@sesamy/sesamy-js 1.0.1 → 1.0.3

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.
@@ -1,6 +1,6 @@
1
- var tr = Object.defineProperty;
2
- var nr = (t, e, n) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var Y = (t, e, n) => (nr(t, typeof e != "symbol" ? e + "" : e, n), n);
1
+ var rr = Object.defineProperty;
2
+ var ir = (t, e, n) => e in t ? rr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var Y = (t, e, n) => (ir(t, typeof e != "symbol" ? e + "" : e, n), n);
4
4
  (function() {
5
5
  const e = document.createElement("link").relList;
6
6
  if (e && e.supports && e.supports("modulepreload"))
@@ -25,16 +25,15 @@ var Y = (t, e, n) => (nr(t, typeof e != "symbol" ? e + "" : e, n), n);
25
25
  fetch(i.href, o);
26
26
  }
27
27
  })();
28
- var wt = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t))(wt || {});
29
- async function rr() {
30
- const t = new CustomEvent(wt.READY, {
31
- detail: {},
28
+ function It(t, e) {
29
+ const n = new CustomEvent(t, {
30
+ detail: e,
32
31
  bubbles: !0,
33
32
  composed: !0
34
33
  });
35
- dispatchEvent(t);
34
+ dispatchEvent(n);
36
35
  }
37
- function q(t, e) {
36
+ function Q(t, e) {
38
37
  var n = {};
39
38
  for (var r in t)
40
39
  Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
@@ -45,14 +44,14 @@ function q(t, e) {
45
44
  }
46
45
  return n;
47
46
  }
48
- var ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
49
- function bt(t) {
47
+ var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
48
+ function St(t) {
50
49
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
51
50
  }
52
- function kt(t, e) {
51
+ function _t(t, e) {
53
52
  return t(e = { exports: {} }, e.exports), e.exports;
54
53
  }
55
- var oe = kt(function(t, e) {
54
+ var oe = _t(function(t, e) {
56
55
  Object.defineProperty(e, "__esModule", { value: !0 });
57
56
  var n = function() {
58
57
  function r() {
@@ -83,9 +82,9 @@ var oe = kt(function(t, e) {
83
82
  return n.getInstance();
84
83
  };
85
84
  });
86
- bt(oe);
87
- var ir = bt(kt(function(t, e) {
88
- var n = ae && ae.__awaiter || function(u, c, d, h) {
85
+ St(oe);
86
+ var or = St(_t(function(t, e) {
87
+ var n = se && se.__awaiter || function(u, c, d, h) {
89
88
  return new (d || (d = Promise))(function(v, w) {
90
89
  function y(I) {
91
90
  try {
@@ -108,7 +107,7 @@ var ir = bt(kt(function(t, e) {
108
107
  }
109
108
  _((h = h.apply(u, c || [])).next());
110
109
  });
111
- }, r = ae && ae.__generator || function(u, c) {
110
+ }, r = se && se.__generator || function(u, c) {
112
111
  var d, h, v, w, y = { label: 0, sent: function() {
113
112
  if (1 & v[0])
114
113
  throw v[1];
@@ -171,7 +170,7 @@ var ir = bt(kt(function(t, e) {
171
170
  }([_, I]);
172
171
  };
173
172
  }
174
- }, i = ae;
173
+ }, i = se;
175
174
  Object.defineProperty(e, "__esModule", { value: !0 });
176
175
  var o = "browser-tabs-lock-key", a = { key: function(u) {
177
176
  return n(i, void 0, void 0, function() {
@@ -352,63 +351,63 @@ var ir = bt(kt(function(t, e) {
352
351
  }();
353
352
  e.default = m;
354
353
  }));
355
- const or = { timeoutInSeconds: 60 }, hn = { name: "auth0-spa-js", version: "2.1.3" }, fn = () => Date.now();
356
- let J = class ft extends Error {
354
+ const ar = { timeoutInSeconds: 60 }, gn = { name: "auth0-spa-js", version: "2.1.3" }, vn = () => Date.now();
355
+ let J = class mt extends Error {
357
356
  constructor(e, n) {
358
- super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, ft.prototype);
357
+ super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, mt.prototype);
359
358
  }
360
359
  static fromPayload({ error: e, error_description: n }) {
361
- return new ft(e, n);
360
+ return new mt(e, n);
362
361
  }
363
- }, ar = class pn extends J {
362
+ }, sr = class yn extends J {
364
363
  constructor(e, n, r, i = null) {
365
- super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, pn.prototype);
364
+ super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, yn.prototype);
366
365
  }
367
- }, pt = class mn extends J {
366
+ }, gt = class wn extends J {
368
367
  constructor() {
369
- super("timeout", "Timeout"), Object.setPrototypeOf(this, mn.prototype);
368
+ super("timeout", "Timeout"), Object.setPrototypeOf(this, wn.prototype);
370
369
  }
371
- }, sr = class gn extends pt {
370
+ }, cr = class bn extends gt {
372
371
  constructor(e) {
373
- super(), this.popup = e, Object.setPrototypeOf(this, gn.prototype);
372
+ super(), this.popup = e, Object.setPrototypeOf(this, bn.prototype);
374
373
  }
375
- }, cr = class vn extends J {
374
+ }, ur = class kn extends J {
376
375
  constructor(e) {
377
- super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, vn.prototype);
376
+ super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, kn.prototype);
378
377
  }
379
- }, ur = class yn extends J {
378
+ }, lr = class In extends J {
380
379
  constructor(e, n, r) {
381
- super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, yn.prototype);
380
+ super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, In.prototype);
382
381
  }
383
- }, wn = class bn extends J {
382
+ }, Sn = class _n extends J {
384
383
  constructor(e, n) {
385
- super("missing_refresh_token", `Missing Refresh Token (audience: '${jt(e, ["default"])}', scope: '${jt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, bn.prototype);
384
+ super("missing_refresh_token", `Missing Refresh Token (audience: '${zt(e, ["default"])}', scope: '${zt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, _n.prototype);
386
385
  }
387
386
  };
388
- function jt(t, e = []) {
387
+ function zt(t, e = []) {
389
388
  return t && !e.includes(t) ? t : "";
390
389
  }
391
- const Ve = () => window.crypto, it = () => {
390
+ const Je = () => window.crypto, ot = () => {
392
391
  const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
393
392
  let e = "";
394
- return Array.from(Ve().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
395
- }, Tt = (t) => btoa(t), mt = (t) => {
396
- var { clientId: e } = t, n = q(t, ["clientId"]);
393
+ return Array.from(Je().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
394
+ }, Nt = (t) => btoa(t), vt = (t) => {
395
+ var { clientId: e } = t, n = Q(t, ["clientId"]);
397
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();
398
- }, Ct = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), lr = async (t, e) => {
397
+ }, At = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), dr = async (t, e) => {
399
398
  const n = await fetch(t, e);
400
399
  return { ok: n.ok, json: await n.json() };
401
- }, dr = async (t, e, n) => {
400
+ }, hr = async (t, e, n) => {
402
401
  const r = new AbortController();
403
402
  let i;
404
- return e.signal = r.signal, Promise.race([lr(t, e), new Promise((o, a) => {
403
+ return e.signal = r.signal, Promise.race([dr(t, e), new Promise((o, a) => {
405
404
  i = setTimeout(() => {
406
405
  r.abort(), a(new Error("Timeout when executing 'fetch'"));
407
406
  }, n);
408
407
  })]).finally(() => {
409
408
  clearTimeout(i);
410
409
  });
411
- }, hr = async (t, e, n, r, i, o, a) => {
410
+ }, fr = async (t, e, n, r, i, o, a) => {
412
411
  return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, f = o, new Promise(function(m, u) {
413
412
  const c = new MessageChannel();
414
413
  c.port1.onmessage = function(d) {
@@ -416,34 +415,34 @@ const Ve = () => window.crypto, it = () => {
416
415
  }, f.postMessage(s, [c.port2]);
417
416
  });
418
417
  var s, f;
419
- }, fr = async (t, e, n, r, i, o, a = 1e4) => i ? hr(t, e, n, r, a, i, o) : dr(t, r, a);
420
- async function pr(t, e) {
421
- var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
422
- const m = s ? mt(f) : JSON.stringify(f);
418
+ }, pr = async (t, e, n, r, i, o, a = 1e4) => i ? fr(t, e, n, r, a, i, o) : hr(t, r, a);
419
+ async function mr(t, e) {
420
+ var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
421
+ const m = s ? vt(f) : JSON.stringify(f);
423
422
  return await async function(u, c, d, h, v, w, y) {
424
423
  let k, _ = null;
425
424
  for (let x = 0; x < 3; x++)
426
425
  try {
427
- k = await fr(u, d, h, v, w, y, c), _ = null;
426
+ k = await pr(u, d, h, v, w, y, c), _ = null;
428
427
  break;
429
- } catch (A) {
430
- _ = A;
428
+ } catch (D) {
429
+ _ = D;
431
430
  }
432
431
  if (_)
433
432
  throw _;
434
- const I = k.json, { error: g, error_description: b } = I, D = q(I, ["error", "error_description"]), { ok: C } = k;
433
+ const I = k.json, { error: g, error_description: b } = I, A = Q(I, ["error", "error_description"]), { ok: C } = k;
435
434
  if (!C) {
436
435
  const x = b || `HTTP error. Unable to fetch ${u}`;
437
- throw g === "mfa_required" ? new ur(g, x, D.mfa_token) : g === "missing_refresh_token" ? new wn(d, h) : new J(g || "request_error", x);
436
+ throw g === "mfa_required" ? new lr(g, x, A.mfa_token) : g === "missing_refresh_token" ? new Sn(d, h) : new J(g || "request_error", x);
438
437
  }
439
- return D;
440
- }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || hn)) } }, e, s);
438
+ return A;
439
+ }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || gn)) } }, e, s);
441
440
  }
442
- const Ae = (...t) => {
441
+ const Ze = (...t) => {
443
442
  return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
444
443
  var e;
445
444
  };
446
- let ce = class gt {
445
+ let ue = class yt {
447
446
  constructor(e, n = "@@auth0spajs@@", r) {
448
447
  this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
449
448
  }
@@ -452,13 +451,13 @@ let ce = class gt {
452
451
  }
453
452
  static fromKey(e) {
454
453
  const [n, r, i, o] = e.split("::");
455
- return new gt({ clientId: r, scope: o, audience: i }, n);
454
+ return new yt({ clientId: r, scope: o, audience: i }, n);
456
455
  }
457
456
  static fromCacheEntry(e) {
458
457
  const { scope: n, audience: r, client_id: i } = e;
459
- return new gt({ scope: n, audience: r, clientId: i });
458
+ return new yt({ scope: n, audience: r, clientId: i });
460
459
  }
461
- }, mr = class {
460
+ }, gr = class {
462
461
  set(e, n) {
463
462
  localStorage.setItem(e, JSON.stringify(n));
464
463
  }
@@ -477,7 +476,7 @@ let ce = class gt {
477
476
  allKeys() {
478
477
  return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
479
478
  }
480
- }, kn = class {
479
+ }, On = class {
481
480
  constructor() {
482
481
  this.enclosedCache = /* @__PURE__ */ function() {
483
482
  let e = {};
@@ -492,9 +491,9 @@ let ce = class gt {
492
491
  }, allKeys: () => Object.keys(e) };
493
492
  }();
494
493
  }
495
- }, gr = class {
494
+ }, vr = class {
496
495
  constructor(e, n, r) {
497
- this.cache = e, this.keyManifest = n, this.nowProvider = r || fn;
496
+ this.cache = e, this.keyManifest = n, this.nowProvider = r || vn;
498
497
  }
499
498
  async setIdToken(e, n, r) {
500
499
  var i;
@@ -527,7 +526,7 @@ let ce = class gt {
527
526
  }
528
527
  async set(e) {
529
528
  var n;
530
- const r = new ce({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
529
+ const r = new ue({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
531
530
  await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
532
531
  }
533
532
  async clear(e) {
@@ -546,16 +545,16 @@ let ce = class gt {
546
545
  return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
547
546
  }
548
547
  getIdTokenCacheKey(e) {
549
- return new ce({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
548
+ return new ue({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
550
549
  }
551
550
  matchExistingCacheKey(e, n) {
552
551
  return n.filter((r) => {
553
552
  var i;
554
- const o = ce.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((m, u) => m && a.has(u), !0);
553
+ const o = ue.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((m, u) => m && a.has(u), !0);
555
554
  return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && f;
556
555
  })[0];
557
556
  }
558
- }, vr = class {
557
+ }, yr = class {
559
558
  constructor(e, n, r) {
560
559
  this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
561
560
  }
@@ -569,17 +568,17 @@ let ce = class gt {
569
568
  this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
570
569
  }
571
570
  };
572
- const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], wr = (t) => {
571
+ const Te = (t) => typeof t == "number", wr = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], br = (t) => {
573
572
  if (!t.id_token)
574
573
  throw new Error("ID token is required but missing");
575
574
  const e = ((o) => {
576
575
  const a = o.split("."), [s, f, m] = a;
577
576
  if (a.length !== 3 || !s || !f || !m)
578
577
  throw new Error("ID token could not be decoded");
579
- const u = JSON.parse(Ct(f)), c = { __raw: o }, d = {};
578
+ const u = JSON.parse(At(f)), c = { __raw: o }, d = {};
580
579
  return Object.keys(u).forEach((h) => {
581
- c[h] = u[h], yr.includes(h) || (d[h] = u[h]);
582
- }), { encoded: { header: s, payload: f, signature: m }, header: JSON.parse(Ct(s)), claims: c, user: d };
580
+ c[h] = u[h], wr.includes(h) || (d[h] = u[h]);
581
+ }), { encoded: { header: s, payload: f, signature: m }, header: JSON.parse(At(s)), claims: c, user: d };
583
582
  })(t.id_token);
584
583
  if (!e.claims.iss)
585
584
  throw new Error("Issuer (iss) claim must be a string present in the ID token");
@@ -608,21 +607,21 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
608
607
  if (e.claims.nonce !== t.nonce)
609
608
  throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
610
609
  }
611
- if (t.max_age && !Ee(e.claims.auth_time))
610
+ if (t.max_age && !Te(e.claims.auth_time))
612
611
  throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
613
- if (e.claims.exp == null || !Ee(e.claims.exp))
612
+ if (e.claims.exp == null || !Te(e.claims.exp))
614
613
  throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
615
- if (!Ee(e.claims.iat))
614
+ if (!Te(e.claims.iat))
616
615
  throw new Error("Issued At (iat) claim must be a number present in the ID token");
617
616
  const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
618
617
  if (i.setUTCSeconds(e.claims.exp + n), r > i)
619
618
  throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
620
- if (e.claims.nbf != null && Ee(e.claims.nbf)) {
619
+ if (e.claims.nbf != null && Te(e.claims.nbf)) {
621
620
  const o = /* @__PURE__ */ new Date(0);
622
621
  if (o.setUTCSeconds(e.claims.nbf - n), r < o)
623
622
  throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${o}`);
624
623
  }
625
- if (e.claims.auth_time != null && Ee(e.claims.auth_time)) {
624
+ if (e.claims.auth_time != null && Te(e.claims.auth_time)) {
626
625
  const o = /* @__PURE__ */ new Date(0);
627
626
  if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
628
627
  throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`);
@@ -645,8 +644,8 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
645
644
  }
646
645
  return e;
647
646
  };
648
- var ue = kt(function(t, e) {
649
- var n = ae && ae.__assign || function() {
647
+ var le = _t(function(t, e) {
648
+ var n = se && se.__assign || function() {
650
649
  return n = Object.assign || function(f) {
651
650
  for (var m, u = 1, c = arguments.length; u < c; u++)
652
651
  for (var d in m = arguments[u])
@@ -692,27 +691,27 @@ var ue = kt(function(t, e) {
692
691
  s(f, "", n(n({}, m), { expires: -1 }));
693
692
  };
694
693
  });
695
- bt(ue), ue.encode, ue.parse, ue.getAll;
696
- var br = ue.get, In = ue.set, Sn = ue.remove;
697
- const pe = { get(t) {
698
- const e = br(t);
694
+ St(le), le.encode, le.parse, le.getAll;
695
+ var kr = le.get, En = le.set, Pn = le.remove;
696
+ const ge = { get(t) {
697
+ const e = kr(t);
699
698
  if (e !== void 0)
700
699
  return JSON.parse(e);
701
700
  }, save(t, e, n) {
702
701
  let r = {};
703
- 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), In(t, JSON.stringify(e), 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), En(t, JSON.stringify(e), r);
704
703
  }, remove(t, e) {
705
704
  let n = {};
706
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Sn(t, n);
707
- } }, kr = { get(t) {
708
- return pe.get(t) || pe.get(`_legacy_${t}`);
705
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n);
706
+ } }, Ir = { get(t) {
707
+ return ge.get(t) || ge.get(`_legacy_${t}`);
709
708
  }, save(t, e, n) {
710
709
  let r = {};
711
- window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), In(`_legacy_${t}`, JSON.stringify(e), r), pe.save(t, e, n);
710
+ window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), En(`_legacy_${t}`, JSON.stringify(e), r), ge.save(t, e, n);
712
711
  }, remove(t, e) {
713
712
  let n = {};
714
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Sn(t, n), pe.remove(t, e), pe.remove(`_legacy_${t}`, e);
715
- } }, Ir = { get(t) {
713
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), Pn(t, n), ge.remove(t, e), ge.remove(`_legacy_${t}`, e);
714
+ } }, Sr = { get(t) {
716
715
  if (typeof sessionStorage > "u")
717
716
  return;
718
717
  const e = sessionStorage.getItem(t);
@@ -722,7 +721,7 @@ const pe = { get(t) {
722
721
  }, remove(t) {
723
722
  sessionStorage.removeItem(t);
724
723
  } };
725
- function Sr(t, e, n) {
724
+ function _r(t, e, n) {
726
725
  var r = e === void 0 ? null : e, i = function(f, m) {
727
726
  var u = atob(f);
728
727
  if (m) {
@@ -735,11 +734,11 @@ function Sr(t, e, n) {
735
734
  `, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
736
735
  return URL.createObjectURL(s);
737
736
  }
738
- var $t, zt, Nt, ot, _r = ($t = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", zt = null, Nt = !1, function(t) {
739
- return ot = ot || Sr($t, zt, Nt), new Worker(ot, t);
737
+ var Lt, Dt, Ut, at, Or = (Lt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Dt = null, Ut = !1, function(t) {
738
+ return at = at || _r(Lt, Dt, Ut), new Worker(at, t);
740
739
  });
741
- const at = {};
742
- let Or = class {
740
+ const st = {};
741
+ let Er = class {
743
742
  constructor(e, n) {
744
743
  this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
745
744
  }
@@ -765,57 +764,57 @@ let Or = class {
765
764
  return `@@auth0spajs@@::${e}`;
766
765
  }
767
766
  };
768
- const Pr = { memory: () => new kn().enclosedCache, localstorage: () => new mr() }, Dt = (t) => Pr[t], Lt = (t) => {
769
- const { openUrl: e, onRedirect: n } = t, r = q(t, ["openUrl", "onRedirect"]);
767
+ const Pr = { memory: () => new On().enclosedCache, localstorage: () => new gr() }, Zt = (t) => Pr[t], Rt = (t) => {
768
+ const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
770
769
  return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
771
- }, st = new ir();
772
- let Er = class {
770
+ }, ct = new or();
771
+ let xr = class {
773
772
  constructor(e) {
774
773
  let n, r;
775
- if (this.userCache = new kn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
776
- await st.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
774
+ if (this.userCache = new On().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
775
+ await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
777
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" && (() => {
778
- if (!Ve())
777
+ if (!Je())
779
778
  throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
780
- if (Ve().subtle === void 0)
779
+ if (Je().subtle === void 0)
781
780
  throw new Error(`
782
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.
783
782
  `);
784
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)
785
784
  r = e.cache;
786
785
  else {
787
- if (n = e.cacheLocation || "memory", !Dt(n))
786
+ if (n = e.cacheLocation || "memory", !Zt(n))
788
787
  throw new Error(`Invalid cache location "${n}"`);
789
- r = Dt(n)();
788
+ r = Zt(n)();
790
789
  }
791
- this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? pe : kr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
792
- const i = e.useCookiesForTransactions ? this.cookieStorage : Ir;
790
+ this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? ge : Ir, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
791
+ const i = e.useCookiesForTransactions ? this.cookieStorage : Sr;
793
792
  var o;
794
- this.scope = Ae("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new vr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || fn, this.cacheManager = new gr(r, r.allKeys ? void 0 : new Or(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 _r());
793
+ this.scope = Ze("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new yr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || vn, this.cacheManager = new vr(r, r.allKeys ? void 0 : new Er(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 Or());
795
794
  }
796
795
  _url(e) {
797
- const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || hn)));
796
+ const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || gn)));
798
797
  return `${this.domainUrl}${e}&auth0Client=${n}`;
799
798
  }
800
799
  _authorizeUrl(e) {
801
- return this._url(`/authorize?${mt(e)}`);
800
+ return this._url(`/authorize?${vt(e)}`);
802
801
  }
803
802
  async _verifyIdToken(e, n, r) {
804
803
  const i = await this.nowProvider();
805
- return wr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
804
+ return br({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
806
805
  var o;
807
806
  }
808
807
  _processOrgHint(e) {
809
808
  e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
810
809
  }
811
810
  async _prepareAuthorizeUrl(e, n, r) {
812
- const i = Tt(it()), o = Tt(it()), a = it(), s = ((u) => {
811
+ const i = Nt(ot()), o = Nt(ot()), a = ot(), s = ((u) => {
813
812
  const c = new Uint8Array(u);
814
813
  return ((d) => {
815
814
  const h = { "+": "-", "/": "_", "=": "" };
816
815
  return d.replace(/[+/=]/g, (v) => h[v]);
817
816
  })(window.btoa(String.fromCharCode(...Array.from(c))));
818
- })(await (async (u) => await Ve().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, d, h, v, w, y, k) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), d), { scope: Ae(c, d.scope), response_type: "code", response_mode: k || "query", state: h, nonce: v, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: w, 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), m = this._authorizeUrl(f);
817
+ })(await (async (u) => await Je().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, d, h, v, w, y, k) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), d), { scope: Ze(c, d.scope), response_type: "code", response_mode: k || "query", state: h, nonce: v, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: w, 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), m = this._authorizeUrl(f);
819
818
  return { nonce: o, code_verifier: a, scope: f.scope, audience: f.audience || "default", redirect_uri: f.redirect_uri, state: i, url: m };
820
819
  }
821
820
  async loginWithPopup(e, n) {
@@ -830,9 +829,9 @@ let Er = class {
830
829
  const o = await ((s) => new Promise((f, m) => {
831
830
  let u;
832
831
  const c = setInterval(() => {
833
- s.popup && s.popup.closed && (clearInterval(c), clearTimeout(d), window.removeEventListener("message", u, !1), m(new cr(s.popup)));
832
+ s.popup && s.popup.closed && (clearInterval(c), clearTimeout(d), window.removeEventListener("message", u, !1), m(new ur(s.popup)));
834
833
  }, 1e3), d = setTimeout(() => {
835
- clearInterval(c), m(new sr(s.popup)), window.removeEventListener("message", u, !1);
834
+ clearInterval(c), m(new cr(s.popup)), window.removeEventListener("message", u, !1);
836
835
  }, 1e3 * (s.timeoutInSeconds || 60));
837
836
  u = function(h) {
838
837
  if (h.data && h.data.type === "authorization_response") {
@@ -859,7 +858,7 @@ let Er = class {
859
858
  }
860
859
  async loginWithRedirect(e = {}) {
861
860
  var n;
862
- const r = Lt(e), { openUrl: i, fragment: o, appState: a } = r, s = q(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = q(m, ["url"]);
861
+ const r = Rt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = Q(m, ["url"]);
863
862
  this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), f && { organization: f }));
864
863
  const d = o ? `${u}#${o}` : u;
865
864
  i ? await i(d) : window.location.assign(d);
@@ -876,7 +875,7 @@ let Er = class {
876
875
  if (!s)
877
876
  throw new J("missing_transaction", "Invalid state");
878
877
  if (this.transactionManager.remove(), o)
879
- throw new ar(o, a || o, r, s.appState);
878
+ throw new sr(o, a || o, r, s.appState);
880
879
  if (!s.code_verifier || s.state && s.state !== r)
881
880
  throw new J("state_mismatch", "Invalid state");
882
881
  const f = s.organization, m = s.nonce, u = s.redirect_uri;
@@ -895,16 +894,16 @@ let Er = class {
895
894
  }
896
895
  async getTokenSilently(e = {}) {
897
896
  var n;
898
- const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ae(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
899
- let s = at[a];
897
+ const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
898
+ let s = st[a];
900
899
  return s || (s = o().finally(() => {
901
- delete at[a], s = null;
902
- }), at[a] = s), s;
900
+ delete st[a], s = null;
901
+ }), st[a] = s), s;
903
902
  })(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
904
903
  return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
905
904
  }
906
905
  async _getTokenSilently(e) {
907
- const { cacheMode: n } = e, r = q(e, ["cacheMode"]);
906
+ const { cacheMode: n } = e, r = Q(e, ["cacheMode"]);
908
907
  if (n !== "off") {
909
908
  const i = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
910
909
  if (i)
@@ -916,8 +915,8 @@ let Er = class {
916
915
  if (await i())
917
916
  return !0;
918
917
  return !1;
919
- })(() => st.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
920
- throw new pt();
918
+ })(() => ct.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
919
+ throw new gt();
921
920
  try {
922
921
  if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
923
922
  const m = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
@@ -927,25 +926,25 @@ let Er = class {
927
926
  const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: f } = i;
928
927
  return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: f });
929
928
  } finally {
930
- await st.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
929
+ await ct.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
931
930
  }
932
931
  }
933
932
  }
934
933
  async getTokenWithPopup(e = {}, n = {}) {
935
934
  var r;
936
- const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ae(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
937
- return n = Object.assign(Object.assign({}, or), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ce({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
935
+ const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ze(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
936
+ return n = Object.assign(Object.assign({}, ar), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ue({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
938
937
  }
939
938
  async isAuthenticated() {
940
939
  return !!await this.getUser();
941
940
  }
942
941
  _buildLogoutUrl(e) {
943
942
  e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
944
- const n = e.logoutParams || {}, { federated: r } = n, i = q(n, ["federated"]), o = r ? "&federated" : "";
945
- return this._url(`/v2/logout?${mt(Object.assign({ clientId: e.clientId }, i))}`) + o;
943
+ const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
944
+ return this._url(`/v2/logout?${vt(Object.assign({ clientId: e.clientId }, i))}`) + o;
946
945
  }
947
946
  async logout(e = {}) {
948
- const n = Lt(e), { openUrl: r } = n, i = q(n, ["openUrl"]);
947
+ const n = Rt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
949
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@@");
950
949
  const o = this._buildLogoutUrl(i);
951
950
  r ? await r(o) : r !== !1 && window.location.assign(o);
@@ -964,14 +963,14 @@ let Er = class {
964
963
  window.document.body.contains(I) && (window.document.body.removeChild(I), window.removeEventListener("message", b, !1));
965
964
  };
966
965
  let b;
967
- const D = setTimeout(() => {
968
- _(new pt()), g();
966
+ const A = setTimeout(() => {
967
+ _(new gt()), g();
969
968
  }, 1e3 * y);
970
969
  b = function(C) {
971
970
  if (C.origin != w || !C.data || C.data.type !== "authorization_response")
972
971
  return;
973
972
  const x = C.source;
974
- x && x.close(), C.data.response.error ? _(J.fromPayload(C.data.response)) : k(C.data.response), clearTimeout(D), window.removeEventListener("message", b, !1), setTimeout(g, 2e3);
973
+ x && x.close(), C.data.response.error ? _(J.fromPayload(C.data.response)) : k(C.data.response), clearTimeout(A), window.removeEventListener("message", b, !1), setTimeout(g, 2e3);
975
974
  }, window.addEventListener("message", b, !1), window.document.body.appendChild(I), I.setAttribute("src", v);
976
975
  }))(i, this.domainUrl, c);
977
976
  if (o !== d.state)
@@ -983,11 +982,11 @@ let Er = class {
983
982
  }
984
983
  }
985
984
  async _getTokenUsingRefreshToken(e) {
986
- const n = await this.cacheManager.get(new ce({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
985
+ const n = await this.cacheManager.get(new ue({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
987
986
  if (!(n && n.refresh_token || this.worker)) {
988
987
  if (this.options.useRefreshTokensFallback)
989
988
  return await this._getTokenFromIFrame(e);
990
- throw new wn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
989
+ throw new Sn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
991
990
  }
992
991
  const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
993
992
  try {
@@ -1000,196 +999,199 @@ let Er = class {
1000
999
  }
1001
1000
  }
1002
1001
  async _saveEntryInCache(e) {
1003
- const { id_token: n, decodedToken: r } = e, i = q(e, ["id_token", "decodedToken"]);
1002
+ const { id_token: n, decodedToken: r } = e, i = Q(e, ["id_token", "decodedToken"]);
1004
1003
  this.userCache.set("@@user@@", { id_token: n, decodedToken: r }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(i);
1005
1004
  }
1006
1005
  async _getIdTokenFromCache() {
1007
- const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new ce({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
1006
+ const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new ue({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
1008
1007
  return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
1009
1008
  }
1010
1009
  async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
1011
- const i = await this.cacheManager.get(new ce({ scope: e, audience: n, clientId: r }), 60);
1010
+ const i = await this.cacheManager.get(new ue({ scope: e, audience: n, clientId: r }), 60);
1012
1011
  if (i && i.access_token) {
1013
1012
  const { access_token: o, oauthTokenScope: a, expires_in: s } = i, f = await this._getIdTokenFromCache();
1014
1013
  return f && Object.assign(Object.assign({ id_token: f.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
1015
1014
  }
1016
1015
  }
1017
1016
  async _requestToken(e, n) {
1018
- const { nonceIn: r, organization: i } = n || {}, o = await pr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
1017
+ const { nonceIn: r, organization: i } = n || {}, o = await mr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
1019
1018
  return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
1020
1019
  }
1021
1020
  };
1022
- async function xr(t) {
1023
- const e = new Er(t);
1021
+ async function Tr(t) {
1022
+ const e = new xr(t);
1024
1023
  return await e.checkSession(), e;
1025
1024
  }
1026
- const jr = "sesamy.com", Tr = "https://logs.sesamy.com/events";
1027
- let Q;
1028
- async function Cr({ clientId: t }) {
1029
- if (Q = await xr({
1025
+ const jr = "sesamy.com", Cr = "https://logs.sesamy.com/events";
1026
+ var he = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t.AUTHENTICATED = "sesamyAuthenticated", t.LOGOUT = "sesamyLogout", t))(he || {});
1027
+ let B;
1028
+ async function $r({ clientId: t }) {
1029
+ if (B = await Tr({
1030
1030
  domain: `token.${jr}`,
1031
1031
  clientId: t,
1032
1032
  cacheLocation: "localstorage"
1033
1033
  }), window.location.search.includes("code="))
1034
1034
  try {
1035
- await Q.handleRedirectCallback(), window.history.replaceState({}, document.title, "/");
1035
+ await B.handleRedirectCallback();
1036
+ const e = await B.getUser();
1037
+ It(he.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
1036
1038
  } catch {
1037
1039
  }
1038
1040
  }
1039
- async function $r() {
1040
- if (!Q)
1041
+ async function zr() {
1042
+ if (!B)
1041
1043
  throw new Error("Auth0 client not initialized");
1042
- return Q.isAuthenticated();
1044
+ return B.isAuthenticated();
1043
1045
  }
1044
- async function zr() {
1045
- if (!Q)
1046
+ async function Nr() {
1047
+ if (!B)
1046
1048
  throw new Error("Auth0 client not initialized");
1047
- return Q.getUser();
1049
+ return B.getUser();
1048
1050
  }
1049
- function Nr() {
1050
- if (!Q)
1051
+ function Ar() {
1052
+ if (!B)
1051
1053
  throw new Error("Auth0 client not initialized");
1052
- return Q.loginWithRedirect({
1054
+ return B.loginWithRedirect({
1053
1055
  authorizationParams: {
1054
1056
  redirect_uri: window.location.href
1055
1057
  }
1056
1058
  });
1057
1059
  }
1058
- function Dr() {
1059
- if (!Q)
1060
+ async function Lr() {
1061
+ if (!B)
1060
1062
  throw new Error("Auth0 client not initialized");
1061
- return Q.logout({
1063
+ return It(he.LOGOUT, {}), B.logout({
1062
1064
  logoutParams: {
1063
1065
  returnTo: window.location.href
1064
1066
  }
1065
1067
  });
1066
1068
  }
1067
- function Lr(t = "sesamy") {
1069
+ function Dr(t = "sesamy") {
1068
1070
  window[t] = {
1069
- getUser: zr,
1070
- isAuthenticated: $r,
1071
- loginWithRedirect: Nr,
1072
- logout: Dr
1071
+ getUser: Nr,
1072
+ isAuthenticated: zr,
1073
+ loginWithRedirect: Ar,
1074
+ logout: Lr
1073
1075
  };
1074
1076
  }
1075
- function At(t, e, n, r, i) {
1077
+ function Wt(t, e, n, r, i) {
1076
1078
  for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
1077
1079
  t = t ? t[e[r]] : i;
1078
1080
  return t === i ? n : t;
1079
1081
  }
1080
- var Ue = "undefined", Ut = "object", Ar = function() {
1081
- }, _n = "any", On = "*", de = "__", He = typeof process < "u" ? process : {};
1082
- He.env && He.env.NODE_ENV;
1082
+ var Re = "undefined", Kt = "object", Ur = function() {
1083
+ }, xn = "any", Tn = "*", fe = "__", Ye = typeof process < "u" ? process : {};
1084
+ Ye.env && Ye.env.NODE_ENV;
1083
1085
  var H = typeof document < "u";
1084
- He.versions != null && He.versions.node != null;
1086
+ Ye.versions != null && Ye.versions.node != null;
1085
1087
  typeof Deno < "u" && Deno.core;
1086
1088
  H && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
1087
- function Pn(t, e) {
1089
+ function jn(t, e) {
1088
1090
  return e.charAt(0)[t]() + e.slice(1);
1089
1091
  }
1090
- var Ur = Pn.bind(null, "toUpperCase"), Zr = Pn.bind(null, "toLowerCase");
1091
- function Rr(t) {
1092
- return En(t) ? Ur("null") : typeof t == "object" ? Xr(t) : Object.prototype.toString.call(t).slice(8, -1);
1092
+ var Zr = jn.bind(null, "toUpperCase"), Rr = jn.bind(null, "toLowerCase");
1093
+ function Wr(t) {
1094
+ return Cn(t) ? Zr("null") : typeof t == "object" ? Vr(t) : Object.prototype.toString.call(t).slice(8, -1);
1093
1095
  }
1094
- function Ye(t, e) {
1096
+ function Ge(t, e) {
1095
1097
  e === void 0 && (e = !0);
1096
- var n = Rr(t);
1097
- return e ? Zr(n) : n;
1098
+ var n = Wr(t);
1099
+ return e ? Rr(n) : n;
1098
1100
  }
1099
1101
  function De(t, e) {
1100
1102
  return typeof e === t;
1101
1103
  }
1102
- var G = De.bind(null, "function"), re = De.bind(null, "string"), me = De.bind(null, "undefined"), Wr = De.bind(null, "boolean");
1104
+ var G = De.bind(null, "function"), re = De.bind(null, "string"), ve = De.bind(null, "undefined"), Kr = De.bind(null, "boolean");
1103
1105
  De.bind(null, "symbol");
1104
- function En(t) {
1106
+ function Cn(t) {
1105
1107
  return t === null;
1106
1108
  }
1107
- function Kr(t) {
1108
- return Ye(t) === "number" && !isNaN(t);
1109
+ function Mr(t) {
1110
+ return Ge(t) === "number" && !isNaN(t);
1109
1111
  }
1110
- function xn(t) {
1111
- return Ye(t) === "array";
1112
+ function $n(t) {
1113
+ return Ge(t) === "array";
1112
1114
  }
1113
1115
  function F(t) {
1114
- if (!Mr(t))
1116
+ if (!Xr(t))
1115
1117
  return !1;
1116
1118
  for (var e = t; Object.getPrototypeOf(e) !== null; )
1117
1119
  e = Object.getPrototypeOf(e);
1118
1120
  return Object.getPrototypeOf(t) === e;
1119
1121
  }
1120
- function Mr(t) {
1122
+ function Xr(t) {
1121
1123
  return t && (typeof t == "object" || t !== null);
1122
1124
  }
1123
- function Xr(t) {
1125
+ function Vr(t) {
1124
1126
  return G(t.constructor) ? t.constructor.name : null;
1125
1127
  }
1126
- function Vr(t) {
1127
- return t instanceof Error || re(t.message) && t.constructor && Kr(t.constructor.stackTraceLimit);
1128
+ function Fr(t) {
1129
+ return t instanceof Error || re(t.message) && t.constructor && Mr(t.constructor.stackTraceLimit);
1128
1130
  }
1129
- function jn(t, e) {
1130
- if (typeof e != "object" || En(e))
1131
+ function zn(t, e) {
1132
+ if (typeof e != "object" || Cn(e))
1131
1133
  return !1;
1132
1134
  if (e instanceof t)
1133
1135
  return !0;
1134
- var n = Ye(new t(""));
1135
- if (Vr(e))
1136
+ var n = Ge(new t(""));
1137
+ if (Fr(e))
1136
1138
  for (; e; ) {
1137
- if (Ye(e) === n)
1139
+ if (Ge(e) === n)
1138
1140
  return !0;
1139
1141
  e = Object.getPrototypeOf(e);
1140
1142
  }
1141
1143
  return !1;
1142
1144
  }
1143
- jn.bind(null, TypeError);
1144
- jn.bind(null, SyntaxError);
1145
- function qe(t, e) {
1145
+ zn.bind(null, TypeError);
1146
+ zn.bind(null, SyntaxError);
1147
+ function Qe(t, e) {
1146
1148
  var n = t instanceof Element || t instanceof HTMLDocument;
1147
- return n && e ? Fr(t, e) : n;
1149
+ return n && e ? Jr(t, e) : n;
1148
1150
  }
1149
- function Fr(t, e) {
1151
+ function Jr(t, e) {
1150
1152
  return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
1151
1153
  }
1152
- function Qe(t) {
1154
+ function et(t) {
1153
1155
  var e = [].slice.call(arguments, 1);
1154
1156
  return function() {
1155
1157
  return t.apply(void 0, [].slice.call(arguments).concat(e));
1156
1158
  };
1157
1159
  }
1158
- Qe(qe, "form");
1159
- Qe(qe, "button");
1160
- Qe(qe, "input");
1161
- Qe(qe, "select");
1162
- function Jr(t) {
1163
- return t ? xn(t) ? t : [t] : [];
1160
+ et(Qe, "form");
1161
+ et(Qe, "button");
1162
+ et(Qe, "input");
1163
+ et(Qe, "select");
1164
+ function Hr(t) {
1165
+ return t ? $n(t) ? t : [t] : [];
1164
1166
  }
1165
- function Zt(t) {
1167
+ function Mt(t) {
1166
1168
  try {
1167
1169
  return decodeURIComponent(t.replace(/\+/g, " "));
1168
1170
  } catch {
1169
1171
  return null;
1170
1172
  }
1171
1173
  }
1172
- function Hr() {
1174
+ function Yr() {
1173
1175
  if (H) {
1174
1176
  var t = navigator, e = t.languages;
1175
1177
  return t.userLanguage || (e && e.length ? e[0] : t.language);
1176
1178
  }
1177
1179
  }
1178
- function Yr() {
1180
+ function Gr() {
1179
1181
  try {
1180
1182
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
1181
1183
  } catch {
1182
1184
  }
1183
1185
  }
1184
- function Gr(t) {
1186
+ function Br(t) {
1185
1187
  return function(e) {
1186
1188
  for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
1187
- var o = Zt(n[1]), a = Zt(n[2]);
1189
+ var o = Mt(n[1]), a = Mt(n[2]);
1188
1190
  o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
1189
1191
  }
1190
1192
  for (var s in r) {
1191
1193
  var f = s.split("[");
1192
- f.length > 1 && (Br(r, f.map(function(m) {
1194
+ f.length > 1 && (qr(r, f.map(function(m) {
1193
1195
  return m.replace(/[?[\]\\ ]/g, "");
1194
1196
  }), r[s]), delete r[s]);
1195
1197
  }
@@ -1202,7 +1204,7 @@ function Gr(t) {
1202
1204
  return H && window.location.search.substring(1);
1203
1205
  }(t));
1204
1206
  }
1205
- function Br(t, e, n) {
1207
+ function qr(t, e, n) {
1206
1208
  for (var r = e.length - 1, i = 0; i < r; ++i) {
1207
1209
  var o = e[i];
1208
1210
  if (o === "__proto__" || o === "constructor")
@@ -1211,27 +1213,27 @@ function Br(t, e, n) {
1211
1213
  }
1212
1214
  t[e[r]] = n;
1213
1215
  }
1214
- function et() {
1216
+ function tt() {
1215
1217
  for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
1216
1218
  var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
1217
1219
  t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
1218
1220
  }
1219
1221
  return t;
1220
1222
  }
1221
- var Te = "global", be = de + "global" + de, ke = typeof self === Ut && self.self === self && self || typeof global === Ut && global.global === global && global || void 0;
1222
- function he(t) {
1223
- return ke[be][t];
1223
+ var $e = "global", Ie = fe + "global" + fe, Se = typeof self === Kt && self.self === self && self || typeof global === Kt && global.global === global && global || void 0;
1224
+ function pe(t) {
1225
+ return Se[Ie][t];
1224
1226
  }
1225
- function fe(t, e) {
1226
- return ke[be][t] = e;
1227
+ function me(t, e) {
1228
+ return Se[Ie][t] = e;
1227
1229
  }
1228
- function Se(t) {
1229
- delete ke[be][t];
1230
+ function Oe(t) {
1231
+ delete Se[Ie][t];
1230
1232
  }
1231
- function _e(t, e, n) {
1233
+ function Ee(t, e, n) {
1232
1234
  var r;
1233
1235
  try {
1234
- if (It(t)) {
1236
+ if (Ot(t)) {
1235
1237
  var i = window[t];
1236
1238
  r = i[e].bind(i);
1237
1239
  }
@@ -1239,41 +1241,41 @@ function _e(t, e, n) {
1239
1241
  }
1240
1242
  return r || n;
1241
1243
  }
1242
- ke[be] || (ke[be] = {});
1243
- var Ze = {};
1244
- function It(t) {
1245
- if (typeof Ze[t] !== Ue)
1246
- return Ze[t];
1244
+ Se[Ie] || (Se[Ie] = {});
1245
+ var We = {};
1246
+ function Ot(t) {
1247
+ if (typeof We[t] !== Re)
1248
+ return We[t];
1247
1249
  try {
1248
1250
  var e = window[t];
1249
- e.setItem(Ue, Ue), e.removeItem(Ue);
1251
+ e.setItem(Re, Re), e.removeItem(Re);
1250
1252
  } catch {
1251
- return Ze[t] = !1;
1253
+ return We[t] = !1;
1252
1254
  }
1253
- return Ze[t] = !0;
1255
+ return We[t] = !0;
1254
1256
  }
1255
- function P() {
1256
- return P = Object.assign || function(t) {
1257
+ function E() {
1258
+ return E = Object.assign || function(t) {
1257
1259
  for (var e = 1; e < arguments.length; e++) {
1258
1260
  var n = arguments[e];
1259
1261
  for (var r in n)
1260
1262
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
1261
1263
  }
1262
1264
  return t;
1263
- }, P.apply(this, arguments);
1265
+ }, E.apply(this, arguments);
1264
1266
  }
1265
- var ne = "function", ee = "undefined", qr = "@@redux/" + Math.random().toString(36), Rt = /* @__PURE__ */ function() {
1267
+ var ne = "function", ee = "undefined", Qr = "@@redux/" + Math.random().toString(36), Xt = /* @__PURE__ */ function() {
1266
1268
  return typeof Symbol === ne && Symbol.observable || "@@observable";
1267
- }(), Re = " != " + ne;
1268
- function Tn(t, e, n) {
1269
+ }(), Ke = " != " + ne;
1270
+ function Nn(t, e, n) {
1269
1271
  var r;
1270
1272
  if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
1271
1273
  if (typeof n !== ne)
1272
- throw new Error("enhancer" + Re);
1273
- return n(Tn)(t, e);
1274
+ throw new Error("enhancer" + Ke);
1275
+ return n(Nn)(t, e);
1274
1276
  }
1275
1277
  if (typeof t !== ne)
1276
- throw new Error("reducer" + Re);
1278
+ throw new Error("reducer" + Ke);
1277
1279
  var i = t, o = e, a = [], s = a, f = !1;
1278
1280
  function m() {
1279
1281
  s === a && (s = a.slice());
@@ -1283,7 +1285,7 @@ function Tn(t, e, n) {
1283
1285
  }
1284
1286
  function c(h) {
1285
1287
  if (typeof h !== ne)
1286
- throw new Error("Listener" + Re);
1288
+ throw new Error("Listener" + Ke);
1287
1289
  var v = !0;
1288
1290
  return m(), s.push(h), function() {
1289
1291
  if (v) {
@@ -1311,9 +1313,9 @@ function Tn(t, e, n) {
1311
1313
  }
1312
1314
  return d({ type: "@@redux/INIT" }), (r = { dispatch: d, subscribe: c, getState: u, replaceReducer: function(h) {
1313
1315
  if (typeof h !== ne)
1314
- throw new Error("next reducer" + Re);
1316
+ throw new Error("next reducer" + Ke);
1315
1317
  i = h, d({ type: "@@redux/INIT" });
1316
- } })[Rt] = function() {
1318
+ } })[Xt] = function() {
1317
1319
  var h, v = c;
1318
1320
  return (h = { subscribe: function(w) {
1319
1321
  if (typeof w != "object")
@@ -1322,16 +1324,16 @@ function Tn(t, e, n) {
1322
1324
  w.next && w.next(u());
1323
1325
  }
1324
1326
  return y(), { unsubscribe: v(y) };
1325
- } })[Rt] = function() {
1327
+ } })[Xt] = function() {
1326
1328
  return this;
1327
1329
  }, h;
1328
1330
  }, r;
1329
1331
  }
1330
- function Qr(t, e) {
1332
+ function ei(t, e) {
1331
1333
  var n = e && e.type;
1332
1334
  return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
1333
1335
  }
1334
- function Ie() {
1336
+ function _e() {
1335
1337
  var t = [].slice.call(arguments);
1336
1338
  return t.length === 0 ? function(e) {
1337
1339
  return e;
@@ -1341,7 +1343,7 @@ function Ie() {
1341
1343
  };
1342
1344
  });
1343
1345
  }
1344
- function ei() {
1346
+ function ti() {
1345
1347
  var t = arguments;
1346
1348
  return function(e) {
1347
1349
  return function(n, r, i) {
@@ -1350,35 +1352,35 @@ function ei() {
1350
1352
  } };
1351
1353
  return o = [].slice.call(t).map(function(m) {
1352
1354
  return m(f);
1353
- }), P({}, a, { dispatch: s = Ie.apply(void 0, o)(a.dispatch) });
1355
+ }), E({}, a, { dispatch: s = _e.apply(void 0, o)(a.dispatch) });
1354
1356
  };
1355
1357
  };
1356
1358
  }
1357
- var ie = de + "anon_id", le = de + "user_id", ve = de + "user_traits", te = "userId", ge = "anonymousId", Fe = ["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"], vt = ["name", "EVENTS", "config", "loaded"], O = Fe.reduce(function(t, e) {
1359
+ var ie = fe + "anon_id", de = fe + "user_id", we = fe + "user_traits", te = "userId", ye = "anonymousId", He = ["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"], wt = ["name", "EVENTS", "config", "loaded"], O = He.reduce(function(t, e) {
1358
1360
  return t[e] = e, t;
1359
1361
  }, { registerPluginType: function(t) {
1360
1362
  return "registerPlugin:" + t;
1361
1363
  }, pluginReadyType: function(t) {
1362
1364
  return "ready:" + t;
1363
- } }), Wt = /^utm_/, Kt = /^an_prop_/, Mt = /^an_trait_/;
1364
- function ti(t) {
1365
+ } }), Vt = /^utm_/, Ft = /^an_prop_/, Jt = /^an_trait_/;
1366
+ function ni(t) {
1365
1367
  var e = t.storage.setItem;
1366
1368
  return function(n) {
1367
1369
  return function(r) {
1368
1370
  return function(i) {
1369
1371
  if (i.type === O.bootstrap) {
1370
1372
  var o = i.params, a = i.user, s = i.persistedUser, f = i.initialUser, m = s.userId === a.userId;
1371
- s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(le, a.userId), f.traits && e(ve, P({}, m && s.traits ? s.traits : {}, f.traits));
1373
+ s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(de, a.userId), f.traits && e(we, E({}, m && s.traits ? s.traits : {}, f.traits));
1372
1374
  var u = Object.keys(i.params);
1373
1375
  if (u.length) {
1374
1376
  var c = o.an_uid, d = o.an_event, h = u.reduce(function(v, w) {
1375
- if (w.match(Wt) || w.match(/^(d|g)clid/)) {
1376
- var y = w.replace(Wt, "");
1377
+ if (w.match(Vt) || w.match(/^(d|g)clid/)) {
1378
+ var y = w.replace(Vt, "");
1377
1379
  v.campaign[y === "campaign" ? "name" : y] = o[w];
1378
1380
  }
1379
- return w.match(Kt) && (v.props[w.replace(Kt, "")] = o[w]), w.match(Mt) && (v.traits[w.replace(Mt, "")] = o[w]), v;
1381
+ return w.match(Ft) && (v.props[w.replace(Ft, "")] = o[w]), w.match(Jt) && (v.traits[w.replace(Jt, "")] = o[w]), v;
1380
1382
  }, { campaign: {}, props: {}, traits: {} });
1381
- n.dispatch(P({ type: O.params, raw: o }, h, c ? { userId: c } : {})), c && setTimeout(function() {
1383
+ n.dispatch(E({ type: O.params, raw: o }, h, c ? { userId: c } : {})), c && setTimeout(function() {
1382
1384
  return t.identify(c, h.traits);
1383
1385
  }, 0), d && setTimeout(function() {
1384
1386
  return t.track(d, h.props);
@@ -1390,19 +1392,19 @@ function ti(t) {
1390
1392
  };
1391
1393
  };
1392
1394
  }
1393
- function ni(t) {
1395
+ function ri(t) {
1394
1396
  return function(e, n) {
1395
1397
  if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === O.setItemEnd) {
1396
1398
  if (n.key === ie)
1397
- return P({}, e, { anonymousId: n.value });
1398
- if (n.key === le)
1399
- return P({}, e, { userId: n.value });
1399
+ return E({}, e, { anonymousId: n.value });
1400
+ if (n.key === de)
1401
+ return E({}, e, { userId: n.value });
1400
1402
  }
1401
1403
  switch (n.type) {
1402
1404
  case O.identify:
1403
- return Object.assign({}, e, { userId: n.userId, traits: P({}, e.traits, n.traits) });
1405
+ return Object.assign({}, e, { userId: n.userId, traits: E({}, e.traits, n.traits) });
1404
1406
  case O.reset:
1405
- return [le, ie, ve].forEach(function(r) {
1407
+ return [de, ie, we].forEach(function(r) {
1406
1408
  t.removeItem(r);
1407
1409
  }), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
1408
1410
  default:
@@ -1410,46 +1412,46 @@ function ni(t) {
1410
1412
  }
1411
1413
  };
1412
1414
  }
1413
- function Xt(t) {
1414
- return { userId: t.getItem(le), anonymousId: t.getItem(ie), traits: t.getItem(ve) };
1415
+ function Ht(t) {
1416
+ return { userId: t.getItem(de), anonymousId: t.getItem(ie), traits: t.getItem(we) };
1415
1417
  }
1416
- var yt = function(t) {
1417
- return de + "TEMP" + de + t;
1418
+ var bt = function(t) {
1419
+ return fe + "TEMP" + fe + t;
1418
1420
  };
1419
- function ri(t) {
1421
+ function ii(t) {
1420
1422
  var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
1421
1423
  return function(o) {
1422
1424
  return function(a) {
1423
1425
  return function(s) {
1424
1426
  var f = s.userId, m = s.traits, u = s.options;
1425
- if (s.type === O.reset && ([le, ve, ie].forEach(function(h) {
1427
+ if (s.type === O.reset && ([de, we, ie].forEach(function(h) {
1426
1428
  r(h);
1427
- }), [te, ge, "traits"].forEach(function(h) {
1428
- Se(yt(h));
1429
+ }), [te, ye, "traits"].forEach(function(h) {
1430
+ Oe(bt(h));
1429
1431
  })), s.type === O.identify) {
1430
- i(ie) || n(ie, et());
1431
- var c = i(le), d = i(ve) || {};
1432
- c && c !== f && o.dispatch({ type: O.userIdChanged, old: { userId: c, traits: d }, new: { userId: f, traits: m }, options: u }), f && n(le, f), m && n(ve, P({}, d, m));
1432
+ i(ie) || n(ie, tt());
1433
+ var c = i(de), d = i(we) || {};
1434
+ c && c !== f && o.dispatch({ type: O.userIdChanged, old: { userId: c, traits: d }, new: { userId: f, traits: m }, options: u }), f && n(de, f), m && n(we, E({}, d, m));
1433
1435
  }
1434
1436
  return a(s);
1435
1437
  };
1436
1438
  };
1437
1439
  };
1438
1440
  }
1439
- var je = {};
1440
- function Vt(t, e) {
1441
- je[t] && G(je[t]) && (je[t](e), delete je[t]);
1441
+ var Ce = {};
1442
+ function Yt(t, e) {
1443
+ Ce[t] && G(Ce[t]) && (Ce[t](e), delete Ce[t]);
1442
1444
  }
1443
- function Cn(t, e, n) {
1445
+ function An(t, e, n) {
1444
1446
  return new Promise(function(r, i) {
1445
- return e() ? r(t) : n < 1 ? i(P({}, t, { queue: !0 })) : new Promise(function(o) {
1447
+ return e() ? r(t) : n < 1 ? i(E({}, t, { queue: !0 })) : new Promise(function(o) {
1446
1448
  return setTimeout(o, 10);
1447
1449
  }).then(function(o) {
1448
- return Cn(t, e, n - 10).then(r, i);
1450
+ return An(t, e, n - 10).then(r, i);
1449
1451
  });
1450
1452
  });
1451
1453
  }
1452
- function $n(t, e, n) {
1454
+ function Ln(t, e, n) {
1453
1455
  var r = e(), i = t.getState(), o = i.plugins, a = i.queue, s = i.user;
1454
1456
  if (!i.context.offline && a && a.actions && a.actions.length) {
1455
1457
  var f = a.actions.reduce(function(u, c, d) {
@@ -1460,13 +1462,13 @@ function $n(t, e, n) {
1460
1462
  var c = a.actions[u], d = c.plugin, h = c.payload.type, v = r[d][h];
1461
1463
  if (v && G(v)) {
1462
1464
  var w = function(k, _) {
1463
- return k === void 0 && (k = {}), _ === void 0 && (_ = {}), [te, ge].reduce(function(I, g) {
1465
+ return k === void 0 && (k = {}), _ === void 0 && (_ = {}), [te, ye].reduce(function(I, g) {
1464
1466
  return k.hasOwnProperty(g) && _[g] && _[g] !== k[g] && (I[g] = _[g]), I;
1465
1467
  }, k);
1466
1468
  }(c.payload, s);
1467
1469
  v({ payload: w, config: o[d].config, instance: n });
1468
1470
  var y = h + ":" + d;
1469
- t.dispatch(P({}, w, { type: y, _: { called: y, from: "queueDrain" } }));
1471
+ t.dispatch(E({}, w, { type: y, _: { called: y, from: "queueDrain" } }));
1470
1472
  }
1471
1473
  });
1472
1474
  var m = a.actions.filter(function(u, c) {
@@ -1476,10 +1478,10 @@ function $n(t, e, n) {
1476
1478
  }
1477
1479
  }
1478
1480
  }
1479
- var ct = function(t) {
1481
+ var ut = function(t) {
1480
1482
  var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, f = t.EVENTS;
1481
1483
  try {
1482
- var m = i.plugins, u = i.context, c = n.type, d = c.match(ye), h = e.exact.map(function(y) {
1484
+ var m = i.plugins, u = i.context, c = n.type, d = c.match(be), h = e.exact.map(function(y) {
1483
1485
  return y.pluginName;
1484
1486
  });
1485
1487
  d && (h = a.during.map(function(y) {
@@ -1487,21 +1489,21 @@ var ct = function(t) {
1487
1489
  }));
1488
1490
  var v = /* @__PURE__ */ function(y, k) {
1489
1491
  return function(_, I, g) {
1490
- var b = I.config, D = I.name, C = D + "." + _.type;
1492
+ var b = I.config, A = I.name, C = A + "." + _.type;
1491
1493
  g && (C = g.event);
1492
- var x = _.type.match(ye) ? /* @__PURE__ */ function(A, L, X, U, V) {
1493
- return function(R, E) {
1494
- var K = U ? U.name : A, M = E && Ne(E) ? E : X;
1495
- if (U && (!(M = E && Ne(E) ? E : [A]).includes(A) || M.length !== 1))
1496
- throw new Error("Method " + L + " can only abort " + A + " plugin. " + JSON.stringify(M) + " input valid");
1497
- return P({}, V, { abort: { reason: R, plugins: M, caller: L, _: K } });
1494
+ var x = _.type.match(be) ? /* @__PURE__ */ function(D, L, X, U, V) {
1495
+ return function(R, P) {
1496
+ var K = U ? U.name : D, M = P && Le(P) ? P : X;
1497
+ if (U && (!(M = P && Le(P) ? P : [D]).includes(D) || M.length !== 1))
1498
+ throw new Error("Method " + L + " can only abort " + D + " plugin. " + JSON.stringify(M) + " input valid");
1499
+ return E({}, V, { abort: { reason: R, plugins: M, caller: L, _: K } });
1498
1500
  };
1499
- }(D, C, k, g, _) : /* @__PURE__ */ function(A, L) {
1501
+ }(A, C, k, g, _) : /* @__PURE__ */ function(D, L) {
1500
1502
  return function() {
1501
- throw new Error(A.type + " action not cancellable. Remove abort in " + L);
1503
+ throw new Error(D.type + " action not cancellable. Remove abort in " + L);
1502
1504
  };
1503
1505
  }(_, C);
1504
- return { payload: ii(_), instance: y, config: b || {}, abort: x };
1506
+ return { payload: oi(_), instance: y, config: b || {}, abort: x };
1505
1507
  };
1506
1508
  }(r, h), w = e.exact.reduce(function(y, k) {
1507
1509
  var _ = k.pluginName, I = k.methodName, g = !1;
@@ -1514,23 +1516,23 @@ var ct = function(t) {
1514
1516
  function b() {
1515
1517
  return Promise.resolve(g);
1516
1518
  }
1517
- var D = function() {
1519
+ var A = function() {
1518
1520
  if (e.namespaced && e.namespaced[I])
1519
- return Promise.resolve(e.namespaced[I].reduce(function(C, x, A) {
1521
+ return Promise.resolve(e.namespaced[I].reduce(function(C, x, D) {
1520
1522
  try {
1521
1523
  return Promise.resolve(C).then(function(L) {
1522
- return x.method && G(x.method) ? (function(R, E) {
1523
- var K = qt(R);
1524
- if (K && K.name === E) {
1525
- var M = qt(K.method);
1526
- throw new Error([E + " plugin is calling method " + R, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + E + " plugin insteadof " + R].join(`
1524
+ return x.method && G(x.method) ? (function(R, P) {
1525
+ var K = nn(R);
1526
+ if (K && K.name === P) {
1527
+ var M = nn(K.method);
1528
+ throw new Error([P + " plugin is calling method " + R, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + P + " plugin insteadof " + R].join(`
1527
1529
  `));
1528
1530
  }
1529
- }(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (X = L, U = I, V = x.pluginName, function(R, E) {
1530
- return P({}, X, { abort: { reason: R, plugins: E || [U], caller: c, from: V || U } });
1531
- }), config: Ht(x.pluginName, m, o), plugins: m })).then(function(R) {
1532
- var E = F(R) ? R : {};
1533
- return Promise.resolve(P({}, L, E));
1531
+ }(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: L, instance: r, abort: (X = L, U = I, V = x.pluginName, function(R, P) {
1532
+ return E({}, X, { abort: { reason: R, plugins: P || [U], caller: c, from: V || U } });
1533
+ }), config: qt(x.pluginName, m, o), plugins: m })).then(function(R) {
1534
+ var P = F(R) ? R : {};
1535
+ return Promise.resolve(E({}, L, P));
1534
1536
  })) : L;
1535
1537
  var X, U, V;
1536
1538
  });
@@ -1542,7 +1544,7 @@ var ct = function(t) {
1542
1544
  });
1543
1545
  g[I] = n;
1544
1546
  }();
1545
- return D && D.then ? D.then(b) : b();
1547
+ return A && A.then ? A.then(b) : b();
1546
1548
  });
1547
1549
  } catch (g) {
1548
1550
  return Promise.reject(g);
@@ -1550,23 +1552,23 @@ var ct = function(t) {
1550
1552
  }, Promise.resolve({}))).then(function(y) {
1551
1553
  return Promise.resolve(e.exact.reduce(function(k, _, I) {
1552
1554
  try {
1553
- var g = e.exact.length === I + 1, b = _.pluginName, D = o[b];
1555
+ var g = e.exact.length === I + 1, b = _.pluginName, A = o[b];
1554
1556
  return Promise.resolve(k).then(function(C) {
1555
1557
  var x = y[b] ? y[b] : {};
1556
- if (d && (x = C), lt(x, b))
1557
- return ut({ data: x, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(C);
1558
- if (lt(C, b))
1559
- return g && ut({ data: C, method: c, instance: r, store: s }), Promise.resolve(C);
1558
+ if (d && (x = C), dt(x, b))
1559
+ return lt({ data: x, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(C);
1560
+ if (dt(C, b))
1561
+ return g && lt({ data: C, method: c, instance: r, store: s }), Promise.resolve(C);
1560
1562
  if (w.hasOwnProperty(b) && w[b] === !0)
1561
1563
  return s.dispatch({ type: "queue", plugin: b, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(C);
1562
- var A = v(y[b], o[b]);
1563
- return Promise.resolve(D[c]({ abort: A.abort, payload: x, instance: r, config: Ht(b, m, o), plugins: m })).then(function(L) {
1564
- var X = F(L) ? L : {}, U = P({}, C, X), V = y[b];
1565
- if (lt(V, b))
1566
- ut({ data: V, method: c, instance: r, pluginName: b, store: s });
1564
+ var D = v(y[b], o[b]);
1565
+ return Promise.resolve(A[c]({ abort: D.abort, payload: x, instance: r, config: qt(b, m, o), plugins: m })).then(function(L) {
1566
+ var X = F(L) ? L : {}, U = E({}, C, X), V = y[b];
1567
+ if (dt(V, b))
1568
+ lt({ data: V, method: c, instance: r, pluginName: b, store: s });
1567
1569
  else {
1568
1570
  var R = c + ":" + b;
1569
- (R.match(/:/g) || []).length < 2 && !c.match(Ft) && !c.match(Jt) && r.dispatch(P({}, d ? U : x, { type: R, _: { called: R, from: "submethod" } }));
1571
+ (R.match(/:/g) || []).length < 2 && !c.match(Gt) && !c.match(Bt) && r.dispatch(E({}, d ? U : x, { type: R, _: { called: R, from: "submethod" } }));
1570
1572
  }
1571
1573
  return Promise.resolve(U);
1572
1574
  });
@@ -1575,11 +1577,11 @@ var ct = function(t) {
1575
1577
  return Promise.reject(C);
1576
1578
  }
1577
1579
  }, Promise.resolve(n))).then(function(k) {
1578
- if (!(c.match(ye) || c.match(/^registerPlugin/) || c.match(Jt) || c.match(Ft) || c.match(/^params/) || c.match(/^userIdChanged/))) {
1580
+ if (!(c.match(be) || c.match(/^registerPlugin/) || c.match(Bt) || c.match(Gt) || c.match(/^params/) || c.match(/^userIdChanged/))) {
1579
1581
  if (f.plugins.includes(c), k._ && k._.originalAction === c)
1580
1582
  return k;
1581
- var _ = P({}, k, { _: { originalAction: k.type, called: k.type, from: "engineEnd" } });
1582
- zn(k, e.exact.length) && !c.match(/End$/) && (_ = P({}, _, { type: k.type + "Aborted" })), s.dispatch(_);
1583
+ var _ = E({}, k, { _: { originalAction: k.type, called: k.type, from: "engineEnd" } });
1584
+ Dn(k, e.exact.length) && !c.match(/End$/) && (_ = E({}, _, { type: k.type + "Aborted" })), s.dispatch(_);
1583
1585
  }
1584
1586
  return k;
1585
1587
  });
@@ -1587,53 +1589,53 @@ var ct = function(t) {
1587
1589
  } catch (y) {
1588
1590
  return Promise.reject(y);
1589
1591
  }
1590
- }, ye = /Start$/, Ft = /^bootstrap/, Jt = /^ready/;
1591
- function ut(t) {
1592
+ }, be = /Start$/, Gt = /^bootstrap/, Bt = /^ready/;
1593
+ function lt(t) {
1592
1594
  var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
1593
- t.store.dispatch(P({}, t.data, { type: n, _: { called: n, from: "abort" } }));
1595
+ t.store.dispatch(E({}, t.data, { type: n, _: { called: n, from: "abort" } }));
1594
1596
  }
1595
- function Ht(t, e, n) {
1597
+ function qt(t, e, n) {
1596
1598
  var r = e[t] || n[t];
1597
1599
  return r && r.config ? r.config : {};
1598
1600
  }
1599
- function Yt(t, e) {
1601
+ function Qt(t, e) {
1600
1602
  return e.reduce(function(n, r) {
1601
1603
  return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
1602
1604
  }, []);
1603
1605
  }
1604
- function Gt(t, e) {
1605
- var n = t.replace(ye, ""), r = e ? ":" + e : "";
1606
+ function en(t, e) {
1607
+ var n = t.replace(be, ""), r = e ? ":" + e : "";
1606
1608
  return ["" + t + r, "" + n + r, n + "End" + r];
1607
1609
  }
1608
- function lt(t, e) {
1610
+ function dt(t, e) {
1609
1611
  var n = t.abort;
1610
- return !!n && (n === !0 || Bt(n, e) || n && Bt(n.plugins, e));
1612
+ return !!n && (n === !0 || tn(n, e) || n && tn(n.plugins, e));
1611
1613
  }
1612
- function zn(t, e) {
1614
+ function Dn(t, e) {
1613
1615
  var n = t.abort;
1614
1616
  if (!n)
1615
1617
  return !1;
1616
1618
  if (n === !0 || re(n))
1617
1619
  return !0;
1618
1620
  var r = n.plugins;
1619
- return Ne(n) && n.length === e || Ne(r) && r.length === e;
1621
+ return Le(n) && n.length === e || Le(r) && r.length === e;
1620
1622
  }
1621
- function Ne(t) {
1623
+ function Le(t) {
1622
1624
  return Array.isArray(t);
1623
1625
  }
1624
- function Bt(t, e) {
1625
- return !(!t || !Ne(t)) && t.includes(e);
1626
+ function tn(t, e) {
1627
+ return !(!t || !Le(t)) && t.includes(e);
1626
1628
  }
1627
- function qt(t) {
1629
+ function nn(t) {
1628
1630
  var e = t.match(/(.*):(.*)/);
1629
1631
  return !!e && { method: e[1], name: e[2] };
1630
1632
  }
1631
- function ii(t) {
1633
+ function oi(t) {
1632
1634
  return Object.keys(t).reduce(function(e, n) {
1633
1635
  return n === "type" || (e[n] = F(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
1634
1636
  }, {});
1635
1637
  }
1636
- function oi(t, e, n) {
1638
+ function ai(t, e, n) {
1637
1639
  var r = {};
1638
1640
  return function(i) {
1639
1641
  return function(o) {
@@ -1645,20 +1647,20 @@ function oi(t, e, n) {
1645
1647
  if (a.abort)
1646
1648
  return Promise.resolve(o(a));
1647
1649
  if (m === O.enablePlugin && i.dispatch({ type: O.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), m === O.disablePlugin && setTimeout(function() {
1648
- return Vt(a.meta.rid, { payload: a });
1650
+ return Yt(a.meta.rid, { payload: a });
1649
1651
  }, 0), m === O.initializeEnd) {
1650
1652
  var d = e(), h = Object.keys(d), v = h.filter(function(g) {
1651
1653
  return u.includes(g);
1652
1654
  }).map(function(g) {
1653
1655
  return d[g];
1654
1656
  }), w = [], y = [], k = a.disabled, _ = v.map(function(g) {
1655
- var b = g.loaded, D = g.name, C = g.config;
1656
- return Cn(g, function() {
1657
+ var b = g.loaded, A = g.name, C = g.config;
1658
+ return An(g, function() {
1657
1659
  return b({ config: C });
1658
1660
  }, 1e4).then(function(x) {
1659
- return r[D] || (i.dispatch({ type: O.pluginReadyType(D), name: D, events: Object.keys(g).filter(function(A) {
1660
- return !vt.includes(A);
1661
- }) }), r[D] = !0), w = w.concat(D), g;
1661
+ return r[A] || (i.dispatch({ type: O.pluginReadyType(A), name: A, events: Object.keys(g).filter(function(D) {
1662
+ return !wt.includes(D);
1663
+ }) }), r[A] = !0), w = w.concat(A), g;
1662
1664
  }).catch(function(x) {
1663
1665
  if (x instanceof Error)
1664
1666
  throw new Error(x);
@@ -1668,22 +1670,22 @@ function oi(t, e, n) {
1668
1670
  Promise.all(_).then(function(g) {
1669
1671
  var b = { plugins: w, failed: y, disabled: k };
1670
1672
  setTimeout(function() {
1671
- h.length === _.length + k.length && i.dispatch(P({}, { type: O.ready }, b));
1673
+ h.length === _.length + k.length && i.dispatch(E({}, { type: O.ready }, b));
1672
1674
  }, 0);
1673
1675
  });
1674
1676
  }
1675
1677
  var I = function() {
1676
1678
  if (m !== O.bootstrap)
1677
1679
  return /^ready:([^:]*)$/.test(m) && setTimeout(function() {
1678
- return $n(i, e, t);
1679
- }, 0), Promise.resolve(function(g, b, D, C, x) {
1680
+ return Ln(i, e, t);
1681
+ }, 0), Promise.resolve(function(g, b, A, C, x) {
1680
1682
  try {
1681
- var A = G(b) ? b() : b, L = g.type, X = L.replace(ye, "");
1683
+ var D = G(b) ? b() : b, L = g.type, X = L.replace(be, "");
1682
1684
  if (g._ && g._.called)
1683
1685
  return Promise.resolve(g);
1684
- var U = D.getState(), V = (K = A, (M = U.plugins) === void 0 && (M = {}), (Oe = g.options) === void 0 && (Oe = {}), Object.keys(K).filter(function(l) {
1685
- var p = Oe.plugins || {};
1686
- return Wr(p[l]) ? p[l] : p.all !== !1 && (!M[l] || M[l].enabled !== !1);
1686
+ var U = A.getState(), V = (K = D, (M = U.plugins) === void 0 && (M = {}), (Pe = g.options) === void 0 && (Pe = {}), Object.keys(K).filter(function(l) {
1687
+ var p = Pe.plugins || {};
1688
+ return Kr(p[l]) ? p[l] : p.all !== !1 && (!M[l] || M[l].enabled !== !1);
1687
1689
  }).map(function(l) {
1688
1690
  return K[l];
1689
1691
  }));
@@ -1691,48 +1693,48 @@ function oi(t, e, n) {
1691
1693
  var p = U.plugins[l];
1692
1694
  return g.plugins.includes(l) && !p.initialized;
1693
1695
  }).map(function(l) {
1694
- return A[l];
1696
+ return D[l];
1695
1697
  }));
1696
1698
  var R = V.map(function(l) {
1697
1699
  return l.name;
1698
- }), E = function(l, p, S) {
1699
- var j = Gt(l).map(function(T) {
1700
- return Yt(T, p);
1700
+ }), P = function(l, p, S) {
1701
+ var T = en(l).map(function(j) {
1702
+ return Qt(j, p);
1701
1703
  });
1702
- return p.reduce(function(T, $) {
1703
- var W = $.name, N = Gt(l, W).map(function(Pe) {
1704
- return Yt(Pe, p);
1705
- }), Z = N[0], z = N[1], B = N[2];
1706
- return Z.length && (T.beforeNS[W] = Z), z.length && (T.duringNS[W] = z), B.length && (T.afterNS[W] = B), T;
1707
- }, { before: j[0], beforeNS: {}, during: j[1], duringNS: {}, after: j[2], afterNS: {} });
1704
+ return p.reduce(function(j, $) {
1705
+ var W = $.name, N = en(l, W).map(function(xe) {
1706
+ return Qt(xe, p);
1707
+ }), Z = N[0], z = N[1], q = N[2];
1708
+ return Z.length && (j.beforeNS[W] = Z), z.length && (j.duringNS[W] = z), q.length && (j.afterNS[W] = q), j;
1709
+ }, { before: T[0], beforeNS: {}, during: T[1], duringNS: {}, after: T[2], afterNS: {} });
1708
1710
  }(L, V);
1709
- return Promise.resolve(ct({ action: g, data: { exact: E.before, namespaced: E.beforeNS }, state: U, allPlugins: A, allMatches: E, instance: D, store: C, EVENTS: x })).then(function(l) {
1711
+ return Promise.resolve(ut({ action: g, data: { exact: P.before, namespaced: P.beforeNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(l) {
1710
1712
  function p() {
1711
- var T = function() {
1712
- if (L.match(ye))
1713
- return Promise.resolve(ct({ action: P({}, S, { type: X + "End" }), data: { exact: E.after, namespaced: E.afterNS }, state: U, allPlugins: A, allMatches: E, instance: D, store: C, EVENTS: x })).then(function($) {
1714
- $.meta && $.meta.hasCallback && Vt($.meta.rid, { payload: $ });
1713
+ var j = function() {
1714
+ if (L.match(be))
1715
+ return Promise.resolve(ut({ action: E({}, S, { type: X + "End" }), data: { exact: P.after, namespaced: P.afterNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function($) {
1716
+ $.meta && $.meta.hasCallback && Yt($.meta.rid, { payload: $ });
1715
1717
  });
1716
1718
  }();
1717
- return T && T.then ? T.then(function() {
1719
+ return j && j.then ? j.then(function() {
1718
1720
  return l;
1719
1721
  }) : l;
1720
1722
  }
1721
- if (zn(l, R.length))
1723
+ if (Dn(l, R.length))
1722
1724
  return l;
1723
- var S, j = function() {
1725
+ var S, T = function() {
1724
1726
  if (L !== X)
1725
- return Promise.resolve(ct({ action: P({}, l, { type: X }), data: { exact: E.during, namespaced: E.duringNS }, state: U, allPlugins: A, allMatches: E, instance: D, store: C, EVENTS: x })).then(function(T) {
1726
- S = T;
1727
+ return Promise.resolve(ut({ action: E({}, l, { type: X }), data: { exact: P.during, namespaced: P.duringNS }, state: U, allPlugins: D, allMatches: P, instance: A, store: C, EVENTS: x })).then(function(j) {
1728
+ S = j;
1727
1729
  });
1728
1730
  S = l;
1729
1731
  }();
1730
- return j && j.then ? j.then(p) : p();
1732
+ return T && T.then ? T.then(p) : p();
1731
1733
  });
1732
1734
  } catch (l) {
1733
1735
  return Promise.reject(l);
1734
1736
  }
1735
- var K, M, Oe;
1737
+ var K, M, Pe;
1736
1738
  }(a, e, t, i, n)).then(function(g) {
1737
1739
  return s = 1, o(g);
1738
1740
  });
@@ -1745,7 +1747,7 @@ function oi(t, e, n) {
1745
1747
  };
1746
1748
  };
1747
1749
  }
1748
- function ai(t) {
1750
+ function si(t) {
1749
1751
  return function(e) {
1750
1752
  return function(n) {
1751
1753
  return function(r) {
@@ -1760,7 +1762,7 @@ function ai(t) {
1760
1762
  };
1761
1763
  };
1762
1764
  }
1763
- var si = function() {
1765
+ var ci = function() {
1764
1766
  var t = this;
1765
1767
  this.before = [], this.after = [], this.addMiddleware = function(e, n) {
1766
1768
  t[n] = t[n].concat(e);
@@ -1778,86 +1780,86 @@ var si = function() {
1778
1780
  } }, a = t[e].map(function(s) {
1779
1781
  return s(o);
1780
1782
  });
1781
- return Ie.apply(void 0, a)(r)(i);
1783
+ return _e.apply(void 0, a)(r)(i);
1782
1784
  };
1783
1785
  };
1784
1786
  };
1785
1787
  };
1786
1788
  };
1787
- function ci(t) {
1789
+ function ui(t) {
1788
1790
  return function(e, n) {
1789
1791
  e === void 0 && (e = {});
1790
1792
  var r = {};
1791
1793
  if (n.type === "initialize:aborted")
1792
1794
  return e;
1793
1795
  if (/^registerPlugin:([^:]*)$/.test(n.type)) {
1794
- var i = Qt(n.type, "registerPlugin"), o = t()[i];
1796
+ var i = rn(n.type, "registerPlugin"), o = t()[i];
1795
1797
  if (!o || !i)
1796
1798
  return e;
1797
1799
  var a = n.enabled, s = o.config;
1798
- return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, P({}, e, r);
1800
+ return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, E({}, e, r);
1799
1801
  }
1800
1802
  if (/^initialize:([^:]*)$/.test(n.type)) {
1801
- var f = Qt(n.type, O.initialize), m = t()[f];
1802
- return m && f ? (r[f] = P({}, e[f], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), P({}, e, r)) : e;
1803
+ var f = rn(n.type, O.initialize), m = t()[f];
1804
+ return m && f ? (r[f] = E({}, e[f], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), E({}, e, r)) : e;
1803
1805
  }
1804
1806
  if (/^ready:([^:]*)$/.test(n.type))
1805
- return r[n.name] = P({}, e[n.name], { loaded: !0 }), P({}, e, r);
1807
+ return r[n.name] = E({}, e[n.name], { loaded: !0 }), E({}, e, r);
1806
1808
  switch (n.type) {
1807
1809
  case O.disablePlugin:
1808
- return P({}, e, en(n.plugins, !1, e));
1810
+ return E({}, e, on(n.plugins, !1, e));
1809
1811
  case O.enablePlugin:
1810
- return P({}, e, en(n.plugins, !0, e));
1812
+ return E({}, e, on(n.plugins, !0, e));
1811
1813
  default:
1812
1814
  return e;
1813
1815
  }
1814
1816
  };
1815
1817
  }
1816
- function Qt(t, e) {
1818
+ function rn(t, e) {
1817
1819
  return t.substring(e.length + 1, t.length);
1818
1820
  }
1819
- function en(t, e, n) {
1821
+ function on(t, e, n) {
1820
1822
  return t.reduce(function(r, i) {
1821
- return r[i] = P({}, n[i], { enabled: e }), r;
1823
+ return r[i] = E({}, n[i], { enabled: e }), r;
1822
1824
  }, n);
1823
1825
  }
1824
- function Nn(t) {
1826
+ function Un(t) {
1825
1827
  try {
1826
1828
  return JSON.parse(JSON.stringify(t));
1827
1829
  } catch {
1828
1830
  }
1829
1831
  return t;
1830
1832
  }
1831
- var ui = { last: {}, history: [] };
1832
- function li(t, e) {
1833
- t === void 0 && (t = ui);
1833
+ var li = { last: {}, history: [] };
1834
+ function di(t, e) {
1835
+ t === void 0 && (t = li);
1834
1836
  var n = e.options, r = e.meta;
1835
1837
  if (e.type === O.track) {
1836
- var i = Nn(P({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
1837
- return P({}, t, { last: i, history: t.history.concat(i) });
1838
+ var i = Un(E({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
1839
+ return E({}, t, { last: i, history: t.history.concat(i) });
1838
1840
  }
1839
1841
  return t;
1840
1842
  }
1841
- var di = { actions: [] };
1842
- function hi(t, e) {
1843
- t === void 0 && (t = di);
1843
+ var hi = { actions: [] };
1844
+ function fi(t, e) {
1845
+ t === void 0 && (t = hi);
1844
1846
  var n = e.payload;
1845
1847
  switch (e.type) {
1846
1848
  case "queue":
1847
1849
  var r;
1848
- return r = n && n.type && n.type === O.identify ? [e].concat(t.actions) : t.actions.concat(e), P({}, t, { actions: r });
1850
+ return r = n && n.type && n.type === O.identify ? [e].concat(t.actions) : t.actions.concat(e), E({}, t, { actions: r });
1849
1851
  case "dequeue":
1850
1852
  return [];
1851
1853
  default:
1852
1854
  return t;
1853
1855
  }
1854
1856
  }
1855
- var Dn = /#.*$/;
1856
- function fi(t) {
1857
+ var Zn = /#.*$/;
1858
+ function pi(t) {
1857
1859
  var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
1858
- return "/" + (e && e[3] ? e[3].split("?")[0].replace(Dn, "") : "");
1860
+ return "/" + (e && e[3] ? e[3].split("?")[0].replace(Zn, "") : "");
1859
1861
  }
1860
- var Ln, An, Un, Zn, pi = function(t) {
1862
+ var Rn, Wn, Kn, Mn, mi = function(t) {
1861
1863
  if (t === void 0 && (t = {}), !H)
1862
1864
  return t;
1863
1865
  var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, f = o.hash, m = o.search, u = function(d) {
@@ -1868,42 +1870,42 @@ var Ln, An, Un, Zn, pi = function(t) {
1868
1870
  return v.getAttribute("href");
1869
1871
  }
1870
1872
  }();
1871
- return h ? h.match(/\?/) ? h : h + d : window.location.href.replace(Dn, "");
1872
- }(m), c = { title: n, url: u, path: fi(u), hash: f, search: m, width: a, height: s };
1873
- return r && r !== "" && (c.referrer = r), P({}, c, t);
1874
- }, mi = { last: {}, history: [] };
1875
- function gi(t, e) {
1876
- t === void 0 && (t = mi);
1873
+ return h ? h.match(/\?/) ? h : h + d : window.location.href.replace(Zn, "");
1874
+ }(m), c = { title: n, url: u, path: pi(u), hash: f, search: m, width: a, height: s };
1875
+ return r && r !== "" && (c.referrer = r), E({}, c, t);
1876
+ }, gi = { last: {}, history: [] };
1877
+ function vi(t, e) {
1878
+ t === void 0 && (t = gi);
1877
1879
  var n = e.options;
1878
1880
  if (e.type === O.page) {
1879
- var r = Nn(P({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
1880
- return P({}, t, { last: r, history: t.history.concat(r) });
1881
+ var r = Un(E({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
1882
+ return E({}, t, { last: r, history: t.history.concat(r) });
1881
1883
  }
1882
1884
  return t;
1883
1885
  }
1884
- Ln = function() {
1886
+ Rn = function() {
1885
1887
  if (!H)
1886
1888
  return !1;
1887
1889
  var t = navigator.appVersion;
1888
1890
  return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
1889
- }(), An = H ? document.referrer : null, Un = Hr(), Zn = Yr();
1890
- var tn = { initialized: !1, sessionId: et(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: Ln }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: Zn, locale: Un, campaign: {}, referrer: An };
1891
- function vi(t, e) {
1892
- t === void 0 && (t = tn);
1891
+ }(), Wn = H ? document.referrer : null, Kn = Yr(), Mn = Gr();
1892
+ var an = { initialized: !1, sessionId: tt(), app: null, version: null, debug: !1, offline: !!H && !navigator.onLine, os: { name: Rn }, userAgent: H ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: Mn, locale: Kn, campaign: {}, referrer: Wn };
1893
+ function yi(t, e) {
1894
+ t === void 0 && (t = an);
1893
1895
  var n = t.initialized, r = e.campaign;
1894
1896
  switch (e.type) {
1895
1897
  case O.campaign:
1896
- return P({}, t, { campaign: r });
1898
+ return E({}, t, { campaign: r });
1897
1899
  case O.offline:
1898
- return P({}, t, { offline: !0 });
1900
+ return E({}, t, { offline: !0 });
1899
1901
  case O.online:
1900
- return P({}, t, { offline: !1 });
1902
+ return E({}, t, { offline: !1 });
1901
1903
  default:
1902
- return n ? t : P({}, tn, t, { initialized: !0 });
1904
+ return n ? t : E({}, an, t, { initialized: !0 });
1903
1905
  }
1904
1906
  }
1905
- var yi = ["plugins", "reducers", "storage"];
1906
- function wi(t, e, n) {
1907
+ var wi = ["plugins", "reducers", "storage"];
1908
+ function bi(t, e, n) {
1907
1909
  if (H) {
1908
1910
  var r = window[(n ? "add" : "remove") + "EventListener"];
1909
1911
  t.split(" ").forEach(function(i) {
@@ -1911,36 +1913,36 @@ function wi(t, e, n) {
1911
1913
  });
1912
1914
  }
1913
1915
  }
1914
- function bi(t) {
1915
- var e = wi.bind(null, "online offline", function(n) {
1916
+ function ki(t) {
1917
+ var e = bi.bind(null, "online offline", function(n) {
1916
1918
  return Promise.resolve(!navigator.onLine).then(t);
1917
1919
  });
1918
1920
  return e(!0), function(n) {
1919
1921
  return e(!1);
1920
1922
  };
1921
1923
  }
1922
- function Rn() {
1923
- return fe("analytics", []), function(t) {
1924
+ function Xn() {
1925
+ return me("analytics", []), function(t) {
1924
1926
  return function(e, n, r) {
1925
1927
  var i = t(e, n, r), o = i.dispatch;
1926
1928
  return Object.assign(i, { dispatch: function(a) {
1927
- return ke[be].analytics.push(a.action || a), o(a);
1929
+ return Se[Ie].analytics.push(a.action || a), o(a);
1928
1930
  } });
1929
1931
  };
1930
1932
  };
1931
1933
  }
1932
- function nn(t) {
1934
+ function sn(t) {
1933
1935
  return function() {
1934
- return Ie(Ie.apply(null, arguments), Rn());
1936
+ return _e(_e.apply(null, arguments), Xn());
1935
1937
  };
1936
1938
  }
1937
- function dt(t) {
1938
- return t ? xn(t) ? t : [t] : [];
1939
+ function ht(t) {
1940
+ return t ? $n(t) ? t : [t] : [];
1939
1941
  }
1940
- function rn(t, e, n) {
1942
+ function cn(t, e, n) {
1941
1943
  t === void 0 && (t = {});
1942
- var r, i, o = et();
1943
- return e && (je[o] = (r = e, i = function(a) {
1944
+ var r, i, o = tt();
1945
+ return e && (Ce[o] = (r = e, i = function(a) {
1944
1946
  for (var s, f = a || Array.prototype.slice.call(arguments), m = 0; m < f.length; m++)
1945
1947
  if (G(f[m])) {
1946
1948
  s = f[m];
@@ -1949,9 +1951,9 @@ function rn(t, e, n) {
1949
1951
  return s;
1950
1952
  }(n), function(a) {
1951
1953
  i && i(a), r(a);
1952
- })), P({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
1954
+ })), E({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
1953
1955
  }
1954
- function ki(t) {
1956
+ function Ii(t) {
1955
1957
  t === void 0 && (t = {});
1956
1958
  var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(l, p) {
1957
1959
  if (G(p))
@@ -1965,67 +1967,67 @@ function ki(t) {
1965
1967
  l.pluginEnabled[p.name] = !(p.enabled === !1 || p.config.enabled === !1), delete p.enabled, p.methods && (l.methods[p.name] = Object.keys(p.methods).reduce(function($, W) {
1966
1968
  var N;
1967
1969
  return $[W] = (N = p.methods[W], function() {
1968
- for (var Z = Array.prototype.slice.call(arguments), z = new Array(N.length), B = 0; B < Z.length; B++)
1969
- z[B] = Z[B];
1970
+ for (var Z = Array.prototype.slice.call(arguments), z = new Array(N.length), q = 0; q < Z.length; q++)
1971
+ z[q] = Z[q];
1970
1972
  return z[z.length] = b, N.apply({ instance: b }, z);
1971
1973
  }), $;
1972
1974
  }, {}), delete p.methods);
1973
- var j = Object.keys(p).concat(S), T = new Set(l.events.concat(j));
1974
- if (l.events = Array.from(T), l.pluginsArray = l.pluginsArray.concat(p), l.plugins[p.name])
1975
+ var T = Object.keys(p).concat(S), j = new Set(l.events.concat(T));
1976
+ if (l.events = Array.from(j), l.pluginsArray = l.pluginsArray.concat(p), l.plugins[p.name])
1975
1977
  throw new Error(p.name + "AlreadyLoaded");
1976
1978
  return l.plugins[p.name] = p, l.plugins[p.name].loaded || (l.plugins[p.name].loaded = function() {
1977
1979
  return !0;
1978
1980
  }), l;
1979
- }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: he, setItem: fe, removeItem: Se }, o = /* @__PURE__ */ function(l) {
1980
- return function(p, S, j) {
1981
- return S.getState("user")[p] || (j && F(j) && j[p] ? j[p] : Xt(l)[p] || he(yt(p)) || null);
1981
+ }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: pe, setItem: me, removeItem: Oe }, o = /* @__PURE__ */ function(l) {
1982
+ return function(p, S, T) {
1983
+ return S.getState("user")[p] || (T && F(T) && T[p] ? T[p] : Ht(l)[p] || pe(bt(p)) || null);
1982
1984
  };
1983
1985
  }(i), a = r.plugins, s = r.events.filter(function(l) {
1984
- return !vt.includes(l);
1985
- }).sort(), f = new Set(s.concat(Fe).filter(function(l) {
1986
- return !vt.includes(l);
1986
+ return !wt.includes(l);
1987
+ }).sort(), f = new Set(s.concat(He).filter(function(l) {
1988
+ return !wt.includes(l);
1987
1989
  })), m = Array.from(f).sort(), u = function() {
1988
1990
  return a;
1989
- }, c = new si(), d = c.addMiddleware, h = c.removeMiddleware, v = c.dynamicMiddlewares, w = function() {
1991
+ }, c = new ci(), d = c.addMiddleware, h = c.removeMiddleware, v = c.dynamicMiddlewares, w = function() {
1990
1992
  throw new Error("Abort disabled inListener");
1991
- }, y = Gr(), k = Xt(i), _ = P({}, k, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
1992
- _.anonymousId || (_.anonymousId = et());
1993
- var I = P({ enable: function(l, p) {
1993
+ }, y = Br(), k = Ht(i), _ = E({}, k, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
1994
+ _.anonymousId || (_.anonymousId = tt());
1995
+ var I = E({ enable: function(l, p) {
1994
1996
  return new Promise(function(S) {
1995
- E.dispatch({ type: O.enablePlugin, plugins: dt(l), _: { originalAction: O.enablePlugin } }, S, [p]);
1997
+ P.dispatch({ type: O.enablePlugin, plugins: ht(l), _: { originalAction: O.enablePlugin } }, S, [p]);
1996
1998
  });
1997
1999
  }, disable: function(l, p) {
1998
2000
  return new Promise(function(S) {
1999
- E.dispatch({ type: O.disablePlugin, plugins: dt(l), _: { originalAction: O.disablePlugin } }, S, [p]);
2001
+ P.dispatch({ type: O.disablePlugin, plugins: ht(l), _: { originalAction: O.disablePlugin } }, S, [p]);
2000
2002
  });
2001
- } }, r.methods), g = !1, b = { identify: function(l, p, S, j) {
2003
+ } }, r.methods), g = !1, b = { identify: function(l, p, S, T) {
2002
2004
  try {
2003
- var T = re(l) ? l : null, $ = F(l) ? l : p, W = S || {}, N = b.user();
2004
- fe(yt(te), T);
2005
- var Z = T || $.userId || o(te, b, $);
2005
+ var j = re(l) ? l : null, $ = F(l) ? l : p, W = S || {}, N = b.user();
2006
+ me(bt(te), j);
2007
+ var Z = j || $.userId || o(te, b, $);
2006
2008
  return Promise.resolve(new Promise(function(z) {
2007
- E.dispatch(P({ type: O.identifyStart, userId: Z, traits: $ || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== T && { previousId: N.id }), z, [p, S, j]);
2009
+ P.dispatch(E({ type: O.identifyStart, userId: Z, traits: $ || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== j && { previousId: N.id }), z, [p, S, T]);
2008
2010
  }));
2009
2011
  } catch (z) {
2010
2012
  return Promise.reject(z);
2011
2013
  }
2012
- }, track: function(l, p, S, j) {
2014
+ }, track: function(l, p, S, T) {
2013
2015
  try {
2014
- var T = F(l) ? l.event : l;
2015
- if (!T || !re(T))
2016
+ var j = F(l) ? l.event : l;
2017
+ if (!j || !re(j))
2016
2018
  throw new Error("EventMissing");
2017
2019
  var $ = F(l) ? l : p || {}, W = F(S) ? S : {};
2018
2020
  return Promise.resolve(new Promise(function(N) {
2019
- E.dispatch({ type: O.trackStart, event: T, properties: $, options: W, userId: o(te, b, p), anonymousId: o(ge, b, p) }, N, [p, S, j]);
2021
+ P.dispatch({ type: O.trackStart, event: j, properties: $, options: W, userId: o(te, b, p), anonymousId: o(ye, b, p) }, N, [p, S, T]);
2020
2022
  }));
2021
2023
  } catch (N) {
2022
2024
  return Promise.reject(N);
2023
2025
  }
2024
2026
  }, page: function(l, p, S) {
2025
2027
  try {
2026
- var j = F(l) ? l : {}, T = F(p) ? p : {};
2028
+ var T = F(l) ? l : {}, j = F(p) ? p : {};
2027
2029
  return Promise.resolve(new Promise(function($) {
2028
- E.dispatch({ type: O.pageStart, properties: pi(j), options: T, userId: o(te, b, j), anonymousId: o(ge, b, j) }, $, [l, p, S]);
2030
+ P.dispatch({ type: O.pageStart, properties: mi(T), options: j, userId: o(te, b, T), anonymousId: o(ye, b, T) }, $, [l, p, S]);
2029
2031
  }));
2030
2032
  } catch ($) {
2031
2033
  return Promise.reject($);
@@ -2033,13 +2035,13 @@ function ki(t) {
2033
2035
  }, user: function(l) {
2034
2036
  if (l === te || l === "id")
2035
2037
  return o(te, b);
2036
- if (l === ge || l === "anonId")
2037
- return o(ge, b);
2038
+ if (l === ye || l === "anonId")
2039
+ return o(ye, b);
2038
2040
  var p = b.getState("user");
2039
- return l ? At(p, l) : p;
2041
+ return l ? Wt(p, l) : p;
2040
2042
  }, reset: function(l) {
2041
2043
  return new Promise(function(p) {
2042
- E.dispatch({ type: O.resetStart }, p, l);
2044
+ P.dispatch({ type: O.resetStart }, p, l);
2043
2045
  });
2044
2046
  }, ready: function(l) {
2045
2047
  return g && l({ plugins: I, instance: b }), b.on(O.ready, function(p) {
@@ -2052,24 +2054,24 @@ function ki(t) {
2052
2054
  throw new Error(".on disabled for " + l);
2053
2055
  var S = /Start$|Start:/;
2054
2056
  if (l === "*") {
2055
- var j = function(N) {
2057
+ var T = function(N) {
2056
2058
  return function(Z) {
2057
2059
  return function(z) {
2058
2060
  return z.type.match(S) && p({ payload: z, instance: b, plugins: a }), Z(z);
2059
2061
  };
2060
2062
  };
2061
- }, T = function(N) {
2063
+ }, j = function(N) {
2062
2064
  return function(Z) {
2063
2065
  return function(z) {
2064
2066
  return z.type.match(S) || p({ payload: z, instance: b, plugins: a }), Z(z);
2065
2067
  };
2066
2068
  };
2067
2069
  };
2068
- return d(j, We), d(T, Ke), function() {
2069
- h(j, We), h(T, Ke);
2070
+ return d(T, Me), d(j, Xe), function() {
2071
+ h(T, Me), h(j, Xe);
2070
2072
  };
2071
2073
  }
2072
- var $ = l.match(S) ? We : Ke, W = function(N) {
2074
+ var $ = l.match(S) ? Me : Xe, W = function(N) {
2073
2075
  return function(Z) {
2074
2076
  return function(z) {
2075
2077
  return z.type === l && p({ payload: z, instance: b, plugins: a, abort: w }), Z(z);
@@ -2084,56 +2086,56 @@ function ki(t) {
2084
2086
  return !1;
2085
2087
  if (l === O.bootstrap)
2086
2088
  throw new Error(".once disabled for " + l);
2087
- var S = b.on(l, function(j) {
2088
- p({ payload: j.payload, instance: b, plugins: a, abort: w }), S();
2089
+ var S = b.on(l, function(T) {
2090
+ p({ payload: T.payload, instance: b, plugins: a, abort: w }), S();
2089
2091
  });
2090
2092
  return S;
2091
2093
  }, getState: function(l) {
2092
- var p = E.getState();
2093
- return l ? At(p, l) : Object.assign({}, p);
2094
+ var p = P.getState();
2095
+ return l ? Wt(p, l) : Object.assign({}, p);
2094
2096
  }, dispatch: function(l) {
2095
2097
  var p = re(l) ? { type: l } : l;
2096
- if (Fe.includes(p.type))
2098
+ if (He.includes(p.type))
2097
2099
  throw new Error("reserved action " + p.type);
2098
- var S = P({}, p, { _: P({ originalAction: p.type }, l._ || {}) });
2099
- E.dispatch(S);
2100
+ var S = E({}, p, { _: E({ originalAction: p.type }, l._ || {}) });
2101
+ P.dispatch(S);
2100
2102
  }, enablePlugin: I.enable, disablePlugin: I.disable, plugins: I, storage: { getItem: i.getItem, setItem: function(l, p, S) {
2101
- E.dispatch({ type: O.setItemStart, key: l, value: p, options: S });
2103
+ P.dispatch({ type: O.setItemStart, key: l, value: p, options: S });
2102
2104
  }, removeItem: function(l, p) {
2103
- E.dispatch({ type: O.removeItemStart, key: l, options: p });
2105
+ P.dispatch({ type: O.removeItemStart, key: l, options: p });
2104
2106
  } }, setAnonymousId: function(l, p) {
2105
2107
  b.storage.setItem(ie, l, p);
2106
- }, events: { core: Fe, plugins: s } }, D = r.middlewares.concat([function(l) {
2108
+ }, events: { core: He, plugins: s } }, A = r.middlewares.concat([function(l) {
2107
2109
  return function(p) {
2108
2110
  return function(S) {
2109
- return S.meta || (S.meta = rn()), p(S);
2111
+ return S.meta || (S.meta = cn()), p(S);
2110
2112
  };
2111
2113
  };
2112
- }, v(We), oi(b, u, { all: m, plugins: s }), ai(i), ti(b), ri(b), v(Ke)]), C = { context: vi, user: ni(i), page: gi, track: li, plugins: ci(u), queue: hi }, x = Ie, A = Ie;
2114
+ }, v(Me), ai(b, u, { all: m, plugins: s }), si(i), ni(b), ii(b), v(Xe)]), C = { context: yi, user: ri(i), page: vi, track: di, plugins: ui(u), queue: fi }, x = _e, D = _e;
2113
2115
  if (H && t.debug) {
2114
2116
  var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2115
- L && (x = L({ trace: !0, traceLimit: 25 })), A = function() {
2116
- return arguments.length === 0 ? Rn() : F(typeof arguments[0]) ? nn() : nn().apply(null, arguments);
2117
+ L && (x = L({ trace: !0, traceLimit: 25 })), D = function() {
2118
+ return arguments.length === 0 ? Xn() : F(typeof arguments[0]) ? sn() : sn().apply(null, arguments);
2117
2119
  };
2118
2120
  }
2119
2121
  var X, U = function(l) {
2120
2122
  return Object.keys(l).reduce(function(p, S) {
2121
- return yi.includes(S) || (p[S] = l[S]), p;
2123
+ return wi.includes(S) || (p[S] = l[S]), p;
2122
2124
  }, {});
2123
2125
  }(t), V = r.pluginsArray.reduce(function(l, p) {
2124
- var S = p.name, j = p.config, T = p.loaded, $ = r.pluginEnabled[S];
2125
- return l[S] = { enabled: $, initialized: !!$ && !p.initialize, loaded: !!T({ config: j }), config: j }, l;
2126
- }, {}), R = { context: U, user: _, plugins: V }, E = Tn(function(l) {
2127
- for (var p = Object.keys(l), S = {}, j = 0; j < p.length; j++) {
2128
- var T = p[j];
2129
- typeof l[T] === ne && (S[T] = l[T]);
2126
+ var S = p.name, T = p.config, j = p.loaded, $ = r.pluginEnabled[S];
2127
+ return l[S] = { enabled: $, initialized: !!$ && !p.initialize, loaded: !!j({ config: T }), config: T }, l;
2128
+ }, {}), R = { context: U, user: _, plugins: V }, P = Nn(function(l) {
2129
+ for (var p = Object.keys(l), S = {}, T = 0; T < p.length; T++) {
2130
+ var j = p[T];
2131
+ typeof l[j] === ne && (S[j] = l[j]);
2130
2132
  }
2131
2133
  var $, W = Object.keys(S);
2132
2134
  try {
2133
2135
  (function(N) {
2134
2136
  Object.keys(N).forEach(function(Z) {
2135
2137
  var z = N[Z];
2136
- if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type: qr }) === ee)
2138
+ if (typeof z(void 0, { type: "@@redux/INIT" }) === ee || typeof z(void 0, { type: Qr }) === ee)
2137
2139
  throw new Error("reducer " + Z + " " + ee);
2138
2140
  });
2139
2141
  })(S);
@@ -2143,69 +2145,69 @@ function ki(t) {
2143
2145
  return function(N, Z) {
2144
2146
  if (N === void 0 && (N = {}), $)
2145
2147
  throw $;
2146
- for (var z = !1, B = {}, Pe = 0; Pe < W.length; Pe++) {
2147
- var Le = W[Pe], xt = N[Le], rt = (0, S[Le])(xt, Z);
2148
- if (typeof rt === ee) {
2149
- var er = Qr(Le, Z);
2150
- throw new Error(er);
2148
+ for (var z = !1, q = {}, xe = 0; xe < W.length; xe++) {
2149
+ var Ue = W[xe], $t = N[Ue], it = (0, S[Ue])($t, Z);
2150
+ if (typeof it === ee) {
2151
+ var nr = ei(Ue, Z);
2152
+ throw new Error(nr);
2151
2153
  }
2152
- B[Le] = rt, z = z || rt !== xt;
2154
+ q[Ue] = it, z = z || it !== $t;
2153
2155
  }
2154
- return z ? B : N;
2156
+ return z ? q : N;
2155
2157
  };
2156
- }(P({}, C, e)), R, A(x(ei.apply(void 0, D))));
2157
- E.dispatch = (X = E.dispatch, function(l, p, S) {
2158
- var j = P({}, l, { meta: rn(l.meta, p, dt(S)) });
2159
- return X.apply(null, [j]);
2158
+ }(E({}, C, e)), R, D(x(ti.apply(void 0, A))));
2159
+ P.dispatch = (X = P.dispatch, function(l, p, S) {
2160
+ var T = E({}, l, { meta: cn(l.meta, p, ht(S)) });
2161
+ return X.apply(null, [T]);
2160
2162
  });
2161
2163
  var K = Object.keys(a);
2162
- E.dispatch({ type: O.bootstrap, plugins: K, config: U, params: y, user: _, initialUser: n, persistedUser: k });
2164
+ P.dispatch({ type: O.bootstrap, plugins: K, config: U, params: y, user: _, initialUser: n, persistedUser: k });
2163
2165
  var M = K.filter(function(l) {
2164
2166
  return r.pluginEnabled[l];
2165
- }), Oe = K.filter(function(l) {
2167
+ }), Pe = K.filter(function(l) {
2166
2168
  return !r.pluginEnabled[l];
2167
2169
  });
2168
- return E.dispatch({ type: O.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(l, p) {
2169
- var S = l.bootstrap, j = l.config, T = l.name;
2170
- S && G(S) && S({ instance: b, config: j, payload: l }), E.dispatch({ type: O.registerPluginType(T), name: T, enabled: r.pluginEnabled[T], plugin: l }), r.pluginsArray.length === p + 1 && E.dispatch({ type: O.initializeStart, plugins: M, disabled: Oe });
2171
- }), bi(function(l) {
2172
- E.dispatch({ type: l ? O.offline : O.online });
2170
+ return P.dispatch({ type: O.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(l, p) {
2171
+ var S = l.bootstrap, T = l.config, j = l.name;
2172
+ S && G(S) && S({ instance: b, config: T, payload: l }), P.dispatch({ type: O.registerPluginType(j), name: j, enabled: r.pluginEnabled[j], plugin: l }), r.pluginsArray.length === p + 1 && P.dispatch({ type: O.initializeStart, plugins: M, disabled: Pe });
2173
+ }), ki(function(l) {
2174
+ P.dispatch({ type: l ? O.offline : O.online });
2173
2175
  }), function(l, p, S) {
2174
2176
  setInterval(function() {
2175
- return $n(l, p, S);
2177
+ return Ln(l, p, S);
2176
2178
  }, 3e3);
2177
- }(E, u, b), b;
2179
+ }(P, u, b), b;
2178
2180
  }
2179
- var We = "before", Ke = "after", Ce = "cookie", se = Mn(), Wn = tt, Ii = tt;
2180
- function Kn(t) {
2181
- return se ? tt(t, "", -1) : Se(t);
2181
+ var Me = "before", Xe = "after", ze = "cookie", ce = Jn(), Vn = nt, Si = nt;
2182
+ function Fn(t) {
2183
+ return ce ? nt(t, "", -1) : Oe(t);
2182
2184
  }
2183
- function Mn() {
2184
- if (se !== void 0)
2185
- return se;
2185
+ function Jn() {
2186
+ if (ce !== void 0)
2187
+ return ce;
2186
2188
  var t = "cookiecookie";
2187
2189
  try {
2188
- tt(t, t), se = document.cookie.indexOf(t) !== -1, Kn(t);
2190
+ nt(t, t), ce = document.cookie.indexOf(t) !== -1, Fn(t);
2189
2191
  } catch {
2190
- se = !1;
2192
+ ce = !1;
2191
2193
  }
2192
- return se;
2194
+ return ce;
2193
2195
  }
2194
- function tt(t, e, n, r, i, o) {
2196
+ function nt(t, e, n, r, i, o) {
2195
2197
  if (typeof window < "u") {
2196
2198
  var a = arguments.length > 1;
2197
- return se === !1 && (a ? fe(t, e) : he(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]);
2198
- }
2199
- }
2200
- var $e = "localStorage", Si = It.bind(null, "localStorage");
2201
- _e("localStorage", "getItem", he);
2202
- _e("localStorage", "setItem", fe);
2203
- _e("localStorage", "removeItem", Se);
2204
- var ze = "sessionStorage", _i = It.bind(null, "sessionStorage");
2205
- _e("sessionStorage", "getItem", he);
2206
- _e("sessionStorage", "setItem", fe);
2207
- _e("sessionStorage", "removeItem", Se);
2208
- function we(t) {
2199
+ return ce === !1 && (a ? me(t, e) : pe(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]);
2200
+ }
2201
+ }
2202
+ var Ne = "localStorage", _i = Ot.bind(null, "localStorage");
2203
+ Ee("localStorage", "getItem", pe);
2204
+ Ee("localStorage", "setItem", me);
2205
+ Ee("localStorage", "removeItem", Oe);
2206
+ var Ae = "sessionStorage", Oi = Ot.bind(null, "sessionStorage");
2207
+ Ee("sessionStorage", "getItem", pe);
2208
+ Ee("sessionStorage", "setItem", me);
2209
+ Ee("sessionStorage", "removeItem", Oe);
2210
+ function ke(t) {
2209
2211
  var e = t;
2210
2212
  try {
2211
2213
  if ((e = JSON.parse(t)) === "true")
@@ -2220,57 +2222,57 @@ function we(t) {
2220
2222
  if (e !== null && e !== "")
2221
2223
  return e;
2222
2224
  }
2223
- var Oi = Si(), Pi = _i(), Ei = Mn();
2224
- function Xn(t, e) {
2225
+ var Ei = _i(), Pi = Oi(), xi = Jn();
2226
+ function Hn(t, e) {
2225
2227
  if (t) {
2226
- var n = St(e), r = !Et(n), i = _t(n) ? we(localStorage.getItem(t)) : void 0;
2227
- if (r && !me(i))
2228
+ var n = Et(e), r = !jt(n), i = Pt(n) ? ke(localStorage.getItem(t)) : void 0;
2229
+ if (r && !ve(i))
2228
2230
  return i;
2229
- var o = Ot(n) ? we(Wn(t)) : void 0;
2231
+ var o = xt(n) ? ke(Vn(t)) : void 0;
2230
2232
  if (r && o)
2231
2233
  return o;
2232
- var a = Pt(n) ? we(sessionStorage.getItem(t)) : void 0;
2234
+ var a = Tt(n) ? ke(sessionStorage.getItem(t)) : void 0;
2233
2235
  if (r && a)
2234
2236
  return a;
2235
- var s = he(t);
2237
+ var s = pe(t);
2236
2238
  return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
2237
2239
  }
2238
2240
  }
2239
- function xi(t, e, n) {
2240
- if (t && !me(e)) {
2241
- var r = {}, i = St(n), o = JSON.stringify(e), a = !Et(i);
2242
- return _t(i) && (r[$e] = Me($e, e, we(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[$e] : Ot(i) && (r[Ce] = Me(Ce, e, we(Wn(t))), Ii(t, o), a) ? r[Ce] : Pt(i) && (r[ze] = Me(ze, e, we(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[ze] : (r[Te] = Me(Te, e, he(t)), fe(t, e), a ? r[Te] : r);
2241
+ function Ti(t, e, n) {
2242
+ if (t && !ve(e)) {
2243
+ var r = {}, i = Et(n), o = JSON.stringify(e), a = !jt(i);
2244
+ return Pt(i) && (r[Ne] = Ve(Ne, e, ke(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ne] : xt(i) && (r[ze] = Ve(ze, e, ke(Vn(t))), Si(t, o), a) ? r[ze] : Tt(i) && (r[Ae] = Ve(Ae, e, ke(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ae] : (r[$e] = Ve($e, e, pe(t)), me(t, e), a ? r[$e] : r);
2243
2245
  }
2244
2246
  }
2245
2247
  function ji(t, e) {
2246
2248
  if (t) {
2247
- var n = St(e), r = Xn(t, On), i = {};
2248
- return !me(r.localStorage) && _t(n) && (localStorage.removeItem(t), i[$e] = r.localStorage), !me(r.cookie) && Ot(n) && (Kn(t), i[Ce] = r.cookie), !me(r.sessionStorage) && Pt(n) && (sessionStorage.removeItem(t), i[ze] = r.sessionStorage), !me(r.global) && nt(n, Te) && (Se(t), i[Te] = r.global), i;
2249
+ var n = Et(e), r = Hn(t, Tn), i = {};
2250
+ return !ve(r.localStorage) && Pt(n) && (localStorage.removeItem(t), i[Ne] = r.localStorage), !ve(r.cookie) && xt(n) && (Fn(t), i[ze] = r.cookie), !ve(r.sessionStorage) && Tt(n) && (sessionStorage.removeItem(t), i[Ae] = r.sessionStorage), !ve(r.global) && rt(n, $e) && (Oe(t), i[$e] = r.global), i;
2249
2251
  }
2250
2252
  }
2251
- function St(t) {
2252
- return t ? re(t) ? t : t.storage : _n;
2253
+ function Et(t) {
2254
+ return t ? re(t) ? t : t.storage : xn;
2253
2255
  }
2254
- function _t(t) {
2255
- return Oi && nt(t, $e);
2256
+ function Pt(t) {
2257
+ return Ei && rt(t, Ne);
2256
2258
  }
2257
- function Ot(t) {
2258
- return Ei && nt(t, Ce);
2259
+ function xt(t) {
2260
+ return xi && rt(t, ze);
2259
2261
  }
2260
- function Pt(t) {
2261
- return Pi && nt(t, ze);
2262
+ function Tt(t) {
2263
+ return Pi && rt(t, Ae);
2262
2264
  }
2263
- function Et(t) {
2264
- return t === On || t === "all";
2265
+ function jt(t) {
2266
+ return t === Tn || t === "all";
2265
2267
  }
2266
- function nt(t, e) {
2267
- return t === _n || t === e || Et(t);
2268
+ function rt(t, e) {
2269
+ return t === xn || t === e || jt(t);
2268
2270
  }
2269
- function Me(t, e, n) {
2271
+ function Ve(t, e, n) {
2270
2272
  return { location: t, current: e, previous: n };
2271
2273
  }
2272
- var Ti = { setItem: xi, getItem: Xn, removeItem: ji };
2273
- function Ci(t, e, n) {
2274
+ var Ci = { setItem: Ti, getItem: Hn, removeItem: ji };
2275
+ function $i(t, e, n) {
2274
2276
  return e in t ? Object.defineProperty(t, e, {
2275
2277
  value: n,
2276
2278
  enumerable: !0,
@@ -2278,7 +2280,7 @@ function Ci(t, e, n) {
2278
2280
  writable: !0
2279
2281
  }) : t[e] = n, t;
2280
2282
  }
2281
- function on(t, e) {
2283
+ function un(t, e) {
2282
2284
  var n = Object.keys(t);
2283
2285
  if (Object.getOwnPropertySymbols) {
2284
2286
  var r = Object.getOwnPropertySymbols(t);
@@ -2288,24 +2290,24 @@ function on(t, e) {
2288
2290
  }
2289
2291
  return n;
2290
2292
  }
2291
- function an(t) {
2293
+ function ln(t) {
2292
2294
  for (var e = 1; e < arguments.length; e++) {
2293
2295
  var n = arguments[e] != null ? arguments[e] : {};
2294
- e % 2 ? on(Object(n), !0).forEach(function(r) {
2295
- Ci(t, r, n[r]);
2296
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : on(Object(n)).forEach(function(r) {
2296
+ e % 2 ? un(Object(n), !0).forEach(function(r) {
2297
+ $i(t, r, n[r]);
2298
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : un(Object(n)).forEach(function(r) {
2297
2299
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
2298
2300
  });
2299
2301
  }
2300
2302
  return t;
2301
2303
  }
2302
- function $i() {
2304
+ function zi() {
2303
2305
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
2304
- storage: Ti
2306
+ storage: Ci
2305
2307
  };
2306
- return ki(an(an({}, e), t));
2308
+ return Ii(ln(ln({}, e), t));
2307
2309
  }
2308
- function zi(t, e) {
2310
+ function Ni(t, e) {
2309
2311
  e = e || {};
2310
2312
  var n, r, i = [], o = e.max || 1 / 0;
2311
2313
  function a() {
@@ -2327,8 +2329,8 @@ function zi(t, e) {
2327
2329
  }
2328
2330
  };
2329
2331
  }
2330
- const Vn = "@sesamy/sesamy-js", Fn = "1.0.1";
2331
- function Ni(t) {
2332
+ const Yn = "@sesamy/sesamy-js", Gn = "1.0.2";
2333
+ function Ai(t) {
2332
2334
  if (!(typeof window > "u")) {
2333
2335
  var e = window, n = e.addEventListener, r = e.history, i = e.location, o = i.pathname;
2334
2336
  n("popstate", function() {
@@ -2336,7 +2338,7 @@ function Ni(t) {
2336
2338
  }), ["push", "replace"].map(function(a) {
2337
2339
  var s = "".concat(a, "State"), f = r[s];
2338
2340
  r[s] = function() {
2339
- var m = arguments, u = Li(arguments[2]);
2341
+ var m = arguments, u = Di(arguments[2]);
2340
2342
  return o !== u && (o = u, setTimeout(function() {
2341
2343
  return t(m[2]);
2342
2344
  }, 0)), f.apply(r, arguments);
@@ -2344,27 +2346,27 @@ function Ni(t) {
2344
2346
  });
2345
2347
  }
2346
2348
  }
2347
- function Di(t, e) {
2349
+ function Li(t, e) {
2348
2350
  var n = t.indexOf(e);
2349
2351
  return n > -1 ? t.slice(0, n) : t;
2350
2352
  }
2351
- function Li(t) {
2353
+ function Di(t) {
2352
2354
  return ["#", "?"].forEach(function(e) {
2353
- return t = Di(t, e);
2355
+ return t = Li(t, e);
2354
2356
  }), t;
2355
2357
  }
2356
- function Ai() {
2357
- Ni(() => {
2358
- Je.page();
2358
+ function Ui() {
2359
+ Ai(() => {
2360
+ ae.page();
2359
2361
  });
2360
2362
  }
2361
- var sn = "EventListener";
2362
- function Ui(t) {
2363
+ var dn = "EventListener";
2364
+ function Zi(t) {
2363
2365
  return function(e, n, r, i) {
2364
- var o = r || Ar, a = i || !1;
2366
+ var o = r || Ur, a = i || !1;
2365
2367
  if (!H)
2366
2368
  return o;
2367
- var s = Ge(n), f = Ge(e, !0);
2369
+ var s = Be(n), f = Be(e, !0);
2368
2370
  if (!f.length)
2369
2371
  throw new Error("noElements");
2370
2372
  if (!s.length)
@@ -2372,9 +2374,9 @@ function Ui(t) {
2372
2374
  var m = [];
2373
2375
  return function u(c) {
2374
2376
  c && (m = []);
2375
- for (var d = c ? "add" + sn : "remove" + sn, h = 0; h < f.length; h++) {
2377
+ for (var d = c ? "add" + dn : "remove" + dn, h = 0; h < f.length; h++) {
2376
2378
  var v = f[h];
2377
- m[h] = c ? a && a.once ? Zi(o) : o : m[h] || o;
2379
+ m[h] = c ? a && a.once ? Ri(o) : o : m[h] || o;
2378
2380
  for (var w = 0; w < s.length; w++)
2379
2381
  v[d] ? v["on" + s[w]] = c ? m[h] : null : v[d](s[w], m[h], a);
2380
2382
  }
@@ -2382,9 +2384,9 @@ function Ui(t) {
2382
2384
  }(t);
2383
2385
  };
2384
2386
  }
2385
- function Ge(t, e) {
2387
+ function Be(t, e) {
2386
2388
  if (re(t))
2387
- return e ? Ge(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
2389
+ return e ? Be(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
2388
2390
  return a.trim();
2389
2391
  });
2390
2392
  var n;
@@ -2393,31 +2395,31 @@ function Ge(t, e) {
2393
2395
  r[i] = t[i];
2394
2396
  return r;
2395
2397
  }
2396
- var o = Jr(t);
2398
+ var o = Hr(t);
2397
2399
  return e ? o.map(function(a) {
2398
- return re(a) ? Ge(a, !0) : a;
2400
+ return re(a) ? Be(a, !0) : a;
2399
2401
  }).flat() : o;
2400
2402
  }
2401
- function Zi(t, e) {
2403
+ function Ri(t, e) {
2402
2404
  var n;
2403
2405
  return function() {
2404
2406
  return t && (n = t.apply(e || this, arguments), t = null), n;
2405
2407
  };
2406
2408
  }
2407
- var ht = Ui("Event");
2408
- function Jn(t, e) {
2409
+ var ft = Zi("Event");
2410
+ function Bn(t, e) {
2409
2411
  return H && G(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), G(n) ? function() {
2410
2412
  n.apply(i, arguments), r.apply(i, arguments);
2411
2413
  } : r) : window[t] = e;
2412
2414
  var n, r, i;
2413
2415
  }
2414
- Jn.bind(null, "onerror");
2415
- Jn.bind(null, "onload");
2416
- var Hn = typeof window > "u", cn = "hidden";
2417
- function Ri(t) {
2418
- if (Hn)
2416
+ Bn.bind(null, "onerror");
2417
+ Bn.bind(null, "onload");
2418
+ var qn = typeof window > "u", hn = "hidden";
2419
+ function Wi(t) {
2420
+ if (qn)
2419
2421
  return !1;
2420
- var e = Wi(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2422
+ var e = Ki(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2421
2423
  return t(!!document[e]);
2422
2424
  }, i = function() {
2423
2425
  return document.addEventListener(n, r);
@@ -2426,15 +2428,15 @@ function Ri(t) {
2426
2428
  return document.removeEventListener(n, r), i;
2427
2429
  };
2428
2430
  }
2429
- function Wi() {
2431
+ function Ki() {
2430
2432
  var t = ["webkit", "moz", "ms", "o"];
2431
- return Hn || cn in document ? cn : t.reduce(function(e, n) {
2433
+ return qn || hn in document ? hn : t.reduce(function(e, n) {
2432
2434
  var r = n + "Hidden";
2433
2435
  return !e && r in document ? r : e;
2434
2436
  }, null);
2435
2437
  }
2436
- var Ki = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2437
- function Mi(t, e) {
2438
+ var Mi = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2439
+ function Xi(t, e) {
2438
2440
  e === void 0 && (e = {});
2439
2441
  var n = /* @__PURE__ */ function(a, s) {
2440
2442
  var f = this, m = !1;
@@ -2445,12 +2447,12 @@ function Mi(t, e) {
2445
2447
  };
2446
2448
  }(t, e.throttle || 1e4), r = [];
2447
2449
  function i() {
2448
- var a = Ri(function(s) {
2450
+ var a = Wi(function(s) {
2449
2451
  s || n({ type: "tabVisible" });
2450
2452
  });
2451
- return r = [a].concat(Ki.map(function(s) {
2452
- return ht(document, s, n);
2453
- })).concat(ht(window, "load", n)).concat(ht(window, "scroll", n, { capture: !0, passive: !0 })), o;
2453
+ return r = [a].concat(Mi.map(function(s) {
2454
+ return ft(document, s, n);
2455
+ })).concat(ft(window, "load", n)).concat(ft(window, "scroll", n, { capture: !0, passive: !0 })), o;
2454
2456
  }
2455
2457
  function o() {
2456
2458
  r.map(function(a) {
@@ -2461,16 +2463,16 @@ function Mi(t, e) {
2461
2463
  return o(), i;
2462
2464
  };
2463
2465
  }
2464
- function Xi(t) {
2466
+ function Vi(t) {
2465
2467
  var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, f = t.throttle, m = f === void 0 ? 2e3 : f, u = !1, c = !1, d = /* @__PURE__ */ new Date(), h = function() {
2466
2468
  return clearTimeout(e);
2467
2469
  };
2468
2470
  function v(y) {
2469
- h(), o && !u && o(xe(d), y), i && u && (u = !1, i(xe(n), y), d = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2470
- u = !0, r && (n = /* @__PURE__ */ new Date(), r(xe(d), y));
2471
+ h(), o && !u && o(je(d), y), i && u && (u = !1, i(je(n), y), d = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2472
+ u = !0, r && (n = /* @__PURE__ */ new Date(), r(je(d), y));
2471
2473
  }, s);
2472
2474
  }
2473
- var w = Mi(v, { throttle: m });
2475
+ var w = Xi(v, { throttle: m });
2474
2476
  return { disable: function() {
2475
2477
  c = !0, u = !1, h();
2476
2478
  var y = w();
@@ -2478,14 +2480,14 @@ function Xi(t) {
2478
2480
  return c = !1, d = /* @__PURE__ */ new Date(), v({ type: "load" }), y();
2479
2481
  };
2480
2482
  }, getStatus: function() {
2481
- return { isIdle: u, isDisabled: c, active: u ? 0 : xe(d, c), idle: u ? xe(n, c) : 0 };
2483
+ return { isIdle: u, isDisabled: c, active: u ? 0 : je(d, c), idle: u ? je(n, c) : 0 };
2482
2484
  } };
2483
2485
  }
2484
- function xe(t, e) {
2486
+ function je(t, e) {
2485
2487
  return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
2486
2488
  }
2487
- const un = 5e3;
2488
- class Vi {
2489
+ const fn = 5e3;
2490
+ class Fi {
2489
2491
  constructor(e) {
2490
2492
  Y(this, "element");
2491
2493
  Y(this, "isInViewport", !1);
@@ -2506,10 +2508,10 @@ class Vi {
2506
2508
  {
2507
2509
  threshold: 0
2508
2510
  }
2509
- ), this.observer.observe(this.element), Xi({
2511
+ ), this.observer.observe(this.element), Vi({
2510
2512
  onIdle: (n) => this.handleAwake(!1, n),
2511
2513
  onWakeUp: (n) => this.handleAwake(!0, n),
2512
- timeout: un
2514
+ timeout: fn
2513
2515
  });
2514
2516
  }
2515
2517
  /**
@@ -2528,7 +2530,7 @@ class Vi {
2528
2530
  ), this.isInViewport = e;
2529
2531
  }
2530
2532
  handleAwake(e, n) {
2531
- this.isAwake = e, this.lastEventAt = e ? Date.now() - n * un : Date.now(), this.isInViewport && this.trackAwake(e, n);
2533
+ this.isAwake = e, this.lastEventAt = e ? Date.now() - n * fn : Date.now(), this.isInViewport && this.trackAwake(e, n);
2532
2534
  }
2533
2535
  trackAwake(e, n) {
2534
2536
  !e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
@@ -2537,45 +2539,57 @@ class Vi {
2537
2539
  this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
2538
2540
  }
2539
2541
  }
2540
- let Yn = !1, Gn, ln, Be;
2541
- function Fi({
2542
+ const pn = "sesamy_session_id";
2543
+ function Ji() {
2544
+ let t = sessionStorage.getItem(pn);
2545
+ return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(pn, t)), t;
2546
+ }
2547
+ let Qn = !1, kt, mn, qe;
2548
+ function Hi({
2542
2549
  clientId: t,
2543
2550
  enabled: e = !0,
2544
- endpoint: n = Tr
2551
+ endpoint: n = Cr
2545
2552
  }) {
2546
- if (Gn = t, ln = e, Be = n, !ln)
2553
+ if (kt = t, mn = e, qe = n, !mn)
2547
2554
  return;
2548
- Ai();
2549
- const r = new Vi({
2555
+ Ui();
2556
+ const r = new Fi({
2550
2557
  element: document.body,
2551
2558
  viewCallback: () => {
2552
- Je.page();
2559
+ ae.page();
2553
2560
  },
2554
2561
  activeDurationCallback: (i, o) => {
2555
- Je.track("activeDuration", {
2562
+ ae.track("activeDuration", {
2556
2563
  duration: i,
2557
2564
  flushing: o
2558
2565
  });
2559
2566
  },
2560
2567
  idleDurationCallback: (i, o) => {
2561
- Je.track("idleDuration", {
2568
+ ae.track("idleDuration", {
2562
2569
  duration: i,
2563
2570
  flushing: o
2564
2571
  });
2565
2572
  }
2566
2573
  });
2567
- Hi(document.body, () => {
2574
+ Gi(document.body, () => {
2568
2575
  r.flush();
2576
+ }), window.addEventListener(he.AUTHENTICATED, async (i) => {
2577
+ const o = i;
2578
+ await ae.identify(o.detail.sub);
2579
+ }), window.addEventListener(he.LOGOUT, async () => {
2580
+ await ae.track("logout", {}), Ct.flush(), await ae.reset();
2569
2581
  });
2570
2582
  }
2571
- function Bn(t) {
2583
+ function er(t) {
2572
2584
  return JSON.stringify(
2573
2585
  t.map((e) => ({
2574
2586
  ...e,
2587
+ clientId: kt,
2588
+ requestId: Math.random().toString(36).slice(2, 9),
2589
+ sessionId: Ji(),
2575
2590
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2576
- originalTimestamp: (/* @__PURE__ */ new Date()).toISOString(),
2577
- version: Fn,
2578
- event: e.event || "page",
2591
+ version: Gn,
2592
+ event: e.event,
2579
2593
  context: {
2580
2594
  page: {
2581
2595
  url: window.location.hostname,
@@ -2585,18 +2599,18 @@ function Bn(t) {
2585
2599
  referrer: document.referrer
2586
2600
  },
2587
2601
  locale: navigator.language,
2588
- library: Vn,
2602
+ library: Yn,
2589
2603
  userAgent: navigator.userAgent,
2590
- clientId: Gn
2604
+ clientId: kt
2591
2605
  }
2592
2606
  }))
2593
2607
  );
2594
2608
  }
2595
- const qn = zi(
2609
+ const Ct = Ni(
2596
2610
  async (t) => {
2597
2611
  if (t.length > 0) {
2598
- const e = Bn(t);
2599
- Yn ? navigator.sendBeacon(Be, e) : (await fetch(Be, {
2612
+ const e = er(t);
2613
+ Qn ? navigator.sendBeacon(qe, e) : (await fetch(qe, {
2600
2614
  method: "POST",
2601
2615
  body: e,
2602
2616
  headers: {
@@ -2612,22 +2626,24 @@ const qn = zi(
2612
2626
  // 3s
2613
2627
  }
2614
2628
  );
2615
- function dn(t) {
2616
- if (t.properties.flushing) {
2617
- const e = { ...t };
2618
- delete e.properties.flushing, navigator.sendBeacon(Be, Bn([e]));
2619
- } else
2620
- qn.push(t);
2621
- }
2622
- const Je = $i({
2623
- app: Vn,
2624
- version: Fn,
2629
+ function pt(t) {
2630
+ var e;
2631
+ if (t.anonymousId)
2632
+ if ((e = t.properties) != null && e.flushing) {
2633
+ const n = { ...t };
2634
+ delete n.properties.flushing, navigator.sendBeacon(qe, er([n]));
2635
+ } else
2636
+ Ct.push(t);
2637
+ }
2638
+ const ae = zi({
2639
+ app: Yn,
2640
+ version: Gn,
2625
2641
  plugins: [
2626
2642
  {
2627
2643
  name: "custom-analytics-plugin",
2628
2644
  page: ({ payload: t }) => {
2629
2645
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
2630
- dn({
2646
+ pt({
2631
2647
  anonymousId: n,
2632
2648
  userId: r,
2633
2649
  properties: e,
@@ -2637,46 +2653,55 @@ const Je = $i({
2637
2653
  },
2638
2654
  track: ({ payload: t }) => {
2639
2655
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
2640
- dn({
2656
+ pt({
2641
2657
  anonymousId: n,
2642
2658
  userId: r,
2643
2659
  properties: e,
2644
2660
  event: i,
2645
2661
  type: "track"
2646
2662
  });
2663
+ },
2664
+ identify: ({ payload: t }) => {
2665
+ const { properties: e, anonymousId: n, userId: r } = t;
2666
+ pt({
2667
+ anonymousId: n,
2668
+ userId: r,
2669
+ properties: e,
2670
+ type: "identify"
2671
+ });
2647
2672
  }
2648
2673
  }
2649
2674
  ]
2650
2675
  });
2651
- function Ji() {
2652
- return Yn = !0, qn.flush();
2676
+ function Yi() {
2677
+ return Qn = !0, Ct.flush();
2653
2678
  }
2654
- const Qn = /* @__PURE__ */ new Map();
2655
- function Hi(t, e) {
2656
- Qn.set(t, e);
2679
+ const tr = /* @__PURE__ */ new Map();
2680
+ function Gi(t, e) {
2681
+ tr.set(t, e);
2657
2682
  }
2658
2683
  window.addEventListener("beforeunload", () => {
2659
- Qn.forEach((t, e) => {
2684
+ tr.forEach((t, e) => {
2660
2685
  t.bind(e)();
2661
- }), Ji();
2686
+ }), Yi();
2662
2687
  });
2663
- async function Yi(t) {
2664
- await Cr(t), Fi({
2688
+ async function Bi(t) {
2689
+ Hi({
2665
2690
  clientId: t.clientId,
2666
2691
  // The default client id can be overridden by the config
2667
2692
  ...t.analytics
2668
- }), Lr(t.namespace), rr();
2693
+ }), await $r(t), Dr(t.namespace), It(he.READY, {});
2669
2694
  }
2670
- const Xe = document.getElementById("sesamy-js");
2671
- if (Xe != null && Xe.textContent)
2695
+ const Fe = document.getElementById("sesamy-js");
2696
+ if (Fe != null && Fe.textContent)
2672
2697
  try {
2673
- const t = JSON.parse(Xe.textContent);
2674
- Yi(t);
2698
+ const t = JSON.parse(Fe.textContent);
2699
+ Bi(t);
2675
2700
  } catch (t) {
2676
2701
  console.error("Failed to parse config", t);
2677
2702
  }
2678
- const Gi = "/sesamy.png";
2679
- class Bi extends HTMLElement {
2703
+ const qi = "/sesamy.png";
2704
+ class Qi extends HTMLElement {
2680
2705
  constructor() {
2681
2706
  super();
2682
2707
  Y(this, "user");
@@ -2686,7 +2711,7 @@ class Bi extends HTMLElement {
2686
2711
  }
2687
2712
  async connectedCallback() {
2688
2713
  if (this.setupEventListeners(), !window.sesamy) {
2689
- window.addEventListener(wt.READY, () => this._handleProfile());
2714
+ window.addEventListener(he.READY, () => this._handleProfile());
2690
2715
  return;
2691
2716
  }
2692
2717
  this._handleProfile();
@@ -2695,7 +2720,7 @@ class Bi extends HTMLElement {
2695
2720
  this.innerHTML = `
2696
2721
  <div>
2697
2722
  <a href="https://docs.sesamy.com" target="_blank">
2698
- <img src="${Gi}" class="logo" alt="Vite logo" />
2723
+ <img src="${qi}" class="logo" alt="Vite logo" />
2699
2724
  </a>
2700
2725
  <h1>Sesamy JS</h1>
2701
2726
  <p class="read-the-docs">
@@ -2733,4 +2758,4 @@ class Bi extends HTMLElement {
2733
2758
  });
2734
2759
  }
2735
2760
  }
2736
- customElements.define("sesamy-app", Bi);
2761
+ customElements.define("sesamy-app", Qi);