@sailfish-ai/recorder 1.8.17 → 1.8.19
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/inAppReportIssueModal/integrations.js +27 -5
- package/dist/recorder.cjs +117 -64
- package/dist/recorder.js +88 -35
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +121 -68
- package/dist/recording.js +14 -1
- package/dist/sourceLocation.js +175 -0
- package/dist/types/sourceLocation.d.ts +17 -0
- package/package.json +1 -1
package/dist/recorder.umd.cjs
CHANGED
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
const a3 = document.createElement("a");
|
|
468
468
|
return a3.href = e3, `${a3.hostname}${a3.port ? `:${a3.port}` : ""}`;
|
|
469
469
|
})(e2);
|
|
470
|
-
let b2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${w2}/ws/notify/?apiKey=${a2}&sessionId=${u2}&sender=JS%2FTS&version=1.8.
|
|
470
|
+
let b2 = `${"https:" === new URL(e2).protocol ? "wss" : "ws"}://${w2}/ws/notify/?apiKey=${a2}&sessionId=${u2}&sender=JS%2FTS&version=1.8.19`;
|
|
471
471
|
m2 && (b2 += `&envValue=${encodeURIComponent(m2)}`);
|
|
472
472
|
return se = new j(b2, [], { connectionTimeout: 3e4 }), se.addEventListener("open", () => {
|
|
473
473
|
re && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (de ? "ENABLED" : "DISABLED"))), (async () => {
|
|
@@ -772,10 +772,10 @@
|
|
|
772
772
|
return this._array.slice();
|
|
773
773
|
}, Oe.ArraySet = ArraySet, Oe;
|
|
774
774
|
}
|
|
775
|
-
var
|
|
775
|
+
var Te, Le, Ae = {};
|
|
776
776
|
function requireMappingList() {
|
|
777
|
-
if (
|
|
778
|
-
|
|
777
|
+
if (Te) return Ae;
|
|
778
|
+
Te = 1;
|
|
779
779
|
var e2 = requireUtil();
|
|
780
780
|
function MappingList() {
|
|
781
781
|
this._array = [], this._sorted = true, this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
@@ -792,8 +792,8 @@
|
|
|
792
792
|
}, Ae.MappingList = MappingList, Ae;
|
|
793
793
|
}
|
|
794
794
|
function requireSourceMapGenerator() {
|
|
795
|
-
if (
|
|
796
|
-
|
|
795
|
+
if (Le) return ke;
|
|
796
|
+
Le = 1;
|
|
797
797
|
var e2 = requireBase64Vlq(), a2 = requireUtil(), u2 = requireArraySet().ArraySet, m2 = requireMappingList().MappingList;
|
|
798
798
|
function SourceMapGenerator(e3) {
|
|
799
799
|
e3 || (e3 = {}), this._file = a2.getArg(e3, "file", null), this._sourceRoot = a2.getArg(e3, "sourceRoot", null), this._skipValidation = a2.getArg(e3, "skipValidation", false), this._ignoreInvalidMapping = a2.getArg(e3, "ignoreInvalidMapping", false), this._sources = new u2(), this._names = new u2(), this._mappings = new m2(), this._sourcesContents = null;
|
|
@@ -1397,10 +1397,10 @@
|
|
|
1397
1397
|
var _a2;
|
|
1398
1398
|
if (!st) return e2;
|
|
1399
1399
|
const a2 = st.teams && Array.isArray(st.teams) && st.teams.length > 0, u2 = document.getElementById("sf-eng-ticket-team");
|
|
1400
|
-
u2 && a2 && (populateSelectOptions(u2, st.teams, st.defaultTeam), e2.engTicketTeam = u2.value);
|
|
1400
|
+
u2 && a2 && (populateSelectOptions(u2, st.teams, st.defaultTeam), e2.engTicketTeam ? u2.value = e2.engTicketTeam : e2.engTicketTeam = u2.value);
|
|
1401
1401
|
const m2 = document.getElementById("sf-eng-ticket-project");
|
|
1402
1402
|
if (m2) {
|
|
1403
|
-
populateSelectOptions(m2, a2 ? getProjectsForTeam(e2.engTicketTeam) : st.projects || [], st.defaultProject), e2.engTicketProject = m2.value;
|
|
1403
|
+
populateSelectOptions(m2, a2 ? getProjectsForTeam(e2.engTicketTeam) : st.projects || [], st.defaultProject), e2.engTicketProject ? m2.value = e2.engTicketProject : e2.engTicketProject = m2.value;
|
|
1404
1404
|
}
|
|
1405
1405
|
const w2 = document.getElementById("sf-eng-ticket-priority");
|
|
1406
1406
|
w2 && (!(function populatePriorityOptions(e3, a3, u3) {
|
|
@@ -1413,9 +1413,9 @@
|
|
|
1413
1413
|
u4.value = a4.id, u4.textContent = a4.name, e3.appendChild(u4);
|
|
1414
1414
|
});
|
|
1415
1415
|
null != u3 ? e3.value = String(u3) : m3 || (e3.value = "0");
|
|
1416
|
-
})(w2, st.provider || "", st.defaultPriority), e2.engTicketPriority = Number(w2.value));
|
|
1416
|
+
})(w2, st.provider || "", st.defaultPriority), e2.engTicketPriority ? w2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(w2.value));
|
|
1417
1417
|
const b2 = document.getElementById("sf-eng-ticket-type"), C2 = "jira" === ((_a2 = st.provider) == null ? void 0 : _a2.toLowerCase());
|
|
1418
|
-
return b2 && C2 && e2.engTicketProject && (updateIssueTypeOptions(b2, e2.engTicketProject), b2.value && (e2.engTicketIssueType = b2.value)), e2;
|
|
1418
|
+
return b2 && C2 && e2.engTicketProject && (updateIssueTypeOptions(b2, e2.engTicketProject), e2.engTicketIssueType ? (b2.value = e2.engTicketIssueType, b2.style.color = "#000") : b2.value && (e2.engTicketIssueType = b2.value)), e2;
|
|
1419
1419
|
}
|
|
1420
1420
|
const it = "sf-create-issue-preference", at = "sf-create-eng-ticket-preference";
|
|
1421
1421
|
function getInitialState() {
|
|
@@ -3123,14 +3123,14 @@
|
|
|
3123
3123
|
};
|
|
3124
3124
|
var bn = wn;
|
|
3125
3125
|
wn.default = wn;
|
|
3126
|
-
let Sn, In, Mn, En, _n = gn, On = bn,
|
|
3126
|
+
let Sn, In, Mn, En, _n = gn, On = bn, Tn = hn, { isClean: Ln, my: Rn } = sn;
|
|
3127
3127
|
function _r(e2) {
|
|
3128
3128
|
return e2.map((e3) => (e3.nodes && (e3.nodes = _r(e3.nodes)), delete e3.source, e3));
|
|
3129
3129
|
}
|
|
3130
3130
|
function Wr(e2) {
|
|
3131
|
-
if (e2[
|
|
3131
|
+
if (e2[Ln] = false, e2.proxyOf.nodes) for (let a2 of e2.proxyOf.nodes) Wr(a2);
|
|
3132
3132
|
}
|
|
3133
|
-
let An = class zr extends
|
|
3133
|
+
let An = class zr extends Tn {
|
|
3134
3134
|
get first() {
|
|
3135
3135
|
if (this.proxyOf.nodes) return this.proxyOf.nodes[0];
|
|
3136
3136
|
}
|
|
@@ -3200,7 +3200,7 @@
|
|
|
3200
3200
|
if (!e2.text) throw new Error("Unknown node type in node creation");
|
|
3201
3201
|
e2 = [new _n(e2)];
|
|
3202
3202
|
}
|
|
3203
|
-
return e2.map((e3) => (e3[Rn] || zr.rebuild(e3), (e3 = e3.proxyOf).parent && e3.parent.removeChild(e3), e3[
|
|
3203
|
+
return e2.map((e3) => (e3[Rn] || zr.rebuild(e3), (e3 = e3.proxyOf).parent && e3.parent.removeChild(e3), e3[Ln] && Wr(e3), e3.raws || (e3.raws = {}), typeof e3.raws.before > "u" && a2 && typeof a2.raws.before < "u" && (e3.raws.before = a2.raws.before.replace(/\S/g, "")), e3.parent = this.proxyOf, e3));
|
|
3204
3204
|
}
|
|
3205
3205
|
prepend(...e2) {
|
|
3206
3206
|
e2 = e2.reverse();
|
|
@@ -4376,7 +4376,7 @@
|
|
|
4376
4376
|
};
|
|
4377
4377
|
var Es = Ms;
|
|
4378
4378
|
Ms.default = Ms;
|
|
4379
|
-
let _s = Wn, Os = ws,
|
|
4379
|
+
let _s = Wn, Os = ws, Ts = Es, Ls = Fr, Rs = class {
|
|
4380
4380
|
constructor(e2 = []) {
|
|
4381
4381
|
this.version = "8.5.3", this.plugins = this.normalize(e2);
|
|
4382
4382
|
}
|
|
@@ -4392,14 +4392,14 @@
|
|
|
4392
4392
|
return a2;
|
|
4393
4393
|
}
|
|
4394
4394
|
process(e2, a2 = {}) {
|
|
4395
|
-
return this.plugins.length || a2.parser || a2.stringifier || a2.syntax ? new Os(this, e2, a2) : new
|
|
4395
|
+
return this.plugins.length || a2.parser || a2.stringifier || a2.syntax ? new Os(this, e2, a2) : new Ts(this, e2, a2);
|
|
4396
4396
|
}
|
|
4397
4397
|
use(e2) {
|
|
4398
4398
|
return this.plugins = this.plugins.concat(this.normalize([e2])), this;
|
|
4399
4399
|
}
|
|
4400
4400
|
};
|
|
4401
4401
|
var As = Rs;
|
|
4402
|
-
Rs.default = Rs,
|
|
4402
|
+
Rs.default = Rs, Ls.registerProcessor(Rs), _s.registerProcessor(Rs);
|
|
4403
4403
|
let Ns = Dn, $s = gn, js = Nn, Ws = Qt, Gs = bn, qs = Wn, Vs = Xr, Hs = Cr, Ks = ws, Zs = $r, Ys = hn, Xs = Zo, Qs = As, ei = es, ti = Fr, si = Gr, ii = on, ai = Yo;
|
|
4404
4404
|
function L$1(...e2) {
|
|
4405
4405
|
return 1 === e2.length && Array.isArray(e2[0]) && (e2 = e2[0]), new Qs(e2);
|
|
@@ -4910,7 +4910,7 @@
|
|
|
4910
4910
|
const { parentNode: u2 } = a2;
|
|
4911
4911
|
return !!u2 && (!!e2.has(u2) || ko(e2, u2));
|
|
4912
4912
|
}
|
|
4913
|
-
const
|
|
4913
|
+
const Ti = [];
|
|
4914
4914
|
function tt(e2) {
|
|
4915
4915
|
try {
|
|
4916
4916
|
if ("composedPath" in e2) {
|
|
@@ -4924,7 +4924,7 @@
|
|
|
4924
4924
|
function Co(e2, a2) {
|
|
4925
4925
|
var u2, m2;
|
|
4926
4926
|
const w2 = new Zl();
|
|
4927
|
-
|
|
4927
|
+
Ti.push(w2), w2.init(e2);
|
|
4928
4928
|
let b2 = window.MutationObserver || window.__rrMutationObserver;
|
|
4929
4929
|
const C2 = null == (m2 = null == (u2 = null == window ? void 0 : window.Zone) ? void 0 : u2.__symbol__) ? void 0 : m2.call(u2, "MutationObserver");
|
|
4930
4930
|
C2 && window[C2] && (b2 = window[C2]);
|
|
@@ -4986,7 +4986,7 @@
|
|
|
4986
4986
|
} else e2({ id: x2, x: C2.scrollLeft, y: C2.scrollTop });
|
|
4987
4987
|
}), b2.scroll || 100)), a2);
|
|
4988
4988
|
}
|
|
4989
|
-
const
|
|
4989
|
+
const Li = ["INPUT", "TEXTAREA", "SELECT"], Ri = /* @__PURE__ */ new WeakMap();
|
|
4990
4990
|
function ql({ deviceChangeCb: e2 }) {
|
|
4991
4991
|
const t = (a3, u3) => {
|
|
4992
4992
|
const m2 = a3.device.productName ? [a3.device.productName] : ["Unknown USB Device"];
|
|
@@ -5122,7 +5122,7 @@
|
|
|
5122
5122
|
function p(e4) {
|
|
5123
5123
|
let u4 = tt(e4);
|
|
5124
5124
|
const E4 = e4.isTrusted, O4 = u4 && u4.tagName;
|
|
5125
|
-
if (u4 && "OPTION" === O4 && (u4 = u4.parentElement), !u4 || !O4 ||
|
|
5125
|
+
if (u4 && "OPTION" === O4 && (u4 = u4.parentElement), !u4 || !O4 || Li.indexOf(O4) < 0 || Z(u4, m3, w3, true) || u4.classList.contains(b3) || C3 && u4.matches(C3)) return;
|
|
5126
5126
|
let F4 = u4.value, D4 = false;
|
|
5127
5127
|
const $4 = Yt(u4) || "", { value: B2, masked: U2 } = Zt({ element: u4, maskInputOptions: x3, tagName: O4, type: $4, value: F4, maskInputFn: I3 });
|
|
5128
5128
|
F4 = B2, ("radio" === $4 || "checkbox" === $4) && (D4 = u4.checked), f2(u4, _3 ? { text: F4, isChecked: D4, masked: U2, userTriggered: E4 } : { text: F4, isChecked: D4, masked: U2 });
|
|
@@ -5311,7 +5311,7 @@
|
|
|
5311
5311
|
})(e2), $2 = [];
|
|
5312
5312
|
for (const a3 of e2.plugins) $2.push(a3.observer(a3.callback, u2, a3.options));
|
|
5313
5313
|
return M(() => {
|
|
5314
|
-
|
|
5314
|
+
Ti.forEach((e3) => e3.reset()), null == m2 || m2.disconnect(), w2(), b2(), C2(), x2(), I2(), E2(), O2(), f(), d(), g2(), h(), F2(), D2(), _2(), $2.forEach((e3) => e3());
|
|
5315
5315
|
});
|
|
5316
5316
|
}
|
|
5317
5317
|
function ft(e2) {
|
|
@@ -5662,7 +5662,7 @@
|
|
|
5662
5662
|
Qi = (e3, w3) => {
|
|
5663
5663
|
var b3;
|
|
5664
5664
|
const C3 = e3;
|
|
5665
|
-
if (C3.timestamp = Mi(), null != (b3 =
|
|
5665
|
+
if (C3.timestamp = Mi(), null != (b3 = Ti[0]) && b3.isFrozen() && C3.type !== ui.FullSnapshot && !(C3.type === ui.IncrementalSnapshot && C3.data.source === di.Mutation) && Ti.forEach((e4) => e4.unfreeze()), ie2) null == a2 || a2(vn(C3), w3);
|
|
5666
5666
|
else if (le2) {
|
|
5667
5667
|
const e4 = { type: "@sailfish-rrweb/rrweb", event: vn(C3), origin: window.location.origin, isCheckout: w3 };
|
|
5668
5668
|
window.parent.postMessage(e4, "*");
|
|
@@ -5684,7 +5684,7 @@
|
|
|
5684
5684
|
const we2 = new wu({ mutationCb: rt, scrollCb: kn, bypassOptions: { blockClass: w2, blockSelector: b2, maskTextClass: I2, maskTextSelector: E2, inlineStylesheet: _2, maskInputOptions: ce2, dataURLOptions: q2, maskTextFn: B2, maskInputFn: $2, recordCanvas: J2, inlineImages: te2, sampling: z2, slimDOMOptions: de2, iframeManager: ge2, stylesheetManager: me2, canvasManager: ta, keepIframeSrcFn: re2, processedNodeManager: ye2 }, mirror: oa });
|
|
5685
5685
|
ea = (e3 = false) => {
|
|
5686
5686
|
if (!H2) return;
|
|
5687
|
-
Qi({ type: ui.Meta, data: { href: window.location.href, width: mo(), height: fo() } }, e3), me2.reset(), we2.init(),
|
|
5687
|
+
Qi({ type: ui.Meta, data: { href: window.location.href, width: mo(), height: fo() } }, e3), me2.reset(), we2.init(), Ti.forEach((e4) => e4.lock());
|
|
5688
5688
|
const a3 = (function Zi(e4, a4) {
|
|
5689
5689
|
const { mirror: u3 = new vt(), blockClass: m3 = "rr-block", blockSelector: w3 = null, maskTextClass: b3 = "rr-mask", maskTextSelector: C3 = null, inlineStylesheet: x3 = true, inlineImages: I3 = false, recordCanvas: E3 = false, maskAllInputs: _3 = false, maskTextFn: O3, maskInputFn: F3, slimDOM: D3 = false, dataURLOptions: $3, preserveWhiteSpace: B3, onSerialize: U3, onIframeLoad: j3, iframeLoadTimeout: z3, onStylesheetLoad: q3, stylesheetLoadTimeout: V3, keepIframeSrcFn: H3 = () => false } = a4 || {};
|
|
5690
5690
|
return Se(e4, { doc: e4, mirror: u3, blockClass: m3, blockSelector: w3, maskTextClass: b3, maskTextSelector: C3, skipChild: false, inlineStylesheet: x3, maskInputOptions: true === _3 ? { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true } : false === _3 ? { password: true } : _3, maskTextFn: O3, maskInputFn: F3, slimDOMOptions: true === D3 || "all" === D3 ? { script: true, comment: true, headFavicon: true, headWhitespace: true, headMetaDescKeywords: "all" === D3, headMetaSocial: true, headMetaRobots: true, headMetaHttpEquiv: true, headMetaAuthorship: true, headMetaVerification: true } : false === D3 ? {} : D3, dataURLOptions: $3, inlineImages: I3, recordCanvas: E3, preserveWhiteSpace: B3, onSerialize: U3, onIframeLoad: j3, iframeLoadTimeout: z3, onStylesheetLoad: q3, stylesheetLoadTimeout: V3, keepIframeSrcFn: H3, newlyAddedElement: false });
|
|
@@ -5696,7 +5696,7 @@
|
|
|
5696
5696
|
me2.attachLinkElement(e4, a4);
|
|
5697
5697
|
}, keepIframeSrcFn: re2 });
|
|
5698
5698
|
if (!a3) return console.warn("Failed to snapshot the document");
|
|
5699
|
-
Qi({ type: ui.FullSnapshot, data: { node: a3, initialOffset: po(window) } }, e3),
|
|
5699
|
+
Qi({ type: ui.FullSnapshot, data: { node: a3, initialOffset: po(window) } }, e3), Ti.forEach((e4) => e4.unlock()), document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0 && me2.adoptStyleSheets(document.adoptedStyleSheets, oa.getId(document));
|
|
5700
5700
|
};
|
|
5701
5701
|
try {
|
|
5702
5702
|
const e3 = [], K = (e4) => {
|
|
@@ -5760,7 +5760,7 @@
|
|
|
5760
5760
|
if (!na) throw new Error("please add Sailfish event after start recording");
|
|
5761
5761
|
Qi({ type: e2, data: { tag: "sailfish-zendesk-test-tag", payload: a2 } });
|
|
5762
5762
|
}, ae.freezePage = () => {
|
|
5763
|
-
|
|
5763
|
+
Ti.forEach((e2) => e2.freeze());
|
|
5764
5764
|
}, ae.takeFullSnapshot = (e2) => {
|
|
5765
5765
|
if (!na) throw new Error("please take full snapshot after start recording");
|
|
5766
5766
|
ea(e2);
|
|
@@ -6137,7 +6137,7 @@
|
|
|
6137
6137
|
};
|
|
6138
6138
|
var Oa = _a;
|
|
6139
6139
|
_a.default = _a;
|
|
6140
|
-
let
|
|
6140
|
+
let Ta = Ma, La = class extends Ta {
|
|
6141
6141
|
get variable() {
|
|
6142
6142
|
return this.prop.startsWith("--") || "$" === this.prop[0];
|
|
6143
6143
|
}
|
|
@@ -6145,8 +6145,8 @@
|
|
|
6145
6145
|
e2 && typeof e2.value < "u" && "string" != typeof e2.value && (e2 = { ...e2, value: String(e2.value) }), super(e2), this.type = "decl";
|
|
6146
6146
|
}
|
|
6147
6147
|
};
|
|
6148
|
-
var Ra =
|
|
6149
|
-
|
|
6148
|
+
var Ra = La;
|
|
6149
|
+
La.default = La;
|
|
6150
6150
|
let Aa, Na, Pa, Fa, Da = Oa, $a = Ra, Ba = Ma, { isClean: Ua, my: ja } = ba;
|
|
6151
6151
|
function Wo(e2) {
|
|
6152
6152
|
return e2.map((e3) => (e3.nodes && (e3.nodes = Wo(e3.nodes)), delete e3.source, e3));
|
|
@@ -6531,17 +6531,17 @@
|
|
|
6531
6531
|
};
|
|
6532
6532
|
var Ol = El;
|
|
6533
6533
|
El.default = El, Ml.registerRoot(El);
|
|
6534
|
-
let
|
|
6534
|
+
let Tl = { comma: (e2) => Tl.split(e2, [","], true), space(e2) {
|
|
6535
6535
|
let a2 = [" ", "\n", " "];
|
|
6536
|
-
return
|
|
6536
|
+
return Tl.split(e2, a2);
|
|
6537
6537
|
}, split(e2, a2, u2) {
|
|
6538
6538
|
let m2 = [], w2 = "", b2 = false, C2 = 0, x2 = false, I2 = "", E2 = false;
|
|
6539
6539
|
for (let u3 of e2) E2 ? E2 = false : "\\" === u3 ? E2 = true : x2 ? u3 === I2 && (x2 = false) : '"' === u3 || "'" === u3 ? (x2 = true, I2 = u3) : "(" === u3 ? C2 += 1 : ")" === u3 ? C2 > 0 && (C2 -= 1) : 0 === C2 && a2.includes(u3) && (b2 = true), b2 ? ("" !== w2 && m2.push(w2.trim()), w2 = "", b2 = false) : w2 += u3;
|
|
6540
6540
|
return (u2 || "" !== w2) && m2.push(w2.trim()), m2;
|
|
6541
6541
|
} };
|
|
6542
|
-
var
|
|
6543
|
-
|
|
6544
|
-
let Rl = Wa, Al =
|
|
6542
|
+
var Ll = Tl;
|
|
6543
|
+
Tl.default = Tl;
|
|
6544
|
+
let Rl = Wa, Al = Ll, Nl = class extends Rl {
|
|
6545
6545
|
get selectors() {
|
|
6546
6546
|
return Al.comma(this.selector);
|
|
6547
6547
|
}
|
|
@@ -7040,9 +7040,9 @@
|
|
|
7040
7040
|
throw this.input.error("At-rule without name", { offset: a2[2] }, { offset: a2[2] + a2[1].length });
|
|
7041
7041
|
}
|
|
7042
7042
|
};
|
|
7043
|
-
let
|
|
7043
|
+
let Tc = Wa, Lc = Cl, Rc = Oc;
|
|
7044
7044
|
function Gt(e2, a2) {
|
|
7045
|
-
let u2 = new
|
|
7045
|
+
let u2 = new Lc(e2, a2), m2 = new Rc(u2);
|
|
7046
7046
|
try {
|
|
7047
7047
|
m2.parse();
|
|
7048
7048
|
} catch (e3) {
|
|
@@ -7051,7 +7051,7 @@
|
|
|
7051
7051
|
return m2.root;
|
|
7052
7052
|
}
|
|
7053
7053
|
var Ac = Gt;
|
|
7054
|
-
Gt.default = Gt,
|
|
7054
|
+
Gt.default = Gt, Tc.registerParse(Gt);
|
|
7055
7055
|
let Nc = class {
|
|
7056
7056
|
constructor(e2, a2 = {}) {
|
|
7057
7057
|
if (this.type = "warning", this.text = e2, a2.node && a2.node.source) {
|
|
@@ -7400,7 +7400,7 @@
|
|
|
7400
7400
|
};
|
|
7401
7401
|
var _u = Eu;
|
|
7402
7402
|
Eu.default = Eu;
|
|
7403
|
-
let Ou = Qa,
|
|
7403
|
+
let Ou = Qa, Tu = cu, Lu = _u, Ru = Ol, Au = class {
|
|
7404
7404
|
constructor(e2 = []) {
|
|
7405
7405
|
this.version = "8.5.3", this.plugins = this.normalize(e2);
|
|
7406
7406
|
}
|
|
@@ -7416,7 +7416,7 @@
|
|
|
7416
7416
|
return a2;
|
|
7417
7417
|
}
|
|
7418
7418
|
process(e2, a2 = {}) {
|
|
7419
|
-
return this.plugins.length || a2.parser || a2.stringifier || a2.syntax ? new
|
|
7419
|
+
return this.plugins.length || a2.parser || a2.stringifier || a2.syntax ? new Tu(this, e2, a2) : new Lu(this, e2, a2);
|
|
7420
7420
|
}
|
|
7421
7421
|
use(e2) {
|
|
7422
7422
|
return this.plugins = this.plugins.concat(this.normalize([e2])), this;
|
|
@@ -7424,7 +7424,7 @@
|
|
|
7424
7424
|
};
|
|
7425
7425
|
var Nu = Au;
|
|
7426
7426
|
Au.default = Au, Ru.registerProcessor(Au), Ou.registerProcessor(Au);
|
|
7427
|
-
let Pu = Va, Fu = Oa, Du = Wa, $u = ha, Uu = Ra, ju = Qa, zu = sc, Wu = Cl, Gu = cu, qu =
|
|
7427
|
+
let Pu = Va, Fu = Oa, Du = Wa, $u = ha, Uu = Ra, ju = Qa, zu = sc, Wu = Cl, Gu = cu, qu = Ll, Vu = Ma, Hu = Ac, Ku = Nu, Zu = $c, Ju = Ol, Yu = Pl, Xu = wa, Qu = Pc;
|
|
7428
7428
|
function T$1(...e2) {
|
|
7429
7429
|
return 1 === e2.length && Array.isArray(e2[0]) && (e2 = e2[0]), new Ku(e2);
|
|
7430
7430
|
}
|
|
@@ -7624,6 +7624,58 @@
|
|
|
7624
7624
|
}
|
|
7625
7625
|
}
|
|
7626
7626
|
var fd = ((e2) => (e2[e2.DomContentLoaded = 0] = "DomContentLoaded", e2[e2.Load = 1] = "Load", e2[e2.FullSnapshot = 2] = "FullSnapshot", e2[e2.IncrementalSnapshot = 3] = "IncrementalSnapshot", e2[e2.Meta = 4] = "Meta", e2[e2.Custom = 5] = "Custom", e2[e2.Plugin = 6] = "Plugin", e2[e2.Device = 24] = "Device", e2[e2.SailfishCustom = 25] = "SailfishCustom", e2))(fd || {});
|
|
7627
|
+
const md = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
7628
|
+
function shouldSkipFrame(e2) {
|
|
7629
|
+
return md.some((a2) => e2.includes(a2));
|
|
7630
|
+
}
|
|
7631
|
+
function normalizeFilePath(e2) {
|
|
7632
|
+
let a2 = e2;
|
|
7633
|
+
if (a2.startsWith("file://") && (a2 = a2.substring(7)), a2.startsWith("webpack-internal:///") && (a2 = a2.substring(20)), a2.startsWith("webpack:///") && (a2 = a2.substring(11)), a2.startsWith("/@fs/") && (a2 = a2.substring(5)), a2.startsWith("http://") || a2.startsWith("https://")) try {
|
|
7634
|
+
a2 = new URL(a2).pathname || a2, "/" === a2 && (a2 = "index.html");
|
|
7635
|
+
} catch {
|
|
7636
|
+
}
|
|
7637
|
+
return a2;
|
|
7638
|
+
}
|
|
7639
|
+
function getCallerLocationFromTrace(e2, a2 = 0) {
|
|
7640
|
+
if (!Array.isArray(e2) || 0 === e2.length) return [null, null];
|
|
7641
|
+
const u2 = (function parseRrwebTraceFrames(e3) {
|
|
7642
|
+
const a3 = [];
|
|
7643
|
+
for (const u3 of e3) {
|
|
7644
|
+
if (!u3) continue;
|
|
7645
|
+
const e4 = u3.startsWith("at ") ? u3.slice(3) : u3;
|
|
7646
|
+
let m2 = /^(.*?)\s+\((.+?):(\d+):(\d+)\)$/.exec(e4);
|
|
7647
|
+
m2 ? a3.push({ functionName: m2[1] || "<anonymous>", file: m2[2], line: parseInt(m2[3], 10), column: parseInt(m2[4], 10) }) : (m2 = /^(.+?):(\d+):(\d+)$/.exec(e4), m2 && a3.push({ functionName: "<anonymous>", file: m2[1], line: parseInt(m2[2], 10), column: parseInt(m2[3], 10) }));
|
|
7648
|
+
}
|
|
7649
|
+
return a3;
|
|
7650
|
+
})(e2);
|
|
7651
|
+
for (let e3 = a2; e3 < Math.min(u2.length, a2 + 20); e3++) {
|
|
7652
|
+
const a3 = u2[e3];
|
|
7653
|
+
if (!(a3 == null ? void 0 : a3.file)) continue;
|
|
7654
|
+
const m2 = normalizeFilePath(a3.file);
|
|
7655
|
+
if (!shouldSkipFrame(m2)) return [m2, a3.line];
|
|
7656
|
+
}
|
|
7657
|
+
return [null, null];
|
|
7658
|
+
}
|
|
7659
|
+
function getCallerLocation(e2 = 0) {
|
|
7660
|
+
const a2 = new Error().stack;
|
|
7661
|
+
if (!a2) return [null, null];
|
|
7662
|
+
const u2 = (function parseV8Stack(e3) {
|
|
7663
|
+
if (!e3) return [];
|
|
7664
|
+
const a3 = e3.split("\n").slice(1), u3 = [];
|
|
7665
|
+
for (const e4 of a3) {
|
|
7666
|
+
let a4 = /at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/.exec(e4);
|
|
7667
|
+
a4 ? u3.push({ functionName: a4[1], file: a4[2], line: parseInt(a4[3], 10), column: parseInt(a4[4], 10) }) : (a4 = /at\s+(.+?):(\d+):(\d+)/.exec(e4), a4 && u3.push({ functionName: "<anonymous>", file: a4[1], line: parseInt(a4[2], 10), column: parseInt(a4[3], 10) }));
|
|
7668
|
+
}
|
|
7669
|
+
return u3;
|
|
7670
|
+
})(a2), m2 = 1 + e2;
|
|
7671
|
+
for (let e3 = m2; e3 < Math.min(u2.length, m2 + 20); e3++) {
|
|
7672
|
+
const a3 = u2[e3];
|
|
7673
|
+
if (!(a3 == null ? void 0 : a3.file)) continue;
|
|
7674
|
+
const m3 = normalizeFilePath(a3.file);
|
|
7675
|
+
if (!shouldSkipFrame(m3)) return [m3, a3.line];
|
|
7676
|
+
}
|
|
7677
|
+
return [null, null];
|
|
7678
|
+
}
|
|
7627
7679
|
function suppressConsoleLogsDuringCall(e2) {
|
|
7628
7680
|
const a2 = console.log, u2 = console.warn, m2 = console.error;
|
|
7629
7681
|
console.log = () => {
|
|
@@ -7636,7 +7688,7 @@
|
|
|
7636
7688
|
console.log = a2, console.warn = u2, console.error = m2;
|
|
7637
7689
|
}
|
|
7638
7690
|
}
|
|
7639
|
-
const
|
|
7691
|
+
const gd = "zendesk_chat", yd = "Zendesk";
|
|
7640
7692
|
function zE_safe(...e2) {
|
|
7641
7693
|
try {
|
|
7642
7694
|
if ((function hasZendesk() {
|
|
@@ -7675,7 +7727,8 @@
|
|
|
7675
7727
|
function initializeConsolePlugin(e2, a2) {
|
|
7676
7728
|
const { name: u2, observer: m2 } = /* @__PURE__ */ ((e3) => ({ name: "@sailfish-rrweb/rrweb/console@1", observer: R, options: e3 }))(e2);
|
|
7677
7729
|
m2((e3) => {
|
|
7678
|
-
|
|
7730
|
+
const m3 = e3, [w2, b2] = getCallerLocationFromTrace(m3 == null ? void 0 : m3.trace, 0), [C2, x2] = getCallerLocation(2), I2 = w2 ?? C2, E2 = b2 ?? x2, _2 = { ...m3, sourceFile: I2, sourceLine: E2 };
|
|
7731
|
+
sendEvent({ type: fd.Plugin, timestamp: Date.now(), data: { plugin: u2, payload: _2 }, sessionId: a2, ...getUrlAndStoredUuids() });
|
|
7679
7732
|
}, window, e2);
|
|
7680
7733
|
}
|
|
7681
7734
|
async function initializeRecording(e2, a2, u2, m2, w2) {
|
|
@@ -7695,11 +7748,11 @@
|
|
|
7695
7748
|
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${m2}`]);
|
|
7696
7749
|
});
|
|
7697
7750
|
const handleWidgetOpen = () => {
|
|
7698
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat opened", element_id:
|
|
7751
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat opened", element_id: gd, provider: yd });
|
|
7699
7752
|
}, handleWidgetClose = () => {
|
|
7700
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat closed", element_id:
|
|
7753
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "customer support chat closed", element_id: gd, provider: yd });
|
|
7701
7754
|
}, handleUnreadMessages = (e3) => {
|
|
7702
|
-
ae.addSailfishEvent(fd.SailfishCustom, { action: "zendesk unreadmessages", element_id:
|
|
7755
|
+
ae.addSailfishEvent(fd.SailfishCustom, { action: "zendesk unreadmessages", element_id: gd, provider: yd });
|
|
7703
7756
|
};
|
|
7704
7757
|
suppressConsoleLogsDuringCall(() => {
|
|
7705
7758
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -7710,8 +7763,8 @@
|
|
|
7710
7763
|
}
|
|
7711
7764
|
return b2;
|
|
7712
7765
|
}
|
|
7713
|
-
let
|
|
7714
|
-
const
|
|
7766
|
+
let wd = null, bd = null;
|
|
7767
|
+
const Sd = readDebugFlag(), vd = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], kd = [400, 403], Cd = "CORS", xd = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {} }, Id = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
7715
7768
|
function trackDomainChangesOnce() {
|
|
7716
7769
|
const e2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
7717
7770
|
if (e2.routeWatcherIntervalId) return;
|
|
@@ -7778,7 +7831,7 @@
|
|
|
7778
7831
|
return true;
|
|
7779
7832
|
}
|
|
7780
7833
|
for (const e3 of F) if (u2.pathname.toLowerCase().endsWith(e3)) return true;
|
|
7781
|
-
return !!matchUrlWithWildcard(e2, [...
|
|
7834
|
+
return !!matchUrlWithWildcard(e2, [...vd, ...a2]);
|
|
7782
7835
|
}
|
|
7783
7836
|
function setupFetchInterceptor(e2 = []) {
|
|
7784
7837
|
const a2 = window.fetch, u2 = getOrSetSessionId();
|
|
@@ -7813,7 +7866,7 @@
|
|
|
7813
7866
|
D2[e4] = a5;
|
|
7814
7867
|
}) : D2 = { ...w3.headers }), F2 = w3.body;
|
|
7815
7868
|
} catch (e4) {
|
|
7816
|
-
|
|
7869
|
+
Sd && console.warn("[Sailfish] Failed to capture request data:", e4);
|
|
7817
7870
|
}
|
|
7818
7871
|
delete D2[C];
|
|
7819
7872
|
const $2 = (_a2 = getFuncSpanHeader()) == null ? void 0 : _a2.name;
|
|
@@ -7823,16 +7876,16 @@
|
|
|
7823
7876
|
const I4 = getFuncSpanHeader();
|
|
7824
7877
|
if (u4 instanceof Request) {
|
|
7825
7878
|
const E3 = u4.clone(), _3 = new Headers(E3.headers);
|
|
7826
|
-
_3.set(C, `${w4}/${b4}/${x4}`), I4 && (_3.set(I4.name, I4.value),
|
|
7879
|
+
_3.set(C, `${w4}/${b4}/${x4}`), I4 && (_3.set(I4.name, I4.value), Sd && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: u4.url, header: I4.name }));
|
|
7827
7880
|
const O3 = new Request(E3, { headers: _3 });
|
|
7828
7881
|
return await e4.call(a5, O3, m4);
|
|
7829
7882
|
}
|
|
7830
7883
|
{
|
|
7831
7884
|
const E3 = { ...m4 }, _3 = new Headers(m4.headers || {});
|
|
7832
|
-
return _3.set(C, `${w4}/${b4}/${x4}`), I4 && (_3.set(I4.name, I4.value),
|
|
7885
|
+
return _3.set(C, `${w4}/${b4}/${x4}`), I4 && (_3.set(I4.name, I4.value), Sd && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof u4 ? u4 : u4.href, header: I4.name })), E3.headers = _3, await e4.call(a5, u4, E3);
|
|
7833
7886
|
}
|
|
7834
7887
|
})(e3, a4, m3, w3, b3, E2.page_visit_uuid, I3), B2 = false;
|
|
7835
|
-
|
|
7888
|
+
kd.includes($3.status) && (Sd && console.log("Perform retry as status was fail:", $3), I3 = v4(), $3 = await (async function retryWithoutPropagateHeaders(e4, a5, u4, m4) {
|
|
7836
7889
|
try {
|
|
7837
7890
|
let m5 = u4[0], w4 = u4[1] || {};
|
|
7838
7891
|
if ("string" == typeof m5 || m5 instanceof URL) {
|
|
@@ -7848,7 +7901,7 @@
|
|
|
7848
7901
|
}
|
|
7849
7902
|
return e4.apply(a5, u4);
|
|
7850
7903
|
} catch (e5) {
|
|
7851
|
-
throw
|
|
7904
|
+
throw Sd && console.log(`Retry without ${C} for ${m4} also failed:`, e5), e5;
|
|
7852
7905
|
}
|
|
7853
7906
|
})(e3, a4, u3, x3), B2 = true);
|
|
7854
7907
|
const U2 = Date.now(), j2 = $3.status, z2 = $3.ok, q2 = z2 ? "" : `Request Error: ${$3.statusText}`;
|
|
@@ -7857,7 +7910,7 @@
|
|
|
7857
7910
|
const e4 = $3.clone();
|
|
7858
7911
|
V2 = await e4.text();
|
|
7859
7912
|
} catch (e4) {
|
|
7860
|
-
|
|
7913
|
+
Sd && console.warn("[Sailfish] Failed to capture response data:", e4), V2 = null;
|
|
7861
7914
|
}
|
|
7862
7915
|
let H2 = null;
|
|
7863
7916
|
try {
|
|
@@ -7865,12 +7918,12 @@
|
|
|
7865
7918
|
H2[a5] = e4;
|
|
7866
7919
|
});
|
|
7867
7920
|
} catch (e4) {
|
|
7868
|
-
|
|
7921
|
+
Sd && console.warn("[Sailfish] Failed to capture response headers:", e4), H2 = null;
|
|
7869
7922
|
}
|
|
7870
7923
|
return sendEvent({ type: 27, timestamp: U2, sessionId: b3, data: { request_id: I3, session_id: b3, timestamp_start: O2, timestamp_end: U2, response_code: j2, success: z2, error: q2, method: _2, url: x3, retry_without_trace_id: B2, request_headers: D2, request_body: F2, response_headers: H2, response_body: V2 }, ...E2 }), $3;
|
|
7871
7924
|
} catch (m4) {
|
|
7872
7925
|
const w4 = Date.now(), C2 = false, $3 = ((_b = m4.response) == null ? void 0 : _b.status) || 500, B2 = m4.message || "Fetch request failed";
|
|
7873
|
-
if (m4 instanceof TypeError && ((_c2 = m4 == null ? void 0 : m4.message) == null ? void 0 : _c2.toLowerCase().includes(
|
|
7926
|
+
if (m4 instanceof TypeError && ((_c2 = m4 == null ? void 0 : m4.message) == null ? void 0 : _c2.toLowerCase().includes(Cd.toLowerCase()))) return e3.apply(a4, u3);
|
|
7874
7927
|
throw sendEvent({ type: 27, timestamp: w4, sessionId: b3, data: { request_id: I3, session_id: b3, timestamp_start: O2, timestamp_end: w4, response_code: $3, success: C2, error: B2, method: _2, url: x3, request_headers: D2, request_body: F2, response_body: null }, ...E2 }), m4;
|
|
7875
7928
|
}
|
|
7876
7929
|
})(a3, m2, w2, x2, I2, u2, b2);
|
|
@@ -7904,7 +7957,7 @@
|
|
|
7904
7957
|
})(), D2 = getOrSetSessionId(), $2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
7905
7958
|
if ($2.sessionId = D2, $2.apiKey = e2, $2.backendApi = a2, $2.serviceAdditionalMetadata = I2, $2.initialized && $2.sessionId === D2 && $2.ws && 1 === $2.ws.readyState) trackDomainChangesOnce();
|
|
7906
7959
|
else {
|
|
7907
|
-
$2.domEventsInit || (initializeDomContentEvents(D2), $2.domEventsInit = true), $2.consoleInit || (initializeConsolePlugin(
|
|
7960
|
+
$2.domEventsInit || (initializeDomContentEvents(D2), $2.domEventsInit = true), $2.consoleInit || (initializeConsolePlugin(Id, D2), $2.consoleInit = true), $2.errorInit || (!(function initializeErrorInterceptor() {
|
|
7908
7961
|
window.addEventListener("error", (e3) => {
|
|
7909
7962
|
captureError(e3.error || e3.message);
|
|
7910
7963
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
@@ -7914,10 +7967,10 @@
|
|
|
7914
7967
|
Q && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", a3));
|
|
7915
7968
|
})({ apiKey: e2, backendApi: a2 }), trackDomainChangesOnce(), sessionStorage.setItem("sailfishApiKey", e2), sessionStorage.setItem("sailfishBackendApi", a2), !isFunctionSpanTrackingEnabled() || $2.ws && 1 === $2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, a2).then((e3) => {
|
|
7916
7969
|
var _a3;
|
|
7917
|
-
((_a3 = e3.data) == null ? void 0 : _a3.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
7970
|
+
((_a3 = e3.data) == null ? void 0 : _a3.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? Sd && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), Sd && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
7918
7971
|
}).catch((e3) => {
|
|
7919
|
-
|
|
7920
|
-
}), $2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...m2, ...
|
|
7972
|
+
Sd && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
7973
|
+
}), $2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...m2, ...vd], a2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), $2.sentDoNotPropagateOnce = true), $2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = []) {
|
|
7921
7974
|
const a3 = XMLHttpRequest.prototype.open, u3 = XMLHttpRequest.prototype.send, m3 = XMLHttpRequest.prototype.setRequestHeader, w3 = getOrSetSessionId();
|
|
7922
7975
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, a4) {
|
|
7923
7976
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = a4, m3.call(this, e4, a4);
|
|
@@ -7935,9 +7988,9 @@
|
|
|
7935
7988
|
}
|
|
7936
7989
|
const E3 = getFuncSpanHeader();
|
|
7937
7990
|
if (E3) try {
|
|
7938
|
-
this.setRequestHeader(E3.name, E3.value),
|
|
7991
|
+
this.setRequestHeader(E3.name, E3.value), Sd && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: m4, header: E3.name });
|
|
7939
7992
|
} catch (e4) {
|
|
7940
|
-
|
|
7993
|
+
Sd && console.warn(`[Sailfish] Could not set funcspan header for ${m4}`, e4);
|
|
7941
7994
|
}
|
|
7942
7995
|
const _3 = Date.now();
|
|
7943
7996
|
let O3 = false;
|
|
@@ -7965,7 +8018,7 @@
|
|
|
7965
8018
|
2 === a6.length && (u4[a6[0]] = a6[1]);
|
|
7966
8019
|
});
|
|
7967
8020
|
} catch (e5) {
|
|
7968
|
-
|
|
8021
|
+
Sd && console.warn("[Sailfish] Failed to capture XHR response headers:", e5), u4 = null;
|
|
7969
8022
|
}
|
|
7970
8023
|
if (e4 >= 200 && e4 < 300) emitFinished(true, e4, "", a5, u4);
|
|
7971
8024
|
else {
|
|
@@ -7981,7 +8034,7 @@
|
|
|
7981
8034
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
7982
8035
|
})();
|
|
7983
8036
|
try {
|
|
7984
|
-
const u3 = await fetchCaptureSettings(e2, a2), m3 = ((_a2 = u3.data) == null ? void 0 : _a2.captureSettingsFromApiKey) ||
|
|
8037
|
+
const u3 = await fetchCaptureSettings(e2, a2), m3 = ((_a2 = u3.data) == null ? void 0 : _a2.captureSettingsFromApiKey) || xd;
|
|
7985
8038
|
if ($2.ws && 1 === $2.ws.readyState) return;
|
|
7986
8039
|
const C2 = withAppUrlMetadata(I2), x3 = await startRecordingSession(e2, D2, a2, _2, O2, F2, E2, "JS/TS", C2);
|
|
7987
8040
|
if ((_b = x3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
@@ -8017,7 +8070,7 @@
|
|
|
8017
8070
|
const e2 = document.visibilityState, a2 = Date.now();
|
|
8018
8071
|
"visible" === e2 && getOrSetSessionId();
|
|
8019
8072
|
try {
|
|
8020
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: a2, ...getUrlAndStoredUuids() } }),
|
|
8073
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: a2, ...getUrlAndStoredUuids() } }), Sd && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
8021
8074
|
} catch (e3) {
|
|
8022
8075
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
8023
8076
|
}
|
|
@@ -8025,12 +8078,12 @@
|
|
|
8025
8078
|
}), J && window.addEventListener("beforeunload", () => {
|
|
8026
8079
|
clearPageVisitDataFromSessionStorage();
|
|
8027
8080
|
});
|
|
8028
|
-
e.DEFAULT_CAPTURE_SETTINGS =
|
|
8081
|
+
e.DEFAULT_CAPTURE_SETTINGS = xd, e.DEFAULT_CONSOLE_RECORDING_SETTINGS = Id, e.STORAGE_VERSION = 1, e.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
8029
8082
|
const a2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
8030
|
-
|
|
8083
|
+
bd && JSON.stringify(bd) === JSON.stringify(e2) || (bd = e2, sendMessage(a2));
|
|
8031
8084
|
}, e.buildBatches = buildBatches, e.clearStaleFuncSpanState = clearStaleFuncSpanState, e.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, e.createTriageFromRecorder = createTriageFromRecorder, e.disableFunctionSpanTracking = disableFunctionSpanTracking, e.enableFunctionSpanTracking = enableFunctionSpanTracking, e.eventSize = eventSize, e.fetchCaptureSettings = fetchCaptureSettings, e.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, e.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, e.flushBufferedEvents = flushBufferedEvents, e.getFuncSpanHeader = getFuncSpanHeader, e.getOrSetSessionId = getOrSetSessionId, e.getUrlAndStoredUuids = getUrlAndStoredUuids, e.identify = function identify(e2, a2 = {}, u2 = false) {
|
|
8032
8085
|
const m2 = { type: "identify", userId: e2, traits: a2 };
|
|
8033
|
-
|
|
8086
|
+
wd && wd.userId === e2 && JSON.stringify(wd.traits) === JSON.stringify(a2) || (wd = { userId: e2, traits: a2, overwrite: u2 }, sendMessage(m2));
|
|
8034
8087
|
}, e.initRecorder = async (e2) => {
|
|
8035
8088
|
if ("undefined" == typeof window) return;
|
|
8036
8089
|
const a2 = window.__sailfish_recorder || (window.__sailfish_recorder = {}), u2 = getOrSetSessionId();
|
package/dist/recording.js
CHANGED
|
@@ -3,6 +3,7 @@ import { getRecordConsolePlugin, } from "@sailfish-rrweb/rrweb-plugin-console-re
|
|
|
3
3
|
// import { NetworkRecordOptions } from "@sailfish-rrweb/rrweb-plugin-network-record";
|
|
4
4
|
import { EventType } from "@sailfish-rrweb/types";
|
|
5
5
|
import { Complete, DomContentEventId, DomContentSource, Loading, } from "./constants";
|
|
6
|
+
import { getCallerLocation, getCallerLocationFromTrace, } from "./sourceLocation";
|
|
6
7
|
import suppressConsoleLogsDuringCall from "./suppressConsoleLogsDuringCall";
|
|
7
8
|
import { initializeWebSocket, sendEvent } from "./websocket";
|
|
8
9
|
const MASK_CLASS = "sailfishSanitize";
|
|
@@ -140,12 +141,24 @@ export function initializeDomContentEvents(sessionId) {
|
|
|
140
141
|
export function initializeConsolePlugin(consoleRecordSettings, sessionId) {
|
|
141
142
|
const { name, observer } = getRecordConsolePlugin(consoleRecordSettings);
|
|
142
143
|
observer((payload) => {
|
|
144
|
+
const anyPayload = payload;
|
|
145
|
+
// rrweb console record plugin includes `trace` for logs (stack frames). :contentReference[oaicite:1]{index=1}
|
|
146
|
+
const [sourceFileFromTrace, sourceLineFromTrace] = getCallerLocationFromTrace(anyPayload?.trace, 0);
|
|
147
|
+
// Fallback (less accurate when inside wrappers)
|
|
148
|
+
const [sourceFileFallback, sourceLineFallback] = getCallerLocation(2);
|
|
149
|
+
const sourceFile = sourceFileFromTrace ?? sourceFileFallback;
|
|
150
|
+
const sourceLine = sourceLineFromTrace ?? sourceLineFallback;
|
|
151
|
+
const enhancedPayload = {
|
|
152
|
+
...anyPayload,
|
|
153
|
+
sourceFile,
|
|
154
|
+
sourceLine,
|
|
155
|
+
};
|
|
143
156
|
const eventData = {
|
|
144
157
|
type: EventType.Plugin,
|
|
145
158
|
timestamp: Date.now(),
|
|
146
159
|
data: {
|
|
147
160
|
plugin: name,
|
|
148
|
-
payload,
|
|
161
|
+
payload: enhancedPayload, // Use enhanced payload
|
|
149
162
|
},
|
|
150
163
|
sessionId: sessionId,
|
|
151
164
|
...getUrlAndStoredUuids(),
|