@braze/web-sdk 5.3.2 → 5.4.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 +20 -4
- package/package.json +1 -1
- package/shared-lib/event-types.js +7 -7
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +9 -8
- package/src/Card/display/card-display.js +59 -58
- package/src/Core/index.js +1 -0
- package/src/Core/is-initialized.js +4 -0
- package/src/InAppMessage/display/in-app-message-to-html.js +64 -62
- package/src/InAppMessage/ui/show-in-app-message.js +42 -40
- package/src/Push/push-manager-factory.js +2 -1
- package/src/Push/push-manager.js +73 -85
- package/src/Push/utils/push-utils.js +3 -3
- package/src/User/user-manager.js +2 -2
- package/src/User/user.js +4 -4
- package/src/common/event-logger.js +4 -4
- package/src/common/feed-display.js +17 -16
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +15 -5
- package/src/managers/braze-instance.js +53 -51
- package/src/managers/device-manager.js +17 -17
- package/src/managers/network-manager.js +89 -89
- package/src/managers/server-config-manager.js +4 -4
- package/src/managers/session-manager.js +4 -4
- package/src/managers/storage-manager-factory.js +1 -1
- package/src/managers/storage-manager.js +17 -17
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +3 -3
- package/src/models/device.js +1 -1
- package/src/models/server-config.js +2 -2
- package/src/request-controller.js +74 -74
- package/src/triggers/models/filter.js +3 -3
- package/src/triggers/models/in-app-message-click-data.js +8 -8
- package/src/triggers/models/push-click-data.js +3 -3
- package/src/triggers/models/trigger-condition.js +1 -1
- package/src/triggers/triggers-provider.js +3 -3
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/util/base-device-parser.js +7 -7
- package/src/util/browser-detector.js +21 -21
- package/src/util/client-hints-parser.js +3 -3
- package/src/util/component-utils.js +13 -12
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +7 -7
- package/src/util/user-agent-parser.js +3 -3
- package/src/util/window-utils.js +1 -1
|
@@ -12,7 +12,7 @@ import { Card, ControlCard } from "../Card/index.js";
|
|
|
12
12
|
import { cardToHtml as _e } from "../Card/display/card-display.js";
|
|
13
13
|
import { isArray as j } from "../util/code-utils.js";
|
|
14
14
|
import { KeyCodes as mt } from "../util/key-codes.js";
|
|
15
|
-
import
|
|
15
|
+
import ue from "../l10n/l10n-manager-factory.js";
|
|
16
16
|
import { removeSubscription } from "../Core/remove-subscription.js";
|
|
17
17
|
import { logger as r, Guid as p } from "../../shared-lib/index.js";
|
|
18
18
|
import { BRAZE_ACTION_URI_REGEX as Z } from "../util/validation-utils.js";
|
|
@@ -41,11 +41,12 @@ export function destroyFeedHtml(e) {
|
|
|
41
41
|
delete scrollListeners[o]);
|
|
42
42
|
}
|
|
43
43
|
export function generateFeedBody(e, t) {
|
|
44
|
-
const o =
|
|
44
|
+
const o = ue.m(),
|
|
45
|
+
s = document.createElement("div");
|
|
45
46
|
if (
|
|
46
|
-
((
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
((s.className = "ab-feed-body"),
|
|
48
|
+
s.setAttribute("aria-label", "Feed"),
|
|
49
|
+
s.setAttribute("role", "feed"),
|
|
49
50
|
null == e.lastUpdated)
|
|
50
51
|
) {
|
|
51
52
|
const e = document.createElement("div");
|
|
@@ -53,27 +54,27 @@ export function generateFeedBody(e, t) {
|
|
|
53
54
|
const t = document.createElement("i");
|
|
54
55
|
(t.className = "fa fa-spinner fa-spin fa-4x ab-initial-spinner"),
|
|
55
56
|
e.appendChild(t),
|
|
56
|
-
|
|
57
|
+
s.appendChild(e);
|
|
57
58
|
} else {
|
|
58
|
-
let
|
|
59
|
+
let n = !1;
|
|
59
60
|
const logCardClick = (t) => e.logCardClick(t);
|
|
60
|
-
for (const
|
|
61
|
-
const
|
|
62
|
-
!
|
|
63
|
-
? (
|
|
61
|
+
for (const i of e.cards) {
|
|
62
|
+
const a = i instanceof ControlCard;
|
|
63
|
+
!a || e.dr()
|
|
64
|
+
? (s.appendChild(_e(i, logCardClick, t, o.wo())), (n = n || !a))
|
|
64
65
|
: r.error(
|
|
65
66
|
"Received a control card for a legacy news feed. Control cards are only supported with content cards.",
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
|
-
if (!
|
|
69
|
+
if (!n) {
|
|
69
70
|
const e = document.createElement("div");
|
|
70
71
|
(e.className = "ab-no-cards-message"),
|
|
71
|
-
(e.innerHTML =
|
|
72
|
+
(e.innerHTML = o.get("NO_CARDS_MESSAGE") || ""),
|
|
72
73
|
e.setAttribute("role", "article"),
|
|
73
|
-
|
|
74
|
+
s.appendChild(e);
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
return
|
|
77
|
+
return s;
|
|
77
78
|
}
|
|
78
79
|
export function detectFeedImpressions(e, t) {
|
|
79
80
|
if (null != e && null != t) {
|
|
@@ -123,7 +124,7 @@ export function refreshFeed(e, t) {
|
|
|
123
124
|
const o = t.querySelectorAll(".ab-initial-spinner")[0];
|
|
124
125
|
if (null != o) {
|
|
125
126
|
const e = document.createElement("span");
|
|
126
|
-
(e.innerHTML =
|
|
127
|
+
(e.innerHTML = ue.m().get("FEED_TIMEOUT_MESSAGE") || ""),
|
|
127
128
|
null != o.parentNode &&
|
|
128
129
|
(o.parentNode.appendChild(e), o.parentNode.removeChild(o));
|
|
129
130
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e, { OPTIONS as L } from "../managers/braze-instance.js";
|
|
2
2
|
import X from "../util/browser-detector.js";
|
|
3
3
|
import nr from "./l10n-manager.js";
|
|
4
|
-
const
|
|
4
|
+
const ue = {
|
|
5
5
|
t: !1,
|
|
6
6
|
i: null,
|
|
7
7
|
m: () => {
|
|
8
|
-
if ((
|
|
8
|
+
if ((ue.o(), !ue.i)) {
|
|
9
9
|
let r = X.language,
|
|
10
10
|
t = !1;
|
|
11
|
-
e.nn(L.zn) && ((r = e.nn(L.zn)), (t = !0)), (
|
|
11
|
+
e.nn(L.zn) && ((r = e.nn(L.zn)), (t = !0)), (ue.i = new nr(r, t));
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return ue.i;
|
|
14
14
|
},
|
|
15
15
|
o: () => {
|
|
16
|
-
|
|
16
|
+
ue.t || (e.g(ue), (ue.t = !0));
|
|
17
17
|
},
|
|
18
18
|
destroy: () => {
|
|
19
|
-
(
|
|
19
|
+
(ue.i = null), (ue.t = !1);
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
export default
|
|
22
|
+
export default ue;
|
package/src/l10n/l10n-manager.js
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import { logger as r } from "../../shared-lib/index.js";
|
|
2
2
|
import xt from "../common/translations.js";
|
|
3
3
|
export default class nr {
|
|
4
|
-
constructor(t,
|
|
4
|
+
constructor(t, e = !1) {
|
|
5
5
|
if (
|
|
6
6
|
((this.language = t),
|
|
7
7
|
null != t && (t = t.toLowerCase()),
|
|
8
8
|
null != t && null == xt[t])
|
|
9
9
|
) {
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const e = t.indexOf("-");
|
|
11
|
+
e > 0 && (t = t.substring(0, e));
|
|
12
12
|
}
|
|
13
13
|
if (null == xt[t]) {
|
|
14
|
-
const
|
|
14
|
+
const a =
|
|
15
15
|
"Braze does not yet have a localization for language " +
|
|
16
16
|
t +
|
|
17
17
|
", defaulting to English. Please contact us if you are willing and able to help us translate our SDK into this language.";
|
|
18
|
-
|
|
18
|
+
e ? r.error(a) : r.info(a), (t = "en");
|
|
19
19
|
}
|
|
20
20
|
this.language = t;
|
|
21
21
|
}
|
|
22
22
|
get(t) {
|
|
23
23
|
return xt[this.language][t];
|
|
24
24
|
}
|
|
25
|
+
wo() {
|
|
26
|
+
switch (this.language) {
|
|
27
|
+
case "ar":
|
|
28
|
+
case "he":
|
|
29
|
+
case "fa":
|
|
30
|
+
return "rtl";
|
|
31
|
+
default:
|
|
32
|
+
return "ltr";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
}
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
isArray as j,
|
|
8
8
|
keys as to,
|
|
9
9
|
validateValueIsFromEnum as J,
|
|
10
|
-
values as
|
|
10
|
+
values as Rt,
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
|
-
import
|
|
12
|
+
import Pt from "./network-manager.js";
|
|
13
13
|
import Lt from "../request-controller.js";
|
|
14
14
|
import Dt from "./server-config-manager.js";
|
|
15
15
|
import Mt from "./session-manager.js";
|
|
@@ -22,23 +22,23 @@ import { User } from "../User/index.js";
|
|
|
22
22
|
import { parseQueryStringKeyValues as ut } from "../util/url-utils.js";
|
|
23
23
|
import { WindowUtils as eo } from "../util/window-utils.js";
|
|
24
24
|
import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../common/constants.js";
|
|
25
|
-
import { SupportedOptions as
|
|
25
|
+
import { SupportedOptions as zt, logger as r } from "../../shared-lib/index.js";
|
|
26
26
|
import _t from "../models/identifier.js";
|
|
27
27
|
const L = {
|
|
28
28
|
Eo: "allowCrawlerActivity",
|
|
29
29
|
_o: "baseUrl",
|
|
30
30
|
Io: "noCookies",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
So: "devicePropertyAllowlist",
|
|
32
|
+
ka: "disablePushTokenMaintenance",
|
|
33
|
+
Ao: "enableLogging",
|
|
34
34
|
No: "enableSdkAuthentication",
|
|
35
|
-
|
|
35
|
+
_a: "manageServiceWorkerExternally",
|
|
36
36
|
Oo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
Ro: "sessionTimeoutInSeconds",
|
|
38
|
+
Po: "appVersion",
|
|
39
39
|
Lo: "appVersionNumber",
|
|
40
40
|
wa: "serviceWorkerLocation",
|
|
41
|
-
|
|
41
|
+
Ma: "safariWebsitePushId",
|
|
42
42
|
zn: "localization",
|
|
43
43
|
bo: "contentSecurityNonce",
|
|
44
44
|
Do: "allowUserSuppliedJavascript",
|
|
@@ -49,14 +49,15 @@ const L = {
|
|
|
49
49
|
Lh: "requireExplicitInAppMessageDismissal",
|
|
50
50
|
Mo: "doNotLoadFontAwesome",
|
|
51
51
|
Uo: "deviceId",
|
|
52
|
-
|
|
52
|
+
ya: "serviceWorkerScope",
|
|
53
|
+
Wo: "sdkFlavor",
|
|
53
54
|
};
|
|
54
|
-
class
|
|
55
|
+
class Vt {
|
|
55
56
|
constructor() {
|
|
56
57
|
(this.rn = ""),
|
|
57
|
-
(this.
|
|
58
|
+
(this.Bo = ""),
|
|
58
59
|
(this.Vo = void 0),
|
|
59
|
-
(this.
|
|
60
|
+
(this.Ko = null),
|
|
60
61
|
(this.on = null),
|
|
61
62
|
(this.qt = null),
|
|
62
63
|
(this.zi = null),
|
|
@@ -65,7 +66,7 @@ class zt {
|
|
|
65
66
|
(this.u = null),
|
|
66
67
|
(this.wt = null),
|
|
67
68
|
(this.Go = ""),
|
|
68
|
-
(this.
|
|
69
|
+
(this.isInitialized = !1),
|
|
69
70
|
(this.$o = !1),
|
|
70
71
|
(this.qo = new T()),
|
|
71
72
|
(this.Jo = new T()),
|
|
@@ -73,7 +74,7 @@ class zt {
|
|
|
73
74
|
(this.Yo = []),
|
|
74
75
|
(this.Ho = []),
|
|
75
76
|
(this._e = []),
|
|
76
|
-
(this.
|
|
77
|
+
(this.Bo = "5.4.0");
|
|
77
78
|
}
|
|
78
79
|
Xo(t) {
|
|
79
80
|
this.qo.It(t);
|
|
@@ -85,8 +86,8 @@ class zt {
|
|
|
85
86
|
if (this.so())
|
|
86
87
|
return r.info("Braze has already been initialized with an API key."), !0;
|
|
87
88
|
this.options = i || {};
|
|
88
|
-
let s = this.nn(L.
|
|
89
|
-
const e = ut(eo.
|
|
89
|
+
let s = this.nn(L.Ao);
|
|
90
|
+
const e = ut(eo.Zo());
|
|
90
91
|
if (
|
|
91
92
|
(e && "true" === e.brazeLogging && (s = !0),
|
|
92
93
|
r.init(s),
|
|
@@ -107,7 +108,7 @@ class zt {
|
|
|
107
108
|
(n.href = h),
|
|
108
109
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
109
110
|
(this.Go = n.toString()),
|
|
110
|
-
X.
|
|
111
|
+
X.Qo && !this.nn(L.Eo))
|
|
111
112
|
)
|
|
112
113
|
return (
|
|
113
114
|
r.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
@@ -116,7 +117,7 @@ class zt {
|
|
|
116
117
|
);
|
|
117
118
|
const a = this.nn(L.Io) || !1;
|
|
118
119
|
if (
|
|
119
|
-
((this.u = Wt.
|
|
120
|
+
((this.u = Wt.Wh(t, a)), a && this.u.Vh(t), new Q.ee(null, !0).br(o.se))
|
|
120
121
|
)
|
|
121
122
|
return (
|
|
122
123
|
r.info("Ignoring all activity due to previous opt out"),
|
|
@@ -124,16 +125,16 @@ class zt {
|
|
|
124
125
|
!1
|
|
125
126
|
);
|
|
126
127
|
for (const t of to(this.options))
|
|
127
|
-
-1 ===
|
|
128
|
+
-1 === Rt(zt).indexOf(t) &&
|
|
128
129
|
r.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
129
130
|
const l = ["mparticle", "wordpress", "tealium"];
|
|
130
|
-
if (null != this.nn(L.
|
|
131
|
-
const t = this.nn(L.
|
|
131
|
+
if (null != this.nn(L.Wo)) {
|
|
132
|
+
const t = this.nn(L.Wo);
|
|
132
133
|
-1 !== l.indexOf(t)
|
|
133
134
|
? (this.Vo = t)
|
|
134
135
|
: r.error("Invalid sdk flavor passed: " + t);
|
|
135
136
|
}
|
|
136
|
-
let u = this.nn(
|
|
137
|
+
let u = this.nn(zt.So);
|
|
137
138
|
if (null != u)
|
|
138
139
|
if (j(u)) {
|
|
139
140
|
const t = [];
|
|
@@ -150,31 +151,31 @@ class zt {
|
|
|
150
151
|
"devicePropertyAllowlist must be an array. Defaulting to all properties.",
|
|
151
152
|
),
|
|
152
153
|
(u = null);
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const t = new _t(
|
|
154
|
+
const c = this.nn(L.Uo);
|
|
155
|
+
if (c) {
|
|
156
|
+
const t = new _t(c);
|
|
156
157
|
this.u.uu(o.iu.Uo, t);
|
|
157
158
|
}
|
|
158
159
|
(this.on = new Ot(this.u, u)),
|
|
159
160
|
(this.yt = new Dt(this.u)),
|
|
160
161
|
(this.wt = new kt(this.yt, this.u)),
|
|
161
|
-
(this.ri = new Mt(this.u, this.wt, this.yt, this.nn(L.
|
|
162
|
-
const
|
|
162
|
+
(this.ri = new Mt(this.u, this.wt, this.yt, this.nn(L.Ro)));
|
|
163
|
+
const f = new T();
|
|
163
164
|
return (
|
|
164
|
-
(this.
|
|
165
|
-
this.$t(
|
|
166
|
-
(this.qt = new
|
|
165
|
+
(this.Ko = new qt(this.u, this.nn(L.No), f)),
|
|
166
|
+
this.$t(f),
|
|
167
|
+
(this.qt = new Pt(
|
|
167
168
|
this.on,
|
|
168
169
|
this.u,
|
|
169
|
-
this.
|
|
170
|
+
this.Ko,
|
|
170
171
|
this.wt,
|
|
171
172
|
this.ri,
|
|
172
173
|
this.yt,
|
|
173
174
|
this.rn,
|
|
174
175
|
this.Go,
|
|
175
|
-
this.
|
|
176
|
+
this.Bo,
|
|
176
177
|
this.Vo || "",
|
|
177
|
-
this.nn(L.
|
|
178
|
+
this.nn(L.Po),
|
|
178
179
|
this.nn(L.Lo),
|
|
179
180
|
)),
|
|
180
181
|
(this.zi = new Lt(
|
|
@@ -188,11 +189,11 @@ class zt {
|
|
|
188
189
|
(t) => {
|
|
189
190
|
if (this.so()) for (const i of this.gr()) i.Ns(t);
|
|
190
191
|
},
|
|
191
|
-
this.
|
|
192
|
+
this.Ko,
|
|
192
193
|
this.qt,
|
|
193
194
|
)),
|
|
194
195
|
this.zi.initialize(),
|
|
195
|
-
a || this.u.
|
|
196
|
+
a || this.u.Kh(),
|
|
196
197
|
r.info(
|
|
197
198
|
`Initialized for the Braze backend at "${this.nn(
|
|
198
199
|
L._o,
|
|
@@ -201,24 +202,25 @@ class zt {
|
|
|
201
202
|
et.o(),
|
|
202
203
|
this.yt.ji(() => {
|
|
203
204
|
var t;
|
|
204
|
-
this.
|
|
205
|
+
this.isInitialized &&
|
|
205
206
|
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) &&
|
|
206
207
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
207
|
-
if (!this.
|
|
208
|
+
if (!this.isInitialized) return;
|
|
208
209
|
(0, t.default)();
|
|
209
210
|
});
|
|
210
211
|
}),
|
|
211
212
|
this.zi.mr(() => {
|
|
212
213
|
var t;
|
|
213
|
-
this.
|
|
214
|
+
this.isInitialized &&
|
|
214
215
|
(null === (t = this.yt) || void 0 === t ? void 0 : t.ci()) &&
|
|
215
216
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
216
|
-
if (!this.
|
|
217
|
+
if (!this.isInitialized) return;
|
|
217
218
|
(0, t.default)(void 0, void 0, !0);
|
|
218
219
|
});
|
|
219
220
|
}),
|
|
220
221
|
this.qo.Dt(this.options),
|
|
221
|
-
(this.
|
|
222
|
+
(this.isInitialized = !0),
|
|
223
|
+
window.dispatchEvent(new CustomEvent("braze.initialized")),
|
|
222
224
|
!0
|
|
223
225
|
);
|
|
224
226
|
}
|
|
@@ -233,7 +235,7 @@ class zt {
|
|
|
233
235
|
(this._e = []),
|
|
234
236
|
null != this.zi && this.zi.destroy(),
|
|
235
237
|
(this.zi = null),
|
|
236
|
-
(this.
|
|
238
|
+
(this.Ko = null),
|
|
237
239
|
(this.on = null),
|
|
238
240
|
(this.qt = null),
|
|
239
241
|
(this.yt = null),
|
|
@@ -241,19 +243,19 @@ class zt {
|
|
|
241
243
|
(this.wt = null),
|
|
242
244
|
(this.options = {}),
|
|
243
245
|
(this.Vo = void 0),
|
|
244
|
-
(this.
|
|
246
|
+
(this.isInitialized = !1),
|
|
245
247
|
(this.$o = !1),
|
|
246
248
|
t && (this.u = null);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
251
|
X() {
|
|
250
|
-
return !this
|
|
252
|
+
return !this.$h() && (!!this.so() || (console.warn(_), !1));
|
|
251
253
|
}
|
|
252
254
|
ba() {
|
|
253
255
|
return this.rn;
|
|
254
256
|
}
|
|
255
257
|
Sr() {
|
|
256
|
-
return this.
|
|
258
|
+
return this.Ko;
|
|
257
259
|
}
|
|
258
260
|
Hs() {
|
|
259
261
|
return this.Go;
|
|
@@ -314,14 +316,14 @@ class zt {
|
|
|
314
316
|
this.$o = t;
|
|
315
317
|
}
|
|
316
318
|
so() {
|
|
317
|
-
return this.
|
|
319
|
+
return this.isInitialized;
|
|
318
320
|
}
|
|
319
|
-
|
|
321
|
+
$h() {
|
|
320
322
|
return this.$o;
|
|
321
323
|
}
|
|
322
324
|
Ds() {
|
|
323
|
-
return this.
|
|
325
|
+
return this.Bo;
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
|
-
const e = new
|
|
327
|
-
export { e as default,
|
|
328
|
+
const e = new Vt();
|
|
329
|
+
export { e as default, Vt as BrazeSdkInstance, L as OPTIONS };
|
|
@@ -4,39 +4,39 @@ import DeviceProperties from "../Core/device-properties.js";
|
|
|
4
4
|
import _t from "../models/identifier.js";
|
|
5
5
|
import { logger as r, Guid as p } from "../../shared-lib/index.js";
|
|
6
6
|
import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
|
|
7
|
-
import { values as
|
|
7
|
+
import { values as Rt } from "../util/code-utils.js";
|
|
8
8
|
import { getErrorMessage as si } from "../util/error-utils.js";
|
|
9
9
|
export default class Ot {
|
|
10
10
|
constructor(t, e) {
|
|
11
11
|
(this.u = t),
|
|
12
|
-
(this.
|
|
12
|
+
(this.Ia = e),
|
|
13
13
|
(this.u = t),
|
|
14
|
-
null == e && (e =
|
|
15
|
-
(this.
|
|
14
|
+
null == e && (e = Rt(DeviceProperties)),
|
|
15
|
+
(this.Ia = e);
|
|
16
16
|
}
|
|
17
17
|
ce(t = !0) {
|
|
18
18
|
let e = this.u.tu(o.iu.Uo);
|
|
19
19
|
null == e && ((e = new _t(p.W())), t && this.u.uu(o.iu.Uo, e));
|
|
20
20
|
const r = new Gt(e.eu);
|
|
21
|
-
for (let t = 0; t < this.
|
|
22
|
-
switch (this.
|
|
21
|
+
for (let t = 0; t < this.Ia.length; t++) {
|
|
22
|
+
switch (this.Ia[t]) {
|
|
23
23
|
case DeviceProperties.BROWSER:
|
|
24
24
|
r.browser = X.browser;
|
|
25
25
|
break;
|
|
26
26
|
case DeviceProperties.BROWSER_VERSION:
|
|
27
|
-
r.
|
|
27
|
+
r.Ta = X.version;
|
|
28
28
|
break;
|
|
29
29
|
case DeviceProperties.OS:
|
|
30
|
-
r.os = this.
|
|
30
|
+
r.os = this.Da();
|
|
31
31
|
break;
|
|
32
32
|
case DeviceProperties.RESOLUTION:
|
|
33
|
-
r.
|
|
33
|
+
r.Sa = screen.width + "x" + screen.height;
|
|
34
34
|
break;
|
|
35
35
|
case DeviceProperties.LANGUAGE:
|
|
36
36
|
r.language = X.language;
|
|
37
37
|
break;
|
|
38
38
|
case DeviceProperties.TIME_ZONE:
|
|
39
|
-
r.timeZone = this.
|
|
39
|
+
r.timeZone = this.Oa(new Date());
|
|
40
40
|
break;
|
|
41
41
|
case DeviceProperties.USER_AGENT:
|
|
42
42
|
r.userAgent = X.userAgent;
|
|
@@ -44,12 +44,12 @@ export default class Ot {
|
|
|
44
44
|
}
|
|
45
45
|
return r;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
if (X.
|
|
49
|
-
const t = this.u.j(o.C.
|
|
50
|
-
return t && t.os_version ? t.os_version : X.
|
|
47
|
+
Da() {
|
|
48
|
+
if (X.Ca()) return X.Ca();
|
|
49
|
+
const t = this.u.j(o.C.Fa);
|
|
50
|
+
return t && t.os_version ? t.os_version : X.Da();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
Oa(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 s = t.getTimezoneOffset();
|
|
69
|
-
return this.
|
|
69
|
+
return this.Ga(s);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
Ga(t) {
|
|
72
72
|
const e = Math.trunc(t / 60),
|
|
73
73
|
r = Math.trunc(t % 60);
|
|
74
74
|
let s = "GMT";
|