@braze/web-sdk 6.4.0 → 6.6.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/README.md +1 -1
- package/index.d.ts +11 -5
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +3 -3
- package/shared-lib/event-types.js +30 -30
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +58 -58
- package/shared-lib/logger.js +7 -7
- package/shared-lib/supported-options.js +17 -16
- package/src/Banner/banner-provider.js +95 -81
- package/src/Banner/banner.js +9 -9
- package/src/Banner/constants.js +4 -0
- package/src/Banner/display/banner-to-html.js +1 -1
- package/src/Banner/display/destroy-banner-html.js +3 -3
- package/src/Banner/display/detect-banner-impressions.js +14 -14
- package/src/Banner/get-all-banners.js +4 -4
- package/src/Banner/get-banner.js +5 -4
- package/src/Banner/log-banner-click.js +2 -2
- package/src/Banner/log-banner-impressions.js +6 -6
- package/src/Banner/request-banners-refresh.js +18 -20
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +17 -14
- package/src/Card/card-manager-factory.js +3 -3
- package/src/Card/card-manager.js +32 -32
- package/src/Card/constants.js +1 -0
- package/src/Card/display/card-display.js +11 -11
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +5 -5
- package/src/Card/models/captioned-image.js +3 -3
- package/src/Card/models/card.js +16 -16
- package/src/Card/models/classic-card.js +3 -3
- package/src/Card/models/control-card.js +3 -3
- package/src/Card/models/image-only.js +3 -3
- package/src/Card/util/card-factory.js +6 -6
- package/src/ContentCards/content-cards-provider-factory.js +11 -11
- package/src/ContentCards/content-cards-provider.js +110 -96
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +5 -5
- package/src/ContentCards/ui/show-content-cards.js +5 -5
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +4 -4
- package/src/Core/disable-sdk.js +9 -8
- package/src/Core/enable-sdk.js +5 -5
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +3 -3
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/log-custom-event.js +13 -13
- package/src/Core/log-purchase.js +10 -10
- package/src/Core/open-session.js +7 -7
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-connection-core.js +23 -0
- package/src/DUST/dust-provider-factory.js +10 -8
- package/src/DUST/dust-provider.js +408 -176
- package/src/DUST/dust-shared-worker-code.js +2 -0
- package/src/DUST/dust-shared-worker-impl.js +240 -0
- package/src/DUST/dust-worker-bridge.js +136 -0
- package/src/DUST/index.js +10 -0
- package/src/DUST/subscribe-to-dust.js +13 -13
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +6 -6
- package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
- package/src/FeatureFlags/feature-flags-provider.js +98 -84
- 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 +7 -7
- package/src/FeatureFlags/refresh-feature-flags.js +2 -2
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
- package/src/InAppMessage/constants.js +4 -0
- package/src/InAppMessage/defer-in-app-message.js +2 -2
- package/src/InAppMessage/display/get-animation-effect.js +1 -1
- package/src/InAppMessage/display/html-message-to-html.js +6 -6
- package/src/InAppMessage/display/in-app-message-to-html.js +40 -40
- package/src/InAppMessage/display/modal-utils.js +16 -16
- package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
- package/src/InAppMessage/in-app-message-factory.js +4 -4
- package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
- package/src/InAppMessage/in-app-message-manager.js +97 -97
- package/src/InAppMessage/log-in-app-message-button-click.js +14 -14
- package/src/InAppMessage/log-in-app-message-click.js +13 -13
- package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
- package/src/InAppMessage/log-in-app-message-impression.js +8 -8
- package/src/InAppMessage/models/control-message.js +5 -5
- package/src/InAppMessage/models/full-screen-message.js +18 -18
- package/src/InAppMessage/models/html-message.js +19 -19
- package/src/InAppMessage/models/in-app-message-button.js +7 -7
- package/src/InAppMessage/models/in-app-message.js +121 -119
- package/src/InAppMessage/models/modal-message.js +18 -18
- package/src/InAppMessage/models/slide-up-message.js +23 -23
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
- package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +8 -8
- package/src/InAppMessage/ui/show-in-app-message.js +34 -34
- package/src/Push/push-manager-factory.js +14 -14
- package/src/Push/push-manager.js +90 -90
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/unregister-push.js +1 -1
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +32 -32
- package/src/User/user.js +71 -71
- package/src/common/constants.js +8 -11
- package/src/common/content-cards-display.js +32 -32
- package/src/common/event-logger.js +10 -10
- package/src/common/properties-base.js +16 -16
- package/src/l10n/l10n-manager-factory.js +11 -11
- package/src/l10n/l10n-manager.js +2 -2
- package/src/managers/auth-manager.js +14 -14
- package/src/managers/braze-instance.js +163 -159
- package/src/managers/device-manager.js +11 -11
- package/src/managers/network-manager.js +154 -154
- package/src/managers/server-config-manager.js +116 -88
- package/src/managers/session-manager.js +41 -41
- package/src/managers/storage-manager-factory.js +13 -13
- package/src/managers/storage-manager.js +130 -131
- package/src/managers/subscription-manager.js +12 -12
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +10 -10
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +17 -17
- package/src/models/push-token.js +14 -14
- package/src/models/request-result.js +4 -4
- package/src/models/server-config.js +41 -37
- package/src/request-controller.js +163 -160
- package/src/triggers/models/custom-event-data.js +5 -5
- package/src/triggers/models/custom-event-property-data.js +6 -6
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +7 -7
- package/src/triggers/models/in-app-message-click-data.js +13 -13
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +6 -6
- package/src/triggers/models/push-click-data.js +6 -6
- package/src/triggers/models/trigger-condition.js +47 -47
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +42 -42
- package/src/triggers/triggers-provider-factory.js +5 -5
- package/src/triggers/triggers-provider.js +66 -66
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +8 -8
- package/src/util/braze-actions.js +5 -5
- package/src/util/browser-detector.js +33 -33
- package/src/util/client-hints-parser.js +10 -10
- package/src/util/component-utils.js +5 -5
- package/src/util/dom-utils.js +13 -13
- package/src/util/html-display-utils.js +7 -7
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +6 -6
- package/src/util/request-header-utils.js +26 -26
- package/src/util/user-agent-parser.js +20 -20
- package/src/util/validation-utils.js +16 -16
- package/src/util/window-utils.js +3 -3
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { EventTypes as
|
|
6
|
-
|
|
2
|
+
import m from "./subscription-manager.js";
|
|
3
|
+
import li from "../models/server-config.js";
|
|
4
|
+
import v from "../common/event-logger.js";
|
|
5
|
+
import { EventTypes as f } from "../../shared-lib/index.js";
|
|
6
|
+
import {
|
|
7
|
+
REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as u,
|
|
8
|
+
REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as c,
|
|
9
|
+
REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as d,
|
|
10
|
+
} from "../common/constants.js";
|
|
11
|
+
export default class Bt {
|
|
7
12
|
constructor(t) {
|
|
8
|
-
(this.
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
(this.
|
|
16
|
-
(this.
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (null == this.
|
|
20
|
-
const t = this.
|
|
21
|
-
this.
|
|
13
|
+
(this.B = t),
|
|
14
|
+
(this.B = t),
|
|
15
|
+
(this.Ec = new m()),
|
|
16
|
+
(this.Bc = new m()),
|
|
17
|
+
(this.wc = new m()),
|
|
18
|
+
(this.Cc = new m()),
|
|
19
|
+
(this.yc = new m()),
|
|
20
|
+
(this.Fc = null),
|
|
21
|
+
(this.Lc = null);
|
|
22
|
+
}
|
|
23
|
+
Mc() {
|
|
24
|
+
if (null == this.Lc) {
|
|
25
|
+
const t = this.B.dt(s.ft.jc);
|
|
26
|
+
this.Lc = null != t ? li._u(t) : new li();
|
|
22
27
|
}
|
|
23
|
-
return this.
|
|
28
|
+
return this.Lc;
|
|
24
29
|
}
|
|
25
|
-
|
|
26
|
-
return this.
|
|
30
|
+
xt() {
|
|
31
|
+
return this.Mc().Sc;
|
|
27
32
|
}
|
|
28
|
-
|
|
33
|
+
Nc(t) {
|
|
29
34
|
var i, e, n, r;
|
|
30
35
|
if (null != t && null != t.config) {
|
|
31
36
|
const l = t.config;
|
|
32
|
-
if (l.time > this.
|
|
33
|
-
const t = (t) => (null == t ? this.
|
|
34
|
-
u = new
|
|
37
|
+
if (l.time > this.Mc().Sc) {
|
|
38
|
+
const t = (t) => (null == t ? this.Mc().xc : t),
|
|
39
|
+
u = new li(
|
|
35
40
|
l.time,
|
|
36
41
|
l.events_blacklist,
|
|
37
42
|
l.attributes_blacklist,
|
|
@@ -43,123 +48,146 @@ export default class Vt {
|
|
|
43
48
|
t(l.global_request_rate_limit),
|
|
44
49
|
l.banners,
|
|
45
50
|
l.dust,
|
|
51
|
+
l.request_backoff,
|
|
46
52
|
);
|
|
53
|
+
let o = !1;
|
|
54
|
+
null != u.Gc && this.ju() !== u.Gc && (o = !0);
|
|
47
55
|
let a = !1;
|
|
48
|
-
null != u.
|
|
56
|
+
null != u.Ic.enabled && this.wi() !== u.Ic.enabled && (a = !0);
|
|
49
57
|
let h = !1;
|
|
50
|
-
null != u.
|
|
51
|
-
let
|
|
52
|
-
null != u.je.enabled && this.Te() !== u.je.enabled && (o = !0);
|
|
53
|
-
let d = !1;
|
|
58
|
+
null != u.Xr.enabled && this.Yr() !== u.Xr.enabled && (h = !0);
|
|
59
|
+
let c = !1;
|
|
54
60
|
null !=
|
|
55
61
|
(null === (i = u.banners) || void 0 === i ? void 0 : i.enabled) &&
|
|
56
|
-
this.
|
|
62
|
+
this.kt() !==
|
|
57
63
|
(null === (e = u.banners) || void 0 === e ? void 0 : e.enabled) &&
|
|
58
|
-
(
|
|
59
|
-
let
|
|
64
|
+
(c = !0);
|
|
65
|
+
let d = !1;
|
|
60
66
|
null != (null === (n = u.dust) || void 0 === n ? void 0 : n.enabled) &&
|
|
61
|
-
this.
|
|
67
|
+
this.Ze() !==
|
|
62
68
|
(null === (r = u.dust) || void 0 === r ? void 0 : r.enabled) &&
|
|
63
|
-
(
|
|
64
|
-
(this.
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
(d = !0),
|
|
70
|
+
(this.Lc = u),
|
|
71
|
+
this.B.bt(s.ft.jc, u.gt()),
|
|
72
|
+
o && this.Ec.L(),
|
|
73
|
+
a && this.Bc.L(),
|
|
74
|
+
h && this.wc.L(),
|
|
75
|
+
c && this.Cc.L(),
|
|
76
|
+
d && this.yc.L();
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
|
-
|
|
75
|
-
const i = this.
|
|
76
|
-
return this.
|
|
80
|
+
xu(t) {
|
|
81
|
+
const i = this.Ec.Rt(t);
|
|
82
|
+
return this.Fc && this.Ec.removeSubscription(this.Fc), (this.Fc = i), i;
|
|
77
83
|
}
|
|
78
|
-
|
|
79
|
-
return this.
|
|
84
|
+
Ci(t) {
|
|
85
|
+
return this.Bc.Rt(t);
|
|
80
86
|
}
|
|
81
|
-
|
|
82
|
-
return this.
|
|
87
|
+
jo(t) {
|
|
88
|
+
return this.wc.Rt(t);
|
|
83
89
|
}
|
|
84
90
|
P(t) {
|
|
85
|
-
return this.
|
|
91
|
+
return this.Cc.Rt(t);
|
|
86
92
|
}
|
|
87
93
|
Tr(t) {
|
|
88
|
-
return this.
|
|
94
|
+
return this.yc.Rt(t);
|
|
89
95
|
}
|
|
90
|
-
|
|
91
|
-
return -1 !== this.
|
|
96
|
+
Ce(t) {
|
|
97
|
+
return -1 !== this.Mc().Kc.indexOf(t);
|
|
92
98
|
}
|
|
93
|
-
|
|
94
|
-
return -1 !== this.
|
|
99
|
+
qu(t) {
|
|
100
|
+
return -1 !== this.Mc().Pc.indexOf(t);
|
|
95
101
|
}
|
|
96
102
|
Dr(t) {
|
|
97
|
-
return -1 !== this.
|
|
103
|
+
return -1 !== this.Mc()._c.indexOf(t);
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
return this.
|
|
105
|
+
Oc() {
|
|
106
|
+
return this.Mc().Vc;
|
|
101
107
|
}
|
|
102
|
-
|
|
103
|
-
return this.
|
|
108
|
+
ju() {
|
|
109
|
+
return this.Mc().Gc;
|
|
104
110
|
}
|
|
105
111
|
wi() {
|
|
106
|
-
return this.
|
|
112
|
+
return this.Mc().Ic.enabled || !1;
|
|
107
113
|
}
|
|
108
|
-
|
|
109
|
-
const t = this.
|
|
114
|
+
zc() {
|
|
115
|
+
const t = this.Mc().xc;
|
|
110
116
|
return !(!t || null == t.enabled) && t.enabled;
|
|
111
117
|
}
|
|
112
|
-
|
|
113
|
-
if (!this.
|
|
114
|
-
const t = this.
|
|
118
|
+
Ac() {
|
|
119
|
+
if (!this.zc()) return -1;
|
|
120
|
+
const t = this.Mc().xc;
|
|
115
121
|
return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
|
|
116
122
|
}
|
|
117
|
-
|
|
118
|
-
if (!this.
|
|
119
|
-
const t = this.
|
|
123
|
+
Dc() {
|
|
124
|
+
if (!this.zc()) return -1;
|
|
125
|
+
const t = this.Mc().xc;
|
|
120
126
|
return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
|
|
121
127
|
}
|
|
122
|
-
|
|
123
|
-
const i = this.
|
|
128
|
+
Hc(t) {
|
|
129
|
+
const i = this.Mc().xc.endpoint_overrides;
|
|
124
130
|
return null == i ? null : i[t];
|
|
125
131
|
}
|
|
126
|
-
|
|
127
|
-
const i = this.
|
|
132
|
+
Tc(t) {
|
|
133
|
+
const i = this.Hc(t);
|
|
128
134
|
return null == i || isNaN(i.capacity) || i.capacity <= 0 ? -1 : i.capacity;
|
|
129
135
|
}
|
|
130
|
-
|
|
131
|
-
const i = this.
|
|
136
|
+
kc(t) {
|
|
137
|
+
const i = this.Hc(t);
|
|
132
138
|
return null == i || isNaN(i.refill_rate) || i.refill_rate <= 0
|
|
133
139
|
? -1
|
|
134
140
|
: i.refill_rate;
|
|
135
141
|
}
|
|
136
|
-
|
|
137
|
-
return this.
|
|
138
|
-
? (
|
|
139
|
-
: this.
|
|
142
|
+
Yr() {
|
|
143
|
+
return this.Mc().Xr.enabled && null == this.yo()
|
|
144
|
+
? (v.lt(f.Cl, { e: "Missing feature flag refresh_rate_limit." }), !1)
|
|
145
|
+
: this.Mc().Xr.enabled || !1;
|
|
140
146
|
}
|
|
141
|
-
|
|
142
|
-
return this.
|
|
147
|
+
yo() {
|
|
148
|
+
return this.Mc().Xr.refresh_rate_limit;
|
|
143
149
|
}
|
|
144
|
-
|
|
150
|
+
kt() {
|
|
145
151
|
var t;
|
|
146
152
|
return (
|
|
147
|
-
(null === (t = this.
|
|
153
|
+
(null === (t = this.Mc().banners) || void 0 === t ? void 0 : t.enabled) ||
|
|
148
154
|
null
|
|
149
155
|
);
|
|
150
156
|
}
|
|
151
|
-
|
|
157
|
+
oe() {
|
|
152
158
|
var t;
|
|
153
159
|
return (
|
|
154
|
-
(null === (t = this.
|
|
160
|
+
(null === (t = this.Mc().banners) || void 0 === t
|
|
155
161
|
? void 0
|
|
156
162
|
: t.max_placements) || 0
|
|
157
163
|
);
|
|
158
164
|
}
|
|
159
|
-
|
|
165
|
+
Ze() {
|
|
160
166
|
var t;
|
|
161
167
|
return (
|
|
162
|
-
(null === (t = this.
|
|
168
|
+
(null === (t = this.Mc().dust) || void 0 === t ? void 0 : t.enabled) || !1
|
|
163
169
|
);
|
|
164
170
|
}
|
|
171
|
+
st() {
|
|
172
|
+
var t;
|
|
173
|
+
const i =
|
|
174
|
+
null === (t = this.Mc().Jc) || void 0 === t
|
|
175
|
+
? void 0
|
|
176
|
+
: t.min_sleep_duration_ms;
|
|
177
|
+
return null != i ? i : c;
|
|
178
|
+
}
|
|
179
|
+
it() {
|
|
180
|
+
var t;
|
|
181
|
+
const i =
|
|
182
|
+
null === (t = this.Mc().Jc) || void 0 === t ? void 0 : t.scale_factor;
|
|
183
|
+
return null != i ? i : d;
|
|
184
|
+
}
|
|
185
|
+
nt() {
|
|
186
|
+
var t;
|
|
187
|
+
const i =
|
|
188
|
+
null === (t = this.Mc().Jc) || void 0 === t
|
|
189
|
+
? void 0
|
|
190
|
+
: t.max_sleep_duration_ms;
|
|
191
|
+
return null != i ? i : u;
|
|
192
|
+
}
|
|
165
193
|
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
2
|
-
import
|
|
2
|
+
import De from "../models/braze-event.js";
|
|
3
3
|
import _t from "../models/identifier.js";
|
|
4
|
-
import { convertMsToSeconds as
|
|
4
|
+
import { convertMsToSeconds as X } from "../util/date-utils.js";
|
|
5
5
|
import {
|
|
6
6
|
logger as E,
|
|
7
|
-
Guid as
|
|
8
|
-
EventTypes as
|
|
7
|
+
Guid as P,
|
|
8
|
+
EventTypes as f,
|
|
9
9
|
} from "../../shared-lib/index.js";
|
|
10
|
-
export default class
|
|
10
|
+
export default class Vt {
|
|
11
11
|
constructor(s, t, i, e) {
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
12
|
+
(this.B = s),
|
|
13
|
+
(this.vs = t),
|
|
14
14
|
(this.h = i),
|
|
15
|
-
(this.
|
|
16
|
-
(this.
|
|
17
|
-
(this.
|
|
15
|
+
(this.tm = e),
|
|
16
|
+
(this.B = s),
|
|
17
|
+
(this.vs = t),
|
|
18
18
|
(this.h = i),
|
|
19
|
-
(this.
|
|
19
|
+
(this.im = 1e3),
|
|
20
20
|
(null == e || isNaN(e)) && (e = 1800),
|
|
21
|
-
e < this.
|
|
21
|
+
e < this.im / 1e3 &&
|
|
22
22
|
(E.info(
|
|
23
23
|
"Specified session timeout of " +
|
|
24
24
|
e +
|
|
25
25
|
"s is too small, using the minimum session timeout of " +
|
|
26
|
-
this.
|
|
26
|
+
this.im / 1e3 +
|
|
27
27
|
"s instead.",
|
|
28
28
|
),
|
|
29
|
-
(e = this.
|
|
30
|
-
(this.
|
|
29
|
+
(e = this.im / 1e3)),
|
|
30
|
+
(this.tm = e);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
return new
|
|
32
|
+
nm(s, t) {
|
|
33
|
+
return new De(this.vs.getUserId(), f.hm, s, t.Tu, { d: X(s - t.lm) });
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
const t = this.
|
|
37
|
-
return null == t ? null : t.
|
|
35
|
+
yt() {
|
|
36
|
+
const t = this.B.$u(s.Ou.um);
|
|
37
|
+
return null == t ? null : t.Tu;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
am() {
|
|
40
40
|
const t = new Date().valueOf(),
|
|
41
|
-
i = this.h.
|
|
41
|
+
i = this.h.Oc();
|
|
42
42
|
if (null == i) return !1;
|
|
43
|
-
const e = this.
|
|
43
|
+
const e = this.B.dt(s.ft.dm),
|
|
44
44
|
n = null == e || t - e > 1e3 * i;
|
|
45
|
-
return n && this.
|
|
45
|
+
return n && this.B.bt(s.ft.dm, t), n;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
return null == t || null == t.
|
|
47
|
+
fm(s, t) {
|
|
48
|
+
return null == t || null == t.pm || (!(s - t.lm < this.im) && t.pm < s);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
el() {
|
|
51
51
|
const t = new Date().valueOf(),
|
|
52
|
-
i = t + 1e3 * this.
|
|
53
|
-
e = this.
|
|
54
|
-
if (this.
|
|
52
|
+
i = t + 1e3 * this.tm,
|
|
53
|
+
e = this.B.$u(s.Ou.um);
|
|
54
|
+
if (this.fm(t, e)) {
|
|
55
55
|
let n = "Generating session start event with time " + t;
|
|
56
56
|
if (null != e) {
|
|
57
|
-
let s = e.
|
|
58
|
-
s - e.
|
|
59
|
-
this.
|
|
57
|
+
let s = e.gm;
|
|
58
|
+
s - e.lm < this.im && (s = e.lm + this.im),
|
|
59
|
+
this.B.wm(this.nm(s, e)),
|
|
60
60
|
(n += " (old session ended " + s + ")");
|
|
61
61
|
}
|
|
62
62
|
(n += ". Will expire " + i.valueOf()), E.info(n);
|
|
63
|
-
const o = new _t(
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
return null == this.
|
|
63
|
+
const o = new _t(P.se(), i);
|
|
64
|
+
this.B.wm(new De(this.vs.getUserId(), f.Sm, t, o.Tu)),
|
|
65
|
+
this.B.Iu(s.Ou.um, o);
|
|
66
|
+
return null == this.B.dt(s.ft.dm) && this.B.bt(s.ft.dm, t), o.Tu;
|
|
67
67
|
}
|
|
68
|
-
if (null != e) return (e.
|
|
68
|
+
if (null != e) return (e.gm = t), (e.pm = i), this.B.Iu(s.Ou.um, e), e.Tu;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
const t = this.
|
|
70
|
+
jm() {
|
|
71
|
+
const t = this.B.$u(s.Ou.um);
|
|
72
72
|
null != t &&
|
|
73
|
-
(this.
|
|
73
|
+
(this.B.xm(s.Ou.um), this.B.wm(this.nm(new Date().valueOf(), t)));
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import ee, { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
2
|
import { logger as E } from "../../shared-lib/index.js";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
let
|
|
3
|
+
const Kt = {
|
|
4
|
+
Sl: function (e, o = !1, t) {
|
|
5
|
+
let r = !1;
|
|
6
6
|
try {
|
|
7
7
|
if (localStorage && localStorage.getItem)
|
|
8
8
|
try {
|
|
9
|
-
localStorage.setItem(s.
|
|
10
|
-
localStorage.getItem(s.
|
|
11
|
-
(localStorage.removeItem(s.
|
|
9
|
+
localStorage.setItem(s.ft.Qc, "true"),
|
|
10
|
+
localStorage.getItem(s.ft.Qc) &&
|
|
11
|
+
(localStorage.removeItem(s.ft.Qc), (r = !0));
|
|
12
12
|
} catch (e) {
|
|
13
13
|
if (
|
|
14
14
|
!(
|
|
@@ -19,17 +19,17 @@ const Gt = {
|
|
|
19
19
|
)
|
|
20
20
|
)
|
|
21
21
|
throw e;
|
|
22
|
-
|
|
22
|
+
r = !0;
|
|
23
23
|
}
|
|
24
24
|
} catch (e) {
|
|
25
25
|
E.info("Local Storage not supported!");
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
return (
|
|
27
|
+
const a = Kt.Uc(),
|
|
28
|
+
n = new ee.Wc(e, a && !o, r, t);
|
|
29
|
+
let c;
|
|
30
|
+
return (c = r ? new ee.Xc(e) : new ee.Yc()), new ee(n, c);
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
Uc: function () {
|
|
33
33
|
return (
|
|
34
34
|
navigator.cookieEnabled ||
|
|
35
35
|
("cookie" in document &&
|
|
@@ -39,4 +39,4 @@ const Gt = {
|
|
|
39
39
|
);
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
export default
|
|
42
|
+
export default Kt;
|