wineater-bot 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -214,22 +214,22 @@ var $n = { exports: {} };
214
214
  var m = "shortString", g = !0;
215
215
  typeof h == "number" && (m = "javaDouble", g = !1), y[m] = y[m] || {}, y[m][f] = g ? h + "" : h;
216
216
  }
217
- function b(y) {
217
+ function v(y) {
218
218
  return !!y && typeof y == "object" && y.value !== void 0;
219
219
  }
220
220
  function w(y) {
221
221
  return Object.fromEntries(Object.entries(y).map(function(f) {
222
222
  var h = f[0], m = f[1];
223
- return [h, b(m) ? m : { value: m }];
223
+ return [h, v(m) ? m : { value: m }];
224
224
  }));
225
225
  }
226
- function v(y) {
226
+ function b(y) {
227
227
  return i(i({}, y), { identity: y.identity ? i(i({}, y.identity), { traits: w(y.identity.traits || {}) }) : void 0 });
228
228
  }
229
229
  (function(y) {
230
230
  y.NONE = "NONE", y.DEFAULT_FLAGS = "DEFAULT_FLAGS", y.CACHE = "CACHE", y.SERVER = "SERVER";
231
231
  })(a || (a = {}));
232
- var T, N = null, M = "BULLET_TRAIN_DB", D = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", _ = "flagsmith_value_", R = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
232
+ var T, _ = null, M = "BULLET_TRAIN_DB", R = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", D = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
233
233
  function y(f) {
234
234
  var h = this;
235
235
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
@@ -264,7 +264,7 @@ var $n = { exports: {} };
264
264
  try {
265
265
  var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
266
266
  Object.keys(h.flags).map(function(J) {
267
- p(se, _ + J, h.getValue(J, { skipAnalytics: !0 })), p(se, R + J, h.hasFeature(J, { skipAnalytics: !0 }));
267
+ p(se, N + J, h.getValue(J, { skipAnalytics: !0 })), p(se, D + J, h.hasFeature(J, { skipAnalytics: !0 }));
268
268
  }), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(J) {
269
269
  p(se, L + J, h.getTrait(J));
270
270
  }), h.log("Sending javaLongOrObject traits to dynatrace", se.javaLongOrObject), h.log("Sending date traits to dynatrace", se.date), h.log("Sending shortString traits to dynatrace", se.shortString), h.log("Sending javaDouble to dynatrace", se.javaDouble), h.dtrum.sendSessionProperties(se.javaLongOrObject, se.date, se.shortString, se.javaDouble);
@@ -318,7 +318,7 @@ var $n = { exports: {} };
318
318
  return [S, x == null ? void 0 : x.value];
319
319
  }));
320
320
  }, this.setContext = function(m) {
321
- var g = v(m);
321
+ var g = b(m);
322
322
  return h.evaluationContext = i(i({}, g), { environment: g.environment || h.evaluationContext.environment }), h.initialised ? h.getFlags() : Promise.resolve();
323
323
  }, this.getContext = function() {
324
324
  return h.evaluationContext;
@@ -333,7 +333,7 @@ var $n = { exports: {} };
333
333
  if (h.api)
334
334
  return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
335
335
  var x = S[0], A = S[1];
336
- return [x, b(A) ? A : { value: A }];
336
+ return [x, v(A) ? A : { value: A }];
337
337
  }))) }) }));
338
338
  console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
339
339
  }, this.hasFeature = function(m, g) {
@@ -370,7 +370,7 @@ var $n = { exports: {} };
370
370
  h.log("Received response with identity mismatch, ignoring response. Requested: ".concat(O, ", Current: ").concat(te));
371
371
  });
