@sailfish-ai/recorder 1.12.5 → 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.
- package/README.md +8 -0
- package/dist/canvas/adapters.js +382 -0
- package/dist/canvas/adapters.js.br +0 -0
- package/dist/canvas/adapters.js.gz +0 -0
- package/dist/canvas/canvasManager.js +1949 -0
- package/dist/canvas/canvasManager.js.br +0 -0
- package/dist/canvas/canvasManager.js.gz +0 -0
- package/dist/canvas/canvasPrivacy.js +233 -0
- package/dist/canvas/canvasPrivacy.js.br +0 -0
- package/dist/canvas/canvasPrivacy.js.gz +0 -0
- package/dist/canvas/codec.js +314 -0
- package/dist/canvas/codec.js.br +0 -0
- package/dist/canvas/codec.js.gz +0 -0
- package/dist/canvas/deviceClass.js +67 -0
- package/dist/canvas/deviceClass.js.br +0 -0
- package/dist/canvas/deviceClass.js.gz +0 -0
- package/dist/canvas/encodeWorker.js +284 -0
- package/dist/canvas/encodeWorker.js.br +0 -0
- package/dist/canvas/encodeWorker.js.gz +0 -0
- package/dist/canvas/governor.js +79 -0
- package/dist/canvas/governor.js.br +0 -0
- package/dist/canvas/governor.js.gz +0 -0
- package/dist/canvas/keyframes.js +183 -0
- package/dist/canvas/keyframes.js.br +0 -0
- package/dist/canvas/keyframes.js.gz +0 -0
- package/dist/canvas/mediaRecorderCapture.js +257 -0
- package/dist/canvas/mediaRecorderCapture.js.br +0 -0
- package/dist/canvas/mediaRecorderCapture.js.gz +0 -0
- package/dist/canvas/objectLog.js +150 -0
- package/dist/canvas/objectLog.js.br +0 -0
- package/dist/canvas/objectLog.js.gz +0 -0
- package/dist/canvas/patch2d.js +1302 -0
- package/dist/canvas/patch2d.js.br +0 -0
- package/dist/canvas/patch2d.js.gz +0 -0
- package/dist/canvas/patchGL.js +371 -0
- package/dist/canvas/patchGL.js.br +0 -0
- package/dist/canvas/patchGL.js.gz +0 -0
- package/dist/canvas/patchWebGPU.js +361 -0
- package/dist/canvas/patchWebGPU.js.br +0 -0
- package/dist/canvas/patchWebGPU.js.gz +0 -0
- package/dist/canvas/piiDetect.js +155 -0
- package/dist/canvas/piiDetect.js.br +0 -0
- package/dist/canvas/piiDetect.js.gz +0 -0
- package/dist/canvas/protocol.js +122 -0
- package/dist/canvas/protocol.js.br +0 -0
- package/dist/canvas/protocol.js.gz +0 -0
- package/dist/canvas/videoCapture.js +252 -0
- package/dist/canvas/videoCapture.js.br +0 -0
- package/dist/canvas/videoCapture.js.gz +0 -0
- package/dist/canvas/workerRelay.js +99 -0
- package/dist/canvas/workerRelay.js.br +0 -0
- package/dist/canvas/workerRelay.js.gz +0 -0
- package/dist/canvas/workerShim.js +227 -0
- package/dist/canvas/workerShim.js.br +0 -0
- package/dist/canvas/workerShim.js.gz +0 -0
- package/dist/canvas-worker.cjs +74 -0
- package/dist/canvas-worker.cjs.br +0 -0
- package/dist/canvas-worker.cjs.gz +0 -0
- package/dist/canvas-worker.js +78 -0
- package/dist/canvas-worker.js.br +0 -0
- package/dist/canvas-worker.js.gz +0 -0
- package/dist/canvasFrameStore.js +198 -0
- package/dist/canvasFrameStore.js.br +0 -0
- package/dist/canvasFrameStore.js.gz +0 -0
- package/dist/chunks/canvasManager-BYn3_oyo.js +1440 -0
- package/dist/chunks/canvasManager-BYn3_oyo.js.br +0 -0
- package/dist/chunks/canvasManager-BYn3_oyo.js.gz +0 -0
- package/dist/chunks/canvasManager-CoX5072G.js +1456 -0
- package/dist/chunks/canvasManager-CoX5072G.js.br +0 -0
- package/dist/chunks/canvasManager-CoX5072G.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-Cd8y9tID.js → chunkSerializer-C_K0Wyk0.js} +1 -1
- package/dist/chunks/chunkSerializer-C_K0Wyk0.js.br +0 -0
- package/dist/chunks/chunkSerializer-C_K0Wyk0.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-pkpgT-FH.js → chunkSerializer-CghPitF4.js} +1 -1
- package/dist/chunks/chunkSerializer-CghPitF4.js.br +0 -0
- package/dist/chunks/chunkSerializer-CghPitF4.js.gz +0 -0
- package/dist/chunks/{index-Bvd8oTpV.js → index-BIj4l3CV.js} +1025 -655
- package/dist/chunks/index-BIj4l3CV.js.br +0 -0
- package/dist/chunks/index-BIj4l3CV.js.gz +0 -0
- package/dist/chunks/{index-CXvHbLRT.js → index-DIYomvdD.js} +1115 -724
- package/dist/chunks/index-DIYomvdD.js.br +0 -0
- package/dist/chunks/index-DIYomvdD.js.gz +0 -0
- package/dist/chunks/patch2d-9voowhJ_.js +816 -0
- package/dist/chunks/patch2d-9voowhJ_.js.br +0 -0
- package/dist/chunks/patch2d-9voowhJ_.js.gz +0 -0
- package/dist/chunks/patch2d-PQxcaE6r.js +886 -0
- package/dist/chunks/patch2d-PQxcaE6r.js.br +0 -0
- package/dist/chunks/patch2d-PQxcaE6r.js.gz +0 -0
- package/dist/graphql.js +12 -1
- package/dist/graphql.js.br +0 -0
- package/dist/graphql.js.gz +0 -0
- package/dist/index.js +144 -2
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +52 -41
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +4842 -2215
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +119 -10
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/types/canvas/adapters.d.ts +71 -0
- package/dist/types/canvas/canvasManager.d.ts +273 -0
- package/dist/types/canvas/canvasPrivacy.d.ts +184 -0
- package/dist/types/canvas/codec.d.ts +27 -0
- package/dist/types/canvas/deviceClass.d.ts +40 -0
- package/dist/types/canvas/encodeWorker.d.ts +54 -0
- package/dist/types/canvas/governor.d.ts +44 -0
- package/dist/types/canvas/keyframes.d.ts +81 -0
- package/dist/types/canvas/mediaRecorderCapture.d.ts +91 -0
- package/dist/types/canvas/objectLog.d.ts +75 -0
- package/dist/types/canvas/patch2d.d.ts +339 -0
- package/dist/types/canvas/patchGL.d.ts +74 -0
- package/dist/types/canvas/patchWebGPU.d.ts +37 -0
- package/dist/types/canvas/piiDetect.d.ts +60 -0
- package/dist/types/canvas/protocol.d.ts +176 -0
- package/dist/types/canvas/videoCapture.d.ts +67 -0
- package/dist/types/canvas/workerRelay.d.ts +29 -0
- package/dist/types/canvas/workerShim.d.ts +10 -0
- package/dist/types/canvasFrameStore.d.ts +23 -0
- package/dist/types/graphql.d.ts +1 -1
- package/dist/types/index.d.ts +99 -1
- package/dist/types/types.d.ts +40 -0
- package/dist/types/websocket.d.ts +19 -0
- package/dist/websocket.js +210 -0
- package/dist/websocket.js.br +0 -0
- package/dist/websocket.js.gz +0 -0
- package/package.json +7 -1
- package/dist/chunks/chunkSerializer-Cd8y9tID.js.br +0 -0
- package/dist/chunks/chunkSerializer-Cd8y9tID.js.gz +0 -0
- package/dist/chunks/chunkSerializer-pkpgT-FH.js.br +0 -0
- package/dist/chunks/chunkSerializer-pkpgT-FH.js.gz +0 -0
- package/dist/chunks/index-Bvd8oTpV.js.br +0 -0
- package/dist/chunks/index-Bvd8oTpV.js.gz +0 -0
- package/dist/chunks/index-CXvHbLRT.js.br +0 -0
- package/dist/chunks/index-CXvHbLRT.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
|
|
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
|
|
64
|
+
return c ? performance.now() : Date.now();
|
|
65
65
|
}
|
|
66
66
|
function timeOriginMs() {
|
|
67
|
-
return
|
|
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,
|
|
91
|
-
return this.samples.push(
|
|
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
|
|
129
|
-
let
|
|
130
|
-
function openDb$
|
|
131
|
-
return (function hasIndexedDB$
|
|
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
|
-
})() ?
|
|
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(
|
|
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
|
-
}),
|
|
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(
|
|
151
|
-
Promise.resolve(t2(
|
|
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
|
|
160
|
-
await withStore$1("readwrite",
|
|
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
|
|
165
|
-
let
|
|
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
|
-
})() ?
|
|
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(
|
|
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
|
-
}),
|
|
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(
|
|
186
|
-
Promise.resolve(t2(
|
|
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
|
|
205
|
-
let
|
|
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 (!
|
|
208
|
-
if (
|
|
209
|
-
const e2 = window.name.startsWith(
|
|
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(
|
|
212
|
-
if (e3) return
|
|
269
|
+
const e3 = window.sessionStorage.getItem(w);
|
|
270
|
+
if (e3) return x = e3, e3;
|
|
213
271
|
}
|
|
214
272
|
const t2 = uuidv4();
|
|
215
|
-
|
|
273
|
+
x = t2;
|
|
216
274
|
try {
|
|
217
|
-
window.sessionStorage.setItem(
|
|
275
|
+
window.sessionStorage.setItem(w, t2);
|
|
218
276
|
} catch (e3) {
|
|
219
277
|
}
|
|
220
278
|
return t2;
|
|
221
279
|
}
|
|
222
|
-
let
|
|
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
|
|
232
|
-
let
|
|
233
|
-
for (const e4 of
|
|
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 && (
|
|
293
|
+
a2 + i3 > n2 && (s2.length > 0 && (o2.push(s2), s2 = [], a2 = 0), i3 > n2) || (s2.push(e4), a2 += i3);
|
|
236
294
|
}
|
|
237
|
-
|
|
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
|
|
250
|
-
let
|
|
251
|
-
|
|
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(
|
|
386
|
+
if (!isWebSocketOpen(M)) return;
|
|
254
387
|
const e2 = getClockSyncManager(), t2 = (function makeTimeSyncRequestId() {
|
|
255
|
-
return
|
|
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
|
|
271
|
-
const
|
|
403
|
+
let N = "", q = "", z = false;
|
|
404
|
+
const H = [];
|
|
272
405
|
function onNavigationChange(e2) {
|
|
273
|
-
|
|
406
|
+
H.push(e2);
|
|
274
407
|
}
|
|
275
408
|
function _updateHrefCache() {
|
|
276
|
-
|
|
277
|
-
for (const e2 of
|
|
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 (
|
|
284
|
-
|
|
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
|
|
428
|
+
return N || ("undefined" != typeof window ? window.location.href : "");
|
|
296
429
|
}
|
|
297
430
|
function getCachedHrefNoQuery() {
|
|
298
|
-
return
|
|
431
|
+
return q || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
|
|
299
432
|
}
|
|
300
|
-
const
|
|
301
|
-
let
|
|
433
|
+
const W = [];
|
|
434
|
+
let K = null;
|
|
302
435
|
function queueEventForIDB(e2) {
|
|
303
|
-
|
|
436
|
+
W.push(e2), W.length >= 50 ? _flushIDBQueue() : K || (K = setTimeout(_flushIDBQueue, 100));
|
|
304
437
|
}
|
|
305
438
|
function _flushIDBQueue() {
|
|
306
|
-
if (
|
|
439
|
+
if (K && (clearTimeout(K), K = null), 0 === W.length) return;
|
|
307
440
|
!(async function saveEventsToIDB(e2) {
|
|
308
|
-
await withStore$
|
|
441
|
+
await withStore$2("readwrite", async (t2) => {
|
|
309
442
|
for (const n2 of e2) t2.add({ timestamp: Date.now(), data: n2 });
|
|
310
443
|
});
|
|
311
|
-
})(
|
|
444
|
+
})(W.splice(0));
|
|
312
445
|
}
|
|
313
|
-
let
|
|
314
|
-
const
|
|
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(
|
|
317
|
-
if (
|
|
318
|
-
return
|
|
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
|
|
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(
|
|
330
|
-
if (
|
|
331
|
-
return
|
|
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
|
|
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(
|
|
478
|
+
localStorage.setItem(J, JSON.stringify(n2)), I && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
346
479
|
} catch (e3) {
|
|
347
|
-
|
|
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(
|
|
486
|
+
localStorage.removeItem(J), I && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
354
487
|
} catch (e2) {
|
|
355
|
-
|
|
488
|
+
I && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
356
489
|
}
|
|
357
490
|
}
|
|
358
491
|
function clearStaleFuncSpanState() {
|
|
359
|
-
|
|
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
|
|
494
|
+
let Y = false;
|
|
362
495
|
function restoreFuncSpanState() {
|
|
363
|
-
if (
|
|
364
|
-
|
|
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(
|
|
501
|
+
const e3 = localStorage.getItem(J);
|
|
369
502
|
if (!e3) return null;
|
|
370
503
|
const t2 = JSON.parse(e3);
|
|
371
|
-
return
|
|
504
|
+
return I && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
372
505
|
} catch (e3) {
|
|
373
|
-
return
|
|
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 (
|
|
377
|
-
Date.now() >=
|
|
378
|
-
} else
|
|
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(
|
|
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(
|
|
532
|
+
if (isWebSocketOpen(M)) if (R) await R;
|
|
400
533
|
else {
|
|
401
|
-
|
|
534
|
+
R = (async () => {
|
|
402
535
|
var _a, _b;
|
|
403
536
|
const e2 = await (async function getAllIndexedEvents() {
|
|
404
|
-
const e3 = await withStore$
|
|
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(
|
|
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
|
|
562
|
+
await R;
|
|
430
563
|
} finally {
|
|
431
|
-
|
|
564
|
+
R = null;
|
|
432
565
|
}
|
|
433
566
|
}
|
|
434
567
|
}
|
|
435
568
|
function sendEvent(e2) {
|
|
436
|
-
e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(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
|
-
|
|
572
|
+
I && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (G ? "ENABLED" : "DISABLED"))), (async () => {
|
|
440
573
|
try {
|
|
441
|
-
|
|
574
|
+
L = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
442
575
|
} finally {
|
|
443
|
-
|
|
576
|
+
L = false;
|
|
444
577
|
}
|
|
445
|
-
null !=
|
|
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 ==
|
|
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 !=
|
|
458
|
-
null !=
|
|
459
|
-
})(),
|
|
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 (
|
|
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
|
-
|
|
468
|
-
const e3 = Date.now(), n2 =
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}, n2)) : (
|
|
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 && (
|
|
475
|
-
|
|
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" }),
|
|
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
|
-
|
|
615
|
+
I && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
483
616
|
}
|
|
484
|
-
} else
|
|
617
|
+
} else Q = null, clearGlobalFuncSpanState();
|
|
485
618
|
} catch (e3) {
|
|
486
619
|
}
|
|
487
620
|
}
|
|
488
|
-
function initializeWebSocket(t2, n2, i2, o2,
|
|
621
|
+
function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
489
622
|
ensureHrefCache();
|
|
490
|
-
const
|
|
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"}://${
|
|
495
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
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,
|
|
504
|
-
const e2 =
|
|
505
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
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
|
|
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
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
|
|
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
|
-
|
|
653
|
+
c2.close(), null != D && (clearInterval(D), D = null);
|
|
519
654
|
} };
|
|
520
|
-
return
|
|
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),
|
|
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 (
|
|
527
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
528
|
-
} else
|
|
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 (
|
|
532
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
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
|
-
|
|
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 && !
|
|
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 (!
|
|
544
|
-
if (null !==
|
|
545
|
-
if (Date.now() >=
|
|
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
|
|
550
|
-
let
|
|
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
|
|
687
|
+
return ee;
|
|
553
688
|
}
|
|
554
|
-
let
|
|
555
|
-
const
|
|
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
|
-
|
|
558
|
-
for (const e3 of
|
|
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(),
|
|
562
|
-
if (
|
|
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
|
-
|
|
700
|
+
ne = null;
|
|
566
701
|
})().catch(() => {
|
|
567
|
-
|
|
702
|
+
ne = null;
|
|
568
703
|
}));
|
|
569
704
|
}
|
|
570
|
-
let
|
|
705
|
+
let oe = null;
|
|
571
706
|
async function getSourceMapModule() {
|
|
572
|
-
return
|
|
707
|
+
return oe || (oe = await import("source-map-js")), oe;
|
|
573
708
|
}
|
|
574
|
-
const
|
|
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 (
|
|
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
|
|
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
|
|
592
|
-
e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace",
|
|
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",
|
|
607
|
-
const
|
|
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(
|
|
746
|
+
const t4 = e4.match(se);
|
|
612
747
|
if (!t4) {
|
|
613
748
|
n3.push(e4);
|
|
614
749
|
continue;
|
|
615
750
|
}
|
|
616
|
-
const [, i3, o3,
|
|
617
|
-
if (!Number.isFinite(a3) || !Number.isFinite(
|
|
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
|
|
622
|
-
if (!
|
|
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 =
|
|
628
|
-
if (!u2.source || null == u2.line) for (let e5 = 1; e5 <= 20 && (u2 =
|
|
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 =
|
|
636
|
-
sendMessage({ type: "event", event: { type: 6, timestamp:
|
|
637
|
-
}
|
|
638
|
-
const
|
|
639
|
-
const
|
|
640
|
-
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3,
|
|
641
|
-
const
|
|
642
|
-
return
|
|
643
|
-
let
|
|
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 (
|
|
649
|
-
const
|
|
650
|
-
return
|
|
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(
|
|
655
|
-
if (
|
|
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,
|
|
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,
|
|
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:
|
|
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,
|
|
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:
|
|
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,
|
|
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:
|
|
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
|
|
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
|
|
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
|
-
|
|
749
|
-
|
|
750
|
-
|
|
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
|
-
|
|
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
|
|
899
|
+
let me = true, he = null, ye = null, Se = null, be = null;
|
|
775
900
|
function invalidateUrlCache() {
|
|
776
|
-
|
|
901
|
+
me = true;
|
|
777
902
|
}
|
|
778
|
-
const getUrlAndStoredUuids = () => (
|
|
779
|
-
|
|
780
|
-
})(), { page_visit_uuid:
|
|
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 =
|
|
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:
|
|
816
|
-
|
|
817
|
-
const i3 = e3, [
|
|
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,
|
|
822
|
-
const
|
|
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
|
|
949
|
+
const i3 = (function createThrottledEmit(e3, t2 = 1e3) {
|
|
825
950
|
if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
|
|
826
951
|
} };
|
|
827
|
-
const
|
|
828
|
-
let
|
|
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,
|
|
835
|
-
if (
|
|
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
|
|
838
|
-
|
|
839
|
-
0 !==
|
|
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
|
-
|
|
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 =
|
|
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:
|
|
854
|
-
|
|
855
|
-
const
|
|
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:
|
|
875
|
-
let
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
}, ...e2, maskInputOptions:
|
|
880
|
-
const g2 = Date.now(), m2 = await
|
|
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
|
|
884
|
-
|
|
885
|
-
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"),
|
|
886
|
-
} else
|
|
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:
|
|
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 (
|
|
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
|
-
|
|
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-${
|
|
1048
|
+
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${r2}`]);
|
|
918
1049
|
});
|
|
919
1050
|
const handleWidgetOpen = () => {
|
|
920
|
-
|
|
1051
|
+
ue == null ? void 0 : ue.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat opened", element_id: fe, provider: ge });
|
|
921
1052
|
}, handleWidgetClose = () => {
|
|
922
|
-
|
|
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
|
-
|
|
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
|
|
1064
|
+
return d2;
|
|
934
1065
|
}
|
|
935
|
-
const
|
|
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
|
|
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:
|
|
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
|
|
1135
|
+
let xe = getInitialState(), Te = null, Ie = null, Ee = null, Ce = false, Me = false;
|
|
1005
1136
|
function setSprintDefaulted(e2) {
|
|
1006
|
-
|
|
1137
|
+
Me = e2;
|
|
1007
1138
|
}
|
|
1008
1139
|
function setTimerInterval(e2) {
|
|
1009
|
-
|
|
1140
|
+
Ee = e2;
|
|
1010
1141
|
}
|
|
1011
1142
|
function setIsRecording(e2) {
|
|
1012
|
-
|
|
1143
|
+
Ce = e2;
|
|
1013
1144
|
}
|
|
1014
|
-
const
|
|
1015
|
-
let
|
|
1016
|
-
const
|
|
1145
|
+
const $e = ["jira", "linear", "zendesk"];
|
|
1146
|
+
let Ae = null;
|
|
1147
|
+
const Fe = /* @__PURE__ */ new Map();
|
|
1017
1148
|
function getIntegrationData() {
|
|
1018
|
-
return
|
|
1149
|
+
return Ae;
|
|
1019
1150
|
}
|
|
1020
1151
|
function hasValidIntegration() {
|
|
1021
|
-
return null !==
|
|
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
|
|
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) &&
|
|
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
|
|
1171
|
+
return Ae = n2, n2;
|
|
1041
1172
|
} catch (e3) {
|
|
1042
|
-
return console.error("Error refreshing integration data:", e3),
|
|
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 (!(
|
|
1088
|
-
const e2 = Array.isArray(
|
|
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 (!(
|
|
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 =
|
|
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
|
-
}),
|
|
1125
|
-
|
|
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 (!(
|
|
1130
|
-
const n2 = Array.isArray(
|
|
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 (
|
|
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
|
|
1144
|
-
if (!
|
|
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 && (
|
|
1277
|
+
e3.length >= 3 && (r2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
|
|
1147
1278
|
}
|
|
1148
|
-
return
|
|
1279
|
+
return r2 && (r2.id || r2.accountId) || null;
|
|
1149
1280
|
}
|
|
1150
1281
|
function lastReporterStorageKey() {
|
|
1151
|
-
if (!
|
|
1152
|
-
const e2 =
|
|
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 (!
|
|
1180
|
-
const t2 =
|
|
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 =
|
|
1313
|
+
const t3 = Ae.teams.find((t4) => t4.id === e2);
|
|
1183
1314
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
1184
1315
|
}
|
|
1185
|
-
return !t2 &&
|
|
1316
|
+
return !t2 && Ae.projects ? Ae.projects : [];
|
|
1186
1317
|
}
|
|
1187
1318
|
function updateFormWithIntegrationData(e2) {
|
|
1188
1319
|
var _a;
|
|
1189
|
-
if (!
|
|
1190
|
-
const t2 =
|
|
1191
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
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) :
|
|
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,
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
if (!e2.engTicketSprint && !
|
|
1201
|
-
const t3 = pickDefaultActiveSprint(
|
|
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(
|
|
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 &&
|
|
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
|
|
1210
|
-
if (!
|
|
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
|
-
|
|
1343
|
+
Ae = resolveIntegration(n2);
|
|
1213
1344
|
} catch (e3) {
|
|
1214
|
-
console.error("Error fetching integration data:", e3),
|
|
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
|
|
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
|
|
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
|
|
1270
|
-
return
|
|
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 || "",
|
|
1274
|
-
|
|
1275
|
-
const
|
|
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 &&
|
|
1278
|
-
}), t2(
|
|
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
|
|
1288
|
-
t2(
|
|
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
|
|
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,
|
|
1304
|
-
if (d2.includes(i3) || d2.includes(
|
|
1305
|
-
const u2 =
|
|
1306
|
-
switch (
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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(""),
|
|
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; ${
|
|
1391
|
-
${
|
|
1521
|
+
style="${p2} appearance:none; cursor:pointer; background-color: white; ${r4 ? "" : "color: #9ca3af;"}"
|
|
1522
|
+
${c2 ? "required" : ""}
|
|
1392
1523
|
>
|
|
1393
|
-
<option value="" ${
|
|
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 (
|
|
1402
|
-
const e5 =
|
|
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 &&
|
|
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
|
-
${
|
|
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" ===
|
|
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
|
-
${
|
|
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
|
-
${
|
|
1591
|
+
${c2 ? "required" : ""}
|
|
1461
1592
|
/>
|
|
1462
1593
|
</div>
|
|
1463
1594
|
` : null;
|
|
1464
1595
|
}
|
|
1465
|
-
})(e3,
|
|
1466
|
-
n2.innerHTML =
|
|
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
|
-
|
|
1601
|
+
xe.engTicketCustomFields[t3] = e4;
|
|
1471
1602
|
});
|
|
1472
1603
|
});
|
|
1473
1604
|
}
|
|
1474
1605
|
function generateEngTicketFieldsHTML() {
|
|
1475
1606
|
var _a;
|
|
1476
|
-
const e2 =
|
|
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,
|
|
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
|
-
})(
|
|
1625
|
+
})(De.shortcuts[e2]);
|
|
1495
1626
|
}
|
|
1496
1627
|
function getSessionIdSafely() {
|
|
1497
|
-
if (!
|
|
1498
|
-
return
|
|
1628
|
+
if (!De.resolveSessionId) throw new Error("getSessionId not defined");
|
|
1629
|
+
return De.resolveSessionId();
|
|
1499
1630
|
}
|
|
1500
1631
|
function openReportIssueModal(e2) {
|
|
1501
|
-
|
|
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
|
-
|
|
1505
|
-
|
|
1506
|
-
})(),
|
|
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
|
|
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 &&
|
|
1526
|
-
a2.setSelectionRange(
|
|
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
|
|
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 ? (
|
|
1673
|
+
n3 && !i3 ? (c2 += 1, c2 >= 2 && (refocus(), c2 = 0)) : (c2 = 0, (() => {
|
|
1543
1674
|
if (a2 && document.activeElement === a2) try {
|
|
1544
|
-
|
|
1675
|
+
s2 = { start: a2.selectionStart ?? a2.value.length, end: a2.selectionEnd ?? a2.value.length };
|
|
1545
1676
|
} catch {
|
|
1546
1677
|
}
|
|
1547
|
-
})()),
|
|
1678
|
+
})()), r2 = window.requestAnimationFrame(watchdog);
|
|
1548
1679
|
};
|
|
1549
|
-
|
|
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),
|
|
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
|
-
|
|
1696
|
+
Pe && (Pe.remove(), Pe = null), Pe = document.createElement("div"), Pe.id = "sf-report-issue-modal";
|
|
1566
1697
|
const t2 = "startnow" === e2;
|
|
1567
|
-
|
|
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;">${
|
|
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" ${
|
|
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:${
|
|
1694
|
-
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${
|
|
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:${
|
|
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="${
|
|
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:${
|
|
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
|
-
`,
|
|
1759
|
-
const e3 =
|
|
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" ===
|
|
1898
|
+
"lookback" === xe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
|
|
1768
1899
|
});
|
|
1769
|
-
const
|
|
1770
|
-
|
|
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
|
|
1782
|
-
|
|
1783
|
-
const e4 =
|
|
1784
|
-
|
|
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
|
-
|
|
1917
|
+
c2 && c2.addEventListener("change", async () => {
|
|
1787
1918
|
var _a;
|
|
1788
|
-
const e4 =
|
|
1789
|
-
if (
|
|
1790
|
-
if (!hasValidIntegration()) return
|
|
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 (!
|
|
1794
|
-
if (getFieldsForProject(
|
|
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
|
-
|
|
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
|
-
|
|
1937
|
+
xe.issueName = d2.value;
|
|
1807
1938
|
});
|
|
1808
1939
|
bindEngTicketListeners(), t3 && (t3.onclick = () => {
|
|
1809
1940
|
const e4 = document.getElementById("sf-issue-description");
|
|
1810
|
-
e4 && (
|
|
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
|
-
|
|
1951
|
+
Te = e6;
|
|
1821
1952
|
})(Date.now()), setIsRecording(true);
|
|
1822
1953
|
try {
|
|
1823
|
-
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() =>
|
|
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() - (
|
|
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,41 +1987,41 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1856
1987
|
}, 1e3);
|
|
1857
1988
|
})();
|
|
1858
1989
|
});
|
|
1859
|
-
|
|
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 =
|
|
1863
|
-
if (
|
|
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 =
|
|
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 (
|
|
1871
|
-
const o3 = document.getElementById("sf-issue-name"),
|
|
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) ||
|
|
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
|
-
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length),
|
|
1882
|
-
for (const e6 of
|
|
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) {
|
|
1883
2014
|
const t5 = e6.fieldId || e6.key;
|
|
1884
2015
|
if ("summary" === t5 || "description" === t5 || "priority" === t5) continue;
|
|
1885
2016
|
let n4, i4;
|
|
1886
|
-
"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) &&
|
|
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);
|
|
1887
2018
|
}
|
|
1888
|
-
if (
|
|
1889
|
-
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4,
|
|
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) {
|
|
1890
2021
|
var _a2, _b, _c;
|
|
1891
2022
|
try {
|
|
1892
2023
|
showStatusModal(true);
|
|
1893
|
-
const f3 = await createTriageAndIssueFromRecorder(
|
|
2024
|
+
const f3 = await createTriageAndIssueFromRecorder(De.apiKey, De.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, r4, s4, a4, c4, l4, d4, u3, p3);
|
|
1894
2025
|
if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
|
|
1895
2026
|
const e7 = f3.errors.map((e8) => e8.message).join("; ");
|
|
1896
2027
|
return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
|
|
@@ -1900,33 +2031,33 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1900
2031
|
} catch (e7) {
|
|
1901
2032
|
console.error("Error creating triage and issue:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1902
2033
|
}
|
|
1903
|
-
})(`${n3}`, `${i3}`, e5,
|
|
2034
|
+
})(`${n3}`, `${i3}`, e5, l3, d3, xe.createEngTicket, u2, p2, f2, g2, m2, h2, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1904
2035
|
} else closeModal(), (async function createTriage(e6, t5, n4, i4) {
|
|
1905
2036
|
var _a2, _b, _c;
|
|
1906
2037
|
try {
|
|
1907
2038
|
showStatusModal(true);
|
|
1908
|
-
const o3 = await createTriageFromRecorder(
|
|
2039
|
+
const o3 = await createTriageFromRecorder(De.apiKey, De.backendApi, getSessionIdSafely(), e6, t5, n4, i4);
|
|
1909
2040
|
if ((_a2 = o3 == null ? void 0 : o3.errors) == null ? void 0 : _a2.length) {
|
|
1910
2041
|
const e7 = o3.errors.map((e8) => e8.message).join("; ");
|
|
1911
2042
|
return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
|
|
1912
2043
|
}
|
|
1913
|
-
const
|
|
1914
|
-
|
|
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."));
|
|
1915
2046
|
} catch (e7) {
|
|
1916
2047
|
console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1917
2048
|
}
|
|
1918
2049
|
})(`${n3}`, `${i3}`, e5, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1919
2050
|
}
|
|
1920
2051
|
});
|
|
1921
|
-
})(),
|
|
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) => {
|
|
1922
2053
|
if (!e3 || !document.getElementById("sf-report-issue-modal")) return;
|
|
1923
|
-
|
|
2054
|
+
De.integrationData = e3;
|
|
1924
2055
|
const t3 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1925
2056
|
if (t3) {
|
|
1926
2057
|
const e4 = generateEngTicketFieldsHTML();
|
|
1927
|
-
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(
|
|
2058
|
+
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(xe), renderDynamicFields(xe.engTicketProject, xe.engTicketIssueType));
|
|
1928
2059
|
}
|
|
1929
|
-
if (
|
|
2060
|
+
if (Be) {
|
|
1930
2061
|
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1931
2062
|
e4 && (e4.style.display = "flex");
|
|
1932
2063
|
}
|
|
@@ -1934,40 +2065,40 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1934
2065
|
}
|
|
1935
2066
|
function initializeEngTicketForm() {
|
|
1936
2067
|
var _a;
|
|
1937
|
-
const e2 =
|
|
2068
|
+
const e2 = De.integrationData;
|
|
1938
2069
|
if (e2) {
|
|
1939
|
-
if (!
|
|
1940
|
-
if (getFieldsForProject(
|
|
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)) {
|
|
1941
2072
|
const t2 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1942
|
-
|
|
2073
|
+
xe.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
|
|
1943
2074
|
}
|
|
1944
2075
|
}
|
|
1945
|
-
|
|
2076
|
+
xe.engTicketProject && renderDynamicFields(xe.engTicketProject, xe.engTicketIssueType);
|
|
1946
2077
|
}
|
|
1947
2078
|
}
|
|
1948
2079
|
function setActiveTab(e2) {
|
|
1949
|
-
|
|
1950
|
-
const t2 =
|
|
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");
|
|
1951
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");
|
|
1952
2083
|
}
|
|
1953
2084
|
function updateModeSpecificUI(e2) {
|
|
1954
|
-
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"),
|
|
1955
|
-
if (t2 && n2 && i2 && o2 &&
|
|
1956
|
-
i2.style.display = "block", a2.style.display = "none",
|
|
1957
|
-
const e3 = null !==
|
|
1958
|
-
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed",
|
|
1959
|
-
const e4 = Math.floor((
|
|
1960
|
-
o2.style.display = "block",
|
|
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}`;
|
|
1961
2092
|
} else o2.style.display = "none";
|
|
1962
|
-
} else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block",
|
|
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";
|
|
1963
2094
|
}
|
|
1964
2095
|
function bindEngTicketListeners() {
|
|
1965
|
-
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"),
|
|
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");
|
|
1966
2097
|
e2 && e2.addEventListener("change", () => {
|
|
1967
|
-
|
|
2098
|
+
xe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
|
|
1968
2099
|
const t3 = document.getElementById("sf-eng-ticket-project");
|
|
1969
2100
|
if (t3) {
|
|
1970
|
-
|
|
2101
|
+
xe.engTicketProject = "", xe.engTicketCustomFields = {};
|
|
1971
2102
|
const n3 = getProjectsForTeam(e2.value);
|
|
1972
2103
|
t3.innerHTML = '<option value="">Select project...</option>', n3.forEach((e3) => {
|
|
1973
2104
|
const n4 = document.createElement("option");
|
|
@@ -1976,41 +2107,41 @@ function bindEngTicketListeners() {
|
|
|
1976
2107
|
}
|
|
1977
2108
|
}), t2 && t2.addEventListener("change", () => {
|
|
1978
2109
|
var _a;
|
|
1979
|
-
|
|
2110
|
+
xe.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", xe.engTicketCustomFields = {};
|
|
1980
2111
|
const e3 = getIntegrationData();
|
|
1981
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value),
|
|
1982
|
-
if (getFieldsForProject(t2.value,
|
|
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)) {
|
|
1983
2114
|
const t3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1984
|
-
|
|
2115
|
+
xe.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
|
|
1985
2116
|
}
|
|
1986
2117
|
}
|
|
1987
|
-
renderDynamicFields(t2.value,
|
|
1988
|
-
}),
|
|
1989
|
-
|
|
2118
|
+
renderDynamicFields(t2.value, xe.engTicketIssueType);
|
|
2119
|
+
}), r2 && r2.addEventListener("change", () => {
|
|
2120
|
+
xe.engTicketSprint = r2.value, r2.style.color = r2.value ? "" : "#9ca3af", setSprintDefaulted(true);
|
|
1990
2121
|
}), n2 && n2.addEventListener("change", () => {
|
|
1991
|
-
|
|
2122
|
+
xe.engTicketPriority = Number(n2.value);
|
|
1992
2123
|
}), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
|
|
1993
|
-
|
|
2124
|
+
xe.engTicketLabels = e3;
|
|
1994
2125
|
}), o2 && o2.addEventListener("change", () => {
|
|
1995
|
-
|
|
2126
|
+
xe.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
|
|
1996
2127
|
const e3 = document.getElementById("sf-eng-ticket-project");
|
|
1997
2128
|
if (e3 && e3.value) {
|
|
1998
|
-
const t3 =
|
|
1999
|
-
|
|
2129
|
+
const t3 = xe.engTicketCustomFields.reporter;
|
|
2130
|
+
xe.engTicketCustomFields = {}, t3 && (xe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
|
|
2000
2131
|
}
|
|
2001
2132
|
});
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2133
|
+
const s2 = document.getElementById("sf-dynamic-fields-container");
|
|
2134
|
+
s2 && (s2.addEventListener("input", (e3) => {
|
|
2004
2135
|
const t3 = e3.target;
|
|
2005
2136
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
2006
2137
|
const e4 = t3.dataset.fieldId;
|
|
2007
|
-
e4 && ("checkbox" === t3.type ?
|
|
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);
|
|
2008
2139
|
}
|
|
2009
|
-
}),
|
|
2140
|
+
}), s2.addEventListener("change", (e3) => {
|
|
2010
2141
|
const t3 = e3.target;
|
|
2011
2142
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
2012
2143
|
const e4 = t3.dataset.fieldId;
|
|
2013
|
-
if (e4 && (
|
|
2144
|
+
if (e4 && (xe.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
|
|
2014
2145
|
const e5 = t3;
|
|
2015
2146
|
e5.style.color = e5.value ? "" : "#9ca3af";
|
|
2016
2147
|
}
|
|
@@ -2020,10 +2151,10 @@ function bindEngTicketListeners() {
|
|
|
2020
2151
|
async function stopRecording() {
|
|
2021
2152
|
var _a;
|
|
2022
2153
|
!(function setRecordingEndTime(e2) {
|
|
2023
|
-
|
|
2024
|
-
})(Date.now()), setIsRecording(false),
|
|
2154
|
+
Ie = e2;
|
|
2155
|
+
})(Date.now()), setIsRecording(false), Ee && (clearInterval(Ee), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
|
|
2025
2156
|
try {
|
|
2026
|
-
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() =>
|
|
2157
|
+
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => Z);
|
|
2027
2158
|
e2();
|
|
2028
2159
|
} catch (e2) {
|
|
2029
2160
|
console.error("[Report Issue] Failed to disable function span tracking:", e2);
|
|
@@ -2036,18 +2167,18 @@ async function stopRecording() {
|
|
|
2036
2167
|
t3 && (t3.textContent = "Re-record");
|
|
2037
2168
|
}
|
|
2038
2169
|
const t2 = document.getElementById("sf-recording-timer-label"), n2 = document.getElementById("sf-recording-timer-display");
|
|
2039
|
-
if (t2 && n2 &&
|
|
2040
|
-
const e3 = Math.floor((
|
|
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");
|
|
2041
2172
|
n2.textContent = `${i3}:${o3}`, t2.style.display = "block";
|
|
2042
2173
|
}
|
|
2043
2174
|
const i2 = document.getElementById("sf-issue-description");
|
|
2044
|
-
i2 && (i2.value =
|
|
2175
|
+
i2 && (i2.value = xe.description);
|
|
2045
2176
|
const o2 = document.querySelector('input[value="startnow"]');
|
|
2046
2177
|
o2 && (o2.checked = true);
|
|
2047
|
-
const
|
|
2048
|
-
if (
|
|
2049
|
-
const e3 = Math.floor(((
|
|
2050
|
-
|
|
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";
|
|
2051
2182
|
}
|
|
2052
2183
|
const a2 = document.getElementById("sf-issue-submit-btn");
|
|
2053
2184
|
a2.disabled = false, a2.style.opacity = "1", a2.style.cursor = "pointer";
|
|
@@ -2060,10 +2191,10 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2060
2191
|
var _a2, _b;
|
|
2061
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();
|
|
2062
2193
|
})();
|
|
2063
|
-
const o2 = !e3 && i2,
|
|
2064
|
-
|
|
2065
|
-
const a2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!",
|
|
2066
|
-
|
|
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 = `
|
|
2067
2198
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
2068
2199
|
<div id="sf-triage-card"
|
|
2069
2200
|
style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
|
|
@@ -2080,8 +2211,8 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2080
2211
|
</button>
|
|
2081
2212
|
|
|
2082
2213
|
<h2 style="font-size:18px; font-weight:600; margin-bottom:${e3 || o2 ? 8 : 40}px; line-height:28px;">${a2}</h2>
|
|
2083
|
-
${l2}
|
|
2084
2214
|
${c2}
|
|
2215
|
+
${l2}
|
|
2085
2216
|
|
|
2086
2217
|
<div style="display:${o2 ? "none" : "flex"}; justify-content:flex-end; align-items:center; gap:8px;">
|
|
2087
2218
|
<button id="sf-copy-triage-link"
|
|
@@ -2104,28 +2235,28 @@ function showStatusModal(e2, t2, n2) {
|
|
|
2104
2235
|
<style>
|
|
2105
2236
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
2106
2237
|
</style>
|
|
2107
|
-
`, document.body.appendChild(
|
|
2108
|
-
const u2 =
|
|
2238
|
+
`, document.body.appendChild(s2);
|
|
2239
|
+
const u2 = s2.querySelector("#sf-triage-card");
|
|
2109
2240
|
(_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
|
|
2110
|
-
fadeCardAndRemove(
|
|
2241
|
+
fadeCardAndRemove(s2, u2, 300);
|
|
2111
2242
|
});
|
|
2112
2243
|
const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
|
|
2113
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", () => {
|
|
2114
|
-
navigator.clipboard.writeText(
|
|
2245
|
+
navigator.clipboard.writeText(r2).then(() => {
|
|
2115
2246
|
const e4 = document.getElementById("sf-copied-status");
|
|
2116
2247
|
e4 && (e4.style.display = "flex");
|
|
2117
2248
|
});
|
|
2118
2249
|
}), f2.disabled = false, f2.addEventListener("click", () => {
|
|
2119
|
-
(t3 || n3) && window.open(
|
|
2120
|
-
}), o2 || setTimeout(() => fadeCardAndRemove(
|
|
2250
|
+
(t3 || n3) && window.open(r2, "_blank");
|
|
2251
|
+
}), o2 || setTimeout(() => fadeCardAndRemove(s2, u2, 300), 1e4));
|
|
2121
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);
|
|
2122
2253
|
}
|
|
2123
2254
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
2124
2255
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
2125
2256
|
}
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2128
|
-
const t3 = { ...
|
|
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 };
|
|
2129
2260
|
if (!e3) return t3;
|
|
2130
2261
|
"boolean" == typeof e3.enabled && (t3.enabled = e3.enabled);
|
|
2131
2262
|
const n2 = ["openModalExistingMode", "openModalCaptureNewMode", "closeModal", "submitReport", "startRecording", "stopRecording"];
|
|
@@ -2135,41 +2266,125 @@ const Ee = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
2135
2266
|
}
|
|
2136
2267
|
return t3;
|
|
2137
2268
|
})(e2.shortcuts);
|
|
2138
|
-
const { shortcuts: t2 } =
|
|
2269
|
+
const { shortcuts: t2 } = De;
|
|
2139
2270
|
window.addEventListener("keydown", (e3) => {
|
|
2140
2271
|
const n2 = (function isTypingInInput() {
|
|
2141
2272
|
const e4 = document.activeElement;
|
|
2142
2273
|
return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
|
|
2143
|
-
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey,
|
|
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) => {
|
|
2144
2275
|
setActiveTab(e4), updateModeSpecificUI(e4);
|
|
2145
2276
|
} : injectModalHTML;
|
|
2146
|
-
if (
|
|
2147
|
-
if (
|
|
2148
|
-
if (
|
|
2149
|
-
if (
|
|
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")) {
|
|
2150
2281
|
const t3 = document.getElementById("sf-issue-submit-btn");
|
|
2151
2282
|
return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
|
|
2152
2283
|
}
|
|
2153
|
-
if (
|
|
2154
|
-
if (
|
|
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) {
|
|
2155
2286
|
const t3 = document.getElementById("sf-start-recording-btn");
|
|
2156
2287
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
2157
2288
|
}
|
|
2158
2289
|
});
|
|
2159
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
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();
|
|
2160
2375
|
function getCachedRegex(e2, t2) {
|
|
2161
2376
|
const n2 = `${e2}|${t2}`;
|
|
2162
|
-
let i2 =
|
|
2163
|
-
return i2 || (i2 = new RegExp(e2, t2),
|
|
2377
|
+
let i2 = ze.get(n2);
|
|
2378
|
+
return i2 || (i2 = new RegExp(e2, t2), ze.set(n2, i2)), i2;
|
|
2164
2379
|
}
|
|
2165
|
-
const
|
|
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" };
|
|
2166
2381
|
function maskAuthorizationHeader(e2) {
|
|
2167
|
-
const t2 = e2[
|
|
2382
|
+
const t2 = e2[Ve] ? Ve : e2[Qe] ? Qe : null;
|
|
2168
2383
|
if (!t2) return;
|
|
2169
2384
|
const n2 = e2[t2], i2 = n2.indexOf(" ");
|
|
2170
2385
|
if (-1 !== i2) {
|
|
2171
|
-
const o2 = n2.slice(0, i2 + 1),
|
|
2172
|
-
|
|
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);
|
|
2173
2388
|
} else n2.length > 8 ? e2[t2] = n2.slice(0, 4) + "*".repeat(n2.length - 8) + n2.slice(-4) : e2[t2] = "*".repeat(n2.length);
|
|
2174
2389
|
}
|
|
2175
2390
|
function trackDomainChangesOnce() {
|
|
@@ -2180,10 +2395,10 @@ function trackDomainChangesOnce() {
|
|
|
2180
2395
|
const i2 = window.location.href.split("?")[0];
|
|
2181
2396
|
if (n3 || i2 !== t2) {
|
|
2182
2397
|
t2 = i2;
|
|
2183
|
-
const o2 = uuidv4(),
|
|
2184
|
-
sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID",
|
|
2185
|
-
const
|
|
2186
|
-
e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid:
|
|
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 } });
|
|
2187
2402
|
}
|
|
2188
2403
|
}, n2 = /* @__PURE__ */ (function debounce(e3, t3) {
|
|
2189
2404
|
let n3;
|
|
@@ -2196,14 +2411,14 @@ function trackDomainChangesOnce() {
|
|
|
2196
2411
|
function sendUserDeviceUuid() {
|
|
2197
2412
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
2198
2413
|
let e2 = null;
|
|
2199
|
-
if (
|
|
2414
|
+
if (b) try {
|
|
2200
2415
|
e2 = localStorage.getItem("sailfishUserDeviceUuid");
|
|
2201
2416
|
} catch {
|
|
2202
2417
|
}
|
|
2203
2418
|
if (!e2) {
|
|
2204
2419
|
e2 = uuidv4();
|
|
2205
2420
|
try {
|
|
2206
|
-
|
|
2421
|
+
b && localStorage.setItem("sailfishUserDeviceUuid", e2);
|
|
2207
2422
|
} catch {
|
|
2208
2423
|
}
|
|
2209
2424
|
}
|
|
@@ -2214,48 +2429,48 @@ function handleVisibilityChange() {
|
|
|
2214
2429
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
2215
2430
|
"visible" === e2 && (getOrSetSessionId(), requestTimeSync());
|
|
2216
2431
|
try {
|
|
2217
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
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`);
|
|
2218
2433
|
} catch (e3) {
|
|
2219
2434
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
2220
2435
|
}
|
|
2221
2436
|
sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
|
|
2222
2437
|
}
|
|
2223
2438
|
function clearPageVisitDataFromSessionStorage() {
|
|
2224
|
-
|
|
2439
|
+
v && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
2225
2440
|
}
|
|
2226
|
-
let
|
|
2441
|
+
let Ye = false;
|
|
2227
2442
|
function _ensureModuleSideEffects() {
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
window.name =
|
|
2443
|
+
Ye || (Ye = true, restoreFuncSpanState(), (function ensureSessionListeners() {
|
|
2444
|
+
T || (T = true, y && window.addEventListener("beforeunload", () => {
|
|
2445
|
+
window.name = k + window.name;
|
|
2231
2446
|
}));
|
|
2232
|
-
})(),
|
|
2447
|
+
})(), y && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
2233
2448
|
sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
2234
|
-
})()),
|
|
2449
|
+
})()), S && document.addEventListener("visibilitychange", handleVisibilityChange), y && (window.addEventListener("beforeunload", () => {
|
|
2235
2450
|
clearPageVisitDataFromSessionStorage();
|
|
2236
2451
|
}), window.addEventListener("online", () => {
|
|
2237
2452
|
requestTimeSync();
|
|
2238
2453
|
})));
|
|
2239
2454
|
}
|
|
2240
2455
|
function matchParsedUrlAgainstPatterns(e2, t2) {
|
|
2241
|
-
const { hostname: n2, pathname: i2, port: o2 } = e2,
|
|
2456
|
+
const { hostname: n2, pathname: i2, port: o2 } = e2, r2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
|
|
2242
2457
|
return t2.some((e3) => {
|
|
2243
2458
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2244
|
-
let [n3,
|
|
2459
|
+
let [n3, s2] = t3.split("/", 2), a2 = "";
|
|
2245
2460
|
n3.includes(":") && ([n3, a2] = n3.split(":"));
|
|
2246
|
-
const
|
|
2461
|
+
const c2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), l2 = r2.startsWith("www.") ? r2.slice(4) : r2;
|
|
2247
2462
|
if (a2 && "*" !== a2 && o2 !== a2) return false;
|
|
2248
2463
|
if (n3.startsWith("*.")) {
|
|
2249
2464
|
const e4 = n3.slice(2).toLowerCase();
|
|
2250
|
-
if (!(
|
|
2251
|
-
if (
|
|
2252
|
-
return getCachedRegex(`^/${
|
|
2465
|
+
if (!(r2 === e4 || l2 === e4 || r2.endsWith("." + e4))) return false;
|
|
2466
|
+
if (s2) {
|
|
2467
|
+
return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2253
2468
|
}
|
|
2254
2469
|
return true;
|
|
2255
2470
|
}
|
|
2256
|
-
if (!
|
|
2257
|
-
if (
|
|
2258
|
-
return getCachedRegex(`^/${
|
|
2471
|
+
if (!c2.test(l2) && !c2.test(r2)) return false;
|
|
2472
|
+
if (s2) {
|
|
2473
|
+
return getCachedRegex(`^/${s2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2259
2474
|
}
|
|
2260
2475
|
return true;
|
|
2261
2476
|
});
|
|
@@ -2270,7 +2485,7 @@ function toAbsoluteUrl(e2) {
|
|
|
2270
2485
|
}
|
|
2271
2486
|
}
|
|
2272
2487
|
function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
2273
|
-
const n2 = [...
|
|
2488
|
+
const n2 = [...We, ...e2], i2 = t2.length > 0;
|
|
2274
2489
|
return function shouldSkipHeadersPropagation(e3) {
|
|
2275
2490
|
let o2;
|
|
2276
2491
|
try {
|
|
@@ -2278,95 +2493,95 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2278
2493
|
} catch {
|
|
2279
2494
|
return true;
|
|
2280
2495
|
}
|
|
2281
|
-
const
|
|
2282
|
-
return !(-1 ===
|
|
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));
|
|
2283
2498
|
};
|
|
2284
2499
|
}
|
|
2285
|
-
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 },
|
|
2286
|
-
const o2 = window.fetch,
|
|
2287
|
-
window.fetch = new Proxy(o2, { apply: async (e3,
|
|
2288
|
-
let
|
|
2289
|
-
if ("string" == typeof d2)
|
|
2290
|
-
else if (d2 instanceof Request)
|
|
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;
|
|
2291
2506
|
else {
|
|
2292
|
-
if (!(d2 instanceof URL)) return e3.apply(
|
|
2293
|
-
|
|
2507
|
+
if (!(d2 instanceof URL)) return e3.apply(n3, o3);
|
|
2508
|
+
l2 = d2.href;
|
|
2294
2509
|
}
|
|
2295
|
-
return
|
|
2510
|
+
return s2(l2) ? e3.apply(n3, o3) : (async function injectHeaderWrapper(e4, n4, o4, r3, s3, l3, d3) {
|
|
2296
2511
|
var _a, _b;
|
|
2297
|
-
if (!
|
|
2512
|
+
if (!l3) return e4.apply(n4, o4);
|
|
2298
2513
|
let u3 = uuidv4();
|
|
2299
|
-
const p2 = getUrlAndStoredUuids(), f2 =
|
|
2514
|
+
const p2 = getUrlAndStoredUuids(), f2 = s3.method || "GET", g2 = Date.now();
|
|
2300
2515
|
let m2, h2 = {}, y2 = null;
|
|
2301
2516
|
try {
|
|
2302
|
-
if (
|
|
2303
|
-
|
|
2517
|
+
if (r3 instanceof Request) {
|
|
2518
|
+
r3.headers.forEach((e5, t3) => {
|
|
2304
2519
|
h2[t3] = e5;
|
|
2305
2520
|
});
|
|
2306
2521
|
try {
|
|
2307
|
-
y2 =
|
|
2522
|
+
y2 = r3.clone();
|
|
2308
2523
|
} catch (e5) {
|
|
2309
2524
|
y2 = null;
|
|
2310
2525
|
}
|
|
2311
|
-
} else
|
|
2526
|
+
} else s3.headers && (s3.headers instanceof Headers ? s3.headers.forEach((e5, t3) => {
|
|
2312
2527
|
h2[t3] = e5;
|
|
2313
|
-
}) : Array.isArray(
|
|
2528
|
+
}) : Array.isArray(s3.headers) ? s3.headers.forEach(([e5, t3]) => {
|
|
2314
2529
|
h2[e5] = t3;
|
|
2315
|
-
}) : h2 = { ...
|
|
2530
|
+
}) : h2 = { ...s3.headers }), m2 = s3.body;
|
|
2316
2531
|
} catch (e5) {
|
|
2317
|
-
|
|
2532
|
+
qe && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2318
2533
|
}
|
|
2319
|
-
delete h2[
|
|
2534
|
+
delete h2[i];
|
|
2320
2535
|
const S2 = getFuncSpanHeader();
|
|
2321
2536
|
S2 && delete h2[S2.name];
|
|
2322
|
-
const
|
|
2323
|
-
h2[
|
|
2537
|
+
const b2 = `${l3}/${p2.page_visit_uuid}/${u3}`;
|
|
2538
|
+
h2[i] = b2, S2 && (h2[S2.name] = S2.value);
|
|
2324
2539
|
maskAuthorizationHeader(h2);
|
|
2325
2540
|
try {
|
|
2326
|
-
let S3 = await (async function injectHeader(e5, t3,
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2329
|
-
const
|
|
2330
|
-
d4.set(
|
|
2331
|
-
const u4 = new Request(
|
|
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 });
|
|
2332
2547
|
return await e5.call(t3, u4, o5);
|
|
2333
2548
|
}
|
|
2334
2549
|
{
|
|
2335
|
-
const
|
|
2336
|
-
return d4.set(
|
|
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);
|
|
2337
2552
|
}
|
|
2338
|
-
})(e4,
|
|
2339
|
-
|
|
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) {
|
|
2340
2555
|
try {
|
|
2341
|
-
let o6 =
|
|
2556
|
+
let o6 = n5[0], r4 = n5[1] || {};
|
|
2342
2557
|
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
return await e5.call(t3, o6,
|
|
2558
|
+
const n6 = { ...r4 }, s4 = new Headers(r4.headers || {});
|
|
2559
|
+
s4.delete(i), n6.headers = s4;
|
|
2560
|
+
return await e5.call(t3, o6, n6);
|
|
2346
2561
|
}
|
|
2347
2562
|
if (o6 instanceof Request) {
|
|
2348
|
-
const
|
|
2349
|
-
|
|
2350
|
-
const a3 = new Request(
|
|
2351
|
-
return await e5.call(t3, a3,
|
|
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);
|
|
2352
2567
|
}
|
|
2353
|
-
return e5.apply(t3,
|
|
2568
|
+
return e5.apply(t3, n5);
|
|
2354
2569
|
} catch (e6) {
|
|
2355
|
-
throw
|
|
2570
|
+
throw qe && console.log(`Retry without ${i} for ${o5} also failed:`, e6), e6;
|
|
2356
2571
|
}
|
|
2357
|
-
})(e4,
|
|
2358
|
-
const
|
|
2572
|
+
})(e4, n4, o4, d3), b3 = true);
|
|
2573
|
+
const v2 = Date.now(), w2 = (function captureClientTime() {
|
|
2359
2574
|
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2360
|
-
})(), k2 = S3.status, x2 = S3.ok,
|
|
2361
|
-
let
|
|
2575
|
+
})(), k2 = S3.status, x2 = S3.ok, T2 = x2 ? "" : `Request Error: ${S3.statusText}`;
|
|
2576
|
+
let I2 = null;
|
|
2362
2577
|
try {
|
|
2363
|
-
|
|
2364
|
-
|
|
2578
|
+
I2 = {}, S3.headers.forEach((e5, t3) => {
|
|
2579
|
+
I2[t3] = e5;
|
|
2365
2580
|
});
|
|
2366
2581
|
} catch (e5) {
|
|
2367
|
-
|
|
2582
|
+
qe && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
|
|
2368
2583
|
}
|
|
2369
|
-
const E2 = { type: 27, timestamp:
|
|
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) => {
|
|
2370
2585
|
E2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2371
2586
|
E2.data.request_body = e6, sendEvent(E2);
|
|
2372
2587
|
}, () => {
|
|
@@ -2377,30 +2592,30 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2377
2592
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2378
2593
|
const t3 = e5.headers.get("content-type");
|
|
2379
2594
|
if (!t3) return false;
|
|
2380
|
-
const
|
|
2381
|
-
return
|
|
2595
|
+
const n5 = t3.toLowerCase();
|
|
2596
|
+
return c2.some((e6) => n5.includes(e6));
|
|
2382
2597
|
})(S3)) sendEventWithBody(null);
|
|
2383
2598
|
else if ((function isStreamingResponse(e5) {
|
|
2384
2599
|
const t3 = e5.headers.get("content-type");
|
|
2385
2600
|
if (!t3) return false;
|
|
2386
|
-
const
|
|
2387
|
-
return a2.some((e6) =>
|
|
2601
|
+
const n5 = t3.toLowerCase();
|
|
2602
|
+
return a2.some((e6) => n5.includes(e6));
|
|
2388
2603
|
})(S3)) if (t2.captureStreamingResponseBody) try {
|
|
2389
|
-
(async function readStreamPrefix(e5, t3,
|
|
2390
|
-
const
|
|
2391
|
-
if (!
|
|
2392
|
-
const o5 =
|
|
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 = [];
|
|
2393
2608
|
let a3 = 0;
|
|
2394
2609
|
const readWithLimit = async () => {
|
|
2395
2610
|
try {
|
|
2396
2611
|
for (; a3 < t3; ) {
|
|
2397
2612
|
const { done: e6, value: t4 } = await o5.read();
|
|
2398
2613
|
if (e6) break;
|
|
2399
|
-
a3 += t4.byteLength,
|
|
2614
|
+
a3 += t4.byteLength, s4.push(r4.decode(t4, { stream: true }));
|
|
2400
2615
|
}
|
|
2401
|
-
return
|
|
2616
|
+
return s4.push(r4.decode()), s4.join("");
|
|
2402
2617
|
} catch {
|
|
2403
|
-
return
|
|
2618
|
+
return s4.length > 0 ? s4.join("") : null;
|
|
2404
2619
|
} finally {
|
|
2405
2620
|
try {
|
|
2406
2621
|
o5.cancel();
|
|
@@ -2414,8 +2629,8 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2414
2629
|
o5.cancel();
|
|
2415
2630
|
} catch {
|
|
2416
2631
|
}
|
|
2417
|
-
e6(
|
|
2418
|
-
},
|
|
2632
|
+
e6(s4.length > 0 ? s4.join("") : null);
|
|
2633
|
+
}, n5))]);
|
|
2419
2634
|
} catch {
|
|
2420
2635
|
try {
|
|
2421
2636
|
o5.cancel();
|
|
@@ -2441,22 +2656,22 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2441
2656
|
}
|
|
2442
2657
|
return S3;
|
|
2443
2658
|
} catch (t3) {
|
|
2444
|
-
const
|
|
2445
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(
|
|
2446
|
-
let
|
|
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;
|
|
2447
2662
|
if (y2) try {
|
|
2448
|
-
|
|
2663
|
+
c3 = await y2.text();
|
|
2449
2664
|
} catch {
|
|
2450
|
-
|
|
2665
|
+
c3 = null;
|
|
2451
2666
|
}
|
|
2452
|
-
throw sendEvent({ type: 27, timestamp:
|
|
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;
|
|
2453
2668
|
}
|
|
2454
|
-
})(e3,
|
|
2669
|
+
})(e3, n3, o3, d2, u2, r2, l2);
|
|
2455
2670
|
} });
|
|
2456
2671
|
}
|
|
2457
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo:
|
|
2458
|
-
var _a, _b;
|
|
2459
|
-
if (!
|
|
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() {
|
|
2460
2675
|
try {
|
|
2461
2676
|
if ("undefined" == typeof navigator) return false;
|
|
2462
2677
|
const e3 = navigator;
|
|
@@ -2467,92 +2682,101 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2467
2682
|
return false;
|
|
2468
2683
|
}
|
|
2469
2684
|
})()) return;
|
|
2470
|
-
const
|
|
2471
|
-
if (
|
|
2472
|
-
const
|
|
2473
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()),
|
|
2474
|
-
const o3 = XMLHttpRequest.prototype.open,
|
|
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);
|
|
2475
2690
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2476
|
-
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4,
|
|
2477
|
-
}, XMLHttpRequest.prototype.open = function(e4, t4, ...
|
|
2478
|
-
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...
|
|
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]);
|
|
2479
2694
|
}, XMLHttpRequest.prototype.send = function(...e4) {
|
|
2480
|
-
const
|
|
2481
|
-
if (!
|
|
2482
|
-
if (
|
|
2483
|
-
const o4 = sessionStorage.getItem("pageVisitUUID"),
|
|
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}`;
|
|
2484
2699
|
try {
|
|
2485
|
-
this.setRequestHeader(
|
|
2700
|
+
this.setRequestHeader(i, l3);
|
|
2486
2701
|
} catch (e5) {
|
|
2487
|
-
console.warn(`Could not set X-Sf3-Rid for ${
|
|
2702
|
+
console.warn(`Could not set X-Sf3-Rid for ${n3}`, e5);
|
|
2488
2703
|
}
|
|
2489
2704
|
const d3 = getFuncSpanHeader();
|
|
2490
2705
|
if (d3) try {
|
|
2491
|
-
this.setRequestHeader(d3.name, d3.value),
|
|
2706
|
+
this.setRequestHeader(d3.name, d3.value), qe && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: n3, header: d3.name });
|
|
2492
2707
|
} catch (e5) {
|
|
2493
|
-
|
|
2708
|
+
qe && console.warn(`[Sailfish] Could not set funcspan header for ${n3}`, e5);
|
|
2494
2709
|
}
|
|
2495
2710
|
const u3 = Date.now();
|
|
2496
2711
|
let p3 = false;
|
|
2497
2712
|
const f3 = e4[0], g3 = { ...this._capturedRequestHeaders };
|
|
2498
2713
|
maskAuthorizationHeader(g3);
|
|
2499
|
-
const emitFinished = (e5, t4,
|
|
2714
|
+
const emitFinished = (e5, t4, i2, o5, r4) => {
|
|
2500
2715
|
if (p3) return;
|
|
2501
2716
|
p3 = true;
|
|
2502
|
-
const
|
|
2503
|
-
sendEvent({ type: 27, timestamp:
|
|
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() });
|
|
2504
2719
|
};
|
|
2505
2720
|
return this.addEventListener("load", () => {
|
|
2506
2721
|
const e5 = this.status || 0;
|
|
2507
|
-
let
|
|
2722
|
+
let n4, i2 = null;
|
|
2508
2723
|
const o5 = 1024 * t3.captureResponseBodyMaxMb * 1024;
|
|
2509
2724
|
try {
|
|
2510
|
-
if (0 === t3.captureResponseBodyMaxMb)
|
|
2725
|
+
if (0 === t3.captureResponseBodyMaxMb) n4 = null;
|
|
2511
2726
|
else {
|
|
2512
2727
|
const e6 = this.responseText || this.response;
|
|
2513
|
-
|
|
2728
|
+
n4 = "string" == typeof e6 && e6.length > o5 ? null : e6;
|
|
2514
2729
|
}
|
|
2515
2730
|
} catch (e6) {
|
|
2516
|
-
|
|
2731
|
+
n4 = null;
|
|
2517
2732
|
}
|
|
2518
2733
|
try {
|
|
2519
|
-
|
|
2734
|
+
i2 = {};
|
|
2520
2735
|
const e6 = this.getAllResponseHeaders();
|
|
2521
2736
|
e6 && e6.split("\r\n").forEach((e7) => {
|
|
2522
2737
|
const t4 = e7.split(": ");
|
|
2523
|
-
2 === t4.length && (
|
|
2738
|
+
2 === t4.length && (i2[t4[0]] = t4[1]);
|
|
2524
2739
|
});
|
|
2525
2740
|
} catch (e6) {
|
|
2526
|
-
|
|
2741
|
+
qe && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i2 = null;
|
|
2527
2742
|
}
|
|
2528
|
-
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "",
|
|
2743
|
+
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n4, i2);
|
|
2529
2744
|
else {
|
|
2530
2745
|
const t4 = this.statusText || `HTTP ${e5}`;
|
|
2531
|
-
emitFinished(false, e5, t4,
|
|
2746
|
+
emitFinished(false, e5, t4, n4, i2);
|
|
2532
2747
|
}
|
|
2533
2748
|
}, { once: true }), this.addEventListener("error", () => {
|
|
2534
2749
|
const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
|
|
2535
2750
|
emitFinished(false, e5, t4);
|
|
2536
|
-
}, { once: true }),
|
|
2751
|
+
}, { once: true }), r3.apply(this, e4);
|
|
2537
2752
|
};
|
|
2538
|
-
})(
|
|
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() {
|
|
2539
2763
|
window.addEventListener("error", (e3) => {
|
|
2540
2764
|
captureError(e3.error ?? e3.message, false, { filename: e3.filename, lineno: e3.lineno, colno: e3.colno });
|
|
2541
2765
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2542
2766
|
captureError(e3.reason, true);
|
|
2543
2767
|
});
|
|
2544
|
-
})(),
|
|
2545
|
-
|
|
2546
|
-
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() ||
|
|
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) => {
|
|
2547
2771
|
var _a2;
|
|
2548
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
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"));
|
|
2549
2773
|
}).catch((e3) => {
|
|
2550
|
-
|
|
2551
|
-
}),
|
|
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() {
|
|
2552
2776
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2553
|
-
})(),
|
|
2777
|
+
})(), d2 && fetchAndSendIp(B2);
|
|
2554
2778
|
try {
|
|
2555
|
-
const n2 =
|
|
2779
|
+
const n2 = c2 ?? (function readGitSha() {
|
|
2556
2780
|
var _a2;
|
|
2557
2781
|
try {
|
|
2558
2782
|
const e3 = globalThis;
|
|
@@ -2569,7 +2793,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2569
2793
|
if ("string" == typeof e3 && e3) return e3;
|
|
2570
2794
|
} catch {
|
|
2571
2795
|
}
|
|
2572
|
-
})(),
|
|
2796
|
+
})(), i2 = a2 ?? "", o3 = s2 ?? "", r3 = R2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
|
|
2573
2797
|
try {
|
|
2574
2798
|
const e3 = window;
|
|
2575
2799
|
if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
|
|
@@ -2581,34 +2805,34 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2581
2805
|
t3 = "undefined" != typeof document && "loading" !== document.readyState;
|
|
2582
2806
|
} catch {
|
|
2583
2807
|
}
|
|
2584
|
-
const n3 = t3,
|
|
2585
|
-
for (const e4 of
|
|
2808
|
+
const n3 = t3, i3 = [];
|
|
2809
|
+
for (const e4 of ve) {
|
|
2586
2810
|
const t4 = e4(n3);
|
|
2587
|
-
t4 && !
|
|
2811
|
+
t4 && !i3.includes(t4) && i3.push(t4);
|
|
2588
2812
|
}
|
|
2589
|
-
return { framework:
|
|
2813
|
+
return { framework: i3[0] ?? null, additionalFrameworks: i3.slice(1), serviceRole: "frontend" };
|
|
2590
2814
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2591
2815
|
await yieldToMain();
|
|
2592
|
-
const [
|
|
2593
|
-
if (
|
|
2594
|
-
if ((
|
|
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) {
|
|
2595
2819
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2596
2820
|
await yieldToMain();
|
|
2597
|
-
const
|
|
2598
|
-
|
|
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 = "") {
|
|
2599
2823
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2600
|
-
})(
|
|
2601
|
-
} else console.error("Failed to start recording session:",
|
|
2824
|
+
})(a2, s2), _2.sentMapUuidOnce = true);
|
|
2825
|
+
} else console.error("Failed to start recording session:", h3.errors || h3);
|
|
2602
2826
|
} catch (e3) {
|
|
2603
2827
|
console.error("Error starting recording:", e3);
|
|
2604
2828
|
}
|
|
2605
2829
|
}
|
|
2606
|
-
exports.DEFAULT_CAPTURE_SETTINGS =
|
|
2830
|
+
exports.DEFAULT_CAPTURE_SETTINGS = Xe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = Je, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
2607
2831
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2608
|
-
|
|
2609
|
-
}, 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) {
|
|
2610
2834
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2611
|
-
|
|
2835
|
+
ee && ee.userId === e2 && JSON.stringify(ee.traits) === JSON.stringify(t2) || (ee = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2612
2836
|
}, exports.initRecorder = async (e2) => {
|
|
2613
2837
|
if ("undefined" == typeof window) return;
|
|
2614
2838
|
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
@@ -2617,14 +2841,14 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2617
2841
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2618
2842
|
try {
|
|
2619
2843
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2620
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData:
|
|
2621
|
-
let
|
|
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;
|
|
2622
2846
|
try {
|
|
2623
|
-
await o2(e2.apiKey, n3),
|
|
2847
|
+
await o2(e2.apiKey, n3), s2 = r2();
|
|
2624
2848
|
} catch (e3) {
|
|
2625
2849
|
console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
|
|
2626
2850
|
}
|
|
2627
|
-
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData:
|
|
2851
|
+
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: s2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
|
|
2628
2852
|
}
|
|
2629
2853
|
} catch (e3) {
|
|
2630
2854
|
console.warn("[Sailfish] Recorder initialization failed:", e3);
|
|
@@ -2632,7 +2856,62 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2632
2856
|
})().finally(() => {
|
|
2633
2857
|
delete t2.initPromise;
|
|
2634
2858
|
})), t2.initPromise);
|
|
2635
|
-
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.
|
|
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) {
|
|
2636
2915
|
let n2, i2;
|
|
2637
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;
|
|
2638
2917
|
try {
|
|
@@ -2642,6 +2921,97 @@ exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2642
2921
|
return false;
|
|
2643
2922
|
}
|
|
2644
2923
|
return matchParsedUrlAgainstPatterns(i2, t2);
|
|
2645
|
-
}, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.
|
|
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) {
|
|
2646
3009
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
2647
|
-
}, exports.
|
|
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;
|