@sesamy/sesamy-js 1.3.13 → 1.3.14
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/dist/sesamy-js.cjs +4 -4
- package/dist/sesamy-js.iife.js +4 -4
- package/dist/sesamy-js.mjs +158 -156
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -61,19 +61,19 @@ var ae = Pt(function(t, e) {
|
|
|
61
61
|
Ot(ae);
|
|
62
62
|
var gr = Ot(Pt(function(t, e) {
|
|
63
63
|
var n = ce && ce.__awaiter || function(u, c, h, d) {
|
|
64
|
-
return new (h || (h = Promise))(function(b,
|
|
64
|
+
return new (h || (h = Promise))(function(b, y) {
|
|
65
65
|
function g(w) {
|
|
66
66
|
try {
|
|
67
67
|
_(d.next(w));
|
|
68
68
|
} catch (l) {
|
|
69
|
-
|
|
69
|
+
y(l);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function I(w) {
|
|
73
73
|
try {
|
|
74
74
|
_(d.throw(w));
|
|
75
75
|
} catch (l) {
|
|
76
|
-
|
|
76
|
+
y(l);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
function _(w) {
|
|
@@ -84,14 +84,14 @@ var gr = Ot(Pt(function(t, e) {
|
|
|
84
84
|
_((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
86
|
}, r = ce && ce.__generator || function(u, c) {
|
|
87
|
-
var h, d, b,
|
|
87
|
+
var h, d, b, y, g = { label: 0, sent: function() {
|
|
88
88
|
if (1 & b[0])
|
|
89
89
|
throw b[1];
|
|
90
90
|
return b[1];
|
|
91
91
|
}, trys: [], ops: [] };
|
|
92
|
-
return
|
|
92
|
+
return y = { next: I(0), throw: I(1), return: I(2) }, typeof Symbol == "function" && (y[Symbol.iterator] = function() {
|
|
93
93
|
return this;
|
|
94
|
-
}),
|
|
94
|
+
}), y;
|
|
95
95
|
function I(_) {
|
|
96
96
|
return function(w) {
|
|
97
97
|
return function(l) {
|
|
@@ -205,19 +205,19 @@ var gr = Ot(Pt(function(t, e) {
|
|
|
205
205
|
}
|
|
206
206
|
return u.prototype.acquireLock = function(c, h) {
|
|
207
207
|
return h === void 0 && (h = 5e3), n(this, void 0, void 0, function() {
|
|
208
|
-
var d, b,
|
|
208
|
+
var d, b, y, g, I, _, w;
|
|
209
209
|
return r(this, function(l) {
|
|
210
210
|
switch (l.label) {
|
|
211
211
|
case 0:
|
|
212
|
-
d = Date.now() + p(4), b = Date.now() + h,
|
|
212
|
+
d = Date.now() + p(4), b = Date.now() + h, y = o + "-" + c, g = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
|
|
213
213
|
case 1:
|
|
214
214
|
return Date.now() < b ? [4, s(30)] : [3, 8];
|
|
215
215
|
case 2:
|
|
216
|
-
return l.sent(), g.getItemSync(
|
|
216
|
+
return l.sent(), g.getItemSync(y) !== null ? [3, 5] : (I = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
217
217
|
case 3:
|
|
218
|
-
return l.sent(), g.setItemSync(
|
|
218
|
+
return l.sent(), g.setItemSync(y, JSON.stringify({ id: this.id, iat: d, timeoutKey: I, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
219
219
|
case 4:
|
|
220
|
-
return l.sent(), (_ = g.getItemSync(
|
|
220
|
+
return l.sent(), (_ = g.getItemSync(y)) !== null && (w = JSON.parse(_)).id === this.id && w.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(y, d), [2, !0]) : [3, 7];
|
|
221
221
|
case 5:
|
|
222
222
|
return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(b)];
|
|
223
223
|
case 6:
|
|
@@ -235,13 +235,13 @@ var gr = Ot(Pt(function(t, e) {
|
|
|
235
235
|
return r(this, function(b) {
|
|
236
236
|
return setTimeout(function() {
|
|
237
237
|
return n(d, void 0, void 0, function() {
|
|
238
|
-
var
|
|
238
|
+
var y, g, I;
|
|
239
239
|
return r(this, function(_) {
|
|
240
240
|
switch (_.label) {
|
|
241
241
|
case 0:
|
|
242
242
|
return [4, ae.default().lock(h)];
|
|
243
243
|
case 1:
|
|
244
|
-
return _.sent(), this.acquiredIatSet.has(h) ? (
|
|
244
|
+
return _.sent(), this.acquiredIatSet.has(h) ? (y = this.storageHandler === void 0 ? a : this.storageHandler, (g = y.getItemSync(c)) === null ? (ae.default().unlock(h), [2]) : ((I = JSON.parse(g)).timeRefreshed = Date.now(), y.setItemSync(c, JSON.stringify(I)), ae.default().unlock(h), this.refreshLockWhileAcquired(c, h), [2])) : (ae.default().unlock(h), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -254,11 +254,11 @@ var gr = Ot(Pt(function(t, e) {
|
|
|
254
254
|
switch (h.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
return [4, new Promise(function(d) {
|
|
257
|
-
var b = !1,
|
|
257
|
+
var b = !1, y = Date.now(), g = !1;
|
|
258
258
|
function I() {
|
|
259
259
|
if (g || (window.removeEventListener("storage", I), u.removeFromWaiting(I), clearTimeout(_), g = !0), !b) {
|
|
260
260
|
b = !0;
|
|
261
|
-
var w = 50 - (Date.now() -
|
|
261
|
+
var w = 50 - (Date.now() - y);
|
|
262
262
|
w > 0 ? setTimeout(d, w) : d(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -293,24 +293,24 @@ var gr = Ot(Pt(function(t, e) {
|
|
|
293
293
|
});
|
|
294
294
|
}, u.prototype.releaseLock__private__ = function(c) {
|
|
295
295
|
return n(this, void 0, void 0, function() {
|
|
296
|
-
var h, d, b,
|
|
296
|
+
var h, d, b, y;
|
|
297
297
|
return r(this, function(g) {
|
|
298
298
|
switch (g.label) {
|
|
299
299
|
case 0:
|
|
300
|
-
return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (b = h.getItemSync(d)) === null ? [2] : (
|
|
300
|
+
return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (b = h.getItemSync(d)) === null ? [2] : (y = JSON.parse(b)).id !== this.id ? [3, 2] : [4, ae.default().lock(y.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
g.sent(), this.acquiredIatSet.delete(
|
|
302
|
+
g.sent(), this.acquiredIatSet.delete(y.iat), h.removeItemSync(d), ae.default().unlock(y.iat), u.notifyWaiters(), g.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
}, u.lockCorrector = function(c) {
|
|
309
|
-
for (var h = Date.now() - 5e3, d = c, b = [],
|
|
310
|
-
var g = d.keySync(
|
|
309
|
+
for (var h = Date.now() - 5e3, d = c, b = [], y = 0; ; ) {
|
|
310
|
+
var g = d.keySync(y);
|
|
311
311
|
if (g === null)
|
|
312
312
|
break;
|
|
313
|
-
b.push(g),
|
|
313
|
+
b.push(g), y++;
|
|
314
314
|
}
|
|
315
315
|
for (var I = !1, _ = 0; _ < b.length; _++) {
|
|
316
316
|
var w = b[_];
|
|
@@ -395,11 +395,11 @@ const Ge = () => window.crypto, ct = () => {
|
|
|
395
395
|
async function Or(t, e) {
|
|
396
396
|
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, p = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
397
|
const f = s ? bt(p) : JSON.stringify(p);
|
|
398
|
-
return await async function(u, c, h, d, b,
|
|
398
|
+
return await async function(u, c, h, d, b, y, g) {
|
|
399
399
|
let I, _ = null;
|
|
400
400
|
for (let x = 0; x < 3; x++)
|
|
401
401
|
try {
|
|
402
|
-
I = await Er(u, h, d, b,
|
|
402
|
+
I = await Er(u, h, d, b, y, g, c), _ = null;
|
|
403
403
|
break;
|
|
404
404
|
} catch (L) {
|
|
405
405
|
_ = L;
|
|
@@ -790,7 +790,7 @@ let Rr = class {
|
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
791
791
|
return h.replace(/[+/=]/g, (b) => d[b]);
|
|
792
792
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
793
|
-
})(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, b,
|
|
793
|
+
})(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, b, y, g, I) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Me(c, h.scope), response_type: "code", response_mode: I || "query", state: d, nonce: b, redirect_uri: g || u.authorizationParams.redirect_uri, code_challenge: y, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), f = this._authorizeUrl(p);
|
|
794
794
|
return { nonce: o, code_verifier: a, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: i, url: f };
|
|
795
795
|
}
|
|
796
796
|
async loginWithPopup(e, n) {
|
|
@@ -932,7 +932,7 @@ let Rr = class {
|
|
|
932
932
|
try {
|
|
933
933
|
if (window.crossOriginIsolated)
|
|
934
934
|
throw new V("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
935
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((b,
|
|
935
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((b, y, g = 60) => new Promise((I, _) => {
|
|
936
936
|
const w = window.document.createElement("iframe");
|
|
937
937
|
w.setAttribute("width", "0"), w.setAttribute("height", "0"), w.style.display = "none";
|
|
938
938
|
const l = () => {
|
|
@@ -943,7 +943,7 @@ let Rr = class {
|
|
|
943
943
|
_(new wt()), l();
|
|
944
944
|
}, 1e3 * g);
|
|
945
945
|
k = function(P) {
|
|
946
|
-
if (P.origin !=
|
|
946
|
+
if (P.origin != y || !P.data || P.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
948
|
const x = P.source;
|
|
949
949
|
x && x.close(), P.data.response.error ? _(V.fromPayload(P.data.response)) : I(P.data.response), clearTimeout(T), window.removeEventListener("message", k, !1), setTimeout(l, 2e3);
|
|
@@ -1010,9 +1010,11 @@ async function Kr(t) {
|
|
|
1010
1010
|
try {
|
|
1011
1011
|
await X.handleRedirectCallback();
|
|
1012
1012
|
const e = await X.getUser();
|
|
1013
|
-
Et(Se.AUTHENTICATED, e)
|
|
1014
|
-
const n =
|
|
1015
|
-
|
|
1013
|
+
Et(Se.AUTHENTICATED, e);
|
|
1014
|
+
const n = new URL(location.href), r = n.searchParams;
|
|
1015
|
+
r.delete("code"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
|
|
1016
|
+
const i = await X.getTokenSilently();
|
|
1017
|
+
localStorage.setItem("accessToken", i);
|
|
1016
1018
|
} catch {
|
|
1017
1019
|
}
|
|
1018
1020
|
}
|
|
@@ -1073,7 +1075,7 @@ const Vr = (t, e) => e.skipDedupe || e.method !== "GET", Yr = (t, e) => e.method
|
|
|
1073
1075
|
let c = 0;
|
|
1074
1076
|
if (s && s(f, u))
|
|
1075
1077
|
return p(f, u);
|
|
1076
|
-
const h = (d, b) => Promise.resolve(r(d, b)).then((
|
|
1078
|
+
const h = (d, b) => Promise.resolve(r(d, b)).then((y) => y ? d && a ? d : b ? Promise.reject(b) : d : (c++, !n || c <= n ? new Promise((g) => {
|
|
1077
1079
|
const I = e(t, c);
|
|
1078
1080
|
setTimeout(() => {
|
|
1079
1081
|
typeof i == "function" ? Promise.resolve(i({
|
|
@@ -1166,7 +1168,7 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
|
|
|
1166
1168
|
});
|
|
1167
1169
|
}
|
|
1168
1170
|
return w;
|
|
1169
|
-
}),
|
|
1171
|
+
}), y = (w) => w.catch((l) => {
|
|
1170
1172
|
const k = l.hasOwnProperty(ye), T = k ? l[ye] : l, P = (T == null ? void 0 : T.status) && f.get(T.status) || f.get(T == null ? void 0 : T.name) || k && f.has(ye) && f.get(ye);
|
|
1171
1173
|
if (P)
|
|
1172
1174
|
return P(T, t);
|
|
@@ -1174,7 +1176,7 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
|
|
|
1174
1176
|
if (x)
|
|
1175
1177
|
return x(T, t);
|
|
1176
1178
|
throw T;
|
|
1177
|
-
}), g = (w) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */
|
|
1179
|
+
}), g = (w) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ y(w ? b.then((k) => k && k[w]()).then((k) => l ? l(k) : k) : b.then((k) => l ? l(k) : k)), I = {
|
|
1178
1180
|
_wretchReq: t,
|
|
1179
1181
|
_fetchReq: h,
|
|
1180
1182
|
_sharedState: e,
|
|
@@ -1333,7 +1335,7 @@ oe.errorType = ni;
|
|
|
1333
1335
|
oe.polyfills = ti;
|
|
1334
1336
|
oe.WretchError = Rn;
|
|
1335
1337
|
function ai(t) {
|
|
1336
|
-
const e = t.endpoint || `https://api2.${Dn}`, n = (
|
|
1338
|
+
const e = t.endpoint || `https://api2.${Dn}`, n = (y) => async (g, I) => {
|
|
1337
1339
|
try {
|
|
1338
1340
|
const _ = await Fr(), w = {
|
|
1339
1341
|
...I,
|
|
@@ -1342,11 +1344,11 @@ function ai(t) {
|
|
|
1342
1344
|
Authorization: `Bearer ${_}`
|
|
1343
1345
|
}
|
|
1344
1346
|
};
|
|
1345
|
-
return
|
|
1347
|
+
return y(g, w);
|
|
1346
1348
|
} catch (_) {
|
|
1347
1349
|
throw console.error("Error fetching access token:", _), _;
|
|
1348
1350
|
}
|
|
1349
|
-
}, r = (
|
|
1351
|
+
}, r = (y) => (g, I) => {
|
|
1350
1352
|
const _ = localStorage.getItem("__anon_id"), w = btoa(`${_}:`), l = {
|
|
1351
1353
|
...I,
|
|
1352
1354
|
headers: {
|
|
@@ -1354,15 +1356,15 @@ function ai(t) {
|
|
|
1354
1356
|
Authorization: `Basic ${w}`
|
|
1355
1357
|
}
|
|
1356
1358
|
};
|
|
1357
|
-
return
|
|
1359
|
+
return y(g, l);
|
|
1358
1360
|
}, i = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1359
1361
|
n,
|
|
1360
1362
|
Xt(),
|
|
1361
1363
|
Ft({
|
|
1362
1364
|
delayTimer: 1e3,
|
|
1363
|
-
delayRamp: (
|
|
1365
|
+
delayRamp: (y, g) => y * g,
|
|
1364
1366
|
maxAttempts: 3,
|
|
1365
|
-
until: (
|
|
1367
|
+
until: (y) => !!(y && (y.ok || y.status >= 400 && y.status < 500)),
|
|
1366
1368
|
retryOnNetworkError: !1
|
|
1367
1369
|
})
|
|
1368
1370
|
]), o = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
@@ -1370,41 +1372,41 @@ function ai(t) {
|
|
|
1370
1372
|
Xt(),
|
|
1371
1373
|
Ft({
|
|
1372
1374
|
delayTimer: 1e3,
|
|
1373
|
-
delayRamp: (
|
|
1375
|
+
delayRamp: (y, g) => y * g,
|
|
1374
1376
|
maxAttempts: 3,
|
|
1375
|
-
until: (
|
|
1377
|
+
until: (y) => !!(y && (y.ok || y.status >= 400 && y.status < 500)),
|
|
1376
1378
|
retryOnNetworkError: !1
|
|
1377
1379
|
})
|
|
1378
1380
|
]);
|
|
1379
1381
|
async function a() {
|
|
1380
1382
|
return i.get("/entitlements").json();
|
|
1381
1383
|
}
|
|
1382
|
-
async function s(
|
|
1384
|
+
async function s(y) {
|
|
1383
1385
|
const g = await i.get("/entitlements").json();
|
|
1384
|
-
return g == null ? void 0 : g.find((I) => I.id ===
|
|
1386
|
+
return g == null ? void 0 : g.find((I) => I.id === y);
|
|
1385
1387
|
}
|
|
1386
1388
|
async function p() {
|
|
1387
1389
|
return i.get("/contracts").json();
|
|
1388
1390
|
}
|
|
1389
|
-
async function f(
|
|
1391
|
+
async function f(y) {
|
|
1390
1392
|
const g = await i.get("/contracts").json();
|
|
1391
|
-
return g == null ? void 0 : g.find((I) => I.id ===
|
|
1393
|
+
return g == null ? void 0 : g.find((I) => I.id === y);
|
|
1392
1394
|
}
|
|
1393
1395
|
async function u() {
|
|
1394
1396
|
return i.get("/bills").json();
|
|
1395
1397
|
}
|
|
1396
|
-
async function c(
|
|
1398
|
+
async function c(y) {
|
|
1397
1399
|
const g = await i.get("/bills").json();
|
|
1398
|
-
return g == null ? void 0 : g.find((I) => I.id ===
|
|
1400
|
+
return g == null ? void 0 : g.find((I) => I.id === y);
|
|
1399
1401
|
}
|
|
1400
1402
|
async function h() {
|
|
1401
1403
|
return await o.url("/tags").get().json();
|
|
1402
1404
|
}
|
|
1403
|
-
async function d(
|
|
1404
|
-
return await o.url(`/tags/${
|
|
1405
|
+
async function d(y, g) {
|
|
1406
|
+
return await o.url(`/tags/${y}`).put(g).json();
|
|
1405
1407
|
}
|
|
1406
|
-
async function b(
|
|
1407
|
-
return await o.url(`/tags/${
|
|
1408
|
+
async function b(y, g) {
|
|
1409
|
+
return await o.url(`/tags/${y}/push`).post(g).json();
|
|
1408
1410
|
}
|
|
1409
1411
|
return {
|
|
1410
1412
|
getEntitlements: a,
|
|
@@ -1661,8 +1663,8 @@ function Hn(t, e, n) {
|
|
|
1661
1663
|
return f(), s.push(d), function() {
|
|
1662
1664
|
if (b) {
|
|
1663
1665
|
b = !1, f();
|
|
1664
|
-
var
|
|
1665
|
-
s.splice(
|
|
1666
|
+
var y = s.indexOf(d);
|
|
1667
|
+
s.splice(y, 1);
|
|
1666
1668
|
}
|
|
1667
1669
|
};
|
|
1668
1670
|
}
|
|
@@ -1678,8 +1680,8 @@ function Hn(t, e, n) {
|
|
|
1678
1680
|
} finally {
|
|
1679
1681
|
p = !1;
|
|
1680
1682
|
}
|
|
1681
|
-
for (var b = a = s,
|
|
1682
|
-
(0, b[
|
|
1683
|
+
for (var b = a = s, y = 0; y < b.length; y++)
|
|
1684
|
+
(0, b[y])();
|
|
1683
1685
|
return d;
|
|
1684
1686
|
}
|
|
1685
1687
|
return h({ type: "@@redux/INIT" }), (r = { dispatch: h, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
@@ -1688,11 +1690,11 @@ function Hn(t, e, n) {
|
|
|
1688
1690
|
i = d, h({ type: "@@redux/INIT" });
|
|
1689
1691
|
} })[qt] = function() {
|
|
1690
1692
|
var d, b = c;
|
|
1691
|
-
return (d = { subscribe: function(
|
|
1692
|
-
if (typeof
|
|
1693
|
+
return (d = { subscribe: function(y) {
|
|
1694
|
+
if (typeof y != "object")
|
|
1693
1695
|
throw new TypeError("Observer != obj");
|
|
1694
1696
|
function g() {
|
|
1695
|
-
|
|
1697
|
+
y.next && y.next(u());
|
|
1696
1698
|
}
|
|
1697
1699
|
return g(), { unsubscribe: b(g) };
|
|
1698
1700
|
} })[qt] = function() {
|
|
@@ -1744,12 +1746,12 @@ function Pi(t) {
|
|
|
1744
1746
|
s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), f || e(fe, a.userId), p.traits && e(ke, O({}, f && s.traits ? s.traits : {}, p.traits));
|
|
1745
1747
|
var u = Object.keys(i.params);
|
|
1746
1748
|
if (u.length) {
|
|
1747
|
-
var c = o.an_uid, h = o.an_event, d = u.reduce(function(b,
|
|
1748
|
-
if (
|
|
1749
|
-
var g =
|
|
1750
|
-
b.campaign[g === "campaign" ? "name" : g] = o[
|
|
1749
|
+
var c = o.an_uid, h = o.an_event, d = u.reduce(function(b, y) {
|
|
1750
|
+
if (y.match(Qt) || y.match(/^(d|g)clid/)) {
|
|
1751
|
+
var g = y.replace(Qt, "");
|
|
1752
|
+
b.campaign[g === "campaign" ? "name" : g] = o[y];
|
|
1751
1753
|
}
|
|
1752
|
-
return
|
|
1754
|
+
return y.match(en) && (b.props[y.replace(en, "")] = o[y]), y.match(tn) && (b.traits[y.replace(tn, "")] = o[y]), b;
|
|
1753
1755
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1754
1756
|
n.dispatch(O({ type: E.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1755
1757
|
return t.identify(c, d.traits);
|
|
@@ -1833,14 +1835,14 @@ function Yn(t, e, n) {
|
|
|
1833
1835
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1834
1836
|
if (f.processIndex && f.processIndex.length) {
|
|
1835
1837
|
f.processIndex.forEach(function(c) {
|
|
1836
|
-
var h = s.actions[c], d = h.plugin, b = h.payload.type,
|
|
1837
|
-
if (
|
|
1838
|
+
var h = s.actions[c], d = h.plugin, b = h.payload.type, y = i[d][b];
|
|
1839
|
+
if (y && G(y)) {
|
|
1838
1840
|
var g, I = function(l, k) {
|
|
1839
1841
|
return l === void 0 && (l = {}), k === void 0 && (k = {}), [te, be].reduce(function(T, P) {
|
|
1840
1842
|
return l.hasOwnProperty(P) && k[P] && k[P] !== l[P] && (T[P] = k[P]), T;
|
|
1841
1843
|
}, l);
|
|
1842
1844
|
}(h.payload, p), _ = r[I.meta.rid];
|
|
1843
|
-
if (!_ && (g =
|
|
1845
|
+
if (!_ && (g = y({ payload: I, config: a[d].config, instance: n, abort: xi })) && J(g) && g.abort)
|
|
1844
1846
|
return void (r[I.meta.rid] = !0);
|
|
1845
1847
|
if (!_) {
|
|
1846
1848
|
var w = b + ":" + d;
|
|
@@ -1882,7 +1884,7 @@ var ht = function(t) {
|
|
|
1882
1884
|
}(_, P);
|
|
1883
1885
|
return { payload: Ci(_), instance: g, config: k || {}, abort: x };
|
|
1884
1886
|
};
|
|
1885
|
-
}(r, d),
|
|
1887
|
+
}(r, d), y = e.exact.reduce(function(g, I) {
|
|
1886
1888
|
var _ = I.pluginName, w = I.methodName, l = !1;
|
|
1887
1889
|
return w.match(/^initialize/) || w.match(/^reset/) || (l = !f[_].loaded), u.offline && w.match(/^(page|track|identify)/) && (l = !0), g["" + _] = l, g;
|
|
1888
1890
|
}, {});
|
|
@@ -1936,7 +1938,7 @@ var ht = function(t) {
|
|
|
1936
1938
|
return ft({ data: x, method: c, instance: r, pluginName: k, store: s }), Promise.resolve(P);
|
|
1937
1939
|
if (pt(P, k))
|
|
1938
1940
|
return l && ft({ data: P, method: c, instance: r, store: s }), Promise.resolve(P);
|
|
1939
|
-
if (
|
|
1941
|
+
if (y.hasOwnProperty(k) && y[k] === !0)
|
|
1940
1942
|
return s.dispatch({ type: "queue", plugin: k, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(P);
|
|
1941
1943
|
var L = b(g[k], o[k]);
|
|
1942
1944
|
return Promise.resolve(T[c]({ abort: L.abort, payload: x, instance: r, config: sn(k, f, o), plugins: f })).then(function(D) {
|
|
@@ -2030,14 +2032,14 @@ function $i(t, e, n) {
|
|
|
2030
2032
|
return u.includes(l);
|
|
2031
2033
|
}).map(function(l) {
|
|
2032
2034
|
return h[l];
|
|
2033
|
-
}),
|
|
2035
|
+
}), y = [], g = [], I = a.disabled, _ = b.map(function(l) {
|
|
2034
2036
|
var k = l.loaded, T = l.name, P = l.config;
|
|
2035
2037
|
return Vn(l, function() {
|
|
2036
2038
|
return k({ config: P });
|
|
2037
2039
|
}, 1e4).then(function(x) {
|
|
2038
2040
|
return r[T] || (i.dispatch({ type: E.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(L) {
|
|
2039
2041
|
return !It.includes(L);
|
|
2040
|
-
}) }), r[T] = !0),
|
|
2042
|
+
}) }), r[T] = !0), y = y.concat(T), l;
|
|
2041
2043
|
}).catch(function(x) {
|
|
2042
2044
|
if (x instanceof Error)
|
|
2043
2045
|
throw new Error(x);
|
|
@@ -2045,7 +2047,7 @@ function $i(t, e, n) {
|
|
|
2045
2047
|
});
|
|
2046
2048
|
});
|
|
2047
2049
|
Promise.all(_).then(function(l) {
|
|
2048
|
-
var k = { plugins:
|
|
2050
|
+
var k = { plugins: y, failed: g, disabled: I };
|
|
2049
2051
|
setTimeout(function() {
|
|
2050
2052
|
d.length === _.length + I.length && i.dispatch(O({}, { type: E.ready }, k));
|
|
2051
2053
|
}, 0);
|
|
@@ -2061,32 +2063,32 @@ function $i(t, e, n) {
|
|
|
2061
2063
|
if (l._ && l._.called)
|
|
2062
2064
|
return Promise.resolve(l);
|
|
2063
2065
|
var U = T.getState(), H = (K = L, (M = U.plugins) === void 0 && (M = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
|
|
2064
|
-
var
|
|
2065
|
-
return fi(
|
|
2066
|
+
var v = Ce.plugins || {};
|
|
2067
|
+
return fi(v[m]) ? v[m] : v.all !== !1 && (!M[m] || M[m].enabled !== !1);
|
|
2066
2068
|
}).map(function(m) {
|
|
2067
2069
|
return K[m];
|
|
2068
2070
|
}));
|
|
2069
2071
|
D === E.initializeStart && l.fromEnable && (H = Object.keys(U.plugins).filter(function(m) {
|
|
2070
|
-
var
|
|
2071
|
-
return l.plugins.includes(m) && !
|
|
2072
|
+
var v = U.plugins[m];
|
|
2073
|
+
return l.plugins.includes(m) && !v.initialized;
|
|
2072
2074
|
}).map(function(m) {
|
|
2073
2075
|
return L[m];
|
|
2074
2076
|
}));
|
|
2075
2077
|
var Z = H.map(function(m) {
|
|
2076
2078
|
return m.name;
|
|
2077
|
-
}), j = function(m,
|
|
2079
|
+
}), j = function(m, v, S) {
|
|
2078
2080
|
var C = un(m).map(function($) {
|
|
2079
|
-
return cn($,
|
|
2081
|
+
return cn($, v);
|
|
2080
2082
|
});
|
|
2081
|
-
return
|
|
2083
|
+
return v.reduce(function($, z) {
|
|
2082
2084
|
var W = z.name, N = un(m, W).map(function($e) {
|
|
2083
|
-
return cn($e,
|
|
2085
|
+
return cn($e, v);
|
|
2084
2086
|
}), R = N[0], A = N[1], q = N[2];
|
|
2085
2087
|
return R.length && ($.beforeNS[W] = R), A.length && ($.duringNS[W] = A), q.length && ($.afterNS[W] = q), $;
|
|
2086
2088
|
}, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
|
|
2087
2089
|
}(D, H);
|
|
2088
2090
|
return Promise.resolve(ht({ action: l, data: { exact: j.before, namespaced: j.beforeNS }, state: U, allPlugins: L, allMatches: j, instance: T, store: P, EVENTS: x })).then(function(m) {
|
|
2089
|
-
function
|
|
2091
|
+
function v() {
|
|
2090
2092
|
var $ = function() {
|
|
2091
2093
|
if (D.match(Ie))
|
|
2092
2094
|
return Promise.resolve(ht({ action: O({}, S, { type: F + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: U, allPlugins: L, allMatches: j, instance: T, store: P, EVENTS: x })).then(function(z) {
|
|
@@ -2106,7 +2108,7 @@ function $i(t, e, n) {
|
|
|
2106
2108
|
});
|
|
2107
2109
|
S = m;
|
|
2108
2110
|
}();
|
|
2109
|
-
return C && C.then ? C.then(
|
|
2111
|
+
return C && C.then ? C.then(v) : v();
|
|
2110
2112
|
});
|
|
2111
2113
|
} catch (m) {
|
|
2112
2114
|
return Promise.reject(m);
|
|
@@ -2242,7 +2244,7 @@ var Qn, er, tr, nr, Wi = function(t) {
|
|
|
2242
2244
|
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, p = o.hash, f = o.search, u = function(h) {
|
|
2243
2245
|
var d = function() {
|
|
2244
2246
|
if (Y) {
|
|
2245
|
-
for (var b,
|
|
2247
|
+
for (var b, y = document.getElementsByTagName("link"), g = 0; b = y[g]; g++)
|
|
2246
2248
|
if (b.getAttribute("rel") === "canonical")
|
|
2247
2249
|
return b.getAttribute("href");
|
|
2248
2250
|
}
|
|
@@ -2332,32 +2334,32 @@ function gn(t, e, n) {
|
|
|
2332
2334
|
}
|
|
2333
2335
|
function Vi(t) {
|
|
2334
2336
|
t === void 0 && (t = {});
|
|
2335
|
-
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m,
|
|
2336
|
-
if (G(
|
|
2337
|
-
return m.middlewares = m.middlewares.concat(
|
|
2338
|
-
if (
|
|
2337
|
+
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, v) {
|
|
2338
|
+
if (G(v))
|
|
2339
|
+
return m.middlewares = m.middlewares.concat(v), m;
|
|
2340
|
+
if (v.NAMESPACE && (v.name = v.NAMESPACE), !v.name)
|
|
2339
2341
|
throw new Error("https://lytics.dev/errors/1");
|
|
2340
|
-
|
|
2341
|
-
var S =
|
|
2342
|
-
return
|
|
2342
|
+
v.config || (v.config = {});
|
|
2343
|
+
var S = v.EVENTS ? Object.keys(v.EVENTS).map(function(z) {
|
|
2344
|
+
return v.EVENTS[z];
|
|
2343
2345
|
}) : [];
|
|
2344
|
-
m.pluginEnabled[
|
|
2346
|
+
m.pluginEnabled[v.name] = !(v.enabled === !1 || v.config.enabled === !1), delete v.enabled, v.methods && (m.methods[v.name] = Object.keys(v.methods).reduce(function(z, W) {
|
|
2345
2347
|
var N;
|
|
2346
|
-
return z[W] = (N =
|
|
2348
|
+
return z[W] = (N = v.methods[W], function() {
|
|
2347
2349
|
for (var R = Array.prototype.slice.call(arguments), A = new Array(N.length), q = 0; q < R.length; q++)
|
|
2348
2350
|
A[q] = R[q];
|
|
2349
2351
|
return A[A.length] = k, N.apply({ instance: k }, A);
|
|
2350
2352
|
}), z;
|
|
2351
|
-
}, {}), delete
|
|
2352
|
-
var C = Object.keys(
|
|
2353
|
-
if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(
|
|
2354
|
-
throw new Error(
|
|
2355
|
-
return m.plugins[
|
|
2353
|
+
}, {}), delete v.methods);
|
|
2354
|
+
var C = Object.keys(v).concat(S), $ = new Set(m.events.concat(C));
|
|
2355
|
+
if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(v), m.plugins[v.name])
|
|
2356
|
+
throw new Error(v.name + "AlreadyLoaded");
|
|
2357
|
+
return m.plugins[v.name] = v, m.plugins[v.name].loaded || (m.plugins[v.name].loaded = function() {
|
|
2356
2358
|
return !0;
|
|
2357
2359
|
}), m;
|
|
2358
2360
|
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: me, setItem: ge, removeItem: je }, o = /* @__PURE__ */ function(m) {
|
|
2359
|
-
return function(
|
|
2360
|
-
return S.getState("user")[
|
|
2361
|
+
return function(v, S, C) {
|
|
2362
|
+
return S.getState("user")[v] || (C && J(C) && C[v] ? C[v] : nn(m)[v] || me(_t(v)) || null);
|
|
2361
2363
|
};
|
|
2362
2364
|
}(i), a = r.plugins, s = r.events.filter(function(m) {
|
|
2363
2365
|
return !It.includes(m);
|
|
@@ -2365,46 +2367,46 @@ function Vi(t) {
|
|
|
2365
2367
|
return !It.includes(m);
|
|
2366
2368
|
})), f = Array.from(p).sort(), u = function() {
|
|
2367
2369
|
return a;
|
|
2368
|
-
}, c = new Ai(), h = c.addMiddleware, d = c.removeMiddleware, b = c.dynamicMiddlewares,
|
|
2370
|
+
}, c = new Ai(), h = c.addMiddleware, d = c.removeMiddleware, b = c.dynamicMiddlewares, y = function() {
|
|
2369
2371
|
throw new Error("Abort disabled inListener");
|
|
2370
2372
|
}, g = Ii(), I = nn(i), _ = O({}, I, n, g.an_uid ? { userId: g.an_uid } : {}, g.an_aid ? { anonymousId: g.an_aid } : {});
|
|
2371
2373
|
_.anonymousId || (_.anonymousId = it());
|
|
2372
|
-
var w = O({ enable: function(m,
|
|
2374
|
+
var w = O({ enable: function(m, v) {
|
|
2373
2375
|
return new Promise(function(S) {
|
|
2374
|
-
j.dispatch({ type: E.enablePlugin, plugins: mt(m), _: { originalAction: E.enablePlugin } }, S, [
|
|
2376
|
+
j.dispatch({ type: E.enablePlugin, plugins: mt(m), _: { originalAction: E.enablePlugin } }, S, [v]);
|
|
2375
2377
|
});
|
|
2376
|
-
}, disable: function(m,
|
|
2378
|
+
}, disable: function(m, v) {
|
|
2377
2379
|
return new Promise(function(S) {
|
|
2378
|
-
j.dispatch({ type: E.disablePlugin, plugins: mt(m), _: { originalAction: E.disablePlugin } }, S, [
|
|
2380
|
+
j.dispatch({ type: E.disablePlugin, plugins: mt(m), _: { originalAction: E.disablePlugin } }, S, [v]);
|
|
2379
2381
|
});
|
|
2380
|
-
} }, r.methods), l = !1, k = { identify: function(m,
|
|
2382
|
+
} }, r.methods), l = !1, k = { identify: function(m, v, S, C) {
|
|
2381
2383
|
try {
|
|
2382
|
-
var $ = re(m) ? m : null, z = J(m) ? m :
|
|
2384
|
+
var $ = re(m) ? m : null, z = J(m) ? m : v, W = S || {}, N = k.user();
|
|
2383
2385
|
ge(_t(te), $);
|
|
2384
2386
|
var R = $ || z.userId || o(te, k, z);
|
|
2385
2387
|
return Promise.resolve(new Promise(function(A) {
|
|
2386
|
-
j.dispatch(O({ type: E.identifyStart, userId: R, traits: z || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== $ && { previousId: N.id }), A, [
|
|
2388
|
+
j.dispatch(O({ type: E.identifyStart, userId: R, traits: z || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== $ && { previousId: N.id }), A, [v, S, C]);
|
|
2387
2389
|
}));
|
|
2388
2390
|
} catch (A) {
|
|
2389
2391
|
return Promise.reject(A);
|
|
2390
2392
|
}
|
|
2391
|
-
}, track: function(m,
|
|
2393
|
+
}, track: function(m, v, S, C) {
|
|
2392
2394
|
try {
|
|
2393
2395
|
var $ = J(m) ? m.event : m;
|
|
2394
2396
|
if (!$ || !re($))
|
|
2395
2397
|
throw new Error("EventMissing");
|
|
2396
|
-
var z = J(m) ? m :
|
|
2398
|
+
var z = J(m) ? m : v || {}, W = J(S) ? S : {};
|
|
2397
2399
|
return Promise.resolve(new Promise(function(N) {
|
|
2398
|
-
j.dispatch({ type: E.trackStart, event: $, properties: z, options: W, userId: o(te, k,
|
|
2400
|
+
j.dispatch({ type: E.trackStart, event: $, properties: z, options: W, userId: o(te, k, v), anonymousId: o(be, k, v) }, N, [v, S, C]);
|
|
2399
2401
|
}));
|
|
2400
2402
|
} catch (N) {
|
|
2401
2403
|
return Promise.reject(N);
|
|
2402
2404
|
}
|
|
2403
|
-
}, page: function(m,
|
|
2405
|
+
}, page: function(m, v, S) {
|
|
2404
2406
|
try {
|
|
2405
|
-
var C = J(m) ? m : {}, $ = J(
|
|
2407
|
+
var C = J(m) ? m : {}, $ = J(v) ? v : {};
|
|
2406
2408
|
return Promise.resolve(new Promise(function(z) {
|
|
2407
|
-
j.dispatch({ type: E.pageStart, properties: Wi(C), options: $, userId: o(te, k, C), anonymousId: o(be, k, C) }, z, [m,
|
|
2409
|
+
j.dispatch({ type: E.pageStart, properties: Wi(C), options: $, userId: o(te, k, C), anonymousId: o(be, k, C) }, z, [m, v, S]);
|
|
2408
2410
|
}));
|
|
2409
2411
|
} catch (z) {
|
|
2410
2412
|
return Promise.reject(z);
|
|
@@ -2414,18 +2416,18 @@ function Vi(t) {
|
|
|
2414
2416
|
return o(te, k);
|
|
2415
2417
|
if (m === be || m === "anonId")
|
|
2416
2418
|
return o(be, k);
|
|
2417
|
-
var
|
|
2418
|
-
return m ? Yt(
|
|
2419
|
+
var v = k.getState("user");
|
|
2420
|
+
return m ? Yt(v, m) : v;
|
|
2419
2421
|
}, reset: function(m) {
|
|
2420
|
-
return new Promise(function(
|
|
2421
|
-
j.dispatch({ type: E.resetStart },
|
|
2422
|
+
return new Promise(function(v) {
|
|
2423
|
+
j.dispatch({ type: E.resetStart }, v, m);
|
|
2422
2424
|
});
|
|
2423
2425
|
}, ready: function(m) {
|
|
2424
|
-
return l && m({ plugins: w, instance: k }), k.on(E.ready, function(
|
|
2425
|
-
m(
|
|
2426
|
+
return l && m({ plugins: w, instance: k }), k.on(E.ready, function(v) {
|
|
2427
|
+
m(v), l = !0;
|
|
2426
2428
|
});
|
|
2427
|
-
}, on: function(m,
|
|
2428
|
-
if (!m || !G(
|
|
2429
|
+
}, on: function(m, v) {
|
|
2430
|
+
if (!m || !G(v))
|
|
2429
2431
|
return !1;
|
|
2430
2432
|
if (m === E.bootstrap)
|
|
2431
2433
|
throw new Error(".on disabled for " + m);
|
|
@@ -2434,13 +2436,13 @@ function Vi(t) {
|
|
|
2434
2436
|
var C = function(N) {
|
|
2435
2437
|
return function(R) {
|
|
2436
2438
|
return function(A) {
|
|
2437
|
-
return A.type.match(S) &&
|
|
2439
|
+
return A.type.match(S) && v({ payload: A, instance: k, plugins: a }), R(A);
|
|
2438
2440
|
};
|
|
2439
2441
|
};
|
|
2440
2442
|
}, $ = function(N) {
|
|
2441
2443
|
return function(R) {
|
|
2442
2444
|
return function(A) {
|
|
2443
|
-
return A.type.match(S) ||
|
|
2445
|
+
return A.type.match(S) || v({ payload: A, instance: k, plugins: a }), R(A);
|
|
2444
2446
|
};
|
|
2445
2447
|
};
|
|
2446
2448
|
};
|
|
@@ -2451,41 +2453,41 @@ function Vi(t) {
|
|
|
2451
2453
|
var z = m.match(S) ? He : Ve, W = function(N) {
|
|
2452
2454
|
return function(R) {
|
|
2453
2455
|
return function(A) {
|
|
2454
|
-
return A.type === m &&
|
|
2456
|
+
return A.type === m && v({ payload: A, instance: k, plugins: a, abort: y }), R(A);
|
|
2455
2457
|
};
|
|
2456
2458
|
};
|
|
2457
2459
|
};
|
|
2458
2460
|
return h(W, z), function() {
|
|
2459
2461
|
return d(W, z);
|
|
2460
2462
|
};
|
|
2461
|
-
}, once: function(m,
|
|
2462
|
-
if (!m || !G(
|
|
2463
|
+
}, once: function(m, v) {
|
|
2464
|
+
if (!m || !G(v))
|
|
2463
2465
|
return !1;
|
|
2464
2466
|
if (m === E.bootstrap)
|
|
2465
2467
|
throw new Error(".once disabled for " + m);
|
|
2466
2468
|
var S = k.on(m, function(C) {
|
|
2467
|
-
|
|
2469
|
+
v({ payload: C.payload, instance: k, plugins: a, abort: y }), S();
|
|
2468
2470
|
});
|
|
2469
2471
|
return S;
|
|
2470
2472
|
}, getState: function(m) {
|
|
2471
|
-
var
|
|
2472
|
-
return m ? Yt(
|
|
2473
|
+
var v = j.getState();
|
|
2474
|
+
return m ? Yt(v, m) : Object.assign({}, v);
|
|
2473
2475
|
}, dispatch: function(m) {
|
|
2474
|
-
var
|
|
2475
|
-
if (Be.includes(
|
|
2476
|
-
throw new Error("reserved action " +
|
|
2477
|
-
var S = O({},
|
|
2476
|
+
var v = re(m) ? { type: m } : m;
|
|
2477
|
+
if (Be.includes(v.type))
|
|
2478
|
+
throw new Error("reserved action " + v.type);
|
|
2479
|
+
var S = O({}, v, { _: O({ originalAction: v.type }, m._ || {}) });
|
|
2478
2480
|
j.dispatch(S);
|
|
2479
|
-
}, enablePlugin: w.enable, disablePlugin: w.disable, plugins: w, storage: { getItem: i.getItem, setItem: function(m,
|
|
2480
|
-
j.dispatch({ type: E.setItemStart, key: m, value:
|
|
2481
|
-
}, removeItem: function(m,
|
|
2482
|
-
j.dispatch({ type: E.removeItemStart, key: m, options:
|
|
2483
|
-
} }, setAnonymousId: function(m,
|
|
2484
|
-
k.storage.setItem(ie, m,
|
|
2481
|
+
}, enablePlugin: w.enable, disablePlugin: w.disable, plugins: w, storage: { getItem: i.getItem, setItem: function(m, v, S) {
|
|
2482
|
+
j.dispatch({ type: E.setItemStart, key: m, value: v, options: S });
|
|
2483
|
+
}, removeItem: function(m, v) {
|
|
2484
|
+
j.dispatch({ type: E.removeItemStart, key: m, options: v });
|
|
2485
|
+
} }, setAnonymousId: function(m, v) {
|
|
2486
|
+
k.storage.setItem(ie, m, v);
|
|
2485
2487
|
}, events: { core: Be, plugins: s } }, T = r.middlewares.concat([function(m) {
|
|
2486
|
-
return function(
|
|
2488
|
+
return function(v) {
|
|
2487
2489
|
return function(S) {
|
|
2488
|
-
return S.meta || (S.meta = gn()),
|
|
2490
|
+
return S.meta || (S.meta = gn()), v(S);
|
|
2489
2491
|
};
|
|
2490
2492
|
};
|
|
2491
2493
|
}, b(He), $i(k, u, { all: f, plugins: s }), zi(i), Pi(k), ji(k), b(Ve)]), P = { context: Ji, user: Ti(i), page: Mi, track: Li, plugins: Ni(u), queue: Ri }, x = Te, L = Te;
|
|
@@ -2496,15 +2498,15 @@ function Vi(t) {
|
|
|
2496
2498
|
};
|
|
2497
2499
|
}
|
|
2498
2500
|
var F, U = function(m) {
|
|
2499
|
-
return Object.keys(m).reduce(function(
|
|
2500
|
-
return Xi.includes(S) || (
|
|
2501
|
+
return Object.keys(m).reduce(function(v, S) {
|
|
2502
|
+
return Xi.includes(S) || (v[S] = m[S]), v;
|
|
2501
2503
|
}, {});
|
|
2502
|
-
}(t), H = r.pluginsArray.reduce(function(m,
|
|
2503
|
-
var S =
|
|
2504
|
-
return m[S] = { enabled: z, initialized: !!z && !
|
|
2504
|
+
}(t), H = r.pluginsArray.reduce(function(m, v) {
|
|
2505
|
+
var S = v.name, C = v.config, $ = v.loaded, z = r.pluginEnabled[S];
|
|
2506
|
+
return m[S] = { enabled: z, initialized: !!z && !v.initialize, loaded: !!$({ config: C }), config: C }, m;
|
|
2505
2507
|
}, {}), Z = { context: U, user: _, plugins: H }, j = Hn(function(m) {
|
|
2506
|
-
for (var
|
|
2507
|
-
var $ =
|
|
2508
|
+
for (var v = Object.keys(m), S = {}, C = 0; C < v.length; C++) {
|
|
2509
|
+
var $ = v[C];
|
|
2508
2510
|
typeof m[$] === ne && (S[$] = m[$]);
|
|
2509
2511
|
}
|
|
2510
2512
|
var z, W = Object.keys(S);
|
|
@@ -2533,8 +2535,8 @@ function Vi(t) {
|
|
|
2533
2535
|
return A ? q : N;
|
|
2534
2536
|
};
|
|
2535
2537
|
}(O({}, P, e)), Z, L(x(Oi.apply(void 0, T))));
|
|
2536
|
-
j.dispatch = (F = j.dispatch, function(m,
|
|
2537
|
-
var C = O({}, m, { meta: gn(m.meta,
|
|
2538
|
+
j.dispatch = (F = j.dispatch, function(m, v, S) {
|
|
2539
|
+
var C = O({}, m, { meta: gn(m.meta, v, mt(S)) });
|
|
2538
2540
|
return F.apply(null, [C]);
|
|
2539
2541
|
});
|
|
2540
2542
|
var K = Object.keys(a);
|
|
@@ -2544,14 +2546,14 @@ function Vi(t) {
|
|
|
2544
2546
|
}), Ce = K.filter(function(m) {
|
|
2545
2547
|
return !r.pluginEnabled[m];
|
|
2546
2548
|
});
|
|
2547
|
-
return j.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m,
|
|
2549
|
+
return j.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, v) {
|
|
2548
2550
|
var S = m.bootstrap, C = m.config, $ = m.name;
|
|
2549
|
-
S && G(S) && S({ instance: k, config: C, payload: m }), j.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length ===
|
|
2551
|
+
S && G(S) && S({ instance: k, config: C, payload: m }), j.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length === v + 1 && j.dispatch({ type: E.initializeStart, plugins: M, disabled: Ce });
|
|
2550
2552
|
}), Hi(function(m) {
|
|
2551
2553
|
j.dispatch({ type: m ? E.offline : E.online });
|
|
2552
|
-
}), function(m,
|
|
2554
|
+
}), function(m, v, S) {
|
|
2553
2555
|
setInterval(function() {
|
|
2554
|
-
return Yn(m,
|
|
2556
|
+
return Yn(m, v, S);
|
|
2555
2557
|
}, 3e3);
|
|
2556
2558
|
}(j, u, k), k;
|
|
2557
2559
|
}
|
|
@@ -2752,8 +2754,8 @@ function ho(t) {
|
|
|
2752
2754
|
for (var h = c ? "add" + wn : "remove" + wn, d = 0; d < p.length; d++) {
|
|
2753
2755
|
var b = p[d];
|
|
2754
2756
|
f[d] = c ? a && a.once ? fo(o) : o : f[d] || o;
|
|
2755
|
-
for (var
|
|
2756
|
-
b[h] ? b["on" + s[
|
|
2757
|
+
for (var y = 0; y < s.length; y++)
|
|
2758
|
+
b[h] ? b["on" + s[y]] = c ? f[d] : null : b[h](s[y], f[d], a);
|
|
2757
2759
|
}
|
|
2758
2760
|
return u.bind(null, !c);
|
|
2759
2761
|
}(t);
|
|
@@ -2847,10 +2849,10 @@ function vo(t) {
|
|
|
2847
2849
|
u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ae(h), g));
|
|
2848
2850
|
}, s);
|
|
2849
2851
|
}
|
|
2850
|
-
var
|
|
2852
|
+
var y = yo(b, { throttle: f });
|
|
2851
2853
|
return { disable: function() {
|
|
2852
2854
|
c = !0, u = !1, d();
|
|
2853
|
-
var g =
|
|
2855
|
+
var g = y();
|
|
2854
2856
|
return function() {
|
|
2855
2857
|
return c = !1, h = /* @__PURE__ */ new Date(), b({ type: "load" }), g();
|
|
2856
2858
|
};
|