@sailfish-ai/recorder 1.11.3 → 1.11.5

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.
Files changed (40) hide show
  1. package/dist/chunks/{chunkSerializer-CV4nkb5-.js → chunkSerializer-C8qtomKe.js} +1 -1
  2. package/dist/chunks/chunkSerializer-C8qtomKe.js.br +0 -0
  3. package/dist/chunks/chunkSerializer-C8qtomKe.js.gz +0 -0
  4. package/dist/chunks/{chunkSerializer-jzbHv2wf.js → chunkSerializer-RWnu-UfC.js} +1 -1
  5. package/dist/chunks/chunkSerializer-RWnu-UfC.js.br +0 -0
  6. package/dist/chunks/chunkSerializer-RWnu-UfC.js.gz +0 -0
  7. package/dist/chunks/{index-BynFTRFv.js → index-CIK1iDN9.js} +227 -196
  8. package/dist/chunks/index-CIK1iDN9.js.br +0 -0
  9. package/dist/chunks/index-CIK1iDN9.js.gz +0 -0
  10. package/dist/chunks/{index-BP-kNUGS.js → index-DiGs9it7.js} +320 -289
  11. package/dist/chunks/index-DiGs9it7.js.br +0 -0
  12. package/dist/chunks/index-DiGs9it7.js.gz +0 -0
  13. package/dist/eventStore.js +25 -1
  14. package/dist/eventStore.js.br +0 -0
  15. package/dist/eventStore.js.gz +0 -0
  16. package/dist/inAppReportIssueModal/index.js +10 -4
  17. package/dist/inAppReportIssueModal/index.js.br +0 -0
  18. package/dist/inAppReportIssueModal/index.js.gz +0 -0
  19. package/dist/inAppReportIssueModal/integrations.js +50 -0
  20. package/dist/inAppReportIssueModal/integrations.js.br +0 -0
  21. package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
  22. package/dist/recorder.cjs +1 -1
  23. package/dist/recorder.cjs.br +0 -0
  24. package/dist/recorder.cjs.gz +0 -0
  25. package/dist/recorder.js +1 -1
  26. package/dist/recorder.js.br +0 -0
  27. package/dist/recorder.js.gz +0 -0
  28. package/dist/recorder.umd.cjs +41 -10
  29. package/dist/recorder.umd.cjs.br +0 -0
  30. package/dist/recorder.umd.cjs.gz +0 -0
  31. package/dist/types/inAppReportIssueModal/integrations.d.ts +3 -0
  32. package/package.json +1 -1
  33. package/dist/chunks/chunkSerializer-CV4nkb5-.js.br +0 -0
  34. package/dist/chunks/chunkSerializer-CV4nkb5-.js.gz +0 -0
  35. package/dist/chunks/chunkSerializer-jzbHv2wf.js.br +0 -0
  36. package/dist/chunks/chunkSerializer-jzbHv2wf.js.gz +0 -0
  37. package/dist/chunks/index-BP-kNUGS.js.br +0 -0
  38. package/dist/chunks/index-BP-kNUGS.js.gz +0 -0
  39. package/dist/chunks/index-BynFTRFv.js.br +0 -0
  40. package/dist/chunks/index-BynFTRFv.js.gz +0 -0
@@ -35,7 +35,7 @@ function uuidv4() {
35
35
  return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
36
36
  });
37
37
  }
38
- const n = "X-Sf3-Rid", i = 0, o = 1, s = 2, a = 4, r = "recordingEvents";
38
+ const n = "X-Sf3-Rid", i = 0, o = 1, a = 2, s = 4, r = "recordingEvents";
39
39
  let l = null;
