@sailfish-ai/recorder 1.12.4 → 1.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +8 -0
  2. package/dist/canvas/adapters.js +382 -0
  3. package/dist/canvas/adapters.js.br +0 -0
  4. package/dist/canvas/adapters.js.gz +0 -0
  5. package/dist/canvas/canvasManager.js +1949 -0
  6. package/dist/canvas/canvasManager.js.br +0 -0
  7. package/dist/canvas/canvasManager.js.gz +0 -0
  8. package/dist/canvas/canvasPrivacy.js +233 -0
  9. package/dist/canvas/canvasPrivacy.js.br +0 -0
  10. package/dist/canvas/canvasPrivacy.js.gz +0 -0
  11. package/dist/canvas/codec.js +314 -0
  12. package/dist/canvas/codec.js.br +0 -0
  13. package/dist/canvas/codec.js.gz +0 -0
  14. package/dist/canvas/deviceClass.js +67 -0
  15. package/dist/canvas/deviceClass.js.br +0 -0
  16. package/dist/canvas/deviceClass.js.gz +0 -0
  17. package/dist/canvas/encodeWorker.js +284 -0
  18. package/dist/canvas/encodeWorker.js.br +0 -0
  19. package/dist/canvas/encodeWorker.js.gz +0 -0
  20. package/dist/canvas/governor.js +79 -0
  21. package/dist/canvas/governor.js.br +0 -0
  22. package/dist/canvas/governor.js.gz +0 -0
  23. package/dist/canvas/keyframes.js +183 -0
  24. package/dist/canvas/keyframes.js.br +0 -0
  25. package/dist/canvas/keyframes.js.gz +0 -0
  26. package/dist/canvas/mediaRecorderCapture.js +257 -0
  27. package/dist/canvas/mediaRecorderCapture.js.br +0 -0
  28. package/dist/canvas/mediaRecorderCapture.js.gz +0 -0
  29. package/dist/canvas/objectLog.js +150 -0
  30. package/dist/canvas/objectLog.js.br +0 -0
  31. package/dist/canvas/objectLog.js.gz +0 -0
  32. package/dist/canvas/patch2d.js +1302 -0
  33. package/dist/canvas/patch2d.js.br +0 -0
  34. package/dist/canvas/patch2d.js.gz +0 -0
  35. package/dist/canvas/patchGL.js +371 -0
  36. package/dist/canvas/patchGL.js.br +0 -0
  37. package/dist/canvas/patchGL.js.gz +0 -0
  38. package/dist/canvas/patchWebGPU.js +361 -0
  39. package/dist/canvas/patchWebGPU.js.br +0 -0
  40. package/dist/canvas/patchWebGPU.js.gz +0 -0
  41. package/dist/canvas/piiDetect.js +155 -0
  42. package/dist/canvas/piiDetect.js.br +0 -0
  43. package/dist/canvas/piiDetect.js.gz +0 -0
  44. package/dist/canvas/protocol.js +122 -0
  45. package/dist/canvas/protocol.js.br +0 -0
  46. package/dist/canvas/protocol.js.gz +0 -0
  47. package/dist/canvas/videoCapture.js +252 -0
  48. package/dist/canvas/videoCapture.js.br +0 -0
  49. package/dist/canvas/videoCapture.js.gz +0 -0
  50. package/dist/canvas/workerRelay.js +99 -0
  51. package/dist/canvas/workerRelay.js.br +0 -0
  52. package/dist/canvas/workerRelay.js.gz +0 -0
  53. package/dist/canvas/workerShim.js +227 -0
  54. package/dist/canvas/workerShim.js.br +0 -0
  55. package/dist/canvas/workerShim.js.gz +0 -0
  56. package/dist/canvas-worker.cjs +74 -0
  57. package/dist/canvas-worker.cjs.br +0 -0
  58. package/dist/canvas-worker.cjs.gz +0 -0
  59. package/dist/canvas-worker.js +78 -0
  60. package/dist/canvas-worker.js.br +0 -0
  61. package/dist/canvas-worker.js.gz +0 -0
  62. package/dist/canvasFrameStore.js +198 -0
  63. package/dist/canvasFrameStore.js.br +0 -0
  64. package/dist/canvasFrameStore.js.gz +0 -0
  65. package/dist/chunks/canvasManager-BYn3_oyo.js +1440 -0
  66. package/dist/chunks/canvasManager-BYn3_oyo.js.br +0 -0
  67. package/dist/chunks/canvasManager-BYn3_oyo.js.gz +0 -0
  68. package/dist/chunks/canvasManager-CoX5072G.js +1456 -0
  69. package/dist/chunks/canvasManager-CoX5072G.js.br +0 -0
  70. package/dist/chunks/canvasManager-CoX5072G.js.gz +0 -0
  71. package/dist/chunks/{chunkSerializer-FQtY90Av.js → chunkSerializer-C_K0Wyk0.js} +1 -1
  72. package/dist/chunks/chunkSerializer-C_K0Wyk0.js.br +0 -0
  73. package/dist/chunks/chunkSerializer-C_K0Wyk0.js.gz +0 -0
  74. package/dist/chunks/{chunkSerializer-DDukZpgl.js → chunkSerializer-CghPitF4.js} +1 -1
  75. package/dist/chunks/chunkSerializer-CghPitF4.js.br +0 -0
  76. package/dist/chunks/chunkSerializer-CghPitF4.js.gz +0 -0
  77. package/dist/chunks/{index-C-qbsfKe.js → index-BIj4l3CV.js} +1028 -650
  78. package/dist/chunks/index-BIj4l3CV.js.br +0 -0
  79. package/dist/chunks/index-BIj4l3CV.js.gz +0 -0
  80. package/dist/chunks/{index-D6axlCRu.js → index-DIYomvdD.js} +1119 -720
  81. package/dist/chunks/index-DIYomvdD.js.br +0 -0
  82. package/dist/chunks/index-DIYomvdD.js.gz +0 -0
  83. package/dist/chunks/patch2d-9voowhJ_.js +816 -0
  84. package/dist/chunks/patch2d-9voowhJ_.js.br +0 -0
  85. package/dist/chunks/patch2d-9voowhJ_.js.gz +0 -0
  86. package/dist/chunks/patch2d-PQxcaE6r.js +886 -0
  87. package/dist/chunks/patch2d-PQxcaE6r.js.br +0 -0
  88. package/dist/chunks/patch2d-PQxcaE6r.js.gz +0 -0
  89. package/dist/graphql.js +12 -1
  90. package/dist/graphql.js.br +0 -0
  91. package/dist/graphql.js.gz +0 -0
  92. package/dist/inAppReportIssueModal/index.js +48 -0
  93. package/dist/inAppReportIssueModal/index.js.br +0 -0
  94. package/dist/inAppReportIssueModal/index.js.gz +0 -0
  95. package/dist/index.js +144 -2
  96. package/dist/index.js.br +0 -0
  97. package/dist/index.js.gz +0 -0
  98. package/dist/recorder.cjs +2 -2
  99. package/dist/recorder.cjs.br +0 -0
  100. package/dist/recorder.cjs.gz +0 -0
  101. package/dist/recorder.js +52 -41
  102. package/dist/recorder.js.br +0 -0
  103. package/dist/recorder.js.gz +0 -0
  104. package/dist/recorder.umd.cjs +4847 -2212
  105. package/dist/recorder.umd.cjs.br +0 -0
  106. package/dist/recorder.umd.cjs.gz +0 -0
  107. package/dist/recording.js +119 -10
  108. package/dist/recording.js.br +0 -0
  109. package/dist/recording.js.gz +0 -0
  110. package/dist/types/canvas/adapters.d.ts +71 -0
  111. package/dist/types/canvas/canvasManager.d.ts +273 -0
  112. package/dist/types/canvas/canvasPrivacy.d.ts +184 -0
  113. package/dist/types/canvas/codec.d.ts +27 -0
  114. package/dist/types/canvas/deviceClass.d.ts +40 -0
  115. package/dist/types/canvas/encodeWorker.d.ts +54 -0
  116. package/dist/types/canvas/governor.d.ts +44 -0
  117. package/dist/types/canvas/keyframes.d.ts +81 -0
  118. package/dist/types/canvas/mediaRecorderCapture.d.ts +91 -0
  119. package/dist/types/canvas/objectLog.d.ts +75 -0
  120. package/dist/types/canvas/patch2d.d.ts +339 -0
  121. package/dist/types/canvas/patchGL.d.ts +74 -0
  122. package/dist/types/canvas/patchWebGPU.d.ts +37 -0
  123. package/dist/types/canvas/piiDetect.d.ts +60 -0
  124. package/dist/types/canvas/protocol.d.ts +176 -0
  125. package/dist/types/canvas/videoCapture.d.ts +67 -0
  126. package/dist/types/canvas/workerRelay.d.ts +29 -0
  127. package/dist/types/canvas/workerShim.d.ts +10 -0
  128. package/dist/types/canvasFrameStore.d.ts +23 -0
  129. package/dist/types/graphql.d.ts +1 -1
  130. package/dist/types/index.d.ts +99 -1
  131. package/dist/types/types.d.ts +40 -0
  132. package/dist/types/websocket.d.ts +19 -0
  133. package/dist/websocket.js +210 -0
  134. package/dist/websocket.js.br +0 -0
  135. package/dist/websocket.js.gz +0 -0
  136. package/package.json +7 -1
  137. package/dist/chunks/chunkSerializer-DDukZpgl.js.br +0 -0
  138. package/dist/chunks/chunkSerializer-DDukZpgl.js.gz +0 -0
  139. package/dist/chunks/chunkSerializer-FQtY90Av.js.br +0 -0
  140. package/dist/chunks/chunkSerializer-FQtY90Av.js.gz +0 -0
  141. package/dist/chunks/index-C-qbsfKe.js.br +0 -0
  142. package/dist/chunks/index-C-qbsfKe.js.gz +0 -0
  143. package/dist/chunks/index-D6axlCRu.js.br +0 -0
  144. package/dist/chunks/index-D6axlCRu.js.gz +0 -0
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  mod
24
24
  ));
25
25
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
- const e = require("reconnecting-websocket"), t = require("@sailfish-rrweb/types");
26
+ const e = require("reconnecting-websocket"), t = require("@sailfish-rrweb/types"), n = require("./patch2d-9voowhJ_.js");
27
27
  function readDebugFlag() {
28
28
  var _a;
29
29
  try {
@@ -59,12 +59,12 @@ function uuidv4() {
59
59
  return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
60
60
  });
61
61
  }
62
- const n = "X-Sf3-Rid", i = 0, o = 1, s = 2, r = 4, a = "undefined" != typeof performance && "function" == typeof performance.now;
62
+ const i = "X-Sf3-Rid", o = 0, r = 1, s = 2, a = 4, c = "undefined" != typeof performance && "function" == typeof performance.now;
63
63
  function monotonicNow() {
64
- return a ? performance.now() : Date.now();
64
+ return c ? performance.now() : Date.now();
65
65
  }
66
66
  function timeOriginMs() {
67
- return a ? performance.timeOrigin : 0;
67
+ return c ? performance.timeOrigin : 0;
68
68
  }
