wineater-bot 3.1.4 → 3.1.6
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 +432 -414
- package/dist/wineater-chatbot.umd.js +1 -1
- package/index.html +3 -3
- package/package.json +1 -1
- package/src/js/i18n.js +18 -0
- package/src/js/widget-styles.js +1 -1
|
@@ -728,33 +728,33 @@ var pn = { exports: {} };
|
|
|
728
728
|
return null;
|
|
729
729
|
}
|
|
730
730
|
}, getItem: function(b, f) {
|
|
731
|
-
var
|
|
731
|
+
var h = this;
|
|
732
732
|
return new Promise(function(m, g) {
|
|
733
733
|
try {
|
|
734
|
-
var w =
|
|
734
|
+
var w = h.getItemSync(b);
|
|
735
735
|
f == null || f(null, w), m(w);
|
|
736
736
|
} catch (x) {
|
|
737
737
|
f && f(x, null), g(x);
|
|
738
738
|
}
|
|
739
739
|
});
|
|
740
|
-
}, setItem: function(b, f,
|
|
740
|
+
}, setItem: function(b, f, h) {
|
|
741
741
|
return new Promise(function(m, g) {
|
|
742
742
|
try {
|
|
743
|
-
localStorage.setItem(b, f),
|
|
743
|
+
localStorage.setItem(b, f), h && h(null, f), m(f);
|
|
744
744
|
} catch (w) {
|
|
745
|
-
|
|
745
|
+
h && h(w, null), g(w);
|
|
746
746
|
}
|
|
747
747
|
});
|
|
748
748
|
} }, i = function() {
|
|
749
749
|
return i = Object.assign || function(b) {
|
|
750
|
-
for (var f,
|
|
751
|
-
for (var g in f = arguments[
|
|
750
|
+
for (var f, h = 1, m = arguments.length; h < m; h++)
|
|
751
|
+
for (var g in f = arguments[h])
|
|
752
752
|
Object.prototype.hasOwnProperty.call(f, g) && (b[g] = f[g]);
|
|
753
753
|
return b;
|
|
754
754
|
}, i.apply(this, arguments);
|
|
755
755
|
};
|
|
756
|
-
function r(b, f,
|
|
757
|
-
return new (
|
|
756
|
+
function r(b, f, h, m) {
|
|
757
|
+
return new (h || (h = Promise))(function(g, w) {
|
|
758
758
|
function x(H) {
|
|
759
759
|
try {
|
|
760
760
|
M(m.next(H));
|
|
@@ -771,7 +771,7 @@ var pn = { exports: {} };
|
|
|
771
771
|
}
|
|
772
772
|
function M(H) {
|
|
773
773
|
var _;
|
|
774
|
-
H.done ? g(H.value) : (_ = H.value, _ instanceof
|
|
774
|
+
H.done ? g(H.value) : (_ = H.value, _ instanceof h ? _ : new h(function(W) {
|
|
775
775
|
W(_);
|
|
776
776
|
})).then(x, R);
|
|
777
777
|
}
|
|
@@ -779,7 +779,7 @@ var pn = { exports: {} };
|
|
|
779
779
|
});
|
|
780
780
|
}
|
|
781
781
|
function o(b, f) {
|
|
782
|
-
var
|
|
782
|
+
var h, m, g, w, x = { label: 0, sent: function() {
|
|
783
783
|
if (1 & g[0])
|
|
784
784
|
throw g[1];
|
|
785
785
|
return g[1];
|
|
@@ -790,11 +790,11 @@ var pn = { exports: {} };
|
|
|
790
790
|
function R(M) {
|
|
791
791
|
return function(H) {
|
|
792
792
|
return function(_) {
|
|
793
|
-
if (
|
|
793
|
+
if (h)
|
|
794
794
|
throw new TypeError("Generator is already executing.");
|
|
795
795
|
for (; x; )
|
|
796
796
|
try {
|
|
797
|
-
if (
|
|
797
|
+
if (h = 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)
|
|
798
798
|
return g;
|
|
799
799
|
switch (m = 0, g && (_ = [2 & _[0], g.value]), _[0]) {
|
|
800
800
|
case 0:
|
|
@@ -833,7 +833,7 @@ var pn = { exports: {} };
|
|
|
833
833
|
} catch (W) {
|
|
834
834
|
_ = [6, W], m = 0;
|
|
835
835
|
} finally {
|
|
836
|
-
|
|
836
|
+
h = g = 0;
|
|
837
837
|
}
|
|
838
838
|
if (5 & _[0])
|
|
839
839
|
throw _[1];
|
|
@@ -842,68 +842,68 @@ var pn = { exports: {} };
|
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
function l(b, f,
|
|
846
|
-
if (
|
|
845
|
+
function l(b, f, h) {
|
|
846
|
+
if (h || arguments.length === 2)
|
|
847
847
|
for (var m, g = 0, w = f.length; g < w; g++)
|
|
848
848
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
849
849
|
return b.concat(m || Array.prototype.slice.call(f));
|
|
850
850
|
}
|
|
851
|
-
var a = function b(f,
|
|
852
|
-
if (f ===
|
|
851
|
+
var a = function b(f, h) {
|
|
852
|
+
if (f === h)
|
|
853
853
|
return !0;
|
|
854
|
-
if (f &&
|
|
855
|
-
if (f.constructor !==
|
|
854
|
+
if (f && h && typeof f == "object" && typeof h == "object") {
|
|
855
|
+
if (f.constructor !== h.constructor)
|
|
856
856
|
return !1;
|
|
857
857
|
var m, g, w;
|
|
858
858
|
if (Array.isArray(f)) {
|
|
859
|
-
if ((m = f.length) !=
|
|
859
|
+
if ((m = f.length) != h.length)
|
|
860
860
|
return !1;
|
|
861
861
|
for (g = m; g-- != 0; )
|
|
862
|
-
if (!b(f[g],
|
|
862
|
+
if (!b(f[g], h[g]))
|
|
863
863
|
return !1;
|
|
864
864
|
return !0;
|
|
865
865
|
}
|
|
866
866
|
if (f.constructor === RegExp)
|
|
867
|
-
return f.source ===
|
|
867
|
+
return f.source === h.source && f.flags === h.flags;
|
|
868
868
|
if (f.valueOf !== Object.prototype.valueOf)
|
|
869
|
-
return f.valueOf() ===
|
|
869
|
+
return f.valueOf() === h.valueOf();
|
|
870
870
|
if (f.toString !== Object.prototype.toString)
|
|
871
|
-
return f.toString() ===
|
|
872
|
-
if ((m = (w = Object.keys(f)).length) !== Object.keys(
|
|
871
|
+
return f.toString() === h.toString();
|
|
872
|
+
if ((m = (w = Object.keys(f)).length) !== Object.keys(h).length)
|
|
873
873
|
return !1;
|
|
874
874
|
for (g = m; g-- != 0; )
|
|
875
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
875
|
+
if (!Object.prototype.hasOwnProperty.call(h, w[g]))
|
|
876
876
|
return !1;
|
|
877
877
|
for (g = m; g-- != 0; ) {
|
|
878
878
|
var x = w[g];
|
|
879
|
-
if (!b(f[x],
|
|
879
|
+
if (!b(f[x], h[x]))
|
|
880
880
|
return !1;
|
|
881
881
|
}
|
|
882
882
|
return !0;
|
|
883
883
|
}
|
|
884
|
-
return f != f &&
|
|
884
|
+
return f != f && h != h;
|
|
885
885
|
};
|
|
886
|
-
function
|
|
887
|
-
var
|
|
886
|
+
function d(b, f) {
|
|
887
|
+
var h = Object.keys(f || {}).filter(function(m) {
|
|
888
888
|
var g = b == null ? void 0 : b[m], w = f == null ? void 0 : f[m];
|
|
889
889
|
return !a(g, w);
|
|
890
890
|
});
|
|
891
891
|
return Object.keys(b || {}).filter(function(m) {
|
|
892
|
-
Object.keys(f || {}).includes(m) ||
|
|
893
|
-
}), Object.keys(
|
|
892
|
+
Object.keys(f || {}).includes(m) || h.push(m);
|
|
893
|
+
}), Object.keys(h).length ? h : null;
|
|
894
894
|
}
|
|
895
895
|
var c, u;
|
|
896
|
-
function p(b, f,
|
|
896
|
+
function p(b, f, h) {
|
|
897
897
|
var m = "shortString", g = !0;
|
|
898
|
-
typeof
|
|
898
|
+
typeof h == "number" && (m = "javaDouble", g = !1), b[m] = b[m] || {}, b[m][f] = g ? h + "" : h;
|
|
899
899
|
}
|
|
900
900
|
function y(b) {
|
|
901
901
|
return !!b && typeof b == "object" && b.value !== void 0;
|
|
902
902
|
}
|
|
903
903
|
function S(b) {
|
|
904
904
|
return Object.fromEntries(Object.entries(b).map(function(f) {
|
|
905
|
-
var
|
|
906
|
-
return [
|
|
905
|
+
var h = f[0], m = f[1];
|
|
906
|
+
return [h, y(m) ? m : { value: m }];
|
|
907
907
|
}));
|
|
908
908
|
}
|
|
909
909
|
function v(b) {
|
|
@@ -914,122 +914,122 @@ var pn = { exports: {} };
|
|
|
914
914
|
})(c || (c = {}));
|
|
915
915
|
var T, A = null, B = "BULLET_TRAIN_DB", D = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", O = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
|
|
916
916
|
function b(f) {
|
|
917
|
-
var
|
|
917
|
+
var h = this;
|
|
918
918
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
919
|
-
var m =
|
|
920
|
-
|
|
921
|
-
var x = "".concat(
|
|
919
|
+
var m = h, g = m.api, w = m.evaluationContext;
|
|
920
|
+
h.log("Get Flags"), h.isLoading = !0, h.loadingState.isFetching || h.setLoadingState(i(i({}, h.loadingState), { isFetching: !0 }));
|
|
921
|
+
var x = "".concat(h.getContext().identity), R = function(M) {
|
|
922
922
|
var H, _, W, ee;
|
|
923
|
-
if (M && x === "".concat(
|
|
923
|
+
if (M && x === "".concat(h.getContext().identity)) {
|
|
924
924
|
var ae = M.flags, te = M.traits, ne = M.identifier;
|
|
925
|
-
|
|
925
|
+
h.isLoading = !1;
|
|
926
926
|
var ce = {}, le = {};
|
|
927
927
|
te = te || [], (ae = ae || []).forEach(function(X) {
|
|
928
928
|
ce[X.feature.name.toLowerCase().replace(/ /g, "_")] = { id: X.feature.id, enabled: X.enabled, value: X.feature_state_value };
|
|
929
929
|
}), te.forEach(function(X) {
|
|
930
930
|
le[X.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: X.transient, value: X.trait_value };
|
|
931
|
-
}),
|
|
932
|
-
var me = h
|
|
933
|
-
if ((ne || Object.keys(le).length) && (
|
|
931
|
+
}), h.oldFlags = i({}, h.flags);
|
|
932
|
+
var me = d(h.oldFlags, ce), Ke = d((H = h.evaluationContext.identity) === null || H === void 0 ? void 0 : H.traits, le);
|
|
933
|
+
if ((ne || Object.keys(le).length) && (h.evaluationContext.identity = { traits: le }, ne && (h.evaluationContext.identity.identifier = ne)), h.flags = ce, h.updateStorage(), h._onChange(h.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: Ke }, h._loadedState(null, c.SERVER)), h.datadogRum)
|
|
934
934
|
try {
|
|
935
|
-
if (
|
|
935
|
+
if (h.datadogRum.trackTraits) {
|
|
936
936
|
var Xe = {};
|
|
937
|
-
Object.keys(((_ =
|
|
938
|
-
Xe[L + X] =
|
|
937
|
+
Object.keys(((_ = h.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(X) {
|
|
938
|
+
Xe[L + X] = h.getTrait(X);
|
|
939
939
|
});
|
|
940
|
-
var Fe = i(i(i({},
|
|
941
|
-
|
|
940
|
+
var Fe = i(i(i({}, h.datadogRum.client.getUser()), { id: h.datadogRum.client.getUser().id || ((W = h.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Xe);
|
|
941
|
+
h.log("Setting Datadog user", Fe), h.datadogRum.client.setUser(Fe);
|
|
942
942
|
}
|
|
943
943
|
} catch (X) {
|
|
944
944
|
console.error(X);
|
|
945
945
|
}
|
|
946
|
-
if (
|
|
946
|
+
if (h.dtrum)
|
|
947
947
|
try {
|
|
948
948
|
var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
949
|
-
Object.keys(
|
|
950
|
-
p(se, N + X,
|
|
951
|
-
}), Object.keys(((ee =
|
|
952
|
-
p(se, L + X,
|
|
953
|
-
}),
|
|
949
|
+
Object.keys(h.flags).map(function(X) {
|
|
950
|
+
p(se, N + X, h.getValue(X, { skipAnalytics: !0 })), p(se, O + X, h.hasFeature(X, { skipAnalytics: !0 }));
|
|
951
|
+
}), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(X) {
|
|
952
|
+
p(se, L + X, h.getTrait(X));
|
|
953
|
+
}), h.log("Sending javaLongOrObject traits to dynatrace", se.javaLongOrObject), h.log("Sending date traits to dynatrace", se.date), h.log("Sending shortString traits to dynatrace", se.shortString), h.log("Sending javaDouble to dynatrace", se.javaDouble), h.dtrum.sendSessionProperties(se.javaLongOrObject, se.date, se.shortString, se.javaDouble);
|
|
954
954
|
} catch (X) {
|
|
955
955
|
console.error(X);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
};
|
|
959
|
-
return w.identity ? Promise.all([w.identity.traits && Object.keys(w.identity.traits).length || !w.identity.identifier ?
|
|
959
|
+
return w.identity ? Promise.all([w.identity.traits && Object.keys(w.identity.traits).length || !w.identity.identifier ? h.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: w.identity.identifier, transient: w.identity.transient, traits: Object.entries(w.identity.traits).map(function(M) {
|
|
960
960
|
var H = M[0], _ = M[1];
|
|
961
961
|
return { trait_key: H, trait_value: _ == null ? void 0 : _.value, transient: _ == null ? void 0 : _.transient };
|
|
962
962
|
}).filter(function(M) {
|
|
963
|
-
return M.trait_value !== void 0 || (
|
|
964
|
-
}) })) :
|
|
965
|
-
return
|
|
963
|
+
return M.trait_value !== void 0 || (h.log("Warning - attempted to set an undefined trait value for key", M.trait_key), !1);
|
|
964
|
+
}) })) : h.getJSON(g + "identities/?identifier=" + encodeURIComponent(w.identity.identifier) + (w.identity.transient ? "&transient=true" : ""))]).then(function(M) {
|
|
965
|
+
return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), R(M == null ? void 0 : M[0]);
|
|
966
966
|
}).catch(function(M) {
|
|
967
967
|
var H = M.message, _ = new Error(H);
|
|
968
968
|
return Promise.reject(_);
|
|
969
|
-
}) :
|
|
969
|
+
}) : h.getJSON(g + "flags/").then(function(M) {
|
|
970
970
|
return R({ flags: M, traits: void 0 });
|
|
971
971
|
});
|
|
972
972
|
}, this.analyticsFlags = function() {
|
|
973
|
-
var m =
|
|
974
|
-
if (
|
|
975
|
-
return
|
|
976
|
-
if (
|
|
977
|
-
var w =
|
|
978
|
-
|
|
973
|
+
var m = h.api;
|
|
974
|
+
if (h.evaluationEvent && h.evaluationContext.environment && h.evaluationEvent[h.evaluationContext.environment.apiKey])
|
|
975
|
+
return h.evaluationEvent && Object.getOwnPropertyNames(h.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(h.evaluationEvent[h.evaluationContext.environment.apiKey]).length !== 0 ? h.getJSON(m + "analytics/flags/", "POST", JSON.stringify(h.evaluationEvent[h.evaluationContext.environment.apiKey])).then(function(g) {
|
|
976
|
+
if (h.evaluationContext.environment) {
|
|
977
|
+
var w = h.getState();
|
|
978
|
+
h.evaluationEvent || (h.evaluationEvent = {}), h.evaluationEvent[h.evaluationContext.environment.apiKey] = {}, h.setState(i(i({}, w), { evaluationEvent: h.evaluationEvent })), h.updateEventStorage();
|
|
979
979
|
}
|
|
980
980
|
}).catch(function(g) {
|
|
981
|
-
|
|
981
|
+
h.log("Exception fetching evaluationEvent", g);
|
|
982
982
|
}) : void 0;
|
|
983
983
|
}, 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) {
|
|
984
|
-
var x =
|
|
985
|
-
if (x && (R = x.value), g != null && g.skipAnalytics || w ||
|
|
984
|
+
var x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], R = null;
|
|
985
|
+
if (x && (R = x.value), g != null && g.skipAnalytics || w || h.evaluateFlag(m, "VALUE"), R === null && (g == null ? void 0 : g.fallback) !== void 0)
|
|
986
986
|
return g.fallback;
|
|
987
987
|
if (g != null && g.json)
|
|
988
988
|
try {
|
|
989
|
-
return R === null ? (
|
|
989
|
+
return R === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(R);
|
|
990
990
|
} catch {
|
|
991
991
|
return g.fallback;
|
|
992
992
|
}
|
|
993
993
|
return R;
|
|
994
994
|
}, this.getTrait = function(m) {
|
|
995
995
|
var g, w;
|
|
996
|
-
return ((g =
|
|
996
|
+
return ((g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((w = h.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || w === void 0 ? void 0 : w.value);
|
|
997
997
|
}, this.getAllTraits = function() {
|
|
998
998
|
var m;
|
|
999
|
-
return Object.fromEntries(Object.entries(((m =
|
|
999
|
+
return Object.fromEntries(Object.entries(((m = h.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
|
|
1000
1000
|
var w = g[0], x = g[1];
|
|
1001
1001
|
return [w, x == null ? void 0 : x.value];
|
|
1002
1002
|
}));
|
|
1003
1003
|
}, this.setContext = function(m) {
|
|
1004
1004
|
var g = v(m);
|
|
1005
|
-
return
|
|
1005
|
+
return h.evaluationContext = i(i({}, g), { environment: g.environment || h.evaluationContext.environment }), h.initialised ? h.getFlags() : Promise.resolve();
|
|
1006
1006
|
}, this.getContext = function() {
|
|
1007
|
-
return
|
|
1007
|
+
return h.evaluationContext;
|
|
1008
1008
|
}, this.updateContext = function(m) {
|
|
1009
|
-
return
|
|
1009
|
+
return h.setContext(i(i({}, h.getContext()), m));
|
|
1010
1010
|
}, this.setTrait = function(m, g) {
|
|
1011
1011
|
var w;
|
|
1012
|
-
if (
|
|
1013
|
-
return
|
|
1012
|
+
if (h.api)
|
|
1013
|
+
return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (w = h.evaluationContext.identity) === null || w === void 0 ? void 0 : w.traits), S(Object.fromEntries([[m, g]]))) }) }));
|
|
1014
1014
|
}, this.setTraits = function(m) {
|
|
1015
1015
|
var g;
|
|
1016
|
-
if (
|
|
1017
|
-
return
|
|
1016
|
+
if (h.api)
|
|
1017
|
+
return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(w) {
|
|
1018
1018
|
var x = w[0], R = w[1];
|
|
1019
1019
|
return [x, y(R) ? R : { value: R }];
|
|
1020
1020
|
}))) }) }));
|
|
1021
1021
|
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.");
|
|
1022
1022
|
}, this.hasFeature = function(m, g) {
|
|
1023
|
-
var w = typeof g == "object", x =
|
|
1024
|
-
return !x && w && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (w && !g.skipAnalytics || !g) &&
|
|
1023
|
+
var w = typeof g == "object", x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], R = !1;
|
|
1024
|
+
return !x && w && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (w && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), R;
|
|
1025
1025
|
}, this.getJSON = function(m, g, w) {
|
|
1026
|
-
var x, R =
|
|
1026
|
+
var x, R = h;
|
|
1027
1027
|
R.evaluationContext;
|
|
1028
1028
|
var M = R.headers, H = { method: g || "GET", body: w, cache: "no-cache", headers: {} };
|
|
1029
|
-
|
|
1030
|
-
var _ = "".concat((x =
|
|
1029
|
+
h.evaluationContext.environment && (H.headers["X-Environment-Key"] = h.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.");
|
|
1030
|
+
var _ = "".concat((x = h.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
|
|
1031
1031
|
return u(m, H).then(function(W) {
|
|
1032
|
-
var ee, ae, te = "".concat((ee =
|
|
1032
|
+
var ee, ae, te = "".concat((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.identifier);
|
|
1033
1033
|
if (_ === te) {
|
|
1034
1034
|
var ne = (ae = W.headers) === null || ae === void 0 ? void 0 : ae.get("x-flagsmith-document-updated-at");
|
|
1035
1035
|
if (ne)
|
|
@@ -1037,11 +1037,11 @@ var pn = { exports: {} };
|
|
|
1037
1037
|
var ce = parseFloat(ne);
|
|
1038
1038
|
if (isNaN(ce))
|
|
1039
1039
|
return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
1040
|
-
|
|
1040
|
+
h.timestamp = ce;
|
|
1041
1041
|
} catch (le) {
|
|
1042
|
-
|
|
1042
|
+
h.log(le, "Failed to parse x-flagsmith-document-updated-at", ne);
|
|
1043
1043
|
}
|
|
1044
|
-
return
|
|
1044
|
+
return h.log("Fetch response: " + W.status + " " + (g || "GET") + 0 + m), W.text().then(function(le) {
|
|
1045
1045
|
var me = le;
|
|
1046
1046
|
try {
|
|
1047
1047
|
me = JSON.parse(le);
|
|
@@ -1050,22 +1050,22 @@ var pn = { exports: {} };
|
|
|
1050
1050
|
return !me && W.status && (me = "API Response: ".concat(W.status)), W.status && W.status >= 200 && W.status < 300 ? me : Promise.reject(new Error(me));
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
|
|
1053
|
+
h.log("Received response with identity mismatch, ignoring response. Requested: ".concat(_, ", Current: ").concat(te));
|
|
1054
1054
|
});
|
|
1055
1055
|
}, this.evaluateFlag = function(m, g) {
|
|
1056
|
-
if (
|
|
1057
|
-
if (!
|
|
1056
|
+
if (h.datadogRum && (h.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? h.datadogRum.client.addFeatureFlagEvaluation(N + m, h.getValue(m, {}, !0)) : h.datadogRum.client.addFeatureFlagEvaluation(O + m, h.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), h.enableAnalytics) {
|
|
1057
|
+
if (!h.evaluationEvent || !h.evaluationContext.environment)
|
|
1058
1058
|
return;
|
|
1059
|
-
|
|
1059
|
+
h.evaluationEvent[h.evaluationContext.environment.apiKey] || (h.evaluationEvent[h.evaluationContext.environment.apiKey] = {}), h.evaluationEvent[h.evaluationContext.environment.apiKey][m] === void 0 && (h.evaluationEvent[h.evaluationContext.environment.apiKey][m] = 0), h.evaluationEvent[h.evaluationContext.environment.apiKey][m] += 1;
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1061
|
+
h.updateEventStorage();
|
|
1062
1062
|
}, this._onChange = function(m, g, w) {
|
|
1063
1063
|
var x, R;
|
|
1064
|
-
|
|
1064
|
+
h.setLoadingState(w), (x = h.onChange) === null || x === void 0 || x.call(h, m, g, h.loadingState), (R = h._trigger) === null || R === void 0 || R.call(h);
|
|
1065
1065
|
}, u = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : qe == null ? void 0 : qe.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (A = f.AsyncStorage);
|
|
1066
1066
|
}
|
|
1067
1067
|
return b.prototype.init = function(f) {
|
|
1068
|
-
var
|
|
1068
|
+
var h, m, g;
|
|
1069
1069
|
return r(this, void 0, void 0, function() {
|
|
1070
1070
|
var w, x, R, M, H, _, W, ee, ae, te, ne, ce, le, me, Ke, Xe, Fe, se, X, Dt, Je, Wn, Ye, Lt, Gn, Vn, Ft, Kn, Mt, Qe, Me, Xn, ie = this;
|
|
1071
1071
|
return o(this, function(pe) {
|
|
@@ -1075,24 +1075,24 @@ var pn = { exports: {} };
|
|
|
1075
1075
|
case 1:
|
|
1076
1076
|
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, ne = f.fetch, ce = f.preventFetch, le = f.enableLogs, me = f.enableDynatrace, Ke = f.enableAnalytics, Xe = f.realtime, Fe = f.eventSourceUrl, se = Fe === void 0 ? "https://realtime.flagsmith.com/" : Fe, X = f.AsyncStorage, Dt = f.identity, Je = f.traits, Wn = f.state, Ye = f.cacheOptions, Lt = f.angularHttpClient, Gn = f._trigger, Vn = f._triggerLoadingState, w.environment = x ? { apiKey: x } : w.environment, !w.environment || !w.environment.apiKey)
|
|
1077
1077
|
throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
1078
|
-
if (w.identity = Dt || Je ? { identifier: Dt, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(
|
|
1079
|
-
return [
|
|
1080
|
-
})) : {} } : w.identity, this.evaluationContext = w, this.api = M, this.headers = H, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Gn || this._trigger, this._triggerLoadingState = Vn || this._triggerLoadingState, this.onError = function(
|
|
1081
|
-
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error:
|
|
1082
|
-
}, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (u = ne), this.enableAnalytics = Ke || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!W, X && (A = X), Xe && typeof window < "u" && this.setupRealtime(se, w.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState(Wn), 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), Lt && (u = /* @__PURE__ */ function(
|
|
1078
|
+
if (w.identity = Dt || Je ? { identifier: Dt, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(de) {
|
|
1079
|
+
return [de[0], { value: de[1] }];
|
|
1080
|
+
})) : {} } : w.identity, this.evaluationContext = w, this.api = M, this.headers = H, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Gn || this._trigger, this._triggerLoadingState = Vn || this._triggerLoadingState, this.onError = function(de) {
|
|
1081
|
+
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: de })), ae == null || ae(de);
|
|
1082
|
+
}, this.enableLogs = le || !1, this.cacheOptions = Ye ? { skipAPI: !!Ye.skipAPI, ttl: Ye.ttl || 0, loadStale: !!Ye.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (u = ne), this.enableAnalytics = Ke || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!W, X && (A = X), Xe && typeof window < "u" && this.setupRealtime(se, w.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState(Wn), 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), Lt && (u = /* @__PURE__ */ function(de) {
|
|
1083
1083
|
return function(be, ye) {
|
|
1084
1084
|
var Ee = ye.headers, Y = ye.method, Pe = ye.body;
|
|
1085
1085
|
return new Promise(function(Re) {
|
|
1086
1086
|
switch (Y) {
|
|
1087
1087
|
case "GET":
|
|
1088
|
-
return
|
|
1088
|
+
return de.get(be, { headers: Ee }).subscribe(function(ke) {
|
|
1089
1089
|
Re({ ok: !0, text: function() {
|
|
1090
1090
|
return Promise.resolve(ke);
|
|
1091
1091
|
} });
|
|
1092
1092
|
});
|
|
1093
1093
|
case "POST":
|
|
1094
1094
|
case "PUT":
|
|
1095
|
-
return
|
|
1095
|
+
return de.post(be, Pe, { headers: Ee }).subscribe(function(ke) {
|
|
1096
1096
|
Re({ ok: !0, text: function() {
|
|
1097
1097
|
return Promise.resolve(ke);
|
|
1098
1098
|
} });
|
|
@@ -1100,14 +1100,14 @@ var pn = { exports: {} };
|
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
1102
|
};
|
|
1103
|
-
}(Lt)), A && this.canUseStorage && A.getItem(D).then(function(
|
|
1103
|
+
}(Lt)), A && this.canUseStorage && A.getItem(D).then(function(de) {
|
|
1104
1104
|
try {
|
|
1105
|
-
ie.evaluationEvent = JSON.parse(
|
|
1105
|
+
ie.evaluationEvent = JSON.parse(de) || {};
|
|
1106
1106
|
} catch {
|
|
1107
1107
|
ie.evaluationEvent = {};
|
|
1108
1108
|
}
|
|
1109
1109
|
ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
|
|
1110
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), A && this.canUseStorage && A.getItem(D, function(
|
|
1110
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), A && this.canUseStorage && A.getItem(D, function(de, be) {
|
|
1111
1111
|
if (be && ie.evaluationContext.environment) {
|
|
1112
1112
|
var ye = JSON.parse(be);
|
|
1113
1113
|
if (ye[ie.evaluationContext.environment.apiKey]) {
|
|
@@ -1119,7 +1119,7 @@ var pn = { exports: {} };
|
|
|
1119
1119
|
return [3, 9];
|
|
1120
1120
|
if (!A || !this.canUseStorage)
|
|
1121
1121
|
return [3, 8];
|
|
1122
|
-
Kn = function(
|
|
1122
|
+
Kn = function(de, be) {
|
|
1123
1123
|
return r(ie, void 0, void 0, function() {
|
|
1124
1124
|
var ye, Ee, Y, Pe, Re, ke, Pt, Jn, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Gt, Vt, Kt, Xt, Jt, Yt, Qt, Zt;
|
|
1125
1125
|
return o(this, function(Ie) {
|
|
@@ -1129,7 +1129,7 @@ var pn = { exports: {} };
|
|
|
1129
1129
|
return [3, 7];
|
|
1130
1130
|
ye = null, Ee = null, Ie.label = 1;
|
|
1131
1131
|
case 1:
|
|
1132
|
-
return Ie.trys.push([1, 5, , 6]), Y = JSON.parse(be), Pe = !1, Re = !1, Y && Y.api === this.api && ((jt = (Bt = Y.evaluationContext) === null || Bt === void 0 ? void 0 : Bt.environment) === null || jt === void 0 ? void 0 : jt.apiKey) === ((zt = this.evaluationContext.environment) === null || zt === void 0 ? void 0 : zt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = Y.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 " + ((qt = ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity) === null || qt === void 0 ? void 0 : qt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), ke = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee =
|
|
1132
|
+
return Ie.trys.push([1, 5, , 6]), Y = JSON.parse(be), Pe = !1, Re = !1, Y && Y.api === this.api && ((jt = (Bt = Y.evaluationContext) === null || Bt === void 0 ? void 0 : Bt.environment) === null || jt === void 0 ? void 0 : jt.apiKey) === ((zt = this.evaluationContext.environment) === null || zt === void 0 ? void 0 : zt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = Y.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 " + ((qt = ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity) === null || qt === void 0 ? void 0 : qt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), ke = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee = d((Wt = this.evaluationContext.identity) === null || Wt === void 0 ? void 0 : Wt.traits, (Vt = (Gt = Y.evaluationContext) === null || Gt === void 0 ? void 0 : Gt.identity) === null || Vt === void 0 ? void 0 : Vt.traits), ye = d(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: v(i(i({}, Y.evaluationContext), { identity: !((Kt = Y.evaluationContext) === null || Kt === void 0) && Kt.identity ? i(i({}, (Xt = Y.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity), { traits: i(i({}, ((Yt = (Jt = Y.evaluationContext) === null || Jt === void 0 ? void 0 : Jt.identity) === null || Yt === void 0 ? void 0 : Yt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Pe ? (Pt = !ce && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ye, traitsChanged: Ee }, this._loadedState(null, c.CACHE, Pt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Pe && !Re && this.log("Skipping API, using cache"), Pt && this.getFlags(), [3, 4]) : [3, 2];
|
|
1133
1133
|
case 2:
|
|
1134
1134
|
return ce ? [3, 4] : [4, this.getFlags()];
|
|
1135
1135
|
case 3:
|
|
@@ -1146,11 +1146,11 @@ var pn = { exports: {} };
|
|
|
1146
1146
|
return Ie.sent(), [3, 10];
|
|
1147
1147
|
case 9:
|
|
1148
1148
|
if (te)
|
|
1149
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1149
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: d({}, this.flags), traitsChanged: d({}, (Qt = this.evaluationContext.identity) === null || Qt === void 0 ? void 0 : Qt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1150
1150
|
else {
|
|
1151
1151
|
if (!this.flags)
|
|
1152
1152
|
throw new Error(Ft);
|
|
1153
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1153
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: d({}, this.flags), traitsChanged: d({}, (Zt = this.evaluationContext.identity) === null || Zt === void 0 ? void 0 : Zt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1154
1154
|
}
|
|
1155
1155
|
Ie.label = 10;
|
|
1156
1156
|
case 10:
|
|
@@ -1178,8 +1178,8 @@ var pn = { exports: {} };
|
|
|
1178
1178
|
return pe.sent(), [3, 12];
|
|
1179
1179
|
case 11:
|
|
1180
1180
|
if (te)
|
|
1181
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1182
|
-
else if (this.flags && (Qe = null, Object.keys(this.flags).length === 0 && (Qe = Ft), this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1181
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: d({}, te), traitsChanged: d({}, (h = w.identity) === null || h === void 0 ? void 0 : h.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1182
|
+
else if (this.flags && (Qe = null, Object.keys(this.flags).length === 0 && (Qe = Ft), this._onChange(null, { isFromServer: !1, flagsChanged: d({}, this.flags), traitsChanged: d({}, (m = w.identity) === null || m === void 0 ? void 0 : m.traits) }, this._loadedState(Qe, c.DEFAULT_FLAGS)), Qe))
|
|
1183
1183
|
throw new Error(Qe);
|
|
1184
1184
|
pe.label = 12;
|
|
1185
1185
|
case 12:
|
|
@@ -1191,12 +1191,12 @@ var pn = { exports: {} };
|
|
|
1191
1191
|
}
|
|
1192
1192
|
});
|
|
1193
1193
|
});
|
|
1194
|
-
}, b.prototype._loadedState = function(f,
|
|
1195
|
-
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source:
|
|
1194
|
+
}, b.prototype._loadedState = function(f, h, m) {
|
|
1195
|
+
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: h };
|
|
1196
1196
|
}, b.prototype.getAllFlags = function() {
|
|
1197
1197
|
return this.flags;
|
|
1198
|
-
}, b.prototype.identify = function(f,
|
|
1199
|
-
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),
|
|
1198
|
+
}, b.prototype.identify = function(f, h, m) {
|
|
1199
|
+
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), h && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(h).map(function(g) {
|
|
1200
1200
|
var w = g[0], x = g[1];
|
|
1201
1201
|
return [w, y(x) ? x : { value: x }];
|
|
1202
1202
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
@@ -1211,8 +1211,8 @@ var pn = { exports: {} };
|
|
|
1211
1211
|
}, b.prototype.stopListening = function() {
|
|
1212
1212
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
1213
1213
|
}, b.prototype.log = function() {
|
|
1214
|
-
for (var f = [],
|
|
1215
|
-
f[
|
|
1214
|
+
for (var f = [], h = 0; h < arguments.length; h++)
|
|
1215
|
+
f[h] = arguments[h];
|
|
1216
1216
|
this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
|
|
1217
1217
|
}, b.prototype.updateStorage = function() {
|
|
1218
1218
|
if (this.cacheFlags) {
|
|
@@ -1226,10 +1226,10 @@ var pn = { exports: {} };
|
|
|
1226
1226
|
A.setItem(D, f);
|
|
1227
1227
|
}
|
|
1228
1228
|
}, b.prototype.setLoadingState = function(f) {
|
|
1229
|
-
var
|
|
1230
|
-
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (
|
|
1231
|
-
}, b.prototype.setupRealtime = function(f,
|
|
1232
|
-
var m = this, g = f + "sse/environments/" +
|
|
1229
|
+
var h;
|
|
1230
|
+
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (h = this._triggerLoadingState) === null || h === void 0 || h.call(this));
|
|
1231
|
+
}, b.prototype.setupRealtime = function(f, h) {
|
|
1232
|
+
var m = this, g = f + "sse/environments/" + h + "/stream";
|
|
1233
1233
|
T ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new T(g), this.eventSource.addEventListener("environment_updated", function(w) {
|
|
1234
1234
|
var x;
|
|
1235
1235
|
try {
|
|
@@ -1242,37 +1242,37 @@ var pn = { exports: {} };
|
|
|
1242
1242
|
}, b;
|
|
1243
1243
|
}();
|
|
1244
1244
|
function E(b) {
|
|
1245
|
-
var f = b.fetch,
|
|
1246
|
-
return new I({ fetch: f, AsyncStorage:
|
|
1245
|
+
var f = b.fetch, h = b.AsyncStorage, m = b.eventSource;
|
|
1246
|
+
return new I({ fetch: f, AsyncStorage: h, eventSource: m });
|
|
1247
1247
|
}
|
|
1248
1248
|
var P, V = (P = function(b, f) {
|
|
1249
|
-
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
1250
|
-
|
|
1251
|
-
} || function(
|
|
1249
|
+
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(h, m) {
|
|
1250
|
+
h.__proto__ = m;
|
|
1251
|
+
} || function(h, m) {
|
|
1252
1252
|
for (var g in m)
|
|
1253
|
-
Object.prototype.hasOwnProperty.call(m, g) && (
|
|
1253
|
+
Object.prototype.hasOwnProperty.call(m, g) && (h[g] = m[g]);
|
|
1254
1254
|
}, P(b, f);
|
|
1255
1255
|
}, function(b, f) {
|
|
1256
1256
|
if (typeof f != "function" && f !== null)
|
|
1257
1257
|
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
1258
|
-
function
|
|
1258
|
+
function h() {
|
|
1259
1259
|
this.constructor = b;
|
|
1260
1260
|
}
|
|
1261
|
-
P(b, f), b.prototype = f === null ? Object.create(f) : (
|
|
1261
|
+
P(b, f), b.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
|
|
1262
1262
|
}), j = function(b) {
|
|
1263
|
-
var f = typeof Symbol == "function" && Symbol.iterator,
|
|
1264
|
-
if (
|
|
1265
|
-
return
|
|
1263
|
+
var f = typeof Symbol == "function" && Symbol.iterator, h = f && b[f], m = 0;
|
|
1264
|
+
if (h)
|
|
1265
|
+
return h.call(b);
|
|
1266
1266
|
if (b && typeof b.length == "number")
|
|
1267
1267
|
return { next: function() {
|
|
1268
1268
|
return b && m >= b.length && (b = void 0), { value: b && b[m++], done: !b };
|
|
1269
1269
|
} };
|
|
1270
1270
|
throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1271
1271
|
}, q = function(b, f) {
|
|
1272
|
-
var
|
|
1273
|
-
if (!
|
|
1272
|
+
var h = typeof Symbol == "function" && b[Symbol.iterator];
|
|
1273
|
+
if (!h)
|
|
1274
1274
|
return b;
|
|
1275
|
-
var m, g, w =
|
|
1275
|
+
var m, g, w = h.call(b), x = [];
|
|
1276
1276
|
try {
|
|
1277
1277
|
for (; (f === void 0 || f-- > 0) && !(m = w.next()).done; )
|
|
1278
1278
|
x.push(m.value);
|
|
@@ -1280,15 +1280,15 @@ var pn = { exports: {} };
|
|
|
1280
1280
|
g = { error: R };
|
|
1281
1281
|
} finally {
|
|
1282
1282
|
try {
|
|
1283
|
-
m && !m.done && (
|
|
1283
|
+
m && !m.done && (h = w.return) && h.call(w);
|
|
1284
1284
|
} finally {
|
|
1285
1285
|
if (g)
|
|
1286
1286
|
throw g.error;
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
1289
|
return x;
|
|
1290
|
-
}, C = function(b, f,
|
|
1291
|
-
if (
|
|
1290
|
+
}, C = function(b, f, h) {
|
|
1291
|
+
if (h || arguments.length === 2)
|
|
1292
1292
|
for (var m, g = 0, w = f.length; g < w; g++)
|
|
1293
1293
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
1294
1294
|
return b.concat(m || Array.prototype.slice.call(f));
|
|
@@ -1299,9 +1299,9 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1299
1299
|
}
|
|
1300
1300
|
return V(f, b), f;
|
|
1301
1301
|
}(Error), G = function() {
|
|
1302
|
-
function b(f,
|
|
1302
|
+
function b(f, h) {
|
|
1303
1303
|
var m = this;
|
|
1304
|
-
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration =
|
|
1304
|
+
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = h != null ? Object.assign({}, h) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = f.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function")
|
|
1305
1305
|
throw new F();
|
|
1306
1306
|
this._onevent_wrapped = function(g) {
|
|
1307
1307
|
m._onevent(g);
|
|
@@ -1310,7 +1310,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1310
1310
|
return b.prototype.dispatchEvent = function(f) {
|
|
1311
1311
|
throw new Error("Method not implemented.");
|
|
1312
1312
|
}, b.prototype._start = function() {
|
|
1313
|
-
var f,
|
|
1313
|
+
var f, h, m = this, g = this.url;
|
|
1314
1314
|
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) {
|
|
1315
1315
|
m._onopen(M);
|
|
1316
1316
|
}, this._eventSource.onerror = function(M) {
|
|
@@ -1327,7 +1327,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1327
1327
|
f = { error: M };
|
|
1328
1328
|
} finally {
|
|
1329
1329
|
try {
|
|
1330
|
-
x && !x.done && (
|
|
1330
|
+
x && !x.done && (h = w.return) && h.call(w);
|
|
1331
1331
|
} finally {
|
|
1332
1332
|
if (f)
|
|
1333
1333
|
throw f.error;
|
|
@@ -1336,16 +1336,16 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1336
1336
|
}, b.prototype._onopen = function(f) {
|
|
1337
1337
|
this.readyState === 0 && (this.readyState = 1, this.onopen(f));
|
|
1338
1338
|
}, b.prototype._onerror = function(f) {
|
|
1339
|
-
var
|
|
1339
|
+
var h = this;
|
|
1340
1340
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
|
|
1341
1341
|
this._eventSource.close(), this._eventSource = null;
|
|
1342
1342
|
var m = Math.round(this.max_retry_time * Math.random());
|
|
1343
1343
|
this._timer = setTimeout(function() {
|
|
1344
|
-
return
|
|
1344
|
+
return h._start();
|
|
1345
1345
|
}, m);
|
|
1346
1346
|
}
|
|
1347
1347
|
}, b.prototype._onevent = function(f) {
|
|
1348
|
-
var
|
|
1348
|
+
var h, m;
|
|
1349
1349
|
f && f.lastEventId && (this._lastEventId = f.lastEventId);
|
|
1350
1350
|
var g = this._listeners[f.type];
|
|
1351
1351
|
if (g != null)
|
|
@@ -1353,13 +1353,13 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1353
1353
|
for (var w = j(C([], q(g), !1)), x = w.next(); !x.done; x = w.next())
|
|
1354
1354
|
x.value.call(this, f);
|
|
1355
1355
|
} catch (R) {
|
|
1356
|
-
|
|
1356
|
+
h = { error: R };
|
|
1357
1357
|
} finally {
|
|
1358
1358
|
try {
|
|
1359
1359
|
x && !x.done && (m = w.return) && m.call(w);
|
|
1360
1360
|
} finally {
|
|
1361
|
-
if (
|
|
1362
|
-
throw
|
|
1361
|
+
if (h)
|
|
1362
|
+
throw h.error;
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
1365
|
f.type === "message" && this.onmessage(f);
|
|
@@ -1368,20 +1368,20 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1368
1368
|
}, b.prototype.onmessage = function(f) {
|
|
1369
1369
|
}, b.prototype.close = function() {
|
|
1370
1370
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
1371
|
-
}, b.prototype.addEventListener = function(f,
|
|
1371
|
+
}, b.prototype.addEventListener = function(f, h, m) {
|
|
1372
1372
|
this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
|
|
1373
1373
|
var g = this._listeners[f];
|
|
1374
|
-
g.includes(
|
|
1375
|
-
}, b.prototype.removeEventListener = function(f,
|
|
1374
|
+
g.includes(h) || (this._listeners[f] = C(C([], q(g), !1), [h], !1));
|
|
1375
|
+
}, b.prototype.removeEventListener = function(f, h, m) {
|
|
1376
1376
|
var g = this._listeners[f];
|
|
1377
1377
|
this._listeners[f] = g.filter(function(w) {
|
|
1378
|
-
return w !==
|
|
1378
|
+
return w !== h;
|
|
1379
1379
|
});
|
|
1380
1380
|
}, b;
|
|
1381
1381
|
}();
|
|
1382
1382
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
1383
1383
|
var K = function(b, f) {
|
|
1384
|
-
return f = f || {}, new Promise(function(
|
|
1384
|
+
return f = f || {}, new Promise(function(h, m) {
|
|
1385
1385
|
var g = new XMLHttpRequest(), w = [], x = [], R = {}, M = function() {
|
|
1386
1386
|
return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
|
|
1387
1387
|
return Promise.resolve(g.responseText);
|
|
@@ -1402,7 +1402,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1402
1402
|
for (var H in g.open(f.method || "get", b, !0), g.onload = function() {
|
|
1403
1403
|
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(_, W, ee) {
|
|
1404
1404
|
w.push(W = W.toLowerCase()), x.push([W, ee]), R[W] = R[W] ? R[W] + "," + ee : ee;
|
|
1405
|
-
}),
|
|
1405
|
+
}), h(M());
|
|
1406
1406
|
}, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
|
|
1407
1407
|
g.setRequestHeader(H, f.headers[H]);
|
|
1408
1408
|
g.send(f.body || null);
|
|
@@ -1422,8 +1422,8 @@ var Qn = {}, Pi = function(t, e, n, s, i) {
|
|
|
1422
1422
|
return r.onmessage = function(o) {
|
|
1423
1423
|
var l = o.data, a = l.$e$;
|
|
1424
1424
|
if (a) {
|
|
1425
|
-
var
|
|
1426
|
-
|
|
1425
|
+
var d = new Error(a[0]);
|
|
1426
|
+
d.code = a[1], d.stack = a[2], i(d, null);
|
|
1427
1427
|
} else
|
|
1428
1428
|
i(null, l);
|
|
1429
1429
|
}, r.postMessage(n, s), r;
|
|
@@ -1522,8 +1522,8 @@ var We = function(t, e, n) {
|
|
|
1522
1522
|
var a = 15 - e;
|
|
1523
1523
|
for (i = 0; i < s; ++i)
|
|
1524
1524
|
if (t[i])
|
|
1525
|
-
for (var
|
|
1526
|
-
l[yt[u] >> a] =
|
|
1525
|
+
for (var d = i << 4 | t[i], c = e - t[i], u = o[t[i] - 1]++ << c, p = u | (1 << c) - 1; u <= p; ++u)
|
|
1526
|
+
l[yt[u] >> a] = d;
|
|
1527
1527
|
} else
|
|
1528
1528
|
for (l = new re(s), i = 0; i < s; ++i)
|
|
1529
1529
|
t[i] && (l[i] = yt[o[t[i] - 1]++] >> 15 - t[i]);
|
|
@@ -1573,7 +1573,7 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1573
1573
|
n <<= e & 7;
|
|
1574
1574
|
var s = e / 8 | 0;
|
|
1575
1575
|
t[s] |= n, t[s + 1] |= n >> 8, t[s + 2] |= n >> 16;
|
|
1576
|
-
},
|
|
1576
|
+
}, ht = function(t, e) {
|
|
1577
1577
|
for (var n = [], s = 0; s < t.length; ++s)
|
|
1578
1578
|
t[s] && n.push({ s, f: t[s] });
|
|
1579
1579
|
var i = n.length, r = n.slice();
|
|
@@ -1586,9 +1586,9 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1586
1586
|
n.sort(function(N, O) {
|
|
1587
1587
|
return N.f - O.f;
|
|
1588
1588
|
}), n.push({ s: -1, f: 25001 });
|
|
1589
|
-
var l = n[0], a = n[1],
|
|
1589
|
+
var l = n[0], a = n[1], d = 0, c = 1, u = 2;
|
|
1590
1590
|
for (n[0] = { s: -1, f: l.f + a.f, l, r: a }; c != i - 1; )
|
|
1591
|
-
l = n[n[
|
|
1591
|
+
l = n[n[d].f < n[u].f ? d++ : u++], a = n[d != c && n[d].f < n[u].f ? d++ : u++], n[c++] = { s: -1, f: l.f + a.f, l, r: a };
|
|
1592
1592
|
for (var p = r[0].s, s = 1; s < i; ++s)
|
|
1593
1593
|
r[s].s > p && (p = r[s].s);
|
|
1594
1594
|
var y = new re(p + 1), S = vt(n[c - 1], y, 0);
|
|
@@ -1649,17 +1649,17 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1649
1649
|
for (var r = 0; r < s; ++r)
|
|
1650
1650
|
t[i + r + 4] = n[r];
|
|
1651
1651
|
return (i + 4 + s) * 8;
|
|
1652
|
-
}, yn = function(t, e, n, s, i, r, o, l, a,
|
|
1652
|
+
}, yn = function(t, e, n, s, i, r, o, l, a, d, c) {
|
|
1653
1653
|
ve(e, c++, n), ++i[256];
|
|
1654
|
-
for (var u =
|
|
1654
|
+
for (var u = ht(i, 15), p = u.t, y = u.l, S = ht(r, 15), v = S.t, T = S.l, A = bn(p), B = A.c, D = A.n, k = bn(v), N = k.c, O = k.n, L = new re(19), I = 0; I < B.length; ++I)
|
|
1655
1655
|
++L[B[I] & 31];
|
|
1656
1656
|
for (var I = 0; I < N.length; ++I)
|
|
1657
1657
|
++L[N[I] & 31];
|
|
1658
|
-
for (var E =
|
|
1658
|
+
for (var E = ht(L, 7), P = E.t, V = E.l, j = 19; j > 4 && !P[gn[j - 1]]; --j)
|
|
1659
1659
|
;
|
|
1660
|
-
var q =
|
|
1660
|
+
var q = d + 5 << 3, C = He(i, Oe) + He(r, nt) + o, F = He(i, p) + He(r, v) + o + 14 + 3 * j + He(L, P) + 2 * L[16] + 3 * L[17] + 7 * L[18];
|
|
1661
1661
|
if (a >= 0 && q <= C && q <= F)
|
|
1662
|
-
return Dn(e, c, t.subarray(a, a +
|
|
1662
|
+
return Dn(e, c, t.subarray(a, a + d));
|
|
1663
1663
|
var G, K, U, b;
|
|
1664
1664
|
if (ve(e, c, 1 + (F < C)), c += 2, F < C) {
|
|
1665
1665
|
G = We(p, y, 0), K = p, U = We(v, T, 0), b = v;
|
|
@@ -1668,8 +1668,8 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1668
1668
|
for (var I = 0; I < j; ++I)
|
|
1669
1669
|
ve(e, c + 3 * I, P[gn[I]]);
|
|
1670
1670
|
c += 3 * j;
|
|
1671
|
-
for (var
|
|
1672
|
-
for (var g =
|
|
1671
|
+
for (var h = [B, N], m = 0; m < 2; ++m)
|
|
1672
|
+
for (var g = h[m], I = 0; I < g.length; ++I) {
|
|
1673
1673
|
var w = g[I] & 31;
|
|
1674
1674
|
ve(e, c, f[w]), c += P[w], w > 15 && (ve(e, c, g[I] >> 5 & 127), c += g[I] >> 12);
|
|
1675
1675
|
}
|
|
@@ -1687,7 +1687,7 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1687
1687
|
}
|
|
1688
1688
|
return Ue(e, c, G[256]), c + K[256];
|
|
1689
1689
|
}, Zs = /* @__PURE__ */ new Ct([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Ln = /* @__PURE__ */ new fe(0), ei = function(t, e, n, s, i, r) {
|
|
1690
|
-
var o = r.z || t.length, l = new fe(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(s, l.length - i),
|
|
1690
|
+
var o = r.z || t.length, l = new fe(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(s, l.length - i), d = r.l, c = (r.r || 0) & 7;
|
|
1691
1691
|
if (e) {
|
|
1692
1692
|
c && (a[0] = r.r >> 3);
|
|
1693
1693
|
for (var u = Zs[e - 1], p = u >> 13, y = u & 8191, S = (1 << n) - 1, v = r.p || new re(32768), T = r.h || new re(S + 1), A = Math.ceil(n / 3), B = 2 * A, D = function(ne) {
|
|
@@ -1696,29 +1696,29 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1696
1696
|
var q = D(E), C = E & 32767, F = T[q];
|
|
1697
1697
|
if (v[C] = F, T[q] = C, V <= E) {
|
|
1698
1698
|
var G = o - E;
|
|
1699
|
-
if ((L > 7e3 || P > 24576) && (G > 423 || !
|
|
1699
|
+
if ((L > 7e3 || P > 24576) && (G > 423 || !d)) {
|
|
1700
1700
|
c = yn(t, a, 0, k, N, O, I, P, j, E - j, c), P = L = I = 0, j = E;
|
|
1701
1701
|
for (var K = 0; K < 286; ++K)
|
|
1702
1702
|
N[K] = 0;
|
|
1703
1703
|
for (var K = 0; K < 30; ++K)
|
|
1704
1704
|
O[K] = 0;
|
|
1705
1705
|
}
|
|
1706
|
-
var U = 2, b = 0, f = y,
|
|
1707
|
-
if (G > 2 && q == D(E -
|
|
1708
|
-
for (var m = Math.min(p, G) - 1, g = Math.min(32767, E), w = Math.min(258, G);
|
|
1709
|
-
if (t[E + U] == t[E + U -
|
|
1710
|
-
for (var x = 0; x < w && t[E + x] == t[E + x -
|
|
1706
|
+
var U = 2, b = 0, f = y, h = C - F & 32767;
|
|
1707
|
+
if (G > 2 && q == D(E - h))
|
|
1708
|
+
for (var m = Math.min(p, G) - 1, g = Math.min(32767, E), w = Math.min(258, G); h <= g && --f && C != F; ) {
|
|
1709
|
+
if (t[E + U] == t[E + U - h]) {
|
|
1710
|
+
for (var x = 0; x < w && t[E + x] == t[E + x - h]; ++x)
|
|
1711
1711
|
;
|
|
1712
1712
|
if (x > U) {
|
|
1713
|
-
if (U = x, b =
|
|
1713
|
+
if (U = x, b = h, x > m)
|
|
1714
1714
|
break;
|
|
1715
|
-
for (var R = Math.min(
|
|
1716
|
-
var H = E -
|
|
1715
|
+
for (var R = Math.min(h, x - 2), M = 0, K = 0; K < R; ++K) {
|
|
1716
|
+
var H = E - h + K & 32767, _ = v[H], W = H - _ & 32767;
|
|
1717
1717
|
W > M && (M = W, F = H);
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
C = F, F = v[C],
|
|
1721
|
+
C = F, F = v[C], h += C - F & 32767;
|
|
1722
1722
|
}
|
|
1723
1723
|
if (b) {
|
|
1724
1724
|
k[P++] = 268435456 | bt[U] << 18 | mn[b];
|
|
@@ -1730,11 +1730,11 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1730
1730
|
}
|
|
1731
1731
|
for (E = Math.max(E, V); E < o; ++E)
|
|
1732
1732
|
k[P++] = t[E], ++N[t[E]];
|
|
1733
|
-
c = yn(t, a,
|
|
1733
|
+
c = yn(t, a, d, k, N, O, I, P, j, E - j, c), d || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = T, r.p = v, r.i = E, r.w = V);
|
|
1734
1734
|
} else {
|
|
1735
|
-
for (var E = r.w || 0; E < o +
|
|
1735
|
+
for (var E = r.w || 0; E < o + d; E += 65535) {
|
|
1736
1736
|
var te = E + 65535;
|
|
1737
|
-
te >= o && (a[c / 8 | 0] =
|
|
1737
|
+
te >= o && (a[c / 8 | 0] = d, te = o), c = Dn(a, c + 1, t.subarray(E, te));
|
|
1738
1738
|
}
|
|
1739
1739
|
r.i = o;
|
|
1740
1740
|
}
|
|
@@ -1776,18 +1776,18 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1776
1776
|
var l = s[o], a = r[o];
|
|
1777
1777
|
if (typeof l == "function") {
|
|
1778
1778
|
e += ";" + a + "=";
|
|
1779
|
-
var
|
|
1779
|
+
var d = l.toString();
|
|
1780
1780
|
if (l.prototype)
|
|
1781
|
-
if (
|
|
1782
|
-
var c =
|
|
1783
|
-
e +=
|
|
1781
|
+
if (d.indexOf("[native code]") != -1) {
|
|
1782
|
+
var c = d.indexOf(" ", 8) + 1;
|
|
1783
|
+
e += d.slice(c, d.indexOf("(", c));
|
|
1784
1784
|
} else {
|
|
1785
|
-
e +=
|
|
1785
|
+
e += d;
|
|
1786
1786
|
for (var u in l.prototype)
|
|
1787
1787
|
e += ";" + a + ".prototype." + u + "=" + l.prototype[u].toString();
|
|
1788
1788
|
}
|
|
1789
1789
|
else
|
|
1790
|
-
e +=
|
|
1790
|
+
e += d;
|
|
1791
1791
|
} else
|
|
1792
1792
|
n[a] = l;
|
|
1793
1793
|
}
|
|
@@ -1806,7 +1806,7 @@ var Xs = /* @__PURE__ */ We(Oe, 9, 0), Js = /* @__PURE__ */ We(nt, 5, 0), An = f
|
|
|
1806
1806
|
var a = Ui({}, it[n].e);
|
|
1807
1807
|
return Pi(it[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, a, Hi(a), s);
|
|
1808
1808
|
}, qi = function() {
|
|
1809
|
-
return [fe, re, Ct, _t, Nt, gn, bt, mn, Xs, Oe, Js, nt, yt, Zs, Ln, We, ve, Ue,
|
|
1809
|
+
return [fe, re, Ct, _t, Nt, gn, bt, mn, Xs, Oe, Js, nt, yt, Zs, Ln, We, ve, Ue, ht, vt, bn, He, Dn, yn, An, Ys, ei, Fn, Vi, si];
|
|
1810
1810
|
}, Wi = function() {
|
|
1811
1811
|
return [ii, ri, wt, ni, ti];
|
|
1812
1812
|
}, si = function(t) {
|
|
@@ -1915,15 +1915,15 @@ class Qi {
|
|
|
1915
1915
|
}), { conditions: i } = await s.json(), r = [];
|
|
1916
1916
|
i.forEach((o) => {
|
|
1917
1917
|
o.filters.forEach((a) => {
|
|
1918
|
-
let
|
|
1919
|
-
a.type === "fetch" ? (
|
|
1918
|
+
let d;
|
|
1919
|
+
a.type === "fetch" ? (d = {
|
|
1920
1920
|
type: "network_request",
|
|
1921
1921
|
subConditions: [],
|
|
1922
1922
|
name: o.name
|
|
1923
1923
|
}, a.filters.forEach((c) => {
|
|
1924
1924
|
const u = this.createConditionFromFilter(c);
|
|
1925
|
-
u &&
|
|
1926
|
-
})) :
|
|
1925
|
+
u && d.subConditions.push(u);
|
|
1926
|
+
})) : d = this.createConditionFromFilter(a), d && (d.type === "session_duration" && this.processDuration(d.value[0], o.name), r.push({ ...d, name: o.name }));
|
|
1927
1927
|
});
|
|
1928
1928
|
}), this.conditions = r;
|
|
1929
1929
|
} catch {
|
|
@@ -2192,8 +2192,8 @@ class er {
|
|
|
2192
2192
|
body: JSON.stringify(o)
|
|
2193
2193
|
});
|
|
2194
2194
|
if (a.status === 200) {
|
|
2195
|
-
const
|
|
2196
|
-
return this.handleFlags(
|
|
2195
|
+
const d = await a.json();
|
|
2196
|
+
return this.handleFlags(d.flags);
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
2199
|
handleFlags(e) {
|
|
@@ -2293,7 +2293,7 @@ function li(t, e, n, s) {
|
|
|
2293
2293
|
);
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
|
-
function
|
|
2296
|
+
function di(t, e, n, s) {
|
|
2297
2297
|
const i = Bn("removeEventListener");
|
|
2298
2298
|
try {
|
|
2299
2299
|
t[i](e, n, s);
|
|
@@ -2335,12 +2335,12 @@ const ar = new or();
|
|
|
2335
2335
|
function cr(t) {
|
|
2336
2336
|
ar.addTask(t);
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function hi(t, e) {
|
|
2339
2339
|
const n = { ...t };
|
|
2340
2340
|
for (const s in e)
|
|
2341
2341
|
if (e.hasOwnProperty(s)) {
|
|
2342
2342
|
const i = e[s], r = t[s];
|
|
2343
|
-
typeof i == "object" && !Array.isArray(i) && i !== null ? n[s] =
|
|
2343
|
+
typeof i == "object" && !Array.isArray(i) && i !== null ? n[s] = hi(r || {}, i) : n[s] = i;
|
|
2344
2344
|
}
|
|
2345
2345
|
return n;
|
|
2346
2346
|
}
|
|
@@ -2357,14 +2357,14 @@ function lr(t, e) {
|
|
|
2357
2357
|
e
|
|
2358
2358
|
];
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2360
|
+
function dr(t, e) {
|
|
2361
2361
|
return [
|
|
2362
2362
|
6,
|
|
2363
2363
|
t,
|
|
2364
2364
|
e
|
|
2365
2365
|
];
|
|
2366
2366
|
}
|
|
2367
|
-
function
|
|
2367
|
+
function hr() {
|
|
2368
2368
|
return [
|
|
2369
2369
|
7
|
|
2370
2370
|
];
|
|
@@ -2603,7 +2603,7 @@ function Sn(t, e, n, s) {
|
|
|
2603
2603
|
s
|
|
2604
2604
|
];
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2606
|
+
function ds(t, e) {
|
|
2607
2607
|
return [
|
|
2608
2608
|
75,
|
|
2609
2609
|
t,
|
|
@@ -2669,7 +2669,7 @@ function Mr(t, e, n, s, i, r) {
|
|
|
2669
2669
|
r
|
|
2670
2670
|
];
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2672
|
+
function hs(t, e, n) {
|
|
2673
2673
|
return [
|
|
2674
2674
|
113,
|
|
2675
2675
|
t,
|
|
@@ -2689,7 +2689,7 @@ function Br(t) {
|
|
|
2689
2689
|
t
|
|
2690
2690
|
];
|
|
2691
2691
|
}
|
|
2692
|
-
function fi(t, e, n, s, i, r, o, l, a,
|
|
2692
|
+
function fi(t, e, n, s, i, r, o, l, a, d) {
|
|
2693
2693
|
return [
|
|
2694
2694
|
116,
|
|
2695
2695
|
t,
|
|
@@ -2701,7 +2701,7 @@ function fi(t, e, n, s, i, r, o, l, a, h) {
|
|
|
2701
2701
|
o,
|
|
2702
2702
|
l,
|
|
2703
2703
|
a,
|
|
2704
|
-
|
|
2704
|
+
d
|
|
2705
2705
|
];
|
|
2706
2706
|
}
|
|
2707
2707
|
function ut(t) {
|
|
@@ -3105,12 +3105,12 @@ function io(t, e) {
|
|
|
3105
3105
|
e.onmousedown = function(n) {
|
|
3106
3106
|
const s = t.getBoundingClientRect(), i = n.clientX - s.left, r = n.clientY - s.top;
|
|
3107
3107
|
t.style.position = "fixed", t.style.zIndex = 99999999999999, o(n.pageX, n.pageY);
|
|
3108
|
-
function o(
|
|
3109
|
-
let u =
|
|
3108
|
+
function o(d, c) {
|
|
3109
|
+
let u = d - i, p = c - r;
|
|
3110
3110
|
u <= 5 && (u = 5), p <= 5 && (p = 5), u >= window.innerWidth - s.width && (u = window.innerWidth - s.width), p >= window.innerHeight - s.height && (p = window.innerHeight - s.height), t.style.left = `${u}px`, t.style.top = `${p}px`;
|
|
3111
3111
|
}
|
|
3112
|
-
function l(
|
|
3113
|
-
o(
|
|
3112
|
+
function l(d) {
|
|
3113
|
+
o(d.pageX, d.pageY);
|
|
3114
3114
|
}
|
|
3115
3115
|
document.addEventListener("mousemove", l);
|
|
3116
3116
|
const a = () => {
|
|
@@ -3180,8 +3180,8 @@ function z(t, e, n, s, i) {
|
|
|
3180
3180
|
}
|
|
3181
3181
|
const ft = "or_uxt_test_start", Tn = "or_uxt_task_index", En = "or_uxt_session_id", lo = "or_uxt_test_id";
|
|
3182
3182
|
class ho {
|
|
3183
|
-
constructor(e, n, s, i, r, o, l, a,
|
|
3184
|
-
this.ingestPoint = e, this.getTimestamp = n, this.token = s, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId =
|
|
3183
|
+
constructor(e, n, s, i, r, o, l, a, d) {
|
|
3184
|
+
this.ingestPoint = e, this.getTimestamp = n, this.token = s, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId = d, this.durations = {
|
|
3185
3185
|
testStart: 0,
|
|
3186
3186
|
tasks: []
|
|
3187
3187
|
}, this.getDurations = () => this.durations, this.setDurations = (u) => {
|
|
@@ -3235,8 +3235,8 @@ class uo {
|
|
|
3235
3235
|
constructor(e, n) {
|
|
3236
3236
|
this.app = e, this.storageKey = n, this.bg = z("div", "bg", qr, void 0, "__or_ut_bg"), this.container = z("div", "container", Wr, void 0, "__or_ut_ct"), this.widgetGuidelinesVisible = !0, this.widgetTasksVisible = !1, this.widgetVisible = !0, this.isActive = !1, this.descriptionSection = null, this.taskSection = null, this.endSection = null, this.stopButton = null, this.stopButtonContainer = null, this.test = null, this.testId = null, this.signalManager = null, this.getTest = (o, l, a) => {
|
|
3237
3237
|
this.testId = o;
|
|
3238
|
-
const
|
|
3239
|
-
return fetch(`${
|
|
3238
|
+
const d = this.app.options.ingestPoint;
|
|
3239
|
+
return fetch(`${d}/v1/web/uxt/test/${o}`, {
|
|
3240
3240
|
headers: {
|
|
3241
3241
|
Authorization: `Bearer ${l}`
|
|
3242
3242
|
}
|
|
@@ -3261,10 +3261,10 @@ class uo {
|
|
|
3261
3261
|
📹 We're recording this browser tab to learn from your experience.
|
|
3262
3262
|
🎤 Please enable mic and camera if asked, to give us a complete picture.`), o = z("div", "button", Kr, "Read guidelines to begin");
|
|
3263
3263
|
this.removeGreeting = () => ((n || s) && this.userRecorder.startRecording(30, ws.Standard, n, s), this.container.removeChild(o), this.container.removeChild(r), this.container.removeChild(i), !1), o.onclick = () => {
|
|
3264
|
-
var a,
|
|
3264
|
+
var a, d, c, u;
|
|
3265
3265
|
this.removeGreeting();
|
|
3266
3266
|
const l = (a = this.signalManager) == null ? void 0 : a.getDurations();
|
|
3267
|
-
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (
|
|
3267
|
+
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (d = this.signalManager) == null || d.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) || []);
|
|
3268
3268
|
}, this.container.append(i, r, o), this.bg.appendChild(this.container), document.body.appendChild(this.bg);
|
|
3269
3269
|
}
|
|
3270
3270
|
showWidget(e, n, s) {
|
|
@@ -3285,8 +3285,8 @@ class uo {
|
|
|
3285
3285
|
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);
|
|
3286
3286
|
const r = this.createDescriptionSection(e), o = this.createTasksSection(n), l = z("div", "stop_bn_or", ms, "Abort Session"), a = z("div", "stop_ct_or", { fontSize: "13px!important" });
|
|
3287
3287
|
a.style.fontSize = "13px", a.append(l), this.container.append(i, r, o, a), this.taskSection = o, this.descriptionSection = r, this.stopButton = l, this.stopButtonContainer = a, l.onclick = () => {
|
|
3288
|
-
var
|
|
3289
|
-
this.userRecorder.discard(), (
|
|
3288
|
+
var d;
|
|
3289
|
+
this.userRecorder.discard(), (d = this.signalManager) == null || d.signalTest("skipped"), document.body.removeChild(this.bg), window.close();
|
|
3290
3290
|
}, s ? this.toggleDescriptionVisibility() : this.hideTaskSection();
|
|
3291
3291
|
}
|
|
3292
3292
|
createTitleSection() {
|
|
@@ -3324,14 +3324,14 @@ class uo {
|
|
|
3324
3324
|
l.innerHTML = e;
|
|
3325
3325
|
const a = z("div", "button_begin_or", gs, "Begin Test");
|
|
3326
3326
|
s.append(i, r), o.append(l, a), n.append(s, o);
|
|
3327
|
-
const
|
|
3327
|
+
const d = () => {
|
|
3328
3328
|
this.widgetGuidelinesVisible = !this.widgetGuidelinesVisible, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" });
|
|
3329
3329
|
};
|
|
3330
|
-
return s.onclick =
|
|
3330
|
+
return s.onclick = d, this.toggleDescriptionVisibility = () => {
|
|
3331
3331
|
this.widgetGuidelinesVisible = !1, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" }), o.removeChild(a);
|
|
3332
3332
|
}, a.onclick = () => {
|
|
3333
3333
|
var c, u, p;
|
|
3334
|
-
if (
|
|
3334
|
+
if (d(), this.test) {
|
|
3335
3335
|
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;
|
|
3336
3336
|
y && S === -1 && (y.tasks.push({
|
|
3337
3337
|
taskId: this.test.tasks[0].task_id,
|
|
@@ -3347,17 +3347,17 @@ class uo {
|
|
|
3347
3347
|
fontSize: "13px",
|
|
3348
3348
|
fontWeight: "500",
|
|
3349
3349
|
lineHeight: "auto"
|
|
3350
|
-
}, "Tasks"), r = z("div", "icon", ps, "-"), o = z("div", "content", je), l = z("div", "pagination", Yr), a = z("div", "taskCard", ys),
|
|
3350
|
+
}, "Tasks"), r = z("div", "icon", ps, "-"), o = z("div", "content", je), l = z("div", "pagination", Yr), a = z("div", "taskCard", ys), d = z("div", "taskText", vs), c = z("div", "taskDescription", Zr), u = z("div", "taskButtons", to), p = z("div", "taskText", vs);
|
|
3351
3351
|
p.textContent = "Your answer";
|
|
3352
3352
|
const y = z("textarea", "taskDescription", {
|
|
3353
3353
|
resize: "vertical"
|
|
3354
3354
|
}), S = z("div", "inputArea", ys);
|
|
3355
3355
|
S.append(p, y);
|
|
3356
3356
|
const v = z("div", "closePanelButton", pi, "Collapse Panel"), T = z("div", "nextButton", eo, "Done, Next");
|
|
3357
|
-
s.append(i, r), a.append(
|
|
3357
|
+
s.append(i, r), a.append(d, c), u.append(v, T), o.append(l, a, S, u), n.append(s, o);
|
|
3358
3358
|
const A = () => {
|
|
3359
3359
|
const k = e[this.currentTaskIndex];
|
|
3360
|
-
|
|
3360
|
+
d.textContent = k.title, c.textContent = k.description, k.allow_typing ? S.style.display = "flex" : S.style.display = "none";
|
|
3361
3361
|
};
|
|
3362
3362
|
e.forEach((k, N) => {
|
|
3363
3363
|
const O = z("span", `or_task_${N}`, {
|
|
@@ -3406,7 +3406,7 @@ class uo {
|
|
|
3406
3406
|
}, 1), n;
|
|
3407
3407
|
}
|
|
3408
3408
|
showEndSection() {
|
|
3409
|
-
var l, a,
|
|
3409
|
+
var l, a, d, c;
|
|
3410
3410
|
let e = !0;
|
|
3411
3411
|
(l = this.signalManager) == null || l.signalTest("done");
|
|
3412
3412
|
const n = z("div", "end_section_or", Jr), s = z("div", "end_title_or", {
|
|
@@ -3415,7 +3415,7 @@ class uo {
|
|
|
3415
3415
|
}, "Thank you! 👍"), i = z("div", "end_description_or", {}, ((a = this.test) == null ? void 0 : a.conclusion) ?? `Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
|
|
3416
3416
|
|
|
3417
3417
|
We appreciate your time and valuable input.`), r = z("div", "end_button_or", gs, "Submitting Feedback"), o = co();
|
|
3418
|
-
r.appendChild(o), (
|
|
3418
|
+
r.appendChild(o), (d = this.test) != null && d.reqMic || (c = this.test) != null && c.reqCamera ? this.userRecorder.sendToAPI().then(() => {
|
|
3419
3419
|
r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
3420
3420
|
}).catch((u) => {
|
|
3421
3421
|
console.error(u), r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
@@ -3471,12 +3471,12 @@ class po {
|
|
|
3471
3471
|
};
|
|
3472
3472
|
const o = jr(i.toString(), r);
|
|
3473
3473
|
this.app.send(o);
|
|
3474
|
-
const l = (
|
|
3475
|
-
go(
|
|
3474
|
+
const l = (d) => {
|
|
3475
|
+
go(d, this.options.quality, this.snapshots[i].dummy, this.options.fixedScaling, this.fileExt, (c) => {
|
|
3476
3476
|
c && (this.snapshots[i].images.push({ id: this.app.timestamp(), data: c }), this.snapshots[i].images.length > 9 && (this.sendSnaps(this.snapshots[i].images, i, this.snapshots[i].createdAt), this.snapshots[i].images = []));
|
|
3477
3477
|
});
|
|
3478
3478
|
}, a = setInterval(() => {
|
|
3479
|
-
const
|
|
3479
|
+
const d = this.app.nodes.getID(s), c = d ? this.app.nodes.getNode(d) : void 0;
|
|
3480
3480
|
!c || !Z(c, "canvas") || c !== s ? (this.app.debug.log("Canvas element not in sync"), clearInterval(a)) : this.snapshots[i].paused || (this.options.useAnimationFrame ? requestAnimationFrame(() => {
|
|
3481
3481
|
l(c);
|
|
3482
3482
|
}) : l(c));
|
|
@@ -3585,7 +3585,7 @@ class yo {
|
|
|
3585
3585
|
if (n !== void 0) {
|
|
3586
3586
|
e[this.node_id] = void 0, delete e[this.node_id], delete this.nodes[n];
|
|
3587
3587
|
const s = this.elementListeners.get(n);
|
|
3588
|
-
s !== void 0 && (this.elementListeners.delete(n), s.forEach((i) =>
|
|
3588
|
+
s !== void 0 && (this.elementListeners.delete(n), s.forEach((i) => di(e, i[0], i[1], i[2]))), this.totalNodeAmount--;
|
|
3589
3589
|
}
|
|
3590
3590
|
return n;
|
|
3591
3591
|
}
|
|
@@ -3657,8 +3657,8 @@ class jn {
|
|
|
3657
3657
|
const a = i.attributeName;
|
|
3658
3658
|
if (a === null)
|
|
3659
3659
|
continue;
|
|
3660
|
-
let
|
|
3661
|
-
|
|
3660
|
+
let d = this.attributesMap.get(l);
|
|
3661
|
+
d === void 0 && this.attributesMap.set(l, d = /* @__PURE__ */ new Set()), d.add(a);
|
|
3662
3662
|
continue;
|
|
3663
3663
|
}
|
|
3664
3664
|
if (o === "characterData") {
|
|
@@ -3786,11 +3786,11 @@ class jn {
|
|
|
3786
3786
|
return !0;
|
|
3787
3787
|
}
|
|
3788
3788
|
o === we.Removed && i !== void 0 && this.app.send(pr(e, i, a));
|
|
3789
|
-
const
|
|
3790
|
-
if (
|
|
3789
|
+
const d = this.attributesMap.get(e);
|
|
3790
|
+
if (d !== void 0) {
|
|
3791
3791
|
if (!Te(n))
|
|
3792
3792
|
throw "commitNode: node is not an element";
|
|
3793
|
-
for (const c of
|
|
3793
|
+
for (const c of d)
|
|
3794
3794
|
this.sendNodeAttribute(e, n, c, n.getAttribute(c));
|
|
3795
3795
|
}
|
|
3796
3796
|
if (this.textSet.has(e)) {
|
|
@@ -3943,7 +3943,7 @@ class So extends jn {
|
|
|
3943
3943
|
const n = on.apply(this, arguments);
|
|
3944
3944
|
return e.handleShadowRoot(n), n;
|
|
3945
3945
|
}, this.app.nodes.clear(), this.observeRoot(window.document, () => {
|
|
3946
|
-
this.app.send(
|
|
3946
|
+
this.app.send(hr()), this.app.nodes.callNodeCallbacks(document, !0);
|
|
3947
3947
|
}, window.document.documentElement);
|
|
3948
3948
|
}
|
|
3949
3949
|
crossdomainObserve(e, n) {
|
|
@@ -4106,7 +4106,7 @@ function cn() {
|
|
|
4106
4106
|
const t = (/* @__PURE__ */ new Date()).getTimezoneOffset() * -1, e = t >= 0 ? "+" : "-", n = Math.floor(Math.abs(t) / 60), s = Math.abs(t) % 60;
|
|
4107
4107
|
return `UTC${e}${String(n).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
4108
4108
|
}
|
|
4109
|
-
const _o = (t) => new Promise((e) => setTimeout(e, t)),
|
|
4109
|
+
const _o = (t) => new Promise((e) => setTimeout(e, t)), he = {
|
|
4110
4110
|
// ask if there are any tabs alive
|
|
4111
4111
|
ask: "never-gonna-give-you-up",
|
|
4112
4112
|
// response from another tab
|
|
@@ -4126,14 +4126,14 @@ let No = class {
|
|
|
4126
4126
|
}, this.restartCanvasTracking = () => {
|
|
4127
4127
|
var a;
|
|
4128
4128
|
(a = this.canvasRecorder) == null || a.restartTracking();
|
|
4129
|
-
}, this.flushBuffer = async (a) => new Promise((
|
|
4129
|
+
}, this.flushBuffer = async (a) => new Promise((d) => {
|
|
4130
4130
|
let c = !1;
|
|
4131
4131
|
const u = [a.shift()];
|
|
4132
4132
|
for (; !c; ) {
|
|
4133
4133
|
const p = a[0];
|
|
4134
4134
|
!p || p[0] === 0 ? c = !0 : u.push(a.shift());
|
|
4135
4135
|
}
|
|
4136
|
-
this.postToWorker(u),
|
|
4136
|
+
this.postToWorker(u), d(null);
|
|
4137
4137
|
}), this.onUxtCb = [], this.contextId = Math.random().toString(36).slice(2), this.projectKey = e, Object.keys(s).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.'), s = {
|
|
4138
4138
|
...s,
|
|
4139
4139
|
canvas: {
|
|
@@ -4176,36 +4176,36 @@ let No = class {
|
|
|
4176
4176
|
useAnimationFrame: !1
|
|
4177
4177
|
}
|
|
4178
4178
|
};
|
|
4179
|
-
if (this.options =
|
|
4179
|
+
if (this.options = hi(o, s), !this.insideIframe && !this.options.forceSingleTab && globalThis && "BroadcastChannel" in globalThis) {
|
|
4180
4180
|
const a = location.hostname.split(".").slice(-2).join("_");
|
|
4181
4181
|
this.bc = new BroadcastChannel(`rick_${a}`);
|
|
4182
4182
|
}
|
|
4183
4183
|
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new ko(this, s), this.nodes = new yo(this.options.node_id), this.observer = new So(this, s), this.ticker = new Io(this), this.ticker.attach(() => this.commit()), this.debug = new bo(this.options.__debug__), this.session = new To(this, this.options), this.attributeSender = new Yi(this, !!this.options.disableStringDict), this.featureFlags = new er(this), this.tagWatcher = new $r(this.sessionStorage, this.debug.error, (a) => {
|
|
4184
4184
|
this.send(zr(a));
|
|
4185
|
-
}), this.session.attachUpdateCallback(({ userID: a, metadata:
|
|
4186
|
-
a != null && this.send(Er(a)),
|
|
4185
|
+
}), this.session.attachUpdateCallback(({ userID: a, metadata: d }) => {
|
|
4186
|
+
a != null && this.send(Er(a)), d != null && Object.entries(d).forEach(([c, u]) => this.send(os(c, u)));
|
|
4187
4187
|
}), n != null && this.session.applySessionHash(n), this.initWorker();
|
|
4188
4188
|
const l = this.session.getTabId();
|
|
4189
4189
|
if (this.insideIframe) {
|
|
4190
4190
|
const a = (c) => {
|
|
4191
4191
|
const { data: u } = c;
|
|
4192
|
-
u.line ===
|
|
4192
|
+
u.line === he.iframeId && (this.rootId = u.id, this.session.setSessionToken(u.token), this.frameOderNumber = u.frameOrderNumber, this.debug.log("starting iframe tracking", u), this.allowAppStart());
|
|
4193
4193
|
};
|
|
4194
4194
|
window.addEventListener("message", a), this.attachStopCallback(() => {
|
|
4195
4195
|
window.removeEventListener("message", a);
|
|
4196
4196
|
});
|
|
4197
|
-
const
|
|
4197
|
+
const d = this.initialHostName;
|
|
4198
4198
|
window.parent.postMessage({
|
|
4199
|
-
line:
|
|
4199
|
+
line: he.iframeSignal,
|
|
4200
4200
|
source: l,
|
|
4201
4201
|
context: this.contextId,
|
|
4202
|
-
domain:
|
|
4202
|
+
domain: d
|
|
4203
4203
|
}, "*");
|
|
4204
4204
|
} else {
|
|
4205
4205
|
let a = 0;
|
|
4206
|
-
const
|
|
4206
|
+
const d = (c) => {
|
|
4207
4207
|
const { data: u } = c;
|
|
4208
|
-
if (u.line ===
|
|
4208
|
+
if (u.line === he.iframeSignal) {
|
|
4209
4209
|
const p = u.domain, y = Array.from(document.querySelectorAll("iframe"));
|
|
4210
4210
|
this.pageFrames = y, (async () => {
|
|
4211
4211
|
let v = 0;
|
|
@@ -4216,7 +4216,7 @@ let No = class {
|
|
|
4216
4216
|
var D;
|
|
4217
4217
|
a++;
|
|
4218
4218
|
const A = this.session.getSessionToken(), B = {
|
|
4219
|
-
line:
|
|
4219
|
+
line: he.iframeId,
|
|
4220
4220
|
context: this.contextId,
|
|
4221
4221
|
domain: p,
|
|
4222
4222
|
id: T,
|
|
@@ -4231,7 +4231,7 @@ let No = class {
|
|
|
4231
4231
|
}
|
|
4232
4232
|
})();
|
|
4233
4233
|
}
|
|
4234
|
-
if (u.line ===
|
|
4234
|
+
if (u.line === he.iframeBatch) {
|
|
4235
4235
|
const y = u.messages.map((S) => {
|
|
4236
4236
|
if (S[0] === 20) {
|
|
4237
4237
|
let v = S;
|
|
@@ -4264,31 +4264,31 @@ let No = class {
|
|
|
4264
4264
|
this.messages.push(...y);
|
|
4265
4265
|
}
|
|
4266
4266
|
};
|
|
4267
|
-
window.addEventListener("message",
|
|
4268
|
-
window.removeEventListener("message",
|
|
4267
|
+
window.addEventListener("message", d), this.attachStopCallback(() => {
|
|
4268
|
+
window.removeEventListener("message", d);
|
|
4269
4269
|
});
|
|
4270
4270
|
}
|
|
4271
4271
|
this.bc !== null && (this.bc.postMessage({
|
|
4272
|
-
line:
|
|
4272
|
+
line: he.ask,
|
|
4273
4273
|
source: l,
|
|
4274
4274
|
context: this.contextId
|
|
4275
4275
|
}), this.startTimeout = setTimeout(() => {
|
|
4276
4276
|
this.allowAppStart();
|
|
4277
4277
|
}, 500), this.bc.onmessage = (a) => {
|
|
4278
4278
|
if (a.data.context !== this.contextId) {
|
|
4279
|
-
if (a.data.line ===
|
|
4280
|
-
const
|
|
4281
|
-
this.session.setSessionToken(
|
|
4279
|
+
if (a.data.line === he.resp) {
|
|
4280
|
+
const d = a.data.token;
|
|
4281
|
+
this.session.setSessionToken(d), this.allowAppStart();
|
|
4282
4282
|
}
|
|
4283
|
-
if (a.data.line ===
|
|
4284
|
-
const
|
|
4285
|
-
this.session.regenerateTabId(), this.session.setSessionToken(
|
|
4283
|
+
if (a.data.line === he.reg) {
|
|
4284
|
+
const d = a.data.token;
|
|
4285
|
+
this.session.regenerateTabId(), this.session.setSessionToken(d), this.allowAppStart();
|
|
4286
4286
|
}
|
|
4287
|
-
if (a.data.line ===
|
|
4288
|
-
const
|
|
4289
|
-
|
|
4290
|
-
line: a.data.source === l ?
|
|
4291
|
-
token:
|
|
4287
|
+
if (a.data.line === he.ask) {
|
|
4288
|
+
const d = this.session.getSessionToken();
|
|
4289
|
+
d && this.bc && this.bc.postMessage({
|
|
4290
|
+
line: a.data.source === l ? he.reg : he.resp,
|
|
4291
|
+
token: d,
|
|
4292
4292
|
source: l,
|
|
4293
4293
|
context: this.contextId
|
|
4294
4294
|
});
|
|
@@ -4366,7 +4366,7 @@ let No = class {
|
|
|
4366
4366
|
if (!(this.worker === void 0 || !this.messages.length)) {
|
|
4367
4367
|
if (this.insideIframe) {
|
|
4368
4368
|
window.parent.postMessage({
|
|
4369
|
-
line:
|
|
4369
|
+
line: he.iframeBatch,
|
|
4370
4370
|
messages: this.messages,
|
|
4371
4371
|
domain: this.initialHostName
|
|
4372
4372
|
}, "*"), this.commitCallbacks.forEach((e) => e(this.messages)), this.messages.length = 0;
|
|
@@ -4425,7 +4425,7 @@ let No = class {
|
|
|
4425
4425
|
// Use app.nodes.attachNodeListener for registered nodes instead
|
|
4426
4426
|
attachEventListener(e, n, s, i = !0, r = !0) {
|
|
4427
4427
|
i && (s = this.safe(s));
|
|
4428
|
-
const o = () => e ? li(e, n, s, r) : null, l = () => e ?
|
|
4428
|
+
const o = () => e ? li(e, n, s, r) : null, l = () => e ? di(e, n, s, r) : null;
|
|
4429
4429
|
this.attachStartCallback(o, i), this.attachStopCallback(l, i);
|
|
4430
4430
|
}
|
|
4431
4431
|
// TODO: full correct semantic
|
|
@@ -4470,8 +4470,8 @@ let No = class {
|
|
|
4470
4470
|
}
|
|
4471
4471
|
const r = this.options.ingestPoint, a = (/api\.openreplay\.com/.test(r) ? "https://app.openreplay.com/ingest" : r).replace(/ingest$/, `${n}/session/${s}`);
|
|
4472
4472
|
if (e != null && e.withCurrentTime) {
|
|
4473
|
-
const
|
|
4474
|
-
return `${a}?jumpto=${
|
|
4473
|
+
const d = ge() - i;
|
|
4474
|
+
return `${a}?jumpto=${d}`;
|
|
4475
4475
|
}
|
|
4476
4476
|
return a;
|
|
4477
4477
|
}
|
|
@@ -4551,7 +4551,7 @@ let No = class {
|
|
|
4551
4551
|
userCountry: o,
|
|
4552
4552
|
userDevice: l,
|
|
4553
4553
|
userOS: a,
|
|
4554
|
-
userState:
|
|
4554
|
+
userState: d,
|
|
4555
4555
|
projectID: c
|
|
4556
4556
|
} = await n.json();
|
|
4557
4557
|
this.session.assign({ projectID: c }), this.session.setUserInfo({
|
|
@@ -4560,7 +4560,7 @@ let No = class {
|
|
|
4560
4560
|
userCountry: o,
|
|
4561
4561
|
userDevice: l,
|
|
4562
4562
|
userOS: a,
|
|
4563
|
-
userState:
|
|
4563
|
+
userState: d
|
|
4564
4564
|
});
|
|
4565
4565
|
const u = { sessionToken: s, userUUID: "", sessionID: "" };
|
|
4566
4566
|
this.startCallbacks.forEach((S) => S(u)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(c, s)), await this.featureFlags.reloadFlags(s), await this.tagWatcher.fetchTags(this.options.ingestPoint, s), (y = this.conditionsManager) == null || y.processFlags(this.featureFlags.flags);
|
|
@@ -4649,7 +4649,7 @@ let No = class {
|
|
|
4649
4649
|
jsHeapSizeLimit: sn,
|
|
4650
4650
|
timezone: cn()
|
|
4651
4651
|
})
|
|
4652
|
-
}), { token: s, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState:
|
|
4652
|
+
}), { token: s, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState: d, beaconSizeLimit: c, projectID: u } = await n.json();
|
|
4653
4653
|
for ((y = this.worker) == null || y.postMessage({
|
|
4654
4654
|
type: "auth",
|
|
4655
4655
|
token: s,
|
|
@@ -4660,7 +4660,7 @@ let No = class {
|
|
|
4660
4660
|
userCountry: o,
|
|
4661
4661
|
userDevice: l,
|
|
4662
4662
|
userOS: a,
|
|
4663
|
-
userState:
|
|
4663
|
+
userState: d
|
|
4664
4664
|
}); this.bufferedMessages1.length > 0; )
|
|
4665
4665
|
await this.flushBuffer(this.bufferedMessages1);
|
|
4666
4666
|
this.postToWorker([["q_end"]]), this.clearBuffers();
|
|
@@ -4722,7 +4722,7 @@ let No = class {
|
|
|
4722
4722
|
return this.signalError(C, []), _e(C);
|
|
4723
4723
|
}
|
|
4724
4724
|
const {
|
|
4725
|
-
token:
|
|
4725
|
+
token: d,
|
|
4726
4726
|
userUUID: c,
|
|
4727
4727
|
projectID: u,
|
|
4728
4728
|
beaconSizeLimit: p,
|
|
@@ -4745,11 +4745,11 @@ let No = class {
|
|
|
4745
4745
|
canvasFPS: E,
|
|
4746
4746
|
assistOnly: P
|
|
4747
4747
|
} = await a.json();
|
|
4748
|
-
if (typeof
|
|
4748
|
+
if (typeof d != "string" || typeof c != "string" || typeof T != "number" && typeof T < "u" || typeof v != "string" || typeof S != "number" || typeof p != "number" && typeof p < "u") {
|
|
4749
4749
|
const C = `Incorrect server response: ${JSON.stringify(a)}`;
|
|
4750
4750
|
return this.signalError(C, []), _e(C);
|
|
4751
4751
|
}
|
|
4752
|
-
this.delay = S, this.session.setSessionToken(
|
|
4752
|
+
this.delay = S, this.session.setSessionToken(d), this.session.setUserInfo({
|
|
4753
4753
|
userBrowser: A,
|
|
4754
4754
|
userCity: B,
|
|
4755
4755
|
userCountry: D,
|
|
@@ -4762,11 +4762,11 @@ let No = class {
|
|
|
4762
4762
|
projectID: u
|
|
4763
4763
|
}), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
|
|
4764
4764
|
type: "auth",
|
|
4765
|
-
token:
|
|
4765
|
+
token: d,
|
|
4766
4766
|
beaconSizeLimit: p
|
|
4767
|
-
}), !l &&
|
|
4768
|
-
const V = { sessionToken:
|
|
4769
|
-
if (this.startCallbacks.forEach((C) => C(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint,
|
|
4767
|
+
}), !l && d === 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, F]) => this.send(os(C, F))), this.localStorage.setItem(this.options.local_uuid_key, c), this.compressionThreshold = y;
|
|
4768
|
+
const V = { sessionToken: d, userUUID: c, sessionID: v };
|
|
4769
|
+
if (this.startCallbacks.forEach((C) => C(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, d), this.activityState = Q.Active, L && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new po(this, {
|
|
4770
4770
|
fps: E,
|
|
4771
4771
|
quality: I,
|
|
4772
4772
|
isDebug: this.options.canvas.__save_canvas_locally,
|
|
@@ -4789,15 +4789,15 @@ let No = class {
|
|
|
4789
4789
|
j = F ? parseInt(F, 10) : void 0;
|
|
4790
4790
|
}
|
|
4791
4791
|
}
|
|
4792
|
-
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j,
|
|
4792
|
+
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, d, !!q).then((C) => {
|
|
4793
4793
|
C && this.onUxtCb.forEach((F) => F(C));
|
|
4794
4794
|
})), Co(V);
|
|
4795
4795
|
} catch (a) {
|
|
4796
4796
|
if (this.stop(), this.session.reset(), a === Ze)
|
|
4797
4797
|
return this.signalError(Ze, []), _e(Ze);
|
|
4798
4798
|
this._debug("session_start", a);
|
|
4799
|
-
const
|
|
4800
|
-
return this.signalError(
|
|
4799
|
+
const d = a instanceof Error ? a.message : a.toString();
|
|
4800
|
+
return this.signalError(d, []), _e(d);
|
|
4801
4801
|
}
|
|
4802
4802
|
}
|
|
4803
4803
|
addOnUxtCb(e) {
|
|
@@ -4936,16 +4936,16 @@ function Lo(t, e) {
|
|
|
4936
4936
|
}, e);
|
|
4937
4937
|
if (!Array.isArray(n.consoleMethods) || n.consoleMethods.length === 0)
|
|
4938
4938
|
return;
|
|
4939
|
-
const s = t.safe((a,
|
|
4939
|
+
const s = t.safe((a, d) => t.send(Sr(a, Do(d))));
|
|
4940
4940
|
let i = 0;
|
|
4941
4941
|
const r = () => {
|
|
4942
4942
|
i = 0;
|
|
4943
4943
|
};
|
|
4944
4944
|
t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
|
|
4945
|
-
const o = (a,
|
|
4945
|
+
const o = (a, d) => {
|
|
4946
4946
|
const c = {
|
|
4947
4947
|
apply: function(u, p, y) {
|
|
4948
|
-
Reflect.apply(u,
|
|
4948
|
+
Reflect.apply(u, d, y), i = i + 1, !(i > n.consoleThrottling) && s(u.name, y);
|
|
4949
4949
|
}
|
|
4950
4950
|
};
|
|
4951
4951
|
n.consoleMethods.forEach((u) => {
|
|
@@ -4953,7 +4953,7 @@ function Lo(t, e) {
|
|
|
4953
4953
|
t.debug.error(`OpenReplay: unsupported console method "${u}"`);
|
|
4954
4954
|
return;
|
|
4955
4955
|
}
|
|
4956
|
-
const p =
|
|
4956
|
+
const p = d.console[u];
|
|
4957
4957
|
a[u] = new Proxy(p, c);
|
|
4958
4958
|
});
|
|
4959
4959
|
}, l = t.safe((a) => o(a.console, a));
|
|
@@ -4976,7 +4976,7 @@ function Fo() {
|
|
|
4976
4976
|
return this[v];
|
|
4977
4977
|
};
|
|
4978
4978
|
}
|
|
4979
|
-
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"],
|
|
4979
|
+
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"], d = ["evalOrigin"], c = r.concat(o, l, a, d);
|
|
4980
4980
|
function u(v) {
|
|
4981
4981
|
if (v)
|
|
4982
4982
|
for (var T = 0; T < c.length; T++)
|
|
@@ -5067,15 +5067,15 @@ function Fo() {
|
|
|
5067
5067
|
extractLocation: function(a) {
|
|
5068
5068
|
if (a.indexOf(":") === -1)
|
|
5069
5069
|
return [a];
|
|
5070
|
-
var
|
|
5070
|
+
var d = /(.+?)(?::(\d+))?(?::(\d+))?$/, c = d.exec(a.replace(/[()]/g, ""));
|
|
5071
5071
|
return [c[1], c[2] || void 0, c[3] || void 0];
|
|
5072
5072
|
},
|
|
5073
5073
|
parseV8OrIE: function(a) {
|
|
5074
|
-
var
|
|
5074
|
+
var d = a.stack.split(`
|
|
5075
5075
|
`).filter(function(c) {
|
|
5076
5076
|
return !!c.match(r);
|
|
5077
5077
|
}, this);
|
|
5078
|
-
return
|
|
5078
|
+
return d.map(function(c) {
|
|
5079
5079
|
c.indexOf("(eval ") > -1 && (c = c.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
5080
5080
|
var u = c.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = u.match(/ (\(.+\)$)/);
|
|
5081
5081
|
u = p ? u.replace(p[0], "") : u;
|
|
@@ -5090,11 +5090,11 @@ function Fo() {
|
|
|
5090
5090
|
}, this);
|
|
5091
5091
|
},
|
|
5092
5092
|
parseFFOrSafari: function(a) {
|
|
5093
|
-
var
|
|
5093
|
+
var d = a.stack.split(`
|
|
5094
5094
|
`).filter(function(c) {
|
|
5095
5095
|
return !c.match(o);
|
|
5096
5096
|
}, this);
|
|
5097
|
-
return
|
|
5097
|
+
return d.map(function(c) {
|
|
5098
5098
|
if (c.indexOf(" > eval") > -1 && (c = c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), c.indexOf("@") === -1 && c.indexOf(":") === -1)
|
|
5099
5099
|
return new s({
|
|
5100
5100
|
functionName: c
|
|
@@ -5116,9 +5116,9 @@ function Fo() {
|
|
|
5116
5116
|
`).length ? this.parseOpera9(a) : a.stack ? this.parseOpera11(a) : this.parseOpera10(a);
|
|
5117
5117
|
},
|
|
5118
5118
|
parseOpera9: function(a) {
|
|
5119
|
-
for (var
|
|
5119
|
+
for (var d = /Line (\d+).*script (?:in )?(\S+)/i, c = a.message.split(`
|
|
5120
5120
|
`), u = [], p = 2, y = c.length; p < y; p += 2) {
|
|
5121
|
-
var S =
|
|
5121
|
+
var S = d.exec(c[p]);
|
|
5122
5122
|
S && u.push(new s({
|
|
5123
5123
|
fileName: S[2],
|
|
5124
5124
|
lineNumber: S[1],
|
|
@@ -5128,9 +5128,9 @@ function Fo() {
|
|
|
5128
5128
|
return u;
|
|
5129
5129
|
},
|
|
5130
5130
|
parseOpera10: function(a) {
|
|
5131
|
-
for (var
|
|
5131
|
+
for (var d = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, c = a.stacktrace.split(`
|
|
5132
5132
|
`), u = [], p = 0, y = c.length; p < y; p += 2) {
|
|
5133
|
-
var S =
|
|
5133
|
+
var S = d.exec(c[p]);
|
|
5134
5134
|
S && u.push(
|
|
5135
5135
|
new s({
|
|
5136
5136
|
functionName: S[3] || void 0,
|
|
@@ -5144,11 +5144,11 @@ function Fo() {
|
|
|
5144
5144
|
},
|
|
5145
5145
|
// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
5146
5146
|
parseOpera11: function(a) {
|
|
5147
|
-
var
|
|
5147
|
+
var d = a.stack.split(`
|
|
5148
5148
|
`).filter(function(c) {
|
|
5149
5149
|
return !!c.match(i) && !c.match(/^Error created at/);
|
|
5150
5150
|
}, this);
|
|
5151
|
-
return
|
|
5151
|
+
return d.map(function(c) {
|
|
5152
5152
|
var u = c.split("@"), p = this.extractLocation(u.pop()), y = u.shift() || "", S = y.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, v;
|
|
5153
5153
|
y.match(/\(([^)]*)\)/) && (v = y.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
|
|
5154
5154
|
var T = v === void 0 || v === "[arguments not available]" ? void 0 : v.split(",");
|
|
@@ -5232,14 +5232,14 @@ const zo = "https://static.openreplay.com/tracker/placeholder.jpeg";
|
|
|
5232
5232
|
function Uo(t) {
|
|
5233
5233
|
function e(l, a) {
|
|
5234
5234
|
t.attributeSender.sendSetAttribute(l, "src", zo);
|
|
5235
|
-
const { width:
|
|
5236
|
-
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(
|
|
5235
|
+
const { width: d, height: c } = a.getBoundingClientRect();
|
|
5236
|
+
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(d)), a.hasAttribute("height") || t.attributeSender.sendSetAttribute(l, "height", String(c));
|
|
5237
5237
|
}
|
|
5238
5238
|
const n = function(l, a) {
|
|
5239
|
-
const { srcset:
|
|
5240
|
-
if (!
|
|
5239
|
+
const { srcset: d } = a;
|
|
5240
|
+
if (!d)
|
|
5241
5241
|
return;
|
|
5242
|
-
const c =
|
|
5242
|
+
const c = d.split(d.match(/,\s+/) ? /,\s+/ : ",").map((u) => _s(u)).join(", ");
|
|
5243
5243
|
t.attributeSender.sendSetAttribute(l, "srcset", c);
|
|
5244
5244
|
}, s = function(l, a) {
|
|
5245
5245
|
a.src.length > nr && e(l, a), t.send(vn(l, "src", a.src, t.getBaseHref()));
|
|
@@ -5252,10 +5252,10 @@ function Uo(t) {
|
|
|
5252
5252
|
}), o = ci(t.safe((l) => {
|
|
5253
5253
|
for (const a of l)
|
|
5254
5254
|
if (a.type === "attributes") {
|
|
5255
|
-
const
|
|
5255
|
+
const d = a.target, c = t.nodes.getID(d);
|
|
5256
5256
|
if (c === void 0)
|
|
5257
5257
|
return;
|
|
5258
|
-
a.attributeName === "src" && s(c,
|
|
5258
|
+
a.attributeName === "src" && s(c, d), a.attributeName === "srcset" && n(c, d);
|
|
5259
5259
|
}
|
|
5260
5260
|
}));
|
|
5261
5261
|
t.attachStopCallback(() => {
|
|
@@ -5365,7 +5365,7 @@ function Go(t, e) {
|
|
|
5365
5365
|
a(u, p.checked);
|
|
5366
5366
|
});
|
|
5367
5367
|
}, 3);
|
|
5368
|
-
function
|
|
5368
|
+
function d(c, u, p, y) {
|
|
5369
5369
|
const { value: S, mask: v } = s(c, u), T = wi(u);
|
|
5370
5370
|
t.send(Mr(c, S, v !== 0, T, p, y));
|
|
5371
5371
|
}
|
|
@@ -5380,7 +5380,7 @@ function Go(t, e) {
|
|
|
5380
5380
|
}, T = () => {
|
|
5381
5381
|
y === 0 && p !== 0 && (y = ge() - p);
|
|
5382
5382
|
}, A = () => {
|
|
5383
|
-
p !== 0 && (S = ge() - p),
|
|
5383
|
+
p !== 0 && (S = ge() - p), d(u, c, y, S), y = 0, S = 0, p = 0;
|
|
5384
5384
|
};
|
|
5385
5385
|
t.nodes.attachNodeListener(c, "focus", v), t.nodes.attachNodeListener(c, "input", T), t.nodes.attachNodeListener(c, "change", A);
|
|
5386
5386
|
return;
|
|
@@ -5428,16 +5428,16 @@ function ot(t, e, n) {
|
|
|
5428
5428
|
if (ue.timeoutMs !== void 0 && l > ue.timeoutMs)
|
|
5429
5429
|
throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
|
|
5430
5430
|
let a = ct(Xo(r)) || ct(...Jo(r)) || ct(...Yo(r)) || ct(Qo(r)) || [Rs()];
|
|
5431
|
-
const
|
|
5431
|
+
const d = Zo(r);
|
|
5432
5432
|
if (e == "all")
|
|
5433
|
-
|
|
5433
|
+
d && (a = a.concat(a.filter(dn).map((c) => at(c, d))));
|
|
5434
5434
|
else if (e == "two")
|
|
5435
|
-
a = a.slice(0, 1),
|
|
5435
|
+
a = a.slice(0, 1), d && (a = a.concat(a.filter(dn).map((c) => at(c, d))));
|
|
5436
5436
|
else if (e == "one") {
|
|
5437
5437
|
const [c] = a = a.slice(0, 1);
|
|
5438
|
-
|
|
5438
|
+
d && dn(c) && (a = [at(c, d)]);
|
|
5439
5439
|
} else
|
|
5440
|
-
e == "none" && (a = [Rs()],
|
|
5440
|
+
e == "none" && (a = [Rs()], d && (a = [at(a[0], d)]));
|
|
5441
5441
|
for (let c of a)
|
|
5442
5442
|
c.level = o;
|
|
5443
5443
|
if (i.push(a), i.length >= ue.seedMinLength && (s = Ns(i, n), s))
|
|
@@ -5527,7 +5527,7 @@ function at(t, e) {
|
|
|
5527
5527
|
penalty: t.penalty + 1
|
|
5528
5528
|
};
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5530
|
+
function dn(t) {
|
|
5531
5531
|
return t.name !== "html" && !t.name.startsWith("#");
|
|
5532
5532
|
}
|
|
5533
5533
|
function ct(...t) {
|
|
@@ -5619,7 +5619,7 @@ function ia(t, e) {
|
|
|
5619
5619
|
}
|
|
5620
5620
|
return "";
|
|
5621
5621
|
}
|
|
5622
|
-
let i = -1, r = -1, o = !1, l = null, a = 0,
|
|
5622
|
+
let i = -1, r = -1, o = !1, l = null, a = 0, d = {}, c = 0, u = 0, p = 0, y = 0, S;
|
|
5623
5623
|
const v = 8e-3, T = 225;
|
|
5624
5624
|
function A() {
|
|
5625
5625
|
const k = y / T;
|
|
@@ -5633,13 +5633,13 @@ function ia(t, e) {
|
|
|
5633
5633
|
t.attachStartCallback(() => {
|
|
5634
5634
|
S = setInterval(() => A(), T);
|
|
5635
5635
|
}), t.attachStopCallback(() => {
|
|
5636
|
-
i = -1, r = -1, o = !1, l = null,
|
|
5636
|
+
i = -1, r = -1, o = !1, l = null, d = {}, S && clearInterval(S);
|
|
5637
5637
|
});
|
|
5638
5638
|
const B = () => {
|
|
5639
5639
|
o && (t.send(wr(i, r)), o = !1);
|
|
5640
5640
|
}, D = (k, N = !1) => {
|
|
5641
5641
|
function O(I, E, P) {
|
|
5642
|
-
return
|
|
5642
|
+
return d[I] = d[I] || na(E, k, P);
|
|
5643
5643
|
}
|
|
5644
5644
|
const L = N ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
|
|
5645
5645
|
L(k.documentElement, "mouseover", (I) => {
|
|
@@ -5686,10 +5686,10 @@ function ra(t) {
|
|
|
5686
5686
|
const l = o.substr(0, 10) === "data:image" ? 0 : t[o];
|
|
5687
5687
|
if (l === void 0)
|
|
5688
5688
|
continue;
|
|
5689
|
-
const a = r.getBoundingClientRect(),
|
|
5690
|
-
if (u <=
|
|
5689
|
+
const a = r.getBoundingClientRect(), d = 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);
|
|
5690
|
+
if (u <= d || p <= c)
|
|
5691
5691
|
continue;
|
|
5692
|
-
const y = (u -
|
|
5692
|
+
const y = (u - d) * (p - c);
|
|
5693
5693
|
e.push({ time: l, area: y });
|
|
5694
5694
|
}
|
|
5695
5695
|
return e;
|
|
@@ -5712,43 +5712,43 @@ function aa(t, e) {
|
|
|
5712
5712
|
if ("PerformanceObserver" in window || (n.captureResourceTimings = !1), !n.captureResourceTimings)
|
|
5713
5713
|
return;
|
|
5714
5714
|
let s = {};
|
|
5715
|
-
function i(
|
|
5715
|
+
function i(d) {
|
|
5716
5716
|
var u;
|
|
5717
|
-
if (
|
|
5717
|
+
if (d.duration < 0 || !ai(d.name) || t.isServiceURL(d.name))
|
|
5718
5718
|
return;
|
|
5719
|
-
s !== null && (s[
|
|
5719
|
+
s !== null && (s[d.name] = d.startTime + d.duration);
|
|
5720
5720
|
let c = !1;
|
|
5721
5721
|
(u = n.excludedResourceUrls) == null || u.forEach((p) => {
|
|
5722
|
-
if (
|
|
5722
|
+
if (d.name.startsWith(p)) {
|
|
5723
5723
|
c = !0;
|
|
5724
5724
|
return;
|
|
5725
5725
|
}
|
|
5726
5726
|
}), !c && t.send(fi(
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5727
|
+
d.startTime + Ve(),
|
|
5728
|
+
d.duration,
|
|
5729
|
+
d.responseStart && d.startTime ? d.responseStart - d.startTime : 0,
|
|
5730
|
+
d.transferSize > d.encodedBodySize ? d.transferSize - d.encodedBodySize : 0,
|
|
5731
|
+
d.encodedBodySize || 0,
|
|
5732
|
+
d.decodedBodySize || 0,
|
|
5733
|
+
d.name,
|
|
5734
|
+
d.initiatorType,
|
|
5735
|
+
d.transferSize,
|
|
5736
5736
|
// @ts-ignore
|
|
5737
|
-
|
|
5737
|
+
d.responseStatus && d.responseStatus === 304 || d.transferSize === 0
|
|
5738
5738
|
));
|
|
5739
5739
|
}
|
|
5740
|
-
const r = new PerformanceObserver((
|
|
5740
|
+
const r = new PerformanceObserver((d) => d.getEntries().forEach(i));
|
|
5741
5741
|
let o;
|
|
5742
|
-
t.attachStartCallback(function({ sessionID:
|
|
5743
|
-
|
|
5742
|
+
t.attachStartCallback(function({ sessionID: d }) {
|
|
5743
|
+
d !== o && (performance.getEntriesByType("resource").forEach(i), o = d), r.observe({ entryTypes: ["resource"] });
|
|
5744
5744
|
}), t.attachStopCallback(function() {
|
|
5745
5745
|
r.disconnect();
|
|
5746
5746
|
});
|
|
5747
5747
|
let l = 0, a = 0;
|
|
5748
5748
|
if (n.capturePageLoadTimings) {
|
|
5749
|
-
let
|
|
5749
|
+
let d = !1;
|
|
5750
5750
|
t.ticker.attach(() => {
|
|
5751
|
-
if (!
|
|
5751
|
+
if (!d && ((l === 0 || a === 0) && performance.getEntriesByType("paint").forEach((c) => {
|
|
5752
5752
|
const { name: u, startTime: p } = c;
|
|
5753
5753
|
switch (u) {
|
|
5754
5754
|
case "first-paint":
|
|
@@ -5759,7 +5759,7 @@ function aa(t, e) {
|
|
|
5759
5759
|
break;
|
|
5760
5760
|
}
|
|
5761
5761
|
}), performance.timing.loadEventEnd || performance.now() > 3e4)) {
|
|
5762
|
-
|
|
5762
|
+
d = !0;
|
|
5763
5763
|
const {
|
|
5764
5764
|
// should be ok to use here, (https://github.com/mdn/content/issues/4713)
|
|
5765
5765
|
// since it is compared with the values obtained on the page load (before any possible sleep state)
|
|
@@ -5778,20 +5778,20 @@ function aa(t, e) {
|
|
|
5778
5778
|
}, 30);
|
|
5779
5779
|
}
|
|
5780
5780
|
if (n.capturePageRenderTimings) {
|
|
5781
|
-
let
|
|
5781
|
+
let d = 0, c = 0, u = 0, p = null, y = !1;
|
|
5782
5782
|
t.ticker.attach(() => {
|
|
5783
5783
|
if (y)
|
|
5784
5784
|
return;
|
|
5785
5785
|
const S = performance.now();
|
|
5786
|
-
if (s !== null && (
|
|
5786
|
+
if (s !== null && (d = Math.max.apply(null, Object.keys(s).map((v) => s[v])), S - d > 1e3 && (p = ra(s), s = null)), u !== null && (S - u > 50 && (c = S), u = S - c > 5e3 ? null : S), p !== null && u === null || S > 3e4) {
|
|
5787
5787
|
y = !0, s = null;
|
|
5788
5788
|
const v = p === null ? 0 : oa(a || l, p), { domContentLoadedEventEnd: T, navigationStart: A } = performance.timing, B = u === null ? Math.max(c, a, T - A || 0) : 0;
|
|
5789
|
-
t.send(kr(v, a >
|
|
5789
|
+
t.send(kr(v, a > d ? a : d, B));
|
|
5790
5790
|
}
|
|
5791
5791
|
});
|
|
5792
5792
|
}
|
|
5793
5793
|
}
|
|
5794
|
-
function
|
|
5794
|
+
function hn(t) {
|
|
5795
5795
|
const e = t.defaultView;
|
|
5796
5796
|
return [
|
|
5797
5797
|
e && e.scrollX || t.documentElement && t.documentElement.scrollLeft || t.body && t.body.scrollLeft || 0,
|
|
@@ -5802,19 +5802,19 @@ function ca(t, e) {
|
|
|
5802
5802
|
let n = !1;
|
|
5803
5803
|
const s = /* @__PURE__ */ new Map();
|
|
5804
5804
|
function i(l) {
|
|
5805
|
-
gi(l) && (Te(l) && s.set(l, [l.scrollLeft, l.scrollTop]), kt(l) && s.set(l,
|
|
5805
|
+
gi(l) && (Te(l) && s.set(l, [l.scrollLeft, l.scrollTop]), kt(l) && s.set(l, hn(l)));
|
|
5806
5806
|
}
|
|
5807
5807
|
const r = t.safe(() => {
|
|
5808
|
-
e || t.send(
|
|
5808
|
+
e || t.send(dr(...hn(document)));
|
|
5809
5809
|
}), o = t.safe((l, a) => {
|
|
5810
|
-
const
|
|
5811
|
-
|
|
5810
|
+
const d = t.nodes.getID(a);
|
|
5811
|
+
d !== void 0 && t.send(br(d, l[0], l[1]));
|
|
5812
5812
|
});
|
|
5813
5813
|
t.attachStartCallback(r), t.attachStopCallback(() => {
|
|
5814
5814
|
n = !1, s.clear();
|
|
5815
5815
|
}), t.nodes.attachNodeCallback((l, a) => {
|
|
5816
|
-
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && s.set(l,
|
|
5817
|
-
i(
|
|
5816
|
+
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && s.set(l, hn(l))), Ot(l) && t.nodes.attachNodeListener(l, "scroll", (d) => {
|
|
5817
|
+
i(d.target);
|
|
5818
5818
|
});
|
|
5819
5819
|
}), t.attachEventListener(document, "scroll", (l) => {
|
|
5820
5820
|
const a = l.target;
|
|
@@ -5830,11 +5830,11 @@ function ca(t, e) {
|
|
|
5830
5830
|
function la(t) {
|
|
5831
5831
|
let e, n, s, i, r = document.referrer;
|
|
5832
5832
|
const o = t.safe(() => {
|
|
5833
|
-
const { URL:
|
|
5834
|
-
|
|
5833
|
+
const { URL: d } = document;
|
|
5834
|
+
d !== e && (e = d, t.send(Ur(e, r, i, document.title)), i = 0, r = e);
|
|
5835
5835
|
}), l = t.safe(() => {
|
|
5836
|
-
const { innerWidth:
|
|
5837
|
-
(
|
|
5836
|
+
const { innerWidth: d, innerHeight: c } = window;
|
|
5837
|
+
(d !== n || c !== s) && (n = d, s = c, t.send(lr(n, s)));
|
|
5838
5838
|
}), a = document.hidden === void 0 ? Function.prototype : t.safe(() => t.send(Nr(document.hidden)));
|
|
5839
5839
|
t.attachStartCallback(() => {
|
|
5840
5840
|
e = null, i = Ve(), n = s = -1, o(), l(), a();
|
|
@@ -5844,12 +5844,12 @@ function Ls(t) {
|
|
|
5844
5844
|
return Ot(t) && // @ts-ignore
|
|
5845
5845
|
!!t.adoptedStyleSheets;
|
|
5846
5846
|
}
|
|
5847
|
-
let
|
|
5847
|
+
let da = 15;
|
|
5848
5848
|
function Ii() {
|
|
5849
|
-
return
|
|
5849
|
+
return da++;
|
|
5850
5850
|
}
|
|
5851
5851
|
const lt = /* @__PURE__ */ new Map();
|
|
5852
|
-
function
|
|
5852
|
+
function ha(t) {
|
|
5853
5853
|
if (t === null || !Ls(document))
|
|
5854
5854
|
return;
|
|
5855
5855
|
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), s = (o) => setTimeout(() => {
|
|
@@ -5858,7 +5858,7 @@ function da(t) {
|
|
|
5858
5858
|
return;
|
|
5859
5859
|
let a = n.get(l);
|
|
5860
5860
|
a || (a = []);
|
|
5861
|
-
const
|
|
5861
|
+
const d = [], c = o.adoptedStyleSheets;
|
|
5862
5862
|
if (c && Symbol.iterator in c)
|
|
5863
5863
|
for (const u of c) {
|
|
5864
5864
|
let p = e.get(u);
|
|
@@ -5868,20 +5868,20 @@ function da(t) {
|
|
|
5868
5868
|
for (let v = 0; v < S.length; v++)
|
|
5869
5869
|
t.send(Sn(p, S[v].cssText, v, t.getBaseHref()));
|
|
5870
5870
|
}
|
|
5871
|
-
|
|
5871
|
+
d.push(p);
|
|
5872
5872
|
}
|
|
5873
5873
|
if (Symbol.iterator in a)
|
|
5874
5874
|
for (const u of a)
|
|
5875
|
-
|
|
5876
|
-
n.set(l,
|
|
5875
|
+
d.includes(u) || t.send(Lr(u, l));
|
|
5876
|
+
n.set(l, d);
|
|
5877
5877
|
}, 20);
|
|
5878
5878
|
function i(o) {
|
|
5879
5879
|
const l = Object.getOwnPropertyDescriptor(o, "adoptedStyleSheets");
|
|
5880
5880
|
l && Object.defineProperty(o, "adoptedStyleSheets", {
|
|
5881
5881
|
...l,
|
|
5882
5882
|
set: function(a) {
|
|
5883
|
-
const
|
|
5884
|
-
return s(this),
|
|
5883
|
+
const d = l.set.call(this, a);
|
|
5884
|
+
return s(this), d;
|
|
5885
5885
|
}
|
|
5886
5886
|
});
|
|
5887
5887
|
}
|
|
@@ -5890,14 +5890,14 @@ function da(t) {
|
|
|
5890
5890
|
return;
|
|
5891
5891
|
o.__openreplay_adpss_patched__ = !0, i(o.Document.prototype), i(o.ShadowRoot.prototype);
|
|
5892
5892
|
const { replace: l, replaceSync: a } = o.CSSStyleSheet.prototype;
|
|
5893
|
-
o.CSSStyleSheet.prototype.replace = function(
|
|
5894
|
-
return l.call(this,
|
|
5893
|
+
o.CSSStyleSheet.prototype.replace = function(d) {
|
|
5894
|
+
return l.call(this, d).then((c) => {
|
|
5895
5895
|
const u = e.get(this);
|
|
5896
|
-
return u && t.send(ls(u,
|
|
5896
|
+
return u && t.send(ls(u, d, t.getBaseHref())), c;
|
|
5897
5897
|
});
|
|
5898
|
-
}, o.CSSStyleSheet.prototype.replaceSync = function(
|
|
5898
|
+
}, o.CSSStyleSheet.prototype.replaceSync = function(d) {
|
|
5899
5899
|
const c = e.get(this);
|
|
5900
|
-
return c && t.send(ls(c,
|
|
5900
|
+
return c && t.send(ls(c, d, t.getBaseHref())), a.call(this, d);
|
|
5901
5901
|
};
|
|
5902
5902
|
};
|
|
5903
5903
|
r(window), t.observer.attachContextCallback(t.safe(r)), t.attachStopCallback(() => {
|
|
@@ -5917,7 +5917,7 @@ function ua(t) {
|
|
|
5917
5917
|
}
|
|
5918
5918
|
const e = t.safe((i, r, o) => {
|
|
5919
5919
|
const l = lt.get(i);
|
|
5920
|
-
l && (typeof o == "string" ? t.send(Sn(l, o, r, t.getBaseHref())) : t.send(
|
|
5920
|
+
l && (typeof o == "string" ? t.send(Sn(l, o, r, t.getBaseHref())) : t.send(ds(l, r)));
|
|
5921
5921
|
}), n = t.safe((i) => {
|
|
5922
5922
|
let r = i;
|
|
5923
5923
|
for (; r.parentRule; )
|
|
@@ -5932,19 +5932,19 @@ function ua(t) {
|
|
|
5932
5932
|
t.debug.warn("No sheedID found for", o, lt);
|
|
5933
5933
|
return;
|
|
5934
5934
|
}
|
|
5935
|
-
const a = r.cssText,
|
|
5936
|
-
c >= 0 ? (t.send(Sn(l, a, c, t.getBaseHref())), t.send(
|
|
5935
|
+
const a = r.cssText, d = o.cssRules, c = Array.from(d).indexOf(r);
|
|
5936
|
+
c >= 0 ? (t.send(Sn(l, a, c, t.getBaseHref())), t.send(ds(l, c + 1))) : t.debug.warn("Rule index not found in", o, r);
|
|
5937
5937
|
}), s = t.safe((i) => {
|
|
5938
5938
|
const { insertRule: r, deleteRule: o } = i.CSSStyleSheet.prototype, { insertRule: l, deleteRule: a } = i.CSSGroupingRule.prototype;
|
|
5939
|
-
i.CSSStyleSheet.prototype.insertRule = function(
|
|
5940
|
-
return e(this, c,
|
|
5941
|
-
}, i.CSSStyleSheet.prototype.deleteRule = function(
|
|
5942
|
-
return e(this,
|
|
5943
|
-
}, i.CSSGroupingRule.prototype.insertRule = function(
|
|
5944
|
-
const u = l.call(this,
|
|
5939
|
+
i.CSSStyleSheet.prototype.insertRule = function(d, c = 0) {
|
|
5940
|
+
return e(this, c, d), r.call(this, d, c);
|
|
5941
|
+
}, i.CSSStyleSheet.prototype.deleteRule = function(d) {
|
|
5942
|
+
return e(this, d), o.call(this, d);
|
|
5943
|
+
}, i.CSSGroupingRule.prototype.insertRule = function(d, c = 0) {
|
|
5944
|
+
const u = l.call(this, d, c);
|
|
5945
5945
|
return n(this), u;
|
|
5946
|
-
}, i.CSSGroupingRule.prototype.deleteRule = function(
|
|
5947
|
-
const c = a.call(this,
|
|
5946
|
+
}, i.CSSGroupingRule.prototype.deleteRule = function(d = 0) {
|
|
5947
|
+
const c = a.call(this, d);
|
|
5948
5948
|
return n(this), c;
|
|
5949
5949
|
};
|
|
5950
5950
|
});
|
|
@@ -5957,8 +5957,8 @@ function ua(t) {
|
|
|
5957
5957
|
const o = i.sheet, l = Ii();
|
|
5958
5958
|
lt.set(o, l), t.send(ui(l, r));
|
|
5959
5959
|
const a = o.cssRules;
|
|
5960
|
-
for (let
|
|
5961
|
-
e(o,
|
|
5960
|
+
for (let d = 0; d < a.length; d++)
|
|
5961
|
+
e(o, d, a[d].cssText);
|
|
5962
5962
|
});
|
|
5963
5963
|
}
|
|
5964
5964
|
function fa(t) {
|
|
@@ -5993,8 +5993,8 @@ function pa(t) {
|
|
|
5993
5993
|
o[2] && t.safe(() => {
|
|
5994
5994
|
l = JSON.stringify(o[2]);
|
|
5995
5995
|
});
|
|
5996
|
-
const a = [o[0], o[1], l],
|
|
5997
|
-
|
|
5996
|
+
const a = [o[0], o[1], l], d = e.get(s.document) || [];
|
|
5997
|
+
d.push(a), e.set(s.document, d);
|
|
5998
5998
|
const c = s === window ? 0 : t.nodes.getID(s.document);
|
|
5999
5999
|
if (c === void 0)
|
|
6000
6000
|
return;
|
|
@@ -6064,10 +6064,10 @@ function ga(t, e, n, s, i) {
|
|
|
6064
6064
|
function a(p) {
|
|
6065
6065
|
return t.debug.log("Openreplay: capturing API request error", p), ma(p) && p.response ? r(p.response) : p instanceof Error && t.send(Et(p, [])), Promise.reject(p);
|
|
6066
6066
|
}
|
|
6067
|
-
function
|
|
6067
|
+
function d(p) {
|
|
6068
6068
|
t.debug.log("Openreplay: failed API request, skipping", p);
|
|
6069
6069
|
}
|
|
6070
|
-
const c = e.interceptors.request.use(o,
|
|
6070
|
+
const c = e.interceptors.request.use(o, d, {
|
|
6071
6071
|
synchronous: !0
|
|
6072
6072
|
}), u = e.interceptors.response.use(l, a, {
|
|
6073
6073
|
synchronous: !0
|
|
@@ -6230,11 +6230,11 @@ class Sa {
|
|
|
6230
6230
|
typeof i != "string" && !(i != null && i.url) || (i instanceof URL || typeof i == "string" ? this.isServiceUrl(String(i)) : this.isServiceUrl(String(i.url))))
|
|
6231
6231
|
return e.apply(window, s);
|
|
6232
6232
|
const l = new Un(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
6233
|
-
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a,
|
|
6233
|
+
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a, d) => {
|
|
6234
6234
|
if (!(this.tokenUrlMatcher !== void 0 && !this.tokenUrlMatcher(l.url))) {
|
|
6235
6235
|
if (s[1] === void 0 && s[0] instanceof Request)
|
|
6236
|
-
return s[0].headers.append(a,
|
|
6237
|
-
s[1] || (s[1] = {}), s[1].headers === void 0 && (s[1] = { ...s[1], headers: {} }), s[1].headers instanceof Headers ? s[1].headers.append(a,
|
|
6236
|
+
return s[0].headers.append(a, d);
|
|
6237
|
+
s[1] || (s[1] = {}), s[1].headers === void 0 && (s[1] = { ...s[1], headers: {} }), s[1].headers instanceof Headers ? s[1].headers.append(a, d) : Array.isArray(s[1].headers) ? s[1].headers.push([a, d]) : s[1].headers[a] = d;
|
|
6238
6238
|
}
|
|
6239
6239
|
}), e.apply(window, s).then(this.afterFetch(l)).catch((a) => {
|
|
6240
6240
|
throw l.endTime = performance.now(), l.duration = l.endTime - (l.startTime || l.endTime), a;
|
|
@@ -6431,8 +6431,8 @@ class Ia {
|
|
|
6431
6431
|
o.requestData = Hn(r), o.startTime || (o.startTime = performance.now());
|
|
6432
6432
|
const a = e.apply(n, s);
|
|
6433
6433
|
a ? (o.endTime = performance.now(), o.duration = o.endTime - (o.startTime || o.endTime), o.status = 0, o.statusText = "Sent", o.readyState = 4) : (o.status = 500, o.statusText = "Unknown");
|
|
6434
|
-
const
|
|
6435
|
-
return
|
|
6434
|
+
const d = o.getMessage();
|
|
6435
|
+
return d && this.sendMessage(d), a;
|
|
6436
6436
|
}
|
|
6437
6437
|
}
|
|
6438
6438
|
class Ge {
|
|
@@ -6497,7 +6497,7 @@ function _a(t, e = {}) {
|
|
|
6497
6497
|
}
|
|
6498
6498
|
return JSON.stringify(c);
|
|
6499
6499
|
}
|
|
6500
|
-
const
|
|
6500
|
+
const d = (c) => {
|
|
6501
6501
|
if (n.useProxy)
|
|
6502
6502
|
return Ca(c, n.ignoreHeaders, o, l, (D) => t.send(D), (D) => t.isServiceURL(D), n.tokenUrlMatcher);
|
|
6503
6503
|
const u = c.fetch.bind(c), p = (D, k = {}) => {
|
|
@@ -6584,18 +6584,18 @@ function _a(t, e = {}) {
|
|
|
6584
6584
|
}
|
|
6585
6585
|
n.axiosInstances || (c.XMLHttpRequest.prototype.open = T, c.XMLHttpRequest.prototype.send = A, c.XMLHttpRequest.prototype.setRequestHeader = B);
|
|
6586
6586
|
};
|
|
6587
|
-
|
|
6587
|
+
d(window), n.axiosInstances && n.axiosInstances.forEach((c) => {
|
|
6588
6588
|
ga(t, c, n, l, a);
|
|
6589
|
-
}), n.captureInIframes && t.observer.attachContextCallback(t.safe(
|
|
6589
|
+
}), n.captureInIframes && t.observer.attachContextCallback(t.safe(d));
|
|
6590
6590
|
}
|
|
6591
6591
|
function Na(t) {
|
|
6592
6592
|
t.attachEventListener(document, "selectionchange", () => {
|
|
6593
6593
|
const e = document.getSelection();
|
|
6594
6594
|
if (e !== null && !e.isCollapsed) {
|
|
6595
6595
|
const n = t.nodes.getID(e.anchorNode), s = t.nodes.getID(e.focusNode), i = e.toString().replace(/\s+/g, " ");
|
|
6596
|
-
n && s && t.send(
|
|
6596
|
+
n && s && t.send(hs(n, s, i));
|
|
6597
6597
|
} else
|
|
6598
|
-
t.send(
|
|
6598
|
+
t.send(hs(-1, -1, ""));
|
|
6599
6599
|
});
|
|
6600
6600
|
}
|
|
6601
6601
|
function Oa(t) {
|
|
@@ -6621,23 +6621,23 @@ class Aa {
|
|
|
6621
6621
|
constructor(e) {
|
|
6622
6622
|
var l;
|
|
6623
6623
|
if (this.options = e, this.app = null, this.crossdomainMode = !1, this.checkDoNotTrack = () => this.options.respectDoNotTrack && (navigator.doNotTrack == "1" || // @ts-ignore
|
|
6624
|
-
window.doNotTrack == "1"), this.signalStartIssue = (a,
|
|
6624
|
+
window.doNotTrack == "1"), this.signalStartIssue = (a, d) => {
|
|
6625
6625
|
const c = this.checkDoNotTrack(), u = new XMLHttpRequest(), p = this.options.ingestPoint || mi;
|
|
6626
6626
|
u.open("POST", p + "/v1/web/not-started"), u.send(JSON.stringify({
|
|
6627
6627
|
trackerVersion: "14.0.4",
|
|
6628
6628
|
projectKey: this.options.projectKey,
|
|
6629
6629
|
doNotTrack: c,
|
|
6630
|
-
reason:
|
|
6630
|
+
reason: d.length ? `missing api: ${d.join(",")}` : a
|
|
6631
6631
|
}));
|
|
6632
6632
|
}, this.restartCanvasTracking = () => {
|
|
6633
6633
|
this.app !== null && this.app.restartCanvasTracking();
|
|
6634
|
-
}, this.handleError = (a,
|
|
6634
|
+
}, this.handleError = (a, d = {}) => {
|
|
6635
6635
|
if (this.app !== null) {
|
|
6636
6636
|
if (a instanceof Error) {
|
|
6637
|
-
const c = Et(a, [],
|
|
6637
|
+
const c = Et(a, [], d);
|
|
6638
6638
|
this.app.send(c);
|
|
6639
6639
|
} else if (a instanceof ErrorEvent || "PromiseRejectionEvent" in window && a instanceof PromiseRejectionEvent) {
|
|
6640
|
-
const c = vi(a, void 0,
|
|
6640
|
+
const c = vi(a, void 0, d);
|
|
6641
6641
|
c != null && this.app.send(c);
|
|
6642
6642
|
}
|
|
6643
6643
|
}
|
|
@@ -6685,12 +6685,12 @@ class Aa {
|
|
|
6685
6685
|
return;
|
|
6686
6686
|
}
|
|
6687
6687
|
const r = new No(e.projectKey, e.sessionToken, e, this.signalStartIssue, this.crossdomainMode);
|
|
6688
|
-
this.app = r, this.crossdomainMode || (la(r), Oo(r), Hr(r, e), Oa(r)), ia(r, e.mouse), ca(r, this.crossdomainMode), ua(r),
|
|
6688
|
+
this.app = r, this.crossdomainMode || (la(r), Oo(r), Hr(r, e), Oa(r)), ia(r, e.mouse), ca(r, this.crossdomainMode), ua(r), ha(r), Lo(r, e), Bo(r, e), Uo(r), Go(r, e), aa(r, e), fa(r), pa(r), _a(r, e.network), Na(r), window.__OPENREPLAY__ = this, e.flags && e.flags.onFlagsLoad && this.onFlagsLoad(e.flags.onFlagsLoad);
|
|
6689
6689
|
const o = window.open;
|
|
6690
6690
|
(e.autoResetOnWindowOpen || e.resetTabOnWindowOpen) && (r.attachStartCallback(() => {
|
|
6691
|
-
const a = r.getTabId(),
|
|
6691
|
+
const a = r.getTabId(), d = r.sessionStorage ?? window.sessionStorage;
|
|
6692
6692
|
window.open = function(...c) {
|
|
6693
|
-
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen &&
|
|
6693
|
+
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen && d.removeItem(e.session_tabid_key || "__openreplay_tabid"), r.resetNextPageSession(!1), d.setItem(e.session_tabid_key || "__openreplay_tabid", a), o.call(window, ...c);
|
|
6694
6694
|
};
|
|
6695
6695
|
}), r.attachStopCallback(() => {
|
|
6696
6696
|
window.open = o;
|
|
@@ -7438,7 +7438,7 @@ qn.href = "https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wgh
|
|
|
7438
7438
|
document.head.appendChild(qn);
|
|
7439
7439
|
const Ci = document.createElement("style");
|
|
7440
7440
|
var js;
|
|
7441
|
-
document.documentElement.style.setProperty("--wineater-
|
|
7441
|
+
document.documentElement.style.setProperty("--wineater-color", ((js = window == null ? void 0 : window.wineaterData) == null ? void 0 : js.COLOR) || "#0044FF");
|
|
7442
7442
|
Ci.textContent = Da;
|
|
7443
7443
|
document.head.appendChild(Ci);
|
|
7444
7444
|
const La = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi", "ampely", "test"], Fa = "HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";
|
|
@@ -7841,7 +7841,25 @@ class Ma {
|
|
|
7841
7841
|
rose: "Рожеве",
|
|
7842
7842
|
light: "Легке",
|
|
7843
7843
|
medium: "Середнє",
|
|
7844
|
-
full: "Повне"
|
|
7844
|
+
full: "Повне",
|
|
7845
|
+
barTitle: "Закуски до вина",
|
|
7846
|
+
barSubtitle: "Виберіть страви нижче та натисніть «Надіслати»",
|
|
7847
|
+
barSendButton: "Надіслати",
|
|
7848
|
+
barResetButton: "Скинути",
|
|
7849
|
+
barName: "Назва бару",
|
|
7850
|
+
barNotesPlaceholder: "Додайте ваші побажання тут...",
|
|
7851
|
+
placeholderSuggestions: [
|
|
7852
|
+
"Вино до пасти",
|
|
7853
|
+
"Ідеально до риби",
|
|
7854
|
+
"Рекомендуємо для вечірки"
|
|
7855
|
+
],
|
|
7856
|
+
headerLine1: "Поділіться будь-якими вашими думками —",
|
|
7857
|
+
headerLine2: "— і отримайте рекомендації щодо ідеального вина за секунди",
|
|
7858
|
+
headerMeal: "страва",
|
|
7859
|
+
headerMood: "настрій",
|
|
7860
|
+
headerBudget: "бюджет",
|
|
7861
|
+
headerOccasion: "подія",
|
|
7862
|
+
headerOr: "або"
|
|
7845
7863
|
},
|
|
7846
7864
|
ru: {
|
|
7847
7865
|
lang: "ru",
|
|
@@ -8127,7 +8145,7 @@ class Pa {
|
|
|
8127
8145
|
(i.type || i.Type) && o.push(i.type || i.Type), (i.country || i.Country) && o.push(i.country || i.Country), (i.region || i.Region) && o.push(i.region || i.Region), (i.grape || i.Grape) && o.push(i.grape || i.Grape);
|
|
8128
8146
|
const l = [];
|
|
8129
8147
|
(i.type || i.Type) && l.push(i.type || i.Type), (i.country || i.Country) && l.push(i.country || i.Country), (i.region || i.Region) && l.push(i.region || i.Region), (i.grape || i.Grape) && l.push(i.grape || i.Grape);
|
|
8130
|
-
const a = l.slice(0, 3).join(" • "),
|
|
8148
|
+
const a = l.slice(0, 3).join(" • "), d = l.slice(3).join(" • "), c = `
|
|
8131
8149
|
<div class="wine-recommendation-tile ${i.isSommSelection ? "somm-selection" : ""}">
|
|
8132
8150
|
${i.isSommSelection ? `<div class="somm-selection-badge">
|
|
8133
8151
|
${$.translate("wineDetails.sommSelection")}
|
|
@@ -8152,7 +8170,7 @@ class Pa {
|
|
|
8152
8170
|
|
|
8153
8171
|
<!-- Параметры через точки -->
|
|
8154
8172
|
${a ? `<div class="wine-params">${a}</div>` : ""}
|
|
8155
|
-
${
|
|
8173
|
+
${d ? `<div class="wine-params">${d}</div>` : ""}
|
|
8156
8174
|
|
|
8157
8175
|
<!-- Кнопка Buy, видна только при наведении -->
|
|
8158
8176
|
<div class="bottom-row">
|
|
@@ -8224,9 +8242,9 @@ class Pa {
|
|
|
8224
8242
|
document.querySelectorAll(".dish-tile.selected").forEach((u) => {
|
|
8225
8243
|
l.push(u.dataset.dish);
|
|
8226
8244
|
});
|
|
8227
|
-
const a = r.value.trim(),
|
|
8228
|
-
l.length > 0 &&
|
|
8229
|
-
const c =
|
|
8245
|
+
const a = r.value.trim(), d = [];
|
|
8246
|
+
l.length > 0 && d.push(`Dishes: ${l.join(", ")}`), a && d.push(`Notes: ${a}`);
|
|
8247
|
+
const c = d.join("; ");
|
|
8230
8248
|
console.log("Final query =>", c);
|
|
8231
8249
|
try {
|
|
8232
8250
|
const u = await this.api.getWineRecommendationsSearch(c);
|
|
@@ -8315,8 +8333,8 @@ class Ba {
|
|
|
8315
8333
|
`, l.querySelector("a").addEventListener("click", (c) => {
|
|
8316
8334
|
c.preventDefault(), this.sendAnalytics(s.Title), window.open(s.Url, "_blank");
|
|
8317
8335
|
}), r.appendChild(l);
|
|
8318
|
-
const
|
|
8319
|
-
|
|
8336
|
+
const d = document.createElement("div");
|
|
8337
|
+
d.className = "wine-description", d.innerHTML = s.Reason, i.appendChild(d), console.log(i), n.appendChild(i);
|
|
8320
8338
|
}), n.scrollTop = n.scrollHeight;
|
|
8321
8339
|
}
|
|
8322
8340
|
}
|
|
@@ -8338,7 +8356,7 @@ function Ha(t) {
|
|
|
8338
8356
|
gt = t;
|
|
8339
8357
|
}
|
|
8340
8358
|
new At();
|
|
8341
|
-
const
|
|
8359
|
+
const dt = {
|
|
8342
8360
|
PRODUCT_PAGES: /producto\/[^\/]+\/$/
|
|
8343
8361
|
// Matches any product page like 'producto/any-product-name/'
|
|
8344
8362
|
// CART_PAGE: /carrito\/$/ // Matches the cart page like 'carrito/'
|
|
@@ -8355,8 +8373,8 @@ const $a = {
|
|
|
8355
8373
|
};
|
|
8356
8374
|
var Hs, $s;
|
|
8357
8375
|
const qa = {
|
|
8358
|
-
PRODUCT_PAGES: ((Hs = window.wineaterData) == null ? void 0 : Hs.PRODUCT_PAGES) ||
|
|
8359
|
-
CART_PAGE: (($s = window.wineaterData) == null ? void 0 : $s.CART_PAGE) || (
|
|
8376
|
+
PRODUCT_PAGES: ((Hs = window.wineaterData) == null ? void 0 : Hs.PRODUCT_PAGES) || dt.PRODUCT_PAGES,
|
|
8377
|
+
CART_PAGE: (($s = window.wineaterData) == null ? void 0 : $s.CART_PAGE) || (dt == null ? void 0 : dt.CART_PAGE)
|
|
8360
8378
|
};
|
|
8361
8379
|
async function Wa() {
|
|
8362
8380
|
const t = window.location.href;
|