wineater-bot 3.8.0 → 3.8.1
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 +651 -619
- package/dist/wineater-chatbot.umd.js +62 -39
- package/package.json +1 -1
- package/src/js/i18n.js +69 -33
- package/src/js/widget.js +75 -64
|
@@ -38,48 +38,48 @@ var $n = { exports: {} };
|
|
|
38
38
|
(function(n, s) {
|
|
39
39
|
s(e);
|
|
40
40
|
})($e, function(n) {
|
|
41
|
-
var s = { getItemSync: function(
|
|
41
|
+
var s = { getItemSync: function(v) {
|
|
42
42
|
try {
|
|
43
|
-
return localStorage.getItem(
|
|
43
|
+
return localStorage.getItem(v) || null;
|
|
44
44
|
} catch {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
}, getItem: function(
|
|
47
|
+
}, getItem: function(v, f) {
|
|
48
48
|
var h = this;
|
|
49
49
|
return new Promise(function(m, g) {
|
|
50
50
|
try {
|
|
51
|
-
var S = h.getItemSync(
|
|
51
|
+
var S = h.getItemSync(v);
|
|
52
52
|
f == null || f(null, S), m(S);
|
|
53
|
-
} catch (
|
|
54
|
-
f && f(
|
|
53
|
+
} catch (k) {
|
|
54
|
+
f && f(k, null), g(k);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
}, setItem: function(
|
|
57
|
+
}, setItem: function(v, f, h) {
|
|
58
58
|
return new Promise(function(m, g) {
|
|
59
59
|
try {
|
|
60
|
-
localStorage.setItem(
|
|
60
|
+
localStorage.setItem(v, f), h && h(null, f), m(f);
|
|
61
61
|
} catch (S) {
|
|
62
62
|
h && h(S, null), g(S);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
} }, i = function() {
|
|
66
|
-
return i = Object.assign || function(
|
|
66
|
+
return i = Object.assign || function(v) {
|
|
67
67
|
for (var f, h = 1, m = arguments.length; h < m; h++)
|
|
68
68
|
for (var g in f = arguments[h])
|
|
69
|
-
Object.prototype.hasOwnProperty.call(f, g) && (
|
|
70
|
-
return
|
|
69
|
+
Object.prototype.hasOwnProperty.call(f, g) && (v[g] = f[g]);
|
|
70
|
+
return v;
|
|
71
71
|
}, i.apply(this, arguments);
|
|
72
72
|
};
|
|
73
|
-
function r(
|
|
73
|
+
function r(v, f, h, m) {
|
|
74
74
|
return new (h || (h = Promise))(function(g, S) {
|
|
75
|
-
function
|
|
75
|
+
function k(q) {
|
|
76
76
|
try {
|
|
77
77
|
B(m.next(q));
|
|
78
78
|
} catch (O) {
|
|
79
79
|
S(O);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function L(q) {
|
|
83
83
|
try {
|
|
84
84
|
B(m.throw(q));
|
|
85
85
|
} catch (O) {
|
|
@@ -90,26 +90,26 @@ var $n = { exports: {} };
|
|
|
90
90
|
var O;
|
|
91
91
|
q.done ? g(q.value) : (O = q.value, O instanceof h ? O : new h(function(W) {
|
|
92
92
|
W(O);
|
|
93
|
-
})).then(
|
|
93
|
+
})).then(k, L);
|
|
94
94
|
}
|
|
95
|
-
B((m = m.apply(
|
|
95
|
+
B((m = m.apply(v, f || [])).next());
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
function o(
|
|
99
|
-
var h, m, g, S,
|
|
98
|
+
function o(v, f) {
|
|
99
|
+
var h, m, g, S, k = { label: 0, sent: function() {
|
|
100
100
|
if (1 & g[0])
|
|
101
101
|
throw g[1];
|
|
102
102
|
return g[1];
|
|
103
103
|
}, trys: [], ops: [] };
|
|
104
|
-
return S = { next:
|
|
104
|
+
return S = { next: L(0), throw: L(1), return: L(2) }, typeof Symbol == "function" && (S[Symbol.iterator] = function() {
|
|
105
105
|
return this;
|
|
106
106
|
}), S;
|
|
107
|
-
function
|
|
107
|
+
function L(B) {
|
|
108
108
|
return function(q) {
|
|
109
109
|
return function(O) {
|
|
110
110
|
if (h)
|
|
111
111
|
throw new TypeError("Generator is already executing.");
|
|
112
|
-
for (;
|
|
112
|
+
for (; k; )
|
|
113
113
|
try {
|
|
114
114
|
if (h = 1, m && (g = 2 & O[0] ? m.return : O[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, O[1])).done)
|
|
115
115
|
return g;
|
|
@@ -119,34 +119,34 @@ var $n = { exports: {} };
|
|
|
119
119
|
g = O;
|
|
120
120
|
break;
|
|
121
121
|
case 4:
|
|
122
|
-
return
|
|
122
|
+
return k.label++, { value: O[1], done: !1 };
|
|
123
123
|
case 5:
|
|
124
|
-
|
|
124
|
+
k.label++, m = O[1], O = [0];
|
|
125
125
|
continue;
|
|
126
126
|
case 7:
|
|
127
|
-
O =
|
|
127
|
+
O = k.ops.pop(), k.trys.pop();
|
|
128
128
|
continue;
|
|
129
129
|
default:
|
|
130
|
-
if (g =
|
|
131
|
-
|
|
130
|
+
if (g = k.trys, !((g = g.length > 0 && g[g.length - 1]) || O[0] !== 6 && O[0] !== 2)) {
|
|
131
|
+
k = 0;
|
|
132
132
|
continue;
|
|
133
133
|
}
|
|
134
134
|
if (O[0] === 3 && (!g || O[1] > g[0] && O[1] < g[3])) {
|
|
135
|
-
|
|
135
|
+
k.label = O[1];
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
|
-
if (O[0] === 6 &&
|
|
139
|
-
|
|
138
|
+
if (O[0] === 6 && k.label < g[1]) {
|
|
139
|
+
k.label = g[1], g = O;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
|
-
if (g &&
|
|
143
|
-
|
|
142
|
+
if (g && k.label < g[2]) {
|
|
143
|
+
k.label = g[2], k.ops.push(O);
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
|
-
g[2] &&
|
|
146
|
+
g[2] && k.ops.pop(), k.trys.pop();
|
|
147
147
|
continue;
|
|
148
148
|
}
|
|
149
|
-
O = f.call(
|
|
149
|
+
O = f.call(v, k);
|
|
150
150
|
} catch (W) {
|
|
151
151
|
O = [6, W], m = 0;
|
|
152
152
|
} finally {
|
|
@@ -159,13 +159,13 @@ var $n = { exports: {} };
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function l(
|
|
162
|
+
function l(v, f, h) {
|
|
163
163
|
if (h || arguments.length === 2)
|
|
164
164
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
165
165
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
166
|
-
return
|
|
166
|
+
return v.concat(m || Array.prototype.slice.call(f));
|
|
167
167
|
}
|
|
168
|
-
var c = function
|
|
168
|
+
var c = function v(f, h) {
|
|
169
169
|
if (f === h)
|
|
170
170
|
return !0;
|
|
171
171
|
if (f && h && typeof f == "object" && typeof h == "object") {
|
|
@@ -176,7 +176,7 @@ var $n = { exports: {} };
|
|
|
176
176
|
if ((m = f.length) != h.length)
|
|
177
177
|
return !1;
|
|
178
178
|
for (g = m; g-- != 0; )
|
|
179
|
-
if (!
|
|
179
|
+
if (!v(f[g], h[g]))
|
|
180
180
|
return !1;
|
|
181
181
|
return !0;
|
|
182
182
|
}
|
|
@@ -192,84 +192,84 @@ var $n = { exports: {} };
|
|
|
192
192
|
if (!Object.prototype.hasOwnProperty.call(h, S[g]))
|
|
193
193
|
return !1;
|
|
194
194
|
for (g = m; g-- != 0; ) {
|
|
195
|
-
var
|
|
196
|
-
if (!
|
|
195
|
+
var k = S[g];
|
|
196
|
+
if (!v(f[k], h[k]))
|
|
197
197
|
return !1;
|
|
198
198
|
}
|
|
199
199
|
return !0;
|
|
200
200
|
}
|
|
201
201
|
return f != f && h != h;
|
|
202
202
|
};
|
|
203
|
-
function u(
|
|
203
|
+
function u(v, f) {
|
|
204
204
|
var h = Object.keys(f || {}).filter(function(m) {
|
|
205
|
-
var g =
|
|
205
|
+
var g = v == null ? void 0 : v[m], S = f == null ? void 0 : f[m];
|
|
206
206
|
return !c(g, S);
|
|
207
207
|
});
|
|
208
|
-
return Object.keys(
|
|
208
|
+
return Object.keys(v || {}).filter(function(m) {
|
|
209
209
|
Object.keys(f || {}).includes(m) || h.push(m);
|
|
210
210
|
}), Object.keys(h).length ? h : null;
|
|
211
211
|
}
|
|
212
212
|
var a, d;
|
|
213
|
-
function p(
|
|
213
|
+
function p(v, f, h) {
|
|
214
214
|
var m = "shortString", g = !0;
|
|
215
|
-
typeof h == "number" && (m = "javaDouble", g = !1),
|
|
215
|
+
typeof h == "number" && (m = "javaDouble", g = !1), v[m] = v[m] || {}, v[m][f] = g ? h + "" : h;
|
|
216
216
|
}
|
|
217
|
-
function v
|
|
218
|
-
return !!
|
|
217
|
+
function b(v) {
|
|
218
|
+
return !!v && typeof v == "object" && v.value !== void 0;
|
|
219
219
|
}
|
|
220
|
-
function w(
|
|
221
|
-
return Object.fromEntries(Object.entries(
|
|
220
|
+
function w(v) {
|
|
221
|
+
return Object.fromEntries(Object.entries(v).map(function(f) {
|
|
222
222
|
var h = f[0], m = f[1];
|
|
223
|
-
return [h,
|
|
223
|
+
return [h, b(m) ? m : { value: m }];
|
|
224
224
|
}));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
return i(i({},
|
|
226
|
+
function y(v) {
|
|
227
|
+
return i(i({}, v), { identity: v.identity ? i(i({}, v.identity), { traits: w(v.identity.traits || {}) }) : void 0 });
|
|
228
228
|
}
|
|
229
|
-
(function(
|
|
230
|
-
|
|
229
|
+
(function(v) {
|
|
230
|
+
v.NONE = "NONE", v.DEFAULT_FLAGS = "DEFAULT_FLAGS", v.CACHE = "CACHE", v.SERVER = "SERVER";
|
|
231
231
|
})(a || (a = {}));
|
|
232
|
-
var
|
|
233
|
-
function
|
|
232
|
+
var x, C = null, F = "BULLET_TRAIN_DB", R = "BULLET_TRAIN_EVENT", T = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", D = "flagsmith_enabled_", A = "flagsmith_trait_", I = function() {
|
|
233
|
+
function v(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() {
|
|
236
236
|
var m = h, g = m.api, S = m.evaluationContext;
|
|
237
237
|
h.log("Get Flags"), h.isLoading = !0, h.loadingState.isFetching || h.setLoadingState(i(i({}, h.loadingState), { isFetching: !0 }));
|
|
238
|
-
var
|
|
238
|
+
var k = "".concat(h.getContext().identity), L = function(B) {
|
|
239
239
|
var q, O, W, ee;
|
|
240
|
-
if (B &&
|
|
240
|
+
if (B && k === "".concat(h.getContext().identity)) {
|
|
241
241
|
var oe = B.flags, te = B.traits, ne = B.identifier;
|
|
242
242
|
h.isLoading = !1;
|
|
243
243
|
var ae = {}, ce = {};
|
|
244
|
-
te = te || [], (oe = oe || []).forEach(function(
|
|
245
|
-
ae[
|
|
246
|
-
}), te.forEach(function(
|
|
247
|
-
ce[
|
|
244
|
+
te = te || [], (oe = oe || []).forEach(function(K) {
|
|
245
|
+
ae[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
|
|
246
|
+
}), te.forEach(function(K) {
|
|
247
|
+
ce[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
|
|
248
248
|
}), h.oldFlags = i({}, h.flags);
|
|
249
249
|
var ge = u(h.oldFlags, ae), Ge = u((q = h.evaluationContext.identity) === null || q === void 0 ? void 0 : q.traits, ce);
|
|
250
250
|
if ((ne || Object.keys(ce).length) && (h.evaluationContext.identity = { traits: ce }, ne && (h.evaluationContext.identity.identifier = ne)), h.flags = ae, h.updateStorage(), h._onChange(h.oldFlags, { isFromServer: !0, flagsChanged: ge, traitsChanged: Ge }, h._loadedState(null, a.SERVER)), h.datadogRum)
|
|
251
251
|
try {
|
|
252
252
|
if (h.datadogRum.trackTraits) {
|
|
253
253
|
var Ke = {};
|
|
254
|
-
Object.keys(((O = h.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits) || {}).map(function(
|
|
255
|
-
Ke[
|
|
254
|
+
Object.keys(((O = h.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits) || {}).map(function(K) {
|
|
255
|
+
Ke[A + K] = h.getTrait(K);
|
|
256
256
|
});
|
|
257
|
-
var
|
|
258
|
-
h.log("Setting Datadog user",
|
|
257
|
+
var Ae = i(i(i({}, h.datadogRum.client.getUser()), { id: h.datadogRum.client.getUser().id || ((W = h.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Ke);
|
|
258
|
+
h.log("Setting Datadog user", Ae), h.datadogRum.client.setUser(Ae);
|
|
259
259
|
}
|
|
260
|
-
} catch (
|
|
261
|
-
console.error(
|
|
260
|
+
} catch (K) {
|
|
261
|
+
console.error(K);
|
|
262
262
|
}
|
|
263
263
|
if (h.dtrum)
|
|
264
264
|
try {
|
|
265
265
|
var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
266
|
-
Object.keys(h.flags).map(function(
|
|
267
|
-
p(se, N +
|
|
268
|
-
}), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(
|
|
269
|
-
p(se,
|
|
266
|
+
Object.keys(h.flags).map(function(K) {
|
|
267
|
+
p(se, N + K, h.getValue(K, { skipAnalytics: !0 })), p(se, D + K, h.hasFeature(K, { skipAnalytics: !0 }));
|
|
268
|
+
}), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(K) {
|
|
269
|
+
p(se, A + K, h.getTrait(K));
|
|
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);
|
|
271
|
-
} catch (
|
|
272
|
-
console.error(
|
|
271
|
+
} catch (K) {
|
|
272
|
+
console.error(K);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
};
|
|
@@ -279,12 +279,12 @@ var $n = { exports: {} };
|
|
|
279
279
|
}).filter(function(B) {
|
|
280
280
|
return B.trait_value !== void 0 || (h.log("Warning - attempted to set an undefined trait value for key", B.trait_key), !1);
|
|
281
281
|
}) })) : h.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(B) {
|
|
282
|
-
return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }),
|
|
282
|
+
return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), L(B == null ? void 0 : B[0]);
|
|
283
283
|
}).catch(function(B) {
|
|
284
284
|
var q = B.message, O = new Error(q);
|
|
285
285
|
return Promise.reject(O);
|
|
286
286
|
}) : h.getJSON(g + "flags/").then(function(B) {
|
|
287
|
-
return
|
|
287
|
+
return L({ flags: B, traits: void 0 });
|
|
288
288
|
});
|
|
289
289
|
}, this.analyticsFlags = function() {
|
|
290
290
|
var m = h.api;
|
|
@@ -298,27 +298,27 @@ var $n = { exports: {} };
|
|
|
298
298
|
h.log("Exception fetching evaluationEvent", g);
|
|
299
299
|
}) : void 0;
|
|
300
300
|
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: a.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1 }, this.getValue = function(m, g, S) {
|
|
301
|
-
var
|
|
302
|
-
if (
|
|
301
|
+
var k = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], L = null;
|
|
302
|
+
if (k && (L = k.value), g != null && g.skipAnalytics || S || h.evaluateFlag(m, "VALUE"), L === null && (g == null ? void 0 : g.fallback) !== void 0)
|
|
303
303
|
return g.fallback;
|
|
304
304
|
if (g != null && g.json)
|
|
305
305
|
try {
|
|
306
|
-
return
|
|
306
|
+
return L === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(L);
|
|
307
307
|
} catch {
|
|
308
308
|
return g.fallback;
|
|
309
309
|
}
|
|
310
|
-
return
|
|
310
|
+
return L;
|
|
311
311
|
}, this.getTrait = function(m) {
|
|
312
312
|
var g, S;
|
|
313
313
|
return ((g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((S = h.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || S === void 0 ? void 0 : S.value);
|
|
314
314
|
}, this.getAllTraits = function() {
|
|
315
315
|
var m;
|
|
316
316
|
return Object.fromEntries(Object.entries(((m = h.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
|
|
317
|
-
var S = g[0],
|
|
318
|
-
return [S,
|
|
317
|
+
var S = g[0], k = g[1];
|
|
318
|
+
return [S, k == null ? void 0 : k.value];
|
|
319
319
|
}));
|
|
320
320
|
}, this.setContext = function(m) {
|
|
321
|
-
var g =
|
|
321
|
+
var g = y(m);
|
|
322
322
|
return h.evaluationContext = i(i({}, g), { environment: g.environment || h.evaluationContext.environment }), h.initialised ? h.getFlags() : Promise.resolve();
|
|
323
323
|
}, this.getContext = function() {
|
|
324
324
|
return h.evaluationContext;
|
|
@@ -332,19 +332,19 @@ var $n = { exports: {} };
|
|
|
332
332
|
var g;
|
|
333
333
|
if (h.api)
|
|
334
334
|
return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
|
|
335
|
-
var
|
|
336
|
-
return [
|
|
335
|
+
var k = S[0], L = S[1];
|
|
336
|
+
return [k, b(L) ? L : { value: L }];
|
|
337
337
|
}))) }) }));
|
|
338
338
|
console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
|
|
339
339
|
}, this.hasFeature = function(m, g) {
|
|
340
|
-
var S = typeof g == "object",
|
|
341
|
-
return !
|
|
340
|
+
var S = typeof g == "object", k = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], L = !1;
|
|
341
|
+
return !k && S && g.fallback !== void 0 ? L = g == null ? void 0 : g.fallback : k && k.enabled && (L = !0), (S && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), L;
|
|
342
342
|
}, this.getJSON = function(m, g, S) {
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
var B =
|
|
343
|
+
var k, L = h;
|
|
344
|
+
L.evaluationContext;
|
|
345
|
+
var B = L.headers, q = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
|
|
346
346
|
h.evaluationContext.environment && (q.headers["X-Environment-Key"] = h.evaluationContext.environment.apiKey), g && g !== "GET" && (q.headers["Content-Type"] = "application/json; charset=utf-8"), B && Object.assign(q.headers, B), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
347
|
-
var O = "".concat((
|
|
347
|
+
var O = "".concat((k = h.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
|
|
348
348
|
return d(m, q).then(function(W) {
|
|
349
349
|
var ee, oe, te = "".concat((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.identifier);
|
|
350
350
|
if (O === te) {
|
|
@@ -377,26 +377,26 @@ var $n = { exports: {} };
|
|
|
377
377
|
}
|
|
378
378
|
h.updateEventStorage();
|
|
379
379
|
}, this._onChange = function(m, g, S) {
|
|
380
|
-
var
|
|
381
|
-
h.setLoadingState(S), (
|
|
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 && (
|
|
380
|
+
var k, L;
|
|
381
|
+
h.setLoadingState(S), (k = h.onChange) === null || k === void 0 || k.call(h, m, g, h.loadingState), (L = h._trigger) === null || L === void 0 || L.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 && (x = f.eventSource), f.AsyncStorage && (C = f.AsyncStorage);
|
|
383
383
|
}
|
|
384
|
-
return
|
|
384
|
+
return v.prototype.init = function(f) {
|
|
385
385
|
var h, m, g;
|
|
386
386
|
return r(this, void 0, void 0, function() {
|
|
387
|
-
var S,
|
|
387
|
+
var S, k, L, B, q, O, W, ee, oe, te, ne, ae, ce, ge, Ge, Ke, Ae, se, K, Ct, Je, Pn, Xe, _t, Bn, jn, Nt, zn, Ot, Ye, Me, Un, ie = this;
|
|
388
388
|
return o(this, function(fe) {
|
|
389
389
|
switch (fe.label) {
|
|
390
390
|
case 0:
|
|
391
|
-
S =
|
|
391
|
+
S = y(f.evaluationContext || this.evaluationContext), fe.label = 1;
|
|
392
392
|
case 1:
|
|
393
|
-
if (fe.trys.push([1, 13, , 14]),
|
|
393
|
+
if (fe.trys.push([1, 13, , 14]), k = f.environmentID, L = f.api, B = L === void 0 ? T : L, q = f.headers, O = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Ae = f.eventSourceUrl, se = Ae === void 0 ? "https://realtime.flagsmith.com/" : Ae, K = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = k ? { apiKey: k } : S.environment, !S.environment || !S.environment.apiKey)
|
|
394
394
|
throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
395
395
|
if (S.identity = Ct || Je ? { identifier: Ct, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(le) {
|
|
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 =
|
|
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 = C !== void 0 && !!W, K && (C = K), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), _t && (d = /* @__PURE__ */ function(le) {
|
|
400
400
|
return function(me, be) {
|
|
401
401
|
var Te = be.headers, Y = be.method, Fe = be.body;
|
|
402
402
|
return new Promise(function(Oe) {
|
|
@@ -417,14 +417,14 @@ var $n = { exports: {} };
|
|
|
417
417
|
}
|
|
418
418
|
});
|
|
419
419
|
};
|
|
420
|
-
}(_t)),
|
|
420
|
+
}(_t)), C && this.canUseStorage && C.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), C && this.canUseStorage && C.getItem(R, function(le, me) {
|
|
428
428
|
if (me && ie.evaluationContext.environment) {
|
|
429
429
|
var be = JSON.parse(me);
|
|
430
430
|
if (be[ie.evaluationContext.environment.apiKey]) {
|
|
@@ -434,11 +434,11 @@ var $n = { exports: {} };
|
|
|
434
434
|
}
|
|
435
435
|
})), !W)
|
|
436
436
|
return [3, 9];
|
|
437
|
-
if (!
|
|
437
|
+
if (!C || !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 be, Te, Y, Fe, Oe, xe, Rt, Hn, Dt,
|
|
441
|
+
var be, Te, Y, Fe, Oe, xe, Rt, Hn, Dt, Lt, At, 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:
|
|
@@ -446,7 +446,7 @@ var $n = { exports: {} };
|
|
|
446
446
|
return [3, 7];
|
|
447
447
|
be = null, Te = null, Ee.label = 1;
|
|
448
448
|
case 1:
|
|
449
|
-
return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((
|
|
449
|
+
return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((Lt = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) === ((At = this.evaluationContext.environment) === null || At === void 0 ? void 0 : At.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: y(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]), C.getItemSync ? (Ot = C.getItemSync(F), [3, 5]) : [3, 3];
|
|
481
481
|
case 3:
|
|
482
|
-
return [4,
|
|
482
|
+
return [4, C.getItem(F)];
|
|
483
483
|
case 4:
|
|
484
484
|
Ot = fe.sent(), fe.label = 5;
|
|
485
485
|
case 5:
|
|
@@ -508,93 +508,93 @@ var $n = { exports: {} };
|
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
510
|
});
|
|
511
|
-
},
|
|
511
|
+
}, v.prototype._loadedState = function(f, h, m) {
|
|
512
512
|
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: h };
|
|
513
|
-
},
|
|
513
|
+
}, v.prototype.getAllFlags = function() {
|
|
514
514
|
return this.flags;
|
|
515
|
-
},
|
|
515
|
+
}, v.prototype.identify = function(f, h, m) {
|
|
516
516
|
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), h && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(h).map(function(g) {
|
|
517
|
-
var S = g[0],
|
|
518
|
-
return [S,
|
|
517
|
+
var S = g[0], k = g[1];
|
|
518
|
+
return [S, b(k) ? k : { value: k }];
|
|
519
519
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
520
|
-
},
|
|
520
|
+
}, v.prototype.getState = function() {
|
|
521
521
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
522
|
-
},
|
|
523
|
-
f && (this.initialised = !0, this.api = f.api || this.api ||
|
|
524
|
-
},
|
|
522
|
+
}, v.prototype.setState = function(f) {
|
|
523
|
+
f && (this.initialised = !0, this.api = f.api || this.api || T, this.flags = f.flags || this.flags, this.evaluationContext = f.evaluationContext || this.evaluationContext, this.evaluationEvent = f.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
|
|
524
|
+
}, v.prototype.logout = function() {
|
|
525
525
|
return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
|
|
526
|
-
},
|
|
526
|
+
}, v.prototype.startListening = function(f) {
|
|
527
527
|
f === void 0 && (f = 1e3), this.getFlagInterval && clearInterval(this.getFlagInterval), this.getFlagInterval = setInterval(this.getFlags, f);
|
|
528
|
-
},
|
|
528
|
+
}, v.prototype.stopListening = function() {
|
|
529
529
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
530
|
-
},
|
|
530
|
+
}, v.prototype.log = function() {
|
|
531
531
|
for (var f = [], h = 0; h < arguments.length; h++)
|
|
532
532
|
f[h] = arguments[h];
|
|
533
533
|
this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
|
|
534
|
-
},
|
|
534
|
+
}, v.prototype.updateStorage = function() {
|
|
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), C.setItem(F, f);
|
|
539
539
|
}
|
|
540
|
-
},
|
|
540
|
+
}, v.prototype.updateEventStorage = function() {
|
|
541
541
|
if (this.enableAnalytics) {
|
|
542
542
|
var f = JSON.stringify(this.getState().evaluationEvent);
|
|
543
|
-
|
|
543
|
+
C.setItem(R, f);
|
|
544
544
|
}
|
|
545
|
-
},
|
|
545
|
+
}, v.prototype.setLoadingState = function(f) {
|
|
546
546
|
var h;
|
|
547
547
|
c(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (h = this._triggerLoadingState) === null || h === void 0 || h.call(this));
|
|
548
|
-
},
|
|
548
|
+
}, v.prototype.setupRealtime = function(f, h) {
|
|
549
549
|
var m = this, g = f + "sse/environments/" + h + "/stream";
|
|
550
|
-
|
|
551
|
-
var
|
|
550
|
+
x ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new x(g), this.eventSource.addEventListener("environment_updated", function(S) {
|
|
551
|
+
var k;
|
|
552
552
|
try {
|
|
553
|
-
|
|
554
|
-
} catch (
|
|
555
|
-
m.log("Could not parse sse event",
|
|
553
|
+
k = JSON.parse(S.data).updated_at;
|
|
554
|
+
} catch (L) {
|
|
555
|
+
m.log("Could not parse sse event", L);
|
|
556
556
|
}
|
|
557
|
-
|
|
557
|
+
k ? !m.timestamp || k > m.timestamp ? m.isLoading ? m.log("updated_at is new, but flags are loading", S.data, m.timestamp) : (m.log("updated_at is new, fetching flags", S.data, m.timestamp), m.getFlags()) : m.log("updated_at is outdated, skipping get flags", S.data, m.timestamp) : m.log("No updated_at received, fetching flags", S);
|
|
558
558
|
})) : this.log("Error, EventSource is undefined");
|
|
559
|
-
},
|
|
559
|
+
}, v;
|
|
560
560
|
}();
|
|
561
|
-
function E(
|
|
562
|
-
var f =
|
|
561
|
+
function E(v) {
|
|
562
|
+
var f = v.fetch, h = v.AsyncStorage, m = v.eventSource;
|
|
563
563
|
return new I({ fetch: f, AsyncStorage: h, eventSource: m });
|
|
564
564
|
}
|
|
565
|
-
var P, U = (P = function(
|
|
565
|
+
var P, U = (P = function(v, f) {
|
|
566
566
|
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(h, m) {
|
|
567
567
|
h.__proto__ = m;
|
|
568
568
|
} || function(h, m) {
|
|
569
569
|
for (var g in m)
|
|
570
570
|
Object.prototype.hasOwnProperty.call(m, g) && (h[g] = m[g]);
|
|
571
|
-
}, P(
|
|
572
|
-
}, function(
|
|
571
|
+
}, P(v, f);
|
|
572
|
+
}, function(v, f) {
|
|
573
573
|
if (typeof f != "function" && f !== null)
|
|
574
574
|
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
575
575
|
function h() {
|
|
576
|
-
this.constructor =
|
|
576
|
+
this.constructor = v;
|
|
577
577
|
}
|
|
578
|
-
P(
|
|
579
|
-
}), j = function(
|
|
580
|
-
var f = typeof Symbol == "function" && Symbol.iterator, h = f &&
|
|
578
|
+
P(v, f), v.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
|
|
579
|
+
}), j = function(v) {
|
|
580
|
+
var f = typeof Symbol == "function" && Symbol.iterator, h = f && v[f], m = 0;
|
|
581
581
|
if (h)
|
|
582
|
-
return h.call(
|
|
583
|
-
if (
|
|
582
|
+
return h.call(v);
|
|
583
|
+
if (v && typeof v.length == "number")
|
|
584
584
|
return { next: function() {
|
|
585
|
-
return
|
|
585
|
+
return v && m >= v.length && (v = void 0), { value: v && v[m++], done: !v };
|
|
586
586
|
} };
|
|
587
587
|
throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
588
|
-
}, z = function(
|
|
589
|
-
var h = typeof Symbol == "function" &&
|
|
588
|
+
}, z = function(v, f) {
|
|
589
|
+
var h = typeof Symbol == "function" && v[Symbol.iterator];
|
|
590
590
|
if (!h)
|
|
591
|
-
return
|
|
592
|
-
var m, g, S = h.call(
|
|
591
|
+
return v;
|
|
592
|
+
var m, g, S = h.call(v), k = [];
|
|
593
593
|
try {
|
|
594
594
|
for (; (f === void 0 || f-- > 0) && !(m = S.next()).done; )
|
|
595
|
-
|
|
596
|
-
} catch (
|
|
597
|
-
g = { error:
|
|
595
|
+
k.push(m.value);
|
|
596
|
+
} catch (L) {
|
|
597
|
+
g = { error: L };
|
|
598
598
|
} finally {
|
|
599
599
|
try {
|
|
600
600
|
m && !m.done && (h = S.return) && h.call(S);
|
|
@@ -603,30 +603,30 @@ var $n = { exports: {} };
|
|
|
603
603
|
throw g.error;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
return
|
|
607
|
-
},
|
|
606
|
+
return k;
|
|
607
|
+
}, _ = function(v, f, h) {
|
|
608
608
|
if (h || arguments.length === 2)
|
|
609
609
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
610
610
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
611
|
-
return
|
|
612
|
-
},
|
|
611
|
+
return v.concat(m || Array.prototype.slice.call(f));
|
|
612
|
+
}, M = function(v) {
|
|
613
613
|
function f() {
|
|
614
|
-
return
|
|
614
|
+
return v.call(this, `EventSource not available.
|
|
615
615
|
Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
|
|
616
616
|
}
|
|
617
|
-
return U(f,
|
|
617
|
+
return U(f, v), f;
|
|
618
618
|
}(Error), V = function() {
|
|
619
|
-
function
|
|
619
|
+
function v(f, h) {
|
|
620
620
|
var m = this;
|
|
621
621
|
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = h != null ? Object.assign({}, h) : 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")
|
|
622
|
-
throw new
|
|
622
|
+
throw new M();
|
|
623
623
|
this._onevent_wrapped = function(g) {
|
|
624
624
|
m._onevent(g);
|
|
625
625
|
}, this._start();
|
|
626
626
|
}
|
|
627
|
-
return
|
|
627
|
+
return v.prototype.dispatchEvent = function(f) {
|
|
628
628
|
throw new Error("Method not implemented.");
|
|
629
|
-
},
|
|
629
|
+
}, v.prototype._start = function() {
|
|
630
630
|
var f, h, m = this, g = this.url;
|
|
631
631
|
this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(B) {
|
|
632
632
|
m._onopen(B);
|
|
@@ -636,23 +636,23 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
636
636
|
m.onmessage(B);
|
|
637
637
|
};
|
|
638
638
|
try {
|
|
639
|
-
for (var S = j(Object.keys(this._listeners)),
|
|
640
|
-
var
|
|
641
|
-
this._eventSource.addEventListener(
|
|
639
|
+
for (var S = j(Object.keys(this._listeners)), k = S.next(); !k.done; k = S.next()) {
|
|
640
|
+
var L = k.value;
|
|
641
|
+
this._eventSource.addEventListener(L, this._onevent_wrapped);
|
|
642
642
|
}
|
|
643
643
|
} catch (B) {
|
|
644
644
|
f = { error: B };
|
|
645
645
|
} finally {
|
|
646
646
|
try {
|
|
647
|
-
|
|
647
|
+
k && !k.done && (h = S.return) && h.call(S);
|
|
648
648
|
} finally {
|
|
649
649
|
if (f)
|
|
650
650
|
throw f.error;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
},
|
|
653
|
+
}, v.prototype._onopen = function(f) {
|
|
654
654
|
this.readyState === 0 && (this.readyState = 1, this.onopen(f));
|
|
655
|
-
},
|
|
655
|
+
}, v.prototype._onerror = function(f) {
|
|
656
656
|
var h = this;
|
|
657
657
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
|
|
658
658
|
this._eventSource.close(), this._eventSource = null;
|
|
@@ -661,45 +661,45 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
661
661
|
return h._start();
|
|
662
662
|
}, m);
|
|
663
663
|
}
|
|
664
|
-
},
|
|
664
|
+
}, v.prototype._onevent = function(f) {
|
|
665
665
|
var h, m;
|
|
666
666
|
f && f.lastEventId && (this._lastEventId = f.lastEventId);
|
|
667
667
|
var g = this._listeners[f.type];
|
|
668
668
|
if (g != null)
|
|
669
669
|
try {
|
|
670
|
-
for (var S = j(
|
|
671
|
-
|
|
672
|
-
} catch (
|
|
673
|
-
h = { error:
|
|
670
|
+
for (var S = j(_([], z(g), !1)), k = S.next(); !k.done; k = S.next())
|
|
671
|
+
k.value.call(this, f);
|
|
672
|
+
} catch (L) {
|
|
673
|
+
h = { error: L };
|
|
674
674
|
} finally {
|
|
675
675
|
try {
|
|
676
|
-
|
|
676
|
+
k && !k.done && (m = S.return) && m.call(S);
|
|
677
677
|
} finally {
|
|
678
678
|
if (h)
|
|
679
679
|
throw h.error;
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
f.type === "message" && this.onmessage(f);
|
|
683
|
-
},
|
|
684
|
-
},
|
|
685
|
-
},
|
|
686
|
-
},
|
|
683
|
+
}, v.prototype.onopen = function(f) {
|
|
684
|
+
}, v.prototype.onerror = function(f) {
|
|
685
|
+
}, v.prototype.onmessage = function(f) {
|
|
686
|
+
}, v.prototype.close = function() {
|
|
687
687
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
688
|
-
},
|
|
688
|
+
}, v.prototype.addEventListener = function(f, h, m) {
|
|
689
689
|
this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
|
|
690
690
|
var g = this._listeners[f];
|
|
691
|
-
g.includes(h) || (this._listeners[f] =
|
|
692
|
-
},
|
|
691
|
+
g.includes(h) || (this._listeners[f] = _(_([], z(g), !1), [h], !1));
|
|
692
|
+
}, v.prototype.removeEventListener = function(f, h, m) {
|
|
693
693
|
var g = this._listeners[f];
|
|
694
694
|
this._listeners[f] = g.filter(function(S) {
|
|
695
695
|
return S !== h;
|
|
696
696
|
});
|
|
697
|
-
},
|
|
697
|
+
}, v;
|
|
698
698
|
}();
|
|
699
699
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
700
|
-
var
|
|
700
|
+
var G = function(v, f) {
|
|
701
701
|
return f = f || {}, new Promise(function(h, m) {
|
|
702
|
-
var g = new XMLHttpRequest(), S = [],
|
|
702
|
+
var g = new XMLHttpRequest(), S = [], k = [], L = {}, B = function() {
|
|
703
703
|
return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
|
|
704
704
|
return Promise.resolve(g.responseText);
|
|
705
705
|
}, json: function() {
|
|
@@ -709,24 +709,24 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
709
709
|
}, clone: B, headers: { keys: function() {
|
|
710
710
|
return S;
|
|
711
711
|
}, entries: function() {
|
|
712
|
-
return
|
|
712
|
+
return k;
|
|
713
713
|
}, get: function(O) {
|
|
714
|
-
return
|
|
714
|
+
return L[O.toLowerCase()];
|
|
715
715
|
}, has: function(O) {
|
|
716
|
-
return O.toLowerCase() in
|
|
716
|
+
return O.toLowerCase() in L;
|
|
717
717
|
} } };
|
|
718
718
|
};
|
|
719
|
-
for (var q in g.open(f.method || "get",
|
|
719
|
+
for (var q in g.open(f.method || "get", v, !0), g.onload = function() {
|
|
720
720
|
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(O, W, ee) {
|
|
721
|
-
S.push(W = W.toLowerCase()),
|
|
721
|
+
S.push(W = W.toLowerCase()), k.push([W, ee]), L[W] = L[W] ? L[W] + "," + ee : ee;
|
|
722
722
|
}), h(B());
|
|
723
723
|
}, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
|
|
724
724
|
g.setRequestHeader(q, f.headers[q]);
|
|
725
725
|
g.send(f.body || null);
|
|
726
726
|
});
|
|
727
|
-
}, $ = E({ AsyncStorage: s, fetch:
|
|
727
|
+
}, $ = E({ AsyncStorage: s, fetch: G, eventSource: V });
|
|
728
728
|
typeof window < "u" && (window.flagsmith = $), n.createFlagsmithInstance = function() {
|
|
729
|
-
return E({ AsyncStorage: s, fetch:
|
|
729
|
+
return E({ AsyncStorage: s, fetch: G, eventSource: V });
|
|
730
730
|
}, n.default = $, Object.defineProperty(n, "__esModule", { value: !0 });
|
|
731
731
|
});
|
|
732
732
|
})($n, $n.exports);
|
|
@@ -818,7 +818,7 @@ var qn = {}, vi = function(t, e, n, s, i) {
|
|
|
818
818
|
for (var r = n[s]; r < n[s + 1]; ++r)
|
|
819
819
|
i[r] = r - n[s] << 5 | s;
|
|
820
820
|
return { b: n, r: i };
|
|
821
|
-
},
|
|
821
|
+
}, Ls = Ds(kt, 2), yi = Ls.b, dt = Ls.r;
|
|
822
822
|
yi[28] = 258, dt[258] = 28;
|
|
823
823
|
var wi = Ds(Tt, 0), cn = wi.r, ft = new re(32768);
|
|
824
824
|
for (var X = 0; X < 32768; ++X) {
|
|
@@ -855,7 +855,7 @@ for (var X = 280; X < 288; ++X)
|
|
|
855
855
|
var tt = new de(32);
|
|
856
856
|
for (var X = 0; X < 32; ++X)
|
|
857
857
|
tt[X] = 5;
|
|
858
|
-
var
|
|
858
|
+
var As = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = function(t) {
|
|
859
859
|
return (t + 7) / 8 | 0;
|
|
860
860
|
}, Fs = function(t, e, n) {
|
|
861
861
|
return (e == null || e < 0) && (e = 0), (n == null || n > t.length) && (n = t.length), new de(t.subarray(e, n));
|
|
@@ -906,29 +906,29 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
906
906
|
l = n[n[u].f < n[d].f ? u++ : d++], c = n[u != a && n[u].f < n[d].f ? u++ : d++], n[a++] = { s: -1, f: l.f + c.f, l, r: c };
|
|
907
907
|
for (var p = r[0].s, s = 1; s < i; ++s)
|
|
908
908
|
r[s].s > p && (p = r[s].s);
|
|
909
|
-
var
|
|
909
|
+
var b = new re(p + 1), w = pt(n[a - 1], b, 0);
|
|
910
910
|
if (w > e) {
|
|
911
|
-
var s = 0,
|
|
912
|
-
for (r.sort(function(D,
|
|
913
|
-
return
|
|
911
|
+
var s = 0, y = 0, x = w - e, C = 1 << x;
|
|
912
|
+
for (r.sort(function(D, A) {
|
|
913
|
+
return b[A.s] - b[D.s] || D.f - A.f;
|
|
914
914
|
}); s < i; ++s) {
|
|
915
|
-
var
|
|
916
|
-
if (
|
|
917
|
-
|
|
915
|
+
var F = r[s].s;
|
|
916
|
+
if (b[F] > e)
|
|
917
|
+
y += C - (1 << w - b[F]), b[F] = e;
|
|
918
918
|
else
|
|
919
919
|
break;
|
|
920
920
|
}
|
|
921
|
-
for (
|
|
921
|
+
for (y >>= x; y > 0; ) {
|
|
922
922
|
var R = r[s].s;
|
|
923
|
-
|
|
923
|
+
b[R] < e ? y -= 1 << e - b[R]++ - 1 : ++s;
|
|
924
924
|
}
|
|
925
|
-
for (; s >= 0 &&
|
|
926
|
-
var
|
|
927
|
-
|
|
925
|
+
for (; s >= 0 && y; --s) {
|
|
926
|
+
var T = r[s].s;
|
|
927
|
+
b[T] == e && (--b[T], ++y);
|
|
928
928
|
}
|
|
929
929
|
w = e;
|
|
930
930
|
}
|
|
931
|
-
return { t: new de(
|
|
931
|
+
return { t: new de(b), l: w };
|
|
932
932
|
}, pt = function(t, e, n) {
|
|
933
933
|
return t.s == -1 ? Math.max(pt(t.l, e, n + 1), pt(t.r, e, n + 1)) : e[t.s] = n;
|
|
934
934
|
}, ln = function(t) {
|
|
@@ -966,86 +966,86 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
966
966
|
return (i + 4 + s) * 8;
|
|
967
967
|
}, un = function(t, e, n, s, i, r, o, l, c, u, a) {
|
|
968
968
|
ve(e, a++, n), ++i[256];
|
|
969
|
-
for (var d = ct(i, 15), p = d.t,
|
|
970
|
-
++
|
|
969
|
+
for (var d = ct(i, 15), p = d.t, b = d.l, w = ct(r, 15), y = w.t, x = w.l, C = ln(p), F = C.c, R = C.n, T = ln(y), N = T.c, D = T.n, A = new re(19), I = 0; I < F.length; ++I)
|
|
970
|
+
++A[F[I] & 31];
|
|
971
971
|
for (var I = 0; I < N.length; ++I)
|
|
972
|
-
++
|
|
973
|
-
for (var E = ct(
|
|
972
|
+
++A[N[I] & 31];
|
|
973
|
+
for (var E = ct(A, 7), P = E.t, U = E.l, j = 19; j > 4 && !P[an[j - 1]]; --j)
|
|
974
974
|
;
|
|
975
|
-
var z = u + 5 << 3,
|
|
976
|
-
if (c >= 0 && z <=
|
|
975
|
+
var z = u + 5 << 3, _ = Ue(i, Ne) + Ue(r, tt) + o, M = Ue(i, p) + Ue(r, y) + o + 14 + 3 * j + Ue(A, P) + 2 * A[16] + 3 * A[17] + 7 * A[18];
|
|
976
|
+
if (c >= 0 && z <= _ && z <= M)
|
|
977
977
|
return En(e, a, t.subarray(c, c + u));
|
|
978
|
-
var V,
|
|
979
|
-
if (ve(e, a, 1 + (
|
|
980
|
-
V = qe(p,
|
|
978
|
+
var V, G, $, v;
|
|
979
|
+
if (ve(e, a, 1 + (M < _)), a += 2, M < _) {
|
|
980
|
+
V = qe(p, b, 0), G = p, $ = qe(y, x, 0), v = y;
|
|
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 = [
|
|
986
|
+
for (var h = [F, 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
|
-
V =
|
|
992
|
+
V = As, G = Ne, $ = Ms, v = tt;
|
|
993
993
|
for (var I = 0; I < l; ++I) {
|
|
994
|
-
var
|
|
995
|
-
if (
|
|
996
|
-
var S =
|
|
997
|
-
ze(e, a, V[S + 257]), a +=
|
|
998
|
-
var
|
|
999
|
-
ze(e, a, $[
|
|
994
|
+
var k = s[I];
|
|
995
|
+
if (k > 255) {
|
|
996
|
+
var S = k >> 18 & 31;
|
|
997
|
+
ze(e, a, V[S + 257]), a += G[S + 257], S > 7 && (ve(e, a, k >> 23 & 31), a += kt[S]);
|
|
998
|
+
var L = k & 31;
|
|
999
|
+
ze(e, a, $[L]), a += v[L], L > 3 && (ze(e, a, k >> 5 & 8191), a += Tt[L]);
|
|
1000
1000
|
} else
|
|
1001
|
-
ze(e, a, V[
|
|
1001
|
+
ze(e, a, V[k]), a += G[k];
|
|
1002
1002
|
}
|
|
1003
|
-
return ze(e, a, V[256]), a +
|
|
1003
|
+
return ze(e, a, V[256]), a + G[256];
|
|
1004
1004
|
}, Bs = /* @__PURE__ */ new xt([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), In = /* @__PURE__ */ new de(0), js = function(t, e, n, s, i, r) {
|
|
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,
|
|
1009
|
-
return (t[ne] ^ t[ne + 1] <<
|
|
1010
|
-
},
|
|
1011
|
-
var z = R(E),
|
|
1012
|
-
if (
|
|
1008
|
+
for (var d = Bs[e - 1], p = d >> 13, b = d & 8191, w = (1 << n) - 1, y = r.p || new re(32768), x = r.h || new re(w + 1), C = Math.ceil(n / 3), F = 2 * C, R = function(ne) {
|
|
1009
|
+
return (t[ne] ^ t[ne + 1] << C ^ t[ne + 2] << F) & w;
|
|
1010
|
+
}, T = new xt(25e3), N = new re(288), D = new re(32), A = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
|
|
1011
|
+
var z = R(E), _ = E & 32767, M = x[z];
|
|
1012
|
+
if (y[_] = M, x[z] = _, U <= E) {
|
|
1013
1013
|
var V = o - E;
|
|
1014
|
-
if ((
|
|
1015
|
-
a = un(t, c, 0,
|
|
1016
|
-
for (var
|
|
1017
|
-
N[
|
|
1018
|
-
for (var
|
|
1019
|
-
D[
|
|
1014
|
+
if ((A > 7e3 || P > 24576) && (V > 423 || !u)) {
|
|
1015
|
+
a = un(t, c, 0, T, N, D, I, P, j, E - j, a), P = A = I = 0, j = E;
|
|
1016
|
+
for (var G = 0; G < 286; ++G)
|
|
1017
|
+
N[G] = 0;
|
|
1018
|
+
for (var G = 0; G < 30; ++G)
|
|
1019
|
+
D[G] = 0;
|
|
1020
1020
|
}
|
|
1021
|
-
var $ = 2,
|
|
1021
|
+
var $ = 2, v = 0, f = b, h = _ - M & 32767;
|
|
1022
1022
|
if (V > 2 && z == R(E - h))
|
|
1023
|
-
for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f &&
|
|
1023
|
+
for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f && _ != M; ) {
|
|
1024
1024
|
if (t[E + $] == t[E + $ - h]) {
|
|
1025
|
-
for (var
|
|
1025
|
+
for (var k = 0; k < S && t[E + k] == t[E + k - h]; ++k)
|
|
1026
1026
|
;
|
|
1027
|
-
if (
|
|
1028
|
-
if ($ =
|
|
1027
|
+
if (k > $) {
|
|
1028
|
+
if ($ = k, v = h, k > m)
|
|
1029
1029
|
break;
|
|
1030
|
-
for (var
|
|
1031
|
-
var q = E - h +
|
|
1032
|
-
W > B && (B = W,
|
|
1030
|
+
for (var L = Math.min(h, k - 2), B = 0, G = 0; G < L; ++G) {
|
|
1031
|
+
var q = E - h + G & 32767, O = y[q], W = q - O & 32767;
|
|
1032
|
+
W > B && (B = W, M = q);
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
|
|
1036
|
+
_ = M, M = y[_], h += _ - M & 32767;
|
|
1037
1037
|
}
|
|
1038
|
-
if (
|
|
1039
|
-
|
|
1040
|
-
var ee = dt[$] & 31, oe = cn[
|
|
1041
|
-
I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++
|
|
1038
|
+
if (v) {
|
|
1039
|
+
T[P++] = 268435456 | dt[$] << 18 | cn[v];
|
|
1040
|
+
var ee = dt[$] & 31, oe = cn[v] & 31;
|
|
1041
|
+
I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++A;
|
|
1042
1042
|
} else
|
|
1043
|
-
|
|
1043
|
+
T[P++] = t[E], ++N[t[E]];
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
for (E = Math.max(E, U); E < o; ++E)
|
|
1047
|
-
|
|
1048
|
-
a = un(t, c, u,
|
|
1047
|
+
T[P++] = t[E], ++N[t[E]];
|
|
1048
|
+
a = un(t, c, u, T, N, D, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = x, r.p = y, 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;
|
|
@@ -1121,7 +1121,7 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
|
|
|
1121
1121
|
var c = xi({}, nt[n].e);
|
|
1122
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,
|
|
1124
|
+
return [de, re, xt, kt, Tt, an, dt, cn, As, 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) {
|
|
@@ -1207,11 +1207,11 @@ class Di {
|
|
|
1207
1207
|
this.dict = new Gn();
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
|
-
class
|
|
1210
|
+
class Li {
|
|
1211
1211
|
constructor(e, n) {
|
|
1212
1212
|
this.app = e, this.startParams = n, this.conditions = [], this.hasStarted = !1, this.createConditionFromFilter = (s) => {
|
|
1213
1213
|
if (s.value.length) {
|
|
1214
|
-
const i =
|
|
1214
|
+
const i = Ai(s);
|
|
1215
1215
|
if (i.type)
|
|
1216
1216
|
return i;
|
|
1217
1217
|
}
|
|
@@ -1354,7 +1354,7 @@ const Pe = {
|
|
|
1354
1354
|
greaterOrEqual: (t, e) => t >= e,
|
|
1355
1355
|
lessOrEqual: (t, e) => t <= e,
|
|
1356
1356
|
lessThan: (t, e) => t < e
|
|
1357
|
-
},
|
|
1357
|
+
}, Ai = (t) => {
|
|
1358
1358
|
const e = {
|
|
1359
1359
|
on: "is",
|
|
1360
1360
|
notOn: "isNot",
|
|
@@ -1556,7 +1556,7 @@ function Nn(t) {
|
|
|
1556
1556
|
let e = t.getAttribute("data-openreplay-label");
|
|
1557
1557
|
return e !== null || (e = t.getAttribute("data-asayer-label"), e !== null && _e('"data-asayer-label" attribute', '"data-openreplay-label" attribute', "/")), e;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function Le(t, e) {
|
|
1560
1560
|
const n = `data-openreplay-${e}`;
|
|
1561
1561
|
return t.hasAttribute(n) ? (Kn[e] && _e(
|
|
1562
1562
|
`"${n}" attribute`,
|
|
@@ -2294,7 +2294,7 @@ const Er = {
|
|
|
2294
2294
|
fontSize: "13px",
|
|
2295
2295
|
height: "24px",
|
|
2296
2296
|
width: "24px"
|
|
2297
|
-
},
|
|
2297
|
+
}, Lr = {
|
|
2298
2298
|
display: "flex",
|
|
2299
2299
|
flexDirection: "column",
|
|
2300
2300
|
alignItems: "center",
|
|
@@ -2318,7 +2318,7 @@ const Er = {
|
|
|
2318
2318
|
alignSelf: "stretch"
|
|
2319
2319
|
}, hs = {
|
|
2320
2320
|
fontWeight: "bold"
|
|
2321
|
-
},
|
|
2321
|
+
}, Ar = {
|
|
2322
2322
|
fontSize: "13px",
|
|
2323
2323
|
lineHeight: "auto"
|
|
2324
2324
|
}, Zs = {
|
|
@@ -2501,10 +2501,10 @@ class Wr {
|
|
|
2501
2501
|
tasks: []
|
|
2502
2502
|
}, this.getDurations = () => this.durations, this.setDurations = (d) => {
|
|
2503
2503
|
this.durations.testStart = d.testStart, this.durations.tasks = d.tasks;
|
|
2504
|
-
}, this.signalTask = (d, p,
|
|
2504
|
+
}, this.signalTask = (d, p, b) => {
|
|
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((C) => C.taskId === d), y = this.getTimestamp(), x = w ? y - w.started : 0;
|
|
2508
2508
|
return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`, {
|
|
2509
2509
|
method: "POST",
|
|
2510
2510
|
headers: {
|
|
@@ -2515,19 +2515,19 @@ class Wr {
|
|
|
2515
2515
|
testId: this.testId,
|
|
2516
2516
|
taskId: d,
|
|
2517
2517
|
status: p,
|
|
2518
|
-
duration:
|
|
2519
|
-
timestamp:
|
|
2520
|
-
taskAnswer:
|
|
2518
|
+
duration: x,
|
|
2519
|
+
timestamp: y,
|
|
2520
|
+
taskAnswer: b
|
|
2521
2521
|
})
|
|
2522
2522
|
});
|
|
2523
2523
|
}, this.signalTest = (d) => {
|
|
2524
2524
|
const p = this.getTimestamp();
|
|
2525
2525
|
if (d === "begin" && this.testId) {
|
|
2526
|
-
const
|
|
2527
|
-
this.setStorageKey(bn,
|
|
2526
|
+
const y = this.getSessionId();
|
|
2527
|
+
this.setStorageKey(bn, y), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
|
|
2528
2528
|
} else
|
|
2529
2529
|
this.removeStorageKey(this.storageKey), this.removeStorageKey(mn), this.removeStorageKey(ut);
|
|
2530
|
-
const
|
|
2530
|
+
const b = this.durations.testStart || p, w = p - b;
|
|
2531
2531
|
return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`, {
|
|
2532
2532
|
method: "POST",
|
|
2533
2533
|
headers: {
|
|
@@ -2647,11 +2647,11 @@ class Vr {
|
|
|
2647
2647
|
}, c.onclick = () => {
|
|
2648
2648
|
var a, d, p;
|
|
2649
2649
|
if (u(), this.test) {
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2650
|
+
const b = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = b ? b.tasks.findIndex((y) => this.test && y.taskId === this.test.tasks[0].task_id) : null;
|
|
2651
|
+
b && w === -1 && (b.tasks.push({
|
|
2652
2652
|
taskId: this.test.tasks[0].task_id,
|
|
2653
2653
|
started: this.app.timestamp()
|
|
2654
|
-
}), (d = this.signalManager) == null || d.setDurations(
|
|
2654
|
+
}), (d = this.signalManager) == null || d.setDurations(b)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
|
|
2655
2655
|
}
|
|
2656
2656
|
this.showTaskSection(), o.removeChild(c);
|
|
2657
2657
|
}, n;
|
|
@@ -2662,19 +2662,19 @@ class Vr {
|
|
|
2662
2662
|
fontSize: "13px",
|
|
2663
2663
|
fontWeight: "500",
|
|
2664
2664
|
lineHeight: "auto"
|
|
2665
|
-
}, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription",
|
|
2665
|
+
}, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription", Ar), d = H("div", "taskButtons", Fr), p = H("div", "taskText", hs);
|
|
2666
2666
|
p.textContent = "Your answer";
|
|
2667
|
-
const
|
|
2667
|
+
const b = H("textarea", "taskDescription", {
|
|
2668
2668
|
resize: "vertical"
|
|
2669
2669
|
}), w = H("div", "inputArea", us);
|
|
2670
|
-
w.append(p,
|
|
2671
|
-
const
|
|
2672
|
-
s.append(i, r), c.append(u, a), d.append(
|
|
2673
|
-
const
|
|
2674
|
-
const
|
|
2675
|
-
u.textContent =
|
|
2670
|
+
w.append(p, b);
|
|
2671
|
+
const y = H("div", "closePanelButton", Zs, "Collapse Panel"), x = H("div", "nextButton", Mr, "Done, Next");
|
|
2672
|
+
s.append(i, r), c.append(u, a), d.append(y, x), o.append(l, c, w, d), n.append(s, o);
|
|
2673
|
+
const C = () => {
|
|
2674
|
+
const T = e[this.currentTaskIndex];
|
|
2675
|
+
u.textContent = T.title, a.textContent = T.description, T.allow_typing ? w.style.display = "flex" : w.style.display = "none";
|
|
2676
2676
|
};
|
|
2677
|
-
e.forEach((
|
|
2677
|
+
e.forEach((T, N) => {
|
|
2678
2678
|
const D = H("span", `or_task_${N}`, {
|
|
2679
2679
|
outline: "1px solid #efefef",
|
|
2680
2680
|
fontSize: "13px",
|
|
@@ -2688,36 +2688,36 @@ class Vr {
|
|
|
2688
2688
|
}, (N + 1).toString());
|
|
2689
2689
|
D.id = `or_task_${N}`, l.append(D);
|
|
2690
2690
|
});
|
|
2691
|
-
const
|
|
2691
|
+
const F = () => {
|
|
2692
2692
|
this.widgetTasksVisible = !this.widgetTasksVisible, r.textContent = this.widgetTasksVisible ? "-" : "+", Object.assign(o.style, this.widgetTasksVisible ? Be : { display: "none" });
|
|
2693
2693
|
};
|
|
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
2697
|
const R = () => {
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2698
|
+
const T = document.getElementById(`or_task_${this.currentTaskIndex}`);
|
|
2699
|
+
T && Object.assign(T.style, ls);
|
|
2700
2700
|
for (let N = 0; N < this.currentTaskIndex; N++) {
|
|
2701
2701
|
const D = document.getElementById(`or_task_${N}`);
|
|
2702
|
-
D && Object.assign(D.style,
|
|
2702
|
+
D && Object.assign(D.style, Lr);
|
|
2703
2703
|
}
|
|
2704
2704
|
};
|
|
2705
|
-
return s.onclick =
|
|
2706
|
-
var N, D,
|
|
2707
|
-
const
|
|
2708
|
-
if (
|
|
2709
|
-
this.currentTaskIndex++,
|
|
2705
|
+
return s.onclick = F, y.onclick = this.collapseWidget, x.onclick = () => {
|
|
2706
|
+
var N, D, A, I;
|
|
2707
|
+
const T = e[this.currentTaskIndex].allow_typing ? b.value : void 0;
|
|
2708
|
+
if (b.value = "", (N = this.signalManager) == null || N.signalTask(e[this.currentTaskIndex].task_id, "done", T), this.currentTaskIndex < e.length - 1) {
|
|
2709
|
+
this.currentTaskIndex++, C();
|
|
2710
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
|
-
}), (
|
|
2714
|
+
}), (A = this.signalManager) == null || A.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
|
-
const
|
|
2720
|
-
|
|
2719
|
+
const T = document.getElementById("or_task_0");
|
|
2720
|
+
T && Object.assign(T.style, ls), C(), R();
|
|
2721
2721
|
}, 1), n;
|
|
2722
2722
|
}
|
|
2723
2723
|
showEndSection() {
|
|
@@ -3222,7 +3222,7 @@ class to extends Rn {
|
|
|
3222
3222
|
super(e, !0), this.iframeOffsets = new eo(), this.contextCallbacks = [], this.contextsSet = /* @__PURE__ */ new Set(), this.iframeObservers = [], this.shadowRootObservers = [], this.options = Object.assign({
|
|
3223
3223
|
captureIFrames: !0
|
|
3224
3224
|
}, n), this.app.nodes.attachNodeCallback((s) => {
|
|
3225
|
-
Z(s, "iframe") && (this.options.captureIFrames && !
|
|
3225
|
+
Z(s, "iframe") && (this.options.captureIFrames && !Le(s, "obscured") || Le(s, "capture")) && this.handleIframe(s);
|
|
3226
3226
|
}), this.app.nodes.attachNodeCallback((s) => {
|
|
3227
3227
|
ke(s) && s.shadowRoot !== null && this.handleShadowRoot(s.shadowRoot);
|
|
3228
3228
|
});
|
|
@@ -3287,7 +3287,7 @@ class so {
|
|
|
3287
3287
|
}, n);
|
|
3288
3288
|
}
|
|
3289
3289
|
handleNode(e, n, s) {
|
|
3290
|
-
if ((this.obscured.has(n) || ke(s) && (
|
|
3290
|
+
if ((this.obscured.has(n) || ke(s) && (Le(s, "masked") || Le(s, "obscured"))) && this.obscured.add(e), (this.hidden.has(n) || ke(s) && (Le(s, "htmlmasked") || Le(s, "hidden"))) && this.hidden.add(e), this.options.domSanitizer !== void 0 && ke(s)) {
|
|
3291
3291
|
const i = this.options.domSanitizer(s);
|
|
3292
3292
|
i === yt.Obscured && this.obscured.add(e), i === yt.Hidden && this.hidden.add(e);
|
|
3293
3293
|
}
|
|
@@ -3521,62 +3521,62 @@ let lo = class {
|
|
|
3521
3521
|
const u = (a) => {
|
|
3522
3522
|
const { data: d } = a;
|
|
3523
3523
|
if (d.line === ue.iframeSignal) {
|
|
3524
|
-
const p = d.domain,
|
|
3525
|
-
this.pageFrames =
|
|
3526
|
-
let
|
|
3527
|
-
for (;
|
|
3528
|
-
const
|
|
3529
|
-
if (
|
|
3524
|
+
const p = d.domain, b = Array.from(document.querySelectorAll("iframe"));
|
|
3525
|
+
this.pageFrames = b, (async () => {
|
|
3526
|
+
let y = 0;
|
|
3527
|
+
for (; y < 10; ) {
|
|
3528
|
+
const x = this.checkNodeId(b, p);
|
|
3529
|
+
if (x) {
|
|
3530
3530
|
this.waitStarted().then(() => {
|
|
3531
3531
|
var R;
|
|
3532
3532
|
c++;
|
|
3533
|
-
const
|
|
3533
|
+
const C = this.session.getSessionToken(), F = {
|
|
3534
3534
|
line: ue.iframeId,
|
|
3535
3535
|
context: this.contextId,
|
|
3536
3536
|
domain: p,
|
|
3537
|
-
id:
|
|
3538
|
-
token:
|
|
3537
|
+
id: x,
|
|
3538
|
+
token: C,
|
|
3539
3539
|
frameOrderNumber: c
|
|
3540
3540
|
};
|
|
3541
|
-
this.debug.log("iframe_data",
|
|
3542
|
-
}).catch(console.error),
|
|
3541
|
+
this.debug.log("iframe_data", F), (R = a.source) == null || R.postMessage(F, "*");
|
|
3542
|
+
}).catch(console.error), y = 10;
|
|
3543
3543
|
break;
|
|
3544
3544
|
}
|
|
3545
|
-
|
|
3545
|
+
y++, await co(100);
|
|
3546
3546
|
}
|
|
3547
3547
|
})();
|
|
3548
3548
|
}
|
|
3549
3549
|
if (d.line === ue.iframeBatch) {
|
|
3550
|
-
const
|
|
3550
|
+
const b = d.messages.map((w) => {
|
|
3551
3551
|
if (w[0] === 20) {
|
|
3552
|
-
let
|
|
3553
|
-
return this.pageFrames.forEach((
|
|
3554
|
-
if (
|
|
3555
|
-
const [
|
|
3556
|
-
|
|
3552
|
+
let y = w;
|
|
3553
|
+
return this.pageFrames.forEach((x) => {
|
|
3554
|
+
if (x.dataset.domain === a.data.domain) {
|
|
3555
|
+
const [C, F, R] = w, { left: T, top: N } = x.getBoundingClientRect();
|
|
3556
|
+
y = [C, F + T, R + N];
|
|
3557
3557
|
}
|
|
3558
|
-
}),
|
|
3558
|
+
}), y;
|
|
3559
3559
|
}
|
|
3560
3560
|
if (w[0] === 68) {
|
|
3561
|
-
let
|
|
3562
|
-
return this.pageFrames.forEach((
|
|
3563
|
-
if (
|
|
3564
|
-
const [
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3561
|
+
let y = w;
|
|
3562
|
+
return this.pageFrames.forEach((x) => {
|
|
3563
|
+
if (x.dataset.domain === a.data.domain) {
|
|
3564
|
+
const [C, F, R, T, N, D, A] = w, { left: I, top: E, width: P, height: U } = x.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, _ = D / 100 * P + I, M = A / 100 * U + E, V = _ / j, G = M / z;
|
|
3565
|
+
y = [
|
|
3566
|
+
C,
|
|
3567
|
+
F,
|
|
3568
3568
|
R,
|
|
3569
|
-
|
|
3569
|
+
T,
|
|
3570
3570
|
N,
|
|
3571
3571
|
Math.round(V * 1e3) / 10,
|
|
3572
|
-
Math.round(
|
|
3572
|
+
Math.round(G * 1e3) / 10
|
|
3573
3573
|
];
|
|
3574
3574
|
}
|
|
3575
|
-
}),
|
|
3575
|
+
}), y;
|
|
3576
3576
|
}
|
|
3577
3577
|
return w;
|
|
3578
3578
|
});
|
|
3579
|
-
this.messages.push(...
|
|
3579
|
+
this.messages.push(...b);
|
|
3580
3580
|
}
|
|
3581
3581
|
};
|
|
3582
3582
|
window.addEventListener("message", u), this.attachStopCallback(() => {
|
|
@@ -3837,8 +3837,8 @@ let lo = class {
|
|
|
3837
3837
|
}, 30 * s), r();
|
|
3838
3838
|
}
|
|
3839
3839
|
async setupConditionalStart(e) {
|
|
3840
|
-
var p,
|
|
3841
|
-
this.conditionsManager = new
|
|
3840
|
+
var p, b;
|
|
3841
|
+
this.conditionsManager = new Li(this, e);
|
|
3842
3842
|
const n = await fetch(this.options.ingestPoint + "/v1/web/start", {
|
|
3843
3843
|
method: "POST",
|
|
3844
3844
|
headers: {
|
|
@@ -3878,7 +3878,7 @@ let lo = class {
|
|
|
3878
3878
|
userState: u
|
|
3879
3879
|
});
|
|
3880
3880
|
const d = { sessionToken: s, userUUID: "", sessionID: "" };
|
|
3881
|
-
this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (
|
|
3881
|
+
this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(a, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (b = this.conditionsManager) == null || b.processFlags(this.featureFlags.flags);
|
|
3882
3882
|
}
|
|
3883
3883
|
/**
|
|
3884
3884
|
* Starts offline session recording
|
|
@@ -3935,7 +3935,7 @@ let lo = class {
|
|
|
3935
3935
|
* @reject {string} - error message
|
|
3936
3936
|
* */
|
|
3937
3937
|
async uploadOfflineRecording() {
|
|
3938
|
-
var p,
|
|
3938
|
+
var p, b;
|
|
3939
3939
|
this.stop(!1);
|
|
3940
3940
|
const e = pe();
|
|
3941
3941
|
(p = this.worker) == null || p.postMessage({
|
|
@@ -3965,7 +3965,7 @@ let lo = class {
|
|
|
3965
3965
|
timezone: tn()
|
|
3966
3966
|
})
|
|
3967
3967
|
}), { token: s, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: c, userState: u, beaconSizeLimit: a, projectID: d } = await n.json();
|
|
3968
|
-
for ((
|
|
3968
|
+
for ((b = this.worker) == null || b.postMessage({
|
|
3969
3969
|
type: "auth",
|
|
3970
3970
|
token: s,
|
|
3971
3971
|
beaconSizeLimit: a
|
|
@@ -4029,68 +4029,68 @@ let lo = class {
|
|
|
4029
4029
|
})
|
|
4030
4030
|
});
|
|
4031
4031
|
if (c.status !== 200) {
|
|
4032
|
-
const
|
|
4033
|
-
return Ce(
|
|
4032
|
+
const _ = await c.text(), M = _ === Qe ? Qe : `Server error: ${c.status}. ${_}`;
|
|
4033
|
+
return Ce(M);
|
|
4034
4034
|
}
|
|
4035
4035
|
if (!this.worker) {
|
|
4036
|
-
const
|
|
4037
|
-
return this.signalError(
|
|
4036
|
+
const _ = "no worker found after start request (this should not happen in real world)";
|
|
4037
|
+
return this.signalError(_, []), Ce(_);
|
|
4038
4038
|
}
|
|
4039
4039
|
const {
|
|
4040
4040
|
token: u,
|
|
4041
4041
|
userUUID: a,
|
|
4042
4042
|
projectID: d,
|
|
4043
4043
|
beaconSizeLimit: p,
|
|
4044
|
-
compressionThreshold:
|
|
4044
|
+
compressionThreshold: b,
|
|
4045
4045
|
// how big the batch should be before we decide to compress it
|
|
4046
4046
|
delay: w,
|
|
4047
4047
|
// derived from token
|
|
4048
|
-
sessionID:
|
|
4048
|
+
sessionID: y,
|
|
4049
4049
|
// derived from token
|
|
4050
|
-
startTimestamp:
|
|
4050
|
+
startTimestamp: x,
|
|
4051
4051
|
// real startTS (server time), derived from sessionID
|
|
4052
|
-
userBrowser:
|
|
4053
|
-
userCity:
|
|
4052
|
+
userBrowser: C,
|
|
4053
|
+
userCity: F,
|
|
4054
4054
|
userCountry: R,
|
|
4055
|
-
userDevice:
|
|
4055
|
+
userDevice: T,
|
|
4056
4056
|
userOS: N,
|
|
4057
4057
|
userState: D,
|
|
4058
|
-
canvasEnabled:
|
|
4058
|
+
canvasEnabled: A,
|
|
4059
4059
|
canvasQuality: I,
|
|
4060
4060
|
canvasFPS: E,
|
|
4061
4061
|
assistOnly: P
|
|
4062
4062
|
} = await c.json();
|
|
4063
|
-
if (typeof u != "string" || typeof a != "string" || typeof
|
|
4064
|
-
const
|
|
4065
|
-
return this.signalError(
|
|
4063
|
+
if (typeof u != "string" || typeof a != "string" || typeof x != "number" && typeof x < "u" || typeof y != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
|
|
4064
|
+
const _ = `Incorrect server response: ${JSON.stringify(c)}`;
|
|
4065
|
+
return this.signalError(_, []), Ce(_);
|
|
4066
4066
|
}
|
|
4067
4067
|
this.delay = w, this.session.setSessionToken(u), this.session.setUserInfo({
|
|
4068
|
-
userBrowser:
|
|
4069
|
-
userCity:
|
|
4068
|
+
userBrowser: C,
|
|
4069
|
+
userCity: F,
|
|
4070
4070
|
userCountry: R,
|
|
4071
|
-
userDevice:
|
|
4071
|
+
userDevice: T,
|
|
4072
4072
|
userOS: N,
|
|
4073
4073
|
userState: D
|
|
4074
4074
|
}), this.session.assign({
|
|
4075
|
-
sessionID:
|
|
4076
|
-
timestamp:
|
|
4075
|
+
sessionID: y,
|
|
4076
|
+
timestamp: x || r,
|
|
4077
4077
|
projectID: d
|
|
4078
4078
|
}), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
|
|
4079
4079
|
type: "auth",
|
|
4080
4080
|
token: u,
|
|
4081
4081
|
beaconSizeLimit: p
|
|
4082
|
-
}), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([
|
|
4083
|
-
const U = { sessionToken: u, userUUID: a, sessionID:
|
|
4084
|
-
if (this.startCallbacks.forEach((
|
|
4082
|
+
}), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([_, M]) => this.send(Qn(_, M))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = b;
|
|
4083
|
+
const U = { sessionToken: u, userUUID: a, sessionID: y };
|
|
4084
|
+
if (this.startCallbacks.forEach((_) => _(U)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, u), this.activityState = Q.Active, A && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new Kr(this, {
|
|
4085
4085
|
fps: E,
|
|
4086
4086
|
quality: I,
|
|
4087
4087
|
isDebug: this.options.canvas.__save_canvas_locally,
|
|
4088
4088
|
fixedScaling: this.options.canvas.fixedCanvasScaling,
|
|
4089
4089
|
useAnimationFrame: this.options.canvas.useAnimationFrame
|
|
4090
4090
|
}), this.canvasRecorder.startTracking()), i) {
|
|
4091
|
-
const
|
|
4092
|
-
for (;
|
|
4093
|
-
await this.flushBuffer(
|
|
4091
|
+
const _ = this.bufferedMessages1.length > this.bufferedMessages2.length ? this.bufferedMessages1 : this.bufferedMessages2;
|
|
4092
|
+
for (; _.length > 0; )
|
|
4093
|
+
await this.flushBuffer(_);
|
|
4094
4094
|
this.clearBuffers(), this.commit();
|
|
4095
4095
|
} else
|
|
4096
4096
|
this.insideIframe && this.rootId ? this.observer.crossdomainObserve(this.rootId, this.frameOderNumber) : this.observer.observe(), this.ticker.start();
|
|
@@ -4098,14 +4098,14 @@ let lo = class {
|
|
|
4098
4098
|
let j;
|
|
4099
4099
|
const z = this.localStorage.getItem(gs);
|
|
4100
4100
|
if (z && (j = parseInt(z, 10)), location != null && location.search) {
|
|
4101
|
-
const
|
|
4102
|
-
if (
|
|
4103
|
-
const
|
|
4104
|
-
j =
|
|
4101
|
+
const _ = new URLSearchParams(location.search);
|
|
4102
|
+
if (_.has("oruxt")) {
|
|
4103
|
+
const M = _.get("oruxt");
|
|
4104
|
+
j = M ? parseInt(M, 10) : void 0;
|
|
4105
4105
|
}
|
|
4106
4106
|
}
|
|
4107
|
-
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((
|
|
4108
|
-
|
|
4107
|
+
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((_) => _(j)) : this.uxtManager.getTest(j, u, !!z).then((_) => {
|
|
4108
|
+
_ && this.onUxtCb.forEach((M) => M(_));
|
|
4109
4109
|
})), ao(U);
|
|
4110
4110
|
} catch (c) {
|
|
4111
4111
|
if (this.stop(), this.session.reset(), c === Qe)
|
|
@@ -4259,8 +4259,8 @@ function go(t, e) {
|
|
|
4259
4259
|
t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
|
|
4260
4260
|
const o = (c, u) => {
|
|
4261
4261
|
const a = {
|
|
4262
|
-
apply: function(d, p,
|
|
4263
|
-
Reflect.apply(d, u,
|
|
4262
|
+
apply: function(d, p, b) {
|
|
4263
|
+
Reflect.apply(d, u, b), i = i + 1, !(i > n.consoleThrottling) && s(d.name, b);
|
|
4264
4264
|
}
|
|
4265
4265
|
};
|
|
4266
4266
|
n.consoleMethods.forEach((d) => {
|
|
@@ -4280,77 +4280,77 @@ function mo() {
|
|
|
4280
4280
|
(function(n, s) {
|
|
4281
4281
|
t.exports = s();
|
|
4282
4282
|
})($e, function() {
|
|
4283
|
-
function n(
|
|
4284
|
-
return !isNaN(parseFloat(
|
|
4283
|
+
function n(y) {
|
|
4284
|
+
return !isNaN(parseFloat(y)) && isFinite(y);
|
|
4285
4285
|
}
|
|
4286
|
-
function s(
|
|
4287
|
-
return
|
|
4286
|
+
function s(y) {
|
|
4287
|
+
return y.charAt(0).toUpperCase() + y.substring(1);
|
|
4288
4288
|
}
|
|
4289
|
-
function i(
|
|
4289
|
+
function i(y) {
|
|
4290
4290
|
return function() {
|
|
4291
|
-
return this[
|
|
4291
|
+
return this[y];
|
|
4292
4292
|
};
|
|
4293
4293
|
}
|
|
4294
4294
|
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], c = ["args"], u = ["evalOrigin"], a = r.concat(o, l, c, u);
|
|
4295
|
-
function d(
|
|
4296
|
-
if (
|
|
4297
|
-
for (var
|
|
4298
|
-
|
|
4295
|
+
function d(y) {
|
|
4296
|
+
if (y)
|
|
4297
|
+
for (var x = 0; x < a.length; x++)
|
|
4298
|
+
y[a[x]] !== void 0 && this["set" + s(a[x])](y[a[x]]);
|
|
4299
4299
|
}
|
|
4300
4300
|
d.prototype = {
|
|
4301
4301
|
getArgs: function() {
|
|
4302
4302
|
return this.args;
|
|
4303
4303
|
},
|
|
4304
|
-
setArgs: function(
|
|
4305
|
-
if (Object.prototype.toString.call(
|
|
4304
|
+
setArgs: function(y) {
|
|
4305
|
+
if (Object.prototype.toString.call(y) !== "[object Array]")
|
|
4306
4306
|
throw new TypeError("Args must be an Array");
|
|
4307
|
-
this.args =
|
|
4307
|
+
this.args = y;
|
|
4308
4308
|
},
|
|
4309
4309
|
getEvalOrigin: function() {
|
|
4310
4310
|
return this.evalOrigin;
|
|
4311
4311
|
},
|
|
4312
|
-
setEvalOrigin: function(
|
|
4313
|
-
if (
|
|
4314
|
-
this.evalOrigin =
|
|
4315
|
-
else if (
|
|
4316
|
-
this.evalOrigin = new d(
|
|
4312
|
+
setEvalOrigin: function(y) {
|
|
4313
|
+
if (y instanceof d)
|
|
4314
|
+
this.evalOrigin = y;
|
|
4315
|
+
else if (y instanceof Object)
|
|
4316
|
+
this.evalOrigin = new d(y);
|
|
4317
4317
|
else
|
|
4318
4318
|
throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
4319
4319
|
},
|
|
4320
4320
|
toString: function() {
|
|
4321
|
-
var
|
|
4322
|
-
return this.getIsEval() ?
|
|
4321
|
+
var y = this.getFileName() || "", x = this.getLineNumber() || "", C = this.getColumnNumber() || "", F = this.getFunctionName() || "";
|
|
4322
|
+
return this.getIsEval() ? y ? "[eval] (" + y + ":" + x + ":" + C + ")" : "[eval]:" + x + ":" + C : F ? F + " (" + y + ":" + x + ":" + C + ")" : y + ":" + x + ":" + C;
|
|
4323
4323
|
}
|
|
4324
|
-
}, d.fromString = function(
|
|
4325
|
-
var
|
|
4324
|
+
}, d.fromString = function(x) {
|
|
4325
|
+
var C = x.indexOf("("), F = x.lastIndexOf(")"), R = x.substring(0, C), T = x.substring(C + 1, F).split(","), N = x.substring(F + 1);
|
|
4326
4326
|
if (N.indexOf("@") === 0)
|
|
4327
|
-
var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""),
|
|
4327
|
+
var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""), A = D[1], I = D[2], E = D[3];
|
|
4328
4328
|
return new d({
|
|
4329
4329
|
functionName: R,
|
|
4330
|
-
args:
|
|
4331
|
-
fileName:
|
|
4330
|
+
args: T || void 0,
|
|
4331
|
+
fileName: A,
|
|
4332
4332
|
lineNumber: I || void 0,
|
|
4333
4333
|
columnNumber: E || void 0
|
|
4334
4334
|
});
|
|
4335
4335
|
};
|
|
4336
4336
|
for (var p = 0; p < r.length; p++)
|
|
4337
|
-
d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(
|
|
4338
|
-
return function(
|
|
4339
|
-
this[
|
|
4337
|
+
d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(y) {
|
|
4338
|
+
return function(x) {
|
|
4339
|
+
this[y] = !!x;
|
|
4340
4340
|
};
|
|
4341
4341
|
}(r[p]);
|
|
4342
|
-
for (var
|
|
4343
|
-
d.prototype["get" + s(o[
|
|
4344
|
-
return function(
|
|
4345
|
-
if (!n(
|
|
4346
|
-
throw new TypeError(
|
|
4347
|
-
this[
|
|
4342
|
+
for (var b = 0; b < o.length; b++)
|
|
4343
|
+
d.prototype["get" + s(o[b])] = i(o[b]), d.prototype["set" + s(o[b])] = /* @__PURE__ */ function(y) {
|
|
4344
|
+
return function(x) {
|
|
4345
|
+
if (!n(x))
|
|
4346
|
+
throw new TypeError(y + " must be a Number");
|
|
4347
|
+
this[y] = Number(x);
|
|
4348
4348
|
};
|
|
4349
|
-
}(o[
|
|
4349
|
+
}(o[b]);
|
|
4350
4350
|
for (var w = 0; w < l.length; w++)
|
|
4351
|
-
d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(
|
|
4352
|
-
return function(
|
|
4353
|
-
this[
|
|
4351
|
+
d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(y) {
|
|
4352
|
+
return function(x) {
|
|
4353
|
+
this[y] = String(x);
|
|
4354
4354
|
};
|
|
4355
4355
|
}(l[w]);
|
|
4356
4356
|
return d;
|
|
@@ -4394,12 +4394,12 @@ function mo() {
|
|
|
4394
4394
|
a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
4395
4395
|
var d = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
|
|
4396
4396
|
d = p ? d.replace(p[0], "") : d;
|
|
4397
|
-
var
|
|
4397
|
+
var b = this.extractLocation(p ? p[1] : d), w = p && d || void 0, y = ["eval", "<anonymous>"].indexOf(b[0]) > -1 ? void 0 : b[0];
|
|
4398
4398
|
return new s({
|
|
4399
4399
|
functionName: w,
|
|
4400
|
-
fileName:
|
|
4401
|
-
lineNumber:
|
|
4402
|
-
columnNumber:
|
|
4400
|
+
fileName: y,
|
|
4401
|
+
lineNumber: b[1],
|
|
4402
|
+
columnNumber: b[2],
|
|
4403
4403
|
source: a
|
|
4404
4404
|
});
|
|
4405
4405
|
}, this);
|
|
@@ -4414,9 +4414,9 @@ function mo() {
|
|
|
4414
4414
|
return new s({
|
|
4415
4415
|
functionName: a
|
|
4416
4416
|
});
|
|
4417
|
-
var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d),
|
|
4417
|
+
var d = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = a.match(d), b = p && p[1] ? p[1] : void 0, w = this.extractLocation(a.replace(d, ""));
|
|
4418
4418
|
return new s({
|
|
4419
|
-
functionName:
|
|
4419
|
+
functionName: b,
|
|
4420
4420
|
fileName: w[0],
|
|
4421
4421
|
lineNumber: w[1],
|
|
4422
4422
|
columnNumber: w[2],
|
|
@@ -4432,7 +4432,7 @@ function mo() {
|
|
|
4432
4432
|
},
|
|
4433
4433
|
parseOpera9: function(c) {
|
|
4434
4434
|
for (var u = /Line (\d+).*script (?:in )?(\S+)/i, a = c.message.split(`
|
|
4435
|
-
`), d = [], p = 2,
|
|
4435
|
+
`), d = [], p = 2, b = a.length; p < b; p += 2) {
|
|
4436
4436
|
var w = u.exec(a[p]);
|
|
4437
4437
|
w && d.push(new s({
|
|
4438
4438
|
fileName: w[2],
|
|
@@ -4444,7 +4444,7 @@ function mo() {
|
|
|
4444
4444
|
},
|
|
4445
4445
|
parseOpera10: function(c) {
|
|
4446
4446
|
for (var u = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, a = c.stacktrace.split(`
|
|
4447
|
-
`), d = [], p = 0,
|
|
4447
|
+
`), d = [], p = 0, b = a.length; p < b; p += 2) {
|
|
4448
4448
|
var w = u.exec(a[p]);
|
|
4449
4449
|
w && d.push(
|
|
4450
4450
|
new s({
|
|
@@ -4464,12 +4464,12 @@ function mo() {
|
|
|
4464
4464
|
return !!a.match(i) && !a.match(/^Error created at/);
|
|
4465
4465
|
}, this);
|
|
4466
4466
|
return u.map(function(a) {
|
|
4467
|
-
var d = a.split("@"), p = this.extractLocation(d.pop()),
|
|
4468
|
-
|
|
4469
|
-
var
|
|
4467
|
+
var d = a.split("@"), p = this.extractLocation(d.pop()), b = d.shift() || "", w = b.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, y;
|
|
4468
|
+
b.match(/\(([^)]*)\)/) && (y = b.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
|
|
4469
|
+
var x = y === void 0 || y === "[arguments not available]" ? void 0 : y.split(",");
|
|
4470
4470
|
return new s({
|
|
4471
4471
|
functionName: w,
|
|
4472
|
-
args:
|
|
4472
|
+
args: x,
|
|
4473
4473
|
fileName: p[0],
|
|
4474
4474
|
lineNumber: p[1],
|
|
4475
4475
|
columnNumber: p[2],
|
|
@@ -4640,10 +4640,10 @@ function Co(t, e) {
|
|
|
4640
4640
|
obscureInputDates: !1
|
|
4641
4641
|
}, e);
|
|
4642
4642
|
function s(a, d) {
|
|
4643
|
-
let p = d.value,
|
|
4644
|
-
d.type === "password" || t.sanitizer.isHidden(a) ?
|
|
4643
|
+
let p = d.value, b = n.defaultInputMode;
|
|
4644
|
+
d.type === "password" || t.sanitizer.isHidden(a) ? b = je.Hidden : (t.sanitizer.isObscured(a) || b === je.Plain && (n.obscureInputNumbers && d.type !== "date" && /\d\d\d\d/.test(p) || n.obscureInputDates && d.type === "date" || n.obscureInputEmails && (d.type === "email" || ~p.indexOf("@")))) && (b = je.Obscured);
|
|
4645
4645
|
let w = 0;
|
|
4646
|
-
switch (
|
|
4646
|
+
switch (b) {
|
|
4647
4647
|
case je.Hidden:
|
|
4648
4648
|
w = -1, p = "";
|
|
4649
4649
|
break;
|
|
@@ -4654,8 +4654,8 @@ function Co(t, e) {
|
|
|
4654
4654
|
return { value: p, mask: w };
|
|
4655
4655
|
}
|
|
4656
4656
|
function i(a, d) {
|
|
4657
|
-
const { value: p, mask:
|
|
4658
|
-
t.send(Zi(a, p,
|
|
4657
|
+
const { value: p, mask: b } = s(a, d);
|
|
4658
|
+
t.send(Zi(a, p, b));
|
|
4659
4659
|
}
|
|
4660
4660
|
const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
4661
4661
|
t.attachStopCallback(() => {
|
|
@@ -4680,24 +4680,24 @@ function Co(t, e) {
|
|
|
4680
4680
|
c(d, p.checked);
|
|
4681
4681
|
});
|
|
4682
4682
|
}, 3);
|
|
4683
|
-
function u(a, d, p,
|
|
4684
|
-
const { value: w, mask:
|
|
4685
|
-
t.send(br(a, w,
|
|
4683
|
+
function u(a, d, p, b) {
|
|
4684
|
+
const { value: w, mask: y } = s(a, d), x = ri(d);
|
|
4685
|
+
t.send(br(a, w, y !== 0, x, p, b));
|
|
4686
4686
|
}
|
|
4687
4687
|
t.nodes.attachNodeCallback(t.safe((a) => {
|
|
4688
4688
|
const d = t.nodes.getID(a);
|
|
4689
4689
|
if (d !== void 0) {
|
|
4690
4690
|
if (Z(a, "select") && (i(d, a), t.nodes.attachNodeListener(a, "change", () => i(d, a))), To(a)) {
|
|
4691
4691
|
l(d, a);
|
|
4692
|
-
let p = 0,
|
|
4693
|
-
const
|
|
4692
|
+
let p = 0, b = 0, w = 0;
|
|
4693
|
+
const y = () => {
|
|
4694
4694
|
p = pe();
|
|
4695
|
-
},
|
|
4696
|
-
|
|
4697
|
-
},
|
|
4698
|
-
p !== 0 && (w = pe() - p), u(d, a,
|
|
4695
|
+
}, x = () => {
|
|
4696
|
+
b === 0 && p !== 0 && (b = pe() - p);
|
|
4697
|
+
}, C = () => {
|
|
4698
|
+
p !== 0 && (w = pe() - p), u(d, a, b, w), b = 0, w = 0, p = 0;
|
|
4699
4699
|
};
|
|
4700
|
-
t.nodes.attachNodeListener(a, "focus",
|
|
4700
|
+
t.nodes.attachNodeListener(a, "focus", y), t.nodes.attachNodeListener(a, "input", x), t.nodes.attachNodeListener(a, "change", C);
|
|
4701
4701
|
return;
|
|
4702
4702
|
}
|
|
4703
4703
|
if (Eo(a)) {
|
|
@@ -4742,8 +4742,8 @@ function it(t, e, n) {
|
|
|
4742
4742
|
const l = (/* @__PURE__ */ new Date()).getTime() - oi.getTime();
|
|
4743
4743
|
if (he.timeoutMs !== void 0 && l > he.timeoutMs)
|
|
4744
4744
|
throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
|
|
4745
|
-
let c = ot(Oo(r)) || ot(...Ro(r)) || ot(...Do(r)) || ot(
|
|
4746
|
-
const u =
|
|
4745
|
+
let c = ot(Oo(r)) || ot(...Ro(r)) || ot(...Do(r)) || ot(Lo(r)) || [ks()];
|
|
4746
|
+
const u = Ao(r);
|
|
4747
4747
|
if (e == "all")
|
|
4748
4748
|
u && (c = c.concat(c.filter(sn).map((a) => rt(a, u))));
|
|
4749
4749
|
else if (e == "two")
|
|
@@ -4811,7 +4811,7 @@ function Do(t) {
|
|
|
4811
4811
|
penalty: 1
|
|
4812
4812
|
}));
|
|
4813
4813
|
}
|
|
4814
|
-
function
|
|
4814
|
+
function Lo(t) {
|
|
4815
4815
|
const e = t.tagName.toLowerCase();
|
|
4816
4816
|
return he.tagName(e) ? {
|
|
4817
4817
|
name: e,
|
|
@@ -4824,7 +4824,7 @@ function ks() {
|
|
|
4824
4824
|
penalty: 3
|
|
4825
4825
|
};
|
|
4826
4826
|
}
|
|
4827
|
-
function
|
|
4827
|
+
function Ao(t) {
|
|
4828
4828
|
const e = t.parentNode;
|
|
4829
4829
|
if (!e)
|
|
4830
4830
|
return null;
|
|
@@ -4901,7 +4901,7 @@ function Ts(t, e) {
|
|
|
4901
4901
|
function Bo(t, e) {
|
|
4902
4902
|
let n = t;
|
|
4903
4903
|
for (; n !== null && n !== e.documentElement; ) {
|
|
4904
|
-
if (
|
|
4904
|
+
if (Le(n, "masked"))
|
|
4905
4905
|
return null;
|
|
4906
4906
|
n = n.parentElement;
|
|
4907
4907
|
}
|
|
@@ -4922,64 +4922,64 @@ function Bo(t, e) {
|
|
|
4922
4922
|
}
|
|
4923
4923
|
function jo(t, e) {
|
|
4924
4924
|
const { disableClickmaps: n = !1 } = e || {};
|
|
4925
|
-
function s(
|
|
4926
|
-
const N = Nn(
|
|
4925
|
+
function s(T) {
|
|
4926
|
+
const N = Nn(T);
|
|
4927
4927
|
if (N !== null)
|
|
4928
4928
|
return N;
|
|
4929
|
-
if (Z(
|
|
4930
|
-
return ri(
|
|
4931
|
-
if (xn(
|
|
4929
|
+
if (Z(T, "input"))
|
|
4930
|
+
return ri(T);
|
|
4931
|
+
if (xn(T)) {
|
|
4932
4932
|
let D = "";
|
|
4933
|
-
return
|
|
4933
|
+
return T instanceof HTMLElement && (D = t.sanitizer.getInnerTextSecure(T)), D = D || T.id || T.className, Ws(D).slice(0, 100);
|
|
4934
4934
|
}
|
|
4935
4935
|
return "";
|
|
4936
4936
|
}
|
|
4937
|
-
let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0,
|
|
4938
|
-
const
|
|
4939
|
-
function
|
|
4940
|
-
const
|
|
4937
|
+
let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, b = 0, w;
|
|
4938
|
+
const y = 8e-3, x = 225;
|
|
4939
|
+
function C() {
|
|
4940
|
+
const T = b / x;
|
|
4941
4941
|
if (!a) {
|
|
4942
|
-
a =
|
|
4942
|
+
a = T;
|
|
4943
4943
|
return;
|
|
4944
4944
|
}
|
|
4945
|
-
const N = (
|
|
4946
|
-
p > 4 && N >
|
|
4945
|
+
const N = (T - a) / x;
|
|
4946
|
+
p > 4 && N > y && t.send(vr(pe())), b = 0, p = 0, a = T;
|
|
4947
4947
|
}
|
|
4948
4948
|
t.attachStartCallback(() => {
|
|
4949
|
-
w = setInterval(() =>
|
|
4949
|
+
w = setInterval(() => C(), x);
|
|
4950
4950
|
}), t.attachStopCallback(() => {
|
|
4951
4951
|
i = -1, r = -1, o = !1, l = null, u = {}, w && clearInterval(w);
|
|
4952
4952
|
});
|
|
4953
|
-
const
|
|
4953
|
+
const F = () => {
|
|
4954
4954
|
o && (t.send(tr(i, r)), o = !1);
|
|
4955
|
-
}, R = (
|
|
4955
|
+
}, R = (T, N = !1) => {
|
|
4956
4956
|
function D(I, E, P) {
|
|
4957
|
-
return u[I] = u[I] || Po(E,
|
|
4957
|
+
return u[I] = u[I] || Po(E, T, P);
|
|
4958
4958
|
}
|
|
4959
|
-
const
|
|
4960
|
-
|
|
4961
|
-
const E = Ts(I.target,
|
|
4959
|
+
const A = N ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
|
|
4960
|
+
A(T.documentElement, "mouseover", (I) => {
|
|
4961
|
+
const E = Ts(I.target, T);
|
|
4962
4962
|
E !== l && (l = E, c = performance.now());
|
|
4963
|
-
}),
|
|
4964
|
-
const [E, P] = t.observer.getDocumentOffset(
|
|
4963
|
+
}), A(T, "mousemove", (I) => {
|
|
4964
|
+
const [E, P] = t.observer.getDocumentOffset(T);
|
|
4965
4965
|
i = I.clientX + E, r = I.clientY + P, o = !0;
|
|
4966
4966
|
const U = Math.sign(I.movementX);
|
|
4967
|
-
|
|
4968
|
-
}, !1),
|
|
4969
|
-
const E = Ts(I.target,
|
|
4967
|
+
b += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
|
|
4968
|
+
}, !1), A(T, "click", (I) => {
|
|
4969
|
+
const E = Ts(I.target, T);
|
|
4970
4970
|
if (!I.clientX && !I.clientY || E === null)
|
|
4971
4971
|
return;
|
|
4972
4972
|
const P = t.nodes.getID(E);
|
|
4973
4973
|
if (P !== void 0) {
|
|
4974
|
-
const U = I.pageX, j = I.pageY, z =
|
|
4975
|
-
|
|
4974
|
+
const U = I.pageX, j = I.pageY, z = T.documentElement.scrollWidth, _ = T.documentElement.scrollHeight, M = Es(U / z), V = Es(j / _);
|
|
4975
|
+
F(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? D(P, E, e) : "", M, V), !0);
|
|
4976
4976
|
}
|
|
4977
4977
|
l = null;
|
|
4978
4978
|
});
|
|
4979
4979
|
};
|
|
4980
|
-
t.nodes.attachNodeCallback((
|
|
4981
|
-
vt(
|
|
4982
|
-
}), R(document, !0), t.ticker.attach(
|
|
4980
|
+
t.nodes.attachNodeCallback((T) => {
|
|
4981
|
+
vt(T) && R(T);
|
|
4982
|
+
}), R(document, !0), t.ticker.attach(F, (e == null ? void 0 : e.trackingOffset) || 7);
|
|
4983
4983
|
}
|
|
4984
4984
|
function Es(t) {
|
|
4985
4985
|
return Math.round(t * 1e4);
|
|
@@ -4992,8 +4992,8 @@ function zo(t) {
|
|
|
4992
4992
|
if (Z(r, "img") && (o = r.currentSrc || r.src), !o) {
|
|
4993
4993
|
const w = getComputedStyle(r).getPropertyValue("background-image");
|
|
4994
4994
|
if (w) {
|
|
4995
|
-
const
|
|
4996
|
-
|
|
4995
|
+
const y = s.exec(w);
|
|
4996
|
+
y !== null && (o = y[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
|
|
4997
4997
|
}
|
|
4998
4998
|
}
|
|
4999
4999
|
if (!o)
|
|
@@ -5004,8 +5004,8 @@ function zo(t) {
|
|
|
5004
5004
|
const c = r.getBoundingClientRect(), u = Math.max(c.top, 0), a = Math.max(c.left, 0), d = Math.min(c.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(c.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
|
|
5005
5005
|
if (d <= u || p <= a)
|
|
5006
5006
|
continue;
|
|
5007
|
-
const
|
|
5008
|
-
e.push({ time: l, area:
|
|
5007
|
+
const b = (d - u) * (p - a);
|
|
5008
|
+
e.push({ time: l, area: b });
|
|
5009
5009
|
}
|
|
5010
5010
|
return e;
|
|
5011
5011
|
}
|
|
@@ -5082,26 +5082,26 @@ function Ho(t, e) {
|
|
|
5082
5082
|
navigationStart: a,
|
|
5083
5083
|
requestStart: d,
|
|
5084
5084
|
responseStart: p,
|
|
5085
|
-
responseEnd:
|
|
5085
|
+
responseEnd: b,
|
|
5086
5086
|
domContentLoadedEventStart: w,
|
|
5087
|
-
domContentLoadedEventEnd:
|
|
5088
|
-
loadEventStart:
|
|
5089
|
-
loadEventEnd:
|
|
5087
|
+
domContentLoadedEventEnd: y,
|
|
5088
|
+
loadEventStart: x,
|
|
5089
|
+
loadEventEnd: C
|
|
5090
5090
|
} = performance.timing;
|
|
5091
|
-
t.send(sr(d - a || 0, p - a || 0,
|
|
5091
|
+
t.send(sr(d - a || 0, p - a || 0, b - a || 0, w - a || 0, y - a || 0, x - a || 0, C - a || 0, l, c));
|
|
5092
5092
|
}
|
|
5093
5093
|
}, 30);
|
|
5094
5094
|
}
|
|
5095
5095
|
if (n.capturePageRenderTimings) {
|
|
5096
|
-
let u = 0, a = 0, d = 0, p = null,
|
|
5096
|
+
let u = 0, a = 0, d = 0, p = null, b = !1;
|
|
5097
5097
|
t.ticker.attach(() => {
|
|
5098
|
-
if (
|
|
5098
|
+
if (b)
|
|
5099
5099
|
return;
|
|
5100
5100
|
const w = performance.now();
|
|
5101
|
-
if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((
|
|
5102
|
-
|
|
5103
|
-
const
|
|
5104
|
-
t.send(ir(
|
|
5101
|
+
if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((y) => s[y])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
|
|
5102
|
+
b = !0, s = null;
|
|
5103
|
+
const y = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: x, navigationStart: C } = performance.timing, F = d === null ? Math.max(a, c, x - C || 0) : 0;
|
|
5104
|
+
t.send(ir(y, c > u ? c : u, F));
|
|
5105
5105
|
}
|
|
5106
5106
|
});
|
|
5107
5107
|
}
|
|
@@ -5177,11 +5177,11 @@ function Vo(t) {
|
|
|
5177
5177
|
if (a && Symbol.iterator in a)
|
|
5178
5178
|
for (const d of a) {
|
|
5179
5179
|
let p = e.get(d);
|
|
5180
|
-
const
|
|
5181
|
-
if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)),
|
|
5180
|
+
const b = !p;
|
|
5181
|
+
if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), b) {
|
|
5182
5182
|
const w = d.cssRules;
|
|
5183
|
-
for (let
|
|
5184
|
-
t.send(fn(p, w[
|
|
5183
|
+
for (let y = 0; y < w.length; y++)
|
|
5184
|
+
t.send(fn(p, w[y].cssText, y, t.getBaseHref()));
|
|
5185
5185
|
}
|
|
5186
5186
|
u.push(p);
|
|
5187
5187
|
}
|
|
@@ -5336,40 +5336,40 @@ 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:
|
|
5340
|
-
function U($,
|
|
5341
|
-
P(
|
|
5339
|
+
const { headers: b, data: w, method: y, url: x, baseURL: C } = p.config, { data: F, headers: R, status: T, response: N } = p, { data: D, headers: A, status: I } = N || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
|
|
5340
|
+
function U($, v) {
|
|
5341
|
+
P(v[0]) || ($[v[0]] = v[1]);
|
|
5342
5342
|
}
|
|
5343
5343
|
let j = {}, z = {};
|
|
5344
|
-
|
|
5345
|
-
const
|
|
5346
|
-
|
|
5347
|
-
P($) || (z[$] =
|
|
5344
|
+
b.toJSON ? j = b.toJSON() : b instanceof Headers ? b.forEach(($, v) => U(j, [v, $])) : Array.isArray(b) ? b.forEach(($) => U(j, $)) : typeof b == "object" && Object.entries(b).forEach(($) => U(j, $));
|
|
5345
|
+
const _ = A || R;
|
|
5346
|
+
_.toJSON ? z = _.toJSON() : _ instanceof Headers ? _.forEach(($, v) => U(z, [v, $])) : Array.isArray(_) ? _.forEach(($) => U(z, $)) : typeof _ == "object" && Object.entries(_).forEach(([$, v]) => {
|
|
5347
|
+
P($) || (z[$] = v);
|
|
5348
5348
|
});
|
|
5349
|
-
const
|
|
5350
|
-
url:
|
|
5351
|
-
method:
|
|
5352
|
-
status:
|
|
5349
|
+
const M = s({
|
|
5350
|
+
url: x,
|
|
5351
|
+
method: y || "",
|
|
5352
|
+
status: T || I || 0,
|
|
5353
5353
|
request: {
|
|
5354
5354
|
headers: j,
|
|
5355
5355
|
body: w
|
|
5356
5356
|
},
|
|
5357
5357
|
response: {
|
|
5358
5358
|
headers: z,
|
|
5359
|
-
body: D ||
|
|
5359
|
+
body: D || F
|
|
5360
5360
|
}
|
|
5361
5361
|
});
|
|
5362
|
-
if (!
|
|
5362
|
+
if (!M) {
|
|
5363
5363
|
t.debug.log("Openreplay: empty request/response info, skipping");
|
|
5364
5364
|
return;
|
|
5365
5365
|
}
|
|
5366
|
-
const V = p.config.__openreplay_timing,
|
|
5367
|
-
t.debug.log("Openreplay: final req object",
|
|
5366
|
+
const V = p.config.__openreplay_timing, G = performance.now() - V;
|
|
5367
|
+
t.debug.log("Openreplay: final req object", M), t.send(bt("xhr", String(y), String(M.url), i(M.request), i(M.response), M.status, V + Ve(), G, 0));
|
|
5368
5368
|
}
|
|
5369
5369
|
function o(p) {
|
|
5370
5370
|
if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), n.sessionTokenHeader) {
|
|
5371
|
-
const
|
|
5372
|
-
w && p.headers.set(
|
|
5371
|
+
const b = typeof n.sessionTokenHeader == "string" ? n.sessionTokenHeader : "X-OpenReplay-Session-Token", w = t.getSessionToken();
|
|
5372
|
+
w && p.headers.set(b, w);
|
|
5373
5373
|
}
|
|
5374
5374
|
return p;
|
|
5375
5375
|
}
|
|
@@ -5388,8 +5388,8 @@ function Xo(t, e, n, s, i) {
|
|
|
5388
5388
|
synchronous: !0
|
|
5389
5389
|
});
|
|
5390
5390
|
t.attachStopCallback(() => {
|
|
5391
|
-
var p,
|
|
5392
|
-
(
|
|
5391
|
+
var p, b, w, y;
|
|
5392
|
+
(b = (p = e.interceptors.request).eject) == null || b.call(p, a), (y = (w = e.interceptors.response).eject) == null || y.call(w, d);
|
|
5393
5393
|
});
|
|
5394
5394
|
}
|
|
5395
5395
|
function Yo(t) {
|
|
@@ -5402,7 +5402,7 @@ var we;
|
|
|
5402
5402
|
(function(t) {
|
|
5403
5403
|
t[t.UNSENT = 0] = "UNSENT", t[t.OPENED = 1] = "OPENED", t[t.HEADERS_RECEIVED = 2] = "HEADERS_RECEIVED", t[t.LOADING = 3] = "LOADING", t[t.DONE = 4] = "DONE";
|
|
5404
5404
|
})(we || (we = {}));
|
|
5405
|
-
class
|
|
5405
|
+
class Ln {
|
|
5406
5406
|
constructor(e = [], n, s) {
|
|
5407
5407
|
this.ignoredHeaders = e, this.setSessionTokenHeader = n, this.sanitize = s, this.id = "", this.name = "", this.method = "", this.url = "", this.status = 0, this.statusText = "", this.cancelState = 0, this.readyState = 0, this.header = {}, this.responseType = "", this.requestHeader = {}, this.responseSize = 0, this.responseSizeText = "", this.startTime = 0, this.endTime = 0, this.duration = 0, this.getData = {}, this.requestData = null;
|
|
5408
5408
|
}
|
|
@@ -5452,7 +5452,7 @@ const et = (t, e) => {
|
|
|
5452
5452
|
break;
|
|
5453
5453
|
}
|
|
5454
5454
|
return n;
|
|
5455
|
-
},
|
|
5455
|
+
}, An = (t) => {
|
|
5456
5456
|
if (!t)
|
|
5457
5457
|
return null;
|
|
5458
5458
|
let e;
|
|
@@ -5544,7 +5544,7 @@ class na {
|
|
|
5544
5544
|
if (!i || // @ts-ignore
|
|
5545
5545
|
typeof i != "string" && !(i != null && i.url) || (i instanceof URL || typeof i == "string" ? this.isServiceUrl(String(i)) : this.isServiceUrl(String(i.url))))
|
|
5546
5546
|
return e.apply(window, s);
|
|
5547
|
-
const l = new
|
|
5547
|
+
const l = new Ln(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
5548
5548
|
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((c, u) => {
|
|
5549
5549
|
if (!(this.tokenUrlMatcher !== void 0 && !this.tokenUrlMatcher(l.url))) {
|
|
5550
5550
|
if (s[1] === void 0 && s[0] instanceof Request)
|
|
@@ -5568,7 +5568,7 @@ class na {
|
|
|
5568
5568
|
for (const [l, c] of i.searchParams)
|
|
5569
5569
|
e.getData[l] = c;
|
|
5570
5570
|
}
|
|
5571
|
-
s != null && s.body && (e.requestData =
|
|
5571
|
+
s != null && s.body && (e.requestData = An(s.body));
|
|
5572
5572
|
}
|
|
5573
5573
|
afterFetch(e) {
|
|
5574
5574
|
return (n) => {
|
|
@@ -5605,7 +5605,7 @@ class ia {
|
|
|
5605
5605
|
this.onAbort();
|
|
5606
5606
|
}, this.XMLReq.ontimeout = () => {
|
|
5607
5607
|
this.onTimeout();
|
|
5608
|
-
}, this.item = new
|
|
5608
|
+
}, this.item = new Ln(n, s, i), this.item.requestType = "xhr";
|
|
5609
5609
|
}
|
|
5610
5610
|
get(e, n) {
|
|
5611
5611
|
switch (n) {
|
|
@@ -5663,7 +5663,7 @@ class ia {
|
|
|
5663
5663
|
const n = Reflect.get(e, "send");
|
|
5664
5664
|
return (...s) => {
|
|
5665
5665
|
const i = s[0];
|
|
5666
|
-
return this.item.requestData =
|
|
5666
|
+
return this.item.requestData = An(i), n.apply(e, s);
|
|
5667
5667
|
};
|
|
5668
5668
|
}
|
|
5669
5669
|
getSetRequestHeader(e) {
|
|
@@ -5734,7 +5734,7 @@ class aa {
|
|
|
5734
5734
|
this.ignoredHeaders = e, this.setSessionTokenHeader = n, this.sanitize = s, this.sendMessage = i, this.isServiceUrl = r;
|
|
5735
5735
|
}
|
|
5736
5736
|
apply(e, n, s) {
|
|
5737
|
-
const i = s[0], r = s[1], o = new
|
|
5737
|
+
const i = s[0], r = s[1], o = new Ln(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
5738
5738
|
if (this.isServiceUrl(i))
|
|
5739
5739
|
return e.apply(n, s);
|
|
5740
5740
|
const l = kn(i);
|
|
@@ -5743,7 +5743,7 @@ class aa {
|
|
|
5743
5743
|
for (const [a, d] of l.searchParams)
|
|
5744
5744
|
o.getData[a] = d;
|
|
5745
5745
|
}
|
|
5746
|
-
o.requestData =
|
|
5746
|
+
o.requestData = An(r), o.startTime || (o.startTime = performance.now());
|
|
5747
5747
|
const c = e.apply(n, s);
|
|
5748
5748
|
c ? (o.endTime = performance.now(), o.duration = o.endTime - (o.startTime || o.endTime), o.status = 0, o.statusText = "Sent", o.readyState = 4) : (o.status = 500, o.statusText = "Unknown");
|
|
5749
5749
|
const u = o.getMessage();
|
|
@@ -5815,63 +5815,63 @@ function la(t, e = {}) {
|
|
|
5815
5815
|
const u = (a) => {
|
|
5816
5816
|
if (n.useProxy)
|
|
5817
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,
|
|
5818
|
+
const d = a.fetch.bind(a), p = (R, T = {}) => {
|
|
5819
5819
|
if (!(typeof R == "string" || R instanceof URL) || t.isServiceURL(String(R)))
|
|
5820
|
-
return d(R,
|
|
5821
|
-
o(function(D,
|
|
5822
|
-
|
|
5820
|
+
return d(R, T);
|
|
5821
|
+
o(function(D, A) {
|
|
5822
|
+
T.headers === void 0 && (T.headers = {}), T.headers instanceof Headers ? T.headers.append(D, A) : Array.isArray(T.headers) ? T.headers.push([D, A]) : T.headers[D] = A;
|
|
5823
5823
|
});
|
|
5824
5824
|
const N = performance.now();
|
|
5825
|
-
return d(R,
|
|
5826
|
-
const
|
|
5825
|
+
return d(R, T).then((D) => {
|
|
5826
|
+
const A = performance.now() - N;
|
|
5827
5827
|
if (n.failuresOnly && D.status < 400)
|
|
5828
5828
|
return D;
|
|
5829
5829
|
const I = D.clone();
|
|
5830
5830
|
return I.text().then((E) => {
|
|
5831
5831
|
const P = {}, U = {};
|
|
5832
5832
|
if (s !== !0) {
|
|
5833
|
-
const
|
|
5834
|
-
i(
|
|
5833
|
+
const _ = ([M, V]) => {
|
|
5834
|
+
i(M) || (P[M] = V);
|
|
5835
5835
|
};
|
|
5836
|
-
|
|
5837
|
-
i(V) || (U[V] =
|
|
5836
|
+
T.headers instanceof Headers ? T.headers.forEach((M, V) => _([V, M])) : Array.isArray(T.headers) ? T.headers.forEach(_) : typeof T.headers == "object" && Object.entries(T.headers).forEach(_), I.headers.forEach((M, V) => {
|
|
5837
|
+
i(V) || (U[V] = M);
|
|
5838
5838
|
});
|
|
5839
5839
|
}
|
|
5840
|
-
const j = _s(
|
|
5840
|
+
const j = _s(T.method), z = l({
|
|
5841
5841
|
url: String(R),
|
|
5842
5842
|
method: j,
|
|
5843
5843
|
status: I.status,
|
|
5844
5844
|
request: {
|
|
5845
5845
|
headers: P,
|
|
5846
5846
|
// @ts-ignore
|
|
5847
|
-
body:
|
|
5847
|
+
body: T.body || null
|
|
5848
5848
|
},
|
|
5849
5849
|
response: {
|
|
5850
5850
|
headers: U,
|
|
5851
5851
|
body: E
|
|
5852
5852
|
}
|
|
5853
5853
|
});
|
|
5854
|
-
z && t.send(bt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, N + Ve(),
|
|
5854
|
+
z && t.send(bt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, N + Ve(), A, 0));
|
|
5855
5855
|
}).catch((E) => t.debug.error("Could not process Fetch response:", E)), D;
|
|
5856
5856
|
});
|
|
5857
5857
|
};
|
|
5858
5858
|
a.fetch = p;
|
|
5859
|
-
const
|
|
5860
|
-
function
|
|
5859
|
+
const b = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, y = a.XMLHttpRequest.prototype.send;
|
|
5860
|
+
function x(R, T) {
|
|
5861
5861
|
const N = this;
|
|
5862
|
-
o((
|
|
5862
|
+
o((A, I) => N.setRequestHeader(A, I));
|
|
5863
5863
|
let D = 0;
|
|
5864
|
-
return N.addEventListener("loadstart", (
|
|
5865
|
-
D =
|
|
5866
|
-
}), N.addEventListener("load", t.safe((
|
|
5867
|
-
const { headers: I, body: E } = on(N), P = D > 0 ?
|
|
5864
|
+
return N.addEventListener("loadstart", (A) => {
|
|
5865
|
+
D = A.timeStamp;
|
|
5866
|
+
}), N.addEventListener("load", t.safe((A) => {
|
|
5867
|
+
const { headers: I, body: E } = on(N), P = D > 0 ? A.timeStamp - D : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
|
|
5868
5868
|
j.forEach(function(V) {
|
|
5869
|
-
const
|
|
5870
|
-
i($) || (z[$] =
|
|
5869
|
+
const G = V.split(": "), $ = G.shift();
|
|
5870
|
+
i($) || (z[$] = G.join(": "));
|
|
5871
5871
|
});
|
|
5872
|
-
const
|
|
5873
|
-
url: String(
|
|
5874
|
-
method:
|
|
5872
|
+
const _ = _s(R), M = l({
|
|
5873
|
+
url: String(T),
|
|
5874
|
+
method: _,
|
|
5875
5875
|
status: N.status,
|
|
5876
5876
|
request: {
|
|
5877
5877
|
headers: I,
|
|
@@ -5883,21 +5883,21 @@ function la(t, e = {}) {
|
|
|
5883
5883
|
body: N.response
|
|
5884
5884
|
}
|
|
5885
5885
|
});
|
|
5886
|
-
|
|
5887
|
-
})),
|
|
5886
|
+
M && t.send(bt("xhr", _, String(M.url), c(M.request), c(M.response), N.status, D + Ve(), P, 0));
|
|
5887
|
+
})), b.apply(this, arguments);
|
|
5888
5888
|
}
|
|
5889
|
-
function
|
|
5890
|
-
const
|
|
5891
|
-
return
|
|
5889
|
+
function C(R) {
|
|
5890
|
+
const T = on(this);
|
|
5891
|
+
return T.body = R, y.apply(this, arguments);
|
|
5892
5892
|
}
|
|
5893
|
-
function
|
|
5893
|
+
function F(R, T) {
|
|
5894
5894
|
if (!i(R)) {
|
|
5895
5895
|
const N = on(this);
|
|
5896
|
-
N.headers[R] =
|
|
5896
|
+
N.headers[R] = T;
|
|
5897
5897
|
}
|
|
5898
5898
|
return w.apply(this, arguments);
|
|
5899
5899
|
}
|
|
5900
|
-
n.axiosInstances || (a.XMLHttpRequest.prototype.open =
|
|
5900
|
+
n.axiosInstances || (a.XMLHttpRequest.prototype.open = x, a.XMLHttpRequest.prototype.send = C, a.XMLHttpRequest.prototype.setRequestHeader = F);
|
|
5901
5901
|
};
|
|
5902
5902
|
u(window), n.axiosInstances && n.axiosInstances.forEach((a) => {
|
|
5903
5903
|
Xo(t, a, n, l, c);
|
|
@@ -7578,8 +7578,8 @@ class ba {
|
|
|
7578
7578
|
headerOccasion: "случай",
|
|
7579
7579
|
headerOr: "или"
|
|
7580
7580
|
},
|
|
7581
|
-
|
|
7582
|
-
lang: "
|
|
7581
|
+
kk: {
|
|
7582
|
+
lang: "kk",
|
|
7583
7583
|
welcomeMessage: "Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",
|
|
7584
7584
|
noResultsFound: "Нәтижелер табылмады.",
|
|
7585
7585
|
somethingWentWrong: "Кешіріңіз, бірдеңе дұрыс болмады.",
|
|
@@ -7648,10 +7648,11 @@ class ba {
|
|
|
7648
7648
|
try {
|
|
7649
7649
|
const n = await this.api.getStoreConfig(e);
|
|
7650
7650
|
this.storeLanguage = n.lang, this.supportedLanguages = n.available_languages, this.OpenAIApiKey = n.open_ai_key;
|
|
7651
|
-
const s =
|
|
7652
|
-
|
|
7651
|
+
const s = new URLSearchParams(window.location.search), i = s.get("lang") || s.get("language");
|
|
7652
|
+
i && this.translations[i] ? this.language = i : n.lang && this.translations[n.lang] ? this.language = n.lang : this.language = "en", this.currency = n.currency || "USD";
|
|
7653
7653
|
} catch {
|
|
7654
|
-
|
|
7654
|
+
const s = new URLSearchParams(window.location.search), i = s.get("lang") || s.get("language");
|
|
7655
|
+
this.language = this.translations[i] ? i : "en", this.currency = "USD";
|
|
7655
7656
|
}
|
|
7656
7657
|
}
|
|
7657
7658
|
getCurrency(e) {
|
|
@@ -7677,42 +7678,72 @@ class ba {
|
|
|
7677
7678
|
getSupportedLanguages() {
|
|
7678
7679
|
return this.supportedLanguages;
|
|
7679
7680
|
}
|
|
7681
|
+
getLangFromURL() {
|
|
7682
|
+
const e = new URLSearchParams(window.location.search), n = e.get("lang") || e.get("language");
|
|
7683
|
+
return n && this.translations[n] ? n : null;
|
|
7684
|
+
}
|
|
7680
7685
|
async translateTexts(e) {
|
|
7681
|
-
var u, a, d
|
|
7686
|
+
var c, u, a, d;
|
|
7682
7687
|
if (this.storeLanguage === this.language || !this.supportedLanguages)
|
|
7683
|
-
return e;
|
|
7688
|
+
return console.log("gривет"), e;
|
|
7684
7689
|
const n = this.OpenAIApiKey, s = "https://api.openai.com/v1/chat/completions", i = {
|
|
7685
7690
|
"Content-Type": "application/json",
|
|
7686
7691
|
Authorization: `Bearer ${n}`
|
|
7687
|
-
},
|
|
7688
|
-
|
|
7689
|
-
|
|
7692
|
+
}, r = Object.entries(e).map(([p, b]) => ({
|
|
7693
|
+
key: p,
|
|
7694
|
+
text: b
|
|
7695
|
+
})), o = `
|
|
7696
|
+
You are a professional translator.
|
|
7697
|
+
|
|
7698
|
+
The input texts are written in language with code "${this.storeLanguage}". Your task is to translate them strictly to the target language with code "${this.language}".
|
|
7699
|
+
|
|
7700
|
+
⚠️ DO NOT leave the original text.
|
|
7701
|
+
⚠️ DO NOT skip any entry.
|
|
7702
|
+
⚠️ Preserve the original order and keys exactly.
|
|
7703
|
+
|
|
7704
|
+
Translate only the "text" fields of the JSON array. Return an array of the same length and structure, like this:
|
|
7705
|
+
|
|
7706
|
+
Input:
|
|
7707
|
+
[
|
|
7708
|
+
{ "key": "shortDescription", "text": "Red wine with rich cherry notes." },
|
|
7709
|
+
{ "key": "tags", "text": "fruity, dry, elegant" }
|
|
7710
|
+
]
|
|
7711
|
+
|
|
7712
|
+
Output:
|
|
7713
|
+
[
|
|
7714
|
+
{ "key": "shortDescription", "text": "..." },
|
|
7715
|
+
{ "key": "tags", "text": "..." }
|
|
7716
|
+
]
|
|
7717
|
+
|
|
7718
|
+
Now translate the following input:
|
|
7719
|
+
${JSON.stringify(r, null, 2)}
|
|
7720
|
+
`, l = JSON.stringify({
|
|
7690
7721
|
model: "gpt-3.5-turbo",
|
|
7691
7722
|
messages: [
|
|
7692
7723
|
{ role: "system", content: "You are a professional translator." },
|
|
7693
|
-
{ role: "user", content:
|
|
7724
|
+
{ role: "user", content: o }
|
|
7694
7725
|
],
|
|
7695
7726
|
temperature: 0.2,
|
|
7696
7727
|
max_tokens: 1e3
|
|
7697
7728
|
});
|
|
7698
7729
|
try {
|
|
7699
|
-
const
|
|
7730
|
+
const w = (d = (a = (u = (c = (await (await fetch(s, {
|
|
7700
7731
|
method: "POST",
|
|
7701
7732
|
headers: i,
|
|
7702
|
-
body:
|
|
7703
|
-
})).json()).choices) == null ? void 0 :
|
|
7704
|
-
if (!
|
|
7733
|
+
body: l
|
|
7734
|
+
})).json()).choices) == null ? void 0 : c[0]) == null ? void 0 : u.message) == null ? void 0 : a.content) == null ? void 0 : d.trim();
|
|
7735
|
+
if (!w)
|
|
7705
7736
|
throw new Error("No response from OpenAI");
|
|
7706
|
-
const
|
|
7707
|
-
return
|
|
7708
|
-
|
|
7709
|
-
}),
|
|
7710
|
-
} catch (
|
|
7711
|
-
return console.error("Error translating texts:",
|
|
7737
|
+
const y = JSON.parse(w), x = {};
|
|
7738
|
+
return y.forEach((C) => {
|
|
7739
|
+
C.key && C.text !== void 0 && (x[C.key] = C.text);
|
|
7740
|
+
}), x;
|
|
7741
|
+
} catch (p) {
|
|
7742
|
+
return console.error("Error translating texts:", p), e;
|
|
7712
7743
|
}
|
|
7713
7744
|
}
|
|
7714
7745
|
}
|
|
7715
|
-
const
|
|
7746
|
+
const J = new ba();
|
|
7716
7747
|
class va {
|
|
7717
7748
|
constructor() {
|
|
7718
7749
|
var e, n, s, i, r;
|
|
@@ -7727,18 +7758,18 @@ class va {
|
|
|
7727
7758
|
}
|
|
7728
7759
|
getTitle(e) {
|
|
7729
7760
|
return e ? `<h1 class="wine-widget-big-title">${e}</h1>` : `<h1 class="wine-widget-big-title">
|
|
7730
|
-
${
|
|
7761
|
+
${J.translate("headerLine1")}
|
|
7731
7762
|
<span class="icon icon-meal"></span>
|
|
7732
|
-
<span class="icon-label">${
|
|
7763
|
+
<span class="icon-label">${J.translate("headerMeal")}</span>,
|
|
7733
7764
|
<span class="icon icon-mood"></span>
|
|
7734
|
-
<span class="icon-label">${
|
|
7765
|
+
<span class="icon-label">${J.translate("headerMood")}</span>
|
|
7735
7766
|
</br>
|
|
7736
7767
|
<!-- <span class="icon icon-budget"></span> -->
|
|
7737
|
-
<!-- <span class="icon-label">${
|
|
7738
|
-
${
|
|
7768
|
+
<!-- <span class="icon-label">${J.translate("headerBudget")}</span>, -->
|
|
7769
|
+
${J.translate("headerOr")}
|
|
7739
7770
|
<span class="icon icon-occasion"></span>
|
|
7740
|
-
<span class="icon-label">${
|
|
7741
|
-
${
|
|
7771
|
+
<span class="icon-label">${J.translate("headerOccasion")}</span>
|
|
7772
|
+
${J.translate("headerLine2")}
|
|
7742
7773
|
</h1>`;
|
|
7743
7774
|
}
|
|
7744
7775
|
initializeWidget() {
|
|
@@ -7757,11 +7788,11 @@ class va {
|
|
|
7757
7788
|
<input
|
|
7758
7789
|
type="text"
|
|
7759
7790
|
id="wine-search-input"
|
|
7760
|
-
placeholder="${
|
|
7791
|
+
placeholder="${J.translate("searchPlaceholder")}">
|
|
7761
7792
|
|
|
7762
7793
|
<!-- Кнопка -->
|
|
7763
7794
|
<button id="wine-search-button">
|
|
7764
|
-
${
|
|
7795
|
+
${J.translate("searchButton")}
|
|
7765
7796
|
</button>
|
|
7766
7797
|
</div>
|
|
7767
7798
|
<div id="wine-widget-right">
|
|
@@ -7775,9 +7806,9 @@ class va {
|
|
|
7775
7806
|
<div id="powered-by-widget">
|
|
7776
7807
|
<div class="powered-by-center">
|
|
7777
7808
|
<a href="https://wineater.com" target="_blank">
|
|
7778
|
-
<span>${
|
|
7809
|
+
<span>${J.translate("poweredBy")}</span>
|
|
7779
7810
|
<img src="${this.countryCode === "ru" ? "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5" : "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"}" alt="Wineater Logo">
|
|
7780
|
-
<span class="powered-by-sommelier">${
|
|
7811
|
+
<span class="powered-by-sommelier">${J.translate("AI sommelier")}</span>
|
|
7781
7812
|
</a>
|
|
7782
7813
|
</div>
|
|
7783
7814
|
<div class="powered-by-lang"></div>
|
|
@@ -7839,20 +7870,20 @@ class va {
|
|
|
7839
7870
|
return typeof u != "number" && (u = Number(u)), u.toLocaleString("en-US");
|
|
7840
7871
|
}
|
|
7841
7872
|
e.forEach(async (u, a) => {
|
|
7842
|
-
const d = i(u, "title"), p = i(u, "image"),
|
|
7873
|
+
const d = i(u, "title"), p = i(u, "image"), b = i(u, "total"), w = i(u, "url"), y = u.tags || u.Tags, x = r(u, ["type", "country", "region", "grape"]), C = y ? o(y) : "", F = l(u), R = u["Short Description"], T = u.pairing_recommendation, N = u.isSommSelection, D = `
|
|
7843
7874
|
<div class="wine-recommendation-tile ${N ? "somm-selection" : ""}">
|
|
7844
|
-
${N ? `<div class="somm-selection-badge">${
|
|
7875
|
+
${N ? `<div class="somm-selection-badge">${J.translate("wineDetails.sommSelection")}</div>` : ""}
|
|
7845
7876
|
|
|
7846
7877
|
<div class="tile-top">
|
|
7847
7878
|
${p ? `<img src="${p}" alt="${d}" class="wine-image" />` : ""}
|
|
7848
|
-
<div class="wine-price">${c(
|
|
7879
|
+
<div class="wine-price">${c(b)} ${J.getCurrency("label")}</div>
|
|
7849
7880
|
<h3 class="wine-title">${d}</h3>
|
|
7850
7881
|
</div>
|
|
7851
7882
|
|
|
7852
|
-
${
|
|
7883
|
+
${x ? `<div class="wine-params">${x}</div>` : ""}
|
|
7853
7884
|
|
|
7854
7885
|
<div class="bottom-row">
|
|
7855
|
-
${w ? `<a class="buy-btn" href="${w}" target="_blank">${
|
|
7886
|
+
${w ? `<a class="buy-btn" href="${w}" target="_blank">${J.translate("wineDetails.buy")}</a>` : `<button class="buy-btn" data-toggle-info>${J.translate("moreInfo")}</button>`}
|
|
7856
7887
|
</div>
|
|
7857
7888
|
|
|
7858
7889
|
<div class="card-popup hidden" data-wine-index="${a}">
|
|
@@ -7861,17 +7892,17 @@ class va {
|
|
|
7861
7892
|
<span class="card-popup-close">×</span>
|
|
7862
7893
|
</div>
|
|
7863
7894
|
${R ? `<p class="popup-short-desc" data-orig="${R}">${R}</p>` : ""}
|
|
7864
|
-
${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` :
|
|
7865
|
-
${
|
|
7895
|
+
${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` : T ? `<p class="popup-pairing" data-orig="${T}">${T}</p>` : ""}
|
|
7896
|
+
${C ? `<div class="popup-tags">${C}</div>` : ""}
|
|
7866
7897
|
</div>
|
|
7867
7898
|
|
|
7868
|
-
${
|
|
7899
|
+
${F}
|
|
7869
7900
|
</div>
|
|
7870
7901
|
`;
|
|
7871
7902
|
s.insertAdjacentHTML("beforeend", D);
|
|
7872
|
-
const
|
|
7903
|
+
const A = s.children[a];
|
|
7873
7904
|
if (!w) {
|
|
7874
|
-
const I =
|
|
7905
|
+
const I = A.querySelector("[data-toggle-info]"), E = A.querySelector(".card-popup"), P = A.querySelector(".card-popup-close");
|
|
7875
7906
|
P == null || P.addEventListener("click", (U) => {
|
|
7876
7907
|
U.stopPropagation(), E.classList.add("hidden");
|
|
7877
7908
|
}), document.addEventListener("click", (U) => {
|
|
@@ -7879,17 +7910,17 @@ class va {
|
|
|
7879
7910
|
}), I == null || I.addEventListener("click", (U) => {
|
|
7880
7911
|
var j;
|
|
7881
7912
|
if (U.stopPropagation(), document.querySelectorAll(".card-popup").forEach((z) => z.classList.add("hidden")), document.querySelectorAll(".mobile-fullscreen-wrapper").forEach((z) => z.remove()), window.innerWidth <= 768) {
|
|
7882
|
-
const z = E.innerHTML,
|
|
7883
|
-
|
|
7913
|
+
const z = E.innerHTML, _ = document.createElement("div");
|
|
7914
|
+
_.className = "mobile-fullscreen-wrapper", _.innerHTML = `
|
|
7884
7915
|
<div class="mobile-fullscreen-overlay"></div>
|
|
7885
7916
|
<div class="card-popup mobile-fullscreen-popup">${z}</div>
|
|
7886
|
-
`, (j =
|
|
7917
|
+
`, (j = _.querySelector(".card-popup-close")) == null || j.addEventListener("click", () => _.remove()), document.body.appendChild(_);
|
|
7887
7918
|
} else
|
|
7888
7919
|
E.classList.remove("hidden");
|
|
7889
7920
|
});
|
|
7890
7921
|
}
|
|
7891
7922
|
setTimeout(() => {
|
|
7892
|
-
|
|
7923
|
+
A.style.opacity = "1", A.style.transform = "translateY(0)";
|
|
7893
7924
|
}, n ? a * 200 : 0);
|
|
7894
7925
|
}), this.translatePopupContent(e), this.widgetType === "store" && this.enableHoverPopups();
|
|
7895
7926
|
}
|
|
@@ -7913,7 +7944,7 @@ class va {
|
|
|
7913
7944
|
const e = document.getElementById("wine-placeholder");
|
|
7914
7945
|
e.innerHTML = `
|
|
7915
7946
|
<div class="no-results">
|
|
7916
|
-
<p>${
|
|
7947
|
+
<p>${J.translate("noResultsMessage") || "No recommendations found for your query."}</p>
|
|
7917
7948
|
</div>
|
|
7918
7949
|
`;
|
|
7919
7950
|
}
|
|
@@ -7921,42 +7952,43 @@ class va {
|
|
|
7921
7952
|
const e = document.getElementById("wine-placeholder");
|
|
7922
7953
|
e.innerHTML = `
|
|
7923
7954
|
<div class="error-message">
|
|
7924
|
-
<p>${
|
|
7955
|
+
<p>${J.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
|
|
7925
7956
|
</div>
|
|
7926
7957
|
`;
|
|
7927
7958
|
}
|
|
7928
7959
|
async translatePopupContent(e) {
|
|
7929
|
-
if (console.log(
|
|
7960
|
+
if (console.log(J.language, J.storeLanguage), J.language === J.storeLanguage || this.widgetType !== "bar")
|
|
7930
7961
|
return;
|
|
7931
|
-
const n = ["Short Description", "reason", "pairing_recommendation", "Tags", "tags"], s = e[0], i = n.filter((o) => o in s);
|
|
7932
|
-
G.language;
|
|
7933
|
-
const r = 4;
|
|
7962
|
+
const n = ["Short Description", "reason", "pairing_recommendation", "Tags", "tags"], s = e[0], i = n.filter((o) => o in s), r = 4;
|
|
7934
7963
|
for (let o = 0; o < e.length; o += r) {
|
|
7935
7964
|
const c = e.slice(o, o + r).map(async (u, a) => {
|
|
7936
|
-
const d = o + a, p = {
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7965
|
+
const d = o + a, p = i.map((x) => {
|
|
7966
|
+
const C = u[x] || u[x.toLowerCase()];
|
|
7967
|
+
return C ? { key: x, text: Array.isArray(C) ? C.join(", ") : C } : null;
|
|
7968
|
+
}).filter(Boolean);
|
|
7969
|
+
if (p.length === 0)
|
|
7941
7970
|
return;
|
|
7942
|
-
const
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7971
|
+
const b = await J.translateTexts(
|
|
7972
|
+
Object.fromEntries(p.map((x) => [x.key, x.text]))
|
|
7973
|
+
), w = document.querySelector(`.card-popup[data-wine-index="${d}"]`);
|
|
7974
|
+
if (!w)
|
|
7975
|
+
return;
|
|
7976
|
+
if (b["Short Description"]) {
|
|
7977
|
+
const x = w.querySelector(".popup-short-desc");
|
|
7978
|
+
x && (x.textContent = b["Short Description"]);
|
|
7979
|
+
}
|
|
7980
|
+
if (b.reason) {
|
|
7981
|
+
const x = w.querySelector(".popup-reason");
|
|
7982
|
+
x && (x.textContent = b.reason);
|
|
7983
|
+
}
|
|
7984
|
+
if (b.pairing_recommendation) {
|
|
7985
|
+
const x = w.querySelector(".popup-pairing");
|
|
7986
|
+
x && (x.textContent = b.pairing_recommendation);
|
|
7987
|
+
}
|
|
7988
|
+
const y = b.tags || b.Tags;
|
|
7989
|
+
if (y) {
|
|
7990
|
+
const C = y.split(",").map((R) => R.trim()).map((R) => `<span class="popup-tag">${R}</span>`).join(""), F = w.querySelector(".popup-tags");
|
|
7991
|
+
F && (F.innerHTML = C);
|
|
7960
7992
|
}
|
|
7961
7993
|
});
|
|
7962
7994
|
await Promise.all(c);
|
|
@@ -7972,7 +8004,7 @@ class va {
|
|
|
7972
8004
|
}
|
|
7973
8005
|
}
|
|
7974
8006
|
initializeSearchAnimation() {
|
|
7975
|
-
const e = document.getElementById("wine-search-input"), n =
|
|
8007
|
+
const e = document.getElementById("wine-search-input"), n = J.translate("placeholderSuggestions");
|
|
7976
8008
|
let s = 0, i = 0, r = !0, o = !1;
|
|
7977
8009
|
const l = () => {
|
|
7978
8010
|
o || (r ? (e.placeholder = n[s].substring(0, i++), i > n[s].length ? (r = !1, setTimeout(l, 2e3)) : setTimeout(l, 100)) : (e.placeholder = n[s].substring(0, i--), i < 0 ? (r = !0, s = (s + 1) % n.length, setTimeout(l, 500)) : setTimeout(l, 50)));
|
|
@@ -7984,16 +8016,16 @@ class va {
|
|
|
7984
8016
|
});
|
|
7985
8017
|
}
|
|
7986
8018
|
createLanguageSwitcher() {
|
|
7987
|
-
const e = document.querySelector("#powered-by-widget .powered-by-lang"), n =
|
|
8019
|
+
const e = document.querySelector("#powered-by-widget .powered-by-lang"), n = J.getSupportedLanguages();
|
|
7988
8020
|
if (!n)
|
|
7989
8021
|
return;
|
|
7990
|
-
const s =
|
|
8022
|
+
const s = J.language, i = document.createElement("select");
|
|
7991
8023
|
i.id = "language-dropdown", i.className = "language-dropdown", n.forEach((r) => {
|
|
7992
8024
|
const o = document.createElement("option");
|
|
7993
8025
|
o.value = r, o.textContent = r.toUpperCase(), o.selected = r === s, i.appendChild(o);
|
|
7994
8026
|
}), i.onchange = (r) => {
|
|
7995
|
-
const o = r.target.value;
|
|
7996
|
-
|
|
8027
|
+
const o = r.target.value, l = new URL(window.location.href);
|
|
8028
|
+
l.searchParams.set("lang", o), localStorage.setItem("selectedLanguage", o), window.location.href = l.toString();
|
|
7997
8029
|
}, e.appendChild(i);
|
|
7998
8030
|
}
|
|
7999
8031
|
}
|
|
@@ -8004,7 +8036,7 @@ class wa {
|
|
|
8004
8036
|
}
|
|
8005
8037
|
async initTranslator() {
|
|
8006
8038
|
const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Test";
|
|
8007
|
-
await
|
|
8039
|
+
await J.fetchConfig(e || "Test");
|
|
8008
8040
|
}
|
|
8009
8041
|
initCookies() {
|
|
8010
8042
|
var e;
|