wineater-bot 3.0.9 → 3.0.11
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 +701 -683
- package/dist/wineater-chatbot.umd.js +70 -80
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/js/api.js +2 -2
- package/src/js/i18n.js +15 -0
- package/src/js/widget-styles.js +19 -0
- package/src/js/widget.js +58 -38
|
@@ -724,58 +724,58 @@ var fs = { exports: {} };
|
|
|
724
724
|
return null;
|
|
725
725
|
}
|
|
726
726
|
}, getItem: function(b, f) {
|
|
727
|
-
var
|
|
727
|
+
var d = this;
|
|
728
728
|
return new Promise(function(m, g) {
|
|
729
729
|
try {
|
|
730
|
-
var w =
|
|
730
|
+
var w = d.getItemSync(b);
|
|
731
731
|
f == null || f(null, w), m(w);
|
|
732
732
|
} catch (x) {
|
|
733
733
|
f && f(x, null), g(x);
|
|
734
734
|
}
|
|
735
735
|
});
|
|
736
|
-
}, setItem: function(b, f,
|
|
736
|
+
}, setItem: function(b, f, d) {
|
|
737
737
|
return new Promise(function(m, g) {
|
|
738
738
|
try {
|
|
739
|
-
localStorage.setItem(b, f),
|
|
739
|
+
localStorage.setItem(b, f), d && d(null, f), m(f);
|
|
740
740
|
} catch (w) {
|
|
741
|
-
|
|
741
|
+
d && d(w, null), g(w);
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
} }, i = function() {
|
|
745
745
|
return i = Object.assign || function(b) {
|
|
746
|
-
for (var f,
|
|
747
|
-
for (var g in f = arguments[
|
|
746
|
+
for (var f, d = 1, m = arguments.length; d < m; d++)
|
|
747
|
+
for (var g in f = arguments[d])
|
|
748
748
|
Object.prototype.hasOwnProperty.call(f, g) && (b[g] = f[g]);
|
|
749
749
|
return b;
|
|
750
750
|
}, i.apply(this, arguments);
|
|
751
751
|
};
|
|
752
|
-
function r(b, f,
|
|
753
|
-
return new (
|
|
754
|
-
function x(
|
|
752
|
+
function r(b, f, d, m) {
|
|
753
|
+
return new (d || (d = Promise))(function(g, w) {
|
|
754
|
+
function x(H) {
|
|
755
755
|
try {
|
|
756
|
-
M(m.next(
|
|
756
|
+
M(m.next(H));
|
|
757
757
|
} catch (_) {
|
|
758
758
|
w(_);
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
function R(
|
|
761
|
+
function R(H) {
|
|
762
762
|
try {
|
|
763
|
-
M(m.throw(
|
|
763
|
+
M(m.throw(H));
|
|
764
764
|
} catch (_) {
|
|
765
765
|
w(_);
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
|
-
function M(
|
|
768
|
+
function M(H) {
|
|
769
769
|
var _;
|
|
770
|
-
|
|
771
|
-
|
|
770
|
+
H.done ? g(H.value) : (_ = H.value, _ instanceof d ? _ : new d(function(W) {
|
|
771
|
+
W(_);
|
|
772
772
|
})).then(x, R);
|
|
773
773
|
}
|
|
774
774
|
M((m = m.apply(b, f || [])).next());
|
|
775
775
|
});
|
|
776
776
|
}
|
|
777
777
|
function o(b, f) {
|
|
778
|
-
var
|
|
778
|
+
var d, m, g, w, x = { label: 0, sent: function() {
|
|
779
779
|
if (1 & g[0])
|
|
780
780
|
throw g[1];
|
|
781
781
|
return g[1];
|
|
@@ -784,13 +784,13 @@ var fs = { exports: {} };
|
|
|
784
784
|
return this;
|
|
785
785
|
}), w;
|
|
786
786
|
function R(M) {
|
|
787
|
-
return function(
|
|
787
|
+
return function(H) {
|
|
788
788
|
return function(_) {
|
|
789
|
-
if (
|
|
789
|
+
if (d)
|
|
790
790
|
throw new TypeError("Generator is already executing.");
|
|
791
791
|
for (; x; )
|
|
792
792
|
try {
|
|
793
|
-
if (
|
|
793
|
+
if (d = 1, m && (g = 2 & _[0] ? m.return : _[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, _[1])).done)
|
|
794
794
|
return g;
|
|
795
795
|
switch (m = 0, g && (_ = [2 & _[0], g.value]), _[0]) {
|
|
796
796
|
case 0:
|
|
@@ -826,83 +826,83 @@ var fs = { exports: {} };
|
|
|
826
826
|
continue;
|
|
827
827
|
}
|
|
828
828
|
_ = f.call(b, x);
|
|
829
|
-
} catch (
|
|
830
|
-
_ = [6,
|
|
829
|
+
} catch (W) {
|
|
830
|
+
_ = [6, W], m = 0;
|
|
831
831
|
} finally {
|
|
832
|
-
|
|
832
|
+
d = g = 0;
|
|
833
833
|
}
|
|
834
834
|
if (5 & _[0])
|
|
835
835
|
throw _[1];
|
|
836
836
|
return { value: _[0] ? _[1] : void 0, done: !0 };
|
|
837
|
-
}([M,
|
|
837
|
+
}([M, H]);
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
function l(b, f,
|
|
842
|
-
if (
|
|
841
|
+
function l(b, f, d) {
|
|
842
|
+
if (d || arguments.length === 2)
|
|
843
843
|
for (var m, g = 0, w = f.length; g < w; g++)
|
|
844
844
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
845
845
|
return b.concat(m || Array.prototype.slice.call(f));
|
|
846
846
|
}
|
|
847
|
-
var a = function b(f,
|
|
848
|
-
if (f ===
|
|
847
|
+
var a = function b(f, d) {
|
|
848
|
+
if (f === d)
|
|
849
849
|
return !0;
|
|
850
|
-
if (f &&
|
|
851
|
-
if (f.constructor !==
|
|
850
|
+
if (f && d && typeof f == "object" && typeof d == "object") {
|
|
851
|
+
if (f.constructor !== d.constructor)
|
|
852
852
|
return !1;
|
|
853
853
|
var m, g, w;
|
|
854
854
|
if (Array.isArray(f)) {
|
|
855
|
-
if ((m = f.length) !=
|
|
855
|
+
if ((m = f.length) != d.length)
|
|
856
856
|
return !1;
|
|
857
857
|
for (g = m; g-- != 0; )
|
|
858
|
-
if (!b(f[g],
|
|
858
|
+
if (!b(f[g], d[g]))
|
|
859
859
|
return !1;
|
|
860
860
|
return !0;
|
|
861
861
|
}
|
|
862
862
|
if (f.constructor === RegExp)
|
|
863
|
-
return f.source ===
|
|
863
|
+
return f.source === d.source && f.flags === d.flags;
|
|
864
864
|
if (f.valueOf !== Object.prototype.valueOf)
|
|
865
|
-
return f.valueOf() ===
|
|
865
|
+
return f.valueOf() === d.valueOf();
|
|
866
866
|
if (f.toString !== Object.prototype.toString)
|
|
867
|
-
return f.toString() ===
|
|
868
|
-
if ((m = (w = Object.keys(f)).length) !== Object.keys(
|
|
867
|
+
return f.toString() === d.toString();
|
|
868
|
+
if ((m = (w = Object.keys(f)).length) !== Object.keys(d).length)
|
|
869
869
|
return !1;
|
|
870
870
|
for (g = m; g-- != 0; )
|
|
871
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
871
|
+
if (!Object.prototype.hasOwnProperty.call(d, w[g]))
|
|
872
872
|
return !1;
|
|
873
873
|
for (g = m; g-- != 0; ) {
|
|
874
874
|
var x = w[g];
|
|
875
|
-
if (!b(f[x],
|
|
875
|
+
if (!b(f[x], d[x]))
|
|
876
876
|
return !1;
|
|
877
877
|
}
|
|
878
878
|
return !0;
|
|
879
879
|
}
|
|
880
|
-
return f != f &&
|
|
880
|
+
return f != f && d != d;
|
|
881
881
|
};
|
|
882
882
|
function h(b, f) {
|
|
883
|
-
var
|
|
883
|
+
var d = Object.keys(f || {}).filter(function(m) {
|
|
884
884
|
var g = b == null ? void 0 : b[m], w = f == null ? void 0 : f[m];
|
|
885
885
|
return !a(g, w);
|
|
886
886
|
});
|
|
887
887
|
return Object.keys(b || {}).filter(function(m) {
|
|
888
|
-
Object.keys(f || {}).includes(m) ||
|
|
889
|
-
}), Object.keys(
|
|
888
|
+
Object.keys(f || {}).includes(m) || d.push(m);
|
|
889
|
+
}), Object.keys(d).length ? d : null;
|
|
890
890
|
}
|
|
891
|
-
var c,
|
|
892
|
-
function p(b, f,
|
|
891
|
+
var c, u;
|
|
892
|
+
function p(b, f, d) {
|
|
893
893
|
var m = "shortString", g = !0;
|
|
894
|
-
typeof
|
|
894
|
+
typeof d == "number" && (m = "javaDouble", g = !1), b[m] = b[m] || {}, b[m][f] = g ? d + "" : d;
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function y(b) {
|
|
897
897
|
return !!b && typeof b == "object" && b.value !== void 0;
|
|
898
898
|
}
|
|
899
899
|
function S(b) {
|
|
900
900
|
return Object.fromEntries(Object.entries(b).map(function(f) {
|
|
901
|
-
var
|
|
902
|
-
return [
|
|
901
|
+
var d = f[0], m = f[1];
|
|
902
|
+
return [d, y(m) ? m : { value: m }];
|
|
903
903
|
}));
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function v(b) {
|
|
906
906
|
return i(i({}, b), { identity: b.identity ? i(i({}, b.identity), { traits: S(b.identity.traits || {}) }) : void 0 });
|
|
907
907
|
}
|
|
908
908
|
(function(b) {
|
|
@@ -910,176 +910,176 @@ var fs = { exports: {} };
|
|
|
910
910
|
})(c || (c = {}));
|
|
911
911
|
var E, F = null, P = "BULLET_TRAIN_DB", A = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", O = "flagsmith_enabled_", D = "flagsmith_trait_", I = function() {
|
|
912
912
|
function b(f) {
|
|
913
|
-
var
|
|
913
|
+
var d = this;
|
|
914
914
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
915
|
-
var m =
|
|
916
|
-
|
|
917
|
-
var x = "".concat(
|
|
918
|
-
var
|
|
919
|
-
if (M && x === "".concat(
|
|
915
|
+
var m = d, g = m.api, w = m.evaluationContext;
|
|
916
|
+
d.log("Get Flags"), d.isLoading = !0, d.loadingState.isFetching || d.setLoadingState(i(i({}, d.loadingState), { isFetching: !0 }));
|
|
917
|
+
var x = "".concat(d.getContext().identity), R = function(M) {
|
|
918
|
+
var H, _, W, ee;
|
|
919
|
+
if (M && x === "".concat(d.getContext().identity)) {
|
|
920
920
|
var ae = M.flags, te = M.traits, se = M.identifier;
|
|
921
|
-
|
|
921
|
+
d.isLoading = !1;
|
|
922
922
|
var ce = {}, le = {};
|
|
923
|
-
te = te || [], (ae = ae || []).forEach(function(
|
|
924
|
-
ce[
|
|
925
|
-
}), te.forEach(function(
|
|
926
|
-
le[
|
|
927
|
-
}),
|
|
928
|
-
var me = h(
|
|
929
|
-
if ((se || Object.keys(le).length) && (
|
|
923
|
+
te = te || [], (ae = ae || []).forEach(function(K) {
|
|
924
|
+
ce[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
|
|
925
|
+
}), te.forEach(function(K) {
|
|
926
|
+
le[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
|
|
927
|
+
}), d.oldFlags = i({}, d.flags);
|
|
928
|
+
var me = h(d.oldFlags, ce), Ke = h((H = d.evaluationContext.identity) === null || H === void 0 ? void 0 : H.traits, le);
|
|
929
|
+
if ((se || Object.keys(le).length) && (d.evaluationContext.identity = { traits: le }, se && (d.evaluationContext.identity.identifier = se)), d.flags = ce, d.updateStorage(), d._onChange(d.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: Ke }, d._loadedState(null, c.SERVER)), d.datadogRum)
|
|
930
930
|
try {
|
|
931
|
-
if (
|
|
931
|
+
if (d.datadogRum.trackTraits) {
|
|
932
932
|
var Je = {};
|
|
933
|
-
Object.keys(((_ =
|
|
934
|
-
Je[D +
|
|
933
|
+
Object.keys(((_ = d.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(K) {
|
|
934
|
+
Je[D + K] = d.getTrait(K);
|
|
935
935
|
});
|
|
936
|
-
var Le = i(i(i({},
|
|
937
|
-
|
|
936
|
+
var Le = i(i(i({}, d.datadogRum.client.getUser()), { id: d.datadogRum.client.getUser().id || ((W = d.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Je);
|
|
937
|
+
d.log("Setting Datadog user", Le), d.datadogRum.client.setUser(Le);
|
|
938
938
|
}
|
|
939
|
-
} catch (
|
|
940
|
-
console.error(
|
|
939
|
+
} catch (K) {
|
|
940
|
+
console.error(K);
|
|
941
941
|
}
|
|
942
|
-
if (
|
|
942
|
+
if (d.dtrum)
|
|
943
943
|
try {
|
|
944
944
|
var ne = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
945
|
-
Object.keys(
|
|
946
|
-
p(ne, N +
|
|
947
|
-
}), Object.keys(((ee =
|
|
948
|
-
p(ne, D +
|
|
949
|
-
}),
|
|
950
|
-
} catch (
|
|
951
|
-
console.error(
|
|
945
|
+
Object.keys(d.flags).map(function(K) {
|
|
946
|
+
p(ne, N + K, d.getValue(K, { skipAnalytics: !0 })), p(ne, O + K, d.hasFeature(K, { skipAnalytics: !0 }));
|
|
947
|
+
}), Object.keys(((ee = d.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(K) {
|
|
948
|
+
p(ne, D + K, d.getTrait(K));
|
|
949
|
+
}), d.log("Sending javaLongOrObject traits to dynatrace", ne.javaLongOrObject), d.log("Sending date traits to dynatrace", ne.date), d.log("Sending shortString traits to dynatrace", ne.shortString), d.log("Sending javaDouble to dynatrace", ne.javaDouble), d.dtrum.sendSessionProperties(ne.javaLongOrObject, ne.date, ne.shortString, ne.javaDouble);
|
|
950
|
+
} catch (K) {
|
|
951
|
+
console.error(K);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
};
|
|
955
|
-
return w.identity ? Promise.all([w.identity.traits && Object.keys(w.identity.traits).length || !w.identity.identifier ?
|
|
956
|
-
var
|
|
957
|
-
return { trait_key:
|
|
955
|
+
return w.identity ? Promise.all([w.identity.traits && Object.keys(w.identity.traits).length || !w.identity.identifier ? d.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: w.identity.identifier, transient: w.identity.transient, traits: Object.entries(w.identity.traits).map(function(M) {
|
|
956
|
+
var H = M[0], _ = M[1];
|
|
957
|
+
return { trait_key: H, trait_value: _ == null ? void 0 : _.value, transient: _ == null ? void 0 : _.transient };
|
|
958
958
|
}).filter(function(M) {
|
|
959
|
-
return M.trait_value !== void 0 || (
|
|
960
|
-
}) })) :
|
|
961
|
-
return
|
|
959
|
+
return M.trait_value !== void 0 || (d.log("Warning - attempted to set an undefined trait value for key", M.trait_key), !1);
|
|
960
|
+
}) })) : d.getJSON(g + "identities/?identifier=" + encodeURIComponent(w.identity.identifier) + (w.identity.transient ? "&transient=true" : ""))]).then(function(M) {
|
|
961
|
+
return d.evaluationContext.identity = i(i({}, d.evaluationContext.identity), { traits: {} }), R(M == null ? void 0 : M[0]);
|
|
962
962
|
}).catch(function(M) {
|
|
963
|
-
var
|
|
963
|
+
var H = M.message, _ = new Error(H);
|
|
964
964
|
return Promise.reject(_);
|
|
965
|
-
}) :
|
|
965
|
+
}) : d.getJSON(g + "flags/").then(function(M) {
|
|
966
966
|
return R({ flags: M, traits: void 0 });
|
|
967
967
|
});
|
|
968
968
|
}, this.analyticsFlags = function() {
|
|
969
|
-
var m =
|
|
970
|
-
if (
|
|
971
|
-
return
|
|
972
|
-
if (
|
|
973
|
-
var w =
|
|
974
|
-
|
|
969
|
+
var m = d.api;
|
|
970
|
+
if (d.evaluationEvent && d.evaluationContext.environment && d.evaluationEvent[d.evaluationContext.environment.apiKey])
|
|
971
|
+
return d.evaluationEvent && Object.getOwnPropertyNames(d.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(d.evaluationEvent[d.evaluationContext.environment.apiKey]).length !== 0 ? d.getJSON(m + "analytics/flags/", "POST", JSON.stringify(d.evaluationEvent[d.evaluationContext.environment.apiKey])).then(function(g) {
|
|
972
|
+
if (d.evaluationContext.environment) {
|
|
973
|
+
var w = d.getState();
|
|
974
|
+
d.evaluationEvent || (d.evaluationEvent = {}), d.evaluationEvent[d.evaluationContext.environment.apiKey] = {}, d.setState(i(i({}, w), { evaluationEvent: d.evaluationEvent })), d.updateEventStorage();
|
|
975
975
|
}
|
|
976
976
|
}).catch(function(g) {
|
|
977
|
-
|
|
977
|
+
d.log("Exception fetching evaluationEvent", g);
|
|
978
978
|
}) : void 0;
|
|
979
979
|
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: c.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, w) {
|
|
980
|
-
var x =
|
|
981
|
-
if (x && (R = x.value), g != null && g.skipAnalytics || w ||
|
|
980
|
+
var x = d.flags && d.flags[m.toLowerCase().replace(/ /g, "_")], R = null;
|
|
981
|
+
if (x && (R = x.value), g != null && g.skipAnalytics || w || d.evaluateFlag(m, "VALUE"), R === null && (g == null ? void 0 : g.fallback) !== void 0)
|
|
982
982
|
return g.fallback;
|
|
983
983
|
if (g != null && g.json)
|
|
984
984
|
try {
|
|
985
|
-
return R === null ? (
|
|
985
|
+
return R === null ? (d.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(R);
|
|
986
986
|
} catch {
|
|
987
987
|
return g.fallback;
|
|
988
988
|
}
|
|
989
989
|
return R;
|
|
990
990
|
}, this.getTrait = function(m) {
|
|
991
991
|
var g, w;
|
|
992
|
-
return ((g =
|
|
992
|
+
return ((g = d.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((w = d.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || w === void 0 ? void 0 : w.value);
|
|
993
993
|
}, this.getAllTraits = function() {
|
|
994
994
|
var m;
|
|
995
|
-
return Object.fromEntries(Object.entries(((m =
|
|
995
|
+
return Object.fromEntries(Object.entries(((m = d.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
|
|
996
996
|
var w = g[0], x = g[1];
|
|
997
997
|
return [w, x == null ? void 0 : x.value];
|
|
998
998
|
}));
|
|
999
999
|
}, this.setContext = function(m) {
|
|
1000
|
-
var g =
|
|
1001
|
-
return
|
|
1000
|
+
var g = v(m);
|
|
1001
|
+
return d.evaluationContext = i(i({}, g), { environment: g.environment || d.evaluationContext.environment }), d.initialised ? d.getFlags() : Promise.resolve();
|
|
1002
1002
|
}, this.getContext = function() {
|
|
1003
|
-
return
|
|
1003
|
+
return d.evaluationContext;
|
|
1004
1004
|
}, this.updateContext = function(m) {
|
|
1005
|
-
return
|
|
1005
|
+
return d.setContext(i(i({}, d.getContext()), m));
|
|
1006
1006
|
}, this.setTrait = function(m, g) {
|
|
1007
1007
|
var w;
|
|
1008
|
-
if (
|
|
1009
|
-
return
|
|
1008
|
+
if (d.api)
|
|
1009
|
+
return d.setContext(i(i({}, d.evaluationContext), { identity: i(i({}, d.evaluationContext.identity), { traits: i(i({}, (w = d.evaluationContext.identity) === null || w === void 0 ? void 0 : w.traits), S(Object.fromEntries([[m, g]]))) }) }));
|
|
1010
1010
|
}, this.setTraits = function(m) {
|
|
1011
1011
|
var g;
|
|
1012
|
-
if (
|
|
1013
|
-
return
|
|
1012
|
+
if (d.api)
|
|
1013
|
+
return d.setContext(i(i({}, d.evaluationContext), { identity: i(i({}, d.evaluationContext.identity), { traits: i(i({}, (g = d.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(w) {
|
|
1014
1014
|
var x = w[0], R = w[1];
|
|
1015
|
-
return [x,
|
|
1015
|
+
return [x, y(R) ? R : { value: R }];
|
|
1016
1016
|
}))) }) }));
|
|
1017
1017
|
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.");
|
|
1018
1018
|
}, this.hasFeature = function(m, g) {
|
|
1019
|
-
var w = typeof g == "object", x =
|
|
1020
|
-
return !x && w && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (w && !g.skipAnalytics || !g) &&
|
|
1019
|
+
var w = typeof g == "object", x = d.flags && d.flags[m.toLowerCase().replace(/ /g, "_")], R = !1;
|
|
1020
|
+
return !x && w && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (w && !g.skipAnalytics || !g) && d.evaluateFlag(m, "ENABLED"), R;
|
|
1021
1021
|
}, this.getJSON = function(m, g, w) {
|
|
1022
|
-
var x, R =
|
|
1022
|
+
var x, R = d;
|
|
1023
1023
|
R.evaluationContext;
|
|
1024
|
-
var M = R.headers,
|
|
1025
|
-
|
|
1026
|
-
var _ = "".concat((x =
|
|
1027
|
-
return
|
|
1028
|
-
var ee, ae, te = "".concat((ee =
|
|
1024
|
+
var M = R.headers, H = { method: g || "GET", body: w, cache: "no-cache", headers: {} };
|
|
1025
|
+
d.evaluationContext.environment && (H.headers["X-Environment-Key"] = d.evaluationContext.environment.apiKey), g && g !== "GET" && (H.headers["Content-Type"] = "application/json; charset=utf-8"), M && Object.assign(H.headers, M), u || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
1026
|
+
var _ = "".concat((x = d.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
|
|
1027
|
+
return u(m, H).then(function(W) {
|
|
1028
|
+
var ee, ae, te = "".concat((ee = d.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.identifier);
|
|
1029
1029
|
if (_ === te) {
|
|
1030
|
-
var se = (ae =
|
|
1030
|
+
var se = (ae = W.headers) === null || ae === void 0 ? void 0 : ae.get("x-flagsmith-document-updated-at");
|
|
1031
1031
|
if (se)
|
|
1032
1032
|
try {
|
|
1033
1033
|
var ce = parseFloat(se);
|
|
1034
1034
|
if (isNaN(ce))
|
|
1035
1035
|
return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
1036
|
-
|
|
1036
|
+
d.timestamp = ce;
|
|
1037
1037
|
} catch (le) {
|
|
1038
|
-
|
|
1038
|
+
d.log(le, "Failed to parse x-flagsmith-document-updated-at", se);
|
|
1039
1039
|
}
|
|
1040
|
-
return
|
|
1040
|
+
return d.log("Fetch response: " + W.status + " " + (g || "GET") + 0 + m), W.text().then(function(le) {
|
|
1041
1041
|
var me = le;
|
|
1042
1042
|
try {
|
|
1043
1043
|
me = JSON.parse(le);
|
|
1044
1044
|
} catch {
|
|
1045
1045
|
}
|
|
1046
|
-
return !me &&
|
|
1046
|
+
return !me && W.status && (me = "API Response: ".concat(W.status)), W.status && W.status >= 200 && W.status < 300 ? me : Promise.reject(new Error(me));
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
|
-
|
|
1049
|
+
d.log("Received response with identity mismatch, ignoring response. Requested: ".concat(_, ", Current: ").concat(te));
|
|
1050
1050
|
});
|
|
1051
1051
|
}, this.evaluateFlag = function(m, g) {
|
|
1052
|
-
if (
|
|
1053
|
-
if (!
|
|
1052
|
+
if (d.datadogRum && (d.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? d.datadogRum.client.addFeatureFlagEvaluation(N + m, d.getValue(m, {}, !0)) : d.datadogRum.client.addFeatureFlagEvaluation(O + m, d.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), d.enableAnalytics) {
|
|
1053
|
+
if (!d.evaluationEvent || !d.evaluationContext.environment)
|
|
1054
1054
|
return;
|
|
1055
|
-
|
|
1055
|
+
d.evaluationEvent[d.evaluationContext.environment.apiKey] || (d.evaluationEvent[d.evaluationContext.environment.apiKey] = {}), d.evaluationEvent[d.evaluationContext.environment.apiKey][m] === void 0 && (d.evaluationEvent[d.evaluationContext.environment.apiKey][m] = 0), d.evaluationEvent[d.evaluationContext.environment.apiKey][m] += 1;
|
|
1056
1056
|
}
|
|
1057
|
-
|
|
1057
|
+
d.updateEventStorage();
|
|
1058
1058
|
}, this._onChange = function(m, g, w) {
|
|
1059
1059
|
var x, R;
|
|
1060
|
-
|
|
1061
|
-
},
|
|
1060
|
+
d.setLoadingState(w), (x = d.onChange) === null || x === void 0 || x.call(d, m, g, d.loadingState), (R = d._trigger) === null || R === void 0 || R.call(d);
|
|
1061
|
+
}, u = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : We == null ? void 0 : We.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (E = f.eventSource), f.AsyncStorage && (F = f.AsyncStorage);
|
|
1062
1062
|
}
|
|
1063
1063
|
return b.prototype.init = function(f) {
|
|
1064
|
-
var
|
|
1064
|
+
var d, m, g;
|
|
1065
1065
|
return r(this, void 0, void 0, function() {
|
|
1066
|
-
var w, x, R, M,
|
|
1066
|
+
var w, x, R, M, H, _, W, ee, ae, te, se, ce, le, me, Ke, Je, Le, ne, K, At, Xe, $s, Ye, Dt, Ws, qs, Lt, Vs, Mt, Qe, Me, Gs, ie = this;
|
|
1067
1067
|
return o(this, function(pe) {
|
|
1068
1068
|
switch (pe.label) {
|
|
1069
1069
|
case 0:
|
|
1070
|
-
w =
|
|
1070
|
+
w = v(f.evaluationContext || this.evaluationContext), pe.label = 1;
|
|
1071
1071
|
case 1:
|
|
1072
|
-
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, M = R === void 0 ? k : R,
|
|
1072
|
+
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, M = R === void 0 ? k : R, H = f.headers, _ = f.onChange, W = f.cacheFlags, ee = f.datadogRum, ae = f.onError, te = f.defaultFlags, se = f.fetch, ce = f.preventFetch, le = f.enableLogs, me = f.enableDynatrace, Ke = f.enableAnalytics, Je = f.realtime, Le = f.eventSourceUrl, ne = Le === void 0 ? "https://realtime.flagsmith.com/" : Le, K = f.AsyncStorage, At = f.identity, Xe = f.traits, $s = f.state, Ye = f.cacheOptions, Dt = f.angularHttpClient, Ws = f._trigger, qs = f._triggerLoadingState, w.environment = x ? { apiKey: x } : w.environment, !w.environment || !w.environment.apiKey)
|
|
1073
1073
|
throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
1074
1074
|
if (w.identity = At || Xe ? { identifier: At, traits: Xe ? Object.fromEntries(Object.entries(Xe).map(function(he) {
|
|
1075
1075
|
return [he[0], { value: he[1] }];
|
|
1076
|
-
})) : {} } : w.identity, this.evaluationContext = w, this.api = M, this.headers =
|
|
1076
|
+
})) : {} } : w.identity, this.evaluationContext = w, this.api = M, this.headers = H, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Lt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Ws || this._trigger, this._triggerLoadingState = qs || this._triggerLoadingState, this.onError = function(he) {
|
|
1077
1077
|
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: he })), ae == null || ae(he);
|
|
1078
|
-
}, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), se && (
|
|
1079
|
-
return function(be,
|
|
1080
|
-
var Te =
|
|
1078
|
+
}, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), se && (u = se), this.enableAnalytics = Ke || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = F !== void 0 && !!W, K && (F = K), Je && typeof window < "u" && this.setupRealtime(ne, w.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState($s), this.log("Initialising with properties", f, this), me && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), Dt && (u = /* @__PURE__ */ function(he) {
|
|
1079
|
+
return function(be, ye) {
|
|
1080
|
+
var Te = ye.headers, X = ye.method, Be = ye.body;
|
|
1081
1081
|
return new Promise(function(Re) {
|
|
1082
|
-
switch (
|
|
1082
|
+
switch (X) {
|
|
1083
1083
|
case "GET":
|
|
1084
1084
|
return he.get(be, { headers: Te }).subscribe(function(ke) {
|
|
1085
1085
|
Re({ ok: !0, text: function() {
|
|
@@ -1105,27 +1105,27 @@ var fs = { exports: {} };
|
|
|
1105
1105
|
ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
|
|
1106
1106
|
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), F && this.canUseStorage && F.getItem(A, function(he, be) {
|
|
1107
1107
|
if (be && ie.evaluationContext.environment) {
|
|
1108
|
-
var
|
|
1109
|
-
if (
|
|
1108
|
+
var ye = JSON.parse(be);
|
|
1109
|
+
if (ye[ie.evaluationContext.environment.apiKey]) {
|
|
1110
1110
|
var Te = ie.getState();
|
|
1111
|
-
ie.log("Retrieved events from cache", be), ie.setState(i(i({}, Te), { evaluationEvent:
|
|
1111
|
+
ie.log("Retrieved events from cache", be), ie.setState(i(i({}, Te), { evaluationEvent: ye[ie.evaluationContext.environment.apiKey] }));
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
})), !
|
|
1114
|
+
})), !W)
|
|
1115
1115
|
return [3, 9];
|
|
1116
1116
|
if (!F || !this.canUseStorage)
|
|
1117
1117
|
return [3, 8];
|
|
1118
1118
|
Vs = function(he, be) {
|
|
1119
1119
|
return r(ie, void 0, void 0, function() {
|
|
1120
|
-
var
|
|
1120
|
+
var ye, Te, X, Be, Re, ke, Bt, Ks, Pt, jt, zt, Ut, Ht, $t, Wt, qt, Vt, Gt, Kt, Jt, Xt, Yt, Qt, Zt;
|
|
1121
1121
|
return o(this, function(Ie) {
|
|
1122
1122
|
switch (Ie.label) {
|
|
1123
1123
|
case 0:
|
|
1124
1124
|
if (!be)
|
|
1125
1125
|
return [3, 7];
|
|
1126
|
-
|
|
1126
|
+
ye = null, Te = null, Ie.label = 1;
|
|
1127
1127
|
case 1:
|
|
1128
|
-
return Ie.trys.push([1, 5, , 6]),
|
|
1128
|
+
return Ie.trys.push([1, 5, , 6]), X = JSON.parse(be), Be = !1, Re = !1, X && X.api === this.api && ((jt = (Pt = X.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.environment) === null || jt === void 0 ? void 0 : jt.apiKey) === ((zt = this.evaluationContext.environment) === null || zt === void 0 ? void 0 : zt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = X.evaluationContext) === null || Ut === void 0 ? void 0 : Ut.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = ($t = X.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!X.ts || (/* @__PURE__ */ new Date()).valueOf() - X.ts > this.cacheOptions.ttl) && (X.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + X.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - X.ts) + "ms"), ke = !1) : X.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + X.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - X.ts) + "ms"), Re = !0, ke = !0)), ke && (Be = !0, Te = h((qt = this.evaluationContext.identity) === null || qt === void 0 ? void 0 : qt.traits, (Gt = (Vt = X.evaluationContext) === null || Vt === void 0 ? void 0 : Vt.identity) === null || Gt === void 0 ? void 0 : Gt.traits), ye = h(this.flags, X.flags), this.setState(i(i({}, X), { evaluationContext: v(i(i({}, X.evaluationContext), { identity: !((Kt = X.evaluationContext) === null || Kt === void 0) && Kt.identity ? i(i({}, (Jt = X.evaluationContext) === null || Jt === void 0 ? void 0 : Jt.identity), { traits: i(i({}, ((Yt = (Xt = X.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity) === null || Yt === void 0 ? void 0 : Yt.traits) || {}), Xe || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", X))), Be ? (Bt = !ce && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ye, traitsChanged: Te }, this._loadedState(null, c.CACHE, Bt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Be && !Re && this.log("Skipping API, using cache"), Bt && this.getFlags(), [3, 4]) : [3, 2];
|
|
1129
1129
|
case 2:
|
|
1130
1130
|
return ce ? [3, 4] : [4, this.getFlags()];
|
|
1131
1131
|
case 3:
|
|
@@ -1174,7 +1174,7 @@ var fs = { exports: {} };
|
|
|
1174
1174
|
return pe.sent(), [3, 12];
|
|
1175
1175
|
case 11:
|
|
1176
1176
|
if (te)
|
|
1177
|
-
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, te), traitsChanged: h({}, (
|
|
1177
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, te), traitsChanged: h({}, (d = w.identity) === null || d === void 0 ? void 0 : d.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1178
1178
|
else if (this.flags && (Qe = null, Object.keys(this.flags).length === 0 && (Qe = Lt), this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (m = w.identity) === null || m === void 0 ? void 0 : m.traits) }, this._loadedState(Qe, c.DEFAULT_FLAGS)), Qe))
|
|
1179
1179
|
throw new Error(Qe);
|
|
1180
1180
|
pe.label = 12;
|
|
@@ -1187,14 +1187,14 @@ var fs = { exports: {} };
|
|
|
1187
1187
|
}
|
|
1188
1188
|
});
|
|
1189
1189
|
});
|
|
1190
|
-
}, b.prototype._loadedState = function(f,
|
|
1191
|
-
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source:
|
|
1190
|
+
}, b.prototype._loadedState = function(f, d, m) {
|
|
1191
|
+
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: d };
|
|
1192
1192
|
}, b.prototype.getAllFlags = function() {
|
|
1193
1193
|
return this.flags;
|
|
1194
|
-
}, b.prototype.identify = function(f,
|
|
1195
|
-
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),
|
|
1194
|
+
}, b.prototype.identify = function(f, d, m) {
|
|
1195
|
+
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), d && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(d).map(function(g) {
|
|
1196
1196
|
var w = g[0], x = g[1];
|
|
1197
|
-
return [w,
|
|
1197
|
+
return [w, y(x) ? x : { value: x }];
|
|
1198
1198
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
1199
1199
|
}, b.prototype.getState = function() {
|
|
1200
1200
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
@@ -1207,8 +1207,8 @@ var fs = { exports: {} };
|
|
|
1207
1207
|
}, b.prototype.stopListening = function() {
|
|
1208
1208
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
1209
1209
|
}, b.prototype.log = function() {
|
|
1210
|
-
for (var f = [],
|
|
1211
|
-
f[
|
|
1210
|
+
for (var f = [], d = 0; d < arguments.length; d++)
|
|
1211
|
+
f[d] = arguments[d];
|
|
1212
1212
|
this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
|
|
1213
1213
|
}, b.prototype.updateStorage = function() {
|
|
1214
1214
|
if (this.cacheFlags) {
|
|
@@ -1222,10 +1222,10 @@ var fs = { exports: {} };
|
|
|
1222
1222
|
F.setItem(A, f);
|
|
1223
1223
|
}
|
|
1224
1224
|
}, b.prototype.setLoadingState = function(f) {
|
|
1225
|
-
var
|
|
1226
|
-
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (
|
|
1227
|
-
}, b.prototype.setupRealtime = function(f,
|
|
1228
|
-
var m = this, g = f + "sse/environments/" +
|
|
1225
|
+
var d;
|
|
1226
|
+
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (d = this._triggerLoadingState) === null || d === void 0 || d.call(this));
|
|
1227
|
+
}, b.prototype.setupRealtime = function(f, d) {
|
|
1228
|
+
var m = this, g = f + "sse/environments/" + d + "/stream";
|
|
1229
1229
|
E ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new E(g), this.eventSource.addEventListener("environment_updated", function(w) {
|
|
1230
1230
|
var x;
|
|
1231
1231
|
try {
|
|
@@ -1238,37 +1238,37 @@ var fs = { exports: {} };
|
|
|
1238
1238
|
}, b;
|
|
1239
1239
|
}();
|
|
1240
1240
|
function T(b) {
|
|
1241
|
-
var f = b.fetch,
|
|
1242
|
-
return new I({ fetch: f, AsyncStorage:
|
|
1241
|
+
var f = b.fetch, d = b.AsyncStorage, m = b.eventSource;
|
|
1242
|
+
return new I({ fetch: f, AsyncStorage: d, eventSource: m });
|
|
1243
1243
|
}
|
|
1244
|
-
var B,
|
|
1245
|
-
return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
1246
|
-
|
|
1247
|
-
} || function(
|
|
1244
|
+
var B, V = (B = function(b, f) {
|
|
1245
|
+
return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, m) {
|
|
1246
|
+
d.__proto__ = m;
|
|
1247
|
+
} || function(d, m) {
|
|
1248
1248
|
for (var g in m)
|
|
1249
|
-
Object.prototype.hasOwnProperty.call(m, g) && (
|
|
1249
|
+
Object.prototype.hasOwnProperty.call(m, g) && (d[g] = m[g]);
|
|
1250
1250
|
}, B(b, f);
|
|
1251
1251
|
}, function(b, f) {
|
|
1252
1252
|
if (typeof f != "function" && f !== null)
|
|
1253
1253
|
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
1254
|
-
function
|
|
1254
|
+
function d() {
|
|
1255
1255
|
this.constructor = b;
|
|
1256
1256
|
}
|
|
1257
|
-
B(b, f), b.prototype = f === null ? Object.create(f) : (
|
|
1257
|
+
B(b, f), b.prototype = f === null ? Object.create(f) : (d.prototype = f.prototype, new d());
|
|
1258
1258
|
}), j = function(b) {
|
|
1259
|
-
var f = typeof Symbol == "function" && Symbol.iterator,
|
|
1260
|
-
if (
|
|
1261
|
-
return
|
|
1259
|
+
var f = typeof Symbol == "function" && Symbol.iterator, d = f && b[f], m = 0;
|
|
1260
|
+
if (d)
|
|
1261
|
+
return d.call(b);
|
|
1262
1262
|
if (b && typeof b.length == "number")
|
|
1263
1263
|
return { next: function() {
|
|
1264
1264
|
return b && m >= b.length && (b = void 0), { value: b && b[m++], done: !b };
|
|
1265
1265
|
} };
|
|
1266
1266
|
throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1267
|
-
},
|
|
1268
|
-
var
|
|
1269
|
-
if (!
|
|
1267
|
+
}, $ = function(b, f) {
|
|
1268
|
+
var d = typeof Symbol == "function" && b[Symbol.iterator];
|
|
1269
|
+
if (!d)
|
|
1270
1270
|
return b;
|
|
1271
|
-
var m, g, w =
|
|
1271
|
+
var m, g, w = d.call(b), x = [];
|
|
1272
1272
|
try {
|
|
1273
1273
|
for (; (f === void 0 || f-- > 0) && !(m = w.next()).done; )
|
|
1274
1274
|
x.push(m.value);
|
|
@@ -1276,15 +1276,15 @@ var fs = { exports: {} };
|
|
|
1276
1276
|
g = { error: R };
|
|
1277
1277
|
} finally {
|
|
1278
1278
|
try {
|
|
1279
|
-
m && !m.done && (
|
|
1279
|
+
m && !m.done && (d = w.return) && d.call(w);
|
|
1280
1280
|
} finally {
|
|
1281
1281
|
if (g)
|
|
1282
1282
|
throw g.error;
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
return x;
|
|
1286
|
-
}, C = function(b, f,
|
|
1287
|
-
if (
|
|
1286
|
+
}, C = function(b, f, d) {
|
|
1287
|
+
if (d || arguments.length === 2)
|
|
1288
1288
|
for (var m, g = 0, w = f.length; g < w; g++)
|
|
1289
1289
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
1290
1290
|
return b.concat(m || Array.prototype.slice.call(f));
|
|
@@ -1293,11 +1293,11 @@ var fs = { exports: {} };
|
|
|
1293
1293
|
return b.call(this, `EventSource not available.
|
|
1294
1294
|
Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
|
|
1295
1295
|
}
|
|
1296
|
-
return
|
|
1297
|
-
}(Error),
|
|
1298
|
-
function b(f,
|
|
1296
|
+
return V(f, b), f;
|
|
1297
|
+
}(Error), q = function() {
|
|
1298
|
+
function b(f, d) {
|
|
1299
1299
|
var m = this;
|
|
1300
|
-
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration =
|
|
1300
|
+
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = d != null ? Object.assign({}, d) : 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")
|
|
1301
1301
|
throw new L();
|
|
1302
1302
|
this._onevent_wrapped = function(g) {
|
|
1303
1303
|
m._onevent(g);
|
|
@@ -1306,7 +1306,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1306
1306
|
return b.prototype.dispatchEvent = function(f) {
|
|
1307
1307
|
throw new Error("Method not implemented.");
|
|
1308
1308
|
}, b.prototype._start = function() {
|
|
1309
|
-
var f,
|
|
1309
|
+
var f, d, m = this, g = this.url;
|
|
1310
1310
|
this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(M) {
|
|
1311
1311
|
m._onopen(M);
|
|
1312
1312
|
}, this._eventSource.onerror = function(M) {
|
|
@@ -1323,7 +1323,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1323
1323
|
f = { error: M };
|
|
1324
1324
|
} finally {
|
|
1325
1325
|
try {
|
|
1326
|
-
x && !x.done && (
|
|
1326
|
+
x && !x.done && (d = w.return) && d.call(w);
|
|
1327
1327
|
} finally {
|
|
1328
1328
|
if (f)
|
|
1329
1329
|
throw f.error;
|
|
@@ -1332,30 +1332,30 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1332
1332
|
}, b.prototype._onopen = function(f) {
|
|
1333
1333
|
this.readyState === 0 && (this.readyState = 1, this.onopen(f));
|
|
1334
1334
|
}, b.prototype._onerror = function(f) {
|
|
1335
|
-
var
|
|
1335
|
+
var d = this;
|
|
1336
1336
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
|
|
1337
1337
|
this._eventSource.close(), this._eventSource = null;
|
|
1338
1338
|
var m = Math.round(this.max_retry_time * Math.random());
|
|
1339
1339
|
this._timer = setTimeout(function() {
|
|
1340
|
-
return
|
|
1340
|
+
return d._start();
|
|
1341
1341
|
}, m);
|
|
1342
1342
|
}
|
|
1343
1343
|
}, b.prototype._onevent = function(f) {
|
|
1344
|
-
var
|
|
1344
|
+
var d, m;
|
|
1345
1345
|
f && f.lastEventId && (this._lastEventId = f.lastEventId);
|
|
1346
1346
|
var g = this._listeners[f.type];
|
|
1347
1347
|
if (g != null)
|
|
1348
1348
|
try {
|
|
1349
|
-
for (var w = j(C([],
|
|
1349
|
+
for (var w = j(C([], $(g), !1)), x = w.next(); !x.done; x = w.next())
|
|
1350
1350
|
x.value.call(this, f);
|
|
1351
1351
|
} catch (R) {
|
|
1352
|
-
|
|
1352
|
+
d = { error: R };
|
|
1353
1353
|
} finally {
|
|
1354
1354
|
try {
|
|
1355
1355
|
x && !x.done && (m = w.return) && m.call(w);
|
|
1356
1356
|
} finally {
|
|
1357
|
-
if (
|
|
1358
|
-
throw
|
|
1357
|
+
if (d)
|
|
1358
|
+
throw d.error;
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
1361
|
f.type === "message" && this.onmessage(f);
|
|
@@ -1364,20 +1364,20 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1364
1364
|
}, b.prototype.onmessage = function(f) {
|
|
1365
1365
|
}, b.prototype.close = function() {
|
|
1366
1366
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
1367
|
-
}, b.prototype.addEventListener = function(f,
|
|
1367
|
+
}, b.prototype.addEventListener = function(f, d, m) {
|
|
1368
1368
|
this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
|
|
1369
1369
|
var g = this._listeners[f];
|
|
1370
|
-
g.includes(
|
|
1371
|
-
}, b.prototype.removeEventListener = function(f,
|
|
1370
|
+
g.includes(d) || (this._listeners[f] = C(C([], $(g), !1), [d], !1));
|
|
1371
|
+
}, b.prototype.removeEventListener = function(f, d, m) {
|
|
1372
1372
|
var g = this._listeners[f];
|
|
1373
1373
|
this._listeners[f] = g.filter(function(w) {
|
|
1374
|
-
return w !==
|
|
1374
|
+
return w !== d;
|
|
1375
1375
|
});
|
|
1376
1376
|
}, b;
|
|
1377
1377
|
}();
|
|
1378
1378
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
1379
|
-
var
|
|
1380
|
-
return f = f || {}, new Promise(function(
|
|
1379
|
+
var G = function(b, f) {
|
|
1380
|
+
return f = f || {}, new Promise(function(d, m) {
|
|
1381
1381
|
var g = new XMLHttpRequest(), w = [], x = [], R = {}, M = function() {
|
|
1382
1382
|
return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
|
|
1383
1383
|
return Promise.resolve(g.responseText);
|
|
@@ -1395,17 +1395,17 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1395
1395
|
return _.toLowerCase() in R;
|
|
1396
1396
|
} } };
|
|
1397
1397
|
};
|
|
1398
|
-
for (var
|
|
1399
|
-
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(_,
|
|
1400
|
-
w.push(
|
|
1401
|
-
}),
|
|
1398
|
+
for (var H in g.open(f.method || "get", b, !0), g.onload = function() {
|
|
1399
|
+
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(_, W, ee) {
|
|
1400
|
+
w.push(W = W.toLowerCase()), x.push([W, ee]), R[W] = R[W] ? R[W] + "," + ee : ee;
|
|
1401
|
+
}), d(M());
|
|
1402
1402
|
}, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
|
|
1403
|
-
g.setRequestHeader(
|
|
1403
|
+
g.setRequestHeader(H, f.headers[H]);
|
|
1404
1404
|
g.send(f.body || null);
|
|
1405
1405
|
});
|
|
1406
|
-
}, U = T({ AsyncStorage: n, fetch:
|
|
1406
|
+
}, U = T({ AsyncStorage: n, fetch: G, eventSource: q });
|
|
1407
1407
|
typeof window < "u" && (window.flagsmith = U), s.createFlagsmithInstance = function() {
|
|
1408
|
-
return T({ AsyncStorage: n, fetch:
|
|
1408
|
+
return T({ AsyncStorage: n, fetch: G, eventSource: q });
|
|
1409
1409
|
}, s.default = U, Object.defineProperty(s, "__esModule", { value: !0 });
|
|
1410
1410
|
});
|
|
1411
1411
|
})(fs, fs.exports);
|
|
@@ -1501,10 +1501,10 @@ var Xs = {}, Li = function(t, e, s, n, i) {
|
|
|
1501
1501
|
return { b: s, r: i };
|
|
1502
1502
|
}, Vn = qn(_t, 2), Mi = Vn.b, bt = Vn.r;
|
|
1503
1503
|
Mi[28] = 258, bt[258] = 28;
|
|
1504
|
-
var Bi = qn(Nt, 0), gs = Bi.r,
|
|
1505
|
-
for (var
|
|
1506
|
-
var Ce = (
|
|
1507
|
-
Ce = (Ce & 52428) >> 2 | (Ce & 13107) << 2, Ce = (Ce & 61680) >> 4 | (Ce & 3855) << 4,
|
|
1504
|
+
var Bi = qn(Nt, 0), gs = Bi.r, yt = new re(32768);
|
|
1505
|
+
for (var J = 0; J < 32768; ++J) {
|
|
1506
|
+
var Ce = (J & 43690) >> 1 | (J & 21845) << 1;
|
|
1507
|
+
Ce = (Ce & 52428) >> 2 | (Ce & 13107) << 2, Ce = (Ce & 61680) >> 4 | (Ce & 3855) << 4, yt[J] = ((Ce & 65280) >> 8 | (Ce & 255) << 8) >> 1;
|
|
1508
1508
|
}
|
|
1509
1509
|
var qe = function(t, e, s) {
|
|
1510
1510
|
for (var n = t.length, i = 0, r = new re(e); i < n; ++i)
|
|
@@ -1518,24 +1518,24 @@ var qe = function(t, e, s) {
|
|
|
1518
1518
|
var a = 15 - e;
|
|
1519
1519
|
for (i = 0; i < n; ++i)
|
|
1520
1520
|
if (t[i])
|
|
1521
|
-
for (var h = i << 4 | t[i], c = e - t[i],
|
|
1522
|
-
l[
|
|
1521
|
+
for (var h = i << 4 | t[i], c = e - t[i], u = o[t[i] - 1]++ << c, p = u | (1 << c) - 1; u <= p; ++u)
|
|
1522
|
+
l[yt[u] >> a] = h;
|
|
1523
1523
|
} else
|
|
1524
1524
|
for (l = new re(n), i = 0; i < n; ++i)
|
|
1525
|
-
t[i] && (l[i] =
|
|
1525
|
+
t[i] && (l[i] = yt[o[t[i] - 1]++] >> 15 - t[i]);
|
|
1526
1526
|
return l;
|
|
1527
1527
|
}, Oe = new fe(288);
|
|
1528
|
-
for (var
|
|
1529
|
-
Oe[
|
|
1530
|
-
for (var
|
|
1531
|
-
Oe[
|
|
1532
|
-
for (var
|
|
1533
|
-
Oe[
|
|
1534
|
-
for (var
|
|
1535
|
-
Oe[
|
|
1528
|
+
for (var J = 0; J < 144; ++J)
|
|
1529
|
+
Oe[J] = 8;
|
|
1530
|
+
for (var J = 144; J < 256; ++J)
|
|
1531
|
+
Oe[J] = 9;
|
|
1532
|
+
for (var J = 256; J < 280; ++J)
|
|
1533
|
+
Oe[J] = 7;
|
|
1534
|
+
for (var J = 280; J < 288; ++J)
|
|
1535
|
+
Oe[J] = 8;
|
|
1536
1536
|
var st = new fe(32);
|
|
1537
|
-
for (var
|
|
1538
|
-
st[
|
|
1537
|
+
for (var J = 0; J < 32; ++J)
|
|
1538
|
+
st[J] = 5;
|
|
1539
1539
|
var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = function(t) {
|
|
1540
1540
|
return (t + 7) / 8 | 0;
|
|
1541
1541
|
}, Jn = function(t, e, s) {
|
|
@@ -1561,7 +1561,7 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1561
1561
|
if (n.code = t, Error.captureStackTrace && Error.captureStackTrace(n, Xn), !s)
|
|
1562
1562
|
throw n;
|
|
1563
1563
|
return n;
|
|
1564
|
-
},
|
|
1564
|
+
}, ve = function(t, e, s) {
|
|
1565
1565
|
s <<= e & 7;
|
|
1566
1566
|
var n = e / 8 | 0;
|
|
1567
1567
|
t[n] |= s, t[n + 1] |= s >> 8;
|
|
@@ -1569,7 +1569,7 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1569
1569
|
s <<= e & 7;
|
|
1570
1570
|
var n = e / 8 | 0;
|
|
1571
1571
|
t[n] |= s, t[n + 1] |= s >> 8, t[n + 2] |= s >> 16;
|
|
1572
|
-
},
|
|
1572
|
+
}, dt = function(t, e) {
|
|
1573
1573
|
for (var s = [], n = 0; n < t.length; ++n)
|
|
1574
1574
|
t[n] && s.push({ s: n, f: t[n] });
|
|
1575
1575
|
var i = s.length, r = s.slice();
|
|
@@ -1582,36 +1582,36 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1582
1582
|
s.sort(function(N, O) {
|
|
1583
1583
|
return N.f - O.f;
|
|
1584
1584
|
}), s.push({ s: -1, f: 25001 });
|
|
1585
|
-
var l = s[0], a = s[1], h = 0, c = 1,
|
|
1585
|
+
var l = s[0], a = s[1], h = 0, c = 1, u = 2;
|
|
1586
1586
|
for (s[0] = { s: -1, f: l.f + a.f, l, r: a }; c != i - 1; )
|
|
1587
|
-
l = s[s[h].f < s[
|
|
1587
|
+
l = s[s[h].f < s[u].f ? h++ : u++], a = s[h != c && s[h].f < s[u].f ? h++ : u++], s[c++] = { s: -1, f: l.f + a.f, l, r: a };
|
|
1588
1588
|
for (var p = r[0].s, n = 1; n < i; ++n)
|
|
1589
1589
|
r[n].s > p && (p = r[n].s);
|
|
1590
|
-
var
|
|
1590
|
+
var y = new re(p + 1), S = vt(s[c - 1], y, 0);
|
|
1591
1591
|
if (S > e) {
|
|
1592
|
-
var n = 0,
|
|
1592
|
+
var n = 0, v = 0, E = S - e, F = 1 << E;
|
|
1593
1593
|
for (r.sort(function(O, D) {
|
|
1594
|
-
return
|
|
1594
|
+
return y[D.s] - y[O.s] || O.f - D.f;
|
|
1595
1595
|
}); n < i; ++n) {
|
|
1596
1596
|
var P = r[n].s;
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1597
|
+
if (y[P] > e)
|
|
1598
|
+
v += F - (1 << S - y[P]), y[P] = e;
|
|
1599
1599
|
else
|
|
1600
1600
|
break;
|
|
1601
1601
|
}
|
|
1602
|
-
for (
|
|
1602
|
+
for (v >>= E; v > 0; ) {
|
|
1603
1603
|
var A = r[n].s;
|
|
1604
|
-
|
|
1604
|
+
y[A] < e ? v -= 1 << e - y[A]++ - 1 : ++n;
|
|
1605
1605
|
}
|
|
1606
|
-
for (; n >= 0 &&
|
|
1606
|
+
for (; n >= 0 && v; --n) {
|
|
1607
1607
|
var k = r[n].s;
|
|
1608
|
-
|
|
1608
|
+
y[k] == e && (--y[k], ++v);
|
|
1609
1609
|
}
|
|
1610
1610
|
S = e;
|
|
1611
1611
|
}
|
|
1612
|
-
return { t: new fe(
|
|
1613
|
-
},
|
|
1614
|
-
return t.s == -1 ? Math.max(
|
|
1612
|
+
return { t: new fe(y), l: S };
|
|
1613
|
+
}, vt = function(t, e, s) {
|
|
1614
|
+
return t.s == -1 ? Math.max(vt(t.l, e, s + 1), vt(t.r, e, s + 1)) : e[t.s] = s;
|
|
1615
1615
|
}, ms = function(t) {
|
|
1616
1616
|
for (var e = t.length; e && !t[--e]; )
|
|
1617
1617
|
;
|
|
@@ -1646,87 +1646,87 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1646
1646
|
t[i + r + 4] = s[r];
|
|
1647
1647
|
return (i + 4 + n) * 8;
|
|
1648
1648
|
}, bs = function(t, e, s, n, i, r, o, l, a, h, c) {
|
|
1649
|
-
|
|
1650
|
-
for (var
|
|
1649
|
+
ve(e, c++, s), ++i[256];
|
|
1650
|
+
for (var u = dt(i, 15), p = u.t, y = u.l, S = dt(r, 15), v = S.t, E = S.l, F = ms(p), P = F.c, A = F.n, k = ms(v), N = k.c, O = k.n, D = new re(19), I = 0; I < P.length; ++I)
|
|
1651
1651
|
++D[P[I] & 31];
|
|
1652
1652
|
for (var I = 0; I < N.length; ++I)
|
|
1653
1653
|
++D[N[I] & 31];
|
|
1654
|
-
for (var T =
|
|
1654
|
+
for (var T = dt(D, 7), B = T.t, V = T.l, j = 19; j > 4 && !B[ps[j - 1]]; --j)
|
|
1655
1655
|
;
|
|
1656
|
-
var
|
|
1657
|
-
if (a >= 0 &&
|
|
1656
|
+
var $ = h + 5 << 3, C = He(i, Oe) + He(r, st) + o, L = He(i, p) + He(r, v) + o + 14 + 3 * j + He(D, B) + 2 * D[16] + 3 * D[17] + 7 * D[18];
|
|
1657
|
+
if (a >= 0 && $ <= C && $ <= L)
|
|
1658
1658
|
return Fs(e, c, t.subarray(a, a + h));
|
|
1659
|
-
var
|
|
1660
|
-
if (
|
|
1661
|
-
|
|
1662
|
-
var f = qe(B,
|
|
1663
|
-
|
|
1659
|
+
var q, G, U, b;
|
|
1660
|
+
if (ve(e, c, 1 + (L < C)), c += 2, L < C) {
|
|
1661
|
+
q = qe(p, y, 0), G = p, U = qe(v, E, 0), b = v;
|
|
1662
|
+
var f = qe(B, V, 0);
|
|
1663
|
+
ve(e, c, A - 257), ve(e, c + 5, O - 1), ve(e, c + 10, j - 4), c += 14;
|
|
1664
1664
|
for (var I = 0; I < j; ++I)
|
|
1665
|
-
|
|
1665
|
+
ve(e, c + 3 * I, B[ps[I]]);
|
|
1666
1666
|
c += 3 * j;
|
|
1667
|
-
for (var
|
|
1668
|
-
for (var g =
|
|
1667
|
+
for (var d = [P, N], m = 0; m < 2; ++m)
|
|
1668
|
+
for (var g = d[m], I = 0; I < g.length; ++I) {
|
|
1669
1669
|
var w = g[I] & 31;
|
|
1670
|
-
|
|
1670
|
+
ve(e, c, f[w]), c += B[w], w > 15 && (ve(e, c, g[I] >> 5 & 127), c += g[I] >> 12);
|
|
1671
1671
|
}
|
|
1672
1672
|
} else
|
|
1673
|
-
|
|
1673
|
+
q = Gn, G = Oe, U = Kn, b = st;
|
|
1674
1674
|
for (var I = 0; I < l; ++I) {
|
|
1675
1675
|
var x = n[I];
|
|
1676
1676
|
if (x > 255) {
|
|
1677
1677
|
var w = x >> 18 & 31;
|
|
1678
|
-
Ue(e, c,
|
|
1678
|
+
Ue(e, c, q[w + 257]), c += G[w + 257], w > 7 && (ve(e, c, x >> 23 & 31), c += _t[w]);
|
|
1679
1679
|
var R = x & 31;
|
|
1680
1680
|
Ue(e, c, U[R]), c += b[R], R > 3 && (Ue(e, c, x >> 5 & 8191), c += Nt[R]);
|
|
1681
1681
|
} else
|
|
1682
|
-
Ue(e, c,
|
|
1682
|
+
Ue(e, c, q[x]), c += G[x];
|
|
1683
1683
|
}
|
|
1684
|
-
return Ue(e, c,
|
|
1684
|
+
return Ue(e, c, q[256]), c + G[256];
|
|
1685
1685
|
}, Yn = /* @__PURE__ */ new Ct([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), As = /* @__PURE__ */ new fe(0), Qn = function(t, e, s, n, i, r) {
|
|
1686
1686
|
var o = r.z || t.length, l = new fe(n + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(n, l.length - i), h = r.l, c = (r.r || 0) & 7;
|
|
1687
1687
|
if (e) {
|
|
1688
1688
|
c && (a[0] = r.r >> 3);
|
|
1689
|
-
for (var
|
|
1689
|
+
for (var u = Yn[e - 1], p = u >> 13, y = u & 8191, S = (1 << s) - 1, v = r.p || new re(32768), E = r.h || new re(S + 1), F = Math.ceil(s / 3), P = 2 * F, A = function(se) {
|
|
1690
1690
|
return (t[se] ^ t[se + 1] << F ^ t[se + 2] << P) & S;
|
|
1691
|
-
}, k = new Ct(25e3), N = new re(288), O = new re(32), D = 0, I = 0, T = r.i || 0, B = 0,
|
|
1692
|
-
var
|
|
1693
|
-
if (
|
|
1694
|
-
var
|
|
1695
|
-
if ((D > 7e3 || B > 24576) && (
|
|
1691
|
+
}, k = new Ct(25e3), N = new re(288), O = new re(32), D = 0, I = 0, T = r.i || 0, B = 0, V = r.w || 0, j = 0; T + 2 < o; ++T) {
|
|
1692
|
+
var $ = A(T), C = T & 32767, L = E[$];
|
|
1693
|
+
if (v[C] = L, E[$] = C, V <= T) {
|
|
1694
|
+
var q = o - T;
|
|
1695
|
+
if ((D > 7e3 || B > 24576) && (q > 423 || !h)) {
|
|
1696
1696
|
c = bs(t, a, 0, k, N, O, I, B, j, T - j, c), B = D = I = 0, j = T;
|
|
1697
|
-
for (var
|
|
1698
|
-
N[
|
|
1699
|
-
for (var
|
|
1700
|
-
O[
|
|
1697
|
+
for (var G = 0; G < 286; ++G)
|
|
1698
|
+
N[G] = 0;
|
|
1699
|
+
for (var G = 0; G < 30; ++G)
|
|
1700
|
+
O[G] = 0;
|
|
1701
1701
|
}
|
|
1702
|
-
var U = 2, b = 0, f =
|
|
1703
|
-
if (
|
|
1704
|
-
for (var m = Math.min(p,
|
|
1705
|
-
if (t[T + U] == t[T + U -
|
|
1706
|
-
for (var x = 0; x < w && t[T + x] == t[T + x -
|
|
1702
|
+
var U = 2, b = 0, f = y, d = C - L & 32767;
|
|
1703
|
+
if (q > 2 && $ == A(T - d))
|
|
1704
|
+
for (var m = Math.min(p, q) - 1, g = Math.min(32767, T), w = Math.min(258, q); d <= g && --f && C != L; ) {
|
|
1705
|
+
if (t[T + U] == t[T + U - d]) {
|
|
1706
|
+
for (var x = 0; x < w && t[T + x] == t[T + x - d]; ++x)
|
|
1707
1707
|
;
|
|
1708
1708
|
if (x > U) {
|
|
1709
|
-
if (U = x, b =
|
|
1709
|
+
if (U = x, b = d, x > m)
|
|
1710
1710
|
break;
|
|
1711
|
-
for (var R = Math.min(
|
|
1712
|
-
var
|
|
1713
|
-
|
|
1711
|
+
for (var R = Math.min(d, x - 2), M = 0, G = 0; G < R; ++G) {
|
|
1712
|
+
var H = T - d + G & 32767, _ = v[H], W = H - _ & 32767;
|
|
1713
|
+
W > M && (M = W, L = H);
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
C = L, L =
|
|
1717
|
+
C = L, L = v[C], d += C - L & 32767;
|
|
1718
1718
|
}
|
|
1719
1719
|
if (b) {
|
|
1720
1720
|
k[B++] = 268435456 | bt[U] << 18 | gs[b];
|
|
1721
1721
|
var ee = bt[U] & 31, ae = gs[b] & 31;
|
|
1722
|
-
I += _t[ee] + Nt[ae], ++N[257 + ee], ++O[ae],
|
|
1722
|
+
I += _t[ee] + Nt[ae], ++N[257 + ee], ++O[ae], V = T + U, ++D;
|
|
1723
1723
|
} else
|
|
1724
1724
|
k[B++] = t[T], ++N[t[T]];
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
1727
|
-
for (T = Math.max(T,
|
|
1727
|
+
for (T = Math.max(T, V); T < o; ++T)
|
|
1728
1728
|
k[B++] = t[T], ++N[t[T]];
|
|
1729
|
-
c = bs(t, a, h, k, N, O, I, B, j, T - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = E, r.p =
|
|
1729
|
+
c = bs(t, a, h, k, N, O, I, B, j, T - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = E, r.p = v, r.i = T, r.w = V);
|
|
1730
1730
|
} else {
|
|
1731
1731
|
for (var T = r.w || 0; T < o + h; T += 65535) {
|
|
1732
1732
|
var te = T + 65535;
|
|
@@ -1779,8 +1779,8 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1779
1779
|
e += h.slice(c, h.indexOf("(", c));
|
|
1780
1780
|
} else {
|
|
1781
1781
|
e += h;
|
|
1782
|
-
for (var
|
|
1783
|
-
e += ";" + a + ".prototype." +
|
|
1782
|
+
for (var u in l.prototype)
|
|
1783
|
+
e += ";" + a + ".prototype." + u + "=" + l.prototype[u].toString();
|
|
1784
1784
|
}
|
|
1785
1785
|
else
|
|
1786
1786
|
e += h;
|
|
@@ -1802,7 +1802,7 @@ var Gn = /* @__PURE__ */ qe(Oe, 9, 0), Kn = /* @__PURE__ */ qe(st, 5, 0), Rs = f
|
|
|
1802
1802
|
var a = ji({}, it[s].e);
|
|
1803
1803
|
return Li(it[s].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", s, a, zi(a), n);
|
|
1804
1804
|
}, Hi = function() {
|
|
1805
|
-
return [fe, re, Ct, _t, Nt, ps, bt, gs, Gn, Oe, Kn, st,
|
|
1805
|
+
return [fe, re, Ct, _t, Nt, ps, bt, gs, Gn, Oe, Kn, st, yt, Yn, As, qe, ve, Ue, dt, vt, ms, He, Fs, bs, Rs, Jn, Qn, Ds, qi, ti];
|
|
1806
1806
|
}, $i = function() {
|
|
1807
1807
|
return [si, ni, wt, ei, Zn];
|
|
1808
1808
|
}, ti = function(t) {
|
|
@@ -1917,8 +1917,8 @@ class Xi {
|
|
|
1917
1917
|
subConditions: [],
|
|
1918
1918
|
name: o.name
|
|
1919
1919
|
}, a.filters.forEach((c) => {
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1920
|
+
const u = this.createConditionFromFilter(c);
|
|
1921
|
+
u && h.subConditions.push(u);
|
|
1922
1922
|
})) : h = this.createConditionFromFilter(a), h && (h.type === "session_duration" && this.processDuration(h.value[0], o.name), r.push({ ...h, name: o.name }));
|
|
1923
1923
|
});
|
|
1924
1924
|
}), this.conditions = r;
|
|
@@ -2164,8 +2164,8 @@ class Qi {
|
|
|
2164
2164
|
async reloadFlags(e) {
|
|
2165
2165
|
const s = this.app.sessionStorage.getItem(this.storageKey), n = {};
|
|
2166
2166
|
s && s.split(";").filter(Boolean).forEach((c) => {
|
|
2167
|
-
const
|
|
2168
|
-
n[
|
|
2167
|
+
const u = JSON.parse(c);
|
|
2168
|
+
n[u.key] = { key: u.key, value: u.value };
|
|
2169
2169
|
});
|
|
2170
2170
|
const i = this.app.session.getInfo(), r = this.app.session.userInfo, o = {
|
|
2171
2171
|
projectID: i.projectID,
|
|
@@ -2375,7 +2375,7 @@ function hr(t, e, s, n, i) {
|
|
|
2375
2375
|
i
|
|
2376
2376
|
];
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function dr(t, e, s) {
|
|
2379
2379
|
return [
|
|
2380
2380
|
9,
|
|
2381
2381
|
t,
|
|
@@ -2383,7 +2383,7 @@ function ur(t, e, s) {
|
|
|
2383
2383
|
s
|
|
2384
2384
|
];
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2386
|
+
function ur(t, e, s) {
|
|
2387
2387
|
return [
|
|
2388
2388
|
10,
|
|
2389
2389
|
t,
|
|
@@ -2434,14 +2434,14 @@ function br(t, e) {
|
|
|
2434
2434
|
e
|
|
2435
2435
|
];
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2437
|
+
function yr(t, e) {
|
|
2438
2438
|
return [
|
|
2439
2439
|
20,
|
|
2440
2440
|
t,
|
|
2441
2441
|
e
|
|
2442
2442
|
];
|
|
2443
2443
|
}
|
|
2444
|
-
function
|
|
2444
|
+
function vr(t, e) {
|
|
2445
2445
|
return [
|
|
2446
2446
|
22,
|
|
2447
2447
|
t,
|
|
@@ -2533,7 +2533,7 @@ function an(t) {
|
|
|
2533
2533
|
t
|
|
2534
2534
|
];
|
|
2535
2535
|
}
|
|
2536
|
-
function
|
|
2536
|
+
function ys(t, e, s, n) {
|
|
2537
2537
|
return [
|
|
2538
2538
|
60,
|
|
2539
2539
|
t,
|
|
@@ -2575,7 +2575,7 @@ function Rr(t, e, s, n, i, r) {
|
|
|
2575
2575
|
r
|
|
2576
2576
|
];
|
|
2577
2577
|
}
|
|
2578
|
-
function
|
|
2578
|
+
function vs(t, e) {
|
|
2579
2579
|
return [
|
|
2580
2580
|
70,
|
|
2581
2581
|
t,
|
|
@@ -2685,7 +2685,7 @@ function Mr(t) {
|
|
|
2685
2685
|
t
|
|
2686
2686
|
];
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2688
|
+
function di(t, e, s, n, i, r, o, l, a, h) {
|
|
2689
2689
|
return [
|
|
2690
2690
|
116,
|
|
2691
2691
|
t,
|
|
@@ -2700,7 +2700,7 @@ function ui(t, e, s, n, i, r, o, l, a, h) {
|
|
|
2700
2700
|
h
|
|
2701
2701
|
];
|
|
2702
2702
|
}
|
|
2703
|
-
function
|
|
2703
|
+
function ut(t) {
|
|
2704
2704
|
return [
|
|
2705
2705
|
117,
|
|
2706
2706
|
t
|
|
@@ -2756,11 +2756,11 @@ function zr(t, e) {
|
|
|
2756
2756
|
i = n = void 0;
|
|
2757
2757
|
}), t.ticker.attach(o, 40, !1), document.hidden !== void 0 && t.attachEventListener(document, "visibilitychange", o, !1, !1);
|
|
2758
2758
|
}
|
|
2759
|
-
const
|
|
2759
|
+
const dn = "__or__watched_tags__";
|
|
2760
2760
|
class Ur {
|
|
2761
2761
|
constructor(e, s, n) {
|
|
2762
2762
|
this.sessionStorage = e, this.errLog = s, this.onTag = n, this.intervals = {}, this.tags = [];
|
|
2763
|
-
const i = JSON.parse(e.getItem(
|
|
2763
|
+
const i = JSON.parse(e.getItem(dn) ?? "[]");
|
|
2764
2764
|
this.setTags(i), this.observer = new IntersectionObserver((r) => {
|
|
2765
2765
|
r.forEach((o) => {
|
|
2766
2766
|
if (o.isIntersecting && o.target) {
|
|
@@ -2780,7 +2780,7 @@ class Ur {
|
|
|
2780
2780
|
if (n && n.length) {
|
|
2781
2781
|
this.setTags(n);
|
|
2782
2782
|
const i = JSON.stringify(n);
|
|
2783
|
-
this.sessionStorage.setItem(
|
|
2783
|
+
this.sessionStorage.setItem(dn, i || "");
|
|
2784
2784
|
}
|
|
2785
2785
|
}).catch((n) => this.errLog(n));
|
|
2786
2786
|
}
|
|
@@ -2873,7 +2873,7 @@ const Hr = {
|
|
|
2873
2873
|
fontWeight: "500",
|
|
2874
2874
|
lineHeight: "1.5rem",
|
|
2875
2875
|
cursor: "pointer"
|
|
2876
|
-
},
|
|
2876
|
+
}, un = {
|
|
2877
2877
|
fontFamily: "Verdana, sans-serif",
|
|
2878
2878
|
fontSize: "13px",
|
|
2879
2879
|
fontWeight: "500",
|
|
@@ -2997,12 +2997,12 @@ const Hr = {
|
|
|
2997
2997
|
padding: "0.625rem 0.9375rem",
|
|
2998
2998
|
gap: "0.5rem",
|
|
2999
2999
|
alignSelf: "stretch"
|
|
3000
|
-
},
|
|
3000
|
+
}, yn = {
|
|
3001
3001
|
fontWeight: "bold"
|
|
3002
3002
|
}, Yr = {
|
|
3003
3003
|
fontSize: "13px",
|
|
3004
3004
|
lineHeight: "auto"
|
|
3005
|
-
},
|
|
3005
|
+
}, ui = {
|
|
3006
3006
|
marginRight: "0.5rem",
|
|
3007
3007
|
cursor: "pointer",
|
|
3008
3008
|
color: "#394EFF",
|
|
@@ -3013,7 +3013,7 @@ const Hr = {
|
|
|
3013
3013
|
fontWeight: "500",
|
|
3014
3014
|
lineHeight: "auto"
|
|
3015
3015
|
}, Qr = {
|
|
3016
|
-
...
|
|
3016
|
+
...ui,
|
|
3017
3017
|
display: "flex",
|
|
3018
3018
|
padding: "0.25rem 0.9375rem",
|
|
3019
3019
|
justifyContent: "center",
|
|
@@ -3034,7 +3034,7 @@ const Hr = {
|
|
|
3034
3034
|
borderRadius: "50%",
|
|
3035
3035
|
borderLeftColor: "#fff",
|
|
3036
3036
|
animation: "spin 0.5s linear infinite"
|
|
3037
|
-
},
|
|
3037
|
+
}, vn = {
|
|
3038
3038
|
Standard: { width: 1280, height: 720 },
|
|
3039
3039
|
High: { width: 1920, height: 1080 }
|
|
3040
3040
|
};
|
|
@@ -3102,8 +3102,8 @@ function so(t, e) {
|
|
|
3102
3102
|
const n = t.getBoundingClientRect(), i = s.clientX - n.left, r = s.clientY - n.top;
|
|
3103
3103
|
t.style.position = "fixed", t.style.zIndex = 99999999999999, o(s.pageX, s.pageY);
|
|
3104
3104
|
function o(h, c) {
|
|
3105
|
-
let
|
|
3106
|
-
|
|
3105
|
+
let u = h - i, p = c - r;
|
|
3106
|
+
u <= 5 && (u = 5), p <= 5 && (p = 5), u >= window.innerWidth - n.width && (u = window.innerWidth - n.width), p >= window.innerHeight - n.height && (p = window.innerHeight - n.height), t.style.left = `${u}px`, t.style.top = `${p}px`;
|
|
3107
3107
|
}
|
|
3108
3108
|
function l(h) {
|
|
3109
3109
|
o(h.pageX, h.pageY);
|
|
@@ -3180,12 +3180,12 @@ class co {
|
|
|
3180
3180
|
this.ingestPoint = e, this.getTimestamp = s, this.token = n, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId = h, this.durations = {
|
|
3181
3181
|
testStart: 0,
|
|
3182
3182
|
tasks: []
|
|
3183
|
-
}, this.getDurations = () => this.durations, this.setDurations = (
|
|
3184
|
-
this.durations.testStart =
|
|
3185
|
-
}, this.signalTask = (
|
|
3186
|
-
if (!
|
|
3183
|
+
}, this.getDurations = () => this.durations, this.setDurations = (u) => {
|
|
3184
|
+
this.durations.testStart = u.testStart, this.durations.tasks = u.tasks;
|
|
3185
|
+
}, this.signalTask = (u, p, y) => {
|
|
3186
|
+
if (!u)
|
|
3187
3187
|
return console.error("User Testing: No Task ID Given");
|
|
3188
|
-
const S = this.durations.tasks.find((F) => F.taskId ===
|
|
3188
|
+
const S = this.durations.tasks.find((F) => F.taskId === u), v = this.getTimestamp(), E = S ? v - S.started : 0;
|
|
3189
3189
|
return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`, {
|
|
3190
3190
|
method: "POST",
|
|
3191
3191
|
headers: {
|
|
@@ -3194,21 +3194,21 @@ class co {
|
|
|
3194
3194
|
},
|
|
3195
3195
|
body: JSON.stringify({
|
|
3196
3196
|
testId: this.testId,
|
|
3197
|
-
taskId:
|
|
3197
|
+
taskId: u,
|
|
3198
3198
|
status: p,
|
|
3199
3199
|
duration: E,
|
|
3200
|
-
timestamp:
|
|
3201
|
-
taskAnswer:
|
|
3200
|
+
timestamp: v,
|
|
3201
|
+
taskAnswer: y
|
|
3202
3202
|
})
|
|
3203
3203
|
});
|
|
3204
|
-
}, this.signalTest = (
|
|
3204
|
+
}, this.signalTest = (u) => {
|
|
3205
3205
|
const p = this.getTimestamp();
|
|
3206
|
-
if (
|
|
3207
|
-
const
|
|
3208
|
-
this.setStorageKey(Es,
|
|
3206
|
+
if (u === "begin" && this.testId) {
|
|
3207
|
+
const v = this.getSessionId();
|
|
3208
|
+
this.setStorageKey(Es, v), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ft, p.toString());
|
|
3209
3209
|
} else
|
|
3210
3210
|
this.removeStorageKey(this.storageKey), this.removeStorageKey(ks), this.removeStorageKey(ft);
|
|
3211
|
-
const
|
|
3211
|
+
const y = this.durations.testStart || p, S = p - y;
|
|
3212
3212
|
return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`, {
|
|
3213
3213
|
method: "POST",
|
|
3214
3214
|
headers: {
|
|
@@ -3217,7 +3217,7 @@ class co {
|
|
|
3217
3217
|
},
|
|
3218
3218
|
body: JSON.stringify({
|
|
3219
3219
|
testId: this.testId,
|
|
3220
|
-
status:
|
|
3220
|
+
status: u,
|
|
3221
3221
|
duration: S,
|
|
3222
3222
|
timestamp: p
|
|
3223
3223
|
})
|
|
@@ -3237,7 +3237,7 @@ class lo {
|
|
|
3237
3237
|
Authorization: `Bearer ${l}`
|
|
3238
3238
|
}
|
|
3239
3239
|
}).then((c) => c.json()).then(({ test: c }) => {
|
|
3240
|
-
this.isActive = !0, this.test = c, this.signalManager = new co(this.app.options.ingestPoint, () => this.app.timestamp(), l, o, this.storageKey, (
|
|
3240
|
+
this.isActive = !0, this.test = c, this.signalManager = new co(this.app.options.ingestPoint, () => this.app.timestamp(), l, o, this.storageKey, (u, p) => this.app.localStorage.setItem(u, p), (u) => this.app.localStorage.removeItem(u), (u) => this.app.localStorage.getItem(u), () => this.app.getSessionID()), this.createGreeting(c.title, c.reqMic, c.reqCamera), a && ((c.reqMic || c.reqCamera) && this.userRecorder.startRecording(30, vn.Standard, c.reqMic, c.reqCamera), this.showWidget(c.description, c.tasks, !0), this.showTaskSection());
|
|
3241
3241
|
}).then(() => o).catch((c) => {
|
|
3242
3242
|
console.log("OR: Error fetching test", c);
|
|
3243
3243
|
});
|
|
@@ -3256,11 +3256,11 @@ class lo {
|
|
|
3256
3256
|
|
|
3257
3257
|
📹 We're recording this browser tab to learn from your experience.
|
|
3258
3258
|
🎤 Please enable mic and camera if asked, to give us a complete picture.`), o = z("div", "button", Vr, "Read guidelines to begin");
|
|
3259
|
-
this.removeGreeting = () => ((s || n) && this.userRecorder.startRecording(30,
|
|
3260
|
-
var a, h, c,
|
|
3259
|
+
this.removeGreeting = () => ((s || n) && this.userRecorder.startRecording(30, vn.Standard, s, n), this.container.removeChild(o), this.container.removeChild(r), this.container.removeChild(i), !1), o.onclick = () => {
|
|
3260
|
+
var a, h, c, u;
|
|
3261
3261
|
this.removeGreeting();
|
|
3262
3262
|
const l = (a = this.signalManager) == null ? void 0 : a.getDurations();
|
|
3263
|
-
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (h = this.signalManager) == null || h.signalTest("begin"), this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt), this.showWidget(((c = this.test) == null ? void 0 : c.guidelines) || "", ((
|
|
3263
|
+
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (h = this.signalManager) == null || h.signalTest("begin"), this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt), this.showWidget(((c = this.test) == null ? void 0 : c.guidelines) || "", ((u = this.test) == null ? void 0 : u.tasks) || []);
|
|
3264
3264
|
}, this.container.append(i, r, o), this.bg.appendChild(this.container), document.body.appendChild(this.bg);
|
|
3265
3265
|
}
|
|
3266
3266
|
showWidget(e, s, n) {
|
|
@@ -3305,7 +3305,7 @@ class lo {
|
|
|
3305
3305
|
return n.onclick = o, i.onclick = o, so(this.bg, s), this.collapseWidget = () => r(!1), e;
|
|
3306
3306
|
}
|
|
3307
3307
|
createDescriptionSection(e) {
|
|
3308
|
-
const s = z("div", "description_section_or", $e), n = z("div", "description_s_title_or",
|
|
3308
|
+
const s = z("div", "description_section_or", $e), n = z("div", "description_s_title_or", un), i = z("div", "title", {
|
|
3309
3309
|
fontSize: 13,
|
|
3310
3310
|
fontWeight: 500,
|
|
3311
3311
|
lineHeight: "auto"
|
|
@@ -3326,31 +3326,31 @@ class lo {
|
|
|
3326
3326
|
return n.onclick = h, this.toggleDescriptionVisibility = () => {
|
|
3327
3327
|
this.widgetGuidelinesVisible = !1, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" }), o.removeChild(a);
|
|
3328
3328
|
}, a.onclick = () => {
|
|
3329
|
-
var c,
|
|
3329
|
+
var c, u, p;
|
|
3330
3330
|
if (h(), this.test) {
|
|
3331
|
-
const
|
|
3332
|
-
|
|
3331
|
+
const y = (c = this.signalManager) == null ? void 0 : c.getDurations(), S = y ? y.tasks.findIndex((v) => this.test && v.taskId === this.test.tasks[0].task_id) : null;
|
|
3332
|
+
y && S === -1 && (y.tasks.push({
|
|
3333
3333
|
taskId: this.test.tasks[0].task_id,
|
|
3334
3334
|
started: this.app.timestamp()
|
|
3335
|
-
}), (
|
|
3335
|
+
}), (u = this.signalManager) == null || u.setDurations(y)), (p = this.signalManager) == null || p.signalTask(this.test.tasks[0].task_id, "begin");
|
|
3336
3336
|
}
|
|
3337
3337
|
this.showTaskSection(), o.removeChild(a);
|
|
3338
3338
|
}, s;
|
|
3339
3339
|
}
|
|
3340
3340
|
createTasksSection(e) {
|
|
3341
3341
|
this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt);
|
|
3342
|
-
const s = z("div", "task_section_or", $e), n = z("div", "description_t_title_or",
|
|
3342
|
+
const s = z("div", "task_section_or", $e), n = z("div", "description_t_title_or", un), i = z("div", "title", {
|
|
3343
3343
|
fontSize: "13px",
|
|
3344
3344
|
fontWeight: "500",
|
|
3345
3345
|
lineHeight: "auto"
|
|
3346
|
-
}, "Tasks"), r = z("div", "icon", fn, "-"), o = z("div", "content", je), l = z("div", "pagination", Jr), a = z("div", "taskCard", bn), h = z("div", "taskText",
|
|
3346
|
+
}, "Tasks"), r = z("div", "icon", fn, "-"), o = z("div", "content", je), l = z("div", "pagination", Jr), a = z("div", "taskCard", bn), h = z("div", "taskText", yn), c = z("div", "taskDescription", Yr), u = z("div", "taskButtons", Zr), p = z("div", "taskText", yn);
|
|
3347
3347
|
p.textContent = "Your answer";
|
|
3348
|
-
const
|
|
3348
|
+
const y = z("textarea", "taskDescription", {
|
|
3349
3349
|
resize: "vertical"
|
|
3350
3350
|
}), S = z("div", "inputArea", bn);
|
|
3351
|
-
S.append(p,
|
|
3352
|
-
const
|
|
3353
|
-
n.append(i, r), a.append(h, c),
|
|
3351
|
+
S.append(p, y);
|
|
3352
|
+
const v = z("div", "closePanelButton", ui, "Collapse Panel"), E = z("div", "nextButton", Qr, "Done, Next");
|
|
3353
|
+
n.append(i, r), a.append(h, c), u.append(v, E), o.append(l, a, S, u), s.append(n, o);
|
|
3354
3354
|
const F = () => {
|
|
3355
3355
|
const k = e[this.currentTaskIndex];
|
|
3356
3356
|
h.textContent = k.title, c.textContent = k.description, k.allow_typing ? S.style.display = "flex" : S.style.display = "none";
|
|
@@ -3383,10 +3383,10 @@ class lo {
|
|
|
3383
3383
|
O && Object.assign(O.style, Xr);
|
|
3384
3384
|
}
|
|
3385
3385
|
};
|
|
3386
|
-
return n.onclick = P,
|
|
3386
|
+
return n.onclick = P, v.onclick = this.collapseWidget, E.onclick = () => {
|
|
3387
3387
|
var N, O, D, I;
|
|
3388
|
-
const k = e[this.currentTaskIndex].allow_typing ?
|
|
3389
|
-
if (
|
|
3388
|
+
const k = e[this.currentTaskIndex].allow_typing ? y.value : void 0;
|
|
3389
|
+
if (y.value = "", (N = this.signalManager) == null || N.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
|
|
3390
3390
|
this.currentTaskIndex++, F();
|
|
3391
3391
|
const T = (O = this.signalManager) == null ? void 0 : O.getDurations();
|
|
3392
3392
|
T && T.tasks.findIndex((B) => B.taskId === e[this.currentTaskIndex].task_id) === -1 && (T.tasks.push({
|
|
@@ -3413,8 +3413,8 @@ class lo {
|
|
|
3413
3413
|
We appreciate your time and valuable input.`), r = z("div", "end_button_or", pn, "Submitting Feedback"), o = oo();
|
|
3414
3414
|
r.appendChild(o), (h = this.test) != null && h.reqMic || (c = this.test) != null && c.reqCamera ? this.userRecorder.sendToAPI().then(() => {
|
|
3415
3415
|
r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
3416
|
-
}).catch((
|
|
3417
|
-
console.error(
|
|
3416
|
+
}).catch((u) => {
|
|
3417
|
+
console.error(u), r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
3418
3418
|
}) : (r.removeChild(o), r.textContent = "End Session", e = !1), this.taskSection && this.container.removeChild(this.taskSection), this.descriptionSection && this.container.removeChild(this.descriptionSection), this.stopButton && this.stopButtonContainer && this.container.removeChild(this.stopButtonContainer), r.onclick = () => {
|
|
3419
3419
|
e || (window.close(), document.body.removeChild(this.bg));
|
|
3420
3420
|
}, s.append(n, i, r), this.endSection = s, this.container.append(s);
|
|
@@ -3671,7 +3671,7 @@ class Ps {
|
|
|
3671
3671
|
}
|
|
3672
3672
|
sendNodeAttribute(e, s, n, i) {
|
|
3673
3673
|
if (Ts(s)) {
|
|
3674
|
-
n.substr(0, 6) === "xlink:" && (n = n.substr(6)), i === null ? this.app.send(nn(e, n)) : n === "href" ? (i.length > 1e5 && (i = ""), this.app.send(
|
|
3674
|
+
n.substr(0, 6) === "xlink:" && (n = n.substr(6)), i === null ? this.app.send(nn(e, n)) : n === "href" ? (i.length > 1e5 && (i = ""), this.app.send(ys(e, n, i, this.app.getBaseHref()))) : this.app.attributeSender.sendSetAttribute(e, n, i);
|
|
3675
3675
|
return;
|
|
3676
3676
|
}
|
|
3677
3677
|
if (!(n === "src" || n === "srcset" || n === "integrity" || n === "crossorigin" || n === "autocomplete" || n.substr(0, 2) === "on") && !(n === "value" && Z(s, "input") && s.type !== "button" && s.type !== "reset" && s.type !== "submit")) {
|
|
@@ -3680,7 +3680,7 @@ class Ps {
|
|
|
3680
3680
|
return;
|
|
3681
3681
|
}
|
|
3682
3682
|
if (n === "style" || n === "href" && Z(s, "link")) {
|
|
3683
|
-
this.app.send(
|
|
3683
|
+
this.app.send(ys(e, n, i, this.app.getBaseHref()));
|
|
3684
3684
|
return;
|
|
3685
3685
|
}
|
|
3686
3686
|
(n === "href" || i.length > 1e5) && (i = ""), this.app.attributeSender.sendSetAttribute(e, n, i);
|
|
@@ -3768,20 +3768,20 @@ class Ps {
|
|
|
3768
3768
|
let c = s;
|
|
3769
3769
|
if (i !== void 0) {
|
|
3770
3770
|
if (this.app.sanitizer.isHidden(e)) {
|
|
3771
|
-
const
|
|
3772
|
-
c = s.cloneNode(), c.style.width = `${
|
|
3771
|
+
const u = c.clientWidth, p = c.clientHeight;
|
|
3772
|
+
c = s.cloneNode(), c.style.width = `${u}px`, c.style.height = `${p}px`;
|
|
3773
3773
|
}
|
|
3774
3774
|
this.app.send(hr(e, i, a, c.tagName, Ts(s)));
|
|
3775
3775
|
}
|
|
3776
|
-
for (let
|
|
3777
|
-
const p = c.attributes[
|
|
3776
|
+
for (let u = 0; u < c.attributes.length; u++) {
|
|
3777
|
+
const p = c.attributes[u];
|
|
3778
3778
|
this.sendNodeAttribute(e, c, p.nodeName, p.value);
|
|
3779
3779
|
}
|
|
3780
3780
|
} else
|
|
3781
|
-
Is(s) && (this.app.send(
|
|
3781
|
+
Is(s) && (this.app.send(dr(e, i, a)), this.sendNodeData(e, n, s.data));
|
|
3782
3782
|
return !0;
|
|
3783
3783
|
}
|
|
3784
|
-
o === we.Removed && i !== void 0 && this.app.send(
|
|
3784
|
+
o === we.Removed && i !== void 0 && this.app.send(ur(e, i, a));
|
|
3785
3785
|
const h = this.attributesMap.get(e);
|
|
3786
3786
|
if (h !== void 0) {
|
|
3787
3787
|
if (!Ee(s))
|
|
@@ -3833,7 +3833,7 @@ class Sn extends Ps {
|
|
|
3833
3833
|
this.app.debug.log("OpenReplay: Iframe document not bound");
|
|
3834
3834
|
return;
|
|
3835
3835
|
}
|
|
3836
|
-
this.app.send(
|
|
3836
|
+
this.app.send(vs(n, i));
|
|
3837
3837
|
});
|
|
3838
3838
|
}
|
|
3839
3839
|
syntheticObserve(e, s) {
|
|
@@ -3842,7 +3842,7 @@ class Sn extends Ps {
|
|
|
3842
3842
|
this.app.debug.log("OpenReplay: Iframe document not bound");
|
|
3843
3843
|
return;
|
|
3844
3844
|
}
|
|
3845
|
-
this.app.send(
|
|
3845
|
+
this.app.send(vs(e, n));
|
|
3846
3846
|
});
|
|
3847
3847
|
}
|
|
3848
3848
|
}
|
|
@@ -3854,11 +3854,11 @@ class bo extends Ps {
|
|
|
3854
3854
|
this.app.debug.error("OpenReplay: Shadow Root was not bound");
|
|
3855
3855
|
return;
|
|
3856
3856
|
}
|
|
3857
|
-
this.app.send(
|
|
3857
|
+
this.app.send(vs(n, i));
|
|
3858
3858
|
});
|
|
3859
3859
|
}
|
|
3860
3860
|
}
|
|
3861
|
-
class
|
|
3861
|
+
class yo {
|
|
3862
3862
|
constructor() {
|
|
3863
3863
|
this.states = /* @__PURE__ */ new Map();
|
|
3864
3864
|
}
|
|
@@ -3898,9 +3898,9 @@ class vo {
|
|
|
3898
3898
|
}
|
|
3899
3899
|
}
|
|
3900
3900
|
const rs = xe ? Element.prototype.attachShadow : () => new ShadowRoot();
|
|
3901
|
-
class
|
|
3901
|
+
class vo extends Ps {
|
|
3902
3902
|
constructor(e, s) {
|
|
3903
|
-
super(e, !0), this.iframeOffsets = new
|
|
3903
|
+
super(e, !0), this.iframeOffsets = new yo(), this.contextCallbacks = [], this.contextsSet = /* @__PURE__ */ new Set(), this.iframeObservers = [], this.shadowRootObservers = [], this.options = Object.assign({
|
|
3904
3904
|
captureIFrames: !0
|
|
3905
3905
|
}, s), this.app.nodes.attachNodeCallback((n) => {
|
|
3906
3906
|
Z(n, "iframe") && (this.options.captureIFrames && !De(n, "obscured") || De(n, "capture")) && this.handleIframe(n);
|
|
@@ -4102,7 +4102,7 @@ function as() {
|
|
|
4102
4102
|
const t = (/* @__PURE__ */ new Date()).getTimezoneOffset() * -1, e = t >= 0 ? "+" : "-", s = Math.floor(Math.abs(t) / 60), n = Math.abs(t) % 60;
|
|
4103
4103
|
return `UTC${e}${String(s).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
4104
4104
|
}
|
|
4105
|
-
const Io = (t) => new Promise((e) => setTimeout(e, t)),
|
|
4105
|
+
const Io = (t) => new Promise((e) => setTimeout(e, t)), de = {
|
|
4106
4106
|
// ask if there are any tabs alive
|
|
4107
4107
|
ask: "never-gonna-give-you-up",
|
|
4108
4108
|
// response from another tab
|
|
@@ -4124,12 +4124,12 @@ let Co = class {
|
|
|
4124
4124
|
(a = this.canvasRecorder) == null || a.restartTracking();
|
|
4125
4125
|
}, this.flushBuffer = async (a) => new Promise((h) => {
|
|
4126
4126
|
let c = !1;
|
|
4127
|
-
const
|
|
4127
|
+
const u = [a.shift()];
|
|
4128
4128
|
for (; !c; ) {
|
|
4129
4129
|
const p = a[0];
|
|
4130
|
-
!p || p[0] === 0 ? c = !0 :
|
|
4130
|
+
!p || p[0] === 0 ? c = !0 : u.push(a.shift());
|
|
4131
4131
|
}
|
|
4132
|
-
this.postToWorker(
|
|
4132
|
+
this.postToWorker(u), h(null);
|
|
4133
4133
|
}), this.onUxtCb = [], this.contextId = Math.random().toString(36).slice(2), this.projectKey = e, Object.keys(n).findIndex((a) => ["fixedCanvasScaling", "disableCanvas"].includes(a)) !== -1 && (console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'), n = {
|
|
4134
4134
|
...n,
|
|
4135
4135
|
canvas: {
|
|
@@ -4176,23 +4176,23 @@ let Co = class {
|
|
|
4176
4176
|
const a = location.hostname.split(".").slice(-2).join("_");
|
|
4177
4177
|
this.bc = new BroadcastChannel(`rick_${a}`);
|
|
4178
4178
|
}
|
|
4179
|
-
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new So(this, n), this.nodes = new mo(this.options.node_id), this.observer = new
|
|
4179
|
+
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new So(this, n), this.nodes = new mo(this.options.node_id), this.observer = new vo(this, n), this.ticker = new Eo(this), this.ticker.attach(() => this.commit()), this.debug = new go(this.options.__debug__), this.session = new xo(this, this.options), this.attributeSender = new Ji(this, !!this.options.disableStringDict), this.featureFlags = new Qi(this), this.tagWatcher = new Ur(this.sessionStorage, this.debug.error, (a) => {
|
|
4180
4180
|
this.send(Pr(a));
|
|
4181
4181
|
}), this.session.attachUpdateCallback(({ userID: a, metadata: h }) => {
|
|
4182
|
-
a != null && this.send(kr(a)), h != null && Object.entries(h).forEach(([c,
|
|
4182
|
+
a != null && this.send(kr(a)), h != null && Object.entries(h).forEach(([c, u]) => this.send(rn(c, u)));
|
|
4183
4183
|
}), s != null && this.session.applySessionHash(s), this.initWorker();
|
|
4184
4184
|
const l = this.session.getTabId();
|
|
4185
4185
|
if (this.insideIframe) {
|
|
4186
4186
|
const a = (c) => {
|
|
4187
|
-
const { data:
|
|
4188
|
-
|
|
4187
|
+
const { data: u } = c;
|
|
4188
|
+
u.line === de.iframeId && (this.rootId = u.id, this.session.setSessionToken(u.token), this.frameOderNumber = u.frameOrderNumber, this.debug.log("starting iframe tracking", u), this.allowAppStart());
|
|
4189
4189
|
};
|
|
4190
4190
|
window.addEventListener("message", a), this.attachStopCallback(() => {
|
|
4191
4191
|
window.removeEventListener("message", a);
|
|
4192
4192
|
});
|
|
4193
4193
|
const h = this.initialHostName;
|
|
4194
4194
|
window.parent.postMessage({
|
|
4195
|
-
line:
|
|
4195
|
+
line: de.iframeSignal,
|
|
4196
4196
|
source: l,
|
|
4197
4197
|
context: this.contextId,
|
|
4198
4198
|
domain: h
|
|
@@ -4200,19 +4200,19 @@ let Co = class {
|
|
|
4200
4200
|
} else {
|
|
4201
4201
|
let a = 0;
|
|
4202
4202
|
const h = (c) => {
|
|
4203
|
-
const { data:
|
|
4204
|
-
if (
|
|
4205
|
-
const p =
|
|
4206
|
-
this.pageFrames =
|
|
4207
|
-
let
|
|
4208
|
-
for (;
|
|
4209
|
-
const E = this.checkNodeId(
|
|
4203
|
+
const { data: u } = c;
|
|
4204
|
+
if (u.line === de.iframeSignal) {
|
|
4205
|
+
const p = u.domain, y = Array.from(document.querySelectorAll("iframe"));
|
|
4206
|
+
this.pageFrames = y, (async () => {
|
|
4207
|
+
let v = 0;
|
|
4208
|
+
for (; v < 10; ) {
|
|
4209
|
+
const E = this.checkNodeId(y, p);
|
|
4210
4210
|
if (E) {
|
|
4211
4211
|
this.waitStarted().then(() => {
|
|
4212
4212
|
var A;
|
|
4213
4213
|
a++;
|
|
4214
4214
|
const F = this.session.getSessionToken(), P = {
|
|
4215
|
-
line:
|
|
4215
|
+
line: de.iframeId,
|
|
4216
4216
|
context: this.contextId,
|
|
4217
4217
|
domain: p,
|
|
4218
4218
|
id: E,
|
|
@@ -4220,44 +4220,44 @@ let Co = class {
|
|
|
4220
4220
|
frameOrderNumber: a
|
|
4221
4221
|
};
|
|
4222
4222
|
this.debug.log("iframe_data", P), (A = c.source) == null || A.postMessage(P, "*");
|
|
4223
|
-
}).catch(console.error),
|
|
4223
|
+
}).catch(console.error), v = 10;
|
|
4224
4224
|
break;
|
|
4225
4225
|
}
|
|
4226
|
-
|
|
4226
|
+
v++, await Io(100);
|
|
4227
4227
|
}
|
|
4228
4228
|
})();
|
|
4229
4229
|
}
|
|
4230
|
-
if (
|
|
4231
|
-
const
|
|
4230
|
+
if (u.line === de.iframeBatch) {
|
|
4231
|
+
const y = u.messages.map((S) => {
|
|
4232
4232
|
if (S[0] === 20) {
|
|
4233
|
-
let
|
|
4233
|
+
let v = S;
|
|
4234
4234
|
return this.pageFrames.forEach((E) => {
|
|
4235
4235
|
if (E.dataset.domain === c.data.domain) {
|
|
4236
4236
|
const [F, P, A] = S, { left: k, top: N } = E.getBoundingClientRect();
|
|
4237
|
-
|
|
4237
|
+
v = [F, P + k, A + N];
|
|
4238
4238
|
}
|
|
4239
|
-
}),
|
|
4239
|
+
}), v;
|
|
4240
4240
|
}
|
|
4241
4241
|
if (S[0] === 68) {
|
|
4242
|
-
let
|
|
4242
|
+
let v = S;
|
|
4243
4243
|
return this.pageFrames.forEach((E) => {
|
|
4244
4244
|
if (E.dataset.domain === c.data.domain) {
|
|
4245
|
-
const [F, P, A, k, N, O, D] = S, { left: I, top: T, width: B, height:
|
|
4246
|
-
|
|
4245
|
+
const [F, P, A, k, N, O, D] = S, { left: I, top: T, width: B, height: V } = E.getBoundingClientRect(), j = document.documentElement.scrollWidth, $ = document.documentElement.scrollHeight, C = O / 100 * B + I, L = D / 100 * V + T, q = C / j, G = L / $;
|
|
4246
|
+
v = [
|
|
4247
4247
|
F,
|
|
4248
4248
|
P,
|
|
4249
4249
|
A,
|
|
4250
4250
|
k,
|
|
4251
4251
|
N,
|
|
4252
|
-
Math.round(
|
|
4253
|
-
Math.round(
|
|
4252
|
+
Math.round(q * 1e3) / 10,
|
|
4253
|
+
Math.round(G * 1e3) / 10
|
|
4254
4254
|
];
|
|
4255
4255
|
}
|
|
4256
|
-
}),
|
|
4256
|
+
}), v;
|
|
4257
4257
|
}
|
|
4258
4258
|
return S;
|
|
4259
4259
|
});
|
|
4260
|
-
this.messages.push(...
|
|
4260
|
+
this.messages.push(...y);
|
|
4261
4261
|
}
|
|
4262
4262
|
};
|
|
4263
4263
|
window.addEventListener("message", h), this.attachStopCallback(() => {
|
|
@@ -4265,25 +4265,25 @@ let Co = class {
|
|
|
4265
4265
|
});
|
|
4266
4266
|
}
|
|
4267
4267
|
this.bc !== null && (this.bc.postMessage({
|
|
4268
|
-
line:
|
|
4268
|
+
line: de.ask,
|
|
4269
4269
|
source: l,
|
|
4270
4270
|
context: this.contextId
|
|
4271
4271
|
}), this.startTimeout = setTimeout(() => {
|
|
4272
4272
|
this.allowAppStart();
|
|
4273
4273
|
}, 500), this.bc.onmessage = (a) => {
|
|
4274
4274
|
if (a.data.context !== this.contextId) {
|
|
4275
|
-
if (a.data.line ===
|
|
4275
|
+
if (a.data.line === de.resp) {
|
|
4276
4276
|
const h = a.data.token;
|
|
4277
4277
|
this.session.setSessionToken(h), this.allowAppStart();
|
|
4278
4278
|
}
|
|
4279
|
-
if (a.data.line ===
|
|
4279
|
+
if (a.data.line === de.reg) {
|
|
4280
4280
|
const h = a.data.token;
|
|
4281
4281
|
this.session.regenerateTabId(), this.session.setSessionToken(h), this.allowAppStart();
|
|
4282
4282
|
}
|
|
4283
|
-
if (a.data.line ===
|
|
4283
|
+
if (a.data.line === de.ask) {
|
|
4284
4284
|
const h = this.session.getSessionToken();
|
|
4285
4285
|
h && this.bc && this.bc.postMessage({
|
|
4286
|
-
line: a.data.source === l ?
|
|
4286
|
+
line: a.data.source === l ? de.reg : de.resp,
|
|
4287
4287
|
token: h,
|
|
4288
4288
|
source: l,
|
|
4289
4289
|
context: this.contextId
|
|
@@ -4362,7 +4362,7 @@ let Co = class {
|
|
|
4362
4362
|
if (!(this.worker === void 0 || !this.messages.length)) {
|
|
4363
4363
|
if (this.insideIframe) {
|
|
4364
4364
|
window.parent.postMessage({
|
|
4365
|
-
line:
|
|
4365
|
+
line: de.iframeBatch,
|
|
4366
4366
|
messages: this.messages,
|
|
4367
4367
|
domain: this.initialHostName
|
|
4368
4368
|
}, "*"), this.commitCallbacks.forEach((e) => e(this.messages)), this.messages.length = 0;
|
|
@@ -4511,14 +4511,14 @@ let Co = class {
|
|
|
4511
4511
|
this.orderNumber += 1, es(), this.coldStartTs = ge(), this.orderNumber % 2 === 0 ? (this.bufferedMessages1.length = 0, this.bufferedMessages1.push(Fe(this.timestamp())), this.bufferedMessages1.push(Ae(this.session.getTabId()))) : (this.bufferedMessages2.length = 0, this.bufferedMessages2.push(Fe(this.timestamp())), this.bufferedMessages2.push(Ae(this.session.getTabId()))), this.stop(!1), this.activityState = Q.ColdStart, e.sessionHash && this.session.applySessionHash(e.sessionHash), e.forceNew && this.session.reset(), this.session.assign({
|
|
4512
4512
|
userID: e.userID,
|
|
4513
4513
|
metadata: e.metadata
|
|
4514
|
-
}), i || (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(
|
|
4514
|
+
}), i || (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(ut(this.session.getTabId()))), this.observer.observe(), this.ticker.start();
|
|
4515
4515
|
};
|
|
4516
4516
|
this.coldInterval = setInterval(() => {
|
|
4517
4517
|
r();
|
|
4518
4518
|
}, 30 * n), r();
|
|
4519
4519
|
}
|
|
4520
4520
|
async setupConditionalStart(e) {
|
|
4521
|
-
var p,
|
|
4521
|
+
var p, y;
|
|
4522
4522
|
this.conditionsManager = new Xi(this, e);
|
|
4523
4523
|
const s = await fetch(this.options.ingestPoint + "/v1/web/start", {
|
|
4524
4524
|
method: "POST",
|
|
@@ -4558,8 +4558,8 @@ let Co = class {
|
|
|
4558
4558
|
userOS: a,
|
|
4559
4559
|
userState: h
|
|
4560
4560
|
});
|
|
4561
|
-
const
|
|
4562
|
-
this.startCallbacks.forEach((S) => S(
|
|
4561
|
+
const u = { sessionToken: n, userUUID: "", sessionID: "" };
|
|
4562
|
+
this.startCallbacks.forEach((S) => S(u)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(c, n)), await this.featureFlags.reloadFlags(n), await this.tagWatcher.fetchTags(this.options.ingestPoint, n), (y = this.conditionsManager) == null || y.processFlags(this.featureFlags.flags);
|
|
4563
4563
|
}
|
|
4564
4564
|
/**
|
|
4565
4565
|
* Starts offline session recording
|
|
@@ -4580,7 +4580,7 @@ let Co = class {
|
|
|
4580
4580
|
metadata: e.metadata
|
|
4581
4581
|
});
|
|
4582
4582
|
const r = { sessionToken: "", userUUID: "", sessionID: "" };
|
|
4583
|
-
return this.startCallbacks.forEach((o) => o(r)), n || this.send(
|
|
4583
|
+
return this.startCallbacks.forEach((o) => o(r)), n || this.send(ut(this.session.getTabId())), this.observer.observe(), this.ticker.start(), {
|
|
4584
4584
|
saveBuffer: this.saveBuffer,
|
|
4585
4585
|
getBuffer: this.getBuffer,
|
|
4586
4586
|
setBuffer: this.setBuffer
|
|
@@ -4616,7 +4616,7 @@ let Co = class {
|
|
|
4616
4616
|
* @reject {string} - error message
|
|
4617
4617
|
* */
|
|
4618
4618
|
async uploadOfflineRecording() {
|
|
4619
|
-
var p,
|
|
4619
|
+
var p, y;
|
|
4620
4620
|
this.stop(!1);
|
|
4621
4621
|
const e = ge();
|
|
4622
4622
|
(p = this.worker) == null || p.postMessage({
|
|
@@ -4645,12 +4645,12 @@ let Co = class {
|
|
|
4645
4645
|
jsHeapSizeLimit: ns,
|
|
4646
4646
|
timezone: as()
|
|
4647
4647
|
})
|
|
4648
|
-
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState: h, beaconSizeLimit: c, projectID:
|
|
4649
|
-
for ((
|
|
4648
|
+
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState: h, beaconSizeLimit: c, projectID: u } = await s.json();
|
|
4649
|
+
for ((y = this.worker) == null || y.postMessage({
|
|
4650
4650
|
type: "auth",
|
|
4651
4651
|
token: n,
|
|
4652
4652
|
beaconSizeLimit: c
|
|
4653
|
-
}), this.session.assign({ projectID:
|
|
4653
|
+
}), this.session.assign({ projectID: u }), this.session.setUserInfo({
|
|
4654
4654
|
userBrowser: i,
|
|
4655
4655
|
userCity: r,
|
|
4656
4656
|
userCountry: o,
|
|
@@ -4720,13 +4720,13 @@ let Co = class {
|
|
|
4720
4720
|
const {
|
|
4721
4721
|
token: h,
|
|
4722
4722
|
userUUID: c,
|
|
4723
|
-
projectID:
|
|
4723
|
+
projectID: u,
|
|
4724
4724
|
beaconSizeLimit: p,
|
|
4725
|
-
compressionThreshold:
|
|
4725
|
+
compressionThreshold: y,
|
|
4726
4726
|
// how big the batch should be before we decide to compress it
|
|
4727
4727
|
delay: S,
|
|
4728
4728
|
// derived from token
|
|
4729
|
-
sessionID:
|
|
4729
|
+
sessionID: v,
|
|
4730
4730
|
// derived from token
|
|
4731
4731
|
startTimestamp: E,
|
|
4732
4732
|
// real startTS (server time), derived from sessionID
|
|
@@ -4741,7 +4741,7 @@ let Co = class {
|
|
|
4741
4741
|
canvasFPS: T,
|
|
4742
4742
|
assistOnly: B
|
|
4743
4743
|
} = await a.json();
|
|
4744
|
-
if (typeof h != "string" || typeof c != "string" || typeof E != "number" && typeof E < "u" || typeof
|
|
4744
|
+
if (typeof h != "string" || typeof c != "string" || typeof E != "number" && typeof E < "u" || typeof v != "string" || typeof S != "number" || typeof p != "number" && typeof p < "u") {
|
|
4745
4745
|
const C = `Incorrect server response: ${JSON.stringify(a)}`;
|
|
4746
4746
|
return this.signalError(C, []), _e(C);
|
|
4747
4747
|
}
|
|
@@ -4753,16 +4753,16 @@ let Co = class {
|
|
|
4753
4753
|
userOS: N,
|
|
4754
4754
|
userState: O
|
|
4755
4755
|
}), this.session.assign({
|
|
4756
|
-
sessionID:
|
|
4756
|
+
sessionID: v,
|
|
4757
4757
|
timestamp: E || r,
|
|
4758
|
-
projectID:
|
|
4758
|
+
projectID: u
|
|
4759
4759
|
}), B ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
|
|
4760
4760
|
type: "auth",
|
|
4761
4761
|
token: h,
|
|
4762
4762
|
beaconSizeLimit: p
|
|
4763
|
-
}), !l && h === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(
|
|
4764
|
-
const
|
|
4765
|
-
if (this.startCallbacks.forEach((C) => C(
|
|
4763
|
+
}), !l && h === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(ut(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, L]) => this.send(rn(C, L))), this.localStorage.setItem(this.options.local_uuid_key, c), this.compressionThreshold = y;
|
|
4764
|
+
const V = { sessionToken: h, userUUID: c, sessionID: v };
|
|
4765
|
+
if (this.startCallbacks.forEach((C) => C(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, h), this.activityState = Q.Active, D && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new uo(this, {
|
|
4766
4766
|
fps: T,
|
|
4767
4767
|
quality: I,
|
|
4768
4768
|
isDebug: this.options.canvas.__save_canvas_locally,
|
|
@@ -4777,17 +4777,17 @@ let Co = class {
|
|
|
4777
4777
|
this.insideIframe && this.rootId ? this.observer.crossdomainObserve(this.rootId, this.frameOderNumber) : this.observer.observe(), this.ticker.start();
|
|
4778
4778
|
this.uxtManager = this.uxtManager ? this.uxtManager : new lo(this, xn);
|
|
4779
4779
|
let j;
|
|
4780
|
-
const
|
|
4781
|
-
if (
|
|
4780
|
+
const $ = this.localStorage.getItem(xn);
|
|
4781
|
+
if ($ && (j = parseInt($, 10)), location != null && location.search) {
|
|
4782
4782
|
const C = new URLSearchParams(location.search);
|
|
4783
4783
|
if (C.has("oruxt")) {
|
|
4784
4784
|
const L = C.get("oruxt");
|
|
4785
4785
|
j = L ? parseInt(L, 10) : void 0;
|
|
4786
4786
|
}
|
|
4787
4787
|
}
|
|
4788
|
-
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, h,
|
|
4788
|
+
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, h, !!$).then((C) => {
|
|
4789
4789
|
C && this.onUxtCb.forEach((L) => L(C));
|
|
4790
|
-
})), To(
|
|
4790
|
+
})), To(V);
|
|
4791
4791
|
} catch (a) {
|
|
4792
4792
|
if (this.stop(), this.session.reset(), a === Ze)
|
|
4793
4793
|
return this.signalError(Ze, []), _e(Ze);
|
|
@@ -4932,7 +4932,7 @@ function Fo(t, e) {
|
|
|
4932
4932
|
}, e);
|
|
4933
4933
|
if (!Array.isArray(s.consoleMethods) || s.consoleMethods.length === 0)
|
|
4934
4934
|
return;
|
|
4935
|
-
const n = t.safe((a, h) => t.send(
|
|
4935
|
+
const n = t.safe((a, h) => t.send(vr(a, Ro(h))));
|
|
4936
4936
|
let i = 0;
|
|
4937
4937
|
const r = () => {
|
|
4938
4938
|
i = 0;
|
|
@@ -4940,17 +4940,17 @@ function Fo(t, e) {
|
|
|
4940
4940
|
t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
|
|
4941
4941
|
const o = (a, h) => {
|
|
4942
4942
|
const c = {
|
|
4943
|
-
apply: function(
|
|
4944
|
-
Reflect.apply(
|
|
4943
|
+
apply: function(u, p, y) {
|
|
4944
|
+
Reflect.apply(u, h, y), i = i + 1, !(i > s.consoleThrottling) && n(u.name, y);
|
|
4945
4945
|
}
|
|
4946
4946
|
};
|
|
4947
|
-
s.consoleMethods.forEach((
|
|
4948
|
-
if (En.indexOf(
|
|
4949
|
-
t.debug.error(`OpenReplay: unsupported console method "${
|
|
4947
|
+
s.consoleMethods.forEach((u) => {
|
|
4948
|
+
if (En.indexOf(u) === -1) {
|
|
4949
|
+
t.debug.error(`OpenReplay: unsupported console method "${u}"`);
|
|
4950
4950
|
return;
|
|
4951
4951
|
}
|
|
4952
|
-
const p = h.console[
|
|
4953
|
-
a[
|
|
4952
|
+
const p = h.console[u];
|
|
4953
|
+
a[u] = new Proxy(p, c);
|
|
4954
4954
|
});
|
|
4955
4955
|
}, l = t.safe((a) => o(a.console, a));
|
|
4956
4956
|
l(window), t.observer.attachContextCallback(l);
|
|
@@ -4961,52 +4961,52 @@ function Ao() {
|
|
|
4961
4961
|
(function(s, n) {
|
|
4962
4962
|
t.exports = n();
|
|
4963
4963
|
})(We, function() {
|
|
4964
|
-
function s(
|
|
4965
|
-
return !isNaN(parseFloat(
|
|
4964
|
+
function s(v) {
|
|
4965
|
+
return !isNaN(parseFloat(v)) && isFinite(v);
|
|
4966
4966
|
}
|
|
4967
|
-
function n(
|
|
4968
|
-
return
|
|
4967
|
+
function n(v) {
|
|
4968
|
+
return v.charAt(0).toUpperCase() + v.substring(1);
|
|
4969
4969
|
}
|
|
4970
|
-
function i(
|
|
4970
|
+
function i(v) {
|
|
4971
4971
|
return function() {
|
|
4972
|
-
return this[
|
|
4972
|
+
return this[v];
|
|
4973
4973
|
};
|
|
4974
4974
|
}
|
|
4975
4975
|
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"], h = ["evalOrigin"], c = r.concat(o, l, a, h);
|
|
4976
|
-
function
|
|
4977
|
-
if (
|
|
4976
|
+
function u(v) {
|
|
4977
|
+
if (v)
|
|
4978
4978
|
for (var E = 0; E < c.length; E++)
|
|
4979
|
-
|
|
4979
|
+
v[c[E]] !== void 0 && this["set" + n(c[E])](v[c[E]]);
|
|
4980
4980
|
}
|
|
4981
|
-
|
|
4981
|
+
u.prototype = {
|
|
4982
4982
|
getArgs: function() {
|
|
4983
4983
|
return this.args;
|
|
4984
4984
|
},
|
|
4985
|
-
setArgs: function(
|
|
4986
|
-
if (Object.prototype.toString.call(
|
|
4985
|
+
setArgs: function(v) {
|
|
4986
|
+
if (Object.prototype.toString.call(v) !== "[object Array]")
|
|
4987
4987
|
throw new TypeError("Args must be an Array");
|
|
4988
|
-
this.args =
|
|
4988
|
+
this.args = v;
|
|
4989
4989
|
},
|
|
4990
4990
|
getEvalOrigin: function() {
|
|
4991
4991
|
return this.evalOrigin;
|
|
4992
4992
|
},
|
|
4993
|
-
setEvalOrigin: function(
|
|
4994
|
-
if (
|
|
4995
|
-
this.evalOrigin =
|
|
4996
|
-
else if (
|
|
4997
|
-
this.evalOrigin = new
|
|
4993
|
+
setEvalOrigin: function(v) {
|
|
4994
|
+
if (v instanceof u)
|
|
4995
|
+
this.evalOrigin = v;
|
|
4996
|
+
else if (v instanceof Object)
|
|
4997
|
+
this.evalOrigin = new u(v);
|
|
4998
4998
|
else
|
|
4999
4999
|
throw new TypeError("Eval Origin must be an Object or StackFrame");
|
|
5000
5000
|
},
|
|
5001
5001
|
toString: function() {
|
|
5002
|
-
var
|
|
5003
|
-
return this.getIsEval() ?
|
|
5002
|
+
var v = this.getFileName() || "", E = this.getLineNumber() || "", F = this.getColumnNumber() || "", P = this.getFunctionName() || "";
|
|
5003
|
+
return this.getIsEval() ? v ? "[eval] (" + v + ":" + E + ":" + F + ")" : "[eval]:" + E + ":" + F : P ? P + " (" + v + ":" + E + ":" + F + ")" : v + ":" + E + ":" + F;
|
|
5004
5004
|
}
|
|
5005
|
-
},
|
|
5005
|
+
}, u.fromString = function(E) {
|
|
5006
5006
|
var F = E.indexOf("("), P = E.lastIndexOf(")"), A = E.substring(0, F), k = E.substring(F + 1, P).split(","), N = E.substring(P + 1);
|
|
5007
5007
|
if (N.indexOf("@") === 0)
|
|
5008
5008
|
var O = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""), D = O[1], I = O[2], T = O[3];
|
|
5009
|
-
return new
|
|
5009
|
+
return new u({
|
|
5010
5010
|
functionName: A,
|
|
5011
5011
|
args: k || void 0,
|
|
5012
5012
|
fileName: D,
|
|
@@ -5015,26 +5015,26 @@ function Ao() {
|
|
|
5015
5015
|
});
|
|
5016
5016
|
};
|
|
5017
5017
|
for (var p = 0; p < r.length; p++)
|
|
5018
|
-
|
|
5018
|
+
u.prototype["get" + n(r[p])] = i(r[p]), u.prototype["set" + n(r[p])] = /* @__PURE__ */ function(v) {
|
|
5019
5019
|
return function(E) {
|
|
5020
|
-
this[
|
|
5020
|
+
this[v] = !!E;
|
|
5021
5021
|
};
|
|
5022
5022
|
}(r[p]);
|
|
5023
|
-
for (var
|
|
5024
|
-
|
|
5023
|
+
for (var y = 0; y < o.length; y++)
|
|
5024
|
+
u.prototype["get" + n(o[y])] = i(o[y]), u.prototype["set" + n(o[y])] = /* @__PURE__ */ function(v) {
|
|
5025
5025
|
return function(E) {
|
|
5026
5026
|
if (!s(E))
|
|
5027
|
-
throw new TypeError(
|
|
5028
|
-
this[
|
|
5027
|
+
throw new TypeError(v + " must be a Number");
|
|
5028
|
+
this[v] = Number(E);
|
|
5029
5029
|
};
|
|
5030
|
-
}(o[
|
|
5030
|
+
}(o[y]);
|
|
5031
5031
|
for (var S = 0; S < l.length; S++)
|
|
5032
|
-
|
|
5032
|
+
u.prototype["get" + n(l[S])] = i(l[S]), u.prototype["set" + n(l[S])] = /* @__PURE__ */ function(v) {
|
|
5033
5033
|
return function(E) {
|
|
5034
|
-
this[
|
|
5034
|
+
this[v] = String(E);
|
|
5035
5035
|
};
|
|
5036
5036
|
}(l[S]);
|
|
5037
|
-
return
|
|
5037
|
+
return u;
|
|
5038
5038
|
});
|
|
5039
5039
|
}(cs)), cs.exports;
|
|
5040
5040
|
}
|
|
@@ -5073,14 +5073,14 @@ function Ao() {
|
|
|
5073
5073
|
}, this);
|
|
5074
5074
|
return h.map(function(c) {
|
|
5075
5075
|
c.indexOf("(eval ") > -1 && (c = c.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
5076
|
-
var
|
|
5077
|
-
|
|
5078
|
-
var
|
|
5076
|
+
var u = c.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = u.match(/ (\(.+\)$)/);
|
|
5077
|
+
u = p ? u.replace(p[0], "") : u;
|
|
5078
|
+
var y = this.extractLocation(p ? p[1] : u), S = p && u || void 0, v = ["eval", "<anonymous>"].indexOf(y[0]) > -1 ? void 0 : y[0];
|
|
5079
5079
|
return new n({
|
|
5080
5080
|
functionName: S,
|
|
5081
|
-
fileName:
|
|
5082
|
-
lineNumber:
|
|
5083
|
-
columnNumber:
|
|
5081
|
+
fileName: v,
|
|
5082
|
+
lineNumber: y[1],
|
|
5083
|
+
columnNumber: y[2],
|
|
5084
5084
|
source: c
|
|
5085
5085
|
});
|
|
5086
5086
|
}, this);
|
|
@@ -5095,9 +5095,9 @@ function Ao() {
|
|
|
5095
5095
|
return new n({
|
|
5096
5096
|
functionName: c
|
|
5097
5097
|
});
|
|
5098
|
-
var
|
|
5098
|
+
var u = /((.*".+"[^@]*)?[^@]*)(?:@)/, p = c.match(u), y = p && p[1] ? p[1] : void 0, S = this.extractLocation(c.replace(u, ""));
|
|
5099
5099
|
return new n({
|
|
5100
|
-
functionName:
|
|
5100
|
+
functionName: y,
|
|
5101
5101
|
fileName: S[0],
|
|
5102
5102
|
lineNumber: S[1],
|
|
5103
5103
|
columnNumber: S[2],
|
|
@@ -5113,21 +5113,21 @@ function Ao() {
|
|
|
5113
5113
|
},
|
|
5114
5114
|
parseOpera9: function(a) {
|
|
5115
5115
|
for (var h = /Line (\d+).*script (?:in )?(\S+)/i, c = a.message.split(`
|
|
5116
|
-
`),
|
|
5116
|
+
`), u = [], p = 2, y = c.length; p < y; p += 2) {
|
|
5117
5117
|
var S = h.exec(c[p]);
|
|
5118
|
-
S &&
|
|
5118
|
+
S && u.push(new n({
|
|
5119
5119
|
fileName: S[2],
|
|
5120
5120
|
lineNumber: S[1],
|
|
5121
5121
|
source: c[p]
|
|
5122
5122
|
}));
|
|
5123
5123
|
}
|
|
5124
|
-
return
|
|
5124
|
+
return u;
|
|
5125
5125
|
},
|
|
5126
5126
|
parseOpera10: function(a) {
|
|
5127
5127
|
for (var h = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, c = a.stacktrace.split(`
|
|
5128
|
-
`),
|
|
5128
|
+
`), u = [], p = 0, y = c.length; p < y; p += 2) {
|
|
5129
5129
|
var S = h.exec(c[p]);
|
|
5130
|
-
S &&
|
|
5130
|
+
S && u.push(
|
|
5131
5131
|
new n({
|
|
5132
5132
|
functionName: S[3] || void 0,
|
|
5133
5133
|
fileName: S[2],
|
|
@@ -5136,7 +5136,7 @@ function Ao() {
|
|
|
5136
5136
|
})
|
|
5137
5137
|
);
|
|
5138
5138
|
}
|
|
5139
|
-
return
|
|
5139
|
+
return u;
|
|
5140
5140
|
},
|
|
5141
5141
|
// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
5142
5142
|
parseOpera11: function(a) {
|
|
@@ -5145,9 +5145,9 @@ function Ao() {
|
|
|
5145
5145
|
return !!c.match(i) && !c.match(/^Error created at/);
|
|
5146
5146
|
}, this);
|
|
5147
5147
|
return h.map(function(c) {
|
|
5148
|
-
var
|
|
5149
|
-
|
|
5150
|
-
var E =
|
|
5148
|
+
var u = c.split("@"), p = this.extractLocation(u.pop()), y = u.shift() || "", S = y.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, v;
|
|
5149
|
+
y.match(/\(([^)]*)\)/) && (v = y.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
|
|
5150
|
+
var E = v === void 0 || v === "[arguments not available]" ? void 0 : v.split(",");
|
|
5151
5151
|
return new n({
|
|
5152
5152
|
functionName: S,
|
|
5153
5153
|
args: E,
|
|
@@ -5235,13 +5235,13 @@ function jo(t) {
|
|
|
5235
5235
|
const { srcset: h } = a;
|
|
5236
5236
|
if (!h)
|
|
5237
5237
|
return;
|
|
5238
|
-
const c = h.split(h.match(/,\s+/) ? /,\s+/ : ",").map((
|
|
5238
|
+
const c = h.split(h.match(/,\s+/) ? /,\s+/ : ",").map((u) => Cn(u)).join(", ");
|
|
5239
5239
|
t.attributeSender.sendSetAttribute(l, "srcset", c);
|
|
5240
5240
|
}, n = function(l, a) {
|
|
5241
|
-
a.src.length > er && e(l, a), t.send(
|
|
5241
|
+
a.src.length > er && e(l, a), t.send(ys(l, "src", a.src, t.getBaseHref()));
|
|
5242
5242
|
}, i = t.safe(function(l) {
|
|
5243
5243
|
const a = Cn(l.src || "");
|
|
5244
|
-
ri(a) && t.send(
|
|
5244
|
+
ri(a) && t.send(di(t.timestamp(), 0, 0, 0, 0, 0, a, "img", 0, !1));
|
|
5245
5245
|
}), r = t.safe(function(l) {
|
|
5246
5246
|
const a = t.nodes.getID(l);
|
|
5247
5247
|
a !== void 0 && l.complete && (l.naturalHeight === 0 && l.naturalWidth === 0 && !Bo(l.src) ? i(l) : t.sanitizer.isHidden(a) || t.sanitizer.isObscured(a) ? e(a, l) : (n(a, l), s(a, l)));
|
|
@@ -5300,7 +5300,7 @@ const $o = xe && "labels" in HTMLInputElement.prototype ? (t) => {
|
|
|
5300
5300
|
return n[0];
|
|
5301
5301
|
}
|
|
5302
5302
|
};
|
|
5303
|
-
function
|
|
5303
|
+
function yi(t) {
|
|
5304
5304
|
let e = Ms(t);
|
|
5305
5305
|
if (e === null) {
|
|
5306
5306
|
const s = $o(t);
|
|
@@ -5320,11 +5320,11 @@ function Wo(t, e) {
|
|
|
5320
5320
|
defaultInputMode: ze.Obscured,
|
|
5321
5321
|
obscureInputDates: !1
|
|
5322
5322
|
}, e);
|
|
5323
|
-
function n(c,
|
|
5324
|
-
let p =
|
|
5325
|
-
|
|
5323
|
+
function n(c, u) {
|
|
5324
|
+
let p = u.value, y = s.defaultInputMode;
|
|
5325
|
+
u.type === "password" || t.sanitizer.isHidden(c) ? y = ze.Hidden : (t.sanitizer.isObscured(c) || y === ze.Plain && (s.obscureInputNumbers && u.type !== "date" && /\d\d\d\d/.test(p) || s.obscureInputDates && u.type === "date" || s.obscureInputEmails && (u.type === "email" || ~p.indexOf("@")))) && (y = ze.Obscured);
|
|
5326
5326
|
let S = 0;
|
|
5327
|
-
switch (
|
|
5327
|
+
switch (y) {
|
|
5328
5328
|
case ze.Hidden:
|
|
5329
5329
|
S = -1, p = "";
|
|
5330
5330
|
break;
|
|
@@ -5334,63 +5334,63 @@ function Wo(t, e) {
|
|
|
5334
5334
|
}
|
|
5335
5335
|
return { value: p, mask: S };
|
|
5336
5336
|
}
|
|
5337
|
-
function i(c,
|
|
5338
|
-
const { value: p, mask:
|
|
5339
|
-
t.send(mr(c, p,
|
|
5337
|
+
function i(c, u) {
|
|
5338
|
+
const { value: p, mask: y } = n(c, u);
|
|
5339
|
+
t.send(mr(c, p, y));
|
|
5340
5340
|
}
|
|
5341
5341
|
const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
5342
5342
|
t.attachStopCallback(() => {
|
|
5343
5343
|
r.clear(), o.clear();
|
|
5344
5344
|
});
|
|
5345
|
-
function l(c,
|
|
5346
|
-
r.get(c) !==
|
|
5345
|
+
function l(c, u) {
|
|
5346
|
+
r.get(c) !== u.value && (r.set(c, u.value), i(c, u));
|
|
5347
5347
|
}
|
|
5348
|
-
function a(c,
|
|
5349
|
-
o.get(c) !==
|
|
5348
|
+
function a(c, u) {
|
|
5349
|
+
o.get(c) !== u && (o.set(c, u), t.send(br(c, u)));
|
|
5350
5350
|
}
|
|
5351
5351
|
t.ticker.attach(() => {
|
|
5352
|
-
r.forEach((c,
|
|
5353
|
-
const p = t.nodes.getNode(
|
|
5352
|
+
r.forEach((c, u) => {
|
|
5353
|
+
const p = t.nodes.getNode(u);
|
|
5354
5354
|
if (!p)
|
|
5355
|
-
return r.delete(
|
|
5356
|
-
l(
|
|
5357
|
-
}), o.forEach((c,
|
|
5358
|
-
const p = t.nodes.getNode(
|
|
5355
|
+
return r.delete(u);
|
|
5356
|
+
l(u, p);
|
|
5357
|
+
}), o.forEach((c, u) => {
|
|
5358
|
+
const p = t.nodes.getNode(u);
|
|
5359
5359
|
if (!p)
|
|
5360
|
-
return o.delete(
|
|
5361
|
-
a(
|
|
5360
|
+
return o.delete(u);
|
|
5361
|
+
a(u, p.checked);
|
|
5362
5362
|
});
|
|
5363
5363
|
}, 3);
|
|
5364
|
-
function h(c,
|
|
5365
|
-
const { value: S, mask:
|
|
5366
|
-
t.send(Dr(c, S,
|
|
5364
|
+
function h(c, u, p, y) {
|
|
5365
|
+
const { value: S, mask: v } = n(c, u), E = yi(u);
|
|
5366
|
+
t.send(Dr(c, S, v !== 0, E, p, y));
|
|
5367
5367
|
}
|
|
5368
5368
|
t.nodes.attachNodeCallback(t.safe((c) => {
|
|
5369
|
-
const
|
|
5370
|
-
if (
|
|
5371
|
-
if (Z(c, "select") && (i(
|
|
5372
|
-
l(
|
|
5373
|
-
let p = 0,
|
|
5374
|
-
const
|
|
5369
|
+
const u = t.nodes.getID(c);
|
|
5370
|
+
if (u !== void 0) {
|
|
5371
|
+
if (Z(c, "select") && (i(u, c), t.nodes.attachNodeListener(c, "change", () => i(u, c))), Uo(c)) {
|
|
5372
|
+
l(u, c);
|
|
5373
|
+
let p = 0, y = 0, S = 0;
|
|
5374
|
+
const v = () => {
|
|
5375
5375
|
p = ge();
|
|
5376
5376
|
}, E = () => {
|
|
5377
|
-
|
|
5377
|
+
y === 0 && p !== 0 && (y = ge() - p);
|
|
5378
5378
|
}, F = () => {
|
|
5379
|
-
p !== 0 && (S = ge() - p), h(
|
|
5379
|
+
p !== 0 && (S = ge() - p), h(u, c, y, S), y = 0, S = 0, p = 0;
|
|
5380
5380
|
};
|
|
5381
|
-
t.nodes.attachNodeListener(c, "focus",
|
|
5381
|
+
t.nodes.attachNodeListener(c, "focus", v), t.nodes.attachNodeListener(c, "input", E), t.nodes.attachNodeListener(c, "change", F);
|
|
5382
5382
|
return;
|
|
5383
5383
|
}
|
|
5384
5384
|
if (Ho(c)) {
|
|
5385
|
-
a(
|
|
5385
|
+
a(u, c.checked), t.nodes.attachNodeListener(c, "change", () => a(u, c.checked));
|
|
5386
5386
|
return;
|
|
5387
5387
|
}
|
|
5388
5388
|
}
|
|
5389
5389
|
}));
|
|
5390
5390
|
}
|
|
5391
|
-
let
|
|
5391
|
+
let ue, js, vi;
|
|
5392
5392
|
function qo(t, e) {
|
|
5393
|
-
if (
|
|
5393
|
+
if (vi = /* @__PURE__ */ new Date(), t.nodeType !== Node.ELEMENT_NODE)
|
|
5394
5394
|
throw new Error("Can't generate CSS selector for non-element node type.");
|
|
5395
5395
|
if (t.tagName.toLowerCase() === "html")
|
|
5396
5396
|
return "html";
|
|
@@ -5406,7 +5406,7 @@ function qo(t, e) {
|
|
|
5406
5406
|
maxNumberOfTries: 1e4,
|
|
5407
5407
|
timeoutMs: void 0
|
|
5408
5408
|
};
|
|
5409
|
-
|
|
5409
|
+
ue = { ...s, ...e }, js = Vo(ue.root, s);
|
|
5410
5410
|
let n = ot(t, "all", () => ot(t, "two", () => ot(t, "one", () => ot(t, "none"))));
|
|
5411
5411
|
if (n) {
|
|
5412
5412
|
const i = xi(ki(n, t));
|
|
@@ -5420,8 +5420,8 @@ function Vo(t, e) {
|
|
|
5420
5420
|
function ot(t, e, s) {
|
|
5421
5421
|
let n = null, i = [], r = t, o = 0;
|
|
5422
5422
|
for (; r; ) {
|
|
5423
|
-
const l = (/* @__PURE__ */ new Date()).getTime() -
|
|
5424
|
-
if (
|
|
5423
|
+
const l = (/* @__PURE__ */ new Date()).getTime() - vi.getTime();
|
|
5424
|
+
if (ue.timeoutMs !== void 0 && l > ue.timeoutMs)
|
|
5425
5425
|
throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
|
|
5426
5426
|
let a = ct(Go(r)) || ct(...Ko(r)) || ct(...Jo(r)) || ct(Xo(r)) || [On()];
|
|
5427
5427
|
const h = Yo(r);
|
|
@@ -5436,7 +5436,7 @@ function ot(t, e, s) {
|
|
|
5436
5436
|
e == "none" && (a = [On()], h && (a = [at(a[0], h)]));
|
|
5437
5437
|
for (let c of a)
|
|
5438
5438
|
c.level = o;
|
|
5439
|
-
if (i.push(a), i.length >=
|
|
5439
|
+
if (i.push(a), i.length >= ue.seedMinLength && (n = _n(i, s), n))
|
|
5440
5440
|
break;
|
|
5441
5441
|
r = r.parentElement, o++;
|
|
5442
5442
|
}
|
|
@@ -5444,7 +5444,7 @@ function ot(t, e, s) {
|
|
|
5444
5444
|
}
|
|
5445
5445
|
function _n(t, e) {
|
|
5446
5446
|
const s = xi(Si(t));
|
|
5447
|
-
if (s.length >
|
|
5447
|
+
if (s.length > ue.threshold)
|
|
5448
5448
|
return e ? e() : null;
|
|
5449
5449
|
for (let n of s)
|
|
5450
5450
|
if (wi(n))
|
|
@@ -5475,26 +5475,26 @@ function wi(t) {
|
|
|
5475
5475
|
}
|
|
5476
5476
|
function Go(t) {
|
|
5477
5477
|
const e = t.getAttribute("id");
|
|
5478
|
-
return e &&
|
|
5478
|
+
return e && ue.idName(e) ? {
|
|
5479
5479
|
name: "#" + CSS.escape(e),
|
|
5480
5480
|
penalty: 0
|
|
5481
5481
|
} : null;
|
|
5482
5482
|
}
|
|
5483
5483
|
function Ko(t) {
|
|
5484
|
-
return Array.from(t.attributes).filter((s) =>
|
|
5484
|
+
return Array.from(t.attributes).filter((s) => ue.attr(s.name, s.value)).map((s) => ({
|
|
5485
5485
|
name: `[${CSS.escape(s.name)}="${CSS.escape(s.value)}"]`,
|
|
5486
5486
|
penalty: 0.5
|
|
5487
5487
|
}));
|
|
5488
5488
|
}
|
|
5489
5489
|
function Jo(t) {
|
|
5490
|
-
return Array.from(t.classList).filter(
|
|
5490
|
+
return Array.from(t.classList).filter(ue.className).map((s) => ({
|
|
5491
5491
|
name: "." + CSS.escape(s),
|
|
5492
5492
|
penalty: 1
|
|
5493
5493
|
}));
|
|
5494
5494
|
}
|
|
5495
5495
|
function Xo(t) {
|
|
5496
5496
|
const e = t.tagName.toLowerCase();
|
|
5497
|
-
return
|
|
5497
|
+
return ue.tagName(e) ? {
|
|
5498
5498
|
name: e,
|
|
5499
5499
|
penalty: 2
|
|
5500
5500
|
} : null;
|
|
@@ -5547,9 +5547,9 @@ function* ki(t, e, s = {
|
|
|
5547
5547
|
counter: 0,
|
|
5548
5548
|
visited: /* @__PURE__ */ new Map()
|
|
5549
5549
|
}) {
|
|
5550
|
-
if (t.length > 2 && t.length >
|
|
5550
|
+
if (t.length > 2 && t.length > ue.optimizedMinLength)
|
|
5551
5551
|
for (let n = 1; n < t.length - 1; n++) {
|
|
5552
|
-
if (s.counter >
|
|
5552
|
+
if (s.counter > ue.maxNumberOfTries)
|
|
5553
5553
|
return;
|
|
5554
5554
|
s.counter += 1;
|
|
5555
5555
|
const i = [...t];
|
|
@@ -5608,23 +5608,23 @@ function sa(t, e) {
|
|
|
5608
5608
|
if (N !== null)
|
|
5609
5609
|
return N;
|
|
5610
5610
|
if (Z(k, "input"))
|
|
5611
|
-
return
|
|
5611
|
+
return yi(k);
|
|
5612
5612
|
if (Ns(k)) {
|
|
5613
5613
|
let O = "";
|
|
5614
5614
|
return k instanceof HTMLElement && (O = t.sanitizer.getInnerTextSecure(k)), O = O || k.id || k.className, ii(O).slice(0, 100);
|
|
5615
5615
|
}
|
|
5616
5616
|
return "";
|
|
5617
5617
|
}
|
|
5618
|
-
let i = -1, r = -1, o = !1, l = null, a = 0, h = {}, c = 0,
|
|
5619
|
-
const
|
|
5618
|
+
let i = -1, r = -1, o = !1, l = null, a = 0, h = {}, c = 0, u = 0, p = 0, y = 0, S;
|
|
5619
|
+
const v = 8e-3, E = 225;
|
|
5620
5620
|
function F() {
|
|
5621
|
-
const k =
|
|
5621
|
+
const k = y / E;
|
|
5622
5622
|
if (!c) {
|
|
5623
5623
|
c = k;
|
|
5624
5624
|
return;
|
|
5625
5625
|
}
|
|
5626
5626
|
const N = (k - c) / E;
|
|
5627
|
-
p > 4 && N >
|
|
5627
|
+
p > 4 && N > v && t.send(Lr(ge())), y = 0, p = 0, c = k;
|
|
5628
5628
|
}
|
|
5629
5629
|
t.attachStartCallback(() => {
|
|
5630
5630
|
S = setInterval(() => F(), E);
|
|
@@ -5632,7 +5632,7 @@ function sa(t, e) {
|
|
|
5632
5632
|
i = -1, r = -1, o = !1, l = null, h = {}, S && clearInterval(S);
|
|
5633
5633
|
});
|
|
5634
5634
|
const P = () => {
|
|
5635
|
-
o && (t.send(
|
|
5635
|
+
o && (t.send(yr(i, r)), o = !1);
|
|
5636
5636
|
}, A = (k, N = !1) => {
|
|
5637
5637
|
function O(I, T, B) {
|
|
5638
5638
|
return h[I] = h[I] || ea(T, k, B);
|
|
@@ -5644,16 +5644,16 @@ function sa(t, e) {
|
|
|
5644
5644
|
}), D(k, "mousemove", (I) => {
|
|
5645
5645
|
const [T, B] = t.observer.getDocumentOffset(k);
|
|
5646
5646
|
i = I.clientX + T, r = I.clientY + B, o = !0;
|
|
5647
|
-
const
|
|
5648
|
-
|
|
5647
|
+
const V = Math.sign(I.movementX);
|
|
5648
|
+
y += Math.abs(I.movementX) + Math.abs(I.movementY), V !== u && (u = V, p++);
|
|
5649
5649
|
}, !1), D(k, "click", (I) => {
|
|
5650
5650
|
const T = Rn(I.target, k);
|
|
5651
5651
|
if (!I.clientX && !I.clientY || T === null)
|
|
5652
5652
|
return;
|
|
5653
5653
|
const B = t.nodes.getID(T);
|
|
5654
5654
|
if (B !== void 0) {
|
|
5655
|
-
const
|
|
5656
|
-
P(), t.send(Rr(B, l === T ? Math.round(performance.now() - a) : 0, n(T), Ns(T) && !s ? O(B, T, e) : "", L,
|
|
5655
|
+
const V = I.pageX, j = I.pageY, $ = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, L = Fn(V / $), q = Fn(j / C);
|
|
5656
|
+
P(), t.send(Rr(B, l === T ? Math.round(performance.now() - a) : 0, n(T), Ns(T) && !s ? O(B, T, e) : "", L, q), !0);
|
|
5657
5657
|
}
|
|
5658
5658
|
l = null;
|
|
5659
5659
|
});
|
|
@@ -5673,8 +5673,8 @@ function na(t) {
|
|
|
5673
5673
|
if (Z(r, "img") && (o = r.currentSrc || r.src), !o) {
|
|
5674
5674
|
const S = getComputedStyle(r).getPropertyValue("background-image");
|
|
5675
5675
|
if (S) {
|
|
5676
|
-
const
|
|
5677
|
-
|
|
5676
|
+
const v = n.exec(S);
|
|
5677
|
+
v !== null && (o = v[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
|
|
5678
5678
|
}
|
|
5679
5679
|
}
|
|
5680
5680
|
if (!o)
|
|
@@ -5682,11 +5682,11 @@ function na(t) {
|
|
|
5682
5682
|
const l = o.substr(0, 10) === "data:image" ? 0 : t[o];
|
|
5683
5683
|
if (l === void 0)
|
|
5684
5684
|
continue;
|
|
5685
|
-
const a = r.getBoundingClientRect(), h = Math.max(a.top, 0), c = Math.max(a.left, 0),
|
|
5686
|
-
if (
|
|
5685
|
+
const a = r.getBoundingClientRect(), h = Math.max(a.top, 0), c = Math.max(a.left, 0), u = Math.min(a.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(a.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
|
|
5686
|
+
if (u <= h || p <= c)
|
|
5687
5687
|
continue;
|
|
5688
|
-
const
|
|
5689
|
-
e.push({ time: l, area:
|
|
5688
|
+
const y = (u - h) * (p - c);
|
|
5689
|
+
e.push({ time: l, area: y });
|
|
5690
5690
|
}
|
|
5691
5691
|
return e;
|
|
5692
5692
|
}
|
|
@@ -5709,17 +5709,17 @@ function ra(t, e) {
|
|
|
5709
5709
|
return;
|
|
5710
5710
|
let n = {};
|
|
5711
5711
|
function i(h) {
|
|
5712
|
-
var
|
|
5712
|
+
var u;
|
|
5713
5713
|
if (h.duration < 0 || !ri(h.name) || t.isServiceURL(h.name))
|
|
5714
5714
|
return;
|
|
5715
5715
|
n !== null && (n[h.name] = h.startTime + h.duration);
|
|
5716
5716
|
let c = !1;
|
|
5717
|
-
(
|
|
5717
|
+
(u = s.excludedResourceUrls) == null || u.forEach((p) => {
|
|
5718
5718
|
if (h.name.startsWith(p)) {
|
|
5719
5719
|
c = !0;
|
|
5720
5720
|
return;
|
|
5721
5721
|
}
|
|
5722
|
-
}), !c && t.send(
|
|
5722
|
+
}), !c && t.send(di(
|
|
5723
5723
|
h.startTime + Ge(),
|
|
5724
5724
|
h.duration,
|
|
5725
5725
|
h.responseStart && h.startTime ? h.responseStart - h.startTime : 0,
|
|
@@ -5745,8 +5745,8 @@ function ra(t, e) {
|
|
|
5745
5745
|
let h = !1;
|
|
5746
5746
|
t.ticker.attach(() => {
|
|
5747
5747
|
if (!h && ((l === 0 || a === 0) && performance.getEntriesByType("paint").forEach((c) => {
|
|
5748
|
-
const { name:
|
|
5749
|
-
switch (
|
|
5748
|
+
const { name: u, startTime: p } = c;
|
|
5749
|
+
switch (u) {
|
|
5750
5750
|
case "first-paint":
|
|
5751
5751
|
l = p;
|
|
5752
5752
|
break;
|
|
@@ -5761,28 +5761,28 @@ function ra(t, e) {
|
|
|
5761
5761
|
// since it is compared with the values obtained on the page load (before any possible sleep state)
|
|
5762
5762
|
// deprecated though
|
|
5763
5763
|
navigationStart: c,
|
|
5764
|
-
requestStart:
|
|
5764
|
+
requestStart: u,
|
|
5765
5765
|
responseStart: p,
|
|
5766
|
-
responseEnd:
|
|
5766
|
+
responseEnd: y,
|
|
5767
5767
|
domContentLoadedEventStart: S,
|
|
5768
|
-
domContentLoadedEventEnd:
|
|
5768
|
+
domContentLoadedEventEnd: v,
|
|
5769
5769
|
loadEventStart: E,
|
|
5770
5770
|
loadEventEnd: F
|
|
5771
5771
|
} = performance.timing;
|
|
5772
|
-
t.send(wr(
|
|
5772
|
+
t.send(wr(u - c || 0, p - c || 0, y - c || 0, S - c || 0, v - c || 0, E - c || 0, F - c || 0, l, a));
|
|
5773
5773
|
}
|
|
5774
5774
|
}, 30);
|
|
5775
5775
|
}
|
|
5776
5776
|
if (s.capturePageRenderTimings) {
|
|
5777
|
-
let h = 0, c = 0,
|
|
5777
|
+
let h = 0, c = 0, u = 0, p = null, y = !1;
|
|
5778
5778
|
t.ticker.attach(() => {
|
|
5779
|
-
if (
|
|
5779
|
+
if (y)
|
|
5780
5780
|
return;
|
|
5781
5781
|
const S = performance.now();
|
|
5782
|
-
if (n !== null && (h = Math.max.apply(null, Object.keys(n).map((
|
|
5783
|
-
|
|
5784
|
-
const
|
|
5785
|
-
t.send(Sr(
|
|
5782
|
+
if (n !== null && (h = Math.max.apply(null, Object.keys(n).map((v) => n[v])), S - h > 1e3 && (p = na(n), n = null)), u !== null && (S - u > 50 && (c = S), u = S - c > 5e3 ? null : S), p !== null && u === null || S > 3e4) {
|
|
5783
|
+
y = !0, n = null;
|
|
5784
|
+
const v = p === null ? 0 : ia(a || l, p), { domContentLoadedEventEnd: E, navigationStart: F } = performance.timing, P = u === null ? Math.max(c, a, E - F || 0) : 0;
|
|
5785
|
+
t.send(Sr(v, a > h ? a : h, P));
|
|
5786
5786
|
}
|
|
5787
5787
|
});
|
|
5788
5788
|
}
|
|
@@ -5856,19 +5856,19 @@ function la(t) {
|
|
|
5856
5856
|
a || (a = []);
|
|
5857
5857
|
const h = [], c = o.adoptedStyleSheets;
|
|
5858
5858
|
if (c && Symbol.iterator in c)
|
|
5859
|
-
for (const
|
|
5860
|
-
let p = e.get(
|
|
5861
|
-
const
|
|
5862
|
-
if (p || (p = Ei(), e.set(
|
|
5863
|
-
const S =
|
|
5864
|
-
for (let
|
|
5865
|
-
t.send(ws(p, S[
|
|
5859
|
+
for (const u of c) {
|
|
5860
|
+
let p = e.get(u);
|
|
5861
|
+
const y = !p;
|
|
5862
|
+
if (p || (p = Ei(), e.set(u, p)), a.includes(p) || t.send(hi(p, l)), y) {
|
|
5863
|
+
const S = u.cssRules;
|
|
5864
|
+
for (let v = 0; v < S.length; v++)
|
|
5865
|
+
t.send(ws(p, S[v].cssText, v, t.getBaseHref()));
|
|
5866
5866
|
}
|
|
5867
5867
|
h.push(p);
|
|
5868
5868
|
}
|
|
5869
5869
|
if (Symbol.iterator in a)
|
|
5870
|
-
for (const
|
|
5871
|
-
h.includes(
|
|
5870
|
+
for (const u of a)
|
|
5871
|
+
h.includes(u) || t.send(Fr(u, l));
|
|
5872
5872
|
s.set(l, h);
|
|
5873
5873
|
}, 20);
|
|
5874
5874
|
function i(o) {
|
|
@@ -5888,8 +5888,8 @@ function la(t) {
|
|
|
5888
5888
|
const { replace: l, replaceSync: a } = o.CSSStyleSheet.prototype;
|
|
5889
5889
|
o.CSSStyleSheet.prototype.replace = function(h) {
|
|
5890
5890
|
return l.call(this, h).then((c) => {
|
|
5891
|
-
const
|
|
5892
|
-
return
|
|
5891
|
+
const u = e.get(this);
|
|
5892
|
+
return u && t.send(cn(u, h, t.getBaseHref())), c;
|
|
5893
5893
|
});
|
|
5894
5894
|
}, o.CSSStyleSheet.prototype.replaceSync = function(h) {
|
|
5895
5895
|
const c = e.get(this);
|
|
@@ -5937,8 +5937,8 @@ function ha(t) {
|
|
|
5937
5937
|
}, i.CSSStyleSheet.prototype.deleteRule = function(h) {
|
|
5938
5938
|
return e(this, h), o.call(this, h);
|
|
5939
5939
|
}, i.CSSGroupingRule.prototype.insertRule = function(h, c = 0) {
|
|
5940
|
-
const
|
|
5941
|
-
return s(this),
|
|
5940
|
+
const u = l.call(this, h, c);
|
|
5941
|
+
return s(this), u;
|
|
5942
5942
|
}, i.CSSGroupingRule.prototype.deleteRule = function(h = 0) {
|
|
5943
5943
|
const c = a.call(this, h);
|
|
5944
5944
|
return s(this), c;
|
|
@@ -5957,7 +5957,7 @@ function ha(t) {
|
|
|
5957
5957
|
e(o, h, a[h].cssText);
|
|
5958
5958
|
});
|
|
5959
5959
|
}
|
|
5960
|
-
function
|
|
5960
|
+
function da(t) {
|
|
5961
5961
|
function e(n) {
|
|
5962
5962
|
const i = t.nodes.getID(n);
|
|
5963
5963
|
i !== void 0 && t.send(an(i));
|
|
@@ -5978,7 +5978,7 @@ function ua(t) {
|
|
|
5978
5978
|
n && n !== n.ownerDocument.body && e(n);
|
|
5979
5979
|
}, !0);
|
|
5980
5980
|
}
|
|
5981
|
-
function
|
|
5981
|
+
function ua(t) {
|
|
5982
5982
|
if (!window.FontFace)
|
|
5983
5983
|
return;
|
|
5984
5984
|
const e = /* @__PURE__ */ new Map(), s = (n) => {
|
|
@@ -6017,26 +6017,26 @@ function fa(t, e, s, n, i) {
|
|
|
6017
6017
|
t.debug.log("Openreplay: attaching axios spy to instance", e);
|
|
6018
6018
|
function r(p) {
|
|
6019
6019
|
t.debug.log("Openreplay: capturing axios response data", p);
|
|
6020
|
-
const { headers:
|
|
6021
|
-
function
|
|
6020
|
+
const { headers: y, data: S, method: v, url: E, baseURL: F } = p.config, { data: P, headers: A, status: k, response: N } = p, { data: O, headers: D, status: I } = N || {}, T = s.ignoreHeaders, B = Array.isArray(T) ? (U) => T.includes(U) : () => T;
|
|
6021
|
+
function V(U, b) {
|
|
6022
6022
|
B(b[0]) || (U[b[0]] = b[1]);
|
|
6023
6023
|
}
|
|
6024
|
-
let j = {},
|
|
6025
|
-
|
|
6024
|
+
let j = {}, $ = {};
|
|
6025
|
+
y.toJSON ? j = y.toJSON() : y instanceof Headers ? y.forEach((U, b) => V(j, [b, U])) : Array.isArray(y) ? y.forEach((U) => V(j, U)) : typeof y == "object" && Object.entries(y).forEach((U) => V(j, U));
|
|
6026
6026
|
const C = D || A;
|
|
6027
|
-
C.toJSON ?
|
|
6028
|
-
B(U) || (
|
|
6027
|
+
C.toJSON ? $ = C.toJSON() : C instanceof Headers ? C.forEach((U, b) => V($, [b, U])) : Array.isArray(C) ? C.forEach((U) => V($, U)) : typeof C == "object" && Object.entries(C).forEach(([U, b]) => {
|
|
6028
|
+
B(U) || ($[U] = b);
|
|
6029
6029
|
});
|
|
6030
6030
|
const L = n({
|
|
6031
6031
|
url: E,
|
|
6032
|
-
method:
|
|
6032
|
+
method: v || "",
|
|
6033
6033
|
status: k || I || 0,
|
|
6034
6034
|
request: {
|
|
6035
6035
|
headers: j,
|
|
6036
6036
|
body: S
|
|
6037
6037
|
},
|
|
6038
6038
|
response: {
|
|
6039
|
-
headers:
|
|
6039
|
+
headers: $,
|
|
6040
6040
|
body: O || P
|
|
6041
6041
|
}
|
|
6042
6042
|
});
|
|
@@ -6044,13 +6044,13 @@ function fa(t, e, s, n, i) {
|
|
|
6044
6044
|
t.debug.log("Openreplay: empty request/response info, skipping");
|
|
6045
6045
|
return;
|
|
6046
6046
|
}
|
|
6047
|
-
const
|
|
6048
|
-
t.debug.log("Openreplay: final req object", L), t.send(xt("xhr", String(
|
|
6047
|
+
const q = p.config.__openreplay_timing, G = performance.now() - q;
|
|
6048
|
+
t.debug.log("Openreplay: final req object", L), t.send(xt("xhr", String(v), String(L.url), i(L.request), i(L.response), L.status, q + Ge(), G, 0));
|
|
6049
6049
|
}
|
|
6050
6050
|
function o(p) {
|
|
6051
6051
|
if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), s.sessionTokenHeader) {
|
|
6052
|
-
const
|
|
6053
|
-
S && p.headers.set(
|
|
6052
|
+
const y = typeof s.sessionTokenHeader == "string" ? s.sessionTokenHeader : "X-OpenReplay-Session-Token", S = t.getSessionToken();
|
|
6053
|
+
S && p.headers.set(y, S);
|
|
6054
6054
|
}
|
|
6055
6055
|
return p;
|
|
6056
6056
|
}
|
|
@@ -6065,12 +6065,12 @@ function fa(t, e, s, n, i) {
|
|
|
6065
6065
|
}
|
|
6066
6066
|
const c = e.interceptors.request.use(o, h, {
|
|
6067
6067
|
synchronous: !0
|
|
6068
|
-
}),
|
|
6068
|
+
}), u = e.interceptors.response.use(l, a, {
|
|
6069
6069
|
synchronous: !0
|
|
6070
6070
|
});
|
|
6071
6071
|
t.attachStopCallback(() => {
|
|
6072
|
-
var p,
|
|
6073
|
-
(
|
|
6072
|
+
var p, y, S, v;
|
|
6073
|
+
(y = (p = e.interceptors.request).eject) == null || y.call(p, c), (v = (S = e.interceptors.response).eject) == null || v.call(S, u);
|
|
6074
6074
|
});
|
|
6075
6075
|
}
|
|
6076
6076
|
function pa(t) {
|
|
@@ -6175,7 +6175,7 @@ function It(t) {
|
|
|
6175
6175
|
return t <= 0 ? "" : t >= 1e3 * 1e3 ? (t / 1e3 / 1e3).toFixed(1) + " MB" : t >= 1e3 ? (t / 1e3).toFixed(1) + " KB" : `${t}B`;
|
|
6176
6176
|
}
|
|
6177
6177
|
const Os = (t) => (t.startsWith("//") && (t = `${new URL(window.location.href).protocol}${t}`), t.startsWith("http") ? new URL(t) : new URL(t, window.location.href));
|
|
6178
|
-
class
|
|
6178
|
+
class ya {
|
|
6179
6179
|
constructor(e, s) {
|
|
6180
6180
|
this.resp = e, this.item = s, this.mockReader();
|
|
6181
6181
|
}
|
|
@@ -6216,7 +6216,7 @@ class va {
|
|
|
6216
6216
|
};
|
|
6217
6217
|
}
|
|
6218
6218
|
}
|
|
6219
|
-
class
|
|
6219
|
+
class va {
|
|
6220
6220
|
constructor(e, s, n, i, r, o) {
|
|
6221
6221
|
this.ignoredHeaders = e, this.setSessionTokenHeader = s, this.sanitize = n, this.sendMessage = i, this.isServiceUrl = r, this.tokenUrlMatcher = o;
|
|
6222
6222
|
}
|
|
@@ -6265,7 +6265,7 @@ class ya {
|
|
|
6265
6265
|
}).catch((i) => {
|
|
6266
6266
|
if (i.name !== "AbortError")
|
|
6267
6267
|
throw i;
|
|
6268
|
-
})), new Proxy(s, new
|
|
6268
|
+
})), new Proxy(s, new ya(s, e));
|
|
6269
6269
|
};
|
|
6270
6270
|
}
|
|
6271
6271
|
handleResponseBody(e, s) {
|
|
@@ -6275,7 +6275,7 @@ class ya {
|
|
|
6275
6275
|
}
|
|
6276
6276
|
class wa {
|
|
6277
6277
|
static create(e, s, n, i, r, o) {
|
|
6278
|
-
return new Proxy(fetch, new
|
|
6278
|
+
return new Proxy(fetch, new va(e, s, n, i, r, o));
|
|
6279
6279
|
}
|
|
6280
6280
|
}
|
|
6281
6281
|
class Sa {
|
|
@@ -6421,8 +6421,8 @@ class Ea {
|
|
|
6421
6421
|
const l = Os(i);
|
|
6422
6422
|
if (o.method = "POST", o.url = i, o.name = (l.pathname.split("/").pop() || "") + l.search, o.requestType = "beacon", o.requestHeader = { "Content-Type": ka(r) }, o.status = 0, o.statusText = "Pending", l.search && l.searchParams) {
|
|
6423
6423
|
o.getData = {};
|
|
6424
|
-
for (const [c,
|
|
6425
|
-
o.getData[c] =
|
|
6424
|
+
for (const [c, u] of l.searchParams)
|
|
6425
|
+
o.getData[c] = u;
|
|
6426
6426
|
}
|
|
6427
6427
|
o.requestData = Us(r), o.startTime || (o.startTime = performance.now());
|
|
6428
6428
|
const a = e.apply(s, n);
|
|
@@ -6448,7 +6448,7 @@ function Ta(t, e, s, n, i, r, o) {
|
|
|
6448
6448
|
var l;
|
|
6449
6449
|
t.XMLHttpRequest ? t.XMLHttpRequest = xa.create(e, s, n, i, r, o) : Dn("XMLHttpRequest"), t.fetch ? t.fetch = wa.create(e, s, n, i, r, o) : Dn("fetch"), (l = t == null ? void 0 : t.navigator) != null && l.sendBeacon && (t.navigator.sendBeacon = Ve.create(e, s, n, i, r));
|
|
6450
6450
|
}
|
|
6451
|
-
function
|
|
6451
|
+
function ds(t) {
|
|
6452
6452
|
return t.__or_req_data__ || (t.__or_req_data__ = { body: void 0, headers: {} }), t.__or_req_data__;
|
|
6453
6453
|
}
|
|
6454
6454
|
function Ln(t) {
|
|
@@ -6468,16 +6468,16 @@ function Ia(t, e = {}) {
|
|
|
6468
6468
|
const n = s.ignoreHeaders, i = Array.isArray(n) ? (c) => n.includes(c) : () => n, r = s.sessionTokenHeader === !0 ? "X-OpenReplay-SessionToken" : s.sessionTokenHeader;
|
|
6469
6469
|
function o(c) {
|
|
6470
6470
|
if (r) {
|
|
6471
|
-
const
|
|
6472
|
-
|
|
6471
|
+
const u = t.getSessionToken();
|
|
6472
|
+
u && t.safe(c)(r, u);
|
|
6473
6473
|
}
|
|
6474
6474
|
}
|
|
6475
6475
|
function l(c) {
|
|
6476
6476
|
if (s.capturePayload || (delete c.request.body, delete c.response.body), s.sanitizer) {
|
|
6477
|
-
const
|
|
6478
|
-
if (typeof
|
|
6477
|
+
const u = c.response.body;
|
|
6478
|
+
if (typeof u == "string")
|
|
6479
6479
|
try {
|
|
6480
|
-
c.response.body = JSON.parse(
|
|
6480
|
+
c.response.body = JSON.parse(u);
|
|
6481
6481
|
} catch {
|
|
6482
6482
|
}
|
|
6483
6483
|
return s.sanitizer(c);
|
|
@@ -6496,29 +6496,29 @@ function Ia(t, e = {}) {
|
|
|
6496
6496
|
const h = (c) => {
|
|
6497
6497
|
if (s.useProxy)
|
|
6498
6498
|
return Ta(c, s.ignoreHeaders, o, l, (A) => t.send(A), (A) => t.isServiceURL(A), s.tokenUrlMatcher);
|
|
6499
|
-
const
|
|
6499
|
+
const u = c.fetch.bind(c), p = (A, k = {}) => {
|
|
6500
6500
|
if (!(typeof A == "string" || A instanceof URL) || t.isServiceURL(String(A)))
|
|
6501
|
-
return
|
|
6501
|
+
return u(A, k);
|
|
6502
6502
|
o(function(O, D) {
|
|
6503
6503
|
k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(O, D) : Array.isArray(k.headers) ? k.headers.push([O, D]) : k.headers[O] = D;
|
|
6504
6504
|
});
|
|
6505
6505
|
const N = performance.now();
|
|
6506
|
-
return
|
|
6506
|
+
return u(A, k).then((O) => {
|
|
6507
6507
|
const D = performance.now() - N;
|
|
6508
6508
|
if (s.failuresOnly && O.status < 400)
|
|
6509
6509
|
return O;
|
|
6510
6510
|
const I = O.clone();
|
|
6511
6511
|
return I.text().then((T) => {
|
|
6512
|
-
const B = {},
|
|
6512
|
+
const B = {}, V = {};
|
|
6513
6513
|
if (n !== !0) {
|
|
6514
|
-
const C = ([L,
|
|
6515
|
-
i(L) || (B[L] =
|
|
6514
|
+
const C = ([L, q]) => {
|
|
6515
|
+
i(L) || (B[L] = q);
|
|
6516
6516
|
};
|
|
6517
|
-
k.headers instanceof Headers ? k.headers.forEach((L,
|
|
6518
|
-
i(
|
|
6517
|
+
k.headers instanceof Headers ? k.headers.forEach((L, q) => C([q, L])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((L, q) => {
|
|
6518
|
+
i(q) || (V[q] = L);
|
|
6519
6519
|
});
|
|
6520
6520
|
}
|
|
6521
|
-
const j = Ln(k.method),
|
|
6521
|
+
const j = Ln(k.method), $ = l({
|
|
6522
6522
|
url: String(A),
|
|
6523
6523
|
method: j,
|
|
6524
6524
|
status: I.status,
|
|
@@ -6528,16 +6528,16 @@ function Ia(t, e = {}) {
|
|
|
6528
6528
|
body: k.body || null
|
|
6529
6529
|
},
|
|
6530
6530
|
response: {
|
|
6531
|
-
headers:
|
|
6531
|
+
headers: V,
|
|
6532
6532
|
body: T
|
|
6533
6533
|
}
|
|
6534
6534
|
});
|
|
6535
|
-
|
|
6535
|
+
$ && t.send(xt("fetch", j, String($.url), a($.request), a($.response), I.status, N + Ge(), D, 0));
|
|
6536
6536
|
}).catch((T) => t.debug.error("Could not process Fetch response:", T)), O;
|
|
6537
6537
|
});
|
|
6538
6538
|
};
|
|
6539
6539
|
c.fetch = p;
|
|
6540
|
-
const
|
|
6540
|
+
const y = c.XMLHttpRequest.prototype.open, S = c.XMLHttpRequest.prototype.setRequestHeader, v = c.XMLHttpRequest.prototype.send;
|
|
6541
6541
|
function E(A, k) {
|
|
6542
6542
|
const N = this;
|
|
6543
6543
|
o((D, I) => N.setRequestHeader(D, I));
|
|
@@ -6545,10 +6545,10 @@ function Ia(t, e = {}) {
|
|
|
6545
6545
|
return N.addEventListener("loadstart", (D) => {
|
|
6546
6546
|
O = D.timeStamp;
|
|
6547
6547
|
}), N.addEventListener("load", t.safe((D) => {
|
|
6548
|
-
const { headers: I, body: T } =
|
|
6549
|
-
j.forEach(function(
|
|
6550
|
-
const
|
|
6551
|
-
i(U) || (
|
|
6548
|
+
const { headers: I, body: T } = ds(N), B = O > 0 ? D.timeStamp - O : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), $ = {};
|
|
6549
|
+
j.forEach(function(q) {
|
|
6550
|
+
const G = q.split(": "), U = G.shift();
|
|
6551
|
+
i(U) || ($[U] = G.join(": "));
|
|
6552
6552
|
});
|
|
6553
6553
|
const C = Ln(A), L = l({
|
|
6554
6554
|
url: String(k),
|
|
@@ -6560,20 +6560,20 @@ function Ia(t, e = {}) {
|
|
|
6560
6560
|
body: T || null
|
|
6561
6561
|
},
|
|
6562
6562
|
response: {
|
|
6563
|
-
headers:
|
|
6563
|
+
headers: $,
|
|
6564
6564
|
body: N.response
|
|
6565
6565
|
}
|
|
6566
6566
|
});
|
|
6567
6567
|
L && t.send(xt("xhr", C, String(L.url), a(L.request), a(L.response), N.status, O + Ge(), B, 0));
|
|
6568
|
-
})),
|
|
6568
|
+
})), y.apply(this, arguments);
|
|
6569
6569
|
}
|
|
6570
6570
|
function F(A) {
|
|
6571
|
-
const k =
|
|
6572
|
-
return k.body = A,
|
|
6571
|
+
const k = ds(this);
|
|
6572
|
+
return k.body = A, v.apply(this, arguments);
|
|
6573
6573
|
}
|
|
6574
6574
|
function P(A, k) {
|
|
6575
6575
|
if (!i(A)) {
|
|
6576
|
-
const N =
|
|
6576
|
+
const N = ds(this);
|
|
6577
6577
|
N.headers[A] = k;
|
|
6578
6578
|
}
|
|
6579
6579
|
return S.apply(this, arguments);
|
|
@@ -6596,7 +6596,7 @@ function Ca(t) {
|
|
|
6596
6596
|
}
|
|
6597
6597
|
function _a(t) {
|
|
6598
6598
|
function e() {
|
|
6599
|
-
document.hidden || (t.debug.log("Openreplay: tab change to" + t.session.getTabId()), t.send(
|
|
6599
|
+
document.hidden || (t.debug.log("Openreplay: tab change to" + t.session.getTabId()), t.send(ut(t.session.getTabId())));
|
|
6600
6600
|
}
|
|
6601
6601
|
t.attachEventListener(window, "focus", e, !1, !1);
|
|
6602
6602
|
}
|
|
@@ -6618,8 +6618,8 @@ class Oa {
|
|
|
6618
6618
|
var l;
|
|
6619
6619
|
if (this.options = e, this.app = null, this.crossdomainMode = !1, this.checkDoNotTrack = () => this.options.respectDoNotTrack && (navigator.doNotTrack == "1" || // @ts-ignore
|
|
6620
6620
|
window.doNotTrack == "1"), this.signalStartIssue = (a, h) => {
|
|
6621
|
-
const c = this.checkDoNotTrack(),
|
|
6622
|
-
|
|
6621
|
+
const c = this.checkDoNotTrack(), u = new XMLHttpRequest(), p = this.options.ingestPoint || pi;
|
|
6622
|
+
u.open("POST", p + "/v1/web/not-started"), u.send(JSON.stringify({
|
|
6623
6623
|
trackerVersion: "14.0.4",
|
|
6624
6624
|
projectKey: this.options.projectKey,
|
|
6625
6625
|
doNotTrack: c,
|
|
@@ -6681,7 +6681,7 @@ class Oa {
|
|
|
6681
6681
|
return;
|
|
6682
6682
|
}
|
|
6683
6683
|
const r = new Co(e.projectKey, e.sessionToken, e, this.signalStartIssue, this.crossdomainMode);
|
|
6684
|
-
this.app = r, this.crossdomainMode || (aa(r), _o(r), zr(r, e), _a(r)), sa(r, e.mouse), oa(r, this.crossdomainMode), ha(r), la(r), Fo(r, e), Mo(r, e), jo(r), Wo(r, e), ra(r, e),
|
|
6684
|
+
this.app = r, this.crossdomainMode || (aa(r), _o(r), zr(r, e), _a(r)), sa(r, e.mouse), oa(r, this.crossdomainMode), ha(r), la(r), Fo(r, e), Mo(r, e), jo(r), Wo(r, e), ra(r, e), da(r), ua(r), Ia(r, e.network), Ca(r), window.__OPENREPLAY__ = this, e.flags && e.flags.onFlagsLoad && this.onFlagsLoad(e.flags.onFlagsLoad);
|
|
6685
6685
|
const o = window.open;
|
|
6686
6686
|
(e.autoResetOnWindowOpen || e.resetTabOnWindowOpen) && (r.attachStartCallback(() => {
|
|
6687
6687
|
const a = r.getTabId(), h = r.sessionStorage ?? window.sessionStorage;
|
|
@@ -6867,6 +6867,9 @@ const Ra = `
|
|
|
6867
6867
|
margin: 40px auto;
|
|
6868
6868
|
}
|
|
6869
6869
|
|
|
6870
|
+
.wine-widget-wrapper {
|
|
6871
|
+
width: 100%;
|
|
6872
|
+
}
|
|
6870
6873
|
/* Левая часть */
|
|
6871
6874
|
#wine-widget-left {
|
|
6872
6875
|
flex: 0 0 40%;
|
|
@@ -6884,6 +6887,7 @@ const Ra = `
|
|
|
6884
6887
|
display: grid;
|
|
6885
6888
|
grid-template-columns: repeat(2, 1fr);
|
|
6886
6889
|
gap: 24px;
|
|
6890
|
+
min-height: 300px;
|
|
6887
6891
|
}
|
|
6888
6892
|
|
|
6889
6893
|
/* Заголовок */
|
|
@@ -6892,12 +6896,14 @@ const Ra = `
|
|
|
6892
6896
|
font-weight: bold;
|
|
6893
6897
|
margin: 0;
|
|
6894
6898
|
color: #333;
|
|
6899
|
+
text-align: center;
|
|
6895
6900
|
}
|
|
6896
6901
|
|
|
6897
6902
|
#wine-widget-header p {
|
|
6898
6903
|
font-size: 16px;
|
|
6899
6904
|
color: #666;
|
|
6900
6905
|
margin-top: 8px;
|
|
6906
|
+
text-align: center;
|
|
6901
6907
|
}
|
|
6902
6908
|
|
|
6903
6909
|
/* Поле ввода */
|
|
@@ -6907,6 +6913,19 @@ const Ra = `
|
|
|
6907
6913
|
align-items: center;
|
|
6908
6914
|
margin: 12px 0;
|
|
6909
6915
|
}
|
|
6916
|
+
#wine-search-input::placeholder {
|
|
6917
|
+
opacity: 1;
|
|
6918
|
+
color: #7B2BEB; /* Фиолетовый цвет для текста placeholder */
|
|
6919
|
+
font-style: normal;
|
|
6920
|
+
transition: color 0.3s ease, opacity 0.3s ease-in-out;
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6923
|
+
/* При активном фокусе инпута */
|
|
6924
|
+
#wine-search-input:focus::placeholder {
|
|
6925
|
+
opacity: 0.5; /* Полупрозрачный эффект */
|
|
6926
|
+
color: linear-gradient(90deg, #7B2BEB, #0044FF); /* Более светлый фиолетовый */
|
|
6927
|
+
font-style: normal;
|
|
6928
|
+
}
|
|
6910
6929
|
|
|
6911
6930
|
#wine-search-input {
|
|
6912
6931
|
flex: 1;
|
|
@@ -7260,7 +7279,7 @@ const Fa = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely",
|
|
|
7260
7279
|
class Ft {
|
|
7261
7280
|
constructor(e) {
|
|
7262
7281
|
var s;
|
|
7263
|
-
this.baseURL = "
|
|
7282
|
+
this.baseURL = "https://wineater-backend.vercel.app/", this.store = Fa.find((n) => window.location.href.includes(n)), this.token = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.CLIENT_TOKEN) || Aa;
|
|
7264
7283
|
}
|
|
7265
7284
|
async getStoreConfig(e) {
|
|
7266
7285
|
console.log(e);
|
|
@@ -7397,7 +7416,12 @@ class Da {
|
|
|
7397
7416
|
barSendButton: "Envoyer",
|
|
7398
7417
|
barResetButton: "Réinitialiser",
|
|
7399
7418
|
barName: "Nom du bar",
|
|
7400
|
-
barNotesPlaceholder: "Entrez vos souhaits ici..."
|
|
7419
|
+
barNotesPlaceholder: "Entrez vos souhaits ici...",
|
|
7420
|
+
placeholderSuggestions: [
|
|
7421
|
+
"Vin pour les pâtes",
|
|
7422
|
+
"Parfait avec du poisson",
|
|
7423
|
+
"Recommandé pour une soirée"
|
|
7424
|
+
]
|
|
7401
7425
|
},
|
|
7402
7426
|
es: {
|
|
7403
7427
|
welcomeMessage: "¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",
|
|
@@ -7438,7 +7462,12 @@ class Da {
|
|
|
7438
7462
|
barSendButton: "Enviar",
|
|
7439
7463
|
barResetButton: "Reiniciar",
|
|
7440
7464
|
barName: "Nombre del bar",
|
|
7441
|
-
barNotesPlaceholder: "Agrega tus comentarios aquí..."
|
|
7465
|
+
barNotesPlaceholder: "Agrega tus comentarios aquí...",
|
|
7466
|
+
placeholderSuggestions: [
|
|
7467
|
+
"Vino para pasta",
|
|
7468
|
+
"Perfecto con pescado",
|
|
7469
|
+
"Recomendado para una fiesta"
|
|
7470
|
+
]
|
|
7442
7471
|
},
|
|
7443
7472
|
en: {
|
|
7444
7473
|
welcomeMessage: "What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",
|
|
@@ -7479,7 +7508,12 @@ class Da {
|
|
|
7479
7508
|
barSendButton: "Send",
|
|
7480
7509
|
barResetButton: "Reset",
|
|
7481
7510
|
barName: "Bar Name",
|
|
7482
|
-
barNotesPlaceholder: "Add your wishes here..."
|
|
7511
|
+
barNotesPlaceholder: "Add your wishes here...",
|
|
7512
|
+
placeholderSuggestions: [
|
|
7513
|
+
"Wine for pasta",
|
|
7514
|
+
"Perfect with fish",
|
|
7515
|
+
"Recommended for a party"
|
|
7516
|
+
]
|
|
7483
7517
|
},
|
|
7484
7518
|
de: {
|
|
7485
7519
|
welcomeMessage: "Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",
|
|
@@ -7535,7 +7569,7 @@ class Da {
|
|
|
7535
7569
|
return this.translations[this.language][e] || e;
|
|
7536
7570
|
}
|
|
7537
7571
|
}
|
|
7538
|
-
const
|
|
7572
|
+
const Y = new Da(), us = {
|
|
7539
7573
|
barName: "LENEZ",
|
|
7540
7574
|
dishGroups: [
|
|
7541
7575
|
{
|
|
@@ -7594,58 +7628,22 @@ class La {
|
|
|
7594
7628
|
price: null,
|
|
7595
7629
|
color: null,
|
|
7596
7630
|
intensity: null
|
|
7597
|
-
}, this.widgetType === "bar" ? (this.barName =
|
|
7631
|
+
}, this.widgetType === "bar" ? (this.barName = us.barName, this.barDishes = us.dishes) : (this.barName = "", this.barDishes = []), this.initializeWidget(), this.initializeSearchAnimation(), this.widgetType === "store" && this.loadInstantRecommendations();
|
|
7598
7632
|
}
|
|
7599
7633
|
initializeWidget() {
|
|
7600
7634
|
const e = document.getElementById("wineater-widget-conteiner");
|
|
7601
7635
|
if (this.widgetType === "store") {
|
|
7602
7636
|
const s = `
|
|
7603
7637
|
<div id="wine-widget-container">
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
<h1>${
|
|
7607
|
-
<p>${
|
|
7638
|
+
<div class="wine-widget-wrapper">
|
|
7639
|
+
<div id="wine-widget-header">
|
|
7640
|
+
<h1>${Y.translate("widgetTitle")}</h1>
|
|
7641
|
+
<p>${Y.translate("widgetSubtitle")}</p>
|
|
7608
7642
|
</div>
|
|
7609
7643
|
<div id="wine-widget-search">
|
|
7610
|
-
<input type="text" id="wine-search-input" placeholder="${
|
|
7611
|
-
<button id="wine-search-button">${
|
|
7612
|
-
</div>
|
|
7613
|
-
<div id="wine-widget-filters">
|
|
7614
|
-
<div class="filter-group">
|
|
7615
|
-
<span class="filter-label">${H.translate("priceRange")}:</span>
|
|
7616
|
-
<div class="filter-buttons" id="price-buttons">
|
|
7617
|
-
<button data-value="< 500">< $500</button>
|
|
7618
|
-
<button data-value="500 - 1000">$500 - $1000</button>
|
|
7619
|
-
<button data-value="> 1000">> $1000</button>
|
|
7620
|
-
<button data-value=" " class="selected">Any</button>
|
|
7621
|
-
</div>
|
|
7622
|
-
</div>
|
|
7623
|
-
<div class="filter-group">
|
|
7624
|
-
<span class="filter-label">${H.translate("wineColor")}:</span>
|
|
7625
|
-
<div class="filter-buttons" id="color-buttons">
|
|
7626
|
-
<button data-value="red">${H.translate("red")}</button>
|
|
7627
|
-
<button data-value="white">${H.translate("white")}</button>
|
|
7628
|
-
<button data-value="rose">${H.translate("rose")}</button>
|
|
7629
|
-
<button data-value=" " class="selected">${H.translate("Any")}</button>
|
|
7630
|
-
</div>
|
|
7631
|
-
</div>
|
|
7632
|
-
<div class="filter-group">
|
|
7633
|
-
<span class="filter-label">${H.translate("intensity")}:</span>
|
|
7634
|
-
<div class="filter-buttons" id="intensity-buttons">
|
|
7635
|
-
<button data-value="light">${H.translate("light")}</button>
|
|
7636
|
-
<button data-value="medium">${H.translate("medium")}</button>
|
|
7637
|
-
<button data-value="full">${H.translate("full")}</button>
|
|
7638
|
-
<button data-value=" " class="selected">${H.translate("Any")}</button>
|
|
7639
|
-
</div>
|
|
7640
|
-
</div>
|
|
7644
|
+
<input type="text" id="wine-search-input" placeholder="${Y.translate("searchPlaceholder")}">
|
|
7645
|
+
<button id="wine-search-button">${Y.translate("searchButton")}</button>
|
|
7641
7646
|
</div>
|
|
7642
|
-
<div id="powered-by-widget">
|
|
7643
|
-
<a href="https://wineater.com" target="_blank">
|
|
7644
|
-
<span>${H.translate("poweredBy")}</span>
|
|
7645
|
-
<img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo.svg" alt="Wineater Logo">
|
|
7646
|
-
</a>
|
|
7647
|
-
</div>
|
|
7648
|
-
</div>
|
|
7649
7647
|
<div id="wine-widget-right">
|
|
7650
7648
|
<div id="loading-indicator" class="hidden">
|
|
7651
7649
|
<div id="typing-indicator" class="typing-indicator">
|
|
@@ -7654,6 +7652,13 @@ class La {
|
|
|
7654
7652
|
</div>
|
|
7655
7653
|
<div id="wine-placeholder"></div>
|
|
7656
7654
|
</div>
|
|
7655
|
+
<div id="powered-by-widget">
|
|
7656
|
+
<a href="https://wineater.com" target="_blank">
|
|
7657
|
+
<span>${Y.translate("poweredBy")}</span>
|
|
7658
|
+
<img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo.svg" alt="Wineater Logo">
|
|
7659
|
+
</a>
|
|
7660
|
+
</div>
|
|
7661
|
+
</div>
|
|
7657
7662
|
</div>
|
|
7658
7663
|
`;
|
|
7659
7664
|
e.insertAdjacentHTML("beforeend", s), this.addEventListenersStoreVersion();
|
|
@@ -7661,7 +7666,7 @@ class La {
|
|
|
7661
7666
|
const s = `
|
|
7662
7667
|
<div id="wine-widget-container">
|
|
7663
7668
|
<div id="wine-widget-right">
|
|
7664
|
-
${
|
|
7669
|
+
${us.dishGroups.map((n) => `
|
|
7665
7670
|
<!-- Обёртка группы -->
|
|
7666
7671
|
<div class="dish-group">
|
|
7667
7672
|
<!-- Заголовок группы, если нужен -->
|
|
@@ -7689,13 +7694,13 @@ class La {
|
|
|
7689
7694
|
<input
|
|
7690
7695
|
type="text"
|
|
7691
7696
|
id="bar-notes-input"
|
|
7692
|
-
placeholder="${
|
|
7697
|
+
placeholder="${Y.translate("barNotesPlaceholder")}"
|
|
7693
7698
|
/>
|
|
7694
7699
|
<button id="bar-send-button">
|
|
7695
|
-
${
|
|
7700
|
+
${Y.translate("barSendButton")}
|
|
7696
7701
|
</button>
|
|
7697
7702
|
<button id="bar-reset-button" class="hidden">
|
|
7698
|
-
${
|
|
7703
|
+
${Y.translate("barResetButton")}
|
|
7699
7704
|
</button>
|
|
7700
7705
|
</div>
|
|
7701
7706
|
|
|
@@ -7704,6 +7709,7 @@ class La {
|
|
|
7704
7709
|
`;
|
|
7705
7710
|
e.insertAdjacentHTML("beforeend", s), this.addEventListenersBarVersion();
|
|
7706
7711
|
}
|
|
7712
|
+
this.initializeSearchAnimation();
|
|
7707
7713
|
}
|
|
7708
7714
|
addEventListenersStoreVersion() {
|
|
7709
7715
|
document.getElementById("wine-search-button").addEventListener("click", () => this.handleSearch()), this.setupFilterButtons("price-buttons", "price"), this.setupFilterButtons("color-buttons", "color"), this.setupFilterButtons("intensity-buttons", "intensity"), document.getElementById("wine-search-input").addEventListener("keydown", (e) => {
|
|
@@ -7773,7 +7779,7 @@ class La {
|
|
|
7773
7779
|
const e = document.getElementById("wine-placeholder");
|
|
7774
7780
|
e.innerHTML = `
|
|
7775
7781
|
<div class="no-results">
|
|
7776
|
-
<p>${
|
|
7782
|
+
<p>${Y.translate("noResultsMessage") || "No recommendations found for your query."}</p>
|
|
7777
7783
|
</div>
|
|
7778
7784
|
`;
|
|
7779
7785
|
}
|
|
@@ -7781,7 +7787,7 @@ class La {
|
|
|
7781
7787
|
const e = document.getElementById("wine-placeholder");
|
|
7782
7788
|
e.innerHTML = `
|
|
7783
7789
|
<div class="error-message">
|
|
7784
|
-
<p>${
|
|
7790
|
+
<p>${Y.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
|
|
7785
7791
|
</div>
|
|
7786
7792
|
`;
|
|
7787
7793
|
}
|
|
@@ -7803,20 +7809,20 @@ class La {
|
|
|
7803
7809
|
});
|
|
7804
7810
|
const s = document.querySelectorAll(".dish-group"), n = document.getElementById("bar-send-button"), i = document.getElementById("bar-reset-button"), r = document.getElementById("bar-notes-input"), o = document.getElementById("wine-placeholder");
|
|
7805
7811
|
!n || !i || !r || !o || (n.addEventListener("click", async () => {
|
|
7806
|
-
s.forEach((
|
|
7812
|
+
s.forEach((u) => u.classList.add("hidden")), this.showLoadingIndicator();
|
|
7807
7813
|
const l = [];
|
|
7808
|
-
document.querySelectorAll(".dish-tile.selected").forEach((
|
|
7809
|
-
l.push(
|
|
7814
|
+
document.querySelectorAll(".dish-tile.selected").forEach((u) => {
|
|
7815
|
+
l.push(u.dataset.dish);
|
|
7810
7816
|
});
|
|
7811
7817
|
const a = r.value.trim(), h = [];
|
|
7812
7818
|
l.length > 0 && h.push(`Dishes: ${l.join(", ")}`), a && h.push(`Notes: ${a}`);
|
|
7813
7819
|
const c = h.join("; ");
|
|
7814
7820
|
console.log("Final query =>", c);
|
|
7815
7821
|
try {
|
|
7816
|
-
const
|
|
7817
|
-
|
|
7818
|
-
} catch (
|
|
7819
|
-
console.error("Error while fetching bar recommendations:",
|
|
7822
|
+
const u = await this.api.getWineRecommendationsSearch(c);
|
|
7823
|
+
u && u.length > 0 ? this.displayResults(u, !0) : this.displayNoResultsMessage(), i.classList.remove("hidden");
|
|
7824
|
+
} catch (u) {
|
|
7825
|
+
console.error("Error while fetching bar recommendations:", u), this.displayErrorMessage();
|
|
7820
7826
|
} finally {
|
|
7821
7827
|
this.hideLoadingIndicator();
|
|
7822
7828
|
}
|
|
@@ -7824,12 +7830,24 @@ class La {
|
|
|
7824
7830
|
s.forEach((l) => l.classList.remove("hidden")), e.forEach((l) => l.classList.remove("selected")), o.innerHTML = "", i.classList.add("hidden"), r.value = "";
|
|
7825
7831
|
}));
|
|
7826
7832
|
}
|
|
7833
|
+
initializeSearchAnimation() {
|
|
7834
|
+
const e = document.getElementById("wine-search-input"), s = Y.translate("placeholderSuggestions");
|
|
7835
|
+
let n = 0, i = 0, r = !0, o = !1;
|
|
7836
|
+
const l = () => {
|
|
7837
|
+
o || (r ? (e.placeholder = s[n].substring(0, i++), i > s[n].length ? (r = !1, setTimeout(l, 2e3)) : setTimeout(l, 100)) : (e.placeholder = s[n].substring(0, i--), i < 0 ? (r = !0, n = (n + 1) % s.length, setTimeout(l, 500)) : setTimeout(l, 50)));
|
|
7838
|
+
};
|
|
7839
|
+
l(), e.addEventListener("focus", () => {
|
|
7840
|
+
e.placeholder = "", o = !0;
|
|
7841
|
+
}), e.addEventListener("blur", () => {
|
|
7842
|
+
o = !1, i = 0, r = !0, l();
|
|
7843
|
+
});
|
|
7844
|
+
}
|
|
7827
7845
|
}
|
|
7828
7846
|
class Ma {
|
|
7829
7847
|
constructor() {
|
|
7830
7848
|
var s;
|
|
7831
7849
|
this.api = new Ft();
|
|
7832
|
-
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) ||
|
|
7850
|
+
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) || Y.translate("welcomeMessage");
|
|
7833
7851
|
this.displayFirstMessage(e);
|
|
7834
7852
|
}
|
|
7835
7853
|
initialize() {
|
|
@@ -7850,7 +7868,7 @@ class Ma {
|
|
|
7850
7868
|
const n = await this.api.getWineRecommendations(s);
|
|
7851
7869
|
this.hideTypingIndicator(), n && n.length ? this.displayResults(n) : this.displayMessage("No results found.", "api");
|
|
7852
7870
|
} catch {
|
|
7853
|
-
this.hideTypingIndicator(), this.displayMessage(
|
|
7871
|
+
this.hideTypingIndicator(), this.displayMessage(Y.translate("somethingWentWrong"), "api");
|
|
7854
7872
|
}
|
|
7855
7873
|
}
|
|
7856
7874
|
}
|
|
@@ -7880,10 +7898,10 @@ class Ma {
|
|
|
7880
7898
|
const l = document.createElement("div");
|
|
7881
7899
|
l.innerHTML = `
|
|
7882
7900
|
<strong>${n.Title}</strong><br>
|
|
7883
|
-
${
|
|
7884
|
-
${
|
|
7885
|
-
${
|
|
7886
|
-
<a href="${n.Url}" target="_blank">${
|
|
7901
|
+
${Y.translate("price")}: ${n.Price}<br>
|
|
7902
|
+
${Y.translate("region")}: ${n.Region}<br>
|
|
7903
|
+
${Y.translate("type")}: ${n.Type}<br>
|
|
7904
|
+
<a href="${n.Url}" target="_blank">${Y.translate("moreInfo")}</a>
|
|
7887
7905
|
`, l.querySelector("a").addEventListener("click", (c) => {
|
|
7888
7906
|
c.preventDefault(), this.sendAnalytics(n.Title), window.open(n.Url, "_blank");
|
|
7889
7907
|
}), r.appendChild(l);
|
|
@@ -7971,7 +7989,7 @@ class qa {
|
|
|
7971
7989
|
}
|
|
7972
7990
|
async initTranslator() {
|
|
7973
7991
|
const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Test";
|
|
7974
|
-
await
|
|
7992
|
+
await Y.fetchConfig(e || "Test");
|
|
7975
7993
|
}
|
|
7976
7994
|
initCookies() {
|
|
7977
7995
|
var e;
|
|
@@ -7986,12 +8004,12 @@ class qa {
|
|
|
7986
8004
|
<div id="chatbot-container">
|
|
7987
8005
|
<div id="chat-icon">
|
|
7988
8006
|
<img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/chat-icon.svg" alt="Chat Icon">
|
|
7989
|
-
<span>${((i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.BUTTON_TEXT) ||
|
|
8007
|
+
<span>${((i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.BUTTON_TEXT) || Y.translate(`chatButton${e}`)}</span>
|
|
7990
8008
|
</div>
|
|
7991
8009
|
<div id="chat-window" class="hidden">
|
|
7992
8010
|
<div id="chat-header">
|
|
7993
8011
|
<div id="chat-title">
|
|
7994
|
-
<h1>${
|
|
8012
|
+
<h1>${Y.translate("chatTitle")}</h1>
|
|
7995
8013
|
</div>
|
|
7996
8014
|
<div id="close-btn">×</div>
|
|
7997
8015
|
</div>
|
|
@@ -8000,12 +8018,12 @@ class qa {
|
|
|
8000
8018
|
<span></span><span></span><span></span>
|
|
8001
8019
|
</div>
|
|
8002
8020
|
<div id="input-container">
|
|
8003
|
-
<input type="text" id="user-input" placeholder="${
|
|
8004
|
-
<button id="send-button">${
|
|
8021
|
+
<input type="text" id="user-input" placeholder="${Y.translate("inputPlaceholder")}">
|
|
8022
|
+
<button id="send-button">${Y.translate("sendButton")}</button>
|
|
8005
8023
|
</div>
|
|
8006
8024
|
<div id="powered-by">
|
|
8007
8025
|
<a href="https://wineater.com" target="_blank">
|
|
8008
|
-
<span>${
|
|
8026
|
+
<span>${Y.translate("poweredBy")}</span>
|
|
8009
8027
|
<img src="https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo.svg" alt="Wineater Logo" id="chatbot-logo">
|
|
8010
8028
|
</a>
|
|
8011
8029
|
</div>
|