@sesamy/sesamy-js 1.3.13 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var pr = Object.defineProperty;
2
- var mr = (t, e, n) => e in t ? pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => (mr(t, typeof e != "symbol" ? e + "" : e, n), n);
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
4
  function Et(t, e) {
5
5
  const n = new CustomEvent(t, {
6
6
  detail: e,
@@ -59,91 +59,91 @@ var ae = Pt(function(t, e) {
59
59
  };
60
60
  });
61
61
  Ot(ae);
62
- var gr = Ot(Pt(function(t, e) {
62
+ var yr = Ot(Pt(function(t, e) {
63
63
  var n = ce && ce.__awaiter || function(u, c, h, d) {
64
- return new (h || (h = Promise))(function(b, v) {
65
- function g(w) {
64
+ return new (h || (h = Promise))(function(w, I) {
65
+ function y(v) {
66
66
  try {
67
- _(d.next(w));
67
+ E(d.next(v));
68
68
  } catch (l) {
69
- v(l);
69
+ I(l);
70
70
  }
71
71
  }
72
- function I(w) {
72
+ function S(v) {
73
73
  try {
74
- _(d.throw(w));
74
+ E(d.throw(v));
75
75
  } catch (l) {
76
- v(l);
76
+ I(l);
77
77
  }
78
78
  }
79
- function _(w) {
80
- w.done ? b(w.value) : new h(function(l) {
81
- l(w.value);
82
- }).then(g, I);
79
+ function E(v) {
80
+ v.done ? w(v.value) : new h(function(l) {
81
+ l(v.value);
82
+ }).then(y, S);
83
83
  }
84
- _((d = d.apply(u, c || [])).next());
84
+ E((d = d.apply(u, c || [])).next());
85
85
  });
86
86
  }, r = ce && ce.__generator || function(u, c) {
87
- var h, d, b, v, g = { label: 0, sent: function() {
88
- if (1 & b[0])
89
- throw b[1];
90
- return b[1];
87
+ var h, d, w, I, y = { label: 0, sent: function() {
88
+ if (1 & w[0])
89
+ throw w[1];
90
+ return w[1];
91
91
  }, trys: [], ops: [] };
92
- return v = { next: I(0), throw: I(1), return: I(2) }, typeof Symbol == "function" && (v[Symbol.iterator] = function() {
92
+ return I = { next: S(0), throw: S(1), return: S(2) }, typeof Symbol == "function" && (I[Symbol.iterator] = function() {
93
93
  return this;
94
- }), v;
95
- function I(_) {
96
- return function(w) {
94
+ }), I;
95
+ function S(E) {
96
+ return function(v) {
97
97
  return function(l) {
98
98
  if (h)
99
99
  throw new TypeError("Generator is already executing.");
100
- for (; g; )
100
+ for (; y; )
101
101
  try {
102
- if (h = 1, d && (b = 2 & l[0] ? d.return : l[0] ? d.throw || ((b = d.return) && b.call(d), 0) : d.next) && !(b = b.call(d, l[1])).done)
103
- return b;
104
- switch (d = 0, b && (l = [2 & l[0], b.value]), l[0]) {
102
+ if (h = 1, d && (w = 2 & l[0] ? d.return : l[0] ? d.throw || ((w = d.return) && w.call(d), 0) : d.next) && !(w = w.call(d, l[1])).done)
103
+ return w;
104
+ switch (d = 0, w && (l = [2 & l[0], w.value]), l[0]) {
105
105
  case 0:
106
106
  case 1:
107
- b = l;
107
+ w = l;
108
108
  break;
109
109
  case 4:
110
- return g.label++, { value: l[1], done: !1 };
110
+ return y.label++, { value: l[1], done: !1 };
111
111
  case 5:
112
- g.label++, d = l[1], l = [0];
112
+ y.label++, d = l[1], l = [0];
113
113
  continue;
114
114
  case 7:
115
- l = g.ops.pop(), g.trys.pop();
115
+ l = y.ops.pop(), y.trys.pop();
116
116
  continue;
117
117
  default:
118
- if (b = g.trys, !((b = b.length > 0 && b[b.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
119
- g = 0;
118
+ if (w = y.trys, !((w = w.length > 0 && w[w.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
119
+ y = 0;
120
120
  continue;
121
121
  }
122
- if (l[0] === 3 && (!b || l[1] > b[0] && l[1] < b[3])) {
123
- g.label = l[1];
122
+ if (l[0] === 3 && (!w || l[1] > w[0] && l[1] < w[3])) {
123
+ y.label = l[1];
124
124
  break;
125
125
  }
126
- if (l[0] === 6 && g.label < b[1]) {
127
- g.label = b[1], b = l;
126
+ if (l[0] === 6 && y.label < w[1]) {
127
+ y.label = w[1], w = l;
128
128
  break;
129
129
  }
130
- if (b && g.label < b[2]) {
131
- g.label = b[2], g.ops.push(l);
130
+ if (w && y.label < w[2]) {
131
+ y.label = w[2], y.ops.push(l);
132
132
  break;
133
133
  }
134
- b[2] && g.ops.pop(), g.trys.pop();
134
+ w[2] && y.ops.pop(), y.trys.pop();
135
135
  continue;
136
136
  }
137
- l = c.call(u, g);
138
- } catch (k) {
139
- l = [6, k], d = 0;
137
+ l = c.call(u, y);
138
+ } catch (b) {
139
+ l = [6, b], d = 0;
140
140
  } finally {
141
- h = b = 0;
141
+ h = w = 0;
142
142
  }
143
143
  if (5 & l[0])
144
144
  throw l[1];
145
145
  return { value: l[0] ? l[1] : void 0, done: !0 };
146
- }([_, w]);
146
+ }([E, v]);
147
147
  };
148
148
  }
149
149
  }, i = ce;
@@ -205,21 +205,21 @@ var gr = Ot(Pt(function(t, e) {
205
205
  }
206
206
  return u.prototype.acquireLock = function(c, h) {
207
207
  return h === void 0 && (h = 5e3), n(this, void 0, void 0, function() {
208
- var d, b, v, g, I, _, w;
208
+ var d, w, I, y, S, E, v;
209
209
  return r(this, function(l) {
210
210
  switch (l.label) {
211
211
  case 0:
212
- d = Date.now() + p(4), b = Date.now() + h, v = o + "-" + c, g = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
212
+ d = Date.now() + p(4), w = Date.now() + h, I = o + "-" + c, y = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
213
213
  case 1:
214
- return Date.now() < b ? [4, s(30)] : [3, 8];
214
+ return Date.now() < w ? [4, s(30)] : [3, 8];
215
215
  case 2:
216
- return l.sent(), g.getItemSync(v) !== null ? [3, 5] : (I = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
216
+ return l.sent(), y.getItemSync(I) !== null ? [3, 5] : (S = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
217
217
  case 3:
218
- return l.sent(), g.setItemSync(v, JSON.stringify({ id: this.id, iat: d, timeoutKey: I, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
218
+ return l.sent(), y.setItemSync(I, JSON.stringify({ id: this.id, iat: d, timeoutKey: S, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
219
219
  case 4:
220
- return l.sent(), (_ = g.getItemSync(v)) !== null && (w = JSON.parse(_)).id === this.id && w.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(v, d), [2, !0]) : [3, 7];
220
+ return l.sent(), (E = y.getItemSync(I)) !== null && (v = JSON.parse(E)).id === this.id && v.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(I, d), [2, !0]) : [3, 7];
221
221
  case 5:
222
- return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(b)];
222
+ return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(w)];
223
223
  case 6:
224
224
  l.sent(), l.label = 7;
225
225
  case 7:
@@ -232,16 +232,16 @@ var gr = Ot(Pt(function(t, e) {
232
232
  }, u.prototype.refreshLockWhileAcquired = function(c, h) {
233
233
  return n(this, void 0, void 0, function() {
234
234
  var d = this;
235
- return r(this, function(b) {
235
+ return r(this, function(w) {
236
236
  return setTimeout(function() {
237
237
  return n(d, void 0, void 0, function() {
238
- var v, g, I;
239
- return r(this, function(_) {
240
- switch (_.label) {
238
+ var I, y, S;
239
+ return r(this, function(E) {
240
+ switch (E.label) {
241
241
  case 0:
242
242
  return [4, ae.default().lock(h)];
243
243
  case 1:
244
- return _.sent(), this.acquiredIatSet.has(h) ? (v = this.storageHandler === void 0 ? a : this.storageHandler, (g = v.getItemSync(c)) === null ? (ae.default().unlock(h), [2]) : ((I = JSON.parse(g)).timeRefreshed = Date.now(), v.setItemSync(c, JSON.stringify(I)), ae.default().unlock(h), this.refreshLockWhileAcquired(c, h), [2])) : (ae.default().unlock(h), [2]);
244
+ return E.sent(), this.acquiredIatSet.has(h) ? (I = this.storageHandler === void 0 ? a : this.storageHandler, (y = I.getItemSync(c)) === null ? (ae.default().unlock(h), [2]) : ((S = JSON.parse(y)).timeRefreshed = Date.now(), I.setItemSync(c, JSON.stringify(S)), ae.default().unlock(h), this.refreshLockWhileAcquired(c, h), [2])) : (ae.default().unlock(h), [2]);
245
245
  }
246
246
  });
247
247
  });
@@ -254,16 +254,16 @@ var gr = Ot(Pt(function(t, e) {
254
254
  switch (h.label) {
255
255
  case 0:
256
256
  return [4, new Promise(function(d) {
257
- var b = !1, v = Date.now(), g = !1;
258
- function I() {
259
- if (g || (window.removeEventListener("storage", I), u.removeFromWaiting(I), clearTimeout(_), g = !0), !b) {
260
- b = !0;
261
- var w = 50 - (Date.now() - v);
262
- w > 0 ? setTimeout(d, w) : d(null);
257
+ var w = !1, I = Date.now(), y = !1;
258
+ function S() {
259
+ if (y || (window.removeEventListener("storage", S), u.removeFromWaiting(S), clearTimeout(E), y = !0), !w) {
260
+ w = !0;
261
+ var v = 50 - (Date.now() - I);
262
+ v > 0 ? setTimeout(d, v) : d(null);
263
263
  }
264
264
  }
265
- window.addEventListener("storage", I), u.addToWaiting(I);
266
- var _ = setTimeout(I, Math.max(0, c - Date.now()));
265
+ window.addEventListener("storage", S), u.addToWaiting(S);
266
+ var E = setTimeout(S, Math.max(0, c - Date.now()));
267
267
  })];
268
268
  case 1:
269
269
  return h.sent(), [2];
@@ -293,41 +293,41 @@ var gr = Ot(Pt(function(t, e) {
293
293
  });
294
294
  }, u.prototype.releaseLock__private__ = function(c) {
295
295
  return n(this, void 0, void 0, function() {
296
- var h, d, b, v;
297
- return r(this, function(g) {
298
- switch (g.label) {
296
+ var h, d, w, I;
297
+ return r(this, function(y) {
298
+ switch (y.label) {
299
299
  case 0:
300
- return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (b = h.getItemSync(d)) === null ? [2] : (v = JSON.parse(b)).id !== this.id ? [3, 2] : [4, ae.default().lock(v.iat)];
300
+ return h = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = h.getItemSync(d)) === null ? [2] : (I = JSON.parse(w)).id !== this.id ? [3, 2] : [4, ae.default().lock(I.iat)];
301
301
  case 1:
302
- g.sent(), this.acquiredIatSet.delete(v.iat), h.removeItemSync(d), ae.default().unlock(v.iat), u.notifyWaiters(), g.label = 2;
302
+ y.sent(), this.acquiredIatSet.delete(I.iat), h.removeItemSync(d), ae.default().unlock(I.iat), u.notifyWaiters(), y.label = 2;
303
303
  case 2:
304
304
  return [2];
305
305
  }
306
306
  });
307
307
  });
308
308
  }, u.lockCorrector = function(c) {
309
- for (var h = Date.now() - 5e3, d = c, b = [], v = 0; ; ) {
310
- var g = d.keySync(v);
311
- if (g === null)
309
+ for (var h = Date.now() - 5e3, d = c, w = [], I = 0; ; ) {
310
+ var y = d.keySync(I);
311
+ if (y === null)
312
312
  break;
313
- b.push(g), v++;
313
+ w.push(y), I++;
314
314
  }
315
- for (var I = !1, _ = 0; _ < b.length; _++) {
316
- var w = b[_];
317
- if (w.includes(o)) {
318
- var l = d.getItemSync(w);
315
+ for (var S = !1, E = 0; E < w.length; E++) {
316
+ var v = w[E];
317
+ if (v.includes(o)) {
318
+ var l = d.getItemSync(v);
319
319
  if (l !== null) {
320
- var k = JSON.parse(l);
321
- (k.timeRefreshed === void 0 && k.timeAcquired < h || k.timeRefreshed !== void 0 && k.timeRefreshed < h) && (d.removeItemSync(w), I = !0);
320
+ var b = JSON.parse(l);
321
+ (b.timeRefreshed === void 0 && b.timeAcquired < h || b.timeRefreshed !== void 0 && b.timeRefreshed < h) && (d.removeItemSync(v), S = !0);
322
322
  }
323
323
  }
324
324
  }
325
- I && u.notifyWaiters();
325
+ S && u.notifyWaiters();
326
326
  }, u.waiters = void 0, u;
327
327
  }();
328
328
  e.default = f;
329
329
  }));
330
- const yr = { timeoutInSeconds: 60 }, Sn = { name: "auth0-spa-js", version: "2.1.3" }, En = () => Date.now();
330
+ const vr = { timeoutInSeconds: 60 }, Sn = { name: "auth0-spa-js", version: "2.1.3" }, En = () => Date.now();
331
331
  let V = class vt extends Error {
332
332
  constructor(e, n) {
333
333
  super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, vt.prototype);
@@ -335,7 +335,7 @@ let V = class vt extends Error {
335
335
  static fromPayload({ error: e, error_description: n }) {
336
336
  return new vt(e, n);
337
337
  }
338
- }, vr = class On extends V {
338
+ }, wr = class On extends V {
339
339
  constructor(e, n, r, i = null) {
340
340
  super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, On.prototype);
341
341
  }
@@ -343,47 +343,47 @@ let V = class vt extends Error {
343
343
  constructor() {
344
344
  super("timeout", "Timeout"), Object.setPrototypeOf(this, Pn.prototype);
345
345
  }
346
- }, wr = class Tn extends wt {
346
+ }, br = class Tn extends wt {
347
347
  constructor(e) {
348
348
  super(), this.popup = e, Object.setPrototypeOf(this, Tn.prototype);
349
349
  }
350
- }, br = class jn extends V {
350
+ }, kr = class jn extends V {
351
351
  constructor(e) {
352
352
  super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, jn.prototype);
353
353
  }
354
- }, kr = class xn extends V {
354
+ }, Ir = class xn extends V {
355
355
  constructor(e, n, r) {
356
356
  super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, xn.prototype);
357
357
  }
358
358
  }, Cn = class $n extends V {
359
359
  constructor(e, n) {
360
- super("missing_refresh_token", `Missing Refresh Token (audience: '${Lt(e, ["default"])}', scope: '${Lt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, $n.prototype);
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);
361
361
  }
362
362
  };
363
- function Lt(t, e = []) {
363
+ function Ut(t, e = []) {
364
364
  return t && !e.includes(t) ? t : "";
365
365
  }
366
366
  const Ge = () => window.crypto, ct = () => {
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
- }, Ut = (t) => btoa(t), bt = (t) => {
370
+ }, Lt = (t) => btoa(t), bt = (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, "+")), Ir = async (t, e) => {
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) => {
374
374
  const n = await fetch(t, e);
375
375
  return { ok: n.ok, json: await n.json() };
376
- }, _r = async (t, e, n) => {
376
+ }, Sr = async (t, e, n) => {
377
377
  const r = new AbortController();
378
378
  let i;
379
- return e.signal = r.signal, Promise.race([Ir(t, e), new Promise((o, a) => {
379
+ return e.signal = r.signal, Promise.race([_r(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
- }, Sr = async (t, e, n, r, i, o, a) => {
386
+ }, Er = 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,30 +391,30 @@ const Ge = () => window.crypto, ct = () => {
391
391
  }, p.postMessage(s, [c.port2]);
392
392
  });
393
393
  var s, p;
394
- }, Er = async (t, e, n, r, i, o, a = 1e4) => i ? Sr(t, e, n, r, a, i, o) : _r(t, r, a);
395
- async function Or(t, e) {
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) {
396
396
  var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, p = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
397
397
  const f = s ? bt(p) : JSON.stringify(p);
398
- return await async function(u, c, h, d, b, v, g) {
399
- let I, _ = null;
400
- for (let x = 0; x < 3; x++)
398
+ return await async function(u, c, h, d, w, I, y) {
399
+ let S, E = null;
400
+ for (let _ = 0; _ < 3; _++)
401
401
  try {
402
- I = await Er(u, h, d, b, v, g, c), _ = null;
402
+ S = await Or(u, h, d, w, I, y, c), E = null;
403
403
  break;
404
- } catch (L) {
405
- _ = L;
404
+ } catch (A) {
405
+ E = A;
406
406
  }
407
- if (_)
408
- throw _;
409
- const w = I.json, { error: l, error_description: k } = w, T = Q(w, ["error", "error_description"]), { ok: P } = I;
410
- if (!P) {
411
- const x = k || `HTTP error. Unable to fetch ${u}`;
412
- throw l === "mfa_required" ? new kr(l, x, T.mfa_token) : l === "missing_refresh_token" ? new Cn(h, d) : new V(l || "request_error", x);
407
+ if (E)
408
+ throw E;
409
+ const v = S.json, { error: l, error_description: b } = v, j = Q(v, ["error", "error_description"]), { ok: k } = S;
410
+ if (!k) {
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", _);
413
413
  }
414
- return T;
414
+ return j;
415
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);
416
416
  }
417
- const Me = (...t) => {
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
  };
@@ -433,7 +433,7 @@ let le = class kt {
433
433
  const { scope: n, audience: r, client_id: i } = e;
434
434
  return new kt({ scope: n, audience: r, clientId: i });
435
435
  }
436
- }, Pr = class {
436
+ }, Tr = 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
- }, zn = class {
455
+ }, An = class {
456
456
  constructor() {
457
457
  this.enclosedCache = /* @__PURE__ */ function() {
458
458
  let e = {};
@@ -467,7 +467,7 @@ let le = class kt {
467
467
  }, allKeys: () => Object.keys(e) };
468
468
  }();
469
469
  }
470
- }, Tr = class {
470
+ }, jr = class {
471
471
  constructor(e, n, r) {
472
472
  this.cache = e, this.keyManifest = n, this.nowProvider = r || En;
473
473
  }
@@ -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
- }, jr = class {
533
+ }, xr = 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,7 +544,7 @@ let le = class kt {
544
544
  this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
545
545
  }
546
546
  };
547
- const ze = (t) => typeof t == "number", xr = ["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"], Cr = (t) => {
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) => {
548
548
  if (!t.id_token)
549
549
  throw new Error("ID token is required but missing");
550
550
  const e = ((o) => {
@@ -553,7 +553,7 @@ const ze = (t) => typeof t == "number", xr = ["iss", "aud", "exp", "nbf", "iat",
553
553
  throw new Error("ID token could not be decoded");
554
554
  const u = JSON.parse(Rt(p)), c = { __raw: o }, h = {};
555
555
  return Object.keys(u).forEach((d) => {
556
- c[d] = u[d], xr.includes(d) || (h[d] = u[d]);
556
+ c[d] = u[d], Cr.includes(d) || (h[d] = u[d]);
557
557
  }), { encoded: { header: s, payload: p, signature: f }, header: JSON.parse(Rt(s)), claims: c, user: h };
558
558
  })(t.id_token);
559
559
  if (!e.claims.iss)
@@ -583,21 +583,21 @@ const ze = (t) => typeof t == "number", xr = ["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 && !ze(e.claims.auth_time))
586
+ if (t.max_age && !Ae(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 || !ze(e.claims.exp))
588
+ if (e.claims.exp == null || !Ae(e.claims.exp))
589
589
  throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
590
- if (!ze(e.claims.iat))
590
+ if (!Ae(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 && ze(e.claims.nbf)) {
595
+ if (e.claims.nbf != null && Ae(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 && ze(e.claims.auth_time)) {
600
+ if (e.claims.auth_time != null && Ae(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}`);
@@ -646,10 +646,10 @@ var de = Pt(function(t, e) {
646
646
  }
647
647
  function o(p) {
648
648
  for (var f = {}, u = p ? p.split("; ") : [], c = /(%[\dA-F]{2})+/gi, h = 0; h < u.length; h++) {
649
- var d = u[h].split("="), b = d.slice(1).join("=");
650
- b.charAt(0) === '"' && (b = b.slice(1, -1));
649
+ var d = u[h].split("="), w = d.slice(1).join("=");
650
+ w.charAt(0) === '"' && (w = w.slice(1, -1));
651
651
  try {
652
- f[d[0].replace(c, decodeURIComponent)] = b.replace(c, decodeURIComponent);
652
+ f[d[0].replace(c, decodeURIComponent)] = w.replace(c, decodeURIComponent);
653
653
  } catch {
654
654
  }
655
655
  }
@@ -668,14 +668,14 @@ var de = Pt(function(t, e) {
668
668
  };
669
669
  });
670
670
  Ot(de), de.encode, de.parse, de.getAll;
671
- var $r = de.get, An = de.set, Nn = de.remove;
671
+ var Ar = de.get, zn = de.set, Nn = de.remove;
672
672
  const ve = { get(t) {
673
- const e = $r(t);
673
+ const e = Ar(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), An(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), zn(t, JSON.stringify(e), r);
679
679
  }, remove(t, e) {
680
680
  let n = {};
681
681
  e != null && e.cookieDomain && (n.domain = e.cookieDomain), Nn(t, n);
@@ -683,11 +683,11 @@ const ve = { get(t) {
683
683
  return ve.get(t) || ve.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), An(`_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), zn(`_legacy_${t}`, JSON.stringify(e), r), ve.save(t, e, n);
687
687
  }, remove(t, e) {
688
688
  let n = {};
689
689
  e != null && e.cookieDomain && (n.domain = e.cookieDomain), Nn(t, n), ve.remove(t, e), ve.remove(`_legacy_${t}`, e);
690
- } }, Ar = { get(t) {
690
+ } }, Nr = { 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 Nr(t, e, n) {
700
+ function Dr(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,8 +710,8 @@ function Nr(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, Wt, Kt, ut, Dr = (Zt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Wt = null, Kt = !1, function(t) {
714
- return ut = ut || Nr(Zt, Wt, Kt), new Worker(ut, t);
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);
715
715
  });
716
716
  const lt = {};
717
717
  let Lr = class {
@@ -740,14 +740,14 @@ let Lr = class {
740
740
  return `@@auth0spajs@@::${e}`;
741
741
  }
742
742
  };
743
- const Ur = { memory: () => new zn().enclosedCache, localstorage: () => new Pr() }, Mt = (t) => Ur[t], Jt = (t) => {
743
+ const Rr = { memory: () => new An().enclosedCache, localstorage: () => new Tr() }, Kt = (t) => Rr[t], Jt = (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 gr();
747
- let Rr = class {
746
+ }, dt = new yr();
747
+ let Zr = class {
748
748
  constructor(e) {
749
749
  let n, r;
750
- if (this.userCache = new zn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
750
+ if (this.userCache = new An().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
751
751
  await dt.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())
@@ -759,14 +759,14 @@ let Rr = 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", !Mt(n))
762
+ if (n = e.cacheLocation || "memory", !Kt(n))
763
763
  throw new Error(`Invalid cache location "${n}"`);
764
- r = Mt(n)();
764
+ r = Kt(n)();
765
765
  }
766
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 : Ar;
767
+ const i = e.useCookiesForTransactions ? this.cookieStorage : Nr;
768
768
  var o;
769
- this.scope = Me("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new jr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || En, this.cacheManager = new Tr(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 Dr());
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());
770
770
  }
771
771
  _url(e) {
772
772
  const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Sn)));
@@ -777,20 +777,20 @@ let Rr = class {
777
777
  }
778
778
  async _verifyIdToken(e, n, r) {
779
779
  const i = await this.nowProvider();
780
- return Cr({ 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 $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 });
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 = Ut(ct()), o = Ut(ct()), a = ct(), s = ((u) => {
787
+ const i = Lt(ct()), o = Lt(ct()), a = ct(), s = ((u) => {
788
788
  const c = new Uint8Array(u);
789
789
  return ((h) => {
790
790
  const d = { "+": "-", "/": "_", "=": "" };
791
- return h.replace(/[+/=]/g, (b) => d[b]);
791
+ return h.replace(/[+/=]/g, (w) => d[w]);
792
792
  })(window.btoa(String.fromCharCode(...Array.from(c))));
793
- })(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, b, v, g, I) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Me(c, h.scope), response_type: "code", response_mode: I || "query", state: d, nonce: b, redirect_uri: g || u.authorizationParams.redirect_uri, code_challenge: v, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), f = this._authorizeUrl(p);
793
+ })(await (async (u) => await Ge().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, h, d, w, I, y, S) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), h), { scope: Ke(c, h.scope), response_type: "code", response_mode: S || "query", state: d, nonce: w, redirect_uri: y || u.authorizationParams.redirect_uri, code_challenge: I, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), f = this._authorizeUrl(p);
794
794
  return { nonce: o, code_verifier: a, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: i, url: f };
795
795
  }
796
796
  async loginWithPopup(e, n) {
@@ -805,9 +805,9 @@ let Rr = 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 br(s.popup)));
808
+ s.popup && s.popup.closed && (clearInterval(c), clearTimeout(h), window.removeEventListener("message", u, !1), f(new kr(s.popup)));
809
809
  }, 1e3), h = setTimeout(() => {
810
- clearInterval(c), f(new wr(s.popup)), window.removeEventListener("message", u, !1);
810
+ clearInterval(c), f(new br(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") {
@@ -851,7 +851,7 @@ let Rr = class {
851
851
  if (!s)
852
852
  throw new V("missing_transaction", "Invalid state");
853
853
  if (this.transactionManager.remove(), o)
854
- throw new vr(o, a || o, r, s.appState);
854
+ throw new wr(o, a || o, r, s.appState);
855
855
  if (!s.code_verifier || s.state && s.state !== r)
856
856
  throw new V("state_mismatch", "Invalid state");
857
857
  const p = s.organization, f = s.nonce, u = s.redirect_uri;
@@ -870,7 +870,7 @@ let Rr = class {
870
870
  }
871
871
  async getTokenSilently(e = {}) {
872
872
  var n;
873
- const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
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
874
  let s = lt[a];
875
875
  return s || (s = o().finally(() => {
876
876
  delete lt[a], s = null;
@@ -908,8 +908,8 @@ let Rr = class {
908
908
  }
909
909
  async getTokenWithPopup(e = {}, n = {}) {
910
910
  var r;
911
- const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
912
- return n = Object.assign(Object.assign({}, yr), 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;
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;
913
913
  }
914
914
  async isAuthenticated() {
915
915
  return !!await this.getUser();
@@ -932,22 +932,22 @@ let Rr = class {
932
932
  try {
933
933
  if (window.crossOriginIsolated)
934
934
  throw new V("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
935
- const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((b, v, g = 60) => new Promise((I, _) => {
936
- const w = window.document.createElement("iframe");
937
- w.setAttribute("width", "0"), w.setAttribute("height", "0"), w.style.display = "none";
935
+ const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, h = await ((w, I, y = 60) => new Promise((S, E) => {
936
+ const v = window.document.createElement("iframe");
937
+ v.setAttribute("width", "0"), v.setAttribute("height", "0"), v.style.display = "none";
938
938
  const l = () => {
939
- window.document.body.contains(w) && (window.document.body.removeChild(w), window.removeEventListener("message", k, !1));
939
+ window.document.body.contains(v) && (window.document.body.removeChild(v), window.removeEventListener("message", b, !1));
940
940
  };
941
- let k;
942
- const T = setTimeout(() => {
943
- _(new wt()), l();
944
- }, 1e3 * g);
945
- k = function(P) {
946
- if (P.origin != v || !P.data || P.data.type !== "authorization_response")
941
+ let b;
942
+ const j = setTimeout(() => {
943
+ E(new wt()), l();
944
+ }, 1e3 * y);
945
+ b = function(k) {
946
+ if (k.origin != I || !k.data || k.data.type !== "authorization_response")
947
947
  return;
948
- const x = P.source;
949
- x && x.close(), P.data.response.error ? _(V.fromPayload(P.data.response)) : I(P.data.response), clearTimeout(T), window.removeEventListener("message", k, !1), setTimeout(l, 2e3);
950
- }, window.addEventListener("message", k, !1), window.document.body.appendChild(w), w.setAttribute("src", b);
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);
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
953
  throw new V("state_mismatch", "Invalid state");
@@ -990,66 +990,68 @@ let Rr = class {
990
990
  }
991
991
  }
992
992
  async _requestToken(e, n) {
993
- const { nonceIn: r, organization: i } = n || {}, o = await Or(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 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);
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 Zr(t) {
998
- const e = new Rr(t);
997
+ async function Mr(t) {
998
+ const e = new Zr(t);
999
999
  return await e.checkSession(), e;
1000
1000
  }
1001
1001
  const Dn = "sesamy.com", Wr = "https://logs.sesamy.com/events";
1002
1002
  var Se = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.SOFT_PAYWALL = "sesamyJsSoftPaywall", t))(Se || {});
1003
- let X;
1003
+ let F;
1004
1004
  async function Kr(t) {
1005
- if (t.enabled !== !1 && (X = await Zr({
1005
+ if (t.enabled !== !1 && (F = await Mr({
1006
1006
  domain: t.endpoint || `token.${Dn}`,
1007
1007
  clientId: t.clientId,
1008
1008
  cacheLocation: "localstorage"
1009
1009
  }), window.location.search.includes("code=")))
1010
1010
  try {
1011
- await X.handleRedirectCallback();
1012
- const e = await X.getUser();
1013
- Et(Se.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
1014
- const n = await X.getTokenSilently();
1015
- localStorage.setItem("accessToken", n);
1011
+ await F.handleRedirectCallback();
1012
+ const e = await F.getUser();
1013
+ Et(Se.AUTHENTICATED, e);
1014
+ const n = new URL(location.href), r = n.searchParams;
1015
+ r.delete("code"), n.search = r.toString(), window.history.replaceState({}, document.title, n.toString());
1016
+ const i = await F.getTokenSilently();
1017
+ localStorage.setItem("accessToken", i);
1016
1018
  } catch {
1017
1019
  }
1018
1020
  }
1019
- async function Mr() {
1020
- if (!X)
1021
+ async function Jr() {
1022
+ if (!F)
1021
1023
  throw new Error("Auth0 client not initialized");
1022
- return X.isAuthenticated();
1024
+ return F.isAuthenticated();
1023
1025
  }
1024
- async function Jr() {
1025
- if (!X)
1026
+ async function Xr() {
1027
+ if (!F)
1026
1028
  throw new Error("Auth0 client not initialized");
1027
- return X.getUser();
1029
+ return F.getUser();
1028
1030
  }
1029
- function Xr() {
1030
- if (!X)
1031
+ function Fr() {
1032
+ if (!F)
1031
1033
  throw new Error("Auth0 client not initialized");
1032
- return X.loginWithRedirect({
1034
+ return F.loginWithRedirect({
1033
1035
  authorizationParams: {
1034
1036
  redirect_uri: window.location.href
1035
1037
  }
1036
1038
  });
1037
1039
  }
1038
- async function Fr() {
1039
- if (!X)
1040
+ async function Hr() {
1041
+ if (!F)
1040
1042
  throw new Error("Auth0 client not initialized");
1041
- return X.getTokenSilently();
1043
+ return F.getTokenSilently();
1042
1044
  }
1043
- async function Hr() {
1044
- if (!X)
1045
+ async function Vr() {
1046
+ if (!F)
1045
1047
  throw new Error("Auth0 client not initialized");
1046
- return Et(Se.LOGOUT, {}), X.logout({
1048
+ return Et(Se.LOGOUT, {}), F.logout({
1047
1049
  logoutParams: {
1048
1050
  returnTo: window.location.href
1049
1051
  }
1050
1052
  });
1051
1053
  }
1052
- const Vr = (t, e) => e.skipDedupe || e.method !== "GET", Yr = (t, e) => e.method + "@" + t, Gr = (t) => t.clone(), Xt = ({ skip: t = Vr, key: e = Yr, resolver: n = Gr } = {}) => {
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 } = {}) => {
1053
1055
  const r = /* @__PURE__ */ new Map();
1054
1056
  return (i) => (o, a) => {
1055
1057
  if (t(o, a))
@@ -1069,37 +1071,37 @@ const Vr = (t, e) => e.skipDedupe || e.method !== "GET", Yr = (t, e) => e.method
1069
1071
  return r.delete(s), Promise.reject(p);
1070
1072
  }
1071
1073
  };
1072
- }, Br = (t, e) => t * e, qr = (t) => t && t.ok, Ft = ({ delayTimer: t = 500, delayRamp: e = Br, maxAttempts: n = 10, until: r = qr, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (p) => (f, u) => {
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) => {
1073
1075
  let c = 0;
1074
1076
  if (s && s(f, u))
1075
1077
  return p(f, u);
1076
- const h = (d, b) => Promise.resolve(r(d, b)).then((v) => v ? d && a ? d : b ? Promise.reject(b) : d : (c++, !n || c <= n ? new Promise((g) => {
1077
- const I = e(t, c);
1078
+ const h = (d, w) => Promise.resolve(r(d, w)).then((I) => I ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((y) => {
1079
+ const S = e(t, c);
1078
1080
  setTimeout(() => {
1079
1081
  typeof i == "function" ? Promise.resolve(i({
1080
1082
  response: d,
1081
- error: b,
1083
+ error: w,
1082
1084
  url: f,
1083
1085
  options: u
1084
- })).then((_ = {}) => {
1085
- var w, l;
1086
- g(p((w = _ && _.url) !== null && w !== void 0 ? w : f, (l = _ && _.options) !== null && l !== void 0 ? l : u));
1087
- }) : g(p(f, u));
1088
- }, I);
1089
- }).then(h).catch((g) => {
1086
+ })).then((E = {}) => {
1087
+ var v, l;
1088
+ y(p((v = E && E.url) !== null && v !== void 0 ? v : f, (l = E && E.options) !== null && l !== void 0 ? l : u));
1089
+ }) : y(p(f, u));
1090
+ }, S);
1091
+ }).then(h).catch((y) => {
1090
1092
  if (!o)
1091
- throw g;
1092
- return h(null, g);
1093
- }) : d && a ? d : Promise.reject(b || new Error("Number of attempts exceeded."))));
1093
+ throw y;
1094
+ return h(null, y);
1095
+ }) : d && a ? d : Promise.reject(w || new Error("Number of attempts exceeded."))));
1094
1096
  return p(f, u).then(h).catch((d) => {
1095
1097
  if (!o)
1096
1098
  throw d;
1097
1099
  return h(null, d);
1098
1100
  });
1099
- }, Qr = "application/json", Ln = "Content-Type", ye = Symbol(), Un = Symbol();
1101
+ }, ei = "application/json", Un = "Content-Type", ye = Symbol(), Ln = Symbol();
1100
1102
  function Ht(t = {}) {
1101
1103
  var e;
1102
- return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Ln.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
1104
+ return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Un.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
1103
1105
  }
1104
1106
  function Vt(t) {
1105
1107
  return /^application\/.*json.*/.test(t);
@@ -1130,90 +1132,90 @@ const he = function(t, e, n = !1) {
1130
1132
  return n && i ? new i(...r) : i;
1131
1133
  }
1132
1134
  };
1133
- function ei(t, e = !1) {
1135
+ function ti(t, e = !1) {
1134
1136
  Ee.options = e ? t : he(Ee.options, t);
1135
1137
  }
1136
- function ti(t, e = !1) {
1138
+ function ni(t, e = !1) {
1137
1139
  Ee.polyfills = e ? t : he(Ee.polyfills, t);
1138
1140
  }
1139
- function ni(t) {
1141
+ function ri(t) {
1140
1142
  Ee.errorType = t;
1141
1143
  }
1142
- const ri = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1144
+ const ii = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
1143
1145
  class Rn extends Error {
1144
1146
  }
1145
- const ii = (t) => {
1147
+ const oi = (t) => {
1146
1148
  const e = /* @__PURE__ */ Object.create(null);
1147
- t = t._addons.reduce((w, l) => l.beforeRequest && l.beforeRequest(w, t._options, e) || w, t);
1149
+ t = t._addons.reduce((v, l) => l.beforeRequest && l.beforeRequest(v, t._options, e) || v, t);
1148
1150
  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);
1149
1151
  let c = n;
1150
- const h = ri(s)((w, l) => (c = w, i.polyfill("fetch")(w, l)))(n, u), d = new Error(), b = h.catch((w) => {
1151
- throw { [ye]: w };
1152
- }).then((w) => {
1153
- if (!w.ok) {
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 };
1154
+ }).then((v) => {
1155
+ if (!v.ok) {
1154
1156
  const l = new Rn();
1155
1157
  if (l.cause = d, l.stack = l.stack + `
1156
- CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
1158
+ CAUSE: ` + d.stack, l.response = v, l.url = c, v.type === "opaque")
1157
1159
  throw l;
1158
- return w.text().then((k) => {
1159
- var T;
1160
- if (l.message = k, i.errorType === "json" || ((T = w.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
1160
+ return v.text().then((b) => {
1161
+ var j;
1162
+ if (l.message = b, i.errorType === "json" || ((j = v.headers.get("Content-Type")) === null || j === void 0 ? void 0 : j.split(";")[0]) === "application/json")
1161
1163
  try {
1162
- l.json = JSON.parse(k);
1164
+ l.json = JSON.parse(b);
1163
1165
  } catch {
1164
1166
  }
1165
- throw l.text = k, l.status = w.status, l;
1167
+ throw l.text = b, l.status = v.status, l;
1166
1168
  });
1167
1169
  }
1168
- return w;
1169
- }), v = (w) => w.catch((l) => {
1170
- const k = l.hasOwnProperty(ye), T = k ? l[ye] : l, P = (T == null ? void 0 : T.status) && f.get(T.status) || f.get(T == null ? void 0 : T.name) || k && f.has(ye) && f.get(ye);
1171
- if (P)
1172
- return P(T, t);
1173
- const x = f.get(Un);
1174
- if (x)
1175
- return x(T, t);
1176
- throw T;
1177
- }), g = (w) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ v(w ? b.then((k) => k && k[w]()).then((k) => l ? l(k) : k) : b.then((k) => l ? l(k) : k)), I = {
1170
+ return v;
1171
+ }), 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);
1173
+ if (k)
1174
+ return k(j, t);
1175
+ const _ = f.get(Ln);
1176
+ if (_)
1177
+ return _(j, t);
1178
+ throw j;
1179
+ }), y = (v) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ I(v ? w.then((b) => b && b[v]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), S = {
1178
1180
  _wretchReq: t,
1179
1181
  _fetchReq: h,
1180
1182
  _sharedState: e,
1181
- res: g(null),
1182
- json: g("json"),
1183
- blob: g("blob"),
1184
- formData: g("formData"),
1185
- arrayBuffer: g("arrayBuffer"),
1186
- text: g("text"),
1187
- error(w, l) {
1188
- return f.set(w, l), this;
1183
+ res: y(null),
1184
+ json: y("json"),
1185
+ blob: y("blob"),
1186
+ formData: y("formData"),
1187
+ arrayBuffer: y("arrayBuffer"),
1188
+ text: y("text"),
1189
+ error(v, l) {
1190
+ return f.set(v, l), this;
1189
1191
  },
1190
- badRequest(w) {
1191
- return this.error(400, w);
1192
+ badRequest(v) {
1193
+ return this.error(400, v);
1192
1194
  },
1193
- unauthorized(w) {
1194
- return this.error(401, w);
1195
+ unauthorized(v) {
1196
+ return this.error(401, v);
1195
1197
  },
1196
- forbidden(w) {
1197
- return this.error(403, w);
1198
+ forbidden(v) {
1199
+ return this.error(403, v);
1198
1200
  },
1199
- notFound(w) {
1200
- return this.error(404, w);
1201
+ notFound(v) {
1202
+ return this.error(404, v);
1201
1203
  },
1202
- timeout(w) {
1203
- return this.error(408, w);
1204
+ timeout(v) {
1205
+ return this.error(408, v);
1204
1206
  },
1205
- internalError(w) {
1206
- return this.error(500, w);
1207
+ internalError(v) {
1208
+ return this.error(500, v);
1207
1209
  },
1208
- fetchError(w) {
1209
- return this.error(ye, w);
1210
+ fetchError(v) {
1211
+ return this.error(ye, v);
1210
1212
  }
1211
- }, _ = p.reduce((w, l) => ({
1212
- ...w,
1213
- ...typeof l.resolver == "function" ? l.resolver(w) : l.resolver
1214
- }), I);
1215
- return a.reduce((w, l) => l(w, t), _);
1216
- }, oi = {
1213
+ }, E = p.reduce((v, l) => ({
1214
+ ...v,
1215
+ ...typeof l.resolver == "function" ? l.resolver(v) : l.resolver
1216
+ }), S);
1217
+ return a.reduce((v, l) => l(v, t), E);
1218
+ }, ai = {
1217
1219
  _url: "",
1218
1220
  _options: {},
1219
1221
  _config: Ee,
@@ -1263,7 +1265,7 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
1263
1265
  return this.headers({ Accept: t });
1264
1266
  },
1265
1267
  content(t) {
1266
- return this.headers({ [Ln]: t });
1268
+ return this.headers({ [Un]: t });
1267
1269
  },
1268
1270
  auth(t) {
1269
1271
  return this.headers({ Authorization: t });
@@ -1273,7 +1275,7 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
1273
1275
  return n.set(t, e), { ...this, _catchers: n };
1274
1276
  },
1275
1277
  catcherFallback(t) {
1276
- return this.catcher(Un, t);
1278
+ return this.catcher(Ln, t);
1277
1279
  },
1278
1280
  resolve(t, e = !1) {
1279
1281
  return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
@@ -1293,7 +1295,7 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
1293
1295
  fetch(t = this._options.method, e = "", n = null) {
1294
1296
  let r = this.url(e).options({ method: t });
1295
1297
  const i = Ht(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Vt(i));
1296
- return r = n ? o ? r.json(n, i) : r.body(n) : r, ii(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
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));
1297
1299
  },
1298
1300
  get(t = "") {
1299
1301
  return this.fetch("GET", t);
@@ -1321,90 +1323,114 @@ CAUSE: ` + d.stack, l.response = w, l.url = c, w.type === "opaque")
1321
1323
  },
1322
1324
  json(t, e) {
1323
1325
  const n = Ht(this._options.headers);
1324
- return this.content(e || Vt(n) && n || Qr).body(JSON.stringify(t));
1326
+ return this.content(e || Vt(n) && n || ei).body(JSON.stringify(t));
1325
1327
  }
1326
1328
  };
1327
1329
  function oe(t = "", e = {}) {
1328
- return { ...oi, _url: t, _options: e };
1330
+ return { ...ai, _url: t, _options: e };
1329
1331
  }
1330
1332
  oe.default = oe;
1331
- oe.options = ei;
1332
- oe.errorType = ni;
1333
- oe.polyfills = ti;
1333
+ oe.options = ti;
1334
+ oe.errorType = ri;
1335
+ oe.polyfills = ni;
1334
1336
  oe.WretchError = Rn;
1335
- function ai(t) {
1336
- const e = t.endpoint || `https://api2.${Dn}`, n = (v) => async (g, I) => {
1337
- try {
1338
- const _ = await Fr(), w = {
1339
- ...I,
1340
- headers: {
1341
- ...I.headers,
1342
- Authorization: `Bearer ${_}`
1343
- }
1344
- };
1345
- return v(g, w);
1346
- } catch (_) {
1347
- throw console.error("Error fetching access token:", _), _;
1348
- }
1349
- }, r = (v) => (g, I) => {
1350
- const _ = localStorage.getItem("__anon_id"), w = btoa(`${_}:`), l = {
1351
- ...I,
1337
+ function si(t) {
1338
+ const e = t.endpoint || `https://api2.${Dn}`, n = (k = !0) => (_) => async (A, U) => {
1339
+ let R = null;
1340
+ if (R = await Hr(), !R && k)
1341
+ throw new Error("No access token available");
1342
+ const L = {
1343
+ ...U,
1344
+ headers: {
1345
+ ...U.headers,
1346
+ ...R ? { Authorization: `Bearer ${R}` } : {}
1347
+ }
1348
+ };
1349
+ return _(A, L);
1350
+ }, r = (k) => (_, A) => {
1351
+ const U = localStorage.getItem("__anon_id"), R = btoa(`${U}:`), L = {
1352
+ ...A,
1352
1353
  headers: {
1353
- ...I.headers,
1354
- Authorization: `Basic ${w}`
1354
+ ...A.headers,
1355
+ Authorization: `Basic ${R}`
1355
1356
  }
1356
1357
  };
1357
- return v(g, l);
1358
+ return k(_, L);
1358
1359
  }, i = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
1359
- n,
1360
+ n(),
1360
1361
  Xt(),
1361
1362
  Ft({
1362
1363
  delayTimer: 1e3,
1363
- delayRamp: (v, g) => v * g,
1364
+ delayRamp: (k, _) => k * _,
1364
1365
  maxAttempts: 3,
1365
- until: (v) => (v == null ? void 0 : v.ok) || !1,
1366
+ until: (k) => !!(k && (k.ok || k.status >= 400 && k.status < 500)),
1366
1367
  retryOnNetworkError: !1
1367
1368
  })
1368
1369
  ]), o = oe(e).headers({ "Content-Type": "application/json" }).middlewares([
1370
+ n(!1),
1369
1371
  r,
1370
1372
  Xt(),
1371
1373
  Ft({
1372
1374
  delayTimer: 1e3,
1373
- delayRamp: (v, g) => v * g,
1375
+ delayRamp: (k, _) => k * _,
1374
1376
  maxAttempts: 3,
1375
- until: (v) => (v == null ? void 0 : v.ok) || !1,
1377
+ until: (k) => !!(k && (k.ok || k.status >= 400 && k.status < 500)),
1376
1378
  retryOnNetworkError: !1
1377
1379
  })
1378
1380
  ]);
1379
1381
  async function a() {
1380
1382
  return i.get("/entitlements").json();
1381
1383
  }
1382
- async function s(v) {
1383
- const g = await i.get("/entitlements").json();
1384
- return g == null ? void 0 : g.find((I) => I.id === v);
1384
+ async function s(k) {
1385
+ const _ = await i.get("/entitlements").json();
1386
+ return _ == null ? void 0 : _.find((A) => A.id === k);
1385
1387
  }
1386
1388
  async function p() {
1387
1389
  return i.get("/contracts").json();
1388
1390
  }
1389
- async function f(v) {
1390
- const g = await i.get("/contracts").json();
1391
- return g == null ? void 0 : g.find((I) => I.id === v);
1391
+ async function f(k) {
1392
+ const _ = await i.get("/contracts").json();
1393
+ return _ == null ? void 0 : _.find((A) => A.id === k);
1392
1394
  }
1393
1395
  async function u() {
1394
1396
  return i.get("/bills").json();
1395
1397
  }
1396
- async function c(v) {
1397
- const g = await i.get("/bills").json();
1398
- return g == null ? void 0 : g.find((I) => I.id === v);
1398
+ async function c(k) {
1399
+ const _ = await i.get("/bills").json();
1400
+ return _ == null ? void 0 : _.find((A) => A.id === k);
1399
1401
  }
1400
- async function h() {
1401
- return await o.url("/tags").get().json();
1402
+ async function h(k, _) {
1403
+ return await i.url(`/user-metadata/${k}`).put(_).json();
1402
1404
  }
1403
- async function d(v, g) {
1404
- return await o.url(`/tags/${v}`).put(g).json();
1405
+ async function d(k) {
1406
+ return (await i.url(`/user-metadata/${k}`).delete().res()).ok;
1405
1407
  }
1406
- async function b(v, g) {
1407
- return await o.url(`/tags/${v}/push`).post(g).json();
1408
+ async function w(k) {
1409
+ return (await i.url(`/user-metadata/${k}`).get().json())[k];
1410
+ }
1411
+ async function I() {
1412
+ return i.url("/user-metadata").get().json();
1413
+ }
1414
+ async function y() {
1415
+ return await i.url("/tags").get().json();
1416
+ }
1417
+ async function S(k) {
1418
+ return (await i.url(`/tags/${k}`).delete().res()).ok;
1419
+ }
1420
+ async function E(k) {
1421
+ return (await i.url("/tags").post(k).res()).ok;
1422
+ }
1423
+ async function v(k) {
1424
+ return (await o.url("/tallies").get().json())[k];
1425
+ }
1426
+ async function l() {
1427
+ return await o.url("/tallies").get().json();
1428
+ }
1429
+ async function b(k) {
1430
+ return (await o.url(`/tallies/${k}`).delete().res()).ok;
1431
+ }
1432
+ async function j(k, _) {
1433
+ return await o.url(`/tallies/${k}/push`).post(_).json();
1408
1434
  }
1409
1435
  return {
1410
1436
  getEntitlements: a,
@@ -1413,36 +1439,80 @@ function ai(t) {
1413
1439
  getContract: f,
1414
1440
  getBills: u,
1415
1441
  getBill: c,
1416
- getTags: h,
1417
- setTag: d,
1418
- pushTag: b
1442
+ setUserMetadata: h,
1443
+ deleteUserMetadata: d,
1444
+ getUserMetadata: w,
1445
+ listUserMetadata: I,
1446
+ getTags: y,
1447
+ deleteTag: S,
1448
+ setTag: E,
1449
+ getTally: v,
1450
+ getTallies: l,
1451
+ deleteTally: b,
1452
+ pushTally: j
1419
1453
  };
1420
1454
  }
1421
1455
  const Zn = "@sesamy/sesamy-js", Tt = "1.3.2";
1422
- function si(t) {
1423
- const { getEntitlement: e, getEntitlements: n, getContract: r, getContracts: i, getBill: o, getBills: a, getTags: s, setTag: p, pushTag: f } = ai(t), u = {
1424
- auth: {
1425
- getUser: Jr,
1426
- isAuthenticated: Mr,
1427
- loginWithRedirect: Xr,
1428
- logout: Hr
1429
- },
1430
- tags: {
1431
- list: s,
1432
- set: p,
1433
- push: f
1434
- },
1456
+ function ci(t) {
1457
+ const {
1435
1458
  getEntitlement: e,
1436
1459
  getEntitlements: n,
1437
1460
  getContract: r,
1438
1461
  getContracts: i,
1439
1462
  getBill: o,
1440
1463
  getBills: a,
1441
- getVersion: ci
1464
+ getTags: s,
1465
+ deleteTag: p,
1466
+ setTag: f,
1467
+ getUserMetadata: u,
1468
+ listUserMetadata: c,
1469
+ setUserMetadata: h,
1470
+ deleteUserMetadata: d,
1471
+ getTally: w,
1472
+ getTallies: I,
1473
+ pushTally: y,
1474
+ deleteTally: S
1475
+ } = si(t), E = {
1476
+ auth: {
1477
+ getUser: Xr,
1478
+ isAuthenticated: Jr,
1479
+ loginWithRedirect: Fr,
1480
+ logout: Vr
1481
+ },
1482
+ tags: {
1483
+ list: s,
1484
+ set: f,
1485
+ delete: p
1486
+ },
1487
+ entitlements: {
1488
+ get: e,
1489
+ list: n
1490
+ },
1491
+ contracts: {
1492
+ get: r,
1493
+ list: i
1494
+ },
1495
+ bills: {
1496
+ get: o,
1497
+ list: a
1498
+ },
1499
+ userMetadata: {
1500
+ get: u,
1501
+ list: c,
1502
+ set: h,
1503
+ delete: d
1504
+ },
1505
+ tallies: {
1506
+ get: w,
1507
+ list: I,
1508
+ push: y,
1509
+ delete: S
1510
+ },
1511
+ getVersion: ui
1442
1512
  };
1443
- return t.namespace && (window[t.namespace] = u), u;
1513
+ return t.namespace && (window[t.namespace] = E), E;
1444
1514
  }
1445
- function ci() {
1515
+ function ui() {
1446
1516
  return Tt;
1447
1517
  }
1448
1518
  function Yt(t, e, n, r, i) {
@@ -1450,54 +1520,54 @@ function Yt(t, e, n, r, i) {
1450
1520
  t = t ? t[e[r]] : i;
1451
1521
  return t === i ? n : t;
1452
1522
  }
1453
- var Je = "undefined", Gt = "object", ui = function() {
1454
- }, Wn = "any", Kn = "*", pe = "__", qe = typeof process < "u" ? process : {};
1523
+ var Je = "undefined", Gt = "object", li = function() {
1524
+ }, Mn = "any", Wn = "*", pe = "__", qe = typeof process < "u" ? process : {};
1455
1525
  qe.env && qe.env.NODE_ENV;
1456
1526
  var Y = typeof document < "u";
1457
1527
  qe.versions != null && qe.versions.node != null;
1458
1528
  typeof Deno < "u" && Deno.core;
1459
1529
  Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
1460
- function Mn(t, e) {
1530
+ function Kn(t, e) {
1461
1531
  return e.charAt(0)[t]() + e.slice(1);
1462
1532
  }
1463
- var li = Mn.bind(null, "toUpperCase"), di = Mn.bind(null, "toLowerCase");
1464
- function hi(t) {
1465
- return Jn(t) ? li("null") : typeof t == "object" ? gi(t) : Object.prototype.toString.call(t).slice(8, -1);
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);
1466
1536
  }
1467
1537
  function Qe(t, e) {
1468
1538
  e === void 0 && (e = !0);
1469
- var n = hi(t);
1470
- return e ? di(n) : n;
1539
+ var n = fi(t);
1540
+ return e ? hi(n) : n;
1471
1541
  }
1472
- function We(t, e) {
1542
+ function Me(t, e) {
1473
1543
  return typeof e === t;
1474
1544
  }
1475
- var G = We.bind(null, "function"), re = We.bind(null, "string"), we = We.bind(null, "undefined"), fi = We.bind(null, "boolean");
1476
- We.bind(null, "symbol");
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");
1477
1547
  function Jn(t) {
1478
1548
  return t === null;
1479
1549
  }
1480
- function pi(t) {
1550
+ function mi(t) {
1481
1551
  return Qe(t) === "number" && !isNaN(t);
1482
1552
  }
1483
1553
  function Xn(t) {
1484
1554
  return Qe(t) === "array";
1485
1555
  }
1486
- function J(t) {
1487
- if (!mi(t))
1556
+ function X(t) {
1557
+ if (!gi(t))
1488
1558
  return !1;
1489
1559
  for (var e = t; Object.getPrototypeOf(e) !== null; )
1490
1560
  e = Object.getPrototypeOf(e);
1491
1561
  return Object.getPrototypeOf(t) === e;
1492
1562
  }
1493
- function mi(t) {
1563
+ function gi(t) {
1494
1564
  return t && (typeof t == "object" || t !== null);
1495
1565
  }
1496
- function gi(t) {
1566
+ function yi(t) {
1497
1567
  return G(t.constructor) ? t.constructor.name : null;
1498
1568
  }
1499
- function yi(t) {
1500
- return t instanceof Error || re(t.message) && t.constructor && pi(t.constructor.stackTraceLimit);
1569
+ function vi(t) {
1570
+ return t instanceof Error || re(t.message) && t.constructor && mi(t.constructor.stackTraceLimit);
1501
1571
  }
1502
1572
  function Fn(t, e) {
1503
1573
  if (typeof e != "object" || Jn(e))
@@ -1505,7 +1575,7 @@ function Fn(t, e) {
1505
1575
  if (e instanceof t)
1506
1576
  return !0;
1507
1577
  var n = Qe(new t(""));
1508
- if (yi(e))
1578
+ if (vi(e))
1509
1579
  for (; e; ) {
1510
1580
  if (Qe(e) === n)
1511
1581
  return !0;
@@ -1517,9 +1587,9 @@ Fn.bind(null, TypeError);
1517
1587
  Fn.bind(null, SyntaxError);
1518
1588
  function nt(t, e) {
1519
1589
  var n = t instanceof Element || t instanceof HTMLDocument;
1520
- return n && e ? vi(t, e) : n;
1590
+ return n && e ? wi(t, e) : n;
1521
1591
  }
1522
- function vi(t, e) {
1592
+ function wi(t, e) {
1523
1593
  return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
1524
1594
  }
1525
1595
  function rt(t) {
@@ -1532,7 +1602,7 @@ rt(nt, "form");
1532
1602
  rt(nt, "button");
1533
1603
  rt(nt, "input");
1534
1604
  rt(nt, "select");
1535
- function wi(t) {
1605
+ function bi(t) {
1536
1606
  return t ? Xn(t) ? t : [t] : [];
1537
1607
  }
1538
1608
  function Bt(t) {
@@ -1542,19 +1612,19 @@ function Bt(t) {
1542
1612
  return null;
1543
1613
  }
1544
1614
  }
1545
- function bi() {
1615
+ function ki() {
1546
1616
  if (Y) {
1547
1617
  var t = navigator, e = t.languages;
1548
1618
  return t.userLanguage || (e && e.length ? e[0] : t.language);
1549
1619
  }
1550
1620
  }
1551
- function ki() {
1621
+ function Ii() {
1552
1622
  try {
1553
1623
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
1554
1624
  } catch {
1555
1625
  }
1556
1626
  }
1557
- function Ii(t) {
1627
+ function _i(t) {
1558
1628
  return function(e) {
1559
1629
  for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
1560
1630
  var o = Bt(n[1]), a = Bt(n[2]);
@@ -1562,7 +1632,7 @@ function Ii(t) {
1562
1632
  }
1563
1633
  for (var s in r) {
1564
1634
  var p = s.split("[");
1565
- p.length > 1 && (_i(r, p.map(function(f) {
1635
+ p.length > 1 && (Si(r, p.map(function(f) {
1566
1636
  return f.replace(/[?[\]\\ ]/g, "");
1567
1637
  }), r[s]), delete r[s]);
1568
1638
  }
@@ -1575,7 +1645,7 @@ function Ii(t) {
1575
1645
  return Y && window.location.search.substring(1);
1576
1646
  }(t));
1577
1647
  }
1578
- function _i(t, e, n) {
1648
+ function Si(t, e, n) {
1579
1649
  for (var r = e.length - 1, i = 0; i < r; ++i) {
1580
1650
  var o = e[i];
1581
1651
  if (o === "__proto__" || o === "constructor")
@@ -1625,17 +1695,17 @@ function jt(t) {
1625
1695
  }
1626
1696
  return Xe[t] = !0;
1627
1697
  }
1628
- function O() {
1629
- return O = Object.assign || function(t) {
1698
+ function T() {
1699
+ return T = Object.assign || function(t) {
1630
1700
  for (var e = 1; e < arguments.length; e++) {
1631
1701
  var n = arguments[e];
1632
1702
  for (var r in n)
1633
1703
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
1634
1704
  }
1635
1705
  return t;
1636
- }, O.apply(this, arguments);
1706
+ }, T.apply(this, arguments);
1637
1707
  }
1638
- var ne = "function", ee = "undefined", Si = "@@redux/" + Math.random().toString(36), qt = /* @__PURE__ */ function() {
1708
+ var ne = "function", ee = "undefined", Ei = "@@redux/" + Math.random().toString(36), qt = /* @__PURE__ */ function() {
1639
1709
  return typeof Symbol === ne && Symbol.observable || "@@observable";
1640
1710
  }(), Fe = " != " + ne;
1641
1711
  function Hn(t, e, n) {
@@ -1657,17 +1727,17 @@ function Hn(t, e, n) {
1657
1727
  function c(d) {
1658
1728
  if (typeof d !== ne)
1659
1729
  throw new Error("Listener" + Fe);
1660
- var b = !0;
1730
+ var w = !0;
1661
1731
  return f(), s.push(d), function() {
1662
- if (b) {
1663
- b = !1, f();
1664
- var v = s.indexOf(d);
1665
- s.splice(v, 1);
1732
+ if (w) {
1733
+ w = !1, f();
1734
+ var I = s.indexOf(d);
1735
+ s.splice(I, 1);
1666
1736
  }
1667
1737
  };
1668
1738
  }
1669
1739
  function h(d) {
1670
- if (!J(d))
1740
+ if (!X(d))
1671
1741
  throw new Error("Act != obj");
1672
1742
  if (typeof d.type === ee)
1673
1743
  throw new Error("ActType " + ee);
@@ -1678,8 +1748,8 @@ function Hn(t, e, n) {
1678
1748
  } finally {
1679
1749
  p = !1;
1680
1750
  }
1681
- for (var b = a = s, v = 0; v < b.length; v++)
1682
- (0, b[v])();
1751
+ for (var w = a = s, I = 0; I < w.length; I++)
1752
+ (0, w[I])();
1683
1753
  return d;
1684
1754
  }
1685
1755
  return h({ type: "@@redux/INIT" }), (r = { dispatch: h, subscribe: c, getState: u, replaceReducer: function(d) {
@@ -1687,20 +1757,20 @@ function Hn(t, e, n) {
1687
1757
  throw new Error("next reducer" + Fe);
1688
1758
  i = d, h({ type: "@@redux/INIT" });
1689
1759
  } })[qt] = function() {
1690
- var d, b = c;
1691
- return (d = { subscribe: function(v) {
1692
- if (typeof v != "object")
1760
+ var d, w = c;
1761
+ return (d = { subscribe: function(I) {
1762
+ if (typeof I != "object")
1693
1763
  throw new TypeError("Observer != obj");
1694
- function g() {
1695
- v.next && v.next(u());
1764
+ function y() {
1765
+ I.next && I.next(u());
1696
1766
  }
1697
- return g(), { unsubscribe: b(g) };
1767
+ return y(), { unsubscribe: w(y) };
1698
1768
  } })[qt] = function() {
1699
1769
  return this;
1700
1770
  }, d;
1701
1771
  }, r;
1702
1772
  }
1703
- function Ei(t, e) {
1773
+ function Oi(t, e) {
1704
1774
  var n = e && e.type;
1705
1775
  return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
1706
1776
  }
@@ -1714,7 +1784,7 @@ function Te() {
1714
1784
  };
1715
1785
  });
1716
1786
  }
1717
- function Oi() {
1787
+ function Pi() {
1718
1788
  var t = arguments;
1719
1789
  return function(e) {
1720
1790
  return function(n, r, i) {
@@ -1723,39 +1793,39 @@ function Oi() {
1723
1793
  } };
1724
1794
  return o = [].slice.call(t).map(function(f) {
1725
1795
  return f(p);
1726
- }), O({}, a, { dispatch: s = Te.apply(void 0, o)(a.dispatch) });
1796
+ }), T({}, a, { dispatch: s = Te.apply(void 0, o)(a.dispatch) });
1727
1797
  };
1728
1798
  };
1729
1799
  }
1730
- 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"], E = Be.reduce(function(t, e) {
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) {
1731
1801
  return t[e] = e, t;
1732
1802
  }, { registerPluginType: function(t) {
1733
1803
  return "registerPlugin:" + t;
1734
1804
  }, pluginReadyType: function(t) {
1735
1805
  return "ready:" + t;
1736
1806
  } }), Qt = /^utm_/, en = /^an_prop_/, tn = /^an_trait_/;
1737
- function Pi(t) {
1807
+ function Ti(t) {
1738
1808
  var e = t.storage.setItem;
1739
1809
  return function(n) {
1740
1810
  return function(r) {
1741
1811
  return function(i) {
1742
- if (i.type === E.bootstrap) {
1812
+ if (i.type === P.bootstrap) {
1743
1813
  var o = i.params, a = i.user, s = i.persistedUser, p = i.initialUser, f = s.userId === a.userId;
1744
- s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), f || e(fe, a.userId), p.traits && e(ke, O({}, f && s.traits ? s.traits : {}, p.traits));
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));
1745
1815
  var u = Object.keys(i.params);
1746
1816
  if (u.length) {
1747
- var c = o.an_uid, h = o.an_event, d = u.reduce(function(b, v) {
1748
- if (v.match(Qt) || v.match(/^(d|g)clid/)) {
1749
- var g = v.replace(Qt, "");
1750
- b.campaign[g === "campaign" ? "name" : g] = o[v];
1817
+ 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, "");
1820
+ w.campaign[y === "campaign" ? "name" : y] = o[I];
1751
1821
  }
1752
- return v.match(en) && (b.props[v.replace(en, "")] = o[v]), v.match(tn) && (b.traits[v.replace(tn, "")] = o[v]), b;
1822
+ return I.match(en) && (w.props[I.replace(en, "")] = o[I]), I.match(tn) && (w.traits[I.replace(tn, "")] = o[I]), w;
1753
1823
  }, { campaign: {}, props: {}, traits: {} });
1754
- n.dispatch(O({ type: E.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1824
+ n.dispatch(T({ type: P.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
1755
1825
  return t.identify(c, d.traits);
1756
1826
  }, 0), h && setTimeout(function() {
1757
1827
  return t.track(h, d.props);
1758
- }, 0), Object.keys(d.campaign).length && n.dispatch({ type: E.campaign, campaign: d.campaign });
1828
+ }, 0), Object.keys(d.campaign).length && n.dispatch({ type: P.campaign, campaign: d.campaign });
1759
1829
  }
1760
1830
  }
1761
1831
  return r(i);
@@ -1763,18 +1833,18 @@ function Pi(t) {
1763
1833
  };
1764
1834
  };
1765
1835
  }
1766
- function Ti(t) {
1836
+ function ji(t) {
1767
1837
  return function(e, n) {
1768
- if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === E.setItemEnd) {
1838
+ if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === P.setItemEnd) {
1769
1839
  if (n.key === ie)
1770
- return O({}, e, { anonymousId: n.value });
1840
+ return T({}, e, { anonymousId: n.value });
1771
1841
  if (n.key === fe)
1772
- return O({}, e, { userId: n.value });
1842
+ return T({}, e, { userId: n.value });
1773
1843
  }
1774
1844
  switch (n.type) {
1775
- case E.identify:
1776
- return Object.assign({}, e, { userId: n.userId, traits: O({}, e.traits, n.traits) });
1777
- case E.reset:
1845
+ case P.identify:
1846
+ return Object.assign({}, e, { userId: n.userId, traits: T({}, e.traits, n.traits) });
1847
+ case P.reset:
1778
1848
  return [fe, ie, ke].forEach(function(r) {
1779
1849
  t.removeItem(r);
1780
1850
  }), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
@@ -1789,20 +1859,20 @@ function nn(t) {
1789
1859
  var _t = function(t) {
1790
1860
  return pe + "TEMP" + pe + t;
1791
1861
  };
1792
- function ji(t) {
1862
+ function xi(t) {
1793
1863
  var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
1794
1864
  return function(o) {
1795
1865
  return function(a) {
1796
1866
  return function(s) {
1797
1867
  var p = s.userId, f = s.traits, u = s.options;
1798
- if (s.type === E.reset && ([fe, ke, ie].forEach(function(d) {
1868
+ if (s.type === P.reset && ([fe, ke, ie].forEach(function(d) {
1799
1869
  r(d);
1800
1870
  }), [te, be, "traits"].forEach(function(d) {
1801
1871
  je(_t(d));
1802
- })), s.type === E.identify) {
1872
+ })), s.type === P.identify) {
1803
1873
  i(ie) || n(ie, it());
1804
1874
  var c = i(fe), h = i(ke) || {};
1805
- c && c !== p && o.dispatch({ type: E.userIdChanged, old: { userId: c, traits: h }, new: { userId: p, traits: f }, options: u }), p && n(fe, p), f && n(ke, O({}, h, f));
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));
1806
1876
  }
1807
1877
  return a(s);
1808
1878
  };
@@ -1815,14 +1885,14 @@ function rn(t, e) {
1815
1885
  }
1816
1886
  function Vn(t, e, n) {
1817
1887
  return new Promise(function(r, i) {
1818
- return e() ? r(t) : n < 1 ? i(O({}, t, { queue: !0 })) : new Promise(function(o) {
1888
+ return e() ? r(t) : n < 1 ? i(T({}, t, { queue: !0 })) : new Promise(function(o) {
1819
1889
  return setTimeout(o, 10);
1820
1890
  }).then(function(o) {
1821
1891
  return Vn(t, e, n - 10).then(r, i);
1822
1892
  });
1823
1893
  });
1824
1894
  }
1825
- function xi(t) {
1895
+ function Ci(t) {
1826
1896
  return { abort: t };
1827
1897
  }
1828
1898
  function Yn(t, e, n) {
@@ -1833,18 +1903,18 @@ function Yn(t, e, n) {
1833
1903
  }, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
1834
1904
  if (f.processIndex && f.processIndex.length) {
1835
1905
  f.processIndex.forEach(function(c) {
1836
- var h = s.actions[c], d = h.plugin, b = h.payload.type, v = i[d][b];
1837
- if (v && G(v)) {
1838
- var g, I = function(l, k) {
1839
- return l === void 0 && (l = {}), k === void 0 && (k = {}), [te, be].reduce(function(T, P) {
1840
- return l.hasOwnProperty(P) && k[P] && k[P] !== l[P] && (T[P] = k[P]), T;
1906
+ var h = s.actions[c], d = h.plugin, w = h.payload.type, I = i[d][w];
1907
+ if (I && G(I)) {
1908
+ var y, S = function(l, b) {
1909
+ return l === void 0 && (l = {}), b === void 0 && (b = {}), [te, be].reduce(function(j, k) {
1910
+ return l.hasOwnProperty(k) && b[k] && b[k] !== l[k] && (j[k] = b[k]), j;
1841
1911
  }, l);
1842
- }(h.payload, p), _ = r[I.meta.rid];
1843
- if (!_ && (g = v({ payload: I, config: a[d].config, instance: n, abort: xi })) && J(g) && g.abort)
1844
- return void (r[I.meta.rid] = !0);
1845
- if (!_) {
1846
- var w = b + ":" + d;
1847
- t.dispatch(O({}, I, { type: w, _: { called: w, from: "queueDrain" } }));
1912
+ }(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)
1914
+ return void (r[S.meta.rid] = !0);
1915
+ if (!E) {
1916
+ var v = w + ":" + d;
1917
+ t.dispatch(T({}, S, { type: v, _: { called: v, from: "queueDrain" } }));
1848
1918
  }
1849
1919
  }
1850
1920
  });
@@ -1858,118 +1928,118 @@ function Yn(t, e, n) {
1858
1928
  var ht = function(t) {
1859
1929
  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;
1860
1930
  try {
1861
- var f = i.plugins, u = i.context, c = n.type, h = c.match(Ie), d = e.exact.map(function(g) {
1862
- return g.pluginName;
1931
+ var f = i.plugins, u = i.context, c = n.type, h = c.match(Ie), d = e.exact.map(function(y) {
1932
+ return y.pluginName;
1863
1933
  });
1864
- h && (d = a.during.map(function(g) {
1865
- return g.pluginName;
1934
+ h && (d = a.during.map(function(y) {
1935
+ return y.pluginName;
1866
1936
  }));
1867
- var b = /* @__PURE__ */ function(g, I) {
1868
- return function(_, w, l) {
1869
- var k = w.config, T = w.name, P = T + "." + _.type;
1870
- l && (P = l.event);
1871
- var x = _.type.match(Ie) ? /* @__PURE__ */ function(L, D, F, U, H) {
1872
- return function(Z, j) {
1873
- var K = U ? U.name : L, M = j && Ze(j) ? j : F;
1874
- if (U && (!(M = j && Ze(j) ? j : [L]).includes(L) || M.length !== 1))
1875
- throw new Error("Method " + D + " can only abort " + L + " plugin. " + JSON.stringify(M) + " input valid");
1876
- return O({}, H, { abort: { reason: Z, plugins: M, caller: D, _: K } });
1937
+ var w = /* @__PURE__ */ function(y, S) {
1938
+ return function(E, v, l) {
1939
+ var b = v.config, j = v.name, k = j + "." + E.type;
1940
+ 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 } });
1877
1947
  };
1878
- }(T, P, I, l, _) : /* @__PURE__ */ function(L, D) {
1948
+ }(j, k, S, l, E) : /* @__PURE__ */ function(A, U) {
1879
1949
  return function() {
1880
- throw new Error(L.type + " action not cancellable. Remove abort in " + D);
1950
+ throw new Error(A.type + " action not cancellable. Remove abort in " + U);
1881
1951
  };
1882
- }(_, P);
1883
- return { payload: Ci(_), instance: g, config: k || {}, abort: x };
1952
+ }(E, k);
1953
+ return { payload: $i(E), instance: y, config: b || {}, abort: _ };
1884
1954
  };
1885
- }(r, d), v = e.exact.reduce(function(g, I) {
1886
- var _ = I.pluginName, w = I.methodName, l = !1;
1887
- return w.match(/^initialize/) || w.match(/^reset/) || (l = !f[_].loaded), u.offline && w.match(/^(page|track|identify)/) && (l = !0), g["" + _] = l, g;
1955
+ }(r, d), I = e.exact.reduce(function(y, S) {
1956
+ var E = S.pluginName, v = S.methodName, l = !1;
1957
+ return v.match(/^initialize/) || v.match(/^reset/) || (l = !f[E].loaded), u.offline && v.match(/^(page|track|identify)/) && (l = !0), y["" + E] = l, y;
1888
1958
  }, {});
1889
- return Promise.resolve(e.exact.reduce(function(g, I, _) {
1959
+ return Promise.resolve(e.exact.reduce(function(y, S, E) {
1890
1960
  try {
1891
- var w = I.pluginName;
1892
- return Promise.resolve(g).then(function(l) {
1893
- function k() {
1961
+ var v = S.pluginName;
1962
+ return Promise.resolve(y).then(function(l) {
1963
+ function b() {
1894
1964
  return Promise.resolve(l);
1895
1965
  }
1896
- var T = function() {
1897
- if (e.namespaced && e.namespaced[w])
1898
- return Promise.resolve(e.namespaced[w].reduce(function(P, x, L) {
1966
+ var j = function() {
1967
+ if (e.namespaced && e.namespaced[v])
1968
+ return Promise.resolve(e.namespaced[v].reduce(function(k, _, A) {
1899
1969
  try {
1900
- return Promise.resolve(P).then(function(D) {
1901
- return x.method && G(x.method) ? (function(Z, j) {
1902
- var K = dn(Z);
1903
- if (K && K.name === j) {
1904
- var M = dn(K.method);
1905
- throw new Error([j + " plugin is calling method " + Z, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + j + " plugin insteadof " + Z].join(`
1970
+ return Promise.resolve(k).then(function(U) {
1971
+ return _.method && G(_.method) ? (function(M, x) {
1972
+ var K = dn(M);
1973
+ 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(`
1906
1976
  `));
1907
1977
  }
1908
- }(x.methodName, x.pluginName), Promise.resolve(x.method({ payload: D, instance: r, abort: (F = D, U = w, H = x.pluginName, function(Z, j) {
1909
- return O({}, F, { abort: { reason: Z, plugins: j || [U], caller: c, from: H || U } });
1910
- }), config: sn(x.pluginName, f, o), plugins: f })).then(function(Z) {
1911
- var j = J(Z) ? Z : {};
1912
- return Promise.resolve(O({}, D, j));
1913
- })) : D;
1914
- var F, U, H;
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));
1983
+ })) : U;
1984
+ var R, L, H;
1915
1985
  });
1916
- } catch (D) {
1917
- return Promise.reject(D);
1986
+ } catch (U) {
1987
+ return Promise.reject(U);
1918
1988
  }
1919
- }, Promise.resolve(n))).then(function(P) {
1920
- l[w] = P;
1989
+ }, Promise.resolve(n))).then(function(k) {
1990
+ l[v] = k;
1921
1991
  });
1922
- l[w] = n;
1992
+ l[v] = n;
1923
1993
  }();
1924
- return T && T.then ? T.then(k) : k();
1994
+ return j && j.then ? j.then(b) : b();
1925
1995
  });
1926
1996
  } catch (l) {
1927
1997
  return Promise.reject(l);
1928
1998
  }
1929
- }, Promise.resolve({}))).then(function(g) {
1930
- return Promise.resolve(e.exact.reduce(function(I, _, w) {
1999
+ }, Promise.resolve({}))).then(function(y) {
2000
+ return Promise.resolve(e.exact.reduce(function(S, E, v) {
1931
2001
  try {
1932
- var l = e.exact.length === w + 1, k = _.pluginName, T = o[k];
1933
- return Promise.resolve(I).then(function(P) {
1934
- var x = g[k] ? g[k] : {};
1935
- if (h && (x = P), pt(x, k))
1936
- return ft({ data: x, method: c, instance: r, pluginName: k, store: s }), Promise.resolve(P);
1937
- if (pt(P, k))
1938
- return l && ft({ data: P, method: c, instance: r, store: s }), Promise.resolve(P);
1939
- if (v.hasOwnProperty(k) && v[k] === !0)
1940
- return s.dispatch({ type: "queue", plugin: k, payload: x, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(P);
1941
- var L = b(g[k], o[k]);
1942
- return Promise.resolve(T[c]({ abort: L.abort, payload: x, instance: r, config: sn(k, f, o), plugins: f })).then(function(D) {
1943
- var F = J(D) ? D : {}, U = O({}, P, F), H = g[k];
1944
- if (pt(H, k))
1945
- ft({ data: H, method: c, instance: r, pluginName: k, store: s });
2002
+ var l = e.exact.length === v + 1, b = E.pluginName, j = o[b];
2003
+ return Promise.resolve(S).then(function(k) {
2004
+ 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);
2009
+ if (I.hasOwnProperty(b) && I[b] === !0)
2010
+ 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 });
1946
2016
  else {
1947
- var Z = c + ":" + k;
1948
- (Z.match(/:/g) || []).length < 2 && !c.match(on) && !c.match(an) && r.dispatch(O({}, h ? U : x, { type: Z, _: { called: Z, from: "submethod" } }));
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" } }));
1949
2019
  }
1950
- return Promise.resolve(U);
2020
+ return Promise.resolve(L);
1951
2021
  });
1952
2022
  });
1953
- } catch (P) {
1954
- return Promise.reject(P);
2023
+ } catch (k) {
2024
+ return Promise.reject(k);
1955
2025
  }
1956
- }, Promise.resolve(n))).then(function(I) {
2026
+ }, Promise.resolve(n))).then(function(S) {
1957
2027
  if (!(c.match(Ie) || c.match(/^registerPlugin/) || c.match(an) || c.match(on) || c.match(/^params/) || c.match(/^userIdChanged/))) {
1958
- if (p.plugins.includes(c), I._ && I._.originalAction === c)
1959
- return I;
1960
- var _ = O({}, I, { _: { originalAction: I.type, called: I.type, from: "engineEnd" } });
1961
- Gn(I, e.exact.length) && !c.match(/End$/) && (_ = O({}, _, { type: I.type + "Aborted" })), s.dispatch(_);
2028
+ if (p.plugins.includes(c), S._ && S._.originalAction === c)
2029
+ 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);
1962
2032
  }
1963
- return I;
2033
+ return S;
1964
2034
  });
1965
2035
  });
1966
- } catch (g) {
1967
- return Promise.reject(g);
2036
+ } catch (y) {
2037
+ return Promise.reject(y);
1968
2038
  }
1969
2039
  }, Ie = /Start$/, on = /^bootstrap/, an = /^ready/;
1970
2040
  function ft(t) {
1971
2041
  var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
1972
- t.store.dispatch(O({}, t.data, { type: n, _: { called: n, from: "abort" } }));
2042
+ t.store.dispatch(T({}, t.data, { type: n, _: { called: n, from: "abort" } }));
1973
2043
  }
1974
2044
  function sn(t, e, n) {
1975
2045
  var r = e[t] || n[t];
@@ -2007,12 +2077,12 @@ function dn(t) {
2007
2077
  var e = t.match(/(.*):(.*)/);
2008
2078
  return !!e && { method: e[1], name: e[2] };
2009
2079
  }
2010
- function Ci(t) {
2080
+ function $i(t) {
2011
2081
  return Object.keys(t).reduce(function(e, n) {
2012
- return n === "type" || (e[n] = J(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2082
+ return n === "type" || (e[n] = X(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
2013
2083
  }, {});
2014
2084
  }
2015
- function $i(t, e, n) {
2085
+ function Ai(t, e, n) {
2016
2086
  var r = {};
2017
2087
  return function(i) {
2018
2088
  return function(o) {
@@ -2023,73 +2093,73 @@ function $i(t, e, n) {
2023
2093
  }, f = a.type, u = a.plugins, c = a;
2024
2094
  if (a.abort)
2025
2095
  return Promise.resolve(o(a));
2026
- if (f === E.enablePlugin && i.dispatch({ type: E.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), f === E.disablePlugin && setTimeout(function() {
2096
+ if (f === P.enablePlugin && i.dispatch({ type: P.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), f === P.disablePlugin && setTimeout(function() {
2027
2097
  return rn(a.meta.rid, { payload: a });
2028
- }, 0), f === E.initializeEnd) {
2029
- var h = e(), d = Object.keys(h), b = d.filter(function(l) {
2098
+ }, 0), f === P.initializeEnd) {
2099
+ var h = e(), d = Object.keys(h), w = d.filter(function(l) {
2030
2100
  return u.includes(l);
2031
2101
  }).map(function(l) {
2032
2102
  return h[l];
2033
- }), v = [], g = [], I = a.disabled, _ = b.map(function(l) {
2034
- var k = l.loaded, T = l.name, P = l.config;
2103
+ }), I = [], y = [], S = a.disabled, E = w.map(function(l) {
2104
+ var b = l.loaded, j = l.name, k = l.config;
2035
2105
  return Vn(l, function() {
2036
- return k({ config: P });
2037
- }, 1e4).then(function(x) {
2038
- return r[T] || (i.dispatch({ type: E.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(L) {
2039
- return !It.includes(L);
2040
- }) }), r[T] = !0), v = v.concat(T), l;
2041
- }).catch(function(x) {
2042
- if (x instanceof Error)
2043
- throw new Error(x);
2044
- return g = g.concat(x.name), x;
2106
+ return b({ config: k });
2107
+ }, 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);
2110
+ }) }), r[j] = !0), I = I.concat(j), l;
2111
+ }).catch(function(_) {
2112
+ if (_ instanceof Error)
2113
+ throw new Error(_);
2114
+ return y = y.concat(_.name), _;
2045
2115
  });
2046
2116
  });
2047
- Promise.all(_).then(function(l) {
2048
- var k = { plugins: v, failed: g, disabled: I };
2117
+ Promise.all(E).then(function(l) {
2118
+ var b = { plugins: I, failed: y, disabled: S };
2049
2119
  setTimeout(function() {
2050
- d.length === _.length + I.length && i.dispatch(O({}, { type: E.ready }, k));
2120
+ d.length === E.length + S.length && i.dispatch(T({}, { type: P.ready }, b));
2051
2121
  }, 0);
2052
2122
  });
2053
2123
  }
2054
- var w = function() {
2055
- if (f !== E.bootstrap)
2124
+ var v = function() {
2125
+ if (f !== P.bootstrap)
2056
2126
  return /^ready:([^:]*)$/.test(f) && setTimeout(function() {
2057
2127
  return Yn(i, e, t);
2058
- }, 0), Promise.resolve(function(l, k, T, P, x) {
2128
+ }, 0), Promise.resolve(function(l, b, j, k, _) {
2059
2129
  try {
2060
- var L = G(k) ? k() : k, D = l.type, F = D.replace(Ie, "");
2130
+ var A = G(b) ? b() : b, U = l.type, R = U.replace(Ie, "");
2061
2131
  if (l._ && l._.called)
2062
2132
  return Promise.resolve(l);
2063
- var U = T.getState(), H = (K = L, (M = U.plugins) === void 0 && (M = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(m) {
2064
- var y = Ce.plugins || {};
2065
- return fi(y[m]) ? y[m] : y.all !== !1 && (!M[m] || M[m].enabled !== !1);
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) {
2134
+ var g = Ce.plugins || {};
2135
+ return pi(g[m]) ? g[m] : g.all !== !1 && (!J[m] || J[m].enabled !== !1);
2066
2136
  }).map(function(m) {
2067
2137
  return K[m];
2068
2138
  }));
2069
- D === E.initializeStart && l.fromEnable && (H = Object.keys(U.plugins).filter(function(m) {
2070
- var y = U.plugins[m];
2071
- return l.plugins.includes(m) && !y.initialized;
2139
+ U === P.initializeStart && l.fromEnable && (H = Object.keys(L.plugins).filter(function(m) {
2140
+ var g = L.plugins[m];
2141
+ return l.plugins.includes(m) && !g.initialized;
2072
2142
  }).map(function(m) {
2073
- return L[m];
2143
+ return A[m];
2074
2144
  }));
2075
- var Z = H.map(function(m) {
2145
+ var M = H.map(function(m) {
2076
2146
  return m.name;
2077
- }), j = function(m, y, S) {
2147
+ }), x = function(m, g, O) {
2078
2148
  var C = un(m).map(function($) {
2079
- return cn($, y);
2149
+ return cn($, g);
2080
2150
  });
2081
- return y.reduce(function($, z) {
2082
- var W = z.name, N = un(m, W).map(function($e) {
2083
- return cn($e, y);
2084
- }), R = N[0], A = N[1], q = N[2];
2085
- return R.length && ($.beforeNS[W] = R), A.length && ($.duringNS[W] = A), q.length && ($.afterNS[W] = q), $;
2151
+ return g.reduce(function($, z) {
2152
+ var W = z.name, D = un(m, W).map(function($e) {
2153
+ return cn($e, g);
2154
+ }), 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), $;
2086
2156
  }, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
2087
- }(D, H);
2088
- return Promise.resolve(ht({ action: l, data: { exact: j.before, namespaced: j.beforeNS }, state: U, allPlugins: L, allMatches: j, instance: T, store: P, EVENTS: x })).then(function(m) {
2089
- function y() {
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) {
2159
+ function g() {
2090
2160
  var $ = function() {
2091
- if (D.match(Ie))
2092
- return Promise.resolve(ht({ action: O({}, S, { type: F + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: U, allPlugins: L, allMatches: j, instance: T, store: P, EVENTS: x })).then(function(z) {
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) {
2093
2163
  z.meta && z.meta.hasCallback && rn(z.meta.rid, { payload: z });
2094
2164
  });
2095
2165
  }();
@@ -2097,26 +2167,26 @@ function $i(t, e, n) {
2097
2167
  return m;
2098
2168
  }) : m;
2099
2169
  }
2100
- if (Gn(m, Z.length))
2170
+ if (Gn(m, M.length))
2101
2171
  return m;
2102
- var S, C = function() {
2103
- if (D !== F)
2104
- return Promise.resolve(ht({ action: O({}, m, { type: F }), data: { exact: j.during, namespaced: j.duringNS }, state: U, allPlugins: L, allMatches: j, instance: T, store: P, EVENTS: x })).then(function($) {
2105
- S = $;
2172
+ var O, C = function() {
2173
+ 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 = $;
2106
2176
  });
2107
- S = m;
2177
+ O = m;
2108
2178
  }();
2109
- return C && C.then ? C.then(y) : y();
2179
+ return C && C.then ? C.then(g) : g();
2110
2180
  });
2111
2181
  } catch (m) {
2112
2182
  return Promise.reject(m);
2113
2183
  }
2114
- var K, M, Ce;
2184
+ var K, J, Ce;
2115
2185
  }(a, e, t, i, n)).then(function(l) {
2116
2186
  return s = 1, o(l);
2117
2187
  });
2118
2188
  }();
2119
- return Promise.resolve(w && w.then ? w.then(p) : p(w));
2189
+ return Promise.resolve(v && v.then ? v.then(p) : p(v));
2120
2190
  } catch (l) {
2121
2191
  return Promise.reject(l);
2122
2192
  }
@@ -2129,17 +2199,17 @@ function zi(t) {
2129
2199
  return function(n) {
2130
2200
  return function(r) {
2131
2201
  var i = r.type, o = r.key, a = r.value, s = r.options;
2132
- if (i === E.setItem || i === E.removeItem) {
2202
+ if (i === P.setItem || i === P.removeItem) {
2133
2203
  if (r.abort)
2134
2204
  return n(r);
2135
- i === E.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
2205
+ i === P.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
2136
2206
  }
2137
2207
  return n(r);
2138
2208
  };
2139
2209
  };
2140
2210
  };
2141
2211
  }
2142
- var Ai = function() {
2212
+ var Ni = function() {
2143
2213
  var t = this;
2144
2214
  this.before = [], this.after = [], this.addMiddleware = function(e, n) {
2145
2215
  t[n] = t[n].concat(e);
@@ -2163,7 +2233,7 @@ var Ai = function() {
2163
2233
  };
2164
2234
  };
2165
2235
  };
2166
- function Ni(t) {
2236
+ function Di(t) {
2167
2237
  return function(e, n) {
2168
2238
  e === void 0 && (e = {});
2169
2239
  var r = {};
@@ -2174,19 +2244,19 @@ function Ni(t) {
2174
2244
  if (!o || !i)
2175
2245
  return e;
2176
2246
  var a = n.enabled, s = o.config;
2177
- return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, O({}, e, r);
2247
+ return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, T({}, e, r);
2178
2248
  }
2179
2249
  if (/^initialize:([^:]*)$/.test(n.type)) {
2180
- var p = hn(n.type, E.initialize), f = t()[p];
2181
- return f && p ? (r[p] = O({}, e[p], { initialized: !0, loaded: !!f.loaded({ config: f.config }) }), O({}, e, r)) : e;
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;
2182
2252
  }
2183
2253
  if (/^ready:([^:]*)$/.test(n.type))
2184
- return r[n.name] = O({}, e[n.name], { loaded: !0 }), O({}, e, r);
2254
+ return r[n.name] = T({}, e[n.name], { loaded: !0 }), T({}, e, r);
2185
2255
  switch (n.type) {
2186
- case E.disablePlugin:
2187
- return O({}, e, fn(n.plugins, !1, e));
2188
- case E.enablePlugin:
2189
- return O({}, e, fn(n.plugins, !0, e));
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));
2190
2260
  default:
2191
2261
  return e;
2192
2262
  }
@@ -2197,7 +2267,7 @@ function hn(t, e) {
2197
2267
  }
2198
2268
  function fn(t, e, n) {
2199
2269
  return t.reduce(function(r, i) {
2200
- return r[i] = O({}, n[i], { enabled: e }), r;
2270
+ return r[i] = T({}, n[i], { enabled: e }), r;
2201
2271
  }, n);
2202
2272
  }
2203
2273
  function Bn(t) {
@@ -2207,24 +2277,24 @@ function Bn(t) {
2207
2277
  }
2208
2278
  return t;
2209
2279
  }
2210
- var Di = { last: {}, history: [] };
2280
+ var Ui = { last: {}, history: [] };
2211
2281
  function Li(t, e) {
2212
- t === void 0 && (t = Di);
2282
+ t === void 0 && (t = Ui);
2213
2283
  var n = e.options, r = e.meta;
2214
- if (e.type === E.track) {
2215
- var i = Bn(O({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
2216
- return O({}, t, { last: i, history: t.history.concat(i) });
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) });
2217
2287
  }
2218
2288
  return t;
2219
2289
  }
2220
- var Ui = { actions: [] };
2221
- function Ri(t, e) {
2222
- t === void 0 && (t = Ui);
2290
+ var Ri = { actions: [] };
2291
+ function Zi(t, e) {
2292
+ t === void 0 && (t = Ri);
2223
2293
  var n = e.payload;
2224
2294
  switch (e.type) {
2225
2295
  case "queue":
2226
2296
  var r;
2227
- return r = n && n.type && n.type === E.identify ? [e].concat(t.actions) : t.actions.concat(e), O({}, t, { actions: r });
2297
+ return r = n && n.type && n.type === P.identify ? [e].concat(t.actions) : t.actions.concat(e), T({}, t, { actions: r });
2228
2298
  case "dequeue":
2229
2299
  return [];
2230
2300
  default:
@@ -2232,7 +2302,7 @@ function Ri(t, e) {
2232
2302
  }
2233
2303
  }
2234
2304
  var qn = /#.*$/;
2235
- function Zi(t) {
2305
+ function Mi(t) {
2236
2306
  var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
2237
2307
  return "/" + (e && e[3] ? e[3].split("?")[0].replace(qn, "") : "");
2238
2308
  }
@@ -2242,21 +2312,21 @@ var Qn, er, tr, nr, Wi = function(t) {
2242
2312
  var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, p = o.hash, f = o.search, u = function(h) {
2243
2313
  var d = function() {
2244
2314
  if (Y) {
2245
- for (var b, v = document.getElementsByTagName("link"), g = 0; b = v[g]; g++)
2246
- if (b.getAttribute("rel") === "canonical")
2247
- return b.getAttribute("href");
2315
+ for (var w, I = document.getElementsByTagName("link"), y = 0; w = I[y]; y++)
2316
+ if (w.getAttribute("rel") === "canonical")
2317
+ return w.getAttribute("href");
2248
2318
  }
2249
2319
  }();
2250
2320
  return d ? d.match(/\?/) ? d : d + h : window.location.href.replace(qn, "");
2251
- }(f), c = { title: n, url: u, path: Zi(u), hash: p, search: f, width: a, height: s };
2252
- return r && r !== "" && (c.referrer = r), O({}, c, t);
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);
2253
2323
  }, Ki = { last: {}, history: [] };
2254
- function Mi(t, e) {
2324
+ function Ji(t, e) {
2255
2325
  t === void 0 && (t = Ki);
2256
2326
  var n = e.options;
2257
- if (e.type === E.page) {
2258
- var r = Bn(O({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
2259
- return O({}, t, { last: r, history: t.history.concat(r) });
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) });
2260
2330
  }
2261
2331
  return t;
2262
2332
  }
@@ -2265,24 +2335,24 @@ Qn = function() {
2265
2335
  return !1;
2266
2336
  var t = navigator.appVersion;
2267
2337
  return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
2268
- }(), er = Y ? document.referrer : null, tr = bi(), nr = ki();
2338
+ }(), er = Y ? document.referrer : null, tr = ki(), nr = Ii();
2269
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 };
2270
- function Ji(t, e) {
2340
+ function Xi(t, e) {
2271
2341
  t === void 0 && (t = pn);
2272
2342
  var n = t.initialized, r = e.campaign;
2273
2343
  switch (e.type) {
2274
- case E.campaign:
2275
- return O({}, t, { campaign: r });
2276
- case E.offline:
2277
- return O({}, t, { offline: !0 });
2278
- case E.online:
2279
- return O({}, t, { offline: !1 });
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 });
2280
2350
  default:
2281
- return n ? t : O({}, pn, t, { initialized: !0 });
2351
+ return n ? t : T({}, pn, t, { initialized: !0 });
2282
2352
  }
2283
2353
  }
2284
- var Xi = ["plugins", "reducers", "storage"];
2285
- function Fi(t, e, n) {
2354
+ var Fi = ["plugins", "reducers", "storage"];
2355
+ function Hi(t, e, n) {
2286
2356
  if (Y) {
2287
2357
  var r = window[(n ? "add" : "remove") + "EventListener"];
2288
2358
  t.split(" ").forEach(function(i) {
@@ -2290,8 +2360,8 @@ function Fi(t, e, n) {
2290
2360
  });
2291
2361
  }
2292
2362
  }
2293
- function Hi(t) {
2294
- var e = Fi.bind(null, "online offline", function(n) {
2363
+ function Vi(t) {
2364
+ var e = Hi.bind(null, "online offline", function(n) {
2295
2365
  return Promise.resolve(!navigator.onLine).then(t);
2296
2366
  });
2297
2367
  return e(!0), function(n) {
@@ -2328,36 +2398,36 @@ function gn(t, e, n) {
2328
2398
  return s;
2329
2399
  }(n), function(a) {
2330
2400
  i && i(a), r(a);
2331
- })), O({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2401
+ })), T({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
2332
2402
  }
2333
- function Vi(t) {
2403
+ function Yi(t) {
2334
2404
  t === void 0 && (t = {});
2335
- var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, y) {
2336
- if (G(y))
2337
- return m.middlewares = m.middlewares.concat(y), m;
2338
- if (y.NAMESPACE && (y.name = y.NAMESPACE), !y.name)
2405
+ var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(m, g) {
2406
+ if (G(g))
2407
+ return m.middlewares = m.middlewares.concat(g), m;
2408
+ if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
2339
2409
  throw new Error("https://lytics.dev/errors/1");
2340
- y.config || (y.config = {});
2341
- var S = y.EVENTS ? Object.keys(y.EVENTS).map(function(z) {
2342
- return y.EVENTS[z];
2410
+ g.config || (g.config = {});
2411
+ var O = g.EVENTS ? Object.keys(g.EVENTS).map(function(z) {
2412
+ return g.EVENTS[z];
2343
2413
  }) : [];
2344
- m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(z, W) {
2345
- var N;
2346
- return z[W] = (N = y.methods[W], function() {
2347
- for (var R = Array.prototype.slice.call(arguments), A = new Array(N.length), q = 0; q < R.length; q++)
2348
- A[q] = R[q];
2349
- return A[A.length] = k, N.apply({ instance: k }, A);
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) {
2415
+ var D;
2416
+ return z[W] = (D = g.methods[W], function() {
2417
+ for (var Z = Array.prototype.slice.call(arguments), N = new Array(D.length), q = 0; q < Z.length; q++)
2418
+ N[q] = Z[q];
2419
+ return N[N.length] = b, D.apply({ instance: b }, N);
2350
2420
  }), z;
2351
- }, {}), delete y.methods);
2352
- var C = Object.keys(y).concat(S), $ = new Set(m.events.concat(C));
2353
- if (m.events = Array.from($), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
2354
- throw new Error(y.name + "AlreadyLoaded");
2355
- return m.plugins[y.name] = y, m.plugins[y.name].loaded || (m.plugins[y.name].loaded = function() {
2421
+ }, {}), 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])
2424
+ throw new Error(g.name + "AlreadyLoaded");
2425
+ return m.plugins[g.name] = g, m.plugins[g.name].loaded || (m.plugins[g.name].loaded = function() {
2356
2426
  return !0;
2357
2427
  }), m;
2358
2428
  }, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: me, setItem: ge, removeItem: je }, o = /* @__PURE__ */ function(m) {
2359
- return function(y, S, C) {
2360
- return S.getState("user")[y] || (C && J(C) && C[y] ? C[y] : nn(m)[y] || me(_t(y)) || null);
2429
+ 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);
2361
2431
  };
2362
2432
  }(i), a = r.plugins, s = r.events.filter(function(m) {
2363
2433
  return !It.includes(m);
@@ -2365,82 +2435,82 @@ function Vi(t) {
2365
2435
  return !It.includes(m);
2366
2436
  })), f = Array.from(p).sort(), u = function() {
2367
2437
  return a;
2368
- }, c = new Ai(), h = c.addMiddleware, d = c.removeMiddleware, b = c.dynamicMiddlewares, v = function() {
2438
+ }, c = new Ni(), h = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, I = function() {
2369
2439
  throw new Error("Abort disabled inListener");
2370
- }, g = Ii(), I = nn(i), _ = O({}, I, n, g.an_uid ? { userId: g.an_uid } : {}, g.an_aid ? { anonymousId: g.an_aid } : {});
2371
- _.anonymousId || (_.anonymousId = it());
2372
- var w = O({ enable: function(m, y) {
2373
- return new Promise(function(S) {
2374
- j.dispatch({ type: E.enablePlugin, plugins: mt(m), _: { originalAction: E.enablePlugin } }, S, [y]);
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) {
2443
+ return new Promise(function(O) {
2444
+ x.dispatch({ type: P.enablePlugin, plugins: mt(m), _: { originalAction: P.enablePlugin } }, O, [g]);
2375
2445
  });
2376
- }, disable: function(m, y) {
2377
- return new Promise(function(S) {
2378
- j.dispatch({ type: E.disablePlugin, plugins: mt(m), _: { originalAction: E.disablePlugin } }, S, [y]);
2446
+ }, disable: function(m, g) {
2447
+ return new Promise(function(O) {
2448
+ x.dispatch({ type: P.disablePlugin, plugins: mt(m), _: { originalAction: P.disablePlugin } }, O, [g]);
2379
2449
  });
2380
- } }, r.methods), l = !1, k = { identify: function(m, y, S, C) {
2450
+ } }, r.methods), l = !1, b = { identify: function(m, g, O, C) {
2381
2451
  try {
2382
- var $ = re(m) ? m : null, z = J(m) ? m : y, W = S || {}, N = k.user();
2452
+ var $ = re(m) ? m : null, z = X(m) ? m : g, W = O || {}, D = b.user();
2383
2453
  ge(_t(te), $);
2384
- var R = $ || z.userId || o(te, k, z);
2385
- return Promise.resolve(new Promise(function(A) {
2386
- j.dispatch(O({ type: E.identifyStart, userId: R, traits: z || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== $ && { previousId: N.id }), A, [y, S, C]);
2454
+ var Z = $ || z.userId || o(te, b, z);
2455
+ 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]);
2387
2457
  }));
2388
- } catch (A) {
2389
- return Promise.reject(A);
2458
+ } catch (N) {
2459
+ return Promise.reject(N);
2390
2460
  }
2391
- }, track: function(m, y, S, C) {
2461
+ }, track: function(m, g, O, C) {
2392
2462
  try {
2393
- var $ = J(m) ? m.event : m;
2463
+ var $ = X(m) ? m.event : m;
2394
2464
  if (!$ || !re($))
2395
2465
  throw new Error("EventMissing");
2396
- var z = J(m) ? m : y || {}, W = J(S) ? S : {};
2397
- return Promise.resolve(new Promise(function(N) {
2398
- j.dispatch({ type: E.trackStart, event: $, properties: z, options: W, userId: o(te, k, y), anonymousId: o(be, k, y) }, N, [y, S, C]);
2466
+ var z = X(m) ? m : g || {}, W = X(O) ? O : {};
2467
+ 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]);
2399
2469
  }));
2400
- } catch (N) {
2401
- return Promise.reject(N);
2470
+ } catch (D) {
2471
+ return Promise.reject(D);
2402
2472
  }
2403
- }, page: function(m, y, S) {
2473
+ }, page: function(m, g, O) {
2404
2474
  try {
2405
- var C = J(m) ? m : {}, $ = J(y) ? y : {};
2475
+ var C = X(m) ? m : {}, $ = X(g) ? g : {};
2406
2476
  return Promise.resolve(new Promise(function(z) {
2407
- j.dispatch({ type: E.pageStart, properties: Wi(C), options: $, userId: o(te, k, C), anonymousId: o(be, k, C) }, z, [m, y, S]);
2477
+ x.dispatch({ type: P.pageStart, properties: Wi(C), options: $, userId: o(te, b, C), anonymousId: o(be, b, C) }, z, [m, g, O]);
2408
2478
  }));
2409
2479
  } catch (z) {
2410
2480
  return Promise.reject(z);
2411
2481
  }
2412
2482
  }, user: function(m) {
2413
2483
  if (m === te || m === "id")
2414
- return o(te, k);
2484
+ return o(te, b);
2415
2485
  if (m === be || m === "anonId")
2416
- return o(be, k);
2417
- var y = k.getState("user");
2418
- return m ? Yt(y, m) : y;
2486
+ return o(be, b);
2487
+ var g = b.getState("user");
2488
+ return m ? Yt(g, m) : g;
2419
2489
  }, reset: function(m) {
2420
- return new Promise(function(y) {
2421
- j.dispatch({ type: E.resetStart }, y, m);
2490
+ return new Promise(function(g) {
2491
+ x.dispatch({ type: P.resetStart }, g, m);
2422
2492
  });
2423
2493
  }, ready: function(m) {
2424
- return l && m({ plugins: w, instance: k }), k.on(E.ready, function(y) {
2425
- m(y), l = !0;
2494
+ return l && m({ plugins: v, instance: b }), b.on(P.ready, function(g) {
2495
+ m(g), l = !0;
2426
2496
  });
2427
- }, on: function(m, y) {
2428
- if (!m || !G(y))
2497
+ }, on: function(m, g) {
2498
+ if (!m || !G(g))
2429
2499
  return !1;
2430
- if (m === E.bootstrap)
2500
+ if (m === P.bootstrap)
2431
2501
  throw new Error(".on disabled for " + m);
2432
- var S = /Start$|Start:/;
2502
+ var O = /Start$|Start:/;
2433
2503
  if (m === "*") {
2434
- var C = function(N) {
2435
- return function(R) {
2436
- return function(A) {
2437
- return A.type.match(S) && y({ payload: A, instance: k, plugins: a }), R(A);
2504
+ var C = function(D) {
2505
+ return function(Z) {
2506
+ return function(N) {
2507
+ return N.type.match(O) && g({ payload: N, instance: b, plugins: a }), Z(N);
2438
2508
  };
2439
2509
  };
2440
- }, $ = function(N) {
2441
- return function(R) {
2442
- return function(A) {
2443
- return A.type.match(S) || y({ payload: A, instance: k, plugins: a }), R(A);
2510
+ }, $ = function(D) {
2511
+ return function(Z) {
2512
+ return function(N) {
2513
+ return N.type.match(O) || g({ payload: N, instance: b, plugins: a }), Z(N);
2444
2514
  };
2445
2515
  };
2446
2516
  };
@@ -2448,114 +2518,114 @@ function Vi(t) {
2448
2518
  d(C, He), d($, Ve);
2449
2519
  };
2450
2520
  }
2451
- var z = m.match(S) ? He : Ve, W = function(N) {
2452
- return function(R) {
2453
- return function(A) {
2454
- return A.type === m && y({ payload: A, instance: k, plugins: a, abort: v }), R(A);
2521
+ var z = m.match(O) ? He : Ve, W = function(D) {
2522
+ return function(Z) {
2523
+ return function(N) {
2524
+ return N.type === m && g({ payload: N, instance: b, plugins: a, abort: I }), Z(N);
2455
2525
  };
2456
2526
  };
2457
2527
  };
2458
2528
  return h(W, z), function() {
2459
2529
  return d(W, z);
2460
2530
  };
2461
- }, once: function(m, y) {
2462
- if (!m || !G(y))
2531
+ }, once: function(m, g) {
2532
+ if (!m || !G(g))
2463
2533
  return !1;
2464
- if (m === E.bootstrap)
2534
+ if (m === P.bootstrap)
2465
2535
  throw new Error(".once disabled for " + m);
2466
- var S = k.on(m, function(C) {
2467
- y({ payload: C.payload, instance: k, plugins: a, abort: v }), S();
2536
+ var O = b.on(m, function(C) {
2537
+ g({ payload: C.payload, instance: b, plugins: a, abort: I }), O();
2468
2538
  });
2469
- return S;
2539
+ return O;
2470
2540
  }, getState: function(m) {
2471
- var y = j.getState();
2472
- return m ? Yt(y, m) : Object.assign({}, y);
2541
+ var g = x.getState();
2542
+ return m ? Yt(g, m) : Object.assign({}, g);
2473
2543
  }, dispatch: function(m) {
2474
- var y = re(m) ? { type: m } : m;
2475
- if (Be.includes(y.type))
2476
- throw new Error("reserved action " + y.type);
2477
- var S = O({}, y, { _: O({ originalAction: y.type }, m._ || {}) });
2478
- j.dispatch(S);
2479
- }, enablePlugin: w.enable, disablePlugin: w.disable, plugins: w, storage: { getItem: i.getItem, setItem: function(m, y, S) {
2480
- j.dispatch({ type: E.setItemStart, key: m, value: y, options: S });
2481
- }, removeItem: function(m, y) {
2482
- j.dispatch({ type: E.removeItemStart, key: m, options: y });
2483
- } }, setAnonymousId: function(m, y) {
2484
- k.storage.setItem(ie, m, y);
2485
- }, events: { core: Be, plugins: s } }, T = r.middlewares.concat([function(m) {
2486
- return function(y) {
2487
- return function(S) {
2488
- return S.meta || (S.meta = gn()), y(S);
2544
+ var g = re(m) ? { type: m } : m;
2545
+ if (Be.includes(g.type))
2546
+ throw new Error("reserved action " + g.type);
2547
+ var O = T({}, g, { _: T({ originalAction: g.type }, m._ || {}) });
2548
+ x.dispatch(O);
2549
+ }, 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 });
2551
+ }, removeItem: function(m, g) {
2552
+ x.dispatch({ type: P.removeItemStart, key: m, options: g });
2553
+ } }, setAnonymousId: function(m, g) {
2554
+ b.storage.setItem(ie, m, g);
2555
+ }, events: { core: Be, plugins: s } }, j = r.middlewares.concat([function(m) {
2556
+ return function(g) {
2557
+ return function(O) {
2558
+ return O.meta || (O.meta = gn()), g(O);
2489
2559
  };
2490
2560
  };
2491
- }, b(He), $i(k, u, { all: f, plugins: s }), zi(i), Pi(k), ji(k), b(Ve)]), P = { context: Ji, user: Ti(i), page: Mi, track: Li, plugins: Ni(u), queue: Ri }, x = Te, L = Te;
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;
2492
2562
  if (Y && t.debug) {
2493
- var D = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2494
- D && (x = D({ trace: !0, traceLimit: 25 })), L = function() {
2495
- return arguments.length === 0 ? rr() : J(typeof arguments[0]) ? mn() : mn().apply(null, arguments);
2563
+ 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);
2496
2566
  };
2497
2567
  }
2498
- var F, U = function(m) {
2499
- return Object.keys(m).reduce(function(y, S) {
2500
- return Xi.includes(S) || (y[S] = m[S]), y;
2568
+ var R, L = function(m) {
2569
+ return Object.keys(m).reduce(function(g, O) {
2570
+ return Fi.includes(O) || (g[O] = m[O]), g;
2501
2571
  }, {});
2502
- }(t), H = r.pluginsArray.reduce(function(m, y) {
2503
- var S = y.name, C = y.config, $ = y.loaded, z = r.pluginEnabled[S];
2504
- return m[S] = { enabled: z, initialized: !!z && !y.initialize, loaded: !!$({ config: C }), config: C }, m;
2505
- }, {}), Z = { context: U, user: _, plugins: H }, j = Hn(function(m) {
2506
- for (var y = Object.keys(m), S = {}, C = 0; C < y.length; C++) {
2507
- var $ = y[C];
2508
- typeof m[$] === ne && (S[$] = m[$]);
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) {
2576
+ for (var g = Object.keys(m), O = {}, C = 0; C < g.length; C++) {
2577
+ var $ = g[C];
2578
+ typeof m[$] === ne && (O[$] = m[$]);
2509
2579
  }
2510
- var z, W = Object.keys(S);
2580
+ var z, W = Object.keys(O);
2511
2581
  try {
2512
- (function(N) {
2513
- Object.keys(N).forEach(function(R) {
2514
- var A = N[R];
2515
- if (typeof A(void 0, { type: "@@redux/INIT" }) === ee || typeof A(void 0, { type: Si }) === ee)
2516
- throw new Error("reducer " + R + " " + ee);
2582
+ (function(D) {
2583
+ Object.keys(D).forEach(function(Z) {
2584
+ var N = D[Z];
2585
+ if (typeof N(void 0, { type: "@@redux/INIT" }) === ee || typeof N(void 0, { type: Ei }) === ee)
2586
+ throw new Error("reducer " + Z + " " + ee);
2517
2587
  });
2518
- })(S);
2519
- } catch (N) {
2520
- z = N;
2588
+ })(O);
2589
+ } catch (D) {
2590
+ z = D;
2521
2591
  }
2522
- return function(N, R) {
2523
- if (N === void 0 && (N = {}), z)
2592
+ return function(D, Z) {
2593
+ if (D === void 0 && (D = {}), z)
2524
2594
  throw z;
2525
- for (var A = !1, q = {}, $e = 0; $e < W.length; $e++) {
2526
- var Ke = W[$e], Dt = N[Ke], st = (0, S[Ke])(Dt, R);
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);
2527
2597
  if (typeof st === ee) {
2528
- var fr = Ei(Ke, R);
2529
- throw new Error(fr);
2598
+ var pr = Oi(We, Z);
2599
+ throw new Error(pr);
2530
2600
  }
2531
- q[Ke] = st, A = A || st !== Dt;
2601
+ q[We] = st, N = N || st !== Dt;
2532
2602
  }
2533
- return A ? q : N;
2603
+ return N ? q : D;
2534
2604
  };
2535
- }(O({}, P, e)), Z, L(x(Oi.apply(void 0, T))));
2536
- j.dispatch = (F = j.dispatch, function(m, y, S) {
2537
- var C = O({}, m, { meta: gn(m.meta, y, mt(S)) });
2538
- return F.apply(null, [C]);
2605
+ }(T({}, k, e)), M, A(_(Pi.apply(void 0, j))));
2606
+ x.dispatch = (R = x.dispatch, function(m, g, O) {
2607
+ var C = T({}, m, { meta: gn(m.meta, g, mt(O)) });
2608
+ return R.apply(null, [C]);
2539
2609
  });
2540
2610
  var K = Object.keys(a);
2541
- j.dispatch({ type: E.bootstrap, plugins: K, config: U, params: g, user: _, initialUser: n, persistedUser: I });
2542
- var M = K.filter(function(m) {
2611
+ x.dispatch({ type: P.bootstrap, plugins: K, config: L, params: y, user: E, initialUser: n, persistedUser: S });
2612
+ var J = K.filter(function(m) {
2543
2613
  return r.pluginEnabled[m];
2544
2614
  }), Ce = K.filter(function(m) {
2545
2615
  return !r.pluginEnabled[m];
2546
2616
  });
2547
- return j.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(m, y) {
2548
- var S = m.bootstrap, C = m.config, $ = m.name;
2549
- S && G(S) && S({ instance: k, config: C, payload: m }), j.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: m }), r.pluginsArray.length === y + 1 && j.dispatch({ type: E.initializeStart, plugins: M, disabled: Ce });
2550
- }), Hi(function(m) {
2551
- j.dispatch({ type: m ? E.offline : E.online });
2552
- }), function(m, y, S) {
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 });
2622
+ }), function(m, g, O) {
2553
2623
  setInterval(function() {
2554
- return Yn(m, y, S);
2624
+ return Yn(m, g, O);
2555
2625
  }, 3e3);
2556
- }(j, u, k), k;
2626
+ }(x, u, b), b;
2557
2627
  }
2558
- var He = "before", Ve = "after", Le = "cookie", ue = ar(), ir = ot, Yi = ot;
2628
+ var He = "before", Ve = "after", Ue = "cookie", ue = ar(), ir = ot, Gi = ot;
2559
2629
  function or(t) {
2560
2630
  return ue ? ot(t, "", -1) : je(t);
2561
2631
  }
@@ -2576,11 +2646,11 @@ function ot(t, e, n, r, i, o) {
2576
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]);
2577
2647
  }
2578
2648
  }
2579
- var Ue = "localStorage", Gi = jt.bind(null, "localStorage");
2649
+ var Le = "localStorage", Bi = jt.bind(null, "localStorage");
2580
2650
  xe("localStorage", "getItem", me);
2581
2651
  xe("localStorage", "setItem", ge);
2582
2652
  xe("localStorage", "removeItem", je);
2583
- var Re = "sessionStorage", Bi = jt.bind(null, "sessionStorage");
2653
+ var Re = "sessionStorage", qi = jt.bind(null, "sessionStorage");
2584
2654
  xe("sessionStorage", "getItem", me);
2585
2655
  xe("sessionStorage", "setItem", ge);
2586
2656
  xe("sessionStorage", "removeItem", je);
@@ -2591,7 +2661,7 @@ function _e(t) {
2591
2661
  return !0;
2592
2662
  if (e === "false")
2593
2663
  return !1;
2594
- if (J(e))
2664
+ if (X(e))
2595
2665
  return e;
2596
2666
  parseFloat(e) === e && (e = parseFloat(e));
2597
2667
  } catch {
@@ -2599,57 +2669,57 @@ function _e(t) {
2599
2669
  if (e !== null && e !== "")
2600
2670
  return e;
2601
2671
  }
2602
- var qi = Gi(), Qi = Bi(), eo = ar();
2672
+ var Qi = Bi(), eo = qi(), to = ar();
2603
2673
  function sr(t, e) {
2604
2674
  if (t) {
2605
- var n = xt(e), r = !At(n), i = Ct(n) ? _e(localStorage.getItem(t)) : void 0;
2675
+ var n = xt(e), r = !zt(n), i = Ct(n) ? _e(localStorage.getItem(t)) : void 0;
2606
2676
  if (r && !we(i))
2607
2677
  return i;
2608
2678
  var o = $t(n) ? _e(ir(t)) : void 0;
2609
2679
  if (r && o)
2610
2680
  return o;
2611
- var a = zt(n) ? _e(sessionStorage.getItem(t)) : void 0;
2681
+ var a = At(n) ? _e(sessionStorage.getItem(t)) : void 0;
2612
2682
  if (r && a)
2613
2683
  return a;
2614
2684
  var s = me(t);
2615
2685
  return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
2616
2686
  }
2617
2687
  }
2618
- function to(t, e, n) {
2688
+ function no(t, e, n) {
2619
2689
  if (t && !we(e)) {
2620
- var r = {}, i = xt(n), o = JSON.stringify(e), a = !At(i);
2621
- return Ct(i) && (r[Ue] = Ye(Ue, e, _e(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ue] : $t(i) && (r[Le] = Ye(Le, e, _e(ir(t))), Yi(t, o), a) ? r[Le] : zt(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);
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);
2622
2692
  }
2623
2693
  }
2624
- function no(t, e) {
2694
+ function ro(t, e) {
2625
2695
  if (t) {
2626
- var n = xt(e), r = sr(t, Kn), i = {};
2627
- return !we(r.localStorage) && Ct(n) && (localStorage.removeItem(t), i[Ue] = r.localStorage), !we(r.cookie) && $t(n) && (or(t), i[Le] = r.cookie), !we(r.sessionStorage) && zt(n) && (sessionStorage.removeItem(t), i[Re] = r.sessionStorage), !we(r.global) && at(n, De) && (je(t), i[De] = r.global), i;
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;
2628
2698
  }
2629
2699
  }
2630
2700
  function xt(t) {
2631
- return t ? re(t) ? t : t.storage : Wn;
2701
+ return t ? re(t) ? t : t.storage : Mn;
2632
2702
  }
2633
2703
  function Ct(t) {
2634
- return qi && at(t, Ue);
2704
+ return Qi && at(t, Le);
2635
2705
  }
2636
2706
  function $t(t) {
2637
- return eo && at(t, Le);
2638
- }
2639
- function zt(t) {
2640
- return Qi && at(t, Re);
2707
+ return to && at(t, Ue);
2641
2708
  }
2642
2709
  function At(t) {
2643
- return t === Kn || t === "all";
2710
+ return eo && at(t, Re);
2711
+ }
2712
+ function zt(t) {
2713
+ return t === Wn || t === "all";
2644
2714
  }
2645
2715
  function at(t, e) {
2646
- return t === Wn || t === e || At(t);
2716
+ return t === Mn || t === e || zt(t);
2647
2717
  }
2648
2718
  function Ye(t, e, n) {
2649
2719
  return { location: t, current: e, previous: n };
2650
2720
  }
2651
- var ro = { setItem: to, getItem: sr, removeItem: no };
2652
- function io(t, e, n) {
2721
+ var io = { setItem: no, getItem: sr, removeItem: ro };
2722
+ function oo(t, e, n) {
2653
2723
  return e in t ? Object.defineProperty(t, e, {
2654
2724
  value: n,
2655
2725
  enumerable: !0,
@@ -2671,20 +2741,20 @@ function vn(t) {
2671
2741
  for (var e = 1; e < arguments.length; e++) {
2672
2742
  var n = arguments[e] != null ? arguments[e] : {};
2673
2743
  e % 2 ? yn(Object(n), !0).forEach(function(r) {
2674
- io(t, r, n[r]);
2744
+ oo(t, r, n[r]);
2675
2745
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : yn(Object(n)).forEach(function(r) {
2676
2746
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
2677
2747
  });
2678
2748
  }
2679
2749
  return t;
2680
2750
  }
2681
- function oo() {
2751
+ function ao() {
2682
2752
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
2683
- storage: ro
2753
+ storage: io
2684
2754
  };
2685
- return Vi(vn(vn({}, e), t));
2755
+ return Yi(vn(vn({}, e), t));
2686
2756
  }
2687
- function ao(t, e) {
2757
+ function so(t, e) {
2688
2758
  e = e || {};
2689
2759
  var n, r, i = [], o = e.max || 1 / 0;
2690
2760
  function a() {
@@ -2706,7 +2776,7 @@ function ao(t, e) {
2706
2776
  }
2707
2777
  };
2708
2778
  }
2709
- function so(t) {
2779
+ function co(t) {
2710
2780
  if (typeof window > "u")
2711
2781
  return;
2712
2782
  const { addEventListener: e, history: n, location: r } = window;
@@ -2718,27 +2788,27 @@ function so(t) {
2718
2788
  const s = n[a];
2719
2789
  n[a] = function(...p) {
2720
2790
  var c;
2721
- const f = ((c = p[2]) == null ? void 0 : c.toString()) || "", u = uo(f);
2791
+ const f = ((c = p[2]) == null ? void 0 : c.toString()) || "", u = lo(f);
2722
2792
  return i !== u && (i = u, setTimeout(() => t(f), 0)), s.apply(n, p);
2723
2793
  };
2724
2794
  });
2725
2795
  }
2726
- function co(t, e) {
2796
+ function uo(t, e) {
2727
2797
  const n = t.indexOf(e);
2728
2798
  return n > -1 ? t.slice(0, n) : t;
2729
2799
  }
2730
- function uo(t) {
2731
- return ["#", "?"].forEach((e) => t = co(t, e)), t;
2800
+ function lo(t) {
2801
+ return ["#", "?"].forEach((e) => t = uo(t, e)), t;
2732
2802
  }
2733
- function lo() {
2734
- so(() => {
2803
+ function ho() {
2804
+ co(() => {
2735
2805
  se.page();
2736
2806
  });
2737
2807
  }
2738
2808
  var wn = "EventListener";
2739
- function ho(t) {
2809
+ function fo(t) {
2740
2810
  return function(e, n, r, i) {
2741
- var o = r || ui, a = i || !1;
2811
+ var o = r || li, a = i || !1;
2742
2812
  if (!Y)
2743
2813
  return o;
2744
2814
  var s = et(n), p = et(e, !0);
@@ -2750,10 +2820,10 @@ function ho(t) {
2750
2820
  return function u(c) {
2751
2821
  c && (f = []);
2752
2822
  for (var h = c ? "add" + wn : "remove" + wn, d = 0; d < p.length; d++) {
2753
- var b = p[d];
2754
- f[d] = c ? a && a.once ? fo(o) : o : f[d] || o;
2755
- for (var v = 0; v < s.length; v++)
2756
- b[h] ? b["on" + s[v]] = c ? f[d] : null : b[h](s[v], f[d], a);
2823
+ var w = p[d];
2824
+ f[d] = c ? a && a.once ? po(o) : o : f[d] || o;
2825
+ for (var I = 0; I < s.length; I++)
2826
+ w[h] ? w["on" + s[I]] = c ? f[d] : null : w[h](s[I], f[d], a);
2757
2827
  }
2758
2828
  return u.bind(null, !c);
2759
2829
  }(t);
@@ -2770,18 +2840,18 @@ function et(t, e) {
2770
2840
  r[i] = t[i];
2771
2841
  return r;
2772
2842
  }
2773
- var o = wi(t);
2843
+ var o = bi(t);
2774
2844
  return e ? o.map(function(a) {
2775
2845
  return re(a) ? et(a, !0) : a;
2776
2846
  }).flat() : o;
2777
2847
  }
2778
- function fo(t, e) {
2848
+ function po(t, e) {
2779
2849
  var n;
2780
2850
  return function() {
2781
2851
  return t && (n = t.apply(e || this, arguments), t = null), n;
2782
2852
  };
2783
2853
  }
2784
- var gt = ho("Event");
2854
+ var gt = fo("Event");
2785
2855
  function cr(t, e) {
2786
2856
  return Y && G(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), G(n) ? function() {
2787
2857
  n.apply(i, arguments), r.apply(i, arguments);
@@ -2791,10 +2861,10 @@ function cr(t, e) {
2791
2861
  cr.bind(null, "onerror");
2792
2862
  cr.bind(null, "onload");
2793
2863
  var ur = typeof window > "u", bn = "hidden";
2794
- function po(t) {
2864
+ function mo(t) {
2795
2865
  if (ur)
2796
2866
  return !1;
2797
- var e = mo(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2867
+ var e = go(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
2798
2868
  return t(!!document[e]);
2799
2869
  }, i = function() {
2800
2870
  return document.addEventListener(n, r);
@@ -2803,15 +2873,15 @@ function po(t) {
2803
2873
  return document.removeEventListener(n, r), i;
2804
2874
  };
2805
2875
  }
2806
- function mo() {
2876
+ function go() {
2807
2877
  var t = ["webkit", "moz", "ms", "o"];
2808
2878
  return ur || bn in document ? bn : t.reduce(function(e, n) {
2809
2879
  var r = n + "Hidden";
2810
2880
  return !e && r in document ? r : e;
2811
2881
  }, null);
2812
2882
  }
2813
- var go = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2814
- function yo(t, e) {
2883
+ var yo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
2884
+ function vo(t, e) {
2815
2885
  e === void 0 && (e = {});
2816
2886
  var n = /* @__PURE__ */ function(a, s) {
2817
2887
  var p = this, f = !1;
@@ -2822,10 +2892,10 @@ function yo(t, e) {
2822
2892
  };
2823
2893
  }(t, e.throttle || 1e4), r = [];
2824
2894
  function i() {
2825
- var a = po(function(s) {
2895
+ var a = mo(function(s) {
2826
2896
  s || n({ type: "tabVisible" });
2827
2897
  });
2828
- return r = [a].concat(go.map(function(s) {
2898
+ return r = [a].concat(yo.map(function(s) {
2829
2899
  return gt(document, s, n);
2830
2900
  })).concat(gt(window, "load", n)).concat(gt(window, "scroll", n, { capture: !0, passive: !0 })), o;
2831
2901
  }
@@ -2838,31 +2908,31 @@ function yo(t, e) {
2838
2908
  return o(), i;
2839
2909
  };
2840
2910
  }
2841
- function vo(t) {
2911
+ function wo(t) {
2842
2912
  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() {
2843
2913
  return clearTimeout(e);
2844
2914
  };
2845
- function b(g) {
2846
- d(), o && !u && o(Ae(h), g), i && u && (u = !1, i(Ae(n), g), h = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2847
- u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ae(h), g));
2915
+ function w(y) {
2916
+ d(), o && !u && o(ze(h), y), i && u && (u = !1, i(ze(n), y), h = /* @__PURE__ */ new Date()), e = setTimeout(function() {
2917
+ u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(h), y));
2848
2918
  }, s);
2849
2919
  }
2850
- var v = yo(b, { throttle: f });
2920
+ var I = vo(w, { throttle: f });
2851
2921
  return { disable: function() {
2852
2922
  c = !0, u = !1, d();
2853
- var g = v();
2923
+ var y = I();
2854
2924
  return function() {
2855
- return c = !1, h = /* @__PURE__ */ new Date(), b({ type: "load" }), g();
2925
+ return c = !1, h = /* @__PURE__ */ new Date(), w({ type: "load" }), y();
2856
2926
  };
2857
2927
  }, getStatus: function() {
2858
- return { isIdle: u, isDisabled: c, active: u ? 0 : Ae(h, c), idle: u ? Ae(n, c) : 0 };
2928
+ return { isIdle: u, isDisabled: c, active: u ? 0 : ze(h, c), idle: u ? ze(n, c) : 0 };
2859
2929
  } };
2860
2930
  }
2861
- function Ae(t, e) {
2931
+ function ze(t, e) {
2862
2932
  return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
2863
2933
  }
2864
2934
  const kn = 5e3;
2865
- class wo {
2935
+ class bo {
2866
2936
  constructor(e) {
2867
2937
  B(this, "element");
2868
2938
  B(this, "isInViewport", !1);
@@ -2883,7 +2953,7 @@ class wo {
2883
2953
  {
2884
2954
  threshold: 0
2885
2955
  }
2886
- ), this.observer.observe(this.element), vo({
2956
+ ), this.observer.observe(this.element), wo({
2887
2957
  onIdle: (n) => this.handleAwake(!1, n),
2888
2958
  onWakeUp: (n) => this.handleAwake(!0, n),
2889
2959
  timeout: kn
@@ -2893,51 +2963,60 @@ class wo {
2893
2963
  * Flush the awake timer in case the page is unloading
2894
2964
  */
2895
2965
  flush() {
2896
- this.isFlushing = !0, this.handleAwake(!this.isAwake, Math.round((Date.now() - this.lastEventAt) / 1e3));
2966
+ this.isFlushing = !0, this.handleAwake(!this.isAwake);
2897
2967
  }
2898
2968
  handleInViewPort(e) {
2899
- e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1, Math.round((Date.now() - this.lastEventAt) / 1e3)), this.isInViewport = e;
2969
+ e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
2900
2970
  }
2901
- handleAwake(e, n) {
2971
+ handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
2902
2972
  this.isAwake = e, this.lastEventAt = e ? Date.now() - n * kn : Date.now(), this.isInViewport && this.trackAwake(e, n);
2903
2973
  }
2974
+ handleVisibilityChange() {
2975
+ this.isAwake = !1;
2976
+ const e = Math.round((Date.now() - this.lastEventAt) / 1e3);
2977
+ e > 1 && (this.lastEventAt = Date.now(), this.trackAwake(!1, e));
2978
+ }
2904
2979
  trackAwake(e, n) {
2905
- !e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
2980
+ !e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing, this.lastEventAt), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing, this.lastEventAt);
2906
2981
  }
2907
2982
  trackInViewport() {
2908
2983
  this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
2909
2984
  }
2910
2985
  }
2911
2986
  const In = "sesamy_session_id";
2912
- function bo() {
2987
+ function ko() {
2913
2988
  let t = sessionStorage.getItem(In);
2914
2989
  return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(In, t)), t;
2915
2990
  }
2916
2991
  let lr = !1, St, _n, tt;
2917
- function ko({ clientId: t, enabled: e = !0, endpoint: n = Wr }) {
2992
+ function Io({ clientId: t, enabled: e = !0, endpoint: n = Wr }) {
2918
2993
  if (St = t, _n = e, tt = n, !_n)
2919
2994
  return;
2920
- lo();
2921
- const r = new wo({
2995
+ ho();
2996
+ const r = new bo({
2922
2997
  element: document.body,
2923
2998
  viewCallback: () => {
2924
2999
  se.page();
2925
3000
  },
2926
- activeDurationCallback: (i, o) => {
3001
+ activeDurationCallback: (i, o, a) => {
2927
3002
  se.track("activeDuration", {
2928
3003
  duration: i,
3004
+ durationStart: a,
2929
3005
  flushing: o
2930
3006
  });
2931
3007
  },
2932
- idleDurationCallback: (i, o) => {
3008
+ idleDurationCallback: (i, o, a) => {
2933
3009
  se.track("idleDuration", {
2934
3010
  duration: i,
3011
+ durationStart: a,
2935
3012
  flushing: o
2936
3013
  });
2937
3014
  }
2938
3015
  });
2939
- _o(document.body, () => {
3016
+ So(document.body, () => {
2940
3017
  r.flush();
3018
+ }), Eo(document.body, () => {
3019
+ r.handleVisibilityChange();
2941
3020
  }), window.addEventListener(Se.AUTHENTICATED, async (i) => {
2942
3021
  const o = i;
2943
3022
  await se.identify(o.detail.sub);
@@ -2951,7 +3030,7 @@ function dr(t) {
2951
3030
  ...e,
2952
3031
  clientId: St,
2953
3032
  requestId: Math.random().toString(36).slice(2, 9),
2954
- sessionId: bo(),
3033
+ sessionId: ko(),
2955
3034
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2956
3035
  version: Tt,
2957
3036
  event: e.event,
@@ -2971,7 +3050,7 @@ function dr(t) {
2971
3050
  }))
2972
3051
  );
2973
3052
  }
2974
- const Nt = ao(
3053
+ const Nt = so(
2975
3054
  async (t) => {
2976
3055
  if (t.length > 0) {
2977
3056
  const e = dr(t);
@@ -3000,7 +3079,7 @@ function yt(t) {
3000
3079
  } else
3001
3080
  Nt.push(t);
3002
3081
  }
3003
- const se = oo({
3082
+ const se = ao({
3004
3083
  app: Zn,
3005
3084
  version: Tt,
3006
3085
  plugins: [
@@ -3038,20 +3117,29 @@ const se = oo({
3038
3117
  }
3039
3118
  ]
3040
3119
  });
3041
- function Io() {
3120
+ function _o() {
3042
3121
  return lr = !0, Nt.flush();
3043
3122
  }
3044
3123
  const hr = /* @__PURE__ */ new Map();
3045
- function _o(t, e) {
3124
+ function So(t, e) {
3046
3125
  hr.set(t, e);
3047
3126
  }
3048
3127
  window.addEventListener("beforeunload", () => {
3049
3128
  hr.forEach((t, e) => {
3050
3129
  t.bind(e)();
3051
- }), Io();
3130
+ }), _o();
3131
+ });
3132
+ const fr = /* @__PURE__ */ new Map();
3133
+ function Eo(t, e) {
3134
+ fr.set(t, e);
3135
+ }
3136
+ window.addEventListener("visibilitychange", () => {
3137
+ document.visibilityState !== "visible" && fr.forEach((t, e) => {
3138
+ t.bind(e)();
3139
+ });
3052
3140
  });
3053
- async function So(t) {
3054
- ko({
3141
+ async function Oo(t) {
3142
+ Io({
3055
3143
  clientId: t.clientId,
3056
3144
  // The default client id can be overridden by the config
3057
3145
  ...t.analytics
@@ -3060,7 +3148,7 @@ async function So(t) {
3060
3148
  // The default client id can be overridden by the config
3061
3149
  ...t.auth
3062
3150
  });
3063
- const e = si(t.api || {});
3151
+ const e = ci(t.api || {});
3064
3152
  return Et(Se.READY, {}), e;
3065
3153
  }
3066
3154
  if (typeof document < "u") {
@@ -3068,11 +3156,11 @@ if (typeof document < "u") {
3068
3156
  if (t != null && t.textContent)
3069
3157
  try {
3070
3158
  const e = JSON.parse(t.textContent);
3071
- So(e);
3159
+ Oo(e);
3072
3160
  } catch (e) {
3073
3161
  console.error("Failed to parse config", e);
3074
3162
  }
3075
3163
  }
3076
3164
  export {
3077
- So as init
3165
+ Oo as init
3078
3166
  };