@braze/web-sdk 4.6.3 → 4.7.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 +13 -8
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +2 -2
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +18 -17
- package/shared-lib/indexed-db-adapter.js +2 -2
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +15 -15
- package/src/Core/handle-braze-action.js +40 -34
- package/src/Core/log-custom-event.js +2 -7
- package/src/Core/log-purchase.js +3 -3
- package/src/Core/wipe-data.js +2 -2
- package/src/FeatureFlags/feature-flag.js +33 -16
- package/src/FeatureFlags/feature-flags-provider.js +86 -75
- package/src/FeatureFlags/get-all-feature-flags.js +5 -5
- package/src/FeatureFlags/get-feature-flag.js +6 -6
- package/src/FeatureFlags/refresh-feature-flags.js +1 -1
- package/src/FeatureFlags/types.js +1 -0
- package/src/Feed/feed-provider.js +17 -17
- package/src/Feed/get-cached-feed.js +1 -1
- package/src/Feed/ui/show-feed.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +135 -120
- package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
- package/src/InAppMessage/display/modal-utils.js +6 -6
- package/src/InAppMessage/in-app-message-factory.js +3 -3
- package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
- package/src/InAppMessage/in-app-message-manager.js +65 -65
- package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-impression.js +3 -3
- package/src/InAppMessage/models/full-screen-message.js +1 -1
- package/src/InAppMessage/models/html-message.js +1 -1
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +80 -80
- package/src/InAppMessage/models/modal-message.js +2 -2
- package/src/InAppMessage/models/slide-up-message.js +8 -8
- package/src/InAppMessage/models/templated-in-app-message.js +4 -4
- 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 +20 -20
- package/src/Push/push-manager.js +216 -209
- package/src/Push/utils/push-utils.js +4 -4
- package/src/User/user-manager.js +11 -8
- package/src/User/user.js +52 -41
- package/src/common/base-feed.js +1 -1
- package/src/common/base-provider.js +1 -1
- package/src/common/constants.js +2 -0
- package/src/common/feed-display.js +6 -6
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/managers/auth-manager.js +24 -24
- package/src/managers/braze-instance.js +120 -120
- package/src/managers/device-manager.js +11 -11
- package/src/managers/network-manager.js +63 -54
- package/src/managers/server-config-manager.js +20 -20
- package/src/managers/session-manager.js +29 -29
- package/src/managers/storage-manager-factory.js +4 -4
- package/src/managers/storage-manager.js +104 -104
- package/src/managers/subscription-manager.js +6 -6
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +6 -6
- package/src/models/push-token.js +3 -3
- package/src/models/server-config.js +15 -15
- package/src/request-controller.js +92 -88
- package/src/triggers/models/custom-event-data.js +4 -4
- 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 +63 -63
- package/src/triggers/models/in-app-message-click-data.js +5 -5
- package/src/triggers/models/purchase-data.js +3 -3
- package/src/triggers/models/purchase-property-data.js +9 -9
- package/src/triggers/models/push-click-data.js +5 -5
- package/src/triggers/models/trigger-condition.js +48 -48
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +29 -29
- package/src/triggers/triggers-provider-factory.js +2 -2
- package/src/triggers/triggers-provider.js +87 -89
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/feed-css.js +4 -4
- package/src/ui/js/iam-css.js +4 -4
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +2 -2
- package/src/util/braze-actions.js +8 -8
- package/src/util/browser-detector.js +8 -8
- package/src/util/client-hints-parser.js +3 -3
- package/src/util/code-utils.js +10 -3
- package/src/util/component-utils.js +1 -1
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +1 -1
- package/src/util/dom-utils.js +9 -9
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +3 -3
- package/src/util/user-agent-parser.js +4 -4
- package/src/util/validation-utils.js +155 -74
- package/src/util/window-utils.js +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import kt from "./auth-manager.js";
|
|
2
2
|
import y from "../common/base-provider.js";
|
|
3
3
|
import ot from "../util/browser-detector.js";
|
|
4
|
-
import
|
|
4
|
+
import Ot from "./device-manager.js";
|
|
5
5
|
import DeviceProperties from "../Core/device-properties.js";
|
|
6
6
|
import {
|
|
7
7
|
isArray as p,
|
|
8
|
-
keys as
|
|
8
|
+
keys as or,
|
|
9
9
|
validateValueIsFromEnum as F,
|
|
10
|
-
values as
|
|
10
|
+
values as Lt
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
12
|
import { logDeprecationWarning as D } from "../util/deprecation-utils.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import Pt from "./network-manager.js";
|
|
14
|
+
import Rt from "../request-controller.js";
|
|
15
|
+
import Mt from "./server-config-manager.js";
|
|
16
|
+
import jt from "./session-manager.js";
|
|
17
17
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
18
18
|
import G, { STORAGE_KEYS as o } from "./storage-manager.js";
|
|
19
|
-
import
|
|
19
|
+
import Dt from "./storage-manager-factory.js";
|
|
20
20
|
import u from "./subscription-manager.js";
|
|
21
21
|
import { TriggersProviderFactory as W } from "../triggers/triggers-provider-factory.js";
|
|
22
22
|
import bt from "../User/user-manager.js";
|
|
@@ -24,66 +24,66 @@ import { User } from "../User/index.js";
|
|
|
24
24
|
import { parseQueryStringKeyValues as ut } from "../util/url-utils.js";
|
|
25
25
|
import { WindowUtils as H } from "../util/window-utils.js";
|
|
26
26
|
const T = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
Yn: "allowCrawlerActivity",
|
|
28
|
+
Xn: "baseUrl",
|
|
29
|
+
Zn: "noCookies",
|
|
30
|
+
ho: "devicePropertyAllowlist",
|
|
31
31
|
ta: "disablePushTokenMaintenance",
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
po: "enableLogging",
|
|
33
|
+
Eo: "enableSdkAuthentication",
|
|
34
34
|
ia: "manageServiceWorkerExternally",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
_o: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
36
|
+
Io: "sessionTimeoutInSeconds",
|
|
37
|
+
Ao: "appVersion",
|
|
38
38
|
na: "serviceWorkerLocation",
|
|
39
39
|
ra: "safariWebsitePushId",
|
|
40
|
-
|
|
40
|
+
jn: "localization",
|
|
41
41
|
ao: "contentSecurityNonce",
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
So: "enableHtmlInAppMessages",
|
|
43
|
+
No: "allowUserSuppliedJavascript",
|
|
44
44
|
no: "inAppMessageZIndex",
|
|
45
45
|
lo: "openInAppMessagesInNewTab",
|
|
46
46
|
tn: "openCardsInNewTab",
|
|
47
47
|
en: "openNewsFeedCardsInNewTab",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Ih: "requireExplicitInAppMessageDismissal",
|
|
49
|
+
wo: "doNotLoadFontAwesome",
|
|
50
|
+
To: "sdkFlavor"
|
|
51
51
|
};
|
|
52
|
-
class
|
|
52
|
+
class Bt {
|
|
53
53
|
constructor() {
|
|
54
|
-
(this.
|
|
55
|
-
(this.
|
|
56
|
-
(this.
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
59
|
-
(this.
|
|
60
|
-
(this.
|
|
61
|
-
(this.
|
|
62
|
-
(this.
|
|
54
|
+
(this.Oo = !1),
|
|
55
|
+
(this.vo = !1),
|
|
56
|
+
(this.Co = new u()),
|
|
57
|
+
(this.Lo = new u()),
|
|
58
|
+
(this.Po = {}),
|
|
59
|
+
(this.Ro = []),
|
|
60
|
+
(this.Mo = []),
|
|
61
|
+
(this.Se = []),
|
|
62
|
+
(this.jo = "4.7.0");
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
this.
|
|
64
|
+
yo(t) {
|
|
65
|
+
this.Co.ut(t);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
this.
|
|
67
|
+
_h(t) {
|
|
68
|
+
this.Lo.ut(t);
|
|
69
69
|
}
|
|
70
70
|
initialize(t, i) {
|
|
71
|
-
if (this.
|
|
71
|
+
if (this.Do())
|
|
72
72
|
return (
|
|
73
73
|
r.D.info("Braze has already been initialized with an API key."), !0
|
|
74
74
|
);
|
|
75
|
-
this.
|
|
76
|
-
let s = this.nn(T.
|
|
77
|
-
const e = ut(H.
|
|
75
|
+
this.Po = i || {};
|
|
76
|
+
let s = this.nn(T.po);
|
|
77
|
+
const e = ut(H.bn());
|
|
78
78
|
if (
|
|
79
79
|
(e && "true" === e.brazeLogging && (s = !0),
|
|
80
80
|
r.D.init(s),
|
|
81
|
-
r.D.info(`Initialization Options: ${JSON.stringify(this.
|
|
81
|
+
r.D.info(`Initialization Options: ${JSON.stringify(this.Po, null, 2)}`),
|
|
82
82
|
null == t || "" === t || "string" != typeof t)
|
|
83
83
|
)
|
|
84
84
|
return r.D.error("Braze requires a valid API key to be initialized."), !1;
|
|
85
85
|
this._r = t;
|
|
86
|
-
let n = this.nn(T.
|
|
86
|
+
let n = this.nn(T.Xn);
|
|
87
87
|
if (null == n || "" === n || "string" != typeof n)
|
|
88
88
|
return r.D.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
89
89
|
!1 === /^https?:/.test(n) && (n = `https://${n}`);
|
|
@@ -92,32 +92,32 @@ class jt {
|
|
|
92
92
|
((n = document.createElement("a")),
|
|
93
93
|
(n.href = a),
|
|
94
94
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
95
|
-
(this.
|
|
96
|
-
ot.
|
|
95
|
+
(this.Uo = n.toString()),
|
|
96
|
+
ot.zo && !this.nn(T.Yn))
|
|
97
97
|
)
|
|
98
98
|
return (
|
|
99
99
|
r.D.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
100
|
-
(this.
|
|
100
|
+
(this.vo = !0),
|
|
101
101
|
!1
|
|
102
102
|
);
|
|
103
|
-
const h = this.nn(
|
|
104
|
-
if (((this.h =
|
|
103
|
+
const h = this.nn(Bt.Zn) || !1;
|
|
104
|
+
if (((this.h = Dt.Bo(t, h)), new G.ne(null, !0).lr(o.ae)))
|
|
105
105
|
return (
|
|
106
106
|
r.D.info("Ignoring all activity due to previous opt out"),
|
|
107
|
-
(this.
|
|
107
|
+
(this.vo = !0),
|
|
108
108
|
!1
|
|
109
109
|
);
|
|
110
|
-
for (const t of
|
|
111
|
-
-1 ===
|
|
110
|
+
for (const t of or(this.Po))
|
|
111
|
+
-1 === Lt(r.Wo).indexOf(t) &&
|
|
112
112
|
r.D.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
113
113
|
const l = ["mparticle", "wordpress", "tealium"];
|
|
114
|
-
if (null != this.nn(T.
|
|
115
|
-
const t = this.nn(T.
|
|
114
|
+
if (null != this.nn(T.To)) {
|
|
115
|
+
const t = this.nn(T.To);
|
|
116
116
|
-1 !== l.indexOf(t)
|
|
117
|
-
? (this.
|
|
117
|
+
? (this.Fo = t)
|
|
118
118
|
: r.D.error("Invalid sdk flavor passed: " + t);
|
|
119
119
|
}
|
|
120
|
-
let f = this.nn(r.
|
|
120
|
+
let f = this.nn(r.Wo.ho);
|
|
121
121
|
if (null != f)
|
|
122
122
|
if (p(f)) {
|
|
123
123
|
const t = [];
|
|
@@ -134,102 +134,102 @@ class jt {
|
|
|
134
134
|
"devicePropertyAllowlist must be an array. Defaulting to all properties."
|
|
135
135
|
),
|
|
136
136
|
(f = null);
|
|
137
|
-
(this.Ur = new
|
|
138
|
-
(this.gt = new
|
|
137
|
+
(this.Ur = new Ot(this.h, f)),
|
|
138
|
+
(this.gt = new Mt(this.h)),
|
|
139
139
|
(this.v = new bt(this.gt, this.h)),
|
|
140
|
-
(this.j = new
|
|
140
|
+
(this.j = new jt(this.h, this.v, this.gt, this.nn(T.Io)));
|
|
141
141
|
const m = new u();
|
|
142
142
|
return (
|
|
143
|
-
(this.
|
|
143
|
+
(this.Vo = new kt(this.h, this.nn(T.Eo), m)),
|
|
144
144
|
this.jt(m),
|
|
145
|
-
(this.vt = new
|
|
145
|
+
(this.vt = new Pt(
|
|
146
146
|
this.Ur,
|
|
147
147
|
this.h,
|
|
148
|
-
this.
|
|
148
|
+
this.Vo,
|
|
149
149
|
this.v,
|
|
150
150
|
this.j,
|
|
151
151
|
this.gt,
|
|
152
152
|
this._r,
|
|
153
|
-
this.Wo,
|
|
154
153
|
this.Uo,
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
154
|
+
this.jo,
|
|
155
|
+
this.Fo,
|
|
156
|
+
this.nn(T.Ao)
|
|
157
157
|
)),
|
|
158
|
-
(this.
|
|
158
|
+
(this.Ci = new Rt(
|
|
159
159
|
this._r,
|
|
160
|
-
this.
|
|
160
|
+
this.Uo,
|
|
161
161
|
this.j,
|
|
162
162
|
this.Ur,
|
|
163
163
|
this.v,
|
|
164
164
|
this.gt,
|
|
165
165
|
this.h,
|
|
166
166
|
t => {
|
|
167
|
-
if (this.
|
|
167
|
+
if (this.Do()) for (const i of this.re()) i.Rs(t);
|
|
168
168
|
},
|
|
169
|
-
this.
|
|
169
|
+
this.Vo,
|
|
170
170
|
this.vt
|
|
171
171
|
)),
|
|
172
|
-
this.
|
|
172
|
+
this.Ci.initialize(),
|
|
173
173
|
r.D.info(
|
|
174
174
|
`Initialized for the Braze backend at "${this.nn(
|
|
175
|
-
T.
|
|
175
|
+
T.Xn
|
|
176
176
|
)}" with API key "${this._r}".`
|
|
177
177
|
),
|
|
178
|
-
null != this.nn(T.
|
|
178
|
+
null != this.nn(T.So) &&
|
|
179
179
|
D(
|
|
180
180
|
"enableHtmlInAppMessages",
|
|
181
181
|
"initialization option",
|
|
182
182
|
"allowUserSuppliedJavascript"
|
|
183
183
|
),
|
|
184
184
|
W.init(),
|
|
185
|
-
this.gt.
|
|
186
|
-
this.
|
|
187
|
-
this.gt.
|
|
185
|
+
this.gt.Fi(() => {
|
|
186
|
+
this.Oo &&
|
|
187
|
+
this.gt.ci() &&
|
|
188
188
|
import("../FeatureFlags/refresh-feature-flags.js").then(t => {
|
|
189
|
-
if (!this.
|
|
189
|
+
if (!this.Oo) return;
|
|
190
190
|
(0, t.default)();
|
|
191
191
|
});
|
|
192
192
|
}),
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
195
|
-
this.gt.
|
|
193
|
+
this.Ci.cr(() => {
|
|
194
|
+
this.Oo &&
|
|
195
|
+
this.gt.ci() &&
|
|
196
196
|
import("../FeatureFlags/refresh-feature-flags.js").then(t => {
|
|
197
|
-
if (!this.
|
|
197
|
+
if (!this.Oo) return;
|
|
198
198
|
(0, t.default)(null, null, !0);
|
|
199
199
|
});
|
|
200
200
|
}),
|
|
201
|
-
this.
|
|
202
|
-
(this.
|
|
201
|
+
this.Co.St(this.Po),
|
|
202
|
+
(this.Oo = !0),
|
|
203
203
|
!0
|
|
204
204
|
);
|
|
205
205
|
}
|
|
206
206
|
destroy(t) {
|
|
207
|
-
if ((r.D.destroy(), this.
|
|
208
|
-
this.
|
|
209
|
-
for (const t of this.
|
|
210
|
-
this.
|
|
211
|
-
for (const t of this.
|
|
212
|
-
(this.
|
|
207
|
+
if ((r.D.destroy(), this.Do())) {
|
|
208
|
+
this.Lo.St(), this.Lo.removeAllSubscriptions();
|
|
209
|
+
for (const t of this.Ro) t.destroy();
|
|
210
|
+
this.Ro = [];
|
|
211
|
+
for (const t of this.Mo) t.clearData(!1);
|
|
212
|
+
(this.Mo = []),
|
|
213
213
|
this.removeAllSubscriptions(),
|
|
214
|
-
(this.
|
|
215
|
-
this.
|
|
216
|
-
(this.
|
|
217
|
-
(this.
|
|
214
|
+
(this.Se = []),
|
|
215
|
+
this.Ci.destroy(),
|
|
216
|
+
(this.Ci = null),
|
|
217
|
+
(this.Vo = null),
|
|
218
218
|
(this.Ur = null),
|
|
219
219
|
(this.vt = null),
|
|
220
220
|
(this.gt = null),
|
|
221
221
|
(this.j = null),
|
|
222
222
|
(this.v = null),
|
|
223
|
-
(this.
|
|
224
|
-
(this.
|
|
225
|
-
(this.
|
|
226
|
-
(this.
|
|
223
|
+
(this.Po = {}),
|
|
224
|
+
(this.Fo = void 0),
|
|
225
|
+
(this.Oo = !1),
|
|
226
|
+
(this.vo = !1),
|
|
227
227
|
t && (this.h = null);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
rr() {
|
|
231
|
-
if (this
|
|
232
|
-
if (!this.
|
|
231
|
+
if (this.Go()) return !1;
|
|
232
|
+
if (!this.Do())
|
|
233
233
|
throw new Error("Braze must be initialized before calling methods.");
|
|
234
234
|
return !0;
|
|
235
235
|
}
|
|
@@ -237,10 +237,10 @@ class jt {
|
|
|
237
237
|
return this._r;
|
|
238
238
|
}
|
|
239
239
|
ii() {
|
|
240
|
-
return this.
|
|
240
|
+
return this.Vo;
|
|
241
241
|
}
|
|
242
242
|
Ks() {
|
|
243
|
-
return this.
|
|
243
|
+
return this.Uo;
|
|
244
244
|
}
|
|
245
245
|
ce() {
|
|
246
246
|
return this.Ur;
|
|
@@ -249,13 +249,13 @@ class jt {
|
|
|
249
249
|
return this.vt;
|
|
250
250
|
}
|
|
251
251
|
nn(t) {
|
|
252
|
-
return this.
|
|
252
|
+
return this.Po[t];
|
|
253
253
|
}
|
|
254
254
|
re() {
|
|
255
|
-
return this.
|
|
255
|
+
return this.Mo;
|
|
256
256
|
}
|
|
257
257
|
mr() {
|
|
258
|
-
return this.
|
|
258
|
+
return this.Ci;
|
|
259
259
|
}
|
|
260
260
|
ir() {
|
|
261
261
|
return this.gt;
|
|
@@ -267,45 +267,45 @@ class jt {
|
|
|
267
267
|
return this.h;
|
|
268
268
|
}
|
|
269
269
|
gr() {
|
|
270
|
-
if (this.v && this.
|
|
270
|
+
if (this.v && this.Ci) return new User(this.v, this.Ci);
|
|
271
271
|
}
|
|
272
272
|
p() {
|
|
273
273
|
return this.v;
|
|
274
274
|
}
|
|
275
275
|
tr() {
|
|
276
|
-
return !0 === this.nn(T.
|
|
276
|
+
return !0 === this.nn(T.No) || !0 === this.nn(T.So);
|
|
277
277
|
}
|
|
278
278
|
u(t) {
|
|
279
279
|
let i = !1;
|
|
280
|
-
for (const s of this.
|
|
281
|
-
i || this.
|
|
280
|
+
for (const s of this.Ro) s === t && (i = !0);
|
|
281
|
+
i || this.Ro.push(t);
|
|
282
282
|
}
|
|
283
283
|
ar(t) {
|
|
284
284
|
let i = !1;
|
|
285
|
-
for (const s of this.
|
|
286
|
-
t instanceof y && !i && this.
|
|
285
|
+
for (const s of this.Mo) s.constructor === t.constructor && (i = !0);
|
|
286
|
+
t instanceof y && !i && this.Mo.push(t);
|
|
287
287
|
}
|
|
288
288
|
jt(t) {
|
|
289
|
-
t instanceof u && this.
|
|
289
|
+
t instanceof u && this.Se.push(t);
|
|
290
290
|
}
|
|
291
291
|
removeAllSubscriptions() {
|
|
292
|
-
if (this.rr()) for (const t of this.
|
|
292
|
+
if (this.rr()) for (const t of this.Se) t.removeAllSubscriptions();
|
|
293
293
|
}
|
|
294
294
|
removeSubscription(t) {
|
|
295
|
-
if (this.rr()) for (const i of this.
|
|
295
|
+
if (this.rr()) for (const i of this.Se) i.removeSubscription(t);
|
|
296
296
|
}
|
|
297
297
|
le(t) {
|
|
298
|
-
this.
|
|
298
|
+
this.vo = t;
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
return this.
|
|
300
|
+
Do() {
|
|
301
|
+
return this.Oo;
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
return this.
|
|
303
|
+
Go() {
|
|
304
|
+
return this.vo;
|
|
305
305
|
}
|
|
306
306
|
Ds() {
|
|
307
|
-
return this.
|
|
307
|
+
return this.jo;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
const e = new
|
|
311
|
-
export { e as default,
|
|
310
|
+
const e = new Bt();
|
|
311
|
+
export { e as default, Bt as BrazeSdkInstance, T as OPTIONS };
|
|
@@ -4,14 +4,14 @@ import DeviceProperties from "../Core/device-properties.js";
|
|
|
4
4
|
import _t from "../models/identifier.js";
|
|
5
5
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
6
6
|
import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
|
|
7
|
-
import { values as
|
|
8
|
-
export default class
|
|
7
|
+
import { values as Lt } from "../util/code-utils.js";
|
|
8
|
+
export default class Ot {
|
|
9
9
|
constructor(e, t) {
|
|
10
|
-
(this.h = e), null == t && (t =
|
|
10
|
+
(this.h = e), null == t && (t = Lt(DeviceProperties)), (this.xo = t);
|
|
11
11
|
}
|
|
12
12
|
te() {
|
|
13
13
|
let e = this.h.tu(o.eu.Jo);
|
|
14
|
-
null == e && ((e = new _t(r.it.nt())), this.h.
|
|
14
|
+
null == e && ((e = new _t(r.it.nt())), this.h.uu(o.eu.Jo, e));
|
|
15
15
|
const t = new Ie(e.iu);
|
|
16
16
|
for (let e = 0; e < this.xo.length; e++) {
|
|
17
17
|
const r = this.xo[e];
|
|
@@ -32,7 +32,7 @@ export default class It {
|
|
|
32
32
|
t[r] = ot.language;
|
|
33
33
|
break;
|
|
34
34
|
case DeviceProperties.TIME_ZONE:
|
|
35
|
-
t[r] = this.
|
|
35
|
+
t[r] = this.Ho(new Date());
|
|
36
36
|
break;
|
|
37
37
|
case DeviceProperties.USER_AGENT:
|
|
38
38
|
t[r] = ot.userAgent;
|
|
@@ -41,11 +41,11 @@ export default class It {
|
|
|
41
41
|
return t;
|
|
42
42
|
}
|
|
43
43
|
qo() {
|
|
44
|
-
if (ot.
|
|
45
|
-
const e = this.h.I(o.q.
|
|
46
|
-
return e && e.os_version ? e.os_version : ot.
|
|
44
|
+
if (ot.Ko()) return ot.Ko();
|
|
45
|
+
const e = this.h.I(o.q.Qo);
|
|
46
|
+
return e && e.os_version ? e.os_version : ot.Xo();
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
Ho(e) {
|
|
49
49
|
if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
|
|
50
50
|
try {
|
|
51
51
|
if ("function" == typeof Intl.DateTimeFormat().resolvedOptions) {
|
|
@@ -61,9 +61,9 @@ export default class It {
|
|
|
61
61
|
}
|
|
62
62
|
if (!e) return e;
|
|
63
63
|
const t = e.getTimezoneOffset();
|
|
64
|
-
return this.
|
|
64
|
+
return this.Yo(t);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
Yo(e) {
|
|
67
67
|
const t = parseInt(e / 60),
|
|
68
68
|
r = parseInt(e % 60);
|
|
69
69
|
let s = "GMT";
|