69
69
  class ClockSyncManager {
70
70
  constructor() {
@@ -87,8 +87,8 @@ class ClockSyncManager {
87
87
  this.pending.delete(e2.requestId);
88
88
  const n2 = monotonicNow(), i2 = n2 - t2.clientSendMonoMs;
89
89
  if (i2 < 0 || !isFinite(i2)) return null;
90
- const o2 = (t2.clientSendMonoMs + n2) / 2, s2 = (e2.serverReceivedAtMs + e2.serverSentAtMs) / 2 - o2, r2 = { clientSendMonoMs: t2.clientSendMonoMs, clientReceiveMonoMs: n2, serverReceiveWallMs: e2.serverReceivedAtMs, serverSendWallMs: e2.serverSentAtMs, rttMs: i2, estimatedOffsetMs: s2, browserWallAtSyncMs: Date.now() };
91
- return this.samples.push(r2), this.pruneSamples(n2), this.recompute(n2), r2;
90
+ const o2 = (t2.clientSendMonoMs + n2) / 2, r2 = (e2.serverReceivedAtMs + e2.serverSentAtMs) / 2 - o2, s2 = { clientSendMonoMs: t2.clientSendMonoMs, clientReceiveMonoMs: n2, serverReceiveWallMs: e2.serverReceivedAtMs, serverSendWallMs: e2.serverSentAtMs, rttMs: i2, estimatedOffsetMs: r2, browserWallAtSyncMs: Date.now() };
91
+ return this.samples.push(s2), this.pruneSamples(n2), this.recompute(n2), s2;
92
92
  }
93
93
  estimateServerTime(e2) {
94
94
  return null == this.estimatedOffsetMs ? null : this.estimatedOffsetMs + e2;
@@ -125,30 +125,64 @@ function buildEventTimeEnvelope(e2, t2) {
125
125
  const n2 = getClockSyncManager(), i2 = n2.getSyncMetadata(), o2 = n2.estimateServerTime(e2);
126
126
  return { client: { wallTimeMs: t2, monotonicMs: e2, timeOriginMs: timeOriginMs() }, serverEstimated: { eventTimeMs: o2, offsetMs: i2.offsetMs, rttMs: i2.rttMs, syncAgeMs: i2.syncAgeMs } };
127
127
  }
128
- const c = "recordingEvents";
129
- let d = null;
130
- function openDb$1() {
131
- return (function hasIndexedDB$1() {
128
+ const d = "recordingEvents";
129
+ let u = null;
130
+ function openDb$2() {
131
+ return (function hasIndexedDB$2() {
132
132
  return "undefined" != typeof globalThis && !!globalThis.indexedDB;
133
- })() ? d || (d = new Promise((e2) => {
133
+ })() ? u || (u = new Promise((e2) => {
134
134
  try {
135
135
  const t2 = globalThis.indexedDB.open("leapsEventDB", 1);
136
136
  t2.onupgradeneeded = () => {
137
137
  const e3 = t2.result;
138
- e3.objectStoreNames.contains(c) || e3.createObjectStore(c, { keyPath: "id", autoIncrement: true });
138
+ e3.objectStoreNames.contains(d) || e3.createObjectStore(d, { keyPath: "id", autoIncrement: true });
139
139
  }, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => {
140
140
  e2(null);
141
141
  };
142
142
  } catch {
143
143
  e2(null);
144
144
  }
145
- }), d) : Promise.resolve(null);
145
+ }), u) : Promise.resolve(null);
146
+ }
147
+ function withStore$2(e2, t2) {
148
+ return openDb$2().then((n2) => n2 ? new Promise((i2) => {
149
+ try {
150
+ const o2 = n2.transaction(d, e2), r2 = o2.objectStore(d);
151
+ Promise.resolve(t2(r2)).then((e3) => {
152
+ o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
153
+ }).catch(() => i2(null));
154
+ } catch {
155
+ i2(null);
156
+ }
157
+ }) : null);
158
+ }
159
+ async function deleteEventsByIds(e2) {
160
+ await withStore$2("readwrite", async (t2) => {
161
+ for (const n2 of e2) t2.delete(n2);
162
+ });
163
+ }
164
+ const p = "canvasFrames", f = 67108864;
165
+ let g = null;
166
+ function openDb$1() {
167
+ return (function hasIndexedDB$1() {
168
+ return "undefined" != typeof globalThis && !!globalThis.indexedDB;
169
+ })() ? g || (g = new Promise((e2) => {
170
+ try {
171
+ const t2 = globalThis.indexedDB.open("leapsCanvasFrameDB", 1);
172
+ t2.onupgradeneeded = () => {
173
+ const e3 = t2.result;
174
+ e3.objectStoreNames.contains(p) || e3.createObjectStore(p, { keyPath: "id", autoIncrement: true });
175
+ }, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
176
+ } catch {
177
+ e2(null);
178
+ }
179
+ }), g) : Promise.resolve(null);
146
180
  }
147
181
  function withStore$1(e2, t2) {
148
182
  return openDb$1().then((n2) => n2 ? new Promise((i2) => {
149
183
  try {
150
- const o2 = n2.transaction(c, e2), s2 = o2.objectStore(c);
151
- Promise.resolve(t2(s2)).then((e3) => {
184
+ const o2 = n2.transaction(p, e2), r2 = o2.objectStore(p);
185
+ Promise.resolve(t2(r2)).then((e3) => {
152
186
  o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
153
187
  }).catch(() => i2(null));
154
188
  } catch {
@@ -156,34 +190,58 @@ function withStore$1(e2, t2) {
156
190
  }
157
191
  }) : null);
158
192
  }
159
- async function deleteEventsByIds(e2) {
160
- await withStore$1("readwrite", async (t2) => {
193
+ async function persistCanvasFrame(e2) {
194
+ const t2 = await withStore$1("readwrite", (t3) => (t3.add({ timestamp: Date.now(), bytes: e2.byteLength, buf: e2 }), true));
195
+ return t2 && (async function pruneToBudget() {
196
+ await withStore$1("readwrite", (e3) => new Promise((t3) => {
197
+ let n2 = 0;
198
+ const i2 = [], o2 = e3.openCursor();
199
+ o2.onsuccess = () => {
200
+ const r2 = o2.result;
201
+ if (r2) {
202
+ const e4 = r2.value, t4 = "number" == typeof (e4 == null ? void 0 : e4.bytes) ? e4.bytes : 0;
203
+ return n2 += t4, "number" == typeof (e4 == null ? void 0 : e4.id) && i2.push({ id: e4.id, bytes: t4 }), void r2.continue();
204
+ }
205
+ let s2 = n2 - f;
206
+ if (s2 <= 0) return t3();
207
+ for (const t4 of i2) {
208
+ if (s2 <= 0) break;
209
+ e3.delete(t4.id), s2 -= t4.bytes;
210
+ }
211
+ t3();
212
+ }, o2.onerror = () => t3();
213
+ }));
214
+ })().catch(() => {
215
+ }), true === t2;
216
+ }
217
+ async function deleteCanvasFramesByIds(e2) {
218
+ 0 !== e2.length && await withStore$1("readwrite", (t2) => {
161
219
  for (const n2 of e2) t2.delete(n2);
162
220
  });
163
221
  }
164
- const u = "notifyMessages";
165
- let p = null;
222
+ const m = "notifyMessages";
223
+ let h = null;
166
224
  function openDb() {
167
225
  return (function hasIndexedDB() {
168
226
  return "undefined" != typeof globalThis && !!globalThis.indexedDB;
169
- })() ? p || (p = new Promise((e2) => {
227
+ })() ? h || (h = new Promise((e2) => {
170
228
  try {
171
229
  const t2 = globalThis.indexedDB.open("leapsNotifyDB", 1);
172
230
  t2.onupgradeneeded = () => {
173
231
  const e3 = t2.result;
174
- e3.objectStoreNames.contains(u) || e3.createObjectStore(u, { keyPath: "id", autoIncrement: true });
232
+ e3.objectStoreNames.contains(m) || e3.createObjectStore(m, { keyPath: "id", autoIncrement: true });
175
233
  }, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
176
234
  } catch {
177
235
  e2(null);
178
236
  }
179
- }), p) : Promise.resolve(null);
237
+ }), h) : Promise.resolve(null);
180
238
  }
181
239
  async function withStore(e2, t2) {
182
240
  const n2 = await openDb();
183
241
  return n2 ? new Promise((i2) => {
184
242
  try {
185
- const o2 = n2.transaction(u, e2), s2 = o2.objectStore(u);
186
- Promise.resolve(t2(s2)).then((e3) => {
243
+ const o2 = n2.transaction(m, e2), r2 = o2.objectStore(m);
244
+ Promise.resolve(t2(r2)).then((e3) => {
187
245
  o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
188
246
  }).catch(() => i2(null));
189
247
  } catch {
@@ -201,25 +259,25 @@ async function deleteNotifyMessageById(e2) {
201
259
  t2.delete(e2);
202
260
  });
203
261
  }
204
- const f = "undefined" != typeof globalThis && void 0 !== globalThis.window, g = "undefined" != typeof globalThis && void 0 !== globalThis.document, m = "undefined" != typeof globalThis && "localStorage" in globalThis, h = "undefined" != typeof globalThis && "sessionStorage" in globalThis, y = "sailfishSessionId", S = "__sailfish_refresh__";
205
- let b = null;
262
+ const y = "undefined" != typeof globalThis && void 0 !== globalThis.window, S = "undefined" != typeof globalThis && void 0 !== globalThis.document, b = "undefined" != typeof globalThis && "localStorage" in globalThis, v = "undefined" != typeof globalThis && "sessionStorage" in globalThis, w = "sailfishSessionId", k = "__sailfish_refresh__";
263
+ let x = null;
206
264
  function getOrSetSessionId() {
207
- if (!f) return uuidv4();
208
- if (b) return b;
209
- const e2 = window.name.startsWith(S);
265
+ if (!y) return uuidv4();
266
+ if (x) return x;
267
+ const e2 = window.name.startsWith(k);
210
268
  if (e2 && (window.name = window.name.substring(20)), e2) {
211
- const e3 = window.sessionStorage.getItem(y);
212
- if (e3) return b = e3, e3;
269
+ const e3 = window.sessionStorage.getItem(w);
270
+ if (e3) return x = e3, e3;
213
271
  }
214
272
  const t2 = uuidv4();
215
- b = t2;
273
+ x = t2;
216
274
  try {
217
- window.sessionStorage.setItem(y, t2);
275
+ window.sessionStorage.setItem(w, t2);
218
276
  } catch (e3) {
219
277
  }
220
278
  return t2;
221
279
  }
222
- let v = false;
280
+ let T = false;
223
281
  function buildBatches(e2, t2, n2) {
224
282
  const i2 = {};
225
283
  for (const t3 of e2) {
@@ -228,13 +286,13 @@ function buildBatches(e2, t2, n2) {
228
286
  }
229
287
  const o2 = [];
230
288
  for (const e3 in i2) {
231
- const s2 = i2[e3];
232
- let r2 = [], a2 = 0;
233
- for (const e4 of s2) {
289
+ const r2 = i2[e3];
290
+ let s2 = [], a2 = 0;
291
+ for (const e4 of r2) {
234
292
  const i3 = t2(e4);
235
- a2 + i3 > n2 && (r2.length > 0 && (o2.push(r2), r2 = [], a2 = 0), i3 > n2) || (r2.push(e4), a2 += i3);
293
+ a2 + i3 > n2 && (s2.length > 0 && (o2.push(s2), s2 = [], a2 = 0), i3 > n2) || (s2.push(e4), a2 += i3);
236
294
  }
237
- r2.length > 0 && o2.push(r2);
295
+ s2.length > 0 && o2.push(s2);
238
296
  }
239
297
  return o2;
240
298
  }
@@ -246,13 +304,88 @@ function withAppUrlMetadata(e2) {
246
304
  return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
247
305
  }
248
306
  exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
249
- const w = readDebugFlag(), k = "per_session";
250
- let x = null, I = null, T = false, E = null, C = null;
251
- let M = null, $ = 0;
307
+ const I = readDebugFlag(), E = "per_session";
308
+ let C = null, M = null, $ = null, A = null, F = 0, L = false, R = null, D = null;
309
+ const P = [];
310
+ let B = 0, _ = 0, O = false;
311
+ function pushBinaryRing(e2) {
312
+ for (P.push(e2), B += e2.byteLength; B > 8388608 && P.length > 0; ) {
313
+ const e3 = P.shift();
314
+ B -= e3.byteLength, _++;
315
+ }
316
+ }
317
+ async function flushPersistedBinary() {
318
+ if (!isWebSocketOpen(M)) return;
319
+ const e2 = await (async function readAllCanvasFrames() {
320
+ const e3 = await withStore$1("readonly", (e4) => new Promise((t4) => {
321
+ const n3 = e4.getAll();
322
+ n3.onsuccess = () => t4(n3.result), n3.onerror = () => t4([]);
323
+ })) ?? [], t3 = Date.now(), n2 = [], i2 = [];
324
+ 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);
325
+ return i2.length > 0 && deleteCanvasFramesByIds(i2).catch(() => {
326
+ }), n2.sort((e4, t4) => (e4.id ?? 0) - (t4.id ?? 0)), n2;
327
+ })();
328
+ if (0 === e2.length) return;
329
+ const t2 = [];
330
+ for (const n2 of e2) {
331
+ if (!isWebSocketOpen(M)) break;
332
+ if (!_wsSendBinaryNow(n2.buf)) break;
333
+ "number" == typeof n2.id && t2.push(n2.id);
334
+ }
335
+ t2.length > 0 && deleteCanvasFramesByIds(t2).catch(() => {
336
+ });
337
+ }
338
+ async function flushBinaryBacklog() {
339
+ !(function flushBinaryRing() {
340
+ for (; P.length > 0 && isWebSocketOpen(M); ) {
341
+ const e2 = P.shift();
342
+ if (B -= e2.byteLength, !_wsSendBinaryNow(e2)) {
343
+ P.unshift(e2), B += e2.byteLength;
344
+ break;
345
+ }
346
+ }
347
+ })(), await flushPersistedBinary();
348
+ }
349
+ function getBinaryDropCount() {
350
+ return _;
351
+ }
352
+ function getBufferedAmount() {
353
+ if (C) return F;
354
+ if (A && isWebSocketOpen(M)) try {
355
+ return A();
356
+ } catch {
357
+ return 0;
358
+ }
359
+ return 0;
360
+ }
361
+ function isTransportSaturated() {
362
+ return getBufferedAmount() > 16777216;
363
+ }
364
+ function bufferBinaryOffline(e2) {
365
+ O = true, persistCanvasFrame(e2).then((t2) => {
366
+ t2 || pushBinaryRing(e2);
367
+ }).catch(() => pushBinaryRing(e2));
368
+ }
369
+ function _wsSendBinaryNow(e2) {
370
+ if (C) try {
371
+ return C.postMessage({ type: "sendBinary", payload: e2 }, [e2]), true;
372
+ } catch {
373
+ return false;
374
+ }
375
+ try {
376
+ return $ ? ($(e2), true) : (M.send(e2), true);
377
+ } catch {
378
+ return false;
379
+ }
380
+ }
381
+ function wsSendBinary(e2) {
382
+ return L || !isWebSocketOpen(M) ? (bufferBinaryOffline(e2), false) : !!_wsSendBinaryNow(e2) || (bufferBinaryOffline(e2), false);
383
+ }
384
+ let j = null, U = 0;
252
385
  function requestTimeSync() {
253
- if (!isWebSocketOpen(I)) return;
386
+ if (!isWebSocketOpen(M)) return;
254
387
  const e2 = getClockSyncManager(), t2 = (function makeTimeSyncRequestId() {
255
- return $ += 1, `ts-${$}-${Math.random().toString(36).slice(2, 10)}`;
388
+ return U += 1, `ts-${U}-${Math.random().toString(36).slice(2, 10)}`;
256
389
  })();
257
390
  e2.beginSync(t2);
258
391
  wsSendPayload({ type: "time-sync-request", requestId: t2, clientSentAtMs: Date.now() }) || e2.abandonSync(t2);
@@ -267,21 +400,21 @@ function enrichEventWithTimeSync(e2) {
267
400
  const t2 = buildEventTimeEnvelope(monotonicNow(), Date.now());
268
401
  e2.client = t2.client, e2.serverEstimated = t2.serverEstimated;
269
402
  }
270
- let F = "", A = "", L = false;
271
- const R = [];
403
+ let N = "", q = "", z = false;
404
+ const H = [];
272
405
  function onNavigationChange(e2) {
273
- R.push(e2);
406
+ H.push(e2);
274
407
  }
275
408
  function _updateHrefCache() {
276
- F = window.location.href, A = window.location.origin + window.location.pathname;
277
- for (const e2 of R) try {
409
+ N = window.location.href, q = window.location.origin + window.location.pathname;
410
+ for (const e2 of H) try {
278
411
  e2();
279
412
  } catch (e3) {
280
413
  }
281
414
  }
282
415
  function ensureHrefCache() {
283
- if (L || "undefined" == typeof window) return;
284
- L = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
416
+ if (z || "undefined" == typeof window) return;
417
+ z = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
285
418
  const e2 = history.pushState;
286
419
  history.pushState = function(...t3) {
287
420
  e2.apply(this, t3), _updateHrefCache();
@@ -292,48 +425,48 @@ function ensureHrefCache() {
292
425
  };
293
426
  }
294
427
  function getCachedHref() {
295
- return F || ("undefined" != typeof window ? window.location.href : "");
428
+ return N || ("undefined" != typeof window ? window.location.href : "");
296
429
  }
297
430
  function getCachedHrefNoQuery() {
298
- return A || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
431
+ return q || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
299
432
  }
300
- const D = [];
301
- let P = null;
433
+ const W = [];
434
+ let K = null;
302
435
  function queueEventForIDB(e2) {
303
- D.push(e2), D.length >= 50 ? _flushIDBQueue() : P || (P = setTimeout(_flushIDBQueue, 100));
436
+ W.push(e2), W.length >= 50 ? _flushIDBQueue() : K || (K = setTimeout(_flushIDBQueue, 100));
304
437
  }
305
438
  function _flushIDBQueue() {
306
- if (P && (clearTimeout(P), P = null), 0 === D.length) return;
439
+ if (K && (clearTimeout(K), K = null), 0 === W.length) return;
307
440
  !(async function saveEventsToIDB(e2) {
308
- await withStore$1("readwrite", async (t2) => {
441
+ await withStore$2("readwrite", async (t2) => {
309
442
  for (const n2 of e2) t2.add({ timestamp: Date.now(), data: n2 });
310
443
  });
311
- })(D.splice(0));
444
+ })(W.splice(0));
312
445
  }
313
- let _ = false, O = null, B = null, j = false;
314
- const U = "sailfish_funcspan_global_state";
446
+ let G = false, V = null, Q = null, X = false;
447
+ const J = "sailfish_funcspan_global_state";
315
448
  function wsSendPayload(e2) {
316
- if (!isWebSocketOpen(I)) return false;
317
- if (x) try {
318
- return x.postMessage({ type: "send", payload: e2 }), true;
449
+ if (!isWebSocketOpen(M)) return false;
450
+ if (C) try {
451
+ return C.postMessage({ type: "send", payload: e2 }), true;
319
452
  } catch {
320
453
  return false;
321
454
  }
322
455
  try {
323
- return I.send(JSON.stringify(e2)), true;
456
+ return M.send(JSON.stringify(e2)), true;
324
457
  } catch {
325
458
  return false;
326
459
  }
327
460
  }
328
461
  function wsSendRaw(e2) {
329
- if (!isWebSocketOpen(I)) return false;
330
- if (x) try {
331
- return x.postMessage({ type: "sendRaw", payload: e2 }), true;
462
+ if (!isWebSocketOpen(M)) return false;
463
+ if (C) try {
464
+ return C.postMessage({ type: "sendRaw", payload: e2 }), true;
332
465
  } catch {
333
466
  return false;
334
467
  }
335
468
  try {
336
- return I.send(e2), true;
469
+ return M.send(e2), true;
337
470
  } catch {
338
471
  return false;
339
472
  }
@@ -342,40 +475,40 @@ function saveGlobalFuncSpanState(e2, t2) {
342
475
  try {
343
476
  if ("undefined" == typeof localStorage) return;
344
477
  const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
345
- localStorage.setItem(U, JSON.stringify(n2)), w && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
478
+ localStorage.setItem(J, JSON.stringify(n2)), I && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
346
479
  } catch (e3) {
347
- w && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
480
+ I && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
348
481
  }
349
482
  }
350
483
  function clearGlobalFuncSpanState() {
351
484
  try {
352
485
  if ("undefined" == typeof localStorage) return;
353
- localStorage.removeItem(U), w && console.log("[Sailfish] Cleared funcSpan state from localStorage");
486
+ localStorage.removeItem(J), I && console.log("[Sailfish] Cleared funcSpan state from localStorage");
354
487
  } catch (e2) {
355
- w && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
488
+ I && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
356
489
  }
357
490
  }
358
491
  function clearStaleFuncSpanState() {
359
- _ = false, B = null, j = false, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
492
+ G = false, Q = null, X = false, clearGlobalFuncSpanState(), I && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
360
493
  }
361
- let N = false;
494
+ let Y = false;
362
495
  function restoreFuncSpanState() {
363
- if (N) return;
364
- N = true;
496
+ if (Y) return;
497
+ Y = true;
365
498
  const e2 = (function loadGlobalFuncSpanState() {
366
499
  try {
367
500
  if ("undefined" == typeof localStorage) return null;
368
- const e3 = localStorage.getItem(U);
501
+ const e3 = localStorage.getItem(J);
369
502
  if (!e3) return null;
370
503
  const t2 = JSON.parse(e3);
371
- return w && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
504
+ return I && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
372
505
  } catch (e3) {
373
- return w && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
506
+ return I && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
374
507
  }
375
508
  })();
376
- if (e2 && e2.enabled) if (_ = true, B = e2.expirationTimestampMs, j = false, w && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: B }), null !== B) {
377
- Date.now() >= B ? (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : w && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
378
- } else w && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
509
+ if (e2 && e2.enabled) if (G = true, Q = e2.expirationTimestampMs, X = false, I && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: Q }), null !== Q) {
510
+ Date.now() >= Q ? (G = false, Q = null, clearGlobalFuncSpanState(), I && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : I && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
511
+ } else I && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
379
512
  }
380
513
  function isWebSocketOpen(e2) {
381
514
  return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
@@ -387,7 +520,7 @@ async function flushNotifyQueue() {
387
520
  n2.onsuccess = () => t2(n2.result), n2.onerror = () => t2([]);
388
521
  })) ?? [];
389
522
  })();
390
- if (isWebSocketOpen(I)) try {
523
+ if (isWebSocketOpen(M)) try {
391
524
  for (const t2 of e2) {
392
525
  if (!wsSendRaw(t2.value)) break;
393
526
  await deleteNotifyMessageById(t2.id);
@@ -396,12 +529,12 @@ async function flushNotifyQueue() {
396
529
  }
397
530
  }
398
531
  async function flushBufferedEvents() {
399
- if (isWebSocketOpen(I)) if (E) await E;
532
+ if (isWebSocketOpen(M)) if (R) await R;
400
533
  else {
401
- E = (async () => {
534
+ R = (async () => {
402
535
  var _a, _b;
403
536
  const e2 = await (async function getAllIndexedEvents() {
404
- const e3 = await withStore$1("readonly", (e4) => new Promise((t4) => {
537
+ const e3 = await withStore$2("readonly", (e4) => new Promise((t4) => {
405
538
  const n3 = e4.getAll();
406
539
  n3.onsuccess = () => t4(n3.result), n3.onerror = () => t4([]);
407
540
  })) ?? [], t3 = Date.now(), n2 = [], i2 = [];
@@ -416,7 +549,7 @@ async function flushBufferedEvents() {
416
549
  for (const e3 of Object.values(t2)) {
417
550
  const t3 = buildBatches(e3, (e4) => eventSize(e4.data), 52428800);
418
551
  for (const e4 of t3) {
419
- if (!isWebSocketOpen(I)) break;
552
+ if (!isWebSocketOpen(M)) break;
420
553
  const t4 = e4.map((e5) => (e5.data.appUrl || (e5.data.appUrl = getCachedHref()), enrichEventWithTimeSync(e5.data), e5.data)), n2 = e4.map((e5) => e5.id).filter((e5) => null != e5);
421
554
  try {
422
555
  wsSendPayload({ type: "events", events: t4, mapUuid: window.sfMapUuid }) && await deleteEventsByIds(n2);
@@ -426,170 +559,172 @@ async function flushBufferedEvents() {
426
559
  }
427
560
  })();
428
561
  try {
429
- await E;
562
+ await R;
430
563
  } finally {
431
- E = null;
564
+ R = null;
432
565
  }
433
566
  }
434
567
  }
435
568
  function sendEvent(e2) {
436
- e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), !T && isWebSocketOpen(I) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
569
+ e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), !L && isWebSocketOpen(M) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
437
570
  }
438
571
  function handleWsOpen() {
439
- w && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (_ ? "ENABLED" : "DISABLED"))), (async () => {
572
+ I && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (G ? "ENABLED" : "DISABLED"))), (async () => {
440
573
  try {
441
- T = true, await flushNotifyQueue(), await flushBufferedEvents();
574
+ L = true, await flushNotifyQueue(), await flushBufferedEvents();
442
575
  } finally {
443
- T = false;
576
+ L = false;
444
577
  }
445
- null != C && clearInterval(C), C = window.setInterval(() => {
446
- flushBufferedEvents();
578
+ await flushBinaryBacklog(), null != D && clearInterval(D), D = window.setInterval(() => {
579
+ flushBufferedEvents(), O && flushBinaryBacklog();
447
580
  }, 2e3);
448
581
  })(), (function kickoffTimeSyncBurst() {
449
582
  if ("undefined" != typeof window) for (let e2 = 0; e2 < 3; e2++) window.setTimeout(requestTimeSync, 250 * e2);
450
583
  })(), (function startTimeSyncInterval() {
451
- null == M && "undefined" != typeof window && (M = window.setInterval(() => {
584
+ null == j && "undefined" != typeof window && (j = window.setInterval(() => {
452
585
  requestTimeSync();
453
586
  }, 6e4));
454
587
  })();
455
588
  }
456
589
  function handleWsClose() {
457
- null != C && (clearInterval(C), C = null), (function stopTimeSyncInterval() {
458
- null != M && "undefined" != typeof window && (window.clearInterval(M), M = null);
459
- })(), w && console.log("[Sailfish] WebSocket closed");
590
+ null != D && (clearInterval(D), D = null), (function stopTimeSyncInterval() {
591
+ null != j && "undefined" != typeof window && (window.clearInterval(j), j = null);
592
+ })(), I && console.log("[Sailfish] WebSocket closed");
460
593
  }
461
594
  function handleWsMessage(e2) {
462
595
  try {
463
596
  const t2 = JSON.parse(e2);
464
597
  if ("time-sync-response" === t2.type) return void getClockSyncManager().recordTimeSyncResponse({ requestId: t2.requestId, serverReceivedAtMs: t2.serverReceivedAtMs, serverSentAtMs: t2.serverSentAtMs });
465
- if ("funcSpanTrackingControl" === t2.type) if (w && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== O && (window.clearTimeout(O), O = null), _ = t2.enabled, j = false, w && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
598
+ if ("funcSpanTrackingControl" === t2.type) if (I && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== V && (window.clearTimeout(V), V = null), G = t2.enabled, X = false, I && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
466
599
  if (t2.expirationTimestampMs) {
467
- B = t2.expirationTimestampMs;
468
- const e3 = Date.now(), n2 = B - e3;
469
- w && console.log(`[Sailfish] Server expiration timestamp: ${B}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, B), O = window.setTimeout(() => {
470
- j || (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired"));
471
- }, n2)) : (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Tracking already expired, not enabling"));
600
+ Q = t2.expirationTimestampMs;
601
+ const e3 = Date.now(), n2 = Q - e3;
602
+ I && console.log(`[Sailfish] Server expiration timestamp: ${Q}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, Q), V = window.setTimeout(() => {
603
+ X || (G = false, Q = null, clearGlobalFuncSpanState(), I && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), I && console.log("[Sailfish] Notified backend that function span tracking expired"));
604
+ }, n2)) : (G = false, Q = null, clearGlobalFuncSpanState(), I && console.log("[Sailfish] Tracking already expired, not enabling"));
472
605
  } else {
473
606
  const e3 = t2.timeoutSeconds || 3600;
474
- e3 > 0 && (B = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, B), O = window.setTimeout(() => {
475
- j || (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
607
+ e3 > 0 && (Q = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, Q), V = window.setTimeout(() => {
608
+ X || (G = false, Q = null, clearGlobalFuncSpanState(), I && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), I && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
476
609
  }, 1e3 * e3));
477
610
  }
478
611
  try {
479
612
  const e3 = getOrSetSessionId();
480
- wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), w && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
613
+ wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), I && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
481
614
  } catch (e3) {
482
- w && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
615
+ I && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
483
616
  }
484
- } else B = null, clearGlobalFuncSpanState();
617
+ } else Q = null, clearGlobalFuncSpanState();
485
618
  } catch (e3) {
486
619
  }
487
620
  }
488
- function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
621
+ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
489
622
  ensureHrefCache();
490
- const r2 = (function getWebSocketHost(e2) {
623
+ const s2 = (function getWebSocketHost(e2) {
491
624
  const t3 = new URL(e2);
492
625
  return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
493
626
  })(t2);
494
- let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.4`;
495
- if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), x = s2 ? (function tryCreateWsWorker() {
627
+ let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${s2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.6`;
628
+ if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), $ = null, A = null, F = 0, C = r2 ? (function tryCreateWsWorker() {
496
629
  if ("undefined" == typeof Worker) return null;
497
630
  try {
498
- 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);
631
+ const e2 = new Blob(['\nvar ws = null;\nvar wsUrl = "";\nvar reconnectTimer = null;\nvar reconnectDelay = 1000;\nvar MAX_RECONNECT_DELAY = 30000;\nvar CONNECTION_TIMEOUT = 30000;\nvar queue = [];\nvar MAX_QUEUE = 500;\n\nfunction enqueue(str) {\n if (queue.length >= MAX_QUEUE) queue.shift();\n queue.push(str);\n}\n\nfunction drain() {\n while (queue.length > 0) {\n if (!ws || ws.readyState !== 1) break;\n try { ws.send(queue.shift()); } catch (e) { break; }\n }\n}\n\n// Backpressure (A11): report the live socket buffer depth to the main thread on\n// a light interval so canvas video capture can throttle frame production when a\n// slow-but-open socket falls behind. Cheap (one number) and off the main thread.\nvar bufferedReportTimer = null;\nfunction startBufferedReporting() {\n if (bufferedReportTimer) return;\n bufferedReportTimer = setInterval(function() {\n var amt = (ws && ws.readyState === 1) ? (ws.bufferedAmount || 0) : 0;\n postMessage({ type: "buffered", bufferedAmount: amt });\n }, 250);\n}\n\nfunction connect() {\n if (ws && (ws.readyState === 0 || ws.readyState === 1)) return;\n try { ws = new WebSocket(wsUrl); } catch (e) { scheduleReconnect(); return; }\n var tid = setTimeout(function() { if (ws && ws.readyState === 0) ws.close(); }, CONNECTION_TIMEOUT);\n ws.onopen = function() {\n clearTimeout(tid);\n reconnectDelay = 1000;\n drain();\n startBufferedReporting();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n if (bufferedReportTimer) { clearInterval(bufferedReportTimer); bufferedReportTimer = null; }\n postMessage({ type: "buffered", bufferedAmount: 0 });\n postMessage({ type: "close" });\n scheduleReconnect();\n };\n ws.onerror = function() {};\n ws.onmessage = function(e) {\n postMessage({ type: "message", data: e.data });\n };\n}\n\nfunction scheduleReconnect() {\n if (reconnectTimer) return;\n reconnectTimer = setTimeout(function() {\n reconnectTimer = null;\n reconnectDelay = Math.min(reconnectDelay * 1.5, MAX_RECONNECT_DELAY);\n connect();\n }, reconnectDelay);\n}\n\nself.onmessage = function(e) {\n var msg = e.data;\n if (msg.type === "init") {\n wsUrl = msg.wsUrl;\n connect();\n } else if (msg.type === "send") {\n try {\n var s = JSON.stringify(msg.payload);\n if (ws && ws.readyState === 1) { ws.send(s); }\n else { enqueue(s); }\n } catch (e) {}\n } else if (msg.type === "sendRaw") {\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) { enqueue(msg.payload); }\n } else { enqueue(msg.payload); }\n } else if (msg.type === "sendBinary") {\n // Binary frames (canvas SFCV). The main thread only posts these while the\n // socket is open; if it closed in the meantime the frame is dropped (the\n // main-thread ring buffer covers the not-open case).\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) {}\n }\n } else if (msg.type === "close") {\n if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }\n if (ws) { ws.close(); ws = null; }\n }\n};\n'], { type: "application/javascript" }), t3 = URL.createObjectURL(e2), n3 = new Worker(t3);
499
632
  return URL.revokeObjectURL(t3), n3;
500
633
  } catch {
501
634
  return null;
502
635
  }
503
- })() : null, x) {
504
- const e2 = x, t3 = { readyState: WebSocket.CONNECTING, close: () => {
505
- t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), x = null, null != C && (clearInterval(C), C = null);
636
+ })() : null, C) {
637
+ const e2 = C, t3 = { readyState: WebSocket.CONNECTING, close: () => {
638
+ t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), C = null, null != D && (clearInterval(D), D = null);
506
639
  } };
507
- return I = t3, x.onmessage = (e3) => {
640
+ return M = t3, C.onmessage = (e3) => {
508
641
  const n3 = e3.data;
509
- "open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
510
- }, x.onerror = () => {
511
- w && console.warn("[Sailfish] WebSocket worker error");
512
- }, x.postMessage({ type: "init", wsUrl: a2 }), w && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
513
- }
514
- w && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
515
- const l2 = new e(a2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
516
- return l2.readyState;
642
+ "open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, F = 0, handleWsClose()) : "message" === n3.type ? handleWsMessage(n3.data) : "buffered" === n3.type && (F = "number" == typeof n3.bufferedAmount ? n3.bufferedAmount : 0);
643
+ }, C.onerror = () => {
644
+ I && console.warn("[Sailfish] WebSocket worker error");
645
+ }, C.postMessage({ type: "init", wsUrl: a2 }), I && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
646
+ }
647
+ I && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
648
+ const c2 = new e(a2, [], { connectionTimeout: 3e4 });
649
+ c2.binaryType = "arraybuffer", $ = (e2) => c2.send(e2), A = () => c2.bufferedAmount || 0;
650
+ const l2 = { get readyState() {
651
+ return c2.readyState;
517
652
  }, close: () => {
518
- l2.close(), null != C && (clearInterval(C), C = null);
653
+ c2.close(), null != D && (clearInterval(D), D = null);
519
654
  } };
520
- return I = c2, l2.addEventListener("open", () => handleWsOpen()), l2.addEventListener("close", () => handleWsClose()), l2.addEventListener("message", (e2) => handleWsMessage(e2.data)), c2;
655
+ return M = l2, c2.addEventListener("open", () => handleWsOpen()), c2.addEventListener("close", () => handleWsClose()), c2.addEventListener("message", (e2) => handleWsMessage(e2.data)), l2;
521
656
  }
522
657
  function sendMessage(e2) {
523
- "sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), T || !isWebSocketOpen(I) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
658
+ "sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), L || !isWebSocketOpen(M) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
524
659
  }
525
660
  function enableFunctionSpanTracking() {
526
- if (w && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), _ = true, j = true, B = null, null !== O && (window.clearTimeout(O), O = null), isWebSocketOpen(I)) {
527
- wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: k });
528
- } else w && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
661
+ if (I && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), G = true, X = true, Q = null, null !== V && (window.clearTimeout(V), V = null), isWebSocketOpen(M)) {
662
+ wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: E });
663
+ } else I && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
529
664
  }
530
665
  function disableFunctionSpanTracking() {
531
- if (w && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(I)) {
532
- wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: k });
666
+ if (I && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(M)) {
667
+ wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: E });
533
668
  } else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
534
- j && (_ = false, j = false, B = null, w && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== O && (window.clearTimeout(O), O = null);
669
+ X && (G = false, X = false, Q = null, I && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== V && (window.clearTimeout(V), V = null);
535
670
  }
536
671
  function isFunctionSpanTrackingEnabled() {
537
- return _;
672
+ return G;
538
673
  }
539
674
  function initializeFunctionSpanTrackingFromApi(e2) {
540
- e2 && !_ ? (_ = true, j = false, B = null, w && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && _ && (_ = false, j = false, B = null, w && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
675
+ e2 && !G ? (G = true, X = false, Q = null, I && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && G && (G = false, X = false, Q = null, I && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
541
676
  }
542
677
  function getFuncSpanHeader() {
543
- if (!_) return null;
544
- if (null !== B) {
545
- if (Date.now() >= B) return _ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
678
+ if (!G) return null;
679
+ if (null !== Q) {
680
+ if (Date.now() >= Q) return G = false, Q = null, clearGlobalFuncSpanState(), I && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
546
681
  }
547
682
  return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
548
683
  }
549
- const q = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, requestTimeSync, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
550
- let z = null, H = null;
684
+ const Z = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getBinaryDropCount, getBufferedAmount, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, isTransportSaturated, onNavigationChange, requestTimeSync, restoreFuncSpanState, sendEvent, sendMessage, wsSendBinary }, Symbol.toStringTag, { value: "Module" }));
685
+ let ee = null, te = null;
551
686
  function getIdentifiedUser() {
552
- return z;
687
+ return ee;
553
688
  }
554
- let W = null;
555
- const K = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
689
+ let ne = null;
690
+ const ie = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
556
691
  function fetchAndSendIp(e2) {
557
- W !== e2 && (W = e2, (async () => {
558
- for (const e3 of K) try {
692
+ ne !== e2 && (ne = e2, (async () => {
693
+ for (const e3 of ie) try {
559
694
  const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
560
695
  if (clearTimeout(n2), !i2.ok) continue;
561
- const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
562
- if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: exports.nowTimestamp() });
696
+ const o2 = await i2.json(), r2 = o2.ip || o2.origin || null;
697
+ if (r2 && "string" == typeof r2 && r2.length <= 45) return void sendMessage({ type: "visitorIp", ip: r2, timestamp: exports.nowTimestamp() });
563
698
  } catch {
564
699
  }
565
- W = null;
700
+ ne = null;
566
701
  })().catch(() => {
567
- W = null;
702
+ ne = null;
568
703
  }));
569
704
  }
570
- let G = null;
705
+ let oe = null;
571
706
  async function getSourceMapModule() {
572
- return G || (G = await import("source-map-js")), G;
707
+ return oe || (oe = await import("source-map-js")), oe;
573
708
  }
574
- const V = /* @__PURE__ */ new Map(), Q = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
709
+ const re = /* @__PURE__ */ new Map(), se = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
575
710
  async function getConsumerFor(e2, t2) {
576
711
  const n2 = (e2 || `/assets/${t2}`).split("?")[0], i2 = [`${n2}.map`, n2.replace(/\.js$/, ".js.map"), `/assets/${t2}.map`], { SourceMapConsumer: o2 } = await getSourceMapModule();
577
712
  for (const e3 of i2) try {
578
- if (V.has(e3)) return V.get(e3);
713
+ if (re.has(e3)) return re.get(e3);
579
714
  const t3 = await fetch(e3);
580
715
  if (!t3.ok) continue;
581
716
  const n3 = await t3.json();
582
717
  if (!n3 || !n3.mappings || !n3.sources) continue;
583
718
  const i3 = await new o2(n3);
584
- return V.set(e3, i3), i3;
719
+ return re.set(e3, i3), i3;
585
720
  } catch {
586
721
  }
587
722
  return null;
588
723
  }
589
724
  async function captureError(e2, t2 = false, n2) {
590
725
  let i2, o2;
591
- const s2 = [];
592
- e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace", s2.push(`${e2.name}: ${i2}`)) : "string" == typeof e2 ? (i2 = e2, o2 = "No stack trace available", s2.push(t2 ? `Uncaught (in promise) ${e2}` : e2)) : (i2 = (function describeNonError(e3) {
726
+ const r2 = [];
727
+ e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace", r2.push(`${e2.name}: ${i2}`)) : "string" == typeof e2 ? (i2 = e2, o2 = "No stack trace available", r2.push(t2 ? `Uncaught (in promise) ${e2}` : e2)) : (i2 = (function describeNonError(e3) {
593
728
  if (null === e3) return "null";
594
729
  if (void 0 === e3) return "undefined";
595
730
  if ("string" == typeof e3) return e3;
@@ -603,83 +738,83 @@ async function captureError(e2, t2 = false, n2) {
603
738
  } catch {
604
739
  return Object.prototype.toString.call(e3);
605
740
  }
606
- })(e2), o2 = "No stack trace available", s2.push(t2 ? `Uncaught (in promise) ${i2}` : i2)), (n2 == null ? void 0 : n2.filename) && s2.push(`at ${n2.filename}:${n2.lineno ?? 0}:${n2.colno ?? 0}`);
607
- const r2 = await (async function resolveStackTrace(e3) {
741
+ })(e2), o2 = "No stack trace available", r2.push(t2 ? `Uncaught (in promise) ${i2}` : i2)), (n2 == null ? void 0 : n2.filename) && r2.push(`at ${n2.filename}:${n2.lineno ?? 0}:${n2.colno ?? 0}`);
742
+ const s2 = await (async function resolveStackTrace(e3) {
608
743
  if (!e3) return ["No stack trace available"];
609
744
  const t3 = Array.isArray(e3) ? e3 : e3.split("\n"), n3 = [];
610
745
  for (const e4 of t3) {
611
- const t4 = e4.match(Q);
746
+ const t4 = e4.match(se);
612
747
  if (!t4) {
613
748
  n3.push(e4);
614
749
  continue;
615
750
  }
616
- const [, i3, o3, s3, r3] = t4, a3 = parseInt(s3, 10), l3 = Math.max(0, parseInt(r3, 10) - 1);
617
- if (!Number.isFinite(a3) || !Number.isFinite(l3)) {
751
+ const [, i3, o3, r3, s3] = t4, a3 = parseInt(r3, 10), c3 = Math.max(0, parseInt(s3, 10) - 1);
752
+ if (!Number.isFinite(a3) || !Number.isFinite(c3)) {
618
753
  n3.push(e4 + " [Invalid line/column]");
619
754
  continue;
620
755
  }
621
- const c3 = await getConsumerFor(i3, o3);
622
- if (!c3) {
756
+ const l3 = await getConsumerFor(i3, o3);
757
+ if (!l3) {
623
758
  n3.push(`${e4} [No source map found for ${o3}]`);
624
759
  continue;
625
760
  }
626
761
  const { SourceMapConsumer: d2 } = await getSourceMapModule();
627
- let u2 = c3.originalPositionFor({ line: a3, column: l3, bias: d2.GREATEST_LOWER_BOUND });
628
- if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 = c3.originalPositionFor({ line: a3, column: Math.max(0, l3 - e5), bias: d2.GREATEST_LOWER_BOUND }), !u2.source || null == u2.line); e5++) ;
762
+ let u2 = l3.originalPositionFor({ line: a3, column: c3, bias: d2.GREATEST_LOWER_BOUND });
763
+ if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 = l3.originalPositionFor({ line: a3, column: Math.max(0, c3 - e5), bias: d2.GREATEST_LOWER_BOUND }), !u2.source || null == u2.line); e5++) ;
629
764
  if (u2.source && null != u2.line) {
630
765
  const e5 = u2.name || "anonymous";
631
766
  n3.push(`${u2.source}:${u2.line}:${u2.column ?? 0} (${e5})`);
632
767
  } else n3.push(`${e4} [No mapping found in ${o3}]`);
633
768
  }
634
769
  return n3;
635
- })(o2), a2 = r2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), l2 = a2.length > 0 ? a2 : r2, c2 = Date.now();
636
- sendMessage({ type: "event", event: { type: 6, timestamp: c2, data: { payload: { message: i2, stack: o2, trace: l2, filteredStack: a2, payload: s2, userAgent: navigator.userAgent, url: window.location.href, timestamp: c2, level: "error" } } } });
637
- }
638
- const J = readDebugFlag();
639
- const X = readDebugFlag();
640
- function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
641
- const r2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
642
- return X && console.log(`Initial GraphQL request for ${e2} at ${r2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
643
- let s3 = 0;
770
+ })(o2), a2 = s2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), c2 = a2.length > 0 ? a2 : s2, l2 = Date.now();
771
+ sendMessage({ type: "event", event: { type: 6, timestamp: l2, data: { payload: { message: i2, stack: o2, trace: c2, filteredStack: a2, payload: r2, userAgent: navigator.userAgent, url: window.location.href, timestamp: l2, level: "error" } } } });
772
+ }
773
+ const ae = readDebugFlag();
774
+ const ce = readDebugFlag();
775
+ function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, r2 = 2) {
776
+ const s2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
777
+ return ce && console.log(`Initial GraphQL request for ${e2} at ${s2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
778
+ let r3 = 0;
644
779
  const attemptRequest = async () => {
645
780
  try {
646
781
  return await e3();
647
782
  } catch (e4) {
648
- if (s3++, s3 > n3) throw e4;
649
- const r3 = i3 * Math.pow(o3, s3 - 1);
650
- return J && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${r3}ms...`), await new Promise((e5) => setTimeout(e5, r3)), attemptRequest();
783
+ if (r3++, r3 > n3) throw e4;
784
+ const s3 = i3 * Math.pow(o3, r3 - 1);
785
+ return ae && console.log(`Attempt ${r3} failed: ${t3}; Retrying in ${s3}ms...`), await new Promise((e5) => setTimeout(e5, s3)), attemptRequest();
651
786
  }
652
787
  };
653
788
  return attemptRequest();
654
- })(() => fetch(r2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
655
- if (X && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
789
+ })(() => fetch(s2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
790
+ if (ce && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
656
791
  return e3.json();
657
- }), "Sending GraphQL request to Sailfish AI", i2, o2, s2);
792
+ }), "Sending GraphQL request to Sailfish AI", i2, o2, r2);
658
793
  }
659
794
  function fetchCaptureSettings(e2, t2) {
660
- 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 maskInputSelector\n maskTextSelector\n blockSelector\n unmaskSelector\n maskInputOptions\n }\n }\n ", { apiKey: e2, backendApi: t2 });
795
+ return sendGraphQLRequest("GetCaptureSettingsFromApiKey", "\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCanvasSf\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n textEditThrottleEnabled\n maskInputSelector\n maskTextSelector\n blockSelector\n unmaskSelector\n maskInputOptions\n maskCanvasText\n }\n }\n ", { apiKey: e2, backendApi: t2 });
661
796
  }
662
797
  function fetchFunctionSpanTrackingEnabled(e2, t2) {
663
798
  return sendGraphQLRequest("GetFunctionSpanTrackingEnabledFromApiKey", "\n query GetFunctionSpanTrackingEnabledFromApiKey($apiKey: String!) {\n isFunctionSpanTrackingEnabledFromApiKey(apiKey: $apiKey)\n }\n ", { apiKey: e2, backendApi: t2 });
664
799
  }
665
- function startRecordingSession(e2, t2, n2, i2, o2, s2, r2, a2, l2) {
666
- 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: r2, library: a2, serviceAdditionalMetadata: l2, startRecordingFilePath: null, startRecordingLineNumber: null });
800
+ function startRecordingSession(e2, t2, n2, i2, o2, r2, s2, a2, c2, l2, d2, u2) {
801
+ return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $gitOrg: String,\n $gitRepo: String,\n $gitProvider: 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 gitOrg: $gitOrg,\n gitRepo: $gitRepo,\n gitProvider: $gitProvider,\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: r2, gitSha: s2, gitOrg: l2, gitRepo: d2, gitProvider: u2, library: a2, serviceAdditionalMetadata: c2, startRecordingFilePath: null, startRecordingLineNumber: null });
667
802
  }
668
803
  function sendDomainsToNotPropagateHeaderTo(e2, t2, n2) {
669
804
  return sendGraphQLRequest("DomainsToNotPassHeaderTo", "mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }", { apiKey: e2, domains: t2, backendApi: n2 });
670
805
  }
671
- function createTriageFromRecorder(e2, t2, n2, i2, o2, s2, r2) {
672
- 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: r2, backendApi: t2 });
806
+ function createTriageFromRecorder(e2, t2, n2, i2, o2, r2, s2) {
807
+ 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: r2, triageSource: s2, backendApi: t2 });
673
808
  }
674
809
  function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
675
810
  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 });
676
811
  }
677
- function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2, r2, a2, l2, c2, d2, u2, p2, f2, g2, m2) {
678
- 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: r2, issueDescription: a2, createEngineeringTicket: l2, teamId: c2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
812
+ function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, r2, s2, a2, c2, l2, d2, u2, p2, f2, g2, m2) {
813
+ 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: r2, issueName: s2, issueDescription: a2, createEngineeringTicket: c2, teamId: l2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
679
814
  }
680
- const Z = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
815
+ const le = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
681
816
  function shouldSkipFrame(e2) {
682
- return Z.some((t2) => e2.includes(t2));
817
+ return le.some((t2) => e2.includes(t2));
683
818
  }
684
819
  function normalizeFilePath(e2) {
685
820
  let t2 = e2;
@@ -745,17 +880,9 @@ function yieldToMain() {
745
880
  var _a;
746
881
  return "undefined" != typeof globalThis && ((_a = globalThis.scheduler) == null ? void 0 : _a.yield) ? globalThis.scheduler.yield() : new Promise((e2) => setTimeout(e2, 0));
747
882
  }
748
- function closestSafe(e2, t2) {
749
- if (!e2 || !t2) return false;
750
- try {
751
- return !!e2.closest(t2);
752
- } catch {
753
- return false;
754
- }
755
- }
756
- const Y = { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true };
757
- let ee = null;
758
- const te = "sailfishSanitize", ne = "zendesk_chat", ie = "Zendesk";
883
+ const de = { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true };
884
+ let ue = null;
885
+ const pe = "sailfishSanitize", fe = "zendesk_chat", ge = "Zendesk";
759
886
  function zE_safe(...e2) {
760
887
  try {
761
888
  if ((function hasZendesk() {
@@ -767,32 +894,30 @@ function zE_safe(...e2) {
767
894
  }
768
895
  function maskInputFn(e2, t2) {
769
896
  var _a;
770
- if ("hidden" === t2.type) return "";
771
- const n2 = { creditCard: /\b(?:\d[ -]*?){13,16}\b/, ssn: /\b\d{3}-\d{2}-\d{4}\b/ };
772
- return t2.hasAttribute("data-cc") || ((_a = t2.getAttribute("autocomplete")) == null ? void 0 : _a.startsWith("cc-")) || n2.creditCard.test(e2) ? "**** **** **** " + e2.slice(-4) : t2.hasAttribute("data-ssn") || n2.ssn.test(e2) ? "***-**-" + e2.slice(-4) : t2.hasAttribute("data-dob") ? "**/**/" + e2.slice(-4) : "*".repeat(e2.length);
897
+ return "hidden" === t2.type ? "" : t2.hasAttribute("data-cc") || ((_a = t2.getAttribute("autocomplete")) == null ? void 0 : _a.startsWith("cc-")) || n.looksLikeCreditCard(e2) ? n.redactCreditCard(e2) : t2.hasAttribute("data-ssn") || n.looksLikeSsn(e2) ? n.redactSsn(e2) : t2.hasAttribute("data-dob") ? n.redactDob(e2) : "*".repeat(e2.length);
773
898
  }
774
- let oe = true, se = null, re = null, ae = null, le = null;
899
+ let me = true, he = null, ye = null, Se = null, be = null;
775
900
  function invalidateUrlCache() {
776
- oe = true;
901
+ me = true;
777
902
  }
778
- const getUrlAndStoredUuids = () => (oe && (function _refreshSessionStorageCache() {
779
- se = sessionStorage.getItem("pageVisitUUID"), re = sessionStorage.getItem("prevPageVisitUUID"), ae = sessionStorage.getItem("tabVisibilityChanged"), le = sessionStorage.getItem("tabVisibilityState"), oe = false;
780
- })(), { page_visit_uuid: se, prev_page_visit_uuid: re, href: getCachedHrefNoQuery(), tabVisibilityChanged: ae, tabVisibilityState: le });
903
+ const getUrlAndStoredUuids = () => (me && (function _refreshSessionStorageCache() {
904
+ he = sessionStorage.getItem("pageVisitUUID"), ye = sessionStorage.getItem("prevPageVisitUUID"), Se = sessionStorage.getItem("tabVisibilityChanged"), be = sessionStorage.getItem("tabVisibilityState"), me = false;
905
+ })(), { page_visit_uuid: he, prev_page_visit_uuid: ye, href: getCachedHrefNoQuery(), tabVisibilityChanged: Se, tabVisibilityState: be });
781
906
  function initializeDomContentEvents(e2) {
782
907
  document.addEventListener("readystatechange", () => {
783
908
  const t2 = { type: 24, data: { source: 0, info: "" }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() };
784
909
  switch (document.readyState) {
785
910
  case "loading":
786
- t2.data.source = i;
911
+ t2.data.source = o;
787
912
  break;
788
913
  case "complete":
789
914
  t2.data.source = s;
790
915
  }
791
916
  t2.data.info && sendEvent(t2);
792
917
  }), document.addEventListener("DOMContentLoaded", () => {
793
- sendEvent({ type: 24, data: { source: o }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
794
- }), window.addEventListener("pagehide", () => {
795
918
  sendEvent({ type: 24, data: { source: r }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
919
+ }), window.addEventListener("pagehide", () => {
920
+ sendEvent({ type: 24, data: { source: a }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
796
921
  });
797
922
  }
798
923
  async function initializePerformancePlugin(e2) {
@@ -812,37 +937,37 @@ async function initializePerformancePlugin(e2) {
812
937
  async function initializeConsolePlugin(e2, n2) {
813
938
  const { getRecordConsolePlugin: i2 } = await import("@sailfish-rrweb/rrweb-plugin-console-record");
814
939
  await yieldToMain();
815
- const { name: o2, observer: s2 } = i2(e2);
816
- s2((e3) => {
817
- const i3 = e3, [s3, r2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [a2, l2] = getCallerLocation(2), c2 = s3 ?? a2, d2 = r2 ?? l2, u2 = { ...i3, sourceFile: c2, sourceLine: d2 };
940
+ const { name: o2, observer: r2 } = i2(e2);
941
+ r2((e3) => {
942
+ const i3 = e3, [r3, s2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [a2, c2] = getCallerLocation(2), l2 = r3 ?? a2, d2 = s2 ?? c2, u2 = { ...i3, sourceFile: l2, sourceLine: d2 };
818
943
  sendEvent({ type: t.EventType.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
819
944
  }, window, e2);
820
945
  }
821
- async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2 = false) {
822
- const c2 = initializeWebSocket(n2, i2, o2, s2, a2);
946
+ async function initializeRecording(e2, i2, o2, r2, s2, a2 = true, c2 = false, l2 = false) {
947
+ const d2 = initializeWebSocket(i2, o2, r2, s2, c2);
823
948
  try {
824
- const n3 = (function createThrottledEmit(e3, t2 = 1e3) {
949
+ const i3 = (function createThrottledEmit(e3, t2 = 1e3) {
825
950
  if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
826
951
  } };
827
- const n4 = /* @__PURE__ */ new Map();
828
- let i3 = null;
952
+ const n2 = /* @__PURE__ */ new Map();
953
+ let i4 = null;
829
954
  return { emit: (e4) => {
830
955
  var _a, _b;
831
956
  const o3 = (_a = e4.data) == null ? void 0 : _a.source;
832
957
  if (3 !== e4.type || 0 !== o3 && 5 !== o3) return void sendEvent(e4);
833
958
  if (0 === o3) {
834
- 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;
835
- if (n5 || i4) return void sendEvent(e4);
959
+ const t3 = e4.data, n3 = (t3 == null ? void 0 : t3.adds) && t3.adds.length > 0, i5 = (t3 == null ? void 0 : t3.removes) && t3.removes.length > 0;
960
+ if (n3 || i5) return void sendEvent(e4);
836
961
  }
837
- const s3 = `3:${o3}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
838
- n4.set(s3, e4), i3 || (i3 = setInterval(() => {
839
- 0 !== n4.size && (n4.forEach((e5) => sendEvent(e5)), n4.clear());
962
+ const r3 = `3:${o3}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
963
+ n2.set(r3, e4), i4 || (i4 = setInterval(() => {
964
+ 0 !== n2.size && (n2.forEach((e5) => sendEvent(e5)), n2.clear());
840
965
  }, t2));
841
966
  }, flush: () => {
842
- n4.size > 0 && (n4.forEach((e4) => sendEvent(e4)), n4.clear()), i3 && (clearInterval(i3), i3 = null);
967
+ n2.size > 0 && (n2.forEach((e4) => sendEvent(e4)), n2.clear()), i4 && (clearInterval(i4), i4 = null);
843
968
  } };
844
969
  })(e2.textEditThrottleEnabled), emitWithContext = (e3) => {
845
- Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId = o2, n3.emit(e3);
970
+ Object.assign(e3, getUrlAndStoredUuids()), e3.sessionId = r2, i3.emit(e3);
846
971
  }, startHeavyWork = async () => {
847
972
  if (true === e2.enableFiberTracking) try {
848
973
  const { installFiberHook: e3, processExistingTree: t2 } = await Promise.resolve().then(() => require("./fiberHook-CEzmPkx_.js"));
@@ -850,44 +975,50 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
850
975
  } catch (e3) {
851
976
  console.warn("[Sailfish] Failed to enable Fiber tracking:", e3);
852
977
  }
853
- const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
854
- ee = n4, await yieldToMain();
855
- const i3 = e2.unmaskSelector || void 0, o3 = e2.blockSelector || void 0, s3 = e2.maskTextSelector || void 0, r3 = e2.maskInputSelector || void 0, a3 = { ...e2.maskInputOptions ?? {} }, c3 = r3 ? { ...Y } : a3, d2 = (function buildMaskInputFn(e3) {
856
- const { baseFn: t2, unmaskSelector: n5, maskInputSelector: i4, adminMaskInputOptions: o4 } = e3;
857
- return n5 || i4 ? (e4, s4) => {
858
- if ("hidden" === s4.type) return "";
859
- if (closestSafe(s4, n5)) return e4;
860
- const r4 = (s4.type || "").toLowerCase(), a4 = (s4.tagName || "").toLowerCase(), l3 = true === o4[r4] || true === o4[a4], c4 = (function matchesSelectorSafe(e5, t3) {
861
- if (!t3) return false;
862
- try {
863
- return e5.matches(t3);
864
- } catch {
865
- return false;
866
- }
867
- })(s4, i4);
868
- return l3 || c4 ? t2(e4, s4) : e4;
869
- } : t2;
870
- })({ baseFn: maskInputFn, unmaskSelector: i3, maskInputSelector: r3, adminMaskInputOptions: a3 }), u2 = /* @__PURE__ */ (function makeMaskTextFn(e3) {
871
- return (t2, n5) => closestSafe(n5, e3) ? t2 : t2.replace(/\S/g, "*");
872
- })(i3);
978
+ const { record: i4 } = await import("@sailfish-rrweb/rrweb-record-only");
979
+ ue = i4, await yieldToMain();
980
+ const o3 = e2.unmaskSelector || void 0, s3 = e2.blockSelector || void 0, a3 = e2.maskTextSelector || void 0, c3 = e2.maskInputSelector || void 0, d3 = { ...e2.maskInputOptions ?? {} }, u2 = c3 ? { ...de } : d3, p2 = n.buildMaskInputFn({ baseFn: maskInputFn, unmaskSelector: o3, maskInputSelector: c3, adminMaskInputOptions: d3 }), f2 = n.makeMaskTextFn(o3);
873
981
  if (l2) {
874
- const { chunkedSnapshot: a4 } = await Promise.resolve().then(() => require("./chunkSerializer-FQtY90Av.js")), l3 = n4.mirror;
875
- let p2 = true;
876
- const f2 = [];
877
- n4({ emit(e3) {
878
- p2 ? f2.push(e3) : emitWithContext(e3);
879
- }, ...e2, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, maskInputSelector: r3, maskTextSelector: s3, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te, recordDOM: false });
880
- const g2 = Date.now(), m2 = await a4(document, l3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te, maskTextSelector: s3, maskInputSelector: r3, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, unmaskSelector: i3 });
982
+ const { chunkedSnapshot: n2 } = await Promise.resolve().then(() => require("./chunkSerializer-C_K0Wyk0.js")), r3 = i4.mirror;
983
+ let l3 = true;
984
+ const d4 = [];
985
+ i4({ emit(e3) {
986
+ l3 ? d4.push(e3) : emitWithContext(e3);
987
+ }, ...e2, maskInputOptions: u2, maskInputFn: p2, maskTextFn: f2, maskInputSelector: c3, maskTextSelector: a3, blockSelector: s3, maskTextClass: e2.maskTextClass ?? pe, recordDOM: false, recordCanvas: false });
988
+ const g2 = Date.now(), m2 = await n2(document, r3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: s3, maskTextClass: e2.maskTextClass ?? pe, maskTextSelector: a3, maskInputSelector: c3, maskInputOptions: u2, maskInputFn: p2, maskTextFn: f2, unmaskSelector: o3 });
881
989
  if (m2) {
882
990
  emitWithContext({ type: t.EventType.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: g2 }), emitWithContext({ type: t.EventType.FullSnapshot, data: { node: m2, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: g2 });
883
- for (const e3 of f2) emitWithContext(e3);
884
- p2 = false;
885
- } else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), p2 = false;
886
- } else n4({ emit(e3) {
991
+ for (const e3 of d4) emitWithContext(e3);
992
+ l3 = false;
993
+ } else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), l3 = false;
994
+ } else i4({ emit(e3) {
887
995
  emitWithContext(e3);
888
- }, ...e2, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, maskInputSelector: r3, maskTextSelector: s3, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te });
996
+ }, ...e2, maskInputOptions: u2, maskInputFn: p2, maskTextFn: f2, maskInputSelector: c3, maskTextSelector: a3, blockSelector: s3, maskTextClass: e2.maskTextClass ?? pe, recordCanvas: false });
997
+ if (e2.recordCanvas) try {
998
+ const { startCanvasRecording: n2, stopCanvasRecording: o4, flushAllCanvas: s4, isCanvasRecordingActive: a4 } = await Promise.resolve().then(() => require("./canvasManager-BYn3_oyo.js")), c4 = { settings: { maskCanvasClass: e2.maskCanvasClass, maskTextClass: e2.maskTextClass, maskTextSelector: e2.maskTextSelector, blockSelector: e2.blockSelector, unmaskSelector: e2.unmaskSelector, maskCanvasText: e2.maskCanvasText ?? void 0, canvasRedactStyle: e2.canvasRedactStyle, recordSsn: e2.recordSsn, recordCreditCardInfo: e2.recordCreditCardInfo, recordDob: e2.recordDob, recordRealName: e2.recordRealName, recordPassword: e2.recordPassword }, mirror: i4.mirror, addSailfishEvent: (e3) => {
999
+ ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { ...e3, tag: "sf-canvas" });
1000
+ }, sendBinary: wsSendBinary, getContextIds: () => ({ session_id: r2, page_visit_uuid: getUrlAndStoredUuids().page_visit_uuid }), isTransportSaturated };
1001
+ n2(c4);
1002
+ const onVisibilityHidden = () => {
1003
+ try {
1004
+ "hidden" === document.visibilityState && s4();
1005
+ } catch {
1006
+ }
1007
+ };
1008
+ document.addEventListener("visibilitychange", onVisibilityHidden), window.addEventListener("pagehide", () => {
1009
+ o4();
1010
+ }), window.addEventListener("pageshow", (e3) => {
1011
+ try {
1012
+ e3.persisted && !a4() && n2(c4);
1013
+ } catch (e4) {
1014
+ console.warn("[Sailfish] canvas recording failed to re-arm after bfcache restore:", e4);
1015
+ }
1016
+ });
1017
+ } catch (e3) {
1018
+ console.warn("[Sailfish] canvas recording failed to start:", e3);
1019
+ }
889
1020
  };
890
- if (r2) {
1021
+ if (a2) {
891
1022
  let e3 = false;
892
1023
  const startOnce = () => {
893
1024
  e3 || (e3 = true, startHeavyWork());
@@ -904,7 +1035,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
904
1035
  "complete" === document.readyState ? scheduleAfterLoad() : window.addEventListener("load", () => scheduleAfterLoad(), { once: true });
905
1036
  } else "function" == typeof requestIdleCallback ? requestIdleCallback(startHeavyWork, { timeout: 2e3 }) : setTimeout(startHeavyWork, 0);
906
1037
  window.addEventListener("beforeunload", () => {
907
- n3.flush();
1038
+ i3.flush();
908
1039
  }), (function whenZendeskReady(e3) {
909
1040
  if ("undefined" == typeof window) return;
910
1041
  const t2 = window.zE;
@@ -914,14 +1045,14 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
914
1045
  }
915
1046
  })(() => {
916
1047
  suppressConsoleLogsDuringCall(() => {
917
- zE_safe("messenger:set", "conversationTags", [`sailfish-session-${o2}`]);
1048
+ zE_safe("messenger:set", "conversationTags", [`sailfish-session-${r2}`]);
918
1049
  });
919
1050
  const handleWidgetOpen = () => {
920
- ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat opened", element_id: ne, provider: ie });
1051
+ ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat opened", element_id: fe, provider: ge });
921
1052
  }, handleWidgetClose = () => {
922
- ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat closed", element_id: ne, provider: ie });
1053
+ ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat closed", element_id: fe, provider: ge });
923
1054
  }, handleUnreadMessages = (e3) => {
924
- ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "zendesk unreadmessages", element_id: ne, provider: ie });
1055
+ ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { action: "zendesk unreadmessages", element_id: fe, provider: ge });
925
1056
  };
926
1057
  suppressConsoleLogsDuringCall(() => {
927
1058
  zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
@@ -930,9 +1061,9 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
930
1061
  } catch (e3) {
931
1062
  console.error("Error importing plugins!", e3);
932
1063
  }
933
- return c2;
1064
+ return d2;
934
1065
  }
935
- const ce = [(e2) => (function checkNextJs() {
1066
+ const ve = [(e2) => (function checkNextJs() {
936
1067
  try {
937
1068
  if (void 0 !== globalThis.__NEXT_DATA__) return "nextjs";
938
1069
  } catch {
@@ -994,52 +1125,52 @@ const ce = [(e2) => (function checkNextJs() {
994
1125
  }
995
1126
  return null;
996
1127
  }];
997
- const de = "sf-create-issue-preference", ue = "sf-create-eng-ticket-preference";
1128
+ const we = "sf-create-issue-preference", ke = "sf-create-eng-ticket-preference";
998
1129
  function getInitialState() {
999
1130
  const e2 = (function loadUserPreferences() {
1000
- return { createIssue: m && "true" === localStorage.getItem(de), createEngTicket: m && "true" === localStorage.getItem(ue) };
1131
+ return { createIssue: b && "true" === localStorage.getItem(we), createEngTicket: b && "true" === localStorage.getItem(ke) };
1001
1132
  })();
1002
1133
  return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
1003
1134
  }
1004
- let pe = getInitialState(), fe = null, ge = null, me = null, he = false, ye = false;
1135
+ let xe = getInitialState(), Te = null, Ie = null, Ee = null, Ce = false, Me = false;
1005
1136
  function setSprintDefaulted(e2) {
1006
- ye = e2;
1137
+ Me = e2;
1007
1138
  }
1008
1139
  function setTimerInterval(e2) {
1009
- me = e2;
1140
+ Ee = e2;
1010
1141
  }
1011
1142
  function setIsRecording(e2) {
1012
- he = e2;
1143
+ Ce = e2;
1013
1144
  }
1014
- const Se = ["jira", "linear", "zendesk"];
1015
- let be = null;
1016
- const ve = /* @__PURE__ */ new Map();
1145
+ const $e = ["jira", "linear", "zendesk"];
1146
+ let Ae = null;
1147
+ const Fe = /* @__PURE__ */ new Map();
1017
1148
  function getIntegrationData() {
1018
- return be;
1149
+ return Ae;
1019
1150
  }
1020
1151
  function hasValidIntegration() {
1021
- return null !== be && true === be.installed;
1152
+ return null !== Ae && true === Ae.installed;
1022
1153
  }
1023
1154
  function resolveIntegration(e2) {
1024
1155
  var _a;
1025
1156
  if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
1026
1157
  const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
1027
1158
  var _a2;
1028
- return Se.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
1159
+ return $e.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
1029
1160
  });
1030
1161
  if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
1031
1162
  const i2 = n2.find((e3) => {
1032
1163
  var _a2;
1033
1164
  return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
1034
1165
  }) || n2[0];
1035
- return (i2 == null ? void 0 : i2.primaryCloudId) && ve.set(i2.primaryCloudId, i2), i2;
1166
+ return (i2 == null ? void 0 : i2.primaryCloudId) && Fe.set(i2.primaryCloudId, i2), i2;
1036
1167
  }
1037
1168
  async function refreshIntegrationData(e2, t2) {
1038
1169
  try {
1039
1170
  const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
1040
- return be = n2, n2;
1171
+ return Ae = n2, n2;
1041
1172
  } catch (e3) {
1042
- return console.error("Error refreshing integration data:", e3), be;
1173
+ return console.error("Error refreshing integration data:", e3), Ae;
1043
1174
  }
1044
1175
  }
1045
1176
  function populateSelectOptions(e2, t2, n2) {
@@ -1084,8 +1215,8 @@ function populateSprintOptions(e2, t2, n2) {
1084
1215
  }), n2 && (e2.value = n2);
1085
1216
  }
1086
1217
  function getSprintFieldId() {
1087
- if (!(be == null ? void 0 : be.fieldConfigurations)) return "customfield_10020";
1088
- const e2 = Array.isArray(be.fieldConfigurations) ? be.fieldConfigurations : [];
1218
+ if (!(Ae == null ? void 0 : Ae.fieldConfigurations)) return "customfield_10020";
1219
+ const e2 = Array.isArray(Ae.fieldConfigurations) ? Ae.fieldConfigurations : [];
1089
1220
  for (const t2 of e2) {
1090
1221
  const e3 = (t2.fields || []).find((e4) => {
1091
1222
  var _a;
@@ -1097,12 +1228,12 @@ function getSprintFieldId() {
1097
1228
  }
1098
1229
  function updateIssueTypeOptions(e2, t2) {
1099
1230
  var _a;
1100
- if (!(be == null ? void 0 : be.projects) || !t2) {
1231
+ if (!(Ae == null ? void 0 : Ae.projects) || !t2) {
1101
1232
  e2.innerHTML = "";
1102
1233
  const t3 = document.createElement("option");
1103
1234
  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");
1104
1235
  }
1105
- const n2 = be.projects.find((e3) => e3.id === t2);
1236
+ const n2 = Ae.projects.find((e3) => e3.id === t2);
1106
1237
  if (!n2 || !n2.issue_types) {
1107
1238
  e2.innerHTML = "";
1108
1239
  const t3 = document.createElement("option");
@@ -1121,17 +1252,17 @@ function updateIssueTypeOptions(e2, t2) {
1121
1252
  }), n3 = i2.find((e3) => {
1122
1253
  var _a2;
1123
1254
  return "task" === ((_a2 = e3.name) == null ? void 0 : _a2.toLowerCase());
1124
- }), s2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
1125
- s2 ? (e2.value = s2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
1255
+ }), r2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
1256
+ r2 ? (e2.value = r2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
1126
1257
  }
1127
1258
  }
1128
1259
  function getFieldsForProject(e2, t2) {
1129
- if (!(be == null ? void 0 : be.fieldConfigurations) || !e2) return [];
1130
- const n2 = Array.isArray(be.fieldConfigurations) ? be.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : be.fieldConfigurations[e2];
1260
+ if (!(Ae == null ? void 0 : Ae.fieldConfigurations) || !e2) return [];
1261
+ const n2 = Array.isArray(Ae.fieldConfigurations) ? Ae.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : Ae.fieldConfigurations[e2];
1131
1262
  return n2 && n2.fields ? n2.fields : [];
1132
1263
  }
1133
1264
  function getUsers() {
1134
- return (be == null ? void 0 : be.users) ? be.users : [];
1265
+ return (Ae == null ? void 0 : Ae.users) ? Ae.users : [];
1135
1266
  }
1136
1267
  function getDefaultReporterAccountId() {
1137
1268
  const e2 = getUsers(), t2 = getIdentifiedUser();
@@ -1140,16 +1271,16 @@ function getDefaultReporterAccountId() {
1140
1271
  const n3 = e2.filter(t3);
1141
1272
  return 1 === n3.length ? n3[0] : null;
1142
1273
  };
1143
- let s2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
1144
- if (!s2 && o2 && (s2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !s2 && i2) {
1274
+ let r2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
1275
+ if (!r2 && o2 && (r2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !r2 && i2) {
1145
1276
  const e3 = i2.split("@")[0];
1146
- e3.length >= 3 && (s2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
1277
+ e3.length >= 3 && (r2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
1147
1278
  }
1148
- return s2 && (s2.id || s2.accountId) || null;
1279
+ return r2 && (r2.id || r2.accountId) || null;
1149
1280
  }
1150
1281
  function lastReporterStorageKey() {
1151
- if (!be) return null;
1152
- const e2 = be.primaryCloudId || be.provider || "";
1282
+ if (!Ae) return null;
1283
+ const e2 = Ae.primaryCloudId || Ae.provider || "";
1153
1284
  return e2 ? `sf-veritas:lastReporter:${e2}` : null;
1154
1285
  }
1155
1286
  function getSavedLastReporterAccountId() {
@@ -1176,42 +1307,42 @@ function getValidSavedReporterAccountId() {
1176
1307
  return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
1177
1308
  }
1178
1309
  function getProjectsForTeam(e2) {
1179
- if (!be) return [];
1180
- const t2 = be.teams && Array.isArray(be.teams) && be.teams.length > 0;
1310
+ if (!Ae) return [];
1311
+ const t2 = Ae.teams && Array.isArray(Ae.teams) && Ae.teams.length > 0;
1181
1312
  if (t2 && e2) {
1182
- const t3 = be.teams.find((t4) => t4.id === e2);
1313
+ const t3 = Ae.teams.find((t4) => t4.id === e2);
1183
1314
  return (t3 == null ? void 0 : t3.projects) || [];
1184
1315
  }
1185
- return !t2 && be.projects ? be.projects : [];
1316
+ return !t2 && Ae.projects ? Ae.projects : [];
1186
1317
  }
1187
1318
  function updateFormWithIntegrationData(e2) {
1188
1319
  var _a;
1189
- if (!be) return e2;
1190
- const t2 = be.teams && Array.isArray(be.teams) && be.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
1191
- n2 && t2 && (populateSelectOptions(n2, be.teams, be.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
1320
+ if (!Ae) return e2;
1321
+ const t2 = Ae.teams && Array.isArray(Ae.teams) && Ae.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
1322
+ n2 && t2 && (populateSelectOptions(n2, Ae.teams, Ae.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
1192
1323
  const i2 = document.getElementById("sf-eng-ticket-project");
1193
1324
  if (i2) {
1194
- populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : be.projects || [], be.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
1325
+ populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : Ae.projects || [], Ae.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
1195
1326
  }
1196
1327
  const o2 = document.getElementById("sf-eng-ticket-priority");
1197
- o2 && (populatePriorityOptions(o2, be.provider || "", be.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
1198
- const s2 = document.getElementById("sf-eng-ticket-sprint"), r2 = "jira" === ((_a = be.provider) == null ? void 0 : _a.toLowerCase());
1199
- if (s2 && r2 && be.sprints) {
1200
- if (!e2.engTicketSprint && !ye) {
1201
- const t3 = pickDefaultActiveSprint(be.sprints, e2.engTicketProject, be.projects || []);
1328
+ o2 && (populatePriorityOptions(o2, Ae.provider || "", Ae.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
1329
+ const r2 = document.getElementById("sf-eng-ticket-sprint"), s2 = "jira" === ((_a = Ae.provider) == null ? void 0 : _a.toLowerCase());
1330
+ if (r2 && s2 && Ae.sprints) {
1331
+ if (!e2.engTicketSprint && !Me) {
1332
+ const t3 = pickDefaultActiveSprint(Ae.sprints, e2.engTicketProject, Ae.projects || []);
1202
1333
  (t3 == null ? void 0 : t3.id) && (e2.engTicketSprint = String(t3.id), setSprintDefaulted(true));
1203
1334
  }
1204
- populateSprintOptions(s2, be.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (s2.style.color = "");
1335
+ populateSprintOptions(r2, Ae.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (r2.style.color = "");
1205
1336
  }
1206
1337
  const a2 = document.getElementById("sf-eng-ticket-type");
1207
- return a2 && r2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
1338
+ return a2 && s2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
1208
1339
  }
1209
- const we = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
1210
- if (!be) try {
1340
+ const Le = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
1341
+ if (!Ae) try {
1211
1342
  const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
1212
- be = resolveIntegration(n2);
1343
+ Ae = resolveIntegration(n2);
1213
1344
  } catch (e3) {
1214
- console.error("Error fetching integration data:", e3), be = null;
1345
+ console.error("Error fetching integration data:", e3), Ae = null;
1215
1346
  }
1216
1347
  }, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, pickDefaultActiveSprint, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }));
1217
1348
  function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
@@ -1247,9 +1378,9 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
1247
1378
  </div>
1248
1379
  `;
1249
1380
  }
1250
- const ke = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, xe = { shortcuts: { ...ke }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
1381
+ const Re = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, De = { shortcuts: { ...Re }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
1251
1382
  }, integrationData: null, showEngTicketFieldsDefault: false };
1252
- let Ie = null, Te = false;
1383
+ let Pe = null, Be = false;
1253
1384
  function setupCustomMultiSelectListeners(e2, t2) {
1254
1385
  const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
1255
1386
  if (!n2 || !i2) return;
@@ -1266,16 +1397,16 @@ function setupCustomMultiSelectListeners(e2, t2) {
1266
1397
  </span>`);
1267
1398
  }
1268
1399
  });
1269
- const s2 = n2.querySelector(".sf-multiselect-chips");
1270
- return s2 && (s2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', s2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
1400
+ const r2 = n2.querySelector(".sf-multiselect-chips");
1401
+ return r2 && (r2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', r2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
1271
1402
  e4.addEventListener("click", (n3) => {
1272
1403
  n3.stopPropagation();
1273
- const o3 = e4.dataset.value || "", s3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
1274
- s3 && (s3.dataset.selected = "false", s3.style.backgroundColor = ""), updateChipsDisplay();
1275
- const r2 = [];
1404
+ const o3 = e4.dataset.value || "", r3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
1405
+ r3 && (r3.dataset.selected = "false", r3.style.backgroundColor = ""), updateChipsDisplay();
1406
+ const s2 = [];
1276
1407
  i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
1277
- "true" === e5.dataset.selected && r2.push(e5.dataset.value || "");
1278
- }), t2(r2);
1408
+ "true" === e5.dataset.selected && s2.push(e5.dataset.value || "");
1409
+ }), t2(s2);
1279
1410
  });
1280
1411
  })), e3;
1281
1412
  }
@@ -1284,8 +1415,8 @@ function setupCustomMultiSelectListeners(e2, t2) {
1284
1415
  n3.stopPropagation();
1285
1416
  const i3 = e3, o2 = "true" === i3.dataset.selected;
1286
1417
  i3.dataset.selected = String(!o2), i3.style.backgroundColor = o2 ? "" : "#e0f2fe";
1287
- const s2 = updateChipsDisplay();
1288
- t2(s2);
1418
+ const r2 = updateChipsDisplay();
1419
+ t2(r2);
1289
1420
  });
1290
1421
  }), updateChipsDisplay(), document.addEventListener("click", (e3) => {
1291
1422
  const t3 = e3.target;
@@ -1298,12 +1429,12 @@ function renderDynamicFields(e2, t2) {
1298
1429
  if (!e2) return void (n2.innerHTML = '<div style="font-size:14px; color:#64748B;">Select a project to see additional fields</div>');
1299
1430
  const i2 = getFieldsForProject(e2, t2), o2 = getUsers();
1300
1431
  if (!i2 || 0 === i2.length) return void (n2.innerHTML = "");
1301
- const s2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
1432
+ const r2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
1302
1433
  var _a, _b, _c, _d;
1303
- const i3 = e4.fieldId || e4.key, o3 = e4.name, s3 = (_a = e4.schema) == null ? void 0 : _a.type, r2 = (_b = e4.schema) == null ? void 0 : _b.system, a2 = (_c = e4.schema) == null ? void 0 : _c.custom, l2 = e4.required || false, c2 = e4.allowedValues, d2 = ["summary", "description", "project", "issuetype", "priority"];
1304
- if (d2.includes(i3) || d2.includes(r2)) return null;
1305
- 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;";
1306
- switch (s3) {
1434
+ const i3 = e4.fieldId || e4.key, o3 = e4.name, r3 = (_a = e4.schema) == null ? void 0 : _a.type, s2 = (_b = e4.schema) == null ? void 0 : _b.system, a2 = (_c = e4.schema) == null ? void 0 : _c.custom, c2 = e4.required || false, l2 = e4.allowedValues, d2 = ["summary", "description", "project", "issuetype", "priority"];
1435
+ if (d2.includes(i3) || d2.includes(s2)) return null;
1436
+ const u2 = c2 ? '<span style="color:#ef4444;">*</span>' : "", p2 = "width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;";
1437
+ switch (r3) {
1307
1438
  case "string":
1308
1439
  return a2 && a2.includes("textarea") ? `
1309
1440
  <div>
@@ -1316,7 +1447,7 @@ function renderDynamicFields(e2, t2) {
1316
1447
  data-field-id="${i3}"
1317
1448
  placeholder="Enter ${o3.toLowerCase()}"
1318
1449
  style="${p2} height:80px; resize:none;"
1319
- ${l2 ? "required" : ""}
1450
+ ${c2 ? "required" : ""}
1320
1451
  >${t3 || ""}</textarea>
1321
1452
  </div>
1322
1453
  ` : `
@@ -1332,7 +1463,7 @@ function renderDynamicFields(e2, t2) {
1332
1463
  value="${t3 || ""}"
1333
1464
  placeholder="Enter ${o3.toLowerCase()}"
1334
1465
  style="${p2}"
1335
- ${l2 ? "required" : ""}
1466
+ ${c2 ? "required" : ""}
1336
1467
  />
1337
1468
  </div>
1338
1469
  `;
@@ -1351,7 +1482,7 @@ function renderDynamicFields(e2, t2) {
1351
1482
  placeholder="Enter ${o3.toLowerCase()}"
1352
1483
  style="${p2}"
1353
1484
  step="0.5"
1354
- ${l2 ? "required" : ""}
1485
+ ${c2 ? "required" : ""}
1355
1486
  />
1356
1487
  </div>
1357
1488
  `;
@@ -1368,7 +1499,7 @@ function renderDynamicFields(e2, t2) {
1368
1499
  data-field-id="${i3}"
1369
1500
  value="${t3 || ""}"
1370
1501
  style="${p2}"
1371
- ${l2 ? "required" : ""}
1502
+ ${c2 ? "required" : ""}
1372
1503
  />
1373
1504
  </div>
1374
1505
  `;
@@ -1377,7 +1508,7 @@ function renderDynamicFields(e2, t2) {
1377
1508
  const e5 = n3.map((e6) => {
1378
1509
  const n4 = e6.email ? `${e6.name} (${e6.email})` : e6.name, i4 = t3 === e6.id ? "selected" : "";
1379
1510
  return `<option value="${e6.id}" ${i4}>${n4}</option>`;
1380
- }).join(""), s4 = t3 && n3.some((e6) => e6.id === t3);
1511
+ }).join(""), r4 = t3 && n3.some((e6) => e6.id === t3);
1381
1512
  return `
1382
1513
  <div>
1383
1514
  <label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
@@ -1387,10 +1518,10 @@ function renderDynamicFields(e2, t2) {
1387
1518
  id="${i3}"
1388
1519
  class="sf-dynamic-field"
1389
1520
  data-field-id="${i3}"
1390
- style="${p2} appearance:none; cursor:pointer; background-color: white; ${s4 ? "" : "color: #9ca3af;"}"
1391
- ${l2 ? "required" : ""}
1521
+ style="${p2} appearance:none; cursor:pointer; background-color: white; ${r4 ? "" : "color: #9ca3af;"}"
1522
+ ${c2 ? "required" : ""}
1392
1523
  >
1393
- <option value="" ${s4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
1524
+ <option value="" ${r4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
1394
1525
  ${e5}
1395
1526
  </select>
1396
1527
  </div>
@@ -1398,11 +1529,11 @@ function renderDynamicFields(e2, t2) {
1398
1529
  }
1399
1530
  return null;
1400
1531
  case "option":
1401
- if (c2 && c2.length > 0) {
1402
- const e5 = c2.map((e6) => {
1532
+ if (l2 && l2.length > 0) {
1533
+ const e5 = l2.map((e6) => {
1403
1534
  const n5 = e6.id || e6.value || e6, i4 = e6.value || e6.name || e6;
1404
1535
  return `<option value="${n5}" ${t3 === n5 ? "selected" : ""}>${i4}</option>`;
1405
- }).join(""), n4 = t3 && c2.some((e6) => (e6.id || e6.value || e6) === t3);
1536
+ }).join(""), n4 = t3 && l2.some((e6) => (e6.id || e6.value || e6) === t3);
1406
1537
  return `
1407
1538
  <div>
1408
1539
  <label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
@@ -1413,7 +1544,7 @@ function renderDynamicFields(e2, t2) {
1413
1544
  class="sf-dynamic-field"
1414
1545
  data-field-id="${i3}"
1415
1546
  style="${p2} appearance:none; cursor:pointer; background-color: white; ${n4 ? "" : "color: #9ca3af;"}"
1416
- ${l2 ? "required" : ""}
1547
+ ${c2 ? "required" : ""}
1417
1548
  >
1418
1549
  <option value="" ${n4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
1419
1550
  ${e5}
@@ -1423,7 +1554,7 @@ function renderDynamicFields(e2, t2) {
1423
1554
  }
1424
1555
  return null;
1425
1556
  case "array":
1426
- return "labels" === r2 ? null : c2 && c2.length > 0 ? renderCustomMultiSelect(i3, o3, c2, Array.isArray(t3) ? t3 : [], l2) : null;
1557
+ return "labels" === s2 ? null : l2 && l2.length > 0 ? renderCustomMultiSelect(i3, o3, l2, Array.isArray(t3) ? t3 : [], c2) : null;
1427
1558
  case "parent":
1428
1559
  case "issuelink":
1429
1560
  return `
@@ -1439,7 +1570,7 @@ function renderDynamicFields(e2, t2) {
1439
1570
  value="${t3 || ""}"
1440
1571
  placeholder="e.g., PROJ-123"
1441
1572
  style="${p2}"
1442
- ${l2 ? "required" : ""}
1573
+ ${c2 ? "required" : ""}
1443
1574
  />
1444
1575
  </div>
1445
1576
  `;
@@ -1457,27 +1588,27 @@ function renderDynamicFields(e2, t2) {
1457
1588
  value="${t3 || ""}"
1458
1589
  placeholder="Enter ${o3.toLowerCase()}"
1459
1590
  style="${p2}"
1460
- ${l2 ? "required" : ""}
1591
+ ${c2 ? "required" : ""}
1461
1592
  />
1462
1593
  </div>
1463
1594
  ` : null;
1464
1595
  }
1465
- })(e3, pe.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
1466
- n2.innerHTML = s2 || "", i2.forEach((e3) => {
1596
+ })(e3, xe.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
1597
+ n2.innerHTML = r2 || "", i2.forEach((e3) => {
1467
1598
  var _a;
1468
1599
  const t3 = e3.fieldId || e3.key, n3 = (_a = e3.schema) == null ? void 0 : _a.type, i3 = e3.allowedValues;
1469
1600
  "array" === n3 && i3 && i3.length > 0 && setupCustomMultiSelectListeners(t3, (e4) => {
1470
- pe.engTicketCustomFields[t3] = e4;
1601
+ xe.engTicketCustomFields[t3] = e4;
1471
1602
  });
1472
1603
  });
1473
1604
  }
1474
1605
  function generateEngTicketFieldsHTML() {
1475
1606
  var _a;
1476
- const e2 = xe.integrationData;
1607
+ const e2 = De.integrationData;
1477
1608
  if (!e2) return "";
1478
1609
  const t2 = "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase());
1479
1610
  let n2 = "<div style='display:flex; flex-direction:column; gap:12px;'>";
1480
- return e2.teams && Array.isArray(e2.teams) && e2.teams.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-team" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Team\n </label>\n <select id="sf-eng-ticket-team"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select team...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-project" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Project\n </label>\n <select id="sf-eng-ticket-project"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project...</option>\n </select>\n </div>\n ', t2 && (n2 += '\n <div>\n <label for="sf-eng-ticket-type" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Issue Type\n </label>\n <select id="sf-eng-ticket-type"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project first...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-priority" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Priority\n </label>\n <select id="sf-eng-ticket-priority"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white;">\n </select>\n </div>\n ', e2.labels && Array.isArray(e2.labels) && e2.labels.length > 0 && (n2 += renderCustomMultiSelect("sf-eng-ticket-labels", "Labels", e2.labels, pe.engTicketLabels, false)), t2 && e2.sprints && Array.isArray(e2.sprints) && e2.sprints.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-sprint" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Sprint\n </label>\n <select id="sf-eng-ticket-sprint"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select sprint...</option>\n </select>\n </div>\n '), n2 += '\n <div id="sf-dynamic-fields-container" style="display: flex; flex-direction: column; gap: 12px;"></div>\n ', n2 += "</div>", n2;
1611
+ return e2.teams && Array.isArray(e2.teams) && e2.teams.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-team" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Team\n </label>\n <select id="sf-eng-ticket-team"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select team...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-project" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Project\n </label>\n <select id="sf-eng-ticket-project"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project...</option>\n </select>\n </div>\n ', t2 && (n2 += '\n <div>\n <label for="sf-eng-ticket-type" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Issue Type\n </label>\n <select id="sf-eng-ticket-type"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project first...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-priority" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Priority\n </label>\n <select id="sf-eng-ticket-priority"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white;">\n </select>\n </div>\n ', e2.labels && Array.isArray(e2.labels) && e2.labels.length > 0 && (n2 += renderCustomMultiSelect("sf-eng-ticket-labels", "Labels", e2.labels, xe.engTicketLabels, false)), t2 && e2.sprints && Array.isArray(e2.sprints) && e2.sprints.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-sprint" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Sprint\n </label>\n <select id="sf-eng-ticket-sprint"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select sprint...</option>\n </select>\n </div>\n '), n2 += '\n <div id="sf-dynamic-fields-container" style="display: flex; flex-direction: column; gap: 12px;"></div>\n ', n2 += "</div>", n2;
1481
1612
  }
1482
1613
  function getShortcutKeyCmdCtrlLabel() {
1483
1614
  return (function isMacPlatform() {
@@ -1491,19 +1622,19 @@ function getShortcutLabelFromContext(e2) {
1491
1622
  return e3.requireCmdCtrl && t2.push(getShortcutKeyCmdCtrlLabel()), t2.push((function formatShortcutKeyLabel(e4) {
1492
1623
  return ({ escape: "esc" }[e4.toLowerCase()] || e4).toUpperCase();
1493
1624
  })(e3.key)), t2.map((e4) => `<span style="background: #F1F5F9; border:1px solid #cbd5e1; border-radius: 4px; padding: 0 4px; font-weight: 500; font-size: 12px; color: #94A3B8; line-height: 16px;">${e4}</span>`).join(e3.requireCmdCtrl ? " + " : "");
1494
- })(xe.shortcuts[e2]);
1625
+ })(De.shortcuts[e2]);
1495
1626
  }
1496
1627
  function getSessionIdSafely() {
1497
- if (!xe.resolveSessionId) throw new Error("getSessionId not defined");
1498
- return xe.resolveSessionId();
1628
+ if (!De.resolveSessionId) throw new Error("getSessionId not defined");
1629
+ return De.resolveSessionId();
1499
1630
  }
1500
1631
  function openReportIssueModal(e2) {
1501
- he ? stopRecording() : (Te = (e2 == null ? void 0 : e2.showEngTicketFields) ?? xe.showEngTicketFieldsDefault, injectModalHTML(), Ie && document.body.appendChild(Ie));
1632
+ Ce ? stopRecording() : (Be = (e2 == null ? void 0 : e2.showEngTicketFields) ?? De.showEngTicketFieldsDefault, injectModalHTML(), Pe && document.body.appendChild(Pe));
1502
1633
  }
1503
1634
  function closeModal() {
1504
- xe.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (Ie == null ? void 0 : Ie.parentNode) && Ie.parentNode.removeChild(Ie), Ie = null, he || (function resetState() {
1505
- pe = getInitialState(), fe = null, ge = null, ye = false;
1506
- })(), me && (clearInterval(me), setTimerInterval(null));
1635
+ De.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (Pe == null ? void 0 : Pe.parentNode) && Pe.parentNode.removeChild(Pe), Pe = null, Ce || (function resetState() {
1636
+ xe = getInitialState(), Te = null, Ie = null, Me = false;
1637
+ })(), Ee && (clearInterval(Ee), setTimerInterval(null));
1507
1638
  }
1508
1639
  function activateModalIsolation(e2) {
1509
1640
  e2.setAttribute("role", "dialog"), e2.setAttribute("aria-modal", "true"), e2.hasAttribute("tabindex") || e2.setAttribute("tabindex", "-1");
@@ -1520,10 +1651,10 @@ function activateModalIsolation(e2) {
1520
1651
  n3 && (e2.contains(n3) || (t3.stopImmediatePropagation(), t3.preventDefault(), refocus()));
1521
1652
  }, o2 = ["mousedown", "mouseup", "click", "pointerdown", "pointerup", "touchstart", "touchend", "wheel", "keydown", "keyup", "focus", "focusin", "focusout", "blur"];
1522
1653
  o2.forEach((e3) => document.addEventListener(e3, quarantine, true));
1523
- let s2 = 0, r2 = null;
1654
+ let r2 = 0, s2 = null;
1524
1655
  const a2 = t2 instanceof HTMLTextAreaElement ? t2 : null, refocus = () => {
1525
- if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 && r2) try {
1526
- a2.setSelectionRange(r2.start, r2.end, "none");
1656
+ if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 && s2) try {
1657
+ a2.setSelectionRange(s2.start, s2.end, "none");
1527
1658
  } catch {
1528
1659
  }
1529
1660
  }, selectionInsideModal = () => {
@@ -1536,17 +1667,17 @@ function activateModalIsolation(e2) {
1536
1667
  }
1537
1668
  return false;
1538
1669
  };
1539
- let l2 = 0;
1670
+ let c2 = 0;
1540
1671
  const watchdog = () => {
1541
1672
  const t3 = document.activeElement, n3 = t3 === document.body || null == t3 || !e2.contains(t3), i3 = selectionInsideModal();
1542
- n3 && !i3 ? (l2 += 1, l2 >= 2 && (refocus(), l2 = 0)) : (l2 = 0, (() => {
1673
+ n3 && !i3 ? (c2 += 1, c2 >= 2 && (refocus(), c2 = 0)) : (c2 = 0, (() => {
1543
1674
  if (a2 && document.activeElement === a2) try {
1544
- r2 = { start: a2.selectionStart ?? a2.value.length, end: a2.selectionEnd ?? a2.value.length };
1675
+ s2 = { start: a2.selectionStart ?? a2.value.length, end: a2.selectionEnd ?? a2.value.length };
1545
1676
  } catch {
1546
1677
  }
1547
- })()), s2 = window.requestAnimationFrame(watchdog);
1678
+ })()), r2 = window.requestAnimationFrame(watchdog);
1548
1679
  };
1549
- s2 = window.requestAnimationFrame(watchdog);
1680
+ r2 = window.requestAnimationFrame(watchdog);
1550
1681
  const onBlurLike = () => {
1551
1682
  setTimeout(() => {
1552
1683
  const t3 = document.activeElement;
@@ -1558,13 +1689,13 @@ function activateModalIsolation(e2) {
1558
1689
  n2.remove(), i2.remove();
1559
1690
  } catch {
1560
1691
  }
1561
- o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), s2 && cancelAnimationFrame(s2);
1692
+ o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), r2 && cancelAnimationFrame(r2);
1562
1693
  };
1563
1694
  }
1564
1695
  function injectModalHTML(e2 = "lookback") {
1565
- Ie && (Ie.remove(), Ie = null), Ie = document.createElement("div"), Ie.id = "sf-report-issue-modal";
1696
+ Pe && (Pe.remove(), Pe = null), Pe = document.createElement("div"), Pe.id = "sf-report-issue-modal";
1566
1697
  const t2 = "startnow" === e2;
1567
- Ie.innerHTML = `
1698
+ Pe.innerHTML = `
1568
1699
  <div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
1569
1700
  <div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
1570
1701
  background:#fff; border-radius:12px;
@@ -1619,7 +1750,7 @@ function injectModalHTML(e2 = "lookback") {
1619
1750
  <textarea id="sf-issue-description" placeholder="Add description here"
1620
1751
  style="width:100%; height:80px; padding:8px 12px; font-size:14px;
1621
1752
  border:1px solid #cbd5e1; border-radius:6px; margin-bottom:20px;
1622
- resize:none; outline:none;">${pe.description}</textarea>
1753
+ resize:none; outline:none;">${xe.description}</textarea>
1623
1754
 
1624
1755
  <!-- When did this happen Section -->
1625
1756
  <div id="sf-lookback-container" style="display:${t2 ? "none" : "block"}; margin-bottom:20px;">
@@ -1685,34 +1816,34 @@ function injectModalHTML(e2 = "lookback") {
1685
1816
  <!-- Checkboxes on same line -->
1686
1817
  <div style="display:flex; align-items:center; gap:24px; margin-bottom:16px;">
1687
1818
  <label style="display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
1688
- <input type="checkbox" id="sf-create-issue-checkbox" ${pe.createIssue ? "checked" : ""}
1819
+ <input type="checkbox" id="sf-create-issue-checkbox" ${xe.createIssue ? "checked" : ""}
1689
1820
  style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
1690
1821
  Create an Issue
1691
1822
  </label>
1692
1823
 
1693
- <label id="sf-create-eng-ticket-label" style="display:${xe.integrationData && Te ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
1694
- <input type="checkbox" id="sf-create-eng-ticket-checkbox" ${pe.createEngTicket ? "checked" : ""}
1824
+ <label id="sf-create-eng-ticket-label" style="display:${De.integrationData && Be ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
1825
+ <input type="checkbox" id="sf-create-eng-ticket-checkbox" ${xe.createEngTicket ? "checked" : ""}
1695
1826
  style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
1696
1827
  Create an Eng Ticket
1697
1828
  </label>
1698
1829
  </div>
1699
1830
 
1700
1831
  <!-- Issue Title Field (always shown when create issue is checked) -->
1701
- <div id="sf-issue-fields-container" style="display:${pe.createIssue ? "block" : "none"};">
1832
+ <div id="sf-issue-fields-container" style="display:${xe.createIssue ? "block" : "none"};">
1702
1833
  <div style="display:flex; flex-direction:column; gap:12px;">
1703
1834
  <div>
1704
1835
  <label for="sf-issue-name" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
1705
1836
  Title <span style="color:#ef4444;">*</span>
1706
1837
  </label>
1707
1838
  <input type="text" id="sf-issue-name" placeholder="Enter title"
1708
- value="${pe.issueName}"
1839
+ value="${xe.issueName}"
1709
1840
  style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;">
1710
1841
  </div>
1711
1842
  </div>
1712
1843
  </div>
1713
1844
 
1714
1845
  <!-- Engineering Ticket Fields (shown when create eng ticket is checked) -->
1715
- <div id="sf-eng-ticket-fields-container" style="display:${pe.createEngTicket && xe.integrationData ? "block" : "none"}; margin-top: ${pe.createIssue ? "12px" : "0"};">
1846
+ <div id="sf-eng-ticket-fields-container" style="display:${xe.createEngTicket && De.integrationData ? "block" : "none"}; margin-top: ${xe.createIssue ? "12px" : "0"};">
1716
1847
  ${generateEngTicketFieldsHTML()}
1717
1848
  </div>
1718
1849
  </div>
@@ -1755,8 +1886,8 @@ function injectModalHTML(e2 = "lookback") {
1755
1886
  </div>
1756
1887
  </div>
1757
1888
  </div>
1758
- `, pe.mode = e2, document.body.appendChild(Ie), (function bindListeners() {
1759
- const e3 = Ie == null ? void 0 : Ie.querySelectorAll(".sf-issue-tab"), t3 = document.getElementById("sf-start-recording-btn"), n2 = document.getElementById("sf-modal-close-btn"), i2 = document.getElementById("sf-issue-submit-btn"), o2 = document.getElementById("sf-lookback-minutes");
1889
+ `, xe.mode = e2, document.body.appendChild(Pe), (function bindListeners() {
1890
+ const e3 = Pe == null ? void 0 : Pe.querySelectorAll(".sf-issue-tab"), t3 = document.getElementById("sf-start-recording-btn"), n2 = document.getElementById("sf-modal-close-btn"), i2 = document.getElementById("sf-issue-submit-btn"), o2 = document.getElementById("sf-lookback-minutes");
1760
1891
  e3 == null ? void 0 : e3.forEach((e4) => {
1761
1892
  e4.addEventListener("click", (e5) => {
1762
1893
  const t4 = e5.currentTarget.dataset.mode;
@@ -1764,10 +1895,10 @@ function injectModalHTML(e2 = "lookback") {
1764
1895
  });
1765
1896
  }), n2 && (n2.onclick = closeModal);
1766
1897
  o2 && o2.addEventListener("change", () => {
1767
- "lookback" === pe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
1898
+ "lookback" === xe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
1768
1899
  });
1769
- const s2 = Ie == null ? void 0 : Ie.querySelectorAll(".sf-collapsible-header");
1770
- s2 == null ? void 0 : s2.forEach((e4) => {
1900
+ const r2 = Pe == null ? void 0 : Pe.querySelectorAll(".sf-collapsible-header");
1901
+ r2 == null ? void 0 : r2.forEach((e4) => {
1771
1902
  e4.addEventListener("click", (e5) => {
1772
1903
  const t4 = e5.currentTarget, n3 = t4.dataset.target, i3 = document.getElementById(n3), o3 = t4.querySelector(".sf-chevron");
1773
1904
  if (i3 && o3) {
@@ -1778,22 +1909,22 @@ function injectModalHTML(e2 = "lookback") {
1778
1909
  }
1779
1910
  });
1780
1911
  });
1781
- const r2 = document.getElementById("sf-create-issue-checkbox"), a2 = document.getElementById("sf-issue-fields-container"), l2 = document.getElementById("sf-create-eng-ticket-checkbox"), c2 = document.getElementById("sf-eng-ticket-fields-container");
1782
- r2 && r2.addEventListener("change", () => {
1783
- const e4 = r2.checked;
1784
- pe.createIssue = e4, localStorage.setItem(de, String(e4)), a2 && (a2.style.display = e4 ? "block" : "none"), !e4 && l2 && (l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"));
1912
+ const s2 = document.getElementById("sf-create-issue-checkbox"), a2 = document.getElementById("sf-issue-fields-container"), c2 = document.getElementById("sf-create-eng-ticket-checkbox"), l2 = document.getElementById("sf-eng-ticket-fields-container");
1913
+ s2 && s2.addEventListener("change", () => {
1914
+ const e4 = s2.checked;
1915
+ xe.createIssue = e4, localStorage.setItem(we, String(e4)), a2 && (a2.style.display = e4 ? "block" : "none"), !e4 && c2 && (c2.checked = false, xe.createEngTicket = false, localStorage.setItem(ke, "false"), l2 && (l2.style.display = "none"));
1785
1916
  });
1786
- l2 && l2.addEventListener("change", async () => {
1917
+ c2 && c2.addEventListener("change", async () => {
1787
1918
  var _a;
1788
- const e4 = l2.checked;
1789
- if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"), r2 && (r2.checked = true), a2 && (a2.style.display = "block")), c2 && (c2.style.display = e4 ? "block" : "none"), e4) {
1790
- 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.");
1919
+ const e4 = c2.checked;
1920
+ if (xe.createEngTicket = e4, localStorage.setItem(ke, String(e4)), e4 && !xe.createIssue && (xe.createIssue = true, localStorage.setItem(we, "true"), s2 && (s2.checked = true), a2 && (a2.style.display = "block")), l2 && (l2.style.display = e4 ? "block" : "none"), e4) {
1921
+ if (!hasValidIntegration()) return c2.checked = false, xe.createEngTicket = false, localStorage.setItem(ke, "false"), l2 && (l2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
1791
1922
  const e5 = getIntegrationData();
1792
1923
  if (e5) {
1793
- 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) {
1794
- if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
1924
+ if (!xe.engTicketTeam && e5.defaultTeam && (xe.engTicketTeam = e5.defaultTeam), !xe.engTicketProject && e5.defaultProject && (xe.engTicketProject = e5.defaultProject), !xe.engTicketPriority && e5.defaultPriority && (xe.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(xe), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && xe.engTicketProject && !xe.engTicketCustomFields.reporter) {
1925
+ if (getFieldsForProject(xe.engTicketProject, xe.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
1795
1926
  const t5 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1796
- pe.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
1927
+ xe.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
1797
1928
  }
1798
1929
  }
1799
1930
  const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
@@ -1803,11 +1934,11 @@ function injectModalHTML(e2 = "lookback") {
1803
1934
  });
1804
1935
  const d2 = document.getElementById("sf-issue-name");
1805
1936
  d2 && d2.addEventListener("input", () => {
1806
- pe.issueName = d2.value;
1937
+ xe.issueName = d2.value;
1807
1938
  });
1808
1939
  bindEngTicketListeners(), t3 && (t3.onclick = () => {
1809
1940
  const e4 = document.getElementById("sf-issue-description");
1810
- e4 && (pe.description = e4.value), (function startCountdownThenRecord() {
1941
+ e4 && (xe.description = e4.value), (function startCountdownThenRecord() {
1811
1942
  if (document.getElementById("sf-countdown-overlay")) return;
1812
1943
  const e5 = document.createElement("div");
1813
1944
  e5.id = "sf-countdown-overlay", e5.style.cssText = "\n position: fixed;\n inset: 0;\n background: rgba(0,0,0,0.6);\n z-index: 10001;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 80px;\n font-weight: bold;\n color: white;\n font-family: sans-serif;\n ";
@@ -1817,10 +1948,10 @@ function injectModalHTML(e2 = "lookback") {
1817
1948
  if (t4--, t4 > 0) e5.textContent = t4.toString();
1818
1949
  else {
1819
1950
  clearInterval(n3), document.body.removeChild(e5), (function setRecordingStartTime(e6) {
1820
- fe = e6;
1951
+ Te = e6;
1821
1952
  })(Date.now()), setIsRecording(true);
1822
1953
  try {
1823
- const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() => q);
1954
+ const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() => Z);
1824
1955
  e6();
1825
1956
  } catch (e6) {
1826
1957
  console.error("[Report Issue] Failed to enable function span tracking:", e6);
@@ -1847,7 +1978,7 @@ function injectModalHTML(e2 = "lookback") {
1847
1978
  const t5 = e6.querySelector("#sf-recording-timer");
1848
1979
  if (!t5) return;
1849
1980
  const n4 = setInterval(() => {
1850
- const e7 = Date.now() - (fe ?? Date.now()), n5 = Math.floor(e7 / 6e4).toString().padStart(2, "0"), i3 = Math.floor(e7 % 6e4 / 1e3).toString().padStart(2, "0");
1981
+ const e7 = Date.now() - (Te ?? Date.now()), n5 = Math.floor(e7 / 6e4).toString().padStart(2, "0"), i3 = Math.floor(e7 % 6e4 / 1e3).toString().padStart(2, "0");
1851
1982
  t5.textContent = `${n5}:${i3}`;
1852
1983
  }, 1e3);
1853
1984
  setTimerInterval(n4);
@@ -1856,33 +1987,41 @@ function injectModalHTML(e2 = "lookback") {
1856
1987
  }, 1e3);
1857
1988
  })();
1858
1989
  });
1859
- Ie == null ? void 0 : Ie.addEventListener("click", (e4) => {
1990
+ Pe == null ? void 0 : Pe.addEventListener("click", (e4) => {
1860
1991
  var _a;
1861
1992
  if (e4.target.closest("#sf-issue-submit-btn")) {
1862
- const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 = pe.mode;
1863
- if (pe.description = e5, pe.createIssue && !pe.issueName.trim()) return void alert("Issue title is required when creating an issue.");
1993
+ const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 = xe.mode;
1994
+ if (xe.description = e5, xe.createIssue && !xe.issueName.trim()) return void alert("Issue title is required when creating an issue.");
1864
1995
  let n3, i3;
1865
- if ("startnow" === t4) n3 = fe ?? Date.now() - 3e5, i3 = ge ?? Date.now();
1996
+ if ("startnow" === t4) n3 = Te ?? Date.now() - 3e5, i3 = Ie ?? Date.now();
1866
1997
  else {
1867
1998
  const e6 = 60 * Number((o2 == null ? void 0 : o2.value) || "2") * 1e3;
1868
1999
  i3 = Date.now(), n3 = i3 - e6;
1869
2000
  }
1870
- if (pe.createIssue) {
1871
- const o3 = document.getElementById("sf-issue-name"), s3 = document.getElementById("sf-eng-ticket-team"), r3 = document.getElementById("sf-eng-ticket-project"), a3 = 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 = (r3 == null ? void 0 : r3.value) || "", f2 = a3 ? Number(a3.value) : 0, g2 = pe.engTicketLabels, m2 = (l3 == null ? void 0 : l3.value) || "", h2 = { ...pe.engTicketCustomFields };
2001
+ if (xe.createIssue) {
2002
+ const o3 = document.getElementById("sf-issue-name"), r3 = document.getElementById("sf-eng-ticket-team"), s3 = document.getElementById("sf-eng-ticket-project"), a3 = document.getElementById("sf-eng-ticket-priority"), c3 = document.getElementById("sf-eng-ticket-type"), l3 = (o3 == null ? void 0 : o3.value) || "", d3 = e5, u2 = (r3 == null ? void 0 : r3.value) || "", p2 = (s3 == null ? void 0 : s3.value) || "", f2 = a3 ? Number(a3.value) : 0, g2 = xe.engTicketLabels, m2 = (c3 == null ? void 0 : c3.value) || "", h2 = { ...xe.engTicketCustomFields };
1872
2003
  document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
1873
2004
  const t5 = e6, n4 = t5.dataset.fieldId;
1874
2005
  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));
1875
2006
  });
1876
- const y2 = document.getElementById("sf-eng-ticket-sprint"), S2 = (y2 == null ? void 0 : y2.value) || pe.engTicketSprint;
2007
+ const y2 = document.getElementById("sf-eng-ticket-sprint"), S2 = (y2 == null ? void 0 : y2.value) || xe.engTicketSprint;
1877
2008
  if (S2) {
1878
2009
  const e6 = getSprintFieldId();
1879
2010
  h2[e6] = parseInt(S2, 10);
1880
2011
  }
1881
- closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, s4, r4, a4, l4, c4, d4, u3, p3) {
2012
+ const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length), b2 = (getFieldsForProject(p2, m2) || []).filter((e6) => e6 && e6.required), v2 = [];
2013
+ for (const e6 of b2) {
2014
+ const t5 = e6.fieldId || e6.key;
2015
+ if ("summary" === t5 || "description" === t5 || "priority" === t5) continue;
2016
+ let n4, i4;
2017
+ "project" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-project"), i4 = p2) : "issuetype" === t5 ? (n4 = !!document.getElementById("sf-eng-ticket-type"), i4 = m2) : (n4 = !!document.querySelector(`[data-field-id="${t5}"]`), i4 = h2[t5]), n4 && isFieldEmpty(i4) && v2.push(e6.name || t5);
2018
+ }
2019
+ if (v2.length > 0) return void alert(`Please fill in the required field${v2.length > 1 ? "s" : ""}: ${v2.join(", ")}`);
2020
+ closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3) {
1882
2021
  var _a2, _b, _c;
1883
2022
  try {
1884
2023
  showStatusModal(true);
1885
- const f3 = await createTriageAndIssueFromRecorder(xe.apiKey, xe.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, s4, r4, a4, l4, c4, d4, u3, p3);
2024
+ const f3 = await createTriageAndIssueFromRecorder(De.apiKey, De.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3);
1886
2025
  if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
1887
2026
  const e7 = f3.errors.map((e8) => e8.message).join("; ");
1888
2027
  return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
@@ -1892,33 +2031,33 @@ function injectModalHTML(e2 = "lookback") {
1892
2031
  } catch (e7) {
1893
2032
  console.error("Error creating triage and issue:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
1894
2033
  }
1895
- })(`${n3}`, `${i3}`, e5, c3, d3, pe.createEngTicket, u2, p2, f2, g2, m2, h2, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
2034
+ })(`${n3}`, `${i3}`, e5, l3, d3, xe.createEngTicket, u2, p2, f2, g2, m2, h2, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
1896
2035
  } else closeModal(), (async function createTriage(e6, t5, n4, i4) {
1897
2036
  var _a2, _b, _c;
1898
2037
  try {
1899
2038
  showStatusModal(true);
1900
- const o3 = await createTriageFromRecorder(xe.apiKey, xe.backendApi, getSessionIdSafely(), e6, t5, n4, i4);
2039
+ const o3 = await createTriageFromRecorder(De.apiKey, De.backendApi, getSessionIdSafely(), e6, t5, n4, i4);
1901
2040
  if ((_a2 = o3 == null ? void 0 : o3.errors) == null ? void 0 : _a2.length) {
1902
2041
  const e7 = o3.errors.map((e8) => e8.message).join("; ");
1903
2042
  return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
1904
2043
  }
1905
- const s3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
1906
- 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."));
2044
+ const r3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
2045
+ r3 ? showStatusModal(false, { type: "triage", id: r3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
1907
2046
  } catch (e7) {
1908
2047
  console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
1909
2048
  }
1910
2049
  })(`${n3}`, `${i3}`, e5, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
1911
2050
  }
1912
2051
  });
1913
- })(), xe.deactivateIsolation = activateModalIsolation(Ie), xe.integrationData && pe.createEngTicket ? initializeEngTicketForm() : xe.integrationData || (pe.createEngTicket = false), xe.apiKey && xe.backendApi && refreshIntegrationData(xe.apiKey, xe.backendApi).then((e3) => {
2052
+ })(), De.deactivateIsolation = activateModalIsolation(Pe), De.integrationData && xe.createEngTicket ? initializeEngTicketForm() : De.integrationData || (xe.createEngTicket = false), De.apiKey && De.backendApi && refreshIntegrationData(De.apiKey, De.backendApi).then((e3) => {
1914
2053
  if (!e3 || !document.getElementById("sf-report-issue-modal")) return;
1915
- xe.integrationData = e3;
2054
+ De.integrationData = e3;
1916
2055
  const t3 = document.getElementById("sf-eng-ticket-fields-container");
1917
2056
  if (t3) {
1918
2057
  const e4 = generateEngTicketFieldsHTML();
1919
- e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(pe), renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType));
2058
+ e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(xe), renderDynamicFields(xe.engTicketProject, xe.engTicketIssueType));
1920
2059
  }
1921
- if (Te) {
2060
+ if (Be) {
1922
2061
  const e4 = document.getElementById("sf-create-eng-ticket-label");
1923
2062
  e4 && (e4.style.display = "flex");
1924
2063
  }
@@ -1926,40 +2065,40 @@ function injectModalHTML(e2 = "lookback") {
1926
2065
  }
1927
2066
  function initializeEngTicketForm() {
1928
2067
  var _a;
1929
- const e2 = xe.integrationData;
2068
+ const e2 = De.integrationData;
1930
2069
  if (e2) {
1931
- 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) {
1932
- if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
2070
+ if (!xe.engTicketTeam && e2.defaultTeam && (xe.engTicketTeam = e2.defaultTeam), !xe.engTicketProject && e2.defaultProject && (xe.engTicketProject = e2.defaultProject), !xe.engTicketPriority && e2.defaultPriority && (xe.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(xe), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && xe.engTicketProject && !xe.engTicketCustomFields.reporter) {
2071
+ if (getFieldsForProject(xe.engTicketProject, xe.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
1933
2072
  const t2 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1934
- pe.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
2073
+ xe.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
1935
2074
  }
1936
2075
  }
1937
- pe.engTicketProject && renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType);
2076
+ xe.engTicketProject && renderDynamicFields(xe.engTicketProject, xe.engTicketIssueType);
1938
2077
  }
1939
2078
  }
1940
2079
  function setActiveTab(e2) {
1941
- pe.mode = e2;
1942
- const t2 = Ie == null ? void 0 : Ie.querySelector("#sf-tab-lookback"), n2 = Ie == null ? void 0 : Ie.querySelector("#sf-tab-startnow");
2080
+ xe.mode = e2;
2081
+ const t2 = Pe == null ? void 0 : Pe.querySelector("#sf-tab-lookback"), n2 = Pe == null ? void 0 : Pe.querySelector("#sf-tab-startnow");
1943
2082
  "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");
1944
2083
  }
1945
2084
  function updateModeSpecificUI(e2) {
1946
- 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"), r2 = document.getElementById("sf-modal-footer"), a2 = document.getElementById("sf-lookback-container");
1947
- if (t2 && n2 && i2 && o2 && s2 && r2 && a2) if ("startnow" === e2) {
1948
- i2.style.display = "block", a2.style.display = "none", r2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
1949
- const e3 = null !== fe && null !== ge;
1950
- if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", fe && ge) {
1951
- const e4 = Math.floor((ge - fe) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
1952
- o2.style.display = "block", s2.textContent = `${t3}:${n3}`;
2085
+ 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"), r2 = document.getElementById("sf-recording-timer-display"), s2 = document.getElementById("sf-modal-footer"), a2 = document.getElementById("sf-lookback-container");
2086
+ if (t2 && n2 && i2 && o2 && r2 && s2 && a2) if ("startnow" === e2) {
2087
+ i2.style.display = "block", a2.style.display = "none", s2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
2088
+ const e3 = null !== Te && null !== Ie;
2089
+ if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", Te && Ie) {
2090
+ const e4 = Math.floor((Ie - Te) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
2091
+ o2.style.display = "block", r2.textContent = `${t3}:${n3}`;
1953
2092
  } else o2.style.display = "none";
1954
- } else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block", r2.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";
2093
+ } else i2.style.display = "none", o2.style.display = "none", a2.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";
1955
2094
  }
1956
2095
  function bindEngTicketListeners() {
1957
- 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");
2096
+ 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"), r2 = document.getElementById("sf-eng-ticket-sprint");
1958
2097
  e2 && e2.addEventListener("change", () => {
1959
- pe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
2098
+ xe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
1960
2099
  const t3 = document.getElementById("sf-eng-ticket-project");
1961
2100
  if (t3) {
1962
- pe.engTicketProject = "", pe.engTicketCustomFields = {};
2101
+ xe.engTicketProject = "", xe.engTicketCustomFields = {};
1963
2102
  const n3 = getProjectsForTeam(e2.value);
1964
2103
  t3.innerHTML = '<option value="">Select project...</option>', n3.forEach((e3) => {
1965
2104
  const n4 = document.createElement("option");
@@ -1968,41 +2107,41 @@ function bindEngTicketListeners() {
1968
2107
  }
1969
2108
  }), t2 && t2.addEventListener("change", () => {
1970
2109
  var _a;
1971
- pe.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", pe.engTicketCustomFields = {};
2110
+ xe.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", xe.engTicketCustomFields = {};
1972
2111
  const e3 = getIntegrationData();
1973
- if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), pe.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
1974
- if (getFieldsForProject(t2.value, pe.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
2112
+ if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), xe.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
2113
+ if (getFieldsForProject(t2.value, xe.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
1975
2114
  const t3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
1976
- pe.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
2115
+ xe.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
1977
2116
  }
1978
2117
  }
1979
- renderDynamicFields(t2.value, pe.engTicketIssueType);
1980
- }), s2 && s2.addEventListener("change", () => {
1981
- pe.engTicketSprint = s2.value, s2.style.color = s2.value ? "" : "#9ca3af", setSprintDefaulted(true);
2118
+ renderDynamicFields(t2.value, xe.engTicketIssueType);
2119
+ }), r2 && r2.addEventListener("change", () => {
2120
+ xe.engTicketSprint = r2.value, r2.style.color = r2.value ? "" : "#9ca3af", setSprintDefaulted(true);
1982
2121
  }), n2 && n2.addEventListener("change", () => {
1983
- pe.engTicketPriority = Number(n2.value);
2122
+ xe.engTicketPriority = Number(n2.value);
1984
2123
  }), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
1985
- pe.engTicketLabels = e3;
2124
+ xe.engTicketLabels = e3;
1986
2125
  }), o2 && o2.addEventListener("change", () => {
1987
- pe.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
2126
+ xe.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
1988
2127
  const e3 = document.getElementById("sf-eng-ticket-project");
1989
2128
  if (e3 && e3.value) {
1990
- const t3 = pe.engTicketCustomFields.reporter;
1991
- pe.engTicketCustomFields = {}, t3 && (pe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
2129
+ const t3 = xe.engTicketCustomFields.reporter;
2130
+ xe.engTicketCustomFields = {}, t3 && (xe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
1992
2131
  }
1993
2132
  });
1994
- const r2 = document.getElementById("sf-dynamic-fields-container");
1995
- r2 && (r2.addEventListener("input", (e3) => {
2133
+ const s2 = document.getElementById("sf-dynamic-fields-container");
2134
+ s2 && (s2.addEventListener("input", (e3) => {
1996
2135
  const t3 = e3.target;
1997
2136
  if (t3.classList.contains("sf-dynamic-field")) {
1998
2137
  const e4 = t3.dataset.fieldId;
1999
- e4 && ("checkbox" === t3.type ? pe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? pe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : pe.engTicketCustomFields[e4] = t3.value);
2138
+ e4 && ("checkbox" === t3.type ? xe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? xe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : xe.engTicketCustomFields[e4] = t3.value);
2000
2139
  }
2001
- }), r2.addEventListener("change", (e3) => {
2140
+ }), s2.addEventListener("change", (e3) => {
2002
2141
  const t3 = e3.target;
2003
2142
  if (t3.classList.contains("sf-dynamic-field")) {
2004
2143
  const e4 = t3.dataset.fieldId;
2005
- if (e4 && (pe.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
2144
+ if (e4 && (xe.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
2006
2145
  const e5 = t3;
2007
2146
  e5.style.color = e5.value ? "" : "#9ca3af";
2008
2147
  }
@@ -2012,10 +2151,10 @@ function bindEngTicketListeners() {
2012
2151
  async function stopRecording() {
2013
2152
  var _a;
2014
2153
  !(function setRecordingEndTime(e2) {
2015
- ge = e2;
2016
- })(Date.now()), setIsRecording(false), me && (clearInterval(me), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
2154
+ Ie = e2;
2155
+ })(Date.now()), setIsRecording(false), Ee && (clearInterval(Ee), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
2017
2156
  try {
2018
- const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => q);
2157
+ const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => Z);
2019
2158
  e2();
2020
2159
  } catch (e2) {
2021
2160
  console.error("[Report Issue] Failed to disable function span tracking:", e2);
@@ -2028,18 +2167,18 @@ async function stopRecording() {
2028
2167
  t3 && (t3.textContent = "Re-record");
2029
2168
  }
2030
2169
  const t2 = document.getElementById("sf-recording-timer-label"), n2 = document.getElementById("sf-recording-timer-display");
2031
- if (t2 && n2 && fe && ge) {
2032
- const e3 = Math.floor((ge - fe) / 1e3), i3 = Math.floor(e3 / 60).toString().padStart(2, "0"), o3 = (e3 % 60).toString().padStart(2, "0");
2170
+ if (t2 && n2 && Te && Ie) {
2171
+ const e3 = Math.floor((Ie - Te) / 1e3), i3 = Math.floor(e3 / 60).toString().padStart(2, "0"), o3 = (e3 % 60).toString().padStart(2, "0");
2033
2172
  n2.textContent = `${i3}:${o3}`, t2.style.display = "block";
2034
2173
  }
2035
2174
  const i2 = document.getElementById("sf-issue-description");
2036
- i2 && (i2.value = pe.description);
2175
+ i2 && (i2.value = xe.description);
2037
2176
  const o2 = document.querySelector('input[value="startnow"]');
2038
2177
  o2 && (o2.checked = true);
2039
- const s2 = document.getElementById("sf-inline-record-chip"), r2 = document.getElementById("sf-inline-record-timer");
2040
- if (s2 && r2) {
2041
- 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");
2042
- r2.textContent = `${t3}:${n3}`, r2.style.color = "black", s2.style.display = "flex";
2178
+ const r2 = document.getElementById("sf-inline-record-chip"), s2 = document.getElementById("sf-inline-record-timer");
2179
+ if (r2 && s2) {
2180
+ const e3 = Math.floor(((Ie ?? 0) - (Te ?? 0)) / 1e3), t3 = Math.floor(e3 / 60).toString().padStart(2, "0"), n3 = Math.floor(e3 % 60).toString().padStart(2, "0");
2181
+ s2.textContent = `${t3}:${n3}`, s2.style.color = "black", r2.style.display = "flex";
2043
2182
  }
2044
2183
  const a2 = document.getElementById("sf-issue-submit-btn");
2045
2184
  a2.disabled = false, a2.style.opacity = "1", a2.style.cursor = "pointer";
@@ -2052,10 +2191,10 @@ function showStatusModal(e2, t2, n2) {
2052
2191
  var _a2, _b;
2053
2192
  (_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
2054
2193
  })();
2055
- const o2 = !e3 && i2, s2 = n3 ? `${xe.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${xe.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", r2 = document.createElement("div");
2056
- r2.id = "sf-triage-status-modal", Object.assign(r2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
2057
- const a2 = 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>';
2058
- r2.innerHTML = `
2194
+ const o2 = !e3 && i2, r2 = n3 ? `${De.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${De.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", s2 = document.createElement("div");
2195
+ s2.id = "sf-triage-status-modal", Object.assign(s2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
2196
+ const a2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!", c2 = 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>` : "", l2 = 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>';
2197
+ s2.innerHTML = `
2059
2198
  <div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
2060
2199
  <div id="sf-triage-card"
2061
2200
  style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
@@ -2072,8 +2211,8 @@ function showStatusModal(e2, t2, n2) {
2072
2211
  </button>
2073
2212
 
2074
2213
  <h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${a2}</h2>
2075
- ${l2}
2076
2214
  ${c2}
2215
+ ${l2}
2077
2216
 
2078
2217
  <div style="display:${o2 ? "none" : "flex"}; justify-content:flex-end; align-items:center; gap:8px;">
2079
2218
  <button id="sf-copy-triage-link"
@@ -2096,28 +2235,28 @@ function showStatusModal(e2, t2, n2) {
2096
2235
  <style>
2097
2236
  @keyframes spin { to { transform: rotate(360deg); } }
2098
2237
  </style>
2099
- `, document.body.appendChild(r2);
2100
- const u2 = r2.querySelector("#sf-triage-card");
2238
+ `, document.body.appendChild(s2);
2239
+ const u2 = s2.querySelector("#sf-triage-card");
2101
2240
  (_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
2102
- fadeCardAndRemove(r2, u2, 300);
2241
+ fadeCardAndRemove(s2, u2, 300);
2103
2242
  });
2104
2243
  const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
2105
2244
  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", () => {
2106
- navigator.clipboard.writeText(s2).then(() => {
2245
+ navigator.clipboard.writeText(r2).then(() => {
2107
2246
  const e4 = document.getElementById("sf-copied-status");
2108
2247
  e4 && (e4.style.display = "flex");
2109
2248
  });
2110
2249
  }), f2.disabled = false, f2.addEventListener("click", () => {
2111
- (t3 || n3) && window.open(s2, "_blank");
2112
- }), o2 || setTimeout(() => fadeCardAndRemove(r2, u2, 300), 1e4));
2250
+ (t3 || n3) && window.open(r2, "_blank");
2251
+ }), o2 || setTimeout(() => fadeCardAndRemove(s2, u2, 300), 1e4));
2113
2252
  })(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
2114
2253
  }
2115
2254
  function fadeCardAndRemove(e2, t2, n2 = 300) {
2116
2255
  t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
2117
2256
  }
2118
- const Ee = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: xe, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
2119
- xe.apiKey = e2.apiKey, xe.backendApi = e2.backendApi, xe.resolveSessionId = e2.getSessionId, xe.integrationData = e2.integrationData || null, xe.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (xe.triageBaseUrl = e2.customBaseUrl), xe.shortcuts = (function mergeShortcutsConfig(e3) {
2120
- const t3 = { ...ke };
2257
+ const _e = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: De, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
2258
+ De.apiKey = e2.apiKey, De.backendApi = e2.backendApi, De.resolveSessionId = e2.getSessionId, De.integrationData = e2.integrationData || null, De.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (De.triageBaseUrl = e2.customBaseUrl), De.shortcuts = (function mergeShortcutsConfig(e3) {
2259
+ const t3 = { ...Re };
2121
2260
  if (!e3) return t3;
2122
2261
  "boolean" == typeof e3.enabled && (t3.enabled = e3.enabled);
2123
2262
  const n2 = ["openModalExistingMode", "openModalCaptureNewMode", "closeModal", "submitReport", "startRecording", "stopRecording"];
@@ -2127,41 +2266,125 @@ const Ee = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
2127
2266
  }
2128
2267
  return t3;
2129
2268
  })(e2.shortcuts);
2130
- const { shortcuts: t2 } = xe;
2269
+ const { shortcuts: t2 } = De;
2131
2270
  window.addEventListener("keydown", (e3) => {
2132
2271
  const n2 = (function isTypingInInput() {
2133
2272
  const e4 = document.activeElement;
2134
2273
  return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
2135
- })(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, s2 = !!document.getElementById("sf-report-issue-modal"), r2 = !n2 && (t2.enabled || s2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, a2 = s2 ? (e4) => {
2274
+ })(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, r2 = !!document.getElementById("sf-report-issue-modal"), s2 = !n2 && (t2.enabled || r2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, a2 = r2 ? (e4) => {
2136
2275
  setActiveTab(e4), updateModeSpecificUI(e4);
2137
2276
  } : injectModalHTML;
2138
- if (r2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void a2("lookback");
2139
- if (r2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void a2("startnow");
2140
- if (s2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
2141
- if (s2 && shortcutUsed("submitReport")) {
2277
+ if (s2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void a2("lookback");
2278
+ if (s2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void a2("startnow");
2279
+ if (r2 && !Ce && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
2280
+ if (r2 && shortcutUsed("submitReport")) {
2142
2281
  const t3 = document.getElementById("sf-issue-submit-btn");
2143
2282
  return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
2144
2283
  }
2145
- if (he && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
2146
- if (s2 && "startnow" === pe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
2284
+ if (Ce && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
2285
+ if (r2 && "startnow" === xe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
2147
2286
  const t3 = document.getElementById("sf-start-recording-btn");
2148
2287
  return void (t3 && (e3.preventDefault(), t3.click()));
2149
2288
  }
2150
2289
  });
2151
- } }, Symbol.toStringTag, { value: "Module" })), Ce = readDebugFlag(), Me = /* @__PURE__ */ new Map();
2290
+ } }, Symbol.toStringTag, { value: "Module" })), Oe = /* @__PURE__ */ new WeakMap();
2291
+ function creationOf(e2) {
2292
+ const t2 = {};
2293
+ try {
2294
+ let n2 = e2;
2295
+ for (let e3 = 0; e3 < 8 && n2 && "object" == typeof n2; e3++) {
2296
+ const e4 = Oe.get(n2);
2297
+ if (e4) {
2298
+ t2.createId = e4;
2299
+ break;
2300
+ }
2301
+ n2 = n2.parent;
2302
+ }
2303
+ } catch {
2304
+ }
2305
+ return t2;
2306
+ }
2307
+ function frameworkChildren(e2) {
2308
+ const t2 = [], push = (e3) => {
2309
+ e3 && "object" == typeof e3 && t2.push(e3);
2310
+ };
2311
+ try {
2312
+ const t3 = e2;
2313
+ if (Array.isArray(t3.children)) for (const e3 of t3.children) push(e3);
2314
+ if (push(t3.scene), Array.isArray(t3.scenes)) for (const e3 of t3.scenes) push(e3);
2315
+ if ("function" == typeof t3.getObjects) {
2316
+ const e3 = t3.getObjects();
2317
+ if (Array.isArray(e3)) for (const t4 of e3) push(t4);
2318
+ }
2319
+ } catch {
2320
+ }
2321
+ return t2;
2322
+ }
2323
+ function markSubtree(e2, t2) {
2324
+ try {
2325
+ if (!e2 || "object" != typeof e2) return;
2326
+ const n2 = /* @__PURE__ */ new WeakSet();
2327
+ let i2 = [e2];
2328
+ n2.add(e2);
2329
+ let o2 = 0;
2330
+ for (let e3 = 0; e3 <= 6 && i2.length; e3++) {
2331
+ const r2 = [];
2332
+ for (const s2 of i2) {
2333
+ if (o2 >= 2e3) return;
2334
+ o2++;
2335
+ try {
2336
+ Oe.has(s2) || Oe.set(s2, t2);
2337
+ } catch {
2338
+ }
2339
+ if (e3 < 6) for (const e4 of frameworkChildren(s2)) n2.has(e4) || (n2.add(e4), r2.push(e4));
2340
+ }
2341
+ i2 = r2;
2342
+ }
2343
+ } catch {
2344
+ }
2345
+ }
2346
+ const je = /* @__PURE__ */ new Map();
2347
+ function bind(e2, t2) {
2348
+ return (function isCanvas(e3) {
2349
+ return "undefined" != typeof HTMLCanvasElement && e3 instanceof HTMLCanvasElement;
2350
+ })(e2) ? (je.set(e2, t2), () => {
2351
+ je.get(e2) === t2 && je.delete(e2);
2352
+ }) : () => {
2353
+ };
2354
+ }
2355
+ let Ue = null, Ne = false;
2356
+ function onPointerDown(e2) {
2357
+ const t2 = Ue;
2358
+ if (t2) for (const [n2, i2] of je) try {
2359
+ if (!n2.isConnected) {
2360
+ je.delete(n2);
2361
+ continue;
2362
+ }
2363
+ const o2 = n2.getBoundingClientRect();
2364
+ if (e2.clientX < o2.left || e2.clientX > o2.right || e2.clientY < o2.top || e2.clientY > o2.bottom) continue;
2365
+ const r2 = t2.canvasIdFor(n2);
2366
+ if (!r2) continue;
2367
+ const s2 = i2(n2, e2);
2368
+ if (!s2) continue;
2369
+ const a2 = n2.width, c2 = n2.height, l2 = o2.width ? Math.round((e2.clientX - o2.left) * a2 / o2.width) : 0, d2 = o2.height ? Math.round((e2.clientY - o2.top) * c2 / o2.height) : 0;
2370
+ t2.emitHit({ op: "hit", canvasId: r2, t: t2.now(), x: l2, y: d2, target: s2 });
2371
+ } catch {
2372
+ }
2373
+ }
2374
+ const qe = readDebugFlag(), ze = /* @__PURE__ */ new Map();
2152
2375
  function getCachedRegex(e2, t2) {
2153
2376
  const n2 = `${e2}|${t2}`;
2154
- let i2 = Me.get(n2);
2155
- return i2 || (i2 = new RegExp(e2, t2), Me.set(n2, i2)), i2;
2377
+ let i2 = ze.get(n2);
2378
+ return i2 || (i2 = new RegExp(e2, t2), ze.set(n2, i2)), i2;
2156
2379
  }
2157
- const $e = 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())), Fe = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ae = [400, 403], Le = "CORS", Re = "authorization", De = "Authorization", Pe = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false, maskInputSelector: "", maskTextSelector: "", blockSelector: "", unmaskSelector: "", maskInputOptions: { password: true } }, _e = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
2380
+ const He = new Set([".js", ".mjs", ".cjs", ".ts", ".css", ".scss", ".sass", ".less", ".styl", ".stylus", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".avif", ".bmp", ".ico", ".tiff", ".tif", ".heic", ".woff", ".woff2", ".ttf", ".otf", ".eot", ".mp4", ".webm", ".ogv", ".mp3", ".wav", ".flac", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".csv", ".json", ".xml", ".txt", ".zip", ".rar", ".gz", ".tar", ".7z", ".map", ".webmanifest"].map((e2) => e2.toLowerCase())), We = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ke = [400, 403], Ge = "CORS", Ve = "authorization", Qe = "Authorization", Xe = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false, maskInputSelector: "", maskTextSelector: "", blockSelector: "", unmaskSelector: "", maskInputOptions: { password: true } }, Je = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
2158
2381
  function maskAuthorizationHeader(e2) {
2159
- const t2 = e2[Re] ? Re : e2[De] ? De : null;
2382
+ const t2 = e2[Ve] ? Ve : e2[Qe] ? Qe : null;
2160
2383
  if (!t2) return;
2161
2384
  const n2 = e2[t2], i2 = n2.indexOf(" ");
2162
2385
  if (-1 !== i2) {
2163
- const o2 = n2.slice(0, i2 + 1), s2 = n2.slice(i2 + 1);
2164
- s2.length > 8 ? e2[t2] = o2 + s2.slice(0, 4) + "*".repeat(s2.length - 8) + s2.slice(-4) : e2[t2] = o2 + "*".repeat(s2.length);
2386
+ const o2 = n2.slice(0, i2 + 1), r2 = n2.slice(i2 + 1);
2387
+ r2.length > 8 ? e2[t2] = o2 + r2.slice(0, 4) + "*".repeat(r2.length - 8) + r2.slice(-4) : e2[t2] = o2 + "*".repeat(r2.length);
2165
2388
  } else n2.length > 8 ? e2[t2] = n2.slice(0, 4) + "*".repeat(n2.length - 8) + n2.slice(-4) : e2[t2] = "*".repeat(n2.length);
2166
2389
  }
2167
2390
  function trackDomainChangesOnce() {
@@ -2172,10 +2395,10 @@ function trackDomainChangesOnce() {
2172
2395
  const i2 = window.location.href.split("?")[0];
2173
2396
  if (n3 || i2 !== t2) {
2174
2397
  t2 = i2;
2175
- const o2 = uuidv4(), s2 = sessionStorage.getItem("pageVisitUUID") ?? "";
2176
- sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID", s2), invalidateUrlCache();
2177
- const r2 = Date.now();
2178
- e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid: s2, forceSend: n3, timestamp: r2, stack: new Error().stack }), sendMessage({ type: "routeChange", data: { url: i2, timestamp: r2, page_visit_uuid: o2, prev_page_visit_uuid: s2 } });
2398
+ const o2 = uuidv4(), r2 = sessionStorage.getItem("pageVisitUUID") ?? "";
2399
+ sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID", r2), invalidateUrlCache();
2400
+ const s2 = Date.now();
2401
+ e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid: r2, forceSend: n3, timestamp: s2, stack: new Error().stack }), sendMessage({ type: "routeChange", data: { url: i2, timestamp: s2, page_visit_uuid: o2, prev_page_visit_uuid: r2 } });
2179
2402
  }
2180
2403
  }, n2 = /* @__PURE__ */ (function debounce(e3, t3) {
2181
2404
  let n3;
@@ -2188,14 +2411,14 @@ function trackDomainChangesOnce() {
2188
2411
  function sendUserDeviceUuid() {
2189
2412
  sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
2190
2413
  let e2 = null;
2191
- if (m) try {
2414
+ if (b) try {
2192
2415
  e2 = localStorage.getItem("sailfishUserDeviceUuid");
2193
2416
  } catch {
2194
2417
  }
2195
2418
  if (!e2) {
2196
2419
  e2 = uuidv4();
2197
2420
  try {
2198
- m && localStorage.setItem("sailfishUserDeviceUuid", e2);
2421
+ b && localStorage.setItem("sailfishUserDeviceUuid", e2);
2199
2422
  } catch {
2200
2423
  }
2201
2424
  }
@@ -2206,48 +2429,48 @@ function handleVisibilityChange() {
2206
2429
  const e2 = document.visibilityState, t2 = Date.now();
2207
2430
  "visible" === e2 && (getOrSetSessionId(), requestTimeSync());
2208
2431
  try {
2209
- sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), Ce && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
2432
+ sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), qe && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
2210
2433
  } catch (e3) {
2211
2434
  console.warn("[Sailfish] Failed to send visibility change event:", e3);
2212
2435
  }
2213
2436
  sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
2214
2437
  }
2215
2438
  function clearPageVisitDataFromSessionStorage() {
2216
- h && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
2439
+ v && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
2217
2440
  }
2218
- let Oe = false;
2441
+ let Ye = false;
2219
2442
  function _ensureModuleSideEffects() {
2220
- Oe || (Oe = true, restoreFuncSpanState(), (function ensureSessionListeners() {
2221
- v || (v = true, f && window.addEventListener("beforeunload", () => {
2222
- window.name = S + window.name;
2443
+ Ye || (Ye = true, restoreFuncSpanState(), (function ensureSessionListeners() {
2444
+ T || (T = true, y && window.addEventListener("beforeunload", () => {
2445
+ window.name = k + window.name;
2223
2446
  }));
2224
- })(), f && (sendUserDeviceUuid(), (function sendTimeZone() {
2447
+ })(), y && (sendUserDeviceUuid(), (function sendTimeZone() {
2225
2448
  sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
2226
- })()), g && document.addEventListener("visibilitychange", handleVisibilityChange), f && (window.addEventListener("beforeunload", () => {
2449
+ })()), S && document.addEventListener("visibilitychange", handleVisibilityChange), y && (window.addEventListener("beforeunload", () => {
2227
2450
  clearPageVisitDataFromSessionStorage();
2228
2451
  }), window.addEventListener("online", () => {
2229
2452
  requestTimeSync();
2230
2453
  })));
2231
2454
  }
2232
2455
  function matchParsedUrlAgainstPatterns(e2, t2) {
2233
- const { hostname: n2, pathname: i2, port: o2 } = e2, s2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
2456
+ const { hostname: n2, pathname: i2, port: o2 } = e2, r2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
2234
2457
  return t2.some((e3) => {
2235
2458
  const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
2236
- let [n3, r2] = t3.split("/", 2), a2 = "";
2459
+ let [n3, s2] = t3.split("/", 2), a2 = "";
2237
2460
  n3.includes(":") && ([n3, a2] = n3.split(":"));
2238
- const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = s2.startsWith("www.") ? s2.slice(4) : s2;
2461
+ const c2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), l2 = r2.startsWith("www.") ? r2.slice(4) : r2;
2239
2462
  if (a2 && "*" !== a2 && o2 !== a2) return false;
2240
2463
  if (n3.startsWith("*.")) {
2241
2464
  const e4 = n3.slice(2).toLowerCase();
2242
- if (!(s2 === e4 || c2 === e4 || s2.endsWith("." + e4))) return false;
2243
- if (r2) {
2244
- return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2465
+ if (!(r2 === e4 || l2 === e4 || r2.endsWith("." + e4))) return false;
2466
+ if (s2) {
2467
+ return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2245
2468
  }
2246
2469
  return true;
2247
2470
  }
2248
- if (!l2.test(c2) && !l2.test(s2)) return false;
2249
- if (r2) {
2250
- return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2471
+ if (!c2.test(l2) && !c2.test(r2)) return false;
2472
+ if (s2) {
2473
+ return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
2251
2474
  }
2252
2475
  return true;
2253
2476
  });
@@ -2262,7 +2485,7 @@ function toAbsoluteUrl(e2) {
2262
2485
  }
2263
2486
  }
2264
2487
  function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
2265
- const n2 = [...Fe, ...e2], i2 = t2.length > 0;
2488
+ const n2 = [...We, ...e2], i2 = t2.length > 0;
2266
2489
  return function shouldSkipHeadersPropagation(e3) {
2267
2490
  let o2;
2268
2491
  try {
@@ -2270,95 +2493,95 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
2270
2493
  } catch {
2271
2494
  return true;
2272
2495
  }
2273
- const s2 = o2.pathname.toLowerCase(), r2 = s2.lastIndexOf(".");
2274
- return !(-1 === r2 || !$e.has(s2.slice(r2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
2496
+ const r2 = o2.pathname.toLowerCase(), s2 = r2.lastIndexOf(".");
2497
+ return !(-1 === s2 || !He.has(r2.slice(s2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
2275
2498
  };
2276
2499
  }
2277
- function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
2278
- const o2 = window.fetch, s2 = getOrSetSessionId(), r2 = createSkipHeadersPropagationChecker(e2, i2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], l2 = ["application/octet-stream"];
2279
- window.fetch = new Proxy(o2, { apply: async (e3, i3, o3) => {
2280
- let c2, d2 = o3[0], u2 = o3[1] || {};
2281
- if ("string" == typeof d2) c2 = d2;
2282
- else if (d2 instanceof Request) c2 = d2.url;
2500
+ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
2501
+ const o2 = window.fetch, r2 = getOrSetSessionId(), s2 = createSkipHeadersPropagationChecker(e2, n2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], c2 = ["application/octet-stream"];
2502
+ window.fetch = new Proxy(o2, { apply: async (e3, n3, o3) => {
2503
+ let l2, d2 = o3[0], u2 = o3[1] || {};
2504
+ if ("string" == typeof d2) l2 = d2;
2505
+ else if (d2 instanceof Request) l2 = d2.url;
2283
2506
  else {
2284
- if (!(d2 instanceof URL)) return e3.apply(i3, o3);
2285
- c2 = d2.href;
2507
+ if (!(d2 instanceof URL)) return e3.apply(n3, o3);
2508
+ l2 = d2.href;
2286
2509
  }
2287
- return r2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, s3, r3, c3, d3) {
2510
+ return s2(l2) ? e3.apply(n3, o3) : (async function injectHeaderWrapper(e4, n4, o4, r3, s3, l3, d3) {
2288
2511
  var _a, _b;
2289
- if (!c3) return e4.apply(i4, o4);
2512
+ if (!l3) return e4.apply(n4, o4);
2290
2513
  let u3 = uuidv4();
2291
- const p2 = getUrlAndStoredUuids(), f2 = r3.method || "GET", g2 = Date.now();
2514
+ const p2 = getUrlAndStoredUuids(), f2 = s3.method || "GET", g2 = Date.now();
2292
2515
  let m2, h2 = {}, y2 = null;
2293
2516
  try {
2294
- if (s3 instanceof Request) {
2295
- s3.headers.forEach((e5, t3) => {
2517
+ if (r3 instanceof Request) {
2518
+ r3.headers.forEach((e5, t3) => {
2296
2519
  h2[t3] = e5;
2297
2520
  });
2298
2521
  try {
2299
- y2 = s3.clone();
2522
+ y2 = r3.clone();
2300
2523
  } catch (e5) {
2301
2524
  y2 = null;
2302
2525
  }
2303
- } else r3.headers && (r3.headers instanceof Headers ? r3.headers.forEach((e5, t3) => {
2526
+ } else s3.headers && (s3.headers instanceof Headers ? s3.headers.forEach((e5, t3) => {
2304
2527
  h2[t3] = e5;
2305
- }) : Array.isArray(r3.headers) ? r3.headers.forEach(([e5, t3]) => {
2528
+ }) : Array.isArray(s3.headers) ? s3.headers.forEach(([e5, t3]) => {
2306
2529
  h2[e5] = t3;
2307
- }) : h2 = { ...r3.headers }), m2 = r3.body;
2530
+ }) : h2 = { ...s3.headers }), m2 = s3.body;
2308
2531
  } catch (e5) {
2309
- Ce && console.warn("[Sailfish] Failed to capture request data:", e5);
2532
+ qe && console.warn("[Sailfish] Failed to capture request data:", e5);
2310
2533
  }
2311
- delete h2[n];
2534
+ delete h2[i];
2312
2535
  const S2 = getFuncSpanHeader();
2313
2536
  S2 && delete h2[S2.name];
2314
- const b2 = `${c3}/${p2.page_visit_uuid}/${u3}`;
2315
- h2[n] = b2, S2 && (h2[S2.name] = S2.value);
2537
+ const b2 = `${l3}/${p2.page_visit_uuid}/${u3}`;
2538
+ h2[i] = b2, S2 && (h2[S2.name] = S2.value);
2316
2539
  maskAuthorizationHeader(h2);
2317
2540
  try {
2318
- let S3 = await (async function injectHeader(e5, t3, i5, o5, s4, r4, a3) {
2319
- const l3 = getFuncSpanHeader();
2320
- if (i5 instanceof Request) {
2321
- const c4 = i5.clone(), d4 = new Headers(c4.headers);
2322
- d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), Ce && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
2323
- const u4 = new Request(c4, { headers: d4 });
2541
+ let S3 = await (async function injectHeader(e5, t3, n5, o5, r4, s4, a3) {
2542
+ const c3 = getFuncSpanHeader();
2543
+ if (n5 instanceof Request) {
2544
+ const l4 = n5.clone(), d4 = new Headers(l4.headers);
2545
+ d4.set(i, `${r4}/${s4}/${a3}`), c3 && (d4.set(c3.name, c3.value), qe && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: n5.url, header: c3.name }));
2546
+ const u4 = new Request(l4, { headers: d4 });
2324
2547
  return await e5.call(t3, u4, o5);
2325
2548
  }
2326
2549
  {
2327
- const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
2328
- return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), Ce && 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);
2550
+ const l4 = { ...o5 }, d4 = new Headers(o5.headers || {});
2551
+ return d4.set(i, `${r4}/${s4}/${a3}`), c3 && (d4.set(c3.name, c3.value), qe && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof n5 ? n5 : n5.href, header: c3.name })), l4.headers = d4, await e5.call(t3, n5, l4);
2329
2552
  }
2330
- })(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3), b3 = false;
2331
- Ae.includes(S3.status) && (Ce && console.log("Perform retry as status was fail:", S3), delete h2[n], S3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
2553
+ })(e4, n4, r3, s3, l3, p2.page_visit_uuid, u3), b3 = false;
2554
+ Ke.includes(S3.status) && (qe && console.log("Perform retry as status was fail:", S3), delete h2[i], S3 = await (async function retryWithoutPropagateHeaders(e5, t3, n5, o5) {
2332
2555
  try {
2333
- let o6 = i5[0], s4 = i5[1] || {};
2556
+ let o6 = n5[0], r4 = n5[1] || {};
2334
2557
  if ("string" == typeof o6 || o6 instanceof URL) {
2335
- const i6 = { ...s4 }, r4 = new Headers(s4.headers || {});
2336
- r4.delete(n), i6.headers = r4;
2337
- return await e5.call(t3, o6, i6);
2558
+ const n6 = { ...r4 }, s4 = new Headers(r4.headers || {});
2559
+ s4.delete(i), n6.headers = s4;
2560
+ return await e5.call(t3, o6, n6);
2338
2561
  }
2339
2562
  if (o6 instanceof Request) {
2340
- const i6 = o6.clone(), r4 = new Headers(i6.headers);
2341
- r4.delete(n);
2342
- const a3 = new Request(i6, { headers: r4 });
2343
- return await e5.call(t3, a3, s4);
2563
+ const n6 = o6.clone(), s4 = new Headers(n6.headers);
2564
+ s4.delete(i);
2565
+ const a3 = new Request(n6, { headers: s4 });
2566
+ return await e5.call(t3, a3, r4);
2344
2567
  }
2345
- return e5.apply(t3, i5);
2568
+ return e5.apply(t3, n5);
2346
2569
  } catch (e6) {
2347
- throw Ce && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
2570
+ throw qe && console.log(`Retry without ${i} for ${o5} also failed:`, e6), e6;
2348
2571
  }
2349
- })(e4, i4, o4, d3), b3 = true);
2572
+ })(e4, n4, o4, d3), b3 = true);
2350
2573
  const v2 = Date.now(), w2 = (function captureClientTime() {
2351
2574
  return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
2352
- })(), k2 = S3.status, x2 = S3.ok, I2 = x2 ? "" : `Request Error: ${S3.statusText}`;
2353
- let T2 = null;
2575
+ })(), k2 = S3.status, x2 = S3.ok, T2 = x2 ? "" : `Request Error: ${S3.statusText}`;
2576
+ let I2 = null;
2354
2577
  try {
2355
- T2 = {}, S3.headers.forEach((e5, t3) => {
2356
- T2[t3] = e5;
2578
+ I2 = {}, S3.headers.forEach((e5, t3) => {
2579
+ I2[t3] = e5;
2357
2580
  });
2358
2581
  } catch (e5) {
2359
- Ce && console.warn("[Sailfish] Failed to capture response headers:", e5), T2 = null;
2582
+ qe && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
2360
2583
  }
2361
- const E2 = { type: 27, timestamp: v2, sessionId: c3, client: w2, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: v2, response_code: k2, success: x2, error: I2, method: f2, url: toAbsoluteUrl(d3), retry_without_trace_id: b3, request_headers: h2, request_body: m2, response_headers: T2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
2584
+ const E2 = { type: 27, timestamp: v2, sessionId: l3, client: w2, data: { request_id: u3, session_id: l3, timestamp_start: g2, timestamp_end: v2, response_code: k2, success: x2, error: T2, method: f2, url: toAbsoluteUrl(d3), retry_without_trace_id: b3, request_headers: h2, request_body: m2, response_headers: I2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
2362
2585
  E2.data.response_body = e5, y2 ? y2.text().then((e6) => {
2363
2586
  E2.data.request_body = e6, sendEvent(E2);
2364
2587
  }, () => {
@@ -2369,30 +2592,30 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2369
2592
  else if ((function shouldSkipBodyCapture(e5) {
2370
2593
  const t3 = e5.headers.get("content-type");
2371
2594
  if (!t3) return false;
2372
- const n2 = t3.toLowerCase();
2373
- return l2.some((e6) => n2.includes(e6));
2595
+ const n5 = t3.toLowerCase();
2596
+ return c2.some((e6) => n5.includes(e6));
2374
2597
  })(S3)) sendEventWithBody(null);
2375
2598
  else if ((function isStreamingResponse(e5) {
2376
2599
  const t3 = e5.headers.get("content-type");
2377
2600
  if (!t3) return false;
2378
- const n2 = t3.toLowerCase();
2379
- return a2.some((e6) => n2.includes(e6));
2601
+ const n5 = t3.toLowerCase();
2602
+ return a2.some((e6) => n5.includes(e6));
2380
2603
  })(S3)) if (t2.captureStreamingResponseBody) try {
2381
- (async function readStreamPrefix(e5, t3, n2) {
2382
- const i5 = e5.body;
2383
- if (!i5) return null;
2384
- const o5 = i5.getReader(), s4 = new TextDecoder(), r4 = [];
2604
+ (async function readStreamPrefix(e5, t3, n5) {
2605
+ const i2 = e5.body;
2606
+ if (!i2) return null;
2607
+ const o5 = i2.getReader(), r4 = new TextDecoder(), s4 = [];
2385
2608
  let a3 = 0;
2386
2609
  const readWithLimit = async () => {
2387
2610
  try {
2388
2611
  for (; a3 < t3; ) {
2389
2612
  const { done: e6, value: t4 } = await o5.read();
2390
2613
  if (e6) break;
2391
- a3 += t4.byteLength, r4.push(s4.decode(t4, { stream: true }));
2614
+ a3 += t4.byteLength, s4.push(r4.decode(t4, { stream: true }));
2392
2615
  }
2393
- return r4.push(s4.decode()), r4.join("");
2616
+ return s4.push(r4.decode()), s4.join("");
2394
2617
  } catch {
2395
- return r4.length > 0 ? r4.join("") : null;
2618
+ return s4.length > 0 ? s4.join("") : null;
2396
2619
  } finally {
2397
2620
  try {
2398
2621
  o5.cancel();
@@ -2406,8 +2629,8 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2406
2629
  o5.cancel();
2407
2630
  } catch {
2408
2631
  }
2409
- e6(r4.length > 0 ? r4.join("") : null);
2410
- }, n2))]);
2632
+ e6(s4.length > 0 ? s4.join("") : null);
2633
+ }, n5))]);
2411
2634
  } catch {
2412
2635
  try {
2413
2636
  o5.cancel();
@@ -2433,22 +2656,22 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
2433
2656
  }
2434
2657
  return S3;
2435
2658
  } catch (t3) {
2436
- const n2 = Date.now(), s4 = false, r4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, a3 = t3.message || "Fetch request failed";
2437
- if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Le.toLowerCase()))) return e4.apply(i4, o4);
2438
- let l3 = m2;
2659
+ const i2 = Date.now(), r4 = false, s4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, a3 = t3.message || "Fetch request failed";
2660
+ if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Ge.toLowerCase()))) return e4.apply(n4, o4);
2661
+ let c3 = m2;
2439
2662
  if (y2) try {
2440
- l3 = await y2.text();
2663
+ c3 = await y2.text();
2441
2664
  } catch {
2442
- l3 = null;
2665
+ c3 = null;
2443
2666
  }
2444
- throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code: r4, success: s4, error: a3, method: f2, url: toAbsoluteUrl(d3), request_headers: h2, request_body: l3, response_body: null }, ...p2 }), t3;
2667
+ throw sendEvent({ type: 27, timestamp: i2, sessionId: l3, data: { request_id: u3, session_id: l3, timestamp_start: g2, timestamp_end: i2, response_code: s4, success: r4, error: a3, method: f2, url: toAbsoluteUrl(d3), request_headers: h2, request_body: c3, response_body: null }, ...p2 }), t3;
2445
2668
  }
2446
- })(e3, i3, o3, d2, u2, s2, c2);
2669
+ })(e3, n3, o3, d2, u2, r2, l2);
2447
2670
  } });
2448
2671
  }
2449
- async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: g2 = false, deferRecording: m2, deferRecordingStart: y2, chunkSnapshot: S2, useWsWorker: b2 = true, capturePerformanceMetrics: v2 = true, maskTextClass: w2, maskInputSelector: k2, maskTextSelector: x2, blockSelector: I2, unmaskSelector: T2, maskInputOptions: E2, library: C2, headlessRecording: M2 = false }) {
2450
- var _a, _b;
2451
- if (!M2 && (function isHeadlessOrLighthouse() {
2672
+ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: o2 = ["*"], domainsToNotPropagateHeaderTo: r2 = [], serviceVersion: s2, serviceIdentifier: a2, gitSha: c2, serviceAdditionalMetadata: l2, enableIpTracking: d2, captureStreamingResponseBody: u2 = true, captureResponseBodyMaxMb: p2 = 10, captureStreamPrefixKb: f2 = 64, captureStreamTimeoutMs: g2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: S2, useWsWorker: b2 = true, capturePerformanceMetrics: w2 = true, maskTextClass: k2, maskInputSelector: x2, maskTextSelector: T2, blockSelector: I2, unmaskSelector: E2, maskInputOptions: C2, recordCanvas: M2, maskCanvasClass: $2, gitOrg: A2, gitRepo: F2, gitProvider: L2, library: R2, headlessRecording: D2 = false }) {
2673
+ var _a, _b, _c, _d;
2674
+ if (!D2 && (function isHeadlessOrLighthouse() {
2452
2675
  try {
2453
2676
  if ("undefined" == typeof navigator) return false;
2454
2677
  const e3 = navigator;
@@ -2459,92 +2682,101 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2459
2682
  return false;
2460
2683
  }
2461
2684
  })()) return;
2462
- const $2 = m2 ?? y2 ?? true, F2 = getOrSetSessionId(), A2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
2463
- if (A2.sessionId = F2, A2.apiKey = e2, A2.backendApi = t2, A2.serviceAdditionalMetadata = l2, A2.initialized && A2.sessionId === F2 && A2.ws && 1 === A2.ws.readyState) return void trackDomainChangesOnce();
2464
- const L2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
2465
- sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), A2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
2466
- const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
2685
+ const P2 = h2 ?? y2 ?? true, B2 = getOrSetSessionId(), _2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
2686
+ if (_2.sessionId = B2, _2.apiKey = e2, _2.backendApi = t2, _2.serviceAdditionalMetadata = l2, _2.initialized && _2.sessionId === B2 && _2.ws && 1 === _2.ws.readyState) return void trackDomainChangesOnce();
2687
+ const O2 = { captureStreamingResponseBody: u2, captureResponseBodyMaxMb: p2, captureStreamPrefixKb: f2, captureStreamTimeoutMs: g2 };
2688
+ sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), _2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, n2 = []) {
2689
+ const o3 = XMLHttpRequest.prototype.open, r3 = XMLHttpRequest.prototype.send, s3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), c3 = createSkipHeadersPropagationChecker(e3, n2);
2467
2690
  XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
2468
- return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
2469
- }, XMLHttpRequest.prototype.open = function(e4, t4, ...n2) {
2470
- return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n2]);
2691
+ return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, s3.call(this, e4, t4);
2692
+ }, XMLHttpRequest.prototype.open = function(e4, t4, ...n3) {
2693
+ return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n3]);
2471
2694
  }, XMLHttpRequest.prototype.send = function(...e4) {
2472
- const i4 = this._requestUrl;
2473
- if (!i4) return s3.apply(this, e4);
2474
- if (l3(i4)) return s3.apply(this, e4);
2475
- const o4 = sessionStorage.getItem("pageVisitUUID"), r4 = uuidv4(), c3 = `${a3}/${o4}/${r4}`;
2695
+ const n3 = this._requestUrl;
2696
+ if (!n3) return r3.apply(this, e4);
2697
+ if (c3(n3)) return r3.apply(this, e4);
2698
+ const o4 = sessionStorage.getItem("pageVisitUUID"), s4 = uuidv4(), l3 = `${a3}/${o4}/${s4}`;
2476
2699
  try {
2477
- this.setRequestHeader(n, c3);
2700
+ this.setRequestHeader(i, l3);
2478
2701
  } catch (e5) {
2479
- console.warn(`Could not set X-Sf3-Rid for ${i4}`, e5);
2702
+ console.warn(`Could not set X-Sf3-Rid for ${n3}`, e5);
2480
2703
  }
2481
2704
  const d3 = getFuncSpanHeader();
2482
2705
  if (d3) try {
2483
- this.setRequestHeader(d3.name, d3.value), Ce && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: i4, header: d3.name });
2706
+ this.setRequestHeader(d3.name, d3.value), qe && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: n3, header: d3.name });
2484
2707
  } catch (e5) {
2485
- Ce && console.warn(`[Sailfish] Could not set funcspan header for ${i4}`, e5);
2708
+ qe && console.warn(`[Sailfish] Could not set funcspan header for ${n3}`, e5);
2486
2709
  }
2487
2710
  const u3 = Date.now();
2488
2711
  let p3 = false;
2489
2712
  const f3 = e4[0], g3 = { ...this._capturedRequestHeaders };
2490
2713
  maskAuthorizationHeader(g3);
2491
- const emitFinished = (e5, t4, n2, o5, s4) => {
2714
+ const emitFinished = (e5, t4, i2, o5, r4) => {
2492
2715
  if (p3) return;
2493
2716
  p3 = true;
2494
- const l4 = Date.now();
2495
- sendEvent({ type: 27, timestamp: l4, sessionId: a3, data: { request_id: r4, session_id: a3, timestamp_start: u3, timestamp_end: l4, response_code: t4, success: e5, error: n2, method: this._requestMethod, url: toAbsoluteUrl(i4), request_headers: g3, request_body: f3, response_headers: s4, response_body: o5 }, ...getUrlAndStoredUuids() });
2717
+ const c4 = Date.now();
2718
+ sendEvent({ type: 27, timestamp: c4, sessionId: a3, data: { request_id: s4, session_id: a3, timestamp_start: u3, timestamp_end: c4, response_code: t4, success: e5, error: i2, method: this._requestMethod, url: toAbsoluteUrl(n3), request_headers: g3, request_body: f3, response_headers: r4, response_body: o5 }, ...getUrlAndStoredUuids() });
2496
2719
  };
2497
2720
  return this.addEventListener("load", () => {
2498
2721
  const e5 = this.status || 0;
2499
- let n2, i5 = null;
2722
+ let n4, i2 = null;
2500
2723
  const o5 = 1024 * t3.captureResponseBodyMaxMb * 1024;
2501
2724
  try {
2502
- if (0 === t3.captureResponseBodyMaxMb) n2 = null;
2725
+ if (0 === t3.captureResponseBodyMaxMb) n4 = null;
2503
2726
  else {
2504
2727
  const e6 = this.responseText || this.response;
2505
- n2 = "string" == typeof e6 && e6.length > o5 ? null : e6;
2728
+ n4 = "string" == typeof e6 && e6.length > o5 ? null : e6;
2506
2729
  }
2507
2730
  } catch (e6) {
2508
- n2 = null;
2731
+ n4 = null;
2509
2732
  }
2510
2733
  try {
2511
- i5 = {};
2734
+ i2 = {};
2512
2735
  const e6 = this.getAllResponseHeaders();
2513
2736
  e6 && e6.split("\r\n").forEach((e7) => {
2514
2737
  const t4 = e7.split(": ");
2515
- 2 === t4.length && (i5[t4[0]] = t4[1]);
2738
+ 2 === t4.length && (i2[t4[0]] = t4[1]);
2516
2739
  });
2517
2740
  } catch (e6) {
2518
- Ce && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
2741
+ qe && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i2 = null;
2519
2742
  }
2520
- if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n2, i5);
2743
+ if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n4, i2);
2521
2744
  else {
2522
2745
  const t4 = this.statusText || `HTTP ${e5}`;
2523
- emitFinished(false, e5, t4, n2, i5);
2746
+ emitFinished(false, e5, t4, n4, i2);
2524
2747
  }
2525
2748
  }, { once: true }), this.addEventListener("error", () => {
2526
2749
  const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
2527
2750
  emitFinished(false, e5, t4);
2528
- }, { once: true }), s3.apply(this, e4);
2751
+ }, { once: true }), r3.apply(this, e4);
2529
2752
  };
2530
- })(o2, L2, i2), A2.xhrPatched = true), A2.fetchPatched || (setupFetchInterceptor(o2, L2, i2), A2.fetchPatched = true), await yieldToMain(), A2.domEventsInit || (initializeDomContentEvents(F2), A2.domEventsInit = true), await yieldToMain(), A2.consoleInit || (initializeConsolePlugin(_e, F2), A2.consoleInit = true), await yieldToMain(), A2.errorInit || (!(function initializeErrorInterceptor() {
2753
+ })(r2, O2, o2), _2.xhrPatched = true), _2.fetchPatched || (setupFetchInterceptor(r2, O2, o2), _2.fetchPatched = true);
2754
+ const j2 = M2 ?? Xe.recordCanvas;
2755
+ if (!_2.canvasObjLogInit && j2) {
2756
+ try {
2757
+ n.installEarlyObjectLogging();
2758
+ } catch {
2759
+ }
2760
+ _2.canvasObjLogInit = true;
2761
+ }
2762
+ await yieldToMain(), _2.domEventsInit || (initializeDomContentEvents(B2), _2.domEventsInit = true), await yieldToMain(), _2.consoleInit || (initializeConsolePlugin(Je, B2), _2.consoleInit = true), await yieldToMain(), _2.errorInit || (!(function initializeErrorInterceptor() {
2531
2763
  window.addEventListener("error", (e3) => {
2532
2764
  captureError(e3.error ?? e3.message, false, { filename: e3.filename, lineno: e3.lineno, colno: e3.colno });
2533
2765
  }), window.addEventListener("unhandledrejection", (e3) => {
2534
2766
  captureError(e3.reason, true);
2535
2767
  });
2536
- })(), A2.errorInit = true), await yieldToMain(), !A2.perfInit && v2 && (initializePerformancePlugin(F2), A2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
2537
- h && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
2538
- })({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || A2.ws && 1 === A2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
2768
+ })(), _2.errorInit = true), await yieldToMain(), !_2.perfInit && w2 && (initializePerformancePlugin(B2), _2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
2769
+ v && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
2770
+ })({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || _2.ws && 1 === _2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
2539
2771
  var _a2;
2540
- ((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? Ce && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), Ce && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
2772
+ ((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? qe && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), qe && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
2541
2773
  }).catch((e3) => {
2542
- Ce && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
2543
- }), A2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...Fe], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), A2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
2774
+ qe && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
2775
+ }), _2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...r2, ...We], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), _2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
2544
2776
  sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
2545
- })(), c2 && fetchAndSendIp(F2);
2777
+ })(), d2 && fetchAndSendIp(B2);
2546
2778
  try {
2547
- const n2 = a2 ?? (function readGitSha() {
2779
+ const n2 = c2 ?? (function readGitSha() {
2548
2780
  var _a2;
2549
2781
  try {
2550
2782
  const e3 = globalThis;
@@ -2561,7 +2793,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2561
2793
  if ("string" == typeof e3 && e3) return e3;
2562
2794
  } catch {
2563
2795
  }
2564
- })(), i3 = r2 ?? "", o3 = s2 ?? "", c3 = C2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
2796
+ })(), i2 = a2 ?? "", o3 = s2 ?? "", r3 = R2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
2565
2797
  try {
2566
2798
  const e3 = window;
2567
2799
  if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
@@ -2573,34 +2805,34 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
2573
2805
  t3 = "undefined" != typeof document && "loading" !== document.readyState;
2574
2806
  } catch {
2575
2807
  }
2576
- const n3 = t3, i4 = [];
2577
- for (const e4 of ce) {
2808
+ const n3 = t3, i3 = [];
2809
+ for (const e4 of ve) {
2578
2810
  const t4 = e4(n3);
2579
- t4 && !i4.includes(t4) && i4.push(t4);
2811
+ t4 && !i3.includes(t4) && i3.push(t4);
2580
2812
  }
2581
- return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
2813
+ return { framework: i3[0] ?? null, additionalFrameworks: i3.slice(1), serviceRole: "frontend" };
2582
2814
  })(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
2583
2815
  await yieldToMain();
2584
- const [m3, h2] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, F2, t2, i3, o3, d3, n2, c3, f3)]), y3 = { ...Pe, ...(_a = m3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: g2, ...void 0 !== w2 ? { maskTextClass: w2 } : {}, ...void 0 !== k2 ? { maskInputSelector: k2 } : {}, ...void 0 !== x2 ? { maskTextSelector: x2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== T2 ? { unmaskSelector: T2 } : {}, ...void 0 !== E2 ? { maskInputOptions: E2 } : {} };
2585
- if (A2.ws && 1 === A2.ws.readyState) return;
2586
- if ((_b = h2.data) == null ? void 0 : _b.startRecordingSession) {
2816
+ const [g3, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, B2, t2, i2, o3, d3, n2, r3, f3, A2, F2, L2)]), y3 = { ...Xe, ...(_a = g3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== k2 ? { maskTextClass: k2 } : {}, ...void 0 !== x2 ? { maskInputSelector: x2 } : {}, ...void 0 !== T2 ? { maskTextSelector: T2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== E2 ? { unmaskSelector: E2 } : {}, ...void 0 !== C2 ? { maskInputOptions: C2 } : {}, recordCanvas: M2 ?? ((_c = (_b = g3.data) == null ? void 0 : _b.captureSettingsFromApiKey) == null ? void 0 : _c.recordCanvasSf) ?? Xe.recordCanvas, ...void 0 !== $2 ? { maskCanvasClass: $2 } : {} };
2817
+ if (_2.ws && 1 === _2.ws.readyState) return;
2818
+ if ((_d = h3.data) == null ? void 0 : _d.startRecordingSession) {
2587
2819
  const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
2588
2820
  await yieldToMain();
2589
- const i4 = await initializeRecording(y3, t2, e2, F2, n3, $2, b2, S2 ?? false);
2590
- A2.ws = i4, A2.initialized = true, trackDomainChangesOnce(), A2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
2821
+ const i3 = await initializeRecording(y3, t2, e2, B2, n3, P2, b2, S2 ?? false);
2822
+ _2.ws = i3, _2.initialized = true, trackDomainChangesOnce(), _2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
2591
2823
  window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
2592
- })(r2, s2), A2.sentMapUuidOnce = true);
2593
- } else console.error("Failed to start recording session:", h2.errors || h2);
2824
+ })(a2, s2), _2.sentMapUuidOnce = true);
2825
+ } else console.error("Failed to start recording session:", h3.errors || h3);
2594
2826
  } catch (e3) {
2595
2827
  console.error("Error starting recording:", e3);
2596
2828
  }
2597
2829
  }
2598
- exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = _e, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
2830
+ exports.DEFAULT_CAPTURE_SETTINGS = Xe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = Je, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
2599
2831
  const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
2600
- H && JSON.stringify(H) === JSON.stringify(e2) || (H = e2, sendMessage(t2));
2601
- }, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, 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.getIdentifiedUser = getIdentifiedUser, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
2832
+ te && JSON.stringify(te) === JSON.stringify(e2) || (te = e2, sendMessage(t2));
2833
+ }, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, 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.getBinaryDropCount = getBinaryDropCount, exports.getBufferedAmount = getBufferedAmount, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getIdentifiedUser = getIdentifiedUser, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
2602
2834
  const i2 = { type: "identify", userId: e2, traits: t2 };
2603
- z && z.userId === e2 && JSON.stringify(z.traits) === JSON.stringify(t2) || (z = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
2835
+ ee && ee.userId === e2 && JSON.stringify(ee.traits) === JSON.stringify(t2) || (ee = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
2604
2836
  }, exports.initRecorder = async (e2) => {
2605
2837
  if ("undefined" == typeof window) return;
2606
2838
  const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
@@ -2609,14 +2841,14 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
2609
2841
  return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
2610
2842
  try {
2611
2843
  if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
2612
- const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => Ee), Promise.resolve().then(() => we)]);
2613
- let r2 = null;
2844
+ const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: r2 }] = await Promise.all([Promise.resolve().then(() => _e), Promise.resolve().then(() => Le)]);
2845
+ let s2 = null;
2614
2846
  try {
2615
- await o2(e2.apiKey, n3), r2 = s2();
2847
+ await o2(e2.apiKey, n3), s2 = r2();
2616
2848
  } catch (e3) {
2617
2849
  console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
2618
2850
  }
2619
- i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: r2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
2851
+ i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: s2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
2620
2852
  }
2621
2853
  } catch (e3) {
2622
2854
  console.warn("[Sailfish] Recorder initialization failed:", e3);
@@ -2624,7 +2856,62 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
2624
2856
  })().finally(() => {
2625
2857
  delete t2.initPromise;
2626
2858
  })), t2.initPromise);
2627
- }, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.maskInputFn = maskInputFn, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
2859
+ }, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.installAdapters = function installAdapters(e2) {
2860
+ Ue = e2;
2861
+ const t2 = globalThis;
2862
+ t2.__sfCreateSite = (e3, t3) => {
2863
+ try {
2864
+ e3 && "object" == typeof e3 && Oe.set(e3, t3);
2865
+ } catch {
2866
+ }
2867
+ }, t2.__sfCreateFrom = (e3, t3) => {
2868
+ !(function createFrom(e4, t4) {
2869
+ try {
2870
+ if (!t4) return;
2871
+ if ((function isThenable(e5) {
2872
+ try {
2873
+ return !!e5 && ("object" == typeof e5 || "function" == typeof e5) && "function" == typeof e5.then;
2874
+ } catch {
2875
+ return false;
2876
+ }
2877
+ })(e4)) return void e4.then((e5) => {
2878
+ markSubtree(e5, t4);
2879
+ }, () => {
2880
+ });
2881
+ markSubtree(e4, t4);
2882
+ } catch {
2883
+ }
2884
+ })(e3, t3);
2885
+ }, Ne || "undefined" == typeof window || (window.addEventListener("pointerdown", onPointerDown, { capture: true, passive: true }), Ne = true);
2886
+ }, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.isTransportSaturated = isTransportSaturated, exports.maskCanvasDraws = function maskCanvasDraws(e2, t2, i2) {
2887
+ let o2 = null;
2888
+ try {
2889
+ o2 = "undefined" != typeof HTMLCanvasElement && e2 instanceof HTMLCanvasElement ? e2.getContext("2d") : e2;
2890
+ } catch {
2891
+ o2 = null;
2892
+ }
2893
+ const r2 = o2 ? n.recorderForContext(o2) : void 0;
2894
+ if (!r2) {
2895
+ let i3 = null;
2896
+ try {
2897
+ if ("undefined" != typeof HTMLCanvasElement && e2 instanceof HTMLCanvasElement) i3 = e2;
2898
+ else {
2899
+ const e3 = o2 == null ? void 0 : o2.canvas;
2900
+ "undefined" != typeof HTMLCanvasElement && e3 instanceof HTMLCanvasElement && (i3 = e3);
2901
+ }
2902
+ } catch {
2903
+ i3 = null;
2904
+ }
2905
+ return n.notePreAttachMaskUsed(i3), t2();
2906
+ }
2907
+ const s2 = r2.redactStyle, a2 = r2.textOnlyMask;
2908
+ i2 && (r2.redactStyle = n.resolveRedactStyle(s2, { text: i2.text, shape: i2.shape }), void 0 !== i2.keepShapes && (r2.textOnlyMask = i2.keepShapes)), r2.maskDepth++;
2909
+ try {
2910
+ return t2();
2911
+ } finally {
2912
+ r2.maskDepth--, r2.redactStyle = s2, r2.textOnlyMask = a2;
2913
+ }
2914
+ }, exports.maskInputFn = maskInputFn, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
2628
2915
  let n2, i2;
2629
2916
  if ("string" == typeof e2 ? n2 = e2 : "undefined" != typeof URL && e2 instanceof URL ? n2 = e2.href : "undefined" != typeof Request && e2 instanceof Request ? n2 = e2.url : null != e2 && "function" == typeof e2.toString && (n2 = e2.toString()), !n2) return false;
2630
2917
  try {
@@ -2634,6 +2921,97 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
2634
2921
  return false;
2635
2922
  }
2636
2923
  return matchParsedUrlAgainstPatterns(i2, t2);
2637
- }, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.requestTimeSync = requestTimeSync, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
2924
+ }, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.registerChart = function registerChart(e2) {
2925
+ try {
2926
+ const t2 = e2;
2927
+ return bind(t2.canvas, (e3, n2) => {
2928
+ var _a, _b, _c, _d, _e2;
2929
+ const i2 = (_a = t2.getElementsAtEventForMode) == null ? void 0 : _a.call(t2, n2, "nearest", { intersect: true }, false);
2930
+ if (!i2 || !i2.length) return null;
2931
+ const { datasetIndex: o2, index: r2 } = i2[0];
2932
+ return { framework: "chartjs", label: `${((_d = (_c = (_b = t2.data) == null ? void 0 : _b.datasets) == null ? void 0 : _c[o2]) == null ? void 0 : _d.label) ?? `dataset${o2}`}[${r2}]`, objectType: (_e2 = t2.config) == null ? void 0 : _e2.type, ...creationOf(t2), configRef: { datasetIndex: o2, index: r2 } };
2933
+ });
2934
+ } catch {
2935
+ return () => {
2936
+ };
2937
+ }
2938
+ }, exports.registerFabricCanvas = function registerFabricCanvas(e2) {
2939
+ try {
2940
+ const t2 = e2;
2941
+ return bind(t2.lowerCanvasEl, (e3, n2) => {
2942
+ var _a;
2943
+ const i2 = (_a = t2.findTarget) == null ? void 0 : _a.call(t2, n2);
2944
+ if (!i2) return null;
2945
+ return { framework: "fabric", label: i2.name || i2.id || i2.type || "object", objectType: i2.type, ...creationOf(i2) };
2946
+ });
2947
+ } catch {
2948
+ return () => {
2949
+ };
2950
+ }
2951
+ }, exports.registerKonvaStage = function registerKonvaStage(e2) {
2952
+ var _a, _b, _c, _d;
2953
+ try {
2954
+ const t2 = e2, n2 = ((_a = t2.getLayers) == null ? void 0 : _a.call(t2)) ?? [], i2 = (_d = (_c = (_b = n2[0]) == null ? void 0 : _b.getCanvas) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d._canvas;
2955
+ return bind(i2, (e3, n3) => {
2956
+ var _a2, _b2, _c2, _d2;
2957
+ const i3 = e3.getBoundingClientRect(), o2 = (_a2 = t2.getIntersection) == null ? void 0 : _a2.call(t2, { x: n3.clientX - i3.left, y: n3.clientY - i3.top });
2958
+ if (!o2) return null;
2959
+ const r2 = (_b2 = o2.getClassName) == null ? void 0 : _b2.call(o2);
2960
+ return { framework: "konva", label: ((_c2 = o2.name) == null ? void 0 : _c2.call(o2)) || ((_d2 = o2.id) == null ? void 0 : _d2.call(o2)) || r2 || "shape", objectType: r2, ...creationOf(o2) };
2961
+ });
2962
+ } catch {
2963
+ return () => {
2964
+ };
2965
+ }
2966
+ }, exports.registerPixiApp = function registerPixiApp(e2) {
2967
+ try {
2968
+ const t2 = e2;
2969
+ return bind(t2.canvas ?? t2.view, (e3, n2) => {
2970
+ var _a, _b, _c, _d;
2971
+ const i2 = e3.getBoundingClientRect(), o2 = n2.clientX - i2.left, r2 = n2.clientY - i2.top, s2 = (_d = (_c = (_b = (_a = t2.renderer) == null ? void 0 : _a.events) == null ? void 0 : _b.rootBoundary) == null ? void 0 : _c.hitTest) == null ? void 0 : _d.call(_c, o2, r2);
2972
+ if (!s2) return null;
2973
+ const a2 = (function pixiObjectType(e4) {
2974
+ var _a2;
2975
+ if ("string" == typeof e4.text) return "Text";
2976
+ const t3 = !!e4.texture && "function" != typeof e4.texture;
2977
+ if (t3 && (e4.tilePosition || e4.tileScale)) return "TilingSprite";
2978
+ if (e4.geometry && e4.shader) return "Mesh";
2979
+ if (e4.context) return "Graphics";
2980
+ if (t3) return "Sprite";
2981
+ if (Array.isArray(e4.children)) return "Container";
2982
+ const n3 = (_a2 = e4.constructor) == null ? void 0 : _a2.name;
2983
+ return n3 && n3.length > 1 ? n3 : void 0;
2984
+ })(s2);
2985
+ return { framework: "pixi", label: s2.label || s2.name || a2 || "displayObject", objectType: a2, ...creationOf(s2) };
2986
+ });
2987
+ } catch {
2988
+ return () => {
2989
+ };
2990
+ }
2991
+ }, exports.registerThreeScene = function registerThreeScene(e2, t2, n2, i2) {
2992
+ try {
2993
+ const o2 = i2, r2 = n2, s2 = e2, a2 = new o2.Raycaster(), c2 = new o2.Vector2();
2994
+ return bind(r2.domElement, (e3, n3) => {
2995
+ const i3 = e3.getBoundingClientRect();
2996
+ c2.x = (n3.clientX - i3.left) / i3.width * 2 - 1, c2.y = -(n3.clientY - i3.top) / i3.height * 2 + 1, a2.setFromCamera(c2, t2);
2997
+ const o3 = a2.intersectObjects(s2.children ?? [], true);
2998
+ if (!o3.length) return null;
2999
+ const r3 = o3[0].object;
3000
+ let l2 = r3;
3001
+ for (; l2 && !l2.name && l2.parent; ) l2 = l2.parent;
3002
+ return { framework: "three", label: (l2 == null ? void 0 : l2.name) || r3.name || r3.uuid || "mesh", objectType: r3.type, path: r3.uuid, ...creationOf(r3) };
3003
+ });
3004
+ } catch {
3005
+ return () => {
3006
+ };
3007
+ }
3008
+ }, exports.requestTimeSync = requestTimeSync, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
2638
3009
  sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
2639
- }, exports.withAppUrlMetadata = withAppUrlMetadata, exports.yieldToMain = yieldToMain;
3010
+ }, exports.uninstallAdapters = function uninstallAdapters() {
3011
+ Ue = null, Ne && "undefined" != typeof window && window.removeEventListener("pointerdown", onPointerDown, { capture: true }), Ne = false, je.clear();
3012
+ try {
3013
+ const e2 = globalThis;
3014
+ delete e2.__sfCreateSite, delete e2.__sfCreateFrom;
3015
+ } catch {
3016
+ }
3017
+ }, exports.withAppUrlMetadata = withAppUrlMetadata, exports.wsSendBinary = wsSendBinary, exports.yieldToMain = yieldToMain;