wineater-bot 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -435,10 +435,14 @@ border-bottom-right-radius: 15px;
435
435
  justify-content: center;
436
436
  align-items: center;
437
437
  height: 0;
438
- visibility: hidden;
438
+ visibility: hidden;
439
439
  background-color: white;
440
440
  }
441
441
 
442
+ #loading-indicator .typing-indicator {
443
+ visibility: visible;
444
+ }
445
+
442
446
  .typing-indicator span {
443
447
  display: block;
444
448
  width: 8px;
@@ -916,35 +920,35 @@ var fn = { exports: {} };
916
920
  var ae = L.flags, te = L.traits, ne = L.identifier;
917
921
  u.isLoading = !1;
918
922
  var ce = {}, le = {};
919
- te = te || [], (ae = ae || []).forEach(function(X) {
920
- ce[X.feature.name.toLowerCase().replace(/ /g, "_")] = { id: X.feature.id, enabled: X.enabled, value: X.feature_state_value };
921
- }), te.forEach(function(X) {
922
- le[X.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: X.transient, value: X.trait_value };
923
+ te = te || [], (ae = ae || []).forEach(function(J) {
924
+ ce[J.feature.name.toLowerCase().replace(/ /g, "_")] = { id: J.feature.id, enabled: J.enabled, value: J.feature_state_value };
925
+ }), te.forEach(function(J) {
926
+ le[J.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: J.transient, value: J.trait_value };
923
927
  }), u.oldFlags = i({}, u.flags);
924
928
  var me = h(u.oldFlags, ce), Ke = h((H = u.evaluationContext.identity) === null || H === void 0 ? void 0 : H.traits, le);
925
929
  if ((ne || Object.keys(le).length) && (u.evaluationContext.identity = { traits: le }, ne && (u.evaluationContext.identity.identifier = ne)), u.flags = ce, u.updateStorage(), u._onChange(u.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: Ke }, u._loadedState(null, c.SERVER)), u.datadogRum)
926
930
  try {
927
931
  if (u.datadogRum.trackTraits) {
928
- var Xe = {};
929
- Object.keys(((_ = u.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(X) {
930
- Xe[D + X] = u.getTrait(X);
932
+ var Je = {};
933
+ Object.keys(((_ = u.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(J) {
934
+ Je[D + J] = u.getTrait(J);
931
935
  });
932
- var Me = i(i(i({}, u.datadogRum.client.getUser()), { id: u.datadogRum.client.getUser().id || ((W = u.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Xe);
936
+ var Me = i(i(i({}, u.datadogRum.client.getUser()), { id: u.datadogRum.client.getUser().id || ((W = u.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Je);
933
937
  u.log("Setting Datadog user", Me), u.datadogRum.client.setUser(Me);
934
938
  }
935
- } catch (X) {
936
- console.error(X);
939
+ } catch (J) {
940
+ console.error(J);
937
941
  }
938
942
  if (u.dtrum)
939
943
  try {
940
944
  var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
941
- Object.keys(u.flags).map(function(X) {
942
- p(se, N + X, u.getValue(X, { skipAnalytics: !0 })), p(se, O + X, u.hasFeature(X, { skipAnalytics: !0 }));
943
- }), Object.keys(((ee = u.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(X) {
944
- p(se, D + X, u.getTrait(X));
945
+ Object.keys(u.flags).map(function(J) {
946
+ p(se, N + J, u.getValue(J, { skipAnalytics: !0 })), p(se, O + J, u.hasFeature(J, { skipAnalytics: !0 }));
947
+ }), Object.keys(((ee = u.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(J) {
948
+ p(se, D + J, u.getTrait(J));
945
949
  }), u.log("Sending javaLongOrObject traits to dynatrace", se.javaLongOrObject), u.log("Sending date traits to dynatrace", se.date), u.log("Sending shortString traits to dynatrace", se.shortString), u.log("Sending javaDouble to dynatrace", se.javaDouble), u.dtrum.sendSessionProperties(se.javaLongOrObject, se.date, se.shortString, se.javaDouble);
946
- } catch (X) {
947
- console.error(X);
950
+ } catch (J) {
951
+ console.error(J);
948
952
  }
949
953
  }
950
954
  };
@@ -1059,19 +1063,19 @@ var fn = { exports: {} };
1059
1063
  return b.prototype.init = function(f) {
1060
1064
  var u, m, g;
1061
1065
  return r(this, void 0, void 0, function() {
1062
- var w, x, R, L, H, _, W, ee, ae, te, ne, ce, le, me, Ke, Xe, Me, se, X, At, Je, $n, Ye, Dt, Wn, qn, Mt, Vn, Lt, Qe, Le, Gn, ie = this;
1066
+ var w, x, R, L, H, _, W, ee, ae, te, ne, ce, le, me, Ke, Je, Me, se, J, At, Xe, $n, Ye, Dt, Wn, qn, Mt, Vn, Lt, Qe, Le, Gn, ie = this;
1063
1067
  return o(this, function(pe) {
1064
1068
  switch (pe.label) {
1065
1069
  case 0:
1066
1070
  w = y(f.evaluationContext || this.evaluationContext), pe.label = 1;
1067
1071
  case 1:
1068
- if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, H = f.headers, _ = f.onChange, W = f.cacheFlags, ee = f.datadogRum, ae = f.onError, te = f.defaultFlags, ne = f.fetch, ce = f.preventFetch, le = f.enableLogs, me = f.enableDynatrace, Ke = f.enableAnalytics, Xe = f.realtime, Me = f.eventSourceUrl, se = Me === void 0 ? "https://realtime.flagsmith.com/" : Me, X = f.AsyncStorage, At = f.identity, Je = f.traits, $n = f.state, Ye = f.cacheOptions, Dt = f.angularHttpClient, Wn = f._trigger, qn = f._triggerLoadingState, w.environment = x ? { apiKey: x } : w.environment, !w.environment || !w.environment.apiKey)
1072
+ if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, H = f.headers, _ = f.onChange, W = f.cacheFlags, ee = f.datadogRum, ae = f.onError, te = f.defaultFlags, ne = f.fetch, ce = f.preventFetch, le = f.enableLogs, me = f.enableDynatrace, Ke = f.enableAnalytics, Je = f.realtime, Me = f.eventSourceUrl, se = Me === void 0 ? "https://realtime.flagsmith.com/" : Me, J = f.AsyncStorage, At = f.identity, Xe = f.traits, $n = f.state, Ye = f.cacheOptions, Dt = f.angularHttpClient, Wn = f._trigger, qn = f._triggerLoadingState, w.environment = x ? { apiKey: x } : w.environment, !w.environment || !w.environment.apiKey)
1069
1073
  throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
1070
- if (w.identity = At || Je ? { identifier: At, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(he) {
1074
+ if (w.identity = At || Xe ? { identifier: At, traits: Xe ? Object.fromEntries(Object.entries(Xe).map(function(he) {
1071
1075
  return [he[0], { value: he[1] }];
1072
1076
  })) : {} } : w.identity, this.evaluationContext = w, this.api = L, this.headers = H, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Mt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Wn || this._trigger, this._triggerLoadingState = qn || this._triggerLoadingState, this.onError = function(he) {
1073
1077
  ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: he })), ae == null || ae(he);
1074
- }, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.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 = Ke || !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 = F !== void 0 && !!W, X && (F = X), Xe && typeof window < "u" && this.setupRealtime(se, w.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState($n), this.log("Initialising with properties", f, this), me && (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), Dt && (d = /* @__PURE__ */ function(he) {
1078
+ }, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.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 = Ke || !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 = F !== void 0 && !!W, J && (F = J), Je && typeof window < "u" && this.setupRealtime(se, w.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState($n), this.log("Initialising with properties", f, this), me && (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), Dt && (d = /* @__PURE__ */ function(he) {
1075
1079
  return function(be, ve) {
1076
1080
  var Ee = ve.headers, Y = ve.method, Pe = ve.body;
1077
1081
  return new Promise(function(Re) {
@@ -1113,7 +1117,7 @@ var fn = { exports: {} };
1113
1117
  return [3, 8];
1114
1118
  Vn = function(he, be) {
1115
1119
  return r(ie, void 0, void 0, function() {
1116
- var ve, Ee, Y, Pe, Re, ke, Pt, Kn, Bt, jt, Ut, zt, Ht, $t, Wt, qt, Vt, Gt, Kt, Xt, Jt, Yt, Qt, Zt;
1120
+ var ve, Ee, Y, Pe, Re, ke, Pt, Kn, Bt, jt, Ut, zt, Ht, $t, Wt, qt, Vt, Gt, Kt, Jt, Xt, Yt, Qt, Zt;
1117
1121
  return o(this, function(Ie) {
1118
1122
  switch (Ie.label) {
1119
1123
  case 0:
@@ -1121,7 +1125,7 @@ var fn = { exports: {} };
1121
1125
  return [3, 7];
1122
1126
  ve = null, Ee = null, Ie.label = 1;
1123
1127
  case 1:
1124
- return Ie.trys.push([1, 5, , 6]), Y = JSON.parse(be), Pe = !1, Re = !1, Y && Y.api === this.api && ((jt = (Bt = Y.evaluationContext) === null || Bt === void 0 ? void 0 : Bt.environment) === null || jt === void 0 ? void 0 : jt.apiKey) === ((Ut = this.evaluationContext.environment) === null || Ut === void 0 ? void 0 : Ut.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !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"), ke = !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"), Re = !0, ke = !0)), ke && (Pe = !0, Ee = h((qt = this.evaluationContext.identity) === null || qt === void 0 ? void 0 : qt.traits, (Gt = (Vt = Y.evaluationContext) === null || Vt === void 0 ? void 0 : Vt.identity) === null || Gt === void 0 ? void 0 : Gt.traits), ve = h(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: y(i(i({}, Y.evaluationContext), { identity: !((Kt = Y.evaluationContext) === null || Kt === void 0) && Kt.identity ? i(i({}, (Xt = Y.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity), { traits: i(i({}, ((Yt = (Jt = Y.evaluationContext) === null || Jt === void 0 ? void 0 : Jt.identity) === null || Yt === void 0 ? void 0 : Yt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Pe ? (Pt = !ce && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ve, traitsChanged: Ee }, this._loadedState(null, c.CACHE, Pt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Pe && !Re && this.log("Skipping API, using cache"), Pt && this.getFlags(), [3, 4]) : [3, 2];
1128
+ return Ie.trys.push([1, 5, , 6]), Y = JSON.parse(be), Pe = !1, Re = !1, Y && Y.api === this.api && ((jt = (Bt = Y.evaluationContext) === null || Bt === void 0 ? void 0 : Bt.environment) === null || jt === void 0 ? void 0 : jt.apiKey) === ((Ut = this.evaluationContext.environment) === null || Ut === void 0 ? void 0 : Ut.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !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"), ke = !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"), Re = !0, ke = !0)), ke && (Pe = !0, Ee = h((qt = this.evaluationContext.identity) === null || qt === void 0 ? void 0 : qt.traits, (Gt = (Vt = Y.evaluationContext) === null || Vt === void 0 ? void 0 : Vt.identity) === null || Gt === void 0 ? void 0 : Gt.traits), ve = h(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: y(i(i({}, Y.evaluationContext), { identity: !((Kt = Y.evaluationContext) === null || Kt === void 0) && Kt.identity ? i(i({}, (Jt = Y.evaluationContext) === null || Jt === void 0 ? void 0 : Jt.identity), { traits: i(i({}, ((Yt = (Xt = Y.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity) === null || Yt === void 0 ? void 0 : Yt.traits) || {}), Xe || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Pe ? (Pt = !ce && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ve, traitsChanged: Ee }, this._loadedState(null, c.CACHE, Pt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Pe && !Re && this.log("Skipping API, using cache"), Pt && this.getFlags(), [3, 4]) : [3, 2];
1125
1129
  case 2:
1126
1130
  return ce ? [3, 4] : [4, this.getFlags()];
1127
1131
  case 3:
@@ -1237,7 +1241,7 @@ var fn = { exports: {} };
1237
1241
  var f = b.fetch, u = b.AsyncStorage, m = b.eventSource;
1238
1242
  return new I({ fetch: f, AsyncStorage: u, eventSource: m });
1239
1243
  }
1240
- var P, V = (P = function(b, f) {
1244
+ var P, G = (P = function(b, f) {
1241
1245
  return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(u, m) {
1242
1246
  u.__proto__ = m;
1243
1247
  } || function(u, m) {
@@ -1289,8 +1293,8 @@ var fn = { exports: {} };
1289
1293
  return b.call(this, `EventSource not available.
1290
1294
  Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
1291
1295
  }
1292
- return V(f, b), f;
1293
- }(Error), q = function() {
1296
+ return G(f, b), f;
1297
+ }(Error), V = function() {
1294
1298
  function b(f, u) {
1295
1299
  var m = this;
1296
1300
  if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = u != null ? Object.assign({}, u) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = f.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function")
@@ -1399,16 +1403,16 @@ Consider loading an EventSource polyfill and making it available globally as Eve
1399
1403
  g.setRequestHeader(H, f.headers[H]);
1400
1404
  g.send(f.body || null);
1401
1405
  });
1402
- }, z = E({ AsyncStorage: s, fetch: K, eventSource: q });
1406
+ }, z = E({ AsyncStorage: s, fetch: K, eventSource: V });
1403
1407
  typeof window < "u" && (window.flagsmith = z), n.createFlagsmithInstance = function() {
1404
- return E({ AsyncStorage: s, fetch: K, eventSource: q });
1408
+ return E({ AsyncStorage: s, fetch: K, eventSource: V });
1405
1409
  }, n.default = z, Object.defineProperty(n, "__esModule", { value: !0 });
1406
1410
  });
1407
1411
  })(fn, fn.exports);
1408
1412
  var Ai = fn.exports;
1409
- const Xn = /* @__PURE__ */ $s(Ai);
1410
- var Jn = {}, Di = function(t, e, n, s, i) {
1411
- var r = new Worker(Jn[e] || (Jn[e] = URL.createObjectURL(new Blob([
1413
+ const Jn = /* @__PURE__ */ $s(Ai);
1414
+ var Xn = {}, Di = function(t, e, n, s, i) {
1415
+ var r = new Worker(Xn[e] || (Xn[e] = URL.createObjectURL(new Blob([
1412
1416
  t + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
1413
1417
  ], { type: "text/javascript" }))));
1414
1418
  return r.onmessage = function(o) {
@@ -1498,9 +1502,9 @@ var Jn = {}, Di = function(t, e, n, s, i) {
1498
1502
  }, qs = Ws(_t, 2), Mi = qs.b, bt = qs.r;
1499
1503
  Mi[28] = 258, bt[258] = 28;
1500
1504
  var Li = Ws(Nt, 0), gn = Li.r, vt = new re(32768);
1501
- for (var J = 0; J < 32768; ++J) {
1502
- var Ce = (J & 43690) >> 1 | (J & 21845) << 1;
1503
- Ce = (Ce & 52428) >> 2 | (Ce & 13107) << 2, Ce = (Ce & 61680) >> 4 | (Ce & 3855) << 4, vt[J] = ((Ce & 65280) >> 8 | (Ce & 255) << 8) >> 1;
1505
+ for (var X = 0; X < 32768; ++X) {
1506
+ var Ce = (X & 43690) >> 1 | (X & 21845) << 1;
1507
+ Ce = (Ce & 52428) >> 2 | (Ce & 13107) << 2, Ce = (Ce & 61680) >> 4 | (Ce & 3855) << 4, vt[X] = ((Ce & 65280) >> 8 | (Ce & 255) << 8) >> 1;
1504
1508
  }
1505
1509
  var qe = function(t, e, n) {
1506
1510
  for (var s = t.length, i = 0, r = new re(e); i < s; ++i)
@@ -1521,17 +1525,17 @@ var qe = function(t, e, n) {
1521
1525
  t[i] && (l[i] = vt[o[t[i] - 1]++] >> 15 - t[i]);
1522
1526
  return l;
1523
1527
  }, Oe = new fe(288);
1524
- for (var J = 0; J < 144; ++J)
1525
- Oe[J] = 8;
1526
- for (var J = 144; J < 256; ++J)
1527
- Oe[J] = 9;
1528
- for (var J = 256; J < 280; ++J)
1529
- Oe[J] = 7;
1530
- for (var J = 280; J < 288; ++J)
1531
- Oe[J] = 8;
1528
+ for (var X = 0; X < 144; ++X)
1529
+ Oe[X] = 8;
1530
+ for (var X = 144; X < 256; ++X)
1531
+ Oe[X] = 9;
1532
+ for (var X = 256; X < 280; ++X)
1533
+ Oe[X] = 7;
1534
+ for (var X = 280; X < 288; ++X)
1535
+ Oe[X] = 8;
1532
1536
  var nt = new fe(32);
1533
- for (var J = 0; J < 32; ++J)
1534
- nt[J] = 5;
1537
+ for (var X = 0; X < 32; ++X)
1538
+ nt[X] = 5;
1535
1539
  var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = function(t) {
1536
1540
  return (t + 7) / 8 | 0;
1537
1541
  }, Ks = function(t, e, n) {
@@ -1552,9 +1556,9 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1552
1556
  "stream finishing",
1553
1557
  "invalid zip data"
1554
1558
  // determined by unknown compression method
1555
- ], Xs = function(t, e, n) {
1559
+ ], Js = function(t, e, n) {
1556
1560
  var s = new Error(e || Pi[t]);
1557
- if (s.code = t, Error.captureStackTrace && Error.captureStackTrace(s, Xs), !n)
1561
+ if (s.code = t, Error.captureStackTrace && Error.captureStackTrace(s, Js), !n)
1558
1562
  throw s;
1559
1563
  return s;
1560
1564
  }, ye = function(t, e, n) {
@@ -1647,15 +1651,15 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1647
1651
  ++D[B[I] & 31];
1648
1652
  for (var I = 0; I < N.length; ++I)
1649
1653
  ++D[N[I] & 31];
1650
- for (var E = ut(D, 7), P = E.t, V = E.l, j = 19; j > 4 && !P[pn[j - 1]]; --j)
1654
+ for (var E = ut(D, 7), P = E.t, G = E.l, j = 19; j > 4 && !P[pn[j - 1]]; --j)
1651
1655
  ;
1652
1656
  var $ = h + 5 << 3, C = He(i, Oe) + He(r, nt) + o, M = He(i, p) + He(r, y) + o + 14 + 3 * j + He(D, P) + 2 * D[16] + 3 * D[17] + 7 * D[18];
1653
1657
  if (a >= 0 && $ <= C && $ <= M)
1654
1658
  return Fn(e, c, t.subarray(a, a + h));
1655
- var q, K, z, b;
1659
+ var V, K, z, b;
1656
1660
  if (ye(e, c, 1 + (M < C)), c += 2, M < C) {
1657
- q = qe(p, v, 0), K = p, z = qe(y, T, 0), b = y;
1658
- var f = qe(P, V, 0);
1661
+ V = qe(p, v, 0), K = p, z = qe(y, T, 0), b = y;
1662
+ var f = qe(P, G, 0);
1659
1663
  ye(e, c, A - 257), ye(e, c + 5, O - 1), ye(e, c + 10, j - 4), c += 14;
1660
1664
  for (var I = 0; I < j; ++I)
1661
1665
  ye(e, c + 3 * I, P[pn[I]]);
@@ -1666,29 +1670,29 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1666
1670
  ye(e, c, f[w]), c += P[w], w > 15 && (ye(e, c, g[I] >> 5 & 127), c += g[I] >> 12);
1667
1671
  }
1668
1672
  } else
1669
- q = Vs, K = Oe, z = Gs, b = nt;
1673
+ V = Vs, K = Oe, z = Gs, b = nt;
1670
1674
  for (var I = 0; I < l; ++I) {
1671
1675
  var x = s[I];
1672
1676
  if (x > 255) {
1673
1677
  var w = x >> 18 & 31;
1674
- ze(e, c, q[w + 257]), c += K[w + 257], w > 7 && (ye(e, c, x >> 23 & 31), c += _t[w]);
1678
+ ze(e, c, V[w + 257]), c += K[w + 257], w > 7 && (ye(e, c, x >> 23 & 31), c += _t[w]);
1675
1679
  var R = x & 31;
1676
1680
  ze(e, c, z[R]), c += b[R], R > 3 && (ze(e, c, x >> 5 & 8191), c += Nt[R]);
1677
1681
  } else
1678
- ze(e, c, q[x]), c += K[x];
1682
+ ze(e, c, V[x]), c += K[x];
1679
1683
  }
1680
- return ze(e, c, q[256]), c + K[256];
1681
- }, Js = /* @__PURE__ */ new Ct([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), An = /* @__PURE__ */ new fe(0), Ys = function(t, e, n, s, i, r) {
1684
+ return ze(e, c, V[256]), c + K[256];
1685
+ }, Xs = /* @__PURE__ */ new Ct([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), An = /* @__PURE__ */ new fe(0), Ys = function(t, e, n, s, i, r) {
1682
1686
  var o = r.z || t.length, l = new fe(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(s, l.length - i), h = r.l, c = (r.r || 0) & 7;
1683
1687
  if (e) {
1684
1688
  c && (a[0] = r.r >> 3);
1685
- for (var d = Js[e - 1], p = d >> 13, v = d & 8191, S = (1 << n) - 1, y = r.p || new re(32768), T = r.h || new re(S + 1), F = Math.ceil(n / 3), B = 2 * F, A = function(ne) {
1689
+ for (var d = Xs[e - 1], p = d >> 13, v = d & 8191, S = (1 << n) - 1, y = r.p || new re(32768), T = r.h || new re(S + 1), F = Math.ceil(n / 3), B = 2 * F, A = function(ne) {
1686
1690
  return (t[ne] ^ t[ne + 1] << F ^ t[ne + 2] << B) & S;
1687
- }, k = new Ct(25e3), N = new re(288), O = new re(32), D = 0, I = 0, E = r.i || 0, P = 0, V = r.w || 0, j = 0; E + 2 < o; ++E) {
1691
+ }, k = new Ct(25e3), N = new re(288), O = new re(32), D = 0, I = 0, E = r.i || 0, P = 0, G = r.w || 0, j = 0; E + 2 < o; ++E) {
1688
1692
  var $ = A(E), C = E & 32767, M = T[$];
1689
- if (y[C] = M, T[$] = C, V <= E) {
1690
- var q = o - E;
1691
- if ((D > 7e3 || P > 24576) && (q > 423 || !h)) {
1693
+ if (y[C] = M, T[$] = C, G <= E) {
1694
+ var V = o - E;
1695
+ if ((D > 7e3 || P > 24576) && (V > 423 || !h)) {
1692
1696
  c = bn(t, a, 0, k, N, O, I, P, j, E - j, c), P = D = I = 0, j = E;
1693
1697
  for (var K = 0; K < 286; ++K)
1694
1698
  N[K] = 0;
@@ -1696,8 +1700,8 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1696
1700
  O[K] = 0;
1697
1701
  }
1698
1702
  var z = 2, b = 0, f = v, u = C - M & 32767;
1699
- if (q > 2 && $ == A(E - u))
1700
- for (var m = Math.min(p, q) - 1, g = Math.min(32767, E), w = Math.min(258, q); u <= g && --f && C != M; ) {
1703
+ if (V > 2 && $ == A(E - u))
1704
+ for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), w = Math.min(258, V); u <= g && --f && C != M; ) {
1701
1705
  if (t[E + z] == t[E + z - u]) {
1702
1706
  for (var x = 0; x < w && t[E + x] == t[E + x - u]; ++x)
1703
1707
  ;
@@ -1715,14 +1719,14 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1715
1719
  if (b) {
1716
1720
  k[P++] = 268435456 | bt[z] << 18 | gn[b];
1717
1721
  var ee = bt[z] & 31, ae = gn[b] & 31;
1718
- I += _t[ee] + Nt[ae], ++N[257 + ee], ++O[ae], V = E + z, ++D;
1722
+ I += _t[ee] + Nt[ae], ++N[257 + ee], ++O[ae], G = E + z, ++D;
1719
1723
  } else
1720
1724
  k[P++] = t[E], ++N[t[E]];
1721
1725
  }
1722
1726
  }
1723
- for (E = Math.max(E, V); E < o; ++E)
1727
+ for (E = Math.max(E, G); E < o; ++E)
1724
1728
  k[P++] = t[E], ++N[t[E]];
1725
- c = bn(t, a, h, k, N, O, I, P, j, E - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = T, r.p = y, r.i = E, r.w = V);
1729
+ c = bn(t, a, h, k, N, O, I, P, j, E - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = T, r.p = y, r.i = E, r.w = G);
1726
1730
  } else {
1727
1731
  for (var E = r.w || 0; E < o + h; E += 65535) {
1728
1732
  var te = E + 65535;
@@ -1798,7 +1802,7 @@ var Vs = /* @__PURE__ */ qe(Oe, 9, 0), Gs = /* @__PURE__ */ qe(nt, 5, 0), Rn = f
1798
1802
  var a = Bi({}, it[n].e);
1799
1803
  return Di(it[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, a, ji(a), s);
1800
1804
  }, zi = function() {
1801
- return [fe, re, Ct, _t, Nt, pn, bt, gn, Vs, Oe, Gs, nt, vt, Js, An, qe, ye, ze, ut, yt, mn, He, Fn, bn, Rn, Ks, Ys, Dn, Wi, ei];
1805
+ return [fe, re, Ct, _t, Nt, pn, bt, gn, Vs, Oe, Gs, nt, vt, Xs, An, qe, ye, ze, ut, yt, mn, He, Fn, bn, Rn, Ks, Ys, Dn, Wi, ei];
1802
1806
  }, Hi = function() {
1803
1807
  return [ti, ni, wt, Zs, Qs];
1804
1808
  }, ei = function(t) {
@@ -1827,7 +1831,7 @@ function Wi(t, e) {
1827
1831
  return Dn(t, e || {}, 0, 0);
1828
1832
  }
1829
1833
  function qi(t, e, n) {
1830
- return n || (n = e, e = {}), typeof n != "function" && Xs(7), $i(t, e, [
1834
+ return n || (n = e, e = {}), typeof n != "function" && Js(7), $i(t, e, [
1831
1835
  zi,
1832
1836
  Hi,
1833
1837
  function() {
@@ -1884,11 +1888,11 @@ class Ki {
1884
1888
  this.dict = new Zn();
1885
1889
  }
1886
1890
  }
1887
- class Xi {
1891
+ class Ji {
1888
1892
  constructor(e, n) {
1889
1893
  this.app = e, this.startParams = n, this.conditions = [], this.hasStarted = !1, this.createConditionFromFilter = (s) => {
1890
1894
  if (s.value.length) {
1891
- const i = Ji(s);
1895
+ const i = Xi(s);
1892
1896
  if (i.type)
1893
1897
  return i;
1894
1898
  }
@@ -2031,7 +2035,7 @@ const Be = {
2031
2035
  greaterOrEqual: (t, e) => t >= e,
2032
2036
  lessOrEqual: (t, e) => t <= e,
2033
2037
  lessThan: (t, e) => t < e
2034
- }, Ji = (t) => {
2038
+ }, Xi = (t) => {
2035
2039
  const e = {
2036
2040
  on: "is",
2037
2041
  notOn: "isNot",
@@ -2971,7 +2975,7 @@ const zr = {
2971
2975
  fontSize: "13px",
2972
2976
  height: "24px",
2973
2977
  width: "24px"
2974
- }, Xr = {
2978
+ }, Jr = {
2975
2979
  display: "flex",
2976
2980
  flexDirection: "column",
2977
2981
  alignItems: "center",
@@ -2995,7 +2999,7 @@ const zr = {
2995
2999
  alignSelf: "stretch"
2996
3000
  }, bs = {
2997
3001
  fontWeight: "bold"
2998
- }, Jr = {
3002
+ }, Xr = {
2999
3003
  fontSize: "13px",
3000
3004
  lineHeight: "auto"
3001
3005
  }, ui = {
@@ -3339,7 +3343,7 @@ class co {
3339
3343
  fontSize: "13px",
3340
3344
  fontWeight: "500",
3341
3345
  lineHeight: "auto"
3342
- }, "Tasks"), r = U("div", "icon", ds, "-"), o = U("div", "content", je), l = U("div", "pagination", Kr), a = U("div", "taskCard", ms), h = U("div", "taskText", bs), c = U("div", "taskDescription", Jr), d = U("div", "taskButtons", Qr), p = U("div", "taskText", bs);
3346
+ }, "Tasks"), r = U("div", "icon", ds, "-"), o = U("div", "content", je), l = U("div", "pagination", Kr), a = U("div", "taskCard", ms), h = U("div", "taskText", bs), c = U("div", "taskDescription", Xr), d = U("div", "taskButtons", Qr), p = U("div", "taskText", bs);
3343
3347
  p.textContent = "Your answer";
3344
3348
  const v = U("textarea", "taskDescription", {
3345
3349
  resize: "vertical"
@@ -3376,7 +3380,7 @@ class co {
3376
3380
  k && Object.assign(k.style, gs);
3377
3381
  for (let N = 0; N < this.currentTaskIndex; N++) {
3378
3382
  const O = document.getElementById(`or_task_${N}`);
3379
- O && Object.assign(O.style, Xr);
3383
+ O && Object.assign(O.style, Jr);
3380
3384
  }
3381
3385
  };
3382
3386
  return s.onclick = B, y.onclick = this.collapseWidget, T.onclick = () => {
@@ -4238,14 +4242,14 @@ let Io = class {
4238
4242
  let y = S;
4239
4243
  return this.pageFrames.forEach((T) => {
4240
4244
  if (T.dataset.domain === c.data.domain) {
4241
- const [F, B, A, k, N, O, D] = S, { left: I, top: E, width: P, height: V } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, $ = document.documentElement.scrollHeight, C = O / 100 * P + I, M = D / 100 * V + E, q = C / j, K = M / $;
4245
+ const [F, B, A, k, N, O, D] = S, { left: I, top: E, width: P, height: G } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, $ = document.documentElement.scrollHeight, C = O / 100 * P + I, M = D / 100 * G + E, V = C / j, K = M / $;
4242
4246
  y = [
4243
4247
  F,
4244
4248
  B,
4245
4249
  A,
4246
4250
  k,
4247
4251
  N,
4248
- Math.round(q * 1e3) / 10,
4252
+ Math.round(V * 1e3) / 10,
4249
4253
  Math.round(K * 1e3) / 10
4250
4254
  ];
4251
4255
  }
@@ -4515,7 +4519,7 @@ let Io = class {
4515
4519
  }
4516
4520
  async setupConditionalStart(e) {
4517
4521
  var p, v;
4518
- this.conditionsManager = new Xi(this, e);
4522
+ this.conditionsManager = new Ji(this, e);
4519
4523
  const n = await fetch(this.options.ingestPoint + "/v1/web/start", {
4520
4524
  method: "POST",
4521
4525
  headers: {
@@ -4757,8 +4761,8 @@ let Io = class {
4757
4761
  token: h,
4758
4762
  beaconSizeLimit: p
4759
4763
  }), !l && h === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(dt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, M]) => this.send(is(C, M))), this.localStorage.setItem(this.options.local_uuid_key, c), this.compressionThreshold = v;
4760
- const V = { sessionToken: h, userUUID: c, sessionID: y };
4761
- if (this.startCallbacks.forEach((C) => C(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, h), this.activityState = Q.Active, D && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new ho(this, {
4764
+ const G = { sessionToken: h, userUUID: c, sessionID: y };
4765
+ if (this.startCallbacks.forEach((C) => C(G)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, h), this.activityState = Q.Active, D && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new ho(this, {
4762
4766
  fps: E,
4763
4767
  quality: I,
4764
4768
  isDebug: this.options.canvas.__save_canvas_locally,
@@ -4783,7 +4787,7 @@ let Io = class {
4783
4787
  }
4784
4788
  return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, h, !!$).then((C) => {
4785
4789
  C && this.onUxtCb.forEach((M) => M(C));
4786
- })), To(V);
4790
+ })), To(G);
4787
4791
  } catch (a) {
4788
4792
  if (this.stop(), this.session.reset(), a === Ze)
4789
4793
  return this.signalError(Ze, []), _e(Ze);
@@ -5419,8 +5423,8 @@ function ot(t, e, n) {
5419
5423
  const l = (/* @__PURE__ */ new Date()).getTime() - vi.getTime();
5420
5424
  if (de.timeoutMs !== void 0 && l > de.timeoutMs)
5421
5425
  throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
5422
- let a = ct(Vo(r)) || ct(...Go(r)) || ct(...Ko(r)) || ct(Xo(r)) || [Ns()];
5423
- const h = Jo(r);
5426
+ let a = ct(Vo(r)) || ct(...Go(r)) || ct(...Ko(r)) || ct(Jo(r)) || [Ns()];
5427
+ const h = Xo(r);
5424
5428
  if (e == "all")
5425
5429
  h && (a = a.concat(a.filter(hn).map((c) => at(c, h))));
5426
5430
  else if (e == "two")
@@ -5488,7 +5492,7 @@ function Ko(t) {
5488
5492
  penalty: 1
5489
5493
  }));
5490
5494
  }
5491
- function Xo(t) {
5495
+ function Jo(t) {
5492
5496
  const e = t.tagName.toLowerCase();
5493
5497
  return de.tagName(e) ? {
5494
5498
  name: e,
@@ -5501,7 +5505,7 @@ function Ns() {
5501
5505
  penalty: 3
5502
5506
  };
5503
5507
  }
5504
- function Jo(t) {
5508
+ function Xo(t) {
5505
5509
  const e = t.parentNode;
5506
5510
  if (!e)
5507
5511
  return null;
@@ -5640,16 +5644,16 @@ function ta(t, e) {
5640
5644
  }), D(k, "mousemove", (I) => {
5641
5645
  const [E, P] = t.observer.getDocumentOffset(k);
5642
5646
  i = I.clientX + E, r = I.clientY + P, o = !0;
5643
- const V = Math.sign(I.movementX);
5644
- v += Math.abs(I.movementX) + Math.abs(I.movementY), V !== d && (d = V, p++);
5647
+ const G = Math.sign(I.movementX);
5648
+ v += Math.abs(I.movementX) + Math.abs(I.movementY), G !== d && (d = G, p++);
5645
5649
  }, !1), D(k, "click", (I) => {
5646
5650
  const E = Os(I.target, k);
5647
5651
  if (!I.clientX && !I.clientY || E === null)
5648
5652
  return;
5649
5653
  const P = t.nodes.getID(E);
5650
5654
  if (P !== void 0) {
5651
- const V = I.pageX, j = I.pageY, $ = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, M = Rs(V / $), q = Rs(j / C);
5652
- B(), t.send(Or(P, l === E ? Math.round(performance.now() - a) : 0, s(E), Nn(E) && !n ? O(P, E, e) : "", M, q), !0);
5655
+ const G = I.pageX, j = I.pageY, $ = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, M = Rs(G / $), V = Rs(j / C);
5656
+ B(), t.send(Or(P, l === E ? Math.round(performance.now() - a) : 0, s(E), Nn(E) && !n ? O(P, E, e) : "", M, V), !0);
5653
5657
  }
5654
5658
  l = null;
5655
5659
  });
@@ -6014,13 +6018,13 @@ function da(t, e, n, s, i) {
6014
6018
  function r(p) {
6015
6019
  t.debug.log("Openreplay: capturing axios response data", p);
6016
6020
  const { headers: v, data: S, method: y, url: T, baseURL: F } = p.config, { data: B, headers: A, status: k, response: N } = p, { data: O, headers: D, status: I } = N || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? (z) => E.includes(z) : () => E;
6017
- function V(z, b) {
6021
+ function G(z, b) {
6018
6022
  P(b[0]) || (z[b[0]] = b[1]);
6019
6023
  }
6020
6024
  let j = {}, $ = {};
6021
- v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach((z, b) => V(j, [b, z])) : Array.isArray(v) ? v.forEach((z) => V(j, z)) : typeof v == "object" && Object.entries(v).forEach((z) => V(j, z));
6025
+ v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach((z, b) => G(j, [b, z])) : Array.isArray(v) ? v.forEach((z) => G(j, z)) : typeof v == "object" && Object.entries(v).forEach((z) => G(j, z));
6022
6026
  const C = D || A;
6023
- C.toJSON ? $ = C.toJSON() : C instanceof Headers ? C.forEach((z, b) => V($, [b, z])) : Array.isArray(C) ? C.forEach((z) => V($, z)) : typeof C == "object" && Object.entries(C).forEach(([z, b]) => {
6027
+ C.toJSON ? $ = C.toJSON() : C instanceof Headers ? C.forEach((z, b) => G($, [b, z])) : Array.isArray(C) ? C.forEach((z) => G($, z)) : typeof C == "object" && Object.entries(C).forEach(([z, b]) => {
6024
6028
  P(z) || ($[z] = b);
6025
6029
  });
6026
6030
  const M = s({
@@ -6040,8 +6044,8 @@ function da(t, e, n, s, i) {
6040
6044
  t.debug.log("Openreplay: empty request/response info, skipping");
6041
6045
  return;
6042
6046
  }
6043
- const q = p.config.__openreplay_timing, K = performance.now() - q;
6044
- t.debug.log("Openreplay: final req object", M), t.send(xt("xhr", String(y), String(M.url), i(M.request), i(M.response), M.status, q + Ge(), K, 0));
6047
+ const V = p.config.__openreplay_timing, K = performance.now() - V;
6048
+ t.debug.log("Openreplay: final req object", M), t.send(xt("xhr", String(y), String(M.url), i(M.request), i(M.response), M.status, V + Ge(), K, 0));
6045
6049
  }
6046
6050
  function o(p) {
6047
6051
  if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), n.sessionTokenHeader) {
@@ -6505,13 +6509,13 @@ function Ea(t, e = {}) {
6505
6509
  return O;
6506
6510
  const I = O.clone();
6507
6511
  return I.text().then((E) => {
6508
- const P = {}, V = {};
6512
+ const P = {}, G = {};
6509
6513
  if (s !== !0) {
6510
- const C = ([M, q]) => {
6511
- i(M) || (P[M] = q);
6514
+ const C = ([M, V]) => {
6515
+ i(M) || (P[M] = V);
6512
6516
  };
6513
- k.headers instanceof Headers ? k.headers.forEach((M, q) => C([q, M])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((M, q) => {
6514
- i(q) || (V[q] = M);
6517
+ k.headers instanceof Headers ? k.headers.forEach((M, V) => C([V, M])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((M, V) => {
6518
+ i(V) || (G[V] = M);
6515
6519
  });
6516
6520
  }
6517
6521
  const j = Ds(k.method), $ = l({
@@ -6524,7 +6528,7 @@ function Ea(t, e = {}) {
6524
6528
  body: k.body || null
6525
6529
  },
6526
6530
  response: {
6527
- headers: V,
6531
+ headers: G,
6528
6532
  body: E
6529
6533
  }
6530
6534
  });
@@ -6542,8 +6546,8 @@ function Ea(t, e = {}) {
6542
6546
  O = D.timeStamp;
6543
6547
  }), N.addEventListener("load", t.safe((D) => {
6544
6548
  const { headers: I, body: E } = dn(N), P = O > 0 ? D.timeStamp - O : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), $ = {};
6545
- j.forEach(function(q) {
6546
- const K = q.split(": "), z = K.shift();
6549
+ j.forEach(function(V) {
6550
+ const K = V.split(": "), z = K.shift();
6547
6551
  i(z) || ($[z] = K.join(": "));
6548
6552
  });
6549
6553
  const C = Ds(A), M = l({
@@ -7161,7 +7165,7 @@ const Oa = `
7161
7165
  `, Ti = document.createElement("style");
7162
7166
  Ti.textContent = Oa;
7163
7167
  document.head.appendChild(Ti);
7164
- const Ra = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely"], Fa = "bMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
7168
+ const Ra = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely", "test"], Fa = "HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";
7165
7169
  class Ft {
7166
7170
  constructor(e) {
7167
7171
  var n;
@@ -7203,6 +7207,24 @@ class Ft {
7203
7207
  throw console.error("Fetching wine recommendations failed:", n.message), new Error(`Error in getWineRecommendations: ${n.message}`);
7204
7208
  }
7205
7209
  }
7210
+ async getWineRecommendationsSearch(e) {
7211
+ console.log(window.location.href);
7212
+ try {
7213
+ const n = await fetch(`${this.baseURL}dish/recommendations/search`, {
7214
+ method: "POST",
7215
+ headers: {
7216
+ "Content-Type": "application/json",
7217
+ Authorization: `Bearer ${this.token}`
7218
+ },
7219
+ body: JSON.stringify({ text: e, store: this.store ? this.store.toString().charAt(0).toUpperCase() + this.store.slice(1) : void 0 })
7220
+ }), s = await n.json();
7221
+ if (!n.ok)
7222
+ throw new Error(`API call failed with status ${n.status}: ${s.message || "No additional error information"}`);
7223
+ return s;
7224
+ } catch (n) {
7225
+ throw console.error("Fetching wine recommendations failed:", n.message), new Error(`Error in getWineRecommendations: ${n.message}`);
7226
+ }
7227
+ }
7206
7228
  async getPossibleDishesWithMeta(e, n) {
7207
7229
  try {
7208
7230
  const s = await fetch(`${this.baseURL}dish/possible_dishes`, {
@@ -7397,7 +7419,7 @@ class Aa {
7397
7419
  return this.translations[this.language][e] || e;
7398
7420
  }
7399
7421
  }
7400
- const G = new Aa();
7422
+ const q = new Aa();
7401
7423
  class Da {
7402
7424
  constructor() {
7403
7425
  this.api = new Ft(), this.selectedFilters = {
@@ -7411,49 +7433,54 @@ class Da {
7411
7433
  <div id="wine-widget-container">
7412
7434
  <div id="wine-widget-left">
7413
7435
  <div id="wine-widget-header">
7414
- <h1>${G.translate("widgetTitle")}</h1>
7415
- <p>${G.translate("widgetSubtitle")}</p>
7436
+ <h1>${q.translate("widgetTitle")}</h1>
7437
+ <p>${q.translate("widgetSubtitle")}</p>
7416
7438
  </div>
7417
7439
  <div id="wine-widget-search">
7418
- <input type="text" id="wine-search-input" placeholder="${G.translate("searchPlaceholder")}">
7419
- <button id="wine-search-button">${G.translate("searchButton")}</button>
7440
+ <input type="text" id="wine-search-input" placeholder="${q.translate("searchPlaceholder")}">
7441
+ <button id="wine-search-button">${q.translate("searchButton")}</button>
7420
7442
  </div>
7421
7443
  <div id="wine-widget-filters">
7422
7444
  <div class="filter-group">
7423
- <span class="filter-label">${G.translate("priceRange")}:</span>
7445
+ <span class="filter-label">${q.translate("priceRange")}:</span>
7424
7446
  <div class="filter-buttons" id="price-buttons">
7425
- <button data-value="<10"><$10</button>
7426
- <button data-value="10-20">$10-$20</button>
7427
- <button data-value=">20">>$20</button>
7447
+ <button data-value="< 500">< $500</button>
7448
+ <button data-value="500 - 1000">$500 - $1000</button>
7449
+ <button data-value="> 1000">> $1000</button>
7450
+ <button data-value=" " class="selected">Any</button>
7428
7451
  </div>
7429
7452
  </div>
7430
7453
  <div class="filter-group">
7431
- <span class="filter-label">${G.translate("wineColor")}:</span>
7454
+ <span class="filter-label">${q.translate("wineColor")}:</span>
7432
7455
  <div class="filter-buttons" id="color-buttons">
7433
- <button data-value="red">${G.translate("red")}</button>
7434
- <button data-value="white">${G.translate("white")}</button>
7435
- <button data-value="rose">${G.translate("rose")}</button>
7456
+ <button data-value="red">${q.translate("red")}</button>
7457
+ <button data-value="white">${q.translate("white")}</button>
7458
+ <button data-value="rose">${q.translate("rose")}</button>
7459
+ <button data-value=" " class="selected">${q.translate("Any")}</button>
7436
7460
  </div>
7437
7461
  </div>
7438
7462
  <div class="filter-group">
7439
- <span class="filter-label">${G.translate("intensity")}:</span>
7463
+ <span class="filter-label">${q.translate("intensity")}:</span>
7440
7464
  <div class="filter-buttons" id="intensity-buttons">
7441
- <button data-value="light">${G.translate("light")}</button>
7442
- <button data-value="medium">${G.translate("medium")}</button>
7443
- <button data-value="full">${G.translate("full")}</button>
7465
+ <button data-value="light">${q.translate("light")}</button>
7466
+ <button data-value="medium">${q.translate("medium")}</button>
7467
+ <button data-value="full">${q.translate("full")}</button>
7468
+ <button data-value=" " class="selected">${q.translate("Any")}</button>
7444
7469
  </div>
7445
7470
  </div>
7446
7471
  </div>
7447
7472
  <div id="powered-by-widget">
7448
7473
  <a href="https://wineater.com" target="_blank">
7449
- <span>${G.translate("poweredBy")}</span>
7450
- <img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/logo.svg" alt="Wineater Logo">
7474
+ <span>${q.translate("poweredBy")}</span>
7475
+ <img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo.svg" alt="Wineater Logo">
7451
7476
  </a>
7452
7477
  </div>
7453
7478
  </div>
7454
7479
  <div id="wine-widget-right">
7455
7480
  <div id="loading-indicator" class="hidden">
7456
- <img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/mascot.jpeg" alt="Loading" />
7481
+ <div id="typing-indicator" class="typing-indicator">
7482
+ <span></span><span></span><span></span>
7483
+ </div>
7457
7484
  </div>
7458
7485
  <div id="wine-placeholder"></div>
7459
7486
  </div>
@@ -7470,20 +7497,20 @@ class Da {
7470
7497
  const s = document.querySelectorAll(`#${e} button`);
7471
7498
  s.forEach((i) => {
7472
7499
  i.addEventListener("click", (r) => {
7473
- s.forEach((o) => o.classList.remove("selected")), r.target.classList.add("selected"), this.selectedFilters[n] = r.target.dataset.value;
7500
+ s.forEach((o) => o.classList.remove("selected")), r.target.classList.add("selected"), this.selectedFilters[n] = r.target.dataset.value, this.handleSearch();
7474
7501
  });
7475
7502
  });
7476
7503
  }
7477
7504
  async handleSearch() {
7478
- const e = document.getElementById("wine-search-input").value;
7479
- this.animateCardDisappearance();
7480
- const n = this.selectedFilters;
7481
- console.log("Searching for:", e), console.log("Applied filters:", n);
7505
+ const e = "wine for dish:" + document.getElementById("wine-search-input").value.trim() + ";", n = this.selectedFilters, s = [];
7506
+ n.price && s.push(`price: ${n.price || "any"};`), n.color && s.push(`color: ${n.color || "any"}; `), n.intensity && s.push(`intensity: ${n.intensity || "any"}; `);
7507
+ const i = s.length > 0 ? `${e} ${s.join(", ")}` : e;
7508
+ console.log("Searching for:", i), console.log("Applied filters:", n), this.animateCardDisappearance();
7482
7509
  try {
7483
- const s = await this.api.getWineRecommendations(e);
7484
- s && s.length > 0 ? (console.log("Recommendations:", s), this.displayResults(s, !0)) : (console.log("No recommendations found."), this.displayNoResultsMessage());
7485
- } catch (s) {
7486
- console.error("Error fetching wine recommendations:", s.message), this.displayErrorMessage();
7510
+ const r = await this.api.getWineRecommendationsSearch(i);
7511
+ r && r.length > 0 ? (console.log("Recommendations:", r), this.displayResults(r, !0)) : (console.log("No recommendations found."), this.displayNoResultsMessage());
7512
+ } catch (r) {
7513
+ console.error("Error fetching wine recommendations:", r.message), this.displayErrorMessage();
7487
7514
  }
7488
7515
  }
7489
7516
  displayResults(e, n = !1) {
@@ -7529,7 +7556,7 @@ class Da {
7529
7556
  const e = document.getElementById("wine-placeholder");
7530
7557
  e.innerHTML = `
7531
7558
  <div class="no-results">
7532
- <p>${G.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7559
+ <p>${q.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7533
7560
  </div>
7534
7561
  `;
7535
7562
  }
@@ -7537,12 +7564,12 @@ class Da {
7537
7564
  const e = document.getElementById("wine-placeholder");
7538
7565
  e.innerHTML = `
7539
7566
  <div class="error-message">
7540
- <p>${G.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7567
+ <p>${q.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7541
7568
  </div>
7542
7569
  `;
7543
7570
  }
7544
7571
  async loadInstantRecommendations() {
7545
- console.log("привет");
7572
+ this.showLoadingIndicator();
7546
7573
  try {
7547
7574
  const e = await this.api.getInstantRecommendations();
7548
7575
  this.displayResults(e);
@@ -7555,7 +7582,7 @@ class Ma {
7555
7582
  constructor() {
7556
7583
  var n;
7557
7584
  this.api = new Ft();
7558
- const e = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.FIRST_MESSAGE_TEXT) || G.translate("welcomeMessage");
7585
+ const e = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.FIRST_MESSAGE_TEXT) || q.translate("welcomeMessage");
7559
7586
  this.displayFirstMessage(e);
7560
7587
  }
7561
7588
  initialize() {
@@ -7576,7 +7603,7 @@ class Ma {
7576
7603
  const s = await this.api.getWineRecommendations(n);
7577
7604
  this.hideTypingIndicator(), s && s.length ? this.displayResults(s) : this.displayMessage("No results found.", "api");
7578
7605
  } catch {
7579
- this.hideTypingIndicator(), this.displayMessage(G.translate("somethingWentWrong"), "api");
7606
+ this.hideTypingIndicator(), this.displayMessage(q.translate("somethingWentWrong"), "api");
7580
7607
  }
7581
7608
  }
7582
7609
  }
@@ -7606,10 +7633,10 @@ class Ma {
7606
7633
  const l = document.createElement("div");
7607
7634
  l.innerHTML = `
7608
7635
  <strong>${s.Title}</strong><br>
7609
- ${G.translate("price")}: ${s.Price}<br>
7610
- ${G.translate("region")}: ${s.Region}<br>
7611
- ${G.translate("type")}: ${s.Type}<br>
7612
- <a href="${s.Url}" target="_blank">${G.translate("moreInfo")}</a>
7636
+ ${q.translate("price")}: ${s.Price}<br>
7637
+ ${q.translate("region")}: ${s.Region}<br>
7638
+ ${q.translate("type")}: ${s.Type}<br>
7639
+ <a href="${s.Url}" target="_blank">${q.translate("moreInfo")}</a>
7613
7640
  `, l.querySelector("a").addEventListener("click", (c) => {
7614
7641
  c.preventDefault(), this.sendAnalytics(s.Title), window.open(s.Url, "_blank");
7615
7642
  }), r.appendChild(l);
@@ -7674,18 +7701,18 @@ async function Ha() {
7674
7701
  }
7675
7702
  return !1;
7676
7703
  }
7677
- const $a = "tbMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
7704
+ const $a = "HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";
7678
7705
  class Wa {
7679
7706
  constructor() {
7680
7707
  var e, n;
7681
- this.stores = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely"], this.tracker = new Na({ projectKey: "PA8j9fAi49i6g2QnvpNs", __DISABLE_SECURE_MODE: !0 }), this.position = ((e = window == null ? void 0 : window.wineaterData) == null ? void 0 : e.POSITION) || "right-center", this.type = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.TYPE) || "chatbot", this.store = this.detectStore();
7708
+ this.stores = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely", "test"], this.tracker = new Na({ projectKey: "PA8j9fAi49i6g2QnvpNs", __DISABLE_SECURE_MODE: !0 }), this.position = ((e = window == null ? void 0 : window.wineaterData) == null ? void 0 : e.POSITION) || "right-center", this.type = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.TYPE) || "chatbot", this.store = this.detectStore();
7682
7709
  }
7683
7710
  detectStore() {
7684
7711
  return this.stores.find((e) => window.location.href.includes(e)) || null;
7685
7712
  }
7686
7713
  async initFlagsmith() {
7687
7714
  try {
7688
- await Xn.init({
7715
+ await Jn.init({
7689
7716
  environmentID: "5RfiDoiqb4dHrNdQvzbkfM",
7690
7717
  cacheFlags: !1,
7691
7718
  enableAnalytics: !0,
@@ -7696,8 +7723,8 @@ class Wa {
7696
7723
  }
7697
7724
  }
7698
7725
  async initTranslator() {
7699
- const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Climats";
7700
- await G.fetchConfig(e || "Climats");
7726
+ const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Test";
7727
+ await q.fetchConfig(e || "Test");
7701
7728
  }
7702
7729
  initCookies() {
7703
7730
  var e;
@@ -7708,16 +7735,16 @@ class Wa {
7708
7735
  }
7709
7736
  createChatbotUI() {
7710
7737
  var i;
7711
- const e = Xn.getValue("chat-btn-txt"), s = `
7738
+ const e = Jn.getValue("chat-btn-txt"), s = `
7712
7739
  <div id="chatbot-container">
7713
7740
  <div id="chat-icon">
7714
- <img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/chat-icon.svg" alt="Chat Icon">
7715
- <span>${((i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.BUTTON_TEXT) || G.translate(`chatButton${e}`)}</span>
7741
+ <img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/chat-icon.svg" alt="Chat Icon">
7742
+ <span>${((i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.BUTTON_TEXT) || q.translate(`chatButton${e}`)}</span>
7716
7743
  </div>
7717
7744
  <div id="chat-window" class="hidden">
7718
7745
  <div id="chat-header">
7719
7746
  <div id="chat-title">
7720
- <h1>${G.translate("chatTitle")}</h1>
7747
+ <h1>${q.translate("chatTitle")}</h1>
7721
7748
  </div>
7722
7749
  <div id="close-btn">&times;</div>
7723
7750
  </div>
@@ -7726,13 +7753,13 @@ class Wa {
7726
7753
  <span></span><span></span><span></span>
7727
7754
  </div>
7728
7755
  <div id="input-container">
7729
- <input type="text" id="user-input" placeholder="${G.translate("inputPlaceholder")}">
7730
- <button id="send-button">${G.translate("sendButton")}</button>
7756
+ <input type="text" id="user-input" placeholder="${q.translate("inputPlaceholder")}">
7757
+ <button id="send-button">${q.translate("sendButton")}</button>
7731
7758
  </div>
7732
7759
  <div id="powered-by">
7733
7760
  <a href="https://wineater.com" target="_blank">
7734
- <span>${G.translate("poweredBy")}</span>
7735
- <img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/logo.svg" alt="Wineater Logo" id="chatbot-logo">
7761
+ <span>${q.translate("poweredBy")}</span>
7762
+ <img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo.svg" alt="Wineater Logo" id="chatbot-logo">
7736
7763
  </a>
7737
7764
  </div>
7738
7765
  </div>