@sailfish-ai/recorder 1.12.7 → 1.12.9
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/chunks/{canvasManager-Ce7vazTt.js → canvasManager-CLCtW5BZ.js} +1 -1
- package/dist/chunks/canvasManager-CLCtW5BZ.js.br +0 -0
- package/dist/chunks/canvasManager-CLCtW5BZ.js.gz +0 -0
- package/dist/chunks/{canvasManager-B9uQ-PFS.js → canvasManager-Dtum5H28.js} +1 -1
- package/dist/chunks/canvasManager-Dtum5H28.js.br +0 -0
- package/dist/chunks/canvasManager-Dtum5H28.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-C1knjCQ5.js → chunkSerializer-9QANwItv.js} +1 -1
- package/dist/chunks/chunkSerializer-9QANwItv.js.br +0 -0
- package/dist/chunks/chunkSerializer-9QANwItv.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-B-z7p0r-.js → chunkSerializer-Ds0Flu_e.js} +1 -1
- package/dist/chunks/chunkSerializer-Ds0Flu_e.js.br +0 -0
- package/dist/chunks/chunkSerializer-Ds0Flu_e.js.gz +0 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js +137 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js.br +0 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js.gz +0 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js +139 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js.br +0 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js.gz +0 -0
- package/dist/chunks/{index-BMHQ-0NY.js → index-BRybWPUS.js} +142 -128
- package/dist/chunks/index-BRybWPUS.js.br +0 -0
- package/dist/chunks/index-BRybWPUS.js.gz +0 -0
- package/dist/chunks/{index-qgM1hFXO.js → index-Cp1vLB5Q.js} +120 -107
- package/dist/chunks/index-Cp1vLB5Q.js.br +0 -0
- package/dist/chunks/index-Cp1vLB5Q.js.gz +0 -0
- package/dist/hoverDetection.js +371 -0
- package/dist/hoverDetection.js.br +0 -0
- package/dist/hoverDetection.js.gz +0 -0
- package/dist/hoverDetection.test.js +187 -0
- package/dist/hoverDetection.test.js.br +0 -0
- package/dist/hoverDetection.test.js.gz +0 -0
- package/dist/index.js +23 -1
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +13 -12
- package/dist/recorder.js.br +7 -2
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +597 -452
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +27 -0
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/types/hoverDetection.d.ts +37 -0
- package/dist/types/hoverDetection.test.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/canvasManager-B9uQ-PFS.js.br +0 -0
- package/dist/chunks/canvasManager-B9uQ-PFS.js.gz +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.br +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.gz +0 -0
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.br +0 -0
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.gz +0 -0
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.br +0 -0
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.gz +0 -0
- package/dist/chunks/index-BMHQ-0NY.js.br +0 -0
- package/dist/chunks/index-BMHQ-0NY.js.gz +0 -0
- package/dist/chunks/index-qgM1hFXO.js.br +0 -0
- package/dist/chunks/index-qgM1hFXO.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -259,7 +259,7 @@ async function deleteNotifyMessageById(e2) {
|
|
|
259
259
|
t2.delete(e2);
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
|
-
const y = "undefined" != typeof globalThis && void 0 !== globalThis.window,
|
|
262
|
+
const y = "undefined" != typeof globalThis && void 0 !== globalThis.window, v = "undefined" != typeof globalThis && void 0 !== globalThis.document, S = "undefined" != typeof globalThis && "localStorage" in globalThis, b = "undefined" != typeof globalThis && "sessionStorage" in globalThis, w = "sailfishSessionId", k = "__sailfish_refresh__";
|
|
263
263
|
let x = null;
|
|
264
264
|
function getOrSetSessionId() {
|
|
265
265
|
if (!y) return uuidv4();
|
|
@@ -305,7 +305,7 @@ function withAppUrlMetadata(e2) {
|
|
|
305
305
|
}
|
|
306
306
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
307
307
|
const I = readDebugFlag(), E = "per_session";
|
|
308
|
-
let C = null, M = null, $ = null,
|
|
308
|
+
let C = null, M = null, $ = null, F = null, A = 0, L = false, R = null, D = null;
|
|
309
309
|
const P = [];
|
|
310
310
|
let B = 0, _ = 0, O = false;
|
|
311
311
|
function pushBinaryRing(e2) {
|
|
@@ -350,9 +350,9 @@ function getBinaryDropCount() {
|
|
|
350
350
|
return _;
|
|
351
351
|
}
|
|
352
352
|
function getBufferedAmount() {
|
|
353
|
-
if (C) return
|
|
354
|
-
if (
|
|
355
|
-
return
|
|
353
|
+
if (C) return A;
|
|
354
|
+
if (F && isWebSocketOpen(M)) try {
|
|
355
|
+
return F();
|
|
356
356
|
} catch {
|
|
357
357
|
return 0;
|
|
358
358
|
}
|
|
@@ -400,21 +400,21 @@ function enrichEventWithTimeSync(e2) {
|
|
|
400
400
|
const t2 = buildEventTimeEnvelope(monotonicNow(), Date.now());
|
|
401
401
|
e2.client = t2.client, e2.serverEstimated = t2.serverEstimated;
|
|
402
402
|
}
|
|
403
|
-
let N = "", q = "",
|
|
404
|
-
const
|
|
403
|
+
let N = "", q = "", H = false;
|
|
404
|
+
const z = [];
|
|
405
405
|
function onNavigationChange(e2) {
|
|
406
|
-
|
|
406
|
+
z.push(e2);
|
|
407
407
|
}
|
|
408
408
|
function _updateHrefCache() {
|
|
409
409
|
N = window.location.href, q = window.location.origin + window.location.pathname;
|
|
410
|
-
for (const e2 of
|
|
410
|
+
for (const e2 of z) try {
|
|
411
411
|
e2();
|
|
412
412
|
} catch (e3) {
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
function ensureHrefCache() {
|
|
416
|
-
if (
|
|
417
|
-
|
|
416
|
+
if (H || "undefined" == typeof window) return;
|
|
417
|
+
H = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
|
|
418
418
|
const e2 = history.pushState;
|
|
419
419
|
history.pushState = function(...t3) {
|
|
420
420
|
e2.apply(this, t3), _updateHrefCache();
|
|
@@ -624,8 +624,8 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
624
624
|
const t3 = new URL(e2);
|
|
625
625
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
626
626
|
})(t2);
|
|
627
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.
|
|
628
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), $ = null,
|
|
627
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.9`;
|
|
628
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), $ = null, F = null, A = 0, C = r2 ? (function tryCreateWsWorker() {
|
|
629
629
|
if ("undefined" == typeof Worker) return null;
|
|
630
630
|
try {
|
|
631
631
|
const e2 = new Blob(['\nvar ws = null;\nvar wsUrl = "";\nvar reconnectTimer = null;\nvar reconnectDelay = 1000;\nvar MAX_RECONNECT_DELAY = 30000;\nvar CONNECTION_TIMEOUT = 30000;\nvar queue = [];\nvar MAX_QUEUE = 500;\n\nfunction enqueue(str) {\n if (queue.length >= MAX_QUEUE) queue.shift();\n queue.push(str);\n}\n\nfunction drain() {\n while (queue.length > 0) {\n if (!ws || ws.readyState !== 1) break;\n try { ws.send(queue.shift()); } catch (e) { break; }\n }\n}\n\n// Backpressure (A11): report the live socket buffer depth to the main thread on\n// a light interval so canvas video capture can throttle frame production when a\n// slow-but-open socket falls behind. Cheap (one number) and off the main thread.\nvar bufferedReportTimer = null;\nfunction startBufferedReporting() {\n if (bufferedReportTimer) return;\n bufferedReportTimer = setInterval(function() {\n var amt = (ws && ws.readyState === 1) ? (ws.bufferedAmount || 0) : 0;\n postMessage({ type: "buffered", bufferedAmount: amt });\n }, 250);\n}\n\nfunction connect() {\n if (ws && (ws.readyState === 0 || ws.readyState === 1)) return;\n try { ws = new WebSocket(wsUrl); } catch (e) { scheduleReconnect(); return; }\n var tid = setTimeout(function() { if (ws && ws.readyState === 0) ws.close(); }, CONNECTION_TIMEOUT);\n ws.onopen = function() {\n clearTimeout(tid);\n reconnectDelay = 1000;\n drain();\n startBufferedReporting();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n if (bufferedReportTimer) { clearInterval(bufferedReportTimer); bufferedReportTimer = null; }\n postMessage({ type: "buffered", bufferedAmount: 0 });\n postMessage({ type: "close" });\n scheduleReconnect();\n };\n ws.onerror = function() {};\n ws.onmessage = function(e) {\n postMessage({ type: "message", data: e.data });\n };\n}\n\nfunction scheduleReconnect() {\n if (reconnectTimer) return;\n reconnectTimer = setTimeout(function() {\n reconnectTimer = null;\n reconnectDelay = Math.min(reconnectDelay * 1.5, MAX_RECONNECT_DELAY);\n connect();\n }, reconnectDelay);\n}\n\nself.onmessage = function(e) {\n var msg = e.data;\n if (msg.type === "init") {\n wsUrl = msg.wsUrl;\n connect();\n } else if (msg.type === "send") {\n try {\n var s = JSON.stringify(msg.payload);\n if (ws && ws.readyState === 1) { ws.send(s); }\n else { enqueue(s); }\n } catch (e) {}\n } else if (msg.type === "sendRaw") {\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) { enqueue(msg.payload); }\n } else { enqueue(msg.payload); }\n } else if (msg.type === "sendBinary") {\n // Binary frames (canvas SFCV). The main thread only posts these while the\n // socket is open; if it closed in the meantime the frame is dropped (the\n // main-thread ring buffer covers the not-open case).\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) {}\n }\n } else if (msg.type === "close") {\n if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }\n if (ws) { ws.close(); ws = null; }\n }\n};\n'], { type: "application/javascript" }), t3 = URL.createObjectURL(e2), n3 = new Worker(t3);
|
|
@@ -639,14 +639,14 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
639
639
|
} };
|
|
640
640
|
return M = t3, C.onmessage = (e3) => {
|
|
641
641
|
const n3 = e3.data;
|
|
642
|
-
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED,
|
|
642
|
+
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, A = 0, handleWsClose()) : "message" === n3.type ? handleWsMessage(n3.data) : "buffered" === n3.type && (A = "number" == typeof n3.bufferedAmount ? n3.bufferedAmount : 0);
|
|
643
643
|
}, C.onerror = () => {
|
|
644
644
|
I && console.warn("[Sailfish] WebSocket worker error");
|
|
645
645
|
}, C.postMessage({ type: "init", wsUrl: a2 }), I && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
646
646
|
}
|
|
647
647
|
I && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
648
648
|
const c2 = new e(a2, [], { connectionTimeout: 3e4 });
|
|
649
|
-
c2.binaryType = "arraybuffer", $ = (e2) => c2.send(e2),
|
|
649
|
+
c2.binaryType = "arraybuffer", $ = (e2) => c2.send(e2), F = () => c2.bufferedAmount || 0;
|
|
650
650
|
const l2 = { get readyState() {
|
|
651
651
|
return c2.readyState;
|
|
652
652
|
}, close: () => {
|
|
@@ -896,13 +896,13 @@ function maskInputFn(e2, t2) {
|
|
|
896
896
|
var _a;
|
|
897
897
|
return "hidden" === t2.type ? "" : t2.hasAttribute("data-cc") || ((_a = t2.getAttribute("autocomplete")) == null ? void 0 : _a.startsWith("cc-")) || n.looksLikeCreditCard(e2) ? n.redactCreditCard(e2) : t2.hasAttribute("data-ssn") || n.looksLikeSsn(e2) ? n.redactSsn(e2) : t2.hasAttribute("data-dob") ? n.redactDob(e2) : "*".repeat(e2.length);
|
|
898
898
|
}
|
|
899
|
-
let me = true, he = null, ye = null,
|
|
899
|
+
let me = true, he = null, ye = null, ve = null, Se = null;
|
|
900
900
|
function invalidateUrlCache() {
|
|
901
901
|
me = true;
|
|
902
902
|
}
|
|
903
903
|
const getUrlAndStoredUuids = () => (me && (function _refreshSessionStorageCache() {
|
|
904
|
-
he = sessionStorage.getItem("pageVisitUUID"), ye = sessionStorage.getItem("prevPageVisitUUID"),
|
|
905
|
-
})(), { page_visit_uuid: he, prev_page_visit_uuid: ye, href: getCachedHrefNoQuery(), tabVisibilityChanged:
|
|
904
|
+
he = sessionStorage.getItem("pageVisitUUID"), ye = sessionStorage.getItem("prevPageVisitUUID"), ve = sessionStorage.getItem("tabVisibilityChanged"), Se = sessionStorage.getItem("tabVisibilityState"), me = false;
|
|
905
|
+
})(), { page_visit_uuid: he, prev_page_visit_uuid: ye, href: getCachedHrefNoQuery(), tabVisibilityChanged: ve, tabVisibilityState: Se });
|
|
906
906
|
function initializeDomContentEvents(e2) {
|
|
907
907
|
document.addEventListener("readystatechange", () => {
|
|
908
908
|
const t2 = { type: 24, data: { source: 0, info: "" }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() };
|
|
@@ -979,7 +979,7 @@ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2
|
|
|
979
979
|
ue = i4, await yieldToMain();
|
|
980
980
|
const o3 = e2.unmaskSelector || void 0, s3 = e2.blockSelector || void 0, a3 = e2.maskTextSelector || void 0, c3 = e2.maskInputSelector || void 0, d3 = { ...e2.maskInputOptions ?? {} }, u2 = c3 ? { ...de } : d3, p2 = n.buildMaskInputFn({ baseFn: maskInputFn, unmaskSelector: o3, maskInputSelector: c3, adminMaskInputOptions: d3 }), f2 = n.makeMaskTextFn(o3);
|
|
981
981
|
if (l2) {
|
|
982
|
-
const { chunkedSnapshot: n2 } = await Promise.resolve().then(() => require("./chunkSerializer-
|
|
982
|
+
const { chunkedSnapshot: n2 } = await Promise.resolve().then(() => require("./chunkSerializer-9QANwItv.js")), r3 = i4.mirror;
|
|
983
983
|
let l3 = true;
|
|
984
984
|
const d4 = [];
|
|
985
985
|
i4({ emit(e3) {
|
|
@@ -994,8 +994,14 @@ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2
|
|
|
994
994
|
} else i4({ emit(e3) {
|
|
995
995
|
emitWithContext(e3);
|
|
996
996
|
}, ...e2, maskInputOptions: u2, maskInputFn: p2, maskTextFn: f2, maskInputSelector: c3, maskTextSelector: a3, blockSelector: s3, maskTextClass: e2.maskTextClass ?? pe, recordCanvas: false });
|
|
997
|
+
if (false !== e2.recordHover) try {
|
|
998
|
+
const { installHoverDetection: t2 } = await Promise.resolve().then(() => require("./hoverDetection-Bl-yKKI3.js")), num = (e3, t3) => "number" == typeof e3 ? e3 : t3, n2 = t2(i4, { dwellMs: num(e2.hoverDwellMs, 500), strictAffordance: false !== e2.hoverStrictAffordance, cooldownMs: num(e2.hoverCooldownMs, 3e3), maxPerSession: num(e2.hoverMaxPerSession, 300), maxPerSecond: num(e2.hoverMaxPerSecond, 1) });
|
|
999
|
+
window.addEventListener("pagehide", () => n2(), { once: true });
|
|
1000
|
+
} catch (e3) {
|
|
1001
|
+
console.warn("[Sailfish] Failed to enable hover detection:", e3);
|
|
1002
|
+
}
|
|
997
1003
|
if (e2.recordCanvas) try {
|
|
998
|
-
const { startCanvasRecording: n2, stopCanvasRecording: o4, flushAllCanvas: s4, isCanvasRecordingActive: a4 } = await Promise.resolve().then(() => require("./canvasManager-
|
|
1004
|
+
const { startCanvasRecording: n2, stopCanvasRecording: o4, flushAllCanvas: s4, isCanvasRecordingActive: a4 } = await Promise.resolve().then(() => require("./canvasManager-CLCtW5BZ.js")), c4 = { settings: { maskCanvasClass: e2.maskCanvasClass, maskTextClass: e2.maskTextClass, maskTextSelector: e2.maskTextSelector, blockSelector: e2.blockSelector, unmaskSelector: e2.unmaskSelector, maskCanvasText: e2.maskCanvasText ?? void 0, canvasRedactStyle: e2.canvasRedactStyle, recordSsn: e2.recordSsn, recordCreditCardInfo: e2.recordCreditCardInfo, recordDob: e2.recordDob, recordRealName: e2.recordRealName, recordPassword: e2.recordPassword }, mirror: i4.mirror, addSailfishEvent: (e3) => {
|
|
999
1005
|
ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { ...e3, tag: "sf-canvas" });
|
|
1000
1006
|
}, sendBinary: wsSendBinary, getContextIds: () => ({ session_id: r2, page_visit_uuid: getUrlAndStoredUuids().page_visit_uuid }), isTransportSaturated };
|
|
1001
1007
|
n2(c4);
|
|
@@ -1063,7 +1069,7 @@ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2
|
|
|
1063
1069
|
}
|
|
1064
1070
|
return d2;
|
|
1065
1071
|
}
|
|
1066
|
-
const
|
|
1072
|
+
const be = [(e2) => (function checkNextJs() {
|
|
1067
1073
|
try {
|
|
1068
1074
|
if (void 0 !== globalThis.__NEXT_DATA__) return "nextjs";
|
|
1069
1075
|
} catch {
|
|
@@ -1128,7 +1134,7 @@ const ve = [(e2) => (function checkNextJs() {
|
|
|
1128
1134
|
const we = "sf-create-issue-preference", ke = "sf-create-eng-ticket-preference";
|
|
1129
1135
|
function getInitialState() {
|
|
1130
1136
|
const e2 = (function loadUserPreferences() {
|
|
1131
|
-
return { createIssue:
|
|
1137
|
+
return { createIssue: S && "true" === localStorage.getItem(we), createEngTicket: S && "true" === localStorage.getItem(ke) };
|
|
1132
1138
|
})();
|
|
1133
1139
|
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
1134
1140
|
}
|
|
@@ -1143,13 +1149,13 @@ function setIsRecording(e2) {
|
|
|
1143
1149
|
Ce = e2;
|
|
1144
1150
|
}
|
|
1145
1151
|
const $e = ["jira", "linear", "zendesk"];
|
|
1146
|
-
let
|
|
1147
|
-
const
|
|
1152
|
+
let Fe = null;
|
|
1153
|
+
const Ae = /* @__PURE__ */ new Map();
|
|
1148
1154
|
function getIntegrationData() {
|
|
1149
|
-
return
|
|
1155
|
+
return Fe;
|
|
1150
1156
|
}
|
|
1151
1157
|
function hasValidIntegration() {
|
|
1152
|
-
return null !==
|
|
1158
|
+
return null !== Fe && true === Fe.installed;
|
|
1153
1159
|
}
|
|
1154
1160
|
function resolveIntegration(e2) {
|
|
1155
1161
|
var _a;
|
|
@@ -1163,14 +1169,14 @@ function resolveIntegration(e2) {
|
|
|
1163
1169
|
var _a2;
|
|
1164
1170
|
return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
|
|
1165
1171
|
}) || n2[0];
|
|
1166
|
-
return (i2 == null ? void 0 : i2.primaryCloudId) &&
|
|
1172
|
+
return (i2 == null ? void 0 : i2.primaryCloudId) && Ae.set(i2.primaryCloudId, i2), i2;
|
|
1167
1173
|
}
|
|
1168
1174
|
async function refreshIntegrationData(e2, t2) {
|
|
1169
1175
|
try {
|
|
1170
1176
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
1171
|
-
return
|
|
1177
|
+
return Fe = n2, n2;
|
|
1172
1178
|
} catch (e3) {
|
|
1173
|
-
return console.error("Error refreshing integration data:", e3),
|
|
1179
|
+
return console.error("Error refreshing integration data:", e3), Fe;
|
|
1174
1180
|
}
|
|
1175
1181
|
}
|
|
1176
1182
|
function populateSelectOptions(e2, t2, n2) {
|
|
@@ -1215,8 +1221,8 @@ function populateSprintOptions(e2, t2, n2) {
|
|
|
1215
1221
|
}), n2 && (e2.value = n2);
|
|
1216
1222
|
}
|
|
1217
1223
|
function getSprintFieldId() {
|
|
1218
|
-
if (!(
|
|
1219
|
-
const e2 = Array.isArray(
|
|
1224
|
+
if (!(Fe == null ? void 0 : Fe.fieldConfigurations)) return "customfield_10020";
|
|
1225
|
+
const e2 = Array.isArray(Fe.fieldConfigurations) ? Fe.fieldConfigurations : [];
|
|
1220
1226
|
for (const t2 of e2) {
|
|
1221
1227
|
const e3 = (t2.fields || []).find((e4) => {
|
|
1222
1228
|
var _a;
|
|
@@ -1228,12 +1234,12 @@ function getSprintFieldId() {
|
|
|
1228
1234
|
}
|
|
1229
1235
|
function updateIssueTypeOptions(e2, t2) {
|
|
1230
1236
|
var _a;
|
|
1231
|
-
if (!(
|
|
1237
|
+
if (!(Fe == null ? void 0 : Fe.projects) || !t2) {
|
|
1232
1238
|
e2.innerHTML = "";
|
|
1233
1239
|
const t3 = document.createElement("option");
|
|
1234
1240
|
return t3.value = "", t3.disabled = true, t3.selected = true, t3.textContent = "Select project first...", t3.style.color = "#9ca3af", e2.appendChild(t3), void (e2.style.color = "#9ca3af");
|
|
1235
1241
|
}
|
|
1236
|
-
const n2 =
|
|
1242
|
+
const n2 = Fe.projects.find((e3) => e3.id === t2);
|
|
1237
1243
|
if (!n2 || !n2.issue_types) {
|
|
1238
1244
|
e2.innerHTML = "";
|
|
1239
1245
|
const t3 = document.createElement("option");
|
|
@@ -1257,12 +1263,12 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
1257
1263
|
}
|
|
1258
1264
|
}
|
|
1259
1265
|
function getFieldsForProject(e2, t2) {
|
|
1260
|
-
if (!(
|
|
1261
|
-
const n2 = Array.isArray(
|
|
1266
|
+
if (!(Fe == null ? void 0 : Fe.fieldConfigurations) || !e2) return [];
|
|
1267
|
+
const n2 = Array.isArray(Fe.fieldConfigurations) ? Fe.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : Fe.fieldConfigurations[e2];
|
|
1262
1268
|
return n2 && n2.fields ? n2.fields : [];
|
|
1263
1269
|
}
|
|
1264
1270
|
function getUsers() {
|
|
1265
|
-
return (
|
|
1271
|
+
return (Fe == null ? void 0 : Fe.users) ? Fe.users : [];
|
|
1266
1272
|
}
|
|
1267
1273
|
function getDefaultReporterAccountId() {
|
|
1268
1274
|
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
@@ -1279,8 +1285,8 @@ function getDefaultReporterAccountId() {
|
|
|
1279
1285
|
return r2 && (r2.id || r2.accountId) || null;
|
|
1280
1286
|
}
|
|
1281
1287
|
function lastReporterStorageKey() {
|
|
1282
|
-
if (!
|
|
1283
|
-
const e2 =
|
|
1288
|
+
if (!Fe) return null;
|
|
1289
|
+
const e2 = Fe.primaryCloudId || Fe.provider || "";
|
|
1284
1290
|
return e2 ? `sf-veritas:lastReporter:${e2}` : null;
|
|
1285
1291
|
}
|
|
1286
1292
|
function getSavedLastReporterAccountId() {
|
|
@@ -1307,42 +1313,42 @@ function getValidSavedReporterAccountId() {
|
|
|
1307
1313
|
return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
|
|
1308
1314
|
}
|
|
1309
1315
|
function getProjectsForTeam(e2) {
|
|
1310
|
-
if (!
|
|
1311
|
-
const t2 =
|
|
1316
|
+
if (!Fe) return [];
|
|
1317
|
+
const t2 = Fe.teams && Array.isArray(Fe.teams) && Fe.teams.length > 0;
|
|
1312
1318
|
if (t2 && e2) {
|
|
1313
|
-
const t3 =
|
|
1319
|
+
const t3 = Fe.teams.find((t4) => t4.id === e2);
|
|
1314
1320
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
1315
1321
|
}
|
|
1316
|
-
return !t2 &&
|
|
1322
|
+
return !t2 && Fe.projects ? Fe.projects : [];
|
|
1317
1323
|
}
|
|
1318
1324
|
function updateFormWithIntegrationData(e2) {
|
|
1319
1325
|
var _a;
|
|
1320
|
-
if (!
|
|
1321
|
-
const t2 =
|
|
1322
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
1326
|
+
if (!Fe) return e2;
|
|
1327
|
+
const t2 = Fe.teams && Array.isArray(Fe.teams) && Fe.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
1328
|
+
n2 && t2 && (populateSelectOptions(n2, Fe.teams, Fe.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
1323
1329
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
1324
1330
|
if (i2) {
|
|
1325
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
1331
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : Fe.projects || [], Fe.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
1326
1332
|
}
|
|
1327
1333
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
1328
|
-
o2 && (populatePriorityOptions(o2,
|
|
1329
|
-
const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a =
|
|
1330
|
-
if (r2 && s2 &&
|
|
1334
|
+
o2 && (populatePriorityOptions(o2, Fe.provider || "", Fe.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
1335
|
+
const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a = Fe.provider) == null ? void 0 : _a.toLowerCase());
|
|
1336
|
+
if (r2 && s2 && Fe.sprints) {
|
|
1331
1337
|
if (!e2.engTicketSprint && !Me) {
|
|
1332
|
-
const t3 = pickDefaultActiveSprint(
|
|
1338
|
+
const t3 = pickDefaultActiveSprint(Fe.sprints, e2.engTicketProject, Fe.projects || []);
|
|
1333
1339
|
(t3 == null ? void 0 : t3.id) && (e2.engTicketSprint = String(t3.id), setSprintDefaulted(true));
|
|
1334
1340
|
}
|
|
1335
|
-
populateSprintOptions(r2,
|
|
1341
|
+
populateSprintOptions(r2, Fe.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (r2.style.color = "");
|
|
1336
1342
|
}
|
|
1337
1343
|
const a2 = document.getElementById("sf-eng-ticket-type");
|
|
1338
1344
|
return a2 && s2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
|
|
1339
1345
|
}
|
|
1340
1346
|
const Le = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
1341
|
-
if (!
|
|
1347
|
+
if (!Fe) try {
|
|
1342
1348
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
1343
|
-
|
|
1349
|
+
Fe = resolveIntegration(n2);
|
|
1344
1350
|
} catch (e3) {
|
|
1345
|
-
console.error("Error fetching integration data:", e3),
|
|
1351
|
+
console.error("Error fetching integration data:", e3), Fe = null;
|
|
1346
1352
|
}
|
|
1347
1353
|
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, pickDefaultActiveSprint, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }));
|
|
1348
1354
|
function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
@@ -2004,19 +2010,19 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
2004
2010
|
const t5 = e6, n4 = t5.dataset.fieldId;
|
|
2005
2011
|
n4 && ("checkbox" === t5.type ? h2[n4] = t5.checked : "number" === t5.type ? h2[n4] = parseFloat(t5.value) || null : t5.classList.contains("sf-custom-multiselect") || (h2[n4] = t5.value));
|
|
2006
2012
|
});
|
|
2007
|
-
const y2 = document.getElementById("sf-eng-ticket-sprint"),
|
|
2008
|
-
if (
|
|
2013
|
+
const y2 = document.getElementById("sf-eng-ticket-sprint"), v2 = (y2 == null ? void 0 : y2.value) || xe.engTicketSprint;
|
|
2014
|
+
if (v2) {
|
|
2009
2015
|
const e6 = getSprintFieldId();
|
|
2010
|
-
h2[e6] = parseInt(
|
|
2016
|
+
h2[e6] = parseInt(v2, 10);
|
|
2011
2017
|
}
|
|
2012
|
-
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length),
|
|
2013
|
-
for (const e6 of
|
|
2018
|
+
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length), S2 = xe.createEngTicket ? (getFieldsForProject(p2, m2) || []).filter((e6) => e6 && e6.required) : [], b2 = [];
|
|
2019
|
+
for (const e6 of S2) {
|
|
2014
2020
|
const t5 = e6.fieldId || e6.key;
|
|
2015
2021
|
if ("summary" === t5 || "description" === t5 || "priority" === t5) continue;
|
|
2016
2022
|
let n4, i4;
|
|
2017
|
-
"project" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-project"), i4 = p2) : "issuetype" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-type"), i4 = m2) : (n4 = !!document.querySelector(`[data-field-id="${t5}"]`), i4 = h2[t5]), n4 && isFieldEmpty(i4) &&
|
|
2023
|
+
"project" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-project"), i4 = p2) : "issuetype" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-type"), i4 = m2) : (n4 = !!document.querySelector(`[data-field-id="${t5}"]`), i4 = h2[t5]), n4 && isFieldEmpty(i4) && b2.push(e6.name || t5);
|
|
2018
2024
|
}
|
|
2019
|
-
if (
|
|
2025
|
+
if (b2.length > 0) return void alert(`Please fill in the required field${b2.length > 1 ? "s" : ""}: ${b2.join(", ")}`);
|
|
2020
2026
|
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3) {
|
|
2021
2027
|
var _a2, _b, _c;
|
|
2022
2028
|
try {
|
|
@@ -2371,13 +2377,13 @@ function onPointerDown(e2) {
|
|
|
2371
2377
|
} catch {
|
|
2372
2378
|
}
|
|
2373
2379
|
}
|
|
2374
|
-
const qe = readDebugFlag(),
|
|
2380
|
+
const qe = readDebugFlag(), He = /* @__PURE__ */ new Map();
|
|
2375
2381
|
function getCachedRegex(e2, t2) {
|
|
2376
2382
|
const n2 = `${e2}|${t2}`;
|
|
2377
|
-
let i2 =
|
|
2378
|
-
return i2 || (i2 = new RegExp(e2, t2),
|
|
2383
|
+
let i2 = He.get(n2);
|
|
2384
|
+
return i2 || (i2 = new RegExp(e2, t2), He.set(n2, i2)), i2;
|
|
2379
2385
|
}
|
|
2380
|
-
const
|
|
2386
|
+
const ze = new Set([".js", ".mjs", ".cjs", ".ts", ".css", ".scss", ".sass", ".less", ".styl", ".stylus", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".avif", ".bmp", ".ico", ".tiff", ".tif", ".heic", ".woff", ".woff2", ".ttf", ".otf", ".eot", ".mp4", ".webm", ".ogv", ".mp3", ".wav", ".flac", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".csv", ".json", ".xml", ".txt", ".zip", ".rar", ".gz", ".tar", ".7z", ".map", ".webmanifest"].map((e2) => e2.toLowerCase())), We = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ke = [400, 403], Ge = "CORS", Ve = "authorization", Qe = "Authorization", Xe = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false, maskInputSelector: "", maskTextSelector: "", blockSelector: "", unmaskSelector: "", maskInputOptions: { password: true }, recordHover: true, hoverDwellMs: 500, hoverStrictAffordance: true, hoverCooldownMs: 3e3, hoverMaxPerSession: 300, hoverMaxPerSecond: 1 }, Je = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
2381
2387
|
function maskAuthorizationHeader(e2) {
|
|
2382
2388
|
const t2 = e2[Ve] ? Ve : e2[Qe] ? Qe : null;
|
|
2383
2389
|
if (!t2) return;
|
|
@@ -2411,14 +2417,14 @@ function trackDomainChangesOnce() {
|
|
|
2411
2417
|
function sendUserDeviceUuid() {
|
|
2412
2418
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
2413
2419
|
let e2 = null;
|
|
2414
|
-
if (
|
|
2420
|
+
if (S) try {
|
|
2415
2421
|
e2 = localStorage.getItem("sailfishUserDeviceUuid");
|
|
2416
2422
|
} catch {
|
|
2417
2423
|
}
|
|
2418
2424
|
if (!e2) {
|
|
2419
2425
|
e2 = uuidv4();
|
|
2420
2426
|
try {
|
|
2421
|
-
|
|
2427
|
+
S && localStorage.setItem("sailfishUserDeviceUuid", e2);
|
|
2422
2428
|
} catch {
|
|
2423
2429
|
}
|
|
2424
2430
|
}
|
|
@@ -2436,7 +2442,7 @@ function handleVisibilityChange() {
|
|
|
2436
2442
|
sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
|
|
2437
2443
|
}
|
|
2438
2444
|
function clearPageVisitDataFromSessionStorage() {
|
|
2439
|
-
|
|
2445
|
+
b && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
2440
2446
|
}
|
|
2441
2447
|
let Ye = false;
|
|
2442
2448
|
function _ensureModuleSideEffects() {
|
|
@@ -2446,7 +2452,7 @@ function _ensureModuleSideEffects() {
|
|
|
2446
2452
|
}));
|
|
2447
2453
|
})(), y && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
2448
2454
|
sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
2449
|
-
})()),
|
|
2455
|
+
})()), v && document.addEventListener("visibilitychange", handleVisibilityChange), y && (window.addEventListener("beforeunload", () => {
|
|
2450
2456
|
clearPageVisitDataFromSessionStorage();
|
|
2451
2457
|
}), window.addEventListener("online", () => {
|
|
2452
2458
|
requestTimeSync();
|
|
@@ -2494,9 +2500,13 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2494
2500
|
return true;
|
|
2495
2501
|
}
|
|
2496
2502
|
const r2 = o2.pathname.toLowerCase(), s2 = r2.lastIndexOf(".");
|
|
2497
|
-
return !(-1 === s2 || !
|
|
2503
|
+
return !(-1 === s2 || !ze.has(r2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2498
2504
|
};
|
|
2499
2505
|
}
|
|
2506
|
+
function resolveFailedFetchStatus(e2, t2) {
|
|
2507
|
+
var _a;
|
|
2508
|
+
return ((_a = e2 == null ? void 0 : e2.response) == null ? void 0 : _a.status) ?? t2 ?? 0;
|
|
2509
|
+
}
|
|
2500
2510
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
|
|
2501
2511
|
const o2 = window.fetch, r2 = getOrSetSessionId(), s2 = createSkipHeadersPropagationChecker(e2, n2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], c2 = ["application/octet-stream"];
|
|
2502
2512
|
window.fetch = new Proxy(o2, { apply: async (e3, n3, o3) => {
|
|
@@ -2508,7 +2518,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2508
2518
|
l2 = d2.href;
|
|
2509
2519
|
}
|
|
2510
2520
|
return s2(l2) ? e3.apply(n3, o3) : (async function injectHeaderWrapper(e4, n4, o4, r3, s3, l3, d3) {
|
|
2511
|
-
var _a
|
|
2521
|
+
var _a;
|
|
2512
2522
|
if (!l3) return e4.apply(n4, o4);
|
|
2513
2523
|
let u3 = uuidv4();
|
|
2514
2524
|
const p2 = getUrlAndStoredUuids(), f2 = s3.method || "GET", g2 = Date.now();
|
|
@@ -2532,13 +2542,14 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2532
2542
|
qe && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2533
2543
|
}
|
|
2534
2544
|
delete h2[i];
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2537
|
-
const
|
|
2538
|
-
h2[i] =
|
|
2545
|
+
const v2 = getFuncSpanHeader();
|
|
2546
|
+
v2 && delete h2[v2.name];
|
|
2547
|
+
const S2 = `${l3}/${p2.page_visit_uuid}/${u3}`;
|
|
2548
|
+
h2[i] = S2, v2 && (h2[v2.name] = v2.value);
|
|
2549
|
+
let b2;
|
|
2539
2550
|
maskAuthorizationHeader(h2);
|
|
2540
2551
|
try {
|
|
2541
|
-
let
|
|
2552
|
+
let v3 = await (async function injectHeader(e5, t3, n5, o5, r4, s4, a3) {
|
|
2542
2553
|
const c3 = getFuncSpanHeader();
|
|
2543
2554
|
if (n5 instanceof Request) {
|
|
2544
2555
|
const l4 = n5.clone(), d4 = new Headers(l4.headers);
|
|
@@ -2550,8 +2561,10 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2550
2561
|
const l4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2551
2562
|
return d4.set(i, `${r4}/${s4}/${a3}`), c3 && (d4.set(c3.name, c3.value), qe && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof n5 ? n5 : n5.href, header: c3.name })), l4.headers = d4, await e5.call(t3, n5, l4);
|
|
2552
2563
|
}
|
|
2553
|
-
})(e4, n4, r3, s3, l3, p2.page_visit_uuid, u3)
|
|
2554
|
-
|
|
2564
|
+
})(e4, n4, r3, s3, l3, p2.page_visit_uuid, u3);
|
|
2565
|
+
b2 = v3.status;
|
|
2566
|
+
let S3 = false;
|
|
2567
|
+
Ke.includes(v3.status) && (qe && console.log("Perform retry as status was fail:", v3), delete h2[i], v3 = await (async function retryWithoutPropagateHeaders(e5, t3, n5, o5) {
|
|
2555
2568
|
try {
|
|
2556
2569
|
let o6 = n5[0], r4 = n5[1] || {};
|
|
2557
2570
|
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
@@ -2569,38 +2582,38 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2569
2582
|
} catch (e6) {
|
|
2570
2583
|
throw qe && console.log(`Retry without ${i} for ${o5} also failed:`, e6), e6;
|
|
2571
2584
|
}
|
|
2572
|
-
})(e4, n4, o4, d3),
|
|
2573
|
-
const
|
|
2585
|
+
})(e4, n4, o4, d3), b2 = v3.status, S3 = true);
|
|
2586
|
+
const w2 = Date.now(), k2 = (function captureClientTime() {
|
|
2574
2587
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2575
|
-
})(),
|
|
2576
|
-
let
|
|
2588
|
+
})(), x2 = v3.status, T2 = v3.ok, I2 = T2 ? "" : `Request Error: ${v3.statusText}`;
|
|
2589
|
+
let E2 = null;
|
|
2577
2590
|
try {
|
|
2578
|
-
|
|
2579
|
-
|
|
2591
|
+
E2 = {}, v3.headers.forEach((e5, t3) => {
|
|
2592
|
+
E2[t3] = e5;
|
|
2580
2593
|
});
|
|
2581
2594
|
} catch (e5) {
|
|
2582
|
-
qe && console.warn("[Sailfish] Failed to capture response headers:", e5),
|
|
2595
|
+
qe && console.warn("[Sailfish] Failed to capture response headers:", e5), E2 = null;
|
|
2583
2596
|
}
|
|
2584
|
-
const
|
|
2585
|
-
|
|
2586
|
-
|
|
2597
|
+
const C2 = { type: 27, timestamp: w2, sessionId: l3, client: k2, data: { request_id: u3, session_id: l3, timestamp_start: g2, timestamp_end: w2, response_code: x2, success: T2, error: I2, method: f2, url: toAbsoluteUrl(d3), retry_without_trace_id: S3, request_headers: h2, request_body: m2, response_headers: E2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2598
|
+
C2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2599
|
+
C2.data.request_body = e6, sendEvent(C2);
|
|
2587
2600
|
}, () => {
|
|
2588
|
-
sendEvent(
|
|
2589
|
-
}) : sendEvent(
|
|
2590
|
-
},
|
|
2601
|
+
sendEvent(C2);
|
|
2602
|
+
}) : sendEvent(C2);
|
|
2603
|
+
}, M2 = 1024 * t2.captureResponseBodyMaxMb * 1024;
|
|
2591
2604
|
if (0 === t2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
2592
2605
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2593
2606
|
const t3 = e5.headers.get("content-type");
|
|
2594
2607
|
if (!t3) return false;
|
|
2595
2608
|
const n5 = t3.toLowerCase();
|
|
2596
2609
|
return c2.some((e6) => n5.includes(e6));
|
|
2597
|
-
})(
|
|
2610
|
+
})(v3)) sendEventWithBody(null);
|
|
2598
2611
|
else if ((function isStreamingResponse(e5) {
|
|
2599
2612
|
const t3 = e5.headers.get("content-type");
|
|
2600
2613
|
if (!t3) return false;
|
|
2601
2614
|
const n5 = t3.toLowerCase();
|
|
2602
2615
|
return a2.some((e6) => n5.includes(e6));
|
|
2603
|
-
})(
|
|
2616
|
+
})(v3)) if (t2.captureStreamingResponseBody) try {
|
|
2604
2617
|
(async function readStreamPrefix(e5, t3, n5) {
|
|
2605
2618
|
const i2 = e5.body;
|
|
2606
2619
|
if (!i2) return null;
|
|
@@ -2638,26 +2651,26 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2638
2651
|
}
|
|
2639
2652
|
return null;
|
|
2640
2653
|
}
|
|
2641
|
-
})(
|
|
2654
|
+
})(v3.clone(), 1024 * t2.captureStreamPrefixKb, t2.captureStreamTimeoutMs).then((e5) => sendEventWithBody(e5), () => sendEventWithBody(null));
|
|
2642
2655
|
} catch {
|
|
2643
2656
|
sendEventWithBody(null);
|
|
2644
2657
|
}
|
|
2645
2658
|
else sendEventWithBody(null);
|
|
2646
2659
|
else {
|
|
2647
|
-
const e5 =
|
|
2648
|
-
if (!isNaN(t3) && t3 >
|
|
2660
|
+
const e5 = v3.headers.get("content-length"), t3 = e5 ? parseInt(e5, 10) : NaN;
|
|
2661
|
+
if (!isNaN(t3) && t3 > M2) sendEventWithBody(null);
|
|
2649
2662
|
else try {
|
|
2650
|
-
|
|
2651
|
-
e6.length >
|
|
2663
|
+
v3.clone().text().then((e6) => {
|
|
2664
|
+
e6.length > M2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
2652
2665
|
}, () => sendEventWithBody(null));
|
|
2653
2666
|
} catch {
|
|
2654
2667
|
sendEventWithBody(null);
|
|
2655
2668
|
}
|
|
2656
2669
|
}
|
|
2657
|
-
return
|
|
2670
|
+
return v3;
|
|
2658
2671
|
} catch (t3) {
|
|
2659
|
-
const i2 = Date.now(), r4 = false, s4 = (
|
|
2660
|
-
if (t3 instanceof TypeError && ((
|
|
2672
|
+
const i2 = Date.now(), r4 = false, s4 = resolveFailedFetchStatus(t3, b2), a3 = t3.message || "Fetch request failed";
|
|
2673
|
+
if (t3 instanceof TypeError && ((_a = t3 == null ? void 0 : t3.message) == null ? void 0 : _a.toLowerCase().includes(Ge.toLowerCase()))) return e4.apply(n4, o4);
|
|
2661
2674
|
let c3 = m2;
|
|
2662
2675
|
if (y2) try {
|
|
2663
2676
|
c3 = await y2.text();
|
|
@@ -2669,7 +2682,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2669
2682
|
})(e3, n3, o3, d2, u2, r2, l2);
|
|
2670
2683
|
} });
|
|
2671
2684
|
}
|
|
2672
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: o2 = ["*"], domainsToNotPropagateHeaderTo: r2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: c2, serviceAdditionalMetadata: l2, enableIpTracking: d2, captureStreamingResponseBody: u2 = true, captureResponseBodyMaxMb: p2 = 10, captureStreamPrefixKb: f2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot:
|
|
2685
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: o2 = ["*"], domainsToNotPropagateHeaderTo: r2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: c2, serviceAdditionalMetadata: l2, enableIpTracking: d2, captureStreamingResponseBody: u2 = true, captureResponseBodyMaxMb: p2 = 10, captureStreamPrefixKb: f2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: v2, useWsWorker: S2 = true, capturePerformanceMetrics: w2 = true, maskTextClass: k2, maskInputSelector: x2, maskTextSelector: T2, blockSelector: I2, unmaskSelector: E2, maskInputOptions: C2, recordCanvas: M2, maskCanvasClass: $2, gitOrg: F2, gitRepo: A2, gitProvider: L2, library: R2, headlessRecording: D2 = false }) {
|
|
2673
2686
|
var _a, _b, _c, _d;
|
|
2674
2687
|
if (!D2 && (function isHeadlessOrLighthouse() {
|
|
2675
2688
|
try {
|
|
@@ -2766,7 +2779,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2766
2779
|
captureError(e3.reason, true);
|
|
2767
2780
|
});
|
|
2768
2781
|
})(), _2.errorInit = true), await yieldToMain(), !_2.perfInit && w2 && (initializePerformancePlugin(B2), _2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2769
|
-
|
|
2782
|
+
b && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2770
2783
|
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || _2.ws && 1 === _2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2771
2784
|
var _a2;
|
|
2772
2785
|
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? qe && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), qe && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
@@ -2806,19 +2819,19 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2806
2819
|
} catch {
|
|
2807
2820
|
}
|
|
2808
2821
|
const n3 = t3, i3 = [];
|
|
2809
|
-
for (const e4 of
|
|
2822
|
+
for (const e4 of be) {
|
|
2810
2823
|
const t4 = e4(n3);
|
|
2811
2824
|
t4 && !i3.includes(t4) && i3.push(t4);
|
|
2812
2825
|
}
|
|
2813
2826
|
return { framework: i3[0] ?? null, additionalFrameworks: i3.slice(1), serviceRole: "frontend" };
|
|
2814
2827
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2815
2828
|
await yieldToMain();
|
|
2816
|
-
const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, B2, t2, i2, o3, d3, n2, r3, f3,
|
|
2829
|
+
const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, B2, t2, i2, o3, d3, n2, r3, f3, F2, A2, L2)]), y3 = { ...Xe, ...(_a = g3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== k2 ? { maskTextClass: k2 } : {}, ...void 0 !== x2 ? { maskInputSelector: x2 } : {}, ...void 0 !== T2 ? { maskTextSelector: T2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== E2 ? { unmaskSelector: E2 } : {}, ...void 0 !== C2 ? { maskInputOptions: C2 } : {}, recordCanvas: M2 ?? ((_c = (_b = g3.data) == null ? void 0 : _b.captureSettingsFromApiKey) == null ? void 0 : _c.recordCanvasSf) ?? Xe.recordCanvas, ...void 0 !== $2 ? { maskCanvasClass: $2 } : {} };
|
|
2817
2830
|
if (_2.ws && 1 === _2.ws.readyState) return;
|
|
2818
2831
|
if ((_d = h3.data) == null ? void 0 : _d.startRecordingSession) {
|
|
2819
2832
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2820
2833
|
await yieldToMain();
|
|
2821
|
-
const i3 = await initializeRecording(y3, t2, e2, B2, n3, P2,
|
|
2834
|
+
const i3 = await initializeRecording(y3, t2, e2, B2, n3, P2, S2, v2 ?? false);
|
|
2822
2835
|
_2.ws = i3, _2.initialized = true, trackDomainChangesOnce(), _2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2823
2836
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2824
2837
|
})(a2, s2), _2.sentMapUuidOnce = true);
|
|
@@ -3005,7 +3018,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Xe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
3005
3018
|
return () => {
|
|
3006
3019
|
};
|
|
3007
3020
|
}
|
|
3008
|
-
}, exports.requestTimeSync = requestTimeSync, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
|
|
3021
|
+
}, exports.requestTimeSync = requestTimeSync, exports.resolveFailedFetchStatus = resolveFailedFetchStatus, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
|
|
3009
3022
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
3010
3023
|
}, exports.uninstallAdapters = function uninstallAdapters() {
|
|
3011
3024
|
Ue = null, Ne && "undefined" != typeof window && window.removeEventListener("pointerdown", onPointerDown, { capture: true }), Ne = false, je.clear();
|
|
Binary file
|
|
Binary file
|