@braze/web-sdk 5.8.1 → 5.9.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 +14 -9
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +19 -19
- package/shared-lib/guid.js +2 -2
- package/shared-lib/indexed-db-adapter.js +3 -3
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +11 -11
- package/src/Banner/banner-provider.js +22 -19
- package/src/Banner/display/banner-to-html.js +32 -27
- package/src/Banner/get-all-banners.js +11 -5
- package/src/Banner/get-banner.js +6 -3
- package/src/Banner/log-banner-click.js +2 -2
- package/src/Banner/log-banner-impressions.js +4 -4
- package/src/Banner/request-banners-refresh.js +5 -2
- package/src/Banner/subscribe-to-banners-updates.js +2 -2
- package/src/Banner/ui/insert-banner.js +2 -2
- package/src/Card/card-manager.js +9 -9
- package/src/Card/display/card-display.js +5 -5
- package/src/Card/log-card-click.js +2 -2
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-card-impressions.js +2 -2
- package/src/Card/models/captioned-image.js +17 -17
- package/src/Card/models/card.js +58 -58
- package/src/Card/models/classic-card.js +17 -17
- package/src/Card/models/control-card.js +8 -8
- package/src/Card/models/image-only.js +15 -15
- package/src/Card/util/card-factory.js +24 -24
- package/src/ContentCards/content-cards-provider.js +77 -75
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +3 -3
- package/src/Core/change-user.js +1 -1
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/handle-braze-action.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/open-session.js +4 -4
- package/src/Core/request-immediate-data-flush.js +1 -1
- package/src/Core/wipe-data.js +7 -5
- package/src/FeatureFlags/feature-flag-factory.js +4 -4
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +17 -11
- package/src/FeatureFlags/get-all-feature-flags.js +2 -2
- package/src/FeatureFlags/get-feature-flag.js +2 -2
- package/src/FeatureFlags/log-feature-flag-impression.js +1 -1
- package/src/Feed/feed-provider-factory.js +1 -1
- package/src/Feed/feed-provider.js +12 -12
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/request-feed-refresh.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +8 -8
- package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
- 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 +70 -70
- package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/control-message.js +2 -2
- package/src/InAppMessage/models/full-screen-message.js +6 -6
- package/src/InAppMessage/models/html-message.js +7 -7
- package/src/InAppMessage/models/in-app-message-button.js +3 -3
- package/src/InAppMessage/models/in-app-message.js +36 -36
- package/src/InAppMessage/models/modal-message.js +6 -6
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- 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/show-in-app-message.js +13 -13
- package/src/Push/push-manager.js +81 -81
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +10 -10
- package/src/User/user.js +15 -15
- package/src/common/constants.js +2 -0
- package/src/common/event-logger.js +2 -2
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/managers/auth-manager.js +30 -30
- package/src/managers/braze-instance.js +94 -93
- package/src/managers/device-manager.js +14 -14
- package/src/managers/network-manager.js +123 -117
- package/src/managers/server-config-manager.js +91 -79
- package/src/managers/session-manager.js +8 -8
- package/src/managers/storage-manager-factory.js +5 -5
- package/src/managers/storage-manager.js +48 -48
- package/src/managers/subscription-manager.js +4 -4
- package/src/models/backend-errors.js +4 -4
- package/src/models/braze-event.js +9 -9
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +3 -3
- package/src/models/push-token.js +4 -4
- package/src/models/request-result.js +2 -2
- package/src/models/server-config.js +18 -18
- package/src/request-controller.js +86 -85
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +2 -2
- package/src/triggers/models/filter-set.js +4 -4
- package/src/triggers/models/filter.js +6 -6
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +2 -2
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +33 -33
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +12 -12
- package/src/triggers/triggers-provider-factory.js +3 -3
- package/src/triggers/triggers-provider.js +17 -17
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +4 -4
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +1 -1
- package/src/util/component-utils.js +2 -2
- package/src/util/dom-utils.js +3 -3
- package/src/util/html-display-utils.js +14 -14
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +2 -2
- package/src/util/request-header-utils.js +13 -13
- package/src/util/user-agent-parser.js +1 -1
- package/src/util/validation-utils.js +2 -2
- package/src/util/window-utils.js +2 -2
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
2
|
import u from "./subscription-manager.js";
|
|
3
|
-
import { logger as N, IndexedDBAdapter as
|
|
4
|
-
export default class
|
|
3
|
+
import { logger as N, IndexedDBAdapter as st } from "../../shared-lib/index.js";
|
|
4
|
+
export default class qt {
|
|
5
5
|
constructor(t, i, s) {
|
|
6
6
|
(this.C = t),
|
|
7
|
-
(this.
|
|
8
|
-
(this.
|
|
7
|
+
(this.gh = i),
|
|
8
|
+
(this.Fh = s),
|
|
9
9
|
(this.C = t),
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
}
|
|
16
|
-
wh() {
|
|
17
|
-
return this.Zn;
|
|
10
|
+
(this.gh = i || !1),
|
|
11
|
+
(this.Fh = s),
|
|
12
|
+
(this.kh = new u()),
|
|
13
|
+
(this.fh = 0),
|
|
14
|
+
(this.wh = 1);
|
|
18
15
|
}
|
|
19
16
|
jh() {
|
|
20
|
-
return this.
|
|
17
|
+
return this.gh;
|
|
18
|
+
}
|
|
19
|
+
xh() {
|
|
20
|
+
return this.C.ft(s.gt.qh);
|
|
21
21
|
}
|
|
22
22
|
setSdkAuthenticationSignature(t) {
|
|
23
|
-
const i = this.
|
|
24
|
-
this.C.Bt(s.gt.
|
|
25
|
-
const e =
|
|
26
|
-
new
|
|
23
|
+
const i = this.xh();
|
|
24
|
+
this.C.Bt(s.gt.qh, t);
|
|
25
|
+
const e = st.Ls.Fs;
|
|
26
|
+
new st(e, N).setItem(e.Ms.yh, this.wh, t), i !== t && this.it();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
this.C.Ut(s.gt.
|
|
30
|
-
const t =
|
|
31
|
-
new
|
|
28
|
+
Bh() {
|
|
29
|
+
this.C.Ut(s.gt.qh);
|
|
30
|
+
const t = st.Ls.Fs;
|
|
31
|
+
new st(t, N).ge(t.Ms.yh, this.wh);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.
|
|
34
|
+
return this.Fh.Dt(t);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
}
|
|
39
|
-
Gh() {
|
|
40
|
-
this.Fh.removeAllSubscriptions();
|
|
36
|
+
Gh(t) {
|
|
37
|
+
this.Fh.X(t);
|
|
41
38
|
}
|
|
42
39
|
Hh() {
|
|
43
|
-
this.kh
|
|
40
|
+
this.kh.removeAllSubscriptions();
|
|
44
41
|
}
|
|
45
42
|
Jh() {
|
|
46
|
-
|
|
43
|
+
this.fh += 1;
|
|
44
|
+
}
|
|
45
|
+
Kh() {
|
|
46
|
+
return this.fh;
|
|
47
47
|
}
|
|
48
48
|
it() {
|
|
49
|
-
this.
|
|
49
|
+
this.fh = 0;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import qt from "./auth-manager.js";
|
|
2
2
|
import t from "../common/base-provider.js";
|
|
3
3
|
import ro from "../util/browser-detector.js";
|
|
4
4
|
import Ot from "./device-manager.js";
|
|
5
5
|
import DeviceProperties from "../Core/device-properties.js";
|
|
6
6
|
import {
|
|
7
7
|
isArray as z,
|
|
8
|
-
keys as
|
|
8
|
+
keys as C,
|
|
9
9
|
validateValueIsFromEnum as ta,
|
|
10
10
|
values as Rt,
|
|
11
11
|
} from "../util/code-utils.js";
|
|
@@ -17,7 +17,7 @@ import ne, { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
|
17
17
|
import Bt from "./storage-manager-factory.js";
|
|
18
18
|
import u from "./subscription-manager.js";
|
|
19
19
|
import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
|
|
20
|
-
import
|
|
20
|
+
import kt from "../User/user-manager.js";
|
|
21
21
|
import { User } from "../User/index.js";
|
|
22
22
|
import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
|
|
23
23
|
import { WindowUtils as no } from "../util/window-utils.js";
|
|
@@ -30,64 +30,64 @@ const w = {
|
|
|
30
30
|
Wh: "noCookies",
|
|
31
31
|
Vh: "devicePropertyAllowlist",
|
|
32
32
|
Da: "disablePushTokenMaintenance",
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
$h: "enableLogging",
|
|
34
|
+
Yh: "enableSdkAuthentication",
|
|
35
35
|
Ca: "manageServiceWorkerExternally",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
+
Zh: "sessionTimeoutInSeconds",
|
|
38
|
+
Qh: "appVersion",
|
|
39
|
+
Ea: "appVersionNumber",
|
|
40
40
|
_a: "serviceWorkerLocation",
|
|
41
41
|
Ba: "safariWebsitePushId",
|
|
42
|
-
|
|
42
|
+
Zn: "localization",
|
|
43
43
|
er: "contentSecurityNonce",
|
|
44
44
|
re: "allowUserSuppliedJavascript",
|
|
45
|
-
|
|
45
|
+
Go: "inAppMessageZIndex",
|
|
46
46
|
Ko: "openInAppMessagesInNewTab",
|
|
47
47
|
tn: "openCardsInNewTab",
|
|
48
48
|
en: "openNewsFeedCardsInNewTab",
|
|
49
49
|
mh: "requireExplicitInAppMessageDismissal",
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
Ia: "doNotLoadFontAwesome",
|
|
51
|
+
Na: "deviceId",
|
|
52
52
|
Aa: "serviceWorkerScope",
|
|
53
|
-
|
|
53
|
+
Oa: "sdkFlavor",
|
|
54
54
|
};
|
|
55
55
|
class Vt {
|
|
56
56
|
constructor() {
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
59
|
-
(this.
|
|
60
|
-
(this.
|
|
61
|
-
(this.
|
|
57
|
+
(this.an = ""),
|
|
58
|
+
(this.Ta = ""),
|
|
59
|
+
(this.Ra = void 0),
|
|
60
|
+
(this.Pa = null),
|
|
61
|
+
(this.hn = null),
|
|
62
62
|
(this.S = null),
|
|
63
63
|
(this.Fi = null),
|
|
64
64
|
(this.B = null),
|
|
65
65
|
(this.T = null),
|
|
66
66
|
(this.C = null),
|
|
67
67
|
(this.Cs = null),
|
|
68
|
-
(this.
|
|
68
|
+
(this.La = ""),
|
|
69
69
|
(this.isInitialized = !1),
|
|
70
|
-
(this.
|
|
71
|
-
(this.Ua = new u()),
|
|
70
|
+
(this.Ua = !1),
|
|
72
71
|
(this.Wa = new u()),
|
|
72
|
+
(this.Va = new u()),
|
|
73
73
|
(this.options = {}),
|
|
74
|
-
(this.Va = []),
|
|
75
74
|
(this.Fa = []),
|
|
75
|
+
(this.Ka = []),
|
|
76
76
|
(this.Mi = []),
|
|
77
|
-
(this.
|
|
77
|
+
(this.Ta = "5.9.0");
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
this.
|
|
79
|
+
Ga(t) {
|
|
80
|
+
this.Wa.Dt(t);
|
|
81
81
|
}
|
|
82
82
|
Nh(t) {
|
|
83
|
-
this.
|
|
83
|
+
this.Va.Dt(t);
|
|
84
84
|
}
|
|
85
85
|
initialize(t, i) {
|
|
86
|
-
if (this.
|
|
86
|
+
if (this.nn())
|
|
87
87
|
return N.info("Braze has already been initialized with an API key."), !0;
|
|
88
88
|
this.options = i || {};
|
|
89
|
-
let e = this.ee(w
|
|
90
|
-
const r = ll(no
|
|
89
|
+
let e = this.ee(w.$h);
|
|
90
|
+
const r = ll(no.$a());
|
|
91
91
|
if (
|
|
92
92
|
(r && "true" === r.brazeLogging && (e = !0),
|
|
93
93
|
N.init(e),
|
|
@@ -97,7 +97,7 @@ class Vt {
|
|
|
97
97
|
null == t || "" === t || "string" != typeof t)
|
|
98
98
|
)
|
|
99
99
|
return N.error("Braze requires a valid API key to be initialized."), !1;
|
|
100
|
-
this.
|
|
100
|
+
this.an = t;
|
|
101
101
|
let n = this.ee(w.Zo);
|
|
102
102
|
if (null == n || "" === n || "string" != typeof n)
|
|
103
103
|
return N.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
@@ -107,31 +107,31 @@ class Vt {
|
|
|
107
107
|
((n = document.createElement("a")),
|
|
108
108
|
(n.href = o),
|
|
109
109
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
110
|
-
(this.
|
|
111
|
-
ro
|
|
110
|
+
(this.La = n.toString()),
|
|
111
|
+
ro.Ja && !this.ee(w.Yo))
|
|
112
112
|
)
|
|
113
113
|
return (
|
|
114
114
|
N.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
115
|
-
(this.
|
|
115
|
+
(this.Ua = !0),
|
|
116
116
|
!1
|
|
117
117
|
);
|
|
118
118
|
const h = this.ee(w.Wh) || !1;
|
|
119
119
|
if (
|
|
120
|
-
((this.C = Bt.
|
|
120
|
+
((this.C = Bt.Ya(t, h)), h && this.C.Ha(t), new ne.se(null, !0).gr(s.me))
|
|
121
121
|
)
|
|
122
122
|
return (
|
|
123
123
|
N.info("Ignoring all activity due to previous opt out"),
|
|
124
|
-
(this.
|
|
124
|
+
(this.Ua = !0),
|
|
125
125
|
!1
|
|
126
126
|
);
|
|
127
|
-
for (const t of
|
|
127
|
+
for (const t of C(this.options))
|
|
128
128
|
-1 === Rt(zt).indexOf(t) &&
|
|
129
129
|
N.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
130
130
|
const a = ["mparticle", "wordpress", "tealium"];
|
|
131
|
-
if (null != this.ee(w.
|
|
132
|
-
const t = this.ee(w.
|
|
131
|
+
if (null != this.ee(w.Oa)) {
|
|
132
|
+
const t = this.ee(w.Oa);
|
|
133
133
|
-1 !== a.indexOf(t)
|
|
134
|
-
? (this.
|
|
134
|
+
? (this.Ra = t)
|
|
135
135
|
: N.error("Invalid sdk flavor passed: " + t);
|
|
136
136
|
}
|
|
137
137
|
let l = this.ee(zt.Vh);
|
|
@@ -151,117 +151,118 @@ class Vt {
|
|
|
151
151
|
"devicePropertyAllowlist must be an array. Defaulting to all properties.",
|
|
152
152
|
),
|
|
153
153
|
(l = null);
|
|
154
|
-
const c = this.ee(w.
|
|
154
|
+
const c = this.ee(w.Na);
|
|
155
155
|
if (c) {
|
|
156
156
|
const t = new _t(c);
|
|
157
|
-
this.C.uu(s.iu.
|
|
157
|
+
this.C.uu(s.iu.Na, t);
|
|
158
158
|
}
|
|
159
|
-
(this.
|
|
159
|
+
(this.hn = new Ot(this.C, l)),
|
|
160
160
|
(this.B = new Mt(this.C)),
|
|
161
|
-
(this.Cs = new
|
|
162
|
-
(this.T = new Wt(this.C, this.Cs, this.B, this.ee(w.
|
|
161
|
+
(this.Cs = new kt(this.B, this.C)),
|
|
162
|
+
(this.T = new Wt(this.C, this.Cs, this.B, this.ee(w.Zh)));
|
|
163
163
|
const f = new u();
|
|
164
164
|
return (
|
|
165
|
-
(this.
|
|
166
|
-
this.
|
|
165
|
+
(this.Pa = new qt(this.C, this.ee(w.Yh), f)),
|
|
166
|
+
this.F(f),
|
|
167
167
|
(this.S = new Pt(
|
|
168
|
-
this.
|
|
168
|
+
this.hn,
|
|
169
169
|
this.C,
|
|
170
|
-
this.
|
|
170
|
+
this.Pa,
|
|
171
171
|
this.Cs,
|
|
172
172
|
this.T,
|
|
173
173
|
this.B,
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
178
|
-
this.ee(w.Zh),
|
|
174
|
+
this.an,
|
|
175
|
+
this.La,
|
|
176
|
+
this.Ta,
|
|
177
|
+
this.Ra || "",
|
|
179
178
|
this.ee(w.Qh),
|
|
179
|
+
this.ee(w.Ea),
|
|
180
180
|
)),
|
|
181
181
|
(this.Fi = new Lt(
|
|
182
|
-
this.un,
|
|
183
|
-
this.Pa,
|
|
184
|
-
this.T,
|
|
185
182
|
this.an,
|
|
183
|
+
this.La,
|
|
184
|
+
this.T,
|
|
185
|
+
this.hn,
|
|
186
186
|
this.Cs,
|
|
187
187
|
this.B,
|
|
188
188
|
this.C,
|
|
189
189
|
(t) => {
|
|
190
|
-
if (this.
|
|
190
|
+
if (this.nn()) for (const i of this.ar()) i.U(t);
|
|
191
191
|
},
|
|
192
|
-
this.
|
|
192
|
+
this.Pa,
|
|
193
193
|
this.S,
|
|
194
194
|
)),
|
|
195
195
|
this.Fi.initialize(),
|
|
196
|
-
h || this.C.
|
|
196
|
+
h || this.C.Xa(),
|
|
197
197
|
N.info(
|
|
198
198
|
`Initialized for the Braze backend at "${this.ee(
|
|
199
199
|
w.Zo,
|
|
200
|
-
)}" with API key "${this.
|
|
200
|
+
)}" with API key "${this.an}".`,
|
|
201
201
|
),
|
|
202
202
|
ot.p(),
|
|
203
203
|
this.B.Ke(() => {
|
|
204
204
|
var t;
|
|
205
205
|
this.isInitialized &&
|
|
206
|
-
(null === (t = this.B) || void 0 === t ? void 0 : t.
|
|
206
|
+
(null === (t = this.B) || void 0 === t ? void 0 : t.ke()) &&
|
|
207
207
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
208
208
|
if (!this.isInitialized) return;
|
|
209
209
|
(0, t.default)();
|
|
210
210
|
});
|
|
211
211
|
}),
|
|
212
|
-
this.Fi.
|
|
212
|
+
this.Fi.on(() => {
|
|
213
213
|
var t;
|
|
214
214
|
this.isInitialized &&
|
|
215
|
-
(null === (t = this.B) || void 0 === t ? void 0 : t.
|
|
215
|
+
(null === (t = this.B) || void 0 === t ? void 0 : t.ke()) &&
|
|
216
216
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
217
217
|
if (!this.isInitialized) return;
|
|
218
218
|
(0, t.default)(void 0, void 0, !0);
|
|
219
219
|
});
|
|
220
220
|
}),
|
|
221
|
-
this.
|
|
221
|
+
this.Wa.X(this.options),
|
|
222
222
|
(this.isInitialized = !0),
|
|
223
223
|
window.dispatchEvent(new CustomEvent("braze.initialized")),
|
|
224
224
|
!0
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
destroy(t) {
|
|
228
|
-
if ((N.destroy(), this.
|
|
229
|
-
this.
|
|
230
|
-
for (const t of this.
|
|
231
|
-
this.
|
|
232
|
-
for (const t of this.
|
|
233
|
-
|
|
228
|
+
if ((N.destroy(), this.nn())) {
|
|
229
|
+
this.Va.X(), this.Va.removeAllSubscriptions();
|
|
230
|
+
for (const t of this.Fa) t.destroy();
|
|
231
|
+
this.Fa = [];
|
|
232
|
+
for (const t of this.Ka) t.clearData(!1);
|
|
233
|
+
this.S && this.S.fo(),
|
|
234
|
+
(this.Ka = []),
|
|
234
235
|
this.removeAllSubscriptions(),
|
|
235
236
|
(this.Mi = []),
|
|
236
237
|
null != this.Fi && this.Fi.destroy(),
|
|
237
238
|
(this.Fi = null),
|
|
238
|
-
(this.
|
|
239
|
-
(this.
|
|
239
|
+
(this.Pa = null),
|
|
240
|
+
(this.hn = null),
|
|
240
241
|
(this.S = null),
|
|
241
242
|
(this.B = null),
|
|
242
243
|
(this.T = null),
|
|
243
244
|
(this.Cs = null),
|
|
244
245
|
(this.options = {}),
|
|
245
|
-
(this.
|
|
246
|
+
(this.Ra = void 0),
|
|
246
247
|
(this.isInitialized = !1),
|
|
247
|
-
(this.
|
|
248
|
+
(this.Ua = !1),
|
|
248
249
|
t && (this.C = null);
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
rr() {
|
|
252
|
-
return !this.
|
|
253
|
+
return !this.Za() && (!!this.nn() || (console.warn(p), !1));
|
|
253
254
|
}
|
|
254
255
|
Ma() {
|
|
255
|
-
return this.
|
|
256
|
+
return this.an;
|
|
256
257
|
}
|
|
257
258
|
Sr() {
|
|
258
|
-
return this.
|
|
259
|
+
return this.Pa;
|
|
259
260
|
}
|
|
260
261
|
Z() {
|
|
261
|
-
return this.
|
|
262
|
+
return this.La;
|
|
262
263
|
}
|
|
263
264
|
ue() {
|
|
264
|
-
return this.
|
|
265
|
+
return this.hn;
|
|
265
266
|
}
|
|
266
267
|
g() {
|
|
267
268
|
return this.S;
|
|
@@ -270,9 +271,9 @@ class Vt {
|
|
|
270
271
|
return this.options[t];
|
|
271
272
|
}
|
|
272
273
|
ar() {
|
|
273
|
-
return this.
|
|
274
|
+
return this.Ka;
|
|
274
275
|
}
|
|
275
|
-
|
|
276
|
+
rn() {
|
|
276
277
|
return this.Fi;
|
|
277
278
|
}
|
|
278
279
|
v() {
|
|
@@ -295,15 +296,15 @@ class Vt {
|
|
|
295
296
|
}
|
|
296
297
|
h(t) {
|
|
297
298
|
let i = !1;
|
|
298
|
-
for (const s of this.
|
|
299
|
-
i || this.
|
|
299
|
+
for (const s of this.Fa) s === t && (i = !0);
|
|
300
|
+
i || this.Fa.push(t);
|
|
300
301
|
}
|
|
301
302
|
_(i) {
|
|
302
303
|
let s = !1;
|
|
303
|
-
for (const t of this.
|
|
304
|
-
i instanceof t && !s && this.
|
|
304
|
+
for (const t of this.Ka) t.constructor === i.constructor && (s = !0);
|
|
305
|
+
i instanceof t && !s && this.Ka.push(i);
|
|
305
306
|
}
|
|
306
|
-
|
|
307
|
+
F(t) {
|
|
307
308
|
t instanceof u && this.Mi.push(t);
|
|
308
309
|
}
|
|
309
310
|
removeAllSubscriptions() {
|
|
@@ -313,16 +314,16 @@ class Vt {
|
|
|
313
314
|
if (this.rr()) for (const i of this.Mi) i.removeSubscription(t);
|
|
314
315
|
}
|
|
315
316
|
fe(t) {
|
|
316
|
-
this.
|
|
317
|
+
this.Ua = t;
|
|
317
318
|
}
|
|
318
|
-
|
|
319
|
+
nn() {
|
|
319
320
|
return this.isInitialized;
|
|
320
321
|
}
|
|
321
|
-
|
|
322
|
-
return this.
|
|
322
|
+
Za() {
|
|
323
|
+
return this.Ua;
|
|
323
324
|
}
|
|
324
|
-
|
|
325
|
-
return this.
|
|
325
|
+
fi() {
|
|
326
|
+
return this.Ta;
|
|
326
327
|
}
|
|
327
328
|
}
|
|
328
329
|
const r = new Vt();
|
|
@@ -2,7 +2,7 @@ import ro from "../util/browser-detector.js";
|
|
|
2
2
|
import Gt from "../models/device.js";
|
|
3
3
|
import DeviceProperties from "../Core/device-properties.js";
|
|
4
4
|
import _t from "../models/identifier.js";
|
|
5
|
-
import { logger as N, Guid as
|
|
5
|
+
import { logger as N, Guid as K } from "../../shared-lib/index.js";
|
|
6
6
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
7
7
|
import { values as Rt } from "../util/code-utils.js";
|
|
8
8
|
import { getErrorMessage as si } from "../util/error-utils.js";
|
|
@@ -15,8 +15,8 @@ export default class Ot {
|
|
|
15
15
|
(this.Qa = e);
|
|
16
16
|
}
|
|
17
17
|
ve(t = !0) {
|
|
18
|
-
let e = this.C.tu(s.iu.
|
|
19
|
-
null == e && ((e = new _t(
|
|
18
|
+
let e = this.C.tu(s.iu.Na);
|
|
19
|
+
null == e && ((e = new _t(K.ce())), t && this.C.uu(s.iu.Na, e));
|
|
20
20
|
const r = new Gt(e.eu);
|
|
21
21
|
for (let t = 0; t < this.Qa.length; t++) {
|
|
22
22
|
switch (this.Qa[t]) {
|
|
@@ -24,19 +24,19 @@ export default class Ot {
|
|
|
24
24
|
r.browser = ro.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
r.
|
|
27
|
+
r.tc = ro.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
r.os = this.
|
|
30
|
+
r.os = this.ec();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
r.
|
|
33
|
+
r.rc = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
36
|
r.language = ro.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
|
-
r.timeZone = this.
|
|
39
|
+
r.timeZone = this.sc(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
42
|
r.userAgent = ro.userAgent;
|
|
@@ -44,12 +44,12 @@ export default class Ot {
|
|
|
44
44
|
}
|
|
45
45
|
return r;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
if (ro.
|
|
49
|
-
const t = this.C.ft(s.gt.
|
|
50
|
-
return t && t.os_version ? t.os_version : ro.
|
|
47
|
+
ec() {
|
|
48
|
+
if (ro.ic()) return ro.ic();
|
|
49
|
+
const t = this.C.ft(s.gt.oc);
|
|
50
|
+
return t && t.os_version ? t.os_version : ro.ec();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
sc(t) {
|
|
53
53
|
let e = !1;
|
|
54
54
|
if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
|
|
55
55
|
try {
|
|
@@ -66,9 +66,9 @@ export default class Ot {
|
|
|
66
66
|
}
|
|
67
67
|
if (e) return "";
|
|
68
68
|
const r = t.getTimezoneOffset();
|
|
69
|
-
return this.
|
|
69
|
+
return this.nc(r);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
nc(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|