@sailfish-ai/recorder 1.10.11 → 1.10.13
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/{chunkSerializer-BCPkBdRj.js → chunkSerializer-CodMnuS3.js} +1 -1
- package/dist/chunks/chunkSerializer-CodMnuS3.js.br +0 -0
- package/dist/chunks/chunkSerializer-CodMnuS3.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-COhHoxJ2.js → chunkSerializer-Dk1eF3S8.js} +1 -1
- package/dist/chunks/chunkSerializer-Dk1eF3S8.js.br +0 -0
- package/dist/chunks/chunkSerializer-Dk1eF3S8.js.gz +0 -0
- package/dist/chunks/{index-DmRBuNoo.js → index-DW416eVj.js} +498 -518
- package/dist/chunks/index-DW416eVj.js.br +0 -0
- package/dist/chunks/index-DW416eVj.js.gz +0 -0
- package/dist/chunks/{index-2nktNgJ_.js → index-DvLh2k6O.js} +319 -280
- package/dist/chunks/index-DvLh2k6O.js.br +0 -0
- package/dist/chunks/index-DvLh2k6O.js.gz +0 -0
- package/dist/headlessDetection.js +29 -0
- package/dist/index.js +24 -10
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.js +40 -39
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recording.js +7 -10
- package/dist/types/headlessDetection.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunkSerializer-BCPkBdRj.js.br +0 -0
- package/dist/chunks/chunkSerializer-BCPkBdRj.js.gz +0 -0
- package/dist/chunks/chunkSerializer-COhHoxJ2.js.br +0 -0
- package/dist/chunks/chunkSerializer-COhHoxJ2.js.gz +0 -0
- package/dist/chunks/index-2nktNgJ_.js.br +0 -0
- package/dist/chunks/index-2nktNgJ_.js.gz +0 -0
- package/dist/chunks/index-DmRBuNoo.js.br +0 -0
- package/dist/chunks/index-DmRBuNoo.js.gz +0 -0
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
const e = require("reconnecting-websocket"), t = require("@sailfish-rrweb/types");
|
|
1
|
+
import e from "reconnecting-websocket";
|
|
2
|
+
import { EventType as t } from "@sailfish-rrweb/types";
|
|
25
3
|
function readDebugFlag() {
|
|
26
4
|
var _a;
|
|
27
5
|
try {
|
|
@@ -57,29 +35,29 @@ function uuidv4() {
|
|
|
57
35
|
return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
|
|
58
36
|
});
|
|
59
37
|
}
|
|
60
|
-
const n = "X-Sf3-Rid", i = 0, o = 1, s = 2,
|
|
61
|
-
let
|
|
38
|
+
const n = "X-Sf3-Rid", i = 0, o = 1, s = 2, a = 4, r = "recordingEvents";
|
|
39
|
+
let l = null;
|
|
62
40
|
function openDb$1() {
|
|
63
41
|
return (function hasIndexedDB$1() {
|
|
64
42
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
65
|
-
})() ?
|
|
43
|
+
})() ? l || (l = new Promise((e2) => {
|
|
66
44
|
try {
|
|
67
45
|
const t2 = globalThis.indexedDB.open("leapsEventDB", 1);
|
|
68
46
|
t2.onupgradeneeded = () => {
|
|
69
47
|
const e3 = t2.result;
|
|
70
|
-
e3.objectStoreNames.contains(
|
|
48
|
+
e3.objectStoreNames.contains(r) || e3.createObjectStore(r, { keyPath: "id", autoIncrement: true });
|
|
71
49
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => {
|
|
72
50
|
e2(null);
|
|
73
51
|
};
|
|
74
52
|
} catch {
|
|
75
53
|
e2(null);
|
|
76
54
|
}
|
|
77
|
-
}),
|
|
55
|
+
}), l) : Promise.resolve(null);
|
|
78
56
|
}
|
|
79
57
|
function withStore$1(e2, t2) {
|
|
80
58
|
return openDb$1().then((n2) => n2 ? new Promise((i2) => {
|
|
81
59
|
try {
|
|
82
|
-
const o2 = n2.transaction(
|
|
60
|
+
const o2 = n2.transaction(r, e2), s2 = o2.objectStore(r);
|
|
83
61
|
Promise.resolve(t2(s2)).then((e3) => {
|
|
84
62
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
85
63
|
}).catch(() => i2(null));
|
|
@@ -93,28 +71,28 @@ async function deleteEventsByIds(e2) {
|
|
|
93
71
|
for (const n2 of e2) t2.delete(n2);
|
|
94
72
|
});
|
|
95
73
|
}
|
|
96
|
-
const
|
|
97
|
-
let
|
|
74
|
+
const c = "notifyMessages";
|
|
75
|
+
let d = null;
|
|
98
76
|
function openDb() {
|
|
99
77
|
return (function hasIndexedDB() {
|
|
100
78
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
101
|
-
})() ?
|
|
79
|
+
})() ? d || (d = new Promise((e2) => {
|
|
102
80
|
try {
|
|
103
81
|
const t2 = globalThis.indexedDB.open("leapsNotifyDB", 1);
|
|
104
82
|
t2.onupgradeneeded = () => {
|
|
105
83
|
const e3 = t2.result;
|
|
106
|
-
e3.objectStoreNames.contains(
|
|
84
|
+
e3.objectStoreNames.contains(c) || e3.createObjectStore(c, { keyPath: "id", autoIncrement: true });
|
|
107
85
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
|
|
108
86
|
} catch {
|
|
109
87
|
e2(null);
|
|
110
88
|
}
|
|
111
|
-
}),
|
|
89
|
+
}), d) : Promise.resolve(null);
|
|
112
90
|
}
|
|
113
91
|
async function withStore(e2, t2) {
|
|
114
92
|
const n2 = await openDb();
|
|
115
93
|
return n2 ? new Promise((i2) => {
|
|
116
94
|
try {
|
|
117
|
-
const o2 = n2.transaction(
|
|
95
|
+
const o2 = n2.transaction(c, e2), s2 = o2.objectStore(c);
|
|
118
96
|
Promise.resolve(t2(s2)).then((e3) => {
|
|
119
97
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
120
98
|
}).catch(() => i2(null));
|
|
@@ -133,25 +111,25 @@ async function deleteNotifyMessageById(e2) {
|
|
|
133
111
|
t2.delete(e2);
|
|
134
112
|
});
|
|
135
113
|
}
|
|
136
|
-
const
|
|
137
|
-
let
|
|
114
|
+
const u = "undefined" != typeof globalThis && void 0 !== globalThis.window, p = "undefined" != typeof globalThis && void 0 !== globalThis.document, f = "undefined" != typeof globalThis && "localStorage" in globalThis, g = "undefined" != typeof globalThis && "sessionStorage" in globalThis, m = "sailfishSessionId", h = "__sailfish_refresh__";
|
|
115
|
+
let y = null;
|
|
138
116
|
function getOrSetSessionId() {
|
|
139
|
-
if (!
|
|
140
|
-
if (
|
|
141
|
-
const e2 = window.name.startsWith(
|
|
117
|
+
if (!u) return uuidv4();
|
|
118
|
+
if (y) return y;
|
|
119
|
+
const e2 = window.name.startsWith(h);
|
|
142
120
|
if (e2 && (window.name = window.name.substring(20)), e2) {
|
|
143
|
-
const e3 = window.sessionStorage.getItem(
|
|
144
|
-
if (e3) return
|
|
121
|
+
const e3 = window.sessionStorage.getItem(m);
|
|
122
|
+
if (e3) return y = e3, e3;
|
|
145
123
|
}
|
|
146
124
|
const t2 = uuidv4();
|
|
147
|
-
|
|
125
|
+
y = t2;
|
|
148
126
|
try {
|
|
149
|
-
window.sessionStorage.setItem(
|
|
127
|
+
window.sessionStorage.setItem(m, t2);
|
|
150
128
|
} catch (e3) {
|
|
151
129
|
}
|
|
152
130
|
return t2;
|
|
153
131
|
}
|
|
154
|
-
let
|
|
132
|
+
let b = false;
|
|
155
133
|
function buildBatches(e2, t2, n2) {
|
|
156
134
|
const i2 = {};
|
|
157
135
|
for (const t3 of e2) {
|
|
@@ -161,23 +139,24 @@ function buildBatches(e2, t2, n2) {
|
|
|
161
139
|
const o2 = [];
|
|
162
140
|
for (const e3 in i2) {
|
|
163
141
|
const s2 = i2[e3];
|
|
164
|
-
let
|
|
142
|
+
let a2 = [], r2 = 0;
|
|
165
143
|
for (const e4 of s2) {
|
|
166
144
|
const i3 = t2(e4);
|
|
167
|
-
|
|
145
|
+
r2 + i3 > n2 && (a2.length > 0 && (o2.push(a2), a2 = [], r2 = 0), i3 > n2) || (a2.push(e4), r2 += i3);
|
|
168
146
|
}
|
|
169
|
-
|
|
147
|
+
a2.length > 0 && o2.push(a2);
|
|
170
148
|
}
|
|
171
149
|
return o2;
|
|
172
150
|
}
|
|
173
151
|
function eventSize(e2) {
|
|
174
152
|
return JSON.stringify(e2).length;
|
|
175
153
|
}
|
|
154
|
+
let w = Date.now;
|
|
176
155
|
function withAppUrlMetadata(e2) {
|
|
177
156
|
var _a;
|
|
178
157
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
158
|
}
|
|
180
|
-
|
|
159
|
+
/[1-9][0-9]{12}/.test(Date.now().toString()) || (w = () => (/* @__PURE__ */ new Date()).getTime());
|
|
181
160
|
const v = readDebugFlag(), S = "per_session";
|
|
182
161
|
let k = null, x = null, I = false, T = null, E = null, C = "", $ = "", F = false;
|
|
183
162
|
const L = [];
|
|
@@ -387,12 +366,12 @@ function handleWsMessage(e2) {
|
|
|
387
366
|
}
|
|
388
367
|
function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
389
368
|
ensureHrefCache();
|
|
390
|
-
const
|
|
369
|
+
const a2 = (function getWebSocketHost(e2) {
|
|
391
370
|
const t3 = new URL(e2);
|
|
392
371
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
393
372
|
})(t2);
|
|
394
|
-
let
|
|
395
|
-
if (o2 && (
|
|
373
|
+
let r2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${a2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.10.13`;
|
|
374
|
+
if (o2 && (r2 += `&envValue=${encodeURIComponent(o2)}`), k = s2 ? (function tryCreateWsWorker() {
|
|
396
375
|
if ("undefined" == typeof Worker) return null;
|
|
397
376
|
try {
|
|
398
377
|
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\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 postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\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 === "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);
|
|
@@ -409,10 +388,10 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
409
388
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
410
389
|
}, k.onerror = () => {
|
|
411
390
|
v && console.warn("[Sailfish] WebSocket worker error");
|
|
412
|
-
}, k.postMessage({ type: "init", wsUrl:
|
|
391
|
+
}, k.postMessage({ type: "init", wsUrl: r2 }), v && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
413
392
|
}
|
|
414
393
|
v && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
415
|
-
const l2 = new e(
|
|
394
|
+
const l2 = new e(r2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
416
395
|
return l2.readyState;
|
|
417
396
|
}, close: () => {
|
|
418
397
|
l2.close(), null != E && (clearInterval(E), E = null);
|
|
@@ -448,25 +427,36 @@ function getFuncSpanHeader() {
|
|
|
448
427
|
}
|
|
449
428
|
const O = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
|
|
450
429
|
let z = null, U = null;
|
|
451
|
-
|
|
430
|
+
function identify(e2, t2 = {}, n2 = false) {
|
|
431
|
+
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
432
|
+
z && z.userId === e2 && JSON.stringify(z.traits) === JSON.stringify(t2) || (z = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
433
|
+
}
|
|
434
|
+
function addOrUpdateMetadata(e2) {
|
|
435
|
+
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
436
|
+
U && JSON.stringify(U) === JSON.stringify(e2) || (U = e2, sendMessage(t2));
|
|
437
|
+
}
|
|
438
|
+
function trackingEvent(e2) {
|
|
439
|
+
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: w() });
|
|
440
|
+
}
|
|
441
|
+
let H = null;
|
|
452
442
|
const q = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
453
443
|
function fetchAndSendIp(e2) {
|
|
454
|
-
|
|
444
|
+
H !== e2 && (H = e2, (async () => {
|
|
455
445
|
for (const e3 of q) try {
|
|
456
446
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
457
447
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
458
448
|
const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
|
|
459
|
-
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp:
|
|
449
|
+
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: w() });
|
|
460
450
|
} catch {
|
|
461
451
|
}
|
|
462
|
-
|
|
452
|
+
H = null;
|
|
463
453
|
})().catch(() => {
|
|
464
|
-
|
|
454
|
+
H = null;
|
|
465
455
|
}));
|
|
466
456
|
}
|
|
467
|
-
let
|
|
457
|
+
let N = null;
|
|
468
458
|
async function getSourceMapModule() {
|
|
469
|
-
return
|
|
459
|
+
return N || (N = await import("source-map-js")), N;
|
|
470
460
|
}
|
|
471
461
|
const W = /* @__PURE__ */ new Map(), K = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
472
462
|
async function getConsumerFor(e2, t2) {
|
|
@@ -495,8 +485,8 @@ async function captureError(e2, t2 = false) {
|
|
|
495
485
|
n3.push(e4);
|
|
496
486
|
continue;
|
|
497
487
|
}
|
|
498
|
-
const [, i3, o3, s3,
|
|
499
|
-
if (!Number.isFinite(
|
|
488
|
+
const [, i3, o3, s3, a3] = t4, r3 = parseInt(s3, 10), l2 = Math.max(0, parseInt(a3, 10) - 1);
|
|
489
|
+
if (!Number.isFinite(r3) || !Number.isFinite(l2)) {
|
|
500
490
|
n3.push(e4 + " [Invalid line/column]");
|
|
501
491
|
continue;
|
|
502
492
|
}
|
|
@@ -506,34 +496,34 @@ async function captureError(e2, t2 = false) {
|
|
|
506
496
|
continue;
|
|
507
497
|
}
|
|
508
498
|
const { SourceMapConsumer: d2 } = await getSourceMapModule();
|
|
509
|
-
let u2 = c2.originalPositionFor({ line:
|
|
510
|
-
if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 = c2.originalPositionFor({ line:
|
|
499
|
+
let u2 = c2.originalPositionFor({ line: r3, column: l2, bias: d2.GREATEST_LOWER_BOUND });
|
|
500
|
+
if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 = c2.originalPositionFor({ line: r3, column: Math.max(0, l2 - e5), bias: d2.GREATEST_LOWER_BOUND }), !u2.source || null == u2.line); e5++) ;
|
|
511
501
|
if (u2.source && null != u2.line) {
|
|
512
502
|
const e5 = u2.name || "anonymous";
|
|
513
503
|
n3.push(`${u2.source}:${u2.line}:${u2.column ?? 0} (${e5})`);
|
|
514
504
|
} else n3.push(`${e4} [No mapping found in ${o3}]`);
|
|
515
505
|
}
|
|
516
506
|
return n3;
|
|
517
|
-
})(i2), s2 = o2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")),
|
|
518
|
-
sendMessage({ type: "event", event: { type: 6, timestamp:
|
|
507
|
+
})(i2), s2 = o2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), a2 = s2.length > 0 ? s2 : o2, r2 = Date.now();
|
|
508
|
+
sendMessage({ type: "event", event: { type: 6, timestamp: r2, data: { payload: { message: n2, stack: i2, trace: a2, filteredStack: s2, userAgent: navigator.userAgent, url: window.location.href, timestamp: r2, level: "error" } } } });
|
|
519
509
|
}
|
|
520
510
|
const G = readDebugFlag();
|
|
521
511
|
const V = readDebugFlag();
|
|
522
512
|
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
|
|
523
|
-
const
|
|
524
|
-
return V && console.log(`Initial GraphQL request for ${e2} at ${
|
|
513
|
+
const a2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
|
|
514
|
+
return V && console.log(`Initial GraphQL request for ${e2} at ${a2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
|
|
525
515
|
let s3 = 0;
|
|
526
516
|
const attemptRequest = async () => {
|
|
527
517
|
try {
|
|
528
518
|
return await e3();
|
|
529
519
|
} catch (e4) {
|
|
530
520
|
if (s3++, s3 > n3) throw e4;
|
|
531
|
-
const
|
|
532
|
-
return G && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${
|
|
521
|
+
const a3 = i3 * Math.pow(o3, s3 - 1);
|
|
522
|
+
return G && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${a3}ms...`), await new Promise((e5) => setTimeout(e5, a3)), attemptRequest();
|
|
533
523
|
}
|
|
534
524
|
};
|
|
535
525
|
return attemptRequest();
|
|
536
|
-
})(() => fetch(
|
|
526
|
+
})(() => fetch(a2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
|
|
537
527
|
if (V && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
|
|
538
528
|
return e3.json();
|
|
539
529
|
}), "Sending GraphQL request to Sailfish AI", i2, o2, s2);
|
|
@@ -544,20 +534,20 @@ function fetchCaptureSettings(e2, t2) {
|
|
|
544
534
|
function fetchFunctionSpanTrackingEnabled(e2, t2) {
|
|
545
535
|
return sendGraphQLRequest("GetFunctionSpanTrackingEnabledFromApiKey", "\n query GetFunctionSpanTrackingEnabledFromApiKey($apiKey: String!) {\n isFunctionSpanTrackingEnabledFromApiKey(apiKey: $apiKey)\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
546
536
|
}
|
|
547
|
-
function startRecordingSession(e2, t2, n2, i2, o2, s2,
|
|
548
|
-
return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }", { apiKey: e2, recordingSessionId: t2, backendApi: n2, serviceIdentifier: i2, serviceVersion: o2, mapUuid: s2, gitSha:
|
|
537
|
+
function startRecordingSession(e2, t2, n2, i2, o2, s2, a2, r2, l2) {
|
|
538
|
+
return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }", { apiKey: e2, recordingSessionId: t2, backendApi: n2, serviceIdentifier: i2, serviceVersion: o2, mapUuid: s2, gitSha: a2, library: r2, serviceAdditionalMetadata: l2, startRecordingFilePath: null, startRecordingLineNumber: null });
|
|
549
539
|
}
|
|
550
540
|
function sendDomainsToNotPropagateHeaderTo(e2, t2, n2) {
|
|
551
541
|
return sendGraphQLRequest("DomainsToNotPassHeaderTo", "mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }", { apiKey: e2, domains: t2, backendApi: n2 });
|
|
552
542
|
}
|
|
553
|
-
function createTriageFromRecorder(e2, t2, n2, i2, o2, s2,
|
|
554
|
-
return sendGraphQLRequest("CreateTriageFromRecorder", "mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $triageSource: TriageSourceEnum\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n triageSource: $triageSource\n ) {\n id\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, triageSource:
|
|
543
|
+
function createTriageFromRecorder(e2, t2, n2, i2, o2, s2, a2) {
|
|
544
|
+
return sendGraphQLRequest("CreateTriageFromRecorder", "mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $triageSource: TriageSourceEnum\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n triageSource: $triageSource\n ) {\n id\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, triageSource: a2, backendApi: t2 });
|
|
555
545
|
}
|
|
556
546
|
function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
|
|
557
547
|
return sendGraphQLRequest("GetEngineeringTicketPlatformIntegrationsFromApiKey", "query GetEngineeringTicketPlatformIntegrationsFromApiKey($apiKey: String!) {\n getEngineeringTicketPlatformIntegrationsFromApiKey(apiKey: $apiKey) {\n pushAutoIdentifiedIssues\n provider\n clientId\n defaultPriority\n defaultProject\n defaultTeam\n primaryCloudId\n installed\n projects\n teams\n workflowStates\n webhookState\n clouds\n labels\n sprints\n users\n fieldConfigurations\n invalidFields\n jiraReporterAccountId\n }\n }", { apiKey: e2, backendApi: t2 });
|
|
558
548
|
}
|
|
559
|
-
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2,
|
|
560
|
-
return sendGraphQLRequest("CreateTriageAndIssueFromRecorder", "mutation CreateTriageAndIssueFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $issueName: String,\n $issueDescription: String,\n $createEngineeringTicket: Boolean,\n $teamId: String,\n $projectId: String,\n $priority: Int,\n $labels: [String!],\n $issueType: String,\n $customFields: JSON,\n $triageSource: TriageSourceEnum\n ) {\n createTriageAndIssueFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n issueName: $issueName,\n issueDescription: $issueDescription,\n createEngineeringTicket: $createEngineeringTicket,\n teamId: $teamId,\n projectId: $projectId,\n priority: $priority,\n labels: $labels,\n issueType: $issueType,\n customFields: $customFields,\n triageSource: $triageSource\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, issueName:
|
|
549
|
+
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2, a2, r2, l2, c2, d2, u2, p2, f2, g2, m2) {
|
|
550
|
+
return sendGraphQLRequest("CreateTriageAndIssueFromRecorder", "mutation CreateTriageAndIssueFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $issueName: String,\n $issueDescription: String,\n $createEngineeringTicket: Boolean,\n $teamId: String,\n $projectId: String,\n $priority: Int,\n $labels: [String!],\n $issueType: String,\n $customFields: JSON,\n $triageSource: TriageSourceEnum\n ) {\n createTriageAndIssueFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n issueName: $issueName,\n issueDescription: $issueDescription,\n createEngineeringTicket: $createEngineeringTicket,\n teamId: $teamId,\n projectId: $projectId,\n priority: $priority,\n labels: $labels,\n issueType: $issueType,\n customFields: $customFields,\n triageSource: $triageSource\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, issueName: a2, issueDescription: r2, createEngineeringTicket: l2, teamId: c2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
|
|
561
551
|
}
|
|
562
552
|
const Q = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
563
553
|
function shouldSkipFrame(e2) {
|
|
@@ -664,9 +654,7 @@ function initializeDomContentEvents(e2) {
|
|
|
664
654
|
t2.data.info && sendEvent(t2);
|
|
665
655
|
}), document.addEventListener("DOMContentLoaded", () => {
|
|
666
656
|
sendEvent({ type: 24, data: { source: o }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
667
|
-
}), window.addEventListener("
|
|
668
|
-
sendEvent({ type: 24, data: { source: r }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
669
|
-
}), window.addEventListener("unload", () => {
|
|
657
|
+
}), window.addEventListener("pagehide", () => {
|
|
670
658
|
sendEvent({ type: 24, data: { source: a }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
671
659
|
});
|
|
672
660
|
}
|
|
@@ -675,12 +663,12 @@ async function initializeConsolePlugin(e2, n2) {
|
|
|
675
663
|
await yieldToMain();
|
|
676
664
|
const { name: o2, observer: s2 } = i2(e2);
|
|
677
665
|
s2((e3) => {
|
|
678
|
-
const i3 = e3, [s3,
|
|
679
|
-
sendEvent({ type: t.
|
|
666
|
+
const i3 = e3, [s3, a2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [r2, l2] = getCallerLocation(2), c2 = s3 ?? r2, d2 = a2 ?? l2, u2 = { ...i3, sourceFile: c2, sourceLine: d2 };
|
|
667
|
+
sendEvent({ type: t.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
|
|
680
668
|
}, window, e2);
|
|
681
669
|
}
|
|
682
|
-
async function initializeRecording(e2, n2, i2, o2, s2,
|
|
683
|
-
const c2 = initializeWebSocket(n2, i2, o2, s2,
|
|
670
|
+
async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2 = false) {
|
|
671
|
+
const c2 = initializeWebSocket(n2, i2, o2, s2, r2);
|
|
684
672
|
try {
|
|
685
673
|
const n3 = (function createThrottledEmit(e3, t2 = 1e3) {
|
|
686
674
|
if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
|
|
@@ -706,30 +694,30 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
706
694
|
Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId = o2, n3.emit(e3);
|
|
707
695
|
}, startHeavyWork = async () => {
|
|
708
696
|
if (true === e2.enableFiberTracking) try {
|
|
709
|
-
const { installFiberHook: e3, processExistingTree: t2 } = await
|
|
697
|
+
const { installFiberHook: e3, processExistingTree: t2 } = await import("./fiberHook-DGANQ2ma.js");
|
|
710
698
|
e3(), t2(), console.log("[Sailfish] React Fiber tracking enabled");
|
|
711
699
|
} catch (e3) {
|
|
712
700
|
console.warn("[Sailfish] Failed to enable Fiber tracking:", e3);
|
|
713
701
|
}
|
|
714
702
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
715
703
|
if (J = n4, await yieldToMain(), l2) {
|
|
716
|
-
const { chunkedSnapshot: i3 } = await
|
|
704
|
+
const { chunkedSnapshot: i3 } = await import("./chunkSerializer-Dk1eF3S8.js"), o3 = n4.mirror;
|
|
717
705
|
let s3 = true;
|
|
718
|
-
const
|
|
706
|
+
const a3 = [];
|
|
719
707
|
n4({ emit(e3) {
|
|
720
|
-
s3 ?
|
|
708
|
+
s3 ? a3.push(e3) : emitWithContext(e3);
|
|
721
709
|
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: X, ...e2, recordDOM: false });
|
|
722
|
-
const
|
|
710
|
+
const r3 = Date.now(), l3 = await i3(document, o3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: e2.blockSelector, maskTextClass: e2.maskTextClass ?? X, maskTextSelector: e2.maskTextSelector });
|
|
723
711
|
if (l3) {
|
|
724
|
-
emitWithContext({ type: t.
|
|
725
|
-
for (const e3 of
|
|
712
|
+
emitWithContext({ type: t.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: r3 }), emitWithContext({ type: t.FullSnapshot, data: { node: l3, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: r3 });
|
|
713
|
+
for (const e3 of a3) emitWithContext(e3);
|
|
726
714
|
s3 = false;
|
|
727
715
|
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
|
|
728
716
|
} else n4({ emit(e3) {
|
|
729
717
|
emitWithContext(e3);
|
|
730
718
|
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: X, ...e2 });
|
|
731
719
|
};
|
|
732
|
-
if (
|
|
720
|
+
if (a2) {
|
|
733
721
|
let e3 = false;
|
|
734
722
|
const startOnce = () => {
|
|
735
723
|
e3 || (e3 = true, startHeavyWork());
|
|
@@ -759,11 +747,11 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
759
747
|
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${o2}`]);
|
|
760
748
|
});
|
|
761
749
|
const handleWidgetOpen = () => {
|
|
762
|
-
J == null ? void 0 : J.addSailfishEvent(t.
|
|
750
|
+
J == null ? void 0 : J.addSailfishEvent(t.SailfishCustom, { action: "customer support chat opened", element_id: Z, provider: Y });
|
|
763
751
|
}, handleWidgetClose = () => {
|
|
764
|
-
J == null ? void 0 : J.addSailfishEvent(t.
|
|
752
|
+
J == null ? void 0 : J.addSailfishEvent(t.SailfishCustom, { action: "customer support chat closed", element_id: Z, provider: Y });
|
|
765
753
|
}, handleUnreadMessages = (e3) => {
|
|
766
|
-
J == null ? void 0 : J.addSailfishEvent(t.
|
|
754
|
+
J == null ? void 0 : J.addSailfishEvent(t.SailfishCustom, { action: "zendesk unreadmessages", element_id: Z, provider: Y });
|
|
767
755
|
};
|
|
768
756
|
suppressConsoleLogsDuringCall(() => {
|
|
769
757
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -836,21 +824,21 @@ const se = [(e2) => (function checkNextJs() {
|
|
|
836
824
|
}
|
|
837
825
|
return null;
|
|
838
826
|
}];
|
|
839
|
-
const
|
|
840
|
-
let
|
|
827
|
+
const ae = ["jira", "linear", "zendesk"];
|
|
828
|
+
let re = null;
|
|
841
829
|
const le = /* @__PURE__ */ new Map();
|
|
842
830
|
function getIntegrationData() {
|
|
843
|
-
return
|
|
831
|
+
return re;
|
|
844
832
|
}
|
|
845
833
|
function hasValidIntegration() {
|
|
846
|
-
return null !==
|
|
834
|
+
return null !== re && true === re.installed;
|
|
847
835
|
}
|
|
848
836
|
function resolveIntegration(e2) {
|
|
849
837
|
var _a;
|
|
850
838
|
if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
|
|
851
839
|
const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
|
|
852
840
|
var _a2;
|
|
853
|
-
return
|
|
841
|
+
return ae.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
|
|
854
842
|
});
|
|
855
843
|
if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
|
|
856
844
|
const i2 = n2.find((e3) => {
|
|
@@ -862,9 +850,9 @@ function resolveIntegration(e2) {
|
|
|
862
850
|
async function refreshIntegrationData(e2, t2) {
|
|
863
851
|
try {
|
|
864
852
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
865
|
-
return
|
|
853
|
+
return re = n2, n2;
|
|
866
854
|
} catch (e3) {
|
|
867
|
-
return console.error("Error refreshing integration data:", e3),
|
|
855
|
+
return console.error("Error refreshing integration data:", e3), re;
|
|
868
856
|
}
|
|
869
857
|
}
|
|
870
858
|
function populateSelectOptions(e2, t2, n2) {
|
|
@@ -899,8 +887,8 @@ function populateSprintOptions(e2, t2, n2) {
|
|
|
899
887
|
}), n2 && (e2.value = n2);
|
|
900
888
|
}
|
|
901
889
|
function getSprintFieldId() {
|
|
902
|
-
if (!(
|
|
903
|
-
const e2 = Array.isArray(
|
|
890
|
+
if (!(re == null ? void 0 : re.fieldConfigurations)) return "customfield_10020";
|
|
891
|
+
const e2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations : [];
|
|
904
892
|
for (const t2 of e2) {
|
|
905
893
|
const e3 = (t2.fields || []).find((e4) => {
|
|
906
894
|
var _a;
|
|
@@ -912,12 +900,12 @@ function getSprintFieldId() {
|
|
|
912
900
|
}
|
|
913
901
|
function updateIssueTypeOptions(e2, t2) {
|
|
914
902
|
var _a;
|
|
915
|
-
if (!(
|
|
903
|
+
if (!(re == null ? void 0 : re.projects) || !t2) {
|
|
916
904
|
e2.innerHTML = "";
|
|
917
905
|
const t3 = document.createElement("option");
|
|
918
906
|
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");
|
|
919
907
|
}
|
|
920
|
-
const n2 =
|
|
908
|
+
const n2 = re.projects.find((e3) => e3.id === t2);
|
|
921
909
|
if (!n2 || !n2.issue_types) {
|
|
922
910
|
e2.innerHTML = "";
|
|
923
911
|
const t3 = document.createElement("option");
|
|
@@ -941,49 +929,49 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
941
929
|
}
|
|
942
930
|
}
|
|
943
931
|
function getFieldsForProject(e2, t2) {
|
|
944
|
-
if (!(
|
|
945
|
-
const n2 = Array.isArray(
|
|
932
|
+
if (!(re == null ? void 0 : re.fieldConfigurations) || !e2) return [];
|
|
933
|
+
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => n3.project_key === e2 && (!t2 || n3.issue_type_id === t2)) : re.fieldConfigurations[e2];
|
|
946
934
|
return n2 && n2.fields ? n2.fields : [];
|
|
947
935
|
}
|
|
948
936
|
function getUsers() {
|
|
949
|
-
return (
|
|
937
|
+
return (re == null ? void 0 : re.users) ? re.users : [];
|
|
950
938
|
}
|
|
951
939
|
function getProjectsForTeam(e2) {
|
|
952
|
-
if (!
|
|
953
|
-
const t2 =
|
|
940
|
+
if (!re) return [];
|
|
941
|
+
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0;
|
|
954
942
|
if (t2 && e2) {
|
|
955
|
-
const t3 =
|
|
943
|
+
const t3 = re.teams.find((t4) => t4.id === e2);
|
|
956
944
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
957
945
|
}
|
|
958
|
-
return !t2 &&
|
|
946
|
+
return !t2 && re.projects ? re.projects : [];
|
|
959
947
|
}
|
|
960
948
|
function updateFormWithIntegrationData(e2) {
|
|
961
949
|
var _a;
|
|
962
|
-
if (!
|
|
963
|
-
const t2 =
|
|
964
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
950
|
+
if (!re) return e2;
|
|
951
|
+
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
952
|
+
n2 && t2 && (populateSelectOptions(n2, re.teams, re.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
965
953
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
966
954
|
if (i2) {
|
|
967
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
955
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : re.projects || [], re.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
968
956
|
}
|
|
969
957
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
970
|
-
o2 && (populatePriorityOptions(o2,
|
|
971
|
-
const s2 = document.getElementById("sf-eng-ticket-sprint"),
|
|
972
|
-
s2 &&
|
|
973
|
-
const
|
|
974
|
-
return
|
|
958
|
+
o2 && (populatePriorityOptions(o2, re.provider || "", re.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
959
|
+
const s2 = document.getElementById("sf-eng-ticket-sprint"), a2 = "jira" === ((_a = re.provider) == null ? void 0 : _a.toLowerCase());
|
|
960
|
+
s2 && a2 && re.sprints && populateSprintOptions(s2, re.sprints, e2.engTicketSprint || void 0);
|
|
961
|
+
const r2 = document.getElementById("sf-eng-ticket-type");
|
|
962
|
+
return r2 && a2 && e2.engTicketProject && (updateIssueTypeOptions(r2, e2.engTicketProject), e2.engTicketIssueType ? (r2.value = e2.engTicketIssueType, r2.style.color = "#000") : r2.value && (e2.engTicketIssueType = r2.value)), e2;
|
|
975
963
|
}
|
|
976
964
|
const ce = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
977
|
-
if (!
|
|
965
|
+
if (!re) try {
|
|
978
966
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
979
|
-
|
|
967
|
+
re = resolveIntegration(n2);
|
|
980
968
|
} catch (e3) {
|
|
981
|
-
console.error("Error fetching integration data:", e3),
|
|
969
|
+
console.error("Error fetching integration data:", e3), re = null;
|
|
982
970
|
}
|
|
983
971
|
}, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), de = "sf-create-issue-preference", ue = "sf-create-eng-ticket-preference";
|
|
984
972
|
function getInitialState() {
|
|
985
973
|
const e2 = (function loadUserPreferences() {
|
|
986
|
-
return { createIssue:
|
|
974
|
+
return { createIssue: f && "true" === localStorage.getItem(de), createEngTicket: f && "true" === localStorage.getItem(ue) };
|
|
987
975
|
})();
|
|
988
976
|
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
989
977
|
}
|
|
@@ -1052,10 +1040,10 @@ function setupCustomMultiSelectListeners(e2, t2) {
|
|
|
1052
1040
|
n3.stopPropagation();
|
|
1053
1041
|
const o3 = e4.dataset.value || "", s3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
|
|
1054
1042
|
s3 && (s3.dataset.selected = "false", s3.style.backgroundColor = ""), updateChipsDisplay();
|
|
1055
|
-
const
|
|
1043
|
+
const a2 = [];
|
|
1056
1044
|
i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
|
|
1057
|
-
"true" === e5.dataset.selected &&
|
|
1058
|
-
}), t2(
|
|
1045
|
+
"true" === e5.dataset.selected && a2.push(e5.dataset.value || "");
|
|
1046
|
+
}), t2(a2);
|
|
1059
1047
|
});
|
|
1060
1048
|
})), e3;
|
|
1061
1049
|
}
|
|
@@ -1080,12 +1068,12 @@ function renderDynamicFields(e2, t2) {
|
|
|
1080
1068
|
if (!i2 || 0 === i2.length) return void (n2.innerHTML = "");
|
|
1081
1069
|
const s2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
|
|
1082
1070
|
var _a, _b, _c, _d;
|
|
1083
|
-
const i3 = e4.fieldId || e4.key, o3 = e4.name, s3 = (_a = e4.schema) == null ? void 0 : _a.type,
|
|
1084
|
-
if (d2.includes(i3) || d2.includes(
|
|
1071
|
+
const i3 = e4.fieldId || e4.key, o3 = e4.name, s3 = (_a = e4.schema) == null ? void 0 : _a.type, a2 = (_b = e4.schema) == null ? void 0 : _b.system, r2 = (_c = e4.schema) == null ? void 0 : _c.custom, l2 = e4.required || false, c2 = e4.allowedValues, d2 = ["summary", "description", "project", "issuetype", "priority"];
|
|
1072
|
+
if (d2.includes(i3) || d2.includes(a2)) return null;
|
|
1085
1073
|
const u2 = l2 ? '<span style="color:#ef4444;">*</span>' : "", p2 = "width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;";
|
|
1086
1074
|
switch (s3) {
|
|
1087
1075
|
case "string":
|
|
1088
|
-
return
|
|
1076
|
+
return r2 && r2.includes("textarea") ? `
|
|
1089
1077
|
<div>
|
|
1090
1078
|
<label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
1091
1079
|
${o3} ${u2}
|
|
@@ -1203,7 +1191,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1203
1191
|
}
|
|
1204
1192
|
return null;
|
|
1205
1193
|
case "array":
|
|
1206
|
-
return "labels" ===
|
|
1194
|
+
return "labels" === a2 ? null : c2 && c2.length > 0 ? renderCustomMultiSelect(i3, o3, c2, Array.isArray(t3) ? t3 : [], l2) : null;
|
|
1207
1195
|
case "parent":
|
|
1208
1196
|
case "issuelink":
|
|
1209
1197
|
return `
|
|
@@ -1300,10 +1288,10 @@ function activateModalIsolation(e2) {
|
|
|
1300
1288
|
n3 && (e2.contains(n3) || (t3.stopImmediatePropagation(), t3.preventDefault(), refocus()));
|
|
1301
1289
|
}, o2 = ["mousedown", "mouseup", "click", "pointerdown", "pointerup", "touchstart", "touchend", "wheel", "keydown", "keyup", "focus", "focusin", "focusout", "blur"];
|
|
1302
1290
|
o2.forEach((e3) => document.addEventListener(e3, quarantine, true));
|
|
1303
|
-
let s2 = 0,
|
|
1304
|
-
const
|
|
1305
|
-
if ((e2.querySelector(":focus") ||
|
|
1306
|
-
|
|
1291
|
+
let s2 = 0, a2 = null;
|
|
1292
|
+
const r2 = t2 instanceof HTMLTextAreaElement ? t2 : null, refocus = () => {
|
|
1293
|
+
if ((e2.querySelector(":focus") || r2 || t2 || e2).focus({ preventScroll: true }), r2 && document.activeElement === r2 && a2) try {
|
|
1294
|
+
r2.setSelectionRange(a2.start, a2.end, "none");
|
|
1307
1295
|
} catch {
|
|
1308
1296
|
}
|
|
1309
1297
|
}, selectionInsideModal = () => {
|
|
@@ -1320,8 +1308,8 @@ function activateModalIsolation(e2) {
|
|
|
1320
1308
|
const watchdog = () => {
|
|
1321
1309
|
const t3 = document.activeElement, n3 = t3 === document.body || null == t3 || !e2.contains(t3), i3 = selectionInsideModal();
|
|
1322
1310
|
n3 && !i3 ? (l2 += 1, l2 >= 2 && (refocus(), l2 = 0)) : (l2 = 0, (() => {
|
|
1323
|
-
if (
|
|
1324
|
-
|
|
1311
|
+
if (r2 && document.activeElement === r2) try {
|
|
1312
|
+
a2 = { start: r2.selectionStart ?? r2.value.length, end: r2.selectionEnd ?? r2.value.length };
|
|
1325
1313
|
} catch {
|
|
1326
1314
|
}
|
|
1327
1315
|
})()), s2 = window.requestAnimationFrame(watchdog);
|
|
@@ -1558,15 +1546,15 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1558
1546
|
}
|
|
1559
1547
|
});
|
|
1560
1548
|
});
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1563
|
-
const e4 =
|
|
1564
|
-
pe.createIssue = e4, localStorage.setItem(de, String(e4)),
|
|
1549
|
+
const a2 = document.getElementById("sf-create-issue-checkbox"), r2 = document.getElementById("sf-issue-fields-container"), l2 = document.getElementById("sf-create-eng-ticket-checkbox"), c2 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1550
|
+
a2 && a2.addEventListener("change", () => {
|
|
1551
|
+
const e4 = a2.checked;
|
|
1552
|
+
pe.createIssue = e4, localStorage.setItem(de, String(e4)), r2 && (r2.style.display = e4 ? "block" : "none"), !e4 && l2 && (l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"));
|
|
1565
1553
|
});
|
|
1566
1554
|
l2 && l2.addEventListener("change", async () => {
|
|
1567
1555
|
var _a;
|
|
1568
1556
|
const e4 = l2.checked;
|
|
1569
|
-
if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"),
|
|
1557
|
+
if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"), a2 && (a2.checked = true), r2 && (r2.style.display = "block")), c2 && (c2.style.display = e4 ? "block" : "none"), e4) {
|
|
1570
1558
|
if (!hasValidIntegration()) return l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1571
1559
|
const e5 = getIntegrationData();
|
|
1572
1560
|
if (e5) {
|
|
@@ -1645,7 +1633,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1645
1633
|
i3 = Date.now(), n3 = i3 - e6;
|
|
1646
1634
|
}
|
|
1647
1635
|
if (pe.createIssue) {
|
|
1648
|
-
const o3 = document.getElementById("sf-issue-name"), s3 = document.getElementById("sf-eng-ticket-team"),
|
|
1636
|
+
const o3 = document.getElementById("sf-issue-name"), s3 = document.getElementById("sf-eng-ticket-team"), a3 = document.getElementById("sf-eng-ticket-project"), r3 = document.getElementById("sf-eng-ticket-priority"), l3 = document.getElementById("sf-eng-ticket-type"), c3 = (o3 == null ? void 0 : o3.value) || "", d3 = e5, u2 = (s3 == null ? void 0 : s3.value) || "", p2 = (a3 == null ? void 0 : a3.value) || "", f2 = r3 ? Number(r3.value) : 0, g2 = pe.engTicketLabels, m2 = (l3 == null ? void 0 : l3.value) || "", h2 = { ...pe.engTicketCustomFields };
|
|
1649
1637
|
document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
|
|
1650
1638
|
const t5 = e6, n4 = t5.dataset.fieldId;
|
|
1651
1639
|
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));
|
|
@@ -1655,11 +1643,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1655
1643
|
const e6 = getSprintFieldId();
|
|
1656
1644
|
h2[e6] = parseInt(b2, 10);
|
|
1657
1645
|
}
|
|
1658
|
-
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, s4,
|
|
1646
|
+
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3, p3) {
|
|
1659
1647
|
var _a2, _b, _c;
|
|
1660
1648
|
try {
|
|
1661
1649
|
showStatusModal(true);
|
|
1662
|
-
const f3 = await createTriageAndIssueFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, s4,
|
|
1650
|
+
const f3 = await createTriageAndIssueFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3, p3);
|
|
1663
1651
|
if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
|
|
1664
1652
|
const e7 = f3.errors.map((e8) => e8.message).join("; ");
|
|
1665
1653
|
return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
|
|
@@ -1717,15 +1705,15 @@ function setActiveTab(e2) {
|
|
|
1717
1705
|
"lookback" === e2 ? (t2.style.background = "white", t2.style.color = "#0F172A", n2.style.background = "transparent", n2.style.color = "#64748B") : (n2.style.background = "white", n2.style.color = "#0F172A", t2.style.background = "transparent", t2.style.color = "#64748B");
|
|
1718
1706
|
}
|
|
1719
1707
|
function updateModeSpecificUI(e2) {
|
|
1720
|
-
const t2 = document.querySelector("#sf-issue-mode-info div"), n2 = document.getElementById("sf-issue-submit-btn"), i2 = document.getElementById("sf-record-button-container"), o2 = document.getElementById("sf-recording-timer-label"), s2 = document.getElementById("sf-recording-timer-display"),
|
|
1721
|
-
if (t2 && n2 && i2 && o2 && s2 &&
|
|
1722
|
-
i2.style.display = "block",
|
|
1708
|
+
const t2 = document.querySelector("#sf-issue-mode-info div"), n2 = document.getElementById("sf-issue-submit-btn"), i2 = document.getElementById("sf-record-button-container"), o2 = document.getElementById("sf-recording-timer-label"), s2 = document.getElementById("sf-recording-timer-display"), a2 = document.getElementById("sf-modal-footer"), r2 = document.getElementById("sf-lookback-container");
|
|
1709
|
+
if (t2 && n2 && i2 && o2 && s2 && a2 && r2) if ("startnow" === e2) {
|
|
1710
|
+
i2.style.display = "block", r2.style.display = "none", a2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
|
|
1723
1711
|
const e3 = null !== fe && null !== ge;
|
|
1724
1712
|
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", fe && ge) {
|
|
1725
1713
|
const e4 = Math.floor((ge - fe) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
|
|
1726
1714
|
o2.style.display = "block", s2.textContent = `${t3}:${n3}`;
|
|
1727
1715
|
} else o2.style.display = "none";
|
|
1728
|
-
} else i2.style.display = "none", o2.style.display = "none",
|
|
1716
|
+
} else i2.style.display = "none", o2.style.display = "none", r2.style.display = "block", a2.style.justifyContent = "flex-end", t2.textContent = "Something already happened. Capture the past few minutes.", n2.disabled = false, n2.style.opacity = "1", n2.style.cursor = "pointer";
|
|
1729
1717
|
}
|
|
1730
1718
|
function bindEngTicketListeners() {
|
|
1731
1719
|
const e2 = document.getElementById("sf-eng-ticket-team"), t2 = document.getElementById("sf-eng-ticket-project"), n2 = document.getElementById("sf-eng-ticket-priority"), i2 = document.getElementById("sf-eng-ticket-labels-container"), o2 = document.getElementById("sf-eng-ticket-type"), s2 = document.getElementById("sf-eng-ticket-sprint");
|
|
@@ -1762,14 +1750,14 @@ function bindEngTicketListeners() {
|
|
|
1762
1750
|
pe.engTicketCustomFields = {}, t3 && (pe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
|
|
1763
1751
|
}
|
|
1764
1752
|
});
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1753
|
+
const a2 = document.getElementById("sf-dynamic-fields-container");
|
|
1754
|
+
a2 && (a2.addEventListener("input", (e3) => {
|
|
1767
1755
|
const t3 = e3.target;
|
|
1768
1756
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1769
1757
|
const e4 = t3.dataset.fieldId;
|
|
1770
1758
|
e4 && ("checkbox" === t3.type ? pe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? pe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : pe.engTicketCustomFields[e4] = t3.value);
|
|
1771
1759
|
}
|
|
1772
|
-
}),
|
|
1760
|
+
}), a2.addEventListener("change", (e3) => {
|
|
1773
1761
|
const t3 = e3.target;
|
|
1774
1762
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1775
1763
|
const e4 = t3.dataset.fieldId;
|
|
@@ -1807,13 +1795,13 @@ async function stopRecording() {
|
|
|
1807
1795
|
i2 && (i2.value = pe.description);
|
|
1808
1796
|
const o2 = document.querySelector('input[value="startnow"]');
|
|
1809
1797
|
o2 && (o2.checked = true);
|
|
1810
|
-
const s2 = document.getElementById("sf-inline-record-chip"),
|
|
1811
|
-
if (s2 &&
|
|
1798
|
+
const s2 = document.getElementById("sf-inline-record-chip"), a2 = document.getElementById("sf-inline-record-timer");
|
|
1799
|
+
if (s2 && a2) {
|
|
1812
1800
|
const e3 = Math.floor(((ge ?? 0) - (fe ?? 0)) / 1e3), t3 = Math.floor(e3 / 60).toString().padStart(2, "0"), n3 = Math.floor(e3 % 60).toString().padStart(2, "0");
|
|
1813
|
-
|
|
1801
|
+
a2.textContent = `${t3}:${n3}`, a2.style.color = "black", s2.style.display = "flex";
|
|
1814
1802
|
}
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1803
|
+
const r2 = document.getElementById("sf-issue-submit-btn");
|
|
1804
|
+
r2.disabled = false, r2.style.opacity = "1", r2.style.cursor = "pointer";
|
|
1817
1805
|
})();
|
|
1818
1806
|
}
|
|
1819
1807
|
function showStatusModal(e2, t2, n2) {
|
|
@@ -1823,10 +1811,10 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1823
1811
|
var _a2, _b;
|
|
1824
1812
|
(_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
|
|
1825
1813
|
})();
|
|
1826
|
-
const o2 = !e3 && i2, s2 = n3 ? `${be.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${be.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "",
|
|
1827
|
-
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1814
|
+
const o2 = !e3 && i2, s2 = n3 ? `${be.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${be.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", a2 = document.createElement("div");
|
|
1815
|
+
a2.id = "sf-triage-status-modal", Object.assign(a2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
|
|
1816
|
+
const r2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!", l2 = e3 ? '<p style="font-size:14px; color:#64748b; line-height:20px;">This may take ~10 seconds</p>' : o2 ? `<p style="font-size:14px; color:#ef4444; line-height:20px;">${i2}</p>` : "", c2 = e3 ? '<div style="display:flex; justify-content:center; align-items:center; padding: 40px 0;">\n <div style="width:24px; height:24px; border:2px solid #295dbf; border-top:2px solid white; border-radius:50%; animation:spin 1s linear infinite;"></div>\n </div>' : "", d2 = e3 ? "" : '<div id="sf-copied-status" style="display:none; font-size:12px; font-weight:500; color:white;\n background-color:#22c55e; padding:4px 8px; border-radius:6px; white-space:nowrap; align-items:center; gap:6px;">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21 7.5L9 19.5L3 13.5L5.25 11.25L9 15L18.75 5.25L21 7.5Z" fill="white"/>\n </svg>\n Copied\n </div>';
|
|
1817
|
+
a2.innerHTML = `
|
|
1830
1818
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1831
1819
|
<div id="sf-triage-card"
|
|
1832
1820
|
style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
|
|
@@ -1842,7 +1830,7 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1842
1830
|
</svg>
|
|
1843
1831
|
</button>
|
|
1844
1832
|
|
|
1845
|
-
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${
|
|
1833
|
+
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${r2}</h2>
|
|
1846
1834
|
${l2}
|
|
1847
1835
|
${c2}
|
|
1848
1836
|
|
|
@@ -1867,10 +1855,10 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1867
1855
|
<style>
|
|
1868
1856
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1869
1857
|
</style>
|
|
1870
|
-
`, document.body.appendChild(
|
|
1871
|
-
const u2 =
|
|
1858
|
+
`, document.body.appendChild(a2);
|
|
1859
|
+
const u2 = a2.querySelector("#sf-triage-card");
|
|
1872
1860
|
(_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
|
|
1873
|
-
fadeCardAndRemove(
|
|
1861
|
+
fadeCardAndRemove(a2, u2, 300);
|
|
1874
1862
|
});
|
|
1875
1863
|
const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
|
|
1876
1864
|
e3 ? (p2.disabled = true, p2.style.opacity = "0.4", p2.style.cursor = "not-allowed", f2.disabled = true, f2.style.opacity = "0.4", f2.style.cursor = "not-allowed") : (p2.disabled = false, p2.addEventListener("click", () => {
|
|
@@ -1880,7 +1868,7 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1880
1868
|
});
|
|
1881
1869
|
}), f2.disabled = false, f2.addEventListener("click", () => {
|
|
1882
1870
|
(t3 || n3) && window.open(s2, "_blank");
|
|
1883
|
-
}), o2 || setTimeout(() => fadeCardAndRemove(
|
|
1871
|
+
}), o2 || setTimeout(() => fadeCardAndRemove(a2, u2, 300), 1e4));
|
|
1884
1872
|
})(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
|
|
1885
1873
|
}
|
|
1886
1874
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
@@ -1903,11 +1891,11 @@ const Se = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1903
1891
|
const n2 = (function isTypingInInput() {
|
|
1904
1892
|
const e4 = document.activeElement;
|
|
1905
1893
|
return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
|
|
1906
|
-
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, s2 = !!document.getElementById("sf-report-issue-modal"),
|
|
1894
|
+
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, s2 = !!document.getElementById("sf-report-issue-modal"), a2 = !n2 && (t2.enabled || s2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, r2 = s2 ? (e4) => {
|
|
1907
1895
|
setActiveTab(e4), updateModeSpecificUI(e4);
|
|
1908
1896
|
} : injectModalHTML;
|
|
1909
|
-
if (
|
|
1910
|
-
if (
|
|
1897
|
+
if (a2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void r2("lookback");
|
|
1898
|
+
if (a2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void r2("startnow");
|
|
1911
1899
|
if (s2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
|
|
1912
1900
|
if (s2 && shortcutUsed("submitReport")) {
|
|
1913
1901
|
const t3 = document.getElementById("sf-issue-submit-btn");
|
|
@@ -1925,9 +1913,9 @@ function getCachedRegex(e2, t2) {
|
|
|
1925
1913
|
let i2 = xe.get(n2);
|
|
1926
1914
|
return i2 || (i2 = new RegExp(e2, t2), xe.set(n2, i2)), i2;
|
|
1927
1915
|
}
|
|
1928
|
-
const Ie = 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())), Te = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ee = [400, 403], Ce = "CORS", $e = "authorization",
|
|
1916
|
+
const Ie = 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())), Te = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ee = [400, 403], Ce = "CORS", $e = 1, Fe = "authorization", Le = "Authorization", Me = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false }, Ae = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
1929
1917
|
function maskAuthorizationHeader(e2) {
|
|
1930
|
-
const t2 = e2[
|
|
1918
|
+
const t2 = e2[Fe] ? Fe : e2[Le] ? Le : null;
|
|
1931
1919
|
if (!t2) return;
|
|
1932
1920
|
const n2 = e2[t2], i2 = n2.indexOf(" ");
|
|
1933
1921
|
if (-1 !== i2) {
|
|
@@ -1958,14 +1946,14 @@ function trackDomainChangesOnce() {
|
|
|
1958
1946
|
function sendUserDeviceUuid() {
|
|
1959
1947
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
1960
1948
|
let e2 = null;
|
|
1961
|
-
if (
|
|
1949
|
+
if (f) try {
|
|
1962
1950
|
e2 = localStorage.getItem("sailfishUserDeviceUuid");
|
|
1963
1951
|
} catch {
|
|
1964
1952
|
}
|
|
1965
1953
|
if (!e2) {
|
|
1966
1954
|
e2 = uuidv4();
|
|
1967
1955
|
try {
|
|
1968
|
-
|
|
1956
|
+
f && localStorage.setItem("sailfishUserDeviceUuid", e2);
|
|
1969
1957
|
} catch {
|
|
1970
1958
|
}
|
|
1971
1959
|
}
|
|
@@ -1983,17 +1971,17 @@ function handleVisibilityChange() {
|
|
|
1983
1971
|
sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
|
|
1984
1972
|
}
|
|
1985
1973
|
function clearPageVisitDataFromSessionStorage() {
|
|
1986
|
-
|
|
1974
|
+
g && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
1987
1975
|
}
|
|
1988
|
-
let
|
|
1976
|
+
let Re = false;
|
|
1989
1977
|
function _ensureModuleSideEffects() {
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
window.name =
|
|
1978
|
+
Re || (Re = true, restoreFuncSpanState(), (function ensureSessionListeners() {
|
|
1979
|
+
b || (b = true, u && window.addEventListener("beforeunload", () => {
|
|
1980
|
+
window.name = h + window.name;
|
|
1993
1981
|
}));
|
|
1994
|
-
})(),
|
|
1982
|
+
})(), u && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
1995
1983
|
sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
1996
|
-
})()),
|
|
1984
|
+
})()), p && document.addEventListener("visibilitychange", handleVisibilityChange), u && window.addEventListener("beforeunload", () => {
|
|
1997
1985
|
clearPageVisitDataFromSessionStorage();
|
|
1998
1986
|
}));
|
|
1999
1987
|
}
|
|
@@ -2006,15 +1994,15 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
2006
1994
|
} catch {
|
|
2007
1995
|
return false;
|
|
2008
1996
|
}
|
|
2009
|
-
const { hostname: o2, pathname: s2, port:
|
|
2010
|
-
if (!/^https?:$/.test(
|
|
1997
|
+
const { hostname: o2, pathname: s2, port: a2, protocol: r2 } = i2;
|
|
1998
|
+
if (!/^https?:$/.test(r2)) return false;
|
|
2011
1999
|
const l2 = o2.startsWith("www.") ? o2.slice(4).toLowerCase() : o2.toLowerCase();
|
|
2012
2000
|
return t2.some((e3) => {
|
|
2013
2001
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2014
2002
|
let [n3, i3] = t3.split("/", 2), o3 = "";
|
|
2015
2003
|
n3.includes(":") && ([n3, o3] = n3.split(":"));
|
|
2016
|
-
const
|
|
2017
|
-
if (o3 &&
|
|
2004
|
+
const r3 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = l2.startsWith("www.") ? l2.slice(4) : l2;
|
|
2005
|
+
if (o3 && "*" !== o3 && a2 !== o3) return false;
|
|
2018
2006
|
if (n3.startsWith("*.")) {
|
|
2019
2007
|
const e4 = n3.slice(2).toLowerCase();
|
|
2020
2008
|
if (!(l2 === e4 || c2 === e4 || l2.endsWith("." + e4))) return false;
|
|
@@ -2023,41 +2011,41 @@ function matchUrlWithWildcard(e2, t2) {
|
|
|
2023
2011
|
}
|
|
2024
2012
|
return true;
|
|
2025
2013
|
}
|
|
2026
|
-
if (!
|
|
2014
|
+
if (!r3.test(c2) && !r3.test(l2)) return false;
|
|
2027
2015
|
if (i3) {
|
|
2028
2016
|
return getCachedRegex(`^/${i3.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(s2);
|
|
2029
2017
|
}
|
|
2030
2018
|
return true;
|
|
2031
2019
|
});
|
|
2032
2020
|
}
|
|
2033
|
-
function createSkipHeadersPropagationChecker(e2 = []) {
|
|
2034
|
-
const
|
|
2021
|
+
function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
2022
|
+
const n2 = [...Te, ...e2], i2 = t2.length > 0;
|
|
2035
2023
|
return function shouldSkipHeadersPropagation(e3) {
|
|
2036
|
-
let
|
|
2024
|
+
let o2;
|
|
2037
2025
|
try {
|
|
2038
|
-
|
|
2026
|
+
o2 = new URL("string" == typeof e3 ? e3 : String((e3 == null ? void 0 : e3.url) ?? e3), window.location.href);
|
|
2039
2027
|
} catch {
|
|
2040
2028
|
return true;
|
|
2041
2029
|
}
|
|
2042
|
-
const
|
|
2043
|
-
return !(-1 ===
|
|
2030
|
+
const s2 = o2.pathname.toLowerCase(), a2 = s2.lastIndexOf(".");
|
|
2031
|
+
return !(-1 === a2 || !Ie.has(s2.slice(a2))) || (!(!i2 || matchUrlWithWildcard(e3, t2)) || !!matchUrlWithWildcard(e3, n2));
|
|
2044
2032
|
};
|
|
2045
2033
|
}
|
|
2046
|
-
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2047
|
-
const
|
|
2048
|
-
window.fetch = new Proxy(
|
|
2049
|
-
let c2, d2 =
|
|
2034
|
+
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
|
|
2035
|
+
const o2 = window.fetch, s2 = getOrSetSessionId(), a2 = createSkipHeadersPropagationChecker(e2, i2), r2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], l2 = ["application/octet-stream"];
|
|
2036
|
+
window.fetch = new Proxy(o2, { apply: async (e3, i3, o3) => {
|
|
2037
|
+
let c2, d2 = o3[0], u2 = o3[1] || {};
|
|
2050
2038
|
if ("string" == typeof d2) c2 = d2;
|
|
2051
2039
|
else if (d2 instanceof Request) c2 = d2.url;
|
|
2052
2040
|
else {
|
|
2053
|
-
if (!(d2 instanceof URL)) return e3.apply(i3,
|
|
2041
|
+
if (!(d2 instanceof URL)) return e3.apply(i3, o3);
|
|
2054
2042
|
c2 = d2.href;
|
|
2055
2043
|
}
|
|
2056
|
-
return
|
|
2044
|
+
return a2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, s3, a3, c3, d3) {
|
|
2057
2045
|
var _a, _b;
|
|
2058
|
-
if (!c3) return e4.apply(i4,
|
|
2046
|
+
if (!c3) return e4.apply(i4, o4);
|
|
2059
2047
|
let u3 = uuidv4();
|
|
2060
|
-
const p2 = getUrlAndStoredUuids(), f2 =
|
|
2048
|
+
const p2 = getUrlAndStoredUuids(), f2 = a3.method || "GET", g2 = Date.now();
|
|
2061
2049
|
let m2, h2 = {}, y2 = null;
|
|
2062
2050
|
try {
|
|
2063
2051
|
if (s3 instanceof Request) {
|
|
@@ -2069,11 +2057,11 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2069
2057
|
} catch (e5) {
|
|
2070
2058
|
y2 = null;
|
|
2071
2059
|
}
|
|
2072
|
-
} else
|
|
2060
|
+
} else a3.headers && (a3.headers instanceof Headers ? a3.headers.forEach((e5, t3) => {
|
|
2073
2061
|
h2[t3] = e5;
|
|
2074
|
-
}) : Array.isArray(
|
|
2062
|
+
}) : Array.isArray(a3.headers) ? a3.headers.forEach(([e5, t3]) => {
|
|
2075
2063
|
h2[e5] = t3;
|
|
2076
|
-
}) : h2 = { ...
|
|
2064
|
+
}) : h2 = { ...a3.headers }), m2 = a3.body;
|
|
2077
2065
|
} catch (e5) {
|
|
2078
2066
|
ke && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2079
2067
|
}
|
|
@@ -2084,38 +2072,38 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2084
2072
|
h2[n] = w2, b2 && (h2[b2.name] = b2.value);
|
|
2085
2073
|
maskAuthorizationHeader(h2);
|
|
2086
2074
|
try {
|
|
2087
|
-
let b3 = await (async function injectHeader(e5, t3, i5,
|
|
2088
|
-
const
|
|
2075
|
+
let b3 = await (async function injectHeader(e5, t3, i5, o5, s4, a4, r3) {
|
|
2076
|
+
const l3 = getFuncSpanHeader();
|
|
2089
2077
|
if (i5 instanceof Request) {
|
|
2090
2078
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
2091
|
-
d4.set(n, `${s4}/${
|
|
2079
|
+
d4.set(n, `${s4}/${a4}/${r3}`), l3 && (d4.set(l3.name, l3.value), ke && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
|
|
2092
2080
|
const u4 = new Request(c4, { headers: d4 });
|
|
2093
|
-
return await e5.call(t3, u4,
|
|
2081
|
+
return await e5.call(t3, u4, o5);
|
|
2094
2082
|
}
|
|
2095
2083
|
{
|
|
2096
|
-
const c4 = { ...
|
|
2097
|
-
return d4.set(n, `${s4}/${
|
|
2084
|
+
const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2085
|
+
return d4.set(n, `${s4}/${a4}/${r3}`), l3 && (d4.set(l3.name, l3.value), ke && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l3.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
2098
2086
|
}
|
|
2099
|
-
})(e4, i4, s3,
|
|
2100
|
-
Ee.includes(b3.status) && (ke && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5,
|
|
2087
|
+
})(e4, i4, s3, a3, c3, p2.page_visit_uuid, u3), w3 = false;
|
|
2088
|
+
Ee.includes(b3.status) && (ke && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
|
|
2101
2089
|
try {
|
|
2102
|
-
let
|
|
2103
|
-
if ("string" == typeof
|
|
2104
|
-
const i6 = { ...s4 },
|
|
2105
|
-
|
|
2106
|
-
return await e5.call(t3,
|
|
2090
|
+
let o6 = i5[0], s4 = i5[1] || {};
|
|
2091
|
+
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
2092
|
+
const i6 = { ...s4 }, a4 = new Headers(s4.headers || {});
|
|
2093
|
+
a4.delete(n), i6.headers = a4;
|
|
2094
|
+
return await e5.call(t3, o6, i6);
|
|
2107
2095
|
}
|
|
2108
|
-
if (
|
|
2109
|
-
const i6 =
|
|
2110
|
-
|
|
2111
|
-
const
|
|
2112
|
-
return await e5.call(t3,
|
|
2096
|
+
if (o6 instanceof Request) {
|
|
2097
|
+
const i6 = o6.clone(), a4 = new Headers(i6.headers);
|
|
2098
|
+
a4.delete(n);
|
|
2099
|
+
const r3 = new Request(i6, { headers: a4 });
|
|
2100
|
+
return await e5.call(t3, r3, s4);
|
|
2113
2101
|
}
|
|
2114
2102
|
return e5.apply(t3, i5);
|
|
2115
2103
|
} catch (e6) {
|
|
2116
|
-
throw ke && console.log(`Retry without ${n} for ${
|
|
2104
|
+
throw ke && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
|
|
2117
2105
|
}
|
|
2118
|
-
})(e4, i4,
|
|
2106
|
+
})(e4, i4, o4, d3), w3 = true);
|
|
2119
2107
|
const v2 = Date.now(), S2 = b3.status, k2 = b3.ok, x2 = k2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2120
2108
|
let I2 = null;
|
|
2121
2109
|
try {
|
|
@@ -2137,7 +2125,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2137
2125
|
const t3 = e5.headers.get("content-type");
|
|
2138
2126
|
if (!t3) return false;
|
|
2139
2127
|
const n2 = t3.toLowerCase();
|
|
2140
|
-
return
|
|
2128
|
+
return l2.some((e6) => n2.includes(e6));
|
|
2141
2129
|
})(b3)) sendEventWithBody(null);
|
|
2142
2130
|
else if ((function isStreamingResponse(e5) {
|
|
2143
2131
|
const t3 = e5.headers.get("content-type");
|
|
@@ -2148,21 +2136,21 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2148
2136
|
(async function readStreamPrefix(e5, t3, n2) {
|
|
2149
2137
|
const i5 = e5.body;
|
|
2150
2138
|
if (!i5) return null;
|
|
2151
|
-
const
|
|
2152
|
-
let
|
|
2139
|
+
const o5 = i5.getReader(), s4 = new TextDecoder(), a4 = [];
|
|
2140
|
+
let r3 = 0;
|
|
2153
2141
|
const readWithLimit = async () => {
|
|
2154
2142
|
try {
|
|
2155
|
-
for (;
|
|
2156
|
-
const { done: e6, value: t4 } = await
|
|
2143
|
+
for (; r3 < t3; ) {
|
|
2144
|
+
const { done: e6, value: t4 } = await o5.read();
|
|
2157
2145
|
if (e6) break;
|
|
2158
|
-
|
|
2146
|
+
r3 += t4.byteLength, a4.push(s4.decode(t4, { stream: true }));
|
|
2159
2147
|
}
|
|
2160
|
-
return
|
|
2148
|
+
return a4.push(s4.decode()), a4.join("");
|
|
2161
2149
|
} catch {
|
|
2162
|
-
return
|
|
2150
|
+
return a4.length > 0 ? a4.join("") : null;
|
|
2163
2151
|
} finally {
|
|
2164
2152
|
try {
|
|
2165
|
-
|
|
2153
|
+
o5.cancel();
|
|
2166
2154
|
} catch {
|
|
2167
2155
|
}
|
|
2168
2156
|
}
|
|
@@ -2170,14 +2158,14 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2170
2158
|
try {
|
|
2171
2159
|
return await Promise.race([readWithLimit(), new Promise((e6) => setTimeout(() => {
|
|
2172
2160
|
try {
|
|
2173
|
-
|
|
2161
|
+
o5.cancel();
|
|
2174
2162
|
} catch {
|
|
2175
2163
|
}
|
|
2176
|
-
e6(
|
|
2164
|
+
e6(a4.length > 0 ? a4.join("") : null);
|
|
2177
2165
|
}, n2))]);
|
|
2178
2166
|
} catch {
|
|
2179
2167
|
try {
|
|
2180
|
-
|
|
2168
|
+
o5.cancel();
|
|
2181
2169
|
} catch {
|
|
2182
2170
|
}
|
|
2183
2171
|
return null;
|
|
@@ -2200,35 +2188,46 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2200
2188
|
}
|
|
2201
2189
|
return b3;
|
|
2202
2190
|
} catch (t3) {
|
|
2203
|
-
const n2 = Date.now(), s4 = false,
|
|
2204
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ce.toLowerCase()))) return e4.apply(i4,
|
|
2205
|
-
let
|
|
2191
|
+
const n2 = Date.now(), s4 = false, a4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, r3 = t3.message || "Fetch request failed";
|
|
2192
|
+
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ce.toLowerCase()))) return e4.apply(i4, o4);
|
|
2193
|
+
let l3 = m2;
|
|
2206
2194
|
if (y2) try {
|
|
2207
|
-
|
|
2195
|
+
l3 = await y2.text();
|
|
2208
2196
|
} catch {
|
|
2209
|
-
|
|
2197
|
+
l3 = null;
|
|
2210
2198
|
}
|
|
2211
|
-
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code:
|
|
2199
|
+
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code: a4, success: s4, error: r3, method: f2, url: d3, request_headers: h2, request_body: l3, response_body: null }, ...p2 }), t3;
|
|
2212
2200
|
}
|
|
2213
|
-
})(e3, i3,
|
|
2201
|
+
})(e3, i3, o3, d2, u2, s2, c2);
|
|
2214
2202
|
} });
|
|
2215
2203
|
}
|
|
2216
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier:
|
|
2204
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: r2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: w2 = true }) {
|
|
2217
2205
|
var _a, _b;
|
|
2206
|
+
if ((function isHeadlessOrLighthouse() {
|
|
2207
|
+
try {
|
|
2208
|
+
if ("undefined" == typeof navigator) return false;
|
|
2209
|
+
const e3 = navigator;
|
|
2210
|
+
if (true === e3.webdriver) return true;
|
|
2211
|
+
const t3 = "string" == typeof e3.userAgent ? e3.userAgent : "";
|
|
2212
|
+
return /HeadlessChrome|Lighthouse|Chrome-Lighthouse|PTST/i.test(t3);
|
|
2213
|
+
} catch {
|
|
2214
|
+
return false;
|
|
2215
|
+
}
|
|
2216
|
+
})()) return;
|
|
2218
2217
|
const v2 = h2 ?? y2 ?? true, S2 = getOrSetSessionId(), k2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2219
2218
|
if (k2.sessionId = S2, k2.apiKey = e2, k2.backendApi = t2, k2.serviceAdditionalMetadata = l2, k2.initialized && k2.sessionId === S2 && k2.ws && 1 === k2.ws.readyState) return void trackDomainChangesOnce();
|
|
2220
2219
|
const x2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2221
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }) {
|
|
2222
|
-
const
|
|
2220
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), k2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
|
|
2221
|
+
const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, a3 = XMLHttpRequest.prototype.setRequestHeader, r3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
|
|
2223
2222
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2224
|
-
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4,
|
|
2223
|
+
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, a3.call(this, e4, t4);
|
|
2225
2224
|
}, XMLHttpRequest.prototype.open = function(e4, t4, ...n2) {
|
|
2226
|
-
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {},
|
|
2225
|
+
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n2]);
|
|
2227
2226
|
}, XMLHttpRequest.prototype.send = function(...e4) {
|
|
2228
2227
|
const i4 = this._requestUrl;
|
|
2229
|
-
if (!i4) return
|
|
2230
|
-
if (
|
|
2231
|
-
const
|
|
2228
|
+
if (!i4) return s3.apply(this, e4);
|
|
2229
|
+
if (l3(i4)) return s3.apply(this, e4);
|
|
2230
|
+
const o4 = sessionStorage.getItem("pageVisitUUID"), a4 = uuidv4(), c3 = `${r3}/${o4}/${a4}`;
|
|
2232
2231
|
try {
|
|
2233
2232
|
this.setRequestHeader(n, c3);
|
|
2234
2233
|
} catch (e5) {
|
|
@@ -2242,23 +2241,23 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2242
2241
|
}
|
|
2243
2242
|
const u3 = Date.now();
|
|
2244
2243
|
let p3 = false;
|
|
2245
|
-
const f3 = e4[0],
|
|
2246
|
-
maskAuthorizationHeader(
|
|
2247
|
-
const emitFinished = (e5, t4, n2,
|
|
2244
|
+
const f3 = e4[0], g2 = { ...this._capturedRequestHeaders };
|
|
2245
|
+
maskAuthorizationHeader(g2);
|
|
2246
|
+
const emitFinished = (e5, t4, n2, o5, s4) => {
|
|
2248
2247
|
if (p3) return;
|
|
2249
2248
|
p3 = true;
|
|
2250
|
-
const
|
|
2251
|
-
sendEvent({ type: 27, timestamp:
|
|
2249
|
+
const l4 = Date.now();
|
|
2250
|
+
sendEvent({ type: 27, timestamp: l4, sessionId: r3, data: { request_id: a4, session_id: r3, timestamp_start: u3, timestamp_end: l4, response_code: t4, success: e5, error: n2, method: this._requestMethod, url: i4, request_headers: g2, request_body: f3, response_headers: s4, response_body: o5 }, ...getUrlAndStoredUuids() });
|
|
2252
2251
|
};
|
|
2253
2252
|
return this.addEventListener("load", () => {
|
|
2254
2253
|
const e5 = this.status || 0;
|
|
2255
2254
|
let n2, i5 = null;
|
|
2256
|
-
const
|
|
2255
|
+
const o5 = 1024 * t3.captureResponseBodyMaxMb * 1024;
|
|
2257
2256
|
try {
|
|
2258
2257
|
if (0 === t3.captureResponseBodyMaxMb) n2 = null;
|
|
2259
2258
|
else {
|
|
2260
2259
|
const e6 = this.responseText || this.response;
|
|
2261
|
-
n2 = "string" == typeof e6 && e6.length >
|
|
2260
|
+
n2 = "string" == typeof e6 && e6.length > o5 ? null : e6;
|
|
2262
2261
|
}
|
|
2263
2262
|
} catch (e6) {
|
|
2264
2263
|
n2 = null;
|
|
@@ -2281,16 +2280,16 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2281
2280
|
}, { once: true }), this.addEventListener("error", () => {
|
|
2282
2281
|
const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
|
|
2283
2282
|
emitFinished(false, e5, t4);
|
|
2284
|
-
}, { once: true }),
|
|
2283
|
+
}, { once: true }), s3.apply(this, e4);
|
|
2285
2284
|
};
|
|
2286
|
-
})(o2, x2), k2.xhrPatched = true), k2.fetchPatched || (setupFetchInterceptor(o2, x2), k2.fetchPatched = true), await yieldToMain(), k2.domEventsInit || (initializeDomContentEvents(S2), k2.domEventsInit = true), await yieldToMain(), k2.consoleInit || (initializeConsolePlugin(
|
|
2285
|
+
})(o2, x2, i2), k2.xhrPatched = true), k2.fetchPatched || (setupFetchInterceptor(o2, x2, i2), k2.fetchPatched = true), await yieldToMain(), k2.domEventsInit || (initializeDomContentEvents(S2), k2.domEventsInit = true), await yieldToMain(), k2.consoleInit || (initializeConsolePlugin(Ae, S2), k2.consoleInit = true), await yieldToMain(), k2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2287
2286
|
window.addEventListener("error", (e3) => {
|
|
2288
2287
|
captureError(e3.error || e3.message);
|
|
2289
2288
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2290
2289
|
captureError(e3.reason, true);
|
|
2291
2290
|
});
|
|
2292
2291
|
})(), k2.errorInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2293
|
-
|
|
2292
|
+
g && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2294
2293
|
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || k2.ws && 1 === k2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2295
2294
|
var _a2;
|
|
2296
2295
|
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? ke && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), ke && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
@@ -2300,7 +2299,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2300
2299
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2301
2300
|
})(), c2 && fetchAndSendIp(S2);
|
|
2302
2301
|
try {
|
|
2303
|
-
const n2 =
|
|
2302
|
+
const n2 = r2 ?? (function readGitSha() {
|
|
2304
2303
|
var _a2;
|
|
2305
2304
|
try {
|
|
2306
2305
|
const e3 = globalThis;
|
|
@@ -2317,7 +2316,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2317
2316
|
if ("string" == typeof e3 && e3) return e3;
|
|
2318
2317
|
} catch {
|
|
2319
2318
|
}
|
|
2320
|
-
})(), i3 =
|
|
2319
|
+
})(), i3 = a2 ?? "", o3 = s2 ?? "", c3 = "JS/TS", d3 = (function getMapUuidFromWindow() {
|
|
2321
2320
|
try {
|
|
2322
2321
|
const e3 = window;
|
|
2323
2322
|
if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
|
|
@@ -2337,7 +2336,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2337
2336
|
return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
|
|
2338
2337
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2339
2338
|
await yieldToMain();
|
|
2340
|
-
const [
|
|
2339
|
+
const [g2, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, S2, t2, i3, o3, d3, n2, c3, f3)]), y3 = { ...Me, ...(_a = g2.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2 };
|
|
2341
2340
|
if (k2.ws && 1 === k2.ws.readyState) return;
|
|
2342
2341
|
if ((_b = h3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2343
2342
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
@@ -2345,35 +2344,75 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2345
2344
|
const i4 = await initializeRecording(y3, t2, e2, S2, n3, v2, w2, b2 ?? false);
|
|
2346
2345
|
k2.ws = i4, k2.initialized = true, trackDomainChangesOnce(), k2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2347
2346
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2348
|
-
})(
|
|
2347
|
+
})(a2, s2), k2.sentMapUuidOnce = true);
|
|
2349
2348
|
} else console.error("Failed to start recording session:", h3.errors || h3);
|
|
2350
2349
|
} catch (e3) {
|
|
2351
2350
|
console.error("Error starting recording:", e3);
|
|
2352
2351
|
}
|
|
2353
2352
|
}
|
|
2354
|
-
|
|
2355
|
-
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2356
|
-
U && JSON.stringify(U) === JSON.stringify(e2) || (U = e2, sendMessage(t2));
|
|
2357
|
-
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2358
|
-
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2359
|
-
z && z.userId === e2 && JSON.stringify(z.traits) === JSON.stringify(t2) || (z = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2360
|
-
}, exports.initRecorder = async (e2) => {
|
|
2353
|
+
const initRecorder = async (e2) => {
|
|
2361
2354
|
if ("undefined" == typeof window) return;
|
|
2362
2355
|
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {}), n2 = getOrSetSessionId();
|
|
2363
2356
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2364
2357
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2365
2358
|
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => Se), Promise.resolve().then(() => ce)]);
|
|
2366
|
-
let
|
|
2359
|
+
let a2 = null;
|
|
2367
2360
|
try {
|
|
2368
|
-
await o2(e2.apiKey, n3),
|
|
2361
|
+
await o2(e2.apiKey, n3), a2 = s2();
|
|
2369
2362
|
} catch (e3) {
|
|
2370
2363
|
console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
|
|
2371
2364
|
}
|
|
2372
|
-
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData:
|
|
2365
|
+
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: a2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
|
|
2373
2366
|
}
|
|
2374
2367
|
})().finally(() => {
|
|
2375
2368
|
delete t2.initPromise;
|
|
2376
2369
|
})), t2.initPromise);
|
|
2377
|
-
}
|
|
2378
|
-
|
|
2379
|
-
|
|
2370
|
+
};
|
|
2371
|
+
export {
|
|
2372
|
+
initializeFunctionSpanTrackingFromApi as A,
|
|
2373
|
+
initializeRecording as B,
|
|
2374
|
+
initializeWebSocket as C,
|
|
2375
|
+
Me as D,
|
|
2376
|
+
invalidateUrlCache as E,
|
|
2377
|
+
isFunctionSpanTrackingEnabled as F,
|
|
2378
|
+
matchUrlWithWildcard as G,
|
|
2379
|
+
w as H,
|
|
2380
|
+
onNavigationChange as I,
|
|
2381
|
+
openReportIssueModal as J,
|
|
2382
|
+
restoreFuncSpanState as K,
|
|
2383
|
+
sendDomainsToNotPropagateHeaderTo as L,
|
|
2384
|
+
sendEvent as M,
|
|
2385
|
+
sendGraphQLRequest as N,
|
|
2386
|
+
sendMessage as O,
|
|
2387
|
+
startRecording as P,
|
|
2388
|
+
startRecordingSession as Q,
|
|
2389
|
+
trackingEvent as R,
|
|
2390
|
+
$e as S,
|
|
2391
|
+
withAppUrlMetadata as T,
|
|
2392
|
+
Ae as a,
|
|
2393
|
+
addOrUpdateMetadata as b,
|
|
2394
|
+
buildBatches as c,
|
|
2395
|
+
clearStaleFuncSpanState as d,
|
|
2396
|
+
createSkipHeadersPropagationChecker as e,
|
|
2397
|
+
createTriageAndIssueFromRecorder as f,
|
|
2398
|
+
createTriageFromRecorder as g,
|
|
2399
|
+
disableFunctionSpanTracking as h,
|
|
2400
|
+
enableFunctionSpanTracking as i,
|
|
2401
|
+
ensureHrefCache as j,
|
|
2402
|
+
eventSize as k,
|
|
2403
|
+
fetchAndSendIp as l,
|
|
2404
|
+
fetchCaptureSettings as m,
|
|
2405
|
+
fetchEngineeringTicketPlatformIntegrations as n,
|
|
2406
|
+
fetchFunctionSpanTrackingEnabled as o,
|
|
2407
|
+
flushBufferedEvents as p,
|
|
2408
|
+
getCachedHref as q,
|
|
2409
|
+
getCachedHrefNoQuery as r,
|
|
2410
|
+
getFuncSpanHeader as s,
|
|
2411
|
+
getOrSetSessionId as t,
|
|
2412
|
+
getUrlAndStoredUuids as u,
|
|
2413
|
+
identify as v,
|
|
2414
|
+
initRecorder as w,
|
|
2415
|
+
initializeConsolePlugin as x,
|
|
2416
|
+
yieldToMain as y,
|
|
2417
|
+
initializeDomContentEvents as z
|
|
2418
|
+
};
|