@sesamy/sesamy-js 1.1.0 → 1.2.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 +17 -4
- package/dist/sesamy-js.es.js +383 -359
- package/dist/sesamy-js.umd.js +7 -7
- package/package.json +10 -2
package/dist/sesamy-js.es.js
CHANGED
|
@@ -25,7 +25,7 @@ var G = (t, e, n) => (yr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
|
25
25
|
fetch(i.href, o);
|
|
26
26
|
}
|
|
27
27
|
})();
|
|
28
|
-
function
|
|
28
|
+
function rt(t, e) {
|
|
29
29
|
const n = new CustomEvent(t, {
|
|
30
30
|
detail: e,
|
|
31
31
|
bubbles: !0,
|
|
@@ -351,7 +351,7 @@ var vr = Tt(jt(function(t, e) {
|
|
|
351
351
|
}();
|
|
352
352
|
e.default = p;
|
|
353
353
|
}));
|
|
354
|
-
const wr = { timeoutInSeconds: 60 },
|
|
354
|
+
const wr = { timeoutInSeconds: 60 }, En = { name: "auth0-spa-js", version: "2.1.3" }, On = () => Date.now();
|
|
355
355
|
let V = class kt extends Error {
|
|
356
356
|
constructor(e, n) {
|
|
357
357
|
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, kt.prototype);
|
|
@@ -359,42 +359,42 @@ let V = class kt extends Error {
|
|
|
359
359
|
static fromPayload({ error: e, error_description: n }) {
|
|
360
360
|
return new kt(e, n);
|
|
361
361
|
}
|
|
362
|
-
}, br = class
|
|
362
|
+
}, br = class Pn extends V {
|
|
363
363
|
constructor(e, n, r, i = null) {
|
|
364
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
364
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Pn.prototype);
|
|
365
365
|
}
|
|
366
|
-
}, It = class
|
|
366
|
+
}, It = class Tn extends V {
|
|
367
367
|
constructor() {
|
|
368
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
368
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, Tn.prototype);
|
|
369
369
|
}
|
|
370
|
-
}, kr = class
|
|
370
|
+
}, kr = class jn extends It {
|
|
371
371
|
constructor(e) {
|
|
372
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
372
|
+
super(), this.popup = e, Object.setPrototypeOf(this, jn.prototype);
|
|
373
373
|
}
|
|
374
|
-
}, Ir = class
|
|
374
|
+
}, Ir = class xn extends V {
|
|
375
375
|
constructor(e) {
|
|
376
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
376
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, xn.prototype);
|
|
377
377
|
}
|
|
378
|
-
}, _r = class
|
|
378
|
+
}, _r = class Cn extends V {
|
|
379
379
|
constructor(e, n, r) {
|
|
380
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
380
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Cn.prototype);
|
|
381
381
|
}
|
|
382
|
-
},
|
|
382
|
+
}, $n = class An extends V {
|
|
383
383
|
constructor(e, n) {
|
|
384
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
384
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Wt(e, ["default"])}', scope: '${Wt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, An.prototype);
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
function
|
|
387
|
+
function Wt(t, e = []) {
|
|
388
388
|
return t && !e.includes(t) ? t : "";
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const Be = () => window.crypto, dt = () => {
|
|
391
391
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
392
392
|
let e = "";
|
|
393
|
-
return Array.from(
|
|
394
|
-
},
|
|
393
|
+
return Array.from(Be().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
394
|
+
}, Zt = (t) => btoa(t), _t = (t) => {
|
|
395
395
|
var { clientId: e } = t, n = Q(t, ["clientId"]);
|
|
396
396
|
return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
|
|
397
|
-
},
|
|
397
|
+
}, Kt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Sr = async (t, e) => {
|
|
398
398
|
const n = await fetch(t, e);
|
|
399
399
|
return { ok: n.ok, json: await n.json() };
|
|
400
400
|
}, Er = async (t, e, n) => {
|
|
@@ -433,10 +433,10 @@ async function Tr(t, e) {
|
|
|
433
433
|
const y = I.json, { error: l, error_description: b } = y, T = Q(y, ["error", "error_description"]), { ok: P } = I;
|
|
434
434
|
if (!P) {
|
|
435
435
|
const x = b || `HTTP error. Unable to fetch ${u}`;
|
|
436
|
-
throw l === "mfa_required" ? new _r(l, x, T.mfa_token) : l === "missing_refresh_token" ? new
|
|
436
|
+
throw l === "mfa_required" ? new _r(l, x, T.mfa_token) : l === "missing_refresh_token" ? new $n(h, d) : new V(l || "request_error", x);
|
|
437
437
|
}
|
|
438
438
|
return T;
|
|
439
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a ||
|
|
439
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || En)) } }, e, s);
|
|
440
440
|
}
|
|
441
441
|
const Xe = (...t) => {
|
|
442
442
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
@@ -476,7 +476,7 @@ let de = class St {
|
|
|
476
476
|
allKeys() {
|
|
477
477
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
478
478
|
}
|
|
479
|
-
},
|
|
479
|
+
}, zn = class {
|
|
480
480
|
constructor() {
|
|
481
481
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
482
482
|
let e = {};
|
|
@@ -493,7 +493,7 @@ let de = class St {
|
|
|
493
493
|
}
|
|
494
494
|
}, xr = class {
|
|
495
495
|
constructor(e, n, r) {
|
|
496
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
496
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || On;
|
|
497
497
|
}
|
|
498
498
|
async setIdToken(e, n, r) {
|
|
499
499
|
var i;
|
|
@@ -575,10 +575,10 @@ const ze = (t) => typeof t == "number", $r = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
575
575
|
const a = o.split("."), [s, m, p] = a;
|
|
576
576
|
if (a.length !== 3 || !s || !m || !p)
|
|
577
577
|
throw new Error("ID token could not be decoded");
|
|
578
|
-
const u = JSON.parse(
|
|
578
|
+
const u = JSON.parse(Kt(m)), c = { __raw: o }, h = {};
|
|
579
579
|
return Object.keys(u).forEach((d) => {
|
|
580
580
|
c[d] = u[d], $r.includes(d) || (h[d] = u[d]);
|
|
581
|
-
}), { encoded: { header: s, payload: m, signature: p }, header: JSON.parse(
|
|
581
|
+
}), { encoded: { header: s, payload: m, signature: p }, header: JSON.parse(Kt(s)), claims: c, user: h };
|
|
582
582
|
})(t.id_token);
|
|
583
583
|
if (!e.claims.iss)
|
|
584
584
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -692,25 +692,25 @@ var he = jt(function(t, e) {
|
|
|
692
692
|
};
|
|
693
693
|
});
|
|
694
694
|
Tt(he), he.encode, he.parse, he.getAll;
|
|
695
|
-
var zr = he.get,
|
|
695
|
+
var zr = he.get, Nn = he.set, Ln = he.remove;
|
|
696
696
|
const we = { get(t) {
|
|
697
697
|
const e = zr(t);
|
|
698
698
|
if (e !== void 0)
|
|
699
699
|
return JSON.parse(e);
|
|
700
700
|
}, save(t, e, n) {
|
|
701
701
|
let r = {};
|
|
702
|
-
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
702
|
+
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Nn(t, JSON.stringify(e), r);
|
|
703
703
|
}, remove(t, e) {
|
|
704
704
|
let n = {};
|
|
705
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
705
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Ln(t, n);
|
|
706
706
|
} }, Nr = { get(t) {
|
|
707
707
|
return we.get(t) || we.get(`_legacy_${t}`);
|
|
708
708
|
}, save(t, e, n) {
|
|
709
709
|
let r = {};
|
|
710
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
710
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Nn(`_legacy_${t}`, JSON.stringify(e), r), we.save(t, e, n);
|
|
711
711
|
}, remove(t, e) {
|
|
712
712
|
let n = {};
|
|
713
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
713
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Ln(t, n), we.remove(t, e), we.remove(`_legacy_${t}`, e);
|
|
714
714
|
} }, Lr = { get(t) {
|
|
715
715
|
if (typeof sessionStorage > "u")
|
|
716
716
|
return;
|
|
@@ -734,8 +734,8 @@ function Dr(t, e, n) {
|
|
|
734
734
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
735
735
|
return URL.createObjectURL(s);
|
|
736
736
|
}
|
|
737
|
-
var
|
|
738
|
-
return ht = ht || Dr(
|
|
737
|
+
var Mt, Xt, Ft, ht, Ur = (Mt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Xt = null, Ft = !1, function(t) {
|
|
738
|
+
return ht = ht || Dr(Mt, Xt, Ft), new Worker(ht, t);
|
|
739
739
|
});
|
|
740
740
|
const ft = {};
|
|
741
741
|
let Rr = class {
|
|
@@ -764,36 +764,36 @@ let Rr = class {
|
|
|
764
764
|
return `@@auth0spajs@@::${e}`;
|
|
765
765
|
}
|
|
766
766
|
};
|
|
767
|
-
const Wr = { memory: () => new
|
|
767
|
+
const Wr = { memory: () => new zn().enclosedCache, localstorage: () => new jr() }, Ht = (t) => Wr[t], Jt = (t) => {
|
|
768
768
|
const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
|
|
769
769
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
770
770
|
}, pt = new vr();
|
|
771
771
|
let Zr = class {
|
|
772
772
|
constructor(e) {
|
|
773
773
|
let n, r;
|
|
774
|
-
if (this.userCache = new
|
|
774
|
+
if (this.userCache = new zn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
775
775
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
776
776
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
777
|
-
if (!
|
|
777
|
+
if (!Be())
|
|
778
778
|
throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
|
|
779
|
-
if (
|
|
779
|
+
if (Be().subtle === void 0)
|
|
780
780
|
throw new Error(`
|
|
781
781
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
782
782
|
`);
|
|
783
783
|
})(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
|
|
784
784
|
r = e.cache;
|
|
785
785
|
else {
|
|
786
|
-
if (n = e.cacheLocation || "memory", !
|
|
786
|
+
if (n = e.cacheLocation || "memory", !Ht(n))
|
|
787
787
|
throw new Error(`Invalid cache location "${n}"`);
|
|
788
|
-
r =
|
|
788
|
+
r = Ht(n)();
|
|
789
789
|
}
|
|
790
790
|
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? we : Nr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
791
791
|
const i = e.useCookiesForTransactions ? this.cookieStorage : Lr;
|
|
792
792
|
var o;
|
|
793
|
-
this.scope = Xe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Cr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider ||
|
|
793
|
+
this.scope = Xe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Cr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || On, this.cacheManager = new xr(r, r.allKeys ? void 0 : new Rr(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Ur());
|
|
794
794
|
}
|
|
795
795
|
_url(e) {
|
|
796
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
796
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || En)));
|
|
797
797
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
798
798
|
}
|
|
799
799
|
_authorizeUrl(e) {
|
|
@@ -808,13 +808,13 @@ let Zr = class {
|
|
|
808
808
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
809
809
|
}
|
|
810
810
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
811
|
-
const i =
|
|
811
|
+
const i = Zt(dt()), o = Zt(dt()), a = dt(), s = ((u) => {
|
|
812
812
|
const c = new Uint8Array(u);
|
|
813
813
|
return ((h) => {
|
|
814
814
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
815
815
|
return h.replace(/[+/=]/g, (w) => d[w]);
|
|
816
816
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
817
|
-
})(await (async (u) => await
|
|
817
|
+
})(await (async (u) => await Be().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), m = ((u, c, h, d, w, k, v, I) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Xe(c, h.scope), response_type: "code", response_mode: I || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, 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), p = this._authorizeUrl(m);
|
|
818
818
|
return { nonce: o, code_verifier: a, scope: m.scope, audience: m.audience || "default", redirect_uri: m.redirect_uri, state: i, url: p };
|
|
819
819
|
}
|
|
820
820
|
async loginWithPopup(e, n) {
|
|
@@ -858,7 +858,7 @@ let Zr = class {
|
|
|
858
858
|
}
|
|
859
859
|
async loginWithRedirect(e = {}) {
|
|
860
860
|
var n;
|
|
861
|
-
const r =
|
|
861
|
+
const r = Jt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), m = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, p = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = p, c = Q(p, ["url"]);
|
|
862
862
|
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), m && { organization: m }));
|
|
863
863
|
const h = o ? `${u}#${o}` : u;
|
|
864
864
|
i ? await i(h) : window.location.assign(h);
|
|
@@ -944,7 +944,7 @@ let Zr = class {
|
|
|
944
944
|
return this._url(`/v2/logout?${_t(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
945
945
|
}
|
|
946
946
|
async logout(e = {}) {
|
|
947
|
-
const n =
|
|
947
|
+
const n = Jt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
|
|
948
948
|
e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
|
|
949
949
|
const o = this._buildLogoutUrl(i);
|
|
950
950
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -986,7 +986,7 @@ let Zr = class {
|
|
|
986
986
|
if (!(n && n.refresh_token || this.worker)) {
|
|
987
987
|
if (this.options.useRefreshTokensFallback)
|
|
988
988
|
return await this._getTokenFromIFrame(e);
|
|
989
|
-
throw new
|
|
989
|
+
throw new $n(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
990
990
|
}
|
|
991
991
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
992
992
|
try {
|
|
@@ -1034,7 +1034,7 @@ async function Xr({ clientId: t }) {
|
|
|
1034
1034
|
try {
|
|
1035
1035
|
await F.handleRedirectCallback();
|
|
1036
1036
|
const e = await F.getUser();
|
|
1037
|
-
|
|
1037
|
+
rt(oe.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
|
|
1038
1038
|
const n = await F.getTokenSilently();
|
|
1039
1039
|
localStorage.setItem("accessToken", n);
|
|
1040
1040
|
} catch {
|
|
@@ -1067,13 +1067,13 @@ async function Vr() {
|
|
|
1067
1067
|
async function Yr() {
|
|
1068
1068
|
if (!F)
|
|
1069
1069
|
throw new Error("Auth0 client not initialized");
|
|
1070
|
-
return
|
|
1070
|
+
return rt(oe.LOGOUT, {}), F.logout({
|
|
1071
1071
|
logoutParams: {
|
|
1072
1072
|
returnTo: window.location.href
|
|
1073
1073
|
}
|
|
1074
1074
|
});
|
|
1075
1075
|
}
|
|
1076
|
-
const Gr = (t, e) => e.skipDedupe || e.method !== "GET", Br = (t, e) => e.method + "@" + t, qr = (t) => t.clone(),
|
|
1076
|
+
const Gr = (t, e) => e.skipDedupe || e.method !== "GET", Br = (t, e) => e.method + "@" + t, qr = (t) => t.clone(), Dn = ({ skip: t = Gr, key: e = Br, resolver: n = qr } = {}) => {
|
|
1077
1077
|
const r = /* @__PURE__ */ new Map();
|
|
1078
1078
|
return (i) => (o, a) => {
|
|
1079
1079
|
if (t(o, a))
|
|
@@ -1093,7 +1093,7 @@ const Gr = (t, e) => e.skipDedupe || e.method !== "GET", Br = (t, e) => e.method
|
|
|
1093
1093
|
return r.delete(s), Promise.reject(m);
|
|
1094
1094
|
}
|
|
1095
1095
|
};
|
|
1096
|
-
}, Qr = (t, e) => t * e, ei = (t) => t && t.ok,
|
|
1096
|
+
}, Qr = (t, e) => t * e, ei = (t) => t && t.ok, Un = ({ delayTimer: t = 500, delayRamp: e = Qr, maxAttempts: n = 10, until: r = ei, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (m) => (p, u) => {
|
|
1097
1097
|
let c = 0;
|
|
1098
1098
|
if (s && s(p, u))
|
|
1099
1099
|
return m(p, u);
|
|
@@ -1120,12 +1120,12 @@ const Gr = (t, e) => e.skipDedupe || e.method !== "GET", Br = (t, e) => e.method
|
|
|
1120
1120
|
throw d;
|
|
1121
1121
|
return h(null, d);
|
|
1122
1122
|
});
|
|
1123
|
-
}, ti = "application/json",
|
|
1124
|
-
function
|
|
1123
|
+
}, ti = "application/json", Rn = "Content-Type", ve = Symbol(), Wn = Symbol();
|
|
1124
|
+
function Vt(t = {}) {
|
|
1125
1125
|
var e;
|
|
1126
|
-
return (e = Object.entries(t).find(([n]) => n.toLowerCase() ===
|
|
1126
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Rn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function Yt(t) {
|
|
1129
1129
|
return /^application\/.*json.*/.test(t);
|
|
1130
1130
|
}
|
|
1131
1131
|
const fe = function(t, e, n = !1) {
|
|
@@ -1164,7 +1164,7 @@ function ii(t) {
|
|
|
1164
1164
|
Ee.errorType = t;
|
|
1165
1165
|
}
|
|
1166
1166
|
const oi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1167
|
-
class
|
|
1167
|
+
class Zn extends Error {
|
|
1168
1168
|
}
|
|
1169
1169
|
const ai = (t) => {
|
|
1170
1170
|
const e = /* @__PURE__ */ Object.create(null);
|
|
@@ -1175,7 +1175,7 @@ const ai = (t) => {
|
|
|
1175
1175
|
throw { [ve]: y };
|
|
1176
1176
|
}).then((y) => {
|
|
1177
1177
|
if (!y.ok) {
|
|
1178
|
-
const l = new
|
|
1178
|
+
const l = new Zn();
|
|
1179
1179
|
if (l.cause = d, l.stack = l.stack + `
|
|
1180
1180
|
CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
1181
1181
|
throw l;
|
|
@@ -1194,7 +1194,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1194
1194
|
const b = l.hasOwnProperty(ve), T = b ? l[ve] : l, P = (T == null ? void 0 : T.status) && p.get(T.status) || p.get(T == null ? void 0 : T.name) || b && p.has(ve) && p.get(ve);
|
|
1195
1195
|
if (P)
|
|
1196
1196
|
return P(T, t);
|
|
1197
|
-
const x = p.get(
|
|
1197
|
+
const x = p.get(Wn);
|
|
1198
1198
|
if (x)
|
|
1199
1199
|
return x(T, t);
|
|
1200
1200
|
throw T;
|
|
@@ -1287,7 +1287,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1287
1287
|
return this.headers({ Accept: t });
|
|
1288
1288
|
},
|
|
1289
1289
|
content(t) {
|
|
1290
|
-
return this.headers({ [
|
|
1290
|
+
return this.headers({ [Rn]: t });
|
|
1291
1291
|
},
|
|
1292
1292
|
auth(t) {
|
|
1293
1293
|
return this.headers({ Authorization: t });
|
|
@@ -1297,7 +1297,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1297
1297
|
return n.set(t, e), { ...this, _catchers: n };
|
|
1298
1298
|
},
|
|
1299
1299
|
catcherFallback(t) {
|
|
1300
|
-
return this.catcher(
|
|
1300
|
+
return this.catcher(Wn, t);
|
|
1301
1301
|
},
|
|
1302
1302
|
resolve(t, e = !1) {
|
|
1303
1303
|
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
@@ -1316,7 +1316,7 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1316
1316
|
},
|
|
1317
1317
|
fetch(t = this._options.method, e = "", n = null) {
|
|
1318
1318
|
let r = this.url(e).options({ method: t });
|
|
1319
|
-
const i =
|
|
1319
|
+
const i = Vt(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Yt(i));
|
|
1320
1320
|
return r = n ? o ? r.json(n, i) : r.body(n) : r, ai(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1321
1321
|
},
|
|
1322
1322
|
get(t = "") {
|
|
@@ -1344,8 +1344,8 @@ CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
|
1344
1344
|
return { ...this, _options: { ...this._options, body: t } };
|
|
1345
1345
|
},
|
|
1346
1346
|
json(t, e) {
|
|
1347
|
-
const n =
|
|
1348
|
-
return this.content(e ||
|
|
1347
|
+
const n = Vt(this._options.headers);
|
|
1348
|
+
return this.content(e || Yt(n) && n || ti).body(JSON.stringify(t));
|
|
1349
1349
|
}
|
|
1350
1350
|
};
|
|
1351
1351
|
function ae(t = "", e = {}) {
|
|
@@ -1355,7 +1355,7 @@ ae.default = ae;
|
|
|
1355
1355
|
ae.options = ni;
|
|
1356
1356
|
ae.errorType = ii;
|
|
1357
1357
|
ae.polyfills = ri;
|
|
1358
|
-
ae.WretchError =
|
|
1358
|
+
ae.WretchError = Zn;
|
|
1359
1359
|
const ci = (t) => (e, n) => new Promise(async (r, i) => {
|
|
1360
1360
|
try {
|
|
1361
1361
|
const o = await Vr(), a = {
|
|
@@ -1369,19 +1369,29 @@ const ci = (t) => (e, n) => new Promise(async (r, i) => {
|
|
|
1369
1369
|
} catch (o) {
|
|
1370
1370
|
console.error("Error fetching access token:", o), i(o);
|
|
1371
1371
|
}
|
|
1372
|
-
}),
|
|
1372
|
+
}), ui = (t) => (e, n) => {
|
|
1373
|
+
const r = localStorage.getItem("__anon_id"), i = btoa(`${r}:`), o = {
|
|
1374
|
+
...n,
|
|
1375
|
+
headers: {
|
|
1376
|
+
...n.headers,
|
|
1377
|
+
Authorization: `Basic ${i}`
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
return t(e, o);
|
|
1381
|
+
}, je = ae(`https://api2.${xt}`).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1373
1382
|
ci,
|
|
1374
|
-
|
|
1375
|
-
|
|
1383
|
+
Dn(),
|
|
1384
|
+
Un({
|
|
1376
1385
|
delayTimer: 1e3,
|
|
1377
1386
|
delayRamp: (t, e) => t * e,
|
|
1378
1387
|
maxAttempts: 3,
|
|
1379
1388
|
until: (t) => (t == null ? void 0 : t.ok) || !1,
|
|
1380
1389
|
retryOnNetworkError: !1
|
|
1381
1390
|
})
|
|
1382
|
-
]),
|
|
1383
|
-
|
|
1384
|
-
Dn(
|
|
1391
|
+
]), it = ae(`https://api2.${xt}`).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1392
|
+
ui,
|
|
1393
|
+
Dn(),
|
|
1394
|
+
Un({
|
|
1385
1395
|
delayTimer: 1e3,
|
|
1386
1396
|
delayRamp: (t, e) => t * e,
|
|
1387
1397
|
maxAttempts: 3,
|
|
@@ -1410,20 +1420,37 @@ async function mi(t) {
|
|
|
1410
1420
|
const e = await je.get("/bills").json();
|
|
1411
1421
|
return e == null ? void 0 : e.find((n) => n.id === t);
|
|
1412
1422
|
}
|
|
1413
|
-
async function gi(
|
|
1423
|
+
async function gi() {
|
|
1424
|
+
return await it.get("/tags").json();
|
|
1425
|
+
}
|
|
1426
|
+
async function yi(t, e) {
|
|
1427
|
+
return await it.url(`/tags/${t}`).put({
|
|
1428
|
+
value: e
|
|
1429
|
+
}).json();
|
|
1430
|
+
}
|
|
1431
|
+
async function vi(t, e) {
|
|
1432
|
+
return await it.url(`/tags/${t}/push`).put({
|
|
1433
|
+
value: e
|
|
1434
|
+
}).json();
|
|
1435
|
+
}
|
|
1436
|
+
async function wi(t) {
|
|
1414
1437
|
const e = localStorage.getItem("__anon_id");
|
|
1415
1438
|
if (!e)
|
|
1416
1439
|
throw new Error("User id not found");
|
|
1417
|
-
return
|
|
1440
|
+
return it.url("/articles/access").post({
|
|
1418
1441
|
articleId: t.articleId,
|
|
1419
1442
|
userId: e
|
|
1420
1443
|
}).json();
|
|
1421
1444
|
}
|
|
1422
|
-
async function
|
|
1423
|
-
const e = await
|
|
1424
|
-
return e.status !== "ok" &&
|
|
1445
|
+
async function bi(t) {
|
|
1446
|
+
const e = await wi({ articleId: t });
|
|
1447
|
+
return e.status !== "ok" && rt(oe.SOFT_PAYWALL, {}), e;
|
|
1425
1448
|
}
|
|
1426
|
-
|
|
1449
|
+
const Kn = "@sesamy/sesamy-js", Ct = "1.1.0";
|
|
1450
|
+
function ki() {
|
|
1451
|
+
return Ct;
|
|
1452
|
+
}
|
|
1453
|
+
function Ii(t = "sesamy") {
|
|
1427
1454
|
window[t] = {
|
|
1428
1455
|
auth: {
|
|
1429
1456
|
getUser: Hr,
|
|
@@ -1432,91 +1459,97 @@ function vi(t = "sesamy") {
|
|
|
1432
1459
|
logout: Yr
|
|
1433
1460
|
},
|
|
1434
1461
|
articles: {
|
|
1435
|
-
access:
|
|
1462
|
+
access: bi
|
|
1463
|
+
},
|
|
1464
|
+
tags: {
|
|
1465
|
+
list: gi,
|
|
1466
|
+
set: yi,
|
|
1467
|
+
push: vi
|
|
1436
1468
|
},
|
|
1437
1469
|
getEntitlement: di,
|
|
1438
1470
|
getEntitlements: li,
|
|
1439
1471
|
getContract: fi,
|
|
1440
1472
|
getContracts: hi,
|
|
1441
1473
|
getBill: mi,
|
|
1442
|
-
getBills: pi
|
|
1474
|
+
getBills: pi,
|
|
1475
|
+
getVersion: ki
|
|
1443
1476
|
};
|
|
1444
1477
|
}
|
|
1445
|
-
function
|
|
1478
|
+
function Gt(t, e, n, r, i) {
|
|
1446
1479
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1447
1480
|
t = t ? t[e[r]] : i;
|
|
1448
1481
|
return t === i ? n : t;
|
|
1449
1482
|
}
|
|
1450
|
-
var Fe = "undefined",
|
|
1451
|
-
},
|
|
1452
|
-
|
|
1483
|
+
var Fe = "undefined", Bt = "object", _i = function() {
|
|
1484
|
+
}, Mn = "any", Xn = "*", me = "__", Qe = typeof process < "u" ? process : {};
|
|
1485
|
+
Qe.env && Qe.env.NODE_ENV;
|
|
1453
1486
|
var Y = typeof document < "u";
|
|
1454
|
-
|
|
1487
|
+
Qe.versions != null && Qe.versions.node != null;
|
|
1455
1488
|
typeof Deno < "u" && Deno.core;
|
|
1456
1489
|
Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1457
|
-
function
|
|
1490
|
+
function Fn(t, e) {
|
|
1458
1491
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1459
1492
|
}
|
|
1460
|
-
var
|
|
1461
|
-
function
|
|
1462
|
-
return
|
|
1493
|
+
var Si = Fn.bind(null, "toUpperCase"), Ei = Fn.bind(null, "toLowerCase");
|
|
1494
|
+
function Oi(t) {
|
|
1495
|
+
return Hn(t) ? Si("null") : typeof t == "object" ? xi(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1463
1496
|
}
|
|
1464
|
-
function
|
|
1497
|
+
function et(t, e) {
|
|
1465
1498
|
e === void 0 && (e = !0);
|
|
1466
|
-
var n =
|
|
1467
|
-
return e ?
|
|
1499
|
+
var n = Oi(t);
|
|
1500
|
+
return e ? Ei(n) : n;
|
|
1468
1501
|
}
|
|
1469
1502
|
function Ke(t, e) {
|
|
1470
1503
|
return typeof e === t;
|
|
1471
1504
|
}
|
|
1472
|
-
var B = Ke.bind(null, "function"), re = Ke.bind(null, "string"), be = Ke.bind(null, "undefined"),
|
|
1505
|
+
var B = Ke.bind(null, "function"), re = Ke.bind(null, "string"), be = Ke.bind(null, "undefined"), Pi = Ke.bind(null, "boolean");
|
|
1473
1506
|
Ke.bind(null, "symbol");
|
|
1474
|
-
function
|
|
1507
|
+
function Hn(t) {
|
|
1475
1508
|
return t === null;
|
|
1476
1509
|
}
|
|
1477
|
-
function
|
|
1478
|
-
return
|
|
1510
|
+
function Ti(t) {
|
|
1511
|
+
return et(t) === "number" && !isNaN(t);
|
|
1479
1512
|
}
|
|
1480
|
-
function
|
|
1481
|
-
return
|
|
1513
|
+
function Jn(t) {
|
|
1514
|
+
return et(t) === "array";
|
|
1482
1515
|
}
|
|
1483
1516
|
function X(t) {
|
|
1484
|
-
if (!
|
|
1517
|
+
if (!ji(t))
|
|
1485
1518
|
return !1;
|
|
1486
1519
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
1487
1520
|
e = Object.getPrototypeOf(e);
|
|
1488
1521
|
return Object.getPrototypeOf(t) === e;
|
|
1489
1522
|
}
|
|
1490
|
-
function
|
|
1523
|
+
function ji(t) {
|
|
1491
1524
|
return t && (typeof t == "object" || t !== null);
|
|
1492
1525
|
}
|
|
1493
|
-
function
|
|
1526
|
+
function xi(t) {
|
|
1494
1527
|
return B(t.constructor) ? t.constructor.name : null;
|
|
1495
1528
|
}
|
|
1496
|
-
function
|
|
1497
|
-
return t instanceof Error || re(t.message) && t.constructor &&
|
|
1529
|
+
function Ci(t) {
|
|
1530
|
+
return t instanceof Error || re(t.message) && t.constructor && Ti(t.constructor.stackTraceLimit);
|
|
1498
1531
|
}
|
|
1499
|
-
function
|
|
1500
|
-
if (typeof e != "object" ||
|
|
1532
|
+
function Vn(t, e) {
|
|
1533
|
+
if (typeof e != "object" || Hn(e))
|
|
1501
1534
|
return !1;
|
|
1502
1535
|
if (e instanceof t)
|
|
1503
1536
|
return !0;
|
|
1504
|
-
var n =
|
|
1505
|
-
if (
|
|
1537
|
+
var n = et(new t(""));
|
|
1538
|
+
if (Ci(e))
|
|
1506
1539
|
for (; e; ) {
|
|
1507
|
-
if (
|
|
1540
|
+
if (et(e) === n)
|
|
1508
1541
|
return !0;
|
|
1509
1542
|
e = Object.getPrototypeOf(e);
|
|
1510
1543
|
}
|
|
1511
1544
|
return !1;
|
|
1512
1545
|
}
|
|
1513
|
-
|
|
1514
|
-
|
|
1546
|
+
Vn.bind(null, TypeError);
|
|
1547
|
+
Vn.bind(null, SyntaxError);
|
|
1515
1548
|
function ot(t, e) {
|
|
1516
1549
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1517
|
-
return n && e ?
|
|
1550
|
+
return n && e ? $i(t, e) : n;
|
|
1518
1551
|
}
|
|
1519
|
-
function
|
|
1552
|
+
function $i(t, e) {
|
|
1520
1553
|
return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
|
|
1521
1554
|
}
|
|
1522
1555
|
function at(t) {
|
|
@@ -1529,37 +1562,37 @@ at(ot, "form");
|
|
|
1529
1562
|
at(ot, "button");
|
|
1530
1563
|
at(ot, "input");
|
|
1531
1564
|
at(ot, "select");
|
|
1532
|
-
function
|
|
1533
|
-
return t ?
|
|
1565
|
+
function Ai(t) {
|
|
1566
|
+
return t ? Jn(t) ? t : [t] : [];
|
|
1534
1567
|
}
|
|
1535
|
-
function
|
|
1568
|
+
function qt(t) {
|
|
1536
1569
|
try {
|
|
1537
1570
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1538
1571
|
} catch {
|
|
1539
1572
|
return null;
|
|
1540
1573
|
}
|
|
1541
1574
|
}
|
|
1542
|
-
function
|
|
1575
|
+
function zi() {
|
|
1543
1576
|
if (Y) {
|
|
1544
1577
|
var t = navigator, e = t.languages;
|
|
1545
1578
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1546
1579
|
}
|
|
1547
1580
|
}
|
|
1548
|
-
function
|
|
1581
|
+
function Ni() {
|
|
1549
1582
|
try {
|
|
1550
1583
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1551
1584
|
} catch {
|
|
1552
1585
|
}
|
|
1553
1586
|
}
|
|
1554
|
-
function
|
|
1587
|
+
function Li(t) {
|
|
1555
1588
|
return function(e) {
|
|
1556
1589
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1557
|
-
var o =
|
|
1590
|
+
var o = qt(n[1]), a = qt(n[2]);
|
|
1558
1591
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1559
1592
|
}
|
|
1560
1593
|
for (var s in r) {
|
|
1561
1594
|
var m = s.split("[");
|
|
1562
|
-
m.length > 1 && (
|
|
1595
|
+
m.length > 1 && (Di(r, m.map(function(p) {
|
|
1563
1596
|
return p.replace(/[?[\]\\ ]/g, "");
|
|
1564
1597
|
}), r[s]), delete r[s]);
|
|
1565
1598
|
}
|
|
@@ -1572,7 +1605,7 @@ function $i(t) {
|
|
|
1572
1605
|
return Y && window.location.search.substring(1);
|
|
1573
1606
|
}(t));
|
|
1574
1607
|
}
|
|
1575
|
-
function
|
|
1608
|
+
function Di(t, e, n) {
|
|
1576
1609
|
for (var r = e.length - 1, i = 0; i < r; ++i) {
|
|
1577
1610
|
var o = e[i];
|
|
1578
1611
|
if (o === "__proto__" || o === "constructor")
|
|
@@ -1588,7 +1621,7 @@ function st() {
|
|
|
1588
1621
|
}
|
|
1589
1622
|
return t;
|
|
1590
1623
|
}
|
|
1591
|
-
var De = "global", Oe = me + "global" + me, Pe = typeof self ===
|
|
1624
|
+
var De = "global", Oe = me + "global" + me, Pe = typeof self === Bt && self.self === self && self || typeof global === Bt && global.global === global && global || void 0;
|
|
1592
1625
|
function ge(t) {
|
|
1593
1626
|
return Pe[Oe][t];
|
|
1594
1627
|
}
|
|
@@ -1601,7 +1634,7 @@ function xe(t) {
|
|
|
1601
1634
|
function Ce(t, e, n) {
|
|
1602
1635
|
var r;
|
|
1603
1636
|
try {
|
|
1604
|
-
if (
|
|
1637
|
+
if ($t(t)) {
|
|
1605
1638
|
var i = window[t];
|
|
1606
1639
|
r = i[e].bind(i);
|
|
1607
1640
|
}
|
|
@@ -1611,7 +1644,7 @@ function Ce(t, e, n) {
|
|
|
1611
1644
|
}
|
|
1612
1645
|
Pe[Oe] || (Pe[Oe] = {});
|
|
1613
1646
|
var He = {};
|
|
1614
|
-
function
|
|
1647
|
+
function $t(t) {
|
|
1615
1648
|
if (typeof He[t] !== Fe)
|
|
1616
1649
|
return He[t];
|
|
1617
1650
|
try {
|
|
@@ -1632,15 +1665,15 @@ function O() {
|
|
|
1632
1665
|
return t;
|
|
1633
1666
|
}, O.apply(this, arguments);
|
|
1634
1667
|
}
|
|
1635
|
-
var ne = "function", ee = "undefined",
|
|
1668
|
+
var ne = "function", ee = "undefined", Ui = "@@redux/" + Math.random().toString(36), Qt = /* @__PURE__ */ function() {
|
|
1636
1669
|
return typeof Symbol === ne && Symbol.observable || "@@observable";
|
|
1637
1670
|
}(), Je = " != " + ne;
|
|
1638
|
-
function
|
|
1671
|
+
function Yn(t, e, n) {
|
|
1639
1672
|
var r;
|
|
1640
1673
|
if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
|
|
1641
1674
|
if (typeof n !== ne)
|
|
1642
1675
|
throw new Error("enhancer" + Je);
|
|
1643
|
-
return n(
|
|
1676
|
+
return n(Yn)(t, e);
|
|
1644
1677
|
}
|
|
1645
1678
|
if (typeof t !== ne)
|
|
1646
1679
|
throw new Error("reducer" + Je);
|
|
@@ -1683,7 +1716,7 @@ function Jn(t, e, n) {
|
|
|
1683
1716
|
if (typeof d !== ne)
|
|
1684
1717
|
throw new Error("next reducer" + Je);
|
|
1685
1718
|
i = d, h({ type: "@@redux/INIT" });
|
|
1686
|
-
} })[
|
|
1719
|
+
} })[Qt] = function() {
|
|
1687
1720
|
var d, w = c;
|
|
1688
1721
|
return (d = { subscribe: function(k) {
|
|
1689
1722
|
if (typeof k != "object")
|
|
@@ -1692,12 +1725,12 @@ function Jn(t, e, n) {
|
|
|
1692
1725
|
k.next && k.next(u());
|
|
1693
1726
|
}
|
|
1694
1727
|
return v(), { unsubscribe: w(v) };
|
|
1695
|
-
} })[
|
|
1728
|
+
} })[Qt] = function() {
|
|
1696
1729
|
return this;
|
|
1697
1730
|
}, d;
|
|
1698
1731
|
}, r;
|
|
1699
1732
|
}
|
|
1700
|
-
function
|
|
1733
|
+
function Ri(t, e) {
|
|
1701
1734
|
var n = e && e.type;
|
|
1702
1735
|
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
|
|
1703
1736
|
}
|
|
@@ -1711,7 +1744,7 @@ function Te() {
|
|
|
1711
1744
|
};
|
|
1712
1745
|
});
|
|
1713
1746
|
}
|
|
1714
|
-
function
|
|
1747
|
+
function Wi() {
|
|
1715
1748
|
var t = arguments;
|
|
1716
1749
|
return function(e) {
|
|
1717
1750
|
return function(n, r, i) {
|
|
@@ -1724,14 +1757,14 @@ function Li() {
|
|
|
1724
1757
|
};
|
|
1725
1758
|
};
|
|
1726
1759
|
}
|
|
1727
|
-
var ie = me + "anon_id", pe = me + "user_id", Ie = me + "user_traits", te = "userId", ke = "anonymousId",
|
|
1760
|
+
var ie = me + "anon_id", pe = me + "user_id", Ie = me + "user_traits", te = "userId", ke = "anonymousId", qe = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], Et = ["name", "EVENTS", "config", "loaded"], E = qe.reduce(function(t, e) {
|
|
1728
1761
|
return t[e] = e, t;
|
|
1729
1762
|
}, { registerPluginType: function(t) {
|
|
1730
1763
|
return "registerPlugin:" + t;
|
|
1731
1764
|
}, pluginReadyType: function(t) {
|
|
1732
1765
|
return "ready:" + t;
|
|
1733
|
-
} }),
|
|
1734
|
-
function
|
|
1766
|
+
} }), en = /^utm_/, tn = /^an_prop_/, nn = /^an_trait_/;
|
|
1767
|
+
function Zi(t) {
|
|
1735
1768
|
var e = t.storage.setItem;
|
|
1736
1769
|
return function(n) {
|
|
1737
1770
|
return function(r) {
|
|
@@ -1742,11 +1775,11 @@ function Di(t) {
|
|
|
1742
1775
|
var u = Object.keys(i.params);
|
|
1743
1776
|
if (u.length) {
|
|
1744
1777
|
var c = o.an_uid, h = o.an_event, d = u.reduce(function(w, k) {
|
|
1745
|
-
if (k.match(
|
|
1746
|
-
var v = k.replace(
|
|
1778
|
+
if (k.match(en) || k.match(/^(d|g)clid/)) {
|
|
1779
|
+
var v = k.replace(en, "");
|
|
1747
1780
|
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1748
1781
|
}
|
|
1749
|
-
return k.match(
|
|
1782
|
+
return k.match(tn) && (w.props[k.replace(tn, "")] = o[k]), k.match(nn) && (w.traits[k.replace(nn, "")] = o[k]), w;
|
|
1750
1783
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1751
1784
|
n.dispatch(O({ type: E.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1752
1785
|
return t.identify(c, d.traits);
|
|
@@ -1760,7 +1793,7 @@ function Di(t) {
|
|
|
1760
1793
|
};
|
|
1761
1794
|
};
|
|
1762
1795
|
}
|
|
1763
|
-
function
|
|
1796
|
+
function Ki(t) {
|
|
1764
1797
|
return function(e, n) {
|
|
1765
1798
|
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === E.setItemEnd) {
|
|
1766
1799
|
if (n.key === ie)
|
|
@@ -1780,13 +1813,13 @@ function Ui(t) {
|
|
|
1780
1813
|
}
|
|
1781
1814
|
};
|
|
1782
1815
|
}
|
|
1783
|
-
function
|
|
1816
|
+
function rn(t) {
|
|
1784
1817
|
return { userId: t.getItem(pe), anonymousId: t.getItem(ie), traits: t.getItem(Ie) };
|
|
1785
1818
|
}
|
|
1786
1819
|
var Ot = function(t) {
|
|
1787
1820
|
return me + "TEMP" + me + t;
|
|
1788
1821
|
};
|
|
1789
|
-
function
|
|
1822
|
+
function Mi(t) {
|
|
1790
1823
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1791
1824
|
return function(o) {
|
|
1792
1825
|
return function(a) {
|
|
@@ -1807,22 +1840,22 @@ function Ri(t) {
|
|
|
1807
1840
|
};
|
|
1808
1841
|
}
|
|
1809
1842
|
var Le = {};
|
|
1810
|
-
function
|
|
1843
|
+
function on(t, e) {
|
|
1811
1844
|
Le[t] && B(Le[t]) && (Le[t](e), delete Le[t]);
|
|
1812
1845
|
}
|
|
1813
|
-
function
|
|
1846
|
+
function Gn(t, e, n) {
|
|
1814
1847
|
return new Promise(function(r, i) {
|
|
1815
1848
|
return e() ? r(t) : n < 1 ? i(O({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1816
1849
|
return setTimeout(o, 10);
|
|
1817
1850
|
}).then(function(o) {
|
|
1818
|
-
return
|
|
1851
|
+
return Gn(t, e, n - 10).then(r, i);
|
|
1819
1852
|
});
|
|
1820
1853
|
});
|
|
1821
1854
|
}
|
|
1822
|
-
function
|
|
1855
|
+
function Xi(t) {
|
|
1823
1856
|
return { abort: t };
|
|
1824
1857
|
}
|
|
1825
|
-
function
|
|
1858
|
+
function Bn(t, e, n) {
|
|
1826
1859
|
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, m = o.user;
|
|
1827
1860
|
if (!o.context.offline && s && s.actions && s.actions.length) {
|
|
1828
1861
|
var p = s.actions.reduce(function(c, h, d) {
|
|
@@ -1837,7 +1870,7 @@ function Yn(t, e, n) {
|
|
|
1837
1870
|
return l.hasOwnProperty(P) && b[P] && b[P] !== l[P] && (T[P] = b[P]), T;
|
|
1838
1871
|
}, l);
|
|
1839
1872
|
}(h.payload, m), _ = r[I.meta.rid];
|
|
1840
|
-
if (!_ && (v = k({ payload: I, config: a[d].config, instance: n, abort:
|
|
1873
|
+
if (!_ && (v = k({ payload: I, config: a[d].config, instance: n, abort: Xi })) && X(v) && v.abort)
|
|
1841
1874
|
return void (r[I.meta.rid] = !0);
|
|
1842
1875
|
if (!_) {
|
|
1843
1876
|
var y = w + ":" + d;
|
|
@@ -1877,7 +1910,7 @@ var mt = function(t) {
|
|
|
1877
1910
|
throw new Error(D.type + " action not cancellable. Remove abort in " + L);
|
|
1878
1911
|
};
|
|
1879
1912
|
}(_, P);
|
|
1880
|
-
return { payload:
|
|
1913
|
+
return { payload: Fi(_), instance: v, config: b || {}, abort: x };
|
|
1881
1914
|
};
|
|
1882
1915
|
}(r, d), k = e.exact.reduce(function(v, I) {
|
|
1883
1916
|
var _ = I.pluginName, y = I.methodName, l = !1;
|
|
@@ -1896,15 +1929,15 @@ var mt = function(t) {
|
|
|
1896
1929
|
try {
|
|
1897
1930
|
return Promise.resolve(P).then(function(L) {
|
|
1898
1931
|
return x.method && B(x.method) ? (function(W, j) {
|
|
1899
|
-
var K =
|
|
1932
|
+
var K = hn(W);
|
|
1900
1933
|
if (K && K.name === j) {
|
|
1901
|
-
var M =
|
|
1934
|
+
var M = hn(K.method);
|
|
1902
1935
|
throw new Error([j + " plugin is calling method " + W, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + j + " plugin insteadof " + W].join(`
|
|
1903
1936
|
`));
|
|
1904
1937
|
}
|
|
1905
1938
|
}(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (H = L, U = y, J = x.pluginName, function(W, j) {
|
|
1906
1939
|
return O({}, H, { abort: { reason: W, plugins: j || [U], caller: c, from: J || U } });
|
|
1907
|
-
}), config:
|
|
1940
|
+
}), config: cn(x.pluginName, p, o), plugins: p })).then(function(W) {
|
|
1908
1941
|
var j = X(W) ? W : {};
|
|
1909
1942
|
return Promise.resolve(O({}, L, j));
|
|
1910
1943
|
})) : L;
|
|
@@ -1936,13 +1969,13 @@ var mt = function(t) {
|
|
|
1936
1969
|
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
1937
1970
|
return s.dispatch({ type: "queue", plugin: b, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(P);
|
|
1938
1971
|
var D = w(v[b], o[b]);
|
|
1939
|
-
return Promise.resolve(T[c]({ abort: D.abort, payload: x, instance: r, config:
|
|
1972
|
+
return Promise.resolve(T[c]({ abort: D.abort, payload: x, instance: r, config: cn(b, p, o), plugins: p })).then(function(L) {
|
|
1940
1973
|
var H = X(L) ? L : {}, U = O({}, P, H), J = v[b];
|
|
1941
1974
|
if (yt(J, b))
|
|
1942
1975
|
gt({ data: J, method: c, instance: r, pluginName: b, store: s });
|
|
1943
1976
|
else {
|
|
1944
1977
|
var W = c + ":" + b;
|
|
1945
|
-
(W.match(/:/g) || []).length < 2 && !c.match(
|
|
1978
|
+
(W.match(/:/g) || []).length < 2 && !c.match(an) && !c.match(sn) && r.dispatch(O({}, h ? U : x, { type: W, _: { called: W, from: "submethod" } }));
|
|
1946
1979
|
}
|
|
1947
1980
|
return Promise.resolve(U);
|
|
1948
1981
|
});
|
|
@@ -1951,11 +1984,11 @@ var mt = function(t) {
|
|
|
1951
1984
|
return Promise.reject(P);
|
|
1952
1985
|
}
|
|
1953
1986
|
}, Promise.resolve(n))).then(function(I) {
|
|
1954
|
-
if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(
|
|
1987
|
+
if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(sn) || c.match(an) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
1955
1988
|
if (m.plugins.includes(c), I._ && I._.originalAction === c)
|
|
1956
1989
|
return I;
|
|
1957
1990
|
var _ = O({}, I, { _: { originalAction: I.type, called: I.type, from: "engineEnd" } });
|
|
1958
|
-
|
|
1991
|
+
qn(I, e.exact.length) && !c.match(/End$/) && (_ = O({}, _, { type: I.type + "Aborted" })), s.dispatch(_);
|
|
1959
1992
|
}
|
|
1960
1993
|
return I;
|
|
1961
1994
|
});
|
|
@@ -1963,29 +1996,29 @@ var mt = function(t) {
|
|
|
1963
1996
|
} catch (v) {
|
|
1964
1997
|
return Promise.reject(v);
|
|
1965
1998
|
}
|
|
1966
|
-
}, _e = /Start$/,
|
|
1999
|
+
}, _e = /Start$/, an = /^bootstrap/, sn = /^ready/;
|
|
1967
2000
|
function gt(t) {
|
|
1968
2001
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
1969
2002
|
t.store.dispatch(O({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
1970
2003
|
}
|
|
1971
|
-
function
|
|
2004
|
+
function cn(t, e, n) {
|
|
1972
2005
|
var r = e[t] || n[t];
|
|
1973
2006
|
return r && r.config ? r.config : {};
|
|
1974
2007
|
}
|
|
1975
|
-
function
|
|
2008
|
+
function un(t, e) {
|
|
1976
2009
|
return e.reduce(function(n, r) {
|
|
1977
2010
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
1978
2011
|
}, []);
|
|
1979
2012
|
}
|
|
1980
|
-
function
|
|
2013
|
+
function ln(t, e) {
|
|
1981
2014
|
var n = t.replace(_e, ""), r = e ? ":" + e : "";
|
|
1982
2015
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
1983
2016
|
}
|
|
1984
2017
|
function yt(t, e) {
|
|
1985
2018
|
var n = t.abort;
|
|
1986
|
-
return !!n && (n === !0 ||
|
|
2019
|
+
return !!n && (n === !0 || dn(n, e) || n && dn(n.plugins, e));
|
|
1987
2020
|
}
|
|
1988
|
-
function
|
|
2021
|
+
function qn(t, e) {
|
|
1989
2022
|
var n = t.abort;
|
|
1990
2023
|
if (!n)
|
|
1991
2024
|
return !1;
|
|
@@ -1997,19 +2030,19 @@ function Gn(t, e) {
|
|
|
1997
2030
|
function Ze(t) {
|
|
1998
2031
|
return Array.isArray(t);
|
|
1999
2032
|
}
|
|
2000
|
-
function
|
|
2033
|
+
function dn(t, e) {
|
|
2001
2034
|
return !(!t || !Ze(t)) && t.includes(e);
|
|
2002
2035
|
}
|
|
2003
|
-
function
|
|
2036
|
+
function hn(t) {
|
|
2004
2037
|
var e = t.match(/(.*):(.*)/);
|
|
2005
2038
|
return !!e && { method: e[1], name: e[2] };
|
|
2006
2039
|
}
|
|
2007
|
-
function
|
|
2040
|
+
function Fi(t) {
|
|
2008
2041
|
return Object.keys(t).reduce(function(e, n) {
|
|
2009
2042
|
return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
2010
2043
|
}, {});
|
|
2011
2044
|
}
|
|
2012
|
-
function
|
|
2045
|
+
function Hi(t, e, n) {
|
|
2013
2046
|
var r = {};
|
|
2014
2047
|
return function(i) {
|
|
2015
2048
|
return function(o) {
|
|
@@ -2021,7 +2054,7 @@ function Ki(t, e, n) {
|
|
|
2021
2054
|
if (a.abort)
|
|
2022
2055
|
return Promise.resolve(o(a));
|
|
2023
2056
|
if (p === E.enablePlugin && i.dispatch({ type: E.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === E.disablePlugin && setTimeout(function() {
|
|
2024
|
-
return
|
|
2057
|
+
return on(a.meta.rid, { payload: a });
|
|
2025
2058
|
}, 0), p === E.initializeEnd) {
|
|
2026
2059
|
var h = e(), d = Object.keys(h), w = d.filter(function(l) {
|
|
2027
2060
|
return u.includes(l);
|
|
@@ -2029,7 +2062,7 @@ function Ki(t, e, n) {
|
|
|
2029
2062
|
return h[l];
|
|
2030
2063
|
}), k = [], v = [], I = a.disabled, _ = w.map(function(l) {
|
|
2031
2064
|
var b = l.loaded, T = l.name, P = l.config;
|
|
2032
|
-
return
|
|
2065
|
+
return Gn(l, function() {
|
|
2033
2066
|
return b({ config: P });
|
|
2034
2067
|
}, 1e4).then(function(x) {
|
|
2035
2068
|
return r[T] || (i.dispatch({ type: E.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(D) {
|
|
@@ -2051,7 +2084,7 @@ function Ki(t, e, n) {
|
|
|
2051
2084
|
var y = function() {
|
|
2052
2085
|
if (p !== E.bootstrap)
|
|
2053
2086
|
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2054
|
-
return
|
|
2087
|
+
return Bn(i, e, t);
|
|
2055
2088
|
}, 0), Promise.resolve(function(l, b, T, P, x) {
|
|
2056
2089
|
try {
|
|
2057
2090
|
var D = B(b) ? b() : b, L = l.type, H = L.replace(_e, "");
|
|
@@ -2059,7 +2092,7 @@ function Ki(t, e, n) {
|
|
|
2059
2092
|
return Promise.resolve(l);
|
|
2060
2093
|
var U = T.getState(), J = (K = D, (M = U.plugins) === void 0 && (M = {}), ($e = l.options) === void 0 && ($e = {}), Object.keys(K).filter(function(f) {
|
|
2061
2094
|
var g = $e.plugins || {};
|
|
2062
|
-
return
|
|
2095
|
+
return Pi(g[f]) ? g[f] : g.all !== !1 && (!M[f] || M[f].enabled !== !1);
|
|
2063
2096
|
}).map(function(f) {
|
|
2064
2097
|
return K[f];
|
|
2065
2098
|
}));
|
|
@@ -2072,12 +2105,12 @@ function Ki(t, e, n) {
|
|
|
2072
2105
|
var W = J.map(function(f) {
|
|
2073
2106
|
return f.name;
|
|
2074
2107
|
}), j = function(f, g, S) {
|
|
2075
|
-
var C =
|
|
2076
|
-
return
|
|
2108
|
+
var C = ln(f).map(function($) {
|
|
2109
|
+
return un($, g);
|
|
2077
2110
|
});
|
|
2078
2111
|
return g.reduce(function($, A) {
|
|
2079
|
-
var Z = A.name, N =
|
|
2080
|
-
return
|
|
2112
|
+
var Z = A.name, N = ln(f, Z).map(function(Ae) {
|
|
2113
|
+
return un(Ae, g);
|
|
2081
2114
|
}), R = N[0], z = N[1], q = N[2];
|
|
2082
2115
|
return R.length && ($.beforeNS[Z] = R), z.length && ($.duringNS[Z] = z), q.length && ($.afterNS[Z] = q), $;
|
|
2083
2116
|
}, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
|
|
@@ -2087,14 +2120,14 @@ function Ki(t, e, n) {
|
|
|
2087
2120
|
var $ = function() {
|
|
2088
2121
|
if (L.match(_e))
|
|
2089
2122
|
return Promise.resolve(mt({ action: O({}, S, { type: H + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: U, allPlugins: D, allMatches: j, instance: T, store: P, EVENTS: x })).then(function(A) {
|
|
2090
|
-
A.meta && A.meta.hasCallback &&
|
|
2123
|
+
A.meta && A.meta.hasCallback && on(A.meta.rid, { payload: A });
|
|
2091
2124
|
});
|
|
2092
2125
|
}();
|
|
2093
2126
|
return $ && $.then ? $.then(function() {
|
|
2094
2127
|
return f;
|
|
2095
2128
|
}) : f;
|
|
2096
2129
|
}
|
|
2097
|
-
if (
|
|
2130
|
+
if (qn(f, W.length))
|
|
2098
2131
|
return f;
|
|
2099
2132
|
var S, C = function() {
|
|
2100
2133
|
if (L !== H)
|
|
@@ -2121,7 +2154,7 @@ function Ki(t, e, n) {
|
|
|
2121
2154
|
};
|
|
2122
2155
|
};
|
|
2123
2156
|
}
|
|
2124
|
-
function
|
|
2157
|
+
function Ji(t) {
|
|
2125
2158
|
return function(e) {
|
|
2126
2159
|
return function(n) {
|
|
2127
2160
|
return function(r) {
|
|
@@ -2136,7 +2169,7 @@ function Mi(t) {
|
|
|
2136
2169
|
};
|
|
2137
2170
|
};
|
|
2138
2171
|
}
|
|
2139
|
-
var
|
|
2172
|
+
var Vi = function() {
|
|
2140
2173
|
var t = this;
|
|
2141
2174
|
this.before = [], this.after = [], this.addMiddleware = function(e, n) {
|
|
2142
2175
|
t[n] = t[n].concat(e);
|
|
@@ -2160,63 +2193,63 @@ var Xi = function() {
|
|
|
2160
2193
|
};
|
|
2161
2194
|
};
|
|
2162
2195
|
};
|
|
2163
|
-
function
|
|
2196
|
+
function Yi(t) {
|
|
2164
2197
|
return function(e, n) {
|
|
2165
2198
|
e === void 0 && (e = {});
|
|
2166
2199
|
var r = {};
|
|
2167
2200
|
if (n.type === "initialize:aborted")
|
|
2168
2201
|
return e;
|
|
2169
2202
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2170
|
-
var i =
|
|
2203
|
+
var i = fn(n.type, "registerPlugin"), o = t()[i];
|
|
2171
2204
|
if (!o || !i)
|
|
2172
2205
|
return e;
|
|
2173
2206
|
var a = n.enabled, s = o.config;
|
|
2174
2207
|
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, O({}, e, r);
|
|
2175
2208
|
}
|
|
2176
2209
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2177
|
-
var m =
|
|
2210
|
+
var m = fn(n.type, E.initialize), p = t()[m];
|
|
2178
2211
|
return p && m ? (r[m] = O({}, e[m], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), O({}, e, r)) : e;
|
|
2179
2212
|
}
|
|
2180
2213
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2181
2214
|
return r[n.name] = O({}, e[n.name], { loaded: !0 }), O({}, e, r);
|
|
2182
2215
|
switch (n.type) {
|
|
2183
2216
|
case E.disablePlugin:
|
|
2184
|
-
return O({}, e,
|
|
2217
|
+
return O({}, e, pn(n.plugins, !1, e));
|
|
2185
2218
|
case E.enablePlugin:
|
|
2186
|
-
return O({}, e,
|
|
2219
|
+
return O({}, e, pn(n.plugins, !0, e));
|
|
2187
2220
|
default:
|
|
2188
2221
|
return e;
|
|
2189
2222
|
}
|
|
2190
2223
|
};
|
|
2191
2224
|
}
|
|
2192
|
-
function
|
|
2225
|
+
function fn(t, e) {
|
|
2193
2226
|
return t.substring(e.length + 1, t.length);
|
|
2194
2227
|
}
|
|
2195
|
-
function
|
|
2228
|
+
function pn(t, e, n) {
|
|
2196
2229
|
return t.reduce(function(r, i) {
|
|
2197
2230
|
return r[i] = O({}, n[i], { enabled: e }), r;
|
|
2198
2231
|
}, n);
|
|
2199
2232
|
}
|
|
2200
|
-
function
|
|
2233
|
+
function Qn(t) {
|
|
2201
2234
|
try {
|
|
2202
2235
|
return JSON.parse(JSON.stringify(t));
|
|
2203
2236
|
} catch {
|
|
2204
2237
|
}
|
|
2205
2238
|
return t;
|
|
2206
2239
|
}
|
|
2207
|
-
var
|
|
2208
|
-
function
|
|
2209
|
-
t === void 0 && (t =
|
|
2240
|
+
var Gi = { last: {}, history: [] };
|
|
2241
|
+
function Bi(t, e) {
|
|
2242
|
+
t === void 0 && (t = Gi);
|
|
2210
2243
|
var n = e.options, r = e.meta;
|
|
2211
2244
|
if (e.type === E.track) {
|
|
2212
|
-
var i =
|
|
2245
|
+
var i = Qn(O({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2213
2246
|
return O({}, t, { last: i, history: t.history.concat(i) });
|
|
2214
2247
|
}
|
|
2215
2248
|
return t;
|
|
2216
2249
|
}
|
|
2217
|
-
var
|
|
2218
|
-
function
|
|
2219
|
-
t === void 0 && (t =
|
|
2250
|
+
var qi = { actions: [] };
|
|
2251
|
+
function Qi(t, e) {
|
|
2252
|
+
t === void 0 && (t = qi);
|
|
2220
2253
|
var n = e.payload;
|
|
2221
2254
|
switch (e.type) {
|
|
2222
2255
|
case "queue":
|
|
@@ -2228,12 +2261,12 @@ function Yi(t, e) {
|
|
|
2228
2261
|
return t;
|
|
2229
2262
|
}
|
|
2230
2263
|
}
|
|
2231
|
-
var
|
|
2232
|
-
function
|
|
2264
|
+
var er = /#.*$/;
|
|
2265
|
+
function eo(t) {
|
|
2233
2266
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2234
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2267
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(er, "") : "");
|
|
2235
2268
|
}
|
|
2236
|
-
var
|
|
2269
|
+
var tr, nr, rr, ir, to = function(t) {
|
|
2237
2270
|
if (t === void 0 && (t = {}), !Y)
|
|
2238
2271
|
return t;
|
|
2239
2272
|
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, m = o.hash, p = o.search, u = function(h) {
|
|
@@ -2244,28 +2277,28 @@ var Qn, er, tr, nr, Bi = function(t) {
|
|
|
2244
2277
|
return w.getAttribute("href");
|
|
2245
2278
|
}
|
|
2246
2279
|
}();
|
|
2247
|
-
return d ? d.match(/\?/) ? d : d + h : window.location.href.replace(
|
|
2248
|
-
}(p), c = { title: n, url: u, path:
|
|
2280
|
+
return d ? d.match(/\?/) ? d : d + h : window.location.href.replace(er, "");
|
|
2281
|
+
}(p), c = { title: n, url: u, path: eo(u), hash: m, search: p, width: a, height: s };
|
|
2249
2282
|
return r && r !== "" && (c.referrer = r), O({}, c, t);
|
|
2250
|
-
},
|
|
2251
|
-
function
|
|
2252
|
-
t === void 0 && (t =
|
|
2283
|
+
}, no = { last: {}, history: [] };
|
|
2284
|
+
function ro(t, e) {
|
|
2285
|
+
t === void 0 && (t = no);
|
|
2253
2286
|
var n = e.options;
|
|
2254
2287
|
if (e.type === E.page) {
|
|
2255
|
-
var r =
|
|
2288
|
+
var r = Qn(O({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2256
2289
|
return O({}, t, { last: r, history: t.history.concat(r) });
|
|
2257
2290
|
}
|
|
2258
2291
|
return t;
|
|
2259
2292
|
}
|
|
2260
|
-
|
|
2293
|
+
tr = function() {
|
|
2261
2294
|
if (!Y)
|
|
2262
2295
|
return !1;
|
|
2263
2296
|
var t = navigator.appVersion;
|
|
2264
2297
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2265
|
-
}(),
|
|
2266
|
-
var
|
|
2267
|
-
function
|
|
2268
|
-
t === void 0 && (t =
|
|
2298
|
+
}(), nr = Y ? document.referrer : null, rr = zi(), ir = Ni();
|
|
2299
|
+
var mn = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!Y && !navigator.onLine, os: { name: tr }, userAgent: Y ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: ir, locale: rr, campaign: {}, referrer: nr };
|
|
2300
|
+
function io(t, e) {
|
|
2301
|
+
t === void 0 && (t = mn);
|
|
2269
2302
|
var n = t.initialized, r = e.campaign;
|
|
2270
2303
|
switch (e.type) {
|
|
2271
2304
|
case E.campaign:
|
|
@@ -2275,11 +2308,11 @@ function eo(t, e) {
|
|
|
2275
2308
|
case E.online:
|
|
2276
2309
|
return O({}, t, { offline: !1 });
|
|
2277
2310
|
default:
|
|
2278
|
-
return n ? t : O({},
|
|
2311
|
+
return n ? t : O({}, mn, t, { initialized: !0 });
|
|
2279
2312
|
}
|
|
2280
2313
|
}
|
|
2281
|
-
var
|
|
2282
|
-
function
|
|
2314
|
+
var oo = ["plugins", "reducers", "storage"];
|
|
2315
|
+
function ao(t, e, n) {
|
|
2283
2316
|
if (Y) {
|
|
2284
2317
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
2285
2318
|
t.split(" ").forEach(function(i) {
|
|
@@ -2287,15 +2320,15 @@ function no(t, e, n) {
|
|
|
2287
2320
|
});
|
|
2288
2321
|
}
|
|
2289
2322
|
}
|
|
2290
|
-
function
|
|
2291
|
-
var e =
|
|
2323
|
+
function so(t) {
|
|
2324
|
+
var e = ao.bind(null, "online offline", function(n) {
|
|
2292
2325
|
return Promise.resolve(!navigator.onLine).then(t);
|
|
2293
2326
|
});
|
|
2294
2327
|
return e(!0), function(n) {
|
|
2295
2328
|
return e(!1);
|
|
2296
2329
|
};
|
|
2297
2330
|
}
|
|
2298
|
-
function
|
|
2331
|
+
function or() {
|
|
2299
2332
|
return ye("analytics", []), function(t) {
|
|
2300
2333
|
return function(e, n, r) {
|
|
2301
2334
|
var i = t(e, n, r), o = i.dispatch;
|
|
@@ -2305,15 +2338,15 @@ function rr() {
|
|
|
2305
2338
|
};
|
|
2306
2339
|
};
|
|
2307
2340
|
}
|
|
2308
|
-
function
|
|
2341
|
+
function gn(t) {
|
|
2309
2342
|
return function() {
|
|
2310
|
-
return Te(Te.apply(null, arguments),
|
|
2343
|
+
return Te(Te.apply(null, arguments), or());
|
|
2311
2344
|
};
|
|
2312
2345
|
}
|
|
2313
2346
|
function vt(t) {
|
|
2314
|
-
return t ?
|
|
2347
|
+
return t ? Jn(t) ? t : [t] : [];
|
|
2315
2348
|
}
|
|
2316
|
-
function
|
|
2349
|
+
function yn(t, e, n) {
|
|
2317
2350
|
t === void 0 && (t = {});
|
|
2318
2351
|
var r, i, o = st();
|
|
2319
2352
|
return e && (Le[o] = (r = e, i = function(a) {
|
|
@@ -2327,7 +2360,7 @@ function gn(t, e, n) {
|
|
|
2327
2360
|
i && i(a), r(a);
|
|
2328
2361
|
})), O({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2329
2362
|
}
|
|
2330
|
-
function
|
|
2363
|
+
function co(t) {
|
|
2331
2364
|
t === void 0 && (t = {});
|
|
2332
2365
|
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(f, g) {
|
|
2333
2366
|
if (B(g))
|
|
@@ -2354,17 +2387,17 @@ function io(t) {
|
|
|
2354
2387
|
}), f;
|
|
2355
2388
|
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: xe }, o = /* @__PURE__ */ function(f) {
|
|
2356
2389
|
return function(g, S, C) {
|
|
2357
|
-
return S.getState("user")[g] || (C && X(C) && C[g] ? C[g] :
|
|
2390
|
+
return S.getState("user")[g] || (C && X(C) && C[g] ? C[g] : rn(f)[g] || ge(Ot(g)) || null);
|
|
2358
2391
|
};
|
|
2359
2392
|
}(i), a = r.plugins, s = r.events.filter(function(f) {
|
|
2360
2393
|
return !Et.includes(f);
|
|
2361
|
-
}).sort(), m = new Set(s.concat(
|
|
2394
|
+
}).sort(), m = new Set(s.concat(qe).filter(function(f) {
|
|
2362
2395
|
return !Et.includes(f);
|
|
2363
2396
|
})), p = Array.from(m).sort(), u = function() {
|
|
2364
2397
|
return a;
|
|
2365
|
-
}, c = new
|
|
2398
|
+
}, c = new Vi(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2366
2399
|
throw new Error("Abort disabled inListener");
|
|
2367
|
-
}, v =
|
|
2400
|
+
}, v = Li(), I = rn(i), _ = O({}, I, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2368
2401
|
_.anonymousId || (_.anonymousId = st());
|
|
2369
2402
|
var y = O({ enable: function(f, g) {
|
|
2370
2403
|
return new Promise(function(S) {
|
|
@@ -2401,7 +2434,7 @@ function io(t) {
|
|
|
2401
2434
|
try {
|
|
2402
2435
|
var C = X(f) ? f : {}, $ = X(g) ? g : {};
|
|
2403
2436
|
return Promise.resolve(new Promise(function(A) {
|
|
2404
|
-
j.dispatch({ type: E.pageStart, properties:
|
|
2437
|
+
j.dispatch({ type: E.pageStart, properties: to(C), options: $, userId: o(te, b, C), anonymousId: o(ke, b, C) }, A, [f, g, S]);
|
|
2405
2438
|
}));
|
|
2406
2439
|
} catch (A) {
|
|
2407
2440
|
return Promise.reject(A);
|
|
@@ -2412,7 +2445,7 @@ function io(t) {
|
|
|
2412
2445
|
if (f === ke || f === "anonId")
|
|
2413
2446
|
return o(ke, b);
|
|
2414
2447
|
var g = b.getState("user");
|
|
2415
|
-
return f ?
|
|
2448
|
+
return f ? Gt(g, f) : g;
|
|
2416
2449
|
}, reset: function(f) {
|
|
2417
2450
|
return new Promise(function(g) {
|
|
2418
2451
|
j.dispatch({ type: E.resetStart }, g, f);
|
|
@@ -2466,10 +2499,10 @@ function io(t) {
|
|
|
2466
2499
|
return S;
|
|
2467
2500
|
}, getState: function(f) {
|
|
2468
2501
|
var g = j.getState();
|
|
2469
|
-
return f ?
|
|
2502
|
+
return f ? Gt(g, f) : Object.assign({}, g);
|
|
2470
2503
|
}, dispatch: function(f) {
|
|
2471
2504
|
var g = re(f) ? { type: f } : f;
|
|
2472
|
-
if (
|
|
2505
|
+
if (qe.includes(g.type))
|
|
2473
2506
|
throw new Error("reserved action " + g.type);
|
|
2474
2507
|
var S = O({}, g, { _: O({ originalAction: g.type }, f._ || {}) });
|
|
2475
2508
|
j.dispatch(S);
|
|
@@ -2479,27 +2512,27 @@ function io(t) {
|
|
|
2479
2512
|
j.dispatch({ type: E.removeItemStart, key: f, options: g });
|
|
2480
2513
|
} }, setAnonymousId: function(f, g) {
|
|
2481
2514
|
b.storage.setItem(ie, f, g);
|
|
2482
|
-
}, events: { core:
|
|
2515
|
+
}, events: { core: qe, plugins: s } }, T = r.middlewares.concat([function(f) {
|
|
2483
2516
|
return function(g) {
|
|
2484
2517
|
return function(S) {
|
|
2485
|
-
return S.meta || (S.meta =
|
|
2518
|
+
return S.meta || (S.meta = yn()), g(S);
|
|
2486
2519
|
};
|
|
2487
2520
|
};
|
|
2488
|
-
}, w(Ve),
|
|
2521
|
+
}, w(Ve), Hi(b, u, { all: p, plugins: s }), Ji(i), Zi(b), Mi(b), w(Ye)]), P = { context: io, user: Ki(i), page: ro, track: Bi, plugins: Yi(u), queue: Qi }, x = Te, D = Te;
|
|
2489
2522
|
if (Y && t.debug) {
|
|
2490
2523
|
var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2491
2524
|
L && (x = L({ trace: !0, traceLimit: 25 })), D = function() {
|
|
2492
|
-
return arguments.length === 0 ?
|
|
2525
|
+
return arguments.length === 0 ? or() : X(typeof arguments[0]) ? gn() : gn().apply(null, arguments);
|
|
2493
2526
|
};
|
|
2494
2527
|
}
|
|
2495
2528
|
var H, U = function(f) {
|
|
2496
2529
|
return Object.keys(f).reduce(function(g, S) {
|
|
2497
|
-
return
|
|
2530
|
+
return oo.includes(S) || (g[S] = f[S]), g;
|
|
2498
2531
|
}, {});
|
|
2499
2532
|
}(t), J = r.pluginsArray.reduce(function(f, g) {
|
|
2500
2533
|
var S = g.name, C = g.config, $ = g.loaded, A = r.pluginEnabled[S];
|
|
2501
2534
|
return f[S] = { enabled: A, initialized: !!A && !g.initialize, loaded: !!$({ config: C }), config: C }, f;
|
|
2502
|
-
}, {}), W = { context: U, user: _, plugins: J }, j =
|
|
2535
|
+
}, {}), W = { context: U, user: _, plugins: J }, j = Yn(function(f) {
|
|
2503
2536
|
for (var g = Object.keys(f), S = {}, C = 0; C < g.length; C++) {
|
|
2504
2537
|
var $ = g[C];
|
|
2505
2538
|
typeof f[$] === ne && (S[$] = f[$]);
|
|
@@ -2509,7 +2542,7 @@ function io(t) {
|
|
|
2509
2542
|
(function(N) {
|
|
2510
2543
|
Object.keys(N).forEach(function(R) {
|
|
2511
2544
|
var z = N[R];
|
|
2512
|
-
if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type:
|
|
2545
|
+
if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type: Ui }) === ee)
|
|
2513
2546
|
throw new Error("reducer " + R + " " + ee);
|
|
2514
2547
|
});
|
|
2515
2548
|
})(S);
|
|
@@ -2520,18 +2553,18 @@ function io(t) {
|
|
|
2520
2553
|
if (N === void 0 && (N = {}), A)
|
|
2521
2554
|
throw A;
|
|
2522
2555
|
for (var z = !1, q = {}, Ae = 0; Ae < Z.length; Ae++) {
|
|
2523
|
-
var Me = Z[Ae],
|
|
2556
|
+
var Me = Z[Ae], Rt = N[Me], lt = (0, S[Me])(Rt, R);
|
|
2524
2557
|
if (typeof lt === ee) {
|
|
2525
|
-
var mr =
|
|
2558
|
+
var mr = Ri(Me, R);
|
|
2526
2559
|
throw new Error(mr);
|
|
2527
2560
|
}
|
|
2528
|
-
q[Me] = lt, z = z || lt !==
|
|
2561
|
+
q[Me] = lt, z = z || lt !== Rt;
|
|
2529
2562
|
}
|
|
2530
2563
|
return z ? q : N;
|
|
2531
2564
|
};
|
|
2532
|
-
}(O({}, P, e)), W, D(x(
|
|
2565
|
+
}(O({}, P, e)), W, D(x(Wi.apply(void 0, T))));
|
|
2533
2566
|
j.dispatch = (H = j.dispatch, function(f, g, S) {
|
|
2534
|
-
var C = O({}, f, { meta:
|
|
2567
|
+
var C = O({}, f, { meta: yn(f.meta, g, vt(S)) });
|
|
2535
2568
|
return H.apply(null, [C]);
|
|
2536
2569
|
});
|
|
2537
2570
|
var K = Object.keys(a);
|
|
@@ -2544,24 +2577,24 @@ function io(t) {
|
|
|
2544
2577
|
return j.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(f, g) {
|
|
2545
2578
|
var S = f.bootstrap, C = f.config, $ = f.name;
|
|
2546
2579
|
S && B(S) && S({ instance: b, config: C, payload: f }), j.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: f }), r.pluginsArray.length === g + 1 && j.dispatch({ type: E.initializeStart, plugins: M, disabled: $e });
|
|
2547
|
-
}),
|
|
2580
|
+
}), so(function(f) {
|
|
2548
2581
|
j.dispatch({ type: f ? E.offline : E.online });
|
|
2549
2582
|
}), function(f, g, S) {
|
|
2550
2583
|
setInterval(function() {
|
|
2551
|
-
return
|
|
2584
|
+
return Bn(f, g, S);
|
|
2552
2585
|
}, 3e3);
|
|
2553
2586
|
}(j, u, b), b;
|
|
2554
2587
|
}
|
|
2555
|
-
var Ve = "before", Ye = "after", Ue = "cookie", le =
|
|
2556
|
-
function
|
|
2588
|
+
var Ve = "before", Ye = "after", Ue = "cookie", le = cr(), ar = ct, uo = ct;
|
|
2589
|
+
function sr(t) {
|
|
2557
2590
|
return le ? ct(t, "", -1) : xe(t);
|
|
2558
2591
|
}
|
|
2559
|
-
function
|
|
2592
|
+
function cr() {
|
|
2560
2593
|
if (le !== void 0)
|
|
2561
2594
|
return le;
|
|
2562
2595
|
var t = "cookiecookie";
|
|
2563
2596
|
try {
|
|
2564
|
-
ct(t, t), le = document.cookie.indexOf(t) !== -1,
|
|
2597
|
+
ct(t, t), le = document.cookie.indexOf(t) !== -1, sr(t);
|
|
2565
2598
|
} catch {
|
|
2566
2599
|
le = !1;
|
|
2567
2600
|
}
|
|
@@ -2573,11 +2606,11 @@ function ct(t, e, n, r, i, o) {
|
|
|
2573
2606
|
return le === !1 && (a ? ye(t, e) : ge(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
|
|
2574
2607
|
}
|
|
2575
2608
|
}
|
|
2576
|
-
var Re = "localStorage",
|
|
2609
|
+
var Re = "localStorage", lo = $t.bind(null, "localStorage");
|
|
2577
2610
|
Ce("localStorage", "getItem", ge);
|
|
2578
2611
|
Ce("localStorage", "setItem", ye);
|
|
2579
2612
|
Ce("localStorage", "removeItem", xe);
|
|
2580
|
-
var We = "sessionStorage",
|
|
2613
|
+
var We = "sessionStorage", ho = $t.bind(null, "sessionStorage");
|
|
2581
2614
|
Ce("sessionStorage", "getItem", ge);
|
|
2582
2615
|
Ce("sessionStorage", "setItem", ye);
|
|
2583
2616
|
Ce("sessionStorage", "removeItem", xe);
|
|
@@ -2596,57 +2629,57 @@ function Se(t) {
|
|
|
2596
2629
|
if (e !== null && e !== "")
|
|
2597
2630
|
return e;
|
|
2598
2631
|
}
|
|
2599
|
-
var
|
|
2600
|
-
function
|
|
2632
|
+
var fo = lo(), po = ho(), mo = cr();
|
|
2633
|
+
function ur(t, e) {
|
|
2601
2634
|
if (t) {
|
|
2602
|
-
var n =
|
|
2635
|
+
var n = At(e), r = !Dt(n), i = zt(n) ? Se(localStorage.getItem(t)) : void 0;
|
|
2603
2636
|
if (r && !be(i))
|
|
2604
2637
|
return i;
|
|
2605
|
-
var o =
|
|
2638
|
+
var o = Nt(n) ? Se(ar(t)) : void 0;
|
|
2606
2639
|
if (r && o)
|
|
2607
2640
|
return o;
|
|
2608
|
-
var a =
|
|
2641
|
+
var a = Lt(n) ? Se(sessionStorage.getItem(t)) : void 0;
|
|
2609
2642
|
if (r && a)
|
|
2610
2643
|
return a;
|
|
2611
2644
|
var s = ge(t);
|
|
2612
2645
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2613
2646
|
}
|
|
2614
2647
|
}
|
|
2615
|
-
function
|
|
2648
|
+
function go(t, e, n) {
|
|
2616
2649
|
if (t && !be(e)) {
|
|
2617
|
-
var r = {}, i =
|
|
2618
|
-
return
|
|
2650
|
+
var r = {}, i = At(n), o = JSON.stringify(e), a = !Dt(i);
|
|
2651
|
+
return zt(i) && (r[Re] = Ge(Re, e, Se(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Re] : Nt(i) && (r[Ue] = Ge(Ue, e, Se(ar(t))), uo(t, o), a) ? r[Ue] : Lt(i) && (r[We] = Ge(We, e, Se(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[We] : (r[De] = Ge(De, e, ge(t)), ye(t, e), a ? r[De] : r);
|
|
2619
2652
|
}
|
|
2620
2653
|
}
|
|
2621
|
-
function
|
|
2654
|
+
function yo(t, e) {
|
|
2622
2655
|
if (t) {
|
|
2623
|
-
var n =
|
|
2624
|
-
return !be(r.localStorage) &&
|
|
2656
|
+
var n = At(e), r = ur(t, Xn), i = {};
|
|
2657
|
+
return !be(r.localStorage) && zt(n) && (localStorage.removeItem(t), i[Re] = r.localStorage), !be(r.cookie) && Nt(n) && (sr(t), i[Ue] = r.cookie), !be(r.sessionStorage) && Lt(n) && (sessionStorage.removeItem(t), i[We] = r.sessionStorage), !be(r.global) && ut(n, De) && (xe(t), i[De] = r.global), i;
|
|
2625
2658
|
}
|
|
2626
2659
|
}
|
|
2627
|
-
function $t(t) {
|
|
2628
|
-
return t ? re(t) ? t : t.storage : Zn;
|
|
2629
|
-
}
|
|
2630
2660
|
function At(t) {
|
|
2631
|
-
return
|
|
2661
|
+
return t ? re(t) ? t : t.storage : Mn;
|
|
2632
2662
|
}
|
|
2633
2663
|
function zt(t) {
|
|
2634
|
-
return
|
|
2664
|
+
return fo && ut(t, Re);
|
|
2635
2665
|
}
|
|
2636
2666
|
function Nt(t) {
|
|
2637
|
-
return
|
|
2667
|
+
return mo && ut(t, Ue);
|
|
2638
2668
|
}
|
|
2639
2669
|
function Lt(t) {
|
|
2640
|
-
return
|
|
2670
|
+
return po && ut(t, We);
|
|
2671
|
+
}
|
|
2672
|
+
function Dt(t) {
|
|
2673
|
+
return t === Xn || t === "all";
|
|
2641
2674
|
}
|
|
2642
2675
|
function ut(t, e) {
|
|
2643
|
-
return t ===
|
|
2676
|
+
return t === Mn || t === e || Dt(t);
|
|
2644
2677
|
}
|
|
2645
2678
|
function Ge(t, e, n) {
|
|
2646
2679
|
return { location: t, current: e, previous: n };
|
|
2647
2680
|
}
|
|
2648
|
-
var
|
|
2649
|
-
function
|
|
2681
|
+
var vo = { setItem: go, getItem: ur, removeItem: yo };
|
|
2682
|
+
function wo(t, e, n) {
|
|
2650
2683
|
return e in t ? Object.defineProperty(t, e, {
|
|
2651
2684
|
value: n,
|
|
2652
2685
|
enumerable: !0,
|
|
@@ -2654,7 +2687,7 @@ function mo(t, e, n) {
|
|
|
2654
2687
|
writable: !0
|
|
2655
2688
|
}) : t[e] = n, t;
|
|
2656
2689
|
}
|
|
2657
|
-
function
|
|
2690
|
+
function vn(t, e) {
|
|
2658
2691
|
var n = Object.keys(t);
|
|
2659
2692
|
if (Object.getOwnPropertySymbols) {
|
|
2660
2693
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2664,24 +2697,24 @@ function yn(t, e) {
|
|
|
2664
2697
|
}
|
|
2665
2698
|
return n;
|
|
2666
2699
|
}
|
|
2667
|
-
function
|
|
2700
|
+
function wn(t) {
|
|
2668
2701
|
for (var e = 1; e < arguments.length; e++) {
|
|
2669
2702
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2670
|
-
e % 2 ?
|
|
2671
|
-
|
|
2672
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2703
|
+
e % 2 ? vn(Object(n), !0).forEach(function(r) {
|
|
2704
|
+
wo(t, r, n[r]);
|
|
2705
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : vn(Object(n)).forEach(function(r) {
|
|
2673
2706
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2674
2707
|
});
|
|
2675
2708
|
}
|
|
2676
2709
|
return t;
|
|
2677
2710
|
}
|
|
2678
|
-
function
|
|
2711
|
+
function bo() {
|
|
2679
2712
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2680
|
-
storage:
|
|
2713
|
+
storage: vo
|
|
2681
2714
|
};
|
|
2682
|
-
return
|
|
2715
|
+
return co(wn(wn({}, e), t));
|
|
2683
2716
|
}
|
|
2684
|
-
function
|
|
2717
|
+
function ko(t, e) {
|
|
2685
2718
|
e = e || {};
|
|
2686
2719
|
var n, r, i = [], o = e.max || 1 / 0;
|
|
2687
2720
|
function a() {
|
|
@@ -2703,8 +2736,7 @@ function yo(t, e) {
|
|
|
2703
2736
|
}
|
|
2704
2737
|
};
|
|
2705
2738
|
}
|
|
2706
|
-
|
|
2707
|
-
function vo(t) {
|
|
2739
|
+
function Io(t) {
|
|
2708
2740
|
if (!(typeof window > "u")) {
|
|
2709
2741
|
var e = window, n = e.addEventListener, r = e.history, i = e.location, o = i.pathname;
|
|
2710
2742
|
n("popstate", function() {
|
|
@@ -2712,7 +2744,7 @@ function vo(t) {
|
|
|
2712
2744
|
}), ["push", "replace"].map(function(a) {
|
|
2713
2745
|
var s = "".concat(a, "State"), m = r[s];
|
|
2714
2746
|
r[s] = function() {
|
|
2715
|
-
var p = arguments, u =
|
|
2747
|
+
var p = arguments, u = So(arguments[2]);
|
|
2716
2748
|
return o !== u && (o = u, setTimeout(function() {
|
|
2717
2749
|
return t(p[2]);
|
|
2718
2750
|
}, 0)), m.apply(r, arguments);
|
|
@@ -2720,27 +2752,27 @@ function vo(t) {
|
|
|
2720
2752
|
});
|
|
2721
2753
|
}
|
|
2722
2754
|
}
|
|
2723
|
-
function
|
|
2755
|
+
function _o(t, e) {
|
|
2724
2756
|
var n = t.indexOf(e);
|
|
2725
2757
|
return n > -1 ? t.slice(0, n) : t;
|
|
2726
2758
|
}
|
|
2727
|
-
function
|
|
2759
|
+
function So(t) {
|
|
2728
2760
|
return ["#", "?"].forEach(function(e) {
|
|
2729
|
-
return t =
|
|
2761
|
+
return t = _o(t, e);
|
|
2730
2762
|
}), t;
|
|
2731
2763
|
}
|
|
2732
|
-
function
|
|
2733
|
-
|
|
2764
|
+
function Eo() {
|
|
2765
|
+
Io(() => {
|
|
2734
2766
|
ce.page();
|
|
2735
2767
|
});
|
|
2736
2768
|
}
|
|
2737
|
-
var
|
|
2738
|
-
function
|
|
2769
|
+
var bn = "EventListener";
|
|
2770
|
+
function Oo(t) {
|
|
2739
2771
|
return function(e, n, r, i) {
|
|
2740
|
-
var o = r ||
|
|
2772
|
+
var o = r || _i, a = i || !1;
|
|
2741
2773
|
if (!Y)
|
|
2742
2774
|
return o;
|
|
2743
|
-
var s =
|
|
2775
|
+
var s = tt(n), m = tt(e, !0);
|
|
2744
2776
|
if (!m.length)
|
|
2745
2777
|
throw new Error("noElements");
|
|
2746
2778
|
if (!s.length)
|
|
@@ -2748,9 +2780,9 @@ function Io(t) {
|
|
|
2748
2780
|
var p = [];
|
|
2749
2781
|
return function u(c) {
|
|
2750
2782
|
c && (p = []);
|
|
2751
|
-
for (var h = c ? "add" +
|
|
2783
|
+
for (var h = c ? "add" + bn : "remove" + bn, d = 0; d < m.length; d++) {
|
|
2752
2784
|
var w = m[d];
|
|
2753
|
-
p[d] = c ? a && a.once ?
|
|
2785
|
+
p[d] = c ? a && a.once ? Po(o) : o : p[d] || o;
|
|
2754
2786
|
for (var k = 0; k < s.length; k++)
|
|
2755
2787
|
w[h] ? w["on" + s[k]] = c ? p[d] : null : w[h](s[k], p[d], a);
|
|
2756
2788
|
}
|
|
@@ -2758,9 +2790,9 @@ function Io(t) {
|
|
|
2758
2790
|
}(t);
|
|
2759
2791
|
};
|
|
2760
2792
|
}
|
|
2761
|
-
function
|
|
2793
|
+
function tt(t, e) {
|
|
2762
2794
|
if (re(t))
|
|
2763
|
-
return e ?
|
|
2795
|
+
return e ? tt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2764
2796
|
return a.trim();
|
|
2765
2797
|
});
|
|
2766
2798
|
var n;
|
|
@@ -2769,18 +2801,18 @@ function nt(t, e) {
|
|
|
2769
2801
|
r[i] = t[i];
|
|
2770
2802
|
return r;
|
|
2771
2803
|
}
|
|
2772
|
-
var o =
|
|
2804
|
+
var o = Ai(t);
|
|
2773
2805
|
return e ? o.map(function(a) {
|
|
2774
|
-
return re(a) ?
|
|
2806
|
+
return re(a) ? tt(a, !0) : a;
|
|
2775
2807
|
}).flat() : o;
|
|
2776
2808
|
}
|
|
2777
|
-
function
|
|
2809
|
+
function Po(t, e) {
|
|
2778
2810
|
var n;
|
|
2779
2811
|
return function() {
|
|
2780
2812
|
return t && (n = t.apply(e || this, arguments), t = null), n;
|
|
2781
2813
|
};
|
|
2782
2814
|
}
|
|
2783
|
-
var wt =
|
|
2815
|
+
var wt = Oo("Event");
|
|
2784
2816
|
function lr(t, e) {
|
|
2785
2817
|
return Y && B(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), B(n) ? function() {
|
|
2786
2818
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
@@ -2789,11 +2821,11 @@ function lr(t, e) {
|
|
|
2789
2821
|
}
|
|
2790
2822
|
lr.bind(null, "onerror");
|
|
2791
2823
|
lr.bind(null, "onload");
|
|
2792
|
-
var dr = typeof window > "u",
|
|
2793
|
-
function
|
|
2824
|
+
var dr = typeof window > "u", kn = "hidden";
|
|
2825
|
+
function To(t) {
|
|
2794
2826
|
if (dr)
|
|
2795
2827
|
return !1;
|
|
2796
|
-
var e =
|
|
2828
|
+
var e = jo(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2797
2829
|
return t(!!document[e]);
|
|
2798
2830
|
}, i = function() {
|
|
2799
2831
|
return document.addEventListener(n, r);
|
|
@@ -2802,15 +2834,15 @@ function So(t) {
|
|
|
2802
2834
|
return document.removeEventListener(n, r), i;
|
|
2803
2835
|
};
|
|
2804
2836
|
}
|
|
2805
|
-
function
|
|
2837
|
+
function jo() {
|
|
2806
2838
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2807
|
-
return dr ||
|
|
2839
|
+
return dr || kn in document ? kn : t.reduce(function(e, n) {
|
|
2808
2840
|
var r = n + "Hidden";
|
|
2809
2841
|
return !e && r in document ? r : e;
|
|
2810
2842
|
}, null);
|
|
2811
2843
|
}
|
|
2812
|
-
var
|
|
2813
|
-
function
|
|
2844
|
+
var xo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
|
|
2845
|
+
function Co(t, e) {
|
|
2814
2846
|
e === void 0 && (e = {});
|
|
2815
2847
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2816
2848
|
var m = this, p = !1;
|
|
@@ -2821,10 +2853,10 @@ function Po(t, e) {
|
|
|
2821
2853
|
};
|
|
2822
2854
|
}(t, e.throttle || 1e4), r = [];
|
|
2823
2855
|
function i() {
|
|
2824
|
-
var a =
|
|
2856
|
+
var a = To(function(s) {
|
|
2825
2857
|
s || n({ type: "tabVisible" });
|
|
2826
2858
|
});
|
|
2827
|
-
return r = [a].concat(
|
|
2859
|
+
return r = [a].concat(xo.map(function(s) {
|
|
2828
2860
|
return wt(document, s, n);
|
|
2829
2861
|
})).concat(wt(window, "load", n)).concat(wt(window, "scroll", n, { capture: !0, passive: !0 })), o;
|
|
2830
2862
|
}
|
|
@@ -2837,7 +2869,7 @@ function Po(t, e) {
|
|
|
2837
2869
|
return o(), i;
|
|
2838
2870
|
};
|
|
2839
2871
|
}
|
|
2840
|
-
function
|
|
2872
|
+
function $o(t) {
|
|
2841
2873
|
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, m = t.throttle, p = m === void 0 ? 2e3 : m, u = !1, c = !1, h = /* @__PURE__ */ new Date(), d = function() {
|
|
2842
2874
|
return clearTimeout(e);
|
|
2843
2875
|
};
|
|
@@ -2846,7 +2878,7 @@ function To(t) {
|
|
|
2846
2878
|
u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ne(h), v));
|
|
2847
2879
|
}, s);
|
|
2848
2880
|
}
|
|
2849
|
-
var k =
|
|
2881
|
+
var k = Co(w, { throttle: p });
|
|
2850
2882
|
return { disable: function() {
|
|
2851
2883
|
c = !0, u = !1, d();
|
|
2852
2884
|
var v = k();
|
|
@@ -2860,8 +2892,8 @@ function To(t) {
|
|
|
2860
2892
|
function Ne(t, e) {
|
|
2861
2893
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
2862
2894
|
}
|
|
2863
|
-
const
|
|
2864
|
-
class
|
|
2895
|
+
const In = 5e3;
|
|
2896
|
+
class Ao {
|
|
2865
2897
|
constructor(e) {
|
|
2866
2898
|
G(this, "element");
|
|
2867
2899
|
G(this, "isInViewport", !1);
|
|
@@ -2882,29 +2914,23 @@ class jo {
|
|
|
2882
2914
|
{
|
|
2883
2915
|
threshold: 0
|
|
2884
2916
|
}
|
|
2885
|
-
), this.observer.observe(this.element),
|
|
2917
|
+
), this.observer.observe(this.element), $o({
|
|
2886
2918
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
2887
2919
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
2888
|
-
timeout:
|
|
2920
|
+
timeout: In
|
|
2889
2921
|
});
|
|
2890
2922
|
}
|
|
2891
2923
|
/**
|
|
2892
2924
|
* Flush the awake timer in case the page is unloading
|
|
2893
2925
|
*/
|
|
2894
2926
|
flush() {
|
|
2895
|
-
this.isFlushing = !0, this.handleAwake(
|
|
2896
|
-
!this.isAwake,
|
|
2897
|
-
Math.round((Date.now() - this.lastEventAt) / 1e3)
|
|
2898
|
-
);
|
|
2927
|
+
this.isFlushing = !0, this.handleAwake(!this.isAwake, Math.round((Date.now() - this.lastEventAt) / 1e3));
|
|
2899
2928
|
}
|
|
2900
2929
|
handleInViewPort(e) {
|
|
2901
|
-
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(
|
|
2902
|
-
!1,
|
|
2903
|
-
Math.round((Date.now() - this.lastEventAt) / 1e3)
|
|
2904
|
-
), this.isInViewport = e;
|
|
2930
|
+
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1, Math.round((Date.now() - this.lastEventAt) / 1e3)), this.isInViewport = e;
|
|
2905
2931
|
}
|
|
2906
2932
|
handleAwake(e, n) {
|
|
2907
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
2933
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * In : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
2908
2934
|
}
|
|
2909
2935
|
trackAwake(e, n) {
|
|
2910
2936
|
!e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
|
|
@@ -2913,21 +2939,17 @@ class jo {
|
|
|
2913
2939
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
2914
2940
|
}
|
|
2915
2941
|
}
|
|
2916
|
-
const
|
|
2917
|
-
function
|
|
2918
|
-
let t = sessionStorage.getItem(
|
|
2919
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
2942
|
+
const _n = "sesamy_session_id";
|
|
2943
|
+
function zo() {
|
|
2944
|
+
let t = sessionStorage.getItem(_n);
|
|
2945
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(_n, t)), t;
|
|
2920
2946
|
}
|
|
2921
|
-
let hr = !1, Pt,
|
|
2922
|
-
function
|
|
2923
|
-
|
|
2924
|
-
enabled: e = !0,
|
|
2925
|
-
endpoint: n = Mr
|
|
2926
|
-
}) {
|
|
2927
|
-
if (Pt = t, _n = e, rt = n, !_n)
|
|
2947
|
+
let hr = !1, Pt, Sn, nt;
|
|
2948
|
+
function No({ clientId: t, enabled: e = !0, endpoint: n = Mr }) {
|
|
2949
|
+
if (Pt = t, Sn = e, nt = n, !Sn)
|
|
2928
2950
|
return;
|
|
2929
|
-
|
|
2930
|
-
const r = new
|
|
2951
|
+
Eo();
|
|
2952
|
+
const r = new Ao({
|
|
2931
2953
|
element: document.body,
|
|
2932
2954
|
viewCallback: () => {
|
|
2933
2955
|
ce.page();
|
|
@@ -2945,13 +2967,13 @@ function Co({
|
|
|
2945
2967
|
});
|
|
2946
2968
|
}
|
|
2947
2969
|
});
|
|
2948
|
-
|
|
2970
|
+
Do(document.body, () => {
|
|
2949
2971
|
r.flush();
|
|
2950
2972
|
}), window.addEventListener(oe.AUTHENTICATED, async (i) => {
|
|
2951
2973
|
const o = i;
|
|
2952
2974
|
await ce.identify(o.detail.sub);
|
|
2953
2975
|
}), window.addEventListener(oe.LOGOUT, async () => {
|
|
2954
|
-
await ce.track("logout", {}),
|
|
2976
|
+
await ce.track("logout", {}), Ut.flush(), await ce.reset();
|
|
2955
2977
|
});
|
|
2956
2978
|
}
|
|
2957
2979
|
function fr(t) {
|
|
@@ -2960,9 +2982,9 @@ function fr(t) {
|
|
|
2960
2982
|
...e,
|
|
2961
2983
|
clientId: Pt,
|
|
2962
2984
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
2963
|
-
sessionId:
|
|
2985
|
+
sessionId: zo(),
|
|
2964
2986
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2965
|
-
version:
|
|
2987
|
+
version: Ct,
|
|
2966
2988
|
event: e.event,
|
|
2967
2989
|
context: {
|
|
2968
2990
|
page: {
|
|
@@ -2973,18 +2995,18 @@ function fr(t) {
|
|
|
2973
2995
|
referrer: document.referrer
|
|
2974
2996
|
},
|
|
2975
2997
|
locale: navigator.language,
|
|
2976
|
-
library:
|
|
2998
|
+
library: Kn,
|
|
2977
2999
|
userAgent: navigator.userAgent,
|
|
2978
3000
|
clientId: Pt
|
|
2979
3001
|
}
|
|
2980
3002
|
}))
|
|
2981
3003
|
);
|
|
2982
3004
|
}
|
|
2983
|
-
const
|
|
3005
|
+
const Ut = ko(
|
|
2984
3006
|
async (t) => {
|
|
2985
3007
|
if (t.length > 0) {
|
|
2986
3008
|
const e = fr(t);
|
|
2987
|
-
hr ? navigator.sendBeacon(
|
|
3009
|
+
hr ? navigator.sendBeacon(nt, e) : (await fetch(nt, {
|
|
2988
3010
|
method: "POST",
|
|
2989
3011
|
body: e,
|
|
2990
3012
|
headers: {
|
|
@@ -3005,13 +3027,13 @@ function bt(t) {
|
|
|
3005
3027
|
if (t.anonymousId)
|
|
3006
3028
|
if ((e = t.properties) != null && e.flushing) {
|
|
3007
3029
|
const n = { ...t };
|
|
3008
|
-
delete n.properties.flushing, navigator.sendBeacon(
|
|
3030
|
+
delete n.properties.flushing, navigator.sendBeacon(nt, fr([n]));
|
|
3009
3031
|
} else
|
|
3010
|
-
|
|
3032
|
+
Ut.push(t);
|
|
3011
3033
|
}
|
|
3012
|
-
const ce =
|
|
3013
|
-
app:
|
|
3014
|
-
version:
|
|
3034
|
+
const ce = bo({
|
|
3035
|
+
app: Kn,
|
|
3036
|
+
version: Ct,
|
|
3015
3037
|
plugins: [
|
|
3016
3038
|
{
|
|
3017
3039
|
name: "custom-analytics-plugin",
|
|
@@ -3047,35 +3069,37 @@ const ce = go({
|
|
|
3047
3069
|
}
|
|
3048
3070
|
]
|
|
3049
3071
|
});
|
|
3050
|
-
function
|
|
3051
|
-
return hr = !0,
|
|
3072
|
+
function Lo() {
|
|
3073
|
+
return hr = !0, Ut.flush();
|
|
3052
3074
|
}
|
|
3053
3075
|
const pr = /* @__PURE__ */ new Map();
|
|
3054
|
-
function
|
|
3076
|
+
function Do(t, e) {
|
|
3055
3077
|
pr.set(t, e);
|
|
3056
3078
|
}
|
|
3057
3079
|
window.addEventListener("beforeunload", () => {
|
|
3058
3080
|
pr.forEach((t, e) => {
|
|
3059
3081
|
t.bind(e)();
|
|
3060
|
-
}),
|
|
3082
|
+
}), Lo();
|
|
3061
3083
|
});
|
|
3062
|
-
async function
|
|
3063
|
-
|
|
3084
|
+
async function Uo(t) {
|
|
3085
|
+
No({
|
|
3064
3086
|
clientId: t.clientId,
|
|
3065
3087
|
// The default client id can be overridden by the config
|
|
3066
3088
|
...t.analytics
|
|
3067
|
-
}), await Xr(t),
|
|
3089
|
+
}), await Xr(t), Ii(t.namespace), rt(oe.READY, {});
|
|
3068
3090
|
}
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3091
|
+
if (typeof document < "u") {
|
|
3092
|
+
const t = document.getElementById("sesamy-js");
|
|
3093
|
+
if (t != null && t.textContent)
|
|
3094
|
+
try {
|
|
3095
|
+
const e = JSON.parse(t.textContent);
|
|
3096
|
+
Uo(e);
|
|
3097
|
+
} catch (e) {
|
|
3098
|
+
console.error("Failed to parse config", e);
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
const Ro = "/sesamy.png";
|
|
3102
|
+
class Wo extends HTMLElement {
|
|
3079
3103
|
constructor() {
|
|
3080
3104
|
super();
|
|
3081
3105
|
G(this, "user");
|
|
@@ -3094,7 +3118,7 @@ class Lo extends HTMLElement {
|
|
|
3094
3118
|
this.innerHTML = `
|
|
3095
3119
|
<div>
|
|
3096
3120
|
<a href="https://docs.sesamy.com" target="_blank">
|
|
3097
|
-
<img src="${
|
|
3121
|
+
<img src="${Ro}" class="logo" alt="Vite logo" />
|
|
3098
3122
|
</a>
|
|
3099
3123
|
<h1>Sesamy JS</h1>
|
|
3100
3124
|
<p class="read-the-docs">
|
|
@@ -3142,4 +3166,4 @@ class Lo extends HTMLElement {
|
|
|
3142
3166
|
});
|
|
3143
3167
|
}
|
|
3144
3168
|
}
|
|
3145
|
-
customElements.define("sesamy-app",
|
|
3169
|
+
customElements.define("sesamy-app", Wo);
|