@appsurify-testmap/rrweb 2.0.0-alpha.23 → 2.0.0-alpha.24

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.
@@ -51,6 +51,46 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
51
51
  var __defProp$1 = Object.defineProperty;
52
52
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
53
53
  var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
54
+ var InteractiveEvent = /* @__PURE__ */ ((InteractiveEvent2) => {
55
+ InteractiveEvent2[InteractiveEvent2["Change"] = 0] = "Change";
56
+ InteractiveEvent2[InteractiveEvent2["Submit"] = 1] = "Submit";
57
+ InteractiveEvent2[InteractiveEvent2["DragStart"] = 2] = "DragStart";
58
+ InteractiveEvent2[InteractiveEvent2["Drop"] = 3] = "Drop";
59
+ InteractiveEvent2[InteractiveEvent2["PointerDown"] = 4] = "PointerDown";
60
+ InteractiveEvent2[InteractiveEvent2["PointerUp"] = 5] = "PointerUp";
61
+ InteractiveEvent2[InteractiveEvent2["Input"] = 6] = "Input";
62
+ InteractiveEvent2[InteractiveEvent2["KeyDown"] = 7] = "KeyDown";
63
+ InteractiveEvent2[InteractiveEvent2["KeyUp"] = 8] = "KeyUp";
64
+ InteractiveEvent2[InteractiveEvent2["KeyPress"] = 9] = "KeyPress";
65
+ InteractiveEvent2[InteractiveEvent2["MouseEnter"] = 10] = "MouseEnter";
66
+ InteractiveEvent2[InteractiveEvent2["MouseLeave"] = 11] = "MouseLeave";
67
+ InteractiveEvent2[InteractiveEvent2["MouseUp"] = 12] = "MouseUp";
68
+ InteractiveEvent2[InteractiveEvent2["MouseDown"] = 13] = "MouseDown";
69
+ InteractiveEvent2[InteractiveEvent2["Click"] = 14] = "Click";
70
+ InteractiveEvent2[InteractiveEvent2["ContextMenu"] = 15] = "ContextMenu";
71
+ InteractiveEvent2[InteractiveEvent2["DblClick"] = 16] = "DblClick";
72
+ InteractiveEvent2[InteractiveEvent2["Focus"] = 17] = "Focus";
73
+ InteractiveEvent2[InteractiveEvent2["Blur"] = 18] = "Blur";
74
+ InteractiveEvent2[InteractiveEvent2["TouchStart"] = 19] = "TouchStart";
75
+ InteractiveEvent2[InteractiveEvent2["TouchMove"] = 20] = "TouchMove";
76
+ InteractiveEvent2[InteractiveEvent2["TouchEnd"] = 21] = "TouchEnd";
77
+ InteractiveEvent2[InteractiveEvent2["TouchCancel"] = 22] = "TouchCancel";
78
+ return InteractiveEvent2;
79
+ })(InteractiveEvent || {});
80
+ var interactiveTag = /* @__PURE__ */ ((interactiveTag2) => {
81
+ interactiveTag2[interactiveTag2["Input"] = 0] = "Input";
82
+ interactiveTag2[interactiveTag2["Button"] = 1] = "Button";
83
+ interactiveTag2[interactiveTag2["A"] = 2] = "A";
84
+ interactiveTag2[interactiveTag2["Select"] = 3] = "Select";
85
+ interactiveTag2[interactiveTag2["Textarea"] = 4] = "Textarea";
86
+ interactiveTag2[interactiveTag2["Label"] = 5] = "Label";
87
+ interactiveTag2[interactiveTag2["Details"] = 6] = "Details";
88
+ interactiveTag2[interactiveTag2["Summary"] = 7] = "Summary";
89
+ interactiveTag2[interactiveTag2["Dialog"] = 8] = "Dialog";
90
+ interactiveTag2[interactiveTag2["Video"] = 9] = "Video";
91
+ interactiveTag2[interactiveTag2["Audio"] = 10] = "Audio";
92
+ return interactiveTag2;
93
+ })(interactiveTag || {});
54
94
  var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
55
95
  NodeType2[NodeType2["Document"] = 0] = "Document";
56
96
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
@@ -202,99 +242,6 @@ const index$1 = {
202
242
  querySelectorAll: querySelectorAll$1,
203
243
  mutationObserver: mutationObserverCtor$1
204
244
  };
