@sailfish-ai/recorder 1.11.6 → 1.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/dist/chunkSerializer.js +70 -23
- package/dist/chunkSerializer.js.br +0 -0
- package/dist/chunkSerializer.js.gz +0 -0
- package/dist/chunks/chunkSerializer-Cd8y9tID.js +115 -0
- 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 +116 -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-CftVmmO9.js → index-Bvd8oTpV.js} +710 -541
- package/dist/chunks/index-Bvd8oTpV.js.br +0 -0
- package/dist/chunks/index-Bvd8oTpV.js.gz +0 -0
- package/dist/chunks/{index-QXHuV98g.js → index-CXvHbLRT.js} +759 -586
- package/dist/chunks/index-CXvHbLRT.js.br +0 -0
- package/dist/chunks/index-CXvHbLRT.js.gz +0 -0
- package/dist/clockSync.js +196 -0
- package/dist/clockSync.js.br +0 -0
- package/dist/clockSync.js.gz +0 -0
- package/dist/graphql.js +5 -0
- package/dist/graphql.js.br +0 -0
- package/dist/graphql.js.gz +0 -0
- package/dist/inAppReportIssueModal/index.js +52 -1
- package/dist/inAppReportIssueModal/index.js.br +0 -0
- package/dist/inAppReportIssueModal/index.js.gz +0 -0
- package/dist/inAppReportIssueModal/integrations.js +36 -0
- package/dist/inAppReportIssueModal/integrations.js.br +0 -0
- package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
- package/dist/inAppReportIssueModal/state.js +8 -0
- package/dist/inAppReportIssueModal/state.js.br +0 -0
- package/dist/inAppReportIssueModal/state.js.gz +0 -0
- package/dist/index.js +67 -5
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/privacyMask.js +93 -0
- package/dist/privacyMask.js.br +0 -0
- package/dist/privacyMask.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 +25 -22
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +1318 -1127
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +84 -13
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/types/chunkSerializer.d.ts +14 -0
- package/dist/types/clockSync.d.ts +70 -0
- package/dist/types/inAppReportIssueModal/integrations.d.ts +1 -0
- package/dist/types/inAppReportIssueModal/state.d.ts +2 -0
- package/dist/types/index.d.ts +16 -2
- package/dist/types/privacyMask.d.ts +46 -0
- package/dist/types/recording.d.ts +1 -0
- package/dist/types/types.d.ts +23 -0
- package/dist/types/websocket.d.ts +1 -0
- package/dist/websocket.js +111 -0
- package/dist/websocket.js.br +0 -0
- package/dist/websocket.js.gz +0 -0
- package/package.json +1 -1
- package/dist/chunks/chunkSerializer-D7_uK-dD.js +0 -94
- package/dist/chunks/chunkSerializer-D7_uK-dD.js.br +0 -0
- package/dist/chunks/chunkSerializer-D7_uK-dD.js.gz +0 -0
- package/dist/chunks/chunkSerializer-DkWXHnW4.js +0 -95
- package/dist/chunks/chunkSerializer-DkWXHnW4.js.br +0 -0
- package/dist/chunks/chunkSerializer-DkWXHnW4.js.gz +0 -0
- package/dist/chunks/index-CftVmmO9.js.br +0 -0
- package/dist/chunks/index-CftVmmO9.js.gz +0 -0
- package/dist/chunks/index-QXHuV98g.js.br +0 -0
- package/dist/chunks/index-QXHuV98g.js.gz +0 -0
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
11
|
for (let key of __getOwnPropNames(from))
|
|
@@ -21,6 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
23
|
mod
|
|
23
24
|
));
|
|
25
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
26
|
const e = require("reconnecting-websocket"), t = require("@sailfish-rrweb/types");
|
|
25
27
|
function readDebugFlag() {
|
|
26
28
|
var _a;
|
|
@@ -57,30 +59,96 @@ function uuidv4() {
|
|
|
57
59
|
return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
|
-
const n = "X-Sf3-Rid", i = 0, o = 1,
|
|
62
|
+
const n = "X-Sf3-Rid", i = 0, o = 1, s = 2, r = 4, a = "undefined" != typeof performance && "function" == typeof performance.now;
|
|
63
|
+
function monotonicNow() {
|
|
64
|
+
return a ? performance.now() : Date.now();
|
|
65
|
+
}
|
|
66
|
+
function timeOriginMs() {
|
|
67
|
+
return a ? performance.timeOrigin : 0;
|
|
68
|
+
}
|
|
69
|
+
class ClockSyncManager {
|
|
70
|
+
constructor() {
|
|
71
|
+
__publicField(this, "samples", []);
|
|
72
|
+
__publicField(this, "pending", /* @__PURE__ */ new Map());
|
|
73
|
+
__publicField(this, "estimatedOffsetMs", null);
|
|
74
|
+
__publicField(this, "bestRttMs", null);
|
|
75
|
+
__publicField(this, "lastSyncMonoMs", null);
|
|
76
|
+
}
|
|
77
|
+
beginSync(e2) {
|
|
78
|
+
const t2 = { requestId: e2, clientSendMonoMs: monotonicNow() };
|
|
79
|
+
return this.pending.set(e2, t2), t2;
|
|
80
|
+
}
|
|
81
|
+
abandonSync(e2) {
|
|
82
|
+
this.pending.delete(e2);
|
|
83
|
+
}
|
|
84
|
+
recordTimeSyncResponse(e2) {
|
|
85
|
+
const t2 = this.pending.get(e2.requestId);
|
|
86
|
+
if (!t2) return null;
|
|
87
|
+
this.pending.delete(e2.requestId);
|
|
88
|
+
const n2 = monotonicNow(), i2 = n2 - t2.clientSendMonoMs;
|
|
89
|
+
if (i2 < 0 || !isFinite(i2)) return null;
|
|
90
|
+
const o2 = (t2.clientSendMonoMs + n2) / 2, s2 = (e2.serverReceivedAtMs + e2.serverSentAtMs) / 2 - o2, r2 = { clientSendMonoMs: t2.clientSendMonoMs, clientReceiveMonoMs: n2, serverReceiveWallMs: e2.serverReceivedAtMs, serverSendWallMs: e2.serverSentAtMs, rttMs: i2, estimatedOffsetMs: s2, browserWallAtSyncMs: Date.now() };
|
|
91
|
+
return this.samples.push(r2), this.pruneSamples(n2), this.recompute(n2), r2;
|
|
92
|
+
}
|
|
93
|
+
estimateServerTime(e2) {
|
|
94
|
+
return null == this.estimatedOffsetMs ? null : this.estimatedOffsetMs + e2;
|
|
95
|
+
}
|
|
96
|
+
getSyncMetadata() {
|
|
97
|
+
const e2 = monotonicNow(), t2 = null != this.lastSyncMonoMs ? e2 - this.lastSyncMonoMs : null;
|
|
98
|
+
return { offsetMs: this.estimatedOffsetMs, rttMs: this.bestRttMs, syncAgeMs: t2 };
|
|
99
|
+
}
|
|
100
|
+
getBrowserClockSkewMs() {
|
|
101
|
+
if (0 === this.samples.length) return null;
|
|
102
|
+
const e2 = this.samples[this.samples.length - 1], t2 = e2.estimatedOffsetMs + e2.clientReceiveMonoMs;
|
|
103
|
+
return e2.browserWallAtSyncMs - t2;
|
|
104
|
+
}
|
|
105
|
+
reset() {
|
|
106
|
+
this.samples = [], this.pending.clear(), this.estimatedOffsetMs = null, this.bestRttMs = null, this.lastSyncMonoMs = null;
|
|
107
|
+
}
|
|
108
|
+
pruneSamples(e2) {
|
|
109
|
+
if (0 === this.samples.length) return;
|
|
110
|
+
const t2 = e2 - 6e5;
|
|
111
|
+
this.samples = this.samples.filter((e3) => e3.clientReceiveMonoMs >= t2), this.samples.length > 20 && (this.samples = this.samples.slice(this.samples.length - 20));
|
|
112
|
+
}
|
|
113
|
+
recompute(e2) {
|
|
114
|
+
const t2 = this.samples.filter((e3) => e3.rttMs <= 500).sort((e3, t3) => e3.rttMs - t3.rttMs).slice(0, 5);
|
|
115
|
+
if (0 === t2.length) return this.lastSyncMonoMs = e2, void (this.bestRttMs = null);
|
|
116
|
+
const n2 = t2.map((e3) => e3.estimatedOffsetMs).sort((e3, t3) => e3 - t3);
|
|
117
|
+
this.estimatedOffsetMs = n2[Math.floor(n2.length / 2)], this.bestRttMs = t2[0].rttMs, this.lastSyncMonoMs = e2;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
61
120
|
let l = null;
|
|
121
|
+
function getClockSyncManager() {
|
|
122
|
+
return l || (l = new ClockSyncManager()), l;
|
|
123
|
+
}
|
|
124
|
+
function buildEventTimeEnvelope(e2, t2) {
|
|
125
|
+
const n2 = getClockSyncManager(), i2 = n2.getSyncMetadata(), o2 = n2.estimateServerTime(e2);
|
|
126
|
+
return { client: { wallTimeMs: t2, monotonicMs: e2, timeOriginMs: timeOriginMs() }, serverEstimated: { eventTimeMs: o2, offsetMs: i2.offsetMs, rttMs: i2.rttMs, syncAgeMs: i2.syncAgeMs } };
|
|
127
|
+
}
|
|
128
|
+
const c = "recordingEvents";
|
|
129
|
+
let d = null;
|
|
62
130
|
function openDb$1() {
|
|
63
131
|
return (function hasIndexedDB$1() {
|
|
64
132
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
65
|
-
})() ?
|
|
133
|
+
})() ? d || (d = new Promise((e2) => {
|
|
66
134
|
try {
|
|
67
135
|
const t2 = globalThis.indexedDB.open("leapsEventDB", 1);
|
|
68
136
|
t2.onupgradeneeded = () => {
|
|
69
137
|
const e3 = t2.result;
|
|
70
|
-
e3.objectStoreNames.contains(
|
|
138
|
+
e3.objectStoreNames.contains(c) || e3.createObjectStore(c, { keyPath: "id", autoIncrement: true });
|
|
71
139
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => {
|
|
72
140
|
e2(null);
|
|
73
141
|
};
|
|
74
142
|
} catch {
|
|
75
143
|
e2(null);
|
|
76
144
|
}
|
|
77
|
-
}),
|
|
145
|
+
}), d) : Promise.resolve(null);
|
|
78
146
|
}
|
|
79
147
|
function withStore$1(e2, t2) {
|
|
80
148
|
return openDb$1().then((n2) => n2 ? new Promise((i2) => {
|
|
81
149
|
try {
|
|
82
|
-
const o2 = n2.transaction(
|
|
83
|
-
Promise.resolve(t2(
|
|
150
|
+
const o2 = n2.transaction(c, e2), s2 = o2.objectStore(c);
|
|
151
|
+
Promise.resolve(t2(s2)).then((e3) => {
|
|
84
152
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
85
153
|
}).catch(() => i2(null));
|
|
86
154
|
} catch {
|
|
@@ -93,29 +161,29 @@ async function deleteEventsByIds(e2) {
|
|
|
93
161
|
for (const n2 of e2) t2.delete(n2);
|
|
94
162
|
});
|
|
95
163
|
}
|
|
96
|
-
const
|
|
97
|
-
let
|
|
164
|
+
const u = "notifyMessages";
|
|
165
|
+
let p = null;
|
|
98
166
|
function openDb() {
|
|
99
167
|
return (function hasIndexedDB() {
|
|
100
168
|
return "undefined" != typeof globalThis && !!globalThis.indexedDB;
|
|
101
|
-
})() ?
|
|
169
|
+
})() ? p || (p = new Promise((e2) => {
|
|
102
170
|
try {
|
|
103
171
|
const t2 = globalThis.indexedDB.open("leapsNotifyDB", 1);
|
|
104
172
|
t2.onupgradeneeded = () => {
|
|
105
173
|
const e3 = t2.result;
|
|
106
|
-
e3.objectStoreNames.contains(
|
|
174
|
+
e3.objectStoreNames.contains(u) || e3.createObjectStore(u, { keyPath: "id", autoIncrement: true });
|
|
107
175
|
}, t2.onsuccess = () => e2(t2.result), t2.onerror = () => e2(null), t2.onblocked = () => e2(null);
|
|
108
176
|
} catch {
|
|
109
177
|
e2(null);
|
|
110
178
|
}
|
|
111
|
-
}),
|
|
179
|
+
}), p) : Promise.resolve(null);
|
|
112
180
|
}
|
|
113
181
|
async function withStore(e2, t2) {
|
|
114
182
|
const n2 = await openDb();
|
|
115
183
|
return n2 ? new Promise((i2) => {
|
|
116
184
|
try {
|
|
117
|
-
const o2 = n2.transaction(
|
|
118
|
-
Promise.resolve(t2(
|
|
185
|
+
const o2 = n2.transaction(u, e2), s2 = o2.objectStore(u);
|
|
186
|
+
Promise.resolve(t2(s2)).then((e3) => {
|
|
119
187
|
o2.oncomplete = () => i2(e3), o2.onerror = () => i2(null);
|
|
120
188
|
}).catch(() => i2(null));
|
|
121
189
|
} catch {
|
|
@@ -133,20 +201,20 @@ async function deleteNotifyMessageById(e2) {
|
|
|
133
201
|
t2.delete(e2);
|
|
134
202
|
});
|
|
135
203
|
}
|
|
136
|
-
const
|
|
137
|
-
let
|
|
204
|
+
const f = "undefined" != typeof globalThis && void 0 !== globalThis.window, g = "undefined" != typeof globalThis && void 0 !== globalThis.document, m = "undefined" != typeof globalThis && "localStorage" in globalThis, h = "undefined" != typeof globalThis && "sessionStorage" in globalThis, y = "sailfishSessionId", S = "__sailfish_refresh__";
|
|
205
|
+
let v = null;
|
|
138
206
|
function getOrSetSessionId() {
|
|
139
|
-
if (!
|
|
140
|
-
if (
|
|
141
|
-
const e2 = window.name.startsWith(
|
|
207
|
+
if (!f) return uuidv4();
|
|
208
|
+
if (v) return v;
|
|
209
|
+
const e2 = window.name.startsWith(S);
|
|
142
210
|
if (e2 && (window.name = window.name.substring(20)), e2) {
|
|
143
|
-
const e3 = window.sessionStorage.getItem(
|
|
144
|
-
if (e3) return
|
|
211
|
+
const e3 = window.sessionStorage.getItem(y);
|
|
212
|
+
if (e3) return v = e3, e3;
|
|
145
213
|
}
|
|
146
214
|
const t2 = uuidv4();
|
|
147
|
-
|
|
215
|
+
v = t2;
|
|
148
216
|
try {
|
|
149
|
-
window.sessionStorage.setItem(
|
|
217
|
+
window.sessionStorage.setItem(y, t2);
|
|
150
218
|
} catch (e3) {
|
|
151
219
|
}
|
|
152
220
|
return t2;
|
|
@@ -160,13 +228,13 @@ function buildBatches(e2, t2, n2) {
|
|
|
160
228
|
}
|
|
161
229
|
const o2 = [];
|
|
162
230
|
for (const e3 in i2) {
|
|
163
|
-
const
|
|
164
|
-
let
|
|
165
|
-
for (const e4 of
|
|
231
|
+
const s2 = i2[e3];
|
|
232
|
+
let r2 = [], a2 = 0;
|
|
233
|
+
for (const e4 of s2) {
|
|
166
234
|
const i3 = t2(e4);
|
|
167
|
-
a2 + i3 > n2 && (
|
|
235
|
+
a2 + i3 > n2 && (r2.length > 0 && (o2.push(r2), r2 = [], a2 = 0), i3 > n2) || (r2.push(e4), a2 += i3);
|
|
168
236
|
}
|
|
169
|
-
|
|
237
|
+
r2.length > 0 && o2.push(r2);
|
|
170
238
|
}
|
|
171
239
|
return o2;
|
|
172
240
|
}
|
|
@@ -178,22 +246,42 @@ function withAppUrlMetadata(e2) {
|
|
|
178
246
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
247
|
}
|
|
180
248
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
181
|
-
const
|
|
182
|
-
let
|
|
183
|
-
|
|
249
|
+
const w = readDebugFlag(), k = "per_session";
|
|
250
|
+
let x = null, I = null, T = false, E = null, C = null;
|
|
251
|
+
let M = null, $ = 0;
|
|
252
|
+
function requestTimeSync() {
|
|
253
|
+
if (!isWebSocketOpen(I)) return;
|
|
254
|
+
const e2 = getClockSyncManager(), t2 = (function makeTimeSyncRequestId() {
|
|
255
|
+
return $ += 1, `ts-${$}-${Math.random().toString(36).slice(2, 10)}`;
|
|
256
|
+
})();
|
|
257
|
+
e2.beginSync(t2);
|
|
258
|
+
wsSendPayload({ type: "time-sync-request", requestId: t2, clientSentAtMs: Date.now() }) || e2.abandonSync(t2);
|
|
259
|
+
}
|
|
260
|
+
function enrichEventWithTimeSync(e2) {
|
|
261
|
+
if (!e2 || "object" != typeof e2) return;
|
|
262
|
+
if (e2.client && null != e2.client.monotonicMs) {
|
|
263
|
+
if (!(null == e2.client.timeOriginMs || Math.abs(e2.client.timeOriginMs - timeOriginMs()) <= 1)) return;
|
|
264
|
+
const t3 = buildEventTimeEnvelope(e2.client.monotonicMs, e2.client.wallTimeMs ?? Date.now());
|
|
265
|
+
return void (e2.serverEstimated ? null == e2.serverEstimated.eventTimeMs && null != t3.serverEstimated.eventTimeMs && (e2.serverEstimated = t3.serverEstimated) : e2.serverEstimated = t3.serverEstimated);
|
|
266
|
+
}
|
|
267
|
+
const t2 = buildEventTimeEnvelope(monotonicNow(), Date.now());
|
|
268
|
+
e2.client = t2.client, e2.serverEstimated = t2.serverEstimated;
|
|
269
|
+
}
|
|
270
|
+
let F = "", A = "", L = false;
|
|
271
|
+
const R = [];
|
|
184
272
|
function onNavigationChange(e2) {
|
|
185
|
-
|
|
273
|
+
R.push(e2);
|
|
186
274
|
}
|
|
187
275
|
function _updateHrefCache() {
|
|
188
|
-
|
|
189
|
-
for (const e2 of
|
|
276
|
+
F = window.location.href, A = window.location.origin + window.location.pathname;
|
|
277
|
+
for (const e2 of R) try {
|
|
190
278
|
e2();
|
|
191
279
|
} catch (e3) {
|
|
192
280
|
}
|
|
193
281
|
}
|
|
194
282
|
function ensureHrefCache() {
|
|
195
|
-
if (
|
|
196
|
-
|
|
283
|
+
if (L || "undefined" == typeof window) return;
|
|
284
|
+
L = true, _updateHrefCache(), window.addEventListener("popstate", _updateHrefCache), window.addEventListener("hashchange", _updateHrefCache);
|
|
197
285
|
const e2 = history.pushState;
|
|
198
286
|
history.pushState = function(...t3) {
|
|
199
287
|
e2.apply(this, t3), _updateHrefCache();
|
|
@@ -204,48 +292,48 @@ function ensureHrefCache() {
|
|
|
204
292
|
};
|
|
205
293
|
}
|
|
206
294
|
function getCachedHref() {
|
|
207
|
-
return
|
|
295
|
+
return F || ("undefined" != typeof window ? window.location.href : "");
|
|
208
296
|
}
|
|
209
297
|
function getCachedHrefNoQuery() {
|
|
210
|
-
return
|
|
298
|
+
return A || ("undefined" != typeof window ? window.location.origin + window.location.pathname : "");
|
|
211
299
|
}
|
|
212
|
-
const
|
|
213
|
-
let
|
|
300
|
+
const D = [];
|
|
301
|
+
let P = null;
|
|
214
302
|
function queueEventForIDB(e2) {
|
|
215
|
-
|
|
303
|
+
D.push(e2), D.length >= 50 ? _flushIDBQueue() : P || (P = setTimeout(_flushIDBQueue, 100));
|
|
216
304
|
}
|
|
217
305
|
function _flushIDBQueue() {
|
|
218
|
-
if (
|
|
306
|
+
if (P && (clearTimeout(P), P = null), 0 === D.length) return;
|
|
219
307
|
!(async function saveEventsToIDB(e2) {
|
|
220
308
|
await withStore$1("readwrite", async (t2) => {
|
|
221
309
|
for (const n2 of e2) t2.add({ timestamp: Date.now(), data: n2 });
|
|
222
310
|
});
|
|
223
|
-
})(
|
|
311
|
+
})(D.splice(0));
|
|
224
312
|
}
|
|
225
|
-
let
|
|
226
|
-
const
|
|
313
|
+
let _ = false, O = null, B = null, j = false;
|
|
314
|
+
const U = "sailfish_funcspan_global_state";
|
|
227
315
|
function wsSendPayload(e2) {
|
|
228
|
-
if (!isWebSocketOpen(
|
|
229
|
-
if (
|
|
230
|
-
return
|
|
316
|
+
if (!isWebSocketOpen(I)) return false;
|
|
317
|
+
if (x) try {
|
|
318
|
+
return x.postMessage({ type: "send", payload: e2 }), true;
|
|
231
319
|
} catch {
|
|
232
320
|
return false;
|
|
233
321
|
}
|
|
234
322
|
try {
|
|
235
|
-
return
|
|
323
|
+
return I.send(JSON.stringify(e2)), true;
|
|
236
324
|
} catch {
|
|
237
325
|
return false;
|
|
238
326
|
}
|
|
239
327
|
}
|
|
240
328
|
function wsSendRaw(e2) {
|
|
241
|
-
if (!isWebSocketOpen(
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
329
|
+
if (!isWebSocketOpen(I)) return false;
|
|
330
|
+
if (x) try {
|
|
331
|
+
return x.postMessage({ type: "sendRaw", payload: e2 }), true;
|
|
244
332
|
} catch {
|
|
245
333
|
return false;
|
|
246
334
|
}
|
|
247
335
|
try {
|
|
248
|
-
return
|
|
336
|
+
return I.send(e2), true;
|
|
249
337
|
} catch {
|
|
250
338
|
return false;
|
|
251
339
|
}
|
|
@@ -254,40 +342,40 @@ function saveGlobalFuncSpanState(e2, t2) {
|
|
|
254
342
|
try {
|
|
255
343
|
if ("undefined" == typeof localStorage) return;
|
|
256
344
|
const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
|
|
257
|
-
localStorage.setItem(
|
|
345
|
+
localStorage.setItem(U, JSON.stringify(n2)), w && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
258
346
|
} catch (e3) {
|
|
259
|
-
|
|
347
|
+
w && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
|
|
260
348
|
}
|
|
261
349
|
}
|
|
262
350
|
function clearGlobalFuncSpanState() {
|
|
263
351
|
try {
|
|
264
352
|
if ("undefined" == typeof localStorage) return;
|
|
265
|
-
localStorage.removeItem(
|
|
353
|
+
localStorage.removeItem(U), w && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
266
354
|
} catch (e2) {
|
|
267
|
-
|
|
355
|
+
w && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
268
356
|
}
|
|
269
357
|
}
|
|
270
358
|
function clearStaleFuncSpanState() {
|
|
271
|
-
|
|
359
|
+
_ = false, B = null, j = false, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
|
|
272
360
|
}
|
|
273
|
-
let
|
|
361
|
+
let q = false;
|
|
274
362
|
function restoreFuncSpanState() {
|
|
275
|
-
if (
|
|
276
|
-
|
|
363
|
+
if (q) return;
|
|
364
|
+
q = true;
|
|
277
365
|
const e2 = (function loadGlobalFuncSpanState() {
|
|
278
366
|
try {
|
|
279
367
|
if ("undefined" == typeof localStorage) return null;
|
|
280
|
-
const e3 = localStorage.getItem(
|
|
368
|
+
const e3 = localStorage.getItem(U);
|
|
281
369
|
if (!e3) return null;
|
|
282
370
|
const t2 = JSON.parse(e3);
|
|
283
|
-
return
|
|
371
|
+
return w && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
284
372
|
} catch (e3) {
|
|
285
|
-
return
|
|
373
|
+
return w && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
|
|
286
374
|
}
|
|
287
375
|
})();
|
|
288
|
-
if (e2 && e2.enabled) if (
|
|
289
|
-
Date.now() >=
|
|
290
|
-
} else
|
|
376
|
+
if (e2 && e2.enabled) if (_ = true, B = e2.expirationTimestampMs, j = false, w && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: B }), null !== B) {
|
|
377
|
+
Date.now() >= B ? (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : w && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
|
|
378
|
+
} else w && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
|
|
291
379
|
}
|
|
292
380
|
function isWebSocketOpen(e2) {
|
|
293
381
|
return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
|
|
@@ -299,7 +387,7 @@ async function flushNotifyQueue() {
|
|
|
299
387
|
n2.onsuccess = () => t2(n2.result), n2.onerror = () => t2([]);
|
|
300
388
|
})) ?? [];
|
|
301
389
|
})();
|
|
302
|
-
if (isWebSocketOpen(
|
|
390
|
+
if (isWebSocketOpen(I)) try {
|
|
303
391
|
for (const t2 of e2) {
|
|
304
392
|
if (!wsSendRaw(t2.value)) break;
|
|
305
393
|
await deleteNotifyMessageById(t2.id);
|
|
@@ -308,9 +396,9 @@ async function flushNotifyQueue() {
|
|
|
308
396
|
}
|
|
309
397
|
}
|
|
310
398
|
async function flushBufferedEvents() {
|
|
311
|
-
if (isWebSocketOpen(
|
|
399
|
+
if (isWebSocketOpen(I)) if (E) await E;
|
|
312
400
|
else {
|
|
313
|
-
|
|
401
|
+
E = (async () => {
|
|
314
402
|
var _a, _b;
|
|
315
403
|
const e2 = await (async function getAllIndexedEvents() {
|
|
316
404
|
const e3 = await withStore$1("readonly", (e4) => new Promise((t4) => {
|
|
@@ -328,8 +416,8 @@ async function flushBufferedEvents() {
|
|
|
328
416
|
for (const e3 of Object.values(t2)) {
|
|
329
417
|
const t3 = buildBatches(e3, (e4) => eventSize(e4.data), 52428800);
|
|
330
418
|
for (const e4 of t3) {
|
|
331
|
-
if (!isWebSocketOpen(
|
|
332
|
-
const t4 = e4.map((e5) => (e5.data.appUrl || (e5.data.appUrl = getCachedHref()), e5.data)), n2 = e4.map((e5) => e5.id).filter((e5) => null != e5);
|
|
419
|
+
if (!isWebSocketOpen(I)) break;
|
|
420
|
+
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);
|
|
333
421
|
try {
|
|
334
422
|
wsSendPayload({ type: "events", events: t4, mapUuid: window.sfMapUuid }) && await deleteEventsByIds(n2);
|
|
335
423
|
} catch (e5) {
|
|
@@ -338,64 +426,73 @@ async function flushBufferedEvents() {
|
|
|
338
426
|
}
|
|
339
427
|
})();
|
|
340
428
|
try {
|
|
341
|
-
await
|
|
429
|
+
await E;
|
|
342
430
|
} finally {
|
|
343
|
-
|
|
431
|
+
E = null;
|
|
344
432
|
}
|
|
345
433
|
}
|
|
346
434
|
}
|
|
347
435
|
function sendEvent(e2) {
|
|
348
|
-
e2.app_url || (e2.app_url = getCachedHref()), !
|
|
436
|
+
e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), !T && isWebSocketOpen(I) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
|
|
349
437
|
}
|
|
350
438
|
function handleWsOpen() {
|
|
351
|
-
|
|
439
|
+
w && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (_ ? "ENABLED" : "DISABLED"))), (async () => {
|
|
352
440
|
try {
|
|
353
|
-
|
|
441
|
+
T = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
354
442
|
} finally {
|
|
355
|
-
|
|
443
|
+
T = false;
|
|
356
444
|
}
|
|
357
|
-
null !=
|
|
445
|
+
null != C && clearInterval(C), C = window.setInterval(() => {
|
|
358
446
|
flushBufferedEvents();
|
|
359
447
|
}, 2e3);
|
|
448
|
+
})(), (function kickoffTimeSyncBurst() {
|
|
449
|
+
if ("undefined" != typeof window) for (let e2 = 0; e2 < 3; e2++) window.setTimeout(requestTimeSync, 250 * e2);
|
|
450
|
+
})(), (function startTimeSyncInterval() {
|
|
451
|
+
null == M && "undefined" != typeof window && (M = window.setInterval(() => {
|
|
452
|
+
requestTimeSync();
|
|
453
|
+
}, 6e4));
|
|
360
454
|
})();
|
|
361
455
|
}
|
|
362
456
|
function handleWsClose() {
|
|
363
|
-
null !=
|
|
457
|
+
null != C && (clearInterval(C), C = null), (function stopTimeSyncInterval() {
|
|
458
|
+
null != M && "undefined" != typeof window && (window.clearInterval(M), M = null);
|
|
459
|
+
})(), w && console.log("[Sailfish] WebSocket closed");
|
|
364
460
|
}
|
|
365
461
|
function handleWsMessage(e2) {
|
|
366
462
|
try {
|
|
367
463
|
const t2 = JSON.parse(e2);
|
|
368
|
-
if ("
|
|
464
|
+
if ("time-sync-response" === t2.type) return void getClockSyncManager().recordTimeSyncResponse({ requestId: t2.requestId, serverReceivedAtMs: t2.serverReceivedAtMs, serverSentAtMs: t2.serverSentAtMs });
|
|
465
|
+
if ("funcSpanTrackingControl" === t2.type) if (w && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== O && (window.clearTimeout(O), O = null), _ = t2.enabled, j = false, w && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
|
|
369
466
|
if (t2.expirationTimestampMs) {
|
|
370
|
-
|
|
371
|
-
const e3 = Date.now(), n2 =
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}, n2)) : (
|
|
467
|
+
B = t2.expirationTimestampMs;
|
|
468
|
+
const e3 = Date.now(), n2 = B - e3;
|
|
469
|
+
w && console.log(`[Sailfish] Server expiration timestamp: ${B}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, B), O = window.setTimeout(() => {
|
|
470
|
+
j || (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired"));
|
|
471
|
+
}, n2)) : (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Tracking already expired, not enabling"));
|
|
375
472
|
} else {
|
|
376
473
|
const e3 = t2.timeoutSeconds || 3600;
|
|
377
|
-
e3 > 0 && (
|
|
378
|
-
|
|
474
|
+
e3 > 0 && (B = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, B), O = window.setTimeout(() => {
|
|
475
|
+
j || (_ = false, B = null, clearGlobalFuncSpanState(), w && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
|
|
379
476
|
}, 1e3 * e3));
|
|
380
477
|
}
|
|
381
478
|
try {
|
|
382
479
|
const e3 = getOrSetSessionId();
|
|
383
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }),
|
|
480
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), w && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
|
|
384
481
|
} catch (e3) {
|
|
385
|
-
|
|
482
|
+
w && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
386
483
|
}
|
|
387
|
-
} else
|
|
484
|
+
} else B = null, clearGlobalFuncSpanState();
|
|
388
485
|
} catch (e3) {
|
|
389
486
|
}
|
|
390
487
|
}
|
|
391
|
-
function initializeWebSocket(t2, n2, i2, o2,
|
|
488
|
+
function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
392
489
|
ensureHrefCache();
|
|
393
|
-
const
|
|
490
|
+
const r2 = (function getWebSocketHost(e2) {
|
|
394
491
|
const t3 = new URL(e2);
|
|
395
492
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
396
493
|
})(t2);
|
|
397
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${
|
|
398
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
494
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.12.5`;
|
|
495
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), x = s2 ? (function tryCreateWsWorker() {
|
|
399
496
|
if ("undefined" == typeof Worker) return null;
|
|
400
497
|
try {
|
|
401
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);
|
|
@@ -403,96 +500,96 @@ function initializeWebSocket(t2, n2, i2, o2, r2 = false) {
|
|
|
403
500
|
} catch {
|
|
404
501
|
return null;
|
|
405
502
|
}
|
|
406
|
-
})() : null,
|
|
407
|
-
const e2 =
|
|
408
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
503
|
+
})() : null, x) {
|
|
504
|
+
const e2 = x, t3 = { readyState: WebSocket.CONNECTING, close: () => {
|
|
505
|
+
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), x = null, null != C && (clearInterval(C), C = null);
|
|
409
506
|
} };
|
|
410
|
-
return
|
|
507
|
+
return I = t3, x.onmessage = (e3) => {
|
|
411
508
|
const n3 = e3.data;
|
|
412
509
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
},
|
|
510
|
+
}, x.onerror = () => {
|
|
511
|
+
w && console.warn("[Sailfish] WebSocket worker error");
|
|
512
|
+
}, x.postMessage({ type: "init", wsUrl: a2 }), w && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
416
513
|
}
|
|
417
|
-
|
|
514
|
+
w && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
418
515
|
const l2 = new e(a2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
419
516
|
return l2.readyState;
|
|
420
517
|
}, close: () => {
|
|
421
|
-
l2.close(), null !=
|
|
518
|
+
l2.close(), null != C && (clearInterval(C), C = null);
|
|
422
519
|
} };
|
|
423
|
-
return
|
|
520
|
+
return I = c2, l2.addEventListener("open", () => handleWsOpen()), l2.addEventListener("close", () => handleWsClose()), l2.addEventListener("message", (e2) => handleWsMessage(e2.data)), c2;
|
|
424
521
|
}
|
|
425
522
|
function sendMessage(e2) {
|
|
426
|
-
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()),
|
|
523
|
+
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), enrichEventWithTimeSync(e2), T || !isWebSocketOpen(I) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
|
|
427
524
|
}
|
|
428
525
|
function enableFunctionSpanTracking() {
|
|
429
|
-
if (
|
|
430
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
431
|
-
} else
|
|
526
|
+
if (w && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), _ = true, j = true, B = null, null !== O && (window.clearTimeout(O), O = null), isWebSocketOpen(I)) {
|
|
527
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: k });
|
|
528
|
+
} else w && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
432
529
|
}
|
|
433
530
|
function disableFunctionSpanTracking() {
|
|
434
|
-
if (
|
|
435
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
531
|
+
if (w && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(I)) {
|
|
532
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: k });
|
|
436
533
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
437
|
-
|
|
534
|
+
j && (_ = false, j = false, B = null, w && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== O && (window.clearTimeout(O), O = null);
|
|
438
535
|
}
|
|
439
536
|
function isFunctionSpanTrackingEnabled() {
|
|
440
|
-
return
|
|
537
|
+
return _;
|
|
441
538
|
}
|
|
442
539
|
function initializeFunctionSpanTrackingFromApi(e2) {
|
|
443
|
-
e2 && !
|
|
540
|
+
e2 && !_ ? (_ = true, j = false, B = null, w && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && _ && (_ = false, j = false, B = null, w && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
|
|
444
541
|
}
|
|
445
542
|
function getFuncSpanHeader() {
|
|
446
|
-
if (!
|
|
447
|
-
if (null !==
|
|
448
|
-
if (Date.now() >=
|
|
543
|
+
if (!_) return null;
|
|
544
|
+
if (null !== B) {
|
|
545
|
+
if (Date.now() >= B) return _ = false, B = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
|
|
449
546
|
}
|
|
450
547
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
451
548
|
}
|
|
452
|
-
const
|
|
453
|
-
let
|
|
549
|
+
const N = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, requestTimeSync, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
|
|
550
|
+
let z = null, H = null;
|
|
454
551
|
function getIdentifiedUser() {
|
|
455
|
-
return
|
|
552
|
+
return z;
|
|
456
553
|
}
|
|
457
|
-
let
|
|
458
|
-
const
|
|
554
|
+
let W = null;
|
|
555
|
+
const K = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
459
556
|
function fetchAndSendIp(e2) {
|
|
460
|
-
|
|
461
|
-
for (const e3 of
|
|
557
|
+
W !== e2 && (W = e2, (async () => {
|
|
558
|
+
for (const e3 of K) try {
|
|
462
559
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
463
560
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
464
|
-
const o2 = await i2.json(),
|
|
465
|
-
if (
|
|
561
|
+
const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
|
|
562
|
+
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: exports.nowTimestamp() });
|
|
466
563
|
} catch {
|
|
467
564
|
}
|
|
468
|
-
|
|
565
|
+
W = null;
|
|
469
566
|
})().catch(() => {
|
|
470
|
-
|
|
567
|
+
W = null;
|
|
471
568
|
}));
|
|
472
569
|
}
|
|
473
|
-
let
|
|
570
|
+
let G = null;
|
|
474
571
|
async function getSourceMapModule() {
|
|
475
|
-
return
|
|
572
|
+
return G || (G = await import("source-map-js")), G;
|
|
476
573
|
}
|
|
477
|
-
const
|
|
574
|
+
const V = /* @__PURE__ */ new Map(), Q = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
478
575
|
async function getConsumerFor(e2, t2) {
|
|
479
576
|
const n2 = (e2 || `/assets/${t2}`).split("?")[0], i2 = [`${n2}.map`, n2.replace(/\.js$/, ".js.map"), `/assets/${t2}.map`], { SourceMapConsumer: o2 } = await getSourceMapModule();
|
|
480
577
|
for (const e3 of i2) try {
|
|
481
|
-
if (
|
|
578
|
+
if (V.has(e3)) return V.get(e3);
|
|
482
579
|
const t3 = await fetch(e3);
|
|
483
580
|
if (!t3.ok) continue;
|
|
484
581
|
const n3 = await t3.json();
|
|
485
582
|
if (!n3 || !n3.mappings || !n3.sources) continue;
|
|
486
583
|
const i3 = await new o2(n3);
|
|
487
|
-
return
|
|
584
|
+
return V.set(e3, i3), i3;
|
|
488
585
|
} catch {
|
|
489
586
|
}
|
|
490
587
|
return null;
|
|
491
588
|
}
|
|
492
589
|
async function captureError(e2, t2 = false, n2) {
|
|
493
590
|
let i2, o2;
|
|
494
|
-
const
|
|
495
|
-
e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace",
|
|
591
|
+
const s2 = [];
|
|
592
|
+
e2 instanceof Error ? (i2 = e2.message || e2.name, o2 = e2.stack || "No stack trace", s2.push(`${e2.name}: ${i2}`)) : "string" == typeof e2 ? (i2 = e2, o2 = "No stack trace available", s2.push(t2 ? `Uncaught (in promise) ${e2}` : e2)) : (i2 = (function describeNonError(e3) {
|
|
496
593
|
if (null === e3) return "null";
|
|
497
594
|
if (void 0 === e3) return "undefined";
|
|
498
595
|
if ("string" == typeof e3) return e3;
|
|
@@ -506,17 +603,17 @@ async function captureError(e2, t2 = false, n2) {
|
|
|
506
603
|
} catch {
|
|
507
604
|
return Object.prototype.toString.call(e3);
|
|
508
605
|
}
|
|
509
|
-
})(e2), o2 = "No stack trace available",
|
|
510
|
-
const
|
|
606
|
+
})(e2), o2 = "No stack trace available", s2.push(t2 ? `Uncaught (in promise) ${i2}` : i2)), (n2 == null ? void 0 : n2.filename) && s2.push(`at ${n2.filename}:${n2.lineno ?? 0}:${n2.colno ?? 0}`);
|
|
607
|
+
const r2 = await (async function resolveStackTrace(e3) {
|
|
511
608
|
if (!e3) return ["No stack trace available"];
|
|
512
609
|
const t3 = Array.isArray(e3) ? e3 : e3.split("\n"), n3 = [];
|
|
513
610
|
for (const e4 of t3) {
|
|
514
|
-
const t4 = e4.match(
|
|
611
|
+
const t4 = e4.match(Q);
|
|
515
612
|
if (!t4) {
|
|
516
613
|
n3.push(e4);
|
|
517
614
|
continue;
|
|
518
615
|
}
|
|
519
|
-
const [, i3, o3,
|
|
616
|
+
const [, i3, o3, s3, r3] = t4, a3 = parseInt(s3, 10), l3 = Math.max(0, parseInt(r3, 10) - 1);
|
|
520
617
|
if (!Number.isFinite(a3) || !Number.isFinite(l3)) {
|
|
521
618
|
n3.push(e4 + " [Invalid line/column]");
|
|
522
619
|
continue;
|
|
@@ -535,54 +632,54 @@ async function captureError(e2, t2 = false, n2) {
|
|
|
535
632
|
} else n3.push(`${e4} [No mapping found in ${o3}]`);
|
|
536
633
|
}
|
|
537
634
|
return n3;
|
|
538
|
-
})(o2), a2 =
|
|
539
|
-
sendMessage({ type: "event", event: { type: 6, timestamp: c2, data: { payload: { message: i2, stack: o2, trace: l2, filteredStack: a2, payload:
|
|
540
|
-
}
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3,
|
|
544
|
-
const
|
|
545
|
-
return
|
|
546
|
-
let
|
|
635
|
+
})(o2), a2 = r2.filter((e3) => !e3.includes("chunk-") && !e3.includes("react-dom")), l2 = a2.length > 0 ? a2 : r2, c2 = Date.now();
|
|
636
|
+
sendMessage({ type: "event", event: { type: 6, timestamp: c2, data: { payload: { message: i2, stack: o2, trace: l2, filteredStack: a2, payload: s2, userAgent: navigator.userAgent, url: window.location.href, timestamp: c2, level: "error" } } } });
|
|
637
|
+
}
|
|
638
|
+
const J = readDebugFlag();
|
|
639
|
+
const X = readDebugFlag();
|
|
640
|
+
function sendGraphQLRequest(e2, t2, n2, i2 = 5, o2 = 2e3, s2 = 2) {
|
|
641
|
+
const r2 = `${n2.backendApi}/graphql/?apiKey=${n2.apiKey}`;
|
|
642
|
+
return X && console.log(`Initial GraphQL request for ${e2} at ${r2}`), (function exponentialBackoff(e3, t3, n3 = 5, i3 = 2e3, o3 = 2) {
|
|
643
|
+
let s3 = 0;
|
|
547
644
|
const attemptRequest = async () => {
|
|
548
645
|
try {
|
|
549
646
|
return await e3();
|
|
550
647
|
} catch (e4) {
|
|
551
|
-
if (
|
|
552
|
-
const
|
|
553
|
-
return
|
|
648
|
+
if (s3++, s3 > n3) throw e4;
|
|
649
|
+
const r3 = i3 * Math.pow(o3, s3 - 1);
|
|
650
|
+
return J && console.log(`Attempt ${s3} failed: ${t3}; Retrying in ${r3}ms...`), await new Promise((e5) => setTimeout(e5, r3)), attemptRequest();
|
|
554
651
|
}
|
|
555
652
|
};
|
|
556
653
|
return attemptRequest();
|
|
557
|
-
})(() => fetch(
|
|
558
|
-
if (
|
|
654
|
+
})(() => fetch(r2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ operationName: e2, query: t2, variables: n2 }) }).then((e3) => {
|
|
655
|
+
if (X && console.log(`Received response with status: ${e3.status}`), !e3.ok) throw new Error(`GraphQL request failed with status ${e3.status}`);
|
|
559
656
|
return e3.json();
|
|
560
|
-
}), "Sending GraphQL request to Sailfish AI", i2, o2,
|
|
657
|
+
}), "Sending GraphQL request to Sailfish AI", i2, o2, s2);
|
|
561
658
|
}
|
|
562
659
|
function fetchCaptureSettings(e2, t2) {
|
|
563
|
-
return sendGraphQLRequest("GetCaptureSettingsFromApiKey", "\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n textEditThrottleEnabled\n }\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
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 });
|
|
564
661
|
}
|
|
565
662
|
function fetchFunctionSpanTrackingEnabled(e2, t2) {
|
|
566
663
|
return sendGraphQLRequest("GetFunctionSpanTrackingEnabledFromApiKey", "\n query GetFunctionSpanTrackingEnabledFromApiKey($apiKey: String!) {\n isFunctionSpanTrackingEnabledFromApiKey(apiKey: $apiKey)\n }\n ", { apiKey: e2, backendApi: t2 });
|
|
567
664
|
}
|
|
568
|
-
function startRecordingSession(e2, t2, n2, i2, o2,
|
|
569
|
-
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:
|
|
665
|
+
function startRecordingSession(e2, t2, n2, i2, o2, s2, r2, a2, l2) {
|
|
666
|
+
return sendGraphQLRequest("StartSession", "mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }", { apiKey: e2, recordingSessionId: t2, backendApi: n2, serviceIdentifier: i2, serviceVersion: o2, mapUuid: s2, gitSha: r2, library: a2, serviceAdditionalMetadata: l2, startRecordingFilePath: null, startRecordingLineNumber: null });
|
|
570
667
|
}
|
|
571
668
|
function sendDomainsToNotPropagateHeaderTo(e2, t2, n2) {
|
|
572
669
|
return sendGraphQLRequest("DomainsToNotPassHeaderTo", "mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }", { apiKey: e2, domains: t2, backendApi: n2 });
|
|
573
670
|
}
|
|
574
|
-
function createTriageFromRecorder(e2, t2, n2, i2, o2,
|
|
575
|
-
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:
|
|
671
|
+
function createTriageFromRecorder(e2, t2, n2, i2, o2, s2, r2) {
|
|
672
|
+
return sendGraphQLRequest("CreateTriageFromRecorder", "mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $triageSource: TriageSourceEnum\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n triageSource: $triageSource\n ) {\n id\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, triageSource: r2, backendApi: t2 });
|
|
576
673
|
}
|
|
577
674
|
function fetchEngineeringTicketPlatformIntegrations(e2, t2) {
|
|
578
675
|
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 });
|
|
579
676
|
}
|
|
580
|
-
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2,
|
|
581
|
-
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:
|
|
677
|
+
function createTriageAndIssueFromRecorder(e2, t2, n2, i2, o2, s2, r2, a2, l2, c2, d2, u2, p2, f2, g2, m2) {
|
|
678
|
+
return sendGraphQLRequest("CreateTriageAndIssueFromRecorder", "mutation CreateTriageAndIssueFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String,\n $issueName: String,\n $issueDescription: String,\n $createEngineeringTicket: Boolean,\n $teamId: String,\n $projectId: String,\n $priority: Int,\n $labels: [String!],\n $issueType: String,\n $customFields: JSON,\n $triageSource: TriageSourceEnum\n ) {\n createTriageAndIssueFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description,\n issueName: $issueName,\n issueDescription: $issueDescription,\n createEngineeringTicket: $createEngineeringTicket,\n teamId: $teamId,\n projectId: $projectId,\n priority: $priority,\n labels: $labels,\n issueType: $issueType,\n customFields: $customFields,\n triageSource: $triageSource\n ) {\n id\n title\n }\n }\n ", { apiKey: e2, recordingSessionId: n2, timestampStart: i2, timestampEnd: o2, description: s2, issueName: r2, issueDescription: a2, createEngineeringTicket: l2, teamId: c2, projectId: d2, priority: u2, labels: p2, issueType: f2, customFields: g2, triageSource: m2, backendApi: t2 });
|
|
582
679
|
}
|
|
583
|
-
const
|
|
680
|
+
const Z = ["/node_modules/", "/@sailfish-ai/", "/@sailfish-rrweb/", "/dist/", "/webpack/", "/vite/", "/__vite", "/react-dom/", "/react/", "/scheduler/", "/<", "/chrome-extension://", "/extensions/"];
|
|
584
681
|
function shouldSkipFrame(e2) {
|
|
585
|
-
return
|
|
682
|
+
return Z.some((t2) => e2.includes(t2));
|
|
586
683
|
}
|
|
587
684
|
function normalizeFilePath(e2) {
|
|
588
685
|
let t2 = e2;
|
|
@@ -648,8 +745,17 @@ function yieldToMain() {
|
|
|
648
745
|
var _a;
|
|
649
746
|
return "undefined" != typeof globalThis && ((_a = globalThis.scheduler) == null ? void 0 : _a.yield) ? globalThis.scheduler.yield() : new Promise((e2) => setTimeout(e2, 0));
|
|
650
747
|
}
|
|
651
|
-
|
|
652
|
-
|
|
748
|
+
function closestSafe(e2, t2) {
|
|
749
|
+
if (!e2 || !t2) return false;
|
|
750
|
+
try {
|
|
751
|
+
return !!e2.closest(t2);
|
|
752
|
+
} catch {
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
const Y = { color: true, date: true, "datetime-local": true, email: true, month: true, number: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true, textarea: true, select: true, password: true };
|
|
757
|
+
let ee = null;
|
|
758
|
+
const te = "sailfishSanitize", ne = "zendesk_chat", ie = "Zendesk";
|
|
653
759
|
function zE_safe(...e2) {
|
|
654
760
|
try {
|
|
655
761
|
if ((function hasZendesk() {
|
|
@@ -663,15 +769,15 @@ function maskInputFn(e2, t2) {
|
|
|
663
769
|
var _a;
|
|
664
770
|
if ("hidden" === t2.type) return "";
|
|
665
771
|
const n2 = { creditCard: /\b(?:\d[ -]*?){13,16}\b/, ssn: /\b\d{3}-\d{2}-\d{4}\b/ };
|
|
666
|
-
return t2.
|
|
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);
|
|
667
773
|
}
|
|
668
|
-
let
|
|
774
|
+
let oe = true, se = null, re = null, ae = null, le = null;
|
|
669
775
|
function invalidateUrlCache() {
|
|
670
|
-
|
|
776
|
+
oe = true;
|
|
671
777
|
}
|
|
672
|
-
const getUrlAndStoredUuids = () => (
|
|
673
|
-
|
|
674
|
-
})(), { page_visit_uuid:
|
|
778
|
+
const getUrlAndStoredUuids = () => (oe && (function _refreshSessionStorageCache() {
|
|
779
|
+
se = sessionStorage.getItem("pageVisitUUID"), re = sessionStorage.getItem("prevPageVisitUUID"), ae = sessionStorage.getItem("tabVisibilityChanged"), le = sessionStorage.getItem("tabVisibilityState"), oe = false;
|
|
780
|
+
})(), { page_visit_uuid: se, prev_page_visit_uuid: re, href: getCachedHrefNoQuery(), tabVisibilityChanged: ae, tabVisibilityState: le });
|
|
675
781
|
function initializeDomContentEvents(e2) {
|
|
676
782
|
document.addEventListener("readystatechange", () => {
|
|
677
783
|
const t2 = { type: 24, data: { source: 0, info: "" }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() };
|
|
@@ -680,13 +786,13 @@ function initializeDomContentEvents(e2) {
|
|
|
680
786
|
t2.data.source = i;
|
|
681
787
|
break;
|
|
682
788
|
case "complete":
|
|
683
|
-
t2.data.source =
|
|
789
|
+
t2.data.source = s;
|
|
684
790
|
}
|
|
685
791
|
t2.data.info && sendEvent(t2);
|
|
686
792
|
}), document.addEventListener("DOMContentLoaded", () => {
|
|
687
793
|
sendEvent({ type: 24, data: { source: o }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
688
794
|
}), window.addEventListener("pagehide", () => {
|
|
689
|
-
sendEvent({ type: 24, data: { source:
|
|
795
|
+
sendEvent({ type: 24, data: { source: r }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
690
796
|
});
|
|
691
797
|
}
|
|
692
798
|
async function initializePerformancePlugin(e2) {
|
|
@@ -706,14 +812,14 @@ async function initializePerformancePlugin(e2) {
|
|
|
706
812
|
async function initializeConsolePlugin(e2, n2) {
|
|
707
813
|
const { getRecordConsolePlugin: i2 } = await import("@sailfish-rrweb/rrweb-plugin-console-record");
|
|
708
814
|
await yieldToMain();
|
|
709
|
-
const { name: o2, observer:
|
|
710
|
-
|
|
711
|
-
const i3 = e3, [
|
|
815
|
+
const { name: o2, observer: s2 } = i2(e2);
|
|
816
|
+
s2((e3) => {
|
|
817
|
+
const i3 = e3, [s3, r2] = getCallerLocationFromTrace(i3 == null ? void 0 : i3.trace, 0), [a2, l2] = getCallerLocation(2), c2 = s3 ?? a2, d2 = r2 ?? l2, u2 = { ...i3, sourceFile: c2, sourceLine: d2 };
|
|
712
818
|
sendEvent({ type: t.EventType.Plugin, timestamp: Date.now(), data: { plugin: o2, payload: u2 }, sessionId: n2, ...getUrlAndStoredUuids() });
|
|
713
819
|
}, window, e2);
|
|
714
820
|
}
|
|
715
|
-
async function initializeRecording(e2, n2, i2, o2,
|
|
716
|
-
const c2 = initializeWebSocket(n2, i2, o2,
|
|
821
|
+
async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2 = false) {
|
|
822
|
+
const c2 = initializeWebSocket(n2, i2, o2, s2, a2);
|
|
717
823
|
try {
|
|
718
824
|
const n3 = (function createThrottledEmit(e3, t2 = 1e3) {
|
|
719
825
|
if (!e3) return { emit: (e4) => sendEvent(e4), flush: () => {
|
|
@@ -728,8 +834,8 @@ async function initializeRecording(e2, n2, i2, o2, r2, s2 = true, a2 = false, l2
|
|
|
728
834
|
const t3 = e4.data, n5 = (t3 == null ? void 0 : t3.adds) && t3.adds.length > 0, i4 = (t3 == null ? void 0 : t3.removes) && t3.removes.length > 0;
|
|
729
835
|
if (n5 || i4) return void sendEvent(e4);
|
|
730
836
|
}
|
|
731
|
-
const
|
|
732
|
-
n4.set(
|
|
837
|
+
const s3 = `3:${o3}:${((_b = e4.data) == null ? void 0 : _b.id) || "unknown"}`;
|
|
838
|
+
n4.set(s3, e4), i3 || (i3 = setInterval(() => {
|
|
733
839
|
0 !== n4.size && (n4.forEach((e5) => sendEvent(e5)), n4.clear());
|
|
734
840
|
}, t2));
|
|
735
841
|
}, flush: () => {
|
|
@@ -745,24 +851,43 @@ async function initializeRecording(e2, n2, i2, o2, r2, s2 = true, a2 = false, l2
|
|
|
745
851
|
console.warn("[Sailfish] Failed to enable Fiber tracking:", e3);
|
|
746
852
|
}
|
|
747
853
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
854
|
+
ee = n4, await yieldToMain();
|
|
855
|
+
const i3 = e2.unmaskSelector || void 0, o3 = e2.blockSelector || void 0, s3 = e2.maskTextSelector || void 0, r3 = e2.maskInputSelector || void 0, a3 = { ...e2.maskInputOptions ?? {} }, c3 = r3 ? { ...Y } : a3, d2 = (function buildMaskInputFn(e3) {
|
|
856
|
+
const { baseFn: t2, unmaskSelector: n5, maskInputSelector: i4, adminMaskInputOptions: o4 } = e3;
|
|
857
|
+
return n5 || i4 ? (e4, s4) => {
|
|
858
|
+
if ("hidden" === s4.type) return "";
|
|
859
|
+
if (closestSafe(s4, n5)) return e4;
|
|
860
|
+
const r4 = (s4.type || "").toLowerCase(), a4 = (s4.tagName || "").toLowerCase(), l3 = true === o4[r4] || true === o4[a4], c4 = (function matchesSelectorSafe(e5, t3) {
|
|
861
|
+
if (!t3) return false;
|
|
862
|
+
try {
|
|
863
|
+
return e5.matches(t3);
|
|
864
|
+
} catch {
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
})(s4, i4);
|
|
868
|
+
return l3 || c4 ? t2(e4, s4) : e4;
|
|
869
|
+
} : t2;
|
|
870
|
+
})({ baseFn: maskInputFn, unmaskSelector: i3, maskInputSelector: r3, adminMaskInputOptions: a3 }), u2 = /* @__PURE__ */ (function makeMaskTextFn(e3) {
|
|
871
|
+
return (t2, n5) => closestSafe(n5, e3) ? t2 : t2.replace(/\S/g, "*");
|
|
872
|
+
})(i3);
|
|
873
|
+
if (l2) {
|
|
874
|
+
const { chunkedSnapshot: a4 } = await Promise.resolve().then(() => require("./chunkSerializer-Cd8y9tID.js")), l3 = n4.mirror;
|
|
875
|
+
let p2 = true;
|
|
876
|
+
const f2 = [];
|
|
752
877
|
n4({ emit(e3) {
|
|
753
|
-
|
|
754
|
-
}, maskInputOptions:
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
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:
|
|
758
|
-
for (const e3 of
|
|
759
|
-
|
|
760
|
-
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"),
|
|
878
|
+
p2 ? f2.push(e3) : emitWithContext(e3);
|
|
879
|
+
}, ...e2, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, maskInputSelector: r3, maskTextSelector: s3, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te, recordDOM: false });
|
|
880
|
+
const g2 = Date.now(), m2 = await a4(document, l3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te, maskTextSelector: s3, maskInputSelector: r3, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, unmaskSelector: i3 });
|
|
881
|
+
if (m2) {
|
|
882
|
+
emitWithContext({ type: t.EventType.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: g2 }), emitWithContext({ type: t.EventType.FullSnapshot, data: { node: m2, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: g2 });
|
|
883
|
+
for (const e3 of f2) emitWithContext(e3);
|
|
884
|
+
p2 = false;
|
|
885
|
+
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), p2 = false;
|
|
761
886
|
} else n4({ emit(e3) {
|
|
762
887
|
emitWithContext(e3);
|
|
763
|
-
}, maskInputOptions:
|
|
888
|
+
}, ...e2, maskInputOptions: c3, maskInputFn: d2, maskTextFn: u2, maskInputSelector: r3, maskTextSelector: s3, blockSelector: o3, maskTextClass: e2.maskTextClass ?? te });
|
|
764
889
|
};
|
|
765
|
-
if (
|
|
890
|
+
if (r2) {
|
|
766
891
|
let e3 = false;
|
|
767
892
|
const startOnce = () => {
|
|
768
893
|
e3 || (e3 = true, startHeavyWork());
|
|
@@ -792,11 +917,11 @@ async function initializeRecording(e2, n2, i2, o2, r2, s2 = true, a2 = false, l2
|
|
|
792
917
|
zE_safe("messenger:set", "conversationTags", [`sailfish-session-${o2}`]);
|
|
793
918
|
});
|
|
794
919
|
const handleWidgetOpen = () => {
|
|
795
|
-
|
|
920
|
+
ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat opened", element_id: ne, provider: ie });
|
|
796
921
|
}, handleWidgetClose = () => {
|
|
797
|
-
|
|
922
|
+
ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "customer support chat closed", element_id: ne, provider: ie });
|
|
798
923
|
}, handleUnreadMessages = (e3) => {
|
|
799
|
-
|
|
924
|
+
ee == null ? void 0 : ee.addSailfishEvent(t.EventType.SailfishCustom, { action: "zendesk unreadmessages", element_id: ne, provider: ie });
|
|
800
925
|
};
|
|
801
926
|
suppressConsoleLogsDuringCall(() => {
|
|
802
927
|
zE_safe("messenger:on", "open", handleWidgetOpen), zE_safe("messenger:on", "close", handleWidgetClose), zE_safe("messenger:on", "unreadMessages", handleUnreadMessages);
|
|
@@ -807,7 +932,7 @@ async function initializeRecording(e2, n2, i2, o2, r2, s2 = true, a2 = false, l2
|
|
|
807
932
|
}
|
|
808
933
|
return c2;
|
|
809
934
|
}
|
|
810
|
-
const
|
|
935
|
+
const ce = [(e2) => (function checkNextJs() {
|
|
811
936
|
try {
|
|
812
937
|
if (void 0 !== globalThis.__NEXT_DATA__) return "nextjs";
|
|
813
938
|
} catch {
|
|
@@ -869,35 +994,52 @@ const oe = [(e2) => (function checkNextJs() {
|
|
|
869
994
|
}
|
|
870
995
|
return null;
|
|
871
996
|
}];
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
const
|
|
997
|
+
const de = "sf-create-issue-preference", ue = "sf-create-eng-ticket-preference";
|
|
998
|
+
function getInitialState() {
|
|
999
|
+
const e2 = (function loadUserPreferences() {
|
|
1000
|
+
return { createIssue: m && "true" === localStorage.getItem(de), createEngTicket: m && "true" === localStorage.getItem(ue) };
|
|
1001
|
+
})();
|
|
1002
|
+
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
1003
|
+
}
|
|
1004
|
+
let pe = getInitialState(), fe = null, ge = null, me = null, he = false, ye = false;
|
|
1005
|
+
function setSprintDefaulted(e2) {
|
|
1006
|
+
ye = e2;
|
|
1007
|
+
}
|
|
1008
|
+
function setTimerInterval(e2) {
|
|
1009
|
+
me = e2;
|
|
1010
|
+
}
|
|
1011
|
+
function setIsRecording(e2) {
|
|
1012
|
+
he = e2;
|
|
1013
|
+
}
|
|
1014
|
+
const Se = ["jira", "linear", "zendesk"];
|
|
1015
|
+
let ve = null;
|
|
1016
|
+
const be = /* @__PURE__ */ new Map();
|
|
875
1017
|
function getIntegrationData() {
|
|
876
|
-
return
|
|
1018
|
+
return ve;
|
|
877
1019
|
}
|
|
878
1020
|
function hasValidIntegration() {
|
|
879
|
-
return null !==
|
|
1021
|
+
return null !== ve && true === ve.installed;
|
|
880
1022
|
}
|
|
881
1023
|
function resolveIntegration(e2) {
|
|
882
1024
|
var _a;
|
|
883
1025
|
if ((e2 == null ? void 0 : e2.errors) && e2.errors.length > 0) return console.error("GraphQL errors fetching integrations:", e2.errors), null;
|
|
884
1026
|
const t2 = (_a = e2 == null ? void 0 : e2.data) == null ? void 0 : _a.getEngineeringTicketPlatformIntegrationsFromApiKey, n2 = (t2 || []).filter((e3) => {
|
|
885
1027
|
var _a2;
|
|
886
|
-
return
|
|
1028
|
+
return Se.includes(((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase()) || "") && true === e3.installed;
|
|
887
1029
|
});
|
|
888
1030
|
if (0 === n2.length) return console.warn("No valid installed integrations found"), null;
|
|
889
1031
|
const i2 = n2.find((e3) => {
|
|
890
1032
|
var _a2;
|
|
891
1033
|
return "jira" === ((_a2 = e3.provider) == null ? void 0 : _a2.toLowerCase());
|
|
892
1034
|
}) || n2[0];
|
|
893
|
-
return (i2 == null ? void 0 : i2.primaryCloudId) &&
|
|
1035
|
+
return (i2 == null ? void 0 : i2.primaryCloudId) && be.set(i2.primaryCloudId, i2), i2;
|
|
894
1036
|
}
|
|
895
1037
|
async function refreshIntegrationData(e2, t2) {
|
|
896
1038
|
try {
|
|
897
1039
|
const n2 = resolveIntegration(await fetchEngineeringTicketPlatformIntegrations(e2, t2));
|
|
898
|
-
return
|
|
1040
|
+
return ve = n2, n2;
|
|
899
1041
|
} catch (e3) {
|
|
900
|
-
return console.error("Error refreshing integration data:", e3),
|
|
1042
|
+
return console.error("Error refreshing integration data:", e3), ve;
|
|
901
1043
|
}
|
|
902
1044
|
}
|
|
903
1045
|
function populateSelectOptions(e2, t2, n2) {
|
|
@@ -922,6 +1064,16 @@ function populatePriorityOptions(e2, t2, n2) {
|
|
|
922
1064
|
}
|
|
923
1065
|
null != n2 ? e2.value = String(n2) : i2 || (e2.value = "0");
|
|
924
1066
|
}
|
|
1067
|
+
function pickDefaultActiveSprint(e2, t2, n2) {
|
|
1068
|
+
const i2 = (e2 || []).filter((e3) => "active" === e3.state);
|
|
1069
|
+
if (!i2.length) return null;
|
|
1070
|
+
const o2 = (function _projectBoardIds(e3, t3) {
|
|
1071
|
+
if (!e3) return [];
|
|
1072
|
+
const n3 = (t3 || []).find((t4) => t4.id === e3 || t4.key === e3);
|
|
1073
|
+
return ((n3 == null ? void 0 : n3.boards) || (n3 == null ? void 0 : n3.board_ids) || []).map((e4) => "object" == typeof e4 ? e4.id : e4);
|
|
1074
|
+
})(t2, n2);
|
|
1075
|
+
return (o2.length ? i2.find((e3) => o2.some((t3) => String(t3) === String(e3.originBoardId))) : null) || i2[0];
|
|
1076
|
+
}
|
|
925
1077
|
function populateSprintOptions(e2, t2, n2) {
|
|
926
1078
|
e2.innerHTML = "";
|
|
927
1079
|
const i2 = document.createElement("option");
|
|
@@ -932,8 +1084,8 @@ function populateSprintOptions(e2, t2, n2) {
|
|
|
932
1084
|
}), n2 && (e2.value = n2);
|
|
933
1085
|
}
|
|
934
1086
|
function getSprintFieldId() {
|
|
935
|
-
if (!(
|
|
936
|
-
const e2 = Array.isArray(
|
|
1087
|
+
if (!(ve == null ? void 0 : ve.fieldConfigurations)) return "customfield_10020";
|
|
1088
|
+
const e2 = Array.isArray(ve.fieldConfigurations) ? ve.fieldConfigurations : [];
|
|
937
1089
|
for (const t2 of e2) {
|
|
938
1090
|
const e3 = (t2.fields || []).find((e4) => {
|
|
939
1091
|
var _a;
|
|
@@ -945,12 +1097,12 @@ function getSprintFieldId() {
|
|
|
945
1097
|
}
|
|
946
1098
|
function updateIssueTypeOptions(e2, t2) {
|
|
947
1099
|
var _a;
|
|
948
|
-
if (!(
|
|
1100
|
+
if (!(ve == null ? void 0 : ve.projects) || !t2) {
|
|
949
1101
|
e2.innerHTML = "";
|
|
950
1102
|
const t3 = document.createElement("option");
|
|
951
1103
|
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");
|
|
952
1104
|
}
|
|
953
|
-
const n2 =
|
|
1105
|
+
const n2 = ve.projects.find((e3) => e3.id === t2);
|
|
954
1106
|
if (!n2 || !n2.issue_types) {
|
|
955
1107
|
e2.innerHTML = "";
|
|
956
1108
|
const t3 = document.createElement("option");
|
|
@@ -969,17 +1121,17 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
969
1121
|
}), n3 = i2.find((e3) => {
|
|
970
1122
|
var _a2;
|
|
971
1123
|
return "task" === ((_a2 = e3.name) == null ? void 0 : _a2.toLowerCase());
|
|
972
|
-
}),
|
|
973
|
-
|
|
1124
|
+
}), s2 = (t3 == null ? void 0 : t3.id) || (n3 == null ? void 0 : n3.id) || ((_a = i2[0]) == null ? void 0 : _a.id);
|
|
1125
|
+
s2 ? (e2.value = s2, e2.style.color = "#000") : (o2.selected = true, e2.style.color = "#9ca3af");
|
|
974
1126
|
}
|
|
975
1127
|
}
|
|
976
1128
|
function getFieldsForProject(e2, t2) {
|
|
977
|
-
if (!(
|
|
978
|
-
const n2 = Array.isArray(
|
|
1129
|
+
if (!(ve == null ? void 0 : ve.fieldConfigurations) || !e2) return [];
|
|
1130
|
+
const n2 = Array.isArray(ve.fieldConfigurations) ? ve.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : ve.fieldConfigurations[e2];
|
|
979
1131
|
return n2 && n2.fields ? n2.fields : [];
|
|
980
1132
|
}
|
|
981
1133
|
function getUsers() {
|
|
982
|
-
return (
|
|
1134
|
+
return (ve == null ? void 0 : ve.users) ? ve.users : [];
|
|
983
1135
|
}
|
|
984
1136
|
function getDefaultReporterAccountId() {
|
|
985
1137
|
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
@@ -988,16 +1140,16 @@ function getDefaultReporterAccountId() {
|
|
|
988
1140
|
const n3 = e2.filter(t3);
|
|
989
1141
|
return 1 === n3.length ? n3[0] : null;
|
|
990
1142
|
};
|
|
991
|
-
let
|
|
992
|
-
if (!
|
|
1143
|
+
let s2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
|
|
1144
|
+
if (!s2 && o2 && (s2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !s2 && i2) {
|
|
993
1145
|
const e3 = i2.split("@")[0];
|
|
994
|
-
e3.length >= 3 && (
|
|
1146
|
+
e3.length >= 3 && (s2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
|
|
995
1147
|
}
|
|
996
|
-
return
|
|
1148
|
+
return s2 && (s2.id || s2.accountId) || null;
|
|
997
1149
|
}
|
|
998
1150
|
function lastReporterStorageKey() {
|
|
999
|
-
if (!
|
|
1000
|
-
const e2 =
|
|
1151
|
+
if (!ve) return null;
|
|
1152
|
+
const e2 = ve.primaryCloudId || ve.provider || "";
|
|
1001
1153
|
return e2 ? `sf-veritas:lastReporter:${e2}` : null;
|
|
1002
1154
|
}
|
|
1003
1155
|
function getSavedLastReporterAccountId() {
|
|
@@ -1024,51 +1176,44 @@ function getValidSavedReporterAccountId() {
|
|
|
1024
1176
|
return getUsers().some((t2) => (t2.accountId || t2.id) === e2 && false !== t2.active) ? e2 : null;
|
|
1025
1177
|
}
|
|
1026
1178
|
function getProjectsForTeam(e2) {
|
|
1027
|
-
if (!
|
|
1028
|
-
const t2 =
|
|
1179
|
+
if (!ve) return [];
|
|
1180
|
+
const t2 = ve.teams && Array.isArray(ve.teams) && ve.teams.length > 0;
|
|
1029
1181
|
if (t2 && e2) {
|
|
1030
|
-
const t3 =
|
|
1182
|
+
const t3 = ve.teams.find((t4) => t4.id === e2);
|
|
1031
1183
|
return (t3 == null ? void 0 : t3.projects) || [];
|
|
1032
1184
|
}
|
|
1033
|
-
return !t2 &&
|
|
1185
|
+
return !t2 && ve.projects ? ve.projects : [];
|
|
1034
1186
|
}
|
|
1035
1187
|
function updateFormWithIntegrationData(e2) {
|
|
1036
1188
|
var _a;
|
|
1037
|
-
if (!
|
|
1038
|
-
const t2 =
|
|
1039
|
-
n2 && t2 && (populateSelectOptions(n2,
|
|
1189
|
+
if (!ve) return e2;
|
|
1190
|
+
const t2 = ve.teams && Array.isArray(ve.teams) && ve.teams.length > 0, n2 = document.getElementById("sf-eng-ticket-team");
|
|
1191
|
+
n2 && t2 && (populateSelectOptions(n2, ve.teams, ve.defaultTeam), e2.engTicketTeam ? n2.value = e2.engTicketTeam : e2.engTicketTeam = n2.value);
|
|
1040
1192
|
const i2 = document.getElementById("sf-eng-ticket-project");
|
|
1041
1193
|
if (i2) {
|
|
1042
|
-
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) :
|
|
1194
|
+
populateSelectOptions(i2, t2 ? getProjectsForTeam(e2.engTicketTeam) : ve.projects || [], ve.defaultProject), e2.engTicketProject ? i2.value = e2.engTicketProject : e2.engTicketProject = i2.value;
|
|
1043
1195
|
}
|
|
1044
1196
|
const o2 = document.getElementById("sf-eng-ticket-priority");
|
|
1045
|
-
o2 && (populatePriorityOptions(o2,
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1197
|
+
o2 && (populatePriorityOptions(o2, ve.provider || "", ve.defaultPriority), e2.engTicketPriority ? o2.value = String(e2.engTicketPriority) : e2.engTicketPriority = Number(o2.value));
|
|
1198
|
+
const s2 = document.getElementById("sf-eng-ticket-sprint"), r2 = "jira" === ((_a = ve.provider) == null ? void 0 : _a.toLowerCase());
|
|
1199
|
+
if (s2 && r2 && ve.sprints) {
|
|
1200
|
+
if (!e2.engTicketSprint && !ye) {
|
|
1201
|
+
const t3 = pickDefaultActiveSprint(ve.sprints, e2.engTicketProject, ve.projects || []);
|
|
1202
|
+
(t3 == null ? void 0 : t3.id) && (e2.engTicketSprint = String(t3.id), setSprintDefaulted(true));
|
|
1203
|
+
}
|
|
1204
|
+
populateSprintOptions(s2, ve.sprints, e2.engTicketSprint || void 0), e2.engTicketSprint && (s2.style.color = "");
|
|
1205
|
+
}
|
|
1048
1206
|
const a2 = document.getElementById("sf-eng-ticket-type");
|
|
1049
|
-
return a2 &&
|
|
1207
|
+
return a2 && r2 && e2.engTicketProject && (updateIssueTypeOptions(a2, e2.engTicketProject), e2.engTicketIssueType ? (a2.value = e2.engTicketIssueType, a2.style.color = "#000") : a2.value && (e2.engTicketIssueType = a2.value)), e2;
|
|
1050
1208
|
}
|
|
1051
|
-
const
|
|
1052
|
-
if (!
|
|
1209
|
+
const we = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrationData: async function fetchIntegrationData(e2, t2) {
|
|
1210
|
+
if (!ve) try {
|
|
1053
1211
|
const n2 = await fetchEngineeringTicketPlatformIntegrations(e2, t2);
|
|
1054
|
-
|
|
1212
|
+
ve = resolveIntegration(n2);
|
|
1055
1213
|
} catch (e3) {
|
|
1056
|
-
console.error("Error fetching integration data:", e3),
|
|
1214
|
+
console.error("Error fetching integration data:", e3), ve = null;
|
|
1057
1215
|
}
|
|
1058
|
-
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }))
|
|
1059
|
-
function getInitialState() {
|
|
1060
|
-
const e2 = (function loadUserPreferences() {
|
|
1061
|
-
return { createIssue: f && "true" === localStorage.getItem(ce), createEngTicket: f && "true" === localStorage.getItem(de) };
|
|
1062
|
-
})();
|
|
1063
|
-
return { mode: "lookback", description: "", occurredInThisTab: true, createIssue: e2.createIssue, issueName: "", issueDescription: "", createEngTicket: e2.createEngTicket, engTicketTeam: "", engTicketProject: "", engTicketPriority: 0, engTicketLabels: [], engTicketSprint: "", engTicketIssueType: "", engTicketCustomFields: {} };
|
|
1064
|
-
}
|
|
1065
|
-
let ue = getInitialState(), pe = null, fe = null, ge = null, me = false;
|
|
1066
|
-
function setTimerInterval(e2) {
|
|
1067
|
-
ge = e2;
|
|
1068
|
-
}
|
|
1069
|
-
function setIsRecording(e2) {
|
|
1070
|
-
me = e2;
|
|
1071
|
-
}
|
|
1216
|
+
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSavedLastReporterAccountId, getSprintFieldId, getUsers, getValidSavedReporterAccountId, hasValidIntegration, pickDefaultActiveSprint, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, saveLastReporterAccountId, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" }));
|
|
1072
1217
|
function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
1073
1218
|
return `
|
|
1074
1219
|
<div style="position:relative;">
|
|
@@ -1102,9 +1247,9 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
|
1102
1247
|
</div>
|
|
1103
1248
|
`;
|
|
1104
1249
|
}
|
|
1105
|
-
const
|
|
1250
|
+
const ke = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, xe = { shortcuts: { ...ke }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
|
|
1106
1251
|
}, integrationData: null, showEngTicketFieldsDefault: false };
|
|
1107
|
-
let
|
|
1252
|
+
let Ie = null, Te = false;
|
|
1108
1253
|
function setupCustomMultiSelectListeners(e2, t2) {
|
|
1109
1254
|
const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
|
|
1110
1255
|
if (!n2 || !i2) return;
|
|
@@ -1121,16 +1266,16 @@ function setupCustomMultiSelectListeners(e2, t2) {
|
|
|
1121
1266
|
</span>`);
|
|
1122
1267
|
}
|
|
1123
1268
|
});
|
|
1124
|
-
const
|
|
1125
|
-
return
|
|
1269
|
+
const s2 = n2.querySelector(".sf-multiselect-chips");
|
|
1270
|
+
return s2 && (s2.innerHTML = o2.join("") || '<span style="color:#9ca3af;">Select...</span>', s2.querySelectorAll(".sf-multiselect-chip-remove").forEach((e4) => {
|
|
1126
1271
|
e4.addEventListener("click", (n3) => {
|
|
1127
1272
|
n3.stopPropagation();
|
|
1128
|
-
const o3 = e4.dataset.value || "",
|
|
1129
|
-
|
|
1130
|
-
const
|
|
1273
|
+
const o3 = e4.dataset.value || "", s3 = i2.querySelector(`.sf-multiselect-option[data-value="${o3}"]`);
|
|
1274
|
+
s3 && (s3.dataset.selected = "false", s3.style.backgroundColor = ""), updateChipsDisplay();
|
|
1275
|
+
const r2 = [];
|
|
1131
1276
|
i2.querySelectorAll(".sf-multiselect-option").forEach((e5) => {
|
|
1132
|
-
"true" === e5.dataset.selected &&
|
|
1133
|
-
}), t2(
|
|
1277
|
+
"true" === e5.dataset.selected && r2.push(e5.dataset.value || "");
|
|
1278
|
+
}), t2(r2);
|
|
1134
1279
|
});
|
|
1135
1280
|
})), e3;
|
|
1136
1281
|
}
|
|
@@ -1139,8 +1284,8 @@ function setupCustomMultiSelectListeners(e2, t2) {
|
|
|
1139
1284
|
n3.stopPropagation();
|
|
1140
1285
|
const i3 = e3, o2 = "true" === i3.dataset.selected;
|
|
1141
1286
|
i3.dataset.selected = String(!o2), i3.style.backgroundColor = o2 ? "" : "#e0f2fe";
|
|
1142
|
-
const
|
|
1143
|
-
t2(
|
|
1287
|
+
const s2 = updateChipsDisplay();
|
|
1288
|
+
t2(s2);
|
|
1144
1289
|
});
|
|
1145
1290
|
}), updateChipsDisplay(), document.addEventListener("click", (e3) => {
|
|
1146
1291
|
const t3 = e3.target;
|
|
@@ -1153,12 +1298,12 @@ function renderDynamicFields(e2, t2) {
|
|
|
1153
1298
|
if (!e2) return void (n2.innerHTML = '<div style="font-size:14px; color:#64748B;">Select a project to see additional fields</div>');
|
|
1154
1299
|
const i2 = getFieldsForProject(e2, t2), o2 = getUsers();
|
|
1155
1300
|
if (!i2 || 0 === i2.length) return void (n2.innerHTML = "");
|
|
1156
|
-
const
|
|
1301
|
+
const s2 = i2.map((e3) => (function renderDynamicField(e4, t3, n3 = []) {
|
|
1157
1302
|
var _a, _b, _c, _d;
|
|
1158
|
-
const i3 = e4.fieldId || e4.key, o3 = e4.name,
|
|
1159
|
-
if (d2.includes(i3) || d2.includes(
|
|
1303
|
+
const i3 = e4.fieldId || e4.key, o3 = e4.name, s3 = (_a = e4.schema) == null ? void 0 : _a.type, r2 = (_b = e4.schema) == null ? void 0 : _b.system, a2 = (_c = e4.schema) == null ? void 0 : _c.custom, l2 = e4.required || false, c2 = e4.allowedValues, d2 = ["summary", "description", "project", "issuetype", "priority"];
|
|
1304
|
+
if (d2.includes(i3) || d2.includes(r2)) return null;
|
|
1160
1305
|
const u2 = l2 ? '<span style="color:#ef4444;">*</span>' : "", p2 = "width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;";
|
|
1161
|
-
switch (
|
|
1306
|
+
switch (s3) {
|
|
1162
1307
|
case "string":
|
|
1163
1308
|
return a2 && a2.includes("textarea") ? `
|
|
1164
1309
|
<div>
|
|
@@ -1232,7 +1377,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1232
1377
|
const e5 = n3.map((e6) => {
|
|
1233
1378
|
const n4 = e6.email ? `${e6.name} (${e6.email})` : e6.name, i4 = t3 === e6.id ? "selected" : "";
|
|
1234
1379
|
return `<option value="${e6.id}" ${i4}>${n4}</option>`;
|
|
1235
|
-
}).join(""),
|
|
1380
|
+
}).join(""), s4 = t3 && n3.some((e6) => e6.id === t3);
|
|
1236
1381
|
return `
|
|
1237
1382
|
<div>
|
|
1238
1383
|
<label for="${i3}" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
@@ -1242,10 +1387,10 @@ function renderDynamicFields(e2, t2) {
|
|
|
1242
1387
|
id="${i3}"
|
|
1243
1388
|
class="sf-dynamic-field"
|
|
1244
1389
|
data-field-id="${i3}"
|
|
1245
|
-
style="${p2} appearance:none; cursor:pointer; background-color: white; ${
|
|
1390
|
+
style="${p2} appearance:none; cursor:pointer; background-color: white; ${s4 ? "" : "color: #9ca3af;"}"
|
|
1246
1391
|
${l2 ? "required" : ""}
|
|
1247
1392
|
>
|
|
1248
|
-
<option value="" ${
|
|
1393
|
+
<option value="" ${s4 ? "" : "selected"} style="color: #9ca3af;">Select ${o3.toLowerCase()}...</option>
|
|
1249
1394
|
${e5}
|
|
1250
1395
|
</select>
|
|
1251
1396
|
</div>
|
|
@@ -1278,7 +1423,7 @@ function renderDynamicFields(e2, t2) {
|
|
|
1278
1423
|
}
|
|
1279
1424
|
return null;
|
|
1280
1425
|
case "array":
|
|
1281
|
-
return "labels" ===
|
|
1426
|
+
return "labels" === r2 ? null : c2 && c2.length > 0 ? renderCustomMultiSelect(i3, o3, c2, Array.isArray(t3) ? t3 : [], l2) : null;
|
|
1282
1427
|
case "parent":
|
|
1283
1428
|
case "issuelink":
|
|
1284
1429
|
return `
|
|
@@ -1317,22 +1462,22 @@ function renderDynamicFields(e2, t2) {
|
|
|
1317
1462
|
</div>
|
|
1318
1463
|
` : null;
|
|
1319
1464
|
}
|
|
1320
|
-
})(e3,
|
|
1321
|
-
n2.innerHTML =
|
|
1465
|
+
})(e3, pe.engTicketCustomFields[e3.fieldId || e3.key], o2)).filter(Boolean).join("");
|
|
1466
|
+
n2.innerHTML = s2 || "", i2.forEach((e3) => {
|
|
1322
1467
|
var _a;
|
|
1323
1468
|
const t3 = e3.fieldId || e3.key, n3 = (_a = e3.schema) == null ? void 0 : _a.type, i3 = e3.allowedValues;
|
|
1324
1469
|
"array" === n3 && i3 && i3.length > 0 && setupCustomMultiSelectListeners(t3, (e4) => {
|
|
1325
|
-
|
|
1470
|
+
pe.engTicketCustomFields[t3] = e4;
|
|
1326
1471
|
});
|
|
1327
1472
|
});
|
|
1328
1473
|
}
|
|
1329
1474
|
function generateEngTicketFieldsHTML() {
|
|
1330
1475
|
var _a;
|
|
1331
|
-
const e2 =
|
|
1476
|
+
const e2 = xe.integrationData;
|
|
1332
1477
|
if (!e2) return "";
|
|
1333
1478
|
const t2 = "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase());
|
|
1334
1479
|
let n2 = "<div style='display:flex; flex-direction:column; gap:12px;'>";
|
|
1335
|
-
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,
|
|
1480
|
+
return e2.teams && Array.isArray(e2.teams) && e2.teams.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-team" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Team\n </label>\n <select id="sf-eng-ticket-team"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select team...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-project" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Project\n </label>\n <select id="sf-eng-ticket-project"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project...</option>\n </select>\n </div>\n ', t2 && (n2 += '\n <div>\n <label for="sf-eng-ticket-type" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Issue Type\n </label>\n <select id="sf-eng-ticket-type"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select project first...</option>\n </select>\n </div>\n '), n2 += '\n <div>\n <label for="sf-eng-ticket-priority" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Priority\n </label>\n <select id="sf-eng-ticket-priority"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white;">\n </select>\n </div>\n ', e2.labels && Array.isArray(e2.labels) && e2.labels.length > 0 && (n2 += renderCustomMultiSelect("sf-eng-ticket-labels", "Labels", e2.labels, pe.engTicketLabels, false)), t2 && e2.sprints && Array.isArray(e2.sprints) && e2.sprints.length > 0 && (n2 += '\n <div>\n <label for="sf-eng-ticket-sprint" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n Sprint\n </label>\n <select id="sf-eng-ticket-sprint"\n style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none; appearance:none; cursor:pointer; background-color: white; color: #9ca3af;">\n <option value="" selected style="color: #9ca3af;">Select sprint...</option>\n </select>\n </div>\n '), n2 += '\n <div id="sf-dynamic-fields-container" style="display: flex; flex-direction: column; gap: 12px;"></div>\n ', n2 += "</div>", n2;
|
|
1336
1481
|
}
|
|
1337
1482
|
function getShortcutKeyCmdCtrlLabel() {
|
|
1338
1483
|
return (function isMacPlatform() {
|
|
@@ -1346,19 +1491,19 @@ function getShortcutLabelFromContext(e2) {
|
|
|
1346
1491
|
return e3.requireCmdCtrl && t2.push(getShortcutKeyCmdCtrlLabel()), t2.push((function formatShortcutKeyLabel(e4) {
|
|
1347
1492
|
return ({ escape: "esc" }[e4.toLowerCase()] || e4).toUpperCase();
|
|
1348
1493
|
})(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 ? " + " : "");
|
|
1349
|
-
})(
|
|
1494
|
+
})(xe.shortcuts[e2]);
|
|
1350
1495
|
}
|
|
1351
1496
|
function getSessionIdSafely() {
|
|
1352
|
-
if (!
|
|
1353
|
-
return
|
|
1497
|
+
if (!xe.resolveSessionId) throw new Error("getSessionId not defined");
|
|
1498
|
+
return xe.resolveSessionId();
|
|
1354
1499
|
}
|
|
1355
1500
|
function openReportIssueModal(e2) {
|
|
1356
|
-
|
|
1501
|
+
he ? stopRecording() : (Te = (e2 == null ? void 0 : e2.showEngTicketFields) ?? xe.showEngTicketFieldsDefault, injectModalHTML(), Ie && document.body.appendChild(Ie));
|
|
1357
1502
|
}
|
|
1358
1503
|
function closeModal() {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
})(),
|
|
1504
|
+
xe.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (Ie == null ? void 0 : Ie.parentNode) && Ie.parentNode.removeChild(Ie), Ie = null, he || (function resetState() {
|
|
1505
|
+
pe = getInitialState(), fe = null, ge = null, ye = false;
|
|
1506
|
+
})(), me && (clearInterval(me), setTimerInterval(null));
|
|
1362
1507
|
}
|
|
1363
1508
|
function activateModalIsolation(e2) {
|
|
1364
1509
|
e2.setAttribute("role", "dialog"), e2.setAttribute("aria-modal", "true"), e2.hasAttribute("tabindex") || e2.setAttribute("tabindex", "-1");
|
|
@@ -1375,10 +1520,10 @@ function activateModalIsolation(e2) {
|
|
|
1375
1520
|
n3 && (e2.contains(n3) || (t3.stopImmediatePropagation(), t3.preventDefault(), refocus()));
|
|
1376
1521
|
}, o2 = ["mousedown", "mouseup", "click", "pointerdown", "pointerup", "touchstart", "touchend", "wheel", "keydown", "keyup", "focus", "focusin", "focusout", "blur"];
|
|
1377
1522
|
o2.forEach((e3) => document.addEventListener(e3, quarantine, true));
|
|
1378
|
-
let
|
|
1523
|
+
let s2 = 0, r2 = null;
|
|
1379
1524
|
const a2 = t2 instanceof HTMLTextAreaElement ? t2 : null, refocus = () => {
|
|
1380
|
-
if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 &&
|
|
1381
|
-
a2.setSelectionRange(
|
|
1525
|
+
if ((e2.querySelector(":focus") || a2 || t2 || e2).focus({ preventScroll: true }), a2 && document.activeElement === a2 && r2) try {
|
|
1526
|
+
a2.setSelectionRange(r2.start, r2.end, "none");
|
|
1382
1527
|
} catch {
|
|
1383
1528
|
}
|
|
1384
1529
|
}, selectionInsideModal = () => {
|
|
@@ -1396,12 +1541,12 @@ function activateModalIsolation(e2) {
|
|
|
1396
1541
|
const t3 = document.activeElement, n3 = t3 === document.body || null == t3 || !e2.contains(t3), i3 = selectionInsideModal();
|
|
1397
1542
|
n3 && !i3 ? (l2 += 1, l2 >= 2 && (refocus(), l2 = 0)) : (l2 = 0, (() => {
|
|
1398
1543
|
if (a2 && document.activeElement === a2) try {
|
|
1399
|
-
|
|
1544
|
+
r2 = { start: a2.selectionStart ?? a2.value.length, end: a2.selectionEnd ?? a2.value.length };
|
|
1400
1545
|
} catch {
|
|
1401
1546
|
}
|
|
1402
|
-
})()),
|
|
1547
|
+
})()), s2 = window.requestAnimationFrame(watchdog);
|
|
1403
1548
|
};
|
|
1404
|
-
|
|
1549
|
+
s2 = window.requestAnimationFrame(watchdog);
|
|
1405
1550
|
const onBlurLike = () => {
|
|
1406
1551
|
setTimeout(() => {
|
|
1407
1552
|
const t3 = document.activeElement;
|
|
@@ -1413,13 +1558,13 @@ function activateModalIsolation(e2) {
|
|
|
1413
1558
|
n2.remove(), i2.remove();
|
|
1414
1559
|
} catch {
|
|
1415
1560
|
}
|
|
1416
|
-
o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true),
|
|
1561
|
+
o2.forEach((e3) => document.removeEventListener(e3, quarantine, true)), window.removeEventListener("blur", onBlurLike, true), document.removeEventListener("focusout", onBlurLike, true), s2 && cancelAnimationFrame(s2);
|
|
1417
1562
|
};
|
|
1418
1563
|
}
|
|
1419
1564
|
function injectModalHTML(e2 = "lookback") {
|
|
1420
|
-
|
|
1565
|
+
Ie && (Ie.remove(), Ie = null), Ie = document.createElement("div"), Ie.id = "sf-report-issue-modal";
|
|
1421
1566
|
const t2 = "startnow" === e2;
|
|
1422
|
-
|
|
1567
|
+
Ie.innerHTML = `
|
|
1423
1568
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1424
1569
|
<div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
|
|
1425
1570
|
background:#fff; border-radius:12px;
|
|
@@ -1474,7 +1619,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1474
1619
|
<textarea id="sf-issue-description" placeholder="Add description here"
|
|
1475
1620
|
style="width:100%; height:80px; padding:8px 12px; font-size:14px;
|
|
1476
1621
|
border:1px solid #cbd5e1; border-radius:6px; margin-bottom:20px;
|
|
1477
|
-
resize:none; outline:none;">${
|
|
1622
|
+
resize:none; outline:none;">${pe.description}</textarea>
|
|
1478
1623
|
|
|
1479
1624
|
<!-- When did this happen Section -->
|
|
1480
1625
|
<div id="sf-lookback-container" style="display:${t2 ? "none" : "block"}; margin-bottom:20px;">
|
|
@@ -1540,34 +1685,34 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1540
1685
|
<!-- Checkboxes on same line -->
|
|
1541
1686
|
<div style="display:flex; align-items:center; gap:24px; margin-bottom:16px;">
|
|
1542
1687
|
<label style="display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1543
|
-
<input type="checkbox" id="sf-create-issue-checkbox" ${
|
|
1688
|
+
<input type="checkbox" id="sf-create-issue-checkbox" ${pe.createIssue ? "checked" : ""}
|
|
1544
1689
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1545
1690
|
Create an Issue
|
|
1546
1691
|
</label>
|
|
1547
1692
|
|
|
1548
|
-
<label id="sf-create-eng-ticket-label" style="display:${
|
|
1549
|
-
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${
|
|
1693
|
+
<label id="sf-create-eng-ticket-label" style="display:${xe.integrationData && Te ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1694
|
+
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${pe.createEngTicket ? "checked" : ""}
|
|
1550
1695
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1551
1696
|
Create an Eng Ticket
|
|
1552
1697
|
</label>
|
|
1553
1698
|
</div>
|
|
1554
1699
|
|
|
1555
1700
|
<!-- Issue Title Field (always shown when create issue is checked) -->
|
|
1556
|
-
<div id="sf-issue-fields-container" style="display:${
|
|
1701
|
+
<div id="sf-issue-fields-container" style="display:${pe.createIssue ? "block" : "none"};">
|
|
1557
1702
|
<div style="display:flex; flex-direction:column; gap:12px;">
|
|
1558
1703
|
<div>
|
|
1559
1704
|
<label for="sf-issue-name" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">
|
|
1560
1705
|
Title <span style="color:#ef4444;">*</span>
|
|
1561
1706
|
</label>
|
|
1562
1707
|
<input type="text" id="sf-issue-name" placeholder="Enter title"
|
|
1563
|
-
value="${
|
|
1708
|
+
value="${pe.issueName}"
|
|
1564
1709
|
style="width:100%; padding:8px 12px; font-size:14px; border:1px solid #cbd5e1; border-radius:6px; outline:none;">
|
|
1565
1710
|
</div>
|
|
1566
1711
|
</div>
|
|
1567
1712
|
</div>
|
|
1568
1713
|
|
|
1569
1714
|
<!-- Engineering Ticket Fields (shown when create eng ticket is checked) -->
|
|
1570
|
-
<div id="sf-eng-ticket-fields-container" style="display:${
|
|
1715
|
+
<div id="sf-eng-ticket-fields-container" style="display:${pe.createEngTicket && xe.integrationData ? "block" : "none"}; margin-top: ${pe.createIssue ? "12px" : "0"};">
|
|
1571
1716
|
${generateEngTicketFieldsHTML()}
|
|
1572
1717
|
</div>
|
|
1573
1718
|
</div>
|
|
@@ -1610,8 +1755,8 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1610
1755
|
</div>
|
|
1611
1756
|
</div>
|
|
1612
1757
|
</div>
|
|
1613
|
-
`,
|
|
1614
|
-
const e3 =
|
|
1758
|
+
`, pe.mode = e2, document.body.appendChild(Ie), (function bindListeners() {
|
|
1759
|
+
const e3 = Ie == null ? void 0 : Ie.querySelectorAll(".sf-issue-tab"), t3 = document.getElementById("sf-start-recording-btn"), n2 = document.getElementById("sf-modal-close-btn"), i2 = document.getElementById("sf-issue-submit-btn"), o2 = document.getElementById("sf-lookback-minutes");
|
|
1615
1760
|
e3 == null ? void 0 : e3.forEach((e4) => {
|
|
1616
1761
|
e4.addEventListener("click", (e5) => {
|
|
1617
1762
|
const t4 = e5.currentTarget.dataset.mode;
|
|
@@ -1619,10 +1764,10 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1619
1764
|
});
|
|
1620
1765
|
}), n2 && (n2.onclick = closeModal);
|
|
1621
1766
|
o2 && o2.addEventListener("change", () => {
|
|
1622
|
-
"lookback" ===
|
|
1767
|
+
"lookback" === pe.mode && (i2.disabled = false, i2.style.opacity = "1", i2.style.cursor = "pointer");
|
|
1623
1768
|
});
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1769
|
+
const s2 = Ie == null ? void 0 : Ie.querySelectorAll(".sf-collapsible-header");
|
|
1770
|
+
s2 == null ? void 0 : s2.forEach((e4) => {
|
|
1626
1771
|
e4.addEventListener("click", (e5) => {
|
|
1627
1772
|
const t4 = e5.currentTarget, n3 = t4.dataset.target, i3 = document.getElementById(n3), o3 = t4.querySelector(".sf-chevron");
|
|
1628
1773
|
if (i3 && o3) {
|
|
@@ -1633,22 +1778,22 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1633
1778
|
}
|
|
1634
1779
|
});
|
|
1635
1780
|
});
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1638
|
-
const e4 =
|
|
1639
|
-
|
|
1781
|
+
const r2 = document.getElementById("sf-create-issue-checkbox"), a2 = document.getElementById("sf-issue-fields-container"), l2 = document.getElementById("sf-create-eng-ticket-checkbox"), c2 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1782
|
+
r2 && r2.addEventListener("change", () => {
|
|
1783
|
+
const e4 = r2.checked;
|
|
1784
|
+
pe.createIssue = e4, localStorage.setItem(de, String(e4)), a2 && (a2.style.display = e4 ? "block" : "none"), !e4 && l2 && (l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"));
|
|
1640
1785
|
});
|
|
1641
1786
|
l2 && l2.addEventListener("change", async () => {
|
|
1642
1787
|
var _a;
|
|
1643
1788
|
const e4 = l2.checked;
|
|
1644
|
-
if (
|
|
1645
|
-
if (!hasValidIntegration()) return l2.checked = false,
|
|
1789
|
+
if (pe.createEngTicket = e4, localStorage.setItem(ue, String(e4)), e4 && !pe.createIssue && (pe.createIssue = true, localStorage.setItem(de, "true"), r2 && (r2.checked = true), a2 && (a2.style.display = "block")), c2 && (c2.style.display = e4 ? "block" : "none"), e4) {
|
|
1790
|
+
if (!hasValidIntegration()) return l2.checked = false, pe.createEngTicket = false, localStorage.setItem(ue, "false"), c2 && (c2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1646
1791
|
const e5 = getIntegrationData();
|
|
1647
1792
|
if (e5) {
|
|
1648
|
-
if (!
|
|
1649
|
-
if (getFieldsForProject(
|
|
1793
|
+
if (!pe.engTicketTeam && e5.defaultTeam && (pe.engTicketTeam = e5.defaultTeam), !pe.engTicketProject && e5.defaultProject && (pe.engTicketProject = e5.defaultProject), !pe.engTicketPriority && e5.defaultPriority && (pe.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && pe.engTicketProject && !pe.engTicketCustomFields.reporter) {
|
|
1794
|
+
if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
|
|
1650
1795
|
const t5 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1651
|
-
|
|
1796
|
+
pe.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
|
|
1652
1797
|
}
|
|
1653
1798
|
}
|
|
1654
1799
|
const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
|
|
@@ -1658,11 +1803,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1658
1803
|
});
|
|
1659
1804
|
const d2 = document.getElementById("sf-issue-name");
|
|
1660
1805
|
d2 && d2.addEventListener("input", () => {
|
|
1661
|
-
|
|
1806
|
+
pe.issueName = d2.value;
|
|
1662
1807
|
});
|
|
1663
1808
|
bindEngTicketListeners(), t3 && (t3.onclick = () => {
|
|
1664
1809
|
const e4 = document.getElementById("sf-issue-description");
|
|
1665
|
-
e4 && (
|
|
1810
|
+
e4 && (pe.description = e4.value), (function startCountdownThenRecord() {
|
|
1666
1811
|
if (document.getElementById("sf-countdown-overlay")) return;
|
|
1667
1812
|
const e5 = document.createElement("div");
|
|
1668
1813
|
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 ";
|
|
@@ -1672,10 +1817,10 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1672
1817
|
if (t4--, t4 > 0) e5.textContent = t4.toString();
|
|
1673
1818
|
else {
|
|
1674
1819
|
clearInterval(n3), document.body.removeChild(e5), (function setRecordingStartTime(e6) {
|
|
1675
|
-
|
|
1820
|
+
fe = e6;
|
|
1676
1821
|
})(Date.now()), setIsRecording(true);
|
|
1677
1822
|
try {
|
|
1678
|
-
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() =>
|
|
1823
|
+
const { enableFunctionSpanTracking: e6 } = await Promise.resolve().then(() => N);
|
|
1679
1824
|
e6();
|
|
1680
1825
|
} catch (e6) {
|
|
1681
1826
|
console.error("[Report Issue] Failed to enable function span tracking:", e6);
|
|
@@ -1702,7 +1847,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1702
1847
|
const t5 = e6.querySelector("#sf-recording-timer");
|
|
1703
1848
|
if (!t5) return;
|
|
1704
1849
|
const n4 = setInterval(() => {
|
|
1705
|
-
const e7 = Date.now() - (
|
|
1850
|
+
const e7 = Date.now() - (fe ?? Date.now()), n5 = Math.floor(e7 / 6e4).toString().padStart(2, "0"), i3 = Math.floor(e7 % 6e4 / 1e3).toString().padStart(2, "0");
|
|
1706
1851
|
t5.textContent = `${n5}:${i3}`;
|
|
1707
1852
|
}, 1e3);
|
|
1708
1853
|
setTimerInterval(n4);
|
|
@@ -1711,33 +1856,41 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1711
1856
|
}, 1e3);
|
|
1712
1857
|
})();
|
|
1713
1858
|
});
|
|
1714
|
-
|
|
1859
|
+
Ie == null ? void 0 : Ie.addEventListener("click", (e4) => {
|
|
1715
1860
|
var _a;
|
|
1716
1861
|
if (e4.target.closest("#sf-issue-submit-btn")) {
|
|
1717
|
-
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 =
|
|
1718
|
-
if (
|
|
1862
|
+
const e5 = ((_a = document.getElementById("sf-issue-description")) == null ? void 0 : _a.value) || "", t4 = pe.mode;
|
|
1863
|
+
if (pe.description = e5, pe.createIssue && !pe.issueName.trim()) return void alert("Issue title is required when creating an issue.");
|
|
1719
1864
|
let n3, i3;
|
|
1720
|
-
if ("startnow" === t4) n3 =
|
|
1865
|
+
if ("startnow" === t4) n3 = fe ?? Date.now() - 3e5, i3 = ge ?? Date.now();
|
|
1721
1866
|
else {
|
|
1722
1867
|
const e6 = 60 * Number((o2 == null ? void 0 : o2.value) || "2") * 1e3;
|
|
1723
1868
|
i3 = Date.now(), n3 = i3 - e6;
|
|
1724
1869
|
}
|
|
1725
|
-
if (
|
|
1726
|
-
const o3 = document.getElementById("sf-issue-name"),
|
|
1870
|
+
if (pe.createIssue) {
|
|
1871
|
+
const o3 = document.getElementById("sf-issue-name"), s3 = document.getElementById("sf-eng-ticket-team"), r3 = document.getElementById("sf-eng-ticket-project"), a3 = document.getElementById("sf-eng-ticket-priority"), l3 = document.getElementById("sf-eng-ticket-type"), c3 = (o3 == null ? void 0 : o3.value) || "", d3 = e5, u2 = (s3 == null ? void 0 : s3.value) || "", p2 = (r3 == null ? void 0 : r3.value) || "", f2 = a3 ? Number(a3.value) : 0, g2 = pe.engTicketLabels, m2 = (l3 == null ? void 0 : l3.value) || "", h2 = { ...pe.engTicketCustomFields };
|
|
1727
1872
|
document.querySelectorAll(".sf-dynamic-field").forEach((e6) => {
|
|
1728
1873
|
const t5 = e6, n4 = t5.dataset.fieldId;
|
|
1729
1874
|
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));
|
|
1730
1875
|
});
|
|
1731
|
-
const y2 = document.getElementById("sf-eng-ticket-sprint"),
|
|
1732
|
-
if (
|
|
1876
|
+
const y2 = document.getElementById("sf-eng-ticket-sprint"), S2 = (y2 == null ? void 0 : y2.value) || pe.engTicketSprint;
|
|
1877
|
+
if (S2) {
|
|
1733
1878
|
const e6 = getSprintFieldId();
|
|
1734
|
-
h2[e6] = parseInt(
|
|
1879
|
+
h2[e6] = parseInt(S2, 10);
|
|
1880
|
+
}
|
|
1881
|
+
const isFieldEmpty = (e6) => null == e6 || ("string" == typeof e6 ? "" === e6.trim() : !!Array.isArray(e6) && 0 === e6.length), v2 = (getFieldsForProject(p2, m2) || []).filter((e6) => e6 && e6.required), b2 = [];
|
|
1882
|
+
for (const e6 of v2) {
|
|
1883
|
+
const t5 = e6.fieldId || e6.key;
|
|
1884
|
+
if ("summary" === t5 || "description" === t5 || "priority" === t5) continue;
|
|
1885
|
+
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) && b2.push(e6.name || t5);
|
|
1735
1887
|
}
|
|
1736
|
-
|
|
1888
|
+
if (b2.length > 0) return void alert(`Please fill in the required field${b2.length > 1 ? "s" : ""}: ${b2.join(", ")}`);
|
|
1889
|
+
closeModal(), (async function createTriageAndIssue(e6, t5, n4, i4, o4, s4, r4, a4, l4, c4, d4, u3, p3) {
|
|
1737
1890
|
var _a2, _b, _c;
|
|
1738
1891
|
try {
|
|
1739
1892
|
showStatusModal(true);
|
|
1740
|
-
const f3 = await createTriageAndIssueFromRecorder(
|
|
1893
|
+
const f3 = await createTriageAndIssueFromRecorder(xe.apiKey, xe.backendApi, getSessionIdSafely(), e6, t5, n4, i4, o4, s4, r4, a4, l4, c4, d4, u3, p3);
|
|
1741
1894
|
if ((_a2 = f3 == null ? void 0 : f3.errors) == null ? void 0 : _a2.length) {
|
|
1742
1895
|
const e7 = f3.errors.map((e8) => e8.message).join("; ");
|
|
1743
1896
|
return console.error("GraphQL error creating triage and issue:", e7), void showStatusModal(false, null, e7);
|
|
@@ -1747,33 +1900,33 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1747
1900
|
} catch (e7) {
|
|
1748
1901
|
console.error("Error creating triage and issue:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1749
1902
|
}
|
|
1750
|
-
})(`${n3}`, `${i3}`, e5, c3, d3,
|
|
1903
|
+
})(`${n3}`, `${i3}`, e5, c3, d3, pe.createEngTicket, u2, p2, f2, g2, m2, h2, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1751
1904
|
} else closeModal(), (async function createTriage(e6, t5, n4, i4) {
|
|
1752
1905
|
var _a2, _b, _c;
|
|
1753
1906
|
try {
|
|
1754
1907
|
showStatusModal(true);
|
|
1755
|
-
const o3 = await createTriageFromRecorder(
|
|
1908
|
+
const o3 = await createTriageFromRecorder(xe.apiKey, xe.backendApi, getSessionIdSafely(), e6, t5, n4, i4);
|
|
1756
1909
|
if ((_a2 = o3 == null ? void 0 : o3.errors) == null ? void 0 : _a2.length) {
|
|
1757
1910
|
const e7 = o3.errors.map((e8) => e8.message).join("; ");
|
|
1758
1911
|
return console.error("GraphQL error creating triage:", e7), void showStatusModal(false, null, e7);
|
|
1759
1912
|
}
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1913
|
+
const s3 = (_c = (_b = o3 == null ? void 0 : o3.data) == null ? void 0 : _b.createTriageFromRecorder) == null ? void 0 : _c.id;
|
|
1914
|
+
s3 ? showStatusModal(false, { type: "triage", id: s3 }) : (console.error("No Triage ID returned from backend."), showStatusModal(false, null, "No triage was created. Please try again."));
|
|
1762
1915
|
} catch (e7) {
|
|
1763
1916
|
console.error("Error creating triage:", e7), showStatusModal(false, null, "Something went wrong. Please try again.");
|
|
1764
1917
|
}
|
|
1765
1918
|
})(`${n3}`, `${i3}`, e5, "startnow" === t4 ? "RECORDED" : "LOOKBACK");
|
|
1766
1919
|
}
|
|
1767
1920
|
});
|
|
1768
|
-
})(),
|
|
1921
|
+
})(), xe.deactivateIsolation = activateModalIsolation(Ie), xe.integrationData && pe.createEngTicket ? initializeEngTicketForm() : xe.integrationData || (pe.createEngTicket = false), xe.apiKey && xe.backendApi && refreshIntegrationData(xe.apiKey, xe.backendApi).then((e3) => {
|
|
1769
1922
|
if (!e3 || !document.getElementById("sf-report-issue-modal")) return;
|
|
1770
|
-
|
|
1923
|
+
xe.integrationData = e3;
|
|
1771
1924
|
const t3 = document.getElementById("sf-eng-ticket-fields-container");
|
|
1772
1925
|
if (t3) {
|
|
1773
1926
|
const e4 = generateEngTicketFieldsHTML();
|
|
1774
|
-
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(
|
|
1927
|
+
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(pe), renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType));
|
|
1775
1928
|
}
|
|
1776
|
-
if (
|
|
1929
|
+
if (Te) {
|
|
1777
1930
|
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1778
1931
|
e4 && (e4.style.display = "flex");
|
|
1779
1932
|
}
|
|
@@ -1781,40 +1934,40 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1781
1934
|
}
|
|
1782
1935
|
function initializeEngTicketForm() {
|
|
1783
1936
|
var _a;
|
|
1784
|
-
const e2 =
|
|
1937
|
+
const e2 = xe.integrationData;
|
|
1785
1938
|
if (e2) {
|
|
1786
|
-
if (!
|
|
1787
|
-
if (getFieldsForProject(
|
|
1939
|
+
if (!pe.engTicketTeam && e2.defaultTeam && (pe.engTicketTeam = e2.defaultTeam), !pe.engTicketProject && e2.defaultProject && (pe.engTicketProject = e2.defaultProject), !pe.engTicketPriority && e2.defaultPriority && (pe.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(pe), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && pe.engTicketProject && !pe.engTicketCustomFields.reporter) {
|
|
1940
|
+
if (getFieldsForProject(pe.engTicketProject, pe.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
|
|
1788
1941
|
const t2 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1789
|
-
|
|
1942
|
+
pe.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
|
|
1790
1943
|
}
|
|
1791
1944
|
}
|
|
1792
|
-
|
|
1945
|
+
pe.engTicketProject && renderDynamicFields(pe.engTicketProject, pe.engTicketIssueType);
|
|
1793
1946
|
}
|
|
1794
1947
|
}
|
|
1795
1948
|
function setActiveTab(e2) {
|
|
1796
|
-
|
|
1797
|
-
const t2 =
|
|
1949
|
+
pe.mode = e2;
|
|
1950
|
+
const t2 = Ie == null ? void 0 : Ie.querySelector("#sf-tab-lookback"), n2 = Ie == null ? void 0 : Ie.querySelector("#sf-tab-startnow");
|
|
1798
1951
|
"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");
|
|
1799
1952
|
}
|
|
1800
1953
|
function updateModeSpecificUI(e2) {
|
|
1801
|
-
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"),
|
|
1802
|
-
if (t2 && n2 && i2 && o2 &&
|
|
1803
|
-
i2.style.display = "block", a2.style.display = "none",
|
|
1804
|
-
const e3 = null !==
|
|
1805
|
-
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed",
|
|
1806
|
-
const e4 = Math.floor((
|
|
1807
|
-
o2.style.display = "block",
|
|
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"), s2 = document.getElementById("sf-recording-timer-display"), r2 = document.getElementById("sf-modal-footer"), a2 = document.getElementById("sf-lookback-container");
|
|
1955
|
+
if (t2 && n2 && i2 && o2 && s2 && r2 && a2) if ("startnow" === e2) {
|
|
1956
|
+
i2.style.display = "block", a2.style.display = "none", r2.style.justifyContent = "space-between", t2.textContent = "I want to reproduce the issue right now.";
|
|
1957
|
+
const e3 = null !== fe && null !== ge;
|
|
1958
|
+
if (n2.disabled = !e3, n2.style.opacity = e3 ? "1" : "0.4", n2.style.cursor = e3 ? "pointer" : "not-allowed", fe && ge) {
|
|
1959
|
+
const e4 = Math.floor((ge - fe) / 1e3), t3 = String(Math.floor(e4 / 60)).padStart(2, "0"), n3 = String(e4 % 60).padStart(2, "0");
|
|
1960
|
+
o2.style.display = "block", s2.textContent = `${t3}:${n3}`;
|
|
1808
1961
|
} else o2.style.display = "none";
|
|
1809
|
-
} else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block",
|
|
1962
|
+
} else i2.style.display = "none", o2.style.display = "none", a2.style.display = "block", r2.style.justifyContent = "flex-end", t2.textContent = "Something already happened. Capture the past few minutes.", n2.disabled = false, n2.style.opacity = "1", n2.style.cursor = "pointer";
|
|
1810
1963
|
}
|
|
1811
1964
|
function bindEngTicketListeners() {
|
|
1812
|
-
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"),
|
|
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"), s2 = document.getElementById("sf-eng-ticket-sprint");
|
|
1813
1966
|
e2 && e2.addEventListener("change", () => {
|
|
1814
|
-
|
|
1967
|
+
pe.engTicketTeam = e2.value, e2.style.color = e2.value ? "" : "#9ca3af";
|
|
1815
1968
|
const t3 = document.getElementById("sf-eng-ticket-project");
|
|
1816
1969
|
if (t3) {
|
|
1817
|
-
|
|
1970
|
+
pe.engTicketProject = "", pe.engTicketCustomFields = {};
|
|
1818
1971
|
const n3 = getProjectsForTeam(e2.value);
|
|
1819
1972
|
t3.innerHTML = '<option value="">Select project...</option>', n3.forEach((e3) => {
|
|
1820
1973
|
const n4 = document.createElement("option");
|
|
@@ -1823,41 +1976,41 @@ function bindEngTicketListeners() {
|
|
|
1823
1976
|
}
|
|
1824
1977
|
}), t2 && t2.addEventListener("change", () => {
|
|
1825
1978
|
var _a;
|
|
1826
|
-
|
|
1979
|
+
pe.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", pe.engTicketCustomFields = {};
|
|
1827
1980
|
const e3 = getIntegrationData();
|
|
1828
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value),
|
|
1829
|
-
if (getFieldsForProject(t2.value,
|
|
1981
|
+
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), pe.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
|
|
1982
|
+
if (getFieldsForProject(t2.value, pe.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
|
|
1830
1983
|
const t3 = getValidSavedReporterAccountId() || getDefaultReporterAccountId();
|
|
1831
|
-
|
|
1984
|
+
pe.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
|
|
1832
1985
|
}
|
|
1833
1986
|
}
|
|
1834
|
-
renderDynamicFields(t2.value,
|
|
1835
|
-
}),
|
|
1836
|
-
|
|
1987
|
+
renderDynamicFields(t2.value, pe.engTicketIssueType);
|
|
1988
|
+
}), s2 && s2.addEventListener("change", () => {
|
|
1989
|
+
pe.engTicketSprint = s2.value, s2.style.color = s2.value ? "" : "#9ca3af", setSprintDefaulted(true);
|
|
1837
1990
|
}), n2 && n2.addEventListener("change", () => {
|
|
1838
|
-
|
|
1991
|
+
pe.engTicketPriority = Number(n2.value);
|
|
1839
1992
|
}), i2 && setupCustomMultiSelectListeners("sf-eng-ticket-labels", (e3) => {
|
|
1840
|
-
|
|
1993
|
+
pe.engTicketLabels = e3;
|
|
1841
1994
|
}), o2 && o2.addEventListener("change", () => {
|
|
1842
|
-
|
|
1995
|
+
pe.engTicketIssueType = o2.value, o2.style.color = o2.value ? "" : "#9ca3af";
|
|
1843
1996
|
const e3 = document.getElementById("sf-eng-ticket-project");
|
|
1844
1997
|
if (e3 && e3.value) {
|
|
1845
|
-
const t3 =
|
|
1846
|
-
|
|
1998
|
+
const t3 = pe.engTicketCustomFields.reporter;
|
|
1999
|
+
pe.engTicketCustomFields = {}, t3 && (pe.engTicketCustomFields.reporter = t3), renderDynamicFields(e3.value, o2.value);
|
|
1847
2000
|
}
|
|
1848
2001
|
});
|
|
1849
|
-
const
|
|
1850
|
-
|
|
2002
|
+
const r2 = document.getElementById("sf-dynamic-fields-container");
|
|
2003
|
+
r2 && (r2.addEventListener("input", (e3) => {
|
|
1851
2004
|
const t3 = e3.target;
|
|
1852
2005
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1853
2006
|
const e4 = t3.dataset.fieldId;
|
|
1854
|
-
e4 && ("checkbox" === t3.type ?
|
|
2007
|
+
e4 && ("checkbox" === t3.type ? pe.engTicketCustomFields[e4] = t3.checked : "number" === t3.type ? pe.engTicketCustomFields[e4] = parseFloat(t3.value) || null : pe.engTicketCustomFields[e4] = t3.value);
|
|
1855
2008
|
}
|
|
1856
|
-
}),
|
|
2009
|
+
}), r2.addEventListener("change", (e3) => {
|
|
1857
2010
|
const t3 = e3.target;
|
|
1858
2011
|
if (t3.classList.contains("sf-dynamic-field")) {
|
|
1859
2012
|
const e4 = t3.dataset.fieldId;
|
|
1860
|
-
if (e4 && (
|
|
2013
|
+
if (e4 && (pe.engTicketCustomFields[e4] = t3.value, "reporter" === e4 && t3.value && saveLastReporterAccountId(t3.value)), "SELECT" === t3.tagName) {
|
|
1861
2014
|
const e5 = t3;
|
|
1862
2015
|
e5.style.color = e5.value ? "" : "#9ca3af";
|
|
1863
2016
|
}
|
|
@@ -1867,10 +2020,10 @@ function bindEngTicketListeners() {
|
|
|
1867
2020
|
async function stopRecording() {
|
|
1868
2021
|
var _a;
|
|
1869
2022
|
!(function setRecordingEndTime(e2) {
|
|
1870
|
-
|
|
1871
|
-
})(Date.now()), setIsRecording(false),
|
|
2023
|
+
ge = e2;
|
|
2024
|
+
})(Date.now()), setIsRecording(false), me && (clearInterval(me), setTimerInterval(null)), (_a = document.getElementById("sf-recording-indicator")) == null ? void 0 : _a.remove();
|
|
1872
2025
|
try {
|
|
1873
|
-
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() =>
|
|
2026
|
+
const { disableFunctionSpanTracking: e2 } = await Promise.resolve().then(() => N);
|
|
1874
2027
|
e2();
|
|
1875
2028
|
} catch (e2) {
|
|
1876
2029
|
console.error("[Report Issue] Failed to disable function span tracking:", e2);
|
|
@@ -1883,18 +2036,18 @@ async function stopRecording() {
|
|
|
1883
2036
|
t3 && (t3.textContent = "Re-record");
|
|
1884
2037
|
}
|
|
1885
2038
|
const t2 = document.getElementById("sf-recording-timer-label"), n2 = document.getElementById("sf-recording-timer-display");
|
|
1886
|
-
if (t2 && n2 &&
|
|
1887
|
-
const e3 = Math.floor((
|
|
2039
|
+
if (t2 && n2 && fe && ge) {
|
|
2040
|
+
const e3 = Math.floor((ge - fe) / 1e3), i3 = Math.floor(e3 / 60).toString().padStart(2, "0"), o3 = (e3 % 60).toString().padStart(2, "0");
|
|
1888
2041
|
n2.textContent = `${i3}:${o3}`, t2.style.display = "block";
|
|
1889
2042
|
}
|
|
1890
2043
|
const i2 = document.getElementById("sf-issue-description");
|
|
1891
|
-
i2 && (i2.value =
|
|
2044
|
+
i2 && (i2.value = pe.description);
|
|
1892
2045
|
const o2 = document.querySelector('input[value="startnow"]');
|
|
1893
2046
|
o2 && (o2.checked = true);
|
|
1894
|
-
const
|
|
1895
|
-
if (
|
|
1896
|
-
const e3 = Math.floor(((
|
|
1897
|
-
|
|
2047
|
+
const s2 = document.getElementById("sf-inline-record-chip"), r2 = document.getElementById("sf-inline-record-timer");
|
|
2048
|
+
if (s2 && r2) {
|
|
2049
|
+
const e3 = Math.floor(((ge ?? 0) - (fe ?? 0)) / 1e3), t3 = Math.floor(e3 / 60).toString().padStart(2, "0"), n3 = Math.floor(e3 % 60).toString().padStart(2, "0");
|
|
2050
|
+
r2.textContent = `${t3}:${n3}`, r2.style.color = "black", s2.style.display = "flex";
|
|
1898
2051
|
}
|
|
1899
2052
|
const a2 = document.getElementById("sf-issue-submit-btn");
|
|
1900
2053
|
a2.disabled = false, a2.style.opacity = "1", a2.style.cursor = "pointer";
|
|
@@ -1907,10 +2060,10 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1907
2060
|
var _a2, _b;
|
|
1908
2061
|
(_a2 = document.getElementById("sf-report-issue-modal")) == null ? void 0 : _a2.remove(), (_b = document.getElementById("sf-triage-status-modal")) == null ? void 0 : _b.remove();
|
|
1909
2062
|
})();
|
|
1910
|
-
const o2 = !e3 && i2,
|
|
1911
|
-
|
|
2063
|
+
const o2 = !e3 && i2, s2 = n3 ? `${xe.triageBaseUrl}/issues/${n3}?from=inAppReportIssue` : t3 ? `${xe.triageBaseUrl}/triage/${t3}?from=inAppReportIssue` : "", r2 = document.createElement("div");
|
|
2064
|
+
r2.id = "sf-triage-status-modal", Object.assign(r2.style, { position: "fixed", inset: "0", zIndex: "9998", display: "flex", alignItems: "center", justifyContent: "center" });
|
|
1912
2065
|
const a2 = e3 ? "Reporting Issue..." : o2 ? "Failed to report issue" : "Issue reported!", l2 = e3 ? '<p style="font-size:14px; color:#64748b; line-height:20px;">This may take ~10 seconds</p>' : o2 ? `<p style="font-size:14px; color:#ef4444; line-height:20px;">${i2}</p>` : "", c2 = e3 ? '<div style="display:flex; justify-content:center; align-items:center; padding: 40px 0;">\n <div style="width:24px; height:24px; border:2px solid #295dbf; border-top:2px solid white; border-radius:50%; animation:spin 1s linear infinite;"></div>\n </div>' : "", d2 = e3 ? "" : '<div id="sf-copied-status" style="display:none; font-size:12px; font-weight:500; color:white;\n background-color:#22c55e; padding:4px 8px; border-radius:6px; white-space:nowrap; align-items:center; gap:6px;">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21 7.5L9 19.5L3 13.5L5.25 11.25L9 15L18.75 5.25L21 7.5Z" fill="white"/>\n </svg>\n Copied\n </div>';
|
|
1913
|
-
|
|
2066
|
+
r2.innerHTML = `
|
|
1914
2067
|
<div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>
|
|
1915
2068
|
<div id="sf-triage-card"
|
|
1916
2069
|
style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;
|
|
@@ -1951,28 +2104,28 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1951
2104
|
<style>
|
|
1952
2105
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1953
2106
|
</style>
|
|
1954
|
-
`, document.body.appendChild(
|
|
1955
|
-
const u2 =
|
|
2107
|
+
`, document.body.appendChild(r2);
|
|
2108
|
+
const u2 = r2.querySelector("#sf-triage-card");
|
|
1956
2109
|
(_a = document.getElementById("sf-triage-modal-close")) == null ? void 0 : _a.addEventListener("click", () => {
|
|
1957
|
-
fadeCardAndRemove(
|
|
2110
|
+
fadeCardAndRemove(r2, u2, 300);
|
|
1958
2111
|
});
|
|
1959
2112
|
const p2 = document.getElementById("sf-copy-triage-link"), f2 = document.getElementById("sf-view-triage-btn");
|
|
1960
2113
|
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", () => {
|
|
1961
|
-
navigator.clipboard.writeText(
|
|
2114
|
+
navigator.clipboard.writeText(s2).then(() => {
|
|
1962
2115
|
const e4 = document.getElementById("sf-copied-status");
|
|
1963
2116
|
e4 && (e4.style.display = "flex");
|
|
1964
2117
|
});
|
|
1965
2118
|
}), f2.disabled = false, f2.addEventListener("click", () => {
|
|
1966
|
-
(t3 || n3) && window.open(
|
|
1967
|
-
}), o2 || setTimeout(() => fadeCardAndRemove(
|
|
2119
|
+
(t3 || n3) && window.open(s2, "_blank");
|
|
2120
|
+
}), o2 || setTimeout(() => fadeCardAndRemove(r2, u2, 300), 1e4));
|
|
1968
2121
|
})(e2, "triage" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, "issue" === (t2 == null ? void 0 : t2.type) ? t2.id : void 0, n2);
|
|
1969
2122
|
}
|
|
1970
2123
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
1971
2124
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
1972
2125
|
}
|
|
1973
|
-
const
|
|
1974
|
-
|
|
1975
|
-
const t3 = { ...
|
|
2126
|
+
const Ee = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: xe, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
2127
|
+
xe.apiKey = e2.apiKey, xe.backendApi = e2.backendApi, xe.resolveSessionId = e2.getSessionId, xe.integrationData = e2.integrationData || null, xe.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (xe.triageBaseUrl = e2.customBaseUrl), xe.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
2128
|
+
const t3 = { ...ke };
|
|
1976
2129
|
if (!e3) return t3;
|
|
1977
2130
|
"boolean" == typeof e3.enabled && (t3.enabled = e3.enabled);
|
|
1978
2131
|
const n2 = ["openModalExistingMode", "openModalCaptureNewMode", "closeModal", "submitReport", "startRecording", "stopRecording"];
|
|
@@ -1982,54 +2135,55 @@ const ve = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1982
2135
|
}
|
|
1983
2136
|
return t3;
|
|
1984
2137
|
})(e2.shortcuts);
|
|
1985
|
-
const { shortcuts: t2 } =
|
|
2138
|
+
const { shortcuts: t2 } = xe;
|
|
1986
2139
|
window.addEventListener("keydown", (e3) => {
|
|
1987
2140
|
const n2 = (function isTypingInInput() {
|
|
1988
2141
|
const e4 = document.activeElement;
|
|
1989
2142
|
return e4 instanceof HTMLInputElement || e4 instanceof HTMLTextAreaElement || e4 instanceof HTMLElement && e4.isContentEditable;
|
|
1990
|
-
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey,
|
|
2143
|
+
})(), i2 = e3.key.toLowerCase(), o2 = e3.metaKey || e3.ctrlKey, s2 = !!document.getElementById("sf-report-issue-modal"), r2 = !n2 && (t2.enabled || s2), shortcutUsed = (e4) => i2 === t2[e4].key && o2 === t2[e4].requireCmdCtrl, a2 = s2 ? (e4) => {
|
|
1991
2144
|
setActiveTab(e4), updateModeSpecificUI(e4);
|
|
1992
2145
|
} : injectModalHTML;
|
|
1993
|
-
if (
|
|
1994
|
-
if (
|
|
1995
|
-
if (
|
|
1996
|
-
if (
|
|
2146
|
+
if (r2 && shortcutUsed("openModalExistingMode")) return e3.preventDefault(), void a2("lookback");
|
|
2147
|
+
if (r2 && shortcutUsed("openModalCaptureNewMode")) return e3.preventDefault(), void a2("startnow");
|
|
2148
|
+
if (s2 && !he && shortcutUsed("closeModal")) return e3.preventDefault(), void closeModal();
|
|
2149
|
+
if (s2 && shortcutUsed("submitReport")) {
|
|
1997
2150
|
const t3 = document.getElementById("sf-issue-submit-btn");
|
|
1998
2151
|
return void (t3 && !t3.disabled && (e3.preventDefault(), t3.click()));
|
|
1999
2152
|
}
|
|
2000
|
-
if (
|
|
2001
|
-
if (
|
|
2153
|
+
if (he && i2 === t2.stopRecording.key && o2 === t2.stopRecording.requireCmdCtrl) return e3.preventDefault(), void stopRecording();
|
|
2154
|
+
if (s2 && "startnow" === pe.mode && i2 === t2.startRecording.key && o2 === t2.startRecording.requireCmdCtrl && !n2) {
|
|
2002
2155
|
const t3 = document.getElementById("sf-start-recording-btn");
|
|
2003
2156
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
2004
2157
|
}
|
|
2005
2158
|
});
|
|
2006
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
2159
|
+
} }, Symbol.toStringTag, { value: "Module" })), Ce = readDebugFlag(), Me = /* @__PURE__ */ new Map();
|
|
2007
2160
|
function getCachedRegex(e2, t2) {
|
|
2008
2161
|
const n2 = `${e2}|${t2}`;
|
|
2009
|
-
let i2 =
|
|
2010
|
-
return i2 || (i2 = new RegExp(e2, t2),
|
|
2162
|
+
let i2 = Me.get(n2);
|
|
2163
|
+
return i2 || (i2 = new RegExp(e2, t2), Me.set(n2, i2)), i2;
|
|
2011
2164
|
}
|
|
2012
|
-
const
|
|
2165
|
+
const $e = new Set([".js", ".mjs", ".cjs", ".ts", ".css", ".scss", ".sass", ".less", ".styl", ".stylus", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".avif", ".bmp", ".ico", ".tiff", ".tif", ".heic", ".woff", ".woff2", ".ttf", ".otf", ".eot", ".mp4", ".webm", ".ogv", ".mp3", ".wav", ".flac", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".csv", ".json", ".xml", ".txt", ".zip", ".rar", ".gz", ".tar", ".7z", ".map", ".webmanifest"].map((e2) => e2.toLowerCase())), Fe = ["t.co", "*.twitter.com", "*.gravatar.com", "*.googleapis.com", "*.amazonaws.com", "*.smooch.io", "*.zendesk.com", "*.zdassets.com"], Ae = [400, 403], Le = "CORS", Re = "authorization", De = "Authorization", Pe = { recordCanvas: false, recordCrossOriginIframes: false, collectFonts: false, inlineImages: false, recordPassword: false, recordRealName: true, recordCreditCardInfo: false, recordSsn: false, recordDob: false, sampling: {}, enableFiberTracking: false, maskInputSelector: "", maskTextSelector: "", blockSelector: "", unmaskSelector: "", maskInputOptions: { password: true } }, _e = { level: ["info", "log", "warn", "error"], lengthThreshold: 1e4, stringifyOptions: { stringLengthLimit: 1e3, numOfKeysLimit: 20, depthOfLimit: 4 }, logger: "console" };
|
|
2013
2166
|
function maskAuthorizationHeader(e2) {
|
|
2014
|
-
const t2 = e2[
|
|
2167
|
+
const t2 = e2[Re] ? Re : e2[De] ? De : null;
|
|
2015
2168
|
if (!t2) return;
|
|
2016
2169
|
const n2 = e2[t2], i2 = n2.indexOf(" ");
|
|
2017
2170
|
if (-1 !== i2) {
|
|
2018
|
-
const o2 = n2.slice(0, i2 + 1),
|
|
2019
|
-
|
|
2171
|
+
const o2 = n2.slice(0, i2 + 1), s2 = n2.slice(i2 + 1);
|
|
2172
|
+
s2.length > 8 ? e2[t2] = o2 + s2.slice(0, 4) + "*".repeat(s2.length - 8) + s2.slice(-4) : e2[t2] = o2 + "*".repeat(s2.length);
|
|
2020
2173
|
} else n2.length > 8 ? e2[t2] = n2.slice(0, 4) + "*".repeat(n2.length - 8) + n2.slice(-4) : e2[t2] = "*".repeat(n2.length);
|
|
2021
2174
|
}
|
|
2022
2175
|
function trackDomainChangesOnce() {
|
|
2023
2176
|
const e2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2024
2177
|
if (e2.routeWatcherIntervalId) return;
|
|
2025
2178
|
let t2 = window.location.href.split("?")[0];
|
|
2026
|
-
const checkDomainChange = (
|
|
2027
|
-
const
|
|
2028
|
-
if (
|
|
2029
|
-
t2 =
|
|
2030
|
-
const
|
|
2031
|
-
sessionStorage.setItem("pageVisitUUID",
|
|
2032
|
-
|
|
2179
|
+
const checkDomainChange = (n3 = false) => {
|
|
2180
|
+
const i2 = window.location.href.split("?")[0];
|
|
2181
|
+
if (n3 || i2 !== t2) {
|
|
2182
|
+
t2 = i2;
|
|
2183
|
+
const o2 = uuidv4(), s2 = sessionStorage.getItem("pageVisitUUID") ?? "";
|
|
2184
|
+
sessionStorage.setItem("pageVisitUUID", o2), sessionStorage.setItem("prevPageVisitUUID", s2), invalidateUrlCache();
|
|
2185
|
+
const r2 = Date.now();
|
|
2186
|
+
e2.internalDebugLogs && console.log("[sf-recorder] mint pageVisitUUID", { url: i2, newUuid: o2, prevUuid: s2, forceSend: n3, timestamp: r2, stack: new Error().stack }), sendMessage({ type: "routeChange", data: { url: i2, timestamp: r2, page_visit_uuid: o2, prev_page_visit_uuid: s2 } });
|
|
2033
2187
|
}
|
|
2034
2188
|
}, n2 = /* @__PURE__ */ (function debounce(e3, t3) {
|
|
2035
2189
|
let n3;
|
|
@@ -2042,14 +2196,14 @@ function trackDomainChangesOnce() {
|
|
|
2042
2196
|
function sendUserDeviceUuid() {
|
|
2043
2197
|
sendMessage({ type: "userDeviceUuid", userDeviceUuid: (function getOrSetUserDeviceUuid() {
|
|
2044
2198
|
let e2 = null;
|
|
2045
|
-
if (
|
|
2199
|
+
if (m) try {
|
|
2046
2200
|
e2 = localStorage.getItem("sailfishUserDeviceUuid");
|
|
2047
2201
|
} catch {
|
|
2048
2202
|
}
|
|
2049
2203
|
if (!e2) {
|
|
2050
2204
|
e2 = uuidv4();
|
|
2051
2205
|
try {
|
|
2052
|
-
|
|
2206
|
+
m && localStorage.setItem("sailfishUserDeviceUuid", e2);
|
|
2053
2207
|
} catch {
|
|
2054
2208
|
}
|
|
2055
2209
|
}
|
|
@@ -2058,54 +2212,65 @@ function sendUserDeviceUuid() {
|
|
|
2058
2212
|
}
|
|
2059
2213
|
function handleVisibilityChange() {
|
|
2060
2214
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
2061
|
-
"visible" === e2 && getOrSetSessionId();
|
|
2215
|
+
"visible" === e2 && (getOrSetSessionId(), requestTimeSync());
|
|
2062
2216
|
try {
|
|
2063
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
2217
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), Ce && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
2064
2218
|
} catch (e3) {
|
|
2065
2219
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
2066
2220
|
}
|
|
2067
2221
|
sessionStorage.setItem("tabVisibilityChanged", t2.toString()), sessionStorage.setItem("tabVisibilityState", e2), invalidateUrlCache();
|
|
2068
2222
|
}
|
|
2069
2223
|
function clearPageVisitDataFromSessionStorage() {
|
|
2070
|
-
|
|
2224
|
+
h && (sessionStorage.removeItem("pageVisitUUID"), sessionStorage.removeItem("prevPageVisitUUID"), sessionStorage.removeItem("tabVisibilityChanged"), sessionStorage.removeItem("tabVisibilityState"), invalidateUrlCache());
|
|
2071
2225
|
}
|
|
2072
|
-
let
|
|
2226
|
+
let Oe = false;
|
|
2073
2227
|
function _ensureModuleSideEffects() {
|
|
2074
|
-
|
|
2075
|
-
b || (b = true,
|
|
2076
|
-
window.name =
|
|
2228
|
+
Oe || (Oe = true, restoreFuncSpanState(), (function ensureSessionListeners() {
|
|
2229
|
+
b || (b = true, f && window.addEventListener("beforeunload", () => {
|
|
2230
|
+
window.name = S + window.name;
|
|
2077
2231
|
}));
|
|
2078
|
-
})(),
|
|
2232
|
+
})(), f && (sendUserDeviceUuid(), (function sendTimeZone() {
|
|
2079
2233
|
sendMessage({ type: "timeZone", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
|
|
2080
|
-
})()),
|
|
2234
|
+
})()), g && document.addEventListener("visibilitychange", handleVisibilityChange), f && (window.addEventListener("beforeunload", () => {
|
|
2081
2235
|
clearPageVisitDataFromSessionStorage();
|
|
2082
|
-
}))
|
|
2236
|
+
}), window.addEventListener("online", () => {
|
|
2237
|
+
requestTimeSync();
|
|
2238
|
+
})));
|
|
2083
2239
|
}
|
|
2084
2240
|
function matchParsedUrlAgainstPatterns(e2, t2) {
|
|
2085
|
-
const { hostname: n2, pathname: i2, port: o2 } = e2,
|
|
2241
|
+
const { hostname: n2, pathname: i2, port: o2 } = e2, s2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
|
|
2086
2242
|
return t2.some((e3) => {
|
|
2087
2243
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2088
|
-
let [n3,
|
|
2244
|
+
let [n3, r2] = t3.split("/", 2), a2 = "";
|
|
2089
2245
|
n3.includes(":") && ([n3, a2] = n3.split(":"));
|
|
2090
|
-
const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 =
|
|
2246
|
+
const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = s2.startsWith("www.") ? s2.slice(4) : s2;
|
|
2091
2247
|
if (a2 && "*" !== a2 && o2 !== a2) return false;
|
|
2092
2248
|
if (n3.startsWith("*.")) {
|
|
2093
2249
|
const e4 = n3.slice(2).toLowerCase();
|
|
2094
|
-
if (!(
|
|
2095
|
-
if (
|
|
2096
|
-
return getCachedRegex(`^/${
|
|
2250
|
+
if (!(s2 === e4 || c2 === e4 || s2.endsWith("." + e4))) return false;
|
|
2251
|
+
if (r2) {
|
|
2252
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2097
2253
|
}
|
|
2098
2254
|
return true;
|
|
2099
2255
|
}
|
|
2100
|
-
if (!l2.test(c2) && !l2.test(
|
|
2101
|
-
if (
|
|
2102
|
-
return getCachedRegex(`^/${
|
|
2256
|
+
if (!l2.test(c2) && !l2.test(s2)) return false;
|
|
2257
|
+
if (r2) {
|
|
2258
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2103
2259
|
}
|
|
2104
2260
|
return true;
|
|
2105
2261
|
});
|
|
2106
2262
|
}
|
|
2263
|
+
function toAbsoluteUrl(e2) {
|
|
2264
|
+
if ("string" != typeof e2 || 0 === e2.length) return e2;
|
|
2265
|
+
try {
|
|
2266
|
+
const t2 = "undefined" != typeof window ? window.location.href : "http://localhost/";
|
|
2267
|
+
return new URL(e2, t2).href;
|
|
2268
|
+
} catch {
|
|
2269
|
+
return e2;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2107
2272
|
function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
2108
|
-
const n2 = [...
|
|
2273
|
+
const n2 = [...Fe, ...e2], i2 = t2.length > 0;
|
|
2109
2274
|
return function shouldSkipHeadersPropagation(e3) {
|
|
2110
2275
|
let o2;
|
|
2111
2276
|
try {
|
|
@@ -2113,12 +2278,12 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2113
2278
|
} catch {
|
|
2114
2279
|
return true;
|
|
2115
2280
|
}
|
|
2116
|
-
const
|
|
2117
|
-
return !(-1 ===
|
|
2281
|
+
const s2 = o2.pathname.toLowerCase(), r2 = s2.lastIndexOf(".");
|
|
2282
|
+
return !(-1 === r2 || !$e.has(s2.slice(r2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2118
2283
|
};
|
|
2119
2284
|
}
|
|
2120
2285
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
|
|
2121
|
-
const o2 = window.fetch,
|
|
2286
|
+
const o2 = window.fetch, s2 = getOrSetSessionId(), r2 = createSkipHeadersPropagationChecker(e2, i2), a2 = ["text/event-stream", "application/x-ndjson", "application/stream+json", "application/grpc", "application/grpc-web"], l2 = ["application/octet-stream"];
|
|
2122
2287
|
window.fetch = new Proxy(o2, { apply: async (e3, i3, o3) => {
|
|
2123
2288
|
let c2, d2 = o3[0], u2 = o3[1] || {};
|
|
2124
2289
|
if ("string" == typeof d2) c2 = d2;
|
|
@@ -2127,113 +2292,115 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2127
2292
|
if (!(d2 instanceof URL)) return e3.apply(i3, o3);
|
|
2128
2293
|
c2 = d2.href;
|
|
2129
2294
|
}
|
|
2130
|
-
return
|
|
2295
|
+
return r2(c2) ? e3.apply(i3, o3) : (async function injectHeaderWrapper(e4, i4, o4, s3, r3, c3, d3) {
|
|
2131
2296
|
var _a, _b;
|
|
2132
2297
|
if (!c3) return e4.apply(i4, o4);
|
|
2133
2298
|
let u3 = uuidv4();
|
|
2134
|
-
const p2 = getUrlAndStoredUuids(), f2 =
|
|
2299
|
+
const p2 = getUrlAndStoredUuids(), f2 = r3.method || "GET", g2 = Date.now();
|
|
2135
2300
|
let m2, h2 = {}, y2 = null;
|
|
2136
2301
|
try {
|
|
2137
|
-
if (
|
|
2138
|
-
|
|
2302
|
+
if (s3 instanceof Request) {
|
|
2303
|
+
s3.headers.forEach((e5, t3) => {
|
|
2139
2304
|
h2[t3] = e5;
|
|
2140
2305
|
});
|
|
2141
2306
|
try {
|
|
2142
|
-
y2 =
|
|
2307
|
+
y2 = s3.clone();
|
|
2143
2308
|
} catch (e5) {
|
|
2144
2309
|
y2 = null;
|
|
2145
2310
|
}
|
|
2146
|
-
} else
|
|
2311
|
+
} else r3.headers && (r3.headers instanceof Headers ? r3.headers.forEach((e5, t3) => {
|
|
2147
2312
|
h2[t3] = e5;
|
|
2148
|
-
}) : Array.isArray(
|
|
2313
|
+
}) : Array.isArray(r3.headers) ? r3.headers.forEach(([e5, t3]) => {
|
|
2149
2314
|
h2[e5] = t3;
|
|
2150
|
-
}) : h2 = { ...
|
|
2315
|
+
}) : h2 = { ...r3.headers }), m2 = r3.body;
|
|
2151
2316
|
} catch (e5) {
|
|
2152
|
-
|
|
2317
|
+
Ce && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2153
2318
|
}
|
|
2154
2319
|
delete h2[n];
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2157
|
-
const
|
|
2158
|
-
h2[n] =
|
|
2320
|
+
const S2 = getFuncSpanHeader();
|
|
2321
|
+
S2 && delete h2[S2.name];
|
|
2322
|
+
const v2 = `${c3}/${p2.page_visit_uuid}/${u3}`;
|
|
2323
|
+
h2[n] = v2, S2 && (h2[S2.name] = S2.value);
|
|
2159
2324
|
maskAuthorizationHeader(h2);
|
|
2160
2325
|
try {
|
|
2161
|
-
let
|
|
2326
|
+
let S3 = await (async function injectHeader(e5, t3, i5, o5, s4, r4, a3) {
|
|
2162
2327
|
const l3 = getFuncSpanHeader();
|
|
2163
2328
|
if (i5 instanceof Request) {
|
|
2164
2329
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
2165
|
-
d4.set(n, `${
|
|
2330
|
+
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), Ce && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
|
|
2166
2331
|
const u4 = new Request(c4, { headers: d4 });
|
|
2167
2332
|
return await e5.call(t3, u4, o5);
|
|
2168
2333
|
}
|
|
2169
2334
|
{
|
|
2170
2335
|
const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2171
|
-
return d4.set(n, `${
|
|
2336
|
+
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), Ce && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l3.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
2172
2337
|
}
|
|
2173
|
-
})(e4, i4,
|
|
2174
|
-
|
|
2338
|
+
})(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3), v3 = false;
|
|
2339
|
+
Ae.includes(S3.status) && (Ce && console.log("Perform retry as status was fail:", S3), delete h2[n], S3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
|
|
2175
2340
|
try {
|
|
2176
|
-
let o6 = i5[0],
|
|
2341
|
+
let o6 = i5[0], s4 = i5[1] || {};
|
|
2177
2342
|
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
2178
|
-
const i6 = { ...
|
|
2179
|
-
|
|
2343
|
+
const i6 = { ...s4 }, r4 = new Headers(s4.headers || {});
|
|
2344
|
+
r4.delete(n), i6.headers = r4;
|
|
2180
2345
|
return await e5.call(t3, o6, i6);
|
|
2181
2346
|
}
|
|
2182
2347
|
if (o6 instanceof Request) {
|
|
2183
|
-
const i6 = o6.clone(),
|
|
2184
|
-
|
|
2185
|
-
const a3 = new Request(i6, { headers:
|
|
2186
|
-
return await e5.call(t3, a3,
|
|
2348
|
+
const i6 = o6.clone(), r4 = new Headers(i6.headers);
|
|
2349
|
+
r4.delete(n);
|
|
2350
|
+
const a3 = new Request(i6, { headers: r4 });
|
|
2351
|
+
return await e5.call(t3, a3, s4);
|
|
2187
2352
|
}
|
|
2188
2353
|
return e5.apply(t3, i5);
|
|
2189
2354
|
} catch (e6) {
|
|
2190
|
-
throw
|
|
2355
|
+
throw Ce && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
|
|
2191
2356
|
}
|
|
2192
|
-
})(e4, i4, o4, d3),
|
|
2193
|
-
const
|
|
2194
|
-
|
|
2357
|
+
})(e4, i4, o4, d3), v3 = true);
|
|
2358
|
+
const b2 = Date.now(), w2 = (function captureClientTime() {
|
|
2359
|
+
return { wallTimeMs: Date.now(), monotonicMs: monotonicNow(), timeOriginMs: timeOriginMs() };
|
|
2360
|
+
})(), k2 = S3.status, x2 = S3.ok, I2 = x2 ? "" : `Request Error: ${S3.statusText}`;
|
|
2361
|
+
let T2 = null;
|
|
2195
2362
|
try {
|
|
2196
|
-
|
|
2197
|
-
|
|
2363
|
+
T2 = {}, S3.headers.forEach((e5, t3) => {
|
|
2364
|
+
T2[t3] = e5;
|
|
2198
2365
|
});
|
|
2199
2366
|
} catch (e5) {
|
|
2200
|
-
|
|
2367
|
+
Ce && console.warn("[Sailfish] Failed to capture response headers:", e5), T2 = null;
|
|
2201
2368
|
}
|
|
2202
|
-
const
|
|
2203
|
-
|
|
2204
|
-
|
|
2369
|
+
const E2 = { type: 27, timestamp: b2, sessionId: c3, client: w2, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: b2, response_code: k2, success: x2, error: I2, method: f2, url: toAbsoluteUrl(d3), retry_without_trace_id: v3, request_headers: h2, request_body: m2, response_headers: T2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2370
|
+
E2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2371
|
+
E2.data.request_body = e6, sendEvent(E2);
|
|
2205
2372
|
}, () => {
|
|
2206
|
-
sendEvent(
|
|
2207
|
-
}) : sendEvent(
|
|
2208
|
-
},
|
|
2373
|
+
sendEvent(E2);
|
|
2374
|
+
}) : sendEvent(E2);
|
|
2375
|
+
}, C2 = 1024 * t2.captureResponseBodyMaxMb * 1024;
|
|
2209
2376
|
if (0 === t2.captureResponseBodyMaxMb) sendEventWithBody(null);
|
|
2210
2377
|
else if ((function shouldSkipBodyCapture(e5) {
|
|
2211
2378
|
const t3 = e5.headers.get("content-type");
|
|
2212
2379
|
if (!t3) return false;
|
|
2213
2380
|
const n2 = t3.toLowerCase();
|
|
2214
2381
|
return l2.some((e6) => n2.includes(e6));
|
|
2215
|
-
})(
|
|
2382
|
+
})(S3)) sendEventWithBody(null);
|
|
2216
2383
|
else if ((function isStreamingResponse(e5) {
|
|
2217
2384
|
const t3 = e5.headers.get("content-type");
|
|
2218
2385
|
if (!t3) return false;
|
|
2219
2386
|
const n2 = t3.toLowerCase();
|
|
2220
2387
|
return a2.some((e6) => n2.includes(e6));
|
|
2221
|
-
})(
|
|
2388
|
+
})(S3)) if (t2.captureStreamingResponseBody) try {
|
|
2222
2389
|
(async function readStreamPrefix(e5, t3, n2) {
|
|
2223
2390
|
const i5 = e5.body;
|
|
2224
2391
|
if (!i5) return null;
|
|
2225
|
-
const o5 = i5.getReader(),
|
|
2392
|
+
const o5 = i5.getReader(), s4 = new TextDecoder(), r4 = [];
|
|
2226
2393
|
let a3 = 0;
|
|
2227
2394
|
const readWithLimit = async () => {
|
|
2228
2395
|
try {
|
|
2229
2396
|
for (; a3 < t3; ) {
|
|
2230
2397
|
const { done: e6, value: t4 } = await o5.read();
|
|
2231
2398
|
if (e6) break;
|
|
2232
|
-
a3 += t4.byteLength,
|
|
2399
|
+
a3 += t4.byteLength, r4.push(s4.decode(t4, { stream: true }));
|
|
2233
2400
|
}
|
|
2234
|
-
return
|
|
2401
|
+
return r4.push(s4.decode()), r4.join("");
|
|
2235
2402
|
} catch {
|
|
2236
|
-
return
|
|
2403
|
+
return r4.length > 0 ? r4.join("") : null;
|
|
2237
2404
|
} finally {
|
|
2238
2405
|
try {
|
|
2239
2406
|
o5.cancel();
|
|
@@ -2247,7 +2414,7 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2247
2414
|
o5.cancel();
|
|
2248
2415
|
} catch {
|
|
2249
2416
|
}
|
|
2250
|
-
e6(
|
|
2417
|
+
e6(r4.length > 0 ? r4.join("") : null);
|
|
2251
2418
|
}, n2))]);
|
|
2252
2419
|
} catch {
|
|
2253
2420
|
try {
|
|
@@ -2256,40 +2423,40 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2256
2423
|
}
|
|
2257
2424
|
return null;
|
|
2258
2425
|
}
|
|
2259
|
-
})(
|
|
2426
|
+
})(S3.clone(), 1024 * t2.captureStreamPrefixKb, t2.captureStreamTimeoutMs).then((e5) => sendEventWithBody(e5), () => sendEventWithBody(null));
|
|
2260
2427
|
} catch {
|
|
2261
2428
|
sendEventWithBody(null);
|
|
2262
2429
|
}
|
|
2263
2430
|
else sendEventWithBody(null);
|
|
2264
2431
|
else {
|
|
2265
|
-
const e5 =
|
|
2266
|
-
if (!isNaN(t3) && t3 >
|
|
2432
|
+
const e5 = S3.headers.get("content-length"), t3 = e5 ? parseInt(e5, 10) : NaN;
|
|
2433
|
+
if (!isNaN(t3) && t3 > C2) sendEventWithBody(null);
|
|
2267
2434
|
else try {
|
|
2268
|
-
|
|
2269
|
-
e6.length >
|
|
2435
|
+
S3.clone().text().then((e6) => {
|
|
2436
|
+
e6.length > C2 ? sendEventWithBody(null) : sendEventWithBody(e6);
|
|
2270
2437
|
}, () => sendEventWithBody(null));
|
|
2271
2438
|
} catch {
|
|
2272
2439
|
sendEventWithBody(null);
|
|
2273
2440
|
}
|
|
2274
2441
|
}
|
|
2275
|
-
return
|
|
2442
|
+
return S3;
|
|
2276
2443
|
} catch (t3) {
|
|
2277
|
-
const n2 = Date.now(),
|
|
2278
|
-
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(
|
|
2444
|
+
const n2 = Date.now(), s4 = false, r4 = ((_a = t3.response) == null ? void 0 : _a.status) || 500, a3 = t3.message || "Fetch request failed";
|
|
2445
|
+
if (t3 instanceof TypeError && ((_b = t3 == null ? void 0 : t3.message) == null ? void 0 : _b.toLowerCase().includes(Le.toLowerCase()))) return e4.apply(i4, o4);
|
|
2279
2446
|
let l3 = m2;
|
|
2280
2447
|
if (y2) try {
|
|
2281
2448
|
l3 = await y2.text();
|
|
2282
2449
|
} catch {
|
|
2283
2450
|
l3 = null;
|
|
2284
2451
|
}
|
|
2285
|
-
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code:
|
|
2452
|
+
throw sendEvent({ type: 27, timestamp: n2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: n2, response_code: r4, success: s4, error: a3, method: f2, url: toAbsoluteUrl(d3), request_headers: h2, request_body: l3, response_body: null }, ...p2 }), t3;
|
|
2286
2453
|
}
|
|
2287
|
-
})(e3, i3, o3, d2, u2,
|
|
2454
|
+
})(e3, i3, o3, d2, u2, s2, c2);
|
|
2288
2455
|
} });
|
|
2289
2456
|
}
|
|
2290
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion:
|
|
2457
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: g2 = false, deferRecording: m2, deferRecordingStart: y2, chunkSnapshot: S2, useWsWorker: v2 = true, capturePerformanceMetrics: b2 = true, maskTextClass: w2, maskInputSelector: k2, maskTextSelector: x2, blockSelector: I2, unmaskSelector: T2, maskInputOptions: E2, library: C2, headlessRecording: M2 = false }) {
|
|
2291
2458
|
var _a, _b;
|
|
2292
|
-
if (!
|
|
2459
|
+
if (!M2 && (function isHeadlessOrLighthouse() {
|
|
2293
2460
|
try {
|
|
2294
2461
|
if ("undefined" == typeof navigator) return false;
|
|
2295
2462
|
const e3 = navigator;
|
|
@@ -2300,20 +2467,20 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2300
2467
|
return false;
|
|
2301
2468
|
}
|
|
2302
2469
|
})()) return;
|
|
2303
|
-
const
|
|
2304
|
-
if (
|
|
2305
|
-
const
|
|
2306
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()),
|
|
2307
|
-
const o3 = XMLHttpRequest.prototype.open,
|
|
2470
|
+
const $2 = m2 ?? y2 ?? true, F2 = getOrSetSessionId(), A2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2471
|
+
if (A2.sessionId = F2, A2.apiKey = e2, A2.backendApi = t2, A2.serviceAdditionalMetadata = l2, A2.initialized && A2.sessionId === F2 && A2.ws && 1 === A2.ws.readyState) return void trackDomainChangesOnce();
|
|
2472
|
+
const L2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2473
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), A2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
|
|
2474
|
+
const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
|
|
2308
2475
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2309
|
-
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4,
|
|
2476
|
+
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
|
|
2310
2477
|
}, XMLHttpRequest.prototype.open = function(e4, t4, ...n2) {
|
|
2311
2478
|
return this._requestUrl = "string" == typeof t4 && t4.length > 0 ? t4 : null, this._requestMethod = e4, this._capturedRequestHeaders = {}, o3.apply(this, [e4, t4, ...n2]);
|
|
2312
2479
|
}, XMLHttpRequest.prototype.send = function(...e4) {
|
|
2313
2480
|
const i4 = this._requestUrl;
|
|
2314
|
-
if (!i4) return
|
|
2315
|
-
if (l3(i4)) return
|
|
2316
|
-
const o4 = sessionStorage.getItem("pageVisitUUID"),
|
|
2481
|
+
if (!i4) return s3.apply(this, e4);
|
|
2482
|
+
if (l3(i4)) return s3.apply(this, e4);
|
|
2483
|
+
const o4 = sessionStorage.getItem("pageVisitUUID"), r4 = uuidv4(), c3 = `${a3}/${o4}/${r4}`;
|
|
2317
2484
|
try {
|
|
2318
2485
|
this.setRequestHeader(n, c3);
|
|
2319
2486
|
} catch (e5) {
|
|
@@ -2321,19 +2488,19 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2321
2488
|
}
|
|
2322
2489
|
const d3 = getFuncSpanHeader();
|
|
2323
2490
|
if (d3) try {
|
|
2324
|
-
this.setRequestHeader(d3.name, d3.value),
|
|
2491
|
+
this.setRequestHeader(d3.name, d3.value), Ce && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: i4, header: d3.name });
|
|
2325
2492
|
} catch (e5) {
|
|
2326
|
-
|
|
2493
|
+
Ce && console.warn(`[Sailfish] Could not set funcspan header for ${i4}`, e5);
|
|
2327
2494
|
}
|
|
2328
2495
|
const u3 = Date.now();
|
|
2329
2496
|
let p3 = false;
|
|
2330
|
-
const f3 = e4[0],
|
|
2331
|
-
maskAuthorizationHeader(
|
|
2332
|
-
const emitFinished = (e5, t4, n2, o5,
|
|
2497
|
+
const f3 = e4[0], g3 = { ...this._capturedRequestHeaders };
|
|
2498
|
+
maskAuthorizationHeader(g3);
|
|
2499
|
+
const emitFinished = (e5, t4, n2, o5, s4) => {
|
|
2333
2500
|
if (p3) return;
|
|
2334
2501
|
p3 = true;
|
|
2335
2502
|
const l4 = Date.now();
|
|
2336
|
-
sendEvent({ type: 27, timestamp: l4, sessionId: a3, data: { request_id:
|
|
2503
|
+
sendEvent({ type: 27, timestamp: l4, sessionId: a3, data: { request_id: r4, session_id: a3, timestamp_start: u3, timestamp_end: l4, response_code: t4, success: e5, error: n2, method: this._requestMethod, url: toAbsoluteUrl(i4), request_headers: g3, request_body: f3, response_headers: s4, response_body: o5 }, ...getUrlAndStoredUuids() });
|
|
2337
2504
|
};
|
|
2338
2505
|
return this.addEventListener("load", () => {
|
|
2339
2506
|
const e5 = this.status || 0;
|
|
@@ -2356,7 +2523,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2356
2523
|
2 === t4.length && (i5[t4[0]] = t4[1]);
|
|
2357
2524
|
});
|
|
2358
2525
|
} catch (e6) {
|
|
2359
|
-
|
|
2526
|
+
Ce && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
|
|
2360
2527
|
}
|
|
2361
2528
|
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n2, i5);
|
|
2362
2529
|
else {
|
|
@@ -2366,24 +2533,24 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2366
2533
|
}, { once: true }), this.addEventListener("error", () => {
|
|
2367
2534
|
const e5 = this.status || 0, t4 = 0 === e5 ? "Network or CORS failure" : this.statusText || `Error ${e5}`;
|
|
2368
2535
|
emitFinished(false, e5, t4);
|
|
2369
|
-
}, { once: true }),
|
|
2536
|
+
}, { once: true }), s3.apply(this, e4);
|
|
2370
2537
|
};
|
|
2371
|
-
})(o2,
|
|
2538
|
+
})(o2, L2, i2), A2.xhrPatched = true), A2.fetchPatched || (setupFetchInterceptor(o2, L2, i2), A2.fetchPatched = true), await yieldToMain(), A2.domEventsInit || (initializeDomContentEvents(F2), A2.domEventsInit = true), await yieldToMain(), A2.consoleInit || (initializeConsolePlugin(_e, F2), A2.consoleInit = true), await yieldToMain(), A2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2372
2539
|
window.addEventListener("error", (e3) => {
|
|
2373
2540
|
captureError(e3.error ?? e3.message, false, { filename: e3.filename, lineno: e3.lineno, colno: e3.colno });
|
|
2374
2541
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2375
2542
|
captureError(e3.reason, true);
|
|
2376
2543
|
});
|
|
2377
|
-
})(),
|
|
2378
|
-
|
|
2379
|
-
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() ||
|
|
2544
|
+
})(), A2.errorInit = true), await yieldToMain(), !A2.perfInit && b2 && (initializePerformancePlugin(F2), A2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2545
|
+
h && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2546
|
+
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || A2.ws && 1 === A2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2380
2547
|
var _a2;
|
|
2381
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
2548
|
+
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? Ce && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), Ce && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
2382
2549
|
}).catch((e3) => {
|
|
2383
|
-
|
|
2384
|
-
}),
|
|
2550
|
+
Ce && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
2551
|
+
}), A2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...Fe], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), A2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
|
|
2385
2552
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2386
|
-
})(), c2 && fetchAndSendIp(
|
|
2553
|
+
})(), c2 && fetchAndSendIp(F2);
|
|
2387
2554
|
try {
|
|
2388
2555
|
const n2 = a2 ?? (function readGitSha() {
|
|
2389
2556
|
var _a2;
|
|
@@ -2402,7 +2569,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2402
2569
|
if ("string" == typeof e3 && e3) return e3;
|
|
2403
2570
|
} catch {
|
|
2404
2571
|
}
|
|
2405
|
-
})(), i3 =
|
|
2572
|
+
})(), i3 = r2 ?? "", o3 = s2 ?? "", c3 = C2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
|
|
2406
2573
|
try {
|
|
2407
2574
|
const e3 = window;
|
|
2408
2575
|
if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
|
|
@@ -2415,47 +2582,49 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2415
2582
|
} catch {
|
|
2416
2583
|
}
|
|
2417
2584
|
const n3 = t3, i4 = [];
|
|
2418
|
-
for (const e4 of
|
|
2585
|
+
for (const e4 of ce) {
|
|
2419
2586
|
const t4 = e4(n3);
|
|
2420
2587
|
t4 && !i4.includes(t4) && i4.push(t4);
|
|
2421
2588
|
}
|
|
2422
2589
|
return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
|
|
2423
2590
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2424
2591
|
await yieldToMain();
|
|
2425
|
-
const [
|
|
2426
|
-
if (
|
|
2427
|
-
if ((_b =
|
|
2592
|
+
const [m3, h2] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, F2, t2, i3, o3, d3, n2, c3, f3)]), y3 = { ...Pe, ...(_a = m3.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: g2, ...void 0 !== w2 ? { maskTextClass: w2 } : {}, ...void 0 !== k2 ? { maskInputSelector: k2 } : {}, ...void 0 !== x2 ? { maskTextSelector: x2 } : {}, ...void 0 !== I2 ? { blockSelector: I2 } : {}, ...void 0 !== T2 ? { unmaskSelector: T2 } : {}, ...void 0 !== E2 ? { maskInputOptions: E2 } : {} };
|
|
2593
|
+
if (A2.ws && 1 === A2.ws.readyState) return;
|
|
2594
|
+
if ((_b = h2.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2428
2595
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2429
2596
|
await yieldToMain();
|
|
2430
|
-
const i4 = await initializeRecording(y3, t2, e2,
|
|
2431
|
-
|
|
2597
|
+
const i4 = await initializeRecording(y3, t2, e2, F2, n3, $2, v2, S2 ?? false);
|
|
2598
|
+
A2.ws = i4, A2.initialized = true, trackDomainChangesOnce(), A2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2432
2599
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2433
|
-
})(
|
|
2434
|
-
} else console.error("Failed to start recording session:",
|
|
2600
|
+
})(r2, s2), A2.sentMapUuidOnce = true);
|
|
2601
|
+
} else console.error("Failed to start recording session:", h2.errors || h2);
|
|
2435
2602
|
} catch (e3) {
|
|
2436
2603
|
console.error("Error starting recording:", e3);
|
|
2437
2604
|
}
|
|
2438
2605
|
}
|
|
2439
|
-
exports.DEFAULT_CAPTURE_SETTINGS =
|
|
2606
|
+
exports.DEFAULT_CAPTURE_SETTINGS = Pe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = _e, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
2440
2607
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2441
|
-
|
|
2608
|
+
H && JSON.stringify(H) === JSON.stringify(e2) || (H = e2, sendMessage(t2));
|
|
2442
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) {
|
|
2443
2610
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2444
|
-
|
|
2611
|
+
z && z.userId === e2 && JSON.stringify(z.traits) === JSON.stringify(t2) || (z = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2445
2612
|
}, exports.initRecorder = async (e2) => {
|
|
2446
2613
|
if ("undefined" == typeof window) return;
|
|
2447
|
-
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {})
|
|
2614
|
+
const t2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2615
|
+
t2.internalDebugLogs = true === e2.enableInternalDebugLogs;
|
|
2616
|
+
const n2 = getOrSetSessionId();
|
|
2448
2617
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2449
2618
|
try {
|
|
2450
2619
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2451
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData:
|
|
2452
|
-
let
|
|
2620
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => Ee), Promise.resolve().then(() => we)]);
|
|
2621
|
+
let r2 = null;
|
|
2453
2622
|
try {
|
|
2454
|
-
await o2(e2.apiKey, n3),
|
|
2623
|
+
await o2(e2.apiKey, n3), r2 = s2();
|
|
2455
2624
|
} catch (e3) {
|
|
2456
2625
|
console.warn("[Sailfish] Failed to fetch integration data for issue reporting:", e3);
|
|
2457
2626
|
}
|
|
2458
|
-
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData:
|
|
2627
|
+
i2({ apiKey: e2.apiKey, backendApi: n3, getSessionId: () => getOrSetSessionId(), shortcuts: e2.reportIssueShortcuts, customBaseUrl: e2.customBaseUrl, integrationData: r2, showEngTicketFieldsInReportIssueModalDefault: e2.showEngTicketFieldsInReportIssueModalDefault }), t2.issueReportingInit = true;
|
|
2459
2628
|
}
|
|
2460
2629
|
} catch (e3) {
|
|
2461
2630
|
console.warn("[Sailfish] Recorder initialization failed:", e3);
|
|
@@ -2463,7 +2632,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2463
2632
|
})().finally(() => {
|
|
2464
2633
|
delete t2.initPromise;
|
|
2465
2634
|
})), t2.initPromise);
|
|
2466
|
-
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
|
|
2635
|
+
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.maskInputFn = maskInputFn, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
|
|
2467
2636
|
let n2, i2;
|
|
2468
2637
|
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;
|
|
2469
2638
|
try {
|
|
@@ -2473,6 +2642,6 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2473
2642
|
return false;
|
|
2474
2643
|
}
|
|
2475
2644
|
return matchParsedUrlAgainstPatterns(i2, t2);
|
|
2476
|
-
}, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.trackingEvent = function trackingEvent(e2) {
|
|
2645
|
+
}, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.requestTimeSync = requestTimeSync, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.toAbsoluteUrl = toAbsoluteUrl, exports.trackingEvent = function trackingEvent(e2) {
|
|
2477
2646
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
2478
2647
|
}, exports.withAppUrlMetadata = withAppUrlMetadata, exports.yieldToMain = yieldToMain;
|