@launchdarkly/o11y 1.3.1 → 1.4.0
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/CHANGELOG.md +15 -0
- package/dist/LDObserve-BQr7RYVC.js +130 -0
- package/dist/LDObserve-BQr7RYVC.js.map +1 -0
- package/dist/LDObserve.d.ts +73 -1
- package/dist/LDObserve.js +2 -2
- package/dist/LDRecord.d.ts +73 -1
- package/dist/LDRecord.js +43 -24
- package/dist/LDRecord.js.map +1 -1
- package/dist/buffer-CwCRPuMA.js +248 -0
- package/dist/buffer-CwCRPuMA.js.map +1 -0
- package/dist/{common-BjaGmQrE.js → common-7gIdCuSo.js} +721 -689
- package/dist/{common-BjaGmQrE.js.map → common-7gIdCuSo.js.map} +1 -1
- package/dist/index.d.ts +103 -5
- package/dist/index.js +335 -365
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +112 -112
- package/dist/index.umd.js.map +1 -1
- package/dist/{observe-D78YYNE1.js → observe-DVzqBVcI.js} +2053 -2043
- package/dist/{observe-D78YYNE1.js.map → observe-DVzqBVcI.js.map} +1 -1
- package/dist/observe.d.ts +21 -1
- package/dist/observe.js +4 -4
- package/dist/{record-BZHDLKsW.js → record-CwkFdJT0.js} +38 -47
- package/dist/{record-BZHDLKsW.js.map → record-CwkFdJT0.js.map} +1 -1
- package/dist/record.d.ts +24 -2
- package/dist/record.js +3 -3
- package/package.json +1 -1
- package/dist/LDObserve-DhF3vCDR.js +0 -92
- package/dist/LDObserve-DhF3vCDR.js.map +0 -1
- package/dist/buffer-BjzLorpP.js +0 -124
- package/dist/buffer-BjzLorpP.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
var Ge = Object.defineProperty, je = Object.defineProperties;
|
|
2
2
|
var Je = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var V = Object.getOwnPropertySymbols;
|
|
4
|
-
var me = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
6
|
-
throw TypeError(
|
|
4
|
+
var me = Object.prototype.hasOwnProperty, we = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var pe = (s) => {
|
|
6
|
+
throw TypeError(s);
|
|
7
7
|
};
|
|
8
|
-
var G = (
|
|
8
|
+
var G = (s, e, t) => e in s ? Ge(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, p = (s, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
me.call(e, t) && G(
|
|
10
|
+
me.call(e, t) && G(s, t, e[t]);
|
|
11
11
|
if (V)
|
|
12
12
|
for (var t of V(e))
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
}, y = (
|
|
16
|
-
var j = (
|
|
13
|
+
we.call(e, t) && G(s, t, e[t]);
|
|
14
|
+
return s;
|
|
15
|
+
}, y = (s, e) => je(s, Je(e));
|
|
16
|
+
var j = (s, e) => {
|
|
17
17
|
var t = {};
|
|
18
|
-
for (var
|
|
19
|
-
me.call(
|
|
20
|
-
if (
|
|
21
|
-
for (var
|
|
22
|
-
e.indexOf(
|
|
18
|
+
for (var i in s)
|
|
19
|
+
me.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
|
|
20
|
+
if (s != null && V)
|
|
21
|
+
for (var i of V(s))
|
|
22
|
+
e.indexOf(i) < 0 && we.call(s, i) && (t[i] = s[i]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var a = (
|
|
26
|
-
var ye = (
|
|
27
|
-
var
|
|
25
|
+
var a = (s, e, t) => G(s, typeof e != "symbol" ? e + "" : e, t), Se = (s, e, t) => e.has(s) || pe("Cannot " + t);
|
|
26
|
+
var ye = (s, e, t) => (Se(s, e, "read from private field"), t ? t.call(s) : e.get(s)), be = (s, e, t) => e.has(s) ? pe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), ke = (s, e, t, i) => (Se(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t);
|
|
27
|
+
var R = (s, e, t) => new Promise((i, n) => {
|
|
28
28
|
var o = (d) => {
|
|
29
29
|
try {
|
|
30
30
|
l(t.next(d));
|
|
@@ -37,21 +37,21 @@ var _ = (i, e, t) => new Promise((s, n) => {
|
|
|
37
37
|
} catch (c) {
|
|
38
38
|
n(c);
|
|
39
39
|
}
|
|
40
|
-
}, l = (d) => d.done ?
|
|
41
|
-
l((t = t.apply(
|
|
40
|
+
}, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(o, r);
|
|
41
|
+
l((t = t.apply(s, e)).next());
|
|
42
42
|
});
|
|
43
|
-
import { W as Qe, M as
|
|
44
|
-
import { R as
|
|
45
|
-
import { s as K, G as
|
|
46
|
-
import { X as Lt, F as
|
|
47
|
-
import { O as
|
|
48
|
-
import { L as
|
|
49
|
-
import { g as Pe } from "./LDObserve-
|
|
50
|
-
import { L as
|
|
51
|
-
import { LDRecord as
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
window._highlightWebSocketRequestCallback =
|
|
43
|
+
import { W as Qe, M as L, r as J, I as ve, a as Re, S as Ye, C as Xe, F as Ze, b as et, P as tt, c as _e, g as st, p as it, d as nt, e as rt, f as ot, h as at, s as ct, i as lt } from "./record-CwkFdJT0.js";
|
|
44
|
+
import { R as ds } from "./record-CwkFdJT0.js";
|
|
45
|
+
import { s as K, G as T, g as F, S as E, r as De, a as Q, b as dt, c as ht, d as Y, e as X, f as W, F as Ie, V as gt, P as ut, h as ft, H as Z, M as mt, i as wt, L as We, j as ze, k as pt, p as St, l as Ce, m as Le, n as yt, o as bt, q as kt, t as vt, u as Rt, v as _t, w as Dt, x as It, y as Ct } from "./common-7gIdCuSo.js";
|
|
46
|
+
import { X as Lt, F as Et, A as Nt, C as Tt, E as Ot, s as Be, D as Pt, a as Ht, m as Ee, d as Me, b as Ne, c as Te, r as Fe, e as Ut, p as Wt, f as zt, g as Bt, M as D, h as N, W as Mt, N as Ft, P as $t, J as Vt, i as x, j as A, k as xt, l as At, n as Kt, o as Oe } from "./observe-DVzqBVcI.js";
|
|
47
|
+
import { O as gs } from "./observe-DVzqBVcI.js";
|
|
48
|
+
import { L as qt, s as Gt, a as O } from "./buffer-CwCRPuMA.js";
|
|
49
|
+
import { g as Pe } from "./LDObserve-BQr7RYVC.js";
|
|
50
|
+
import { L as fs } from "./LDObserve-BQr7RYVC.js";
|
|
51
|
+
import { LDRecord as ws } from "./LDRecord.js";
|
|
52
|
+
const jt = (s, e, t) => {
|
|
53
|
+
const i = window._highlightWebSocketRequestCallback;
|
|
54
|
+
window._highlightWebSocketRequestCallback = s;
|
|
55
55
|
const n = window._highlightWebSocketEventCallback;
|
|
56
56
|
return window._highlightWebSocketEventCallback = (o) => {
|
|
57
57
|
const h = o, { message: r, size: l } = h, d = j(h, ["message", "size"]), g = t.some(
|
|
@@ -59,13 +59,13 @@ const Gt = (i, e, t) => {
|
|
|
59
59
|
) ? d : o;
|
|
60
60
|
e(g);
|
|
61
61
|
}, () => {
|
|
62
|
-
window._highlightWebSocketRequestCallback =
|
|
62
|
+
window._highlightWebSocketRequestCallback = i, window._highlightWebSocketEventCallback = n;
|
|
63
63
|
};
|
|
64
|
-
},
|
|
65
|
-
xhrCallback:
|
|
64
|
+
}, Jt = ({
|
|
65
|
+
xhrCallback: s,
|
|
66
66
|
fetchCallback: e,
|
|
67
67
|
webSocketRequestCallback: t,
|
|
68
|
-
webSocketEventCallback:
|
|
68
|
+
webSocketEventCallback: i,
|
|
69
69
|
disableWebSocketRecording: n,
|
|
70
70
|
bodyKeysToRedact: o,
|
|
71
71
|
highlightEndpoints: r,
|
|
@@ -74,13 +74,13 @@ const Gt = (i, e, t) => {
|
|
|
74
74
|
bodyKeysToRecord: c
|
|
75
75
|
}) => {
|
|
76
76
|
const g = Lt(
|
|
77
|
-
|
|
77
|
+
s,
|
|
78
78
|
r,
|
|
79
79
|
l,
|
|
80
80
|
d,
|
|
81
81
|
o,
|
|
82
82
|
c
|
|
83
|
-
), h =
|
|
83
|
+
), h = Et(
|
|
84
84
|
e,
|
|
85
85
|
r,
|
|
86
86
|
l,
|
|
@@ -88,9 +88,9 @@ const Gt = (i, e, t) => {
|
|
|
88
88
|
o,
|
|
89
89
|
c
|
|
90
90
|
), f = n ? () => {
|
|
91
|
-
} :
|
|
91
|
+
} : jt(
|
|
92
92
|
t,
|
|
93
|
-
|
|
93
|
+
i,
|
|
94
94
|
d
|
|
95
95
|
);
|
|
96
96
|
return () => {
|
|
@@ -125,9 +125,9 @@ class I {
|
|
|
125
125
|
a(this, "urlBlocklist");
|
|
126
126
|
a(this, "highlightEndpoints");
|
|
127
127
|
a(this, "requestResponseSanitizer");
|
|
128
|
-
var t,
|
|
129
|
-
this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (
|
|
130
|
-
...
|
|
128
|
+
var t, i;
|
|
129
|
+
this.options = e, this.disableConsoleRecording = !!e.disableConsoleRecording, this.reportConsoleErrors = (t = e.reportConsoleErrors) != null ? t : !1, this.enablePromisePatch = (i = e.enablePromisePatch) != null ? i : !1, this.consoleMethodsToRecord = e.consoleMethodsToRecord || [
|
|
130
|
+
...Nt
|
|
131
131
|
], this.listeners = [], this.errors = [], this.messages = [], this.lastNetworkRequestTimestamp = 0;
|
|
132
132
|
}
|
|
133
133
|
isListening() {
|
|
@@ -137,12 +137,12 @@ class I {
|
|
|
137
137
|
if (this.isListening()) return;
|
|
138
138
|
const e = this;
|
|
139
139
|
this.disableConsoleRecording || this.listeners.push(
|
|
140
|
-
|
|
140
|
+
Tt(
|
|
141
141
|
(t) => {
|
|
142
|
-
var
|
|
142
|
+
var i, n, o;
|
|
143
143
|
if (this.reportConsoleErrors && (t.type === "Error" || t.type === "error") && t.value && t.trace) {
|
|
144
144
|
const r = K(t.value);
|
|
145
|
-
if (Ne.includes(r) ||
|
|
145
|
+
if (Ne.includes(r) || Te.some(
|
|
146
146
|
(l) => r.includes(l)
|
|
147
147
|
))
|
|
148
148
|
return;
|
|
@@ -150,7 +150,7 @@ class I {
|
|
|
150
150
|
event: r,
|
|
151
151
|
type: "console.error",
|
|
152
152
|
url: window.location.href,
|
|
153
|
-
source: (
|
|
153
|
+
source: (i = t.trace[0]) != null && i.fileName ? t.trace[0].fileName : "",
|
|
154
154
|
lineNumber: (n = t.trace[0]) != null && n.lineNumber ? t.trace[0].lineNumber : 0,
|
|
155
155
|
columnNumber: (o = t.trace[0]) != null && o.columnNumber ? t.trace[0].columnNumber : 0,
|
|
156
156
|
stackTrace: t.trace,
|
|
@@ -160,7 +160,7 @@ class I {
|
|
|
160
160
|
}
|
|
161
161
|
e.messages.push(t);
|
|
162
162
|
},
|
|
163
|
-
y(
|
|
163
|
+
y(p({}, Me), {
|
|
164
164
|
level: this.consoleMethodsToRecord,
|
|
165
165
|
recordLaunchDarklySdkLogs: this.options.recordLaunchDarklySdkLogs
|
|
166
166
|
})
|
|
@@ -168,8 +168,8 @@ class I {
|
|
|
168
168
|
), this.listeners.push(
|
|
169
169
|
Ot(
|
|
170
170
|
(t) => {
|
|
171
|
-
Ne.includes(t.event) ||
|
|
172
|
-
(
|
|
171
|
+
Ne.includes(t.event) || Te.some(
|
|
172
|
+
(i) => t.event.includes(i)
|
|
173
173
|
) || e.errors.push(t);
|
|
174
174
|
},
|
|
175
175
|
{ enablePromisePatch: this.enablePromisePatch }
|
|
@@ -182,10 +182,10 @@ class I {
|
|
|
182
182
|
// We define this as a static method because versions earlier than 4.0.0 (Feb 2022) don't have this code.
|
|
183
183
|
// For those versions, calling this from client will monkey-patch the network listeners onto the old FirstLoadListener object.
|
|
184
184
|
static setupNetworkListener(e, t) {
|
|
185
|
-
var o, r, l, d, c, g, h, f, m,
|
|
186
|
-
const
|
|
185
|
+
var o, r, l, d, c, g, h, f, m, _, k, C;
|
|
186
|
+
const i = (t == null ? void 0 : t.backendUrl) || void 0 || "https://pub.highlight.io", n = t.otlpEndpoint || "https://otel.highlight.io";
|
|
187
187
|
e.highlightEndpoints = [
|
|
188
|
-
|
|
188
|
+
i,
|
|
189
189
|
`${n}/v1/traces`,
|
|
190
190
|
`${n}/v1/logs`,
|
|
191
191
|
`${n}/v1/metrics`
|
|
@@ -197,13 +197,13 @@ class I {
|
|
|
197
197
|
(S) => S.toLowerCase()
|
|
198
198
|
)) || [], e.urlBlocklist = [
|
|
199
199
|
...e.urlBlocklist,
|
|
200
|
-
...
|
|
201
|
-
], e.requestResponseSanitizer = (
|
|
200
|
+
...Pt
|
|
201
|
+
], e.requestResponseSanitizer = (_ = t.networkRecording) == null ? void 0 : _.requestResponseSanitizer, e.networkHeaderKeysToRecord = (k = t.networkRecording) == null ? void 0 : k.headerKeysToRecord, e.networkHeaderKeysToRecord && (e.networkHeadersToRedact = [], e.networkHeaderKeysToRecord = e.networkHeaderKeysToRecord.map(
|
|
202
202
|
(S) => S.toLocaleLowerCase()
|
|
203
|
-
)), e.networkBodyKeysToRecord = (
|
|
203
|
+
)), e.networkBodyKeysToRecord = (C = t.networkRecording) == null ? void 0 : C.bodyKeysToRecord, e.networkBodyKeysToRecord && (e.networkBodyKeysToRedact = [], e.networkBodyKeysToRecord = e.networkBodyKeysToRecord.map(
|
|
204
204
|
(S) => S.toLocaleLowerCase()
|
|
205
205
|
))), !e.disableNetworkRecording && e.enableRecordingNetworkContents && (e.hasNetworkRecording = !0, e.listeners.push(
|
|
206
|
-
|
|
206
|
+
Jt({
|
|
207
207
|
xhrCallback: (S) => {
|
|
208
208
|
e.xhrNetworkContents.push(S);
|
|
209
209
|
},
|
|
@@ -227,40 +227,40 @@ class I {
|
|
|
227
227
|
}
|
|
228
228
|
static getRecordedNetworkResources(e, t) {
|
|
229
229
|
var o, r;
|
|
230
|
-
let
|
|
230
|
+
let i = [], n = [];
|
|
231
231
|
if (!e.disableNetworkRecording) {
|
|
232
232
|
const l = ((o = window == null ? void 0 : window.performance) == null ? void 0 : o.timeOrigin) || 0;
|
|
233
|
-
|
|
233
|
+
i = performance.getEntriesByType(
|
|
234
234
|
"resource"
|
|
235
235
|
);
|
|
236
236
|
const d = (t - l) * 2;
|
|
237
|
-
if (
|
|
237
|
+
if (i = i.filter((c) => c.responseEnd < e.lastNetworkRequestTimestamp ? !1 : Ht(
|
|
238
238
|
c.name,
|
|
239
239
|
e.highlightEndpoints
|
|
240
|
-
)).map((c) => y(
|
|
240
|
+
)).map((c) => y(p({}, c.toJSON()), {
|
|
241
241
|
offsetStartTime: c.startTime - d,
|
|
242
242
|
offsetResponseEnd: c.responseEnd - d,
|
|
243
243
|
offsetFetchStart: c.fetchStart - d
|
|
244
|
-
})), e.lastNetworkRequestTimestamp = ((r =
|
|
244
|
+
})), e.lastNetworkRequestTimestamp = ((r = i.at(-1)) == null ? void 0 : r.responseEnd) || e.lastNetworkRequestTimestamp, e.enableRecordingNetworkContents) {
|
|
245
245
|
const c = {
|
|
246
246
|
headersToRedact: e.networkHeadersToRedact,
|
|
247
247
|
headersToRecord: e.networkHeaderKeysToRecord,
|
|
248
248
|
requestResponseSanitizer: e.requestResponseSanitizer
|
|
249
249
|
};
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
i = Ee(
|
|
251
|
+
i,
|
|
252
252
|
e.xhrNetworkContents,
|
|
253
253
|
"xmlhttprequest",
|
|
254
254
|
c
|
|
255
|
-
),
|
|
256
|
-
|
|
255
|
+
), i = Ee(
|
|
256
|
+
i,
|
|
257
257
|
e.fetchNetworkContents,
|
|
258
258
|
"fetch",
|
|
259
259
|
c
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...
|
|
263
|
+
return e.disableRecordingWebSocketContents || (n = e.webSocketNetworkContents || []), [...i, ...n];
|
|
264
264
|
}
|
|
265
265
|
static getRecordedWebSocketEvents(e) {
|
|
266
266
|
let t = [];
|
|
@@ -270,8 +270,8 @@ class I {
|
|
|
270
270
|
e.disableNetworkRecording || (e.xhrNetworkContents = [], e.fetchNetworkContents = [], e.webSocketNetworkContents = [], e.webSocketEventContents = [], performance.clearResourceTimings());
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
const z = (
|
|
274
|
-
|
|
273
|
+
const z = (s, e) => {
|
|
274
|
+
O("warn", `Highlight Warning: (${s}): `, { output: e });
|
|
275
275
|
};
|
|
276
276
|
var $;
|
|
277
277
|
const se = class se {
|
|
@@ -331,24 +331,24 @@ const se = class se {
|
|
|
331
331
|
a(this, "_up_down_counters", /* @__PURE__ */ new Map());
|
|
332
332
|
a(this, "_integrations", []);
|
|
333
333
|
var n, o, r, l, d;
|
|
334
|
-
e.sessionSecureID || (e.sessionSecureID =
|
|
334
|
+
e.sessionSecureID || (e.sessionSecureID = T()), this.options = e, typeof ((n = this.options) == null ? void 0 : n.debug) == "boolean" ? this.debugOptions = this.options.debug ? { clientInteractions: !0 } : {} : this.debugOptions = (r = (o = this.options) == null ? void 0 : o.debug) != null ? r : {}, this.logger = new qt(this.debugOptions.clientInteractions), e.debug && Gt(!0), e.storageMode && (this.logger.log(
|
|
335
335
|
`initializing in ${e.storageMode} session mode`
|
|
336
|
-
),
|
|
336
|
+
), yt(e.storageMode)), ze(!!(e != null && e.sessionCookie)), (e == null ? void 0 : e.sessionCookieDomain) !== void 0 && pt(e.sessionCookieDomain), this._worker = new Qe(), this._worker.onmessage = (c) => {
|
|
337
337
|
var g, h, f;
|
|
338
|
-
((g = c.data.response) == null ? void 0 : g.type) ===
|
|
338
|
+
((g = c.data.response) == null ? void 0 : g.type) === L.AsyncEvents ? (this._eventBytesSinceSnapshot += c.data.response.eventsSize, this.logger.log(
|
|
339
339
|
`Web worker sent payloadID ${c.data.response.id} size ${c.data.response.eventsSize} bytes, compression ratio ${c.data.response.eventsSize / c.data.response.compressedSize}.
|
|
340
340
|
Total since snapshot: ${(this._eventBytesSinceSnapshot / 1e6).toFixed(1)}MB`
|
|
341
|
-
)) : ((h = c.data.response) == null ? void 0 : h.type) ===
|
|
341
|
+
)) : ((h = c.data.response) == null ? void 0 : h.type) === L.CustomEvent ? this.addCustomEvent(
|
|
342
342
|
c.data.response.tag,
|
|
343
343
|
c.data.response.payload
|
|
344
|
-
) : ((f = c.data.response) == null ? void 0 : f.type) ===
|
|
344
|
+
) : ((f = c.data.response) == null ? void 0 : f.type) === L.Stop && (z(
|
|
345
345
|
"Stopping recording due to worker failure",
|
|
346
346
|
c.data.response
|
|
347
347
|
), this.stopRecording(!1));
|
|
348
348
|
};
|
|
349
|
-
let
|
|
350
|
-
if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (
|
|
351
|
-
this.sessionData =
|
|
349
|
+
let i = F();
|
|
350
|
+
if (this.reloaded = !1, !((l = this.sessionData) != null && l.sessionSecureID) && (i != null && i.sessionSecureID))
|
|
351
|
+
this.sessionData = i, this.options.sessionSecureID = i.sessionSecureID, this.reloaded = !0, this.logger.log(
|
|
352
352
|
`Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`
|
|
353
353
|
);
|
|
354
354
|
else {
|
|
@@ -372,8 +372,8 @@ const se = class se {
|
|
|
372
372
|
return new se(e);
|
|
373
373
|
}
|
|
374
374
|
// Start a new session
|
|
375
|
-
_reset(
|
|
376
|
-
return
|
|
375
|
+
_reset(i) {
|
|
376
|
+
return R(this, arguments, function* ({
|
|
377
377
|
forceNew: e,
|
|
378
378
|
sessionKey: t
|
|
379
379
|
}) {
|
|
@@ -390,12 +390,12 @@ const se = class se {
|
|
|
390
390
|
}
|
|
391
391
|
for (const r of Object.values(E))
|
|
392
392
|
De(r);
|
|
393
|
-
this.sessionData.sessionSecureID = t ?
|
|
393
|
+
this.sessionData.sessionSecureID = t ? T(`${this.organizationID}-${t}`) : T(), this.sessionData.sessionKey = t, this.sessionData.sessionStartTime = Date.now(), this.options.sessionSecureID = this.sessionData.sessionSecureID, this.stopRecording(), this._firstLoadListeners.stopListening(), this._firstLoadListeners = new I(this.options), yield this.initialize(), n && o && this.identify(n, o);
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
396
|
_initMembers(e) {
|
|
397
|
-
var o, r, l, d, c, g, h, f, m,
|
|
398
|
-
this.sessionShortcut = !1, this._recordingStartTime = 0, this._isOnLocalHost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "", this.ready = !1, this.state = "NotRecording", this.manualStopped = !1, this.enableSegmentIntegration = !!e.enableSegmentIntegration, this.privacySetting = (o = e.privacySetting) != null ? o : "default", this.enableCanvasRecording = (r = e.enableCanvasRecording) != null ? r : !1, this.enablePerformanceRecording = (l = e.enablePerformanceRecording) != null ? l : !0, this.inlineImages = (d = e.inlineImages) != null ? d : this._isOnLocalHost, this.inlineVideos = (c = e.inlineVideos) != null ? c : this._isOnLocalHost, this.inlineStylesheet = (g = e.inlineStylesheet) != null ? g : this._isOnLocalHost, this.styleSheetResyncInterval = (h = e.styleSheetResyncInterval) != null ? h : 2e3, this.samplingStrategy =
|
|
397
|
+
var o, r, l, d, c, g, h, f, m, _, k;
|
|
398
|
+
this.sessionShortcut = !1, this._recordingStartTime = 0, this._isOnLocalHost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "", this.ready = !1, this.state = "NotRecording", this.manualStopped = !1, this.enableSegmentIntegration = !!e.enableSegmentIntegration, this.privacySetting = (o = e.privacySetting) != null ? o : "default", this.enableCanvasRecording = (r = e.enableCanvasRecording) != null ? r : !1, this.enablePerformanceRecording = (l = e.enablePerformanceRecording) != null ? l : !0, this.inlineImages = (d = e.inlineImages) != null ? d : this._isOnLocalHost, this.inlineVideos = (c = e.inlineVideos) != null ? c : this._isOnLocalHost, this.inlineStylesheet = (g = e.inlineStylesheet) != null ? g : this._isOnLocalHost, this.styleSheetResyncInterval = (h = e.styleSheetResyncInterval) != null ? h : 2e3, this.samplingStrategy = p({
|
|
399
399
|
canvasFactor: 0.5,
|
|
400
400
|
canvasMaxSnapshotDimension: 360,
|
|
401
401
|
canvasClearWebGLBuffer: !0,
|
|
@@ -403,19 +403,19 @@ const se = class se {
|
|
|
403
403
|
}, (f = e.samplingStrategy) != null ? f : {
|
|
404
404
|
canvas: 2
|
|
405
405
|
}), this._backendUrl = (m = e == null ? void 0 : e.backendUrl) != null ? m : "https://pub.highlight.io", this._backendUrl[0] === "/" && (this._backendUrl = new URL(this._backendUrl, document.baseURI).href);
|
|
406
|
-
const t = new
|
|
406
|
+
const t = new kt(`${this._backendUrl}`, {
|
|
407
407
|
headers: {}
|
|
408
408
|
});
|
|
409
|
-
ke(this, $, ht(t,
|
|
409
|
+
ke(this, $, ht(t, bt())), this.environment = (_ = e.environment) != null ? _ : "production", this.appVersion = e.appVersion, this.serviceName = (k = e.serviceName) != null ? k : "", typeof e.organizationID == "string" ? this.organizationID = e.organizationID : this.organizationID = e.organizationID.toString(), this.isRunningOnHighlight = this.organizationID === "1" || this.organizationID === "1jdkoe52", this.firstloadVersion = e.firstloadVersion || "unknown", this.sessionShortcut = e.sessionShortcut || !1, this._onToggleFeedbackFormVisibility = () => {
|
|
410
410
|
};
|
|
411
|
-
const
|
|
411
|
+
const C = e, { firstloadVersion: i } = C, n = j(C, ["firstloadVersion"]);
|
|
412
412
|
this._optionsInternal = n, this.listeners = [], this.events = [], this.hasSessionUnloaded = !1, this.hasPushedData = !1, window.Intercom && window.Intercom("onShow", () => {
|
|
413
413
|
window.Intercom("update", {
|
|
414
414
|
highlightSessionURL: this.getCurrentSessionURLWithTimestamp()
|
|
415
415
|
}), this.addProperties({ event: "Intercom onShow" });
|
|
416
416
|
}), this._eventBytesSinceSnapshot = 0, this._lastSnapshotTime = (/* @__PURE__ */ new Date()).getTime(), this._lastVisibilityChangeTime = (/* @__PURE__ */ new Date()).getTime();
|
|
417
417
|
}
|
|
418
|
-
identify(e, t = {},
|
|
418
|
+
identify(e, t = {}, i) {
|
|
419
419
|
if (!e || e === "") {
|
|
420
420
|
console.warn(
|
|
421
421
|
"Highlight's identify() call was passed an empty identifier.",
|
|
@@ -428,10 +428,10 @@ const se = class se {
|
|
|
428
428
|
e.toString()
|
|
429
429
|
), Y(E.USER_OBJECT, JSON.stringify(t)), this._worker.postMessage({
|
|
430
430
|
message: {
|
|
431
|
-
type:
|
|
431
|
+
type: L.Identify,
|
|
432
432
|
userIdentifier: e,
|
|
433
433
|
userObject: t,
|
|
434
|
-
source:
|
|
434
|
+
source: i
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
for (const n of this._integrations)
|
|
@@ -439,22 +439,22 @@ const se = class se {
|
|
|
439
439
|
this.sessionData.sessionSecureID,
|
|
440
440
|
e,
|
|
441
441
|
t,
|
|
442
|
-
|
|
442
|
+
i
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
|
-
log(e, t,
|
|
445
|
+
log(e, t, i) {
|
|
446
446
|
this._firstLoadListeners.messages.push(
|
|
447
|
-
|
|
447
|
+
Ut(t, Me, e, i)
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
450
|
pushCustomError(e, t) {
|
|
451
451
|
return this.consumeCustomError(new Error(e), void 0, t);
|
|
452
452
|
}
|
|
453
|
-
consumeCustomError(e, t,
|
|
453
|
+
consumeCustomError(e, t, i) {
|
|
454
454
|
let n = {};
|
|
455
|
-
if (
|
|
455
|
+
if (i)
|
|
456
456
|
try {
|
|
457
|
-
n =
|
|
457
|
+
n = p(p({}, JSON.parse(i)), n);
|
|
458
458
|
} catch (o) {
|
|
459
459
|
}
|
|
460
460
|
return this.consumeError(e, {
|
|
@@ -464,15 +464,15 @@ const se = class se {
|
|
|
464
464
|
}
|
|
465
465
|
consumeError(e, {
|
|
466
466
|
message: t,
|
|
467
|
-
payload:
|
|
467
|
+
payload: i,
|
|
468
468
|
source: n,
|
|
469
469
|
type: o
|
|
470
470
|
}) {
|
|
471
471
|
var c, g, h, f;
|
|
472
|
-
e.cause && (
|
|
472
|
+
e.cause && (i = y(p({}, i), { "exception.cause": e.cause }));
|
|
473
473
|
let r = t ? t + ":" + e.message : e.message;
|
|
474
474
|
o === "React.ErrorBoundary" && (r = "ErrorBoundary: " + r);
|
|
475
|
-
const l =
|
|
475
|
+
const l = Wt(e), d = {
|
|
476
476
|
event: r,
|
|
477
477
|
type: o != null ? o : "custom",
|
|
478
478
|
url: window.location.href,
|
|
@@ -481,7 +481,7 @@ const se = class se {
|
|
|
481
481
|
columnNumber: (h = l[0]) != null && h.columnNumber ? (f = l[0]) == null ? void 0 : f.columnNumber : 0,
|
|
482
482
|
stackTrace: l,
|
|
483
483
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
484
|
-
payload: JSON.stringify(
|
|
484
|
+
payload: JSON.stringify(i),
|
|
485
485
|
id: Fe()
|
|
486
486
|
};
|
|
487
487
|
this._firstLoadListeners.errors.push(d);
|
|
@@ -489,30 +489,30 @@ const se = class se {
|
|
|
489
489
|
m.error(this.sessionData.sessionSecureID, d);
|
|
490
490
|
}
|
|
491
491
|
addProperties(e = {}, t) {
|
|
492
|
-
const
|
|
493
|
-
Object.entries(
|
|
492
|
+
const i = p({}, e);
|
|
493
|
+
Object.entries(i).forEach(([n, o]) => {
|
|
494
494
|
try {
|
|
495
495
|
structuredClone(o);
|
|
496
496
|
} catch (r) {
|
|
497
|
-
delete
|
|
497
|
+
delete i[n];
|
|
498
498
|
}
|
|
499
499
|
}), this._worker.postMessage({
|
|
500
500
|
message: {
|
|
501
|
-
type:
|
|
502
|
-
propertiesObject:
|
|
501
|
+
type: L.Properties,
|
|
502
|
+
propertiesObject: i,
|
|
503
503
|
propertyType: t
|
|
504
504
|
}
|
|
505
505
|
});
|
|
506
506
|
for (const n of this._integrations)
|
|
507
|
-
n.track(this.sessionData.sessionSecureID,
|
|
507
|
+
n.track(this.sessionData.sessionSecureID, p({
|
|
508
508
|
sessionSecureID: this.sessionData.sessionSecureID,
|
|
509
509
|
propertyType: t
|
|
510
510
|
}, e));
|
|
511
511
|
}
|
|
512
512
|
initialize(e) {
|
|
513
|
-
return
|
|
514
|
-
var t,
|
|
515
|
-
if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (
|
|
513
|
+
return R(this, null, function* () {
|
|
514
|
+
var t, i, n, o, r, l, d, c, g, h, f, m, _, k, C, S, ie, ne, re, oe, ae, ce, le, de, he;
|
|
515
|
+
if (navigator != null && navigator.webdriver && !window.Cypress || (t = navigator == null ? void 0 : navigator.userAgent) != null && t.includes("Googlebot") || (i = navigator == null ? void 0 : navigator.userAgent) != null && i.includes("AdsBot")) {
|
|
516
516
|
(n = this._firstLoadListeners) == null || n.stopListening();
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
@@ -522,11 +522,11 @@ const se = class se {
|
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
524
|
if (e != null && e.sessionKey && (e == null ? void 0 : e.sessionKey) !== this.sessionData.sessionKey) {
|
|
525
|
-
yield this._reset(y(
|
|
525
|
+
yield this._reset(y(p({}, e), { forceNew: !0 }));
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
-
const P = new
|
|
529
|
-
|
|
528
|
+
const P = new Bt();
|
|
529
|
+
zt(
|
|
530
530
|
{
|
|
531
531
|
backendUrl: (r = (o = this.options) == null ? void 0 : o.backendUrl) != null ? r : "https://pub.highlight.io",
|
|
532
532
|
otlpEndpoint: (d = (l = this.options) == null ? void 0 : l.otlpEndpoint) != null ? d : "https://otel.highlight.io",
|
|
@@ -534,8 +534,8 @@ const se = class se {
|
|
|
534
534
|
sessionSecureId: (g = this.options) == null ? void 0 : g.sessionSecureID,
|
|
535
535
|
environment: (f = (h = this.options) == null ? void 0 : h.environment) != null ? f : "production",
|
|
536
536
|
networkRecordingOptions: typeof ((m = this.options) == null ? void 0 : m.networkRecording) == "object" ? this.options.networkRecording : void 0,
|
|
537
|
-
tracingOrigins: (
|
|
538
|
-
serviceName: (
|
|
537
|
+
tracingOrigins: (_ = this.options) == null ? void 0 : _.tracingOrigins,
|
|
538
|
+
serviceName: (C = (k = this.options) == null ? void 0 : k.serviceName) != null ? C : "highlight-browser",
|
|
539
539
|
instrumentations: (ie = (S = this.options) == null ? void 0 : S.otel) == null ? void 0 : ie.instrumentations,
|
|
540
540
|
getIntegrations: () => [...this._integrations],
|
|
541
541
|
productAnalyticsEvents: this._productAnalyticsEvents()
|
|
@@ -547,8 +547,8 @@ const se = class se {
|
|
|
547
547
|
this.sessionData,
|
|
548
548
|
this.options
|
|
549
549
|
), this.sessionData = (ne = F(this.sessionData.sessionSecureID)) != null ? ne : this.sessionData, (re = this.sessionData) != null && re.sessionStartTime ? this._recordingStartTime = (oe = this.sessionData) == null ? void 0 : oe.sessionStartTime : (this._recordingStartTime = (/* @__PURE__ */ new Date()).getTime(), this.sessionData.sessionStartTime = this._recordingStartTime), X(""), W(this.sessionData);
|
|
550
|
-
let H = Q(
|
|
551
|
-
H || (H =
|
|
550
|
+
let H = Q(Le.CLIENT_ID);
|
|
551
|
+
H || (H = T(), Y(Le.CLIENT_ID, H));
|
|
552
552
|
let U;
|
|
553
553
|
this.options.disableSessionRecording || this.options.disableNetworkRecording !== void 0 || typeof this.options.networkRecording == "boolean" ? U = !1 : U = ((ae = this.options.networkRecording) == null ? void 0 : ae.recordHeadersAndBody) || !1;
|
|
554
554
|
let ge = [];
|
|
@@ -578,7 +578,7 @@ const se = class se {
|
|
|
578
578
|
), this.sessionData.sessionSecureID = v.initializeSession.secure_id, this.sessionData.projectID = parseInt(
|
|
579
579
|
((le = v == null ? void 0 : v.initializeSession) == null ? void 0 : le.project_id) || "0"
|
|
580
580
|
), P.setConfig(v.initializeSession.sampling), !this.sessionData.projectID || !this.sessionData.sessionSecureID) {
|
|
581
|
-
|
|
581
|
+
O(
|
|
582
582
|
"error",
|
|
583
583
|
"Failed to initialize Highlight; an error occurred on our end.",
|
|
584
584
|
this.sessionData
|
|
@@ -593,7 +593,7 @@ Project ID: ${this.sessionData.projectID}
|
|
|
593
593
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
594
594
|
), this.options.sessionSecureID = this.sessionData.sessionSecureID, this._worker.postMessage({
|
|
595
595
|
message: {
|
|
596
|
-
type:
|
|
596
|
+
type: L.Initialize,
|
|
597
597
|
sessionSecureID: this.sessionData.sessionSecureID,
|
|
598
598
|
backend: this._backendUrl,
|
|
599
599
|
debug: !!this.debugOptions.clientInteractions,
|
|
@@ -616,7 +616,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
616
616
|
), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
619
|
-
const { getDeviceDetails: ue } =
|
|
619
|
+
const { getDeviceDetails: ue } = xt();
|
|
620
620
|
ue && this.recordGauge({
|
|
621
621
|
name: N.DeviceMemory,
|
|
622
622
|
value: ue().deviceMemory,
|
|
@@ -682,13 +682,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
682
682
|
{ type: "session" }
|
|
683
683
|
), this._setupWindowListeners(), this.ready = !0, this.state = "Recording", this.manualStopped = !1;
|
|
684
684
|
} catch (P) {
|
|
685
|
-
this._isOnLocalHost && (
|
|
685
|
+
this._isOnLocalHost && (O("error", P), z("initializeSession", P));
|
|
686
686
|
}
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
689
|
_productAnalyticsEvents() {
|
|
690
|
-
var
|
|
691
|
-
const e = (
|
|
690
|
+
var i;
|
|
691
|
+
const e = (i = this.options) == null ? void 0 : i.productAnalytics;
|
|
692
692
|
if (e === !1)
|
|
693
693
|
return {};
|
|
694
694
|
const t = {
|
|
@@ -703,7 +703,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
703
703
|
return t;
|
|
704
704
|
}
|
|
705
705
|
_visibilityHandler(e) {
|
|
706
|
-
return
|
|
706
|
+
return R(this, null, function* () {
|
|
707
707
|
if (this.manualStopped) {
|
|
708
708
|
this.logger.log("Ignoring visibility event due to manual stop.");
|
|
709
709
|
return;
|
|
@@ -712,14 +712,14 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
712
712
|
});
|
|
713
713
|
}
|
|
714
714
|
_setupCrossOriginIframe() {
|
|
715
|
-
return
|
|
715
|
+
return R(this, null, function* () {
|
|
716
716
|
this.logger.log("highlight in cross-origin iframe is waiting "), yield new Promise((e) => {
|
|
717
|
-
const t = (
|
|
718
|
-
if (
|
|
719
|
-
const n =
|
|
717
|
+
const t = (i) => {
|
|
718
|
+
if (i.data.highlight === ve) {
|
|
719
|
+
const n = i.data;
|
|
720
720
|
this.logger.log("highlight got window message ", n), this.sessionData.projectID = n.projectID, this.sessionData.sessionSecureID = n.sessionSecureID, window.parent.postMessage(
|
|
721
721
|
{
|
|
722
|
-
highlight:
|
|
722
|
+
highlight: Re
|
|
723
723
|
},
|
|
724
724
|
"*"
|
|
725
725
|
), window.removeEventListener("message", t), e();
|
|
@@ -745,13 +745,13 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
745
745
|
);
|
|
746
746
|
});
|
|
747
747
|
}, Ie), window.addEventListener("message", (e) => {
|
|
748
|
-
e.data.highlight ===
|
|
748
|
+
e.data.highlight === Re && this.logger.log(
|
|
749
749
|
"highlight got response from initialized iframe"
|
|
750
750
|
);
|
|
751
751
|
});
|
|
752
752
|
}
|
|
753
753
|
_setupWindowListeners() {
|
|
754
|
-
var
|
|
754
|
+
var i;
|
|
755
755
|
try {
|
|
756
756
|
const n = this;
|
|
757
757
|
this.enableSegmentIntegration && this.listeners.push(
|
|
@@ -792,7 +792,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
792
792
|
let d = null, c = null;
|
|
793
793
|
if (l && l.target) {
|
|
794
794
|
const g = l.target;
|
|
795
|
-
d =
|
|
795
|
+
d = vt(g), c = g.textContent, c && c.length > 2e3 && (c = c.substring(0, 2e3));
|
|
796
796
|
}
|
|
797
797
|
this.addCustomEvent("Click", {
|
|
798
798
|
clickTarget: r,
|
|
@@ -805,7 +805,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
805
805
|
r && this.addCustomEvent("Focus", r);
|
|
806
806
|
})
|
|
807
807
|
), this.listeners.push(
|
|
808
|
-
|
|
808
|
+
Mt((r) => {
|
|
809
809
|
const { name: l, value: d } = r, c = [], g = (h, f) => {
|
|
810
810
|
f && c.push({ name: h, value: f });
|
|
811
811
|
};
|
|
@@ -814,7 +814,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
814
814
|
const h = r.attribution;
|
|
815
815
|
g("web_vital.element", h.element), g(
|
|
816
816
|
"web_vital.attribution.url",
|
|
817
|
-
h.url ?
|
|
817
|
+
h.url ? At(h.url) : void 0
|
|
818
818
|
);
|
|
819
819
|
break;
|
|
820
820
|
}
|
|
@@ -848,7 +848,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
848
848
|
});
|
|
849
849
|
})
|
|
850
850
|
), this.listeners.push(
|
|
851
|
-
|
|
851
|
+
Ft(
|
|
852
852
|
(r) => {
|
|
853
853
|
const l = [];
|
|
854
854
|
r.saveData !== void 0 && l.push({
|
|
@@ -861,7 +861,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
861
861
|
name: "type",
|
|
862
862
|
value: r.type.toString()
|
|
863
863
|
}), Object.entries(r).forEach(([d, c]) => {
|
|
864
|
-
|
|
864
|
+
Rt(c) && this.recordGauge({
|
|
865
865
|
name: d,
|
|
866
866
|
value: c,
|
|
867
867
|
category: D.Performance,
|
|
@@ -880,7 +880,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
880
880
|
);
|
|
881
881
|
})
|
|
882
882
|
), this.enablePerformanceRecording && (this.listeners.push(
|
|
883
|
-
|
|
883
|
+
$t((r) => {
|
|
884
884
|
this.addCustomEvent("Performance", K(r)), Object.entries(r).filter(([l]) => l !== "relativeTimestamp").forEach(
|
|
885
885
|
([l, d]) => d && this.recordGauge({
|
|
886
886
|
name: l,
|
|
@@ -891,7 +891,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
891
891
|
);
|
|
892
892
|
}, this._recordingStartTime)
|
|
893
893
|
), this.listeners.push(
|
|
894
|
-
|
|
894
|
+
Vt((r) => {
|
|
895
895
|
this.addCustomEvent("Jank", K(r)), this.recordGauge({
|
|
896
896
|
name: "Jank",
|
|
897
897
|
value: r.jankAmount,
|
|
@@ -899,7 +899,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
899
899
|
group: r.querySelector
|
|
900
900
|
});
|
|
901
901
|
}, this._recordingStartTime)
|
|
902
|
-
)), this._hasPreviouslyInitialized || ((
|
|
902
|
+
)), this._hasPreviouslyInitialized || ((i = window.electron) != null && i.ipcRenderer ? (window.electron.ipcRenderer.on(
|
|
903
903
|
"highlight.run",
|
|
904
904
|
({ visible: r }) => {
|
|
905
905
|
this._visibilityHandler(!r);
|
|
@@ -914,7 +914,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
914
914
|
() => window.removeEventListener("beforeunload", o)
|
|
915
915
|
);
|
|
916
916
|
} catch (n) {
|
|
917
|
-
this._isOnLocalHost && (
|
|
917
|
+
this._isOnLocalHost && (O("error", n), z("initializeSession _setupWindowListeners", n));
|
|
918
918
|
}
|
|
919
919
|
const e = () => {
|
|
920
920
|
this.addCustomEvent("Page Unload", ""), X(this.sessionData.sessionSecureID), W(this.sessionData);
|
|
@@ -933,7 +933,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
933
933
|
submitViewportMetrics({
|
|
934
934
|
height: e,
|
|
935
935
|
width: t,
|
|
936
|
-
availHeight:
|
|
936
|
+
availHeight: i,
|
|
937
937
|
availWidth: n
|
|
938
938
|
}) {
|
|
939
939
|
this.recordGauge({
|
|
@@ -948,7 +948,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
948
948
|
group: window.location.href
|
|
949
949
|
}), this.recordGauge({
|
|
950
950
|
name: N.ScreenHeight,
|
|
951
|
-
value:
|
|
951
|
+
value: i,
|
|
952
952
|
category: D.Device,
|
|
953
953
|
group: window.location.href
|
|
954
954
|
}), this.recordGauge({
|
|
@@ -964,16 +964,16 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
recordGauge(e) {
|
|
967
|
-
var
|
|
967
|
+
var i, n;
|
|
968
968
|
let t = this._gauges.get(e.name);
|
|
969
969
|
if (!t) {
|
|
970
|
-
if (t = (
|
|
970
|
+
if (t = (i = x()) == null ? void 0 : i.createGauge(
|
|
971
971
|
e.name,
|
|
972
972
|
A(e.name, e.unit)
|
|
973
973
|
), !t) return;
|
|
974
974
|
this._gauges.set(e.name, t);
|
|
975
975
|
}
|
|
976
|
-
t.record(e.value, y(
|
|
976
|
+
t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
977
977
|
group: e.group,
|
|
978
978
|
category: e.category,
|
|
979
979
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -982,51 +982,51 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
982
982
|
o.recordGauge(this.sessionData.sessionSecureID, e);
|
|
983
983
|
}
|
|
984
984
|
recordCount(e) {
|
|
985
|
-
var
|
|
985
|
+
var i, n;
|
|
986
986
|
let t = this._counters.get(e.name);
|
|
987
987
|
if (!t) {
|
|
988
|
-
if (t = (
|
|
988
|
+
if (t = (i = x()) == null ? void 0 : i.createCounter(
|
|
989
989
|
e.name,
|
|
990
990
|
A(e.name, e.unit)
|
|
991
991
|
), !t) return;
|
|
992
992
|
this._counters.set(e.name, t);
|
|
993
993
|
}
|
|
994
|
-
t.add(e.value, y(
|
|
994
|
+
t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
995
995
|
group: e.group,
|
|
996
996
|
category: e.category,
|
|
997
997
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
998
998
|
}));
|
|
999
999
|
}
|
|
1000
1000
|
recordIncr(e) {
|
|
1001
|
-
this.recordCount(y(
|
|
1001
|
+
this.recordCount(y(p({}, e), { value: 1 }));
|
|
1002
1002
|
}
|
|
1003
1003
|
recordHistogram(e) {
|
|
1004
|
-
var
|
|
1004
|
+
var i, n;
|
|
1005
1005
|
let t = this._histograms.get(e.name);
|
|
1006
1006
|
if (!t) {
|
|
1007
|
-
if (t = (
|
|
1007
|
+
if (t = (i = x()) == null ? void 0 : i.createHistogram(
|
|
1008
1008
|
e.name,
|
|
1009
1009
|
A(e.name, e.unit)
|
|
1010
1010
|
), !t) return;
|
|
1011
1011
|
this._histograms.set(e.name, t);
|
|
1012
1012
|
}
|
|
1013
|
-
t.record(e.value, y(
|
|
1013
|
+
t.record(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
1014
1014
|
group: e.group,
|
|
1015
1015
|
category: e.category,
|
|
1016
1016
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
1017
1017
|
}));
|
|
1018
1018
|
}
|
|
1019
1019
|
recordUpDownCounter(e) {
|
|
1020
|
-
var
|
|
1020
|
+
var i, n;
|
|
1021
1021
|
let t = this._up_down_counters.get(e.name);
|
|
1022
1022
|
if (!t) {
|
|
1023
|
-
if (t = (
|
|
1023
|
+
if (t = (i = x()) == null ? void 0 : i.createUpDownCounter(
|
|
1024
1024
|
e.name,
|
|
1025
1025
|
A(e.name, e.unit)
|
|
1026
1026
|
), !t) return;
|
|
1027
1027
|
this._up_down_counters.set(e.name, t);
|
|
1028
1028
|
}
|
|
1029
|
-
t.add(e.value, y(
|
|
1029
|
+
t.add(e.value, y(p({}, (n = e.tags) == null ? void 0 : n.reduce((o, r) => y(p({}, o), { [r.name]: r.value }), {})), {
|
|
1030
1030
|
group: e.group,
|
|
1031
1031
|
category: e.category,
|
|
1032
1032
|
"highlight.session_id": this.sessionData.sessionSecureID
|
|
@@ -1049,50 +1049,36 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1049
1049
|
* Returns the current timestamp for the current session.
|
|
1050
1050
|
*/
|
|
1051
1051
|
getCurrentSessionURLWithTimestamp() {
|
|
1052
|
-
const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID:
|
|
1053
|
-
return `https://${Z}/${t}/sessions/${
|
|
1052
|
+
const e = (/* @__PURE__ */ new Date()).getTime(), { projectID: t, sessionSecureID: i } = this.sessionData, n = (e - this._recordingStartTime) / 1e3;
|
|
1053
|
+
return `https://${Z}/${t}/sessions/${i}?ts=${n}`;
|
|
1054
1054
|
}
|
|
1055
1055
|
getCurrentSessionURL() {
|
|
1056
1056
|
const e = this.sessionData.projectID, t = this.sessionData.sessionSecureID;
|
|
1057
1057
|
return e && t ? `https://${Z}/${e}/sessions/${t}` : null;
|
|
1058
1058
|
}
|
|
1059
1059
|
snapshot(e) {
|
|
1060
|
-
return
|
|
1060
|
+
return R(this, null, function* () {
|
|
1061
1061
|
yield J.snapshotCanvas(e);
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
verbatim: t,
|
|
1067
|
-
user_email: s,
|
|
1068
|
-
user_name: n
|
|
1069
|
-
}) {
|
|
1070
|
-
var o;
|
|
1071
|
-
this._worker.postMessage({
|
|
1072
|
-
message: {
|
|
1073
|
-
type: C.Feedback,
|
|
1074
|
-
verbatim: t,
|
|
1075
|
-
timestamp: e,
|
|
1076
|
-
userName: n || this.sessionData.userIdentifier,
|
|
1077
|
-
userEmail: s || ((o = this.sessionData.userObject) == null ? void 0 : o.name)
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1064
|
+
/** @deprecated Session feedback is no longer supported. This is a no-op. */
|
|
1065
|
+
addSessionFeedback(e) {
|
|
1080
1066
|
}
|
|
1081
1067
|
// Reset the events array and push to a backend.
|
|
1082
1068
|
_save() {
|
|
1083
|
-
return
|
|
1069
|
+
return R(this, null, function* () {
|
|
1084
1070
|
var e;
|
|
1085
1071
|
try {
|
|
1086
1072
|
this.state === "Recording" && this.listeners && !this.sessionData.sessionKey && this.sessionData.sessionStartTime && Date.now() - this.sessionData.sessionStartTime > mt && (this.logger.log("Resetting session", {
|
|
1087
1073
|
start: this.sessionData.sessionStartTime
|
|
1088
1074
|
}), yield this._reset({}));
|
|
1089
1075
|
let t;
|
|
1090
|
-
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (
|
|
1076
|
+
((e = this.options) == null ? void 0 : e.sendMode) === "local" && (t = (i) => R(this, null, function* () {
|
|
1091
1077
|
let n = new Blob(
|
|
1092
1078
|
[
|
|
1093
1079
|
JSON.stringify({
|
|
1094
|
-
query:
|
|
1095
|
-
variables:
|
|
1080
|
+
query: St(_t),
|
|
1081
|
+
variables: i
|
|
1096
1082
|
})
|
|
1097
1083
|
],
|
|
1098
1084
|
{
|
|
@@ -1105,11 +1091,11 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1105
1091
|
}), 0;
|
|
1106
1092
|
})), yield this._sendPayload({ sendFn: t }), this.hasPushedData = !0, this.sessionData.lastPushTime = Date.now(), W(this.sessionData);
|
|
1107
1093
|
} catch (t) {
|
|
1108
|
-
this._isOnLocalHost && (
|
|
1094
|
+
this._isOnLocalHost && (O("error", t), z("_save", t));
|
|
1109
1095
|
}
|
|
1110
1096
|
this.state === "Recording" && (this.pushPayloadTimerId && (clearTimeout(this.pushPayloadTimerId), this.pushPayloadTimerId = void 0), this.pushPayloadTimerId = setTimeout(() => {
|
|
1111
1097
|
this._save();
|
|
1112
|
-
},
|
|
1098
|
+
}, wt));
|
|
1113
1099
|
});
|
|
1114
1100
|
}
|
|
1115
1101
|
/**
|
|
@@ -1118,25 +1104,25 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1118
1104
|
*/
|
|
1119
1105
|
addCustomEvent(e, t) {
|
|
1120
1106
|
if (this.state === "NotRecording") {
|
|
1121
|
-
let
|
|
1107
|
+
let i;
|
|
1122
1108
|
const n = () => {
|
|
1123
|
-
clearInterval(
|
|
1109
|
+
clearInterval(i), this.state === "Recording" && this.events.length > 0 ? _e(e, t) : i = setTimeout(n, 500);
|
|
1124
1110
|
};
|
|
1125
|
-
|
|
1126
|
-
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) &&
|
|
1111
|
+
i = setTimeout(n, 500);
|
|
1112
|
+
} else this.state === "Recording" && (this.events.length > 0 || this.hasPushedData) && _e(e, t);
|
|
1127
1113
|
}
|
|
1128
1114
|
_sendPayload(t) {
|
|
1129
|
-
return
|
|
1115
|
+
return R(this, arguments, function* ({
|
|
1130
1116
|
sendFn: e
|
|
1131
1117
|
}) {
|
|
1132
|
-
const
|
|
1118
|
+
const i = I.getRecordedNetworkResources(
|
|
1133
1119
|
this._firstLoadListeners,
|
|
1134
1120
|
this._recordingStartTime
|
|
1135
1121
|
), n = I.getRecordedWebSocketEvents(
|
|
1136
1122
|
this._firstLoadListeners
|
|
1137
|
-
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ?
|
|
1123
|
+
), o = [...this.events], r = [...this._firstLoadListeners.messages], l = [...this._firstLoadListeners.errors], { bytes: d, time: c } = this.enableCanvasRecording ? Ce.canvas : Ce.normal;
|
|
1138
1124
|
this._eventBytesSinceSnapshot >= d && (/* @__PURE__ */ new Date()).getTime() - this._lastSnapshotTime >= c && this.takeFullSnapshot(), this.logger.log(
|
|
1139
|
-
`Sending: ${o.length} events, ${r.length} messages, ${
|
|
1125
|
+
`Sending: ${o.length} events, ${r.length} messages, ${i.length} network resources, ${l.length} errors
|
|
1140
1126
|
To: ${this._backendUrl}
|
|
1141
1127
|
Org: ${this.organizationID}
|
|
1142
1128
|
SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
@@ -1148,7 +1134,7 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1148
1134
|
payload_id: g.toString(),
|
|
1149
1135
|
events: { events: o },
|
|
1150
1136
|
messages: K({ messages: r }),
|
|
1151
|
-
resources: JSON.stringify({ resources:
|
|
1137
|
+
resources: JSON.stringify({ resources: i }),
|
|
1152
1138
|
web_socket_events: JSON.stringify({ webSocketEvents: n }),
|
|
1153
1139
|
errors: l,
|
|
1154
1140
|
is_beacon: !1,
|
|
@@ -1163,12 +1149,12 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1163
1149
|
} else
|
|
1164
1150
|
this._worker.postMessage({
|
|
1165
1151
|
message: {
|
|
1166
|
-
type:
|
|
1152
|
+
type: L.AsyncEvents,
|
|
1167
1153
|
id: g,
|
|
1168
1154
|
events: o,
|
|
1169
1155
|
messages: r,
|
|
1170
1156
|
errors: l,
|
|
1171
|
-
resourcesString: JSON.stringify({ resources:
|
|
1157
|
+
resourcesString: JSON.stringify({ resources: i }),
|
|
1172
1158
|
webSocketEventsString: JSON.stringify({
|
|
1173
1159
|
webSocketEvents: n
|
|
1174
1160
|
}),
|
|
@@ -1199,24 +1185,24 @@ SessionSecureID: ${this.sessionData.sessionSecureID}`
|
|
|
1199
1185
|
};
|
|
1200
1186
|
$ = new WeakMap();
|
|
1201
1187
|
let ee = se;
|
|
1202
|
-
const
|
|
1203
|
-
var
|
|
1204
|
-
typeof chrome != "undefined" && ((
|
|
1205
|
-
(t,
|
|
1188
|
+
const Qt = () => {
|
|
1189
|
+
var s, e;
|
|
1190
|
+
typeof chrome != "undefined" && ((s = chrome == null ? void 0 : chrome.runtime) != null && s.onMessage) && ((e = chrome == null ? void 0 : chrome.runtime) == null || e.onMessage.addListener(
|
|
1191
|
+
(t, i, n) => {
|
|
1206
1192
|
const o = t.action;
|
|
1207
1193
|
switch (console.log(
|
|
1208
1194
|
`[highlight] received '${o}' event from extension.`
|
|
1209
1195
|
), o) {
|
|
1210
1196
|
case "init": {
|
|
1211
|
-
|
|
1197
|
+
w.init(1, {
|
|
1212
1198
|
debug: !0
|
|
1213
|
-
}),
|
|
1199
|
+
}), w.getSessionURL().then((r) => {
|
|
1214
1200
|
n({ url: r });
|
|
1215
1201
|
});
|
|
1216
1202
|
break;
|
|
1217
1203
|
}
|
|
1218
1204
|
case "stop": {
|
|
1219
|
-
|
|
1205
|
+
w.stop(), n({ success: !0 });
|
|
1220
1206
|
break;
|
|
1221
1207
|
}
|
|
1222
1208
|
}
|
|
@@ -1224,49 +1210,49 @@ const Jt = () => {
|
|
|
1224
1210
|
}
|
|
1225
1211
|
));
|
|
1226
1212
|
};
|
|
1227
|
-
function
|
|
1213
|
+
function rs(s) {
|
|
1228
1214
|
var e;
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
}),
|
|
1232
|
-
|
|
1233
|
-
}),
|
|
1234
|
-
|
|
1215
|
+
s.on && ((e = s.webContents) != null && e.send) && (s.on("focus", () => {
|
|
1216
|
+
s.webContents.send("highlight.run", { visible: !0 });
|
|
1217
|
+
}), s.on("blur", () => {
|
|
1218
|
+
s.webContents.send("highlight.run", { visible: !1 });
|
|
1219
|
+
}), s.on("close", () => {
|
|
1220
|
+
s.webContents.send("highlight.run", { visible: !1 });
|
|
1235
1221
|
}));
|
|
1236
1222
|
}
|
|
1237
|
-
const
|
|
1238
|
-
next:
|
|
1223
|
+
const os = ({
|
|
1224
|
+
next: s,
|
|
1239
1225
|
payload: e
|
|
1240
1226
|
}) => {
|
|
1241
1227
|
if (typeof window != "undefined" && typeof document != "undefined" && "H" in window) {
|
|
1242
1228
|
if (e.obj.type === "track") {
|
|
1243
|
-
const t = e.obj.event,
|
|
1244
|
-
window.H.track(t,
|
|
1229
|
+
const t = e.obj.event, i = e.obj.properties;
|
|
1230
|
+
window.H.track(t, i);
|
|
1245
1231
|
} else if (e.obj.type === "identify") {
|
|
1246
1232
|
const t = e.obj.userId;
|
|
1247
1233
|
if (t != null && t.length) {
|
|
1248
|
-
const
|
|
1249
|
-
window.H.identify(t,
|
|
1234
|
+
const i = e.obj.traits;
|
|
1235
|
+
window.H.identify(t, i);
|
|
1250
1236
|
}
|
|
1251
1237
|
}
|
|
1252
1238
|
}
|
|
1253
|
-
|
|
1239
|
+
s(e);
|
|
1254
1240
|
}, $e = () => {
|
|
1255
1241
|
if (typeof window != "undefined") {
|
|
1256
1242
|
if (typeof window._highlightFetchPatch != "undefined")
|
|
1257
1243
|
return;
|
|
1258
|
-
window._originalFetch = window.fetch, window._fetchProxy = (
|
|
1244
|
+
window._originalFetch = window.fetch, window._fetchProxy = (s, e) => window._originalFetch(s, e), window._highlightFetchPatch = (s, e) => window._fetchProxy.call(window || global, s, e), window.fetch = window._highlightFetchPatch;
|
|
1259
1245
|
}
|
|
1260
1246
|
}, He = () => null, Ve = () => {
|
|
1261
1247
|
if (typeof window != "undefined") {
|
|
1262
1248
|
if (typeof window._highlightWebSocketRequestCallback != "undefined")
|
|
1263
1249
|
return;
|
|
1264
1250
|
window._highlightWebSocketRequestCallback = He, window._highlightWebSocketEventCallback = He;
|
|
1265
|
-
const
|
|
1251
|
+
const s = new Proxy(window.WebSocket, {
|
|
1266
1252
|
construct(e, t) {
|
|
1267
|
-
const [,
|
|
1253
|
+
const [, i] = Kt(), n = new e(...t), o = (g) => {
|
|
1268
1254
|
window._highlightWebSocketRequestCallback({
|
|
1269
|
-
socketId:
|
|
1255
|
+
socketId: i,
|
|
1270
1256
|
initiatorType: "websocket",
|
|
1271
1257
|
type: "open",
|
|
1272
1258
|
name: n.url,
|
|
@@ -1274,7 +1260,7 @@ const rs = ({
|
|
|
1274
1260
|
});
|
|
1275
1261
|
}, r = (g) => {
|
|
1276
1262
|
window._highlightWebSocketRequestCallback({
|
|
1277
|
-
socketId:
|
|
1263
|
+
socketId: i,
|
|
1278
1264
|
initiatorType: "websocket",
|
|
1279
1265
|
type: "close",
|
|
1280
1266
|
name: n.url,
|
|
@@ -1284,7 +1270,7 @@ const rs = ({
|
|
|
1284
1270
|
const { data: h } = g, f = typeof h == "string" ? g.data : void 0;
|
|
1285
1271
|
let m;
|
|
1286
1272
|
typeof h == "string" ? m = h.length : h instanceof Blob ? m = h.size : m = h.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1287
|
-
socketId:
|
|
1273
|
+
socketId: i,
|
|
1288
1274
|
type: "received",
|
|
1289
1275
|
name: n.url,
|
|
1290
1276
|
timeStamp: performance.timeOrigin + g.timeStamp,
|
|
@@ -1293,7 +1279,7 @@ const rs = ({
|
|
|
1293
1279
|
});
|
|
1294
1280
|
}, d = (g) => {
|
|
1295
1281
|
window._highlightWebSocketEventCallback({
|
|
1296
|
-
socketId:
|
|
1282
|
+
socketId: i,
|
|
1297
1283
|
type: "error",
|
|
1298
1284
|
name: n.url,
|
|
1299
1285
|
timeStamp: performance.timeOrigin + g.timeStamp,
|
|
@@ -1303,193 +1289,177 @@ const rs = ({
|
|
|
1303
1289
|
n.addEventListener("open", o), n.addEventListener("error", d), n.addEventListener("message", l), n.addEventListener("close", r);
|
|
1304
1290
|
const c = new Proxy(n.send, {
|
|
1305
1291
|
apply: function(g, h, f) {
|
|
1306
|
-
const m = f[0],
|
|
1292
|
+
const m = f[0], _ = typeof m == "string" ? m : void 0;
|
|
1307
1293
|
let k;
|
|
1308
1294
|
typeof m == "string" ? k = m.length : m instanceof Blob ? k = m.size : k = m.byteLength || 0, window._highlightWebSocketEventCallback({
|
|
1309
|
-
socketId:
|
|
1295
|
+
socketId: i,
|
|
1310
1296
|
type: "sent",
|
|
1311
1297
|
name: n.url,
|
|
1312
1298
|
timeStamp: performance.timeOrigin + performance.now(),
|
|
1313
1299
|
size: k,
|
|
1314
|
-
message:
|
|
1300
|
+
message: _
|
|
1315
1301
|
}), g.apply(h, f);
|
|
1316
1302
|
}
|
|
1317
1303
|
});
|
|
1318
1304
|
return n.send = c, n;
|
|
1319
1305
|
}
|
|
1320
1306
|
});
|
|
1321
|
-
window.WebSocket =
|
|
1307
|
+
window.WebSocket = s;
|
|
1322
1308
|
}
|
|
1323
1309
|
};
|
|
1324
|
-
var
|
|
1325
|
-
const b = (
|
|
1326
|
-
|
|
1327
|
-
},
|
|
1310
|
+
var Yt = /* @__PURE__ */ ((s) => (s.Device = "Device", s.WebVital = "WebVital", s.Frontend = "Frontend", s.Backend = "Backend", s))(Yt || {});
|
|
1311
|
+
const b = (s, e) => {
|
|
1312
|
+
O("warn", `highlight.run warning: (${s}): `, e);
|
|
1313
|
+
}, Xt = 200;
|
|
1328
1314
|
let B = [], q, u, M, Ue = [], te = !1;
|
|
1329
|
-
const
|
|
1315
|
+
const w = {
|
|
1330
1316
|
options: void 0,
|
|
1331
|
-
init: (
|
|
1332
|
-
var t,
|
|
1317
|
+
init: (s, e) => {
|
|
1318
|
+
var t, i, n, o, r, l, d, c;
|
|
1333
1319
|
try {
|
|
1334
|
-
if (
|
|
1320
|
+
if (w.options = e, typeof window == "undefined" || typeof document == "undefined")
|
|
1335
1321
|
return;
|
|
1336
|
-
if (!
|
|
1322
|
+
if (!s) {
|
|
1337
1323
|
console.info(
|
|
1338
1324
|
"Highlight is not initializing because projectID was passed undefined."
|
|
1339
1325
|
);
|
|
1340
1326
|
return;
|
|
1341
1327
|
}
|
|
1342
|
-
e != null && e.sessionCookie ?
|
|
1328
|
+
e != null && e.sessionCookie ? It() : ze(!1);
|
|
1343
1329
|
const g = F();
|
|
1344
|
-
let h =
|
|
1345
|
-
if (e != null && e.sessionKey ? h =
|
|
1346
|
-
`${
|
|
1330
|
+
let h = T();
|
|
1331
|
+
if (e != null && e.sessionKey ? h = T(
|
|
1332
|
+
`${s}-${e.sessionKey}`
|
|
1347
1333
|
) : g != null && g.sessionSecureID && (h = g.sessionSecureID), te)
|
|
1348
1334
|
return { sessionSecureID: h };
|
|
1349
1335
|
te = !0, $e(), Ve();
|
|
1350
|
-
const f = y(
|
|
1351
|
-
organizationID:
|
|
1352
|
-
firstloadVersion:
|
|
1336
|
+
const f = y(p({}, e), {
|
|
1337
|
+
organizationID: s,
|
|
1338
|
+
firstloadVersion: Ct,
|
|
1353
1339
|
environment: (e == null ? void 0 : e.environment) || "production",
|
|
1354
1340
|
appVersion: e == null ? void 0 : e.version,
|
|
1355
1341
|
sessionSecureID: h
|
|
1356
1342
|
});
|
|
1357
|
-
return M = new I(f), e != null && e.manualStart || M.startListening(), u = u != null ? u : new ee(f, M), e != null && e.manualStart || u.initialize(), !((
|
|
1343
|
+
return M = new I(f), e != null && e.manualStart || M.startListening(), u = u != null ? u : new ee(f, M), e != null && e.manualStart || u.initialize(), !((i = (t = e == null ? void 0 : e.integrations) == null ? void 0 : t.mixpanel) != null && i.disabled) && ((o = (n = e == null ? void 0 : e.integrations) == null ? void 0 : n.mixpanel) != null && o.projectToken) && ct(e.integrations.mixpanel), !((l = (r = e == null ? void 0 : e.integrations) == null ? void 0 : r.amplitude) != null && l.disabled) && ((c = (d = e == null ? void 0 : e.integrations) == null ? void 0 : d.amplitude) != null && c.apiKey) && lt(e.integrations.amplitude), { sessionSecureID: h };
|
|
1358
1344
|
} catch (g) {
|
|
1359
1345
|
b("init", g);
|
|
1360
1346
|
}
|
|
1361
1347
|
},
|
|
1362
|
-
snapshot: (
|
|
1348
|
+
snapshot: (s) => R(void 0, null, function* () {
|
|
1363
1349
|
try {
|
|
1364
1350
|
if (u && u.ready)
|
|
1365
|
-
return yield u.snapshot(
|
|
1351
|
+
return yield u.snapshot(s);
|
|
1366
1352
|
} catch (e) {
|
|
1367
1353
|
b("snapshot", e);
|
|
1368
1354
|
}
|
|
1369
1355
|
}),
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
userName: e,
|
|
1373
|
-
userEmail: t,
|
|
1374
|
-
timestampOverride: s
|
|
1375
|
-
}) => {
|
|
1376
|
-
try {
|
|
1377
|
-
p.onHighlightReady(
|
|
1378
|
-
() => u.addSessionFeedback({
|
|
1379
|
-
verbatim: i,
|
|
1380
|
-
timestamp: s || (/* @__PURE__ */ new Date()).toISOString(),
|
|
1381
|
-
user_email: t,
|
|
1382
|
-
user_name: e
|
|
1383
|
-
})
|
|
1384
|
-
);
|
|
1385
|
-
} catch (n) {
|
|
1386
|
-
b("error", n);
|
|
1387
|
-
}
|
|
1356
|
+
/** @deprecated Session feedback is no longer supported. This is a no-op. */
|
|
1357
|
+
addSessionFeedback: () => {
|
|
1388
1358
|
},
|
|
1389
|
-
consumeError: (
|
|
1359
|
+
consumeError: (s, e, t) => {
|
|
1390
1360
|
try {
|
|
1391
|
-
|
|
1361
|
+
w.onHighlightReady(
|
|
1392
1362
|
() => u.consumeCustomError(
|
|
1393
|
-
|
|
1363
|
+
s,
|
|
1394
1364
|
e,
|
|
1395
1365
|
JSON.stringify(t)
|
|
1396
1366
|
)
|
|
1397
1367
|
);
|
|
1398
|
-
} catch (
|
|
1399
|
-
b("error",
|
|
1368
|
+
} catch (i) {
|
|
1369
|
+
b("error", i);
|
|
1400
1370
|
}
|
|
1401
1371
|
},
|
|
1402
|
-
consume: (
|
|
1372
|
+
consume: (s, e) => {
|
|
1403
1373
|
try {
|
|
1404
|
-
|
|
1374
|
+
w.onHighlightReady(() => u.consumeError(s, e));
|
|
1405
1375
|
} catch (t) {
|
|
1406
1376
|
b("error", t);
|
|
1407
1377
|
}
|
|
1408
1378
|
},
|
|
1409
|
-
error: (
|
|
1379
|
+
error: (s, e) => {
|
|
1410
1380
|
try {
|
|
1411
|
-
|
|
1412
|
-
() => u.pushCustomError(
|
|
1381
|
+
w.onHighlightReady(
|
|
1382
|
+
() => u.pushCustomError(s, JSON.stringify(e))
|
|
1413
1383
|
);
|
|
1414
1384
|
} catch (t) {
|
|
1415
1385
|
b("error", t);
|
|
1416
1386
|
}
|
|
1417
1387
|
},
|
|
1418
|
-
track: (
|
|
1419
|
-
var t,
|
|
1388
|
+
track: (s, e = {}) => {
|
|
1389
|
+
var t, i, n, o, r, l, d, c, g, h, f;
|
|
1420
1390
|
try {
|
|
1421
|
-
|
|
1422
|
-
u.addProperties(y(
|
|
1423
|
-
event:
|
|
1391
|
+
w.onHighlightReady(() => {
|
|
1392
|
+
u.addProperties(y(p({}, e), { event: s })), u.log("H.track", "INFO", y(p({}, e != null ? e : {}), {
|
|
1393
|
+
event: s
|
|
1424
1394
|
}));
|
|
1425
1395
|
});
|
|
1426
1396
|
const m = u == null ? void 0 : u.getCurrentSessionURL();
|
|
1427
|
-
(n = (
|
|
1397
|
+
(n = (i = (t = w.options) == null ? void 0 : t.integrations) == null ? void 0 : i.mixpanel) != null && n.disabled || (o = window.mixpanel) != null && o.track && window.mixpanel.track(s, y(p({}, e), {
|
|
1428
1398
|
highlightSessionURL: m
|
|
1429
|
-
})), (d = (l = (r =
|
|
1399
|
+
})), (d = (l = (r = w.options) == null ? void 0 : r.integrations) == null ? void 0 : l.amplitude) != null && d.disabled || (c = window.amplitude) != null && c.getInstance && window.amplitude.getInstance().logEvent(s, y(p({}, e), {
|
|
1430
1400
|
highlightSessionURL: m
|
|
1431
|
-
})), (f = (h = (g =
|
|
1401
|
+
})), (f = (h = (g = w.options) == null ? void 0 : g.integrations) == null ? void 0 : h.intercom) != null && f.disabled || window.Intercom && window.Intercom("trackEvent", s, e);
|
|
1432
1402
|
} catch (m) {
|
|
1433
1403
|
b("track", m);
|
|
1434
1404
|
}
|
|
1435
1405
|
},
|
|
1436
|
-
log: (
|
|
1406
|
+
log: (s, e, t) => {
|
|
1437
1407
|
try {
|
|
1438
|
-
|
|
1439
|
-
() => u.log(
|
|
1408
|
+
w.onHighlightReady(
|
|
1409
|
+
() => u.log(s, e, t != null ? t : {})
|
|
1440
1410
|
);
|
|
1441
|
-
} catch (
|
|
1442
|
-
b("log",
|
|
1411
|
+
} catch (i) {
|
|
1412
|
+
b("log", i);
|
|
1443
1413
|
}
|
|
1444
1414
|
},
|
|
1445
|
-
start: (
|
|
1415
|
+
start: (s) => {
|
|
1446
1416
|
var e;
|
|
1447
|
-
(u == null ? void 0 : u.state) === "Recording" && !(
|
|
1417
|
+
(u == null ? void 0 : u.state) === "Recording" && !(s != null && s.forceNew) ? s != null && s.silent || console.warn(
|
|
1448
1418
|
"Highlight is already recording. Please `H.stop()` the current session before starting a new one."
|
|
1449
|
-
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(),
|
|
1450
|
-
() =>
|
|
1451
|
-
yield u.initialize(
|
|
1419
|
+
) : (((e = u == null ? void 0 : u._firstLoadListeners) != null ? e : M).startListening(), w.onHighlightReady(
|
|
1420
|
+
() => R(void 0, null, function* () {
|
|
1421
|
+
yield u.initialize(s);
|
|
1452
1422
|
}),
|
|
1453
1423
|
{ waitForReady: !1 }
|
|
1454
1424
|
));
|
|
1455
1425
|
},
|
|
1456
|
-
stop: (
|
|
1457
|
-
(u == null ? void 0 : u.state) !== "Recording" ?
|
|
1426
|
+
stop: (s) => {
|
|
1427
|
+
(u == null ? void 0 : u.state) !== "Recording" ? s != null && s.silent || console.warn(
|
|
1458
1428
|
"Highlight is already stopped. Please call `H.start()`."
|
|
1459
|
-
) :
|
|
1429
|
+
) : w.onHighlightReady(() => u.stopRecording(!0));
|
|
1460
1430
|
},
|
|
1461
|
-
identify: (
|
|
1462
|
-
var
|
|
1431
|
+
identify: (s, e = {}, t) => {
|
|
1432
|
+
var i, n, o, r, l, d, c, g;
|
|
1463
1433
|
try {
|
|
1464
|
-
|
|
1465
|
-
() => u.identify(
|
|
1434
|
+
w.onHighlightReady(
|
|
1435
|
+
() => u.identify(s, e, t)
|
|
1466
1436
|
);
|
|
1467
1437
|
} catch (h) {
|
|
1468
1438
|
b("identify", h);
|
|
1469
1439
|
}
|
|
1470
|
-
if ((o = (n = (
|
|
1471
|
-
typeof (e == null ? void 0 : e.email) == "string" ? e == null ? void 0 : e.email :
|
|
1472
|
-
), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l =
|
|
1440
|
+
if ((o = (n = (i = w.options) == null ? void 0 : i.integrations) == null ? void 0 : n.mixpanel) != null && o.disabled || (r = window.mixpanel) != null && r.identify && (window.mixpanel.identify(
|
|
1441
|
+
typeof (e == null ? void 0 : e.email) == "string" ? e == null ? void 0 : e.email : s
|
|
1442
|
+
), e && (window.mixpanel.track("identify", e), window.mixpanel.people.set(e))), !((c = (d = (l = w.options) == null ? void 0 : l.integrations) == null ? void 0 : d.amplitude) != null && c.disabled) && (g = window.amplitude) != null && g.getInstance && (window.amplitude.getInstance().setUserId(s), Object.keys(e).length > 0)) {
|
|
1473
1443
|
const h = Object.keys(
|
|
1474
1444
|
e
|
|
1475
1445
|
).reduce((f, m) => (f.set(m, e[m]), f), new window.amplitude.Identify());
|
|
1476
1446
|
window.amplitude.getInstance().identify(h);
|
|
1477
1447
|
}
|
|
1478
1448
|
},
|
|
1479
|
-
metrics: (
|
|
1449
|
+
metrics: (s) => {
|
|
1480
1450
|
try {
|
|
1481
|
-
for (const e of
|
|
1482
|
-
|
|
1451
|
+
for (const e of s)
|
|
1452
|
+
w.recordMetric(e);
|
|
1483
1453
|
} catch (e) {
|
|
1484
1454
|
b("metrics", e);
|
|
1485
1455
|
}
|
|
1486
1456
|
},
|
|
1487
|
-
recordMetric: (
|
|
1457
|
+
recordMetric: (s) => {
|
|
1488
1458
|
try {
|
|
1489
|
-
|
|
1459
|
+
w.onHighlightReady(() => {
|
|
1490
1460
|
var e;
|
|
1491
|
-
u.recordGauge(y(
|
|
1492
|
-
tags: (e =
|
|
1461
|
+
u.recordGauge(y(p({}, s), {
|
|
1462
|
+
tags: (e = s.tags) != null ? e : [],
|
|
1493
1463
|
group: window.location.href,
|
|
1494
1464
|
category: "Frontend"
|
|
1495
1465
|
/* Frontend */
|
|
@@ -1499,108 +1469,108 @@ const p = {
|
|
|
1499
1469
|
b("recordMetric", e);
|
|
1500
1470
|
}
|
|
1501
1471
|
},
|
|
1502
|
-
recordCount: (
|
|
1472
|
+
recordCount: (s) => {
|
|
1503
1473
|
try {
|
|
1504
|
-
|
|
1505
|
-
u.recordCount(
|
|
1474
|
+
w.onHighlightReady(() => {
|
|
1475
|
+
u.recordCount(s);
|
|
1506
1476
|
});
|
|
1507
1477
|
} catch (e) {
|
|
1508
1478
|
b("recordCount", e);
|
|
1509
1479
|
}
|
|
1510
1480
|
},
|
|
1511
|
-
recordIncr: (
|
|
1481
|
+
recordIncr: (s) => {
|
|
1512
1482
|
try {
|
|
1513
|
-
|
|
1514
|
-
u.recordIncr(
|
|
1483
|
+
w.onHighlightReady(() => {
|
|
1484
|
+
u.recordIncr(s);
|
|
1515
1485
|
});
|
|
1516
1486
|
} catch (e) {
|
|
1517
1487
|
b("recordIncr", e);
|
|
1518
1488
|
}
|
|
1519
1489
|
},
|
|
1520
|
-
recordHistogram: (
|
|
1490
|
+
recordHistogram: (s) => {
|
|
1521
1491
|
try {
|
|
1522
|
-
|
|
1523
|
-
u.recordHistogram(
|
|
1492
|
+
w.onHighlightReady(() => {
|
|
1493
|
+
u.recordHistogram(s);
|
|
1524
1494
|
});
|
|
1525
1495
|
} catch (e) {
|
|
1526
1496
|
b("recordHistogram", e);
|
|
1527
1497
|
}
|
|
1528
1498
|
},
|
|
1529
|
-
recordUpDownCounter: (
|
|
1499
|
+
recordUpDownCounter: (s) => {
|
|
1530
1500
|
try {
|
|
1531
|
-
|
|
1532
|
-
u.recordUpDownCounter(
|
|
1501
|
+
w.onHighlightReady(() => {
|
|
1502
|
+
u.recordUpDownCounter(s);
|
|
1533
1503
|
});
|
|
1534
1504
|
} catch (e) {
|
|
1535
1505
|
b("recordUpDownCounter", e);
|
|
1536
1506
|
}
|
|
1537
1507
|
},
|
|
1538
|
-
startSpan: (
|
|
1539
|
-
const n =
|
|
1508
|
+
startSpan: (s, e, t, i) => {
|
|
1509
|
+
const n = Oe();
|
|
1540
1510
|
if (!n) {
|
|
1541
1511
|
const r = Pe();
|
|
1542
|
-
return
|
|
1512
|
+
return i === void 0 && t === void 0 ? e(r) : i === void 0 ? t(r) : i(r);
|
|
1543
1513
|
}
|
|
1544
1514
|
const o = (r, l) => {
|
|
1545
1515
|
const d = l(r);
|
|
1546
1516
|
return d instanceof Promise ? d.finally(() => r.end()) : (r.end(), d);
|
|
1547
1517
|
};
|
|
1548
|
-
return
|
|
1549
|
-
|
|
1518
|
+
return i === void 0 && t === void 0 ? n.startActiveSpan(
|
|
1519
|
+
s,
|
|
1550
1520
|
(r) => o(r, e)
|
|
1551
|
-
) :
|
|
1552
|
-
|
|
1521
|
+
) : i === void 0 ? n.startActiveSpan(
|
|
1522
|
+
s,
|
|
1553
1523
|
e,
|
|
1554
1524
|
(r) => o(r, t)
|
|
1555
1525
|
) : n.startActiveSpan(
|
|
1556
|
-
|
|
1526
|
+
s,
|
|
1557
1527
|
e,
|
|
1558
1528
|
t,
|
|
1559
|
-
(r) => o(r,
|
|
1529
|
+
(r) => o(r, i)
|
|
1560
1530
|
);
|
|
1561
1531
|
},
|
|
1562
|
-
startManualSpan: (
|
|
1563
|
-
const n =
|
|
1532
|
+
startManualSpan: (s, e, t, i) => {
|
|
1533
|
+
const n = Oe();
|
|
1564
1534
|
if (!n) {
|
|
1565
1535
|
const o = Pe();
|
|
1566
|
-
return
|
|
1536
|
+
return i === void 0 && t === void 0 ? e(o) : i === void 0 ? t(o) : i(o);
|
|
1567
1537
|
}
|
|
1568
|
-
return
|
|
1569
|
-
|
|
1538
|
+
return i === void 0 && t === void 0 ? n.startActiveSpan(s, e) : i === void 0 ? n.startActiveSpan(
|
|
1539
|
+
s,
|
|
1570
1540
|
e,
|
|
1571
1541
|
t
|
|
1572
1542
|
) : n.startActiveSpan(
|
|
1573
|
-
|
|
1543
|
+
s,
|
|
1574
1544
|
e,
|
|
1575
1545
|
t,
|
|
1576
|
-
|
|
1546
|
+
i
|
|
1577
1547
|
);
|
|
1578
1548
|
},
|
|
1579
|
-
getSessionURL: () => new Promise((
|
|
1580
|
-
|
|
1581
|
-
const t = u.sessionData.sessionSecureID,
|
|
1582
|
-
|
|
1583
|
-
`https://${Z}/${
|
|
1549
|
+
getSessionURL: () => new Promise((s, e) => {
|
|
1550
|
+
w.onHighlightReady(() => {
|
|
1551
|
+
const t = u.sessionData.sessionSecureID, i = F(t);
|
|
1552
|
+
i ? s(
|
|
1553
|
+
`https://${Z}/${i.projectID}/sessions/${t}`
|
|
1584
1554
|
) : e(new Error(`Unable to get session URL: ${t}`));
|
|
1585
1555
|
});
|
|
1586
1556
|
}),
|
|
1587
|
-
getSessionDetails: () => new Promise((
|
|
1588
|
-
|
|
1557
|
+
getSessionDetails: () => new Promise((s, e) => {
|
|
1558
|
+
w.onHighlightReady(() => R(void 0, null, function* () {
|
|
1589
1559
|
try {
|
|
1590
|
-
const t = yield
|
|
1560
|
+
const t = yield w.getSessionURL();
|
|
1591
1561
|
if (!t)
|
|
1592
1562
|
throw new Error("Could not get session URL");
|
|
1593
|
-
const
|
|
1563
|
+
const i = u.sessionData.sessionSecureID, n = F(i), o = n == null ? void 0 : n.sessionStartTime;
|
|
1594
1564
|
if (!o)
|
|
1595
1565
|
throw new Error("Could not get session start timestamp");
|
|
1596
1566
|
const r = (/* @__PURE__ */ new Date()).getTime(), l = new URL(t), d = new URL(t);
|
|
1597
1567
|
d.searchParams.set(
|
|
1598
1568
|
"ts",
|
|
1599
1569
|
((r - o) / 1e3).toString()
|
|
1600
|
-
),
|
|
1570
|
+
), s({
|
|
1601
1571
|
url: l.toString(),
|
|
1602
1572
|
urlWithTimestamp: d.toString(),
|
|
1603
|
-
sessionSecureID:
|
|
1573
|
+
sessionSecureID: i
|
|
1604
1574
|
});
|
|
1605
1575
|
} catch (t) {
|
|
1606
1576
|
e(t);
|
|
@@ -1608,15 +1578,15 @@ const p = {
|
|
|
1608
1578
|
}));
|
|
1609
1579
|
}),
|
|
1610
1580
|
getRecordingState: () => {
|
|
1611
|
-
var
|
|
1612
|
-
return (
|
|
1581
|
+
var s;
|
|
1582
|
+
return (s = u == null ? void 0 : u.state) != null ? s : "NotRecording";
|
|
1613
1583
|
},
|
|
1614
|
-
onHighlightReady: (
|
|
1584
|
+
onHighlightReady: (s, e) => {
|
|
1615
1585
|
if (u && u.ready) {
|
|
1616
|
-
|
|
1586
|
+
s();
|
|
1617
1587
|
return;
|
|
1618
1588
|
}
|
|
1619
|
-
if (B.push({ options: e, func:
|
|
1589
|
+
if (B.push({ options: e, func: s }), q !== void 0)
|
|
1620
1590
|
return;
|
|
1621
1591
|
const t = () => {
|
|
1622
1592
|
B = B.filter((n) => {
|
|
@@ -1624,39 +1594,39 @@ const p = {
|
|
|
1624
1594
|
return !u || ((o = n.options) == null ? void 0 : o.waitForReady) !== !1 && !u.ready ? !0 : (n.func(), !1);
|
|
1625
1595
|
}), q = void 0, B.length > 0 && (q = setTimeout(
|
|
1626
1596
|
t,
|
|
1627
|
-
|
|
1597
|
+
Xt
|
|
1628
1598
|
));
|
|
1629
1599
|
};
|
|
1630
1600
|
t();
|
|
1631
1601
|
},
|
|
1632
|
-
registerLD(
|
|
1633
|
-
Ue.length || (
|
|
1634
|
-
u.registerLD(
|
|
1635
|
-
}),
|
|
1602
|
+
registerLD(s) {
|
|
1603
|
+
Ue.length || (w.onHighlightReady(() => {
|
|
1604
|
+
u.registerLD(s);
|
|
1605
|
+
}), Dt(this, s, w.options), Ue.push(new We(s)));
|
|
1636
1606
|
}
|
|
1637
1607
|
};
|
|
1638
|
-
typeof window != "undefined" && (window.H =
|
|
1639
|
-
|
|
1608
|
+
typeof window != "undefined" && (window.H = w);
|
|
1609
|
+
Qt();
|
|
1640
1610
|
$e();
|
|
1641
1611
|
Ve();
|
|
1642
|
-
const
|
|
1612
|
+
const as = {
|
|
1643
1613
|
reset: () => {
|
|
1644
1614
|
te = !1, u = void 0, B = [], q = void 0, M = void 0;
|
|
1645
1615
|
},
|
|
1646
|
-
setHighlightObj: (
|
|
1647
|
-
u =
|
|
1616
|
+
setHighlightObj: (s) => {
|
|
1617
|
+
u = s;
|
|
1648
1618
|
}
|
|
1649
1619
|
};
|
|
1650
1620
|
export {
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1621
|
+
T as GenerateSecureID,
|
|
1622
|
+
w as H,
|
|
1623
|
+
os as HighlightSegmentMiddleware,
|
|
1624
|
+
fs as LDObserve,
|
|
1625
|
+
ws as LDRecord,
|
|
1626
|
+
Yt as MetricCategory,
|
|
1627
|
+
gs as Observe,
|
|
1628
|
+
ds as Record,
|
|
1629
|
+
as as __testing,
|
|
1630
|
+
rs as configureElectronHighlight
|
|
1661
1631
|
};
|
|
1662
1632
|
//# sourceMappingURL=index.js.map
|