205
- function getXPath(node2) {
206
- if (node2.nodeType === Node.DOCUMENT_NODE) {
207
- return "/";
208
- }
209
- if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
210
- return "/html/doctype";
211
- }
212
- if (node2.nodeType === Node.ELEMENT_NODE) {
213
- const element = node2;
214
- if (element.id) {
215
- return `//*[@id="${element.id}"]`;
216
- }
217
- if (element.tagName && element.tagName.toLowerCase() === "html") {
218
- return "/html";
219
- }
220
- if (element === document.head) {
221
- return "/html/head";
222
- }
223
- if (element === document.body) {
224
- return "/html/body";
225
- }
226
- const parentNode2 = element.parentNode;
227
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
228
- return "";
229
- }
230
- const siblings = Array.from(parentNode2.children).filter(
231
- (sibling) => sibling.tagName === element.tagName
232
- );
233
- const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
234
- return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
235
- }
236
- if (node2.nodeType === Node.TEXT_NODE) {
237
- const parent = node2.parentNode;
238
- if (!parent) {
239
- return "";
240
- }
241
- const textSiblings = Array.from(parent.childNodes).filter(
242
- (sibling) => sibling.nodeType === Node.TEXT_NODE
243
- );
244
- const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
245
- return `${getXPath(parent)}/text()${index2}`;
246
- }
247
- if (node2.nodeType === Node.CDATA_SECTION_NODE) {
248
- const parent = node2.parentNode;
249
- if (!parent) {
250
- return "";
251
- }
252
- const cdataSiblings = Array.from(parent.childNodes).filter(
253
- (sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
254
- );
255
- const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
256
- return `${getXPath(parent)}/text()${index2}`;
257
- }
258
- if (node2.nodeType === Node.COMMENT_NODE) {
259
- const parent = node2.parentNode;
260
- if (!parent) {
261
- return "";
262
- }
263
- const commentSiblings = Array.from(parent.childNodes).filter(
264
- (sibling) => sibling.nodeType === Node.COMMENT_NODE
265
- );
266
- const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
267
- return `${getXPath(parent)}/comment()${index2}`;
268
- }
269
- return "";
270
- }
271
- function isElement(n2) {
272
- return n2.nodeType === n2.ELEMENT_NODE;
273
- }
274
- function isTextVisible(n2) {
275
- var _a2;
276
- const parent = index$1.parentNode(n2);
277
- const parentElement2 = parent && parent;
278
- if (!parentElement2) {
279
- return false;
280
- }
281
- const isParentVisible = isElementVisible(parentElement2);
282
- if (!isParentVisible) {
283
- return false;
284
- }
285
- const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
286
- return textContent2 !== "";
287
- }
288
- function isElementVisible(n2) {
289
- return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
290
- }
291
- function isStyleVisible(n2) {
292
- const style = window.getComputedStyle(n2);
293
- return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
294
- }
295
- function isRectVisible(rect) {
296
- return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
297
- }
298
245
  function isShadowRoot(n2) {
299
246
  const hostEl = (
300
247
  // anchor and textarea elements also have a `host` property
@@ -643,6 +590,140 @@ function splitCssText(cssText, style) {
643
590
  function markCssSplits(cssText, style) {
644
591
  return splitCssText(cssText, style).join("/* rr_split */");
645
592
  }
593
+ function getXPath(node2) {
594
+ if (node2.nodeType === Node.DOCUMENT_NODE) {
595
+ return "/";
596
+ }
597
+ if (node2.nodeType === Node.DOCUMENT_TYPE_NODE) {
598
+ return "/html/doctype";
599
+ }
600
+ if (node2.nodeType === Node.ELEMENT_NODE) {
601
+ const element = node2;
602
+ if (element.id) {
603
+ return `//*[@id="${element.id}"]`;
604
+ }
605
+ if (element.tagName && element.tagName.toLowerCase() === "html") {
606
+ return "/html";
607
+ }
608
+ if (element === document.head) {
609
+ return "/html/head";
610
+ }
611
+ if (element === document.body) {
612
+ return "/html/body";
613
+ }
614
+ const parentNode2 = element.parentNode;
615
+ if (!parentNode2 || !(parentNode2 instanceof Element)) {
616
+ return "";
617
+ }
618
+ const siblings = Array.from(parentNode2.children).filter(
619
+ (sibling) => sibling.tagName === element.tagName
620
+ );
621
+ const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
622
+ return `${getXPath(parentNode2)}/${element.tagName.toLowerCase()}${index2}`;
623
+ }
624
+ if (node2.nodeType === Node.TEXT_NODE) {
625
+ const parent = node2.parentNode;
626
+ if (!parent) {
627
+ return "";
628
+ }
629
+ const textSiblings = Array.from(parent.childNodes).filter(
630
+ (sibling) => sibling.nodeType === Node.TEXT_NODE
631
+ );
632
+ const index2 = textSiblings.length > 1 ? `[${textSiblings.indexOf(node2) + 1}]` : "";
633
+ return `${getXPath(parent)}/text()${index2}`;
634
+ }
635
+ if (node2.nodeType === Node.CDATA_SECTION_NODE) {
636
+ const parent = node2.parentNode;
637
+ if (!parent) {
638
+ return "";
639
+ }
640
+ const cdataSiblings = Array.from(parent.childNodes).filter(
641
+ (sibling) => sibling.nodeType === Node.CDATA_SECTION_NODE
642
+ );
643
+ const index2 = cdataSiblings.length > 1 ? `[${cdataSiblings.indexOf(node2) + 1}]` : "";
644
+ return `${getXPath(parent)}/text()${index2}`;
645
+ }
646
+ if (node2.nodeType === Node.COMMENT_NODE) {
647
+ const parent = node2.parentNode;
648
+ if (!parent) {
649
+ return "";
650
+ }
651
+ const commentSiblings = Array.from(parent.childNodes).filter(
652
+ (sibling) => sibling.nodeType === Node.COMMENT_NODE
653
+ );
654
+ const index2 = commentSiblings.length > 1 ? `[${commentSiblings.indexOf(node2) + 1}]` : "";
655
+ return `${getXPath(parent)}/comment()${index2}`;
656
+ }
657
+ return "";
658
+ }
659
+ function isElement(n2) {
660
+ return n2.nodeType === n2.ELEMENT_NODE;
661
+ }
662
+ function isTextVisible(n2) {
663
+ var _a2;
664
+ const parent = index$1.parentNode(n2);
665
+ const parentElement2 = parent && parent;
666
+ if (!parentElement2) {
667
+ return false;
668
+ }
669
+ const isParentVisible = isElementVisible(parentElement2);
670
+ if (!isParentVisible) {
671
+ return false;
672
+ }
673
+ const textContent2 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim();
674
+ return textContent2 !== "";
675
+ }
676
+ function isElementVisible(n2) {
677
+ return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
678
+ }
679
+ function isStyleVisible(n2) {
680
+ const style = window.getComputedStyle(n2);
681
+ return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
682
+ }
683
+ function isRectVisible(rect) {
684
+ return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
685
+ }
686
+ function getInteractiveEvents() {
687
+ return Object.keys(InteractiveEvent).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
688
+ }
689
+ function getInteractiveTags() {
690
+ return Object.keys(interactiveTag).filter((key) => isNaN(Number(key))).map((key) => key.toLowerCase().replace(/_/g, "-"));
691
+ }
692
+ function hasEventListeners(n2) {
693
+ return getInteractiveEvents().some((eventType) => {
694
+ let hasListener = false;
695
+ const testListener = () => {
696
+ hasListener = true;
697
+ };
698
+ n2.addEventListener(eventType, testListener);
699
+ n2.dispatchEvent(new Event(eventType));
700
+ n2.removeEventListener(eventType, testListener);
701
+ return hasListener;
702
+ });
703
+ }
704
+ function isElementInteractive(n2) {
705
+ var _a2;
706
+ const allowedTags = getInteractiveTags();
707
+ if (n2.nodeType === Node.ELEMENT_NODE) {
708
+ const element = n2;
709
+ const tagName = element.tagName.toLowerCase();
710
+ if (!allowedTags.includes(tagName)) {
711
+ return false;
712
+ }
713
+ const hasTabIndex = element.hasAttribute("tabindex") && element.getAttribute("tabindex") !== "-1";
714
+ const hasRoleInteractive = ["button", "link", "checkbox", "switch", "menuitem"].includes(
715
+ element.getAttribute("role") || ""
716
+ );
717
+ const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
718
+ return result2;
719
+ }
720
+ if (n2.nodeType === Node.TEXT_NODE) {
721
+ const textNode = n2;
722
+ const parentElement2 = textNode.parentElement;
723
+ return parentElement2 !== null && allowedTags.includes(parentElement2.tagName.toLowerCase()) && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
724
+ }
725
+ return false;
726
+ }
646
727
  let _id = 1;
647
728
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
648
729
  const IGNORED_NODE = -2;
@@ -998,11 +1079,13 @@ function serializeTextNode(n2, options) {
998
1079
  textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
999
1080
  }
1000
1081
  const isVisible = isTextVisible(n2);
1082
+ const isInteractive = isElementInteractive(n2);
1001
1083
  return {
1002
1084
  type: NodeType$3.Text,
1003
1085
  textContent: textContent2 || "",
1004
1086
  rootId,
1005
1087
  isVisible,
1088
+ isInteractive,
1006
1089
  xPath
1007
1090
  };
1008
1091
  }
@@ -1188,6 +1271,7 @@ function serializeElementNode(n2, options) {
1188
1271
  } catch (e2) {
1189
1272
  }
1190
1273
  const isVisible = isElementVisible(n2);
1274
+ const isInteractive = isElementInteractive(n2);
1191
1275
  return {
1192
1276
  type: NodeType$3.Element,
1193
1277
  tagName,
@@ -1198,6 +1282,7 @@ function serializeElementNode(n2, options) {
1198
1282
  rootId,
1199
1283
  isCustom: isCustomElement,
1200
1284
  isVisible,
1285
+ isInteractive,
1201
1286
  xPath
1202
1287
  };
1203
1288
  }
@@ -10980,20 +11065,20 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
10980
11065
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
10981
11066
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
10982
11067
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
11068
+ IncrementalSource2[IncrementalSource2["VisibilityChange"] = 17] = "VisibilityChange";
10983
11069
  return IncrementalSource2;
10984
11070
  })(IncrementalSource || {});