40
40
  function openDb$1() {
41
41
  return (function hasIndexedDB$1() {
@@ -57,8 +57,8 @@ function openDb$1() {
57
57
  function withStore$1(e2, t2) {
58
58
  return openDb$1().then((n2) => n2 ? new Promise((i2) => {
59
59
  try {
60
- const o2 = n2.transaction(r, e2), s2 = o2.objectStore(r);
61
- Promise.resolve(t2(s2)).then((e3) => {
60
+ const o2 = n2.transaction(r, e2), a2 = o2.objectStore(r);
61
+ Promise.resolve(t2(a2)).then((e3) => {
62
62
  o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
63
63
  }).catch(() => i2(null));
64
64
  } catch {
@@ -92,8 +92,8 @@ async function withStore(e2, t2) {
92
92
  const n2 = await openDb();
93
93
  return n2 ? new Promise((i2) => {
94
94
  try {
95
- const o2 = n2.transaction(c, e2), s2 = o2.objectStore(c);
96
- Promise.resolve(t2(s2)).then((e3) => {
95
+ const o2 = n2.transaction(c, e2), a2 = o2.objectStore(c);
96
+ Promise.resolve(t2(a2)).then((e3) => {
97
97
  o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
98
98
  }).catch(() => i2(null));
99
99
  } catch {
@@ -138,13 +138,13 @@ function buildBatches(e2, t2, n2) {
138
138
  }
139
139
  const o2 = [];
140
140
  for (const e3 in i2) {
141
- const s2 = i2[e3];
142
- let a2 = [], r2 = 0;
143
- for (const e4 of s2) {
141
+ const a2 = i2[e3];
142
+ let s2 = [], r2 = 0;
143
+ for (const e4 of a2) {
144
144
  const i3 = t2(e4);
145
- r2 + i3 > n2 && (a2.length > 0 && (o2.push(a2), a2 = [], r2 = 0), i3 > n2) || (a2.push(e4), r2 += i3);
145
+ r2 + i3 > n2 && (s2.length > 0 && (o2.push(s2), s2 = [], r2 = 0), i3 > n2) || (s2.push(e4), r2 += i3);
146
146
  }
147
- a2.length > 0 && o2.push(a2);
147
+ s2.length > 0 && o2.push(s2);
148
148
  }
149
149
  return o2;
150
150
  }
@@ -292,10 +292,13 @@ async function flushBufferedEvents() {
292
292
  T = (async () => {
293
293
  var _a, _b;
294
294
  const e2 = await (async function getAllIndexedEvents() {
295
- return await withStore$1("readonly", (e3) => new Promise((t3) => {
296
- const n2 = e3.getAll();
297
- n2.onsuccess = () => t3(n2.result), n2.onerror = () => t3([]);
298
- })) ?? [];
295
+ const e3 = await withStore$1("readonly", (e4) => new Promise((t4) => {
296
+ const n3 = e4.getAll();
297
+ n3.onsuccess = () => t4(n3.result), n3.onerror = () => t4([]);
298
+ })) ?? [], t3 = Date.now(), n2 = [], i2 = [];
299
+ for (const o2 of e3) "number" == typeof (o2 == null ? void 0 : o2.timestamp) && t3 - o2.timestamp >= 864e5 ? "number" == typeof o2.id && i2.push(o2.id) : n2.push(o2);
300
+ return i2.length > 0 && deleteEventsByIds(i2).catch(() => {
301
+ }), n2;
299
302
  })(), t2 = {};
300
303
  for (const n2 of e2) {
301
304
  const e3 = ((_b = (_a = n2 == null ? void 0 : n2.data) == null ? void 0 : _a.data) == null ? void 0 : _b.sessionId) ?? "unknown-session";
@@ -364,14 +367,14 @@ function handleWsMessage(e2) {
364
367
  } catch (e3) {
365
368
  }
366
369
  }
367
- function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
370
+ function initializeWebSocket(t2, n2, i2, o2, a2 = false) {
368
371
  ensureHrefCache();
369
- const a2 = (function getWebSocketHost(e2) {
372
+ const s2 = (function getWebSocketHost(e2) {
370
373
  const t3 = new URL(e2);
371
374
  return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
372
375
  })(t2);
373
- let r2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${a2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.3`;
374
- if (o2 && (r2 += `&envValue=${encodeURIComponent(o2)}`), k = s2 ? (function tryCreateWsWorker() {
376
+ let r2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.5`;
377
+ if (o2 && (r2 += `&envValue=${encodeURIComponent(o2)}`), k = a2 ? (function tryCreateWsWorker() {
375
378
  if ("undefined" == typeof Worker) return null;
376
379
  try {
377
380
  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);
@@ -448,8 +451,8 @@ function fetchAndSendIp(e2) {
448
451
  for (const e3 of H) try {
449
452
  const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
450
453
  if (clearTimeout(n2), !i2.ok) continue;
451
- const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
452
- if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: w() });
454
+ const o2 = await i2.json(), a2 = o2.ip || o2.origin || null;
455
+ if (a2 && "string" == typeof a2 && a2.length <= 45) return void sendMessage({ type: "visitorIp", ip: a2, timestamp: w() });
453
456
  } catch {
454
457
  }
455
458
  N = null;
@@ -488,7 +491,7 @@ async function captureError(e2, t2 = false) {
488
491
  n3.push(e4);
489
492
  continue;
490
493
  }
491
- const [, i3, o3, s3, a3] = t4, r3 = parseInt(s3, 10), l2 = Math.max(0, parseInt(a3, 10) - 1);
494
+ const [, i3, o3, a3, s3] = t4, r3 = parseInt(a3, 10), l2 = Math.max(0, parseInt(s3, 10) - 1);
492
495
  if (!Number.isFinite(r3) || !Number.isFinite(l2)) {
493
496
  n3.push(e4 + " [Invalid line/column]");
494
497
  continue;
@@ -507,29 +510,29 @@ async function captureError(e2, t2 = false) {
507
510
  } else n3.push(`${e4} [No mapping found in ${o3}]`);
508
511
  }
509
512
  return n3;
510
- })(i2), s2 = o2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), a2 = s2.length > 0 ? s2 : o2, r2 = Date.now();
511
- 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" } } } });
513
+ })(i2), a2 = o2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), s2 = a2.length > 0 ? a2 : o2, r2 = Date.now();
514
+ sendMessage({ type: "event", event: { type: 6, timestamp: r2, data: { payload: { message: n2, stack: i2, trace: s2, filteredStack: a2, userAgent: navigator.userAgent, url: window.location.href, timestamp: r2, level: "error" } } } });
512
515
  }
513
- const G = readDebugFlag();
514
516
  const V = readDebugFlag();
515
- function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
516
- const a2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
517
- return V && console.log(`Initial GraphQL request for ${e2} at ${a2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
518
- let s3 = 0;
517
+ const G = readDebugFlag();
518
+ function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, a2 = 2) {
519
+ const s2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
520
+ return G && console.log(`Initial GraphQL request for ${e2} at ${s2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
521
+ let a3 = 0;
519
522
  const attemptRequest = async () => {
520
523
  try {
521
524
  return await e3();
522
525
  } catch (e4) {
523
- if (s3++, s3 > n3) throw e4;
524
- const a3 = i3 * Math.pow(o3, s3 - 1);
525
- return G && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${a3}ms...`), await new Promise((e5) => setTimeout(e5, a3)), attemptRequest();
526
+ if (a3++, a3 > n3) throw e4;
527
+ const s3 = i3 * Math.pow(o3, a3 - 1);
528
+ return V && console.log(`Attempt ${a3} failed: ${t3}; Retrying in ${s3}ms...`), await new Promise((e5) => setTimeout(e5, s3)), attemptRequest();
526
529
  }
527
530
  };
528
531
  return attemptRequest();
529
- })(() => fetch(a2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
530
- if (V && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
532
+ })(() => fetch(s2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
533
+ if (G && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
531
534
  return e3.json();
532
- }), "Sending GraphQL request to Sailfish AI", i2, o2, s2);
535
+ }), "Sending GraphQL request to Sailfish AI", i2, o2, a2);
533
536
  }
534
537
  function fetchCaptureSettings(e2, t2) {
535
538
  return sendGraphQLRequest("GetCaptureSettingsFromApiKey", "\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n textEditThrottleEnabled\n }\n }\n ", { apiKey: e2, backendApi: t2 });
@@ -537,20 +540,20 @@ function fetchCaptureSettings(e2, t2) {
537
540
  function fetchFunctionSpanTrackingEnabled(e2, t2) {
538
541
  return sendGraphQLRequest("GetFunctionSpanTrackingEnabledFromApiKey", "\n query GetFunctionSpanTrackingEnabledFromApiKey($apiKey: String!) {\n isFunctionSpanTrackingEnabledFromApiKey(apiKey: $apiKey)\n }\n ", { apiKey: e2, backendApi: t2 });
539
542
  }
540
- function startRecordingSession(e2, t2, n2, i2, o2, s2, a2, r2, l2) {
541
- 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 });
543
+ function startRecordingSession(e2, t2, n2, i2, o2, a2, s2, r2, l2) {
544
+ 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: a2, gitSha: s2, library: r2, serviceAdditionalMetadata: l2, startRecordingFilePath: null, startRecordingLineNumber: null });
542
545
  }
543
546
  function sendDomainsToNotPropagateHeaderTo(e2, t2, n2) {
544
547
  return sendGraphQLRequest("DomainsToNotPassHeaderTo", "mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }", { apiKey: e2, domains: t2, backendApi: n2 });
545
548
  }
546
- function createTriageFromRecorder(e2, t2, n2, i2, o2, s2, a2) {
547
- 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 });
549
+ function createTriageFromRecorder(e2, t2, n2, i2, o2, a2, s2) {
550
+ 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: a2, triageSource: s2, backendApi: t2 });
548
551
  }
549
552
  function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
550
553
  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 });
551
554
  }
552
- function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2, a2, r2, l2, c2, d2, u2, p2, f2, g2, m2) {
553
- 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 });
555
+ function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, a2, s2, r2, l2, c2, d2, u2, p2, f2, g2, m2) {
556
+ 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: a2, issueName: s2, issueDescription: r2, createEngineeringTicket: l2, teamId: c2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
554
557
  }
555
558
  const Q = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
556
559
  function shouldSkipFrame(e2) {
@@ -652,13 +655,13 @@ function initializeDomContentEvents(e2) {
652
655
  t2.data.source = i;
653
656
  break;
654
657
  case "complete":
655
- t2.data.source = s;
658
+ t2.data.source = a;
656
659
  }
657
660
  t2.data.info && sendEvent(t2);
658
661
  }), document.addEventListener("DOMContentLoaded", () => {
659
662
  sendEvent({ type: 24, data: { source: o }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
660
663
  }), window.addEventListener("pagehide", () => {
661
- sendEvent({ type: 24, data: { source: a }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
664
+ sendEvent({ type: 24, data: { source: s }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
662
665
  });
663
666
  }
664
667
  async function initializePerformancePlugin(e2) {
@@ -678,14 +681,14 @@ async function initializePerformancePlugin(e2) {
678
681
  async function initializeConsolePlugin(e2, n2) {
679
682
  const { getRecordConsolePlugin: i2 } = await import("@sailfish-rrweb/rrweb-plugin-console-record");
680
683
  await yieldToMain();
681
- const { name: o2, observer: s2 } = i2(e2);
682
- s2((e3) => {
683
- 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 };
684
+ const { name: o2, observer: a2 } = i2(e2);
685
+ a2((e3) => {
686
+ const i3 = e3, [a3, s2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [r2, l2] = getCallerLocation(2), c2 = a3 ?? r2, d2 = s2 ?? l2, u2 = { ...i3, sourceFile: c2, sourceLine: d2 };
684
687
  sendEvent({ type: t.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
685
688
  }, window, e2);
686
689
  }
687
- async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2 = false) {
688
- const c2 = initializeWebSocket(n2, i2, o2, s2, r2);
690
+ async function initializeRecording(e2, n2, i2, o2, a2, s2 = true, r2 = false, l2 = false) {
691
+ const c2 = initializeWebSocket(n2, i2, o2, a2, r2);
689
692
  try {
690
693
  const n3 = (function createThrottledEmit(e3, t2 = 1e3) {
691
694
  if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
@@ -700,8 +703,8 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
700
703
  const t3 = e4.data, n5 = (t3 == null ? void 0 : t3.adds) && t3.adds.length > 0, i4 = (t3 == null ? void 0 : t3.removes) && t3.removes.length > 0;
701
704
  if (n5 || i4) return void sendEvent(e4);
702
705
  }
703
- const s3 = `3:${o3}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
704
- n4.set(s3, e4), i3 || (i3 = setInterval(() => {
706
+ const a3 = `3:${o3}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
707
+ n4.set(a3, e4), i3 || (i3 = setInterval(() => {
705
708
  0 !== n4.size && (n4.forEach((e5) => sendEvent(e5)), n4.clear());
706
709
  }, t2));
707
710
  }, flush: () => {
@@ -718,23 +721,23 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
718
721
  }
719
722
  const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
720
723
  if (J = n4, await yieldToMain(), l2) {
721
- const { chunkedSnapshot: i3 } = await import("./chunkSerializer-CV4nkb5-.js"), o3 = n4.mirror;
722
- let s3 = true;
723
- const a3 = [];
724
+ const { chunkedSnapshot: i3 } = await import("./chunkSerializer-C8qtomKe.js"), o3 = n4.mirror;
725
+ let a3 = true;
726
+ const s3 = [];
724
727
  n4({ emit(e3) {
725
- s3 ? a3.push(e3) : emitWithContext(e3);
728
+ a3 ? s3.push(e3) : emitWithContext(e3);
726
729
  }, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? X, recordDOM: false });
727
730
  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 });
728
731
  if (l3) {
729
732
  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 });
730
- for (const e3 of a3) emitWithContext(e3);
731
- s3 = false;
732
- } else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
733
+ for (const e3 of s3) emitWithContext(e3);
734
+ a3 = false;
735
+ } else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), a3 = false;
733
736
  } else n4({ emit(e3) {
734
737
  emitWithContext(e3);
735
738
  }, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? X });
736
739
  };
737
- if (a2) {
740
+ if (s2) {
738
741
  let e3 = false;
739
742
  const startOnce = () => {
740
743
  e3 || (e3 = true, startHeavyWork());
@@ -779,7 +782,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, a2 = true, r2 = false, l2
779
782
  }
780
783
  return c2;
781
784
  }
782
- const se = [(e2) => (function checkNextJs() {
785
+ const ae = [(e2) => (function checkNextJs() {
783
786
  try {
784
787
  if (void 0 !== globalThis.__NEXT_DATA__) return "nextjs";
785
788
  } catch {
@@ -841,7 +844,7 @@ const se = [(e2) => (function checkNextJs() {
841
844
  }
842
845
  return null;
843
846
  }];
844
- const ae = ["jira", "linear", "zendesk"];
847
+ const se = ["jira", "linear", "zendesk"];
845
848
  let re = null;
846
849
  const le = /* @__PURE__ */ new Map();
847
850
  function getIntegrationData() {
@@ -855,7 +858,7 @@ function resolveIntegration(e2) {
855
858
  if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
856
859
  const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
857
860
  var _a2;
858
- return ae.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
861
+ return se.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
859
862
  });
860
863
  if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
861
864
  const i2 = n2.find((e3) => {
@@ -941,8 +944,8 @@ function updateIssueTypeOptions(e2, t2) {
941
944
  }), n3 = i2.find((e3) => {
942
945
  var _a2;
943
946
  return "task" === ((_a2 = e3.name) == null ? void 0 : _a2.toLowerCase());
944
- }), s2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
945
- s2 ? (e2.value = s2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
947
+ }), a2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
948
+ a2 ? (e2.value = a2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
946
949
  }
947
950
  }
948
951
  function getFieldsForProject(e2, t2) {
@@ -960,12 +963,40 @@ function getDefaultReporterAccountId() {
960
963
  const n3 = e2.filter(t3);
961
964
  return 1 === n3.length ? n3[0] : null;
962
965
  };
963
- let s2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
964
- if (!s2 && o2 && (s2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !s2 && i2) {
966
+ let a2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
967
+ if (!a2 && o2 && (a2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !a2 && i2) {
965
968
  const e3 = i2.split("@")[0];
966
- e3.length >= 3 && (s2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
969
+ e3.length >= 3 && (a2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
967
970
  }
968
- return s2 && (s2.id || s2.accountId) || null;
971
+ return a2 && (a2.id || a2.accountId) || null;
972
+ }
973
+ function lastReporterStorageKey() {
974
+ if (!re) return null;
975
+ const e2 = re.primaryCloudId || re.provider || "";
976
+ return e2 ? `sf-veritas:lastReporter:${e2}` : null;
977
+ }
978
+ function getSavedLastReporterAccountId() {
979
+ if ("undefined" == typeof window || "undefined" == typeof localStorage) return null;
980
+ const e2 = lastReporterStorageKey();
981
+ if (!e2) return null;
982
+ try {
983
+ return localStorage.getItem(e2);
984
+ } catch {
985
+ return null;
986
+ }
987
+ }
988
+ function saveLastReporterAccountId(e2) {
989
+ if ("undefined" == typeof window || "undefined" == typeof localStorage) return;
990
+ const t2 = lastReporterStorageKey();
991
+ if (t2 && e2) try {
992
+ localStorage.setItem(t2, e2);
993
+ } catch {
994
+ }
995
+ }
996
+ function getValidSavedReporterAccountId() {
997
+ const e2 = getSavedLastReporterAccountId();
998
+ if (!e2) return null;
999
+ return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
969
1000
  }
970
1001
  function getProjectsForTeam(e2) {
971
1002
  if (!re) return [];
@@ -987,10 +1018,10 @@ function updateFormWithIntegrationData(e2) {
987
1018
  }
988
1019
  const o2 = document.getElementById("sf-eng-ticket-priority");
989
1020
  o2 && (populatePriorityOptions(o2, re.provider || "", re.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
990
- const s2 = document.getElementById("sf-eng-ticket-sprint"), a2 = "jira" === ((_a = re.provider) == null ? void 0 : _a.toLowerCase());
991
- s2 && a2 && re.sprints && populateSprintOptions(s2, re.sprints, e2.engTicketSprint || void 0);
1021
+ const a2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a = re.provider) == null ? void 0 : _a.toLowerCase());
1022
+ a2 && s2 && re.sprints && populateSprintOptions(a2, re.sprints, e2.engTicketSprint || void 0);
992
1023
  const r2 = document.getElementById("sf-eng-ticket-type");
993
- 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;
1024
+ return r2 && s2 && e2.engTicketProject && (updateIssueTypeOptions(r2, e2.engTicketProject), e2.engTicketIssueType ? (r2.value = e2.engTicketIssueType, r2.style.color = "#000") : r2.value && (e2.engTicketIssueType = r2.value)), e2;
994
1025
  }
995
1026
  const ce = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
996
1027
  if (!re) try {
@@ -999,7 +1030,7 @@ const ce = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrati
999
1030
  } catch (e3) {
1000
1031
  console.error("Error fetching integration data:", e3), re = null;
1001
1032
  }
1002
- }, getDefaultReporterAccountId, 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";
1033
+ }, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), de = "sf-create-issue-preference", ue = "sf-create-eng-ticket-preference";
1003
1034
  function getInitialState() {
1004
1035
  const e2 = (function loadUserPreferences() {
1005
1036
  return { createIssue: f && "true" === localStorage.getItem(de), createEngTicket: f && "true" === localStorage.getItem(ue) };
@@ -1065,16 +1096,16 @@ function setupCustomMultiSelectListeners(e2, t2) {
1065
1096
  </span>`);
1066
1097
  }
1067
1098
  });
1068
- const s2 = n2.querySelector(".sf-multiselect-chips");
1069
- return s2 && (s2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', s2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
1099
+ const a2 = n2.querySelector(".sf-multiselect-chips");
1100
+ return a2 && (a2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', a2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
1070
1101
  e4.addEventListener("click", (n3) => {
1071
1102
  n3.stopPropagation();
1072
- const o3 = e4.dataset.value || "", s3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
1073
- s3 && (s3.dataset.selected = "false", s3.style.backgroundColor = ""), updateChipsDisplay();
1074
- const a2 = [];
1103
+ const o3 = e4.dataset.value || "", a3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
1104
+ a3 && (a3.dataset.selected = "false", a3.style.backgroundColor = ""), updateChipsDisplay();
1105
+ const s2 = [];
1075
1106
  i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
1076
- "true" === e5.dataset.selected && a2.push(e5.dataset.value || "");
1077
- }), t2(a2);
1107
+ "true" === e5.dataset.selected && s2.push(e5.dataset.value || "");
1108
+ }), t2(s2);
1078
1109
  });
1079
1110
  })), e3;
1080
1111
  }
@@ -1083,8 +1114,8 @@ function setupCustomMultiSelectListeners(e2, t2) {
1083
1114
  n3.stopPropagation();
1084
1115
  const i3 = e3, o2 = "true" === i3.dataset.selected;
1085
1116
  i3.dataset.selected = String(!o2), i3.style.backgroundColor = o2 ? "" : "#e0f2fe";
1086
- const s2 = updateChipsDisplay();
1087
- t2(s2);
1117
+ const a2 = updateChipsDisplay();
1118
+ t2(a2);
1088
1119
  });
1089
1120
  }), updateChipsDisplay(), document.addEventListener("click", (e3) => {
1090
1121
  const t3 = e3.target;
@@ -1097,12 +1128,12 @@ function renderDynamicFields(e2, t2) {
1097
1128
  if (!e2) return void (n2.innerHTML = '<div style="font-size:14px; color:#64748B;">Select a project to see additional fields</div>');
1098
1129
  const i2 = getFieldsForProject(e2, t2), o2 = getUsers();
1099
1130
  if (!i2 || 0 === i2.length) return void (n2.innerHTML = "");
1100
- const s2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
1131
+ const a2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
1101
1132
  var _a, _b, _c, _d;
1102
- 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"];
1103
- if (d2.includes(i3) || d2.includes(a2)) return null;
1133
+ const i3 = e4.fieldId || e4.key, o3 = e4.name, a3 = (_a = e4.schema) == null ? void 0 : _a.type, s2 = (_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"];
1134
+ if (d2.includes(i3) || d2.includes(s2)) return null;
1104
1135
  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;";
1105
- switch (s3) {
1136
+ switch (a3) {
1106
1137
  case "string":
1107
1138
  return r2 && r2.includes("textarea") ? `
1108
1139
  <div>
@@ -1176,7 +1207,7 @@ function renderDynamicFields(e2, t2) {
1176
1207
  const e5 = n3.map((e6) => {
1177
1208
  const n4 = e6.email ? `${e6.name} (${e6.email})` : e6.name, i4 = t3 === e6.id ? "selected" : "";
1178
1209
  return `<option value="${e6.id}" ${i4}>${n4}</option>`;
1179
- }).join(""), s4 = t3 && n3.some((e6) => e6.id === t3);
1210
+ }).join(""), a4 = t3 && n3.some((e6) => e6.id === t3);
1180
1211
  return `
1181
1212
  <div>
1182
1213
  <label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
@@ -1186,10 +1217,10 @@ function renderDynamicFields(e2, t2) {
1186
1217
  id="${i3}"
1187
1218
  class="sf-dynamic-field"
1188
1219
  data-field-id="${i3}"
1189
- style="${p2} appearance:none; cursor:pointer; background-color: white; ${s4 ? "" : "color: #9ca3af;"}"
1220
+ style="${p2} appearance:none; cursor:pointer; background-color: white; ${a4 ? "" : "color: #9ca3af;"}"
1190
1221
  ${l2 ? "required" : ""}
1191
1222
  >
1192
- <option value="" ${s4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
1223
+ <option value="" ${a4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
1193
1224
  ${e5}
1194
1225
  </select>
1195
1226
  </div>
@@ -1222,7 +1253,7 @@ function renderDynamicFields(e2, t2) {
1222
1253
  }
1223
1254
  return null;
1224
1255
  case "array":
1225
- return "labels" === a2 ? null : c2 && c2.length > 0 ? renderCustomMultiSelect(i3, o3, c2, Array.isArray(t3) ? t3 : [], l2) : null;
1256
+ return "labels" === s2 ? null : c2 && c2.length > 0 ? renderCustomMultiSelect(i3, o3, c2, Array.isArray(t3) ? t3 : [], l2) : null;
1226
1257
  case "parent":
1227
1258
  case "issuelink":
1228
1259
  return `
@@ -1262,7 +1293,7 @@ function renderDynamicFields(e2, t2) {
1262
1293
  ` : null;
1263
1294
  }
1264
1295
  })(e3, pe.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
1265
- n2.innerHTML = s2 || "", i2.forEach((e3) => {
1296
+ n2.innerHTML = a2 || "", i2.forEach((e3) => {
1266
1297
  var _a;
1267
1298
  const t3 = e3.fieldId || e3.key, n3 = (_a = e3.schema) == null ? void 0 : _a.type, i3 = e3.allowedValues;
1268
1299
  "array" === n3 && i3 && i3.length > 0 && setupCustomMultiSelectListeners(t3, (e4) => {
@@ -1319,10 +1350,10 @@ function activateModalIsolation(e2) {
1319
1350
  n3 && (e2.contains(n3) || (t3.stopImmediatePropagation(), t3.preventDefault(), refocus()));
1320
1351
  }, o2 = ["mousedown", "mouseup", "click", "pointerdown", "pointerup", "touchstart", "touchend", "wheel", "keydown", "keyup", "focus", "focusin", "focusout", "blur"];
1321
1352
  o2.forEach((e3) => document.addEventListener(e3, quarantine, true));
1322
- let s2 = 0, a2 = null;
1353
+ let a2 = 0, s2 = null;
1323
1354
  const r2 = t2 instanceof HTMLTextAreaElement ? t2 : null, refocus = () => {
1324
- if ((e2.querySelector(":focus") || r2 || t2 || e2).focus({ preventScroll: true }), r2 && document.activeElement === r2 && a2) try {
1325
- r2.setSelectionRange(a2.start, a2.end, "none");
1355
+ if ((e2.querySelector(":focus") || r2 || t2 || e2).focus({ preventScroll: true }), r2 && document.activeElement === r2 && s2) try {
1356
+ r2.setSelectionRange(s2.start, s2.end, "none");
1326
1357
  } catch {
1327
1358
  }
1328
1359
  }, selectionInsideModal = () => {
@@ -1340,12 +1371,12 @@ function activateModalIsolation(e2) {
1340
1371
  const t3 = document.activeElement, n3 = t3 === document.body || null == t3 || !e2.contains(t3), i3 = selectionInsideModal();
1341
1372
  n3 && !i3 ? (l2 += 1, l2 >= 2 && (refocus(), l2 = 0)) : (l2 = 0, (() => {
1342
1373
  if (r2 && document.activeElement === r2) try {
1343
- a2 = { start: r2.selectionStart ?? r2.value.length, end: r2.selectionEnd ?? r2.value.length };
1374
+ s2 = { start: r2.selectionStart ?? r2.value.length, end: r2.selectionEnd ?? r2.value.length };
1344
1375
  } catch {
1345
1376
  }
1346
- })()), s2 = window.requestAnimationFrame(watchdog);
1377
+ })()), a2 = window.requestAnimationFrame(watchdog);
1347
1378
  };
1348
- s2 = window.requestAnimationFrame(watchdog);
1379
+ a2 = window.requestAnimationFrame(watchdog);
1349
1380
  const onBlurLike = () => {
1350
1381
  setTimeout(() => {
1351
1382
  const t3 = document.activeElement;
@@ -1357,7 +1388,7 @@ function activateModalIsolation(e2) {
1357
1388
  n2.remove(), i2.remove();
1358
1389
  } catch {
1359
1390
  }
1360
- o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), s2 && cancelAnimationFrame(s2);
1391
+ o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), a2 && cancelAnimationFrame(a2);
1361
1392
  };
1362
1393
  }
1363
1394
  function injectModalHTML(e2 = "lookback") {
@@ -1565,8 +1596,8 @@ function injectModalHTML(e2 = "lookback") {
1565
1596
  o2 && o2.addEventListener("change", () => {
1566
1597
  "lookback" === pe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
1567
1598
  });
1568
- const s2 = we == null ? void 0 : we.querySelectorAll(".sf-collapsible-header");
1569
- s2 == null ? void 0 : s2.forEach((e4) => {
1599
+ const a2 = we == null ? void 0 : we.querySelectorAll(".sf-collapsible-header");
1600
+ a2 == null ? void 0 : a2.forEach((e4) => {
1570
1601
  e4.addEventListener("click", (e5) => {
1571
1602
  const t4 = e5.currentTarget, n3 = t4.dataset.target, i3 = document.getElementById(n3), o3 = t4.querySelector(".sf-chevron");
1572
1603
  if (i3 && o3) {
@@ -1577,21 +1608,21 @@ function injectModalHTML(e2 = "lookback") {
1577
1608
  }
1578
1609
  });
1579
1610
  });
1580
- 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");
1581
- a2 && a2.addEventListener("change", () => {
1582
- const e4 = a2.checked;
1611
+ const s2 = 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");
1612
+ s2 && s2.addEventListener("change", () => {
1613
+ const e4 = s2.checked;
1583
1614
  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"));
1584
1615
  });
1585
1616
  l2 && l2.addEventListener("change", async () => {
1586
1617
  var _a;
1587
1618
  const e4 = l2.checked;
1588
- 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) {
1619
+ if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"), s2 && (s2.checked = true), r2 && (r2.style.display = "block")), c2 && (c2.style.display = e4 ? "block" : "none"), e4) {
1589
1620
  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.");
1590
1621
  const e5 = getIntegrationData();
1591
1622
  if (e5) {
1592
1623
  if (!pe.engTicketTeam && e5.defaultTeam && (pe.engTicketTeam = e5.defaultTeam), !pe.engTicketProject && e5.defaultProject && (pe.engTicketProject = e5.defaultProject), !pe.engTicketPriority && e5.defaultPriority && (pe.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && pe.engTicketProject && !pe.engTicketCustomFields.reporter) {
1593
1624
  if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
1594
- const t5 = getDefaultReporterAccountId();
1625
+ const t5 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1595
1626
  pe.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
1596
1627
  }
1597
1628
  }
@@ -1667,7 +1698,7 @@ function injectModalHTML(e2 = "lookback") {
1667
1698
  i3 = Date.now(), n3 = i3 - e6;
1668
1699
  }
1669
1700
  if (pe.createIssue) {
1670
- 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 };
1701
+ const o3 = document.getElementById("sf-issue-name"), a3 = document.getElementById("sf-eng-ticket-team"), s3 = 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 = (a3 == null ? void 0 : a3.value) || "", p2 = (s3 == null ? void 0 : s3.value) || "", f2 = r3 ? Number(r3.value) : 0, g2 = pe.engTicketLabels, m2 = (l3 == null ? void 0 : l3.value) || "", h2 = { ...pe.engTicketCustomFields };
1671
1702
  document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
1672
1703
  const t5 = e6, n4 = t5.dataset.fieldId;
1673
1704
  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));
@@ -1677,11 +1708,11 @@ function injectModalHTML(e2 = "lookback") {
1677
1708
  const e6 = getSprintFieldId();
1678
1709
  h2[e6] = parseInt(b2, 10);
1679
1710
  }
1680
- closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3, p3) {
1711
+ closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, a4, s4, r4, l4, c4, d4, u3, p3) {
1681
1712
  var _a2, _b, _c;
1682
1713
  try {
1683
1714
  showStatusModal(true);
1684
- const f3 = await createTriageAndIssueFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, s4, a4, r4, l4, c4, d4, u3, p3);
1715
+ const f3 = await createTriageAndIssueFromRecorder(be.apiKey, be.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, a4, s4, r4, l4, c4, d4, u3, p3);
1685
1716
  if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
1686
1717
  const e7 = f3.errors.map((e8) => e8.message).join("; ");
1687
1718
  return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
@@ -1701,8 +1732,8 @@ function injectModalHTML(e2 = "lookback") {
1701
1732
  const e7 = o3.errors.map((e8) => e8.message).join("; ");
1702
1733
  return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
1703
1734
  }
1704
- const s3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
1705
- s3 ? showStatusModal(false, { type: "triage", id: s3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
1735
+ const a3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
1736
+ a3 ? showStatusModal(false, { type: "triage", id: a3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
1706
1737
  } catch (e7) {
1707
1738
  console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
1708
1739
  }
@@ -1729,7 +1760,7 @@ function initializeEngTicketForm() {
1729
1760
  if (e2) {
1730
1761
  if (!pe.engTicketTeam && e2.defaultTeam && (pe.engTicketTeam = e2.defaultTeam), !pe.engTicketProject && e2.defaultProject && (pe.engTicketProject = e2.defaultProject), !pe.engTicketPriority && e2.defaultPriority && (pe.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && pe.engTicketProject && !pe.engTicketCustomFields.reporter) {
1731
1762
  if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
1732
- const t2 = getDefaultReporterAccountId();
1763
+ const t2 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1733
1764
  pe.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
1734
1765
  }
1735
1766
  }
@@ -1742,18 +1773,18 @@ function setActiveTab(e2) {
1742
1773
  "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");
1743
1774
  }
1744
1775
  function updateModeSpecificUI(e2) {
1745
- 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");
1746
- if (t2 && n2 && i2 && o2 && s2 && a2 && r2) if ("startnow" === e2) {
1747
- i2.style.display = "block", r2.style.display = "none", a2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
1776
+ 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"), a2 = document.getElementById("sf-recording-timer-display"), s2 = document.getElementById("sf-modal-footer"), r2 = document.getElementById("sf-lookback-container");
1777
+ if (t2 && n2 && i2 && o2 && a2 && s2 && r2) if ("startnow" === e2) {
1778
+ i2.style.display = "block", r2.style.display = "none", s2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
1748
1779
  const e3 = null !== fe && null !== ge;
1749
1780
  if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", fe && ge) {
1750
1781
  const e4 = Math.floor((ge - fe) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
1751
- o2.style.display = "block", s2.textContent = `${t3}:${n3}`;
1782
+ o2.style.display = "block", a2.textContent = `${t3}:${n3}`;
1752
1783
  } else o2.style.display = "none";
1753
- } 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";
1784
+ } else i2.style.display = "none", o2.style.display = "none", r2.style.display = "block", s2.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";
1754
1785
  }
1755
1786
  function bindEngTicketListeners() {
1756
- 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");
1787
+ 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"), a2 = document.getElementById("sf-eng-ticket-sprint");
1757
1788
  e2 && e2.addEventListener("change", () => {
1758
1789
  pe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
1759
1790
  const t3 = document.getElementById("sf-eng-ticket-project");
@@ -1771,13 +1802,13 @@ function bindEngTicketListeners() {
1771
1802
  const e3 = getIntegrationData();
1772
1803
  if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), pe.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
1773
1804
  if (getFieldsForProject(t2.value, pe.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
1774
- const t3 = getDefaultReporterAccountId();
1805
+ const t3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1775
1806
  pe.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
1776
1807
  }
1777
1808
  }
1778
1809
  renderDynamicFields(t2.value, pe.engTicketIssueType);
1779
- }), s2 && s2.addEventListener("change", () => {
1780
- pe.engTicketSprint = s2.value, s2.style.color = s2.value ? "" : "#9ca3af";
1810
+ }), a2 && a2.addEventListener("change", () => {
1811
+ pe.engTicketSprint = a2.value, a2.style.color = a2.value ? "" : "#9ca3af";
1781
1812
  }), n2 && n2.addEventListener("change", () => {
1782
1813
  pe.engTicketPriority = Number(n2.value);
1783
1814
  }), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
@@ -1790,18 +1821,18 @@ function bindEngTicketListeners() {
1790
1821
  pe.engTicketCustomFields = {}, t3 && (pe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
1791
1822
  }
1792
1823
  });
1793
- const a2 = document.getElementById("sf-dynamic-fields-container");
1794
- a2 && (a2.addEventListener("input", (e3) => {
1824
+ const s2 = document.getElementById("sf-dynamic-fields-container");
1825
+ s2 && (s2.addEventListener("input", (e3) => {
1795
1826
  const t3 = e3.target;
1796
1827
  if (t3.classList.contains("sf-dynamic-field")) {
1797
1828
  const e4 = t3.dataset.fieldId;
1798
1829
  e4 && ("checkbox" === t3.type ? pe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? pe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : pe.engTicketCustomFields[e4] = t3.value);
1799
1830
  }
1800
- }), a2.addEventListener("change", (e3) => {
1831
+ }), s2.addEventListener("change", (e3) => {
1801
1832
  const t3 = e3.target;
1802
1833
  if (t3.classList.contains("sf-dynamic-field")) {
1803
1834
  const e4 = t3.dataset.fieldId;
1804
- if (e4 && (pe.engTicketCustomFields[e4] = t3.value), "SELECT" === t3.tagName) {
1835
+ if (e4 && (pe.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
1805
1836
  const e5 = t3;
1806
1837
  e5.style.color = e5.value ? "" : "#9ca3af";
1807
1838
  }
@@ -1835,10 +1866,10 @@ async function stopRecording() {
1835
1866
  i2 && (i2.value = pe.description);
1836
1867
  const o2 = document.querySelector('input[value="startnow"]');
1837
1868
  o2 && (o2.checked = true);
1838
- const s2 = document.getElementById("sf-inline-record-chip"), a2 = document.getElementById("sf-inline-record-timer");
1839
- if (s2 && a2) {
1869
+ const a2 = document.getElementById("sf-inline-record-chip"), s2 = document.getElementById("sf-inline-record-timer");
1870
+ if (a2 && s2) {
1840
1871
  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");
1841
- a2.textContent = `${t3}:${n3}`, a2.style.color = "black", s2.style.display = "flex";
1872
+ s2.textContent = `${t3}:${n3}`, s2.style.color = "black", a2.style.display = "flex";
1842
1873
  }
1843
1874
  const r2 = document.getElementById("sf-issue-submit-btn");
1844
1875
  r2.disabled = false, r2.style.opacity = "1", r2.style.cursor = "pointer";
@@ -1851,10 +1882,10 @@ function showStatusModal(e2, t2, n2) {
1851
1882
  var _a2, _b;
1852
1883
  (_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
1853
1884
  })();
1854
- const o2 = !e3 && i2, s2 = n3 ? `${be.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${be.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", a2 = document.createElement("div");
1855
- a2.id = "sf-triage-status-modal", Object.assign(a2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
1885
+ const o2 = !e3 && i2, a2 = n3 ? `${be.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${be.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", s2 = document.createElement("div");
1886
+ s2.id = "sf-triage-status-modal", Object.assign(s2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
1856
1887
  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>';
1857
- a2.innerHTML = `
1888
+ s2.innerHTML = `
1858
1889
  <div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
1859
1890
  <div id="sf-triage-card"
1860
1891
  style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
@@ -1895,20 +1926,20 @@ function showStatusModal(e2, t2, n2) {
1895
1926
  <style>
1896
1927
  @keyframes spin { to { transform: rotate(360deg); } }
1897
1928
  </style>
1898
- `, document.body.appendChild(a2);
1899
- const u2 = a2.querySelector("#sf-triage-card");
1929
+ `, document.body.appendChild(s2);
1930
+ const u2 = s2.querySelector("#sf-triage-card");
1900
1931
  (_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
1901
- fadeCardAndRemove(a2, u2, 300);
1932
+ fadeCardAndRemove(s2, u2, 300);
1902
1933
  });
1903
1934
  const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
1904
1935
  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", () => {
1905
- navigator.clipboard.writeText(s2).then(() => {
1936
+ navigator.clipboard.writeText(a2).then(() => {
1906
1937
  const e4 = document.getElementById("sf-copied-status");
1907
1938
  e4 && (e4.style.display = "flex");
1908
1939
  });
1909
1940
  }), f2.disabled = false, f2.addEventListener("click", () => {
1910
- (t3 || n3) && window.open(s2, "_blank");
1911
- }), o2 || setTimeout(() => fadeCardAndRemove(a2, u2, 300), 1e4));
1941
+ (t3 || n3) && window.open(a2, "_blank");
1942
+ }), o2 || setTimeout(() => fadeCardAndRemove(s2, u2, 300), 1e4));
1912
1943
  })(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
1913
1944
  }
1914
1945
  function fadeCardAndRemove(e2, t2, n2 = 300) {
@@ -1931,18 +1962,18 @@ const Se = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
1931
1962
  const n2 = (function isTypingInInput() {
1932
1963
  const e4 = document.activeElement;
1933
1964
  return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
1934
- })(), 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) => {
1965
+ })(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, a2 = !!document.getElementById("sf-report-issue-modal"), s2 = !n2 && (t2.enabled || a2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, r2 = a2 ? (e4) => {
1935
1966
  setActiveTab(e4), updateModeSpecificUI(e4);
1936
1967
  } : injectModalHTML;
1937
- if (a2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void r2("lookback");
1938
- if (a2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void r2("startnow");
1939
- if (s2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
1940
- if (s2 && shortcutUsed("submitReport")) {
1968
+ if (s2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void r2("lookback");
1969
+ if (s2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void r2("startnow");
1970
+ if (a2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
1971
+ if (a2 && shortcutUsed("submitReport")) {
1941
1972
  const t3 = document.getElementById("sf-issue-submit-btn");
1942
1973
  return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
1943
1974
  }
1944
1975
  if (he && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
1945
- if (s2 && "startnow" === pe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
1976
+ if (a2 && "startnow" === pe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
1946
1977
  const t3 = document.getElementById("sf-start-recording-btn");
1947
1978
  return void (t3 && (e3.preventDefault(), t3.click()));
1948
1979
  }
@@ -1959,8 +1990,8 @@ function maskAuthorizationHeader(e2) {
1959
1990
  if (!t2) return;
1960
1991
  const n2 = e2[t2], i2 = n2.indexOf(" ");
1961
1992
  if (-1 !== i2) {
1962
- const o2 = n2.slice(0, i2 + 1), s2 = n2.slice(i2 + 1);
1963
- s2.length > 8 ? e2[t2] = o2 + s2.slice(0, 4) + "*".repeat(s2.length - 8) + s2.slice(-4) : e2[t2] = o2 + "*".repeat(s2.length);
1993
+ const o2 = n2.slice(0, i2 + 1), a2 = n2.slice(i2 + 1);
1994
+ a2.length > 8 ? e2[t2] = o2 + a2.slice(0, 4) + "*".repeat(a2.length - 8) + a2.slice(-4) : e2[t2] = o2 + "*".repeat(a2.length);
1964
1995
  } else n2.length > 8 ? e2[t2] = n2.slice(0, 4) + "*".repeat(n2.length - 8) + n2.slice(-4) : e2[t2] = "*".repeat(n2.length);
1965
1996
  }
1966
1997
  function trackDomainChangesOnce() {
@@ -2026,24 +2057,24 @@ function _ensureModuleSideEffects() {
2026
2057
  }));
2027
2058
  }
2028
2059
  function matchParsedUrlAgainstPatterns(e2, t2) {
2029
- const { hostname: n2, pathname: i2, port: o2 } = e2, s2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
2060
+ const { hostname: n2, pathname: i2, port: o2 } = e2, a2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
2030
2061
  return t2.some((e3) => {
2031
2062
  const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
2032
- let [n3, a2] = t3.split("/", 2), r2 = "";
2063
+ let [n3, s2] = t3.split("/", 2), r2 = "";
2033
2064
  n3.includes(":") && ([n3, r2] = n3.split(":"));
2034
- const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = s2.startsWith("www.") ? s2.slice(4) : s2;
2065
+ const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = a2.startsWith("www.") ? a2.slice(4) : a2;
2035
2066
  if (r2 && "*" !== r2 && o2 !== r2) return false;
2036
2067
  if (n3.startsWith("*.")) {
2037
2068
  const e4 = n3.slice(2).toLowerCase();
2038
- if (!(s2 === e4 || c2 === e4 || s2.endsWith("." + e4))) return false;
2039
- if (a2) {
2040
- return getCachedRegex(`^/${a2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2069
+ if (!(a2 === e4 || c2 === e4 || a2.endsWith("." + e4))) return false;
2070
+ if (s2) {
2071
+ return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2041
2072
  }
2042
2073
  return true;
2043
2074
  }
2044
- if (!l2.test(c2) && !l2.test(s2)) return false;
2045
- if (a2) {
2046
- return getCachedRegex(`^/${a2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2075
+ if (!l2.test(c2) && !l2.test(a2)) return false;
2076
+ if (s2) {
2077
+ return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2047
2078
  }
2048
2079
  return true;
2049
2080
  });
@@ -2068,12 +2099,12 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
2068
2099
  } catch {
2069
2100
  return true;
2070
2101
  }
2071
- const s2 = o2.pathname.toLowerCase(), a2 = s2.lastIndexOf(".");
2072
- return !(-1 === a2 || !Ie.has(s2.slice(a2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
2102
+ const a2 = o2.pathname.toLowerCase(), s2 = a2.lastIndexOf(".");
2103
+ return !(-1 === s2 || !Ie.has(a2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
2073
2104
  };
2074
2105
  }
2075
2106
  function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
2076
- 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"];
2107
+ const o2 = window.fetch, a2 = getOrSetSessionId(), s2 = createSkipHeadersPropagationChecker(e2, i2), r2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], l2 = ["application/octet-stream"];
2077
2108
  window.fetch = new Proxy(o2, { apply: async (e3, i3, o3) => {
2078
2109
  let c2, d2 = o3[0], u2 = o3[1] || {};
2079
2110
  if ("string" == typeof d2) c2 = d2;
@@ -2082,27 +2113,27 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2082
2113
  if (!(d2 instanceof URL)) return e3.apply(i3, o3);
2083
2114
  c2 = d2.href;
2084
2115
  }
2085
- return a2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, s3, a3, c3, d3) {
2116
+ return s2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, a3, s3, c3, d3) {
2086
2117
  var _a, _b;
2087
2118
  if (!c3) return e4.apply(i4, o4);
2088
2119
  let u3 = uuidv4();
2089
- const p2 = getUrlAndStoredUuids(), f2 = a3.method || "GET", g2 = Date.now();
2120
+ const p2 = getUrlAndStoredUuids(), f2 = s3.method || "GET", g2 = Date.now();
2090
2121
  let m2, h2 = {}, y2 = null;
2091
2122
  try {
2092
- if (s3 instanceof Request) {
2093
- s3.headers.forEach((e5, t3) => {
2123
+ if (a3 instanceof Request) {
2124
+ a3.headers.forEach((e5, t3) => {
2094
2125
  h2[t3] = e5;
2095
2126
  });
2096
2127
  try {
2097
- y2 = s3.clone();
2128
+ y2 = a3.clone();
2098
2129
  } catch (e5) {
2099
2130
  y2 = null;
2100
2131
  }
2101
- } else a3.headers && (a3.headers instanceof Headers ? a3.headers.forEach((e5, t3) => {
2132
+ } else s3.headers && (s3.headers instanceof Headers ? s3.headers.forEach((e5, t3) => {
2102
2133
  h2[t3] = e5;
2103
- }) : Array.isArray(a3.headers) ? a3.headers.forEach(([e5, t3]) => {
2134
+ }) : Array.isArray(s3.headers) ? s3.headers.forEach(([e5, t3]) => {
2104
2135
  h2[e5] = t3;
2105
- }) : h2 = { ...a3.headers }), m2 = a3.body;
2136
+ }) : h2 = { ...s3.headers }), m2 = s3.body;
2106
2137
  } catch (e5) {
2107
2138
  ke && console.warn("[Sailfish] Failed to capture request data:", e5);
2108
2139
  }
@@ -2113,32 +2144,32 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2113
2144
  h2[n] = w2, b2 && (h2[b2.name] = b2.value);
2114
2145
  maskAuthorizationHeader(h2);
2115
2146
  try {
2116
- let b3 = await (async function injectHeader(e5, t3, i5, o5, s4, a4, r3) {
2147
+ let b3 = await (async function injectHeader(e5, t3, i5, o5, a4, s4, r3) {
2117
2148
  const l3 = getFuncSpanHeader();
2118
2149
  if (i5 instanceof Request) {
2119
2150
  const c4 = i5.clone(), d4 = new Headers(c4.headers);
2120
- 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 }));
2151
+ d4.set(n, `${a4}/${s4}/${r3}`), l3 && (d4.set(l3.name, l3.value), ke && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
2121
2152
  const u4 = new Request(c4, { headers: d4 });
2122
2153
  return await e5.call(t3, u4, o5);
2123
2154
  }
2124
2155
  {
2125
2156
  const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
2126
- 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);
2157
+ return d4.set(n, `${a4}/${s4}/${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);
2127
2158
  }
2128
- })(e4, i4, s3, a3, c3, p2.page_visit_uuid, u3), w3 = false;
2159
+ })(e4, i4, a3, s3, c3, p2.page_visit_uuid, u3), w3 = false;
2129
2160
  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) {
2130
2161
  try {
2131
- let o6 = i5[0], s4 = i5[1] || {};
2162
+ let o6 = i5[0], a4 = i5[1] || {};
2132
2163
  if ("string" == typeof o6 || o6 instanceof URL) {
2133
- const i6 = { ...s4 }, a4 = new Headers(s4.headers || {});
2134
- a4.delete(n), i6.headers = a4;
2164
+ const i6 = { ...a4 }, s4 = new Headers(a4.headers || {});
2165
+ s4.delete(n), i6.headers = s4;
2135
2166
  return await e5.call(t3, o6, i6);
2136
2167
  }
2137
2168
  if (o6 instanceof Request) {
2138
- const i6 = o6.clone(), a4 = new Headers(i6.headers);
2139
- a4.delete(n);
2140
- const r3 = new Request(i6, { headers: a4 });
2141
- return await e5.call(t3, r3, s4);
2169
+ const i6 = o6.clone(), s4 = new Headers(i6.headers);
2170
+ s4.delete(n);
2171
+ const r3 = new Request(i6, { headers: s4 });
2172
+ return await e5.call(t3, r3, a4);
2142
2173
  }
2143
2174
  return e5.apply(t3, i5);
2144
2175
  } catch (e6) {
@@ -2177,18 +2208,18 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2177
2208
  (async function readStreamPrefix(e5, t3, n2) {
2178
2209
  const i5 = e5.body;
2179
2210
  if (!i5) return null;
2180
- const o5 = i5.getReader(), s4 = new TextDecoder(), a4 = [];
2211
+ const o5 = i5.getReader(), a4 = new TextDecoder(), s4 = [];
2181
2212
  let r3 = 0;
2182
2213
  const readWithLimit = async () => {
2183
2214
  try {
2184
2215
  for (; r3 < t3; ) {
2185
2216
  const { done: e6, value: t4 } = await o5.read();
2186
2217
  if (e6) break;
2187
- r3 += t4.byteLength, a4.push(s4.decode(t4, { stream: true }));
2218
+ r3 += t4.byteLength, s4.push(a4.decode(t4, { stream: true }));
2188
2219
  }
2189
- return a4.push(s4.decode()), a4.join("");
2220
+ return s4.push(a4.decode()), s4.join("");
2190
2221
  } catch {
2191
- return a4.length > 0 ? a4.join("") : null;
2222
+ return s4.length > 0 ? s4.join("") : null;
2192
2223
  } finally {
2193
2224
  try {
2194
2225
  o5.cancel();
@@ -2202,7 +2233,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2202
2233
  o5.cancel();
2203
2234
  } catch {
2204
2235
  }
2205
- e6(a4.length > 0 ? a4.join("") : null);
2236
+ e6(s4.length > 0 ? s4.join("") : null);
2206
2237
  }, n2))]);
2207
2238
  } catch {
2208
2239
  try {
@@ -2229,7 +2260,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2229
2260
  }
2230
2261
  return b3;
2231
2262
  } catch (t3) {
2232
- const n2 = Date.now(), s4 = false, a4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, r3 = t3.message || "Fetch request failed";
2263
+ const n2 = Date.now(), a4 = false, s4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, r3 = t3.message || "Fetch request failed";
2233
2264
  if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ce.toLowerCase()))) return e4.apply(i4, o4);
2234
2265
  let l3 = m2;
2235
2266
  if (y2) try {
@@ -2237,12 +2268,12 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2237
2268
  } catch {
2238
2269
  l3 = null;
2239
2270
  }
2240
- 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;
2271
+ throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code: s4, success: a4, error: r3, method: f2, url: d3, request_headers: h2, request_body: l3, response_body: null }, ...p2 }), t3;
2241
2272
  }
2242
- })(e3, i3, o3, d2, u2, s2, c2);
2273
+ })(e3, i3, o3, d2, u2, a2, c2);
2243
2274
  } });
2244
2275
  }
2245
- 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, capturePerformanceMetrics: v2 = true, maskTextClass: S2, library: k2, headlessRecording: x2 = false }) {
2276
+ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: a2, serviceIdentifier: s2, 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, capturePerformanceMetrics: v2 = true, maskTextClass: S2, library: k2, headlessRecording: x2 = false }) {
2246
2277
  var _a, _b;
2247
2278
  if (!x2 && (function isHeadlessOrLighthouse() {
2248
2279
  try {
@@ -2259,16 +2290,16 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2259
2290
  if (E2.sessionId = T2, E2.apiKey = e2, E2.backendApi = t2, E2.serviceAdditionalMetadata = l2, E2.initialized && E2.sessionId === T2 && E2.ws && 1 === E2.ws.readyState) return void trackDomainChangesOnce();
2260
2291
  const C2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
2261
2292
  sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), E2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
2262
- const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, a3 = XMLHttpRequest.prototype.setRequestHeader, r3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
2293
+ const o3 = XMLHttpRequest.prototype.open, a3 = XMLHttpRequest.prototype.send, s3 = XMLHttpRequest.prototype.setRequestHeader, r3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
2263
2294
  XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
2264
- return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, a3.call(this, e4, t4);
2295
+ return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, s3.call(this, e4, t4);
2265
2296
  }, XMLHttpRequest.prototype.open = function(e4, t4, ...n2) {
2266
2297
  return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n2]);
2267
2298
  }, XMLHttpRequest.prototype.send = function(...e4) {
2268
2299
  const i4 = this._requestUrl;
2269
- if (!i4) return s3.apply(this, e4);
2270
- if (l3(i4)) return s3.apply(this, e4);
2271
- const o4 = sessionStorage.getItem("pageVisitUUID"), a4 = uuidv4(), c3 = `${r3}/${o4}/${a4}`;
2300
+ if (!i4) return a3.apply(this, e4);
2301
+ if (l3(i4)) return a3.apply(this, e4);
2302
+ const o4 = sessionStorage.getItem("pageVisitUUID"), s4 = uuidv4(), c3 = `${r3}/${o4}/${s4}`;
2272
2303
  try {
2273
2304
  this.setRequestHeader(n, c3);
2274
2305
  } catch (e5) {
@@ -2284,11 +2315,11 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2284
2315
  let p3 = false;
2285
2316
  const f3 = e4[0], g2 = { ...this._capturedRequestHeaders };
2286
2317
  maskAuthorizationHeader(g2);
2287
- const emitFinished = (e5, t4, n2, o5, s4) => {
2318
+ const emitFinished = (e5, t4, n2, o5, a4) => {
2288
2319
  if (p3) return;
2289
2320
  p3 = true;
2290
2321
  const l4 = Date.now();
2291
- 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() });
2322
+ sendEvent({ type: 27, timestamp: l4, sessionId: r3, data: { request_id: s4, 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: a4, response_body: o5 }, ...getUrlAndStoredUuids() });
2292
2323
  };
2293
2324
  return this.addEventListener("load", () => {
2294
2325
  const e5 = this.status || 0;
@@ -2321,7 +2352,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2321
2352
  }, { once: true }), this.addEventListener("error", () => {
2322
2353
  const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
2323
2354
  emitFinished(false, e5, t4);
2324
- }, { once: true }), s3.apply(this, e4);
2355
+ }, { once: true }), a3.apply(this, e4);
2325
2356
  };
2326
2357
  })(o2, C2, i2), E2.xhrPatched = true), E2.fetchPatched || (setupFetchInterceptor(o2, C2, i2), E2.fetchPatched = true), await yieldToMain(), E2.domEventsInit || (initializeDomContentEvents(T2), E2.domEventsInit = true), await yieldToMain(), E2.consoleInit || (initializeConsolePlugin(Ae, T2), E2.consoleInit = true), await yieldToMain(), E2.errorInit || (!(function initializeErrorInterceptor() {
2327
2358
  window.addEventListener("error", (e3) => {
@@ -2357,7 +2388,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2357
2388
  if ("string" == typeof e3 && e3) return e3;
2358
2389
  } catch {
2359
2390
  }
2360
- })(), i3 = a2 ?? "", o3 = s2 ?? "", c3 = k2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
2391
+ })(), i3 = s2 ?? "", o3 = a2 ?? "", c3 = k2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
2361
2392
  try {
2362
2393
  const e3 = window;
2363
2394
  if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
@@ -2370,7 +2401,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2370
2401
  } catch {
2371
2402
  }
2372
2403
  const n3 = t3, i4 = [];
2373
- for (const e4 of se) {
2404
+ for (const e4 of ae) {
2374
2405
  const t4 = e4(n3);
2375
2406
  t4 && !i4.includes(t4) && i4.push(t4);
2376
2407
  }
@@ -2385,7 +2416,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2385
2416
  const i4 = await initializeRecording(y3, t2, e2, T2, n3, I2, w2, b2 ?? false);
2386
2417
  E2.ws = i4, E2.initialized = true, trackDomainChangesOnce(), E2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
2387
2418
  window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
2388
- })(a2, s2), E2.sentMapUuidOnce = true);
2419
+ })(s2, a2), E2.sentMapUuidOnce = true);
2389
2420
  } else console.error("Failed to start recording session:", h3.errors || h3);
2390
2421
  } catch (e3) {
2391
2422
  console.error("Error starting recording:", e3);
@@ -2397,14 +2428,14 @@ const initRecorder = async (e2) => {
2397
2428
  return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
2398
2429
  try {
2399
2430
  if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
2400
- 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)]);
2401
- let a2 = null;
2431
+ const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: a2 }] = await Promise.all([Promise.resolve().then(() => Se), Promise.resolve().then(() => ce)]);
2432
+ let s2 = null;
2402
2433
  try {
2403
- await o2(e2.apiKey, n3), a2 = s2();
2434
+ await o2(e2.apiKey, n3), s2 = a2();
2404
2435
  } catch (e3) {
2405
2436
  console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
2406
2437
  }
2407
- i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: a2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
2438
+ i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: s2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
2408
2439
  }
2409
2440
  } catch (e3) {
2410
2441
  console.warn("[Sailfish] Recorder initialization failed:", e3);