372
372
  }, this.evaluateFlag = function(m, g) {
373
- if (h.datadogRum && (h.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? h.datadogRum.client.addFeatureFlagEvaluation(_ + m, h.getValue(m, {}, !0)) : h.datadogRum.client.addFeatureFlagEvaluation(R + m, h.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), h.enableAnalytics) {
373
+ if (h.datadogRum && (h.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? h.datadogRum.client.addFeatureFlagEvaluation(N + m, h.getValue(m, {}, !0)) : h.datadogRum.client.addFeatureFlagEvaluation(D + m, h.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), h.enableAnalytics) {
374
374
  if (!h.evaluationEvent || !h.evaluationContext.environment)
375
375
  return;
376
376
  h.evaluationEvent[h.evaluationContext.environment.apiKey] || (h.evaluationEvent[h.evaluationContext.environment.apiKey] = {}), h.evaluationEvent[h.evaluationContext.environment.apiKey][m] === void 0 && (h.evaluationEvent[h.evaluationContext.environment.apiKey][m] = 0), h.evaluationEvent[h.evaluationContext.environment.apiKey][m] += 1;
@@ -379,7 +379,7 @@ var $n = { exports: {} };
379
379
  }, this._onChange = function(m, g, S) {
380
380
  var x, A;
381
381
  h.setLoadingState(S), (x = h.onChange) === null || x === void 0 || x.call(h, m, g, h.loadingState), (A = h._trigger) === null || A === void 0 || A.call(h);
382
- }, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (N = f.AsyncStorage);
382
+ }, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (_ = f.AsyncStorage);
383
383
  }
384
384
  return y.prototype.init = function(f) {
385
385
  var h, m, g;
@@ -388,7 +388,7 @@ var $n = { exports: {} };
388
388
  return o(this, function(fe) {
389
389
  switch (fe.label) {
390
390
  case 0:
391
- S = v(f.evaluationContext || this.evaluationContext), fe.label = 1;
391
+ S = b(f.evaluationContext || this.evaluationContext), fe.label = 1;
392
392
  case 1:
393
393
  if (fe.trys.push([1, 13, , 14]), x = f.environmentID, A = f.api, B = A === void 0 ? k : A, q = f.headers, O = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Le = f.eventSourceUrl, se = Le === void 0 ? "https://realtime.flagsmith.com/" : Le, J = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
394
394
  throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
@@ -396,7 +396,7 @@ var $n = { exports: {} };
396
396
  return [le[0], { value: le[1] }];
397
397
  })) : {} } : S.identity, this.evaluationContext = S, this.api = B, this.headers = q, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = O, Nt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Bn || this._trigger, this._triggerLoadingState = jn || this._triggerLoadingState, this.onError = function(le) {
398
398
  ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: le })), oe == null || oe(le);
399
- }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = N !== void 0 && !!W, J && (N = J), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), _t && (d = /* @__PURE__ */ function(le) {
399
+ }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = _ !== void 0 && !!W, J && (_ = J), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), _t && (d = /* @__PURE__ */ function(le) {
400
400
  return function(me, be) {
401
401
  var Te = be.headers, Y = be.method, Fe = be.body;
402
402
  return new Promise(function(Oe) {
@@ -417,14 +417,14 @@ var $n = { exports: {} };
417
417
  }
418
418
  });
419
419
  };
420
- }(_t)), N && this.canUseStorage && N.getItem(D).then(function(le) {
420
+ }(_t)), _ && this.canUseStorage && _.getItem(R).then(function(le) {
421
421
  try {
422
422
  ie.evaluationEvent = JSON.parse(le) || {};
423
423
  } catch {
424
424
  ie.evaluationEvent = {};
425
425
  }
426
426
  ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
427
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), N && this.canUseStorage && N.getItem(D, function(le, me) {
427
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), _ && this.canUseStorage && _.getItem(R, function(le, me) {
428
428
  if (me && ie.evaluationContext.environment) {
429
429
  var be = JSON.parse(me);
430
430
  if (be[ie.evaluationContext.environment.apiKey]) {
@@ -434,7 +434,7 @@ var $n = { exports: {} };
434
434
  }
435
435
  })), !W)
436
436
  return [3, 9];
437
- if (!N || !this.canUseStorage)
437
+ if (!_ || !this.canUseStorage)
438
438
  return [3, 8];
439
439
  zn = function(le, me) {
440
440
  return r(ie, void 0, void 0, function() {
@@ -446,7 +446,7 @@ var $n = { exports: {} };
446
446
  return [3, 7];
447
447
  be = null, Te = null, Ee.label = 1;
448
448
  case 1:
449
- return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((At = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || At === void 0 ? void 0 : At.apiKey) === ((Lt = this.evaluationContext.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = Y.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = Y.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), xe = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), be = u(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: v(i(i({}, Y.evaluationContext), { identity: !((Ht = Y.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = Y.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: be, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
449
+ return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((At = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || At === void 0 ? void 0 : At.apiKey) === ((Lt = this.evaluationContext.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = Y.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = Y.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), xe = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), be = u(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: b(i(i({}, Y.evaluationContext), { identity: !((Ht = Y.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = Y.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: be, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
450
450
  case 2:
451
451
  return ae ? [3, 4] : [4, this.getFlags()];
452
452
  case 3:
@@ -477,9 +477,9 @@ var $n = { exports: {} };
477
477
  });
478
478
  }, fe.label = 2;
479
479
  case 2:
480
- return fe.trys.push([2, 7, , 8]), N.getItemSync ? (Ot = N.getItemSync(M), [3, 5]) : [3, 3];
480
+ return fe.trys.push([2, 7, , 8]), _.getItemSync ? (Ot = _.getItemSync(M), [3, 5]) : [3, 3];
481
481
  case 3:
482
- return [4, N.getItem(M)];
482
+ return [4, _.getItem(M)];
483
483
  case 4:
484
484
  Ot = fe.sent(), fe.label = 5;
485
485
  case 5:
@@ -515,7 +515,7 @@ var $n = { exports: {} };
515
515
  }, y.prototype.identify = function(f, h, m) {
516
516
  return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), h && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(h).map(function(g) {
517
517
  var S = g[0], x = g[1];
518
- return [S, b(x) ? x : { value: x }];
518
+ return [S, v(x) ? x : { value: x }];
519
519
  }))), this.initialised ? this.getFlags() : Promise.resolve();
520
520
  }, y.prototype.getState = function() {
521
521
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
@@ -535,12 +535,12 @@ var $n = { exports: {} };
535
535
  if (this.cacheFlags) {
536
536
  this.ts = (/* @__PURE__ */ new Date()).valueOf();
537
537
  var f = JSON.stringify(this.getState());
538
- this.log("Setting storage", f), N.setItem(M, f);
538
+ this.log("Setting storage", f), _.setItem(M, f);
539
539
  }
540
540
  }, y.prototype.updateEventStorage = function() {
541
541
  if (this.enableAnalytics) {
542
542
  var f = JSON.stringify(this.getState().evaluationEvent);
543
- N.setItem(D, f);
543
+ _.setItem(R, f);
544
544
  }
545
545
  }, y.prototype.setLoadingState = function(f) {
546
546
  var h;
@@ -898,37 +898,37 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
898
898
  var o = new de(n[0].s + 1);
899
899
  return o[n[0].s] = 1, { t: o, l: 1 };
900
900
  }
901
- n.sort(function(_, R) {
902
- return _.f - R.f;
901
+ n.sort(function(N, D) {
902
+ return N.f - D.f;
903
903
  }), n.push({ s: -1, f: 25001 });
904
904
  var l = n[0], c = n[1], u = 0, a = 1, d = 2;
905
905
  for (n[0] = { s: -1, f: l.f + c.f, l, r: c }; a != i - 1; )
906
906
  l = n[n[u].f < n[d].f ? u++ : d++], c = n[u != a && n[u].f < n[d].f ? u++ : d++], n[a++] = { s: -1, f: l.f + c.f, l, r: c };
907
907
  for (var p = r[0].s, s = 1; s < i; ++s)
908
908
  r[s].s > p && (p = r[s].s);
909
- var b = new re(p + 1), w = pt(n[a - 1], b, 0);
909
+ var v = new re(p + 1), w = pt(n[a - 1], v, 0);
910
910
  if (w > e) {
911
- var s = 0, v = 0, T = w - e, N = 1 << T;
912
- for (r.sort(function(R, L) {
913
- return b[L.s] - b[R.s] || R.f - L.f;
911
+ var s = 0, b = 0, T = w - e, _ = 1 << T;
912
+ for (r.sort(function(D, L) {
913
+ return v[L.s] - v[D.s] || D.f - L.f;
914
914
  }); s < i; ++s) {
915
915
  var M = r[s].s;
916
- if (b[M] > e)
917
- v += N - (1 << w - b[M]), b[M] = e;
916
+ if (v[M] > e)
917
+ b += _ - (1 << w - v[M]), v[M] = e;
918
918
  else
919
919
  break;
920
920
  }
921
- for (v >>= T; v > 0; ) {
922
- var D = r[s].s;
923
- b[D] < e ? v -= 1 << e - b[D]++ - 1 : ++s;
921
+ for (b >>= T; b > 0; ) {
922
+ var R = r[s].s;
923
+ v[R] < e ? b -= 1 << e - v[R]++ - 1 : ++s;
924
924
  }
925
- for (; s >= 0 && v; --s) {
925
+ for (; s >= 0 && b; --s) {
926
926
  var k = r[s].s;
927
- b[k] == e && (--b[k], ++v);
927
+ v[k] == e && (--v[k], ++b);
928
928
  }
929
929
  w = e;
930
930
  }
931
- return { t: new de(b), l: w };
931
+ return { t: new de(v), l: w };
932
932
  }, pt = function(t, e, n) {
933
933
  return t.s == -1 ? Math.max(pt(t.l, e, n + 1), pt(t.r, e, n + 1)) : e[t.s] = n;
934
934
  }, ln = function(t) {
@@ -966,24 +966,24 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
966
966
  return (i + 4 + s) * 8;
967
967
  }, un = function(t, e, n, s, i, r, o, l, c, u, a) {
968
968
  ve(e, a++, n), ++i[256];
969
- for (var d = ct(i, 15), p = d.t, b = d.l, w = ct(r, 15), v = w.t, T = w.l, N = ln(p), M = N.c, D = N.n, k = ln(v), _ = k.c, R = k.n, L = new re(19), I = 0; I < M.length; ++I)
969
+ for (var d = ct(i, 15), p = d.t, v = d.l, w = ct(r, 15), b = w.t, T = w.l, _ = ln(p), M = _.c, R = _.n, k = ln(b), N = k.c, D = k.n, L = new re(19), I = 0; I < M.length; ++I)
970
970
  ++L[M[I] & 31];
971
- for (var I = 0; I < _.length; ++I)
972
- ++L[_[I] & 31];
971
+ for (var I = 0; I < N.length; ++I)
972
+ ++L[N[I] & 31];
973
973
  for (var E = ct(L, 7), P = E.t, U = E.l, j = 19; j > 4 && !P[an[j - 1]]; --j)
974
974
  ;
975
- var z = u + 5 << 3, C = Ue(i, Ne) + Ue(r, tt) + o, F = Ue(i, p) + Ue(r, v) + o + 14 + 3 * j + Ue(L, P) + 2 * L[16] + 3 * L[17] + 7 * L[18];
975
+ var z = u + 5 << 3, C = Ue(i, Ne) + Ue(r, tt) + o, F = Ue(i, p) + Ue(r, b) + o + 14 + 3 * j + Ue(L, P) + 2 * L[16] + 3 * L[17] + 7 * L[18];
976
976
  if (c >= 0 && z <= C && z <= F)
977
977
  return En(e, a, t.subarray(c, c + u));
978
978
  var V, K, $, y;
979
979
  if (ve(e, a, 1 + (F < C)), a += 2, F < C) {
980
- V = qe(p, b, 0), K = p, $ = qe(v, T, 0), y = v;
980
+ V = qe(p, v, 0), K = p, $ = qe(b, T, 0), y = b;
981
981
  var f = qe(P, U, 0);
982
- ve(e, a, D - 257), ve(e, a + 5, R - 1), ve(e, a + 10, j - 4), a += 14;
982
+ ve(e, a, R - 257), ve(e, a + 5, D - 1), ve(e, a + 10, j - 4), a += 14;
983
983
  for (var I = 0; I < j; ++I)
984
984
  ve(e, a + 3 * I, P[an[I]]);
985
985
  a += 3 * j;
986
- for (var h = [M, _], m = 0; m < 2; ++m)
986
+ for (var h = [M, N], m = 0; m < 2; ++m)
987
987
  for (var g = h[m], I = 0; I < g.length; ++I) {
988
988
  var S = g[I] & 31;
989
989
  ve(e, a, f[S]), a += P[S], S > 15 && (ve(e, a, g[I] >> 5 & 127), a += g[I] >> 12);
@@ -1005,21 +1005,21 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
1005
1005
  var o = r.z || t.length, l = new de(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), c = l.subarray(s, l.length - i), u = r.l, a = (r.r || 0) & 7;
1006
1006
  if (e) {
1007
1007
  a && (c[0] = r.r >> 3);
1008
- for (var d = Bs[e - 1], p = d >> 13, b = d & 8191, w = (1 << n) - 1, v = r.p || new re(32768), T = r.h || new re(w + 1), N = Math.ceil(n / 3), M = 2 * N, D = function(ne) {
1009
- return (t[ne] ^ t[ne + 1] << N ^ t[ne + 2] << M) & w;
1010
- }, k = new xt(25e3), _ = new re(288), R = new re(32), L = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
1011
- var z = D(E), C = E & 32767, F = T[z];
1012
- if (v[C] = F, T[z] = C, U <= E) {
1008
+ for (var d = Bs[e - 1], p = d >> 13, v = d & 8191, w = (1 << n) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1), _ = Math.ceil(n / 3), M = 2 * _, R = function(ne) {
1009
+ return (t[ne] ^ t[ne + 1] << _ ^ t[ne + 2] << M) & w;
1010
+ }, k = new xt(25e3), N = new re(288), D = new re(32), L = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
1011
+ var z = R(E), C = E & 32767, F = T[z];
1012
+ if (b[C] = F, T[z] = C, U <= E) {
1013
1013
  var V = o - E;
1014
1014
  if ((L > 7e3 || P > 24576) && (V > 423 || !u)) {
1015
- a = un(t, c, 0, k, _, R, I, P, j, E - j, a), P = L = I = 0, j = E;
1015
+ a = un(t, c, 0, k, N, D, I, P, j, E - j, a), P = L = I = 0, j = E;
1016
1016
  for (var K = 0; K < 286; ++K)
1017
- _[K] = 0;
1017
+ N[K] = 0;
1018
1018
  for (var K = 0; K < 30; ++K)
1019
- R[K] = 0;
1019
+ D[K] = 0;
1020
1020
  }
1021
- var $ = 2, y = 0, f = b, h = C - F & 32767;
1022
- if (V > 2 && z == D(E - h))
1021
+ var $ = 2, y = 0, f = v, h = C - F & 32767;
1022
+ if (V > 2 && z == R(E - h))
1023
1023
  for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f && C != F; ) {
1024
1024
  if (t[E + $] == t[E + $ - h]) {
1025
1025
  for (var x = 0; x < S && t[E + x] == t[E + x - h]; ++x)
@@ -1028,24 +1028,24 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
1028
1028
  if ($ = x, y = h, x > m)
1029
1029
  break;
1030
1030
  for (var A = Math.min(h, x - 2), B = 0, K = 0; K < A; ++K) {
1031
- var q = E - h + K & 32767, O = v[q], W = q - O & 32767;
1031
+ var q = E - h + K & 32767, O = b[q], W = q - O & 32767;
1032
1032
  W > B && (B = W, F = q);
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
- C = F, F = v[C], h += C - F & 32767;
1036
+ C = F, F = b[C], h += C - F & 32767;
1037
1037
  }
1038
1038
  if (y) {
1039
1039
  k[P++] = 268435456 | dt[$] << 18 | cn[y];
1040
1040
  var ee = dt[$] & 31, oe = cn[y] & 31;
1041
- I += kt[ee] + Tt[oe], ++_[257 + ee], ++R[oe], U = E + $, ++L;
1041
+ I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++L;
1042
1042
  } else
1043
- k[P++] = t[E], ++_[t[E]];
1043
+ k[P++] = t[E], ++N[t[E]];
1044
1044
  }
1045
1045
  }
1046
1046
  for (E = Math.max(E, U); E < o; ++E)
1047
- k[P++] = t[E], ++_[t[E]];
1048
- a = un(t, c, u, k, _, R, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = T, r.p = v, r.i = E, r.w = U);
1047
+ k[P++] = t[E], ++N[t[E]];
1048
+ a = un(t, c, u, k, N, D, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = T, r.p = b, r.i = E, r.w = U);
1049
1049
  } else {
1050
1050
  for (var E = r.w || 0; E < o + u; E += 65535) {
1051
1051
  var te = E + 65535;
@@ -2501,10 +2501,10 @@ class Wr {
2501
2501
  tasks: []
2502
2502
  }, this.getDurations = () => this.durations, this.setDurations = (d) => {
2503
2503
  this.durations.testStart = d.testStart, this.durations.tasks = d.tasks;
2504
- }, this.signalTask = (d, p, b) => {
2504
+ }, this.signalTask = (d, p, v) => {
2505
2505
  if (!d)
2506
2506
  return console.error("User Testing: No Task ID Given");
2507
- const w = this.durations.tasks.find((N) => N.taskId === d), v = this.getTimestamp(), T = w ? v - w.started : 0;
2507
+ const w = this.durations.tasks.find((_) => _.taskId === d), b = this.getTimestamp(), T = w ? b - w.started : 0;
2508
2508
  return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`, {
2509
2509
  method: "POST",
2510
2510
  headers: {
@@ -2516,18 +2516,18 @@ class Wr {
2516
2516
  taskId: d,
2517
2517
  status: p,
2518
2518
  duration: T,
2519
- timestamp: v,
2520
- taskAnswer: b
2519
+ timestamp: b,
2520
+ taskAnswer: v
2521
2521
  })
2522
2522
  });
2523
2523
  }, this.signalTest = (d) => {
2524
2524
  const p = this.getTimestamp();
2525
2525
  if (d === "begin" && this.testId) {
2526
- const v = this.getSessionId();
2527
- this.setStorageKey(bn, v), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2526
+ const b = this.getSessionId();
2527
+ this.setStorageKey(bn, b), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2528
2528
  } else
2529
2529
  this.removeStorageKey(this.storageKey), this.removeStorageKey(mn), this.removeStorageKey(ut);
2530
- const b = this.durations.testStart || p, w = p - b;
2530
+ const v = this.durations.testStart || p, w = p - v;
2531
2531
  return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`, {
2532
2532
  method: "POST",
2533
2533
  headers: {
@@ -2647,11 +2647,11 @@ class Vr {
2647
2647
  }, c.onclick = () => {
2648
2648
  var a, d, p;
2649
2649
  if (u(), this.test) {
2650
- const b = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = b ? b.tasks.findIndex((v) => this.test && v.taskId === this.test.tasks[0].task_id) : null;
2651
- b && w === -1 && (b.tasks.push({
2650
+ const v = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = v ? v.tasks.findIndex((b) => this.test && b.taskId === this.test.tasks[0].task_id) : null;
2651
+ v && w === -1 && (v.tasks.push({
2652
2652
  taskId: this.test.tasks[0].task_id,
2653
2653
  started: this.app.timestamp()
2654
- }), (d = this.signalManager) == null || d.setDurations(b)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
2654
+ }), (d = this.signalManager) == null || d.setDurations(v)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
2655
2655
  }
2656
2656
  this.showTaskSection(), o.removeChild(c);
2657
2657
  }, n;
@@ -2664,18 +2664,18 @@ class Vr {
2664
2664
  lineHeight: "auto"
2665
2665
  }, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription", Lr), d = H("div", "taskButtons", Fr), p = H("div", "taskText", hs);
2666
2666
  p.textContent = "Your answer";
2667
- const b = H("textarea", "taskDescription", {
2667
+ const v = H("textarea", "taskDescription", {
2668
2668
  resize: "vertical"
2669
2669
  }), w = H("div", "inputArea", us);
2670
- w.append(p, b);
2671
- const v = H("div", "closePanelButton", Zs, "Collapse Panel"), T = H("div", "nextButton", Mr, "Done, Next");
2672
- s.append(i, r), c.append(u, a), d.append(v, T), o.append(l, c, w, d), n.append(s, o);
2673
- const N = () => {
2670
+ w.append(p, v);
2671
+ const b = H("div", "closePanelButton", Zs, "Collapse Panel"), T = H("div", "nextButton", Mr, "Done, Next");
2672
+ s.append(i, r), c.append(u, a), d.append(b, T), o.append(l, c, w, d), n.append(s, o);
2673
+ const _ = () => {
2674
2674
  const k = e[this.currentTaskIndex];
2675
2675
  u.textContent = k.title, a.textContent = k.description, k.allow_typing ? w.style.display = "flex" : w.style.display = "none";
2676
2676
  };
2677
- e.forEach((k, _) => {
2678
- const R = H("span", `or_task_${_}`, {
2677
+ e.forEach((k, N) => {
2678
+ const D = H("span", `or_task_${N}`, {
2679
2679
  outline: "1px solid #efefef",
2680
2680
  fontSize: "13px",
2681
2681
  height: "24px",
@@ -2685,8 +2685,8 @@ class Vr {
2685
2685
  alignItems: "center",
2686
2686
  justifyContent: "center",
2687
2687
  borderRadius: "6.25em"
2688
- }, (_ + 1).toString());
2689
- R.id = `or_task_${_}`, l.append(R);
2688
+ }, (N + 1).toString());
2689
+ D.id = `or_task_${N}`, l.append(D);
2690
2690
  });
2691
2691
  const M = () => {
2692
2692
  this.widgetTasksVisible = !this.widgetTasksVisible, r.textContent = this.widgetTasksVisible ? "-" : "+", Object.assign(o.style, this.widgetTasksVisible ? Be : { display: "none" });
@@ -2694,30 +2694,30 @@ class Vr {
2694
2694
  this.hideTaskSection = () => (r.textContent = "+", Object.assign(o.style, {
2695
2695
  display: "none"
2696
2696
  }), this.widgetTasksVisible = !1, !1), this.showTaskSection = () => (r.textContent = "-", Object.assign(o.style, Be), this.widgetTasksVisible = !0, !0);
2697
- const D = () => {
2697
+ const R = () => {
2698
2698
  const k = document.getElementById(`or_task_${this.currentTaskIndex}`);
2699
2699
  k && Object.assign(k.style, ls);
2700
- for (let _ = 0; _ < this.currentTaskIndex; _++) {
2701
- const R = document.getElementById(`or_task_${_}`);
2702
- R && Object.assign(R.style, Ar);
2700
+ for (let N = 0; N < this.currentTaskIndex; N++) {
2701
+ const D = document.getElementById(`or_task_${N}`);
2702
+ D && Object.assign(D.style, Ar);
2703
2703
  }
2704
2704
  };
2705
- return s.onclick = M, v.onclick = this.collapseWidget, T.onclick = () => {
2706
- var _, R, L, I;
2707
- const k = e[this.currentTaskIndex].allow_typing ? b.value : void 0;
2708
- if (b.value = "", (_ = this.signalManager) == null || _.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
2709
- this.currentTaskIndex++, N();
2710
- const E = (R = this.signalManager) == null ? void 0 : R.getDurations();
2705
+ return s.onclick = M, b.onclick = this.collapseWidget, T.onclick = () => {
2706
+ var N, D, L, I;
2707
+ const k = e[this.currentTaskIndex].allow_typing ? v.value : void 0;
2708
+ if (v.value = "", (N = this.signalManager) == null || N.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
2709
+ this.currentTaskIndex++, _();
2710
+ const E = (D = this.signalManager) == null ? void 0 : D.getDurations();
2711
2711
  E && E.tasks.findIndex((P) => P.taskId === e[this.currentTaskIndex].task_id) === -1 && (E.tasks.push({
2712
2712
  taskId: e[this.currentTaskIndex].task_id,
2713
2713
  started: this.app.timestamp()
2714
- }), (L = this.signalManager) == null || L.setDurations(E)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), D();
2714
+ }), (L = this.signalManager) == null || L.setDurations(E)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), R();
2715
2715
  } else
2716
2716
  this.showEndSection();
2717
2717
  this.app.localStorage.setItem("or_uxt_task_index", this.currentTaskIndex.toString());
2718
2718
  }, setTimeout(() => {
2719
2719
  const k = document.getElementById("or_task_0");
2720
- k && Object.assign(k.style, ls), N(), D();
2720
+ k && Object.assign(k.style, ls), _(), R();
2721
2721
  }, 1), n;
2722
2722
  }
2723
2723
  showEndSection() {
@@ -3521,62 +3521,62 @@ let lo = class {
3521
3521
  const u = (a) => {
3522
3522
  const { data: d } = a;
3523
3523
  if (d.line === ue.iframeSignal) {
3524
- const p = d.domain, b = Array.from(document.querySelectorAll("iframe"));
3525
- this.pageFrames = b, (async () => {
3526
- let v = 0;
3527
- for (; v < 10; ) {
3528
- const T = this.checkNodeId(b, p);
3524
+ const p = d.domain, v = Array.from(document.querySelectorAll("iframe"));
3525
+ this.pageFrames = v, (async () => {
3526
+ let b = 0;
3527
+ for (; b < 10; ) {
3528
+ const T = this.checkNodeId(v, p);
3529
3529
  if (T) {
3530
3530
  this.waitStarted().then(() => {
3531
- var D;
3531
+ var R;
3532
3532
  c++;
3533
- const N = this.session.getSessionToken(), M = {
3533
+ const _ = this.session.getSessionToken(), M = {
3534
3534
  line: ue.iframeId,
3535
3535
  context: this.contextId,
3536
3536
  domain: p,
3537
3537
  id: T,
3538
- token: N,
3538
+ token: _,
3539
3539
  frameOrderNumber: c
3540
3540
  };
3541
- this.debug.log("iframe_data", M), (D = a.source) == null || D.postMessage(M, "*");
3542
- }).catch(console.error), v = 10;
3541
+ this.debug.log("iframe_data", M), (R = a.source) == null || R.postMessage(M, "*");
3542
+ }).catch(console.error), b = 10;
3543
3543
  break;
3544
3544
  }
3545
- v++, await co(100);
3545
+ b++, await co(100);
3546
3546
  }
3547
3547
  })();
3548
3548
  }
3549
3549
  if (d.line === ue.iframeBatch) {
3550
- const b = d.messages.map((w) => {
3550
+ const v = d.messages.map((w) => {
3551
3551
  if (w[0] === 20) {
3552
- let v = w;
3552
+ let b = w;
3553
3553
  return this.pageFrames.forEach((T) => {
3554
3554
  if (T.dataset.domain === a.data.domain) {
3555
- const [N, M, D] = w, { left: k, top: _ } = T.getBoundingClientRect();
3556
- v = [N, M + k, D + _];
3555
+ const [_, M, R] = w, { left: k, top: N } = T.getBoundingClientRect();
3556
+ b = [_, M + k, R + N];
3557
3557
  }
3558
- }), v;
3558
+ }), b;
3559
3559
  }
3560
3560
  if (w[0] === 68) {
3561
- let v = w;
3561
+ let b = w;
3562
3562
  return this.pageFrames.forEach((T) => {
3563
3563
  if (T.dataset.domain === a.data.domain) {
3564
- const [N, M, D, k, _, R, L] = w, { left: I, top: E, width: P, height: U } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, C = R / 100 * P + I, F = L / 100 * U + E, V = C / j, K = F / z;
3565
- v = [
3566
- N,
3564
+ const [_, M, R, k, N, D, L] = w, { left: I, top: E, width: P, height: U } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, C = D / 100 * P + I, F = L / 100 * U + E, V = C / j, K = F / z;
3565
+ b = [
3566
+ _,
3567
3567
  M,
3568
- D,
3568
+ R,
3569
3569
  k,
3570
- _,
3570
+ N,
3571
3571
  Math.round(V * 1e3) / 10,
3572
3572
  Math.round(K * 1e3) / 10
3573
3573
  ];
3574
3574
  }
3575
- }), v;
3575
+ }), b;
3576
3576
  }
3577
3577
  return w;
3578
3578
  });
3579
- this.messages.push(...b);
3579
+ this.messages.push(...v);
3580
3580
  }
3581
3581
  };
3582
3582
  window.addEventListener("message", u), this.attachStopCallback(() => {
@@ -3837,7 +3837,7 @@ let lo = class {
3837
3837
  }, 30 * s), r();
3838
3838
  }
3839
3839
  async setupConditionalStart(e) {
3840
- var p, b;
3840
+ var p, v;
3841
3841
  this.conditionsManager = new Ai(this, e);
3842
3842
  const n = await fetch(this.options.ingestPoint + "/v1/web/start", {
3843
3843
  method: "POST",
@@ -3878,7 +3878,7 @@ let lo = class {
3878
3878
  userState: u
3879
3879
  });
3880
3880
  const d = { sessionToken: s, userUUID: "", sessionID: "" };
3881
- this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (b = this.conditionsManager) == null || b.processFlags(this.featureFlags.flags);
3881
+ this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (v = this.conditionsManager) == null || v.processFlags(this.featureFlags.flags);
3882
3882
  }
3883
3883
  /**
3884
3884
  * Starts offline session recording
@@ -3935,7 +3935,7 @@ let lo = class {
3935
3935
  * @reject {string} - error message
3936
3936
  * */
3937
3937
  async uploadOfflineRecording() {
3938
- var p, b;
3938
+ var p, v;
3939
3939
  this.stop(!1);
3940
3940
  const e = pe();
3941
3941
  (p = this.worker) == null || p.postMessage({
@@ -3965,7 +3965,7 @@ let lo = class {
3965
3965
  timezone: tn()
3966
3966
  })
3967
3967
  }), { token: s, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: c, userState: u, beaconSizeLimit: a, projectID: d } = await n.json();
3968
- for ((b = this.worker) == null || b.postMessage({
3968
+ for ((v = this.worker) == null || v.postMessage({
3969
3969
  type: "auth",
3970
3970
  token: s,
3971
3971
  beaconSizeLimit: a
@@ -4041,46 +4041,46 @@ let lo = class {
4041
4041
  userUUID: a,
4042
4042
  projectID: d,
4043
4043
  beaconSizeLimit: p,
4044
- compressionThreshold: b,
4044
+ compressionThreshold: v,
4045
4045
  // how big the batch should be before we decide to compress it
4046
4046
  delay: w,
4047
4047
  // derived from token
4048
- sessionID: v,
4048
+ sessionID: b,
4049
4049
  // derived from token
4050
4050
  startTimestamp: T,
4051
4051
  // real startTS (server time), derived from sessionID
4052
- userBrowser: N,
4052
+ userBrowser: _,
4053
4053
  userCity: M,
4054
- userCountry: D,
4054
+ userCountry: R,
4055
4055
  userDevice: k,
4056
- userOS: _,
4057
- userState: R,
4056
+ userOS: N,
4057
+ userState: D,
4058
4058
  canvasEnabled: L,
4059
4059
  canvasQuality: I,
4060
4060
  canvasFPS: E,
4061
4061
  assistOnly: P
4062
4062
  } = await c.json();
4063
- if (typeof u != "string" || typeof a != "string" || typeof T != "number" && typeof T < "u" || typeof v != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4063
+ if (typeof u != "string" || typeof a != "string" || typeof T != "number" && typeof T < "u" || typeof b != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4064
4064
  const C = `Incorrect server response: ${JSON.stringify(c)}`;
4065
4065
  return this.signalError(C, []), Ce(C);
4066
4066
  }
4067
4067
  this.delay = w, this.session.setSessionToken(u), this.session.setUserInfo({
4068
- userBrowser: N,
4068
+ userBrowser: _,
4069
4069
  userCity: M,
4070
- userCountry: D,
4070
+ userCountry: R,
4071
4071
  userDevice: k,
4072
- userOS: _,
4073
- userState: R
4072
+ userOS: N,
4073
+ userState: D
4074
4074
  }), this.session.assign({
4075
- sessionID: v,
4075
+ sessionID: b,
4076
4076
  timestamp: T || r,
4077
4077
  projectID: d
4078
4078
  }), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
4079
4079
  type: "auth",
4080
4080
  token: u,
4081
4081
  beaconSizeLimit: p
4082
- }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, F]) => this.send(Qn(C, F))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = b;
4083
- const U = { sessionToken: u, userUUID: a, sessionID: v };
4082
+ }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, F]) => this.send(Qn(C, F))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = v;
4083
+ const U = { sessionToken: u, userUUID: a, sessionID: b };
4084
4084
  if (this.startCallbacks.forEach((C) => C(U)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, u), this.activityState = Q.Active, L && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new Kr(this, {
4085
4085
  fps: E,
4086
4086
  quality: I,
@@ -4259,8 +4259,8 @@ function go(t, e) {
4259
4259
  t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
4260
4260
  const o = (c, u) => {
4261
4261
  const a = {
4262
- apply: function(d, p, b) {
4263
- Reflect.apply(d, u, b), i = i + 1, !(i > n.consoleThrottling) && s(d.name, b);
4262
+ apply: function(d, p, v) {
4263
+ Reflect.apply(d, u, v), i = i + 1, !(i > n.consoleThrottling) && s(d.name, v);
4264
4264
  }
4265
4265
  };
4266
4266
  n.consoleMethods.forEach((d) => {
@@ -4280,53 +4280,53 @@ function mo() {
4280
4280
  (function(n, s) {
4281
4281
  t.exports = s();
4282
4282
  })($e, function() {
4283
- function n(v) {
4284
- return !isNaN(parseFloat(v)) && isFinite(v);
4283
+ function n(b) {
4284
+ return !isNaN(parseFloat(b)) && isFinite(b);
4285
4285
  }
4286
- function s(v) {
4287
- return v.charAt(0).toUpperCase() + v.substring(1);
4286
+ function s(b) {
4287
+ return b.charAt(0).toUpperCase() + b.substring(1);
4288
4288
  }
4289
- function i(v) {
4289
+ function i(b) {
4290
4290
  return function() {
4291
- return this[v];
4291
+ return this[b];
4292
4292
  };
4293
4293
  }
4294
4294
  var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], c = ["args"], u = ["evalOrigin"], a = r.concat(o, l, c, u);
4295
- function d(v) {
4296
- if (v)
4295
+ function d(b) {
4296
+ if (b)
4297
4297
  for (var T = 0; T < a.length; T++)
4298
- v[a[T]] !== void 0 && this["set" + s(a[T])](v[a[T]]);
4298
+ b[a[T]] !== void 0 && this["set" + s(a[T])](b[a[T]]);
4299
4299
  }
4300
4300
  d.prototype = {
4301
4301
  getArgs: function() {
4302
4302
  return this.args;
4303
4303
  },
4304
- setArgs: function(v) {
4305
- if (Object.prototype.toString.call(v) !== "[object Array]")
4304
+ setArgs: function(b) {
4305
+ if (Object.prototype.toString.call(b) !== "[object Array]")
4306
4306
  throw new TypeError("Args must be an Array");
4307
- this.args = v;
4307
+ this.args = b;
4308
4308
  },
4309
4309
  getEvalOrigin: function() {
4310
4310
  return this.evalOrigin;
4311
4311
  },
4312
- setEvalOrigin: function(v) {
4313
- if (v instanceof d)
4314
- this.evalOrigin = v;
4315
- else if (v instanceof Object)
4316
- this.evalOrigin = new d(v);
4312
+ setEvalOrigin: function(b) {
4313
+ if (b instanceof d)
4314
+ this.evalOrigin = b;
4315
+ else if (b instanceof Object)
4316
+ this.evalOrigin = new d(b);
4317
4317
  else
4318
4318
  throw new TypeError("Eval Origin must be an Object or StackFrame");
4319
4319
  },
4320
4320
  toString: function() {
4321
- var v = this.getFileName() || "", T = this.getLineNumber() || "", N = this.getColumnNumber() || "", M = this.getFunctionName() || "";
4322
- return this.getIsEval() ? v ? "[eval] (" + v + ":" + T + ":" + N + ")" : "[eval]:" + T + ":" + N : M ? M + " (" + v + ":" + T + ":" + N + ")" : v + ":" + T + ":" + N;
4321
+ var b = this.getFileName() || "", T = this.getLineNumber() || "", _ = this.getColumnNumber() || "", M = this.getFunctionName() || "";
4322
+ return this.getIsEval() ? b ? "[eval] (" + b + ":" + T + ":" + _ + ")" : "[eval]:" + T + ":" + _ : M ? M + " (" + b + ":" + T + ":" + _ + ")" : b + ":" + T + ":" + _;
4323
4323
  }
4324
4324
  }, d.fromString = function(T) {
4325
- var N = T.indexOf("("), M = T.lastIndexOf(")"), D = T.substring(0, N), k = T.substring(N + 1, M).split(","), _ = T.substring(M + 1);
4326
- if (_.indexOf("@") === 0)
4327
- var R = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(_, ""), L = R[1], I = R[2], E = R[3];
4325
+ var _ = T.indexOf("("), M = T.lastIndexOf(")"), R = T.substring(0, _), k = T.substring(_ + 1, M).split(","), N = T.substring(M + 1);
4326
+ if (N.indexOf("@") === 0)
4327
+ var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""), L = D[1], I = D[2], E = D[3];
4328
4328
  return new d({
4329
- functionName: D,
4329
+ functionName: R,
4330
4330
  args: k || void 0,
4331
4331
  fileName: L,
4332
4332
  lineNumber: I || void 0,
@@ -4334,23 +4334,23 @@ function mo() {
4334
4334
  });
4335
4335
  };
4336
4336
  for (var p = 0; p < r.length; p++)
4337
- d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(v) {
4337
+ d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(b) {
4338
4338
  return function(T) {
4339
- this[v] = !!T;
4339
+ this[b] = !!T;
4340
4340
  };
4341
4341
  }(r[p]);
4342
- for (var b = 0; b < o.length; b++)
4343
- d.prototype["get" + s(o[b])] = i(o[b]), d.prototype["set" + s(o[b])] = /* @__PURE__ */ function(v) {
4342
+ for (var v = 0; v < o.length; v++)
4343
+ d.prototype["get" + s(o[v])] = i(o[v]), d.prototype["set" + s(o[v])] = /* @__PURE__ */ function(b) {
4344
4344
  return function(T) {
4345
4345
  if (!n(T))
4346
- throw new TypeError(v + " must be a Number");
4347
- this[v] = Number(T);
4346
+ throw new TypeError(b + " must be a Number");
4347
+ this[b] = Number(T);
4348
4348
  };
4349
- }(o[b]);
4349
+ }(o[v]);
4350
4350
  for (var w = 0; w < l.length; w++)
4351
- d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(v) {
4351
+ d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(b) {
4352
4352
  return function(T) {
4353
- this[v] = String(T);
4353
+ this[b] = String(T);
4354
4354
  };
4355
4355
  }(l[w]);
4356
4356
  return d;
@@ -4394,12 +4394,12 @@ function mo() {
4394
4394
  a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
4395
4395
  var d = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
4396
4396
  d = p ? d.replace(p[0], "") : d;
4397
- var b = this.extractLocation(p ? p[1] : d), w = p && d || void 0, v = ["eval", "<anonymous>"].indexOf(b[0]) > -1 ? void 0 : b[0];
4397
+ var v = this.extractLocation(p ? p[1] : d), w = p && d || void 0, b = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
4398
4398
  return new s({
4399
4399
  functionName: w,
4400
- fileName: v,
4401
- lineNumber: b[1],
4402
- columnNumber: b[2],
4400
+ fileName: b,
4401
+ lineNumber: v[1],
4402
+ columnNumber: v[2],
4403
4403
  source: a
4404
4404
  });
4405
4405
  }, this);
@@ -4414,9 +4414,9 @@ function mo() {
4414
4414
  return new s({
4415
4415
  functionName: a
4416
4416
  });
4417
- var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d), b = p && p[1] ? p[1] : void 0, w = this.extractLocation(a.replace(d, ""));
4417
+ var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d), v = p && p[1] ? p[1] : void 0, w = this.extractLocation(a.replace(d, ""));
4418
4418
  return new s({
4419
- functionName: b,
4419
+ functionName: v,
4420
4420
  fileName: w[0],
4421
4421
  lineNumber: w[1],
4422
4422
  columnNumber: w[2],
@@ -4432,7 +4432,7 @@ function mo() {
4432
4432
  },
4433
4433
  parseOpera9: function(c) {
4434
4434
  for (var u = /Line (\d+).*script (?:in )?(\S+)/i, a = c.message.split(`
4435
- `), d = [], p = 2, b = a.length; p < b; p += 2) {
4435
+ `), d = [], p = 2, v = a.length; p < v; p += 2) {
4436
4436
  var w = u.exec(a[p]);
4437
4437
  w && d.push(new s({
4438
4438
  fileName: w[2],
@@ -4444,7 +4444,7 @@ function mo() {
4444
4444
  },
4445
4445
  parseOpera10: function(c) {
4446
4446
  for (var u = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, a = c.stacktrace.split(`
4447
- `), d = [], p = 0, b = a.length; p < b; p += 2) {
4447
+ `), d = [], p = 0, v = a.length; p < v; p += 2) {
4448
4448
  var w = u.exec(a[p]);
4449
4449
  w && d.push(
4450
4450
  new s({
@@ -4464,9 +4464,9 @@ function mo() {
4464
4464
  return !!a.match(i) && !a.match(/^Error created at/);
4465
4465
  }, this);
4466
4466
  return u.map(function(a) {
4467
- var d = a.split("@"), p = this.extractLocation(d.pop()), b = d.shift() || "", w = b.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, v;
4468
- b.match(/\(([^)]*)\)/) && (v = b.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
- var T = v === void 0 || v === "[arguments not available]" ? void 0 : v.split(",");
4467
+ var d = a.split("@"), p = this.extractLocation(d.pop()), v = d.shift() || "", w = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, b;
4468
+ v.match(/\(([^)]*)\)/) && (b = v.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
+ var T = b === void 0 || b === "[arguments not available]" ? void 0 : b.split(",");
4470
4470
  return new s({
4471
4471
  functionName: w,
4472
4472
  args: T,
@@ -4640,10 +4640,10 @@ function Co(t, e) {
4640
4640
  obscureInputDates: !1
4641
4641
  }, e);
4642
4642
  function s(a, d) {
4643
- let p = d.value, b = n.defaultInputMode;
4644
- d.type === "password" || t.sanitizer.isHidden(a) ? b = je.Hidden : (t.sanitizer.isObscured(a) || b === je.Plain && (n.obscureInputNumbers && d.type !== "date" && /\d\d\d\d/.test(p) || n.obscureInputDates && d.type === "date" || n.obscureInputEmails && (d.type === "email" || ~p.indexOf("@")))) && (b = je.Obscured);
4643
+ let p = d.value, v = n.defaultInputMode;
4644
+ d.type === "password" || t.sanitizer.isHidden(a) ? v = je.Hidden : (t.sanitizer.isObscured(a) || v === je.Plain && (n.obscureInputNumbers && d.type !== "date" && /\d\d\d\d/.test(p) || n.obscureInputDates && d.type === "date" || n.obscureInputEmails && (d.type === "email" || ~p.indexOf("@")))) && (v = je.Obscured);
4645
4645
  let w = 0;
4646
- switch (b) {
4646
+ switch (v) {
4647
4647
  case je.Hidden:
4648
4648
  w = -1, p = "";
4649
4649
  break;
@@ -4654,8 +4654,8 @@ function Co(t, e) {
4654
4654
  return { value: p, mask: w };
4655
4655
  }
4656
4656
  function i(a, d) {
4657
- const { value: p, mask: b } = s(a, d);
4658
- t.send(Zi(a, p, b));
4657
+ const { value: p, mask: v } = s(a, d);
4658
+ t.send(Zi(a, p, v));
4659
4659
  }
4660
4660
  const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
4661
4661
  t.attachStopCallback(() => {
@@ -4680,24 +4680,24 @@ function Co(t, e) {
4680
4680
  c(d, p.checked);
4681
4681
  });
4682
4682
  }, 3);
4683
- function u(a, d, p, b) {
4684
- const { value: w, mask: v } = s(a, d), T = ri(d);
4685
- t.send(br(a, w, v !== 0, T, p, b));
4683
+ function u(a, d, p, v) {
4684
+ const { value: w, mask: b } = s(a, d), T = ri(d);
4685
+ t.send(br(a, w, b !== 0, T, p, v));
4686
4686
  }
4687
4687
  t.nodes.attachNodeCallback(t.safe((a) => {
4688
4688
  const d = t.nodes.getID(a);
4689
4689
  if (d !== void 0) {
4690
4690
  if (Z(a, "select") && (i(d, a), t.nodes.attachNodeListener(a, "change", () => i(d, a))), To(a)) {
4691
4691
  l(d, a);
4692
- let p = 0, b = 0, w = 0;
4693
- const v = () => {
4692
+ let p = 0, v = 0, w = 0;
4693
+ const b = () => {
4694
4694
  p = pe();
4695
4695
  }, T = () => {
4696
- b === 0 && p !== 0 && (b = pe() - p);
4697
- }, N = () => {
4698
- p !== 0 && (w = pe() - p), u(d, a, b, w), b = 0, w = 0, p = 0;
4696
+ v === 0 && p !== 0 && (v = pe() - p);
4697
+ }, _ = () => {
4698
+ p !== 0 && (w = pe() - p), u(d, a, v, w), v = 0, w = 0, p = 0;
4699
4699
  };
4700
- t.nodes.attachNodeListener(a, "focus", v), t.nodes.attachNodeListener(a, "input", T), t.nodes.attachNodeListener(a, "change", N);
4700
+ t.nodes.attachNodeListener(a, "focus", b), t.nodes.attachNodeListener(a, "input", T), t.nodes.attachNodeListener(a, "change", _);
4701
4701
  return;
4702
4702
  }
4703
4703
  if (Eo(a)) {
@@ -4923,40 +4923,40 @@ function Bo(t, e) {
4923
4923
  function jo(t, e) {
4924
4924
  const { disableClickmaps: n = !1 } = e || {};
4925
4925
  function s(k) {
4926
- const _ = Nn(k);
4927
- if (_ !== null)
4928
- return _;
4926
+ const N = Nn(k);
4927
+ if (N !== null)
4928
+ return N;
4929
4929
  if (Z(k, "input"))
4930
4930
  return ri(k);
4931
4931
  if (xn(k)) {
4932
- let R = "";
4933
- return k instanceof HTMLElement && (R = t.sanitizer.getInnerTextSecure(k)), R = R || k.id || k.className, Ws(R).slice(0, 100);
4932
+ let D = "";
4933
+ return k instanceof HTMLElement && (D = t.sanitizer.getInnerTextSecure(k)), D = D || k.id || k.className, Ws(D).slice(0, 100);
4934
4934
  }
4935
4935
  return "";
4936
4936
  }
4937
- let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, b = 0, w;
4938
- const v = 8e-3, T = 225;
4939
- function N() {
4940
- const k = b / T;
4937
+ let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, v = 0, w;
4938
+ const b = 8e-3, T = 225;
4939
+ function _() {
4940
+ const k = v / T;
4941
4941
  if (!a) {
4942
4942
  a = k;
4943
4943
  return;
4944
4944
  }
4945
- const _ = (k - a) / T;
4946
- p > 4 && _ > v && t.send(vr(pe())), b = 0, p = 0, a = k;
4945
+ const N = (k - a) / T;
4946
+ p > 4 && N > b && t.send(vr(pe())), v = 0, p = 0, a = k;
4947
4947
  }
4948
4948
  t.attachStartCallback(() => {
4949
- w = setInterval(() => N(), T);
4949
+ w = setInterval(() => _(), T);
4950
4950
  }), t.attachStopCallback(() => {
4951
4951
  i = -1, r = -1, o = !1, l = null, u = {}, w && clearInterval(w);
4952
4952
  });
4953
4953
  const M = () => {
4954
4954
  o && (t.send(tr(i, r)), o = !1);
4955
- }, D = (k, _ = !1) => {
4956
- function R(I, E, P) {
4955
+ }, R = (k, N = !1) => {
4956
+ function D(I, E, P) {
4957
4957
  return u[I] = u[I] || Po(E, k, P);
4958
4958
  }
4959
- const L = _ ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
4959
+ const L = N ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
4960
4960
  L(k.documentElement, "mouseover", (I) => {
4961
4961
  const E = Ts(I.target, k);
4962
4962
  E !== l && (l = E, c = performance.now());
@@ -4964,7 +4964,7 @@ function jo(t, e) {
4964
4964
  const [E, P] = t.observer.getDocumentOffset(k);
4965
4965
  i = I.clientX + E, r = I.clientY + P, o = !0;
4966
4966
  const U = Math.sign(I.movementX);
4967
- b += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
4967
+ v += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
4968
4968
  }, !1), L(k, "click", (I) => {
4969
4969
  const E = Ts(I.target, k);
4970
4970
  if (!I.clientX && !I.clientY || E === null)
@@ -4972,14 +4972,14 @@ function jo(t, e) {
4972
4972
  const P = t.nodes.getID(E);
4973
4973
  if (P !== void 0) {
4974
4974
  const U = I.pageX, j = I.pageY, z = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, F = Es(U / z), V = Es(j / C);
4975
- M(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? R(P, E, e) : "", F, V), !0);
4975
+ M(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? D(P, E, e) : "", F, V), !0);
4976
4976
  }
4977
4977
  l = null;
4978
4978
  });
4979
4979
  };
4980
4980
  t.nodes.attachNodeCallback((k) => {
4981
- vt(k) && D(k);
4982
- }), D(document, !0), t.ticker.attach(M, (e == null ? void 0 : e.trackingOffset) || 7);
4981
+ vt(k) && R(k);
4982
+ }), R(document, !0), t.ticker.attach(M, (e == null ? void 0 : e.trackingOffset) || 7);
4983
4983
  }
4984
4984
  function Es(t) {
4985
4985
  return Math.round(t * 1e4);
@@ -4992,8 +4992,8 @@ function zo(t) {
4992
4992
  if (Z(r, "img") && (o = r.currentSrc || r.src), !o) {
4993
4993
  const w = getComputedStyle(r).getPropertyValue("background-image");
4994
4994
  if (w) {
4995
- const v = s.exec(w);
4996
- v !== null && (o = v[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4995
+ const b = s.exec(w);
4996
+ b !== null && (o = b[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4997
4997
  }
4998
4998
  }
4999
4999
  if (!o)
@@ -5004,8 +5004,8 @@ function zo(t) {
5004
5004
  const c = r.getBoundingClientRect(), u = Math.max(c.top, 0), a = Math.max(c.left, 0), d = Math.min(c.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(c.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
5005
5005
  if (d <= u || p <= a)
5006
5006
  continue;
5007
- const b = (d - u) * (p - a);
5008
- e.push({ time: l, area: b });
5007
+ const v = (d - u) * (p - a);
5008
+ e.push({ time: l, area: v });
5009
5009
  }
5010
5010
  return e;
5011
5011
  }
@@ -5082,26 +5082,26 @@ function Ho(t, e) {
5082
5082
  navigationStart: a,
5083
5083
  requestStart: d,
5084
5084
  responseStart: p,
5085
- responseEnd: b,
5085
+ responseEnd: v,
5086
5086
  domContentLoadedEventStart: w,
5087
- domContentLoadedEventEnd: v,
5087
+ domContentLoadedEventEnd: b,
5088
5088
  loadEventStart: T,
5089
- loadEventEnd: N
5089
+ loadEventEnd: _
5090
5090
  } = performance.timing;
5091
- t.send(sr(d - a || 0, p - a || 0, b - a || 0, w - a || 0, v - a || 0, T - a || 0, N - a || 0, l, c));
5091
+ t.send(sr(d - a || 0, p - a || 0, v - a || 0, w - a || 0, b - a || 0, T - a || 0, _ - a || 0, l, c));
5092
5092
  }
5093
5093
  }, 30);
5094
5094
  }
5095
5095
  if (n.capturePageRenderTimings) {
5096
- let u = 0, a = 0, d = 0, p = null, b = !1;
5096
+ let u = 0, a = 0, d = 0, p = null, v = !1;
5097
5097
  t.ticker.attach(() => {
5098
- if (b)
5098
+ if (v)
5099
5099
  return;
5100
5100
  const w = performance.now();
5101
- if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((v) => s[v])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5102
- b = !0, s = null;
5103
- const v = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: T, navigationStart: N } = performance.timing, M = d === null ? Math.max(a, c, T - N || 0) : 0;
5104
- t.send(ir(v, c > u ? c : u, M));
5101
+ if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((b) => s[b])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5102
+ v = !0, s = null;
5103
+ const b = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: T, navigationStart: _ } = performance.timing, M = d === null ? Math.max(a, c, T - _ || 0) : 0;
5104
+ t.send(ir(b, c > u ? c : u, M));
5105
5105
  }
5106
5106
  });
5107
5107
  }
@@ -5177,11 +5177,11 @@ function Vo(t) {
5177
5177
  if (a && Symbol.iterator in a)
5178
5178
  for (const d of a) {
5179
5179
  let p = e.get(d);
5180
- const b = !p;
5181
- if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), b) {
5180
+ const v = !p;
5181
+ if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), v) {
5182
5182
  const w = d.cssRules;
5183
- for (let v = 0; v < w.length; v++)
5184
- t.send(fn(p, w[v].cssText, v, t.getBaseHref()));
5183
+ for (let b = 0; b < w.length; b++)
5184
+ t.send(fn(p, w[b].cssText, b, t.getBaseHref()));
5185
5185
  }
5186
5186
  u.push(p);
5187
5187
  }
@@ -5336,19 +5336,19 @@ function Xo(t, e, n, s, i) {
5336
5336
  t.debug.log("Openreplay: attaching axios spy to instance", e);
5337
5337
  function r(p) {
5338
5338
  t.debug.log("Openreplay: capturing axios response data", p);
5339
- const { headers: b, data: w, method: v, url: T, baseURL: N } = p.config, { data: M, headers: D, status: k, response: _ } = p, { data: R, headers: L, status: I } = _ || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
5339
+ const { headers: v, data: w, method: b, url: T, baseURL: _ } = p.config, { data: M, headers: R, status: k, response: N } = p, { data: D, headers: L, status: I } = N || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
5340
5340
  function U($, y) {
5341
5341
  P(y[0]) || ($[y[0]] = y[1]);
5342
5342
  }
5343
5343
  let j = {}, z = {};
5344
- b.toJSON ? j = b.toJSON() : b instanceof Headers ? b.forEach(($, y) => U(j, [y, $])) : Array.isArray(b) ? b.forEach(($) => U(j, $)) : typeof b == "object" && Object.entries(b).forEach(($) => U(j, $));
5345
- const C = L || D;
5344
+ v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach(($, y) => U(j, [y, $])) : Array.isArray(v) ? v.forEach(($) => U(j, $)) : typeof v == "object" && Object.entries(v).forEach(($) => U(j, $));
5345
+ const C = L || R;
5346
5346
  C.toJSON ? z = C.toJSON() : C instanceof Headers ? C.forEach(($, y) => U(z, [y, $])) : Array.isArray(C) ? C.forEach(($) => U(z, $)) : typeof C == "object" && Object.entries(C).forEach(([$, y]) => {
5347
5347
  P($) || (z[$] = y);
5348
5348
  });
5349
5349
  const F = s({
5350
5350
  url: T,
5351
- method: v || "",
5351
+ method: b || "",
5352
5352
  status: k || I || 0,
5353
5353
  request: {
5354
5354
  headers: j,
@@ -5356,7 +5356,7 @@ function Xo(t, e, n, s, i) {
5356
5356
  },
5357
5357
  response: {
5358
5358
  headers: z,
5359
- body: R || M
5359
+ body: D || M
5360
5360
  }
5361
5361
  });
5362
5362
  if (!F) {
@@ -5364,12 +5364,12 @@ function Xo(t, e, n, s, i) {
5364
5364
  return;
5365
5365
  }
5366
5366
  const V = p.config.__openreplay_timing, K = performance.now() - V;
5367
- t.debug.log("Openreplay: final req object", F), t.send(bt("xhr", String(v), String(F.url), i(F.request), i(F.response), F.status, V + Ve(), K, 0));
5367
+ t.debug.log("Openreplay: final req object", F), t.send(bt("xhr", String(b), String(F.url), i(F.request), i(F.response), F.status, V + Ve(), K, 0));
5368
5368
  }
5369
5369
  function o(p) {
5370
5370
  if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), n.sessionTokenHeader) {
5371
- const b = typeof n.sessionTokenHeader == "string" ? n.sessionTokenHeader : "X-OpenReplay-Session-Token", w = t.getSessionToken();
5372
- w && p.headers.set(b, w);
5371
+ const v = typeof n.sessionTokenHeader == "string" ? n.sessionTokenHeader : "X-OpenReplay-Session-Token", w = t.getSessionToken();
5372
+ w && p.headers.set(v, w);
5373
5373
  }
5374
5374
  return p;
5375
5375
  }
@@ -5388,8 +5388,8 @@ function Xo(t, e, n, s, i) {
5388
5388
  synchronous: !0
5389
5389
  });
5390
5390
  t.attachStopCallback(() => {
5391
- var p, b, w, v;
5392
- (b = (p = e.interceptors.request).eject) == null || b.call(p, a), (v = (w = e.interceptors.response).eject) == null || v.call(w, d);
5391
+ var p, v, w, b;
5392
+ (v = (p = e.interceptors.request).eject) == null || v.call(p, a), (b = (w = e.interceptors.response).eject) == null || b.call(w, d);
5393
5393
  });
5394
5394
  }
5395
5395
  function Yo(t) {
@@ -5814,19 +5814,19 @@ function la(t, e = {}) {
5814
5814
  }
5815
5815
  const u = (a) => {
5816
5816
  if (n.useProxy)
5817
- return ca(a, n.ignoreHeaders, o, l, (D) => t.send(D), (D) => t.isServiceURL(D), n.tokenUrlMatcher);
5818
- const d = a.fetch.bind(a), p = (D, k = {}) => {
5819
- if (!(typeof D == "string" || D instanceof URL) || t.isServiceURL(String(D)))
5820
- return d(D, k);
5821
- o(function(R, L) {
5822
- k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(R, L) : Array.isArray(k.headers) ? k.headers.push([R, L]) : k.headers[R] = L;
5817
+ return ca(a, n.ignoreHeaders, o, l, (R) => t.send(R), (R) => t.isServiceURL(R), n.tokenUrlMatcher);
5818
+ const d = a.fetch.bind(a), p = (R, k = {}) => {
5819
+ if (!(typeof R == "string" || R instanceof URL) || t.isServiceURL(String(R)))
5820
+ return d(R, k);
5821
+ o(function(D, L) {
5822
+ k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(D, L) : Array.isArray(k.headers) ? k.headers.push([D, L]) : k.headers[D] = L;
5823
5823
  });
5824
- const _ = performance.now();
5825
- return d(D, k).then((R) => {
5826
- const L = performance.now() - _;
5827
- if (n.failuresOnly && R.status < 400)
5828
- return R;
5829
- const I = R.clone();
5824
+ const N = performance.now();
5825
+ return d(R, k).then((D) => {
5826
+ const L = performance.now() - N;
5827
+ if (n.failuresOnly && D.status < 400)
5828
+ return D;
5829
+ const I = D.clone();
5830
5830
  return I.text().then((E) => {
5831
5831
  const P = {}, U = {};
5832
5832
  if (s !== !0) {
@@ -5838,7 +5838,7 @@ function la(t, e = {}) {
5838
5838
  });
5839
5839
  }
5840
5840
  const j = _s(k.method), z = l({
5841
- url: String(D),
5841
+ url: String(R),
5842
5842
  method: j,
5843
5843
  status: I.status,
5844
5844
  request: {
@@ -5851,28 +5851,28 @@ function la(t, e = {}) {
5851
5851
  body: E
5852
5852
  }
5853
5853
  });
5854
- z && t.send(bt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, _ + Ve(), L, 0));
5855
- }).catch((E) => t.debug.error("Could not process Fetch response:", E)), R;
5854
+ z && t.send(bt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, N + Ve(), L, 0));
5855
+ }).catch((E) => t.debug.error("Could not process Fetch response:", E)), D;
5856
5856
  });
5857
5857
  };
5858
5858
  a.fetch = p;
5859
- const b = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, v = a.XMLHttpRequest.prototype.send;
5860
- function T(D, k) {
5861
- const _ = this;
5862
- o((L, I) => _.setRequestHeader(L, I));
5863
- let R = 0;
5864
- return _.addEventListener("loadstart", (L) => {
5865
- R = L.timeStamp;
5866
- }), _.addEventListener("load", t.safe((L) => {
5867
- const { headers: I, body: E } = on(_), P = R > 0 ? L.timeStamp - R : 0, j = (_.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5859
+ const v = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, b = a.XMLHttpRequest.prototype.send;
5860
+ function T(R, k) {
5861
+ const N = this;
5862
+ o((L, I) => N.setRequestHeader(L, I));
5863
+ let D = 0;
5864
+ return N.addEventListener("loadstart", (L) => {
5865
+ D = L.timeStamp;
5866
+ }), N.addEventListener("load", t.safe((L) => {
5867
+ const { headers: I, body: E } = on(N), P = D > 0 ? L.timeStamp - D : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5868
5868
  j.forEach(function(V) {
5869
5869
  const K = V.split(": "), $ = K.shift();
5870
5870
  i($) || (z[$] = K.join(": "));
5871
5871
  });
5872
- const C = _s(D), F = l({
5872
+ const C = _s(R), F = l({
5873
5873
  url: String(k),
5874
5874
  method: C,
5875
- status: _.status,
5875
+ status: N.status,
5876
5876
  request: {
5877
5877
  headers: I,
5878
5878
  // @ts-ignore
@@ -5880,24 +5880,24 @@ function la(t, e = {}) {
5880
5880
  },
5881
5881
  response: {
5882
5882
  headers: z,
5883
- body: _.response
5883
+ body: N.response
5884
5884
  }
5885
5885
  });
5886
- F && t.send(bt("xhr", C, String(F.url), c(F.request), c(F.response), _.status, R + Ve(), P, 0));
5887
- })), b.apply(this, arguments);
5886
+ F && t.send(bt("xhr", C, String(F.url), c(F.request), c(F.response), N.status, D + Ve(), P, 0));
5887
+ })), v.apply(this, arguments);
5888
5888
  }
5889
- function N(D) {
5889
+ function _(R) {
5890
5890
  const k = on(this);
5891
- return k.body = D, v.apply(this, arguments);
5891
+ return k.body = R, b.apply(this, arguments);
5892
5892
  }
5893
- function M(D, k) {
5894
- if (!i(D)) {
5895
- const _ = on(this);
5896
- _.headers[D] = k;
5893
+ function M(R, k) {
5894
+ if (!i(R)) {
5895
+ const N = on(this);
5896
+ N.headers[R] = k;
5897
5897
  }
5898
5898
  return w.apply(this, arguments);
5899
5899
  }
5900
- n.axiosInstances || (a.XMLHttpRequest.prototype.open = T, a.XMLHttpRequest.prototype.send = N, a.XMLHttpRequest.prototype.setRequestHeader = M);
5900
+ n.axiosInstances || (a.XMLHttpRequest.prototype.open = T, a.XMLHttpRequest.prototype.send = _, a.XMLHttpRequest.prototype.setRequestHeader = M);
5901
5901
  };
5902
5902
  u(window), n.axiosInstances && n.axiosInstances.forEach((a) => {
5903
5903
  Xo(t, a, n, l, c);
@@ -7684,7 +7684,7 @@ class ba {
7684
7684
  const n = this.OpenAIApiKey, s = "https://api.openai.com/v1/chat/completions", i = {
7685
7685
  "Content-Type": "application/json",
7686
7686
  Authorization: `Bearer ${n}`
7687
- }, o = Object.values(e).join(" ||| "), l = `Translate the following texts to ${this.language}. Return only the translated texts separated by " ||| " in the same order:
7687
+ }, o = Object.values(e).join(" ||| "), l = `Translate the following texts to language with the next code: ${this.language}. Return only the translated texts separated by " ||| " in the same order:
7688
7688
 
7689
7689
  ${o}`, c = JSON.stringify({
7690
7690
  model: "gpt-3.5-turbo",
@@ -7696,19 +7696,19 @@ class ba {
7696
7696
  max_tokens: 1e3
7697
7697
  });
7698
7698
  try {
7699
- const v = (p = (d = (a = (u = (await (await fetch(s, {
7699
+ const b = (p = (d = (a = (u = (await (await fetch(s, {
7700
7700
  method: "POST",
7701
7701
  headers: i,
7702
7702
  body: c
7703
7703
  })).json()).choices) == null ? void 0 : u[0]) == null ? void 0 : a.message) == null ? void 0 : d.content) == null ? void 0 : p.trim();
7704
- if (!v)
7704
+ if (!b)
7705
7705
  throw new Error("No response from OpenAI");
7706
- const T = v.split(" ||| ").map((M) => M.trim()), N = {};
7707
- return Object.keys(e).forEach((M, D) => {
7708
- N[M] = T[D] || e[M];
7709
- }), N;
7710
- } catch (b) {
7711
- return console.error("Error translating texts:", b), e;
7706
+ const T = b.split(" ||| ").map((M) => M.trim()), _ = {};
7707
+ return Object.keys(e).forEach((M, R) => {
7708
+ _[M] = T[R] || e[M];
7709
+ }), _;
7710
+ } catch (v) {
7711
+ return console.error("Error translating texts:", v), e;
7712
7712
  }
7713
7713
  }
7714
7714
  }
@@ -7839,13 +7839,13 @@ class va {
7839
7839
  return typeof u != "number" && (u = Number(u)), u.toLocaleString("en-US");
7840
7840
  }
7841
7841
  e.forEach(async (u, a) => {
7842
- const d = i(u, "title"), p = i(u, "image"), b = i(u, "total"), w = i(u, "url"), v = u.tags || u.Tags, T = r(u, ["type", "country", "region", "grape"]), N = v ? o(v) : "", M = l(u), D = u["Short Description"], k = u.pairing_recommendation, _ = u.isSommSelection, R = `
7843
- <div class="wine-recommendation-tile ${_ ? "somm-selection" : ""}">
7844
- ${_ ? `<div class="somm-selection-badge">${G.translate("wineDetails.sommSelection")}</div>` : ""}
7842
+ const d = i(u, "title"), p = i(u, "image"), v = i(u, "total"), w = i(u, "url"), b = u.tags || u.Tags, T = r(u, ["type", "country", "region", "grape"]), _ = b ? o(b) : "", M = l(u), R = u["Short Description"], k = u.pairing_recommendation, N = u.isSommSelection, D = `
7843
+ <div class="wine-recommendation-tile ${N ? "somm-selection" : ""}">
7844
+ ${N ? `<div class="somm-selection-badge">${G.translate("wineDetails.sommSelection")}</div>` : ""}
7845
7845
 
7846
7846
  <div class="tile-top">
7847
7847
  ${p ? `<img src="${p}" alt="${d}" class="wine-image" />` : ""}
7848
- <div class="wine-price">${c(b)} ${G.getCurrency("label")}</div>
7848
+ <div class="wine-price">${c(v)} ${G.getCurrency("label")}</div>
7849
7849
  <h3 class="wine-title">${d}</h3>
7850
7850
  </div>
7851
7851
 
@@ -7860,15 +7860,15 @@ class va {
7860
7860
  <h2>${d}</h2>
7861
7861
  <span class="card-popup-close">&times;</span>
7862
7862
  </div>
7863
- ${D ? `<p class="popup-short-desc" data-orig="${D}">${D}</p>` : ""}
7863
+ ${R ? `<p class="popup-short-desc" data-orig="${R}">${R}</p>` : ""}
7864
7864
  ${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` : k ? `<p class="popup-pairing" data-orig="${k}">${k}</p>` : ""}
7865
- ${N ? `<div class="popup-tags">${N}</div>` : ""}
7865
+ ${_ ? `<div class="popup-tags">${_}</div>` : ""}
7866
7866
  </div>
7867
7867
 
7868
7868
  ${M}
7869
7869
  </div>
7870
7870
  `;
7871
- s.insertAdjacentHTML("beforeend", R);
7871
+ s.insertAdjacentHTML("beforeend", D);
7872
7872
  const L = s.children[a];
7873
7873
  if (!w) {
7874
7874
  const I = L.querySelector("[data-toggle-info]"), E = L.querySelector(".card-popup"), P = L.querySelector(".card-popup-close");
@@ -7928,38 +7928,38 @@ class va {
7928
7928
  async translatePopupContent(e) {
7929
7929
  if (console.log(G.language, G.storeLanguage), G.language === G.storeLanguage || this.widgetType !== "bar")
7930
7930
  return;
7931
- const n = ["Short Description", "reason", "pairing_recommendation", "Tags"];
7931
+ const n = ["Short Description", "reason", "pairing_recommendation", "Tags", "tags"], s = e[0], i = n.filter((o) => o in s);
7932
7932
  G.language;
7933
- const s = 4;
7934
- for (let i = 0; i < e.length; i += s) {
7935
- const o = e.slice(i, i + s).map(async (l, c) => {
7936
- const u = i + c, a = {};
7937
- if (n.forEach((b) => {
7938
- const w = l[b] || l[b.toLowerCase()];
7939
- w && (a[b] = Array.isArray(w) ? w.join(", ") : w);
7940
- }), Object.keys(a).length === 0)
7933
+ const r = 4;
7934
+ for (let o = 0; o < e.length; o += r) {
7935
+ const c = e.slice(o, o + r).map(async (u, a) => {
7936
+ const d = o + a, p = {};
7937
+ if (i.forEach((b) => {
7938
+ const T = u[b] || u[b.toLowerCase()];
7939
+ T && (p[b] = Array.isArray(T) ? T.join(", ") : T);
7940
+ }), Object.keys(p).length === 0)
7941
7941
  return;
7942
- const d = await G.translateTexts(a), p = document.querySelector(`.card-popup[data-wine-index="${u}"]`);
7943
- if (p) {
7944
- if (d["Short Description"]) {
7945
- const b = p.querySelector(".popup-short-desc");
7946
- b && (b.textContent = d["Short Description"]);
7942
+ const v = await G.translateTexts(p), w = document.querySelector(`.card-popup[data-wine-index="${d}"]`);
7943
+ if (w) {
7944
+ if (v["Short Description"]) {
7945
+ const b = w.querySelector(".popup-short-desc");
7946
+ b && (b.textContent = v["Short Description"]);
7947
7947
  }
7948
- if (d.reason) {
7949
- const b = p.querySelector(".popup-reason");
7950
- b && (b.textContent = d.reason);
7948
+ if (v.reason) {
7949
+ const b = w.querySelector(".popup-reason");
7950
+ b && (b.textContent = v.reason);
7951
7951
  }
7952
- if (d.pairing_recommendation) {
7953
- const b = p.querySelector(".popup-pairing");
7954
- b && (b.textContent = d.pairing_recommendation);
7952
+ if (v.pairing_recommendation) {
7953
+ const b = w.querySelector(".popup-pairing");
7954
+ b && (b.textContent = v.pairing_recommendation);
7955
7955
  }
7956
- if (d.Tags) {
7957
- const w = d.Tags.split(",").map((T) => T.trim()).map((T) => `<span class="popup-tag">${T}</span>`).join(""), v = p.querySelector(".popup-tags");
7958
- v && (v.innerHTML = w);
7956
+ if (v.tags || v.Tags) {
7957
+ const _ = (v.tags || v.Tags).split(",").map((R) => R.trim()).map((R) => `<span class="popup-tag">${R}</span>`).join(""), M = w.querySelector(".popup-tags");
7958
+ M && (M.innerHTML = _);
7959
7959
  }
7960
7960
  }
7961
7961
  });
7962
- await Promise.all(o);
7962
+ await Promise.all(c);
7963
7963
  }
7964
7964
  }
7965
7965
  async loadInstantRecommendations() {