@sesamy/sesamy-js 1.3.15 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var mr = Object.defineProperty;
2
- var gr = (t, e, n) => e in t ? mr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => (gr(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- function Et(t, e) {
1
+ var wr = Object.defineProperty;
2
+ var br = (t, e, n) => e in t ? wr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var B = (t, e, n) => (br(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ function nt(t, e) {
5
5
  const n = new CustomEvent(t, {
6
6
  detail: e,
7
7
  bubbles: !0,
@@ -24,10 +24,10 @@ var ce = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
24
24
  function Ot(t) {
25
25
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
26
26
  }
27
- function Pt(t, e) {
27
+ function Tt(t, e) {
28
28
  return t(e = { exports: {} }, e.exports), e.exports;
29
29
  }
30
- var ae = Pt(function(t, e) {
30
+ var ae = Tt(function(t, e) {
31
31
  Object.defineProperty(e, "__esModule", { value: !0 });
32
32
  var n = function() {
33
33
  function r() {
@@ -59,7 +59,7 @@ var ae = Pt(function(t, e) {
59
59
  };
60
60
  });
61
61
  Ot(ae);
62
- var yr = Ot(Pt(function(t, e) {
62
+ var kr = Ot(Tt(function(t, e) {
63
63
  var n = ce && ce.__awaiter || function(u, c, h, d) {
64
64
  return new (h || (h = Promise))(function(w, I) {
65
65
  function y(v) {
@@ -327,63 +327,63 @@ var yr = Ot(Pt(function(t, e) {
327
327
  }();
328
328
  e.default = f;
329
329
  }));
330
- const vr = { timeoutInSeconds: 60 }, Sn = { name: "auth0-spa-js", version: "2.1.3" }, En = () => Date.now();
331
- let V = class vt extends Error {
330
+ const Ir = { timeoutInSeconds: 60 }, Tn = { name: "auth0-spa-js", version: "2.1.3" }, Pn = () => Date.now();
331
+ let H = class wt extends Error {
332
332
  constructor(e, n) {
333
- super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, vt.prototype);
333
+ super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, wt.prototype);
334
334
  }
335
335
  static fromPayload({ error: e, error_description: n }) {
336
- return new vt(e, n);
336
+ return new wt(e, n);
337
337
  }
338
- }, wr = class On extends V {
338
+ }, _r = class jn extends H {
339
339
  constructor(e, n, r, i = null) {
340
- super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, On.prototype);
340
+ super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, jn.prototype);
341
341
  }
342
- }, wt = class Pn extends V {
342
+ }, bt = class xn extends H {
343
343
  constructor() {
344
- super("timeout", "Timeout"), Object.setPrototypeOf(this, Pn.prototype);
344
+ super("timeout", "Timeout"), Object.setPrototypeOf(this, xn.prototype);
345
345
  }
346
- }, br = class Tn extends wt {
346
+ }, Sr = class Cn extends bt {
347
347
  constructor(e) {
348
- super(), this.popup = e, Object.setPrototypeOf(this, Tn.prototype);
348
+ super(), this.popup = e, Object.setPrototypeOf(this, Cn.prototype);
349
349
  }
350
- }, kr = class jn extends V {
350
+ }, Er = class An extends H {
351
351
  constructor(e) {
352
- super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, jn.prototype);
352
+ super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, An.prototype);
353
353
  }
354
- }, Ir = class xn extends V {
354
+ }, Or = class $n extends H {
355
355
  constructor(e, n, r) {
356
- super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, xn.prototype);
356
+ super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, $n.prototype);
357
357
  }
358
- }, Cn = class $n extends V {
358
+ }, zn = class Nn extends H {
359
359
  constructor(e, n) {
360
- super("missing_refresh_token", `Missing Refresh Token (audience: '${Ut(e, ["default"])}', scope: '${Ut(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, $n.prototype);
360
+ super("missing_refresh_token", `Missing Refresh Token (audience: '${Zt(e, ["default"])}', scope: '${Zt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Nn.prototype);
361
361
  }
362
362
  };
363
- function Ut(t, e = []) {
363
+ function Zt(t, e = []) {
364
364
  return t && !e.includes(t) ? t : "";
365
365
  }
366
- const Ge = () => window.crypto, ct = () => {
366
+ const Ge = () => window.crypto, ut = () => {
367
367
  const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
368
368
  let e = "";
369
369
  return Array.from(Ge().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
370
- }, Lt = (t) => btoa(t), bt = (t) => {
370
+ }, Wt = (t) => btoa(t), kt = (t) => {
371
371
  var { clientId: e } = t, n = Q(t, ["clientId"]);
372
372
  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();
373
- }, Rt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), _r = async (t, e) => {
373
+ }, Mt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Tr = async (t, e) => {
374
374
  const n = await fetch(t, e);
375
375
  return { ok: n.ok, json: await n.json() };
376
- }, Sr = async (t, e, n) => {
376
+ }, Pr = async (t, e, n) => {
377
377
  const r = new AbortController();
378
378
  let i;
379
- return e.signal = r.signal, Promise.race([_r(t, e), new Promise((o, a) => {
379
+ return e.signal = r.signal, Promise.race([Tr(t, e), new Promise((o, a) => {
380
380
  i = setTimeout(() => {
381
381
  r.abort(), a(new Error("Timeout when executing 'fetch'"));
382
382
  }, n);
383
383
  })]).finally(() => {
384
384
  clearTimeout(i);
385
385
  });
386
- }, Er = async (t, e, n, r, i, o, a) => {
386
+ }, jr = async (t, e, n, r, i, o, a) => {
387
387
  return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, p = o, new Promise(function(f, u) {
388
388
  const c = new MessageChannel();
389
389
  c.port1.onmessage = function(h) {
@@ -391,34 +391,34 @@ const Ge = () => window.crypto, ct = () => {
391
391
  }, p.postMessage(s, [c.port2]);
392
392
  });
393
393
  var s, p;
394
- }, Or = async (t, e, n, r, i, o, a = 1e4) => i ? Er(t, e, n, r, a, i, o) : Sr(t, r, a);
395
- async function Pr(t, e) {
394
+ }, xr = async (t, e, n, r, i, o, a = 1e4) => i ? jr(t, e, n, r, a, i, o) : Pr(t, r, a);
395
+ async function Cr(t, e) {
396
396
  var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, p = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
397
- const f = s ? bt(p) : JSON.stringify(p);
397
+ const f = s ? kt(p) : JSON.stringify(p);
398
398
  return await async function(u, c, h, d, w, I, y) {
399
399
  let S, E = null;
400
400
  for (let _ = 0; _ < 3; _++)
401
401
  try {
402
- S = await Or(u, h, d, w, I, y, c), E = null;
402
+ S = await xr(u, h, d, w, I, y, c), E = null;
403
403
  break;
404
- } catch (A) {
405
- E = A;
404
+ } catch ($) {
405
+ E = $;
406
406
  }
407
407
  if (E)
408
408
  throw E;
409
409
  const v = S.json, { error: l, error_description: b } = v, j = Q(v, ["error", "error_description"]), { ok: k } = S;
410
410
  if (!k) {
411
411
  const _ = b || `HTTP error. Unable to fetch ${u}`;
412
- throw l === "mfa_required" ? new Ir(l, _, j.mfa_token) : l === "missing_refresh_token" ? new Cn(h, d) : new V(l || "request_error", _);
412
+ throw l === "mfa_required" ? new Or(l, _, j.mfa_token) : l === "missing_refresh_token" ? new zn(h, d) : new H(l || "request_error", _);
413
413
  }
414
414
  return j;
415
- }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: f, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || Sn)) } }, e, s);
415
+ }(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: f, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || Tn)) } }, e, s);
416
416
  }
417
417
  const Ke = (...t) => {
418
418
  return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
419
419
  var e;
420
420
  };
421
- let le = class kt {
421
+ let le = class It {
422
422
  constructor(e, n = "@@auth0spajs@@", r) {
423
423
  this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
424
424
  }
@@ -427,13 +427,13 @@ let le = class kt {
427
427
  }
428
428
  static fromKey(e) {
429
429
  const [n, r, i, o] = e.split("::");
430
- return new kt({ clientId: r, scope: o, audience: i }, n);
430
+ return new It({ clientId: r, scope: o, audience: i }, n);
431
431
  }
432
432
  static fromCacheEntry(e) {
433
433
  const { scope: n, audience: r, client_id: i } = e;
434
- return new kt({ scope: n, audience: r, clientId: i });
434
+ return new It({ scope: n, audience: r, clientId: i });
435
435
  }
436
- }, Tr = class {
436
+ }, Ar = class {
437
437
  set(e, n) {
438
438
  localStorage.setItem(e, JSON.stringify(n));
439
439
  }
@@ -452,7 +452,7 @@ let le = class kt {
452
452
  allKeys() {
453
453
  return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
454
454
  }
455
- }, An = class {
455
+ }, Dn = class {
456
456
  constructor() {
457
457
  this.enclosedCache = /* @__PURE__ */ function() {
458
458
  let e = {};
@@ -467,9 +467,9 @@ let le = class kt {
467
467
  }, allKeys: () => Object.keys(e) };
468
468
  }();
469
469
  }
470
- }, jr = class {
470
+ }, $r = class {
471
471
  constructor(e, n, r) {
472
- this.cache = e, this.keyManifest = n, this.nowProvider = r || En;
472
+ this.cache = e, this.keyManifest = n, this.nowProvider = r || Pn;
473
473
  }
474
474
  async setIdToken(e, n, r) {
475
475
  var i;
@@ -530,7 +530,7 @@ let le = class kt {
530
530
  return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && p;
531
531
  })[0];
532
532
  }
533
- }, xr = class {
533
+ }, zr = class {
534
534
  constructor(e, n, r) {
535
535
  this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
536
536
  }
@@ -544,17 +544,17 @@ let le = class kt {
544
544
  this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
545
545
  }
546
546
  };
547
- const Ae = (t) => typeof t == "number", Cr = ["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"], $r = (t) => {
547
+ const $e = (t) => typeof t == "number", Nr = ["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"], Dr = (t) => {
548
548
  if (!t.id_token)
549
549
  throw new Error("ID token is required but missing");
550
550
  const e = ((o) => {
551
551
  const a = o.split("."), [s, p, f] = a;
552
552
  if (a.length !== 3 || !s || !p || !f)
553
553
  throw new Error("ID token could not be decoded");
554
- const u = JSON.parse(Rt(p)), c = { __raw: o }, h = {};
554
+ const u = JSON.parse(Mt(p)), c = { __raw: o }, h = {};
555
555
  return Object.keys(u).forEach((d) => {
556
- c[d] = u[d], Cr.includes(d) || (h[d] = u[d]);
557
- }), { encoded: { header: s, payload: p, signature: f }, header: JSON.parse(Rt(s)), claims: c, user: h };
556
+ c[d] = u[d], Nr.includes(d) || (h[d] = u[d]);
557
+ }), { encoded: { header: s, payload: p, signature: f }, header: JSON.parse(Mt(s)), claims: c, user: h };
558
558
  })(t.id_token);
559
559
  if (!e.claims.iss)
560
560
  throw new Error("Issuer (iss) claim must be a string present in the ID token");
@@ -583,21 +583,21 @@ const Ae = (t) => typeof t == "number", Cr = ["iss", "aud", "exp", "nbf", "iat",
583
583
  if (e.claims.nonce !== t.nonce)
584
584
  throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
585
585
  }
586
- if (t.max_age && !Ae(e.claims.auth_time))
586
+ if (t.max_age && !$e(e.claims.auth_time))
587
587
  throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
588
- if (e.claims.exp == null || !Ae(e.claims.exp))
588
+ if (e.claims.exp == null || !$e(e.claims.exp))
589
589
  throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
590
- if (!Ae(e.claims.iat))
590
+ if (!$e(e.claims.iat))
591
591
  throw new Error("Issued At (iat) claim must be a number present in the ID token");
592
592
  const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
593
593
  if (i.setUTCSeconds(e.claims.exp + n), r > i)
594
594
  throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
595
- if (e.claims.nbf != null && Ae(e.claims.nbf)) {
595
+ if (e.claims.nbf != null && $e(e.claims.nbf)) {
596
596
  const o = /* @__PURE__ */ new Date(0);
597
597
  if (o.setUTCSeconds(e.claims.nbf - n), r < o)
598
598
  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}`);
599
599
  }
600
- if (e.claims.auth_time != null && Ae(e.claims.auth_time)) {
600
+ if (e.claims.auth_time != null && $e(e.claims.auth_time)) {
601
601
  const o = /* @__PURE__ */ new Date(0);
602
602
  if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
603
603
  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}`);
@@ -620,7 +620,7 @@ const Ae = (t) => typeof t == "number", Cr = ["iss", "aud", "exp", "nbf", "iat",
620
620
  }
621
621
  return e;
622
622
  };
623
- var de = Pt(function(t, e) {
623
+ var de = Tt(function(t, e) {
624
624
  var n = ce && ce.__assign || function() {
625
625
  return n = Object.assign || function(p) {
626
626
  for (var f, u = 1, c = arguments.length; u < c; u++)
@@ -668,26 +668,26 @@ var de = Pt(function(t, e) {
668
668
  };
669
669
  });
670
670
  Ot(de), de.encode, de.parse, de.getAll;
671
- var Ar = de.get, zn = de.set, Nn = de.remove;
672
- const ve = { get(t) {
673
- const e = Ar(t);
671
+ var Ur = de.get, Un = de.set, Ln = de.remove;
672
+ const we = { get(t) {
673
+ const e = Ur(t);
674
674
  if (e !== void 0)
675
675
  return JSON.parse(e);
676
676
  }, save(t, e, n) {
677
677
  let r = {};
678
- 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), zn(t, JSON.stringify(e), r);
678
+ 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), Un(t, JSON.stringify(e), r);
679
679
  }, remove(t, e) {
680
680
  let n = {};
681
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Nn(t, n);
682
- } }, zr = { get(t) {
683
- return ve.get(t) || ve.get(`_legacy_${t}`);
681
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), Ln(t, n);
682
+ } }, Lr = { get(t) {
683
+ return we.get(t) || we.get(`_legacy_${t}`);
684
684
  }, save(t, e, n) {
685
685
  let r = {};
686
- window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), zn(`_legacy_${t}`, JSON.stringify(e), r), ve.save(t, e, n);
686
+ window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Un(`_legacy_${t}`, JSON.stringify(e), r), we.save(t, e, n);
687
687
  }, remove(t, e) {
688
688
  let n = {};
689
- e != null && e.cookieDomain && (n.domain = e.cookieDomain), Nn(t, n), ve.remove(t, e), ve.remove(`_legacy_${t}`, e);
690
- } }, Nr = { get(t) {
689
+ e != null && e.cookieDomain && (n.domain = e.cookieDomain), Ln(t, n), we.remove(t, e), we.remove(`_legacy_${t}`, e);
690
+ } }, Rr = { get(t) {
691
691
  if (typeof sessionStorage > "u")
692
692
  return;
693
693
  const e = sessionStorage.getItem(t);
@@ -697,7 +697,7 @@ const ve = { get(t) {
697
697
  }, remove(t) {
698
698
  sessionStorage.removeItem(t);
699
699
  } };
700
- function Dr(t, e, n) {
700
+ function Zr(t, e, n) {
701
701
  var r = e === void 0 ? null : e, i = function(p, f) {
702
702
  var u = atob(p);
703
703
  if (f) {
@@ -710,11 +710,11 @@ function Dr(t, e, n) {
710
710
  `, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
711
711
  return URL.createObjectURL(s);
712
712
  }
713
- var Zt, Mt, Wt, ut, Ur = (Zt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Mt = null, Wt = !1, function(t) {
714
- return ut = ut || Dr(Zt, Mt, Wt), new Worker(ut, t);
713
+ var Kt, Jt, Xt, lt, Wr = (Kt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Jt = null, Xt = !1, function(t) {
714
+ return lt = lt || Zr(Kt, Jt, Xt), new Worker(lt, t);
715
715
  });
716
- const lt = {};
717
- let Lr = class {
716
+ const dt = {};
717
+ let Mr = class {
718
718
  constructor(e, n) {
719
719
  this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
720
720
  }
@@ -740,15 +740,15 @@ let Lr = class {
740
740
  return `@@auth0spajs@@::${e}`;
741
741
  }
742
742
  };
743
- const Rr = { memory: () => new An().enclosedCache, localstorage: () => new Tr() }, Kt = (t) => Rr[t], Jt = (t) => {
743
+ const Kr = { memory: () => new Dn().enclosedCache, localstorage: () => new Ar() }, Ft = (t) => Kr[t], Ht = (t) => {
744
744
  const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
745
745
  return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
746
- }, dt = new yr();
747
- let Zr = class {
746
+ }, ht = new kr();
747
+ let Jr = class {
748
748
  constructor(e) {
749
749
  let n, r;
750
- if (this.userCache = new An().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
751
- await dt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
750
+ if (this.userCache = new Dn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
751
+ await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
752
752
  }, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
753
753
  if (!Ge())
754
754
  throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
@@ -759,32 +759,32 @@ let Zr = class {
759
759
  })(), 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)
760
760
  r = e.cache;
761
761
  else {
762
- if (n = e.cacheLocation || "memory", !Kt(n))
762
+ if (n = e.cacheLocation || "memory", !Ft(n))
763
763
  throw new Error(`Invalid cache location "${n}"`);
764
- r = Kt(n)();
764
+ r = Ft(n)();
765
765
  }
766
- this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? ve : zr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
767
- const i = e.useCookiesForTransactions ? this.cookieStorage : Nr;
766
+ this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? we : Lr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
767
+ const i = e.useCookiesForTransactions ? this.cookieStorage : Rr;
768
768
  var o;
769
- this.scope = Ke("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new xr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || En, this.cacheManager = new jr(r, r.allKeys ? void 0 : new Lr(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new Ur());
769
+ this.scope = Ke("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new zr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Pn, this.cacheManager = new $r(r, r.allKeys ? void 0 : new Mr(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 Wr());
770
770
  }
771
771
  _url(e) {
772
- const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Sn)));
772
+ const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Tn)));
773
773
  return `${this.domainUrl}${e}&auth0Client=${n}`;
774
774
  }
775
775
  _authorizeUrl(e) {
776
- return this._url(`/authorize?${bt(e)}`);
776
+ return this._url(`/authorize?${kt(e)}`);
777
777
  }
778
778
  async _verifyIdToken(e, n, r) {
779
779
  const i = await this.nowProvider();
780
- return $r({ 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 });
780
+ return Dr({ 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 });
781
781
  var o;
782
782
  }
783
783
  _processOrgHint(e) {
784
784
  e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
785
785
  }
786
786
  async _prepareAuthorizeUrl(e, n, r) {
787
- const i = Lt(ct()), o = Lt(ct()), a = ct(), s = ((u) => {
787
+ const i = Wt(ut()), o = Wt(ut()), a = ut(), s = ((u) => {
788
788
  const c = new Uint8Array(u);
789
789
  return ((h) => {
790
790
  const d = { "+": "-", "/": "_", "=": "" };
@@ -805,20 +805,20 @@ let Zr = class {
805
805
  const o = await ((s) => new Promise((p, f) => {
806
806
  let u;
807
807
  const c = setInterval(() => {
808
- s.popup && s.popup.closed && (clearInterval(c), clearTimeout(h), window.removeEventListener("message", u, !1), f(new kr(s.popup)));
808
+ s.popup && s.popup.closed && (clearInterval(c), clearTimeout(h), window.removeEventListener("message", u, !1), f(new Er(s.popup)));
809
809
  }, 1e3), h = setTimeout(() => {
810
- clearInterval(c), f(new br(s.popup)), window.removeEventListener("message", u, !1);
810
+ clearInterval(c), f(new Sr(s.popup)), window.removeEventListener("message", u, !1);
811
811
  }, 1e3 * (s.timeoutInSeconds || 60));
812
812
  u = function(d) {
813
813
  if (d.data && d.data.type === "authorization_response") {
814
814
  if (clearTimeout(h), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
815
- return f(V.fromPayload(d.data.response));
815
+ return f(H.fromPayload(d.data.response));
816
816
  p(d.data.response);
817
817
  }
818
818
  }, window.addEventListener("message", u);
819
819
  }))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
820
820
  if (i.state !== o.state)
821
- throw new V("state_mismatch", "Invalid state");
821
+ throw new H("state_mismatch", "Invalid state");
822
822
  const a = ((r = e.authorizationParams) === null || r === void 0 ? void 0 : r.organization) || this.options.authorizationParams.organization;
823
823
  await this._requestToken({ audience: i.audience, scope: i.scope, code_verifier: i.code_verifier, grant_type: "authorization_code", code: o.code, redirect_uri: i.redirect_uri }, { nonceIn: i.nonce, organization: a });
824
824
  }
@@ -834,7 +834,7 @@ let Zr = class {
834
834
  }
835
835
  async loginWithRedirect(e = {}) {
836
836
  var n;
837
- const r = Jt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), p = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, f = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = f, c = Q(f, ["url"]);
837
+ const r = Ht(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), p = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, f = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = f, c = Q(f, ["url"]);
838
838
  this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), p && { organization: p }));
839
839
  const h = o ? `${u}#${o}` : u;
840
840
  i ? await i(h) : window.location.assign(h);
@@ -849,11 +849,11 @@ let Zr = class {
849
849
  return { state: h.get("state"), code: h.get("code") || void 0, error: h.get("error") || void 0, error_description: h.get("error_description") || void 0 };
850
850
  })(n.join("")), s = this.transactionManager.get();
851
851
  if (!s)
852
- throw new V("missing_transaction", "Invalid state");
852
+ throw new H("missing_transaction", "Invalid state");
853
853
  if (this.transactionManager.remove(), o)
854
- throw new wr(o, a || o, r, s.appState);
854
+ throw new _r(o, a || o, r, s.appState);
855
855
  if (!s.code_verifier || s.state && s.state !== r)
856
- throw new V("state_mismatch", "Invalid state");
856
+ throw new H("state_mismatch", "Invalid state");
857
857
  const p = s.organization, f = s.nonce, u = s.redirect_uri;
858
858
  return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: f, organization: p }), { appState: s.appState };
859
859
  }
@@ -871,10 +871,10 @@ let Zr = class {
871
871
  async getTokenSilently(e = {}) {
872
872
  var n;
873
873
  const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ke(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
874
- let s = lt[a];
874
+ let s = dt[a];
875
875
  return s || (s = o().finally(() => {
876
- delete lt[a], s = null;
877
- }), lt[a] = s), s;
876
+ delete dt[a], s = null;
877
+ }), dt[a] = s), s;
878
878
  })(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
879
879
  return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
880
880
  }
@@ -891,8 +891,8 @@ let Zr = class {
891
891
  if (await i())
892
892
  return !0;
893
893
  return !1;
894
- })(() => dt.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
895
- throw new wt();
894
+ })(() => ht.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
895
+ throw new bt();
896
896
  try {
897
897
  if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
898
898
  const f = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
@@ -902,14 +902,14 @@ let Zr = class {
902
902
  const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: p } = i;
903
903
  return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: p });
904
904
  } finally {
905
- await dt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
905
+ await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
906
906
  }
907
907
  }
908
908
  }
909
909
  async getTokenWithPopup(e = {}, n = {}) {
910
910
  var r;
911
911
  const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Ke(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
912
- return n = Object.assign(Object.assign({}, vr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new le({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
912
+ return n = Object.assign(Object.assign({}, Ir), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new le({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
913
913
  }
914
914
  async isAuthenticated() {
915
915
  return !!await this.getUser();
@@ -917,10 +917,10 @@ let Zr = class {
917
917
  _buildLogoutUrl(e) {
918
918
  e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
919
919
  const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
920
- return this._url(`/v2/logout?${bt(Object.assign({ clientId: e.clientId }, i))}`) + o;
920
+ return this._url(`/v2/logout?${kt(Object.assign({ clientId: e.clientId }, i))}`) + o;
921
921
  }
922
922
  async logout(e = {}) {
923
- const n = Jt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
923
+ const n = Ht(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
924
924
  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@@");
925
925
  const o = this._buildLogoutUrl(i);
926
926
  r ? await r(o) : r !== !1 && window.location.assign(o);
@@ -931,7 +931,7 @@ let Zr = class {
931
931
  const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: p, scope: f, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
932
932
  try {
933
933
  if (window.crossOriginIsolated)
934
- throw new V("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
934
+ throw new H("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
935
935
  const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((w, I, y = 60) => new Promise((S, E) => {
936
936
  const v = window.document.createElement("iframe");
937
937
  v.setAttribute("width", "0"), v.setAttribute("height", "0"), v.style.display = "none";
@@ -940,17 +940,17 @@ let Zr = class {
940
940
  };
941
941
  let b;
942
942
  const j = setTimeout(() => {
943
- E(new wt()), l();
943
+ E(new bt()), l();
944
944
  }, 1e3 * y);
945
945
  b = function(k) {
946
946
  if (k.origin != I || !k.data || k.data.type !== "authorization_response")
947
947
  return;
948
948
  const _ = k.source;
949
- _ && _.close(), k.data.response.error ? E(V.fromPayload(k.data.response)) : S(k.data.response), clearTimeout(j), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
949
+ _ && _.close(), k.data.response.error ? E(H.fromPayload(k.data.response)) : S(k.data.response), clearTimeout(j), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
950
950
  }, window.addEventListener("message", b, !1), window.document.body.appendChild(v), v.setAttribute("src", w);
951
951
  }))(i, this.domainUrl, c);
952
952
  if (o !== h.state)
953
- throw new V("state_mismatch", "Invalid state");
953
+ throw new H("state_mismatch", "Invalid state");
954
954
  const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: h.code, grant_type: "authorization_code", redirect_uri: p, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
955
955
  return Object.assign(Object.assign({}, d), { scope: f, oauthTokenScope: d.scope, audience: u });
956
956
  } catch (c) {
@@ -962,7 +962,7 @@ let Zr = class {
962
962
  if (!(n && n.refresh_token || this.worker)) {
963
963
  if (this.options.useRefreshTokensFallback)
964
964
  return await this._getTokenFromIFrame(e);
965
- throw new Cn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
965
+ throw new zn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
966
966
  }
967
967
  const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
968
968
  try {
@@ -990,68 +990,97 @@ let Zr = class {
990
990
  }
991
991
  }
992
992
  async _requestToken(e, n) {
993
- 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);
993
+ const { nonceIn: r, organization: i } = n || {}, o = await Cr(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);
994
994
  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 });
995
995
  }
996
996
  };
997
- async function Mr(t) {
998
- const e = new Zr(t);
997
+ async function Xr(t) {
998
+ const e = new Jr(t);
999
999
  return await e.checkSession(), e;
1000
1000
  }
1001
- const Dn = "sesamy.com", Wr = "https://logs.sesamy.com/events";
1002
- var Se = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.SOFT_PAYWALL = "sesamyJsSoftPaywall", t))(Se || {});
1003
- let F;
1004
- async function Kr(t) {
1005
- if (t.enabled !== !1 && (F = await Mr({
1006
- domain: t.endpoint || `token.${Dn}`,
1007
- clientId: t.clientId,
1008
- cacheLocation: "localstorage"
1001
+ const Rn = "sesamy.com", Fr = "https://logs.sesamy.com/events";
1002
+ var pe = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.SOFT_PAYWALL = "sesamyJsSoftPaywall", t))(pe || {});
1003
+ let V;
1004
+ const Pt = "sesamyAccessToken", jt = "sesamyExpiresAt";
1005
+ function xt() {
1006
+ const t = localStorage.getItem(jt);
1007
+ if (!(!t || parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
1008
+ return localStorage.getItem(Pt);
1009
+ }
1010
+ async function Hr(t) {
1011
+ if (t.enabled !== !1 && (V = await Xr({
1012
+ domain: t.endpoint || `token.${Rn}`,
1013
+ clientId: t.clientId
1009
1014
  }), window.location.search.includes("code=")))
1010
1015
  try {
1011
- await F.handleRedirectCallback();
1012
- const e = await F.getUser();
1013
- Et(Se.AUTHENTICATED, e);
1016
+ await V.handleRedirectCallback();
1017
+ const e = await V.getUser();
1018
+ nt(pe.AUTHENTICATED, e);
1014
1019
  const n = new URL(location.href), r = n.searchParams;
1015
1020
  r.delete("code"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
1016
- const i = await F.getTokenSilently();
1017
- localStorage.setItem("accessToken", i);
1018
1021
  } catch {
1019
1022
  }
1020
1023
  }
1021
- async function Jr() {
1022
- if (!F)
1024
+ async function Vr() {
1025
+ if (xt())
1026
+ return !0;
1027
+ if (!V)
1023
1028
  throw new Error("Auth0 client not initialized");
1024
- return F.isAuthenticated();
1029
+ return V.isAuthenticated();
1025
1030
  }
1026
- async function Xr() {
1027
- if (!F)
1031
+ async function Yr() {
1032
+ if (xt())
1033
+ return {
1034
+ sub: "local",
1035
+ name: "Local User"
1036
+ };
1037
+ if (!V)
1028
1038
  throw new Error("Auth0 client not initialized");
1029
- return F.getUser();
1039
+ return V.getUser();
1030
1040
  }
1031
- function Fr() {
1032
- if (!F)
1041
+ function Gr() {
1042
+ if (!V)
1033
1043
  throw new Error("Auth0 client not initialized");
1034
- return F.loginWithRedirect({
1044
+ return V.loginWithRedirect({
1035
1045
  authorizationParams: {
1036
1046
  redirect_uri: window.location.href
1037
1047
  }
1038
1048
  });
1039
1049
  }
1040
- async function Hr() {
1041
- if (!F)
1050
+ async function Br() {
1051
+ const t = xt();
1052
+ if (t)
1053
+ return t;
1054
+ if (!V)
1042
1055
  throw new Error("Auth0 client not initialized");
1043
- return F.getTokenSilently();
1056
+ return V.getTokenSilently();
1044
1057
  }
1045
- async function Vr() {
1046
- if (!F)
1058
+ async function qr() {
1059
+ if (localStorage.removeItem(Pt), localStorage.removeItem(jt), !V)
1047
1060
  throw new Error("Auth0 client not initialized");
1048
- return Et(Se.LOGOUT, {}), F.logout({
1061
+ return nt(pe.LOGOUT, {}), V.logout({
1049
1062
  logoutParams: {
1050
1063
  returnTo: window.location.href
1051
1064
  }
1052
1065
  });
1053
1066
  }
1054
- const Yr = (t, e) => e.skipDedupe || e.method !== "GET", Gr = (t, e) => e.method + "@" + t, Br = (t) => t.clone(), Xt = ({ skip: t = Yr, key: e = Gr, resolver: n = Br } = {}) => {
1067
+ function Qr(t) {
1068
+ const e = t.split(".");
1069
+ if (e.length !== 3)
1070
+ throw new Error("Invalid JWT token format.");
1071
+ const r = e[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
1072
+ atob(r).split("").map(function(o) {
1073
+ return "%" + ("00" + o.charCodeAt(0).toString(16)).slice(-2);
1074
+ }).join("")
1075
+ );
1076
+ return JSON.parse(i);
1077
+ }
1078
+ async function Zn(t, e) {
1079
+ localStorage.setItem(Pt, t), localStorage.setItem(jt, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
1080
+ const n = Qr(t);
1081
+ nt(pe.AUTHENTICATED, n);
1082
+ }
1083
+ const ei = (t, e) => e.skipDedupe || e.method !== "GET", ti = (t, e) => e.method + "@" + t, ni = (t) => t.clone(), Vt = ({ skip: t = ei, key: e = ti, resolver: n = ni } = {}) => {
1055
1084
  const r = /* @__PURE__ */ new Map();
1056
1085
  return (i) => (o, a) => {
1057
1086
  if (t(o, a))
@@ -1071,7 +1100,7 @@ const Yr = (t, e) => e.skipDedupe || e.method !== "GET", Gr = (t, e) => e.method
1071
1100
  return r.delete(s), Promise.reject(p);
1072
1101
  }
1073
1102
  };
1074
- }, qr = (t, e) => t * e, Qr = (t) => t && t.ok, Ft = ({ delayTimer: t = 500, delayRamp: e = qr, maxAttempts: n = 10, until: r = Qr, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (p) => (f, u) => {
1103
+ }, ri = (t, e) => t * e, ii = (t) => t && t.ok, Yt = ({ delayTimer: t = 500, delayRamp: e = ri, maxAttempts: n = 10, until: r = ii, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (p) => (f, u) => {
1075
1104
  let c = 0;
1076
1105
  if (s && s(f, u))
1077
1106
  return p(f, u);
@@ -1098,12 +1127,12 @@ const Yr = (t, e) => e.skipDedupe || e.method !== "GET", Gr = (t, e) => e.method
1098
1127
  throw d;
1099
1128
  return h(null, d);
1100
1129
  });
1101
- }, ei = "application/json", Un = "Content-Type", ye = Symbol(), Ln = Symbol();
1102
- function Ht(t = {}) {
1130
+ }, oi = "application/json", Wn = "Content-Type", ve = Symbol(), Mn = Symbol();
1131
+ function Gt(t = {}) {
1103
1132
  var e;
1104
- return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Un.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
1133
+ return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Wn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
1105
1134
  }
1106
- function Vt(t) {
1135
+ function Bt(t) {
1107
1136
  return /^application\/.*json.*/.test(t);
1108
1137
  }
1109
1138
  const he = function(t, e, n = !1) {
@@ -1132,28 +1161,28 @@ const he = function(t, e, n = !1) {
1132
1161
  return n && i ? new i(...r) : i;
1133
1162
  }
1134
1163
  };
1135
- function ti(t, e = !1) {
1164
+ function ai(t, e = !1) {
1136
1165
  Ee.options = e ? t : he(Ee.options, t);
1137
1166
  }
1138
- function ni(t, e = !1) {
1167
+ function si(t, e = !1) {
1139
1168
  Ee.polyfills = e ? t : he(Ee.polyfills, t);
1140
1169
  }
1141
- function ri(t) {
1170
+ function ci(t) {
1142
1171
  Ee.errorType = t;
1143
1172
  }
1144
- const ii = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1145
- class Rn extends Error {
1173
+ const ui = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1174
+ class Kn extends Error {
1146
1175
  }
1147
- const oi = (t) => {
1176
+ const li = (t) => {
1148
1177
  const e = /* @__PURE__ */ Object.create(null);
1149
1178
  t = t._addons.reduce((v, l) => l.beforeRequest && l.beforeRequest(v, t._options, e) || v, t);
1150
1179
  const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: p } = t, f = new Map(o), u = he(i.options, r);
1151
1180
  let c = n;
1152
- const h = ii(s)((v, l) => (c = v, i.polyfill("fetch")(v, l)))(n, u), d = new Error(), w = h.catch((v) => {
1153
- throw { [ye]: v };
1181
+ const h = ui(s)((v, l) => (c = v, i.polyfill("fetch")(v, l)))(n, u), d = new Error(), w = h.catch((v) => {
1182
+ throw { [ve]: v };
1154
1183
  }).then((v) => {
1155
1184
  if (!v.ok) {
1156
- const l = new Rn();
1185
+ const l = new Kn();
1157
1186
  if (l.cause = d, l.stack = l.stack + `
1158
1187
  CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1159
1188
  throw l;
@@ -1169,10 +1198,10 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1169
1198
  }
1170
1199
  return v;
1171
1200
  }), I = (v) => v.catch((l) => {
1172
- const b = l.hasOwnProperty(ye), j = b ? l[ye] : l, k = (j == null ? void 0 : j.status) && f.get(j.status) || f.get(j == null ? void 0 : j.name) || b && f.has(ye) && f.get(ye);
1201
+ const b = l.hasOwnProperty(ve), j = b ? l[ve] : l, k = (j == null ? void 0 : j.status) && f.get(j.status) || f.get(j == null ? void 0 : j.name) || b && f.has(ve) && f.get(ve);
1173
1202
  if (k)
1174
1203
  return k(j, t);
1175
- const _ = f.get(Ln);
1204
+ const _ = f.get(Mn);
1176
1205
  if (_)
1177
1206
  return _(j, t);
1178
1207
  throw j;
@@ -1208,14 +1237,14 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1208
1237
  return this.error(500, v);
1209
1238
  },
1210
1239
  fetchError(v) {
1211
- return this.error(ye, v);
1240
+ return this.error(ve, v);
1212
1241
  }
1213
1242
  }, E = p.reduce((v, l) => ({
1214
1243
  ...v,
1215
1244
  ...typeof l.resolver == "function" ? l.resolver(v) : l.resolver
1216
1245
  }), S);
1217
1246
  return a.reduce((v, l) => l(v, t), E);
1218
- }, ai = {
1247
+ }, di = {
1219
1248
  _url: "",
1220
1249
  _options: {},
1221
1250
  _config: Ee,
@@ -1265,7 +1294,7 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1265
1294
  return this.headers({ Accept: t });
1266
1295
  },
1267
1296
  content(t) {
1268
- return this.headers({ [Un]: t });
1297
+ return this.headers({ [Wn]: t });
1269
1298
  },
1270
1299
  auth(t) {
1271
1300
  return this.headers({ Authorization: t });
@@ -1275,7 +1304,7 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1275
1304
  return n.set(t, e), { ...this, _catchers: n };
1276
1305
  },
1277
1306
  catcherFallback(t) {
1278
- return this.catcher(Ln, t);
1307
+ return this.catcher(Mn, t);
1279
1308
  },
1280
1309
  resolve(t, e = !1) {
1281
1310
  return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
@@ -1294,8 +1323,8 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1294
1323
  },
1295
1324
  fetch(t = this._options.method, e = "", n = null) {
1296
1325
  let r = this.url(e).options({ method: t });
1297
- const i = Ht(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Vt(i));
1298
- return r = n ? o ? r.json(n, i) : r.body(n) : r, oi(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
1326
+ const i = Gt(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Bt(i));
1327
+ return r = n ? o ? r.json(n, i) : r.body(n) : r, li(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
1299
1328
  },
1300
1329
  get(t = "") {
1301
1330
  return this.fetch("GET", t);
@@ -1322,22 +1351,22 @@ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1322
1351
  return { ...this, _options: { ...this._options, body: t } };
1323
1352
  },
1324
1353
  json(t, e) {
1325
- const n = Ht(this._options.headers);
1326
- return this.content(e || Vt(n) && n || ei).body(JSON.stringify(t));
1354
+ const n = Gt(this._options.headers);
1355
+ return this.content(e || Bt(n) && n || oi).body(JSON.stringify(t));
1327
1356
  }
1328
1357
  };
1329
1358
  function oe(t = "", e = {}) {
1330
- return { ...ai, _url: t, _options: e };
1359
+ return { ...di, _url: t, _options: e };
1331
1360
  }
1332
1361
  oe.default = oe;
1333
- oe.options = ti;
1334
- oe.errorType = ri;
1335
- oe.polyfills = ni;
1336
- oe.WretchError = Rn;
1337
- function si(t) {
1338
- const e = t.endpoint || `https://api2.${Dn}`, n = (k = !0) => (_) => async (A, U) => {
1362
+ oe.options = ai;
1363
+ oe.errorType = ci;
1364
+ oe.polyfills = si;
1365
+ oe.WretchError = Kn;
1366
+ function hi(t) {
1367
+ const e = t.endpoint || `https://api2.${Rn}`, n = (k = !0) => (_) => async ($, U) => {
1339
1368
  let R = null;
1340
- if (R = await Hr(), !R && k)
1369
+ if (R = await Br(), !R && k)
1341
1370
  throw new Error("No access token available");
1342
1371
  const L = {
1343
1372
  ...U,
@@ -1346,20 +1375,20 @@ function si(t) {
1346
1375
  ...R ? { Authorization: `Bearer ${R}` } : {}
1347
1376
  }
1348
1377
  };
1349
- return _(A, L);
1350
- }, r = (k) => (_, A) => {
1378
+ return _($, L);
1379
+ }, r = (k) => (_, $) => {
1351
1380
  const U = localStorage.getItem("__anon_id"), R = btoa(`${U}:`), L = {
1352
- ...A,
1381
+ ...$,
1353
1382
  headers: {
1354
- ...A.headers,
1383
+ ...$.headers,
1355
1384
  Authorization: `Basic ${R}`
1356
1385
  }
1357
1386
  };
1358
1387
  return k(_, L);
1359
1388
  }, i = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
1360
1389
  n(),
1361
- Xt(),
1362
- Ft({
1390
+ Vt(),
1391
+ Yt({
1363
1392
  delayTimer: 1e3,
1364
1393
  delayRamp: (k, _) => k * _,
1365
1394
  maxAttempts: 3,
@@ -1369,8 +1398,8 @@ function si(t) {
1369
1398
  ]), o = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
1370
1399
  n(!1),
1371
1400
  r,
1372
- Xt(),
1373
- Ft({
1401
+ Vt(),
1402
+ Yt({
1374
1403
  delayTimer: 1e3,
1375
1404
  delayRamp: (k, _) => k * _,
1376
1405
  maxAttempts: 3,
@@ -1383,21 +1412,21 @@ function si(t) {
1383
1412
  }
1384
1413
  async function s(k) {
1385
1414
  const _ = await i.get("/entitlements").json();
1386
- return _ == null ? void 0 : _.find((A) => A.id === k);
1415
+ return _ == null ? void 0 : _.find(($) => $.id === k);
1387
1416
  }
1388
1417
  async function p() {
1389
1418
  return i.get("/contracts").json();
1390
1419
  }
1391
1420
  async function f(k) {
1392
1421
  const _ = await i.get("/contracts").json();
1393
- return _ == null ? void 0 : _.find((A) => A.id === k);
1422
+ return _ == null ? void 0 : _.find(($) => $.id === k);
1394
1423
  }
1395
1424
  async function u() {
1396
1425
  return i.get("/bills").json();
1397
1426
  }
1398
1427
  async function c(k) {
1399
1428
  const _ = await i.get("/bills").json();
1400
- return _ == null ? void 0 : _.find((A) => A.id === k);
1429
+ return _ == null ? void 0 : _.find(($) => $.id === k);
1401
1430
  }
1402
1431
  async function h(k, _) {
1403
1432
  return await i.url(`/user-metadata/${k}`).put(_).json();
@@ -1452,8 +1481,8 @@ function si(t) {
1452
1481
  pushTally: j
1453
1482
  };
1454
1483
  }
1455
- const Zn = "@sesamy/sesamy-js", Tt = "1.3.2";
1456
- function ci(t) {
1484
+ const Jn = "@sesamy/sesamy-js", Ct = "1.3.2";
1485
+ function fi(t) {
1457
1486
  const {
1458
1487
  getEntitlement: e,
1459
1488
  getEntitlements: n,
@@ -1472,12 +1501,13 @@ function ci(t) {
1472
1501
  getTallies: I,
1473
1502
  pushTally: y,
1474
1503
  deleteTally: S
1475
- } = si(t), E = {
1504
+ } = hi(t), E = {
1476
1505
  auth: {
1477
- getUser: Xr,
1478
- isAuthenticated: Jr,
1479
- loginWithRedirect: Fr,
1480
- logout: Vr
1506
+ getUser: Yr,
1507
+ isAuthenticated: Vr,
1508
+ loginWithRedirect: Gr,
1509
+ logout: qr,
1510
+ setToken: Zn
1481
1511
  },
1482
1512
  tags: {
1483
1513
  list: s,
@@ -1508,74 +1538,74 @@ function ci(t) {
1508
1538
  push: y,
1509
1539
  delete: S
1510
1540
  },
1511
- getVersion: ui
1541
+ getVersion: pi
1512
1542
  };
1513
1543
  return t.namespace && (window[t.namespace] = E), E;
1514
1544
  }
1515
- function ui() {
1516
- return Tt;
1545
+ function pi() {
1546
+ return Ct;
1517
1547
  }
1518
- function Yt(t, e, n, r, i) {
1548
+ function qt(t, e, n, r, i) {
1519
1549
  for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
1520
1550
  t = t ? t[e[r]] : i;
1521
1551
  return t === i ? n : t;
1522
1552
  }
1523
- var Je = "undefined", Gt = "object", li = function() {
1524
- }, Mn = "any", Wn = "*", pe = "__", qe = typeof process < "u" ? process : {};
1553
+ var Je = "undefined", Qt = "object", mi = function() {
1554
+ }, Xn = "any", Fn = "*", me = "__", qe = typeof process < "u" ? process : {};
1525
1555
  qe.env && qe.env.NODE_ENV;
1526
1556
  var Y = typeof document < "u";
1527
1557
  qe.versions != null && qe.versions.node != null;
1528
1558
  typeof Deno < "u" && Deno.core;
1529
1559
  Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
1530
- function Kn(t, e) {
1560
+ function Hn(t, e) {
1531
1561
  return e.charAt(0)[t]() + e.slice(1);
1532
1562
  }
1533
- var di = Kn.bind(null, "toUpperCase"), hi = Kn.bind(null, "toLowerCase");
1534
- function fi(t) {
1535
- return Jn(t) ? di("null") : typeof t == "object" ? yi(t) : Object.prototype.toString.call(t).slice(8, -1);
1563
+ var gi = Hn.bind(null, "toUpperCase"), yi = Hn.bind(null, "toLowerCase");
1564
+ function vi(t) {
1565
+ return Vn(t) ? gi("null") : typeof t == "object" ? Ii(t) : Object.prototype.toString.call(t).slice(8, -1);
1536
1566
  }
1537
1567
  function Qe(t, e) {
1538
1568
  e === void 0 && (e = !0);
1539
- var n = fi(t);
1540
- return e ? hi(n) : n;
1569
+ var n = vi(t);
1570
+ return e ? yi(n) : n;
1541
1571
  }
1542
- function Me(t, e) {
1572
+ function We(t, e) {
1543
1573
  return typeof e === t;
1544
1574
  }
1545
- var G = Me.bind(null, "function"), re = Me.bind(null, "string"), we = Me.bind(null, "undefined"), pi = Me.bind(null, "boolean");
1546
- Me.bind(null, "symbol");
1547
- function Jn(t) {
1575
+ var G = We.bind(null, "function"), re = We.bind(null, "string"), be = We.bind(null, "undefined"), wi = We.bind(null, "boolean");
1576
+ We.bind(null, "symbol");
1577
+ function Vn(t) {
1548
1578
  return t === null;
1549
1579
  }
1550
- function mi(t) {
1580
+ function bi(t) {
1551
1581
  return Qe(t) === "number" && !isNaN(t);
1552
1582
  }
1553
- function Xn(t) {
1583
+ function Yn(t) {
1554
1584
  return Qe(t) === "array";
1555
1585
  }
1556
1586
  function X(t) {
1557
- if (!gi(t))
1587
+ if (!ki(t))
1558
1588
  return !1;
1559
1589
  for (var e = t; Object.getPrototypeOf(e) !== null; )
1560
1590
  e = Object.getPrototypeOf(e);
1561
1591
  return Object.getPrototypeOf(t) === e;
1562
1592
  }
1563
- function gi(t) {
1593
+ function ki(t) {
1564
1594
  return t && (typeof t == "object" || t !== null);
1565
1595
  }
1566
- function yi(t) {
1596
+ function Ii(t) {
1567
1597
  return G(t.constructor) ? t.constructor.name : null;
1568
1598
  }
1569
- function vi(t) {
1570
- return t instanceof Error || re(t.message) && t.constructor && mi(t.constructor.stackTraceLimit);
1599
+ function _i(t) {
1600
+ return t instanceof Error || re(t.message) && t.constructor && bi(t.constructor.stackTraceLimit);
1571
1601
  }
1572
- function Fn(t, e) {
1573
- if (typeof e != "object" || Jn(e))
1602
+ function Gn(t, e) {
1603
+ if (typeof e != "object" || Vn(e))
1574
1604
  return !1;
1575
1605
  if (e instanceof t)
1576
1606
  return !0;
1577
1607
  var n = Qe(new t(""));
1578
- if (vi(e))
1608
+ if (_i(e))
1579
1609
  for (; e; ) {
1580
1610
  if (Qe(e) === n)
1581
1611
  return !0;
@@ -1583,56 +1613,56 @@ function Fn(t, e) {
1583
1613
  }
1584
1614
  return !1;
1585
1615
  }
1586
- Fn.bind(null, TypeError);
1587
- Fn.bind(null, SyntaxError);
1588
- function nt(t, e) {
1616
+ Gn.bind(null, TypeError);
1617
+ Gn.bind(null, SyntaxError);
1618
+ function rt(t, e) {
1589
1619
  var n = t instanceof Element || t instanceof HTMLDocument;
1590
- return n && e ? wi(t, e) : n;
1620
+ return n && e ? Si(t, e) : n;
1591
1621
  }
1592
- function wi(t, e) {
1622
+ function Si(t, e) {
1593
1623
  return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
1594
1624
  }
1595
- function rt(t) {
1625
+ function it(t) {
1596
1626
  var e = [].slice.call(arguments, 1);
1597
1627
  return function() {
1598
1628
  return t.apply(void 0, [].slice.call(arguments).concat(e));
1599
1629
  };
1600
1630
  }
1601
- rt(nt, "form");
1602
- rt(nt, "button");
1603
- rt(nt, "input");
1604
- rt(nt, "select");
1605
- function bi(t) {
1606
- return t ? Xn(t) ? t : [t] : [];
1631
+ it(rt, "form");
1632
+ it(rt, "button");
1633
+ it(rt, "input");
1634
+ it(rt, "select");
1635
+ function Ei(t) {
1636
+ return t ? Yn(t) ? t : [t] : [];
1607
1637
  }
1608
- function Bt(t) {
1638
+ function en(t) {
1609
1639
  try {
1610
1640
  return decodeURIComponent(t.replace(/\+/g, " "));
1611
1641
  } catch {
1612
1642
  return null;
1613
1643
  }
1614
1644
  }
1615
- function ki() {
1645
+ function Oi() {
1616
1646
  if (Y) {
1617
1647
  var t = navigator, e = t.languages;
1618
1648
  return t.userLanguage || (e && e.length ? e[0] : t.language);
1619
1649
  }
1620
1650
  }
1621
- function Ii() {
1651
+ function Ti() {
1622
1652
  try {
1623
1653
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
1624
1654
  } catch {
1625
1655
  }
1626
1656
  }
1627
- function _i(t) {
1657
+ function Pi(t) {
1628
1658
  return function(e) {
1629
1659
  for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
1630
- var o = Bt(n[1]), a = Bt(n[2]);
1660
+ var o = en(n[1]), a = en(n[2]);
1631
1661
  o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
1632
1662
  }
1633
1663
  for (var s in r) {
1634
1664
  var p = s.split("[");
1635
- p.length > 1 && (Si(r, p.map(function(f) {
1665
+ p.length > 1 && (ji(r, p.map(function(f) {
1636
1666
  return f.replace(/[?[\]\\ ]/g, "");
1637
1667
  }), r[s]), delete r[s]);
1638
1668
  }
@@ -1645,7 +1675,7 @@ function _i(t) {
1645
1675
  return Y && window.location.search.substring(1);
1646
1676
  }(t));
1647
1677
  }
1648
- function Si(t, e, n) {
1678
+ function ji(t, e, n) {
1649
1679
  for (var r = e.length - 1, i = 0; i < r; ++i) {
1650
1680
  var o = e[i];
1651
1681
  if (o === "__proto__" || o === "constructor")
@@ -1654,27 +1684,27 @@ function Si(t, e, n) {
1654
1684
  }
1655
1685
  t[e[r]] = n;
1656
1686
  }
1657
- function it() {
1687
+ function ot() {
1658
1688
  for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
1659
1689
  var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
1660
1690
  t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
1661
1691
  }
1662
1692
  return t;
1663
1693
  }
1664
- var De = "global", Oe = pe + "global" + pe, Pe = typeof self === Gt && self.self === self && self || typeof global === Gt && global.global === global && global || void 0;
1665
- function me(t) {
1666
- return Pe[Oe][t];
1694
+ var De = "global", Oe = me + "global" + me, Te = typeof self === Qt && self.self === self && self || typeof global === Qt && global.global === global && global || void 0;
1695
+ function ge(t) {
1696
+ return Te[Oe][t];
1667
1697
  }
1668
- function ge(t, e) {
1669
- return Pe[Oe][t] = e;
1698
+ function ye(t, e) {
1699
+ return Te[Oe][t] = e;
1670
1700
  }
1671
1701
  function je(t) {
1672
- delete Pe[Oe][t];
1702
+ delete Te[Oe][t];
1673
1703
  }
1674
1704
  function xe(t, e, n) {
1675
1705
  var r;
1676
1706
  try {
1677
- if (jt(t)) {
1707
+ if (At(t)) {
1678
1708
  var i = window[t];
1679
1709
  r = i[e].bind(i);
1680
1710
  }
@@ -1682,9 +1712,9 @@ function xe(t, e, n) {
1682
1712
  }
1683
1713
  return r || n;
1684
1714
  }
1685
- Pe[Oe] || (Pe[Oe] = {});
1715
+ Te[Oe] || (Te[Oe] = {});
1686
1716
  var Xe = {};
1687
- function jt(t) {
1717
+ function At(t) {
1688
1718
  if (typeof Xe[t] !== Je)
1689
1719
  return Xe[t];
1690
1720
  try {
@@ -1695,25 +1725,25 @@ function jt(t) {
1695
1725
  }
1696
1726
  return Xe[t] = !0;
1697
1727
  }
1698
- function T() {
1699
- return T = Object.assign || function(t) {
1728
+ function P() {
1729
+ return P = Object.assign || function(t) {
1700
1730
  for (var e = 1; e < arguments.length; e++) {
1701
1731
  var n = arguments[e];
1702
1732
  for (var r in n)
1703
1733
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
1704
1734
  }
1705
1735
  return t;
1706
- }, T.apply(this, arguments);
1736
+ }, P.apply(this, arguments);
1707
1737
  }
1708
- var ne = "function", ee = "undefined", Ei = "@@redux/" + Math.random().toString(36), qt = /* @__PURE__ */ function() {
1738
+ var ne = "function", ee = "undefined", xi = "@@redux/" + Math.random().toString(36), tn = /* @__PURE__ */ function() {
1709
1739
  return typeof Symbol === ne && Symbol.observable || "@@observable";
1710
1740
  }(), Fe = " != " + ne;
1711
- function Hn(t, e, n) {
1741
+ function Bn(t, e, n) {
1712
1742
  var r;
1713
1743
  if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
1714
1744
  if (typeof n !== ne)
1715
1745
  throw new Error("enhancer" + Fe);
1716
- return n(Hn)(t, e);
1746
+ return n(Bn)(t, e);
1717
1747
  }
1718
1748
  if (typeof t !== ne)
1719
1749
  throw new Error("reducer" + Fe);
@@ -1756,7 +1786,7 @@ function Hn(t, e, n) {
1756
1786
  if (typeof d !== ne)
1757
1787
  throw new Error("next reducer" + Fe);
1758
1788
  i = d, h({ type: "@@redux/INIT" });
1759
- } })[qt] = function() {
1789
+ } })[tn] = function() {
1760
1790
  var d, w = c;
1761
1791
  return (d = { subscribe: function(I) {
1762
1792
  if (typeof I != "object")
@@ -1765,16 +1795,16 @@ function Hn(t, e, n) {
1765
1795
  I.next && I.next(u());
1766
1796
  }
1767
1797
  return y(), { unsubscribe: w(y) };
1768
- } })[qt] = function() {
1798
+ } })[tn] = function() {
1769
1799
  return this;
1770
1800
  }, d;
1771
1801
  }, r;
1772
1802
  }
1773
- function Oi(t, e) {
1803
+ function Ci(t, e) {
1774
1804
  var n = e && e.type;
1775
1805
  return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
1776
1806
  }
1777
- function Te() {
1807
+ function Pe() {
1778
1808
  var t = [].slice.call(arguments);
1779
1809
  return t.length === 0 ? function(e) {
1780
1810
  return e;
@@ -1784,7 +1814,7 @@ function Te() {
1784
1814
  };
1785
1815
  });
1786
1816
  }
1787
- function Pi() {
1817
+ function Ai() {
1788
1818
  var t = arguments;
1789
1819
  return function(e) {
1790
1820
  return function(n, r, i) {
@@ -1793,39 +1823,39 @@ function Pi() {
1793
1823
  } };
1794
1824
  return o = [].slice.call(t).map(function(f) {
1795
1825
  return f(p);
1796
- }), T({}, a, { dispatch: s = Te.apply(void 0, o)(a.dispatch) });
1826
+ }), P({}, a, { dispatch: s = Pe.apply(void 0, o)(a.dispatch) });
1797
1827
  };
1798
1828
  };
1799
1829
  }
1800
- var ie = pe + "anon_id", fe = pe + "user_id", ke = pe + "user_traits", te = "userId", be = "anonymousId", Be = ["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"], It = ["name", "EVENTS", "config", "loaded"], P = Be.reduce(function(t, e) {
1830
+ var ie = me + "anon_id", fe = me + "user_id", Ie = me + "user_traits", te = "userId", ke = "anonymousId", Be = ["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"], _t = ["name", "EVENTS", "config", "loaded"], T = Be.reduce(function(t, e) {
1801
1831
  return t[e] = e, t;
1802
1832
  }, { registerPluginType: function(t) {
1803
1833
  return "registerPlugin:" + t;
1804
1834
  }, pluginReadyType: function(t) {
1805
1835
  return "ready:" + t;
1806
- } }), Qt = /^utm_/, en = /^an_prop_/, tn = /^an_trait_/;
1807
- function Ti(t) {
1836
+ } }), nn = /^utm_/, rn = /^an_prop_/, on = /^an_trait_/;
1837
+ function $i(t) {
1808
1838
  var e = t.storage.setItem;
1809
1839
  return function(n) {
1810
1840
  return function(r) {
1811
1841
  return function(i) {
1812
- if (i.type === P.bootstrap) {
1842
+ if (i.type === T.bootstrap) {
1813
1843
  var o = i.params, a = i.user, s = i.persistedUser, p = i.initialUser, f = s.userId === a.userId;
1814
- s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), f || e(fe, a.userId), p.traits && e(ke, T({}, f && s.traits ? s.traits : {}, p.traits));
1844
+ s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), f || e(fe, a.userId), p.traits && e(Ie, P({}, f && s.traits ? s.traits : {}, p.traits));
1815
1845
  var u = Object.keys(i.params);
1816
1846
  if (u.length) {
1817
1847
  var c = o.an_uid, h = o.an_event, d = u.reduce(function(w, I) {
1818
- if (I.match(Qt) || I.match(/^(d|g)clid/)) {
1819
- var y = I.replace(Qt, "");
1848
+ if (I.match(nn) || I.match(/^(d|g)clid/)) {
1849
+ var y = I.replace(nn, "");
1820
1850
  w.campaign[y === "campaign" ? "name" : y] = o[I];
1821
1851
  }
1822
- return I.match(en) && (w.props[I.replace(en, "")] = o[I]), I.match(tn) && (w.traits[I.replace(tn, "")] = o[I]), w;
1852
+ return I.match(rn) && (w.props[I.replace(rn, "")] = o[I]), I.match(on) && (w.traits[I.replace(on, "")] = o[I]), w;
1823
1853
  }, { campaign: {}, props: {}, traits: {} });
1824
- n.dispatch(T({ type: P.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1854
+ n.dispatch(P({ type: T.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1825
1855
  return t.identify(c, d.traits);
1826
1856
  }, 0), h && setTimeout(function() {
1827
1857
  return t.track(h, d.props);
1828
- }, 0), Object.keys(d.campaign).length && n.dispatch({ type: P.campaign, campaign: d.campaign });
1858
+ }, 0), Object.keys(d.campaign).length && n.dispatch({ type: T.campaign, campaign: d.campaign });
1829
1859
  }
1830
1860
  }
1831
1861
  return r(i);
@@ -1833,19 +1863,19 @@ function Ti(t) {
1833
1863
  };
1834
1864
  };
1835
1865
  }
1836
- function ji(t) {
1866
+ function zi(t) {
1837
1867
  return function(e, n) {
1838
- if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === P.setItemEnd) {
1868
+ if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === T.setItemEnd) {
1839
1869
  if (n.key === ie)
1840
- return T({}, e, { anonymousId: n.value });
1870
+ return P({}, e, { anonymousId: n.value });
1841
1871
  if (n.key === fe)
1842
- return T({}, e, { userId: n.value });
1872
+ return P({}, e, { userId: n.value });
1843
1873
  }
1844
1874
  switch (n.type) {
1845
- case P.identify:
1846
- return Object.assign({}, e, { userId: n.userId, traits: T({}, e.traits, n.traits) });
1847
- case P.reset:
1848
- return [fe, ie, ke].forEach(function(r) {
1875
+ case T.identify:
1876
+ return Object.assign({}, e, { userId: n.userId, traits: P({}, e.traits, n.traits) });
1877
+ case T.reset:
1878
+ return [fe, ie, Ie].forEach(function(r) {
1849
1879
  t.removeItem(r);
1850
1880
  }), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
1851
1881
  default:
@@ -1853,26 +1883,26 @@ function ji(t) {
1853
1883
  }
1854
1884
  };
1855
1885
  }
1856
- function nn(t) {
1857
- return { userId: t.getItem(fe), anonymousId: t.getItem(ie), traits: t.getItem(ke) };
1886
+ function an(t) {
1887
+ return { userId: t.getItem(fe), anonymousId: t.getItem(ie), traits: t.getItem(Ie) };
1858
1888
  }
1859
- var _t = function(t) {
1860
- return pe + "TEMP" + pe + t;
1889
+ var St = function(t) {
1890
+ return me + "TEMP" + me + t;
1861
1891
  };
1862
- function xi(t) {
1892
+ function Ni(t) {
1863
1893
  var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
1864
1894
  return function(o) {
1865
1895
  return function(a) {
1866
1896
  return function(s) {
1867
1897
  var p = s.userId, f = s.traits, u = s.options;
1868
- if (s.type === P.reset && ([fe, ke, ie].forEach(function(d) {
1898
+ if (s.type === T.reset && ([fe, Ie, ie].forEach(function(d) {
1869
1899
  r(d);
1870
- }), [te, be, "traits"].forEach(function(d) {
1871
- je(_t(d));
1872
- })), s.type === P.identify) {
1873
- i(ie) || n(ie, it());
1874
- var c = i(fe), h = i(ke) || {};
1875
- c && c !== p && o.dispatch({ type: P.userIdChanged, old: { userId: c, traits: h }, new: { userId: p, traits: f }, options: u }), p && n(fe, p), f && n(ke, T({}, h, f));
1900
+ }), [te, ke, "traits"].forEach(function(d) {
1901
+ je(St(d));
1902
+ })), s.type === T.identify) {
1903
+ i(ie) || n(ie, ot());
1904
+ var c = i(fe), h = i(Ie) || {};
1905
+ c && c !== p && o.dispatch({ type: T.userIdChanged, old: { userId: c, traits: h }, new: { userId: p, traits: f }, options: u }), p && n(fe, p), f && n(Ie, P({}, h, f));
1876
1906
  }
1877
1907
  return a(s);
1878
1908
  };
@@ -1880,22 +1910,22 @@ function xi(t) {
1880
1910
  };
1881
1911
  }
1882
1912
  var Ne = {};
1883
- function rn(t, e) {
1913
+ function sn(t, e) {
1884
1914
  Ne[t] && G(Ne[t]) && (Ne[t](e), delete Ne[t]);
1885
1915
  }
1886
- function Vn(t, e, n) {
1916
+ function qn(t, e, n) {
1887
1917
  return new Promise(function(r, i) {
1888
- return e() ? r(t) : n < 1 ? i(T({}, t, { queue: !0 })) : new Promise(function(o) {
1918
+ return e() ? r(t) : n < 1 ? i(P({}, t, { queue: !0 })) : new Promise(function(o) {
1889
1919
  return setTimeout(o, 10);
1890
1920
  }).then(function(o) {
1891
- return Vn(t, e, n - 10).then(r, i);
1921
+ return qn(t, e, n - 10).then(r, i);
1892
1922
  });
1893
1923
  });
1894
1924
  }
1895
- function Ci(t) {
1925
+ function Di(t) {
1896
1926
  return { abort: t };
1897
1927
  }
1898
- function Yn(t, e, n) {
1928
+ function Qn(t, e, n) {
1899
1929
  var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, p = o.user;
1900
1930
  if (!o.context.offline && s && s.actions && s.actions.length) {
1901
1931
  var f = s.actions.reduce(function(c, h, d) {
@@ -1906,15 +1936,15 @@ function Yn(t, e, n) {
1906
1936
  var h = s.actions[c], d = h.plugin, w = h.payload.type, I = i[d][w];
1907
1937
  if (I && G(I)) {
1908
1938
  var y, S = function(l, b) {
1909
- return l === void 0 && (l = {}), b === void 0 && (b = {}), [te, be].reduce(function(j, k) {
1939
+ return l === void 0 && (l = {}), b === void 0 && (b = {}), [te, ke].reduce(function(j, k) {
1910
1940
  return l.hasOwnProperty(k) && b[k] && b[k] !== l[k] && (j[k] = b[k]), j;
1911
1941
  }, l);
1912
1942
  }(h.payload, p), E = r[S.meta.rid];
1913
- if (!E && (y = I({ payload: S, config: a[d].config, instance: n, abort: Ci })) && X(y) && y.abort)
1943
+ if (!E && (y = I({ payload: S, config: a[d].config, instance: n, abort: Di })) && X(y) && y.abort)
1914
1944
  return void (r[S.meta.rid] = !0);
1915
1945
  if (!E) {
1916
1946
  var v = w + ":" + d;
1917
- t.dispatch(T({}, S, { type: v, _: { called: v, from: "queueDrain" } }));
1947
+ t.dispatch(P({}, S, { type: v, _: { called: v, from: "queueDrain" } }));
1918
1948
  }
1919
1949
  }
1920
1950
  });
@@ -1925,10 +1955,10 @@ function Yn(t, e, n) {
1925
1955
  }
1926
1956
  }
1927
1957
  }
1928
- var ht = function(t) {
1958
+ var ft = function(t) {
1929
1959
  var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, p = t.EVENTS;
1930
1960
  try {
1931
- var f = i.plugins, u = i.context, c = n.type, h = c.match(Ie), d = e.exact.map(function(y) {
1961
+ var f = i.plugins, u = i.context, c = n.type, h = c.match(_e), d = e.exact.map(function(y) {
1932
1962
  return y.pluginName;
1933
1963
  });
1934
1964
  h && (d = a.during.map(function(y) {
@@ -1938,19 +1968,19 @@ var ht = function(t) {
1938
1968
  return function(E, v, l) {
1939
1969
  var b = v.config, j = v.name, k = j + "." + E.type;
1940
1970
  l && (k = l.event);
1941
- var _ = E.type.match(Ie) ? /* @__PURE__ */ function(A, U, R, L, H) {
1942
- return function(M, x) {
1943
- var K = L ? L.name : A, J = x && Ze(x) ? x : R;
1944
- if (L && (!(J = x && Ze(x) ? x : [A]).includes(A) || J.length !== 1))
1945
- throw new Error("Method " + U + " can only abort " + A + " plugin. " + JSON.stringify(J) + " input valid");
1946
- return T({}, H, { abort: { reason: M, plugins: J, caller: U, _: K } });
1971
+ var _ = E.type.match(_e) ? /* @__PURE__ */ function($, U, R, L, F) {
1972
+ return function(W, x) {
1973
+ var K = L ? L.name : $, J = x && Ze(x) ? x : R;
1974
+ if (L && (!(J = x && Ze(x) ? x : [$]).includes($) || J.length !== 1))
1975
+ throw new Error("Method " + U + " can only abort " + $ + " plugin. " + JSON.stringify(J) + " input valid");
1976
+ return P({}, F, { abort: { reason: W, plugins: J, caller: U, _: K } });
1947
1977
  };
1948
- }(j, k, S, l, E) : /* @__PURE__ */ function(A, U) {
1978
+ }(j, k, S, l, E) : /* @__PURE__ */ function($, U) {
1949
1979
  return function() {
1950
- throw new Error(A.type + " action not cancellable. Remove abort in " + U);
1980
+ throw new Error($.type + " action not cancellable. Remove abort in " + U);
1951
1981
  };
1952
1982
  }(E, k);
1953
- return { payload: $i(E), instance: y, config: b || {}, abort: _ };
1983
+ return { payload: Ui(E), instance: y, config: b || {}, abort: _ };
1954
1984
  };
1955
1985
  }(r, d), I = e.exact.reduce(function(y, S) {
1956
1986
  var E = S.pluginName, v = S.methodName, l = !1;
@@ -1965,23 +1995,23 @@ var ht = function(t) {
1965
1995
  }
1966
1996
  var j = function() {
1967
1997
  if (e.namespaced && e.namespaced[v])
1968
- return Promise.resolve(e.namespaced[v].reduce(function(k, _, A) {
1998
+ return Promise.resolve(e.namespaced[v].reduce(function(k, _, $) {
1969
1999
  try {
1970
2000
  return Promise.resolve(k).then(function(U) {
1971
- return _.method && G(_.method) ? (function(M, x) {
1972
- var K = dn(M);
2001
+ return _.method && G(_.method) ? (function(W, x) {
2002
+ var K = pn(W);
1973
2003
  if (K && K.name === x) {
1974
- var J = dn(K.method);
1975
- throw new Error([x + " plugin is calling method " + M, "Plugins cant call self", "Use " + K.method + " " + (J ? "or " + J.method : "") + " in " + x + " plugin insteadof " + M].join(`
2004
+ var J = pn(K.method);
2005
+ throw new Error([x + " plugin is calling method " + W, "Plugins cant call self", "Use " + K.method + " " + (J ? "or " + J.method : "") + " in " + x + " plugin insteadof " + W].join(`
1976
2006
  `));
1977
2007
  }
1978
- }(_.methodName, _.pluginName), Promise.resolve(_.method({ payload: U, instance: r, abort: (R = U, L = v, H = _.pluginName, function(M, x) {
1979
- return T({}, R, { abort: { reason: M, plugins: x || [L], caller: c, from: H || L } });
1980
- }), config: sn(_.pluginName, f, o), plugins: f })).then(function(M) {
1981
- var x = X(M) ? M : {};
1982
- return Promise.resolve(T({}, U, x));
2008
+ }(_.methodName, _.pluginName), Promise.resolve(_.method({ payload: U, instance: r, abort: (R = U, L = v, F = _.pluginName, function(W, x) {
2009
+ return P({}, R, { abort: { reason: W, plugins: x || [L], caller: c, from: F || L } });
2010
+ }), config: ln(_.pluginName, f, o), plugins: f })).then(function(W) {
2011
+ var x = X(W) ? W : {};
2012
+ return Promise.resolve(P({}, U, x));
1983
2013
  })) : U;
1984
- var R, L, H;
2014
+ var R, L, F;
1985
2015
  });
1986
2016
  } catch (U) {
1987
2017
  return Promise.reject(U);
@@ -2002,20 +2032,20 @@ var ht = function(t) {
2002
2032
  var l = e.exact.length === v + 1, b = E.pluginName, j = o[b];
2003
2033
  return Promise.resolve(S).then(function(k) {
2004
2034
  var _ = y[b] ? y[b] : {};
2005
- if (h && (_ = k), pt(_, b))
2006
- return ft({ data: _, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(k);
2007
- if (pt(k, b))
2008
- return l && ft({ data: k, method: c, instance: r, store: s }), Promise.resolve(k);
2035
+ if (h && (_ = k), mt(_, b))
2036
+ return pt({ data: _, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(k);
2037
+ if (mt(k, b))
2038
+ return l && pt({ data: k, method: c, instance: r, store: s }), Promise.resolve(k);
2009
2039
  if (I.hasOwnProperty(b) && I[b] === !0)
2010
2040
  return s.dispatch({ type: "queue", plugin: b, payload: _, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(k);
2011
- var A = w(y[b], o[b]);
2012
- return Promise.resolve(j[c]({ abort: A.abort, payload: _, instance: r, config: sn(b, f, o), plugins: f })).then(function(U) {
2013
- var R = X(U) ? U : {}, L = T({}, k, R), H = y[b];
2014
- if (pt(H, b))
2015
- ft({ data: H, method: c, instance: r, pluginName: b, store: s });
2041
+ var $ = w(y[b], o[b]);
2042
+ return Promise.resolve(j[c]({ abort: $.abort, payload: _, instance: r, config: ln(b, f, o), plugins: f })).then(function(U) {
2043
+ var R = X(U) ? U : {}, L = P({}, k, R), F = y[b];
2044
+ if (mt(F, b))
2045
+ pt({ data: F, method: c, instance: r, pluginName: b, store: s });
2016
2046
  else {
2017
- var M = c + ":" + b;
2018
- (M.match(/:/g) || []).length < 2 && !c.match(on) && !c.match(an) && r.dispatch(T({}, h ? L : _, { type: M, _: { called: M, from: "submethod" } }));
2047
+ var W = c + ":" + b;
2048
+ (W.match(/:/g) || []).length < 2 && !c.match(cn) && !c.match(un) && r.dispatch(P({}, h ? L : _, { type: W, _: { called: W, from: "submethod" } }));
2019
2049
  }
2020
2050
  return Promise.resolve(L);
2021
2051
  });
@@ -2024,11 +2054,11 @@ var ht = function(t) {
2024
2054
  return Promise.reject(k);
2025
2055
  }
2026
2056
  }, Promise.resolve(n))).then(function(S) {
2027
- if (!(c.match(Ie) || c.match(/^registerPlugin/) || c.match(an) || c.match(on) || c.match(/^params/) || c.match(/^userIdChanged/))) {
2057
+ if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(un) || c.match(cn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
2028
2058
  if (p.plugins.includes(c), S._ && S._.originalAction === c)
2029
2059
  return S;
2030
- var E = T({}, S, { _: { originalAction: S.type, called: S.type, from: "engineEnd" } });
2031
- Gn(S, e.exact.length) && !c.match(/End$/) && (E = T({}, E, { type: S.type + "Aborted" })), s.dispatch(E);
2060
+ var E = P({}, S, { _: { originalAction: S.type, called: S.type, from: "engineEnd" } });
2061
+ er(S, e.exact.length) && !c.match(/End$/) && (E = P({}, E, { type: S.type + "Aborted" })), s.dispatch(E);
2032
2062
  }
2033
2063
  return S;
2034
2064
  });
@@ -2036,29 +2066,29 @@ var ht = function(t) {
2036
2066
  } catch (y) {
2037
2067
  return Promise.reject(y);
2038
2068
  }
2039
- }, Ie = /Start$/, on = /^bootstrap/, an = /^ready/;
2040
- function ft(t) {
2069
+ }, _e = /Start$/, cn = /^bootstrap/, un = /^ready/;
2070
+ function pt(t) {
2041
2071
  var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
2042
- t.store.dispatch(T({}, t.data, { type: n, _: { called: n, from: "abort" } }));
2072
+ t.store.dispatch(P({}, t.data, { type: n, _: { called: n, from: "abort" } }));
2043
2073
  }
2044
- function sn(t, e, n) {
2074
+ function ln(t, e, n) {
2045
2075
  var r = e[t] || n[t];
2046
2076
  return r && r.config ? r.config : {};
2047
2077
  }
2048
- function cn(t, e) {
2078
+ function dn(t, e) {
2049
2079
  return e.reduce(function(n, r) {
2050
2080
  return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
2051
2081
  }, []);
2052
2082
  }
2053
- function un(t, e) {
2054
- var n = t.replace(Ie, ""), r = e ? ":" + e : "";
2083
+ function hn(t, e) {
2084
+ var n = t.replace(_e, ""), r = e ? ":" + e : "";
2055
2085
  return ["" + t + r, "" + n + r, n + "End" + r];
2056
2086
  }
2057
- function pt(t, e) {
2087
+ function mt(t, e) {
2058
2088
  var n = t.abort;
2059
- return !!n && (n === !0 || ln(n, e) || n && ln(n.plugins, e));
2089
+ return !!n && (n === !0 || fn(n, e) || n && fn(n.plugins, e));
2060
2090
  }
2061
- function Gn(t, e) {
2091
+ function er(t, e) {
2062
2092
  var n = t.abort;
2063
2093
  if (!n)
2064
2094
  return !1;
@@ -2070,19 +2100,19 @@ function Gn(t, e) {
2070
2100
  function Ze(t) {
2071
2101
  return Array.isArray(t);
2072
2102
  }
2073
- function ln(t, e) {
2103
+ function fn(t, e) {
2074
2104
  return !(!t || !Ze(t)) && t.includes(e);
2075
2105
  }
2076
- function dn(t) {
2106
+ function pn(t) {
2077
2107
  var e = t.match(/(.*):(.*)/);
2078
2108
  return !!e && { method: e[1], name: e[2] };
2079
2109
  }
2080
- function $i(t) {
2110
+ function Ui(t) {
2081
2111
  return Object.keys(t).reduce(function(e, n) {
2082
2112
  return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2083
2113
  }, {});
2084
2114
  }
2085
- function Ai(t, e, n) {
2115
+ function Li(t, e, n) {
2086
2116
  var r = {};
2087
2117
  return function(i) {
2088
2118
  return function(o) {
@@ -2093,20 +2123,20 @@ function Ai(t, e, n) {
2093
2123
  }, f = a.type, u = a.plugins, c = a;
2094
2124
  if (a.abort)
2095
2125
  return Promise.resolve(o(a));
2096
- if (f === P.enablePlugin && i.dispatch({ type: P.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), f === P.disablePlugin && setTimeout(function() {
2097
- return rn(a.meta.rid, { payload: a });
2098
- }, 0), f === P.initializeEnd) {
2126
+ if (f === T.enablePlugin && i.dispatch({ type: T.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), f === T.disablePlugin && setTimeout(function() {
2127
+ return sn(a.meta.rid, { payload: a });
2128
+ }, 0), f === T.initializeEnd) {
2099
2129
  var h = e(), d = Object.keys(h), w = d.filter(function(l) {
2100
2130
  return u.includes(l);
2101
2131
  }).map(function(l) {
2102
2132
  return h[l];
2103
2133
  }), I = [], y = [], S = a.disabled, E = w.map(function(l) {
2104
2134
  var b = l.loaded, j = l.name, k = l.config;
2105
- return Vn(l, function() {
2135
+ return qn(l, function() {
2106
2136
  return b({ config: k });
2107
2137
  }, 1e4).then(function(_) {
2108
- return r[j] || (i.dispatch({ type: P.pluginReadyType(j), name: j, events: Object.keys(l).filter(function(A) {
2109
- return !It.includes(A);
2138
+ return r[j] || (i.dispatch({ type: T.pluginReadyType(j), name: j, events: Object.keys(l).filter(function($) {
2139
+ return !_t.includes($);
2110
2140
  }) }), r[j] = !0), I = I.concat(j), l;
2111
2141
  }).catch(function(_) {
2112
2142
  if (_ instanceof Error)
@@ -2117,62 +2147,62 @@ function Ai(t, e, n) {
2117
2147
  Promise.all(E).then(function(l) {
2118
2148
  var b = { plugins: I, failed: y, disabled: S };
2119
2149
  setTimeout(function() {
2120
- d.length === E.length + S.length && i.dispatch(T({}, { type: P.ready }, b));
2150
+ d.length === E.length + S.length && i.dispatch(P({}, { type: T.ready }, b));
2121
2151
  }, 0);
2122
2152
  });
2123
2153
  }
2124
2154
  var v = function() {
2125
- if (f !== P.bootstrap)
2155
+ if (f !== T.bootstrap)
2126
2156
  return /^ready:([^:]*)$/.test(f) && setTimeout(function() {
2127
- return Yn(i, e, t);
2157
+ return Qn(i, e, t);
2128
2158
  }, 0), Promise.resolve(function(l, b, j, k, _) {
2129
2159
  try {
2130
- var A = G(b) ? b() : b, U = l.type, R = U.replace(Ie, "");
2160
+ var $ = G(b) ? b() : b, U = l.type, R = U.replace(_e, "");
2131
2161
  if (l._ && l._.called)
2132
2162
  return Promise.resolve(l);
2133
- var L = j.getState(), H = (K = A, (J = L.plugins) === void 0 && (J = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2163
+ var L = j.getState(), F = (K = $, (J = L.plugins) === void 0 && (J = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2134
2164
  var g = Ce.plugins || {};
2135
- return pi(g[m]) ? g[m] : g.all !== !1 && (!J[m] || J[m].enabled !== !1);
2165
+ return wi(g[m]) ? g[m] : g.all !== !1 && (!J[m] || J[m].enabled !== !1);
2136
2166
  }).map(function(m) {
2137
2167
  return K[m];
2138
2168
  }));
2139
- U === P.initializeStart && l.fromEnable && (H = Object.keys(L.plugins).filter(function(m) {
2169
+ U === T.initializeStart && l.fromEnable && (F = Object.keys(L.plugins).filter(function(m) {
2140
2170
  var g = L.plugins[m];
2141
2171
  return l.plugins.includes(m) && !g.initialized;
2142
2172
  }).map(function(m) {
2143
- return A[m];
2173
+ return $[m];
2144
2174
  }));
2145
- var M = H.map(function(m) {
2175
+ var W = F.map(function(m) {
2146
2176
  return m.name;
2147
2177
  }), x = function(m, g, O) {
2148
- var C = un(m).map(function($) {
2149
- return cn($, g);
2178
+ var C = hn(m).map(function(A) {
2179
+ return dn(A, g);
2150
2180
  });
2151
- return g.reduce(function($, z) {
2152
- var W = z.name, D = un(m, W).map(function($e) {
2153
- return cn($e, g);
2181
+ return g.reduce(function(A, z) {
2182
+ var M = z.name, D = hn(m, M).map(function(Ae) {
2183
+ return dn(Ae, g);
2154
2184
  }), Z = D[0], N = D[1], q = D[2];
2155
- return Z.length && ($.beforeNS[W] = Z), N.length && ($.duringNS[W] = N), q.length && ($.afterNS[W] = q), $;
2185
+ return Z.length && (A.beforeNS[M] = Z), N.length && (A.duringNS[M] = N), q.length && (A.afterNS[M] = q), A;
2156
2186
  }, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
2157
- }(U, H);
2158
- return Promise.resolve(ht({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: L, allPlugins: A, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(m) {
2187
+ }(U, F);
2188
+ return Promise.resolve(ft({ action: l, data: { exact: x.before, namespaced: x.beforeNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(m) {
2159
2189
  function g() {
2160
- var $ = function() {
2161
- if (U.match(Ie))
2162
- return Promise.resolve(ht({ action: T({}, O, { type: R + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: L, allPlugins: A, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(z) {
2163
- z.meta && z.meta.hasCallback && rn(z.meta.rid, { payload: z });
2190
+ var A = function() {
2191
+ if (U.match(_e))
2192
+ return Promise.resolve(ft({ action: P({}, O, { type: R + "End" }), data: { exact: x.after, namespaced: x.afterNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(z) {
2193
+ z.meta && z.meta.hasCallback && sn(z.meta.rid, { payload: z });
2164
2194
  });
2165
2195
  }();
2166
- return $ && $.then ? $.then(function() {
2196
+ return A && A.then ? A.then(function() {
2167
2197
  return m;
2168
2198
  }) : m;
2169
2199
  }
2170
- if (Gn(m, M.length))
2200
+ if (er(m, W.length))
2171
2201
  return m;
2172
2202
  var O, C = function() {
2173
2203
  if (U !== R)
2174
- return Promise.resolve(ht({ action: T({}, m, { type: R }), data: { exact: x.during, namespaced: x.duringNS }, state: L, allPlugins: A, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function($) {
2175
- O = $;
2204
+ return Promise.resolve(ft({ action: P({}, m, { type: R }), data: { exact: x.during, namespaced: x.duringNS }, state: L, allPlugins: $, allMatches: x, instance: j, store: k, EVENTS: _ })).then(function(A) {
2205
+ O = A;
2176
2206
  });
2177
2207
  O = m;
2178
2208
  }();
@@ -2194,22 +2224,22 @@ function Ai(t, e, n) {
2194
2224
  };
2195
2225
  };
2196
2226
  }
2197
- function zi(t) {
2227
+ function Ri(t) {
2198
2228
  return function(e) {
2199
2229
  return function(n) {
2200
2230
  return function(r) {
2201
2231
  var i = r.type, o = r.key, a = r.value, s = r.options;
2202
- if (i === P.setItem || i === P.removeItem) {
2232
+ if (i === T.setItem || i === T.removeItem) {
2203
2233
  if (r.abort)
2204
2234
  return n(r);
2205
- i === P.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
2235
+ i === T.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
2206
2236
  }
2207
2237
  return n(r);
2208
2238
  };
2209
2239
  };
2210
2240
  };
2211
2241
  }
2212
- var Ni = function() {
2242
+ var Zi = function() {
2213
2243
  var t = this;
2214
2244
  this.before = [], this.after = [], this.addMiddleware = function(e, n) {
2215
2245
  t[n] = t[n].concat(e);
@@ -2227,86 +2257,86 @@ var Ni = function() {
2227
2257
  } }, a = t[e].map(function(s) {
2228
2258
  return s(o);
2229
2259
  });
2230
- return Te.apply(void 0, a)(r)(i);
2260
+ return Pe.apply(void 0, a)(r)(i);
2231
2261
  };
2232
2262
  };
2233
2263
  };
2234
2264
  };
2235
2265
  };
2236
- function Di(t) {
2266
+ function Wi(t) {
2237
2267
  return function(e, n) {
2238
2268
  e === void 0 && (e = {});
2239
2269
  var r = {};
2240
2270
  if (n.type === "initialize:aborted")
2241
2271
  return e;
2242
2272
  if (/^registerPlugin:([^:]*)$/.test(n.type)) {
2243
- var i = hn(n.type, "registerPlugin"), o = t()[i];
2273
+ var i = mn(n.type, "registerPlugin"), o = t()[i];
2244
2274
  if (!o || !i)
2245
2275
  return e;
2246
2276
  var a = n.enabled, s = o.config;
2247
- return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, T({}, e, r);
2277
+ return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, P({}, e, r);
2248
2278
  }
2249
2279
  if (/^initialize:([^:]*)$/.test(n.type)) {
2250
- var p = hn(n.type, P.initialize), f = t()[p];
2251
- return f && p ? (r[p] = T({}, e[p], { initialized: !0, loaded: !!f.loaded({ config: f.config }) }), T({}, e, r)) : e;
2280
+ var p = mn(n.type, T.initialize), f = t()[p];
2281
+ return f && p ? (r[p] = P({}, e[p], { initialized: !0, loaded: !!f.loaded({ config: f.config }) }), P({}, e, r)) : e;
2252
2282
  }
2253
2283
  if (/^ready:([^:]*)$/.test(n.type))
2254
- return r[n.name] = T({}, e[n.name], { loaded: !0 }), T({}, e, r);
2284
+ return r[n.name] = P({}, e[n.name], { loaded: !0 }), P({}, e, r);
2255
2285
  switch (n.type) {
2256
- case P.disablePlugin:
2257
- return T({}, e, fn(n.plugins, !1, e));
2258
- case P.enablePlugin:
2259
- return T({}, e, fn(n.plugins, !0, e));
2286
+ case T.disablePlugin:
2287
+ return P({}, e, gn(n.plugins, !1, e));
2288
+ case T.enablePlugin:
2289
+ return P({}, e, gn(n.plugins, !0, e));
2260
2290
  default:
2261
2291
  return e;
2262
2292
  }
2263
2293
  };
2264
2294
  }
2265
- function hn(t, e) {
2295
+ function mn(t, e) {
2266
2296
  return t.substring(e.length + 1, t.length);
2267
2297
  }
2268
- function fn(t, e, n) {
2298
+ function gn(t, e, n) {
2269
2299
  return t.reduce(function(r, i) {
2270
- return r[i] = T({}, n[i], { enabled: e }), r;
2300
+ return r[i] = P({}, n[i], { enabled: e }), r;
2271
2301
  }, n);
2272
2302
  }
2273
- function Bn(t) {
2303
+ function tr(t) {
2274
2304
  try {
2275
2305
  return JSON.parse(JSON.stringify(t));
2276
2306
  } catch {
2277
2307
  }
2278
2308
  return t;
2279
2309
  }
2280
- var Ui = { last: {}, history: [] };
2281
- function Li(t, e) {
2282
- t === void 0 && (t = Ui);
2310
+ var Mi = { last: {}, history: [] };
2311
+ function Ki(t, e) {
2312
+ t === void 0 && (t = Mi);
2283
2313
  var n = e.options, r = e.meta;
2284
- if (e.type === P.track) {
2285
- var i = Bn(T({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
2286
- return T({}, t, { last: i, history: t.history.concat(i) });
2314
+ if (e.type === T.track) {
2315
+ var i = tr(P({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
2316
+ return P({}, t, { last: i, history: t.history.concat(i) });
2287
2317
  }
2288
2318
  return t;
2289
2319
  }
2290
- var Ri = { actions: [] };
2291
- function Zi(t, e) {
2292
- t === void 0 && (t = Ri);
2320
+ var Ji = { actions: [] };
2321
+ function Xi(t, e) {
2322
+ t === void 0 && (t = Ji);
2293
2323
  var n = e.payload;
2294
2324
  switch (e.type) {
2295
2325
  case "queue":
2296
2326
  var r;
2297
- return r = n && n.type && n.type === P.identify ? [e].concat(t.actions) : t.actions.concat(e), T({}, t, { actions: r });
2327
+ return r = n && n.type && n.type === T.identify ? [e].concat(t.actions) : t.actions.concat(e), P({}, t, { actions: r });
2298
2328
  case "dequeue":
2299
2329
  return [];
2300
2330
  default:
2301
2331
  return t;
2302
2332
  }
2303
2333
  }
2304
- var qn = /#.*$/;
2305
- function Mi(t) {
2334
+ var nr = /#.*$/;
2335
+ function Fi(t) {
2306
2336
  var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
2307
- return "/" + (e && e[3] ? e[3].split("?")[0].replace(qn, "") : "");
2337
+ return "/" + (e && e[3] ? e[3].split("?")[0].replace(nr, "") : "");
2308
2338
  }
2309
- var Qn, er, tr, nr, Wi = function(t) {
2339
+ var rr, ir, or, ar, Hi = function(t) {
2310
2340
  if (t === void 0 && (t = {}), !Y)
2311
2341
  return t;
2312
2342
  var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, p = o.hash, f = o.search, u = function(h) {
@@ -2317,42 +2347,42 @@ var Qn, er, tr, nr, Wi = function(t) {
2317
2347
  return w.getAttribute("href");
2318
2348
  }
2319
2349
  }();
2320
- return d ? d.match(/\?/) ? d : d + h : window.location.href.replace(qn, "");
2321
- }(f), c = { title: n, url: u, path: Mi(u), hash: p, search: f, width: a, height: s };
2322
- return r && r !== "" && (c.referrer = r), T({}, c, t);
2323
- }, Ki = { last: {}, history: [] };
2324
- function Ji(t, e) {
2325
- t === void 0 && (t = Ki);
2350
+ return d ? d.match(/\?/) ? d : d + h : window.location.href.replace(nr, "");
2351
+ }(f), c = { title: n, url: u, path: Fi(u), hash: p, search: f, width: a, height: s };
2352
+ return r && r !== "" && (c.referrer = r), P({}, c, t);
2353
+ }, Vi = { last: {}, history: [] };
2354
+ function Yi(t, e) {
2355
+ t === void 0 && (t = Vi);
2326
2356
  var n = e.options;
2327
- if (e.type === P.page) {
2328
- var r = Bn(T({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
2329
- return T({}, t, { last: r, history: t.history.concat(r) });
2357
+ if (e.type === T.page) {
2358
+ var r = tr(P({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
2359
+ return P({}, t, { last: r, history: t.history.concat(r) });
2330
2360
  }
2331
2361
  return t;
2332
2362
  }
2333
- Qn = function() {
2363
+ rr = function() {
2334
2364
  if (!Y)
2335
2365
  return !1;
2336
2366
  var t = navigator.appVersion;
2337
2367
  return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
2338
- }(), er = Y ? document.referrer : null, tr = ki(), nr = Ii();
2339
- var pn = { initialized: !1, sessionId: it(), app: null, version: null, debug: !1, offline: !!Y && !navigator.onLine, os: { name: Qn }, userAgent: Y ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: nr, locale: tr, campaign: {}, referrer: er };
2340
- function Xi(t, e) {
2341
- t === void 0 && (t = pn);
2368
+ }(), ir = Y ? document.referrer : null, or = Oi(), ar = Ti();
2369
+ var yn = { initialized: !1, sessionId: ot(), app: null, version: null, debug: !1, offline: !!Y && !navigator.onLine, os: { name: rr }, userAgent: Y ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: ar, locale: or, campaign: {}, referrer: ir };
2370
+ function Gi(t, e) {
2371
+ t === void 0 && (t = yn);
2342
2372
  var n = t.initialized, r = e.campaign;
2343
2373
  switch (e.type) {
2344
- case P.campaign:
2345
- return T({}, t, { campaign: r });
2346
- case P.offline:
2347
- return T({}, t, { offline: !0 });
2348
- case P.online:
2349
- return T({}, t, { offline: !1 });
2374
+ case T.campaign:
2375
+ return P({}, t, { campaign: r });
2376
+ case T.offline:
2377
+ return P({}, t, { offline: !0 });
2378
+ case T.online:
2379
+ return P({}, t, { offline: !1 });
2350
2380
  default:
2351
- return n ? t : T({}, pn, t, { initialized: !0 });
2381
+ return n ? t : P({}, yn, t, { initialized: !0 });
2352
2382
  }
2353
2383
  }
2354
- var Fi = ["plugins", "reducers", "storage"];
2355
- function Hi(t, e, n) {
2384
+ var Bi = ["plugins", "reducers", "storage"];
2385
+ function qi(t, e, n) {
2356
2386
  if (Y) {
2357
2387
  var r = window[(n ? "add" : "remove") + "EventListener"];
2358
2388
  t.split(" ").forEach(function(i) {
@@ -2360,35 +2390,35 @@ function Hi(t, e, n) {
2360
2390
  });
2361
2391
  }
2362
2392
  }
2363
- function Vi(t) {
2364
- var e = Hi.bind(null, "online offline", function(n) {
2393
+ function Qi(t) {
2394
+ var e = qi.bind(null, "online offline", function(n) {
2365
2395
  return Promise.resolve(!navigator.onLine).then(t);
2366
2396
  });
2367
2397
  return e(!0), function(n) {
2368
2398
  return e(!1);
2369
2399
  };
2370
2400
  }
2371
- function rr() {
2372
- return ge("analytics", []), function(t) {
2401
+ function sr() {
2402
+ return ye("analytics", []), function(t) {
2373
2403
  return function(e, n, r) {
2374
2404
  var i = t(e, n, r), o = i.dispatch;
2375
2405
  return Object.assign(i, { dispatch: function(a) {
2376
- return Pe[Oe].analytics.push(a.action || a), o(a);
2406
+ return Te[Oe].analytics.push(a.action || a), o(a);
2377
2407
  } });
2378
2408
  };
2379
2409
  };
2380
2410
  }
2381
- function mn(t) {
2411
+ function vn(t) {
2382
2412
  return function() {
2383
- return Te(Te.apply(null, arguments), rr());
2413
+ return Pe(Pe.apply(null, arguments), sr());
2384
2414
  };
2385
2415
  }
2386
- function mt(t) {
2387
- return t ? Xn(t) ? t : [t] : [];
2416
+ function gt(t) {
2417
+ return t ? Yn(t) ? t : [t] : [];
2388
2418
  }
2389
- function gn(t, e, n) {
2419
+ function wn(t, e, n) {
2390
2420
  t === void 0 && (t = {});
2391
- var r, i, o = it();
2421
+ var r, i, o = ot();
2392
2422
  return e && (Ne[o] = (r = e, i = function(a) {
2393
2423
  for (var s, p = a || Array.prototype.slice.call(arguments), f = 0; f < p.length; f++)
2394
2424
  if (G(p[f])) {
@@ -2398,9 +2428,9 @@ function gn(t, e, n) {
2398
2428
  return s;
2399
2429
  }(n), function(a) {
2400
2430
  i && i(a), r(a);
2401
- })), T({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2431
+ })), P({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2402
2432
  }
2403
- function Yi(t) {
2433
+ function eo(t) {
2404
2434
  t === void 0 && (t = {});
2405
2435
  var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, g) {
2406
2436
  if (G(g))
@@ -2411,70 +2441,70 @@ function Yi(t) {
2411
2441
  var O = g.EVENTS ? Object.keys(g.EVENTS).map(function(z) {
2412
2442
  return g.EVENTS[z];
2413
2443
  }) : [];
2414
- m.pluginEnabled[g.name] = !(g.enabled === !1 || g.config.enabled === !1), delete g.enabled, g.methods && (m.methods[g.name] = Object.keys(g.methods).reduce(function(z, W) {
2444
+ m.pluginEnabled[g.name] = !(g.enabled === !1 || g.config.enabled === !1), delete g.enabled, g.methods && (m.methods[g.name] = Object.keys(g.methods).reduce(function(z, M) {
2415
2445
  var D;
2416
- return z[W] = (D = g.methods[W], function() {
2446
+ return z[M] = (D = g.methods[M], function() {
2417
2447
  for (var Z = Array.prototype.slice.call(arguments), N = new Array(D.length), q = 0; q < Z.length; q++)
2418
2448
  N[q] = Z[q];
2419
2449
  return N[N.length] = b, D.apply({ instance: b }, N);
2420
2450
  }), z;
2421
2451
  }, {}), delete g.methods);
2422
- var C = Object.keys(g).concat(O), $ = new Set(m.events.concat(C));
2423
- if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2452
+ var C = Object.keys(g).concat(O), A = new Set(m.events.concat(C));
2453
+ if (m.events = Array.from(A), m.pluginsArray = m.pluginsArray.concat(g), m.plugins[g.name])
2424
2454
  throw new Error(g.name + "AlreadyLoaded");
2425
2455
  return m.plugins[g.name] = g, m.plugins[g.name].loaded || (m.plugins[g.name].loaded = function() {
2426
2456
  return !0;
2427
2457
  }), m;
2428
- }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: me, setItem: ge, removeItem: je }, o = /* @__PURE__ */ function(m) {
2458
+ }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: je }, o = /* @__PURE__ */ function(m) {
2429
2459
  return function(g, O, C) {
2430
- return O.getState("user")[g] || (C && X(C) && C[g] ? C[g] : nn(m)[g] || me(_t(g)) || null);
2460
+ return O.getState("user")[g] || (C && X(C) && C[g] ? C[g] : an(m)[g] || ge(St(g)) || null);
2431
2461
  };
2432
2462
  }(i), a = r.plugins, s = r.events.filter(function(m) {
2433
- return !It.includes(m);
2463
+ return !_t.includes(m);
2434
2464
  }).sort(), p = new Set(s.concat(Be).filter(function(m) {
2435
- return !It.includes(m);
2465
+ return !_t.includes(m);
2436
2466
  })), f = Array.from(p).sort(), u = function() {
2437
2467
  return a;
2438
- }, c = new Ni(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, I = function() {
2468
+ }, c = new Zi(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, I = function() {
2439
2469
  throw new Error("Abort disabled inListener");
2440
- }, y = _i(), S = nn(i), E = T({}, S, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
2441
- E.anonymousId || (E.anonymousId = it());
2442
- var v = T({ enable: function(m, g) {
2470
+ }, y = Pi(), S = an(i), E = P({}, S, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
2471
+ E.anonymousId || (E.anonymousId = ot());
2472
+ var v = P({ enable: function(m, g) {
2443
2473
  return new Promise(function(O) {
2444
- x.dispatch({ type: P.enablePlugin, plugins: mt(m), _: { originalAction: P.enablePlugin } }, O, [g]);
2474
+ x.dispatch({ type: T.enablePlugin, plugins: gt(m), _: { originalAction: T.enablePlugin } }, O, [g]);
2445
2475
  });
2446
2476
  }, disable: function(m, g) {
2447
2477
  return new Promise(function(O) {
2448
- x.dispatch({ type: P.disablePlugin, plugins: mt(m), _: { originalAction: P.disablePlugin } }, O, [g]);
2478
+ x.dispatch({ type: T.disablePlugin, plugins: gt(m), _: { originalAction: T.disablePlugin } }, O, [g]);
2449
2479
  });
2450
2480
  } }, r.methods), l = !1, b = { identify: function(m, g, O, C) {
2451
2481
  try {
2452
- var $ = re(m) ? m : null, z = X(m) ? m : g, W = O || {}, D = b.user();
2453
- ge(_t(te), $);
2454
- var Z = $ || z.userId || o(te, b, z);
2482
+ var A = re(m) ? m : null, z = X(m) ? m : g, M = O || {}, D = b.user();
2483
+ ye(St(te), A);
2484
+ var Z = A || z.userId || o(te, b, z);
2455
2485
  return Promise.resolve(new Promise(function(N) {
2456
- x.dispatch(T({ type: P.identifyStart, userId: Z, traits: z || {}, options: W, anonymousId: D.anonymousId }, D.id && D.id !== $ && { previousId: D.id }), N, [g, O, C]);
2486
+ x.dispatch(P({ type: T.identifyStart, userId: Z, traits: z || {}, options: M, anonymousId: D.anonymousId }, D.id && D.id !== A && { previousId: D.id }), N, [g, O, C]);
2457
2487
  }));
2458
2488
  } catch (N) {
2459
2489
  return Promise.reject(N);
2460
2490
  }
2461
2491
  }, track: function(m, g, O, C) {
2462
2492
  try {
2463
- var $ = X(m) ? m.event : m;
2464
- if (!$ || !re($))
2493
+ var A = X(m) ? m.event : m;
2494
+ if (!A || !re(A))
2465
2495
  throw new Error("EventMissing");
2466
- var z = X(m) ? m : g || {}, W = X(O) ? O : {};
2496
+ var z = X(m) ? m : g || {}, M = X(O) ? O : {};
2467
2497
  return Promise.resolve(new Promise(function(D) {
2468
- x.dispatch({ type: P.trackStart, event: $, properties: z, options: W, userId: o(te, b, g), anonymousId: o(be, b, g) }, D, [g, O, C]);
2498
+ x.dispatch({ type: T.trackStart, event: A, properties: z, options: M, userId: o(te, b, g), anonymousId: o(ke, b, g) }, D, [g, O, C]);
2469
2499
  }));
2470
2500
  } catch (D) {
2471
2501
  return Promise.reject(D);
2472
2502
  }
2473
2503
  }, page: function(m, g, O) {
2474
2504
  try {
2475
- var C = X(m) ? m : {}, $ = X(g) ? g : {};
2505
+ var C = X(m) ? m : {}, A = X(g) ? g : {};
2476
2506
  return Promise.resolve(new Promise(function(z) {
2477
- x.dispatch({ type: P.pageStart, properties: Wi(C), options: $, userId: o(te, b, C), anonymousId: o(be, b, C) }, z, [m, g, O]);
2507
+ x.dispatch({ type: T.pageStart, properties: Hi(C), options: A, userId: o(te, b, C), anonymousId: o(ke, b, C) }, z, [m, g, O]);
2478
2508
  }));
2479
2509
  } catch (z) {
2480
2510
  return Promise.reject(z);
@@ -2482,22 +2512,22 @@ function Yi(t) {
2482
2512
  }, user: function(m) {
2483
2513
  if (m === te || m === "id")
2484
2514
  return o(te, b);
2485
- if (m === be || m === "anonId")
2486
- return o(be, b);
2515
+ if (m === ke || m === "anonId")
2516
+ return o(ke, b);
2487
2517
  var g = b.getState("user");
2488
- return m ? Yt(g, m) : g;
2518
+ return m ? qt(g, m) : g;
2489
2519
  }, reset: function(m) {
2490
2520
  return new Promise(function(g) {
2491
- x.dispatch({ type: P.resetStart }, g, m);
2521
+ x.dispatch({ type: T.resetStart }, g, m);
2492
2522
  });
2493
2523
  }, ready: function(m) {
2494
- return l && m({ plugins: v, instance: b }), b.on(P.ready, function(g) {
2524
+ return l && m({ plugins: v, instance: b }), b.on(T.ready, function(g) {
2495
2525
  m(g), l = !0;
2496
2526
  });
2497
2527
  }, on: function(m, g) {
2498
2528
  if (!m || !G(g))
2499
2529
  return !1;
2500
- if (m === P.bootstrap)
2530
+ if (m === T.bootstrap)
2501
2531
  throw new Error(".on disabled for " + m);
2502
2532
  var O = /Start$|Start:/;
2503
2533
  if (m === "*") {
@@ -2507,31 +2537,31 @@ function Yi(t) {
2507
2537
  return N.type.match(O) && g({ payload: N, instance: b, plugins: a }), Z(N);
2508
2538
  };
2509
2539
  };
2510
- }, $ = function(D) {
2540
+ }, A = function(D) {
2511
2541
  return function(Z) {
2512
2542
  return function(N) {
2513
2543
  return N.type.match(O) || g({ payload: N, instance: b, plugins: a }), Z(N);
2514
2544
  };
2515
2545
  };
2516
2546
  };
2517
- return h(C, He), h($, Ve), function() {
2518
- d(C, He), d($, Ve);
2547
+ return h(C, He), h(A, Ve), function() {
2548
+ d(C, He), d(A, Ve);
2519
2549
  };
2520
2550
  }
2521
- var z = m.match(O) ? He : Ve, W = function(D) {
2551
+ var z = m.match(O) ? He : Ve, M = function(D) {
2522
2552
  return function(Z) {
2523
2553
  return function(N) {
2524
2554
  return N.type === m && g({ payload: N, instance: b, plugins: a, abort: I }), Z(N);
2525
2555
  };
2526
2556
  };
2527
2557
  };
2528
- return h(W, z), function() {
2529
- return d(W, z);
2558
+ return h(M, z), function() {
2559
+ return d(M, z);
2530
2560
  };
2531
2561
  }, once: function(m, g) {
2532
2562
  if (!m || !G(g))
2533
2563
  return !1;
2534
- if (m === P.bootstrap)
2564
+ if (m === T.bootstrap)
2535
2565
  throw new Error(".once disabled for " + m);
2536
2566
  var O = b.on(m, function(C) {
2537
2567
  g({ payload: C.payload, instance: b, plugins: a, abort: I }), O();
@@ -2539,50 +2569,50 @@ function Yi(t) {
2539
2569
  return O;
2540
2570
  }, getState: function(m) {
2541
2571
  var g = x.getState();
2542
- return m ? Yt(g, m) : Object.assign({}, g);
2572
+ return m ? qt(g, m) : Object.assign({}, g);
2543
2573
  }, dispatch: function(m) {
2544
2574
  var g = re(m) ? { type: m } : m;
2545
2575
  if (Be.includes(g.type))
2546
2576
  throw new Error("reserved action " + g.type);
2547
- var O = T({}, g, { _: T({ originalAction: g.type }, m._ || {}) });
2577
+ var O = P({}, g, { _: P({ originalAction: g.type }, m._ || {}) });
2548
2578
  x.dispatch(O);
2549
2579
  }, enablePlugin: v.enable, disablePlugin: v.disable, plugins: v, storage: { getItem: i.getItem, setItem: function(m, g, O) {
2550
- x.dispatch({ type: P.setItemStart, key: m, value: g, options: O });
2580
+ x.dispatch({ type: T.setItemStart, key: m, value: g, options: O });
2551
2581
  }, removeItem: function(m, g) {
2552
- x.dispatch({ type: P.removeItemStart, key: m, options: g });
2582
+ x.dispatch({ type: T.removeItemStart, key: m, options: g });
2553
2583
  } }, setAnonymousId: function(m, g) {
2554
2584
  b.storage.setItem(ie, m, g);
2555
2585
  }, events: { core: Be, plugins: s } }, j = r.middlewares.concat([function(m) {
2556
2586
  return function(g) {
2557
2587
  return function(O) {
2558
- return O.meta || (O.meta = gn()), g(O);
2588
+ return O.meta || (O.meta = wn()), g(O);
2559
2589
  };
2560
2590
  };
2561
- }, w(He), Ai(b, u, { all: f, plugins: s }), zi(i), Ti(b), xi(b), w(Ve)]), k = { context: Xi, user: ji(i), page: Ji, track: Li, plugins: Di(u), queue: Zi }, _ = Te, A = Te;
2591
+ }, w(He), Li(b, u, { all: f, plugins: s }), Ri(i), $i(b), Ni(b), w(Ve)]), k = { context: Gi, user: zi(i), page: Yi, track: Ki, plugins: Wi(u), queue: Xi }, _ = Pe, $ = Pe;
2562
2592
  if (Y && t.debug) {
2563
2593
  var U = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2564
- U && (_ = U({ trace: !0, traceLimit: 25 })), A = function() {
2565
- return arguments.length === 0 ? rr() : X(typeof arguments[0]) ? mn() : mn().apply(null, arguments);
2594
+ U && (_ = U({ trace: !0, traceLimit: 25 })), $ = function() {
2595
+ return arguments.length === 0 ? sr() : X(typeof arguments[0]) ? vn() : vn().apply(null, arguments);
2566
2596
  };
2567
2597
  }
2568
2598
  var R, L = function(m) {
2569
2599
  return Object.keys(m).reduce(function(g, O) {
2570
- return Fi.includes(O) || (g[O] = m[O]), g;
2600
+ return Bi.includes(O) || (g[O] = m[O]), g;
2571
2601
  }, {});
2572
- }(t), H = r.pluginsArray.reduce(function(m, g) {
2573
- var O = g.name, C = g.config, $ = g.loaded, z = r.pluginEnabled[O];
2574
- return m[O] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!$({ config: C }), config: C }, m;
2575
- }, {}), M = { context: L, user: E, plugins: H }, x = Hn(function(m) {
2602
+ }(t), F = r.pluginsArray.reduce(function(m, g) {
2603
+ var O = g.name, C = g.config, A = g.loaded, z = r.pluginEnabled[O];
2604
+ return m[O] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!A({ config: C }), config: C }, m;
2605
+ }, {}), W = { context: L, user: E, plugins: F }, x = Bn(function(m) {
2576
2606
  for (var g = Object.keys(m), O = {}, C = 0; C < g.length; C++) {
2577
- var $ = g[C];
2578
- typeof m[$] === ne && (O[$] = m[$]);
2607
+ var A = g[C];
2608
+ typeof m[A] === ne && (O[A] = m[A]);
2579
2609
  }
2580
- var z, W = Object.keys(O);
2610
+ var z, M = Object.keys(O);
2581
2611
  try {
2582
2612
  (function(D) {
2583
2613
  Object.keys(D).forEach(function(Z) {
2584
2614
  var N = D[Z];
2585
- if (typeof N(void 0, { type: "@@redux/INIT" }) === ee || typeof N(void 0, { type: Ei }) === ee)
2615
+ if (typeof N(void 0, { type: "@@redux/INIT" }) === ee || typeof N(void 0, { type: xi }) === ee)
2586
2616
  throw new Error("reducer " + Z + " " + ee);
2587
2617
  });
2588
2618
  })(O);
@@ -2592,69 +2622,69 @@ function Yi(t) {
2592
2622
  return function(D, Z) {
2593
2623
  if (D === void 0 && (D = {}), z)
2594
2624
  throw z;
2595
- for (var N = !1, q = {}, $e = 0; $e < W.length; $e++) {
2596
- var We = W[$e], Dt = D[We], st = (0, O[We])(Dt, Z);
2597
- if (typeof st === ee) {
2598
- var pr = Oi(We, Z);
2599
- throw new Error(pr);
2625
+ for (var N = !1, q = {}, Ae = 0; Ae < M.length; Ae++) {
2626
+ var Me = M[Ae], Rt = D[Me], ct = (0, O[Me])(Rt, Z);
2627
+ if (typeof ct === ee) {
2628
+ var vr = Ci(Me, Z);
2629
+ throw new Error(vr);
2600
2630
  }
2601
- q[We] = st, N = N || st !== Dt;
2631
+ q[Me] = ct, N = N || ct !== Rt;
2602
2632
  }
2603
2633
  return N ? q : D;
2604
2634
  };
2605
- }(T({}, k, e)), M, A(_(Pi.apply(void 0, j))));
2635
+ }(P({}, k, e)), W, $(_(Ai.apply(void 0, j))));
2606
2636
  x.dispatch = (R = x.dispatch, function(m, g, O) {
2607
- var C = T({}, m, { meta: gn(m.meta, g, mt(O)) });
2637
+ var C = P({}, m, { meta: wn(m.meta, g, gt(O)) });
2608
2638
  return R.apply(null, [C]);
2609
2639
  });
2610
2640
  var K = Object.keys(a);
2611
- x.dispatch({ type: P.bootstrap, plugins: K, config: L, params: y, user: E, initialUser: n, persistedUser: S });
2641
+ x.dispatch({ type: T.bootstrap, plugins: K, config: L, params: y, user: E, initialUser: n, persistedUser: S });
2612
2642
  var J = K.filter(function(m) {
2613
2643
  return r.pluginEnabled[m];
2614
2644
  }), Ce = K.filter(function(m) {
2615
2645
  return !r.pluginEnabled[m];
2616
2646
  });
2617
- return x.dispatch({ type: P.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, g) {
2618
- var O = m.bootstrap, C = m.config, $ = m.name;
2619
- O && G(O) && O({ instance: b, config: C, payload: m }), x.dispatch({ type: P.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: P.initializeStart, plugins: J, disabled: Ce });
2620
- }), Vi(function(m) {
2621
- x.dispatch({ type: m ? P.offline : P.online });
2647
+ return x.dispatch({ type: T.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, g) {
2648
+ var O = m.bootstrap, C = m.config, A = m.name;
2649
+ O && G(O) && O({ instance: b, config: C, payload: m }), x.dispatch({ type: T.registerPluginType(A), name: A, enabled: r.pluginEnabled[A], plugin: m }), r.pluginsArray.length === g + 1 && x.dispatch({ type: T.initializeStart, plugins: J, disabled: Ce });
2650
+ }), Qi(function(m) {
2651
+ x.dispatch({ type: m ? T.offline : T.online });
2622
2652
  }), function(m, g, O) {
2623
2653
  setInterval(function() {
2624
- return Yn(m, g, O);
2654
+ return Qn(m, g, O);
2625
2655
  }, 3e3);
2626
2656
  }(x, u, b), b;
2627
2657
  }
2628
- var He = "before", Ve = "after", Ue = "cookie", ue = ar(), ir = ot, Gi = ot;
2629
- function or(t) {
2630
- return ue ? ot(t, "", -1) : je(t);
2658
+ var He = "before", Ve = "after", Ue = "cookie", ue = lr(), cr = at, to = at;
2659
+ function ur(t) {
2660
+ return ue ? at(t, "", -1) : je(t);
2631
2661
  }
2632
- function ar() {
2662
+ function lr() {
2633
2663
  if (ue !== void 0)
2634
2664
  return ue;
2635
2665
  var t = "cookiecookie";
2636
2666
  try {
2637
- ot(t, t), ue = document.cookie.indexOf(t) !== -1, or(t);
2667
+ at(t, t), ue = document.cookie.indexOf(t) !== -1, ur(t);
2638
2668
  } catch {
2639
2669
  ue = !1;
2640
2670
  }
2641
2671
  return ue;
2642
2672
  }
2643
- function ot(t, e, n, r, i, o) {
2673
+ function at(t, e, n, r, i, o) {
2644
2674
  if (typeof window < "u") {
2645
2675
  var a = arguments.length > 1;
2646
- return ue === !1 && (a ? ge(t, e) : me(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]);
2676
+ return ue === !1 && (a ? ye(t, e) : ge(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
2647
2677
  }
2648
2678
  }
2649
- var Le = "localStorage", Bi = jt.bind(null, "localStorage");
2650
- xe("localStorage", "getItem", me);
2651
- xe("localStorage", "setItem", ge);
2679
+ var Le = "localStorage", no = At.bind(null, "localStorage");
2680
+ xe("localStorage", "getItem", ge);
2681
+ xe("localStorage", "setItem", ye);
2652
2682
  xe("localStorage", "removeItem", je);
2653
- var Re = "sessionStorage", qi = jt.bind(null, "sessionStorage");
2654
- xe("sessionStorage", "getItem", me);
2655
- xe("sessionStorage", "setItem", ge);
2683
+ var Re = "sessionStorage", ro = At.bind(null, "sessionStorage");
2684
+ xe("sessionStorage", "getItem", ge);
2685
+ xe("sessionStorage", "setItem", ye);
2656
2686
  xe("sessionStorage", "removeItem", je);
2657
- function _e(t) {
2687
+ function Se(t) {
2658
2688
  var e = t;
2659
2689
  try {
2660
2690
  if ((e = JSON.parse(t)) === "true")
@@ -2669,57 +2699,57 @@ function _e(t) {
2669
2699
  if (e !== null && e !== "")
2670
2700
  return e;
2671
2701
  }
2672
- var Qi = Bi(), eo = qi(), to = ar();
2673
- function sr(t, e) {
2702
+ var io = no(), oo = ro(), ao = lr();
2703
+ function dr(t, e) {
2674
2704
  if (t) {
2675
- var n = xt(e), r = !zt(n), i = Ct(n) ? _e(localStorage.getItem(t)) : void 0;
2676
- if (r && !we(i))
2705
+ var n = $t(e), r = !Ut(n), i = zt(n) ? Se(localStorage.getItem(t)) : void 0;
2706
+ if (r && !be(i))
2677
2707
  return i;
2678
- var o = $t(n) ? _e(ir(t)) : void 0;
2708
+ var o = Nt(n) ? Se(cr(t)) : void 0;
2679
2709
  if (r && o)
2680
2710
  return o;
2681
- var a = At(n) ? _e(sessionStorage.getItem(t)) : void 0;
2711
+ var a = Dt(n) ? Se(sessionStorage.getItem(t)) : void 0;
2682
2712
  if (r && a)
2683
2713
  return a;
2684
- var s = me(t);
2714
+ var s = ge(t);
2685
2715
  return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
2686
2716
  }
2687
2717
  }
2688
- function no(t, e, n) {
2689
- if (t && !we(e)) {
2690
- var r = {}, i = xt(n), o = JSON.stringify(e), a = !zt(i);
2691
- return Ct(i) && (r[Le] = Ye(Le, e, _e(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Le] : $t(i) && (r[Ue] = Ye(Ue, e, _e(ir(t))), Gi(t, o), a) ? r[Ue] : At(i) && (r[Re] = Ye(Re, e, _e(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Re] : (r[De] = Ye(De, e, me(t)), ge(t, e), a ? r[De] : r);
2718
+ function so(t, e, n) {
2719
+ if (t && !be(e)) {
2720
+ var r = {}, i = $t(n), o = JSON.stringify(e), a = !Ut(i);
2721
+ return zt(i) && (r[Le] = Ye(Le, e, Se(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Le] : Nt(i) && (r[Ue] = Ye(Ue, e, Se(cr(t))), to(t, o), a) ? r[Ue] : Dt(i) && (r[Re] = Ye(Re, e, Se(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Re] : (r[De] = Ye(De, e, ge(t)), ye(t, e), a ? r[De] : r);
2692
2722
  }
2693
2723
  }
2694
- function ro(t, e) {
2724
+ function co(t, e) {
2695
2725
  if (t) {
2696
- var n = xt(e), r = sr(t, Wn), i = {};
2697
- return !we(r.localStorage) && Ct(n) && (localStorage.removeItem(t), i[Le] = r.localStorage), !we(r.cookie) && $t(n) && (or(t), i[Ue] = r.cookie), !we(r.sessionStorage) && At(n) && (sessionStorage.removeItem(t), i[Re] = r.sessionStorage), !we(r.global) && at(n, De) && (je(t), i[De] = r.global), i;
2726
+ var n = $t(e), r = dr(t, Fn), i = {};
2727
+ return !be(r.localStorage) && zt(n) && (localStorage.removeItem(t), i[Le] = r.localStorage), !be(r.cookie) && Nt(n) && (ur(t), i[Ue] = r.cookie), !be(r.sessionStorage) && Dt(n) && (sessionStorage.removeItem(t), i[Re] = r.sessionStorage), !be(r.global) && st(n, De) && (je(t), i[De] = r.global), i;
2698
2728
  }
2699
2729
  }
2700
- function xt(t) {
2701
- return t ? re(t) ? t : t.storage : Mn;
2730
+ function $t(t) {
2731
+ return t ? re(t) ? t : t.storage : Xn;
2702
2732
  }
2703
- function Ct(t) {
2704
- return Qi && at(t, Le);
2733
+ function zt(t) {
2734
+ return io && st(t, Le);
2705
2735
  }
2706
- function $t(t) {
2707
- return to && at(t, Ue);
2736
+ function Nt(t) {
2737
+ return ao && st(t, Ue);
2708
2738
  }
2709
- function At(t) {
2710
- return eo && at(t, Re);
2739
+ function Dt(t) {
2740
+ return oo && st(t, Re);
2711
2741
  }
2712
- function zt(t) {
2713
- return t === Wn || t === "all";
2742
+ function Ut(t) {
2743
+ return t === Fn || t === "all";
2714
2744
  }
2715
- function at(t, e) {
2716
- return t === Mn || t === e || zt(t);
2745
+ function st(t, e) {
2746
+ return t === Xn || t === e || Ut(t);
2717
2747
  }
2718
2748
  function Ye(t, e, n) {
2719
2749
  return { location: t, current: e, previous: n };
2720
2750
  }
2721
- var io = { setItem: no, getItem: sr, removeItem: ro };
2722
- function oo(t, e, n) {
2751
+ var uo = { setItem: so, getItem: dr, removeItem: co };
2752
+ function lo(t, e, n) {
2723
2753
  return e in t ? Object.defineProperty(t, e, {
2724
2754
  value: n,
2725
2755
  enumerable: !0,
@@ -2727,7 +2757,7 @@ function oo(t, e, n) {
2727
2757
  writable: !0
2728
2758
  }) : t[e] = n, t;
2729
2759
  }
2730
- function yn(t, e) {
2760
+ function bn(t, e) {
2731
2761
  var n = Object.keys(t);
2732
2762
  if (Object.getOwnPropertySymbols) {
2733
2763
  var r = Object.getOwnPropertySymbols(t);
@@ -2737,24 +2767,24 @@ function yn(t, e) {
2737
2767
  }
2738
2768
  return n;
2739
2769
  }
2740
- function vn(t) {
2770
+ function kn(t) {
2741
2771
  for (var e = 1; e < arguments.length; e++) {
2742
2772
  var n = arguments[e] != null ? arguments[e] : {};
2743
- e % 2 ? yn(Object(n), !0).forEach(function(r) {
2744
- oo(t, r, n[r]);
2745
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : yn(Object(n)).forEach(function(r) {
2773
+ e % 2 ? bn(Object(n), !0).forEach(function(r) {
2774
+ lo(t, r, n[r]);
2775
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : bn(Object(n)).forEach(function(r) {
2746
2776
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
2747
2777
  });
2748
2778
  }
2749
2779
  return t;
2750
2780
  }
2751
- function ao() {
2781
+ function ho() {
2752
2782
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
2753
- storage: io
2783
+ storage: uo
2754
2784
  };
2755
- return Yi(vn(vn({}, e), t));
2785
+ return eo(kn(kn({}, e), t));
2756
2786
  }
2757
- function so(t, e) {
2787
+ function fo(t, e) {
2758
2788
  e = e || {};
2759
2789
  var n, r, i = [], o = e.max || 1 / 0;
2760
2790
  function a() {
@@ -2776,7 +2806,7 @@ function so(t, e) {
2776
2806
  }
2777
2807
  };
2778
2808
  }
2779
- function co(t) {
2809
+ function po(t) {
2780
2810
  if (typeof window > "u")
2781
2811
  return;
2782
2812
  const { addEventListener: e, history: n, location: r } = window;
@@ -2788,27 +2818,27 @@ function co(t) {
2788
2818
  const s = n[a];
2789
2819
  n[a] = function(...p) {
2790
2820
  var c;
2791
- const f = ((c = p[2]) == null ? void 0 : c.toString()) || "", u = lo(f);
2821
+ const f = ((c = p[2]) == null ? void 0 : c.toString()) || "", u = go(f);
2792
2822
  return i !== u && (i = u, setTimeout(() => t(f), 0)), s.apply(n, p);
2793
2823
  };
2794
2824
  });
2795
2825
  }
2796
- function uo(t, e) {
2826
+ function mo(t, e) {
2797
2827
  const n = t.indexOf(e);
2798
2828
  return n > -1 ? t.slice(0, n) : t;
2799
2829
  }
2800
- function lo(t) {
2801
- return ["#", "?"].forEach((e) => t = uo(t, e)), t;
2830
+ function go(t) {
2831
+ return ["#", "?"].forEach((e) => t = mo(t, e)), t;
2802
2832
  }
2803
- function ho() {
2804
- co(() => {
2833
+ function yo() {
2834
+ po(() => {
2805
2835
  se.page();
2806
2836
  });
2807
2837
  }
2808
- var wn = "EventListener";
2809
- function fo(t) {
2838
+ var In = "EventListener";
2839
+ function vo(t) {
2810
2840
  return function(e, n, r, i) {
2811
- var o = r || li, a = i || !1;
2841
+ var o = r || mi, a = i || !1;
2812
2842
  if (!Y)
2813
2843
  return o;
2814
2844
  var s = et(n), p = et(e, !0);
@@ -2819,9 +2849,9 @@ function fo(t) {
2819
2849
  var f = [];
2820
2850
  return function u(c) {
2821
2851
  c && (f = []);
2822
- for (var h = c ? "add" + wn : "remove" + wn, d = 0; d < p.length; d++) {
2852
+ for (var h = c ? "add" + In : "remove" + In, d = 0; d < p.length; d++) {
2823
2853
  var w = p[d];
2824
- f[d] = c ? a && a.once ? po(o) : o : f[d] || o;
2854
+ f[d] = c ? a && a.once ? wo(o) : o : f[d] || o;
2825
2855
  for (var I = 0; I < s.length; I++)
2826
2856
  w[h] ? w["on" + s[I]] = c ? f[d] : null : w[h](s[I], f[d], a);
2827
2857
  }
@@ -2840,31 +2870,31 @@ function et(t, e) {
2840
2870
  r[i] = t[i];
2841
2871
  return r;
2842
2872
  }
2843
- var o = bi(t);
2873
+ var o = Ei(t);
2844
2874
  return e ? o.map(function(a) {
2845
2875
  return re(a) ? et(a, !0) : a;
2846
2876
  }).flat() : o;
2847
2877
  }
2848
- function po(t, e) {
2878
+ function wo(t, e) {
2849
2879
  var n;
2850
2880
  return function() {
2851
2881
  return t && (n = t.apply(e || this, arguments), t = null), n;
2852
2882
  };
2853
2883
  }
2854
- var gt = fo("Event");
2855
- function cr(t, e) {
2884
+ var yt = vo("Event");
2885
+ function hr(t, e) {
2856
2886
  return Y && G(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), G(n) ? function() {
2857
2887
  n.apply(i, arguments), r.apply(i, arguments);
2858
2888
  } : r) : window[t] = e;
2859
2889
  var n, r, i;
2860
2890
  }
2861
- cr.bind(null, "onerror");
2862
- cr.bind(null, "onload");
2863
- var ur = typeof window > "u", bn = "hidden";
2864
- function mo(t) {
2865
- if (ur)
2891
+ hr.bind(null, "onerror");
2892
+ hr.bind(null, "onload");
2893
+ var fr = typeof window > "u", _n = "hidden";
2894
+ function bo(t) {
2895
+ if (fr)
2866
2896
  return !1;
2867
- var e = go(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2897
+ var e = ko(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2868
2898
  return t(!!document[e]);
2869
2899
  }, i = function() {
2870
2900
  return document.addEventListener(n, r);
@@ -2873,15 +2903,15 @@ function mo(t) {
2873
2903
  return document.removeEventListener(n, r), i;
2874
2904
  };
2875
2905
  }
2876
- function go() {
2906
+ function ko() {
2877
2907
  var t = ["webkit", "moz", "ms", "o"];
2878
- return ur || bn in document ? bn : t.reduce(function(e, n) {
2908
+ return fr || _n in document ? _n : t.reduce(function(e, n) {
2879
2909
  var r = n + "Hidden";
2880
2910
  return !e && r in document ? r : e;
2881
2911
  }, null);
2882
2912
  }
2883
- var yo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2884
- function vo(t, e) {
2913
+ var Io = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2914
+ function _o(t, e) {
2885
2915
  e === void 0 && (e = {});
2886
2916
  var n = /* @__PURE__ */ function(a, s) {
2887
2917
  var p = this, f = !1;
@@ -2892,12 +2922,12 @@ function vo(t, e) {
2892
2922
  };
2893
2923
  }(t, e.throttle || 1e4), r = [];
2894
2924
  function i() {
2895
- var a = mo(function(s) {
2925
+ var a = bo(function(s) {
2896
2926
  s || n({ type: "tabVisible" });
2897
2927
  });
2898
- return r = [a].concat(yo.map(function(s) {
2899
- return gt(document, s, n);
2900
- })).concat(gt(window, "load", n)).concat(gt(window, "scroll", n, { capture: !0, passive: !0 })), o;
2928
+ return r = [a].concat(Io.map(function(s) {
2929
+ return yt(document, s, n);
2930
+ })).concat(yt(window, "load", n)).concat(yt(window, "scroll", n, { capture: !0, passive: !0 })), o;
2901
2931
  }
2902
2932
  function o() {
2903
2933
  r.map(function(a) {
@@ -2908,7 +2938,7 @@ function vo(t, e) {
2908
2938
  return o(), i;
2909
2939
  };
2910
2940
  }
2911
- function wo(t) {
2941
+ function So(t) {
2912
2942
  var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, p = t.throttle, f = p === void 0 ? 2e3 : p, u = !1, c = !1, h = /* @__PURE__ */ new Date(), d = function() {
2913
2943
  return clearTimeout(e);
2914
2944
  };
@@ -2917,7 +2947,7 @@ function wo(t) {
2917
2947
  u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(h), y));
2918
2948
  }, s);
2919
2949
  }
2920
- var I = vo(w, { throttle: f });
2950
+ var I = _o(w, { throttle: f });
2921
2951
  return { disable: function() {
2922
2952
  c = !0, u = !1, d();
2923
2953
  var y = I();
@@ -2931,8 +2961,8 @@ function wo(t) {
2931
2961
  function ze(t, e) {
2932
2962
  return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
2933
2963
  }
2934
- const kn = 5e3;
2935
- class bo {
2964
+ const Sn = 5e3;
2965
+ class Eo {
2936
2966
  constructor(e) {
2937
2967
  B(this, "element");
2938
2968
  B(this, "isInViewport", !1);
@@ -2953,10 +2983,10 @@ class bo {
2953
2983
  {
2954
2984
  threshold: 0
2955
2985
  }
2956
- ), this.observer.observe(this.element), wo({
2986
+ ), this.observer.observe(this.element), So({
2957
2987
  onIdle: (n) => this.handleAwake(!1, n),
2958
2988
  onWakeUp: (n) => this.handleAwake(!0, n),
2959
- timeout: kn
2989
+ timeout: Sn
2960
2990
  });
2961
2991
  }
2962
2992
  /**
@@ -2969,7 +2999,7 @@ class bo {
2969
2999
  e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
2970
3000
  }
2971
3001
  handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
2972
- this.isAwake = e, this.lastEventAt = e ? Date.now() - n * kn : Date.now(), this.isInViewport && this.trackAwake(e, n);
3002
+ this.isAwake = e, this.lastEventAt = e ? Date.now() - n * Sn : Date.now(), this.isInViewport && this.trackAwake(e, n);
2973
3003
  }
2974
3004
  handleVisibilityChange() {
2975
3005
  this.isAwake = !1;
@@ -2983,17 +3013,17 @@ class bo {
2983
3013
  this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
2984
3014
  }
2985
3015
  }
2986
- const In = "sesamy_session_id";
2987
- function ko() {
2988
- let t = sessionStorage.getItem(In);
2989
- return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(In, t)), t;
3016
+ const En = "sesamy_session_id";
3017
+ function Oo() {
3018
+ let t = sessionStorage.getItem(En);
3019
+ return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(En, t)), t;
2990
3020
  }
2991
- let lr = !1, St, _n, tt;
2992
- function Io({ clientId: t, enabled: e = !0, endpoint: n = Wr }) {
2993
- if (St = t, _n = e, tt = n, !_n)
3021
+ let pr = !1, Et, On, tt;
3022
+ function To({ clientId: t, enabled: e = !0, endpoint: n = Fr }) {
3023
+ if (Et = t, On = e, tt = n, !On)
2994
3024
  return;
2995
- ho();
2996
- const r = new bo({
3025
+ yo();
3026
+ const r = new Eo({
2997
3027
  element: document.body,
2998
3028
  viewCallback: () => {
2999
3029
  se.page();
@@ -3013,26 +3043,26 @@ function Io({ clientId: t, enabled: e = !0, endpoint: n = Wr }) {
3013
3043
  });
3014
3044
  }
3015
3045
  });
3016
- So(document.body, () => {
3046
+ jo(document.body, () => {
3017
3047
  r.flush();
3018
- }), Eo(document.body, () => {
3048
+ }), xo(document.body, () => {
3019
3049
  r.handleVisibilityChange();
3020
- }), window.addEventListener(Se.AUTHENTICATED, async (i) => {
3050
+ }), window.addEventListener(pe.AUTHENTICATED, async (i) => {
3021
3051
  const o = i;
3022
3052
  await se.identify(o.detail.sub);
3023
- }), window.addEventListener(Se.LOGOUT, async () => {
3024
- await se.track("logout", {}), Nt.flush(), await se.reset();
3053
+ }), window.addEventListener(pe.LOGOUT, async () => {
3054
+ await se.track("logout", {}), Lt.flush(), await se.reset();
3025
3055
  });
3026
3056
  }
3027
- function dr(t) {
3057
+ function mr(t) {
3028
3058
  return JSON.stringify(
3029
3059
  t.map((e) => ({
3030
3060
  ...e,
3031
- clientId: St,
3061
+ clientId: Et,
3032
3062
  requestId: Math.random().toString(36).slice(2, 9),
3033
- sessionId: ko(),
3063
+ sessionId: Oo(),
3034
3064
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3035
- version: Tt,
3065
+ version: Ct,
3036
3066
  event: e.event,
3037
3067
  context: {
3038
3068
  page: {
@@ -3043,18 +3073,18 @@ function dr(t) {
3043
3073
  referrer: document.referrer
3044
3074
  },
3045
3075
  locale: navigator.language,
3046
- library: Zn,
3076
+ library: Jn,
3047
3077
  userAgent: navigator.userAgent,
3048
- clientId: St
3078
+ clientId: Et
3049
3079
  }
3050
3080
  }))
3051
3081
  );
3052
3082
  }
3053
- const Nt = so(
3083
+ const Lt = fo(
3054
3084
  async (t) => {
3055
3085
  if (t.length > 0) {
3056
- const e = dr(t);
3057
- lr ? navigator.sendBeacon(tt, e) : (await fetch(tt, {
3086
+ const e = mr(t);
3087
+ pr ? navigator.sendBeacon(tt, e) : (await fetch(tt, {
3058
3088
  method: "POST",
3059
3089
  body: e,
3060
3090
  headers: {
@@ -3070,24 +3100,24 @@ const Nt = so(
3070
3100
  // 3s
3071
3101
  }
3072
3102
  );
3073
- function yt(t) {
3103
+ function vt(t) {
3074
3104
  var e;
3075
3105
  if (t.anonymousId)
3076
3106
  if ((e = t.properties) != null && e.flushing) {
3077
3107
  const n = { ...t };
3078
- delete n.properties.flushing, navigator.sendBeacon(tt, dr([n]));
3108
+ delete n.properties.flushing, navigator.sendBeacon(tt, mr([n]));
3079
3109
  } else
3080
- Nt.push(t);
3110
+ Lt.push(t);
3081
3111
  }
3082
- const se = ao({
3083
- app: Zn,
3084
- version: Tt,
3112
+ const se = ho({
3113
+ app: Jn,
3114
+ version: Ct,
3085
3115
  plugins: [
3086
3116
  {
3087
3117
  name: "custom-analytics-plugin",
3088
3118
  page: ({ payload: t }) => {
3089
3119
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
3090
- yt({
3120
+ vt({
3091
3121
  anonymousId: n,
3092
3122
  userId: r,
3093
3123
  properties: e,
@@ -3097,7 +3127,7 @@ const se = ao({
3097
3127
  },
3098
3128
  track: ({ payload: t }) => {
3099
3129
  const { properties: e, anonymousId: n, userId: r, event: i } = t;
3100
- yt({
3130
+ vt({
3101
3131
  anonymousId: n,
3102
3132
  userId: r,
3103
3133
  properties: e,
@@ -3107,7 +3137,7 @@ const se = ao({
3107
3137
  },
3108
3138
  identify: ({ payload: t }) => {
3109
3139
  const { properties: e, anonymousId: n, userId: r } = t;
3110
- yt({
3140
+ vt({
3111
3141
  anonymousId: n,
3112
3142
  userId: r,
3113
3143
  properties: e,
@@ -3117,50 +3147,58 @@ const se = ao({
3117
3147
  }
3118
3148
  ]
3119
3149
  });
3120
- function _o() {
3121
- return lr = !0, Nt.flush();
3150
+ function Po() {
3151
+ return pr = !0, Lt.flush();
3122
3152
  }
3123
- const hr = /* @__PURE__ */ new Map();
3124
- function So(t, e) {
3125
- hr.set(t, e);
3153
+ const gr = /* @__PURE__ */ new Map();
3154
+ function jo(t, e) {
3155
+ gr.set(t, e);
3126
3156
  }
3127
3157
  window.addEventListener("beforeunload", () => {
3128
- hr.forEach((t, e) => {
3158
+ gr.forEach((t, e) => {
3129
3159
  t.bind(e)();
3130
- }), _o();
3160
+ }), Po();
3131
3161
  });
3132
- const fr = /* @__PURE__ */ new Map();
3133
- function Eo(t, e) {
3134
- fr.set(t, e);
3162
+ const yr = /* @__PURE__ */ new Map();
3163
+ function xo(t, e) {
3164
+ yr.set(t, e);
3135
3165
  }
3136
3166
  window.addEventListener("visibilitychange", () => {
3137
- document.visibilityState !== "visible" && fr.forEach((t, e) => {
3167
+ document.visibilityState !== "visible" && yr.forEach((t, e) => {
3138
3168
  t.bind(e)();
3139
3169
  });
3140
3170
  });
3141
- async function Oo(t) {
3142
- Io({
3171
+ function Co() {
3172
+ const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
3173
+ if (e && n) {
3174
+ Zn(e, parseInt(n, 10));
3175
+ const r = new URL(window.location.href);
3176
+ t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
3177
+ }
3178
+ }
3179
+ async function Ao(t) {
3180
+ To({
3143
3181
  clientId: t.clientId,
3144
3182
  // The default client id can be overridden by the config
3145
3183
  ...t.analytics
3146
- }), await Kr({
3184
+ }), await Hr({
3147
3185
  clientId: t.clientId,
3148
3186
  // The default client id can be overridden by the config
3149
3187
  ...t.auth
3150
3188
  });
3151
- const e = ci(t.api || {});
3152
- return Et(Se.READY, {}), e;
3189
+ const e = fi(t.api || {});
3190
+ return nt(pe.READY, {}), Co(), e;
3153
3191
  }
3154
3192
  if (typeof document < "u") {
3155
3193
  const t = document.getElementById("sesamy-js");
3156
3194
  if (t != null && t.textContent)
3157
3195
  try {
3158
3196
  const e = JSON.parse(t.textContent);
3159
- Oo(e);
3197
+ Ao(e);
3160
3198
  } catch (e) {
3161
3199
  console.error("Failed to parse config", e);
3162
3200
  }
3163
3201
  }
3164
3202
  export {
3165
- Oo as init
3203
+ Ao as init
3166
3204
  };