@appsurify-testmap/rrweb-record 2.1.2-alpha.1 → 2.1.2-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -808,10 +808,13 @@ function inspectInlineEventHandlers$1() {
808
808
  });
809
809
  });
810
810
  }
811
- if (document.readyState === "complete" || document.readyState === "interactive") {
812
- inspectInlineEventHandlers$1();
813
- } else {
814
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
811
+ try {
812
+ if (document.readyState === "complete" || document.readyState === "interactive") {
813
+ inspectInlineEventHandlers$1();
814
+ } else {
815
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
816
+ }
817
+ } catch (error) {
815
818
  }
816
819
  let _id = 1;
817
820
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -5363,10 +5366,13 @@ function inspectInlineEventHandlers() {
5363
5366
  });
5364
5367
  });
5365
5368
  }
5366
- if (document.readyState === "complete" || document.readyState === "interactive") {
5367
- inspectInlineEventHandlers();
5368
- } else {
5369
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5369
+ try {
5370
+ if (document.readyState === "complete" || document.readyState === "interactive") {
5371
+ inspectInlineEventHandlers();
5372
+ } else {
5373
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5374
+ }
5375
+ } catch (error) {
5370
5376
  }
5371
5377
  function getDefaultExportFromCjs(x2) {
5372
5378
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -12438,6 +12444,7 @@ class VisibilityManager {
12438
12444
  __publicField(this, "mirror");
12439
12445
  __publicField(this, "mutationCb");
12440
12446
  __publicField(this, "rafId", null);
12447
+ __publicField(this, "intervalId", null);
12441
12448
  __publicField(this, "rafThrottle");
12442
12449
  __publicField(this, "lastFlushTime", 0);
12443
12450
  __publicField(this, "elements", /* @__PURE__ */ new Set());
@@ -12470,7 +12477,7 @@ class VisibilityManager {
12470
12477
  this.throttle = Number((visibilitySampling == null ? void 0 : visibilitySampling.throttle) ?? 100);
12471
12478
  this.threshold = Number((visibilitySampling == null ? void 0 : visibilitySampling.threshold) ?? 0.5);
12472
12479
  this.sensitivity = Number((visibilitySampling == null ? void 0 : visibilitySampling.sensitivity) ?? 0.05);
12473
- this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 100);
12480
+ this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 50);
12474
12481
  doc.querySelectorAll("*").forEach((el) => this.observe(el));
12475
12482
  const mo = new MutationObserver((mutations) => {
12476
12483
  mutations.forEach((m) => {
@@ -12492,14 +12499,25 @@ class VisibilityManager {
12492
12499
  }
12493
12500
  startPendingFlushLoop() {
12494
12501
  if (this.disabled) return;
12495
- const loop = (timestamp) => {
12496
- if (timestamp - this.lastFlushTime >= this.rafThrottle) {
12497
- this.lastFlushTime = timestamp;
12498
- this.flushPendingVisibilityMutations();
12499
- }
12502
+ if (typeof requestAnimationFrame === "function") {
12503
+ const loop = (timestamp) => {
12504
+ if (timestamp - this.lastFlushTime >= this.rafThrottle) {
12505
+ this.lastFlushTime = timestamp;
12506
+ this.flushPendingVisibilityMutations();
12507
+ }
12508
+ this.rafId = requestAnimationFrame(loop);
12509
+ };
12500
12510
  this.rafId = requestAnimationFrame(loop);
12501
- };
12502
- this.rafId = requestAnimationFrame(loop);
12511
+ } else {
12512
+ const loop = () => {
12513
+ const now = performance.now();
12514
+ if (now - this.lastFlushTime >= this.rafThrottle) {
12515
+ this.lastFlushTime = now;
12516
+ this.flushPendingVisibilityMutations();
12517
+ }
12518
+ };
12519
+ this.intervalId = setInterval(loop, this.rafThrottle);
12520
+ }
12503
12521
  }
12504
12522
  flushPendingVisibilityMutations() {
12505
12523
  if (this.disabled) return;
@@ -12569,6 +12587,7 @@ class VisibilityManager {
12569
12587
  }
12570
12588
  unfreeze() {
12571
12589
  this.frozen = false;
12590
+ this.flushPendingVisibilityMutations();
12572
12591
  }
12573
12592
  lock() {
12574
12593
  this.locked = true;
@@ -12580,10 +12599,17 @@ class VisibilityManager {
12580
12599
  this.elements.clear();
12581
12600
  this.previousState.clear();
12582
12601
  this.pending.clear();
12583
- if (this.rafId) cancelAnimationFrame(this.rafId);
12602
+ if (this.rafId) {
12603
+ cancelAnimationFrame(this.rafId);
12604
+ this.rafId = null;
12605
+ }
12606
+ if (this.intervalId) {
12607
+ clearInterval(this.intervalId);
12608
+ this.intervalId = null;
12609
+ }
12584
12610
  }
12585
12611
  }
12586
- const version$1 = "2.1.2-alpha.1";
12612
+ const version$1 = "2.1.2-alpha.5";
12587
12613
  let wrappedEmit;
12588
12614
  let takeFullSnapshot$1;
12589
12615
  let canvasManager;