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