@appsurify-testmap/rrweb-all 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.
@@ -820,10 +820,13 @@ function inspectInlineEventHandlers$1() {
820
820
  });
821
821
  });
822
822
  }
823
- if (document.readyState === "complete" || document.readyState === "interactive") {
824
- inspectInlineEventHandlers$1();
825
- } else {
826
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
823
+ try {
824
+ if (document.readyState === "complete" || document.readyState === "interactive") {
825
+ inspectInlineEventHandlers$1();
826
+ } else {
827
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
828
+ }
829
+ } catch (error) {
827
830
  }
828
831
  let _id = 1;
829
832
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -5887,10 +5890,13 @@ function inspectInlineEventHandlers() {
5887
5890
  });
5888
5891
  });
5889
5892
  }
5890
- if (document.readyState === "complete" || document.readyState === "interactive") {
5891
- inspectInlineEventHandlers();
5892
- } else {
5893
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5893
+ try {
5894
+ if (document.readyState === "complete" || document.readyState === "interactive") {
5895
+ inspectInlineEventHandlers();
5896
+ } else {
5897
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5898
+ }
5899
+ } catch (error) {
5894
5900
  }
5895
5901
  function getDefaultExportFromCjs(x2) {
5896
5902
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -14345,6 +14351,7 @@ class VisibilityManager {
14345
14351
  __publicField(this, "mirror");
14346
14352
  __publicField(this, "mutationCb");
14347
14353
  __publicField(this, "rafId", null);
14354
+ __publicField(this, "intervalId", null);
14348
14355
  __publicField(this, "rafThrottle");
14349
14356
  __publicField(this, "lastFlushTime", 0);
14350
14357
  __publicField(this, "elements", /* @__PURE__ */ new Set());
@@ -14377,7 +14384,7 @@ class VisibilityManager {
14377
14384
  this.throttle = Number((visibilitySampling == null ? void 0 : visibilitySampling.throttle) ?? 100);
14378
14385
  this.threshold = Number((visibilitySampling == null ? void 0 : visibilitySampling.threshold) ?? 0.5);
14379
14386
  this.sensitivity = Number((visibilitySampling == null ? void 0 : visibilitySampling.sensitivity) ?? 0.05);
14380
- this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 100);
14387
+ this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 50);
14381
14388
  doc.querySelectorAll("*").forEach((el) => this.observe(el));
14382
14389
  const mo = new MutationObserver((mutations) => {
14383
14390
  mutations.forEach((m) => {
@@ -14399,14 +14406,25 @@ class VisibilityManager {
14399
14406
  }
14400
14407
  startPendingFlushLoop() {
14401
14408
  if (this.disabled) return;
14402
- const loop = (timestamp) => {
14403
- if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14404
- this.lastFlushTime = timestamp;
14405
- this.flushPendingVisibilityMutations();
14406
- }
14409
+ if (typeof requestAnimationFrame === "function") {
14410
+ const loop = (timestamp) => {
14411
+ if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14412
+ this.lastFlushTime = timestamp;
14413
+ this.flushPendingVisibilityMutations();
14414
+ }
14415
+ this.rafId = requestAnimationFrame(loop);
14416
+ };
14407
14417
  this.rafId = requestAnimationFrame(loop);
14408
- };
14409
- this.rafId = requestAnimationFrame(loop);
14418
+ } else {
14419
+ const loop = () => {
14420
+ const now = performance.now();
14421
+ if (now - this.lastFlushTime >= this.rafThrottle) {
14422
+ this.lastFlushTime = now;
14423
+ this.flushPendingVisibilityMutations();
14424
+ }
14425
+ };
14426
+ this.intervalId = setInterval(loop, this.rafThrottle);
14427
+ }
14410
14428
  }
14411
14429
  flushPendingVisibilityMutations() {
14412
14430
  if (this.disabled) return;
@@ -14476,6 +14494,7 @@ class VisibilityManager {
14476
14494
  }
14477
14495
  unfreeze() {
14478
14496
  this.frozen = false;
14497
+ this.flushPendingVisibilityMutations();
14479
14498
  }
14480
14499
  lock() {
14481
14500
  this.locked = true;
@@ -14487,10 +14506,17 @@ class VisibilityManager {
14487
14506
  this.elements.clear();
14488
14507
  this.previousState.clear();
14489
14508
  this.pending.clear();
14490
- if (this.rafId) cancelAnimationFrame(this.rafId);
14509
+ if (this.rafId) {
14510
+ cancelAnimationFrame(this.rafId);
14511
+ this.rafId = null;
14512
+ }
14513
+ if (this.intervalId) {
14514
+ clearInterval(this.intervalId);
14515
+ this.intervalId = null;
14516
+ }
14491
14517
  }
14492
14518
  }
14493
- const version$1 = "2.1.2-alpha.1";
14519
+ const version$1 = "2.1.2-alpha.5";
14494
14520
  let wrappedEmit;
14495
14521
  let takeFullSnapshot$1;
14496
14522
  let canvasManager;
@@ -17981,7 +18007,7 @@ class Replayer {
17981
18007
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
17982
18008
  }
17983
18009
  }
17984
- const version = "2.1.2-alpha.1";
18010
+ const version = "2.1.2-alpha.5";
17985
18011
  const { getVersion } = record;
17986
18012
  const { isRecording } = record;
17987
18013
  const { flushCustomEventQueue } = record;