@flashlog/tracker-sdk 0.1.0 → 0.1.1

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.
@@ -1,15 +1,15 @@
1
- const br = (e) => {
1
+ const vr = (e) => {
2
2
  const t = e.trim();
3
3
  return t.length > 0 ? t : null;
4
- }, vr = () => {
4
+ }, wr = () => {
5
5
  if (typeof window > "u")
6
6
  return null;
7
7
  const { hostname: e, protocol: t } = window.location;
8
8
  return e === "localhost" || e === "127.0.0.1" ? `${t}//${e}:3008/api` : null;
9
- }, wr = () => {
10
- const e = br("https://api.flashlog.app/api");
9
+ }, Ar = () => {
10
+ const e = vr("http://localhost:3008/api");
11
11
  if (e) return e;
12
- const t = vr();
12
+ const t = wr();
13
13
  return t || "https://api.flashlog.app/api";
14
14
  }, ft = /* @__PURE__ */ new Set([
15
15
  "NETWORK_ERROR",
@@ -40,7 +40,7 @@ const br = (e) => {
40
40
  "sessionToken",
41
41
  "sessionCookie",
42
42
  "sessionSecret"
43
- ], Ar = [
43
+ ], kr = [
44
44
  "password",
45
45
  "passwd",
46
46
  "authorization",
@@ -63,7 +63,7 @@ const br = (e) => {
63
63
  "sessionCookie",
64
64
  "sessionSecret"
65
65
  ], w = {
66
- apiUrl: wr(),
66
+ apiUrl: Ar(),
67
67
  apiKey: "",
68
68
  debug: !1,
69
69
  autoCapture: !0,
@@ -76,7 +76,7 @@ const br = (e) => {
76
76
  captureRequestBody: !0,
77
77
  captureResponseBody: !0,
78
78
  redactKeys: ze,
79
- redactUrlParams: Ar,
79
+ redactUrlParams: kr,
80
80
  propagateTraceHeaders: !1,
81
81
  traceOrigins: [],
82
82
  traceHeaderName: "x-flashlog-trace-id",
@@ -104,12 +104,12 @@ const br = (e) => {
104
104
  deviceId: "flashlog_tracker_device_id",
105
105
  accountId: "flashlog_tracker_account_id",
106
106
  accountTraits: "flashlog_tracker_account_traits"
107
- }, kr = (e) => {
107
+ }, Er = (e) => {
108
108
  if (e.scriptUrl)
109
109
  return e.scriptUrl;
110
110
  if (e.source === "package")
111
111
  return "package:@flashlog/tracker-sdk";
112
- }, Vt = async (e) => {
112
+ }, Pt = async (e) => {
113
113
  if (typeof window > "u" || typeof document > "u")
114
114
  return;
115
115
  const t = Number(e.brandId);
@@ -128,7 +128,7 @@ const br = (e) => {
128
128
  brand_id: t,
129
129
  url: window.location.href,
130
130
  referrer: document.referrer || void 0,
131
- script_url: kr(e)
131
+ script_url: Er(e)
132
132
  })
133
133
  });
134
134
  !n.ok && e.debug && console.warn("[FlashlogTracker] Installation ping failed", {
@@ -153,7 +153,7 @@ const br = (e) => {
153
153
  const i = Ge(s);
154
154
  return i.length === 0 ? !1 : i.length === 1 ? r.includes(i[0]) : n === i.join("") || Rr(r, i);
155
155
  });
156
- }, gt = (e, t) => e ? Ge(e).join("") === t : !1, Er = (e) => e ? Ge(e).includes("url") : !1, Tr = (e) => {
156
+ }, gt = (e, t) => e ? Ge(e).join("") === t : !1, Tr = (e) => e ? Ge(e).includes("url") : !1, _r = (e) => {
157
157
  const t = e.trim();
158
158
  if (!t.startsWith("{") && !t.startsWith("[")) return null;
159
159
  try {
@@ -162,37 +162,37 @@ const br = (e) => {
162
162
  } catch {
163
163
  return null;
164
164
  }
165
- }, Pt = (e, t) => {
165
+ }, Zt = (e, t) => {
166
166
  let r = e.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${de}`).replace(/\b(Basic\s+)[A-Za-z0-9+/=-]+/gi, `$1${de}`).replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, de);
167
167
  return r !== e && (t.redactedFieldsCount += 1), r;
168
- }, Zt = (e) => Pt(e, {
168
+ }, Ht = (e) => Zt(e, {
169
169
  redactedFieldsCount: 0
170
- }), _r = (e, t, r) => {
170
+ }), Nr = (e, t, r) => {
171
171
  try {
172
172
  const n = e.startsWith("/"), s = new URL(e, "https://flashlog.local");
173
173
  let i = !1;
174
- return s.searchParams.forEach((a, o) => {
175
- Oe(o, t.redactUrlParams) && (s.searchParams.set(o, de), i = !0);
174
+ return s.searchParams.forEach((o, c) => {
175
+ Oe(c, t.redactUrlParams) && (s.searchParams.set(c, de), i = !0);
176
176
  }), i ? (r.redactedFieldsCount += 1, n ? `${s.pathname}${s.search}${s.hash}` : s.toString()) : e;
177
177
  } catch {
178
178
  return e;
179
179
  }
180
- }, Nr = (e, t, r, n, s = /* @__PURE__ */ new WeakSet()) => {
181
- if (Er(n))
182
- return _r(e, t, r);
183
- const i = Tr(e);
180
+ }, Mr = (e, t, r, n, s = /* @__PURE__ */ new WeakSet()) => {
181
+ if (Tr(n))
182
+ return Nr(e, t, r);
183
+ const i = _r(e);
184
184
  if (i !== null) {
185
- const a = Ke(i, t, r, n, s);
186
- return JSON.stringify(a);
185
+ const o = Ke(i, t, r, n, s);
186
+ return JSON.stringify(o);
187
187
  }
188
- return Pt(e, r);
188
+ return Zt(e, r);
189
189
  }, Ke = (e, t, r, n, s = /* @__PURE__ */ new WeakSet()) => {
190
190
  if (gt(n, "requestbody") && !t.captureRequestBody || gt(n, "responsebody") && !t.captureResponseBody)
191
191
  return r.omittedFieldsCount += 1, mt;
192
192
  if (n && Oe(n, t.redactKeys))
193
193
  return r.redactedFieldsCount += 1, de;
194
194
  if (typeof e == "string")
195
- return Nr(e, t, r, n, s);
195
+ return Mr(e, t, r, n, s);
196
196
  if (Array.isArray(e))
197
197
  return e.map((i) => Ke(i, t, r, void 0, s));
198
198
  if (!e || typeof e != "object")
@@ -202,13 +202,13 @@ const br = (e) => {
202
202
  s.add(e);
203
203
  try {
204
204
  return Object.entries(e).reduce(
205
- (i, [a, o]) => (i[a] = Ke(o, t, r, a, s), i),
205
+ (i, [o, c]) => (i[o] = Ke(c, t, r, o, s), i),
206
206
  {}
207
207
  );
208
208
  } finally {
209
209
  s.delete(e);
210
210
  }
211
- }, Mr = (e, t) => {
211
+ }, Or = (e, t) => {
212
212
  const r = {
213
213
  redactedFieldsCount: 0,
214
214
  omittedFieldsCount: 0
@@ -228,17 +228,17 @@ const br = (e) => {
228
228
  }
229
229
  }
230
230
  };
231
- }, Or = () => typeof window < "u" && window.location ? window.location.href : "", Lr = 120, Ht = (e, t = Lr) => e.length > t ? e.slice(0, t) : e, lt = (e) => {
231
+ }, Lr = () => typeof window < "u" && window.location ? window.location.href : "", Fr = 120, jt = (e, t = Fr) => e.length > t ? e.slice(0, t) : e, lt = (e) => {
232
232
  const t = e == null ? void 0 : e.trim();
233
233
  if (t)
234
- return Ht(Zt(t));
234
+ return jt(Ht(t));
235
235
  }, yt = (e) => {
236
- const r = Zt(e).split(/([_:.=-])/), n = r.map((s, i) => {
236
+ const r = Ht(e).split(/([_:.=-])/), n = r.map((s, i) => {
237
237
  if (!s || /^[_:.=-]$/.test(s)) return s;
238
- const o = `${i >= 2 ? r[i - 2] : ""} ${s}`;
239
- return Oe(s, ze) || Oe(o, ze) ? de : s;
238
+ const c = `${i >= 2 ? r[i - 2] : ""} ${s}`;
239
+ return Oe(s, ze) || Oe(c, ze) ? de : s;
240
240
  });
241
- return Ht(n.join(""), 80);
241
+ return jt(n.join(""), 80);
242
242
  }, st = (e) => {
243
243
  if (!e) return "";
244
244
  if (e.id) return `#${yt(e.id)}`;
@@ -249,20 +249,20 @@ const br = (e) => {
249
249
  t.unshift(`${r.tagName.toLowerCase()}${n ? `.${n}` : ""}`), r = r.parentElement;
250
250
  }
251
251
  return t.join(" > ");
252
- }, Fr = (e) => [
252
+ }, xr = (e) => [
253
253
  e.getAttribute("name"),
254
254
  e.getAttribute("id"),
255
255
  e.getAttribute("aria-label"),
256
256
  e.getAttribute("placeholder"),
257
257
  e.getAttribute("autocomplete"),
258
258
  e.getAttribute("type")
259
- ].filter(Boolean).join(" "), xr = (e) => {
260
- const t = Fr(e);
259
+ ].filter(Boolean).join(" "), Br = (e) => {
260
+ const t = xr(e);
261
261
  return (e.getAttribute("type") || "").toLowerCase() === "password" || Oe(t, ze);
262
262
  }, ge = (e, t) => {
263
263
  const r = e == null ? void 0 : e.trim();
264
264
  if (r)
265
- return xr(t) ? de : lt(r);
265
+ return Br(t) ? de : lt(r);
266
266
  }, Dr = (e) => {
267
267
  const t = {
268
268
  tagName: e == null ? void 0 : e.tagName,
@@ -270,7 +270,7 @@ const br = (e) => {
270
270
  };
271
271
  if (!e) return t;
272
272
  if (e instanceof HTMLSelectElement) {
273
- const r = Array.from(e.selectedOptions), n = r.map((a) => ge(a.value, e)), s = r.map((a) => ge(a.text, e)), i = e.multiple;
273
+ const r = Array.from(e.selectedOptions), n = r.map((o) => ge(o.value, e)), s = r.map((o) => ge(o.text, e)), i = e.multiple;
274
274
  return {
275
275
  ...t,
276
276
  value: i ? n : n[0],
@@ -299,27 +299,27 @@ const br = (e) => {
299
299
  text: lt(e.innerText)
300
300
  };
301
301
  };
302
- class Br {
302
+ class Ur {
303
303
  constructor(t) {
304
304
  this.actions = [], this.detachHandlers = [], this.maxSize = t;
305
305
  }
306
306
  start() {
307
307
  if (typeof window > "u" || typeof document > "u" || this.detachHandlers.length > 0) return;
308
308
  const t = (i) => {
309
- const a = i.target;
309
+ const o = i.target;
310
310
  this.add("CLICK", {
311
- tagName: a == null ? void 0 : a.tagName,
312
- text: lt(a == null ? void 0 : a.innerText),
313
- selector: st(a)
311
+ tagName: o == null ? void 0 : o.tagName,
312
+ text: lt(o == null ? void 0 : o.innerText),
313
+ selector: st(o)
314
314
  });
315
315
  }, r = (i) => {
316
- const a = i.target;
317
- this.add("INPUT_CHANGE", Dr(a));
316
+ const o = i.target;
317
+ this.add("INPUT_CHANGE", Dr(o));
318
318
  }, n = (i) => {
319
- const a = i.target;
319
+ const o = i.target;
320
320
  this.add("FORM_SUBMIT", {
321
- tagName: a == null ? void 0 : a.tagName,
322
- selector: st(a)
321
+ tagName: o == null ? void 0 : o.tagName,
322
+ selector: st(o)
323
323
  });
324
324
  }, s = () => {
325
325
  this.add("VISIBILITY_CHANGE", {
@@ -341,7 +341,7 @@ class Br {
341
341
  action: t,
342
342
  details: r,
343
343
  timestamp: Date.now(),
344
- url: Or()
344
+ url: Lr()
345
345
  }), this.actions.length > this.maxSize && (this.actions = this.actions.slice(-this.maxSize));
346
346
  }
347
347
  getAll() {
@@ -351,7 +351,7 @@ class Br {
351
351
  this.actions = [];
352
352
  }
353
353
  }
354
- const Ur = (e) => {
354
+ const Wr = (e) => {
355
355
  const t = [
356
356
  { key: "edg/", name: "Edge" },
357
357
  { key: "chrome/", name: "Chrome" },
@@ -366,18 +366,18 @@ const Ur = (e) => {
366
366
  }
367
367
  }
368
368
  return { name: "Unknown", version: "unknown" };
369
- }, Wr = (e) => {
369
+ }, zr = (e) => {
370
370
  const t = e.toLowerCase();
371
371
  return t.includes("windows") ? "Windows" : t.includes("mac os") ? "MacOS" : t.includes("android") ? "Android" : t.includes("iphone") || t.includes("ipad") || t.includes("ios") ? "iOS" : t.includes("linux") ? "Linux" : "Unknown";
372
- }, zr = () => {
372
+ }, Gr = () => {
373
373
  if (typeof window > "u") return "Unknown";
374
374
  const e = window.innerWidth || 0;
375
375
  return e <= 768 ? "Mobile" : e <= 1024 ? "Tablet" : "Desktop";
376
376
  }, It = (e) => {
377
- const t = typeof navigator < "u" ? navigator : {}, r = t.userAgent || "", n = Ur(r);
377
+ const t = typeof navigator < "u" ? navigator : {}, r = t.userAgent || "", n = Wr(r);
378
378
  return {
379
- os_name: Wr(r),
380
- device_type: zr(),
379
+ os_name: zr(r),
380
+ device_type: Gr(),
381
381
  device_id: e,
382
382
  browser_name: n.name,
383
383
  browser_version: n.version,
@@ -410,7 +410,7 @@ const Ur = (e) => {
410
410
  span_id: t,
411
411
  traceparent: `00-${e}-${t}-01`
412
412
  };
413
- }, Gr = (e = {}) => {
413
+ }, Kr = (e = {}) => {
414
414
  const t = typeof e.trace_id == "string" && e.trace_id.trim() ? e.trace_id.trim() : null, r = typeof e.span_id == "string" && e.span_id.trim() ? e.span_id.trim() : null, n = typeof e.traceparent == "string" && e.traceparent.trim() ? e.traceparent.trim() : null;
415
415
  return t && r ? {
416
416
  trace_id: t,
@@ -429,8 +429,8 @@ const Ur = (e) => {
429
429
  } catch {
430
430
  return !1;
431
431
  }
432
- }, Kr = "[omitted: non-json body]";
433
- class Vr {
432
+ }, Vr = "[omitted: non-json body]";
433
+ class Pr {
434
434
  constructor(t, r) {
435
435
  this.socketMeta = /* @__PURE__ */ new WeakMap(), this.initialized = !1, this.handleWindowError = (n) => {
436
436
  var s;
@@ -443,10 +443,10 @@ class Vr {
443
443
  timestamp: Date.now()
444
444
  });
445
445
  }, this.handleUnhandledRejection = (n) => {
446
- const s = n.reason, i = s instanceof Error ? s.message : typeof s == "string" ? s : "Unhandled rejection", a = s instanceof Error ? s.stack : "";
446
+ const s = n.reason, i = s instanceof Error ? s.message : typeof s == "string" ? s : "Unhandled rejection", o = s instanceof Error ? s.stack : "";
447
447
  this.hooks.onUnhandledRejection({
448
448
  message: i,
449
- stack: a || "",
449
+ stack: o || "",
450
450
  timestamp: Date.now()
451
451
  });
452
452
  }, this.config = t, this.hooks = r;
@@ -476,28 +476,28 @@ class Vr {
476
476
  return typeof t == "string" ? t : JSON.stringify({
477
477
  body_type: this.getBodyType(t),
478
478
  captured: !1,
479
- reason: Kr
479
+ reason: Vr
480
480
  });
481
481
  }
482
482
  attachTraceHeadersToFetchRequest(t, r, n, s) {
483
483
  if (!bt(n, this.config))
484
484
  return { input: t, init: r };
485
485
  if (t instanceof Request) {
486
- const a = new Headers(t.headers);
487
- return new Headers(r == null ? void 0 : r.headers).forEach((c, d) => {
488
- a.set(d, c);
489
- }), Object.entries(s).forEach(([c, d]) => {
490
- a.set(c, d);
486
+ const o = new Headers(t.headers);
487
+ return new Headers(r == null ? void 0 : r.headers).forEach((a, d) => {
488
+ o.set(d, a);
489
+ }), Object.entries(s).forEach(([a, d]) => {
490
+ o.set(a, d);
491
491
  }), {
492
492
  input: new Request(t, {
493
493
  ...r,
494
- headers: a
494
+ headers: o
495
495
  })
496
496
  };
497
497
  }
498
498
  const i = new Headers(r == null ? void 0 : r.headers);
499
- return Object.entries(s).forEach(([a, o]) => {
500
- i.set(a, o);
499
+ return Object.entries(s).forEach(([o, c]) => {
500
+ i.set(o, c);
501
501
  }), {
502
502
  input: t,
503
503
  init: {
@@ -510,10 +510,10 @@ class Vr {
510
510
  if (typeof window.fetch != "function") return;
511
511
  const t = this;
512
512
  this.originalFetch = window.fetch, window.fetch = async function(n, s) {
513
- const i = Date.now(), a = (s == null ? void 0 : s.method) || "GET", o = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url;
514
- if (t.shouldIgnoreUrl(o))
513
+ const i = Date.now(), o = (s == null ? void 0 : s.method) || "GET", c = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url;
514
+ if (t.shouldIgnoreUrl(c))
515
515
  return t.originalFetch.call(window, n, s);
516
- const c = t.safeBodyPreview(s == null ? void 0 : s.body), d = Ve(), l = it(d, t.config.traceHeaderName), u = t.attachTraceHeadersToFetchRequest(n, s, o, l);
516
+ const a = t.safeBodyPreview(s == null ? void 0 : s.body), d = Ve(), l = it(d, t.config.traceHeaderName), u = t.attachTraceHeadersToFetchRequest(n, s, c, l);
517
517
  try {
518
518
  const h = await t.originalFetch.call(
519
519
  window,
@@ -522,8 +522,8 @@ class Vr {
522
522
  ), f = Date.now() - i;
523
523
  if ((h.ok || t.shouldIgnoreStatus(h.status)) && t.hooks.onNetworkActivity({
524
524
  type: "fetch",
525
- url: o,
526
- method: a.toUpperCase(),
525
+ url: c,
526
+ method: o.toUpperCase(),
527
527
  status: h.status,
528
528
  statusText: h.statusText,
529
529
  duration_ms: f,
@@ -540,12 +540,12 @@ class Vr {
540
540
  }
541
541
  t.hooks.onNetworkError({
542
542
  type: "fetch",
543
- url: o,
544
- method: a.toUpperCase(),
543
+ url: c,
544
+ method: o.toUpperCase(),
545
545
  status: h.status,
546
546
  statusText: h.statusText,
547
547
  duration_ms: f,
548
- request_body: t.truncate(c),
548
+ request_body: t.truncate(a),
549
549
  response_body: t.truncate(p),
550
550
  trace_id: d.trace_id,
551
551
  span_id: d.span_id,
@@ -557,12 +557,12 @@ class Vr {
557
557
  } catch (h) {
558
558
  throw t.hooks.onNetworkError({
559
559
  type: "fetch",
560
- url: o,
561
- method: a.toUpperCase(),
560
+ url: c,
561
+ method: o.toUpperCase(),
562
562
  status: 0,
563
563
  statusText: "NETWORK_ERROR",
564
564
  duration_ms: Date.now() - i,
565
- request_body: t.truncate(c),
565
+ request_body: t.truncate(a),
566
566
  response_body: t.truncate(h instanceof Error ? h.message : String(h)),
567
567
  trace_id: d.trace_id,
568
568
  span_id: d.span_id,
@@ -574,17 +574,17 @@ class Vr {
574
574
  }
575
575
  interceptXhr() {
576
576
  const t = this;
577
- this.originalXhrOpen = XMLHttpRequest.prototype.open, this.originalXhrSend = XMLHttpRequest.prototype.send, XMLHttpRequest.prototype.open = function(n, s, i, a, o) {
578
- const c = s instanceof URL ? s.toString() : String(s);
577
+ this.originalXhrOpen = XMLHttpRequest.prototype.open, this.originalXhrSend = XMLHttpRequest.prototype.send, XMLHttpRequest.prototype.open = function(n, s, i, o, c) {
578
+ const a = s instanceof URL ? s.toString() : String(s);
579
579
  return this.__flashlog_meta = {
580
580
  method: (n || "GET").toUpperCase(),
581
- url: c
582
- }, t.originalXhrOpen.call(this, n, s, i ?? !0, a ?? null, o ?? null);
581
+ url: a
582
+ }, t.originalXhrOpen.call(this, n, s, i ?? !0, o ?? null, c ?? null);
583
583
  }, XMLHttpRequest.prototype.send = function(n) {
584
584
  const s = this, i = s.__flashlog_meta || {};
585
585
  if (t.shouldIgnoreUrl(i.url || ""))
586
586
  return t.originalXhrSend.call(this, n);
587
- const a = Date.now(), o = t.safeBodyPreview(n), c = Ve(), d = it(c, t.config.traceHeaderName);
587
+ const o = Date.now(), c = t.safeBodyPreview(n), a = Ve(), d = it(a, t.config.traceHeaderName);
588
588
  return bt(i.url || "", t.config) && Object.entries(d).forEach(([l, u]) => {
589
589
  try {
590
590
  s.setRequestHeader(l, u);
@@ -602,10 +602,10 @@ class Vr {
602
602
  method: i.method || "GET",
603
603
  status: l,
604
604
  statusText: s.statusText || "HTTP_RESULT",
605
- duration_ms: Date.now() - a,
606
- trace_id: c.trace_id,
607
- span_id: c.span_id,
608
- traceparent: c.traceparent,
605
+ duration_ms: Date.now() - o,
606
+ trace_id: a.trace_id,
607
+ span_id: a.span_id,
608
+ traceparent: a.traceparent,
609
609
  timestamp: Date.now()
610
610
  }), l >= 400 && !t.shouldIgnoreStatus(l) && t.hooks.onNetworkError({
611
611
  type: "xhr",
@@ -613,12 +613,12 @@ class Vr {
613
613
  method: i.method || "GET",
614
614
  status: l,
615
615
  statusText: s.statusText || "HTTP_ERROR",
616
- duration_ms: Date.now() - a,
617
- request_body: t.truncate(o),
616
+ duration_ms: Date.now() - o,
617
+ request_body: t.truncate(c),
618
618
  response_body: t.truncate(s.responseText || ""),
619
- trace_id: c.trace_id,
620
- span_id: c.span_id,
621
- traceparent: c.traceparent,
619
+ trace_id: a.trace_id,
620
+ span_id: a.span_id,
621
+ traceparent: a.traceparent,
622
622
  timestamp: Date.now()
623
623
  });
624
624
  }), s.addEventListener("error", () => {
@@ -628,12 +628,12 @@ class Vr {
628
628
  method: i.method || "GET",
629
629
  status: 0,
630
630
  statusText: "NETWORK_ERROR",
631
- duration_ms: Date.now() - a,
632
- request_body: t.truncate(o),
631
+ duration_ms: Date.now() - o,
632
+ request_body: t.truncate(c),
633
633
  response_body: "XHR network error",
634
- trace_id: c.trace_id,
635
- span_id: c.span_id,
636
- traceparent: c.traceparent,
634
+ trace_id: a.trace_id,
635
+ span_id: a.span_id,
636
+ traceparent: a.traceparent,
637
637
  timestamp: Date.now()
638
638
  });
639
639
  }), t.originalXhrSend.call(this, n);
@@ -643,35 +643,35 @@ class Vr {
643
643
  if (typeof window.WebSocket != "function") return;
644
644
  const t = this;
645
645
  this.originalWebSocket = window.WebSocket;
646
- const r = this.originalWebSocket, n = function(i, a) {
647
- const o = i instanceof URL ? i.toString() : String(i), c = a !== void 0 ? new r(i, a) : new r(i);
648
- return t.shouldIgnoreUrl(o) || (t.socketMeta.set(c, {
649
- url: o,
646
+ const r = this.originalWebSocket, n = function(i, o) {
647
+ const c = i instanceof URL ? i.toString() : String(i), a = o !== void 0 ? new r(i, o) : new r(i);
648
+ return t.shouldIgnoreUrl(c) || (t.socketMeta.set(a, {
649
+ url: c,
650
650
  createdAt: Date.now(),
651
651
  openedAt: null
652
- }), c.addEventListener("open", () => {
653
- const d = t.socketMeta.get(c);
652
+ }), a.addEventListener("open", () => {
653
+ const d = t.socketMeta.get(a);
654
654
  d && (d.openedAt = Date.now());
655
- }), c.addEventListener("error", () => {
656
- const d = t.socketMeta.get(c), l = (d == null ? void 0 : d.openedAt) || (d == null ? void 0 : d.createdAt) || Date.now();
655
+ }), a.addEventListener("error", () => {
656
+ const d = t.socketMeta.get(a), l = (d == null ? void 0 : d.openedAt) || (d == null ? void 0 : d.createdAt) || Date.now();
657
657
  t.hooks.onSocketError({
658
658
  type: "websocket",
659
659
  phase: "error",
660
- url: (d == null ? void 0 : d.url) || o,
660
+ url: (d == null ? void 0 : d.url) || c,
661
661
  method: "CONNECT",
662
662
  status: 0,
663
663
  statusText: "WEBSOCKET_ERROR",
664
664
  duration_ms: Date.now() - l,
665
665
  timestamp: Date.now()
666
666
  });
667
- }), c.addEventListener("close", (d) => {
667
+ }), a.addEventListener("close", (d) => {
668
668
  if (d.code === 1e3 || d.code === 1001)
669
669
  return;
670
- const l = t.socketMeta.get(c), u = (l == null ? void 0 : l.openedAt) || (l == null ? void 0 : l.createdAt) || Date.now();
670
+ const l = t.socketMeta.get(a), u = (l == null ? void 0 : l.openedAt) || (l == null ? void 0 : l.createdAt) || Date.now();
671
671
  t.hooks.onSocketError({
672
672
  type: "websocket",
673
673
  phase: "close",
674
- url: (l == null ? void 0 : l.url) || o,
674
+ url: (l == null ? void 0 : l.url) || c,
675
675
  method: "CONNECT",
676
676
  status: 0,
677
677
  socket_close_code: d.code,
@@ -680,7 +680,7 @@ class Vr {
680
680
  duration_ms: Date.now() - u,
681
681
  timestamp: Date.now()
682
682
  });
683
- })), c;
683
+ })), a;
684
684
  };
685
685
  n.prototype = r.prototype, Object.defineProperty(n, "CONNECTING", {
686
686
  value: r.CONNECTING
@@ -697,7 +697,7 @@ var F;
697
697
  (function(e) {
698
698
  e[e.Document = 0] = "Document", e[e.DocumentType = 1] = "DocumentType", e[e.Element = 2] = "Element", e[e.Text = 3] = "Text", e[e.CDATA = 4] = "CDATA", e[e.Comment = 5] = "Comment";
699
699
  })(F || (F = {}));
700
- function Pr(e) {
700
+ function Zr(e) {
701
701
  return e.nodeType === e.ELEMENT_NODE;
702
702
  }
703
703
  function Ne(e) {
@@ -707,30 +707,30 @@ function Ne(e) {
707
707
  function Me(e) {
708
708
  return Object.prototype.toString.call(e) === "[object ShadowRoot]";
709
709
  }
710
- function Zr(e) {
710
+ function Hr(e) {
711
711
  return e.includes(" background-clip: text;") && !e.includes(" -webkit-background-clip: text;") && (e = e.replace(" background-clip: text;", " -webkit-background-clip: text; background-clip: text;")), e;
712
712
  }
713
- function at(e) {
713
+ function ot(e) {
714
714
  try {
715
715
  var t = e.rules || e.cssRules;
716
- return t ? Zr(Array.from(t).map(jt).join("")) : null;
716
+ return t ? Hr(Array.from(t).map(Jt).join("")) : null;
717
717
  } catch {
718
718
  return null;
719
719
  }
720
720
  }
721
- function jt(e) {
721
+ function Jt(e) {
722
722
  var t = e.cssText;
723
- if (Hr(e))
723
+ if (jr(e))
724
724
  try {
725
- t = at(e.styleSheet) || t;
725
+ t = ot(e.styleSheet) || t;
726
726
  } catch {
727
727
  }
728
728
  return t;
729
729
  }
730
- function Hr(e) {
730
+ function jr(e) {
731
731
  return "styleSheet" in e;
732
732
  }
733
- var Jt = function() {
733
+ var qt = function() {
734
734
  function e() {
735
735
  this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
736
736
  }
@@ -769,58 +769,58 @@ var Jt = function() {
769
769
  this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
770
770
  }, e;
771
771
  }();
772
- function jr() {
773
- return new Jt();
772
+ function Jr() {
773
+ return new qt();
774
774
  }
775
775
  function ut(e) {
776
- var t = e.maskInputOptions, r = e.tagName, n = e.type, s = e.value, i = e.maskInputFn, a = s || "";
777
- return (t[r.toLowerCase()] || t[n]) && (i ? a = i(a) : a = "*".repeat(a.length)), a;
776
+ var t = e.maskInputOptions, r = e.tagName, n = e.type, s = e.value, i = e.maskInputFn, o = s || "";
777
+ return (t[r.toLowerCase()] || t[n]) && (i ? o = i(o) : o = "*".repeat(o.length)), o;
778
778
  }
779
779
  var vt = "__rrweb_original__";
780
- function Jr(e) {
780
+ function qr(e) {
781
781
  var t = e.getContext("2d");
782
782
  if (!t)
783
783
  return !0;
784
784
  for (var r = 50, n = 0; n < e.width; n += r)
785
785
  for (var s = 0; s < e.height; s += r) {
786
- var i = t.getImageData, a = vt in i ? i[vt] : i, o = new Uint32Array(a.call(t, n, s, Math.min(r, e.width - n), Math.min(r, e.height - s)).data.buffer);
787
- if (o.some(function(c) {
788
- return c !== 0;
786
+ var i = t.getImageData, o = vt in i ? i[vt] : i, c = new Uint32Array(o.call(t, n, s, Math.min(r, e.width - n), Math.min(r, e.height - s)).data.buffer);
787
+ if (c.some(function(a) {
788
+ return a !== 0;
789
789
  }))
790
790
  return !1;
791
791
  }
792
792
  return !0;
793
793
  }
794
- var qr = 1, Yr = new RegExp("[^a-z0-9-_:]"), Le = -2;
795
- function qt() {
796
- return qr++;
794
+ var Yr = 1, Xr = new RegExp("[^a-z0-9-_:]"), Le = -2;
795
+ function Yt() {
796
+ return Yr++;
797
797
  }
798
- function Xr(e) {
798
+ function Qr(e) {
799
799
  if (e instanceof HTMLFormElement)
800
800
  return "form";
801
801
  var t = e.tagName.toLowerCase().trim();
802
- return Yr.test(t) ? "div" : t;
802
+ return Xr.test(t) ? "div" : t;
803
803
  }
804
- function Qr(e) {
804
+ function $r(e) {
805
805
  return e.cssRules ? Array.from(e.cssRules).map(function(t) {
806
806
  return t.cssText || "";
807
807
  }).join("") : "";
808
808
  }
809
- function $r(e) {
809
+ function en(e) {
810
810
  var t = "";
811
811
  return e.indexOf("//") > -1 ? t = e.split("/").slice(0, 3).join("/") : t = e.split("/")[0], t = t.split("?")[0], t;
812
812
  }
813
- var ye, wt, en = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, tn = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/, rn = /^(data:)([^,]*),(.*)/i;
813
+ var ye, wt, tn = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, rn = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/, nn = /^(data:)([^,]*),(.*)/i;
814
814
  function Pe(e, t) {
815
- return (e || "").replace(en, function(r, n, s, i, a, o) {
816
- var c = s || a || o, d = n || i || "";
817
- if (!c)
815
+ return (e || "").replace(tn, function(r, n, s, i, o, c) {
816
+ var a = s || o || c, d = n || i || "";
817
+ if (!a)
818
818
  return r;
819
- if (!tn.test(c) || rn.test(c))
820
- return "url(".concat(d).concat(c).concat(d, ")");
821
- if (c[0] === "/")
822
- return "url(".concat(d).concat($r(t) + c).concat(d, ")");
823
- var l = t.split("/"), u = c.split("/");
819
+ if (!rn.test(a) || nn.test(a))
820
+ return "url(".concat(d).concat(a).concat(d, ")");
821
+ if (a[0] === "/")
822
+ return "url(".concat(d).concat(en(t) + a).concat(d, ")");
823
+ var l = t.split("/"), u = a.split("/");
824
824
  l.pop();
825
825
  for (var h = 0, f = u; h < f.length; h++) {
826
826
  var p = f[h];
@@ -829,7 +829,7 @@ function Pe(e, t) {
829
829
  return "url(".concat(d).concat(l.join("/")).concat(d, ")");
830
830
  });
831
831
  }
832
- var nn = /^[^ \t\n\r\u000c]+/, sn = /^[, \t\n\r\u000c]+/;
832
+ var sn = /^[^ \t\n\r\u000c]+/, on = /^[, \t\n\r\u000c]+/;
833
833
  function an(e, t) {
834
834
  if (t.trim() === "")
835
835
  return t;
@@ -838,25 +838,25 @@ function an(e, t) {
838
838
  var l, u = d.exec(t.substring(r));
839
839
  return u ? (l = u[0], r += l.length, l) : "";
840
840
  }
841
- for (var s = []; n(sn), !(r >= t.length); ) {
842
- var i = n(nn);
841
+ for (var s = []; n(on), !(r >= t.length); ) {
842
+ var i = n(sn);
843
843
  if (i.slice(-1) === ",")
844
844
  i = be(e, i.substring(0, i.length - 1)), s.push(i);
845
845
  else {
846
- var a = "";
846
+ var o = "";
847
847
  i = be(e, i);
848
- for (var o = !1; ; ) {
849
- var c = t.charAt(r);
850
- if (c === "") {
851
- s.push((i + a).trim());
848
+ for (var c = !1; ; ) {
849
+ var a = t.charAt(r);
850
+ if (a === "") {
851
+ s.push((i + o).trim());
852
852
  break;
853
- } else if (o)
854
- c === ")" && (o = !1);
855
- else if (c === ",") {
856
- r += 1, s.push((i + a).trim());
853
+ } else if (c)
854
+ a === ")" && (c = !1);
855
+ else if (a === ",") {
856
+ r += 1, s.push((i + o).trim());
857
857
  break;
858
- } else c === "(" && (o = !0);
859
- a += c, r += 1;
858
+ } else a === "(" && (c = !0);
859
+ o += a, r += 1;
860
860
  }
861
861
  }
862
862
  }
@@ -868,17 +868,17 @@ function be(e, t) {
868
868
  var r = e.createElement("a");
869
869
  return r.href = t, r.href;
870
870
  }
871
- function on(e) {
871
+ function cn(e) {
872
872
  return !!(e.tagName === "svg" || e.ownerSVGElement);
873
873
  }
874
874
  function pt() {
875
875
  var e = document.createElement("a");
876
876
  return e.href = "", e.href;
877
877
  }
878
- function Yt(e, t, r, n) {
878
+ function Xt(e, t, r, n) {
879
879
  return r === "src" || r === "href" && n && !(t === "use" && n[0] === "#") || r === "xlink:href" && n && n[0] !== "#" || r === "background" && n && (t === "table" || t === "td" || t === "th") ? be(e, n) : r === "srcset" && n ? an(e, n) : r === "style" && n ? Pe(n, pt()) : t === "object" && r === "data" && n ? be(e, n) : n;
880
880
  }
881
- function cn(e, t, r) {
881
+ function dn(e, t, r) {
882
882
  if (typeof t == "string") {
883
883
  if (e.classList.contains(t))
884
884
  return !0;
@@ -902,7 +902,7 @@ function Ze(e, t, r) {
902
902
  }
903
903
  return r ? Ze(e.parentNode, t, r) : !1;
904
904
  }
905
- function Xt(e, t, r) {
905
+ function Qt(e, t, r) {
906
906
  var n = e.nodeType === e.ELEMENT_NODE ? e : e.parentElement;
907
907
  if (n === null)
908
908
  return !1;
@@ -913,7 +913,7 @@ function Xt(e, t, r) {
913
913
  return !0;
914
914
  return !!(r && (n.matches(r) || n.closest(r)));
915
915
  }
916
- function dn(e, t, r) {
916
+ function ln(e, t, r) {
917
917
  var n = e.contentWindow;
918
918
  if (n) {
919
919
  var s = !1, i;
@@ -923,21 +923,21 @@ function dn(e, t, r) {
923
923
  return;
924
924
  }
925
925
  if (i !== "complete") {
926
- var a = setTimeout(function() {
926
+ var o = setTimeout(function() {
927
927
  s || (t(), s = !0);
928
928
  }, r);
929
929
  e.addEventListener("load", function() {
930
- clearTimeout(a), s = !0, t();
930
+ clearTimeout(o), s = !0, t();
931
931
  });
932
932
  return;
933
933
  }
934
- var o = "about:blank";
935
- if (n.location.href !== o || e.src === o || e.src === "")
934
+ var c = "about:blank";
935
+ if (n.location.href !== c || e.src === c || e.src === "")
936
936
  return setTimeout(t, 0), e.addEventListener("load", t);
937
937
  e.addEventListener("load", t);
938
938
  }
939
939
  }
940
- function ln(e, t, r) {
940
+ function un(e, t, r) {
941
941
  var n = !1, s;
942
942
  try {
943
943
  s = e.sheet;
@@ -953,8 +953,8 @@ function ln(e, t, r) {
953
953
  });
954
954
  }
955
955
  }
956
- function un(e, t) {
957
- var r = t.doc, n = t.mirror, s = t.blockClass, i = t.blockSelector, a = t.maskTextClass, o = t.maskTextSelector, c = t.inlineStylesheet, d = t.maskInputOptions, l = d === void 0 ? {} : d, u = t.maskTextFn, h = t.maskInputFn, f = t.dataURLOptions, p = f === void 0 ? {} : f, y = t.inlineImages, S = t.recordCanvas, C = t.keepIframeSrcFn, m = t.newlyAddedElement, g = m === void 0 ? !1 : m, k = pn(r, n);
956
+ function pn(e, t) {
957
+ var r = t.doc, n = t.mirror, s = t.blockClass, i = t.blockSelector, o = t.maskTextClass, c = t.maskTextSelector, a = t.inlineStylesheet, d = t.maskInputOptions, l = d === void 0 ? {} : d, u = t.maskTextFn, h = t.maskInputFn, f = t.dataURLOptions, p = f === void 0 ? {} : f, y = t.inlineImages, S = t.recordCanvas, C = t.keepIframeSrcFn, m = t.newlyAddedElement, g = m === void 0 ? !1 : m, k = hn(r, n);
958
958
  switch (e.nodeType) {
959
959
  case e.DOCUMENT_NODE:
960
960
  return e.compatMode !== "CSS1Compat" ? {
@@ -974,11 +974,11 @@ function un(e, t) {
974
974
  rootId: k
975
975
  };
976
976
  case e.ELEMENT_NODE:
977
- return fn(e, {
977
+ return mn(e, {
978
978
  doc: r,
979
979
  blockClass: s,
980
980
  blockSelector: i,
981
- inlineStylesheet: c,
981
+ inlineStylesheet: a,
982
982
  maskInputOptions: l,
983
983
  maskInputFn: h,
984
984
  dataURLOptions: p,
@@ -989,9 +989,9 @@ function un(e, t) {
989
989
  rootId: k
990
990
  });
991
991
  case e.TEXT_NODE:
992
- return hn(e, {
993
- maskTextClass: a,
994
- maskTextSelector: o,
992
+ return fn(e, {
993
+ maskTextClass: o,
994
+ maskTextSelector: c,
995
995
  maskTextFn: u,
996
996
  rootId: k
997
997
  });
@@ -1011,43 +1011,43 @@ function un(e, t) {
1011
1011
  return !1;
1012
1012
  }
1013
1013
  }
1014
- function pn(e, t) {
1014
+ function hn(e, t) {
1015
1015
  if (t.hasNode(e)) {
1016
1016
  var r = t.getId(e);
1017
1017
  return r === 1 ? void 0 : r;
1018
1018
  }
1019
1019
  }
1020
- function hn(e, t) {
1021
- var r, n = t.maskTextClass, s = t.maskTextSelector, i = t.maskTextFn, a = t.rootId, o = e.parentNode && e.parentNode.tagName, c = e.textContent, d = o === "STYLE" ? !0 : void 0, l = o === "SCRIPT" ? !0 : void 0;
1022
- if (d && c) {
1020
+ function fn(e, t) {
1021
+ var r, n = t.maskTextClass, s = t.maskTextSelector, i = t.maskTextFn, o = t.rootId, c = e.parentNode && e.parentNode.tagName, a = e.textContent, d = c === "STYLE" ? !0 : void 0, l = c === "SCRIPT" ? !0 : void 0;
1022
+ if (d && a) {
1023
1023
  try {
1024
- e.nextSibling || e.previousSibling || !((r = e.parentNode.sheet) === null || r === void 0) && r.cssRules && (c = Qr(e.parentNode.sheet));
1024
+ e.nextSibling || e.previousSibling || !((r = e.parentNode.sheet) === null || r === void 0) && r.cssRules && (a = $r(e.parentNode.sheet));
1025
1025
  } catch (u) {
1026
1026
  console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(u), e);
1027
1027
  }
1028
- c = Pe(c, pt());
1028
+ a = Pe(a, pt());
1029
1029
  }
1030
- return l && (c = "SCRIPT_PLACEHOLDER"), !d && !l && c && Xt(e, n, s) && (c = i ? i(c) : c.replace(/[\S]/g, "*")), {
1030
+ return l && (a = "SCRIPT_PLACEHOLDER"), !d && !l && a && Qt(e, n, s) && (a = i ? i(a) : a.replace(/[\S]/g, "*")), {
1031
1031
  type: F.Text,
1032
- textContent: c || "",
1032
+ textContent: a || "",
1033
1033
  isStyle: d,
1034
- rootId: a
1034
+ rootId: o
1035
1035
  };
1036
1036
  }
1037
- function fn(e, t) {
1038
- for (var r = t.doc, n = t.blockClass, s = t.blockSelector, i = t.inlineStylesheet, a = t.maskInputOptions, o = a === void 0 ? {} : a, c = t.maskInputFn, d = t.dataURLOptions, l = d === void 0 ? {} : d, u = t.inlineImages, h = t.recordCanvas, f = t.keepIframeSrcFn, p = t.newlyAddedElement, y = p === void 0 ? !1 : p, S = t.rootId, C = cn(e, n, s), m = Xr(e), g = {}, k = e.attributes.length, U = 0; U < k; U++) {
1037
+ function mn(e, t) {
1038
+ for (var r = t.doc, n = t.blockClass, s = t.blockSelector, i = t.inlineStylesheet, o = t.maskInputOptions, c = o === void 0 ? {} : o, a = t.maskInputFn, d = t.dataURLOptions, l = d === void 0 ? {} : d, u = t.inlineImages, h = t.recordCanvas, f = t.keepIframeSrcFn, p = t.newlyAddedElement, y = p === void 0 ? !1 : p, S = t.rootId, C = dn(e, n, s), m = Qr(e), g = {}, k = e.attributes.length, U = 0; U < k; U++) {
1039
1039
  var x = e.attributes[U];
1040
- g[x.name] = Yt(r, m, x.name, x.value);
1040
+ g[x.name] = Xt(r, m, x.name, x.value);
1041
1041
  }
1042
1042
  if (m === "link" && i) {
1043
- var D = Array.from(r.styleSheets).find(function(q) {
1043
+ var B = Array.from(r.styleSheets).find(function(q) {
1044
1044
  return q.href === e.href;
1045
- }), R = null;
1046
- D && (R = at(D)), R && (delete g.rel, delete g.href, g._cssText = Pe(R, D.href));
1045
+ }), E = null;
1046
+ B && (E = ot(B)), E && (delete g.rel, delete g.href, g._cssText = Pe(E, B.href));
1047
1047
  }
1048
1048
  if (m === "style" && e.sheet && !(e.innerText || e.textContent || "").trim().length) {
1049
- var R = at(e.sheet);
1050
- R && (g._cssText = Pe(R, pt()));
1049
+ var E = ot(e.sheet);
1050
+ E && (g._cssText = Pe(E, pt()));
1051
1051
  }
1052
1052
  if (m === "input" || m === "textarea" || m === "select") {
1053
1053
  var H = e.value, j = e.checked;
@@ -1055,13 +1055,13 @@ function fn(e, t) {
1055
1055
  type: g.type,
1056
1056
  tagName: m,
1057
1057
  value: H,
1058
- maskInputOptions: o,
1059
- maskInputFn: c
1058
+ maskInputOptions: c,
1059
+ maskInputFn: a
1060
1060
  }) : j && (g.checked = j);
1061
1061
  }
1062
- if (m === "option" && (e.selected && !o.select ? g.selected = !0 : delete g.selected), m === "canvas" && h) {
1062
+ if (m === "option" && (e.selected && !c.select ? g.selected = !0 : delete g.selected), m === "canvas" && h) {
1063
1063
  if (e.__context === "2d")
1064
- Jr(e) || (g.rr_dataURL = e.toDataURL(l.type, l.quality));
1064
+ qr(e) || (g.rr_dataURL = e.toDataURL(l.type, l.quality));
1065
1065
  else if (!("__context" in e)) {
1066
1066
  var X = e.toDataURL(l.type, l.quality), Q = document.createElement("canvas");
1067
1067
  Q.width = e.width, Q.height = e.height;
@@ -1084,10 +1084,10 @@ function fn(e, t) {
1084
1084
  O.complete && O.naturalWidth !== 0 ? ee() : O.onload = ee;
1085
1085
  }
1086
1086
  if ((m === "audio" || m === "video") && (g.rr_mediaState = e.paused ? "paused" : "played", g.rr_mediaCurrentTime = e.currentTime), y || (e.scrollLeft && (g.rr_scrollLeft = e.scrollLeft), e.scrollTop && (g.rr_scrollTop = e.scrollTop)), C) {
1087
- var se = e.getBoundingClientRect(), ae = se.width, V = se.height;
1087
+ var se = e.getBoundingClientRect(), oe = se.width, V = se.height;
1088
1088
  g = {
1089
1089
  class: g.class,
1090
- rr_width: "".concat(ae, "px"),
1090
+ rr_width: "".concat(oe, "px"),
1091
1091
  rr_height: "".concat(V, "px")
1092
1092
  };
1093
1093
  }
@@ -1096,49 +1096,49 @@ function fn(e, t) {
1096
1096
  tagName: m,
1097
1097
  attributes: g,
1098
1098
  childNodes: [],
1099
- isSVG: on(e) || void 0,
1099
+ isSVG: cn(e) || void 0,
1100
1100
  needBlock: C,
1101
1101
  rootId: S
1102
1102
  };
1103
1103
  }
1104
- function E(e) {
1104
+ function R(e) {
1105
1105
  return e === void 0 ? "" : e.toLowerCase();
1106
1106
  }
1107
- function mn(e, t) {
1107
+ function gn(e, t) {
1108
1108
  if (t.comment && e.type === F.Comment)
1109
1109
  return !0;
1110
1110
  if (e.type === F.Element) {
1111
1111
  if (t.script && (e.tagName === "script" || e.tagName === "link" && e.attributes.rel === "preload" && e.attributes.as === "script" || e.tagName === "link" && e.attributes.rel === "prefetch" && typeof e.attributes.href == "string" && e.attributes.href.endsWith(".js")))
1112
1112
  return !0;
1113
- if (t.headFavicon && (e.tagName === "link" && e.attributes.rel === "shortcut icon" || e.tagName === "meta" && (E(e.attributes.name).match(/^msapplication-tile(image|color)$/) || E(e.attributes.name) === "application-name" || E(e.attributes.rel) === "icon" || E(e.attributes.rel) === "apple-touch-icon" || E(e.attributes.rel) === "shortcut icon")))
1113
+ if (t.headFavicon && (e.tagName === "link" && e.attributes.rel === "shortcut icon" || e.tagName === "meta" && (R(e.attributes.name).match(/^msapplication-tile(image|color)$/) || R(e.attributes.name) === "application-name" || R(e.attributes.rel) === "icon" || R(e.attributes.rel) === "apple-touch-icon" || R(e.attributes.rel) === "shortcut icon")))
1114
1114
  return !0;
1115
1115
  if (e.tagName === "meta") {
1116
- if (t.headMetaDescKeywords && E(e.attributes.name).match(/^description|keywords$/))
1116
+ if (t.headMetaDescKeywords && R(e.attributes.name).match(/^description|keywords$/))
1117
1117
  return !0;
1118
- if (t.headMetaSocial && (E(e.attributes.property).match(/^(og|twitter|fb):/) || E(e.attributes.name).match(/^(og|twitter):/) || E(e.attributes.name) === "pinterest"))
1118
+ if (t.headMetaSocial && (R(e.attributes.property).match(/^(og|twitter|fb):/) || R(e.attributes.name).match(/^(og|twitter):/) || R(e.attributes.name) === "pinterest"))
1119
1119
  return !0;
1120
- if (t.headMetaRobots && (E(e.attributes.name) === "robots" || E(e.attributes.name) === "googlebot" || E(e.attributes.name) === "bingbot"))
1120
+ if (t.headMetaRobots && (R(e.attributes.name) === "robots" || R(e.attributes.name) === "googlebot" || R(e.attributes.name) === "bingbot"))
1121
1121
  return !0;
1122
1122
  if (t.headMetaHttpEquiv && e.attributes["http-equiv"] !== void 0)
1123
1123
  return !0;
1124
- if (t.headMetaAuthorship && (E(e.attributes.name) === "author" || E(e.attributes.name) === "generator" || E(e.attributes.name) === "framework" || E(e.attributes.name) === "publisher" || E(e.attributes.name) === "progid" || E(e.attributes.property).match(/^article:/) || E(e.attributes.property).match(/^product:/)))
1124
+ if (t.headMetaAuthorship && (R(e.attributes.name) === "author" || R(e.attributes.name) === "generator" || R(e.attributes.name) === "framework" || R(e.attributes.name) === "publisher" || R(e.attributes.name) === "progid" || R(e.attributes.property).match(/^article:/) || R(e.attributes.property).match(/^product:/)))
1125
1125
  return !0;
1126
- if (t.headMetaVerification && (E(e.attributes.name) === "google-site-verification" || E(e.attributes.name) === "yandex-verification" || E(e.attributes.name) === "csrf-token" || E(e.attributes.name) === "p:domain_verify" || E(e.attributes.name) === "verify-v1" || E(e.attributes.name) === "verification" || E(e.attributes.name) === "shopify-checkout-api-token"))
1126
+ if (t.headMetaVerification && (R(e.attributes.name) === "google-site-verification" || R(e.attributes.name) === "yandex-verification" || R(e.attributes.name) === "csrf-token" || R(e.attributes.name) === "p:domain_verify" || R(e.attributes.name) === "verify-v1" || R(e.attributes.name) === "verification" || R(e.attributes.name) === "shopify-checkout-api-token"))
1127
1127
  return !0;
1128
1128
  }
1129
1129
  }
1130
1130
  return !1;
1131
1131
  }
1132
1132
  function ve(e, t) {
1133
- var r = t.doc, n = t.mirror, s = t.blockClass, i = t.blockSelector, a = t.maskTextClass, o = t.maskTextSelector, c = t.skipChild, d = c === void 0 ? !1 : c, l = t.inlineStylesheet, u = l === void 0 ? !0 : l, h = t.maskInputOptions, f = h === void 0 ? {} : h, p = t.maskTextFn, y = t.maskInputFn, S = t.slimDOMOptions, C = t.dataURLOptions, m = C === void 0 ? {} : C, g = t.inlineImages, k = g === void 0 ? !1 : g, U = t.recordCanvas, x = U === void 0 ? !1 : U, D = t.onSerialize, R = t.onIframeLoad, H = t.iframeLoadTimeout, j = H === void 0 ? 5e3 : H, X = t.onStylesheetLoad, Q = t.stylesheetLoadTimeout, $ = Q === void 0 ? 5e3 : Q, O = t.keepIframeSrcFn, J = O === void 0 ? function() {
1133
+ var r = t.doc, n = t.mirror, s = t.blockClass, i = t.blockSelector, o = t.maskTextClass, c = t.maskTextSelector, a = t.skipChild, d = a === void 0 ? !1 : a, l = t.inlineStylesheet, u = l === void 0 ? !0 : l, h = t.maskInputOptions, f = h === void 0 ? {} : h, p = t.maskTextFn, y = t.maskInputFn, S = t.slimDOMOptions, C = t.dataURLOptions, m = C === void 0 ? {} : C, g = t.inlineImages, k = g === void 0 ? !1 : g, U = t.recordCanvas, x = U === void 0 ? !1 : U, B = t.onSerialize, E = t.onIframeLoad, H = t.iframeLoadTimeout, j = H === void 0 ? 5e3 : H, X = t.onStylesheetLoad, Q = t.stylesheetLoadTimeout, $ = Q === void 0 ? 5e3 : Q, O = t.keepIframeSrcFn, J = O === void 0 ? function() {
1134
1134
  return !1;
1135
- } : O, ee = t.newlyAddedElement, se = ee === void 0 ? !1 : ee, ae = t.preserveWhiteSpace, V = ae === void 0 ? !0 : ae, q = un(e, {
1135
+ } : O, ee = t.newlyAddedElement, se = ee === void 0 ? !1 : ee, oe = t.preserveWhiteSpace, V = oe === void 0 ? !0 : oe, q = pn(e, {
1136
1136
  doc: r,
1137
1137
  mirror: n,
1138
1138
  blockClass: s,
1139
1139
  blockSelector: i,
1140
- maskTextClass: a,
1141
- maskTextSelector: o,
1140
+ maskTextClass: o,
1141
+ maskTextSelector: c,
1142
1142
  inlineStylesheet: u,
1143
1143
  maskInputOptions: f,
1144
1144
  maskTextFn: p,
@@ -1151,12 +1151,12 @@ function ve(e, t) {
1151
1151
  });
1152
1152
  if (!q)
1153
1153
  return console.warn(e, "not serialized"), null;
1154
- var oe;
1155
- n.hasNode(e) ? oe = n.getId(e) : mn(q, S) || !V && q.type === F.Text && !q.isStyle && !q.textContent.replace(/^\s+|\s+$/gm, "").length ? oe = Le : oe = qt();
1156
- var N = Object.assign(q, { id: oe });
1157
- if (n.add(e, N), oe === Le)
1154
+ var ae;
1155
+ n.hasNode(e) ? ae = n.getId(e) : gn(q, S) || !V && q.type === F.Text && !q.isStyle && !q.textContent.replace(/^\s+|\s+$/gm, "").length ? ae = Le : ae = Yt();
1156
+ var N = Object.assign(q, { id: ae });
1157
+ if (n.add(e, N), ae === Le)
1158
1158
  return null;
1159
- D && D(e);
1159
+ B && B(e);
1160
1160
  var te = !d;
1161
1161
  if (N.type === F.Element) {
1162
1162
  te = te && !N.needBlock, delete N.needBlock;
@@ -1170,8 +1170,8 @@ function ve(e, t) {
1170
1170
  mirror: n,
1171
1171
  blockClass: s,
1172
1172
  blockSelector: i,
1173
- maskTextClass: a,
1174
- maskTextSelector: o,
1173
+ maskTextClass: o,
1174
+ maskTextSelector: c,
1175
1175
  skipChild: d,
1176
1176
  inlineStylesheet: u,
1177
1177
  maskInputOptions: f,
@@ -1182,8 +1182,8 @@ function ve(e, t) {
1182
1182
  inlineImages: k,
1183
1183
  recordCanvas: x,
1184
1184
  preserveWhiteSpace: V,
1185
- onSerialize: D,
1186
- onIframeLoad: R,
1185
+ onSerialize: B,
1186
+ onIframeLoad: E,
1187
1187
  iframeLoadTimeout: j,
1188
1188
  onStylesheetLoad: X,
1189
1189
  stylesheetLoadTimeout: $,
@@ -1192,22 +1192,22 @@ function ve(e, t) {
1192
1192
  var P = W[I], T = ve(P, me);
1193
1193
  T && N.childNodes.push(T);
1194
1194
  }
1195
- if (Pr(e) && e.shadowRoot)
1195
+ if (Zr(e) && e.shadowRoot)
1196
1196
  for (var Y = 0, A = Array.from(e.shadowRoot.childNodes); Y < A.length; Y++) {
1197
1197
  var P = A[Y], T = ve(P, me);
1198
1198
  T && (Me(e.shadowRoot) && (T.isShadow = !0), N.childNodes.push(T));
1199
1199
  }
1200
1200
  }
1201
- return e.parentNode && Ne(e.parentNode) && Me(e.parentNode) && (N.isShadow = !0), N.type === F.Element && N.tagName === "iframe" && dn(e, function() {
1201
+ return e.parentNode && Ne(e.parentNode) && Me(e.parentNode) && (N.isShadow = !0), N.type === F.Element && N.tagName === "iframe" && ln(e, function() {
1202
1202
  var Z = e.contentDocument;
1203
- if (Z && R) {
1204
- var Ee = ve(Z, {
1203
+ if (Z && E) {
1204
+ var Re = ve(Z, {
1205
1205
  doc: Z,
1206
1206
  mirror: n,
1207
1207
  blockClass: s,
1208
1208
  blockSelector: i,
1209
- maskTextClass: a,
1210
- maskTextSelector: o,
1209
+ maskTextClass: o,
1210
+ maskTextSelector: c,
1211
1211
  skipChild: !1,
1212
1212
  inlineStylesheet: u,
1213
1213
  maskInputOptions: f,
@@ -1218,24 +1218,24 @@ function ve(e, t) {
1218
1218
  inlineImages: k,
1219
1219
  recordCanvas: x,
1220
1220
  preserveWhiteSpace: V,
1221
- onSerialize: D,
1222
- onIframeLoad: R,
1221
+ onSerialize: B,
1222
+ onIframeLoad: E,
1223
1223
  iframeLoadTimeout: j,
1224
1224
  onStylesheetLoad: X,
1225
1225
  stylesheetLoadTimeout: $,
1226
1226
  keepIframeSrcFn: J
1227
1227
  });
1228
- Ee && R(e, Ee);
1228
+ Re && E(e, Re);
1229
1229
  }
1230
- }, j), N.type === F.Element && N.tagName === "link" && N.attributes.rel === "stylesheet" && ln(e, function() {
1230
+ }, j), N.type === F.Element && N.tagName === "link" && N.attributes.rel === "stylesheet" && un(e, function() {
1231
1231
  if (X) {
1232
1232
  var Z = ve(e, {
1233
1233
  doc: r,
1234
1234
  mirror: n,
1235
1235
  blockClass: s,
1236
1236
  blockSelector: i,
1237
- maskTextClass: a,
1238
- maskTextSelector: o,
1237
+ maskTextClass: o,
1238
+ maskTextSelector: c,
1239
1239
  skipChild: !1,
1240
1240
  inlineStylesheet: u,
1241
1241
  maskInputOptions: f,
@@ -1246,8 +1246,8 @@ function ve(e, t) {
1246
1246
  inlineImages: k,
1247
1247
  recordCanvas: x,
1248
1248
  preserveWhiteSpace: V,
1249
- onSerialize: D,
1250
- onIframeLoad: R,
1249
+ onSerialize: B,
1250
+ onIframeLoad: E,
1251
1251
  iframeLoadTimeout: j,
1252
1252
  onStylesheetLoad: X,
1253
1253
  stylesheetLoadTimeout: $,
@@ -1257,10 +1257,10 @@ function ve(e, t) {
1257
1257
  }
1258
1258
  }, $), N;
1259
1259
  }
1260
- function gn(e, t) {
1261
- var r = t || {}, n = r.mirror, s = n === void 0 ? new Jt() : n, i = r.blockClass, a = i === void 0 ? "rr-block" : i, o = r.blockSelector, c = o === void 0 ? null : o, d = r.maskTextClass, l = d === void 0 ? "rr-mask" : d, u = r.maskTextSelector, h = u === void 0 ? null : u, f = r.inlineStylesheet, p = f === void 0 ? !0 : f, y = r.inlineImages, S = y === void 0 ? !1 : y, C = r.recordCanvas, m = C === void 0 ? !1 : C, g = r.maskAllInputs, k = g === void 0 ? !1 : g, U = r.maskTextFn, x = r.maskInputFn, D = r.slimDOM, R = D === void 0 ? !1 : D, H = r.dataURLOptions, j = r.preserveWhiteSpace, X = r.onSerialize, Q = r.onIframeLoad, $ = r.iframeLoadTimeout, O = r.onStylesheetLoad, J = r.stylesheetLoadTimeout, ee = r.keepIframeSrcFn, se = ee === void 0 ? function() {
1260
+ function yn(e, t) {
1261
+ var r = t || {}, n = r.mirror, s = n === void 0 ? new qt() : n, i = r.blockClass, o = i === void 0 ? "rr-block" : i, c = r.blockSelector, a = c === void 0 ? null : c, d = r.maskTextClass, l = d === void 0 ? "rr-mask" : d, u = r.maskTextSelector, h = u === void 0 ? null : u, f = r.inlineStylesheet, p = f === void 0 ? !0 : f, y = r.inlineImages, S = y === void 0 ? !1 : y, C = r.recordCanvas, m = C === void 0 ? !1 : C, g = r.maskAllInputs, k = g === void 0 ? !1 : g, U = r.maskTextFn, x = r.maskInputFn, B = r.slimDOM, E = B === void 0 ? !1 : B, H = r.dataURLOptions, j = r.preserveWhiteSpace, X = r.onSerialize, Q = r.onIframeLoad, $ = r.iframeLoadTimeout, O = r.onStylesheetLoad, J = r.stylesheetLoadTimeout, ee = r.keepIframeSrcFn, se = ee === void 0 ? function() {
1262
1262
  return !1;
1263
- } : ee, ae = k === !0 ? {
1263
+ } : ee, oe = k === !0 ? {
1264
1264
  color: !0,
1265
1265
  date: !0,
1266
1266
  "datetime-local": !0,
@@ -1279,28 +1279,28 @@ function gn(e, t) {
1279
1279
  password: !0
1280
1280
  } : k === !1 ? {
1281
1281
  password: !0
1282
- } : k, V = R === !0 || R === "all" ? {
1282
+ } : k, V = E === !0 || E === "all" ? {
1283
1283
  script: !0,
1284
1284
  comment: !0,
1285
1285
  headFavicon: !0,
1286
1286
  headWhitespace: !0,
1287
- headMetaDescKeywords: R === "all",
1287
+ headMetaDescKeywords: E === "all",
1288
1288
  headMetaSocial: !0,
1289
1289
  headMetaRobots: !0,
1290
1290
  headMetaHttpEquiv: !0,
1291
1291
  headMetaAuthorship: !0,
1292
1292
  headMetaVerification: !0
1293
- } : R === !1 ? {} : R;
1293
+ } : E === !1 ? {} : E;
1294
1294
  return ve(e, {
1295
1295
  doc: e,
1296
1296
  mirror: s,
1297
- blockClass: a,
1298
- blockSelector: c,
1297
+ blockClass: o,
1298
+ blockSelector: a,
1299
1299
  maskTextClass: l,
1300
1300
  maskTextSelector: h,
1301
1301
  skipChild: !1,
1302
1302
  inlineStylesheet: p,
1303
- maskInputOptions: ae,
1303
+ maskInputOptions: oe,
1304
1304
  maskTextFn: U,
1305
1305
  maskInputFn: x,
1306
1306
  slimDOMOptions: V,
@@ -1350,21 +1350,21 @@ typeof window < "u" && window.Proxy && window.Reflect && (At = new Proxy(At, {
1350
1350
  function Fe(e, t, r = {}) {
1351
1351
  let n = null, s = 0;
1352
1352
  return function(...i) {
1353
- const a = Date.now();
1354
- !s && r.leading === !1 && (s = a);
1355
- const o = t - (a - s), c = this;
1356
- o <= 0 || o > t ? (n && (clearTimeout(n), n = null), s = a, e.apply(c, i)) : !n && r.trailing !== !1 && (n = setTimeout(() => {
1357
- s = r.leading === !1 ? 0 : Date.now(), n = null, e.apply(c, i);
1358
- }, o));
1353
+ const o = Date.now();
1354
+ !s && r.leading === !1 && (s = o);
1355
+ const c = t - (o - s), a = this;
1356
+ c <= 0 || c > t ? (n && (clearTimeout(n), n = null), s = o, e.apply(a, i)) : !n && r.trailing !== !1 && (n = setTimeout(() => {
1357
+ s = r.leading === !1 ? 0 : Date.now(), n = null, e.apply(a, i);
1358
+ }, c));
1359
1359
  };
1360
1360
  }
1361
1361
  function qe(e, t, r, n, s = window) {
1362
1362
  const i = s.Object.getOwnPropertyDescriptor(e, t);
1363
1363
  return s.Object.defineProperty(e, t, n ? r : {
1364
- set(a) {
1364
+ set(o) {
1365
1365
  setTimeout(() => {
1366
- r.set.call(this, a);
1367
- }, 0), i && i.set && i.set.call(this, a);
1366
+ r.set.call(this, o);
1367
+ }, 0), i && i.set && i.set.call(this, o);
1368
1368
  }
1369
1369
  }), () => qe(e, t, i || {}, !0);
1370
1370
  }
@@ -1387,10 +1387,10 @@ function he(e, t, r) {
1387
1387
  };
1388
1388
  }
1389
1389
  }
1390
- function Qt() {
1390
+ function $t() {
1391
1391
  return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
1392
1392
  }
1393
- function $t() {
1393
+ function er() {
1394
1394
  return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
1395
1395
  }
1396
1396
  function K(e, t, r, n) {
@@ -1406,22 +1406,22 @@ function K(e, t, r, n) {
1406
1406
  return !0;
1407
1407
  return !!(r && (e.matches(r) || n && s.closest(r) !== null));
1408
1408
  }
1409
- function yn(e, t) {
1409
+ function In(e, t) {
1410
1410
  return t.getId(e) !== -1;
1411
1411
  }
1412
1412
  function Qe(e, t) {
1413
1413
  return t.getId(e) === Le;
1414
1414
  }
1415
- function er(e, t) {
1415
+ function tr(e, t) {
1416
1416
  if (Ne(e))
1417
1417
  return !1;
1418
1418
  const r = t.getId(e);
1419
- return t.has(r) ? e.parentNode && e.parentNode.nodeType === e.DOCUMENT_NODE ? !1 : e.parentNode ? er(e.parentNode, t) : !0 : !0;
1419
+ return t.has(r) ? e.parentNode && e.parentNode.nodeType === e.DOCUMENT_NODE ? !1 : e.parentNode ? tr(e.parentNode, t) : !0 : !0;
1420
1420
  }
1421
- function tr(e) {
1421
+ function rr(e) {
1422
1422
  return !!e.changedTouches;
1423
1423
  }
1424
- function In(e = window) {
1424
+ function Cn(e = window) {
1425
1425
  "NodeList" in e && !e.NodeList.prototype.forEach && (e.NodeList.prototype.forEach = Array.prototype.forEach), "DOMTokenList" in e && !e.DOMTokenList.prototype.forEach && (e.DOMTokenList.prototype.forEach = Array.prototype.forEach), Node.prototype.contains || (Node.prototype.contains = (...t) => {
1426
1426
  let r = t[0];
1427
1427
  if (!(0 in t))
@@ -1433,16 +1433,16 @@ function In(e = window) {
1433
1433
  return !1;
1434
1434
  });
1435
1435
  }
1436
- function rr(e, t) {
1436
+ function nr(e, t) {
1437
1437
  return !!(e.nodeName === "IFRAME" && t.getMeta(e));
1438
1438
  }
1439
- function nr(e, t) {
1439
+ function sr(e, t) {
1440
1440
  return !!(e.nodeName === "LINK" && e.nodeType === e.ELEMENT_NODE && e.getAttribute && e.getAttribute("rel") === "stylesheet" && t.getMeta(e));
1441
1441
  }
1442
- function sr(e) {
1442
+ function ir(e) {
1443
1443
  return !!(e != null && e.shadowRoot);
1444
1444
  }
1445
- class Cn {
1445
+ class Sn {
1446
1446
  constructor() {
1447
1447
  this.id = 1, this.styleIDMap = /* @__PURE__ */ new WeakMap(), this.idStyleMap = /* @__PURE__ */ new Map();
1448
1448
  }
@@ -1469,11 +1469,11 @@ class Cn {
1469
1469
  return this.id++;
1470
1470
  }
1471
1471
  }
1472
- var v = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(v || {}), b = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e))(b || {}), ot = /* @__PURE__ */ ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(ot || {}), ke = /* @__PURE__ */ ((e) => (e[e["2D"] = 0] = "2D", e[e.WebGL = 1] = "WebGL", e[e.WebGL2 = 2] = "WebGL2", e))(ke || {});
1472
+ var v = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(v || {}), b = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e))(b || {}), at = /* @__PURE__ */ ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(at || {}), ke = /* @__PURE__ */ ((e) => (e[e["2D"] = 0] = "2D", e[e.WebGL = 1] = "WebGL", e[e.WebGL2 = 2] = "WebGL2", e))(ke || {});
1473
1473
  function kt(e) {
1474
1474
  return "__ln" in e;
1475
1475
  }
1476
- class Sn {
1476
+ class bn {
1477
1477
  constructor() {
1478
1478
  this.length = 0, this.head = null;
1479
1479
  }
@@ -1506,33 +1506,33 @@ class Sn {
1506
1506
  this.head && (r.previous ? (r.previous.next = r.next, r.next && (r.next.previous = r.previous)) : (this.head = r.next, this.head && (this.head.previous = null)), t.__ln && delete t.__ln, this.length--);
1507
1507
  }
1508
1508
  }
1509
- const Rt = (e, t) => `${e}@${t}`;
1510
- class bn {
1509
+ const Et = (e, t) => `${e}@${t}`;
1510
+ class vn {
1511
1511
  constructor() {
1512
1512
  this.frozen = !1, this.locked = !1, this.texts = [], this.attributes = [], this.removes = [], this.mapRemoves = [], this.movedMap = {}, this.addedSet = /* @__PURE__ */ new Set(), this.movedSet = /* @__PURE__ */ new Set(), this.droppedSet = /* @__PURE__ */ new Set(), this.processMutations = (t) => {
1513
1513
  t.forEach(this.processMutation), this.emit();
1514
1514
  }, this.emit = () => {
1515
1515
  if (this.frozen || this.locked)
1516
1516
  return;
1517
- const t = [], r = new Sn(), n = (o) => {
1518
- let c = o, d = Le;
1517
+ const t = [], r = new bn(), n = (c) => {
1518
+ let a = c, d = Le;
1519
1519
  for (; d === Le; )
1520
- c = c && c.nextSibling, d = c && this.mirror.getId(c);
1520
+ a = a && a.nextSibling, d = a && this.mirror.getId(a);
1521
1521
  return d;
1522
- }, s = (o) => {
1523
- var c, d, l, u;
1522
+ }, s = (c) => {
1523
+ var a, d, l, u;
1524
1524
  let h = null;
1525
- ((d = (c = o.getRootNode) === null || c === void 0 ? void 0 : c.call(o)) === null || d === void 0 ? void 0 : d.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && o.getRootNode().host && (h = o.getRootNode().host);
1525
+ ((d = (a = c.getRootNode) === null || a === void 0 ? void 0 : a.call(c)) === null || d === void 0 ? void 0 : d.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && c.getRootNode().host && (h = c.getRootNode().host);
1526
1526
  let f = h;
1527
1527
  for (; ((u = (l = f == null ? void 0 : f.getRootNode) === null || l === void 0 ? void 0 : l.call(f)) === null || u === void 0 ? void 0 : u.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && f.getRootNode().host; )
1528
1528
  f = f.getRootNode().host;
1529
- const p = !this.doc.contains(o) && (!f || !this.doc.contains(f));
1530
- if (!o.parentNode || p)
1529
+ const p = !this.doc.contains(c) && (!f || !this.doc.contains(f));
1530
+ if (!c.parentNode || p)
1531
1531
  return;
1532
- const y = Ne(o.parentNode) ? this.mirror.getId(h) : this.mirror.getId(o.parentNode), S = n(o);
1532
+ const y = Ne(c.parentNode) ? this.mirror.getId(h) : this.mirror.getId(c.parentNode), S = n(c);
1533
1533
  if (y === -1 || S === -1)
1534
- return r.addNode(o);
1535
- const C = ve(o, {
1534
+ return r.addNode(c);
1535
+ const C = ve(c, {
1536
1536
  doc: this.doc,
1537
1537
  mirror: this.mirror,
1538
1538
  blockClass: this.blockClass,
@@ -1550,7 +1550,7 @@ class bn {
1550
1550
  recordCanvas: this.recordCanvas,
1551
1551
  inlineImages: this.inlineImages,
1552
1552
  onSerialize: (m) => {
1553
- rr(m, this.mirror) && this.iframeManager.addIframe(m), nr(m, this.mirror) && this.stylesheetManager.trackLinkElement(m), sr(o) && this.shadowDomManager.addShadowRoot(o.shadowRoot, this.doc);
1553
+ nr(m, this.mirror) && this.iframeManager.addIframe(m), sr(m, this.mirror) && this.stylesheetManager.trackLinkElement(m), ir(c) && this.shadowDomManager.addShadowRoot(c.shadowRoot, this.doc);
1554
1554
  },
1555
1555
  onIframeLoad: (m, g) => {
1556
1556
  this.iframeManager.attachIframe(m, g), this.shadowDomManager.observeAttachShadow(m);
@@ -1567,66 +1567,66 @@ class bn {
1567
1567
  };
1568
1568
  for (; this.mapRemoves.length; )
1569
1569
  this.mirror.removeNodeFromMap(this.mapRemoves.shift());
1570
- for (const o of Array.from(this.movedSet.values()))
1571
- Et(this.removes, o, this.mirror) && !this.movedSet.has(o.parentNode) || s(o);
1572
- for (const o of Array.from(this.addedSet.values()))
1573
- !Tt(this.droppedSet, o) && !Et(this.removes, o, this.mirror) || Tt(this.movedSet, o) ? s(o) : this.droppedSet.add(o);
1570
+ for (const c of Array.from(this.movedSet.values()))
1571
+ Rt(this.removes, c, this.mirror) && !this.movedSet.has(c.parentNode) || s(c);
1572
+ for (const c of Array.from(this.addedSet.values()))
1573
+ !Tt(this.droppedSet, c) && !Rt(this.removes, c, this.mirror) || Tt(this.movedSet, c) ? s(c) : this.droppedSet.add(c);
1574
1574
  let i = null;
1575
1575
  for (; r.length; ) {
1576
- let o = null;
1576
+ let c = null;
1577
1577
  if (i) {
1578
- const c = this.mirror.getId(i.value.parentNode), d = n(i.value);
1579
- c !== -1 && d !== -1 && (o = i);
1578
+ const a = this.mirror.getId(i.value.parentNode), d = n(i.value);
1579
+ a !== -1 && d !== -1 && (c = i);
1580
1580
  }
1581
- if (!o)
1582
- for (let c = r.length - 1; c >= 0; c--) {
1583
- const d = r.get(c);
1581
+ if (!c)
1582
+ for (let a = r.length - 1; a >= 0; a--) {
1583
+ const d = r.get(a);
1584
1584
  if (d) {
1585
1585
  const l = this.mirror.getId(d.value.parentNode);
1586
1586
  if (n(d.value) === -1)
1587
1587
  continue;
1588
1588
  if (l !== -1) {
1589
- o = d;
1589
+ c = d;
1590
1590
  break;
1591
1591
  } else {
1592
1592
  const h = d.value;
1593
1593
  if (h.parentNode && h.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1594
1594
  const f = h.parentNode.host;
1595
1595
  if (this.mirror.getId(f) !== -1) {
1596
- o = d;
1596
+ c = d;
1597
1597
  break;
1598
1598
  }
1599
1599
  }
1600
1600
  }
1601
1601
  }
1602
1602
  }
1603
- if (!o) {
1603
+ if (!c) {
1604
1604
  for (; r.head; )
1605
1605
  r.removeNode(r.head.value);
1606
1606
  break;
1607
1607
  }
1608
- i = o.previous, r.removeNode(o.value), s(o.value);
1608
+ i = c.previous, r.removeNode(c.value), s(c.value);
1609
1609
  }
1610
- const a = {
1611
- texts: this.texts.map((o) => ({
1612
- id: this.mirror.getId(o.node),
1613
- value: o.value
1614
- })).filter((o) => this.mirror.has(o.id)),
1615
- attributes: this.attributes.map((o) => ({
1616
- id: this.mirror.getId(o.node),
1617
- attributes: o.attributes
1618
- })).filter((o) => this.mirror.has(o.id)),
1610
+ const o = {
1611
+ texts: this.texts.map((c) => ({
1612
+ id: this.mirror.getId(c.node),
1613
+ value: c.value
1614
+ })).filter((c) => this.mirror.has(c.id)),
1615
+ attributes: this.attributes.map((c) => ({
1616
+ id: this.mirror.getId(c.node),
1617
+ attributes: c.attributes
1618
+ })).filter((c) => this.mirror.has(c.id)),
1619
1619
  removes: this.removes,
1620
1620
  adds: t
1621
1621
  };
1622
- !a.texts.length && !a.attributes.length && !a.removes.length && !a.adds.length || (this.texts = [], this.attributes = [], this.removes = [], this.addedSet = /* @__PURE__ */ new Set(), this.movedSet = /* @__PURE__ */ new Set(), this.droppedSet = /* @__PURE__ */ new Set(), this.movedMap = {}, this.mutationCb(a));
1622
+ !o.texts.length && !o.attributes.length && !o.removes.length && !o.adds.length || (this.texts = [], this.attributes = [], this.removes = [], this.addedSet = /* @__PURE__ */ new Set(), this.movedSet = /* @__PURE__ */ new Set(), this.droppedSet = /* @__PURE__ */ new Set(), this.movedMap = {}, this.mutationCb(o));
1623
1623
  }, this.processMutation = (t) => {
1624
1624
  if (!Qe(t.target, this.mirror))
1625
1625
  switch (t.type) {
1626
1626
  case "characterData": {
1627
1627
  const r = t.target.textContent;
1628
1628
  !K(t.target, this.blockClass, this.blockSelector, !1) && r !== t.oldValue && this.texts.push({
1629
- value: Xt(t.target, this.maskTextClass, this.maskTextSelector) && r ? this.maskTextFn ? this.maskTextFn(r) : r.replace(/[\S]/g, "*") : r,
1629
+ value: Qt(t.target, this.maskTextClass, this.maskTextSelector) && r ? this.maskTextFn ? this.maskTextFn(r) : r.replace(/[\S]/g, "*") : r,
1630
1630
  node: t.target
1631
1631
  });
1632
1632
  break;
@@ -1654,15 +1654,15 @@ class bn {
1654
1654
  }, this.attributes.push(s)), t.attributeName === "style") {
1655
1655
  const i = this.doc.createElement("span");
1656
1656
  t.oldValue && i.setAttribute("style", t.oldValue), (s.attributes.style === void 0 || s.attributes.style === null) && (s.attributes.style = {});
1657
- const a = s.attributes.style;
1658
- for (const o of Array.from(r.style)) {
1659
- const c = r.style.getPropertyValue(o), d = r.style.getPropertyPriority(o);
1660
- (c !== i.style.getPropertyValue(o) || d !== i.style.getPropertyPriority(o)) && (d === "" ? a[o] = c : a[o] = [c, d]);
1657
+ const o = s.attributes.style;
1658
+ for (const c of Array.from(r.style)) {
1659
+ const a = r.style.getPropertyValue(c), d = r.style.getPropertyPriority(c);
1660
+ (a !== i.style.getPropertyValue(c) || d !== i.style.getPropertyPriority(c)) && (d === "" ? o[c] = a : o[c] = [a, d]);
1661
1661
  }
1662
- for (const o of Array.from(i.style))
1663
- r.style.getPropertyValue(o) === "" && (a[o] = !1);
1662
+ for (const c of Array.from(i.style))
1663
+ r.style.getPropertyValue(c) === "" && (o[c] = !1);
1664
1664
  } else
1665
- s.attributes[t.attributeName] = Yt(this.doc, r.tagName, t.attributeName, n);
1665
+ s.attributes[t.attributeName] = Xt(this.doc, r.tagName, t.attributeName, n);
1666
1666
  break;
1667
1667
  }
1668
1668
  case "childList": {
@@ -1670,7 +1670,7 @@ class bn {
1670
1670
  return;
1671
1671
  t.addedNodes.forEach((r) => this.genAdds(r, t.target)), t.removedNodes.forEach((r) => {
1672
1672
  const n = this.mirror.getId(r), s = Ne(t.target) ? this.mirror.getId(t.target.host) : this.mirror.getId(t.target);
1673
- K(t.target, this.blockClass, this.blockSelector, !1) || Qe(r, this.mirror) || !yn(r, this.mirror) || (this.addedSet.has(r) ? (ct(this.addedSet, r), this.droppedSet.add(r)) : this.addedSet.has(t.target) && n === -1 || er(t.target, this.mirror) || (this.movedSet.has(r) && this.movedMap[Rt(n, s)] ? ct(this.movedSet, r) : this.removes.push({
1673
+ K(t.target, this.blockClass, this.blockSelector, !1) || Qe(r, this.mirror) || !In(r, this.mirror) || (this.addedSet.has(r) ? (ct(this.addedSet, r), this.droppedSet.add(r)) : this.addedSet.has(t.target) && n === -1 || tr(t.target, this.mirror) || (this.movedSet.has(r) && this.movedMap[Et(n, s)] ? ct(this.movedSet, r) : this.removes.push({
1674
1674
  parentId: s,
1675
1675
  id: n,
1676
1676
  isShadow: Ne(t.target) && Me(t.target) ? !0 : void 0
@@ -1685,7 +1685,7 @@ class bn {
1685
1685
  return;
1686
1686
  this.movedSet.add(t);
1687
1687
  let n = null;
1688
- r && this.mirror.hasNode(r) && (n = this.mirror.getId(r)), n && n !== -1 && (this.movedMap[Rt(this.mirror.getId(t), n)] = !0);
1688
+ r && this.mirror.hasNode(r) && (n = this.mirror.getId(r)), n && n !== -1 && (this.movedMap[Et(this.mirror.getId(t), n)] = !0);
1689
1689
  } else
1690
1690
  this.addedSet.add(t), this.droppedSet.delete(t);
1691
1691
  K(t, this.blockClass, this.blockSelector, !1) || t.childNodes.forEach((n) => this.genAdds(n));
@@ -1739,15 +1739,15 @@ class bn {
1739
1739
  function ct(e, t) {
1740
1740
  e.delete(t), t.childNodes.forEach((r) => ct(e, r));
1741
1741
  }
1742
- function Et(e, t, r) {
1743
- return e.length === 0 ? !1 : ir(e, t, r);
1742
+ function Rt(e, t, r) {
1743
+ return e.length === 0 ? !1 : or(e, t, r);
1744
1744
  }
1745
- function ir(e, t, r) {
1745
+ function or(e, t, r) {
1746
1746
  const { parentNode: n } = t;
1747
1747
  if (!n)
1748
1748
  return !1;
1749
1749
  const s = r.getId(n);
1750
- return e.some((i) => i.id === s) ? !0 : ir(e, n, r);
1750
+ return e.some((i) => i.id === s) ? !0 : or(e, n, r);
1751
1751
  }
1752
1752
  function Tt(e, t) {
1753
1753
  return e.size === 0 ? !1 : ar(e, t);
@@ -1756,7 +1756,7 @@ function ar(e, t) {
1756
1756
  const { parentNode: r } = t;
1757
1757
  return r ? e.has(r) ? !0 : ar(e, r) : !1;
1758
1758
  }
1759
- const ue = [], or = typeof CSSGroupingRule < "u", cr = typeof CSSMediaRule < "u", dr = typeof CSSSupportsRule < "u", lr = typeof CSSConditionRule < "u";
1759
+ const ue = [], cr = typeof CSSGroupingRule < "u", dr = typeof CSSMediaRule < "u", lr = typeof CSSSupportsRule < "u", ur = typeof CSSConditionRule < "u";
1760
1760
  function xe(e) {
1761
1761
  try {
1762
1762
  if ("composedPath" in e) {
@@ -1770,40 +1770,40 @@ function xe(e) {
1770
1770
  return e.target;
1771
1771
  }
1772
1772
  }
1773
- function ur(e, t) {
1773
+ function pr(e, t) {
1774
1774
  var r, n;
1775
- const s = new bn();
1775
+ const s = new vn();
1776
1776
  ue.push(s), s.init(e);
1777
1777
  let i = window.MutationObserver || window.__rrMutationObserver;
1778
- const a = (n = (r = window == null ? void 0 : window.Zone) === null || r === void 0 ? void 0 : r.__symbol__) === null || n === void 0 ? void 0 : n.call(r, "MutationObserver");
1779
- a && window[a] && (i = window[a]);
1780
- const o = new i(s.processMutations.bind(s));
1781
- return o.observe(t, {
1778
+ const o = (n = (r = window == null ? void 0 : window.Zone) === null || r === void 0 ? void 0 : r.__symbol__) === null || n === void 0 ? void 0 : n.call(r, "MutationObserver");
1779
+ o && window[o] && (i = window[o]);
1780
+ const c = new i(s.processMutations.bind(s));
1781
+ return c.observe(t, {
1782
1782
  attributes: !0,
1783
1783
  attributeOldValue: !0,
1784
1784
  characterData: !0,
1785
1785
  characterDataOldValue: !0,
1786
1786
  childList: !0,
1787
1787
  subtree: !0
1788
- }), o;
1788
+ }), c;
1789
1789
  }
1790
- function vn({ mousemoveCb: e, sampling: t, doc: r, mirror: n }) {
1790
+ function wn({ mousemoveCb: e, sampling: t, doc: r, mirror: n }) {
1791
1791
  if (t.mousemove === !1)
1792
1792
  return () => {
1793
1793
  };
1794
1794
  const s = typeof t.mousemove == "number" ? t.mousemove : 50, i = typeof t.mousemoveCallback == "number" ? t.mousemoveCallback : 500;
1795
- let a = [], o;
1796
- const c = Fe((u) => {
1797
- const h = Date.now() - o;
1798
- e(a.map((f) => (f.timeOffset -= h, f)), u), a = [], o = null;
1795
+ let o = [], c;
1796
+ const a = Fe((u) => {
1797
+ const h = Date.now() - c;
1798
+ e(o.map((f) => (f.timeOffset -= h, f)), u), o = [], c = null;
1799
1799
  }, i), d = Fe((u) => {
1800
- const h = xe(u), { clientX: f, clientY: p } = tr(u) ? u.changedTouches[0] : u;
1801
- o || (o = Date.now()), a.push({
1800
+ const h = xe(u), { clientX: f, clientY: p } = rr(u) ? u.changedTouches[0] : u;
1801
+ c || (c = Date.now()), o.push({
1802
1802
  x: f,
1803
1803
  y: p,
1804
1804
  id: n.getId(h),
1805
- timeOffset: Date.now() - o
1806
- }), c(typeof DragEvent < "u" && u instanceof DragEvent ? b.Drag : u instanceof MouseEvent ? b.MouseMove : b.TouchMove);
1805
+ timeOffset: Date.now() - c
1806
+ }), a(typeof DragEvent < "u" && u instanceof DragEvent ? b.Drag : u instanceof MouseEvent ? b.MouseMove : b.TouchMove);
1807
1807
  }, s, {
1808
1808
  trailing: !1
1809
1809
  }), l = [
@@ -1815,39 +1815,39 @@ function vn({ mousemoveCb: e, sampling: t, doc: r, mirror: n }) {
1815
1815
  l.forEach((u) => u());
1816
1816
  };
1817
1817
  }
1818
- function wn({ mouseInteractionCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, sampling: i }) {
1818
+ function An({ mouseInteractionCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, sampling: i }) {
1819
1819
  if (i.mouseInteraction === !1)
1820
1820
  return () => {
1821
1821
  };
1822
- const a = i.mouseInteraction === !0 || i.mouseInteraction === void 0 ? {} : i.mouseInteraction, o = [], c = (d) => (l) => {
1822
+ const o = i.mouseInteraction === !0 || i.mouseInteraction === void 0 ? {} : i.mouseInteraction, c = [], a = (d) => (l) => {
1823
1823
  const u = xe(l);
1824
1824
  if (K(u, n, s, !0))
1825
1825
  return;
1826
- const h = tr(l) ? l.changedTouches[0] : l;
1826
+ const h = rr(l) ? l.changedTouches[0] : l;
1827
1827
  if (!h)
1828
1828
  return;
1829
1829
  const f = r.getId(u), { clientX: p, clientY: y } = h;
1830
1830
  e({
1831
- type: ot[d],
1831
+ type: at[d],
1832
1832
  id: f,
1833
1833
  x: p,
1834
1834
  y
1835
1835
  });
1836
1836
  };
1837
- return Object.keys(ot).filter((d) => Number.isNaN(Number(d)) && !d.endsWith("_Departed") && a[d] !== !1).forEach((d) => {
1838
- const l = d.toLowerCase(), u = c(d);
1839
- o.push(G(l, u, t));
1837
+ return Object.keys(at).filter((d) => Number.isNaN(Number(d)) && !d.endsWith("_Departed") && o[d] !== !1).forEach((d) => {
1838
+ const l = d.toLowerCase(), u = a(d);
1839
+ c.push(G(l, u, t));
1840
1840
  }), () => {
1841
- o.forEach((d) => d());
1841
+ c.forEach((d) => d());
1842
1842
  };
1843
1843
  }
1844
- function pr({ scrollCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, sampling: i }) {
1845
- const a = Fe((o) => {
1846
- const c = xe(o);
1847
- if (!c || K(c, n, s, !0))
1844
+ function hr({ scrollCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, sampling: i }) {
1845
+ const o = Fe((c) => {
1846
+ const a = xe(c);
1847
+ if (!a || K(a, n, s, !0))
1848
1848
  return;
1849
- const d = r.getId(c);
1850
- if (c === t) {
1849
+ const d = r.getId(a);
1850
+ if (a === t) {
1851
1851
  const l = t.scrollingElement || t.documentElement;
1852
1852
  e({
1853
1853
  id: d,
@@ -1857,16 +1857,16 @@ function pr({ scrollCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, s
1857
1857
  } else
1858
1858
  e({
1859
1859
  id: d,
1860
- x: c.scrollLeft,
1861
- y: c.scrollTop
1860
+ x: a.scrollLeft,
1861
+ y: a.scrollTop
1862
1862
  });
1863
1863
  }, i.scroll || 100);
1864
- return G("scroll", a, t);
1864
+ return G("scroll", o, t);
1865
1865
  }
1866
- function An({ viewportResizeCb: e }) {
1866
+ function kn({ viewportResizeCb: e }) {
1867
1867
  let t = -1, r = -1;
1868
1868
  const n = Fe(() => {
1869
- const s = Qt(), i = $t();
1869
+ const s = $t(), i = er();
1870
1870
  (t !== s || r !== i) && (e({
1871
1871
  width: Number(i),
1872
1872
  height: Number(s)
@@ -1878,28 +1878,28 @@ function _t(e, t) {
1878
1878
  const r = Object.assign({}, e);
1879
1879
  return t || delete r.userTriggered, r;
1880
1880
  }
1881
- const kn = ["INPUT", "TEXTAREA", "SELECT"], Nt = /* @__PURE__ */ new WeakMap();
1882
- function Rn({ inputCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, ignoreClass: i, maskInputOptions: a, maskInputFn: o, sampling: c, userTriggeredOnInput: d }) {
1881
+ const En = ["INPUT", "TEXTAREA", "SELECT"], Nt = /* @__PURE__ */ new WeakMap();
1882
+ function Rn({ inputCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, ignoreClass: i, maskInputOptions: o, maskInputFn: c, sampling: a, userTriggeredOnInput: d }) {
1883
1883
  function l(C) {
1884
1884
  let m = xe(C);
1885
1885
  const g = C.isTrusted;
1886
- if (m && m.tagName === "OPTION" && (m = m.parentElement), !m || !m.tagName || kn.indexOf(m.tagName) < 0 || K(m, n, s, !0))
1886
+ if (m && m.tagName === "OPTION" && (m = m.parentElement), !m || !m.tagName || En.indexOf(m.tagName) < 0 || K(m, n, s, !0))
1887
1887
  return;
1888
1888
  const k = m.type;
1889
1889
  if (m.classList.contains(i))
1890
1890
  return;
1891
1891
  let U = m.value, x = !1;
1892
- k === "radio" || k === "checkbox" ? x = m.checked : (a[m.tagName.toLowerCase()] || a[k]) && (U = ut({
1893
- maskInputOptions: a,
1892
+ k === "radio" || k === "checkbox" ? x = m.checked : (o[m.tagName.toLowerCase()] || o[k]) && (U = ut({
1893
+ maskInputOptions: o,
1894
1894
  tagName: m.tagName,
1895
1895
  type: k,
1896
1896
  value: U,
1897
- maskInputFn: o
1897
+ maskInputFn: c
1898
1898
  })), u(m, _t({ text: U, isChecked: x, userTriggered: g }, d));
1899
- const D = m.name;
1900
- k === "radio" && D && x && t.querySelectorAll(`input[type="radio"][name="${D}"]`).forEach((R) => {
1901
- R !== m && u(R, _t({
1902
- text: R.value,
1899
+ const B = m.name;
1900
+ k === "radio" && B && x && t.querySelectorAll(`input[type="radio"][name="${B}"]`).forEach((E) => {
1901
+ E !== m && u(E, _t({
1902
+ text: E.value,
1903
1903
  isChecked: !x,
1904
1904
  userTriggered: !1
1905
1905
  }, d));
@@ -1913,7 +1913,7 @@ function Rn({ inputCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, ig
1913
1913
  e(Object.assign(Object.assign({}, m), { id: k }));
1914
1914
  }
1915
1915
  }
1916
- const f = (c.input === "last" ? ["change"] : ["input", "change"]).map((C) => G(C, l, t)), p = t.defaultView;
1916
+ const f = (a.input === "last" ? ["change"] : ["input", "change"]).map((C) => G(C, l, t)), p = t.defaultView;
1917
1917
  if (!p)
1918
1918
  return () => {
1919
1919
  f.forEach((C) => C());
@@ -1937,12 +1937,12 @@ function Rn({ inputCb: e, doc: t, mirror: r, blockClass: n, blockSelector: s, ig
1937
1937
  function He(e) {
1938
1938
  const t = [];
1939
1939
  function r(n, s) {
1940
- if (or && n.parentRule instanceof CSSGroupingRule || cr && n.parentRule instanceof CSSMediaRule || dr && n.parentRule instanceof CSSSupportsRule || lr && n.parentRule instanceof CSSConditionRule) {
1941
- const a = Array.from(n.parentRule.cssRules).indexOf(n);
1942
- s.unshift(a);
1940
+ if (cr && n.parentRule instanceof CSSGroupingRule || dr && n.parentRule instanceof CSSMediaRule || lr && n.parentRule instanceof CSSSupportsRule || ur && n.parentRule instanceof CSSConditionRule) {
1941
+ const o = Array.from(n.parentRule.cssRules).indexOf(n);
1942
+ s.unshift(o);
1943
1943
  } else if (n.parentStyleSheet) {
1944
- const a = Array.from(n.parentStyleSheet.cssRules).indexOf(n);
1945
- s.unshift(a);
1944
+ const o = Array.from(n.parentStyleSheet.cssRules).indexOf(n);
1945
+ s.unshift(o);
1946
1946
  }
1947
1947
  return s;
1948
1948
  }
@@ -1955,7 +1955,7 @@ function ce(e, t, r) {
1955
1955
  id: n
1956
1956
  }) : {};
1957
1957
  }
1958
- function En({ styleSheetRuleCb: e, mirror: t, stylesheetManager: r }, { win: n }) {
1958
+ function Tn({ styleSheetRuleCb: e, mirror: t, stylesheetManager: r }, { win: n }) {
1959
1959
  const s = n.CSSStyleSheet.prototype.insertRule;
1960
1960
  n.CSSStyleSheet.prototype.insertRule = function(l, u) {
1961
1961
  const { id: h, styleId: f } = ce(this, t, r.styleMirror);
@@ -1974,28 +1974,28 @@ function En({ styleSheetRuleCb: e, mirror: t, stylesheetManager: r }, { win: n }
1974
1974
  removes: [{ index: l }]
1975
1975
  }), i.apply(this, [l]);
1976
1976
  };
1977
- let a;
1978
- n.CSSStyleSheet.prototype.replace && (a = n.CSSStyleSheet.prototype.replace, n.CSSStyleSheet.prototype.replace = function(l) {
1977
+ let o;
1978
+ n.CSSStyleSheet.prototype.replace && (o = n.CSSStyleSheet.prototype.replace, n.CSSStyleSheet.prototype.replace = function(l) {
1979
1979
  const { id: u, styleId: h } = ce(this, t, r.styleMirror);
1980
1980
  return (u && u !== -1 || h && h !== -1) && e({
1981
1981
  id: u,
1982
1982
  styleId: h,
1983
1983
  replace: l
1984
- }), a.apply(this, [l]);
1984
+ }), o.apply(this, [l]);
1985
1985
  });
1986
- let o;
1987
- n.CSSStyleSheet.prototype.replaceSync && (o = n.CSSStyleSheet.prototype.replaceSync, n.CSSStyleSheet.prototype.replaceSync = function(l) {
1986
+ let c;
1987
+ n.CSSStyleSheet.prototype.replaceSync && (c = n.CSSStyleSheet.prototype.replaceSync, n.CSSStyleSheet.prototype.replaceSync = function(l) {
1988
1988
  const { id: u, styleId: h } = ce(this, t, r.styleMirror);
1989
1989
  return (u && u !== -1 || h && h !== -1) && e({
1990
1990
  id: u,
1991
1991
  styleId: h,
1992
1992
  replaceSync: l
1993
- }), o.apply(this, [l]);
1993
+ }), c.apply(this, [l]);
1994
1994
  });
1995
- const c = {};
1996
- or ? c.CSSGroupingRule = n.CSSGroupingRule : (cr && (c.CSSMediaRule = n.CSSMediaRule), lr && (c.CSSConditionRule = n.CSSConditionRule), dr && (c.CSSSupportsRule = n.CSSSupportsRule));
1995
+ const a = {};
1996
+ cr ? a.CSSGroupingRule = n.CSSGroupingRule : (dr && (a.CSSMediaRule = n.CSSMediaRule), ur && (a.CSSConditionRule = n.CSSConditionRule), lr && (a.CSSSupportsRule = n.CSSSupportsRule));
1997
1997
  const d = {};
1998
- return Object.entries(c).forEach(([l, u]) => {
1998
+ return Object.entries(a).forEach(([l, u]) => {
1999
1999
  d[l] = {
2000
2000
  insertRule: u.prototype.insertRule,
2001
2001
  deleteRule: u.prototype.deleteRule
@@ -2025,94 +2025,94 @@ function En({ styleSheetRuleCb: e, mirror: t, stylesheetManager: r }, { win: n }
2025
2025
  }), d[l].deleteRule.apply(this, [h]);
2026
2026
  };
2027
2027
  }), () => {
2028
- n.CSSStyleSheet.prototype.insertRule = s, n.CSSStyleSheet.prototype.deleteRule = i, a && (n.CSSStyleSheet.prototype.replace = a), o && (n.CSSStyleSheet.prototype.replaceSync = o), Object.entries(c).forEach(([l, u]) => {
2028
+ n.CSSStyleSheet.prototype.insertRule = s, n.CSSStyleSheet.prototype.deleteRule = i, o && (n.CSSStyleSheet.prototype.replace = o), c && (n.CSSStyleSheet.prototype.replaceSync = c), Object.entries(a).forEach(([l, u]) => {
2029
2029
  u.prototype.insertRule = d[l].insertRule, u.prototype.deleteRule = d[l].deleteRule;
2030
2030
  });
2031
2031
  };
2032
2032
  }
2033
- function hr({ mirror: e, stylesheetManager: t }, r) {
2033
+ function fr({ mirror: e, stylesheetManager: t }, r) {
2034
2034
  var n, s, i;
2035
- let a = null;
2036
- r.nodeName === "#document" ? a = e.getId(r) : a = e.getId(r.host);
2037
- const o = r.nodeName === "#document" ? (n = r.defaultView) === null || n === void 0 ? void 0 : n.Document : (i = (s = r.ownerDocument) === null || s === void 0 ? void 0 : s.defaultView) === null || i === void 0 ? void 0 : i.ShadowRoot, c = Object.getOwnPropertyDescriptor(o == null ? void 0 : o.prototype, "adoptedStyleSheets");
2038
- return a === null || a === -1 || !o || !c ? () => {
2035
+ let o = null;
2036
+ r.nodeName === "#document" ? o = e.getId(r) : o = e.getId(r.host);
2037
+ const c = r.nodeName === "#document" ? (n = r.defaultView) === null || n === void 0 ? void 0 : n.Document : (i = (s = r.ownerDocument) === null || s === void 0 ? void 0 : s.defaultView) === null || i === void 0 ? void 0 : i.ShadowRoot, a = Object.getOwnPropertyDescriptor(c == null ? void 0 : c.prototype, "adoptedStyleSheets");
2038
+ return o === null || o === -1 || !c || !a ? () => {
2039
2039
  } : (Object.defineProperty(r, "adoptedStyleSheets", {
2040
- configurable: c.configurable,
2041
- enumerable: c.enumerable,
2040
+ configurable: a.configurable,
2041
+ enumerable: a.enumerable,
2042
2042
  get() {
2043
2043
  var d;
2044
- return (d = c.get) === null || d === void 0 ? void 0 : d.call(this);
2044
+ return (d = a.get) === null || d === void 0 ? void 0 : d.call(this);
2045
2045
  },
2046
2046
  set(d) {
2047
2047
  var l;
2048
- const u = (l = c.set) === null || l === void 0 ? void 0 : l.call(this, d);
2049
- if (a !== null && a !== -1)
2048
+ const u = (l = a.set) === null || l === void 0 ? void 0 : l.call(this, d);
2049
+ if (o !== null && o !== -1)
2050
2050
  try {
2051
- t.adoptStyleSheets(d, a);
2051
+ t.adoptStyleSheets(d, o);
2052
2052
  } catch {
2053
2053
  }
2054
2054
  return u;
2055
2055
  }
2056
2056
  }), () => {
2057
2057
  Object.defineProperty(r, "adoptedStyleSheets", {
2058
- configurable: c.configurable,
2059
- enumerable: c.enumerable,
2060
- get: c.get,
2061
- set: c.set
2058
+ configurable: a.configurable,
2059
+ enumerable: a.enumerable,
2060
+ get: a.get,
2061
+ set: a.set
2062
2062
  });
2063
2063
  });
2064
2064
  }
2065
- function Tn({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: r, stylesheetManager: n }, { win: s }) {
2065
+ function _n({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: r, stylesheetManager: n }, { win: s }) {
2066
2066
  const i = s.CSSStyleDeclaration.prototype.setProperty;
2067
- s.CSSStyleDeclaration.prototype.setProperty = function(o, c, d) {
2067
+ s.CSSStyleDeclaration.prototype.setProperty = function(c, a, d) {
2068
2068
  var l;
2069
- if (r.has(o))
2070
- return i.apply(this, [o, c, d]);
2069
+ if (r.has(c))
2070
+ return i.apply(this, [c, a, d]);
2071
2071
  const { id: u, styleId: h } = ce((l = this.parentRule) === null || l === void 0 ? void 0 : l.parentStyleSheet, t, n.styleMirror);
2072
2072
  return (u && u !== -1 || h && h !== -1) && e({
2073
2073
  id: u,
2074
2074
  styleId: h,
2075
2075
  set: {
2076
- property: o,
2077
- value: c,
2076
+ property: c,
2077
+ value: a,
2078
2078
  priority: d
2079
2079
  },
2080
2080
  index: He(this.parentRule)
2081
- }), i.apply(this, [o, c, d]);
2081
+ }), i.apply(this, [c, a, d]);
2082
2082
  };
2083
- const a = s.CSSStyleDeclaration.prototype.removeProperty;
2084
- return s.CSSStyleDeclaration.prototype.removeProperty = function(o) {
2085
- var c;
2086
- if (r.has(o))
2087
- return a.apply(this, [o]);
2088
- const { id: d, styleId: l } = ce((c = this.parentRule) === null || c === void 0 ? void 0 : c.parentStyleSheet, t, n.styleMirror);
2083
+ const o = s.CSSStyleDeclaration.prototype.removeProperty;
2084
+ return s.CSSStyleDeclaration.prototype.removeProperty = function(c) {
2085
+ var a;
2086
+ if (r.has(c))
2087
+ return o.apply(this, [c]);
2088
+ const { id: d, styleId: l } = ce((a = this.parentRule) === null || a === void 0 ? void 0 : a.parentStyleSheet, t, n.styleMirror);
2089
2089
  return (d && d !== -1 || l && l !== -1) && e({
2090
2090
  id: d,
2091
2091
  styleId: l,
2092
2092
  remove: {
2093
- property: o
2093
+ property: c
2094
2094
  },
2095
2095
  index: He(this.parentRule)
2096
- }), a.apply(this, [o]);
2096
+ }), o.apply(this, [c]);
2097
2097
  }, () => {
2098
- s.CSSStyleDeclaration.prototype.setProperty = i, s.CSSStyleDeclaration.prototype.removeProperty = a;
2098
+ s.CSSStyleDeclaration.prototype.setProperty = i, s.CSSStyleDeclaration.prototype.removeProperty = o;
2099
2099
  };
2100
2100
  }
2101
- function _n({ mediaInteractionCb: e, blockClass: t, blockSelector: r, mirror: n, sampling: s }) {
2102
- const i = (o) => Fe((c) => {
2103
- const d = xe(c);
2101
+ function Nn({ mediaInteractionCb: e, blockClass: t, blockSelector: r, mirror: n, sampling: s }) {
2102
+ const i = (c) => Fe((a) => {
2103
+ const d = xe(a);
2104
2104
  if (!d || K(d, t, r, !0))
2105
2105
  return;
2106
2106
  const { currentTime: l, volume: u, muted: h, playbackRate: f } = d;
2107
2107
  e({
2108
- type: o,
2108
+ type: c,
2109
2109
  id: n.getId(d),
2110
2110
  currentTime: l,
2111
2111
  volume: u,
2112
2112
  muted: h,
2113
2113
  playbackRate: f
2114
2114
  });
2115
- }, s.media || 500), a = [
2115
+ }, s.media || 500), o = [
2116
2116
  G("play", i(0)),
2117
2117
  G("pause", i(1)),
2118
2118
  G("seeked", i(2)),
@@ -2120,49 +2120,49 @@ function _n({ mediaInteractionCb: e, blockClass: t, blockSelector: r, mirror: n,
2120
2120
  G("ratechange", i(4))
2121
2121
  ];
2122
2122
  return () => {
2123
- a.forEach((o) => o());
2123
+ o.forEach((c) => c());
2124
2124
  };
2125
2125
  }
2126
- function Nn({ fontCb: e, doc: t }) {
2126
+ function Mn({ fontCb: e, doc: t }) {
2127
2127
  const r = t.defaultView;
2128
2128
  if (!r)
2129
2129
  return () => {
2130
2130
  };
2131
2131
  const n = [], s = /* @__PURE__ */ new WeakMap(), i = r.FontFace;
2132
- r.FontFace = function(c, d, l) {
2133
- const u = new i(c, d, l);
2132
+ r.FontFace = function(a, d, l) {
2133
+ const u = new i(a, d, l);
2134
2134
  return s.set(u, {
2135
- family: c,
2135
+ family: a,
2136
2136
  buffer: typeof d != "string",
2137
2137
  descriptors: l,
2138
2138
  fontSource: typeof d == "string" ? d : JSON.stringify(Array.from(new Uint8Array(d)))
2139
2139
  }), u;
2140
2140
  };
2141
- const a = he(t.fonts, "add", function(o) {
2142
- return function(c) {
2141
+ const o = he(t.fonts, "add", function(c) {
2142
+ return function(a) {
2143
2143
  return setTimeout(() => {
2144
- const d = s.get(c);
2145
- d && (e(d), s.delete(c));
2146
- }, 0), o.apply(this, [c]);
2144
+ const d = s.get(a);
2145
+ d && (e(d), s.delete(a));
2146
+ }, 0), c.apply(this, [a]);
2147
2147
  };
2148
2148
  });
2149
2149
  return n.push(() => {
2150
2150
  r.FontFace = i;
2151
- }), n.push(a), () => {
2152
- n.forEach((o) => o());
2151
+ }), n.push(o), () => {
2152
+ n.forEach((c) => c());
2153
2153
  };
2154
2154
  }
2155
- function Mn(e) {
2155
+ function On(e) {
2156
2156
  const { doc: t, mirror: r, blockClass: n, blockSelector: s, selectionCb: i } = e;
2157
- let a = !0;
2158
- const o = () => {
2159
- const c = t.getSelection();
2160
- if (!c || a && (c != null && c.isCollapsed))
2157
+ let o = !0;
2158
+ const c = () => {
2159
+ const a = t.getSelection();
2160
+ if (!a || o && (a != null && a.isCollapsed))
2161
2161
  return;
2162
- a = c.isCollapsed || !1;
2163
- const d = [], l = c.rangeCount || 0;
2162
+ o = a.isCollapsed || !1;
2163
+ const d = [], l = a.rangeCount || 0;
2164
2164
  for (let u = 0; u < l; u++) {
2165
- const h = c.getRangeAt(u), { startContainer: f, startOffset: p, endContainer: y, endOffset: S } = h;
2165
+ const h = a.getRangeAt(u), { startContainer: f, startOffset: p, endContainer: y, endOffset: S } = h;
2166
2166
  K(f, n, s, !0) || K(y, n, s, !0) || d.push({
2167
2167
  start: r.getId(f),
2168
2168
  startOffset: p,
@@ -2172,10 +2172,10 @@ function Mn(e) {
2172
2172
  }
2173
2173
  i({ ranges: d });
2174
2174
  };
2175
- return o(), G("selectionchange", o);
2175
+ return c(), G("selectionchange", c);
2176
2176
  }
2177
- function On(e, t) {
2178
- const { mutationCb: r, mousemoveCb: n, mouseInteractionCb: s, scrollCb: i, viewportResizeCb: a, inputCb: o, mediaInteractionCb: c, styleSheetRuleCb: d, styleDeclarationCb: l, canvasMutationCb: u, fontCb: h, selectionCb: f } = e;
2177
+ function Ln(e, t) {
2178
+ const { mutationCb: r, mousemoveCb: n, mouseInteractionCb: s, scrollCb: i, viewportResizeCb: o, inputCb: c, mediaInteractionCb: a, styleSheetRuleCb: d, styleDeclarationCb: l, canvasMutationCb: u, fontCb: h, selectionCb: f } = e;
2179
2179
  e.mutationCb = (...p) => {
2180
2180
  t.mutation && t.mutation(...p), r(...p);
2181
2181
  }, e.mousemoveCb = (...p) => {
@@ -2185,11 +2185,11 @@ function On(e, t) {
2185
2185
  }, e.scrollCb = (...p) => {
2186
2186
  t.scroll && t.scroll(...p), i(...p);
2187
2187
  }, e.viewportResizeCb = (...p) => {
2188
- t.viewportResize && t.viewportResize(...p), a(...p);
2188
+ t.viewportResize && t.viewportResize(...p), o(...p);
2189
2189
  }, e.inputCb = (...p) => {
2190
- t.input && t.input(...p), o(...p);
2190
+ t.input && t.input(...p), c(...p);
2191
2191
  }, e.mediaInteractionCb = (...p) => {
2192
- t.mediaInteaction && t.mediaInteaction(...p), c(...p);
2192
+ t.mediaInteaction && t.mediaInteaction(...p), a(...p);
2193
2193
  }, e.styleSheetRuleCb = (...p) => {
2194
2194
  t.styleSheetRule && t.styleSheetRule(...p), d(...p);
2195
2195
  }, e.styleDeclarationCb = (...p) => {
@@ -2202,20 +2202,20 @@ function On(e, t) {
2202
2202
  t.selection && t.selection(...p), f(...p);
2203
2203
  };
2204
2204
  }
2205
- function Ln(e, t = {}) {
2205
+ function Fn(e, t = {}) {
2206
2206
  const r = e.doc.defaultView;
2207
2207
  if (!r)
2208
2208
  return () => {
2209
2209
  };
2210
- On(e, t);
2211
- const n = ur(e, e.doc), s = vn(e), i = wn(e), a = pr(e), o = An(e), c = Rn(e), d = _n(e), l = En(e, { win: r }), u = hr(e, e.doc), h = Tn(e, {
2210
+ Ln(e, t);
2211
+ const n = pr(e, e.doc), s = wn(e), i = An(e), o = hr(e), c = kn(e), a = Rn(e), d = Nn(e), l = Tn(e, { win: r }), u = fr(e, e.doc), h = _n(e, {
2212
2212
  win: r
2213
- }), f = e.collectFonts ? Nn(e) : () => {
2214
- }, p = Mn(e), y = [];
2213
+ }), f = e.collectFonts ? Mn(e) : () => {
2214
+ }, p = On(e), y = [];
2215
2215
  for (const S of e.plugins)
2216
2216
  y.push(S.observer(S.callback, r, S.options));
2217
2217
  return () => {
2218
- ue.forEach((S) => S.reset()), n.disconnect(), s(), i(), a(), o(), c(), d(), l(), u(), h(), f(), p(), y.forEach((S) => S());
2218
+ ue.forEach((S) => S.reset()), n.disconnect(), s(), i(), o(), c(), a(), d(), l(), u(), h(), f(), p(), y.forEach((S) => S());
2219
2219
  };
2220
2220
  }
2221
2221
  class Mt {
@@ -2223,9 +2223,9 @@ class Mt {
2223
2223
  this.generateIdFn = t, this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap(), this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap();
2224
2224
  }
2225
2225
  getId(t, r, n, s) {
2226
- const i = n || this.getIdToRemoteIdMap(t), a = s || this.getRemoteIdToIdMap(t);
2227
- let o = i.get(r);
2228
- return o || (o = this.generateIdFn(), i.set(r, o), a.set(o, r)), o;
2226
+ const i = n || this.getIdToRemoteIdMap(t), o = s || this.getRemoteIdToIdMap(t);
2227
+ let c = i.get(r);
2228
+ return c || (c = this.generateIdFn(), i.set(r, c), o.set(c, r)), c;
2229
2229
  }
2230
2230
  getIds(t, r) {
2231
2231
  const n = this.getIdToRemoteIdMap(t), s = this.getRemoteIdToIdMap(t);
@@ -2258,9 +2258,9 @@ class Mt {
2258
2258
  return r || (r = /* @__PURE__ */ new Map(), this.iframeRemoteIdToIdMap.set(t, r)), r;
2259
2259
  }
2260
2260
  }
2261
- class Fn {
2261
+ class xn {
2262
2262
  constructor(t) {
2263
- this.iframes = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMap = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMirror = new Mt(qt), this.mutationCb = t.mutationCb, this.wrappedEmit = t.wrappedEmit, this.stylesheetManager = t.stylesheetManager, this.recordCrossOriginIframes = t.recordCrossOriginIframes, this.crossOriginIframeStyleMirror = new Mt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)), this.mirror = t.mirror, this.recordCrossOriginIframes && window.addEventListener("message", this.handleMessage.bind(this));
2263
+ this.iframes = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMap = /* @__PURE__ */ new WeakMap(), this.crossOriginIframeMirror = new Mt(Yt), this.mutationCb = t.mutationCb, this.wrappedEmit = t.wrappedEmit, this.stylesheetManager = t.stylesheetManager, this.recordCrossOriginIframes = t.recordCrossOriginIframes, this.crossOriginIframeStyleMirror = new Mt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)), this.mirror = t.mirror, this.recordCrossOriginIframes && window.addEventListener("message", this.handleMessage.bind(this));
2264
2264
  }
2265
2265
  addIframe(t) {
2266
2266
  this.iframes.set(t, !0), t.contentWindow && this.crossOriginIframeMap.set(t.contentWindow, t);
@@ -2388,7 +2388,7 @@ class Fn {
2388
2388
  });
2389
2389
  }
2390
2390
  }
2391
- class xn {
2391
+ class Bn {
2392
2392
  constructor(t) {
2393
2393
  this.shadowDoms = /* @__PURE__ */ new WeakSet(), this.restorePatches = [], this.mutationCb = t.mutationCb, this.scrollCb = t.scrollCb, this.bypassOptions = t.bypassOptions, this.mirror = t.mirror;
2394
2394
  const r = this;
@@ -2400,8 +2400,8 @@ class xn {
2400
2400
  }));
2401
2401
  }
2402
2402
  addShadowRoot(t, r) {
2403
- Me(t) && (this.shadowDoms.has(t) || (this.shadowDoms.add(t), ur(Object.assign(Object.assign({}, this.bypassOptions), { doc: r, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), t), pr(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: t, mirror: this.mirror })), setTimeout(() => {
2404
- t.adoptedStyleSheets && t.adoptedStyleSheets.length > 0 && this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets, this.mirror.getId(t.host)), hr({
2403
+ Me(t) && (this.shadowDoms.has(t) || (this.shadowDoms.add(t), pr(Object.assign(Object.assign({}, this.bypassOptions), { doc: r, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), t), hr(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: t, mirror: this.mirror })), setTimeout(() => {
2404
+ t.adoptedStyleSheets && t.adoptedStyleSheets.length > 0 && this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets, this.mirror.getId(t.host)), fr({
2405
2405
  mirror: this.mirror,
2406
2406
  stylesheetManager: this.bypassOptions.stylesheetManager
2407
2407
  }, t);
@@ -2444,57 +2444,57 @@ function Dn(e, t) {
2444
2444
  t.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[s]) && (r[n[s]] = e[n[s]]);
2445
2445
  return r;
2446
2446
  }
2447
- function Bn(e, t, r, n) {
2447
+ function Un(e, t, r, n) {
2448
2448
  function s(i) {
2449
- return i instanceof r ? i : new r(function(a) {
2450
- a(i);
2449
+ return i instanceof r ? i : new r(function(o) {
2450
+ o(i);
2451
2451
  });
2452
2452
  }
2453
- return new (r || (r = Promise))(function(i, a) {
2454
- function o(l) {
2453
+ return new (r || (r = Promise))(function(i, o) {
2454
+ function c(l) {
2455
2455
  try {
2456
2456
  d(n.next(l));
2457
2457
  } catch (u) {
2458
- a(u);
2458
+ o(u);
2459
2459
  }
2460
2460
  }
2461
- function c(l) {
2461
+ function a(l) {
2462
2462
  try {
2463
2463
  d(n.throw(l));
2464
2464
  } catch (u) {
2465
- a(u);
2465
+ o(u);
2466
2466
  }
2467
2467
  }
2468
2468
  function d(l) {
2469
- l.done ? i(l.value) : s(l.value).then(o, c);
2469
+ l.done ? i(l.value) : s(l.value).then(c, a);
2470
2470
  }
2471
2471
  d((n = n.apply(e, [])).next());
2472
2472
  });
2473
2473
  }
2474
- var we = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Un = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
2475
- for (var De = 0; De < we.length; De++)
2476
- Un[we.charCodeAt(De)] = De;
2477
- var Wn = function(e) {
2474
+ var we = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Wn = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
2475
+ for (var Be = 0; Be < we.length; Be++)
2476
+ Wn[we.charCodeAt(Be)] = Be;
2477
+ var zn = function(e) {
2478
2478
  var t = new Uint8Array(e), r, n = t.length, s = "";
2479
2479
  for (r = 0; r < n; r += 3)
2480
2480
  s += we[t[r] >> 2], s += we[(t[r] & 3) << 4 | t[r + 1] >> 4], s += we[(t[r + 1] & 15) << 2 | t[r + 2] >> 6], s += we[t[r + 2] & 63];
2481
2481
  return n % 3 === 2 ? s = s.substring(0, s.length - 1) + "=" : n % 3 === 1 && (s = s.substring(0, s.length - 2) + "=="), s;
2482
2482
  };
2483
2483
  const Ot = /* @__PURE__ */ new Map();
2484
- function zn(e, t) {
2484
+ function Gn(e, t) {
2485
2485
  let r = Ot.get(e);
2486
2486
  return r || (r = /* @__PURE__ */ new Map(), Ot.set(e, r)), r.has(t) || r.set(t, []), r.get(t);
2487
2487
  }
2488
- const fr = (e, t, r) => {
2489
- if (!e || !(gr(e, t) || typeof e == "object"))
2488
+ const mr = (e, t, r) => {
2489
+ if (!e || !(yr(e, t) || typeof e == "object"))
2490
2490
  return;
2491
- const n = e.constructor.name, s = zn(r, n);
2491
+ const n = e.constructor.name, s = Gn(r, n);
2492
2492
  let i = s.indexOf(e);
2493
2493
  return i === -1 && (i = s.length, s.push(e)), i;
2494
2494
  };
2495
- function Be(e, t, r) {
2495
+ function De(e, t, r) {
2496
2496
  if (e instanceof Array)
2497
- return e.map((n) => Be(n, t, r));
2497
+ return e.map((n) => De(n, t, r));
2498
2498
  if (e === null)
2499
2499
  return e;
2500
2500
  if (e instanceof Float32Array || e instanceof Float64Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Uint8Array || e instanceof Uint16Array || e instanceof Int16Array || e instanceof Int8Array || e instanceof Uint8ClampedArray)
@@ -2503,7 +2503,7 @@ function Be(e, t, r) {
2503
2503
  args: [Object.values(e)]
2504
2504
  };
2505
2505
  if (e instanceof ArrayBuffer) {
2506
- const n = e.constructor.name, s = Wn(e);
2506
+ const n = e.constructor.name, s = zn(e);
2507
2507
  return {
2508
2508
  rr_type: n,
2509
2509
  base64: s
@@ -2513,7 +2513,7 @@ function Be(e, t, r) {
2513
2513
  return {
2514
2514
  rr_type: e.constructor.name,
2515
2515
  args: [
2516
- Be(e.buffer, t, r),
2516
+ De(e.buffer, t, r),
2517
2517
  e.byteOffset,
2518
2518
  e.byteLength
2519
2519
  ]
@@ -2534,10 +2534,10 @@ function Be(e, t, r) {
2534
2534
  if (e instanceof ImageData)
2535
2535
  return {
2536
2536
  rr_type: e.constructor.name,
2537
- args: [Be(e.data, t, r), e.width, e.height]
2537
+ args: [De(e.data, t, r), e.width, e.height]
2538
2538
  };
2539
- if (gr(e, t) || typeof e == "object") {
2540
- const n = e.constructor.name, s = fr(e, t, r);
2539
+ if (yr(e, t) || typeof e == "object") {
2540
+ const n = e.constructor.name, s = mr(e, t, r);
2541
2541
  return {
2542
2542
  rr_type: n,
2543
2543
  index: s
@@ -2547,7 +2547,7 @@ function Be(e, t, r) {
2547
2547
  }
2548
2548
  return e;
2549
2549
  }
2550
- const mr = (e, t, r) => [...e].map((n) => Be(n, t, r)), gr = (e, t) => !![
2550
+ const gr = (e, t, r) => [...e].map((n) => De(n, t, r)), yr = (e, t) => !![
2551
2551
  "WebGLActiveInfo",
2552
2552
  "WebGLBuffer",
2553
2553
  "WebGLFramebuffer",
@@ -2560,48 +2560,48 @@ const mr = (e, t, r) => [...e].map((n) => Be(n, t, r)), gr = (e, t) => !![
2560
2560
  "WebGLVertexArrayObject",
2561
2561
  "WebGLVertexArrayObjectOES"
2562
2562
  ].filter((s) => typeof t[s] == "function").find((s) => e instanceof t[s]);
2563
- function Gn(e, t, r, n) {
2563
+ function Kn(e, t, r, n) {
2564
2564
  const s = [], i = Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);
2565
- for (const a of i)
2565
+ for (const o of i)
2566
2566
  try {
2567
- if (typeof t.CanvasRenderingContext2D.prototype[a] != "function")
2567
+ if (typeof t.CanvasRenderingContext2D.prototype[o] != "function")
2568
2568
  continue;
2569
- const o = he(t.CanvasRenderingContext2D.prototype, a, function(c) {
2569
+ const c = he(t.CanvasRenderingContext2D.prototype, o, function(a) {
2570
2570
  return function(...d) {
2571
2571
  return K(this.canvas, r, n, !0) || setTimeout(() => {
2572
- const l = mr([...d], t, this);
2572
+ const l = gr([...d], t, this);
2573
2573
  e(this.canvas, {
2574
2574
  type: ke["2D"],
2575
- property: a,
2575
+ property: o,
2576
2576
  args: l
2577
2577
  });
2578
- }, 0), c.apply(this, d);
2578
+ }, 0), a.apply(this, d);
2579
2579
  };
2580
2580
  });
2581
- s.push(o);
2581
+ s.push(c);
2582
2582
  } catch {
2583
- const c = qe(t.CanvasRenderingContext2D.prototype, a, {
2583
+ const a = qe(t.CanvasRenderingContext2D.prototype, o, {
2584
2584
  set(d) {
2585
2585
  e(this.canvas, {
2586
2586
  type: ke["2D"],
2587
- property: a,
2587
+ property: o,
2588
2588
  args: [d],
2589
2589
  setter: !0
2590
2590
  });
2591
2591
  }
2592
2592
  });
2593
- s.push(c);
2593
+ s.push(a);
2594
2594
  }
2595
2595
  return () => {
2596
- s.forEach((a) => a());
2596
+ s.forEach((o) => o());
2597
2597
  };
2598
2598
  }
2599
2599
  function Lt(e, t, r) {
2600
2600
  const n = [];
2601
2601
  try {
2602
2602
  const s = he(e.HTMLCanvasElement.prototype, "getContext", function(i) {
2603
- return function(a, ...o) {
2604
- return K(this, t, r, !0) || "__context" in this || (this.__context = a), i.apply(this, [a, ...o]);
2603
+ return function(o, ...c) {
2604
+ return K(this, t, r, !0) || "__context" in this || (this.__context = o), i.apply(this, [o, ...c]);
2605
2605
  };
2606
2606
  });
2607
2607
  n.push(s);
@@ -2612,9 +2612,9 @@ function Lt(e, t, r) {
2612
2612
  n.forEach((s) => s());
2613
2613
  };
2614
2614
  }
2615
- function Ft(e, t, r, n, s, i, a) {
2616
- const o = [], c = Object.getOwnPropertyNames(e);
2617
- for (const d of c)
2615
+ function Ft(e, t, r, n, s, i, o) {
2616
+ const c = [], a = Object.getOwnPropertyNames(e);
2617
+ for (const d of a)
2618
2618
  if (![
2619
2619
  "isContextLost",
2620
2620
  "canvas",
@@ -2627,8 +2627,8 @@ function Ft(e, t, r, n, s, i, a) {
2627
2627
  const l = he(e, d, function(u) {
2628
2628
  return function(...h) {
2629
2629
  const f = u.apply(this, h);
2630
- if (fr(f, a, this), !K(this.canvas, n, s, !0)) {
2631
- const p = mr([...h], a, this), y = {
2630
+ if (mr(f, o, this), !K(this.canvas, n, s, !0)) {
2631
+ const p = gr([...h], o, this), y = {
2632
2632
  type: t,
2633
2633
  property: d,
2634
2634
  args: p
@@ -2638,7 +2638,7 @@ function Ft(e, t, r, n, s, i, a) {
2638
2638
  return f;
2639
2639
  };
2640
2640
  });
2641
- o.push(l);
2641
+ c.push(l);
2642
2642
  } catch {
2643
2643
  const u = qe(e, d, {
2644
2644
  set(h) {
@@ -2650,63 +2650,63 @@ function Ft(e, t, r, n, s, i, a) {
2650
2650
  });
2651
2651
  }
2652
2652
  });
2653
- o.push(u);
2653
+ c.push(u);
2654
2654
  }
2655
- return o;
2655
+ return c;
2656
2656
  }
2657
- function Kn(e, t, r, n, s) {
2657
+ function Vn(e, t, r, n, s) {
2658
2658
  const i = [];
2659
2659
  return i.push(...Ft(t.WebGLRenderingContext.prototype, ke.WebGL, e, r, n, s, t)), typeof t.WebGL2RenderingContext < "u" && i.push(...Ft(t.WebGL2RenderingContext.prototype, ke.WebGL2, e, r, n, s, t)), () => {
2660
- i.forEach((a) => a());
2660
+ i.forEach((o) => o());
2661
2661
  };
2662
2662
  }
2663
- var yr = null;
2663
+ var Ir = null;
2664
2664
  try {
2665
- var Vn = typeof module < "u" && typeof module.require == "function" && module.require("worker_threads") || typeof __non_webpack_require__ == "function" && __non_webpack_require__("worker_threads") || typeof require == "function" && require("worker_threads");
2666
- yr = Vn.Worker;
2665
+ var Pn = typeof module < "u" && typeof module.require == "function" && module.require("worker_threads") || typeof __non_webpack_require__ == "function" && __non_webpack_require__("worker_threads") || typeof require == "function" && require("worker_threads");
2666
+ Ir = Pn.Worker;
2667
2667
  } catch {
2668
2668
  }
2669
- function Pn(e, t) {
2669
+ function Zn(e, t) {
2670
2670
  return Buffer.from(e, "base64").toString("utf8");
2671
2671
  }
2672
- function Zn(e, t, r) {
2673
- var n = Pn(e), s = n.indexOf(`
2672
+ function Hn(e, t, r) {
2673
+ var n = Zn(e), s = n.indexOf(`
2674
2674
  `, 10) + 1, i = n.substring(s) + "";
2675
- return function(o) {
2676
- return new yr(i, Object.assign({}, o, { eval: !0 }));
2675
+ return function(c) {
2676
+ return new Ir(i, Object.assign({}, c, { eval: !0 }));
2677
2677
  };
2678
2678
  }
2679
- function Hn(e, t) {
2679
+ function jn(e, t) {
2680
2680
  var r = atob(e);
2681
2681
  return r;
2682
2682
  }
2683
- function jn(e, t, r) {
2684
- var n = Hn(e), s = n.indexOf(`
2685
- `, 10) + 1, i = n.substring(s) + "", a = new Blob([i], { type: "application/javascript" });
2686
- return URL.createObjectURL(a);
2687
- }
2688
2683
  function Jn(e, t, r) {
2684
+ var n = jn(e), s = n.indexOf(`
2685
+ `, 10) + 1, i = n.substring(s) + "", o = new Blob([i], { type: "application/javascript" });
2686
+ return URL.createObjectURL(o);
2687
+ }
2688
+ function qn(e, t, r) {
2689
2689
  var n;
2690
2690
  return function(i) {
2691
- return n = n || jn(e), new Worker(n, i);
2691
+ return n = n || Jn(e), new Worker(n, i);
2692
2692
  };
2693
2693
  }
2694
- var qn = Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
2695
- function Yn() {
2696
- return qn;
2694
+ var Yn = Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
2695
+ function Xn() {
2696
+ return Yn;
2697
2697
  }
2698
- function Xn(e, t, r) {
2699
- return Yn() ? Zn(e) : Jn(e);
2698
+ function Qn(e, t, r) {
2699
+ return Xn() ? Hn(e) : qn(e);
2700
2700
  }
2701
- var Qn = Xn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");
2702
- class $n {
2701
+ var $n = Qn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");
2702
+ class es {
2703
2703
  constructor(t) {
2704
- this.pendingCanvasMutations = /* @__PURE__ */ new Map(), this.rafStamps = { latestId: 0, invokeId: null }, this.frozen = !1, this.locked = !1, this.processMutation = (c, d) => {
2705
- (this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId || !this.rafStamps.invokeId) && (this.rafStamps.invokeId = this.rafStamps.latestId), this.pendingCanvasMutations.has(c) || this.pendingCanvasMutations.set(c, []), this.pendingCanvasMutations.get(c).push(d);
2704
+ this.pendingCanvasMutations = /* @__PURE__ */ new Map(), this.rafStamps = { latestId: 0, invokeId: null }, this.frozen = !1, this.locked = !1, this.processMutation = (a, d) => {
2705
+ (this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId || !this.rafStamps.invokeId) && (this.rafStamps.invokeId = this.rafStamps.latestId), this.pendingCanvasMutations.has(a) || this.pendingCanvasMutations.set(a, []), this.pendingCanvasMutations.get(a).push(d);
2706
2706
  };
2707
- const { sampling: r = "all", win: n, blockClass: s, blockSelector: i, recordCanvas: a, dataURLOptions: o } = t;
2708
- this.mutationCb = t.mutationCb, this.mirror = t.mirror, a && r === "all" && this.initCanvasMutationObserver(n, s, i), a && typeof r == "number" && this.initCanvasFPSObserver(r, n, s, i, {
2709
- dataURLOptions: o
2707
+ const { sampling: r = "all", win: n, blockClass: s, blockSelector: i, recordCanvas: o, dataURLOptions: c } = t;
2708
+ this.mutationCb = t.mutationCb, this.mirror = t.mirror, o && r === "all" && this.initCanvasMutationObserver(n, s, i), o && typeof r == "number" && this.initCanvasFPSObserver(r, n, s, i, {
2709
+ dataURLOptions: c
2710
2710
  });
2711
2711
  }
2712
2712
  reset() {
@@ -2725,10 +2725,10 @@ class $n {
2725
2725
  this.locked = !1;
2726
2726
  }
2727
2727
  initCanvasFPSObserver(t, r, n, s, i) {
2728
- const a = Lt(r, n, s), o = /* @__PURE__ */ new Map(), c = new Qn();
2729
- c.onmessage = (p) => {
2728
+ const o = Lt(r, n, s), c = /* @__PURE__ */ new Map(), a = new $n();
2729
+ a.onmessage = (p) => {
2730
2730
  const { id: y } = p.data;
2731
- if (o.set(y, !1), !("base64" in p.data))
2731
+ if (c.set(y, !1), !("base64" in p.data))
2732
2732
  return;
2733
2733
  const { base64: S, type: C, width: m, height: g } = p.data;
2734
2734
  this.mutationCb({
@@ -2771,17 +2771,17 @@ class $n {
2771
2771
  u = requestAnimationFrame(f);
2772
2772
  return;
2773
2773
  }
2774
- l = p, h().forEach((y) => Bn(this, void 0, void 0, function* () {
2774
+ l = p, h().forEach((y) => Un(this, void 0, void 0, function* () {
2775
2775
  var S;
2776
2776
  const C = this.mirror.getId(y);
2777
- if (o.get(C))
2777
+ if (c.get(C))
2778
2778
  return;
2779
- if (o.set(C, !0), ["webgl", "webgl2"].includes(y.__context)) {
2779
+ if (c.set(C, !0), ["webgl", "webgl2"].includes(y.__context)) {
2780
2780
  const g = y.getContext(y.__context);
2781
2781
  ((S = g == null ? void 0 : g.getContextAttributes()) === null || S === void 0 ? void 0 : S.preserveDrawingBuffer) === !1 && (g == null || g.clear(g.COLOR_BUFFER_BIT));
2782
2782
  }
2783
2783
  const m = yield createImageBitmap(y);
2784
- c.postMessage({
2784
+ a.postMessage({
2785
2785
  id: C,
2786
2786
  bitmap: m,
2787
2787
  width: y.width,
@@ -2791,14 +2791,14 @@ class $n {
2791
2791
  })), u = requestAnimationFrame(f);
2792
2792
  };
2793
2793
  u = requestAnimationFrame(f), this.resetObservers = () => {
2794
- a(), cancelAnimationFrame(u);
2794
+ o(), cancelAnimationFrame(u);
2795
2795
  };
2796
2796
  }
2797
2797
  initCanvasMutationObserver(t, r, n) {
2798
2798
  this.startRAFTimestamping(), this.startPendingCanvasMutationFlusher();
2799
- const s = Lt(t, r, n), i = Gn(this.processMutation.bind(this), t, r, n), a = Kn(this.processMutation.bind(this), t, r, n, this.mirror);
2799
+ const s = Lt(t, r, n), i = Kn(this.processMutation.bind(this), t, r, n), o = Vn(this.processMutation.bind(this), t, r, n, this.mirror);
2800
2800
  this.resetObservers = () => {
2801
- s(), i(), a();
2801
+ s(), i(), o();
2802
2802
  };
2803
2803
  }
2804
2804
  startPendingCanvasMutationFlusher() {
@@ -2822,13 +2822,13 @@ class $n {
2822
2822
  const n = this.pendingCanvasMutations.get(t);
2823
2823
  if (!n || r === -1)
2824
2824
  return;
2825
- const s = n.map((a) => Dn(a, ["type"])), { type: i } = n[0];
2825
+ const s = n.map((o) => Dn(o, ["type"])), { type: i } = n[0];
2826
2826
  this.mutationCb({ id: r, type: i, commands: s }), this.pendingCanvasMutations.delete(t);
2827
2827
  }
2828
2828
  }
2829
- class es {
2829
+ class ts {
2830
2830
  constructor(t) {
2831
- this.trackedLinkElements = /* @__PURE__ */ new WeakSet(), this.styleMirror = new Cn(), this.mutationCb = t.mutationCb, this.adoptedStyleSheetCb = t.adoptedStyleSheetCb;
2831
+ this.trackedLinkElements = /* @__PURE__ */ new WeakSet(), this.styleMirror = new Sn(), this.mutationCb = t.mutationCb, this.adoptedStyleSheetCb = t.adoptedStyleSheetCb;
2832
2832
  }
2833
2833
  attachLinkElement(t, r) {
2834
2834
  "_cssText" in r.attributes && this.mutationCb({
@@ -2854,21 +2854,21 @@ class es {
2854
2854
  styleIds: []
2855
2855
  }, s = [];
2856
2856
  for (const i of t) {
2857
- let a;
2857
+ let o;
2858
2858
  if (this.styleMirror.has(i))
2859
- a = this.styleMirror.getId(i);
2859
+ o = this.styleMirror.getId(i);
2860
2860
  else {
2861
- a = this.styleMirror.add(i);
2862
- const o = Array.from(i.rules || CSSRule);
2861
+ o = this.styleMirror.add(i);
2862
+ const c = Array.from(i.rules || CSSRule);
2863
2863
  s.push({
2864
- styleId: a,
2865
- rules: o.map((c, d) => ({
2866
- rule: jt(c),
2864
+ styleId: o,
2865
+ rules: c.map((a, d) => ({
2866
+ rule: Jt(a),
2867
2867
  index: d
2868
2868
  }))
2869
2869
  });
2870
2870
  }
2871
- n.styleIds.push(a);
2871
+ n.styleIds.push(o);
2872
2872
  }
2873
2873
  s.length > 0 && (n.styles = s), this.adoptedStyleSheetCb(n);
2874
2874
  }
@@ -2882,9 +2882,9 @@ function L(e) {
2882
2882
  return Object.assign(Object.assign({}, e), { timestamp: Date.now() });
2883
2883
  }
2884
2884
  let _, Ue, $e, je = !1;
2885
- const ne = jr();
2886
- function Re(e = {}) {
2887
- const { emit: t, checkoutEveryNms: r, checkoutEveryNth: n, blockClass: s = "rr-block", blockSelector: i = null, ignoreClass: a = "rr-ignore", maskTextClass: o = "rr-mask", maskTextSelector: c = null, inlineStylesheet: d = !0, maskAllInputs: l, maskInputOptions: u, slimDOMOptions: h, maskInputFn: f, maskTextFn: p, hooks: y, packFn: S, sampling: C = {}, dataURLOptions: m = {}, mousemoveWait: g, recordCanvas: k = !1, recordCrossOriginIframes: U = !1, userTriggeredOnInput: x = !1, collectFonts: D = !1, inlineImages: R = !1, plugins: H, keepIframeSrcFn: j = () => !1, ignoreCSSAttributes: X = /* @__PURE__ */ new Set([]) } = e, Q = U ? window.parent === window : !0;
2885
+ const ne = Jr();
2886
+ function Ee(e = {}) {
2887
+ const { emit: t, checkoutEveryNms: r, checkoutEveryNth: n, blockClass: s = "rr-block", blockSelector: i = null, ignoreClass: o = "rr-ignore", maskTextClass: c = "rr-mask", maskTextSelector: a = null, inlineStylesheet: d = !0, maskAllInputs: l, maskInputOptions: u, slimDOMOptions: h, maskInputFn: f, maskTextFn: p, hooks: y, packFn: S, sampling: C = {}, dataURLOptions: m = {}, mousemoveWait: g, recordCanvas: k = !1, recordCrossOriginIframes: U = !1, userTriggeredOnInput: x = !1, collectFonts: B = !1, inlineImages: E = !1, plugins: H, keepIframeSrcFn: j = () => !1, ignoreCSSAttributes: X = /* @__PURE__ */ new Set([]) } = e, Q = U ? window.parent === window : !0;
2888
2888
  let $ = !1;
2889
2889
  if (!Q)
2890
2890
  try {
@@ -2924,9 +2924,9 @@ function Re(e = {}) {
2924
2924
  headMetaAuthorship: h === "all",
2925
2925
  headMetaDescKeywords: h === "all"
2926
2926
  } : h || {};
2927
- In();
2927
+ Cn();
2928
2928
  let ee, se = 0;
2929
- const ae = (I) => {
2929
+ const oe = (I) => {
2930
2930
  for (const W of H || [])
2931
2931
  W.eventProcessor && (I = W.eventProcessor(I));
2932
2932
  return S && (I = S(I)), I;
@@ -2934,11 +2934,11 @@ function Re(e = {}) {
2934
2934
  _ = (I, W) => {
2935
2935
  var P;
2936
2936
  if (!((P = ue[0]) === null || P === void 0) && P.isFrozen() && I.type !== v.FullSnapshot && !(I.type === v.IncrementalSnapshot && I.data.source === b.Mutation) && ue.forEach((T) => T.unfreeze()), Q)
2937
- t == null || t(ae(I), W);
2937
+ t == null || t(oe(I), W);
2938
2938
  else if ($) {
2939
2939
  const T = {
2940
2940
  type: "rrweb",
2941
- event: ae(I),
2941
+ event: oe(I),
2942
2942
  isCheckout: W
2943
2943
  };
2944
2944
  window.parent.postMessage(T, "*");
@@ -2961,16 +2961,16 @@ function Re(e = {}) {
2961
2961
  }, q = (I) => _(L({
2962
2962
  type: v.IncrementalSnapshot,
2963
2963
  data: Object.assign({ source: b.Scroll }, I)
2964
- })), oe = (I) => _(L({
2964
+ })), ae = (I) => _(L({
2965
2965
  type: v.IncrementalSnapshot,
2966
2966
  data: Object.assign({ source: b.CanvasMutation }, I)
2967
2967
  })), N = (I) => _(L({
2968
2968
  type: v.IncrementalSnapshot,
2969
2969
  data: Object.assign({ source: b.AdoptedStyleSheet }, I)
2970
- })), te = new es({
2970
+ })), te = new ts({
2971
2971
  mutationCb: V,
2972
2972
  adoptedStyleSheetCb: N
2973
- }), ie = new Fn({
2973
+ }), ie = new xn({
2974
2974
  mirror: ne,
2975
2975
  mutationCb: V,
2976
2976
  stylesheetManager: te,
@@ -2983,9 +2983,9 @@ function Re(e = {}) {
2983
2983
  crossOriginIframeMirror: ie.crossOriginIframeMirror,
2984
2984
  crossOriginIframeStyleMirror: ie.crossOriginIframeStyleMirror
2985
2985
  });
2986
- $e = new $n({
2986
+ $e = new es({
2987
2987
  recordCanvas: k,
2988
- mutationCb: oe,
2988
+ mutationCb: ae,
2989
2989
  win: window,
2990
2990
  blockClass: s,
2991
2991
  blockSelector: i,
@@ -2993,21 +2993,21 @@ function Re(e = {}) {
2993
2993
  sampling: C.canvas,
2994
2994
  dataURLOptions: m
2995
2995
  });
2996
- const me = new xn({
2996
+ const me = new Bn({
2997
2997
  mutationCb: V,
2998
2998
  scrollCb: q,
2999
2999
  bypassOptions: {
3000
3000
  blockClass: s,
3001
3001
  blockSelector: i,
3002
- maskTextClass: o,
3003
- maskTextSelector: c,
3002
+ maskTextClass: c,
3003
+ maskTextSelector: a,
3004
3004
  inlineStylesheet: d,
3005
3005
  maskInputOptions: O,
3006
3006
  dataURLOptions: m,
3007
3007
  maskTextFn: p,
3008
3008
  maskInputFn: f,
3009
3009
  recordCanvas: k,
3010
- inlineImages: R,
3010
+ inlineImages: E,
3011
3011
  sampling: C,
3012
3012
  slimDOMOptions: J,
3013
3013
  iframeManager: ie,
@@ -3023,25 +3023,25 @@ function Re(e = {}) {
3023
3023
  type: v.Meta,
3024
3024
  data: {
3025
3025
  href: window.location.href,
3026
- width: $t(),
3027
- height: Qt()
3026
+ width: er(),
3027
+ height: $t()
3028
3028
  }
3029
3029
  }), I), te.reset(), ue.forEach((z) => z.lock());
3030
- const Ee = gn(document, {
3030
+ const Re = yn(document, {
3031
3031
  mirror: ne,
3032
3032
  blockClass: s,
3033
3033
  blockSelector: i,
3034
- maskTextClass: o,
3035
- maskTextSelector: c,
3034
+ maskTextClass: c,
3035
+ maskTextSelector: a,
3036
3036
  inlineStylesheet: d,
3037
3037
  maskAllInputs: O,
3038
3038
  maskTextFn: p,
3039
3039
  slimDOM: J,
3040
3040
  dataURLOptions: m,
3041
3041
  recordCanvas: k,
3042
- inlineImages: R,
3042
+ inlineImages: E,
3043
3043
  onSerialize: (z) => {
3044
- rr(z, ne) && ie.addIframe(z), nr(z, ne) && te.trackLinkElement(z), sr(z) && me.addShadowRoot(z.shadowRoot, document);
3044
+ nr(z, ne) && ie.addIframe(z), sr(z, ne) && te.trackLinkElement(z), ir(z) && me.addShadowRoot(z.shadowRoot, document);
3045
3045
  },
3046
3046
  onIframeLoad: (z, Ye) => {
3047
3047
  ie.attachIframe(z, Ye), me.observeAttachShadow(z);
@@ -3051,12 +3051,12 @@ function Re(e = {}) {
3051
3051
  },
3052
3052
  keepIframeSrcFn: j
3053
3053
  });
3054
- if (!Ee)
3054
+ if (!Re)
3055
3055
  return console.warn("Failed to snapshot the document");
3056
3056
  _(L({
3057
3057
  type: v.FullSnapshot,
3058
3058
  data: {
3059
- node: Ee,
3059
+ node: Re,
3060
3060
  initialOffset: {
3061
3061
  left: window.pageXOffset !== void 0 ? window.pageXOffset : (document == null ? void 0 : document.documentElement.scrollLeft) || ((P = (W = document == null ? void 0 : document.body) === null || W === void 0 ? void 0 : W.parentElement) === null || P === void 0 ? void 0 : P.scrollLeft) || ((T = document == null ? void 0 : document.body) === null || T === void 0 ? void 0 : T.scrollLeft) || 0,
3062
3062
  top: window.pageYOffset !== void 0 ? window.pageYOffset : (document == null ? void 0 : document.documentElement.scrollTop) || ((A = (Y = document == null ? void 0 : document.body) === null || Y === void 0 ? void 0 : Y.parentElement) === null || A === void 0 ? void 0 : A.scrollTop) || ((Z = document == null ? void 0 : document.body) === null || Z === void 0 ? void 0 : Z.scrollTop) || 0
@@ -3074,7 +3074,7 @@ function Re(e = {}) {
3074
3074
  }));
3075
3075
  const W = (T) => {
3076
3076
  var Y;
3077
- return Ln({
3077
+ return Fn({
3078
3078
  mutationCb: V,
3079
3079
  mousemoveCb: (A, Z) => _(L({
3080
3080
  type: v.IncrementalSnapshot,
@@ -3108,7 +3108,7 @@ function Re(e = {}) {
3108
3108
  type: v.IncrementalSnapshot,
3109
3109
  data: Object.assign({ source: b.StyleDeclaration }, A)
3110
3110
  })),
3111
- canvasMutationCb: oe,
3111
+ canvasMutationCb: ae,
3112
3112
  fontCb: (A) => _(L({
3113
3113
  type: v.IncrementalSnapshot,
3114
3114
  data: Object.assign({ source: b.Font }, A)
@@ -3120,16 +3120,16 @@ function Re(e = {}) {
3120
3120
  }));
3121
3121
  },
3122
3122
  blockClass: s,
3123
- ignoreClass: a,
3124
- maskTextClass: o,
3125
- maskTextSelector: c,
3123
+ ignoreClass: o,
3124
+ maskTextClass: c,
3125
+ maskTextSelector: a,
3126
3126
  maskInputOptions: O,
3127
3127
  inlineStylesheet: d,
3128
3128
  sampling: C,
3129
3129
  recordCanvas: k,
3130
- inlineImages: R,
3130
+ inlineImages: E,
3131
3131
  userTriggeredOnInput: x,
3132
- collectFonts: D,
3132
+ collectFonts: B,
3133
3133
  doc: T,
3134
3134
  maskInputFn: f,
3135
3135
  maskTextFn: p,
@@ -3174,7 +3174,7 @@ function Re(e = {}) {
3174
3174
  console.warn(I);
3175
3175
  }
3176
3176
  }
3177
- Re.addCustomEvent = (e, t) => {
3177
+ Ee.addCustomEvent = (e, t) => {
3178
3178
  if (!je)
3179
3179
  throw new Error("please add custom event after start recording");
3180
3180
  _(L({
@@ -3185,16 +3185,16 @@ Re.addCustomEvent = (e, t) => {
3185
3185
  }
3186
3186
  }));
3187
3187
  };
3188
- Re.freezePage = () => {
3188
+ Ee.freezePage = () => {
3189
3189
  ue.forEach((e) => e.freeze());
3190
3190
  };
3191
- Re.takeFullSnapshot = (e) => {
3191
+ Ee.takeFullSnapshot = (e) => {
3192
3192
  if (!je)
3193
3193
  throw new Error("please take full snapshot after start recording");
3194
3194
  Ue(e);
3195
3195
  };
3196
- Re.mirror = ne;
3197
- const { addCustomEvent: ts } = Re;
3196
+ Ee.mirror = ne;
3197
+ const { addCustomEvent: rs } = Ee;
3198
3198
  class Ie {
3199
3199
  constructor(t) {
3200
3200
  this.fileName = t.fileName || "", this.functionName = t.functionName || "", this.lineNumber = t.lineNumber, this.columnNumber = t.columnNumber;
@@ -3204,7 +3204,7 @@ class Ie {
3204
3204
  return this.functionName ? `${this.functionName} (${this.fileName}:${t}:${r})` : `${this.fileName}:${t}:${r}`;
3205
3205
  }
3206
3206
  }
3207
- const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)?(\[native code])?$/, Dt = {
3207
+ const ns = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ss = /^(eval@)?(\[native code])?$/, Bt = {
3208
3208
  parse: function(e) {
3209
3209
  if (!e)
3210
3210
  return [];
@@ -3233,31 +3233,31 @@ const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)
3233
3233
  let n = r.replace(/^\s+/, "").replace(/\(eval code/g, "(");
3234
3234
  const s = n.match(/ (\((.+):(\d+):(\d+)\)$)/);
3235
3235
  n = s ? n.replace(s[0], "") : n;
3236
- const i = n.split(/\s+/).slice(1), a = this.extractLocation(s ? s[1] : i.pop()), o = i.join(" ") || void 0, c = ["eval", "<anonymous>"].indexOf(a[0]) > -1 ? void 0 : a[0];
3236
+ const i = n.split(/\s+/).slice(1), o = this.extractLocation(s ? s[1] : i.pop()), c = i.join(" ") || void 0, a = ["eval", "<anonymous>"].indexOf(o[0]) > -1 ? void 0 : o[0];
3237
3237
  return new Ie({
3238
- functionName: o,
3239
- fileName: c,
3240
- lineNumber: a[1],
3241
- columnNumber: a[2]
3238
+ functionName: c,
3239
+ fileName: a,
3240
+ lineNumber: o[1],
3241
+ columnNumber: o[2]
3242
3242
  });
3243
3243
  }, this);
3244
3244
  },
3245
3245
  parseFFOrSafari: function(e) {
3246
3246
  return e.stack.split(`
3247
3247
  `).filter(function(r) {
3248
- return !r.match(ns);
3248
+ return !r.match(ss);
3249
3249
  }, this).map(function(r) {
3250
3250
  if (r.indexOf(" > eval") > -1 && (r = r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), r.indexOf("@") === -1 && r.indexOf(":") === -1)
3251
3251
  return new Ie({
3252
3252
  functionName: r
3253
3253
  });
3254
3254
  {
3255
- const n = /((.*".+"[^@]*)?[^@]*)(?:@)/, s = r.match(n), i = s && s[1] ? s[1] : void 0, a = this.extractLocation(r.replace(n, ""));
3255
+ const n = /((.*".+"[^@]*)?[^@]*)(?:@)/, s = r.match(n), i = s && s[1] ? s[1] : void 0, o = this.extractLocation(r.replace(n, ""));
3256
3256
  return new Ie({
3257
3257
  functionName: i,
3258
- fileName: a[0],
3259
- lineNumber: a[1],
3260
- columnNumber: a[2]
3258
+ fileName: o[0],
3259
+ lineNumber: o[1],
3260
+ columnNumber: o[2]
3261
3261
  });
3262
3262
  }
3263
3263
  }, this);
@@ -3272,10 +3272,10 @@ const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)
3272
3272
  const t = /Line (\d+).*script (?:in )?(\S+)/i, r = e.message.split(`
3273
3273
  `), n = [];
3274
3274
  for (let s = 2, i = r.length; s < i; s += 2) {
3275
- const a = t.exec(r[s]);
3276
- a && n.push(new Ie({
3277
- fileName: a[2],
3278
- lineNumber: parseFloat(a[1])
3275
+ const o = t.exec(r[s]);
3276
+ o && n.push(new Ie({
3277
+ fileName: o[2],
3278
+ lineNumber: parseFloat(o[1])
3279
3279
  }));
3280
3280
  }
3281
3281
  return n;
@@ -3284,11 +3284,11 @@ const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)
3284
3284
  const t = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, r = e.stacktrace.split(`
3285
3285
  `), n = [];
3286
3286
  for (let s = 0, i = r.length; s < i; s += 2) {
3287
- const a = t.exec(r[s]);
3288
- a && n.push(new Ie({
3289
- functionName: a[3] || void 0,
3290
- fileName: a[2],
3291
- lineNumber: parseFloat(a[1])
3287
+ const o = t.exec(r[s]);
3288
+ o && n.push(new Ie({
3289
+ functionName: o[3] || void 0,
3290
+ fileName: o[2],
3291
+ lineNumber: parseFloat(o[1])
3292
3292
  }));
3293
3293
  }
3294
3294
  return n;
@@ -3296,11 +3296,11 @@ const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)
3296
3296
  parseOpera11: function(e) {
3297
3297
  return e.stack.split(`
3298
3298
  `).filter(function(r) {
3299
- return !!r.match(rs) && !r.match(/^Error created at/);
3299
+ return !!r.match(ns) && !r.match(/^Error created at/);
3300
3300
  }, this).map(function(r) {
3301
- const n = r.split("@"), s = this.extractLocation(n.pop()), a = (n.shift() || "").replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0;
3301
+ const n = r.split("@"), s = this.extractLocation(n.pop()), o = (n.shift() || "").replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0;
3302
3302
  return new Ie({
3303
- functionName: a,
3303
+ functionName: o,
3304
3304
  fileName: s[0],
3305
3305
  lineNumber: s[1],
3306
3306
  columnNumber: s[2]
@@ -3308,7 +3308,7 @@ const rs = /(^|@)\S+:\d+/, xt = /^\s*at .*(\S+:\d+|\(native\))/m, ns = /^(eval@)
3308
3308
  }, this);
3309
3309
  }
3310
3310
  };
3311
- function ss(e) {
3311
+ function is(e) {
3312
3312
  if (!e || !e.outerHTML)
3313
3313
  return "";
3314
3314
  let t = "";
@@ -3320,8 +3320,8 @@ function ss(e) {
3320
3320
  const n = e.parentElement, s = [];
3321
3321
  if (n.children && n.children.length > 0)
3322
3322
  for (let i = 0; i < n.children.length; i++) {
3323
- const a = n.children[i];
3324
- a.localName && a.localName.toLowerCase && a.localName.toLowerCase() === r && s.push(a);
3323
+ const o = n.children[i];
3324
+ o.localName && o.localName.toLowerCase && o.localName.toLowerCase() === r && s.push(o);
3325
3325
  }
3326
3326
  s.length > 1 && (r += `:eq(${s.indexOf(e)})`), t = r + (t ? ">" + t : ""), e = n;
3327
3327
  }
@@ -3330,12 +3330,12 @@ function ss(e) {
3330
3330
  function dt(e) {
3331
3331
  return Object.prototype.toString.call(e) === "[object Object]";
3332
3332
  }
3333
- function Ir(e, t) {
3333
+ function Cr(e, t) {
3334
3334
  if (t === 0)
3335
3335
  return !0;
3336
3336
  const r = Object.keys(e);
3337
3337
  for (const n of r)
3338
- if (dt(e[n]) && Ir(e[n], t - 1))
3338
+ if (dt(e[n]) && Cr(e[n], t - 1))
3339
3339
  return !0;
3340
3340
  return !1;
3341
3341
  }
@@ -3346,43 +3346,43 @@ function et(e, t) {
3346
3346
  };
3347
3347
  Object.assign(r, t);
3348
3348
  const n = [], s = [];
3349
- return JSON.stringify(e, function(o, c) {
3349
+ return JSON.stringify(e, function(c, a) {
3350
3350
  if (n.length > 0) {
3351
3351
  const d = n.indexOf(this);
3352
- ~d ? n.splice(d + 1) : n.push(this), ~d ? s.splice(d, 1 / 0, o) : s.push(o), ~n.indexOf(c) && (n[0] === c ? c = "[Circular ~]" : c = "[Circular ~." + s.slice(0, n.indexOf(c)).join(".") + "]");
3352
+ ~d ? n.splice(d + 1) : n.push(this), ~d ? s.splice(d, 1 / 0, c) : s.push(c), ~n.indexOf(a) && (n[0] === a ? a = "[Circular ~]" : a = "[Circular ~." + s.slice(0, n.indexOf(a)).join(".") + "]");
3353
3353
  } else
3354
- n.push(c);
3355
- if (c === null)
3356
- return c;
3357
- if (c === void 0)
3354
+ n.push(a);
3355
+ if (a === null)
3356
+ return a;
3357
+ if (a === void 0)
3358
3358
  return "undefined";
3359
- if (i(c))
3360
- return a(c);
3361
- if (c instanceof Event) {
3359
+ if (i(a))
3360
+ return o(a);
3361
+ if (a instanceof Event) {
3362
3362
  const d = {};
3363
- for (const l in c) {
3364
- const u = c[l];
3365
- Array.isArray(u) ? d[l] = ss(u.length ? u[0] : null) : d[l] = u;
3363
+ for (const l in a) {
3364
+ const u = a[l];
3365
+ Array.isArray(u) ? d[l] = is(u.length ? u[0] : null) : d[l] = u;
3366
3366
  }
3367
3367
  return d;
3368
3368
  } else {
3369
- if (c instanceof Node)
3370
- return c instanceof HTMLElement ? c ? c.outerHTML : "" : c.nodeName;
3371
- if (c instanceof Error)
3372
- return c.stack ? c.stack + `
3373
- End of stack for Error object` : c.name + ": " + c.message;
3369
+ if (a instanceof Node)
3370
+ return a instanceof HTMLElement ? a ? a.outerHTML : "" : a.nodeName;
3371
+ if (a instanceof Error)
3372
+ return a.stack ? a.stack + `
3373
+ End of stack for Error object` : a.name + ": " + a.message;
3374
3374
  }
3375
- return c;
3375
+ return a;
3376
3376
  });
3377
- function i(o) {
3378
- return !!(dt(o) && Object.keys(o).length > r.numOfKeysLimit || typeof o == "function" || dt(o) && Ir(o, r.depthOfLimit));
3377
+ function i(c) {
3378
+ return !!(dt(c) && Object.keys(c).length > r.numOfKeysLimit || typeof c == "function" || dt(c) && Cr(c, r.depthOfLimit));
3379
3379
  }
3380
- function a(o) {
3381
- let c = o.toString();
3382
- return r.stringLengthLimit && c.length > r.stringLengthLimit && (c = `${c.slice(0, r.stringLengthLimit)}...`), c;
3380
+ function o(c) {
3381
+ let a = c.toString();
3382
+ return r.stringLengthLimit && a.length > r.stringLengthLimit && (a = `${a.slice(0, r.stringLengthLimit)}...`), a;
3383
3383
  }
3384
3384
  }
3385
- const Bt = {
3385
+ const Dt = {
3386
3386
  level: [
3387
3387
  "assert",
3388
3388
  "clear",
@@ -3407,43 +3407,43 @@ const Bt = {
3407
3407
  lengthThreshold: 1e3,
3408
3408
  logger: "console"
3409
3409
  };
3410
- function is(e, t, r) {
3411
- const n = r ? Object.assign({}, Bt, r) : Bt, s = n.logger;
3410
+ function os(e, t, r) {
3411
+ const n = r ? Object.assign({}, Dt, r) : Dt, s = n.logger;
3412
3412
  if (!s)
3413
3413
  return () => {
3414
3414
  };
3415
3415
  let i;
3416
3416
  typeof s == "string" ? i = t[s] : i = s;
3417
- let a = 0;
3418
- const o = [];
3417
+ let o = 0;
3418
+ const c = [];
3419
3419
  if (n.level.includes("error") && window) {
3420
3420
  const d = (l) => {
3421
- const u = l.message, h = l.error, f = Dt.parse(h).map((y) => y.toString()), p = [et(u, n.stringifyOptions)];
3421
+ const u = l.message, h = l.error, f = Bt.parse(h).map((y) => y.toString()), p = [et(u, n.stringifyOptions)];
3422
3422
  e({
3423
3423
  level: "error",
3424
3424
  trace: f,
3425
3425
  payload: p
3426
3426
  });
3427
3427
  };
3428
- window.addEventListener("error", d), o.push(() => {
3428
+ window.addEventListener("error", d), c.push(() => {
3429
3429
  window && window.removeEventListener("error", d);
3430
3430
  });
3431
3431
  }
3432
3432
  for (const d of n.level)
3433
- o.push(c(i, d));
3433
+ c.push(a(i, d));
3434
3434
  return () => {
3435
- o.forEach((d) => d());
3435
+ c.forEach((d) => d());
3436
3436
  };
3437
- function c(d, l) {
3437
+ function a(d, l) {
3438
3438
  return d[l] ? he(d, l, (u) => (...h) => {
3439
3439
  u.apply(this, h);
3440
3440
  try {
3441
- const f = Dt.parse(new Error()).map((y) => y.toString()).splice(1), p = h.map((y) => et(y, n.stringifyOptions));
3442
- a++, a < n.lengthThreshold ? e({
3441
+ const f = Bt.parse(new Error()).map((y) => y.toString()).splice(1), p = h.map((y) => et(y, n.stringifyOptions));
3442
+ o++, o < n.lengthThreshold ? e({
3443
3443
  level: l,
3444
3444
  trace: f,
3445
3445
  payload: p
3446
- }) : a === n.lengthThreshold && e({
3446
+ }) : o === n.lengthThreshold && e({
3447
3447
  level: "warn",
3448
3448
  trace: [],
3449
3449
  payload: [
@@ -3457,11 +3457,11 @@ function is(e, t, r) {
3457
3457
  };
3458
3458
  }
3459
3459
  }
3460
- const as = "rrweb/console@1", os = (e) => ({
3460
+ const as = "rrweb/console@1", cs = (e) => ({
3461
3461
  name: as,
3462
- observer: is,
3462
+ observer: os,
3463
3463
  options: e
3464
- }), cs = "application/json", ds = "flashlog", ls = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`, Te = () => typeof window < "u" && window.location ? window.location.href : "", Ut = (e) => new Date(typeof e == "number" ? e : Date.now()).toISOString(), tt = async (e) => {
3464
+ }), ds = "application/json", ls = "flashlog", us = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`, Te = () => typeof window < "u" && window.location ? window.location.href : "", Ut = (e) => new Date(typeof e == "number" ? e : Date.now()).toISOString(), tt = async (e) => {
3465
3465
  try {
3466
3466
  return await e.json();
3467
3467
  } catch {
@@ -3473,7 +3473,12 @@ class Wt extends Error {
3473
3473
  super(t), this.name = "ReplayQuotaError";
3474
3474
  }
3475
3475
  }
3476
- class us {
3476
+ class zt extends Error {
3477
+ constructor(t) {
3478
+ super(t), this.name = "ReplaySegmentTooLargeError";
3479
+ }
3480
+ }
3481
+ class ps {
3477
3482
  constructor() {
3478
3483
  this.config = null, this.currentBytes = 0, this.currentEvents = [], this.detachListeners = [], this.finalized = !1, this.flushInFlight = null, this.flushTimer = null, this.replaySessionId = null, this.segmentSequence = 0;
3479
3484
  }
@@ -3482,13 +3487,13 @@ class us {
3482
3487
  finalize: !0,
3483
3488
  keepalive: !1,
3484
3489
  reason: "reinit"
3485
- }), !(typeof window > "u" || typeof document > "u") && (this.config = t, this.currentBytes = 0, this.currentEvents = [], this.detachListeners = [], this.finalized = !1, this.flushInFlight = null, this.replaySessionId = null, this.segmentSequence = 0, this.stopRecording = Re({
3490
+ }), !(typeof window > "u" || typeof document > "u") && (this.config = t, this.currentBytes = 0, this.currentEvents = [], this.detachListeners = [], this.finalized = !1, this.flushInFlight = null, this.replaySessionId = null, this.segmentSequence = 0, this.stopRecording = Ee({
3486
3491
  emit: (r) => this.pushEvent(r),
3487
3492
  collectFonts: !0,
3488
3493
  inlineStylesheet: !0,
3489
3494
  maskAllInputs: t.maskAllInputs,
3490
3495
  userTriggeredOnInput: !0,
3491
- plugins: [os()]
3496
+ plugins: [cs()]
3492
3497
  }) || void 0, this.bindLifecycleListeners(), this.flushTimer = window.setInterval(() => {
3493
3498
  this.flush("interval");
3494
3499
  }, t.flushIntervalMs), this.addCustomEvent("session-start", {
@@ -3505,21 +3510,29 @@ class us {
3505
3510
  if (!this.config || this.finalized)
3506
3511
  return null;
3507
3512
  const n = this.takePendingSegment();
3508
- return n ? (this.flushInFlight = this.uploadSegment(
3513
+ if (!n)
3514
+ return null;
3515
+ let s = !1;
3516
+ return this.flushInFlight = this.uploadSegment(
3509
3517
  n,
3510
3518
  t,
3511
3519
  (r == null ? void 0 : r.keepalive) === !0
3512
- ).catch((s) => s instanceof Wt ? (this.currentBytes = 0, this.currentEvents = [], this.finalized = !0, this.stopCapture(), this.debug("Replay capture stopped by server quota", {
3513
- message: s.message,
3520
+ ).then((i) => (s = !0, i)).catch((i) => i instanceof Wt ? (this.currentBytes = 0, this.currentEvents = [], this.finalized = !0, this.stopCapture(), this.debug("Replay capture stopped by server quota", {
3521
+ message: i.message,
3514
3522
  reason: t,
3515
3523
  segmentId: n.segmentId
3524
+ }), null) : i instanceof zt ? (s = !0, this.debug("Replay event skipped because it exceeds the upload limit", {
3525
+ message: i.message,
3526
+ reason: t,
3527
+ segmentId: n.segmentId,
3528
+ sizeBytes: n.sizeBytes
3516
3529
  }), null) : (this.restorePendingSegment(n), this.debug("Replay upload failed", {
3517
- message: s instanceof Error ? s.message : String(s),
3530
+ message: i instanceof Error ? i.message : String(i),
3518
3531
  reason: t,
3519
3532
  segmentId: n.segmentId
3520
3533
  }), null)).finally(() => {
3521
- this.flushInFlight = null;
3522
- }), this.flushInFlight) : null;
3534
+ this.flushInFlight = null, s && this.currentEvents.length > 0 && this.flush("buffer-threshold");
3535
+ }), this.flushInFlight;
3523
3536
  }
3524
3537
  async finalize(t = "manual", r) {
3525
3538
  if (!this.config || this.finalized)
@@ -3530,12 +3543,21 @@ class us {
3530
3543
  session_id: this.config.sessionId,
3531
3544
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
3532
3545
  }), this.stopCapture();
3533
- const n = await this.flush(t, {
3534
- keepalive: (r == null ? void 0 : r.keepalive) === !0
3535
- });
3546
+ let n = null;
3547
+ for (; this.flushInFlight || this.currentEvents.length > 0; ) {
3548
+ const a = await this.flush(t, {
3549
+ keepalive: (r == null ? void 0 : r.keepalive) === !0
3550
+ });
3551
+ if (!a) {
3552
+ if (this.flushInFlight)
3553
+ continue;
3554
+ break;
3555
+ }
3556
+ n = a;
3557
+ }
3536
3558
  if (this.replaySessionId = (n == null ? void 0 : n.replay_session_id) || this.replaySessionId, this.finalized = !0, !this.replaySessionId)
3537
3559
  return this.config = null, null;
3538
- const s = this.config, i = `${s.apiUrl.replace(/\/+$/, "")}/v1/session-replays/public/finalize`, a = await fetch(i, {
3560
+ const s = this.config, i = `${s.apiUrl.replace(/\/+$/, "")}/v1/session-replays/public/finalize`, o = await fetch(i, {
3539
3561
  body: JSON.stringify({
3540
3562
  brand_id: s.brandId,
3541
3563
  device_id: s.deviceId,
@@ -3550,17 +3572,17 @@ class us {
3550
3572
  },
3551
3573
  keepalive: (r == null ? void 0 : r.keepalive) === !0,
3552
3574
  method: "POST"
3553
- }).catch((c) => (this.debug("Replay finalize failed", {
3554
- message: c instanceof Error ? c.message : String(c),
3575
+ }).catch((a) => (this.debug("Replay finalize failed", {
3576
+ message: a instanceof Error ? a.message : String(a),
3555
3577
  reason: t
3556
3578
  }), null));
3557
- if (this.config = null, !a)
3579
+ if (this.config = null, !o)
3558
3580
  return null;
3559
- const o = await tt(
3560
- a
3581
+ const c = await tt(
3582
+ o
3561
3583
  );
3562
- return a.ok ? (o == null ? void 0 : o.data) || null : (this.debug("Replay finalize returned non-200", {
3563
- message: (o == null ? void 0 : o.message) || `HTTP ${a.status}`,
3584
+ return o.ok ? (c == null ? void 0 : c.data) || null : (this.debug("Replay finalize returned non-200", {
3585
+ message: (c == null ? void 0 : c.message) || `HTTP ${o.status}`,
3564
3586
  reason: t
3565
3587
  }), null);
3566
3588
  }
@@ -3576,7 +3598,7 @@ class us {
3576
3598
  addCustomEvent(t, r) {
3577
3599
  if (!(!this.config || this.finalized))
3578
3600
  try {
3579
- ts(`${ds}:${t}`, r);
3601
+ rs(`${ls}:${t}`, r);
3580
3602
  } catch (n) {
3581
3603
  this.debug("Replay custom event skipped", {
3582
3604
  message: n instanceof Error ? n.message : String(n),
@@ -3605,17 +3627,21 @@ class us {
3605
3627
  (n = this.config) != null && n.debug && console.log("[FlashlogTracker][Replay]", t, r || {});
3606
3628
  }
3607
3629
  pushEvent(t) {
3608
- !this.config || this.finalized || (this.currentEvents.push(t), this.currentBytes += this.estimateEventSize(t), (this.currentBytes >= this.config.maxSegmentBytes || this.currentEvents.length >= this.config.maxSegmentEvents) && this.flush("buffer-threshold"));
3630
+ !this.config || this.finalized || (this.currentEvents.push(t), this.currentBytes += this.estimateEventSize(t), this.isBufferAtThreshold() && this.flush("buffer-threshold"));
3631
+ }
3632
+ isBufferAtThreshold() {
3633
+ return !!(this.config && (this.currentBytes >= this.config.maxSegmentBytes || this.currentEvents.length >= this.config.maxSegmentEvents));
3609
3634
  }
3610
3635
  estimateEventSize(t) {
3611
3636
  try {
3612
- return JSON.stringify(t).length;
3637
+ const r = JSON.stringify(t);
3638
+ return typeof TextEncoder > "u" ? r.length : new TextEncoder().encode(r).byteLength;
3613
3639
  } catch {
3614
3640
  return 0;
3615
3641
  }
3616
3642
  }
3617
3643
  nextSegmentId(t) {
3618
- return `segment-${String(t).padStart(6, "0")}-${ls()}`;
3644
+ return `segment-${String(t).padStart(6, "0")}-${us()}`;
3619
3645
  }
3620
3646
  restorePendingSegment(t) {
3621
3647
  this.currentEvents = [...t.events, ...this.currentEvents], this.currentBytes += t.sizeBytes, this.segmentSequence = Math.min(this.segmentSequence, t.sequenceNumber);
@@ -3625,30 +3651,39 @@ class us {
3625
3651
  (t = this.stopRecording) == null || t.call(this), this.stopRecording = void 0, this.flushTimer !== null && typeof window < "u" && (window.clearInterval(this.flushTimer), this.flushTimer = null), this.detachListeners.forEach((r) => r()), this.detachListeners = [];
3626
3652
  }
3627
3653
  takePendingSegment() {
3628
- var s, i;
3629
- if (this.currentEvents.length === 0)
3654
+ var i, o;
3655
+ if (!this.config || this.currentEvents.length === 0)
3630
3656
  return null;
3631
- const t = this.currentEvents, r = this.currentBytes, n = this.segmentSequence;
3632
- return this.currentEvents = [], this.currentBytes = 0, this.segmentSequence += 1, {
3633
- endedAt: Ut((s = t[t.length - 1]) == null ? void 0 : s.timestamp),
3634
- eventCount: t.length,
3635
- events: t,
3636
- segmentId: this.nextSegmentId(n),
3637
- sequenceNumber: n,
3657
+ let t = 0, r = 0;
3658
+ for (const c of this.currentEvents) {
3659
+ const a = this.estimateEventSize(c), d = t > 0 && r + a > this.config.maxSegmentBytes, l = t >= this.config.maxSegmentEvents;
3660
+ if (d || l)
3661
+ break;
3662
+ t += 1, r += a;
3663
+ }
3664
+ const n = this.currentEvents.splice(0, Math.max(t, 1));
3665
+ t === 0 && (r = this.estimateEventSize(n[0]));
3666
+ const s = this.segmentSequence;
3667
+ return this.currentBytes = Math.max(0, this.currentBytes - r), this.segmentSequence += 1, {
3668
+ endedAt: Ut((i = n[n.length - 1]) == null ? void 0 : i.timestamp),
3669
+ eventCount: n.length,
3670
+ events: n,
3671
+ segmentId: this.nextSegmentId(s),
3672
+ sequenceNumber: s,
3638
3673
  sizeBytes: r,
3639
- startedAt: Ut((i = t[0]) == null ? void 0 : i.timestamp)
3674
+ startedAt: Ut((o = n[0]) == null ? void 0 : o.timestamp)
3640
3675
  };
3641
3676
  }
3642
3677
  async uploadSegment(t, r, n) {
3643
- var h;
3678
+ var f;
3644
3679
  if (!this.config)
3645
3680
  throw new Error("Replay recorder is not configured");
3646
3681
  const s = this.config, i = `${s.apiUrl.replace(
3647
3682
  /\/+$/,
3648
3683
  ""
3649
- )}/v1/session-replays/public/segments/upload-url`, a = {
3684
+ )}/v1/session-replays/public/segments/upload-url`, o = {
3650
3685
  brand_id: s.brandId,
3651
- content_type: cs,
3686
+ content_type: ds,
3652
3687
  device_id: s.deviceId,
3653
3688
  ended_at: t.endedAt,
3654
3689
  event_count: t.eventCount,
@@ -3659,22 +3694,22 @@ class us {
3659
3694
  session_id: s.sessionId,
3660
3695
  started_at: t.startedAt,
3661
3696
  upload_reason: r
3662
- }, o = await fetch(i, {
3663
- body: JSON.stringify(a),
3697
+ }, c = await fetch(i, {
3698
+ body: JSON.stringify(o),
3664
3699
  headers: {
3665
3700
  "Content-Type": "application/json",
3666
3701
  "x-api-key": s.apiKey
3667
3702
  },
3668
3703
  keepalive: n,
3669
3704
  method: "POST"
3670
- }), c = await tt(o);
3671
- if (!o.ok || !((h = c == null ? void 0 : c.data) != null && h.upload_url)) {
3672
- const f = c == null ? void 0 : c.message, p = typeof f == "object" && f ? f.code : c == null ? void 0 : c.code, y = typeof f == "object" && f ? f.message : f;
3673
- throw o.status === 403 && typeof p == "string" && p.startsWith("REPLAY_") ? new Wt(y || "Replay capture quota exhausted") : new Error(
3674
- y || `Failed to create replay upload URL (${o.status})`
3705
+ }), a = await tt(c);
3706
+ if (!c.ok || !((f = a == null ? void 0 : a.data) != null && f.upload_url)) {
3707
+ const p = a == null ? void 0 : a.message, y = typeof p == "object" && p ? p.code : a == null ? void 0 : a.code, S = typeof p == "object" && p ? p.message : p;
3708
+ throw c.status === 403 && typeof y == "string" && y.startsWith("REPLAY_") ? new Wt(S || "Replay capture quota exhausted") : new Error(
3709
+ S || `Failed to create replay upload URL (${c.status})`
3675
3710
  );
3676
3711
  }
3677
- this.replaySessionId = c.data.replay_session_id || this.replaySessionId;
3712
+ this.replaySessionId = a.data.replay_session_id || this.replaySessionId;
3678
3713
  const d = JSON.stringify({
3679
3714
  events: t.events,
3680
3715
  meta: {
@@ -3692,27 +3727,32 @@ class us {
3692
3727
  source: "flashlog-tracker-sdk",
3693
3728
  type: "rrweb-event-segment",
3694
3729
  version: 1
3695
- }), l = await fetch(c.data.upload_url, {
3730
+ }), l = typeof TextEncoder > "u" ? d.length : new TextEncoder().encode(d).byteLength;
3731
+ if (l > a.data.max_bytes)
3732
+ throw new zt(
3733
+ `Replay segment is ${l} bytes; upload limit is ${a.data.max_bytes} bytes`
3734
+ );
3735
+ const u = await fetch(a.data.upload_url, {
3696
3736
  body: d,
3697
3737
  headers: {
3698
3738
  "Content-Type": "application/octet-stream"
3699
3739
  },
3700
3740
  keepalive: n,
3701
- method: c.data.method || "PUT"
3702
- }), u = await tt(l);
3703
- if (!l.ok || !(u != null && u.data))
3741
+ method: a.data.method || "PUT"
3742
+ }), h = await tt(u);
3743
+ if (!u.ok || !(h != null && h.data))
3704
3744
  throw new Error(
3705
- (u == null ? void 0 : u.message) || `Replay segment upload failed (${l.status})`
3745
+ (h == null ? void 0 : h.message) || `Replay segment upload failed (${u.status})`
3706
3746
  );
3707
3747
  return this.debug("Replay segment uploaded", {
3708
- objectKey: u.data.object_key,
3748
+ objectKey: h.data.object_key,
3709
3749
  reason: r,
3710
- segmentId: u.data.segment_id,
3711
- sequenceNumber: u.data.sequence_number
3712
- }), u.data;
3750
+ segmentId: h.data.segment_id,
3751
+ sequenceNumber: h.data.sequence_number
3752
+ }), h.data;
3713
3753
  }
3714
3754
  }
3715
- const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = () => {
3755
+ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Sr = () => {
3716
3756
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
3717
3757
  return crypto.randomUUID();
3718
3758
  const e = Date.now().toString(36), t = Math.random().toString(36).slice(2, 12);
@@ -3721,7 +3761,7 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3721
3761
  ht() && window.localStorage.setItem(e, t);
3722
3762
  }, Ae = (e) => {
3723
3763
  ht() && window.localStorage.removeItem(e);
3724
- }, ps = (e) => {
3764
+ }, hs = (e) => {
3725
3765
  const t = fe(e);
3726
3766
  if (!t) return null;
3727
3767
  try {
@@ -3729,32 +3769,32 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3729
3769
  } catch {
3730
3770
  return null;
3731
3771
  }
3732
- }, hs = (e, t) => {
3772
+ }, fs = (e, t) => {
3733
3773
  pe(e, JSON.stringify(t));
3734
- }, zt = () => {
3774
+ }, Gt = () => {
3735
3775
  const e = fe(M.deviceId);
3736
3776
  if (e) return e;
3737
- const t = Cr();
3777
+ const t = Sr();
3738
3778
  return pe(M.deviceId, t), t;
3739
- }, Gt = (e) => {
3779
+ }, Kt = (e) => {
3740
3780
  const t = Date.now(), r = fe(M.sessionId), n = fe(M.sessionSeenAt), s = n ? Number(n) : NaN, i = Number.isFinite(s) && t - s <= e;
3741
3781
  if (r && i)
3742
3782
  return pe(M.sessionSeenAt, String(t)), r;
3743
- const a = Cr();
3744
- return pe(M.sessionId, a), pe(M.sessionSeenAt, String(t)), a;
3745
- }, fs = () => {
3783
+ const o = Sr();
3784
+ return pe(M.sessionId, o), pe(M.sessionSeenAt, String(t)), o;
3785
+ }, ms = () => {
3746
3786
  pe(M.sessionSeenAt, String(Date.now()));
3747
- }, ms = () => fe(M.sessionId), gs = () => fe(M.deviceId), ys = (e, t) => {
3787
+ }, gs = () => fe(M.sessionId), ys = () => fe(M.deviceId), Is = (e, t) => {
3748
3788
  if (pe(M.accountId, e), t && Object.keys(t).length > 0) {
3749
- hs(M.accountTraits, t);
3789
+ fs(M.accountTraits, t);
3750
3790
  return;
3751
3791
  }
3752
3792
  Ae(M.accountTraits);
3753
- }, Is = () => fe(M.accountId), Cs = () => ps(M.accountTraits), Sr = () => {
3793
+ }, Cs = () => fe(M.accountId), Ss = () => hs(M.accountTraits), br = () => {
3754
3794
  Ae(M.accountId), Ae(M.accountTraits);
3755
- }, Ss = () => {
3756
- Ae(M.sessionId), Ae(M.sessionSeenAt), Ae(M.deviceId), Sr();
3757
- }, Kt = (e, t) => Array.from(/* @__PURE__ */ new Set([...e, ...t || []])), bs = (e) => {
3795
+ }, bs = () => {
3796
+ Ae(M.sessionId), Ae(M.sessionSeenAt), Ae(M.deviceId), br();
3797
+ }, Vt = (e, t) => Array.from(/* @__PURE__ */ new Set([...e, ...t || []])), vs = (e) => {
3758
3798
  var t, r;
3759
3799
  return {
3760
3800
  apiUrl: ((t = e == null ? void 0 : e.apiUrl) == null ? void 0 : t.trim()) || w.apiUrl,
@@ -3771,8 +3811,8 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3771
3811
  ignoredUrls: (e == null ? void 0 : e.ignoredUrls) || w.ignoredUrls,
3772
3812
  captureRequestBody: (e == null ? void 0 : e.captureRequestBody) ?? w.captureRequestBody,
3773
3813
  captureResponseBody: (e == null ? void 0 : e.captureResponseBody) ?? w.captureResponseBody,
3774
- redactKeys: Kt(w.redactKeys, e == null ? void 0 : e.redactKeys),
3775
- redactUrlParams: Kt(w.redactUrlParams, e == null ? void 0 : e.redactUrlParams),
3814
+ redactKeys: Vt(w.redactKeys, e == null ? void 0 : e.redactKeys),
3815
+ redactUrlParams: Vt(w.redactUrlParams, e == null ? void 0 : e.redactUrlParams),
3776
3816
  propagateTraceHeaders: (e == null ? void 0 : e.propagateTraceHeaders) ?? w.propagateTraceHeaders,
3777
3817
  traceOrigins: (e == null ? void 0 : e.traceOrigins) || w.traceOrigins,
3778
3818
  traceHeaderName: ((r = e == null ? void 0 : e.traceHeaderName) == null ? void 0 : r.trim()) || w.traceHeaderName,
@@ -3782,17 +3822,17 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3782
3822
  replayMaxSegmentEvents: (e == null ? void 0 : e.replayMaxSegmentEvents) ?? w.replayMaxSegmentEvents,
3783
3823
  replayMaskAllInputs: (e == null ? void 0 : e.replayMaskAllInputs) ?? w.replayMaskAllInputs
3784
3824
  };
3785
- }, B = () => typeof window < "u" && window.location ? window.location.href : "", le = () => typeof document < "u" && document.title || "", vs = /* @__PURE__ */ new Set(["beacon", "fetch", "xmlhttprequest"]), Ce = 1e3, We = () => typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), ws = (e) => {
3825
+ }, D = () => typeof window < "u" && window.location ? window.location.href : "", le = () => typeof document < "u" && document.title || "", ws = /* @__PURE__ */ new Set(["beacon", "fetch", "xmlhttprequest"]), Ce = 1e3, We = () => typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), As = (e) => {
3786
3826
  const t = String(e.initiatorType || "").toLowerCase(), r = String(e.name || "").toLowerCase();
3787
3827
  return t === "fetch" || t === "xmlhttprequest" || t === "beacon" ? "xhr" : t === "css" || t === "link" || r.endsWith(".css") || r.includes(".css?") ? "css" : t === "script" || r.endsWith(".js") || r.includes(".js?") ? "js" : t === "img" || t === "image" || /\.(png|jpg|jpeg|gif|svg|webp|avif|ico)(\?|$)/.test(r) ? "images" : t === "font" || /\.(woff|woff2|ttf|otf|eot)(\?|$)/.test(r) ? "fonts" : "other";
3788
- }, As = (e) => {
3828
+ }, ks = (e) => {
3789
3829
  if (!(e != null && e.name))
3790
3830
  return !1;
3791
3831
  if (e.entryType === "navigation")
3792
3832
  return !0;
3793
3833
  const t = String(e.initiatorType || "").toLowerCase();
3794
- return vs.has(t) ? !1 : !/^wss?:/i.test(e.name);
3795
- }, ks = (e) => {
3834
+ return ws.has(t) ? !1 : !/^wss?:/i.test(e.name);
3835
+ }, Es = (e) => {
3796
3836
  const t = Number(e.responseStatus);
3797
3837
  if (Number.isFinite(t) && t > 0)
3798
3838
  return t;
@@ -3800,7 +3840,7 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3800
3840
  return 200;
3801
3841
  const r = Number(e.transferSize || 0), n = Number(e.encodedBodySize || 0), s = Number(e.decodedBodySize || 0);
3802
3842
  return r > 0 || n > 0 || s > 0 ? 200 : null;
3803
- }, Rs = (e) => Math.round(We() + Math.max(0, Number(e.startTime || 0))), rt = (e) => Math.round(e / (1024 * 1024) * 10) / 10, Es = () => {
3843
+ }, Rs = (e) => Math.round(We() + Math.max(0, Number(e.startTime || 0))), rt = (e) => Math.round(e / (1024 * 1024) * 10) / 10, Ts = () => {
3804
3844
  if (typeof performance > "u")
3805
3845
  return null;
3806
3846
  const e = performance.memory;
@@ -3812,7 +3852,7 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3812
3852
  total_js_heap_mb: rt(r),
3813
3853
  used_js_heap_mb: rt(t)
3814
3854
  };
3815
- }, Ts = () => {
3855
+ }, _s = () => {
3816
3856
  if (typeof performance > "u")
3817
3857
  return null;
3818
3858
  const e = performance.getEntriesByType("navigation")[0], t = performance.getEntriesByName("first-contentful-paint")[0];
@@ -3821,65 +3861,65 @@ const ht = () => typeof window < "u" && typeof window.localStorage < "u", Cr = (
3821
3861
  const r = {};
3822
3862
  return e && (r.dom_content_loaded_ms = Math.round(e.domContentLoadedEventEnd || 0), r.load_event_ms = Math.round(e.loadEventEnd || 0), r.response_end_ms = Math.round(e.responseEnd || 0), r.dom_complete_ms = Math.round(e.domComplete || 0), r.transfer_size = Math.round(e.transferSize || 0)), t && (r.first_contentful_paint_ms = Math.round(t.startTime || 0)), Object.keys(r).length > 0 ? r : null;
3823
3863
  };
3824
- class _s {
3864
+ class Ns {
3825
3865
  constructor() {
3826
- this.config = w, this.brandId = null, this.sessionId = null, this.deviceId = null, this.accountId = null, this.accountTraits = null, this.errorCapture = null, this.initialized = !1, this.performanceObservers = [], this.performanceSampleTimer = null, this.pendingLongTaskMs = 0, this.resourceObserver = null, this.replayResourceKeys = /* @__PURE__ */ new Set(), this.nextPerformanceSampleAt = 0, this.actionBuffer = new Br(w.maxActionBufferSize), this.replayRecorder = new us();
3866
+ this.config = w, this.brandId = null, this.sessionId = null, this.deviceId = null, this.accountId = null, this.accountTraits = null, this.errorCapture = null, this.initialized = !1, this.performanceObservers = [], this.performanceSampleTimer = null, this.pendingLongTaskMs = 0, this.resourceObserver = null, this.replayResourceKeys = /* @__PURE__ */ new Set(), this.nextPerformanceSampleAt = 0, this.actionBuffer = new Ur(w.maxActionBufferSize), this.replayRecorder = new ps();
3827
3867
  }
3828
3868
  async init(t, r) {
3829
3869
  var i;
3830
3870
  const n = Number(t);
3831
3871
  if (!Number.isFinite(n) || n <= 0)
3832
3872
  throw new Error("[FlashlogTracker] Invalid brand id");
3833
- const s = bs(r);
3873
+ const s = vs(r);
3834
3874
  if (!s.apiKey || !s.apiKey.trim())
3835
3875
  throw new Error("[FlashlogTracker] Missing api key");
3836
3876
  this.config = {
3837
3877
  ...s,
3838
3878
  apiKey: s.apiKey.trim()
3839
- }, this.brandId = n, this.sessionId = Gt(this.config.sessionTimeoutMs), this.deviceId = zt(), this.accountId = Is(), this.accountTraits = Cs(), this.actionBuffer.stop(), this.actionBuffer.clear(), this.actionBuffer.start(), this.stopReplayResourceCapture(), await this.replayRecorder.dispose({
3879
+ }, this.brandId = n, this.sessionId = Kt(this.config.sessionTimeoutMs), this.deviceId = Gt(), this.accountId = Cs(), this.accountTraits = Ss(), this.actionBuffer.stop(), this.actionBuffer.clear(), this.actionBuffer.start(), this.stopReplayResourceCapture(), await this.replayRecorder.dispose({
3840
3880
  finalize: !0,
3841
3881
  keepalive: !1,
3842
3882
  reason: "reinit"
3843
- }), (i = this.errorCapture) == null || i.stop(), this.errorCapture = null, this.config.autoCapture && (this.errorCapture = new Vr(this.config, {
3883
+ }), (i = this.errorCapture) == null || i.stop(), this.errorCapture = null, this.config.autoCapture && (this.errorCapture = new Pr(this.config, {
3844
3884
  debug: this.config.debug,
3845
- onNetworkActivity: (a) => {
3885
+ onNetworkActivity: (o) => {
3846
3886
  this.replayRecorder.addCustomEvent("network-activity", {
3847
- ...a,
3887
+ ...o,
3848
3888
  page_title: le(),
3849
3889
  session_id: this.sessionId,
3850
- url_bug_happened: B()
3890
+ url_bug_happened: D()
3851
3891
  });
3852
3892
  },
3853
- onNetworkError: (a) => {
3893
+ onNetworkError: (o) => {
3854
3894
  this.trackInternal("NETWORK_ERROR", {
3855
- ...a,
3895
+ ...o,
3856
3896
  error_type: "network_error",
3857
- url_bug_happened: B(),
3858
- url: String(a.url || "")
3897
+ url_bug_happened: D(),
3898
+ url: String(o.url || "")
3859
3899
  });
3860
3900
  },
3861
- onSocketError: (a) => {
3901
+ onSocketError: (o) => {
3862
3902
  this.trackInternal("SOCKET_ERROR", {
3863
- ...a,
3903
+ ...o,
3864
3904
  error_type: "socket_error",
3865
- url_bug_happened: B(),
3866
- url: String(a.url || "")
3905
+ url_bug_happened: D(),
3906
+ url: String(o.url || "")
3867
3907
  });
3868
3908
  },
3869
- onJsError: (a) => {
3909
+ onJsError: (o) => {
3870
3910
  this.trackInternal("JS_ERROR", {
3871
- ...a,
3911
+ ...o,
3872
3912
  error_type: "js_error",
3873
- url_bug_happened: B(),
3874
- url: B()
3913
+ url_bug_happened: D(),
3914
+ url: D()
3875
3915
  });
3876
3916
  },
3877
- onUnhandledRejection: (a) => {
3917
+ onUnhandledRejection: (o) => {
3878
3918
  this.trackInternal("UNHANDLED_REJECTION", {
3879
- ...a,
3919
+ ...o,
3880
3920
  error_type: "unhandled_rejection",
3881
- url_bug_happened: B(),
3882
- url: B()
3921
+ url_bug_happened: D(),
3922
+ url: D()
3883
3923
  });
3884
3924
  }
3885
3925
  }), this.errorCapture.start()), this.config.enableSessionReplay && (await this.replayRecorder.start({
@@ -3893,7 +3933,7 @@ class _s {
3893
3933
  maxSegmentBytes: this.config.replayMaxSegmentBytes,
3894
3934
  maxSegmentEvents: this.config.replayMaxSegmentEvents,
3895
3935
  sessionId: this.sessionId
3896
- }), this.recordReplaySessionContext("init"), this.startReplayResourceCapture(), this.startReplayPerformanceCapture()), this.initialized = !0, Vt({
3936
+ }), this.recordReplaySessionContext("init"), this.startReplayResourceCapture(), this.startReplayPerformanceCapture()), this.initialized = !0, Pt({
3897
3937
  apiKey: this.config.apiKey,
3898
3938
  apiUrl: this.config.apiUrl,
3899
3939
  brandId: this.brandId,
@@ -3914,8 +3954,8 @@ class _s {
3914
3954
  stack: s,
3915
3955
  context: r,
3916
3956
  error_type: "manual_error",
3917
- url_bug_happened: B(),
3918
- url: B(),
3957
+ url_bug_happened: D(),
3958
+ url: D(),
3919
3959
  timestamp: Date.now()
3920
3960
  });
3921
3961
  }
@@ -3925,26 +3965,26 @@ class _s {
3925
3965
  details: r || null,
3926
3966
  session_id: this.sessionId,
3927
3967
  timestamp: Date.now(),
3928
- url: B()
3968
+ url: D()
3929
3969
  });
3930
3970
  }
3931
3971
  identify(t, r = {}) {
3932
3972
  const n = String(t || "").trim();
3933
3973
  if (!n)
3934
3974
  throw new Error("[FlashlogTracker] identify requires a non-empty account id");
3935
- this.accountId = n, this.accountTraits = Object.keys(r).length > 0 ? r : null, ys(n, this.accountTraits || void 0), this.recordReplaySessionContext("identify");
3975
+ this.accountId = n, this.accountTraits = Object.keys(r).length > 0 ? r : null, Is(n, this.accountTraits || void 0), this.recordReplaySessionContext("identify");
3936
3976
  }
3937
3977
  clearIdentity() {
3938
- this.accountId = null, this.accountTraits = null, Sr(), this.recordReplaySessionContext("clear-identity");
3978
+ this.accountId = null, this.accountTraits = null, br(), this.recordReplaySessionContext("clear-identity");
3939
3979
  }
3940
3980
  getTraceHeaders() {
3941
3981
  return it(Ve(), this.config.traceHeaderName);
3942
3982
  }
3943
3983
  getSessionId() {
3944
- return this.sessionId || ms();
3984
+ return this.sessionId || gs();
3945
3985
  }
3946
3986
  getDeviceId() {
3947
- return this.deviceId || gs();
3987
+ return this.deviceId || ys();
3948
3988
  }
3949
3989
  async flushReplay(t = "manual") {
3950
3990
  return this.replayRecorder.flush(t);
@@ -3958,7 +3998,7 @@ class _s {
3958
3998
  finalize: !0,
3959
3999
  keepalive: !1,
3960
4000
  reason: "reset"
3961
- }), Ss(), this.initialized = !1, this.brandId = null, this.sessionId = null, this.deviceId = null;
4001
+ }), bs(), this.initialized = !1, this.brandId = null, this.sessionId = null, this.deviceId = null;
3962
4002
  }
3963
4003
  buildPayload(t, r, n) {
3964
4004
  if (!this.brandId || !this.sessionId || !this.deviceId) return null;
@@ -3966,7 +4006,7 @@ class _s {
3966
4006
  actions: this.actionBuffer.getAll(),
3967
4007
  device_info: It(this.deviceId),
3968
4008
  network_status: Ct(),
3969
- url_bug_happened: r.url_bug_happened || B(),
4009
+ url_bug_happened: r.url_bug_happened || D(),
3970
4010
  trace_id: n.trace_id,
3971
4011
  span_id: n.span_id,
3972
4012
  traceparent: n.traceparent,
@@ -3984,19 +4024,19 @@ class _s {
3984
4024
  async trackInternal(t, r) {
3985
4025
  if (!this.initialized)
3986
4026
  return this.config.debug && console.warn("[FlashlogTracker] Not initialized"), !1;
3987
- fs(), this.sessionId || (this.sessionId = Gt(this.config.sessionTimeoutMs)), this.deviceId || (this.deviceId = zt());
3988
- const n = Gr(r), s = this.buildPayload(t, r, n);
4027
+ ms(), this.sessionId || (this.sessionId = Kt(this.config.sessionTimeoutMs)), this.deviceId || (this.deviceId = Gt());
4028
+ const n = Kr(r), s = this.buildPayload(t, r, n);
3989
4029
  if (!s) return !1;
3990
- const i = Mr(s, this.config), a = typeof i.data.status == "number" ? i.data.status : typeof i.data.http_status == "number" ? i.data.http_status : null, o = typeof i.data.method == "string" ? i.data.method.toUpperCase() : typeof i.data.http_method == "string" ? i.data.http_method.toUpperCase() : null, c = typeof i.data.request_url == "string" ? i.data.request_url : typeof i.data.url == "string" ? i.data.url : null;
4030
+ const i = Or(s, this.config), o = typeof i.data.status == "number" ? i.data.status : typeof i.data.http_status == "number" ? i.data.http_status : null, c = typeof i.data.method == "string" ? i.data.method.toUpperCase() : typeof i.data.http_method == "string" ? i.data.http_method.toUpperCase() : null, a = typeof i.data.request_url == "string" ? i.data.request_url : typeof i.data.url == "string" ? i.data.url : null;
3991
4031
  this.replayRecorder.addCustomEvent("tracking-event", {
3992
4032
  ...i.data,
3993
4033
  event_name: t,
3994
4034
  error_type: typeof i.data.error_type == "string" ? i.data.error_type : null,
3995
- http_method: o,
3996
- http_status: a,
3997
- method: o,
4035
+ http_method: c,
4036
+ http_status: o,
4037
+ method: c,
3998
4038
  page_title: le(),
3999
- request_url: c,
4039
+ request_url: a,
4000
4040
  session_id: s.session_id,
4001
4041
  timestamp: typeof i.data.timestamp == "number" ? i.data.timestamp : Date.now()
4002
4042
  });
@@ -4024,8 +4064,8 @@ class _s {
4024
4064
  device_info: It(this.deviceId),
4025
4065
  network_status: Ct(),
4026
4066
  page_title: le(),
4027
- page_url: B(),
4028
- performance: Ts(),
4067
+ page_url: D(),
4068
+ performance: _s(),
4029
4069
  reason: t,
4030
4070
  session_id: this.sessionId,
4031
4071
  timestamp: Date.now()
@@ -4075,17 +4115,17 @@ class _s {
4075
4115
  Math.round(
4076
4116
  Math.min(Ce, s) / Ce * 100 + Math.min(Ce, this.pendingLongTaskMs) / Ce * 100
4077
4117
  )
4078
- ), a = Es();
4118
+ ), o = Ts();
4079
4119
  this.pendingLongTaskMs = 0, this.replayRecorder.addCustomEvent("performance-sample", {
4080
4120
  cpu_usage_pct: i,
4081
- js_heap_limit_mb: (a == null ? void 0 : a.js_heap_limit_mb) ?? null,
4082
- memory_mb: (a == null ? void 0 : a.used_js_heap_mb) ?? null,
4121
+ js_heap_limit_mb: (o == null ? void 0 : o.js_heap_limit_mb) ?? null,
4122
+ memory_mb: (o == null ? void 0 : o.used_js_heap_mb) ?? null,
4083
4123
  page_title: le(),
4084
- page_url: B(),
4124
+ page_url: D(),
4085
4125
  reason: t,
4086
4126
  session_id: this.sessionId,
4087
4127
  timestamp: Math.round(We() + r),
4088
- total_memory_mb: (a == null ? void 0 : a.total_js_heap_mb) ?? null
4128
+ total_memory_mb: (o == null ? void 0 : o.total_js_heap_mb) ?? null
4089
4129
  });
4090
4130
  }
4091
4131
  observeReplayLongTasks() {
@@ -4098,7 +4138,7 @@ class _s {
4098
4138
  duration_ms: s,
4099
4139
  name: n.name || "longtask",
4100
4140
  page_title: le(),
4101
- page_url: B(),
4141
+ page_url: D(),
4102
4142
  session_id: this.sessionId,
4103
4143
  start_time_ms: Math.round(Number(n.startTime || 0)),
4104
4144
  timestamp: Math.round(We() + Number(n.startTime || performance.now()))
@@ -4117,7 +4157,7 @@ class _s {
4117
4157
  const s = Number(n.value || 0);
4118
4158
  !Number.isFinite(s) || s <= 0 || n.hadRecentInput || this.replayRecorder.addCustomEvent("layout-shift", {
4119
4159
  page_title: le(),
4120
- page_url: B(),
4160
+ page_url: D(),
4121
4161
  session_id: this.sessionId,
4122
4162
  timestamp: Math.round(We() + Number(n.startTime || performance.now())),
4123
4163
  value: Math.round(s * 1e4) / 1e4
@@ -4130,7 +4170,7 @@ class _s {
4130
4170
  }
4131
4171
  captureReplayResourceEntries(t, r) {
4132
4172
  this.sessionId && t.forEach((n) => {
4133
- if (!As(n))
4173
+ if (!ks(n))
4134
4174
  return;
4135
4175
  const s = [
4136
4176
  n.entryType,
@@ -4147,12 +4187,12 @@ class _s {
4147
4187
  initiator_type: String(n.initiatorType || ""),
4148
4188
  method: "GET",
4149
4189
  page_title: le(),
4150
- page_url: B(),
4190
+ page_url: D(),
4151
4191
  request_url: n.name,
4152
- resource_type: ws(n),
4192
+ resource_type: As(n),
4153
4193
  response_end_ms: Math.round(Number(n.responseEnd || 0)),
4154
4194
  session_id: this.sessionId,
4155
- status: ks(n),
4195
+ status: Es(n),
4156
4196
  timestamp: Rs(n),
4157
4197
  transfer_size: Math.round(Number(n.transferSize || 0)),
4158
4198
  url: n.name
@@ -4160,7 +4200,7 @@ class _s {
4160
4200
  });
4161
4201
  }
4162
4202
  }
4163
- const Ns = () => new _s(), Je = Ns(), Ls = Je, re = (e, t) => e === void 0 ? t : e === "true", _e = (e, t) => {
4203
+ const Ms = () => new Ns(), Je = Ms(), Fs = Je, re = (e, t) => e === void 0 ? t : e === "true", _e = (e, t) => {
4164
4204
  if (!e) return t;
4165
4205
  const r = Number(e);
4166
4206
  return Number.isFinite(r) ? r : t;
@@ -4168,7 +4208,7 @@ const Ns = () => new _s(), Je = Ns(), Ls = Je, re = (e, t) => e === void 0 ? t :
4168
4208
  if (!e) return;
4169
4209
  const t = e.split(",").map((r) => r.trim()).filter(Boolean);
4170
4210
  return t.length > 0 ? t : void 0;
4171
- }, Ms = () => {
4211
+ }, Os = () => {
4172
4212
  if (typeof document > "u") return null;
4173
4213
  if (document.currentScript instanceof HTMLScriptElement) return document.currentScript;
4174
4214
  const e = document.getElementsByTagName("script");
@@ -4178,9 +4218,9 @@ const Ns = () => new _s(), Je = Ns(), Ls = Je, re = (e, t) => e === void 0 ? t :
4178
4218
  return r;
4179
4219
  }
4180
4220
  return null;
4181
- }, Os = async () => {
4221
+ }, Ls = async () => {
4182
4222
  if (typeof window > "u" || typeof document > "u") return;
4183
- const e = Ms();
4223
+ const e = Os();
4184
4224
  if (!e || e.dataset.autoInit !== "true") return;
4185
4225
  const t = e.dataset.productId || e.dataset.brandId, r = e.dataset.apiKey, n = re(e.dataset.debug, !1);
4186
4226
  if (t) {
@@ -4224,7 +4264,7 @@ const Ns = () => new _s(), Je = Ns(), Ls = Je, re = (e, t) => e === void 0 ? t :
4224
4264
  e.dataset.replayMaskAllInputs,
4225
4265
  w.replayMaskAllInputs
4226
4266
  )
4227
- }), Vt({
4267
+ }), Pt({
4228
4268
  apiUrl: e.dataset.apiUrl,
4229
4269
  apiKey: r,
4230
4270
  brandId: t,
@@ -4237,11 +4277,11 @@ const Ns = () => new _s(), Je = Ns(), Ls = Je, re = (e, t) => e === void 0 ? t :
4237
4277
  }
4238
4278
  }
4239
4279
  };
4240
- typeof window < "u" && (window.FlashlogBugTracker = Je, window.Tracker || (window.Tracker = Je), Os());
4280
+ typeof window < "u" && (window.FlashlogBugTracker = Je, window.Tracker || (window.Tracker = Je), Ls());
4241
4281
  export {
4242
4282
  w as DEFAULT_CONFIG,
4243
- _s as FlashlogTrackerLite,
4244
- Ns as createTracker,
4283
+ Ns as FlashlogTrackerLite,
4284
+ Ms as createTracker,
4245
4285
  Je as default,
4246
- Ls as flashlogTracker
4286
+ Fs as flashlogTracker
4247
4287
  };