@braze/web-sdk 6.12.0 → 6.13.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 +240 -3
- package/package.json +1 -1
- package/shared-lib/event-types.js +18 -18
- package/shared-lib/indexed-db-adapter.js +58 -58
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +25 -24
- package/src/ConversationalChat/automatically-manage-chat.js +5 -0
- package/src/ConversationalChat/chat-message-factory.js +25 -0
- package/src/ConversationalChat/chat-message.js +33 -0
- package/src/ConversationalChat/constants.js +1 -0
- package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
- package/src/ConversationalChat/conversational-chat-provider.js +372 -0
- package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
- package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
- package/src/ConversationalChat/get-chat-messages.js +7 -0
- package/src/ConversationalChat/index.js +12 -0
- package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
- package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
- package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
- package/src/ConversationalChat/register-chat-action-handler.js +10 -0
- package/src/ConversationalChat/reset-chat-conversation.js +5 -0
- package/src/ConversationalChat/retrieve-chat-config.js +7 -0
- package/src/ConversationalChat/send-chat-message.js +17 -0
- package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
- package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
- package/src/ConversationalChat/trigger-chat-action.js +11 -0
- package/src/ConversationalChat/types.js +1 -0
- package/src/Core/add-sdk-metadata.js +5 -5
- package/src/Core/change-user.js +6 -6
- package/src/Core/disable-sdk.js +6 -6
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +20 -13
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +9 -9
- package/src/Core/log-ecommerce-event.js +4 -4
- package/src/Core/log-purchase.js +14 -14
- package/src/Core/open-session.js +8 -8
- package/src/Core/set-sdk-authentication-signature.js +3 -3
- package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
- package/src/Core/wipe-data.js +1 -1
- package/src/DUST/dust-config-store.js +35 -35
- package/src/DUST/dust-message-dedup.js +3 -3
- package/src/DUST/dust-provider-factory.js +10 -10
- package/src/DUST/dust-provider.js +234 -234
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +2 -2
- package/src/FeatureFlags/feature-flag.js +4 -4
- package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
- package/src/FeatureFlags/feature-flags-provider.js +38 -38
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +3 -3
- package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
- package/src/FeatureFlags/refresh-feature-flags.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/display/html-message-display-utils.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +13 -13
- package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/in-app-message-factory.js +6 -6
- package/src/InAppMessage/in-app-message-manager.js +92 -92
- package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-click.js +7 -7
- package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +39 -39
- package/src/InAppMessage/models/html-message.js +20 -20
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +102 -102
- package/src/InAppMessage/models/modal-message.js +38 -38
- package/src/InAppMessage/models/slide-up-message.js +34 -34
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +27 -24
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +15 -15
- package/src/Push/push-manager.js +13 -13
- package/src/Push/register-push.js +2 -2
- package/src/Push/request-push-permission.js +2 -2
- package/src/Push/unregister-push-token-on-server.js +3 -3
- package/src/Push/unregister-push.js +3 -3
- package/src/Push/utils/push-utils.js +15 -15
- package/src/User/user-manager.js +9 -9
- package/src/User/user.js +50 -50
- package/src/common/constants.js +1 -1
- package/src/common/content-cards-display.js +22 -22
- package/src/common/event-logger.js +3 -3
- package/src/index.js +2 -9
- package/src/l10n/l10n-manager-factory.js +4 -4
- package/src/l10n/l10n-manager.js +6 -6
- package/src/managers/auth-manager.js +28 -28
- package/src/managers/braze-action-manager.js +14 -0
- package/src/managers/braze-instance.js +159 -151
- package/src/managers/device-manager.js +26 -26
- package/src/managers/network-manager.js +120 -120
- package/src/managers/server-config-manager.js +95 -86
- package/src/managers/session-manager.js +25 -25
- package/src/managers/storage-manager-factory.js +12 -12
- package/src/managers/storage-manager.js +129 -124
- package/src/managers/subscription-manager.js +8 -8
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +5 -5
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +8 -8
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +27 -27
- package/src/request-controller.js +117 -117
- package/src/standard-index.js +9 -0
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +5 -5
- package/src/triggers/models/filter.js +31 -31
- package/src/triggers/models/in-app-message-click-data.js +9 -9
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +5 -5
- package/src/triggers/models/push-click-data.js +4 -4
- package/src/triggers/models/trigger-condition.js +35 -35
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +5 -5
- package/src/triggers/triggers-provider.js +128 -128
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/chat-widget-css.js +11 -0
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +41 -41
- package/src/util/client-hints-parser.js +10 -10
- package/src/util/component-utils.js +1 -1
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +8 -8
- package/src/util/ecommerce-event-validation.js +13 -13
- package/src/util/html-display-utils.js +6 -6
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +82 -44
- package/src/util/request-header-utils.js +26 -24
- package/src/util/user-agent-parser.js +21 -21
- package/src/util/validation-utils.js +29 -21
- package/src/util/window-utils.js +3 -3
package/src/models/push-token.js
CHANGED
|
@@ -4,21 +4,21 @@ export default class ui {
|
|
|
4
4
|
(this.endpoint = t),
|
|
5
5
|
(this.Uu = i),
|
|
6
6
|
(this.publicKey = s),
|
|
7
|
-
(this.
|
|
8
|
-
(this.
|
|
7
|
+
(this.zd = l),
|
|
8
|
+
(this.Td = h),
|
|
9
9
|
(this.endpoint = t || null),
|
|
10
10
|
(this.Uu = i || null),
|
|
11
11
|
(this.publicKey = s || null),
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
12
|
+
(this.zd = l || null),
|
|
13
|
+
(this.Td = h || null);
|
|
14
14
|
}
|
|
15
15
|
qt() {
|
|
16
16
|
return {
|
|
17
17
|
e: this.endpoint,
|
|
18
18
|
c: this.Uu,
|
|
19
19
|
p: this.publicKey,
|
|
20
|
-
u: this.
|
|
21
|
-
v: this.
|
|
20
|
+
u: this.zd,
|
|
21
|
+
v: this.Td,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
static _u(t) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default class L {
|
|
2
2
|
constructor(t = !1, s = []) {
|
|
3
|
-
(this.lt = t), (this.
|
|
3
|
+
(this.lt = t), (this.Ne = s), (this.lt = t), (this.Ne = s);
|
|
4
4
|
}
|
|
5
5
|
Cs(t) {
|
|
6
|
-
(this.lt = this.lt && t.lt), this.
|
|
6
|
+
(this.lt = this.lt && t.lt), this.Ne.push(...t.Ne);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as
|
|
3
|
-
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as
|
|
2
|
+
GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as bi,
|
|
3
|
+
GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as Vi,
|
|
4
4
|
} from "../common/constants.js";
|
|
5
5
|
export default class vi {
|
|
6
6
|
constructor(
|
|
@@ -12,51 +12,51 @@ export default class vi {
|
|
|
12
12
|
e = null,
|
|
13
13
|
r = { enabled: !1 },
|
|
14
14
|
n = { enabled: !1, refresh_rate_limit: void 0 },
|
|
15
|
-
a = { enabled: !0, capacity:
|
|
15
|
+
a = { enabled: !0, capacity: bi, refill_rate: Vi, endpoint_overrides: {} },
|
|
16
16
|
o = null,
|
|
17
17
|
u = null,
|
|
18
18
|
c = null,
|
|
19
19
|
d = null,
|
|
20
20
|
m = null,
|
|
21
21
|
) {
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
22
|
+
(this.Ed = t),
|
|
23
|
+
(this.Sd = i),
|
|
24
|
+
(this.Fd = s),
|
|
25
|
+
(this.Ld = h),
|
|
26
|
+
(this.kd = l),
|
|
27
|
+
(this.Td = e),
|
|
28
|
+
(this.yd = r),
|
|
29
29
|
(this.Rr = n),
|
|
30
|
-
(this.
|
|
30
|
+
(this.Bd = a),
|
|
31
31
|
(this.banners = o),
|
|
32
32
|
(this.dust = u),
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
33
|
+
(this.xd = c),
|
|
34
|
+
(this.Gd = d),
|
|
35
|
+
(this.Md = m);
|
|
36
36
|
}
|
|
37
37
|
qt() {
|
|
38
38
|
return {
|
|
39
|
-
s: "6.
|
|
40
|
-
l: this.
|
|
41
|
-
e: this.
|
|
42
|
-
a: this.
|
|
43
|
-
p: this.
|
|
44
|
-
m: this.
|
|
45
|
-
v: this.
|
|
46
|
-
c: this.
|
|
39
|
+
s: "6.13.0",
|
|
40
|
+
l: this.Ed,
|
|
41
|
+
e: this.Sd,
|
|
42
|
+
a: this.Fd,
|
|
43
|
+
p: this.Ld,
|
|
44
|
+
m: this.kd,
|
|
45
|
+
v: this.Td,
|
|
46
|
+
c: this.yd,
|
|
47
47
|
f: this.Rr,
|
|
48
|
-
grl: this.
|
|
48
|
+
grl: this.Bd,
|
|
49
49
|
b: this.banners,
|
|
50
50
|
d: this.dust,
|
|
51
|
-
rb: this.
|
|
52
|
-
mst: this.
|
|
53
|
-
ch: this.
|
|
51
|
+
rb: this.xd,
|
|
52
|
+
mst: this.Gd,
|
|
53
|
+
ch: this.Md,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
static _u(t) {
|
|
57
57
|
let i = t.l;
|
|
58
58
|
return (
|
|
59
|
-
"6.
|
|
59
|
+
"6.13.0" !== t.s && (i = 0),
|
|
60
60
|
new vi(
|
|
61
61
|
i,
|
|
62
62
|
t.e,
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
logger as b,
|
|
6
6
|
} from "../shared-lib/index.js";
|
|
7
7
|
import v from "./common/event-logger.js";
|
|
8
|
-
import { removeAllVisibleInAppMessages as
|
|
8
|
+
import { removeAllVisibleInAppMessages as wi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
|
|
9
9
|
import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
|
|
10
10
|
import f from "./managers/subscription-manager.js";
|
|
11
11
|
import ve from "./models/braze-event.js";
|
|
12
12
|
import L from "./models/request-result.js";
|
|
13
|
-
import
|
|
13
|
+
import _t from "./Push/utils/push-utils.js";
|
|
14
14
|
import { randomInclusive as a } from "./util/math.js";
|
|
15
15
|
import l from "./util/net.js";
|
|
16
16
|
import h from "./util/request-header-utils.js";
|
|
17
|
-
export default class
|
|
17
|
+
export default class pi {
|
|
18
18
|
constructor(t, i, s, e, h, o, n, r, l, u) {
|
|
19
19
|
(this.eu = t),
|
|
20
20
|
(this.baseUrl = i),
|
|
@@ -23,50 +23,50 @@ export default class Zt {
|
|
|
23
23
|
(this.Ss = h),
|
|
24
24
|
(this.h = o),
|
|
25
25
|
(this.j = n),
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
26
|
+
(this.Ad = r),
|
|
27
|
+
(this.Cl = l),
|
|
28
28
|
(this.B = u),
|
|
29
29
|
(this.eu = t),
|
|
30
30
|
(this.baseUrl = i),
|
|
31
|
-
(this
|
|
32
|
-
(this.fS = n.
|
|
33
|
-
(this.
|
|
31
|
+
(this.$d = 0),
|
|
32
|
+
(this.fS = n.dS() || 0),
|
|
33
|
+
(this.Id = null),
|
|
34
34
|
(this.C = s),
|
|
35
35
|
(this.tu = e),
|
|
36
36
|
(this.Ss = h),
|
|
37
37
|
(this.h = o),
|
|
38
38
|
(this.j = n),
|
|
39
|
-
(this.
|
|
39
|
+
(this.Cl = l),
|
|
40
40
|
(this.B = u),
|
|
41
|
-
(this.
|
|
42
|
-
(this.
|
|
43
|
-
(this.
|
|
44
|
-
(this.
|
|
45
|
-
(this.
|
|
46
|
-
(this.
|
|
41
|
+
(this.Ad = r),
|
|
42
|
+
(this.Pd = new f()),
|
|
43
|
+
(this.Od = null),
|
|
44
|
+
(this.Ud = 50),
|
|
45
|
+
(this._d = !1),
|
|
46
|
+
(this.Jd = !1);
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
return !t && !i && this.
|
|
48
|
+
Kd(t, i) {
|
|
49
|
+
return !t && !i && this.Cl.bc() >= this.Ud;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
let i = this.C.
|
|
51
|
+
Wd(t) {
|
|
52
|
+
let i = this.C.dm();
|
|
53
53
|
if (t.length > 0) {
|
|
54
54
|
const s = this.Ss.getUserId();
|
|
55
55
|
for (const e of t) {
|
|
56
56
|
const t = (!e.userId && !s) || e.userId === s;
|
|
57
|
-
e.type === p.
|
|
57
|
+
e.type === p.Sm && t && (i = !0);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
i && this.
|
|
64
|
-
const d = this.j.
|
|
65
|
-
m = this.j.
|
|
62
|
+
Xd(t = !1, i = !0, e, o, n, r = !1, u = !1, c = "sdk") {
|
|
63
|
+
i && this.Hd();
|
|
64
|
+
const d = this.j.RS(),
|
|
65
|
+
m = this.j.bS();
|
|
66
66
|
let f = !1;
|
|
67
67
|
const g = (t, r, u = -1) => {
|
|
68
68
|
const c = new Date().valueOf();
|
|
69
|
-
h.nt(this.j, h.it.
|
|
69
|
+
h.nt(this.j, h.it.Jh, c),
|
|
70
70
|
-1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
|
|
71
71
|
let d = !1;
|
|
72
72
|
l.ot({
|
|
@@ -76,18 +76,18 @@ export default class Zt {
|
|
|
76
76
|
lt: (i) => {
|
|
77
77
|
null != t.respond_with &&
|
|
78
78
|
t.respond_with.triggers &&
|
|
79
|
-
(this
|
|
79
|
+
(this.$d = Math.max(this.$d - 1, 0)),
|
|
80
80
|
this.B.ut(t, i, r)
|
|
81
|
-
? (this.
|
|
82
|
-
this.h.
|
|
81
|
+
? (this.Cl.ct(),
|
|
82
|
+
this.h.wd(i),
|
|
83
83
|
(null != t.respond_with &&
|
|
84
84
|
t.respond_with.user_id != this.Ss.getUserId()) ||
|
|
85
|
-
(null != t.device && this.j.Pt(s.It.
|
|
85
|
+
(null != t.device && this.j.Pt(s.It.Mc, t.device),
|
|
86
86
|
null != t.sdk_metadata &&
|
|
87
|
-
(this.j.Pt(s.It.
|
|
88
|
-
this.j.Pt(s.It.
|
|
89
|
-
this.
|
|
90
|
-
h
|
|
87
|
+
(this.j.Pt(s.It.Hl, t.sdk_metadata),
|
|
88
|
+
this.j.Pt(s.It.Yl, this.C.$t())),
|
|
89
|
+
this.Ad(i),
|
|
90
|
+
h.$c(this.j, h.it.Jh, 1),
|
|
91
91
|
"function" == typeof e && e()))
|
|
92
92
|
: i.auth_error && (d = !0);
|
|
93
93
|
},
|
|
@@ -95,13 +95,13 @@ export default class Zt {
|
|
|
95
95
|
(d = !0),
|
|
96
96
|
null != t.respond_with &&
|
|
97
97
|
t.respond_with.triggers &&
|
|
98
|
-
(this
|
|
99
|
-
this.B.
|
|
98
|
+
(this.$d = Math.max(this.$d - 1, 0)),
|
|
99
|
+
this.B.Jl(t.events, t.attributes),
|
|
100
100
|
"function" == typeof o && o();
|
|
101
101
|
},
|
|
102
102
|
ft: (t, s) => {
|
|
103
103
|
"function" == typeof n && n(!d);
|
|
104
|
-
const e = this.B.
|
|
104
|
+
const e = this.B.Hc(s);
|
|
105
105
|
let o = 0;
|
|
106
106
|
if (e)
|
|
107
107
|
switch (e.type) {
|
|
@@ -113,98 +113,98 @@ export default class Zt {
|
|
|
113
113
|
}
|
|
114
114
|
if (i && !f) {
|
|
115
115
|
if (d) {
|
|
116
|
-
h.
|
|
116
|
+
h.Oc(this.j, h.it.Jh);
|
|
117
117
|
const t = this.h.vt(),
|
|
118
118
|
i = this.h.gt(),
|
|
119
119
|
s = this.h.bt();
|
|
120
|
-
let e = this.
|
|
120
|
+
let e = this.Id;
|
|
121
121
|
(null == e || e < t) && (e = t);
|
|
122
122
|
const n = Math.min(s, a(t, e * i)) + o;
|
|
123
|
-
this.
|
|
124
|
-
} else this.
|
|
123
|
+
this.Qd(n);
|
|
124
|
+
} else this.Qd(Math.max(1e3 * this.fS, o));
|
|
125
125
|
f = !0;
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
|
-
p = this.
|
|
130
|
+
p = this.Wd(d),
|
|
131
131
|
v = t || p;
|
|
132
|
-
if (this.
|
|
132
|
+
if (this.Kd(r, p))
|
|
133
133
|
return void b.info(
|
|
134
134
|
"Declining to flush data due to 50 consecutive authentication failures",
|
|
135
135
|
);
|
|
136
|
-
if (i && !this.B.
|
|
137
|
-
return this.
|
|
138
|
-
const w = this.B.
|
|
139
|
-
v && this
|
|
136
|
+
if (i && !this.B.Dc(d, m, v))
|
|
137
|
+
return this.Qd(), void ("function" == typeof n && n(!0));
|
|
138
|
+
const w = this.B.yc(v, d, m, u, c);
|
|
139
|
+
v && this.$d++;
|
|
140
140
|
let k = !1;
|
|
141
141
|
if (w)
|
|
142
142
|
for (const t of w)
|
|
143
143
|
this.B.et(
|
|
144
144
|
t.requestData,
|
|
145
145
|
(i) => g(t.requestData, t.headers, i),
|
|
146
|
-
h.it.
|
|
146
|
+
h.it.Jh,
|
|
147
147
|
o,
|
|
148
148
|
),
|
|
149
149
|
(k = !0);
|
|
150
|
-
this.
|
|
151
|
-
? this.
|
|
150
|
+
this.Cl.hc() && i && !k
|
|
151
|
+
? this.Qd()
|
|
152
152
|
: p &&
|
|
153
153
|
(b.info("Invoking new session subscriptions"),
|
|
154
|
-
this.
|
|
155
|
-
(this.
|
|
154
|
+
this.Pd.A(),
|
|
155
|
+
(this.Jd = !0));
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
return this
|
|
157
|
+
Vd() {
|
|
158
|
+
return this.$d > 0;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
(this.
|
|
163
|
-
(this.
|
|
160
|
+
Qd(t = 1e3 * this.fS) {
|
|
161
|
+
this._d ||
|
|
162
|
+
(this.Hd(),
|
|
163
|
+
(this.Od = window.setTimeout(() => {
|
|
164
164
|
if (document.hidden) {
|
|
165
165
|
const t = "visibilitychange",
|
|
166
166
|
i = () => {
|
|
167
167
|
document.hidden ||
|
|
168
|
-
(document.removeEventListener(t, i, !1), this.
|
|
168
|
+
(document.removeEventListener(t, i, !1), this.Xd());
|
|
169
169
|
};
|
|
170
170
|
document.addEventListener(t, i, !1);
|
|
171
|
-
} else this.
|
|
171
|
+
} else this.Xd();
|
|
172
172
|
}, t)),
|
|
173
|
-
(this.
|
|
173
|
+
(this.Id = t));
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
null != this.
|
|
175
|
+
Hd() {
|
|
176
|
+
null != this.Od && (clearTimeout(this.Od), (this.Od = null));
|
|
177
177
|
}
|
|
178
178
|
initialize() {
|
|
179
|
-
(this.
|
|
179
|
+
(this._d = !1), this.Qd();
|
|
180
180
|
}
|
|
181
181
|
destroy() {
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
184
|
-
this.
|
|
185
|
-
(this.
|
|
186
|
-
this.
|
|
187
|
-
(this.
|
|
188
|
-
(this.
|
|
182
|
+
this.Pd.removeAllSubscriptions(),
|
|
183
|
+
this.Cl.gc(),
|
|
184
|
+
this.Hd(),
|
|
185
|
+
(this._d = !0),
|
|
186
|
+
this.Xd(void 0, !1, void 0, void 0, void 0, void 0, !0),
|
|
187
|
+
(this.Od = null),
|
|
188
|
+
(this.Jd = !1);
|
|
189
189
|
}
|
|
190
190
|
rn(t) {
|
|
191
|
-
const i = this.
|
|
192
|
-
return this.
|
|
191
|
+
const i = this.Pd.Ut(t);
|
|
192
|
+
return this.Jd && t(), i;
|
|
193
193
|
}
|
|
194
194
|
openSession() {
|
|
195
|
-
const t = this.C.$t() !== this.C.
|
|
196
|
-
t && (this.j.hS(s.Ou.
|
|
197
|
-
this.
|
|
198
|
-
t && (this.j.Vt(s.It.
|
|
195
|
+
const t = this.C.$t() !== this.C.ol();
|
|
196
|
+
t && (this.j.hS(s.Ou.Nl), this.j.hS(s.Ou.Cu)),
|
|
197
|
+
this.Xd(!1, void 0, () => {
|
|
198
|
+
t && (this.j.Vt(s.It.do), this.j.Vt(s.It.At));
|
|
199
199
|
}),
|
|
200
|
-
this.
|
|
200
|
+
this.el(),
|
|
201
201
|
t &&
|
|
202
202
|
import("./Push/push-manager-factory.js").then((t) => {
|
|
203
|
-
if (this.
|
|
203
|
+
if (this._d) return;
|
|
204
204
|
const i = t.default.ra();
|
|
205
205
|
if (
|
|
206
206
|
null != i &&
|
|
207
|
-
(
|
|
207
|
+
(_t.isPushPermissionGranted() || _t.isPushBlocked())
|
|
208
208
|
) {
|
|
209
209
|
const t = () => {
|
|
210
210
|
i.lu()
|
|
@@ -225,44 +225,44 @@ export default class Zt {
|
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
|
|
229
|
-
this.j.Vt(s.It.
|
|
228
|
+
Yd() {
|
|
229
|
+
this.j.Vt(s.It.ho), this.j.Vt(s.It.bi), this.j.Vt(s.It.Pa);
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
this.j.Vt(s.It.
|
|
231
|
+
Zd() {
|
|
232
|
+
this.j.Vt(s.It.Uc),
|
|
233
233
|
this.j.Vt(s.It.lS),
|
|
234
|
-
this.j.Vt(s.It.
|
|
235
|
-
this.j.Vt(s.It.
|
|
234
|
+
this.j.Vt(s.It._c),
|
|
235
|
+
this.j.Vt(s.It.Jc);
|
|
236
236
|
}
|
|
237
237
|
changeUser(t, i, e) {
|
|
238
238
|
const h = this.Ss.getUserId();
|
|
239
239
|
if (h !== t) {
|
|
240
|
-
this.C.
|
|
241
|
-
this.
|
|
242
|
-
|
|
243
|
-
null != h && this.
|
|
240
|
+
this.C.jm(),
|
|
241
|
+
this.Yd(),
|
|
242
|
+
wi(),
|
|
243
|
+
null != h && this.Xd(void 0, !1, void 0, void 0, void 0),
|
|
244
244
|
this.Ss.Lu(t),
|
|
245
|
-
e ? this.
|
|
245
|
+
e ? this.Cl.setSdkAuthenticationSignature(e) : this.Cl.cc();
|
|
246
246
|
for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
|
|
247
247
|
this.B.fo(),
|
|
248
248
|
null != h && this.j.Vt(s.It.rS),
|
|
249
|
-
this.j.Vt(s.It.
|
|
249
|
+
this.j.Vt(s.It.Mc),
|
|
250
250
|
this.j.Vt(s.It.uS),
|
|
251
|
-
this.
|
|
251
|
+
this.Zd(),
|
|
252
252
|
this.openSession(),
|
|
253
253
|
b.info('Changed user to "' + t + '".');
|
|
254
254
|
} else {
|
|
255
255
|
let i = "Doing nothing.";
|
|
256
256
|
e &&
|
|
257
|
-
this.
|
|
258
|
-
(this.
|
|
257
|
+
this.Cl.uc() !== e &&
|
|
258
|
+
(this.Cl.setSdkAuthenticationSignature(e),
|
|
259
259
|
(i = "Updated SDK authentication signature")),
|
|
260
260
|
b.info(`Current user is already ${t}. ${i}`);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
requestImmediateDataFlush(t) {
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
264
|
+
this.Hd(), this.C.ol();
|
|
265
|
+
this.Xd(
|
|
266
266
|
void 0,
|
|
267
267
|
void 0,
|
|
268
268
|
void 0,
|
|
@@ -273,13 +273,13 @@ export default class Zt {
|
|
|
273
273
|
!0,
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
this.C.
|
|
276
|
+
Br(t, i, s = "sdk") {
|
|
277
|
+
this.C.ol(),
|
|
278
278
|
b.info("Requesting explicit trigger refresh."),
|
|
279
|
-
this.
|
|
279
|
+
this.Xd(!0, void 0, t, i, void 0, void 0, void 0, s);
|
|
280
280
|
}
|
|
281
281
|
Hu(t, i) {
|
|
282
|
-
const e = p.
|
|
282
|
+
const e = p.vm,
|
|
283
283
|
h = { a: t, l: i },
|
|
284
284
|
o = v.Dt(e, h);
|
|
285
285
|
return (
|
|
@@ -305,38 +305,38 @@ export default class Zt {
|
|
|
305
305
|
null != e && (n.altitude = e),
|
|
306
306
|
null != h && (n.ll_accuracy = h),
|
|
307
307
|
null != o && (n.alt_accuracy = o);
|
|
308
|
-
const r = v.Dt(p.
|
|
308
|
+
const r = v.Dt(p.bm, n, t || void 0);
|
|
309
309
|
return (
|
|
310
310
|
r &&
|
|
311
311
|
b.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
|
|
312
312
|
r
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
|
-
|
|
316
|
-
const s = this.C.
|
|
317
|
-
return new ve(this.Ss.getUserId(), p
|
|
315
|
+
Sr(t, i) {
|
|
316
|
+
const s = this.C.ol();
|
|
317
|
+
return new ve(this.Ss.getUserId(), p.km, t, s, { cid: i });
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
ym(t, i) {
|
|
320
320
|
return new et(t, i);
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
el() {
|
|
323
323
|
const t = et._s.Xs;
|
|
324
|
-
this.
|
|
324
|
+
this.ym(t, b).setItem(t.Ws.Jh, 1, {
|
|
325
325
|
baseUrl: this.baseUrl,
|
|
326
|
-
data: { api_key: this.eu, device_id: this.tu.
|
|
326
|
+
data: { api_key: this.eu, device_id: this.tu.Ye().id },
|
|
327
327
|
userId: this.Ss.getUserId(),
|
|
328
|
-
sdkAuthEnabled: this.
|
|
328
|
+
sdkAuthEnabled: this.Cl.hc(),
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
Er(t) {
|
|
332
332
|
for (const i of t)
|
|
333
|
-
if (i.api_key === this.eu) this.B.
|
|
333
|
+
if (i.api_key === this.eu) this.B.Jl(i.events, i.attributes);
|
|
334
334
|
else {
|
|
335
335
|
const t = et._s.Xs;
|
|
336
|
-
new et(t, b).setItem(t.Ws.
|
|
336
|
+
new et(t, b).setItem(t.Ws.Dr, V.de(), i);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
Va(t, i, s) {
|
|
340
340
|
if (this.h.zu(t))
|
|
341
341
|
return (
|
|
342
342
|
b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
|
|
@@ -344,13 +344,13 @@ export default class Zt {
|
|
|
344
344
|
let e, h;
|
|
345
345
|
return (
|
|
346
346
|
null === i && null === s
|
|
347
|
-
? ((e = p.
|
|
348
|
-
: ((e = p.
|
|
347
|
+
? ((e = p.Am), (h = { key: t }))
|
|
348
|
+
: ((e = p.Dm), (h = { key: t, latitude: i, longitude: s })),
|
|
349
349
|
v.Dt(e, h)
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
Wa(t, i) {
|
|
353
353
|
const s = { group_id: t, status: i };
|
|
354
|
-
return v.Dt(p
|
|
354
|
+
return v.Dt(p.$m, s);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./Card/index.js";
|
|
2
|
+
export * from "./ContentCards/index.js";
|
|
3
|
+
export * from "./Core/index.js";
|
|
4
|
+
export * from "./InAppMessage/index.js";
|
|
5
|
+
export * from "./Push/index.js";
|
|
6
|
+
export * from "./User/index.js";
|
|
7
|
+
export * from "./FeatureFlags/index.js";
|
|
8
|
+
export * from "./Banner/index.js";
|
|
9
|
+
export { WindowUtils } from "./util/window-utils.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default class es {
|
|
2
2
|
constructor(t) {
|
|
3
|
-
(this.
|
|
3
|
+
(this.tf = t), (this.tf = t);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return null == this.
|
|
5
|
+
sf(t) {
|
|
6
|
+
return null == this.tf || this.tf === t[0];
|
|
7
7
|
}
|
|
8
8
|
static fromJson(t) {
|
|
9
9
|
return new es(t ? t.event_name : null);
|
|
10
10
|
}
|
|
11
11
|
qt() {
|
|
12
|
-
return this.
|
|
12
|
+
return this.tf;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import ls from "./filter-set.js";
|
|
2
2
|
export default class ns {
|
|
3
3
|
constructor(t, s) {
|
|
4
|
-
(this.
|
|
4
|
+
(this.tf = t), (this.if = s), (this.tf = t), (this.if = s);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
if (null == this.
|
|
6
|
+
sf(t) {
|
|
7
|
+
if (null == this.tf || null == this.if) return !1;
|
|
8
8
|
const s = t[0],
|
|
9
9
|
i = t[1];
|
|
10
|
-
return s === this.
|
|
10
|
+
return s === this.tf && this.if.sf(i);
|
|
11
11
|
}
|
|
12
12
|
static fromJson(t) {
|
|
13
13
|
return new ns(
|
|
@@ -16,6 +16,6 @@ export default class ns {
|
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
qt() {
|
|
19
|
-
return { e: this.
|
|
19
|
+
return { e: this.tf, pf: this.if ? this.if.qt() : null };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import kr from "./filter.js";
|
|
2
2
|
import { isArray as g } from "../../util/code-utils.js";
|
|
3
3
|
export default class ls {
|
|
4
4
|
constructor(t) {
|
|
5
5
|
(this.filters = t), (this.filters = t);
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
sf(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].sf(t)) {
|
|
14
14
|
s = !0;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
@@ -27,7 +27,7 @@ export default class ls {
|
|
|
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(kr.fromJson(s[t]));
|
|
31
31
|
r.push(o);
|
|
32
32
|
}
|
|
33
33
|
return new ls(r);
|
|
@@ -47,7 +47,7 @@ export default class ls {
|
|
|
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(kr._u(s[t]));
|
|
51
51
|
r.push(o);
|
|
52
52
|
}
|
|
53
53
|
return new ls(r);
|