@braze/web-sdk 4.8.0 → 4.8.1
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 +6 -3
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +11 -11
- package/shared-lib/indexed-db-adapter.js +67 -67
- package/shared-lib/logger.js +7 -7
- package/src/Card/card-manager.js +1 -1
- package/src/ContentCards/ui/show-content-cards.js +1 -1
- package/src/Core/disable-sdk.js +5 -4
- package/src/Core/enable-sdk.js +1 -1
- package/src/Core/is-disabled.js +1 -1
- package/src/FeatureFlags/feature-flags-provider.js +12 -12
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +40 -34
- 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 +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +13 -13
- package/src/InAppMessage/models/slide-up-message.js +2 -2
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +2 -2
- package/src/Push/push-manager.js +82 -81
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +4 -4
- package/src/User/user.js +5 -5
- package/src/common/feed-display.js +82 -72
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/managers/auth-manager.js +18 -15
- package/src/managers/braze-instance.js +125 -109
- package/src/managers/device-manager.js +40 -35
- package/src/managers/network-manager.js +90 -81
- package/src/managers/server-config-manager.js +36 -34
- package/src/managers/session-manager.js +44 -37
- package/src/managers/storage-manager-factory.js +23 -16
- package/src/managers/storage-manager.js +251 -239
- package/src/managers/subscription-manager.js +10 -7
- package/src/managers/types.js +1 -0
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +10 -4
- package/src/models/device.js +10 -18
- package/src/models/identifier.js +10 -11
- package/src/models/push-token.js +14 -9
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +32 -16
- package/src/models/types.js +1 -0
- package/src/request-controller.js +109 -109
- package/src/triggers/models/custom-event-data.js +6 -6
- package/src/triggers/models/custom-event-property-data.js +9 -9
- package/src/triggers/models/filter-set.js +9 -9
- package/src/triggers/models/filter.js +60 -60
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- package/src/triggers/models/purchase-data.js +3 -3
- package/src/triggers/models/purchase-property-data.js +7 -7
- package/src/triggers/models/push-click-data.js +6 -6
- package/src/triggers/models/trigger-condition.js +46 -46
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +27 -27
- package/src/triggers/triggers-provider.js +126 -126
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +18 -18
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/device-constants.js +6 -6
- package/src/util/dom-utils.js +5 -5
- package/src/util/error-utils.js +2 -0
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +9 -9
- package/src/util/user-agent-parser.js +21 -21
- package/src/util/window-utils.js +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import sr from "./filter.js";
|
|
2
2
|
import { isArray as p } from "../../util/code-utils.js";
|
|
3
|
-
export default class
|
|
3
|
+
export default class Yt {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
this.filters = t;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
xu(t) {
|
|
8
8
|
let r = !0;
|
|
9
9
|
for (let e = 0; e < this.filters.length; e++) {
|
|
10
10
|
const o = this.filters[e];
|
|
11
11
|
let s = !1;
|
|
12
12
|
for (let r = 0; r < o.length; r++)
|
|
13
|
-
if (o[r].
|
|
13
|
+
if (o[r].xu(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -27,10 +27,10 @@ export default class Qt {
|
|
|
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(sr.fromJson(s[t]));
|
|
31
31
|
r.push(o);
|
|
32
32
|
}
|
|
33
|
-
return new
|
|
33
|
+
return new Yt(r);
|
|
34
34
|
}
|
|
35
35
|
ss() {
|
|
36
36
|
const t = [];
|
|
@@ -42,14 +42,14 @@ export default class Qt {
|
|
|
42
42
|
}
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static zn(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(
|
|
50
|
+
for (let t = 0; t < s.length; t++) o.push(sr.zn(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
|
-
return new
|
|
53
|
+
return new Yt(r);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -5,65 +5,65 @@ 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 sr {
|
|
9
9
|
constructor(t, s, e, i) {
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
10
|
+
(this.Eu = t),
|
|
11
|
+
(this.Tu = s),
|
|
12
12
|
(this.comparator = e),
|
|
13
|
-
(this.
|
|
14
|
-
this.
|
|
15
|
-
this.comparator !==
|
|
16
|
-
this.comparator !==
|
|
17
|
-
this.comparator !==
|
|
18
|
-
this.comparator !==
|
|
19
|
-
(this.
|
|
13
|
+
(this.Au = i),
|
|
14
|
+
this.Tu === sr.yu._u &&
|
|
15
|
+
this.comparator !== sr.Nu.Su &&
|
|
16
|
+
this.comparator !== sr.Nu.Mu &&
|
|
17
|
+
this.comparator !== sr.Nu.Ru &&
|
|
18
|
+
this.comparator !== sr.Nu.Hu &&
|
|
19
|
+
(this.Au = l(this.Au));
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
xu(t) {
|
|
22
22
|
let s = null;
|
|
23
|
-
switch ((null != t && (s = t[this.
|
|
24
|
-
case
|
|
25
|
-
return null != s && s.valueOf() === this.
|
|
26
|
-
case
|
|
27
|
-
return null == s || s.valueOf() !== this.
|
|
28
|
-
case
|
|
29
|
-
return typeof s == typeof this.
|
|
30
|
-
case
|
|
31
|
-
return this.
|
|
32
|
-
? null != s && Nt(s) && ts(s) <= this.
|
|
33
|
-
: typeof s == typeof this.
|
|
34
|
-
case
|
|
35
|
-
return typeof s == typeof this.
|
|
36
|
-
case
|
|
37
|
-
return this.
|
|
38
|
-
? null != s && Nt(s) && ts(s) >= this.
|
|
39
|
-
: typeof s == typeof this.
|
|
40
|
-
case
|
|
23
|
+
switch ((null != t && (s = t[this.Eu]), this.comparator)) {
|
|
24
|
+
case sr.Nu.Lu:
|
|
25
|
+
return null != s && s.valueOf() === this.Au.valueOf();
|
|
26
|
+
case sr.Nu.Iu:
|
|
27
|
+
return null == s || s.valueOf() !== this.Au.valueOf();
|
|
28
|
+
case sr.Nu.Ou:
|
|
29
|
+
return typeof s == typeof this.Au && s > this.Au;
|
|
30
|
+
case sr.Nu.Su:
|
|
31
|
+
return this.Tu === sr.yu._u
|
|
32
|
+
? null != s && Nt(s) && ts(s) <= this.Au
|
|
33
|
+
: typeof s == typeof this.Au && s >= this.Au;
|
|
34
|
+
case sr.Nu.Uu:
|
|
35
|
+
return typeof s == typeof this.Au && s < this.Au;
|
|
36
|
+
case sr.Nu.Mu:
|
|
37
|
+
return this.Tu === sr.yu._u
|
|
38
|
+
? null != s && Nt(s) && ts(s) >= this.Au
|
|
39
|
+
: typeof s == typeof this.Au && s <= this.Au;
|
|
40
|
+
case sr.Nu.Du:
|
|
41
41
|
return (
|
|
42
42
|
null != s &&
|
|
43
43
|
"string" == typeof s &&
|
|
44
|
-
typeof s == typeof this.
|
|
45
|
-
null != s.match(this.
|
|
44
|
+
typeof s == typeof this.Au &&
|
|
45
|
+
null != s.match(this.Au)
|
|
46
46
|
);
|
|
47
|
-
case
|
|
47
|
+
case sr.Nu.Qu:
|
|
48
48
|
return null != s;
|
|
49
|
-
case
|
|
49
|
+
case sr.Nu.Xu:
|
|
50
50
|
return null == s;
|
|
51
|
-
case
|
|
52
|
-
return null != s && Nt(s) && es(s) < this.
|
|
53
|
-
case
|
|
54
|
-
return null != s && Nt(s) && es(s) > this.
|
|
55
|
-
case
|
|
51
|
+
case sr.Nu.Ru:
|
|
52
|
+
return null != s && Nt(s) && es(s) < this.Au;
|
|
53
|
+
case sr.Nu.Hu:
|
|
54
|
+
return null != s && Nt(s) && es(s) > this.Au;
|
|
55
|
+
case sr.Nu.Bu:
|
|
56
56
|
return (
|
|
57
57
|
null == s ||
|
|
58
|
-
typeof s != typeof this.
|
|
58
|
+
typeof s != typeof this.Au ||
|
|
59
59
|
"string" != typeof s ||
|
|
60
|
-
null == s.match(this.
|
|
60
|
+
null == s.match(this.Au)
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
65
|
static fromJson(t) {
|
|
66
|
-
return new
|
|
66
|
+
return new sr(
|
|
67
67
|
t.property_key,
|
|
68
68
|
t.property_type,
|
|
69
69
|
t.comparator,
|
|
@@ -71,28 +71,28 @@ export default class Zt {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
ss() {
|
|
74
|
-
let t = this.
|
|
74
|
+
let t = this.Au;
|
|
75
75
|
return (
|
|
76
|
-
Nt(this.
|
|
77
|
-
{ k: this.
|
|
76
|
+
Nt(this.Au) && (t = h(t.valueOf())),
|
|
77
|
+
{ k: this.Eu, t: this.Tu, c: this.comparator, v: t }
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
static
|
|
81
|
-
return new
|
|
80
|
+
static zn(t) {
|
|
81
|
+
return new sr(t.k, t.t, t.c, t.v);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
(sr.Nu = {
|
|
85
|
+
Lu: 1,
|
|
86
|
+
Iu: 2,
|
|
87
|
+
Ou: 3,
|
|
88
|
+
Su: 4,
|
|
89
|
+
Uu: 5,
|
|
90
|
+
Mu: 6,
|
|
91
|
+
Du: 10,
|
|
92
|
+
Qu: 11,
|
|
93
|
+
Xu: 12,
|
|
94
|
+
Ru: 15,
|
|
95
|
+
Hu: 16,
|
|
96
|
+
Bu: 17
|
|
97
97
|
}),
|
|
98
|
-
(
|
|
98
|
+
(sr.yu = { Gu: "boolean", bu: "number", zu: "string", _u: "date" });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import ri from "./trigger-condition.js";
|
|
2
2
|
export default class si {
|
|
3
3
|
constructor(t, i) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.ku = t), (this.Ju = i);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
8
|
-
const i = ri.
|
|
6
|
+
xu(t) {
|
|
7
|
+
if (null == this.ku) return !1;
|
|
8
|
+
const i = ri.qu(t[0], this.ku);
|
|
9
9
|
if (!i) return !1;
|
|
10
|
-
let r = null == this.
|
|
11
|
-
if (null != this.
|
|
12
|
-
for (let i = 0; i < this.
|
|
13
|
-
if (this.
|
|
10
|
+
let r = null == this.Ju || 0 === this.Ju.length;
|
|
11
|
+
if (null != this.Ju)
|
|
12
|
+
for (let i = 0; i < this.Ju.length; i++)
|
|
13
|
+
if (this.Ju[i] === t[1]) {
|
|
14
14
|
r = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -20,6 +20,6 @@ export default class si {
|
|
|
20
20
|
return new si(t ? t.id : null, t ? t.buttons : null);
|
|
21
21
|
}
|
|
22
22
|
ss() {
|
|
23
|
-
return this.
|
|
23
|
+
return this.ku;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default class
|
|
1
|
+
export default class lr {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
this.productId = t;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
xu(t) {
|
|
6
6
|
return null == this.productId || t[0] === this.productId;
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
|
-
return new
|
|
9
|
+
return new lr(t ? t.product_id : null);
|
|
10
10
|
}
|
|
11
11
|
ss() {
|
|
12
12
|
return this.productId;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Yt from "./filter-set.js";
|
|
2
2
|
export default class is {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.productId = t), (this.
|
|
4
|
+
(this.productId = t), (this.ju = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.productId || null == this.
|
|
6
|
+
xu(t) {
|
|
7
|
+
if (null == this.productId || null == this.ju) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.productId && this.
|
|
10
|
+
return s === this.productId && this.ju.xu(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new is(
|
|
14
14
|
t ? t.product_id : null,
|
|
15
|
-
t ?
|
|
15
|
+
t ? Yt.fromJson(t.property_filters) : null
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
ss() {
|
|
19
|
-
return { id: this.productId, pf: this.
|
|
19
|
+
return { id: this.productId, pf: this.ju.ss() };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ri from "./trigger-condition.js";
|
|
2
|
-
export default class
|
|
2
|
+
export default class ur {
|
|
3
3
|
constructor(t) {
|
|
4
|
-
this.
|
|
4
|
+
this.ku = t;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
return null == this.
|
|
6
|
+
xu(t) {
|
|
7
|
+
return null == this.ku || ri.qu(t[0], this.ku);
|
|
8
8
|
}
|
|
9
9
|
static fromJson(t) {
|
|
10
|
-
return new
|
|
10
|
+
return new ur(t ? t.campaign_id : null);
|
|
11
11
|
}
|
|
12
12
|
ss() {
|
|
13
|
-
return this.
|
|
13
|
+
return this.ku;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import Qt from "./custom-event-data.js";
|
|
2
|
+
import Zt from "./custom-event-property-data.js";
|
|
3
|
+
import Yt from "./filter-set.js";
|
|
4
4
|
import si from "./in-app-message-click-data.js";
|
|
5
|
-
import
|
|
5
|
+
import lr from "./purchase-data.js";
|
|
6
6
|
import is from "./purchase-property-data.js";
|
|
7
|
-
import
|
|
7
|
+
import ur 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
|
export default class ri {
|
|
@@ -12,9 +12,9 @@ export default class ri {
|
|
|
12
12
|
(this.type = e), (this.data = t);
|
|
13
13
|
}
|
|
14
14
|
ec(e, t) {
|
|
15
|
-
return ri.
|
|
15
|
+
return ri.rc[this.type] === e && (null == this.data || this.data.xu(t));
|
|
16
16
|
}
|
|
17
|
-
static
|
|
17
|
+
static qu(e, t) {
|
|
18
18
|
let a = null;
|
|
19
19
|
try {
|
|
20
20
|
a = window.atob(e);
|
|
@@ -29,28 +29,28 @@ export default class ri {
|
|
|
29
29
|
const t = e.type;
|
|
30
30
|
let r;
|
|
31
31
|
switch (t) {
|
|
32
|
-
case ri.
|
|
32
|
+
case ri.ac.OPEN:
|
|
33
33
|
r = null;
|
|
34
34
|
break;
|
|
35
|
-
case ri.
|
|
36
|
-
r =
|
|
35
|
+
case ri.ac.Rr:
|
|
36
|
+
r = lr.fromJson(e.data);
|
|
37
37
|
break;
|
|
38
|
-
case ri.
|
|
38
|
+
case ri.ac.sc:
|
|
39
39
|
r = is.fromJson(e.data);
|
|
40
40
|
break;
|
|
41
|
-
case ri.
|
|
42
|
-
r =
|
|
41
|
+
case ri.ac.zr:
|
|
42
|
+
r = ur.fromJson(e.data);
|
|
43
43
|
break;
|
|
44
|
-
case ri.
|
|
45
|
-
r =
|
|
44
|
+
case ri.ac.be:
|
|
45
|
+
r = Qt.fromJson(e.data);
|
|
46
46
|
break;
|
|
47
|
-
case ri.
|
|
48
|
-
r =
|
|
47
|
+
case ri.ac.cc:
|
|
48
|
+
r = Zt.fromJson(e.data);
|
|
49
49
|
break;
|
|
50
|
-
case ri.
|
|
50
|
+
case ri.ac.Lr:
|
|
51
51
|
r = si.fromJson(e.data);
|
|
52
52
|
break;
|
|
53
|
-
case ri.
|
|
53
|
+
case ri.ac.ks:
|
|
54
54
|
r = null;
|
|
55
55
|
}
|
|
56
56
|
return new ri(t, r);
|
|
@@ -58,52 +58,52 @@ export default class ri {
|
|
|
58
58
|
ss() {
|
|
59
59
|
return { t: this.type, d: this.data ? this.data.ss() : null };
|
|
60
60
|
}
|
|
61
|
-
static
|
|
61
|
+
static zn(e) {
|
|
62
62
|
let t, r;
|
|
63
63
|
switch (e.t) {
|
|
64
|
-
case ri.
|
|
64
|
+
case ri.ac.OPEN:
|
|
65
65
|
t = null;
|
|
66
66
|
break;
|
|
67
|
-
case ri.
|
|
68
|
-
t = new
|
|
67
|
+
case ri.ac.Rr:
|
|
68
|
+
t = new lr(e.d);
|
|
69
69
|
break;
|
|
70
|
-
case ri.
|
|
71
|
-
(r = e.d || {}), (t = new is(r.id,
|
|
70
|
+
case ri.ac.sc:
|
|
71
|
+
(r = e.d || {}), (t = new is(r.id, Yt.zn(r.pf || [])));
|
|
72
72
|
break;
|
|
73
|
-
case ri.
|
|
74
|
-
t = new
|
|
73
|
+
case ri.ac.zr:
|
|
74
|
+
t = new ur(e.d);
|
|
75
75
|
break;
|
|
76
|
-
case ri.
|
|
77
|
-
t = new
|
|
76
|
+
case ri.ac.be:
|
|
77
|
+
t = new Qt(e.d);
|
|
78
78
|
break;
|
|
79
|
-
case ri.
|
|
80
|
-
(r = e.d || {}), (t = new
|
|
79
|
+
case ri.ac.cc:
|
|
80
|
+
(r = e.d || {}), (t = new Zt(r.e, Yt.zn(r.pf || [])));
|
|
81
81
|
break;
|
|
82
|
-
case ri.
|
|
82
|
+
case ri.ac.Lr:
|
|
83
83
|
t = new si(e.d);
|
|
84
84
|
break;
|
|
85
|
-
case ri.
|
|
85
|
+
case ri.ac.ks:
|
|
86
86
|
t = null;
|
|
87
87
|
}
|
|
88
88
|
return new ri(e.t, t);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
(ri.
|
|
91
|
+
(ri.ac = {
|
|
92
92
|
OPEN: "open",
|
|
93
93
|
Rr: "purchase",
|
|
94
|
-
|
|
94
|
+
sc: "purchase_property",
|
|
95
95
|
zr: "push_click",
|
|
96
96
|
be: "custom_event",
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
cc: "custom_event_property",
|
|
98
|
+
Lr: "iam_click",
|
|
99
99
|
ks: "test"
|
|
100
100
|
}),
|
|
101
|
-
(ri.
|
|
102
|
-
(ri.
|
|
103
|
-
(ri.
|
|
104
|
-
(ri.
|
|
105
|
-
(ri.
|
|
106
|
-
(ri.
|
|
107
|
-
(ri.
|
|
108
|
-
(ri.
|
|
109
|
-
(ri.
|
|
101
|
+
(ri.rc = {}),
|
|
102
|
+
(ri.rc[ri.ac.OPEN] = tt.OPEN),
|
|
103
|
+
(ri.rc[ri.ac.Rr] = tt.Rr),
|
|
104
|
+
(ri.rc[ri.ac.sc] = tt.Rr),
|
|
105
|
+
(ri.rc[ri.ac.zr] = tt.zr),
|
|
106
|
+
(ri.rc[ri.ac.be] = tt.be),
|
|
107
|
+
(ri.rc[ri.ac.cc] = tt.be),
|
|
108
|
+
(ri.rc[ri.ac.Lr] = tt.Lr),
|
|
109
|
+
(ri.rc[ri.ac.ks] = tt.ks);
|
|
@@ -8,41 +8,41 @@ import { validateValueIsFromEnum as H } from "../../util/code-utils.js";
|
|
|
8
8
|
export default class mt {
|
|
9
9
|
constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
|
|
10
10
|
(this.id = t),
|
|
11
|
-
(this.
|
|
11
|
+
(this.Pu = i || []),
|
|
12
12
|
void 0 === s && (s = null),
|
|
13
13
|
(this.startTime = s),
|
|
14
14
|
void 0 === e && (e = null),
|
|
15
15
|
(this.endTime = e),
|
|
16
16
|
(this.priority = r || 0),
|
|
17
17
|
(this.type = l),
|
|
18
|
-
(this.
|
|
19
|
-
null == a && (a = 1e3 * (this.
|
|
20
|
-
(this.
|
|
18
|
+
(this.vu = n || 0),
|
|
19
|
+
null == a && (a = 1e3 * (this.vu + 30)),
|
|
20
|
+
(this.Kr = a),
|
|
21
21
|
(this.data = o),
|
|
22
|
-
null == h && (h = mt
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this
|
|
22
|
+
null == h && (h = mt.$u),
|
|
23
|
+
(this.Cu = h),
|
|
24
|
+
(this.Fu = u),
|
|
25
|
+
(this.Vu = d || null);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
Ku(t) {
|
|
28
28
|
return (
|
|
29
|
-
null == this
|
|
29
|
+
null == this.Vu || (this.Cu !== mt.$u && t - this.Vu >= 1e3 * this.Cu)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
this
|
|
32
|
+
Wu(t) {
|
|
33
|
+
this.Vu = t;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
const i = t + 1e3 * this.
|
|
35
|
+
Yu(t) {
|
|
36
|
+
const i = t + 1e3 * this.vu;
|
|
37
37
|
return Math.max(i - new Date().valueOf(), 0);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
Zu(t) {
|
|
40
40
|
const i = new Date().valueOf() - t,
|
|
41
|
-
s = null == t || isNaN(i) || null == this.
|
|
41
|
+
s = null == t || isNaN(i) || null == this.Kr || i < this.Kr;
|
|
42
42
|
return (
|
|
43
43
|
s ||
|
|
44
44
|
r.j.info(
|
|
45
|
-
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.
|
|
45
|
+
`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Kr}ms.`
|
|
46
46
|
),
|
|
47
47
|
!s
|
|
48
48
|
);
|
|
@@ -62,7 +62,7 @@ export default class mt {
|
|
|
62
62
|
d = t.data,
|
|
63
63
|
m = t.min_seconds_since_last_trigger;
|
|
64
64
|
return H(
|
|
65
|
-
mt.
|
|
65
|
+
mt.Gr,
|
|
66
66
|
n,
|
|
67
67
|
"Could not construct Trigger from server data",
|
|
68
68
|
"Trigger.Types"
|
|
@@ -72,7 +72,7 @@ export default class mt {
|
|
|
72
72
|
}
|
|
73
73
|
ss() {
|
|
74
74
|
const t = [];
|
|
75
|
-
for (let i = 0; i < this.
|
|
75
|
+
for (let i = 0; i < this.Pu.length; i++) t.push(this.Pu[i].ss());
|
|
76
76
|
return {
|
|
77
77
|
i: this.id,
|
|
78
78
|
c: t,
|
|
@@ -81,16 +81,16 @@ export default class mt {
|
|
|
81
81
|
p: this.priority,
|
|
82
82
|
t: this.type,
|
|
83
83
|
da: this.data,
|
|
84
|
-
d: this.
|
|
85
|
-
r: this.
|
|
86
|
-
tm: this.
|
|
87
|
-
ss: this.
|
|
88
|
-
ld: this
|
|
84
|
+
d: this.vu,
|
|
85
|
+
r: this.Cu,
|
|
86
|
+
tm: this.Kr,
|
|
87
|
+
ss: this.Fu,
|
|
88
|
+
ld: this.Vu
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
static
|
|
91
|
+
static zn(t) {
|
|
92
92
|
const i = [];
|
|
93
|
-
for (let s = 0; s < t.c.length; s++) i.push(ri.
|
|
93
|
+
for (let s = 0; s < t.c.length; s++) i.push(ri.zn(t.c[s]));
|
|
94
94
|
return new mt(
|
|
95
95
|
t.i,
|
|
96
96
|
i,
|
|
@@ -107,4 +107,4 @@ export default class mt {
|
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
(mt
|
|
110
|
+
(mt.$u = -1), (mt.Gr = { _r: "inapp", td: "templated_iam" });
|