10985
11071
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
10986
11072
  MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
10987
11073
  MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
10988
11074
  MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
10989
- MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
10990
- MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
10991
- MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
10992
- MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
10993
- MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
10994
- MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
10995
- MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
10996
- MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
11075
+ MouseInteractions2[MouseInteractions2["DblClick"] = 3] = "DblClick";
11076
+ MouseInteractions2[MouseInteractions2["Focus"] = 4] = "Focus";
11077
+ MouseInteractions2[MouseInteractions2["Blur"] = 5] = "Blur";
11078
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 6] = "TouchStart";
11079
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 7] = "TouchMove_Departed";
11080
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 8] = "TouchEnd";
11081
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 9] = "TouchCancel";
10997
11082
  return MouseInteractions2;
10998
11083
  })(MouseInteractions || {});
10999
11084
  var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
@@ -11693,6 +11778,54 @@ function initMutationObserver(options, rootEl) {
11693
11778
  });
11694
11779
  return observer;
11695
11780
  }
11781
+ function initVisibilityObserver({
11782
+ visibilityChangeCb,
11783
+ doc,
11784
+ mirror: mirror2
11785
+ }) {
11786
+ if (!visibilityChangeCb) {
11787
+ return () => {
11788
+ };
11789
+ }
11790
+ const observedElements = /* @__PURE__ */ new WeakMap();
11791
+ const observer = new IntersectionObserver(
11792
+ (entries) => {
11793
+ entries.forEach((entry) => {
11794
+ const target = entry.target;
11795
+ const id = mirror2.getId(target);
11796
+ const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
11797
+ if (id !== -1) {
11798
+ if (observedElements.has(target)) {
11799
+ visibilityChangeCb({
11800
+ id,
11801
+ isVisible,
11802
+ visibilityRatio: entry.intersectionRatio,
11803
+ boundingRect: entry.boundingClientRect
11804
+ });
11805
+ } else {
11806
+ observedElements.set(target, true);
11807
+ }
11808
+ }
11809
+ });
11810
+ },
11811
+ { root: null, threshold: [0.1, 0.9] }
11812
+ );
11813
+ doc.querySelectorAll("*").forEach((el) => observer.observe(el));
11814
+ const mutationObserver = new MutationObserver((mutations) => {
11815
+ mutations.forEach((mutation) => {
11816
+ mutation.addedNodes.forEach((node2) => {
11817
+ if (node2 instanceof Element) {
11818
+ observer.observe(node2);
11819
+ }
11820
+ });
11821
+ });
11822
+ });
11823
+ mutationObserver.observe(doc, { childList: true, subtree: true });
11824
+ return () => {
11825
+ observer.disconnect();
11826
+ mutationObserver.disconnect();
11827
+ };
11828
+ }
11696
11829
  function initMoveObserver({
11697
11830
  mousemoveCb,
11698
11831
  sampling,
@@ -12506,6 +12639,7 @@ function initCustomElementObserver({
12506
12639
  function mergeHooks(o2, hooks) {
12507
12640
  const {
12508
12641
  mutationCb,
12642
+ visibilityChangeCb,
12509
12643
  mousemoveCb,
12510
12644
  mouseInteractionCb,
12511
12645
  scrollCb,
@@ -12525,6 +12659,12 @@ function mergeHooks(o2, hooks) {
12525
12659
  }
12526
12660
  mutationCb(...p);
12527
12661
  };
12662
+ o2.visibilityChangeCb = (...p) => {
12663
+ if (hooks.visibilityChange) {
12664
+ hooks.visibilityChange(...p);
12665
+ }
12666
+ visibilityChangeCb(...p);
12667
+ };
12528
12668
  o2.mousemoveCb = (...p) => {
12529
12669
  if (hooks.mousemove) {
12530
12670
  hooks.mousemove(...p);
@@ -12599,6 +12739,7 @@ function mergeHooks(o2, hooks) {
12599
12739
  };
12600
12740
  }
12601
12741
  function initObservers(o2, hooks = {}) {
12742
+ console.info("initObservers", o2);
12602
12743
  const currentWindow = o2.doc.defaultView;
12603
12744
  if (!currentWindow) {
12604
12745
  return () => {
@@ -12617,6 +12758,7 @@ function initObservers(o2, hooks = {}) {
12617
12758
  });
12618
12759
  const inputHandler = initInputObserver(o2);
12619
12760
  const mediaInteractionHandler = initMediaInteractionObserver(o2);
12761
+ const visibleHandler = initVisibilityObserver(o2);
12620
12762
  let styleSheetObserver = () => {
12621
12763
  };
12622
12764
  let adoptedStyleSheetObserver = () => {
@@ -12646,6 +12788,7 @@ function initObservers(o2, hooks = {}) {
12646
12788
  return callbackWrapper(() => {
12647
12789
  mutationBuffers.forEach((b) => b.reset());
12648
12790
  mutationObserver == null ? void 0 : mutationObserver.disconnect();
12791
+ visibleHandler();
12649
12792
  mousemoveHandler();
12650
12793
  mouseInteractionHandler();
12651
12794
  scrollHandler();
@@ -13730,6 +13873,7 @@ function record(options = {}) {
13730
13873
  emit,
13731
13874
  checkoutEveryNms,
13732
13875
  checkoutEveryNth,
13876
+ checkoutEveryEvc,
13733
13877
  blockClass = "rr-block",
13734
13878
  blockSelector = null,
13735
13879
  ignoreClass = "rr-ignore",
@@ -14016,6 +14160,11 @@ function record(options = {}) {
14016
14160
  mirror.getId(document)
14017
14161
  );
14018
14162
  };
14163
+ const debouncedFullSnapshot = throttle(() => {
14164
+ if (checkoutEveryEvc) {
14165
+ takeFullSnapshot$1(true);
14166
+ }
14167
+ }, 100, { leading: false, trailing: true });
14019
14168
  try {
14020
14169
  const handlers = [];
14021
14170
  const observe = (doc) => {
@@ -14023,6 +14172,17 @@ function record(options = {}) {
14023
14172
  return callbackWrapper(initObservers)(
14024
14173
  {
14025
14174
  mutationCb: wrappedMutationEmit,
14175
+ visibilityChangeCb: (v2) => {
14176
+ debouncedFullSnapshot();
14177
+ if (sampling.visibility) {
14178
+ return wrappedEmit({
14179
+ type: EventType.IncrementalSnapshot,
14180
+ data: __spreadValues({
14181
+ source: IncrementalSource.VisibilityChange
14182
+ }, v2)
14183
+ });
14184
+ }
14185
+ },
14026
14186
  mousemoveCb: (positions, source) => wrappedEmit({
14027
14187
  type: EventType.IncrementalSnapshot,
14028
14188
  data: {