wineater-bot 3.6.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.
- package/dist/wineater-chatbot.mjs +219 -219
- package/dist/wineater-chatbot.umd.js +18 -18
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/js/i18n.js +3 -2
- package/src/js/widget.js +53 -48
|
@@ -30,7 +30,7 @@ function mi() {
|
|
|
30
30
|
return e || (e = pi(), Rs(t, e, 365)), e;
|
|
31
31
|
}
|
|
32
32
|
var $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
33
|
-
function
|
|
33
|
+
function bi(t) {
|
|
34
34
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
35
35
|
}
|
|
36
36
|
var $n = { exports: {} };
|
|
@@ -229,7 +229,7 @@ var $n = { exports: {} };
|
|
|
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,
|
|
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,
|
|
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);
|
|
@@ -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(
|
|
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 && (
|
|
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;
|
|
@@ -396,9 +396,9 @@ 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 =
|
|
400
|
-
return function(me,
|
|
401
|
-
var Te =
|
|
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
|
+
return function(me, be) {
|
|
401
|
+
var Te = be.headers, Y = be.method, Fe = be.body;
|
|
402
402
|
return new Promise(function(Oe) {
|
|
403
403
|
switch (Y) {
|
|
404
404
|
case "GET":
|
|
@@ -417,36 +417,36 @@ var $n = { exports: {} };
|
|
|
417
417
|
}
|
|
418
418
|
});
|
|
419
419
|
};
|
|
420
|
-
}(_t)),
|
|
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),
|
|
427
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), _ && this.canUseStorage && _.getItem(R, function(le, me) {
|
|
428
428
|
if (me && ie.evaluationContext.environment) {
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
429
|
+
var be = JSON.parse(me);
|
|
430
|
+
if (be[ie.evaluationContext.environment.apiKey]) {
|
|
431
431
|
var Te = ie.getState();
|
|
432
|
-
ie.log("Retrieved events from cache", me), ie.setState(i(i({}, Te), { evaluationEvent:
|
|
432
|
+
ie.log("Retrieved events from cache", me), ie.setState(i(i({}, Te), { evaluationEvent: be[ie.evaluationContext.environment.apiKey] }));
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
})), !W)
|
|
436
436
|
return [3, 9];
|
|
437
|
-
if (!
|
|
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() {
|
|
441
|
-
var
|
|
441
|
+
var be, Te, Y, Fe, Oe, xe, Rt, Hn, Dt, At, Lt, Mt, Ft, Pt, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Vt, Gt;
|
|
442
442
|
return o(this, function(Ee) {
|
|
443
443
|
switch (Ee.label) {
|
|
444
444
|
case 0:
|
|
445
445
|
if (!me)
|
|
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),
|
|
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]),
|
|
480
|
+
return fe.trys.push([2, 7, , 8]), _.getItemSync ? (Ot = _.getItemSync(M), [3, 5]) : [3, 3];
|
|
481
481
|
case 3:
|
|
482
|
-
return [4,
|
|
482
|
+
return [4, _.getItem(M)];
|
|
483
483
|
case 4:
|
|
484
484
|
Ot = fe.sent(), fe.label = 5;
|
|
485
485
|
case 5:
|
|
@@ -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),
|
|
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
|
-
|
|
543
|
+
_.setItem(R, f);
|
|
544
544
|
}
|
|
545
545
|
}, y.prototype.setLoadingState = function(f) {
|
|
546
546
|
var h;
|
|
@@ -730,7 +730,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
730
730
|
}, n.default = $, Object.defineProperty(n, "__esModule", { value: !0 });
|
|
731
731
|
});
|
|
732
732
|
})($n, $n.exports);
|
|
733
|
-
var qn = {},
|
|
733
|
+
var qn = {}, vi = function(t, e, n, s, i) {
|
|
734
734
|
var r = new Worker(qn[e] || (qn[e] = URL.createObjectURL(new Blob([
|
|
735
735
|
t + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
|
|
736
736
|
], { type: "text/javascript" }))));
|
|
@@ -880,7 +880,7 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
880
880
|
if (s.code = t, Error.captureStackTrace && Error.captureStackTrace(s, Ps), !n)
|
|
881
881
|
throw s;
|
|
882
882
|
return s;
|
|
883
|
-
},
|
|
883
|
+
}, ve = function(t, e, n) {
|
|
884
884
|
n <<= e & 7;
|
|
885
885
|
var s = e / 8 | 0;
|
|
886
886
|
t[s] |= n, t[s + 1] |= n >> 8;
|
|
@@ -898,8 +898,8 @@ 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(
|
|
902
|
-
return
|
|
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; )
|
|
@@ -908,19 +908,19 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
908
908
|
r[s].s > p && (p = r[s].s);
|
|
909
909
|
var v = new re(p + 1), w = pt(n[a - 1], v, 0);
|
|
910
910
|
if (w > e) {
|
|
911
|
-
var s = 0, b = 0, T = w - e,
|
|
912
|
-
for (r.sort(function(
|
|
913
|
-
return v[L.s] - v[
|
|
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
916
|
if (v[M] > e)
|
|
917
|
-
b +=
|
|
917
|
+
b += _ - (1 << w - v[M]), v[M] = e;
|
|
918
918
|
else
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
921
|
for (b >>= T; b > 0; ) {
|
|
922
|
-
var
|
|
923
|
-
v[
|
|
922
|
+
var R = r[s].s;
|
|
923
|
+
v[R] < e ? b -= 1 << e - v[R]++ - 1 : ++s;
|
|
924
924
|
}
|
|
925
925
|
for (; s >= 0 && b; --s) {
|
|
926
926
|
var k = r[s].s;
|
|
@@ -965,28 +965,28 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
965
965
|
t[i + r + 4] = n[r];
|
|
966
966
|
return (i + 4 + s) * 8;
|
|
967
967
|
}, un = function(t, e, n, s, i, r, o, l, c, u, a) {
|
|
968
|
-
|
|
969
|
-
for (var d = ct(i, 15), p = d.t, v = d.l, w = ct(r, 15), b = w.t, T = w.l,
|
|
968
|
+
ve(e, a++, n), ++i[256];
|
|
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 <
|
|
972
|
-
++L[
|
|
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
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
|
-
if (
|
|
979
|
+
if (ve(e, a, 1 + (F < C)), a += 2, F < C) {
|
|
980
980
|
V = qe(p, v, 0), K = p, $ = qe(b, T, 0), y = b;
|
|
981
981
|
var f = qe(P, U, 0);
|
|
982
|
-
|
|
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,
|
|
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);
|
|
990
990
|
}
|
|
991
991
|
} else
|
|
992
992
|
V = Ls, K = Ne, $ = Ms, y = tt;
|
|
@@ -994,7 +994,7 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
994
994
|
var x = s[I];
|
|
995
995
|
if (x > 255) {
|
|
996
996
|
var S = x >> 18 & 31;
|
|
997
|
-
ze(e, a, V[S + 257]), a += K[S + 257], S > 7 && (
|
|
997
|
+
ze(e, a, V[S + 257]), a += K[S + 257], S > 7 && (ve(e, a, x >> 23 & 31), a += kt[S]);
|
|
998
998
|
var A = x & 31;
|
|
999
999
|
ze(e, a, $[A]), a += y[A], A > 3 && (ze(e, a, x >> 5 & 8191), a += Tt[A]);
|
|
1000
1000
|
} else
|
|
@@ -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, v = d & 8191, w = (1 << n) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1),
|
|
1009
|
-
return (t[ne] ^ t[ne + 1] <<
|
|
1010
|
-
}, k = new xt(25e3),
|
|
1011
|
-
var z =
|
|
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
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,
|
|
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
|
-
|
|
1017
|
+
N[K] = 0;
|
|
1018
1018
|
for (var K = 0; K < 30; ++K)
|
|
1019
|
-
|
|
1019
|
+
D[K] = 0;
|
|
1020
1020
|
}
|
|
1021
1021
|
var $ = 2, y = 0, f = v, h = C - F & 32767;
|
|
1022
|
-
if (V > 2 && z ==
|
|
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)
|
|
@@ -1038,14 +1038,14 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
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], ++
|
|
1041
|
+
I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++L;
|
|
1042
1042
|
} else
|
|
1043
|
-
k[P++] = 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], ++
|
|
1048
|
-
a = un(t, c, u, k,
|
|
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;
|
|
@@ -1119,9 +1119,9 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
1119
1119
|
nt[n] = { c: Wn(t[o], i, r), e: r };
|
|
1120
1120
|
}
|
|
1121
1121
|
var c = xi({}, nt[n].e);
|
|
1122
|
-
return
|
|
1122
|
+
return vi(nt[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, c, ki(c), s);
|
|
1123
1123
|
}, Ei = function() {
|
|
1124
|
-
return [de, re, xt, kt, Tt, an, dt, cn, Ls, Ne, Ms, tt, ft, Bs, In, qe,
|
|
1124
|
+
return [de, re, xt, kt, Tt, an, dt, cn, Ls, Ne, Ms, tt, ft, Bs, In, qe, ve, ze, ct, pt, ln, Ue, En, un, Tn, Fs, js, Cn, _i, Hs];
|
|
1125
1125
|
}, Ii = function() {
|
|
1126
1126
|
return [$s, qs, gt, Us, zs];
|
|
1127
1127
|
}, Hs = function(t) {
|
|
@@ -1948,7 +1948,7 @@ function pn(t, e, n, s) {
|
|
|
1948
1948
|
s
|
|
1949
1949
|
];
|
|
1950
1950
|
}
|
|
1951
|
-
function
|
|
1951
|
+
function bt(t, e, n, s, i, r, o, l, c) {
|
|
1952
1952
|
return [
|
|
1953
1953
|
83,
|
|
1954
1954
|
t,
|
|
@@ -1973,7 +1973,7 @@ function mr(t, e, n, s, i, r) {
|
|
|
1973
1973
|
r
|
|
1974
1974
|
];
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1976
|
+
function br(t, e, n, s, i, r) {
|
|
1977
1977
|
return [
|
|
1978
1978
|
112,
|
|
1979
1979
|
t,
|
|
@@ -1992,7 +1992,7 @@ function ss(t, e, n) {
|
|
|
1992
1992
|
n
|
|
1993
1993
|
];
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function vr(t) {
|
|
1996
1996
|
return [
|
|
1997
1997
|
114,
|
|
1998
1998
|
t
|
|
@@ -2493,7 +2493,7 @@ function H(t, e, n, s, i) {
|
|
|
2493
2493
|
const r = document.createElement(t);
|
|
2494
2494
|
return r.className = e, Object.assign(r.style, n), s && (r.textContent = s), i && (r.id = i), r;
|
|
2495
2495
|
}
|
|
2496
|
-
const ut = "or_uxt_test_start", mn = "or_uxt_task_index",
|
|
2496
|
+
const ut = "or_uxt_test_start", mn = "or_uxt_task_index", bn = "or_uxt_session_id", qr = "or_uxt_test_id";
|
|
2497
2497
|
class Wr {
|
|
2498
2498
|
constructor(e, n, s, i, r, o, l, c, u) {
|
|
2499
2499
|
this.ingestPoint = e, this.getTimestamp = n, this.token = s, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = c, this.getSessionId = u, this.durations = {
|
|
@@ -2504,7 +2504,7 @@ class Wr {
|
|
|
2504
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((
|
|
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: {
|
|
@@ -2524,7 +2524,7 @@ class Wr {
|
|
|
2524
2524
|
const p = this.getTimestamp();
|
|
2525
2525
|
if (d === "begin" && this.testId) {
|
|
2526
2526
|
const b = this.getSessionId();
|
|
2527
|
-
this.setStorageKey(
|
|
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
2530
|
const v = this.durations.testStart || p, w = p - v;
|
|
@@ -2562,8 +2562,8 @@ class Vr {
|
|
|
2562
2562
|
});
|
|
2563
2563
|
}, this.hideTaskSection = () => !1, this.showTaskSection = () => !0, this.collapseWidget = () => !1, this.removeGreeting = () => !1, this.toggleDescriptionVisibility = () => {
|
|
2564
2564
|
}, this.currentTaskIndex = 0, this.userRecorder = new Br(e);
|
|
2565
|
-
const s = this.app.getSessionID(), i = this.app.localStorage.getItem(
|
|
2566
|
-
s !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(
|
|
2565
|
+
const s = this.app.getSessionID(), i = this.app.localStorage.getItem(bn);
|
|
2566
|
+
s !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(bn), this.app.localStorage.removeItem(qr), this.app.localStorage.removeItem(mn), this.app.localStorage.removeItem(ut));
|
|
2567
2567
|
const r = this.app.localStorage.getItem(mn);
|
|
2568
2568
|
r && (this.currentTaskIndex = parseInt(r, 10));
|
|
2569
2569
|
}
|
|
@@ -2670,12 +2670,12 @@ class Vr {
|
|
|
2670
2670
|
w.append(p, v);
|
|
2671
2671
|
const b = H("div", "closePanelButton", Zs, "Collapse Panel"), T = H("div", "nextButton", Mr, "Done, Next");
|
|
2672
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
|
|
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
|
|
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
|
-
}, (
|
|
2689
|
-
|
|
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
|
|
2697
|
+
const R = () => {
|
|
2698
2698
|
const k = document.getElementById(`or_task_${this.currentTaskIndex}`);
|
|
2699
2699
|
k && Object.assign(k.style, ls);
|
|
2700
|
-
for (let
|
|
2701
|
-
const
|
|
2702
|
-
|
|
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
2705
|
return s.onclick = M, b.onclick = this.collapseWidget, T.onclick = () => {
|
|
2706
|
-
var
|
|
2706
|
+
var N, D, L, I;
|
|
2707
2707
|
const k = e[this.currentTaskIndex].allow_typing ? v.value : void 0;
|
|
2708
|
-
if (v.value = "", (
|
|
2709
|
-
this.currentTaskIndex++,
|
|
2710
|
-
const E = (
|
|
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"),
|
|
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),
|
|
2720
|
+
k && Object.assign(k.style, ls), _(), R();
|
|
2721
2721
|
}, 1), n;
|
|
2722
2722
|
}
|
|
2723
2723
|
showEndSection() {
|
|
@@ -2742,7 +2742,7 @@ We appreciate your time and valuable input.`), r = H("div", "end_button_or", as,
|
|
|
2742
2742
|
function ei(t) {
|
|
2743
2743
|
return !!t && t.nodeType != null;
|
|
2744
2744
|
}
|
|
2745
|
-
function
|
|
2745
|
+
function vn(t) {
|
|
2746
2746
|
return t.namespaceURI === "http://www.w3.org/2000/svg";
|
|
2747
2747
|
}
|
|
2748
2748
|
function ke(t) {
|
|
@@ -2754,7 +2754,7 @@ function Gr(t) {
|
|
|
2754
2754
|
function yn(t) {
|
|
2755
2755
|
return t.nodeType === Node.TEXT_NODE;
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2757
|
+
function vt(t) {
|
|
2758
2758
|
return t.nodeType === Node.DOCUMENT_NODE;
|
|
2759
2759
|
}
|
|
2760
2760
|
function Et(t) {
|
|
@@ -2989,7 +2989,7 @@ class Rn {
|
|
|
2989
2989
|
this.commited.length = 0, this.recents.clear(), this.indexes.length = 1, this.attributesMap.clear(), this.textSet.clear();
|
|
2990
2990
|
}
|
|
2991
2991
|
sendNodeAttribute(e, n, s, i) {
|
|
2992
|
-
if (
|
|
2992
|
+
if (vn(n)) {
|
|
2993
2993
|
s.substr(0, 6) === "xlink:" && (s = s.substr(6)), i === null ? this.app.send(Yn(e, s)) : s === "href" ? (i.length > 1e5 && (i = ""), this.app.send(hn(e, s, i, this.app.getBaseHref()))) : this.app.attributeSender.sendSetAttribute(e, s, i);
|
|
2994
2994
|
return;
|
|
2995
2995
|
}
|
|
@@ -3090,7 +3090,7 @@ class Rn {
|
|
|
3090
3090
|
const d = a.clientWidth, p = a.clientHeight;
|
|
3091
3091
|
a = n.cloneNode(), a.style.width = `${d}px`, a.style.height = `${p}px`;
|
|
3092
3092
|
}
|
|
3093
|
-
this.app.send(Gi(e, i, c, a.tagName,
|
|
3093
|
+
this.app.send(Gi(e, i, c, a.tagName, vn(n)));
|
|
3094
3094
|
}
|
|
3095
3095
|
for (let d = 0; d < a.attributes.length; d++) {
|
|
3096
3096
|
const p = a.attributes[d];
|
|
@@ -3528,17 +3528,17 @@ let lo = class {
|
|
|
3528
3528
|
const T = this.checkNodeId(v, p);
|
|
3529
3529
|
if (T) {
|
|
3530
3530
|
this.waitStarted().then(() => {
|
|
3531
|
-
var
|
|
3531
|
+
var R;
|
|
3532
3532
|
c++;
|
|
3533
|
-
const
|
|
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:
|
|
3538
|
+
token: _,
|
|
3539
3539
|
frameOrderNumber: c
|
|
3540
3540
|
};
|
|
3541
|
-
this.debug.log("iframe_data", M), (
|
|
3541
|
+
this.debug.log("iframe_data", M), (R = a.source) == null || R.postMessage(M, "*");
|
|
3542
3542
|
}).catch(console.error), b = 10;
|
|
3543
3543
|
break;
|
|
3544
3544
|
}
|
|
@@ -3552,8 +3552,8 @@ let lo = class {
|
|
|
3552
3552
|
let b = w;
|
|
3553
3553
|
return this.pageFrames.forEach((T) => {
|
|
3554
3554
|
if (T.dataset.domain === a.data.domain) {
|
|
3555
|
-
const [
|
|
3556
|
-
b = [
|
|
3555
|
+
const [_, M, R] = w, { left: k, top: N } = T.getBoundingClientRect();
|
|
3556
|
+
b = [_, M + k, R + N];
|
|
3557
3557
|
}
|
|
3558
3558
|
}), b;
|
|
3559
3559
|
}
|
|
@@ -3561,13 +3561,13 @@ let lo = class {
|
|
|
3561
3561
|
let b = w;
|
|
3562
3562
|
return this.pageFrames.forEach((T) => {
|
|
3563
3563
|
if (T.dataset.domain === a.data.domain) {
|
|
3564
|
-
const [
|
|
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
3565
|
b = [
|
|
3566
|
-
|
|
3566
|
+
_,
|
|
3567
3567
|
M,
|
|
3568
|
-
|
|
3568
|
+
R,
|
|
3569
3569
|
k,
|
|
3570
|
-
|
|
3570
|
+
N,
|
|
3571
3571
|
Math.round(V * 1e3) / 10,
|
|
3572
3572
|
Math.round(K * 1e3) / 10
|
|
3573
3573
|
];
|
|
@@ -4049,12 +4049,12 @@ let lo = class {
|
|
|
4049
4049
|
// derived from token
|
|
4050
4050
|
startTimestamp: T,
|
|
4051
4051
|
// real startTS (server time), derived from sessionID
|
|
4052
|
-
userBrowser:
|
|
4052
|
+
userBrowser: _,
|
|
4053
4053
|
userCity: M,
|
|
4054
|
-
userCountry:
|
|
4054
|
+
userCountry: R,
|
|
4055
4055
|
userDevice: k,
|
|
4056
|
-
userOS:
|
|
4057
|
-
userState:
|
|
4056
|
+
userOS: N,
|
|
4057
|
+
userState: D,
|
|
4058
4058
|
canvasEnabled: L,
|
|
4059
4059
|
canvasQuality: I,
|
|
4060
4060
|
canvasFPS: E,
|
|
@@ -4065,12 +4065,12 @@ let lo = class {
|
|
|
4065
4065
|
return this.signalError(C, []), Ce(C);
|
|
4066
4066
|
}
|
|
4067
4067
|
this.delay = w, this.session.setSessionToken(u), this.session.setUserInfo({
|
|
4068
|
-
userBrowser:
|
|
4068
|
+
userBrowser: _,
|
|
4069
4069
|
userCity: M,
|
|
4070
|
-
userCountry:
|
|
4070
|
+
userCountry: R,
|
|
4071
4071
|
userDevice: k,
|
|
4072
|
-
userOS:
|
|
4073
|
-
userState:
|
|
4072
|
+
userOS: N,
|
|
4073
|
+
userState: D
|
|
4074
4074
|
}), this.session.assign({
|
|
4075
4075
|
sessionID: b,
|
|
4076
4076
|
timestamp: T || r,
|
|
@@ -4243,10 +4243,10 @@ function po(t) {
|
|
|
4243
4243
|
}
|
|
4244
4244
|
})), t.map(ms).join(" ");
|
|
4245
4245
|
}
|
|
4246
|
-
const
|
|
4246
|
+
const bs = ["log", "info", "warn", "error", "debug", "assert"];
|
|
4247
4247
|
function go(t, e) {
|
|
4248
4248
|
const n = Object.assign({
|
|
4249
|
-
consoleMethods:
|
|
4249
|
+
consoleMethods: bs,
|
|
4250
4250
|
consoleThrottling: 30
|
|
4251
4251
|
}, e);
|
|
4252
4252
|
if (!Array.isArray(n.consoleMethods) || n.consoleMethods.length === 0)
|
|
@@ -4264,7 +4264,7 @@ function go(t, e) {
|
|
|
4264
4264
|
}
|
|
4265
4265
|
};
|
|
4266
4266
|
n.consoleMethods.forEach((d) => {
|
|
4267
|
-
if (
|
|
4267
|
+
if (bs.indexOf(d) === -1) {
|
|
4268
4268
|
t.debug.error(`OpenReplay: unsupported console method "${d}"`);
|
|
4269
4269
|
return;
|
|
4270
4270
|
}
|
|
@@ -4274,9 +4274,9 @@ function go(t, e) {
|
|
|
4274
4274
|
}, l = t.safe((c) => o(c.console, c));
|
|
4275
4275
|
l(window), t.observer.attachContextCallback(l);
|
|
4276
4276
|
}
|
|
4277
|
-
var si = { exports: {} }, nn = { exports: {} },
|
|
4277
|
+
var si = { exports: {} }, nn = { exports: {} }, vs;
|
|
4278
4278
|
function mo() {
|
|
4279
|
-
return
|
|
4279
|
+
return vs || (vs = 1, function(t, e) {
|
|
4280
4280
|
(function(n, s) {
|
|
4281
4281
|
t.exports = s();
|
|
4282
4282
|
})($e, function() {
|
|
@@ -4318,15 +4318,15 @@ function mo() {
|
|
|
4318
4318
|
throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
4319
4319
|
},
|
|
4320
4320
|
toString: function() {
|
|
4321
|
-
var b = this.getFileName() || "", T = this.getLineNumber() || "",
|
|
4322
|
-
return this.getIsEval() ? b ? "[eval] (" + b + ":" + T + ":" +
|
|
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
|
|
4326
|
-
if (
|
|
4327
|
-
var
|
|
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:
|
|
4329
|
+
functionName: R,
|
|
4330
4330
|
args: k || void 0,
|
|
4331
4331
|
fileName: L,
|
|
4332
4332
|
lineNumber: I || void 0,
|
|
@@ -4480,8 +4480,8 @@ function mo() {
|
|
|
4480
4480
|
};
|
|
4481
4481
|
});
|
|
4482
4482
|
})(si);
|
|
4483
|
-
var
|
|
4484
|
-
const
|
|
4483
|
+
var bo = si.exports;
|
|
4484
|
+
const vo = /* @__PURE__ */ bi(bo);
|
|
4485
4485
|
function ys(t) {
|
|
4486
4486
|
return [
|
|
4487
4487
|
{
|
|
@@ -4496,7 +4496,7 @@ function ys(t) {
|
|
|
4496
4496
|
function wt(t, e, n = {}) {
|
|
4497
4497
|
let s = e;
|
|
4498
4498
|
try {
|
|
4499
|
-
s =
|
|
4499
|
+
s = vo.parse(t);
|
|
4500
4500
|
} catch {
|
|
4501
4501
|
}
|
|
4502
4502
|
return pn(t.name, t.message, JSON.stringify(s), JSON.stringify(n));
|
|
@@ -4682,7 +4682,7 @@ function Co(t, e) {
|
|
|
4682
4682
|
}, 3);
|
|
4683
4683
|
function u(a, d, p, v) {
|
|
4684
4684
|
const { value: w, mask: b } = s(a, d), T = ri(d);
|
|
4685
|
-
t.send(
|
|
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);
|
|
@@ -4694,10 +4694,10 @@ function Co(t, e) {
|
|
|
4694
4694
|
p = pe();
|
|
4695
4695
|
}, T = () => {
|
|
4696
4696
|
v === 0 && p !== 0 && (v = pe() - p);
|
|
4697
|
-
},
|
|
4697
|
+
}, _ = () => {
|
|
4698
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", b), t.nodes.attachNodeListener(a, "input", T), t.nodes.attachNodeListener(a, "change",
|
|
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)) {
|
|
@@ -4905,7 +4905,7 @@ function Bo(t, e) {
|
|
|
4905
4905
|
return null;
|
|
4906
4906
|
n = n.parentElement;
|
|
4907
4907
|
}
|
|
4908
|
-
if (
|
|
4908
|
+
if (vn(t)) {
|
|
4909
4909
|
let s = t.ownerSVGElement;
|
|
4910
4910
|
for (; s !== null; )
|
|
4911
4911
|
t = s, s = s.ownerSVGElement;
|
|
@@ -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
|
|
4927
|
-
if (
|
|
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
|
|
4933
|
-
return k instanceof HTMLElement && (
|
|
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
4937
|
let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, v = 0, w;
|
|
4938
4938
|
const b = 8e-3, T = 225;
|
|
4939
|
-
function
|
|
4939
|
+
function _() {
|
|
4940
4940
|
const k = v / T;
|
|
4941
4941
|
if (!a) {
|
|
4942
4942
|
a = k;
|
|
4943
4943
|
return;
|
|
4944
4944
|
}
|
|
4945
|
-
const
|
|
4946
|
-
p > 4 &&
|
|
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(() =>
|
|
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
|
-
},
|
|
4956
|
-
function
|
|
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 =
|
|
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());
|
|
@@ -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 ?
|
|
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
|
-
|
|
4982
|
-
}),
|
|
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);
|
|
@@ -5086,9 +5086,9 @@ function Ho(t, e) {
|
|
|
5086
5086
|
domContentLoadedEventStart: w,
|
|
5087
5087
|
domContentLoadedEventEnd: b,
|
|
5088
5088
|
loadEventStart: T,
|
|
5089
|
-
loadEventEnd:
|
|
5089
|
+
loadEventEnd: _
|
|
5090
5090
|
} = performance.timing;
|
|
5091
|
-
t.send(sr(d - a || 0, p - a || 0, v - a || 0, w - a || 0, b - a || 0, T - a || 0,
|
|
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
|
}
|
|
@@ -5100,7 +5100,7 @@ function Ho(t, e) {
|
|
|
5100
5100
|
const w = performance.now();
|
|
5101
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
5102
|
v = !0, s = null;
|
|
5103
|
-
const b = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: T, navigationStart:
|
|
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
5104
|
t.send(ir(b, c > u ? c : u, M));
|
|
5105
5105
|
}
|
|
5106
5106
|
});
|
|
@@ -5117,7 +5117,7 @@ function $o(t, e) {
|
|
|
5117
5117
|
let n = !1;
|
|
5118
5118
|
const s = /* @__PURE__ */ new Map();
|
|
5119
5119
|
function i(l) {
|
|
5120
|
-
ei(l) && (ke(l) && s.set(l, [l.scrollLeft, l.scrollTop]),
|
|
5120
|
+
ei(l) && (ke(l) && s.set(l, [l.scrollLeft, l.scrollTop]), vt(l) && s.set(l, rn(l)));
|
|
5121
5121
|
}
|
|
5122
5122
|
const r = t.safe(() => {
|
|
5123
5123
|
e || t.send(Wi(...rn(document)));
|
|
@@ -5128,7 +5128,7 @@ function $o(t, e) {
|
|
|
5128
5128
|
t.attachStartCallback(r), t.attachStopCallback(() => {
|
|
5129
5129
|
n = !1, s.clear();
|
|
5130
5130
|
}), t.nodes.attachNodeCallback((l, c) => {
|
|
5131
|
-
c && (ke(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) :
|
|
5131
|
+
c && (ke(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) : vt(l) && s.set(l, rn(l))), Et(l) && t.nodes.attachNodeListener(l, "scroll", (u) => {
|
|
5132
5132
|
i(u.target);
|
|
5133
5133
|
});
|
|
5134
5134
|
}), t.attachEventListener(document, "scroll", (l) => {
|
|
@@ -5321,7 +5321,7 @@ function Jo(t) {
|
|
|
5321
5321
|
s.FontFace = i;
|
|
5322
5322
|
};
|
|
5323
5323
|
t.observer.attachContextCallback(n), n(window), t.nodes.attachNodeCallback(t.safe((s) => {
|
|
5324
|
-
if (!
|
|
5324
|
+
if (!vt(s))
|
|
5325
5325
|
return;
|
|
5326
5326
|
const i = e.get(s);
|
|
5327
5327
|
if (!i)
|
|
@@ -5336,13 +5336,13 @@ 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: v, data: w, method: b, url: T, baseURL:
|
|
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
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 ||
|
|
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
|
});
|
|
@@ -5356,7 +5356,7 @@ function Xo(t, e, n, s, i) {
|
|
|
5356
5356
|
},
|
|
5357
5357
|
response: {
|
|
5358
5358
|
headers: z,
|
|
5359
|
-
body:
|
|
5359
|
+
body: D || M
|
|
5360
5360
|
}
|
|
5361
5361
|
});
|
|
5362
5362
|
if (!F) {
|
|
@@ -5364,7 +5364,7 @@ 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(
|
|
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) {
|
|
@@ -5418,7 +5418,7 @@ class An {
|
|
|
5418
5418
|
response: i
|
|
5419
5419
|
});
|
|
5420
5420
|
if (r)
|
|
5421
|
-
return
|
|
5421
|
+
return bt(this.requestType, r.method, r.url, JSON.stringify(r.request), JSON.stringify(r.response), r.status, this.startTime + Ve(), this.duration, this.responseSize);
|
|
5422
5422
|
}
|
|
5423
5423
|
writeHeaders() {
|
|
5424
5424
|
const e = {};
|
|
@@ -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, (
|
|
5818
|
-
const d = a.fetch.bind(a), p = (
|
|
5819
|
-
if (!(typeof
|
|
5820
|
-
return d(
|
|
5821
|
-
o(function(
|
|
5822
|
-
k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(
|
|
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
|
|
5825
|
-
return d(
|
|
5826
|
-
const L = performance.now() -
|
|
5827
|
-
if (n.failuresOnly &&
|
|
5828
|
-
return
|
|
5829
|
-
const I =
|
|
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(
|
|
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(
|
|
5855
|
-
}).catch((E) => t.debug.error("Could not process Fetch response:", E)),
|
|
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
5859
|
const v = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, b = a.XMLHttpRequest.prototype.send;
|
|
5860
|
-
function T(
|
|
5861
|
-
const
|
|
5862
|
-
o((L, I) =>
|
|
5863
|
-
let
|
|
5864
|
-
return
|
|
5865
|
-
|
|
5866
|
-
}),
|
|
5867
|
-
const { headers: I, body: E } = on(
|
|
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(
|
|
5872
|
+
const C = _s(R), F = l({
|
|
5873
5873
|
url: String(k),
|
|
5874
5874
|
method: C,
|
|
5875
|
-
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:
|
|
5883
|
+
body: N.response
|
|
5884
5884
|
}
|
|
5885
5885
|
});
|
|
5886
|
-
F && t.send(
|
|
5886
|
+
F && t.send(bt("xhr", C, String(F.url), c(F.request), c(F.response), N.status, D + Ve(), P, 0));
|
|
5887
5887
|
})), v.apply(this, arguments);
|
|
5888
5888
|
}
|
|
5889
|
-
function
|
|
5889
|
+
function _(R) {
|
|
5890
5890
|
const k = on(this);
|
|
5891
|
-
return k.body =
|
|
5891
|
+
return k.body = R, b.apply(this, arguments);
|
|
5892
5892
|
}
|
|
5893
|
-
function M(
|
|
5894
|
-
if (!i(
|
|
5895
|
-
const
|
|
5896
|
-
|
|
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 =
|
|
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);
|
|
@@ -7119,7 +7119,7 @@ class fi {
|
|
|
7119
7119
|
}
|
|
7120
7120
|
}
|
|
7121
7121
|
}
|
|
7122
|
-
class
|
|
7122
|
+
class ba {
|
|
7123
7123
|
constructor() {
|
|
7124
7124
|
this.api = new fi(), this.language = "en", this.currency = "USD", this.currencies = {
|
|
7125
7125
|
USD: {
|
|
@@ -7647,7 +7647,7 @@ class va {
|
|
|
7647
7647
|
async fetchConfig(e) {
|
|
7648
7648
|
try {
|
|
7649
7649
|
const n = await this.api.getStoreConfig(e);
|
|
7650
|
-
this.storeLanguage = n.lang, this.supportedLanguages = n.available_languages;
|
|
7650
|
+
this.storeLanguage = n.lang, this.supportedLanguages = n.available_languages, this.OpenAIApiKey = n.open_ai_key;
|
|
7651
7651
|
const s = localStorage.getItem("selectedLanguage");
|
|
7652
7652
|
s && this.translations[s] ? this.language = s : n.lang && this.translations[n.lang] ? (this.language = n.lang, localStorage.setItem("selectedLanguage", n.lang)) : this.language = "en", this.currency = n.currency || "USD";
|
|
7653
7653
|
} catch {
|
|
@@ -7681,10 +7681,10 @@ class va {
|
|
|
7681
7681
|
var u, a, d, p;
|
|
7682
7682
|
if (this.storeLanguage === this.language || !this.supportedLanguages)
|
|
7683
7683
|
return e;
|
|
7684
|
-
const n =
|
|
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",
|
|
@@ -7703,17 +7703,17 @@ class va {
|
|
|
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
7704
|
if (!b)
|
|
7705
7705
|
throw new Error("No response from OpenAI");
|
|
7706
|
-
const T = b.split(" ||| ").map((M) => M.trim()),
|
|
7707
|
-
return Object.keys(e).forEach((M,
|
|
7708
|
-
|
|
7709
|
-
}),
|
|
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
7710
|
} catch (v) {
|
|
7711
7711
|
return console.error("Error translating texts:", v), e;
|
|
7712
7712
|
}
|
|
7713
7713
|
}
|
|
7714
7714
|
}
|
|
7715
|
-
const G = new
|
|
7716
|
-
class
|
|
7715
|
+
const G = new ba();
|
|
7716
|
+
class va {
|
|
7717
7717
|
constructor() {
|
|
7718
7718
|
var e, n, s, i, r;
|
|
7719
7719
|
this.widgetType = ((e = window == null ? void 0 : window.wineaterData) == null ? void 0 : e.WIDGET_TYPE) || "store", this.countryCode = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.COUNTRY_CODE) || null, this.widgetWrapper = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.WIDGET_WRAPPER) || "wineater-widget-conteiner", this.titleText = (i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.TITLE_TEXT, this.subtitleText = (r = window == null ? void 0 : window.wineaterData) == null ? void 0 : r.SUBTITLE_TEXT, this.api = new fi(), console.log(this.titleText), this.selectedFilters = {
|
|
@@ -7839,9 +7839,9 @@ class ba {
|
|
|
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"), v = i(u, "total"), w = i(u, "url"), b = u.tags || u.Tags, T = r(u, ["type", "country", "region", "grape"]),
|
|
7843
|
-
<div class="wine-recommendation-tile ${
|
|
7844
|
-
${
|
|
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" />` : ""}
|
|
@@ -7860,15 +7860,15 @@ class ba {
|
|
|
7860
7860
|
<h2>${d}</h2>
|
|
7861
7861
|
<span class="card-popup-close">×</span>
|
|
7862
7862
|
</div>
|
|
7863
|
-
${
|
|
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
|
-
${
|
|
7865
|
+
${_ ? `<div class="popup-tags">${_}</div>` : ""}
|
|
7866
7866
|
</div>
|
|
7867
7867
|
|
|
7868
7868
|
${M}
|
|
7869
7869
|
</div>
|
|
7870
7870
|
`;
|
|
7871
|
-
s.insertAdjacentHTML("beforeend",
|
|
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 ba {
|
|
|
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
|
|
7934
|
-
for (let
|
|
7935
|
-
const
|
|
7936
|
-
const
|
|
7937
|
-
if (
|
|
7938
|
-
const
|
|
7939
|
-
|
|
7940
|
-
}), Object.keys(
|
|
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
|
|
7943
|
-
if (
|
|
7944
|
-
if (
|
|
7945
|
-
const
|
|
7946
|
-
|
|
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 (
|
|
7949
|
-
const
|
|
7950
|
-
|
|
7948
|
+
if (v.reason) {
|
|
7949
|
+
const b = w.querySelector(".popup-reason");
|
|
7950
|
+
b && (b.textContent = v.reason);
|
|
7951
7951
|
}
|
|
7952
|
-
if (
|
|
7953
|
-
const
|
|
7954
|
-
|
|
7952
|
+
if (v.pairing_recommendation) {
|
|
7953
|
+
const b = w.querySelector(".popup-pairing");
|
|
7954
|
+
b && (b.textContent = v.pairing_recommendation);
|
|
7955
7955
|
}
|
|
7956
|
-
if (
|
|
7957
|
-
const
|
|
7958
|
-
|
|
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(
|
|
7962
|
+
await Promise.all(c);
|
|
7963
7963
|
}
|
|
7964
7964
|
}
|
|
7965
7965
|
async loadInstantRecommendations() {
|
|
@@ -8011,7 +8011,7 @@ class wa {
|
|
|
8011
8011
|
Rs("chatbotToken", ((e = window.wineaterData) == null ? void 0 : e.CLIENT_TOKEN) || ya, 365), mi();
|
|
8012
8012
|
}
|
|
8013
8013
|
async initialize() {
|
|
8014
|
-
this.tracker.start(), await this.initTranslator(), this.initCookies(), new
|
|
8014
|
+
this.tracker.start(), await this.initTranslator(), this.initCookies(), new va();
|
|
8015
8015
|
}
|
|
8016
8016
|
}
|
|
8017
8017
|
document.addEventListener("DOMContentLoaded", () => {
|