@appsurify-testmap/rrweb-record 2.0.0-alpha.41 → 2.1.0-alpha.2

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.
@@ -142,6 +142,32 @@ function querySelectorAll$1(n2, selectors) {
142
142
  function mutationObserverCtor$1() {
143
143
  return getUntaintedPrototype$1("MutationObserver").constructor;
144
144
  }
145
+ function patch$1(source, name, replacement) {
146
+ try {
147
+ if (!(name in source)) {
148
+ return () => {
149
+ };
150
+ }
151
+ const original = source[name];
152
+ const wrapped = replacement(original);
153
+ if (typeof wrapped === "function") {
154
+ wrapped.prototype = wrapped.prototype || {};
155
+ Object.defineProperties(wrapped, {
156
+ __rrweb_original__: {
157
+ enumerable: false,
158
+ value: original
159
+ }
160
+ });
161
+ }
162
+ source[name] = wrapped;
163
+ return () => {
164
+ source[name] = original;
165
+ };
166
+ } catch {
167
+ return () => {
168
+ };
169
+ }
170
+ }
145
171
  const index$1 = {
146
172
  childNodes: childNodes$1,
147
173
  parentNode: parentNode$1,
@@ -154,8 +180,12 @@ const index$1 = {
154
180
  shadowRoot: shadowRoot$1,
155
181
  querySelector: querySelector$1,
156
182
  querySelectorAll: querySelectorAll$1,
157
- mutationObserver: mutationObserverCtor$1
183
+ mutationObserver: mutationObserverCtor$1,
184
+ patch: patch$1
158
185
  };
186
+ function isElement(n2) {
187
+ return n2.nodeType === n2.ELEMENT_NODE;
188
+ }
159
189
  function isShadowRoot(n2) {
160
190
  const hostEl = (
161
191
  // anchor and textarea elements also have a `host` property
@@ -420,19 +450,27 @@ function absolutifyURLs(cssText, href) {
420
450
  }
421
451
  );
422
452
  }
423
- function normalizeCssString(cssText) {
424
- return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
453
+ function normalizeCssString(cssText, _testNoPxNorm = false) {
454
+ if (_testNoPxNorm) {
455
+ return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
456
+ } else {
457
+ return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
458
+ }
425
459
  }
426
- function splitCssText(cssText, style) {
460
+ function splitCssText(cssText, style, _testNoPxNorm = false) {
427
461
  const childNodes2 = Array.from(style.childNodes);
428
462
  const splits = [];
429
- let iterLimit = 0;
463
+ let iterCount = 0;
430
464
  if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
431
- let cssTextNorm = normalizeCssString(cssText);
465
+ let cssTextNorm = normalizeCssString(cssText, _testNoPxNorm);
432
466
  const normFactor = cssTextNorm.length / cssText.length;
433
467
  for (let i2 = 1; i2 < childNodes2.length; i2++) {
434
468
  if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
435
- const textContentNorm = normalizeCssString(childNodes2[i2].textContent);
469
+ const textContentNorm = normalizeCssString(
470
+ childNodes2[i2].textContent,
471
+ _testNoPxNorm
472
+ );
473
+ const jLimit = 100;
436
474
  let j = 3;
437
475
  for (; j < textContentNorm.length; j++) {
438
476
  if (
@@ -445,23 +483,49 @@ function splitCssText(cssText, style) {
445
483
  break;
446
484
  }
447
485
  for (; j < textContentNorm.length; j++) {
448
- const bit = textContentNorm.substring(0, j);
449
- const bits = cssTextNorm.split(bit);
486
+ let startSubstring = textContentNorm.substring(0, j);
487
+ let cssNormSplits = cssTextNorm.split(startSubstring);
450
488
  let splitNorm = -1;
451
- if (bits.length === 2) {
452
- splitNorm = cssTextNorm.indexOf(bit);
453
- } else if (bits.length > 2 && bits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
454
- splitNorm = cssTextNorm.indexOf(bit, 1);
489
+ if (cssNormSplits.length === 2) {
490
+ splitNorm = cssNormSplits[0].length;
491
+ } else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
492
+ splitNorm = cssTextNorm.indexOf(startSubstring, 1);
493
+ } else if (cssNormSplits.length === 1) {
494
+ startSubstring = startSubstring.substring(
495
+ 0,
496
+ startSubstring.length - 1
497
+ );
498
+ cssNormSplits = cssTextNorm.split(startSubstring);
499
+ if (cssNormSplits.length <= 1) {
500
+ splits.push(cssText);
501
+ return splits;
502
+ }
503
+ j = jLimit + 1;
504
+ } else if (j === textContentNorm.length - 1) {
505
+ splitNorm = cssTextNorm.indexOf(startSubstring);
506
+ }
507
+ if (cssNormSplits.length >= 2 && j > jLimit) {
508
+ const prevTextContent = childNodes2[i2 - 1].textContent;
509
+ if (prevTextContent && typeof prevTextContent === "string") {
510
+ const prevMinLength = normalizeCssString(prevTextContent).length;
511
+ splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);
512
+ }
513
+ if (splitNorm === -1) {
514
+ splitNorm = cssNormSplits[0].length;
515
+ }
455
516
  }
456
517
  if (splitNorm !== -1) {
457
518
  let k = Math.floor(splitNorm / normFactor);
458
519
  for (; k > 0 && k < cssText.length; ) {
459
- iterLimit += 1;
460
- if (iterLimit > 50 * childNodes2.length) {
520
+ iterCount += 1;
521
+ if (iterCount > 50 * childNodes2.length) {
461
522
  splits.push(cssText);
462
523
  return splits;
463
524
  }
464
- const normPart = normalizeCssString(cssText.substring(0, k));
525
+ const normPart = normalizeCssString(
526
+ cssText.substring(0, k),
527
+ _testNoPxNorm
528
+ );
465
529
  if (normPart.length === splitNorm) {
466
530
  splits.push(cssText.substring(0, k));
467
531
  cssText = cssText.substring(k);
@@ -557,9 +621,6 @@ function getXPath(node2) {
557
621
  }
558
622
  return "";
559
623
  }
560
- function isElement(n2) {
561
- return n2.nodeType === n2.ELEMENT_NODE;
562
- }
563
624
  function isTextVisible(n2) {
564
625
  var _a2;
565
626
  const parent = index$1.parentNode(n2);
@@ -580,10 +641,10 @@ function isElementVisible(n2) {
580
641
  const style = win ? win.getComputedStyle(n2) : null;
581
642
  const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
582
643
  const rect = n2.getBoundingClientRect();
583
- const result2 = isStyleVisible && isRectVisible(rect, win);
644
+ const result2 = isStyleVisible && isRectVisible(rect);
584
645
  return result2;
585
646
  }
586
- function isRectVisible(rect, win) {
647
+ function isRectVisible(rect, win = window) {
587
648
  var _a2, _b, _c, _d;
588
649
  const height = (win == null ? void 0 : win.innerHeight) ?? ((_b = (_a2 = win == null ? void 0 : win.document) == null ? void 0 : _a2.documentElement) == null ? void 0 : _b.clientHeight) ?? 0;
589
650
  const width = (win == null ? void 0 : win.innerWidth) ?? ((_d = (_c = win == null ? void 0 : win.document) == null ? void 0 : _c.documentElement) == null ? void 0 : _d.clientWidth) ?? 0;
@@ -627,7 +688,7 @@ const interactiveTags = [
627
688
  "video",
628
689
  "audio"
629
690
  ];
630
- const inlineEventAttributes = [
691
+ const inlineEventAttributes$1 = [
631
692
  "onclick",
632
693
  "ondblclick",
633
694
  "onmousedown",
@@ -652,27 +713,20 @@ const inlineEventAttributes = [
652
713
  "ontouchcancel"
653
714
  ];
654
715
  const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
655
- if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
656
- const originalAddEventListener = EventTarget.prototype.addEventListener;
657
- EventTarget.prototype.addEventListener = function(type, listener, options) {
658
- originalAddEventListener.call(this, type, listener, options);
659
- if (this instanceof Element) {
660
- const eventType = type.toLowerCase();
661
- if (interactiveEvents$1.includes(eventType)) {
662
- interactiveElementsRegistry$1.add(this);
663
- }
664
- }
665
- };
666
- }
667
- if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
668
- const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
669
- EventTarget.prototype.removeEventListener = function(type, listener, options) {
670
- originalRemoveEventListener.call(this, type, listener, options);
671
- if (this instanceof Element) {
672
- type.toLowerCase();
716
+ const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
717
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
718
+ originalAddEventListener$1.call(this, type, listener, options);
719
+ if (this instanceof Element) {
720
+ const eventType = type.toLowerCase();
721
+ if (interactiveEvents$1.includes(eventType)) {
722
+ interactiveElementsRegistry$1.add(this);
673
723
  }
674
- };
675
- }
724
+ }
725
+ };
726
+ const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
727
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
728
+ originalRemoveEventListener$1.call(this, type, listener, options);
729
+ };
676
730
  function hasEventListeners(n2) {
677
731
  return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
678
732
  }
@@ -692,33 +746,20 @@ function isElementInteractive(n2) {
692
746
  }
693
747
  return false;
694
748
  }
695
- function inspectInlineEventHandlers(doc) {
696
- if (!doc || typeof doc.querySelectorAll !== "function") return;
697
- const allElements = doc.querySelectorAll("*");
749
+ function inspectInlineEventHandlers$1() {
750
+ const allElements = document.querySelectorAll("*");
698
751
  allElements.forEach((el) => {
699
- inlineEventAttributes.forEach((attr) => {
752
+ inlineEventAttributes$1.forEach((attr) => {
700
753
  if (el.hasAttribute(attr)) {
701
754
  interactiveElementsRegistry$1.add(el);
702
755
  }
703
756
  });
704
757
  });
705
758
  }
706
- function scheduleInlineEventInspection(doc) {
707
- if (!doc || typeof doc.addEventListener !== "function" || typeof doc.querySelectorAll !== "function") {
708
- return;
709
- }
710
- try {
711
- if (doc.readyState === "complete" || doc.readyState === "interactive") {
712
- inspectInlineEventHandlers(doc);
713
- } else {
714
- doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
715
- once: true,
716
- capture: false
717
- });
718
- }
719
- } catch (e2) {
720
- console.warn("[inlineEventInspection] Failed to inspect document:", e2);
721
- }
759
+ if (document.readyState === "complete" || document.readyState === "interactive") {
760
+ inspectInlineEventHandlers$1();
761
+ } else {
762
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
722
763
  }
723
764
  let _id = 1;
724
765
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -1012,6 +1053,7 @@ function serializeNode(n2, options) {
1012
1053
  childNodes: [],
1013
1054
  xPath,
1014
1055
  compatMode: n2.compatMode
1056
+ // probably "BackCompat"
1015
1057
  };
1016
1058
  } else {
1017
1059
  return {
@@ -1306,7 +1348,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
1306
1348
  } else if (sn.type === NodeType$3.Element) {
1307
1349
  if (slimDOMOptions.script && // script tag
1308
1350
  (sn.tagName === "script" || // (module)preload link
1309
- sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
1351
+ sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") || // prefetch link
1310
1352
  sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
1311
1353
  return true;
1312
1354
  } else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
@@ -1568,7 +1610,7 @@ function snapshot(n2, options) {
1568
1610
  blockSelector = null,
1569
1611
  maskTextClass = "rr-mask",
1570
1612
  maskTextSelector = null,
1571
- ignoreAttribute = "rr-ignore-attr",
1613
+ ignoreAttribute = "rr-ignore",
1572
1614
  inlineStylesheet = true,
1573
1615
  inlineImages = false,
1574
1616
  recordCanvas = false,
@@ -1585,7 +1627,6 @@ function snapshot(n2, options) {
1585
1627
  stylesheetLoadTimeout,
1586
1628
  keepIframeSrcFn = () => false
1587
1629
  } = options || {};
1588
- scheduleInlineEventInspection(n2);
1589
1630
  const maskInputOptions = maskAllInputs === true ? {
1590
1631
  color: true,
1591
1632
  date: true,
@@ -5226,27 +5267,59 @@ const interactiveEvents = [
5226
5267
  "touchend",
5227
5268
  "touchcancel"
5228
5269
  ];
5270
+ const inlineEventAttributes = [
5271
+ "onclick",
5272
+ "ondblclick",
5273
+ "onmousedown",
5274
+ "onmouseup",
5275
+ "onmouseover",
5276
+ "onmouseout",
5277
+ "onmousemove",
5278
+ "onfocus",
5279
+ "onblur",
5280
+ "onkeydown",
5281
+ "onkeypress",
5282
+ "onkeyup",
5283
+ "onchange",
5284
+ "oninput",
5285
+ "onsubmit",
5286
+ "onreset",
5287
+ "onselect",
5288
+ "oncontextmenu",
5289
+ "ontouchstart",
5290
+ "ontouchmove",
5291
+ "ontouchend",
5292
+ "ontouchcancel"
5293
+ ];
5229
5294
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
5230
- if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
5231
- const originalAddEventListener = EventTarget.prototype.addEventListener;
5232
- EventTarget.prototype.addEventListener = function(type, listener, options) {
5233
- originalAddEventListener.call(this, type, listener, options);
5234
- if (this instanceof Element) {
5235
- const eventType = type.toLowerCase();
5236
- if (interactiveEvents.includes(eventType)) {
5237
- interactiveElementsRegistry.add(this);
5238
- }
5295
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
5296
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
5297
+ originalAddEventListener.call(this, type, listener, options);
5298
+ if (this instanceof Element) {
5299
+ const eventType = type.toLowerCase();
5300
+ if (interactiveEvents.includes(eventType)) {
5301
+ interactiveElementsRegistry.add(this);
5239
5302
  }
5240
- };
5303
+ }
5304
+ };
5305
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
5306
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
5307
+ originalRemoveEventListener.call(this, type, listener, options);
5308
+ };
5309
+ function inspectInlineEventHandlers() {
5310
+ const allElements = document.querySelectorAll("*");
5311
+ allElements.forEach((el) => {
5312
+ inlineEventAttributes.forEach((attr) => {
5313
+ if (el.hasAttribute(attr)) {
5314
+ interactiveElementsRegistry.add(el);
5315
+ }
5316
+ });
5317
+ });
5241
5318
  }
5242
- if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
5243
- const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
5244
- EventTarget.prototype.removeEventListener = function(type, listener, options) {
5245
- originalRemoveEventListener.call(this, type, listener, options);
5246
- if (this instanceof Element) {
5247
- type.toLowerCase();
5248
- }
5249
- };
5319
+ if (document.readyState === "complete" || document.readyState === "interactive") {
5320
+ inspectInlineEventHandlers();
5321
+ } else {
5322
+ document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5250
5323
  }
5251
5324
  function getDefaultExportFromCjs(x2) {
5252
5325
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -8982,6 +9055,32 @@ function querySelectorAll(n2, selectors) {
8982
9055
  function mutationObserverCtor() {
8983
9056
  return getUntaintedPrototype("MutationObserver").constructor;
8984
9057
  }
9058
+ function patch(source, name, replacement) {
9059
+ try {
9060
+ if (!(name in source)) {
9061
+ return () => {
9062
+ };
9063
+ }
9064
+ const original = source[name];
9065
+ const wrapped = replacement(original);
9066
+ if (typeof wrapped === "function") {
9067
+ wrapped.prototype = wrapped.prototype || {};
9068
+ Object.defineProperties(wrapped, {
9069
+ __rrweb_original__: {
9070
+ enumerable: false,
9071
+ value: original
9072
+ }
9073
+ });
9074
+ }
9075
+ source[name] = wrapped;
9076
+ return () => {
9077
+ source[name] = original;
9078
+ };
9079
+ } catch {
9080
+ return () => {
9081
+ };
9082
+ }
9083
+ }
8985
9084
  const index = {
8986
9085
  childNodes,
8987
9086
  parentNode,
@@ -8994,7 +9093,8 @@ const index = {
8994
9093
  shadowRoot,
8995
9094
  querySelector,
8996
9095
  querySelectorAll,
8997
- mutationObserver: mutationObserverCtor
9096
+ mutationObserver: mutationObserverCtor,
9097
+ patch
8998
9098
  };
8999
9099
  function on(type, fn, target = document) {
9000
9100
  const options = { capture: true, passive: true };
@@ -9077,32 +9177,6 @@ function hookSetter(target, key, d, isRevoked, win = window) {
9077
9177
  );
9078
9178
  return () => hookSetter(target, key, original || {}, true);
9079
9179
  }
9080
- function patch(source, name, replacement) {
9081
- try {
9082
- if (!(name in source)) {
9083
- return () => {
9084
- };
9085
- }
9086
- const original = source[name];
9087
- const wrapped = replacement(original);
9088
- if (typeof wrapped === "function") {
9089
- wrapped.prototype = wrapped.prototype || {};
9090
- Object.defineProperties(wrapped, {
9091
- __rrweb_original__: {
9092
- enumerable: false,
9093
- value: original
9094
- }
9095
- });
9096
- }
9097
- source[name] = wrapped;
9098
- return () => {
9099
- source[name] = original;
9100
- };
9101
- } catch {
9102
- return () => {
9103
- };
9104
- }
9105
- }
9106
9180
  let nowTimestamp = Date.now;
9107
9181
  if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
9108
9182
  nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
@@ -9302,13 +9376,14 @@ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
9302
9376
  MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
9303
9377
  MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
9304
9378
  MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
9305
- MouseInteractions2[MouseInteractions2["DblClick"] = 3] = "DblClick";
9306
- MouseInteractions2[MouseInteractions2["Focus"] = 4] = "Focus";
9307
- MouseInteractions2[MouseInteractions2["Blur"] = 5] = "Blur";
9308
- MouseInteractions2[MouseInteractions2["TouchStart"] = 6] = "TouchStart";
9309
- MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 7] = "TouchMove_Departed";
9310
- MouseInteractions2[MouseInteractions2["TouchEnd"] = 8] = "TouchEnd";
9311
- MouseInteractions2[MouseInteractions2["TouchCancel"] = 9] = "TouchCancel";
9379
+ MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
9380
+ MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
9381
+ MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
9382
+ MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
9383
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
9384
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
9385
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
9386
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
9312
9387
  return MouseInteractions2;
9313
9388
  })(MouseInteractions || {});
9314
9389
  var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
@@ -9668,10 +9743,18 @@ class MutationBuffer {
9668
9743
  this.attributes.push(item);
9669
9744
  this.attributeMap.set(textarea, item);
9670
9745
  }
9671
- item.attributes.value = Array.from(
9746
+ const value = Array.from(
9672
9747
  index.childNodes(textarea),
9673
9748
  (cn) => index.textContent(cn) || ""
9674
9749
  ).join("");
9750
+ item.attributes.value = maskInputValue({
9751
+ element: textarea,
9752
+ maskInputOptions: this.maskInputOptions,
9753
+ tagName: textarea.tagName,
9754
+ type: getInputType(textarea),
9755
+ value,
9756
+ maskInputFn: this.maskInputFn
9757
+ });
9675
9758
  });
9676
9759
  __publicField(this, "processMutation", (m) => {
9677
9760
  if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
@@ -12072,7 +12155,6 @@ try {
12072
12155
  }
12073
12156
  const mirror = createMirror$2();
12074
12157
  function record(options = {}) {
12075
- var _a2;
12076
12158
  const {
12077
12159
  emit,
12078
12160
  checkoutEveryNms,
@@ -12082,7 +12164,7 @@ function record(options = {}) {
12082
12164
  blockSelector = null,
12083
12165
  ignoreClass = "rr-ignore",
12084
12166
  ignoreSelector = null,
12085
- ignoreAttribute = "rr-ignore-attribute",
12167
+ ignoreAttribute = "rr-ignore",
12086
12168
  maskTextClass = "rr-mask",
12087
12169
  maskTextSelector = null,
12088
12170
  inlineStylesheet = true,
@@ -12108,24 +12190,12 @@ function record(options = {}) {
12108
12190
  ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
12109
12191
  errorHandler: errorHandler2
12110
12192
  } = options;
12111
- const win = options.customWindow || window;
12112
- const doc = options.customDocument || document;
12113
- try {
12114
- if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
12115
- const cleanFrame = doc.createElement("iframe");
12116
- doc.body.appendChild(cleanFrame);
12117
- Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
12118
- doc.body.removeChild(cleanFrame);
12119
- }
12120
- } catch (err) {
12121
- console.debug("Unable to override Array.from", err);
12122
- }
12123
12193
  registerErrorHandler(errorHandler2);
12124
- const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
12194
+ const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
12125
12195
  let passEmitsToParent = false;
12126
12196
  if (!inEmittingFrame) {
12127
12197
  try {
12128
- if (win.parent.document) {
12198
+ if (window.parent.document) {
12129
12199
  passEmitsToParent = false;
12130
12200
  }
12131
12201
  } catch (e2) {
@@ -12192,10 +12262,10 @@ function record(options = {}) {
12192
12262
  return e2;
12193
12263
  };
12194
12264
  wrappedEmit = (r2, isCheckout) => {
12195
- var _a3;
12265
+ var _a2;
12196
12266
  const e2 = r2;
12197
12267
  e2.timestamp = nowTimestamp();
12198
- if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
12268
+ if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
12199
12269
  mutationBuffers.forEach((buf) => buf.unfreeze());
12200
12270
  }
12201
12271
  if (inEmittingFrame) {
@@ -12204,10 +12274,10 @@ function record(options = {}) {
12204
12274
  const message = {
12205
12275
  type: "rrweb",
12206
12276
  event: eventProcessor(e2),
12207
- origin: win.location.origin,
12277
+ origin: window.location.origin,
12208
12278
  isCheckout
12209
12279
  };
12210
- win.parent.postMessage(message, "*");
12280
+ window.parent.postMessage(message, "*");
12211
12281
  }
12212
12282
  if (e2.type === EventType.FullSnapshot) {
12213
12283
  lastFullSnapshotEvent = e2;
@@ -12278,7 +12348,7 @@ function record(options = {}) {
12278
12348
  canvasManager = new CanvasManager({
12279
12349
  recordCanvas,
12280
12350
  mutationCb: wrappedCanvasMutationEmit,
12281
- win,
12351
+ win: window,
12282
12352
  blockClass,
12283
12353
  blockSelector,
12284
12354
  mirror,
@@ -12319,9 +12389,9 @@ function record(options = {}) {
12319
12389
  {
12320
12390
  type: EventType.Meta,
12321
12391
  data: {
12322
- href: win.location.href,
12323
- width: getWindowWidth(win),
12324
- height: getWindowHeight(win)
12392
+ href: window.location.href,
12393
+ width: getWindowWidth(),
12394
+ height: getWindowHeight()
12325
12395
  }
12326
12396
  },
12327
12397
  isCheckout
@@ -12329,12 +12399,13 @@ function record(options = {}) {
12329
12399
  stylesheetManager.reset();
12330
12400
  shadowDomManager.init();
12331
12401
  mutationBuffers.forEach((buf) => buf.lock());
12332
- const node2 = snapshot(doc, {
12402
+ const node2 = snapshot(document, {
12333
12403
  mirror,
12334
12404
  blockClass,
12335
12405
  blockSelector,
12336
12406
  maskTextClass,
12337
12407
  maskTextSelector,
12408
+ ignoreAttribute,
12338
12409
  inlineStylesheet,
12339
12410
  maskAllInputs: maskInputOptions,
12340
12411
  maskTextFn,
@@ -12351,7 +12422,7 @@ function record(options = {}) {
12351
12422
  stylesheetManager.trackLinkElement(n2);
12352
12423
  }
12353
12424
  if (hasShadowRoot(n2)) {
12354
- shadowDomManager.addShadowRoot(index.shadowRoot(n2), doc);
12425
+ shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
12355
12426
  }
12356
12427
  },
12357
12428
  onIframeLoad: (iframe, childSn) => {
@@ -12371,22 +12442,22 @@ function record(options = {}) {
12371
12442
  type: EventType.FullSnapshot,
12372
12443
  data: {
12373
12444
  node: node2,
12374
- initialOffset: getWindowScroll(win)
12445
+ initialOffset: getWindowScroll(window)
12375
12446
  }
12376
12447
  },
12377
12448
  isCheckout
12378
12449
  );
12379
12450
  mutationBuffers.forEach((buf) => buf.unlock());
12380
- if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
12451
+ if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
12381
12452
  stylesheetManager.adoptStyleSheets(
12382
- doc.adoptedStyleSheets,
12383
- mirror.getId(doc)
12453
+ document.adoptedStyleSheets,
12454
+ mirror.getId(document)
12384
12455
  );
12385
12456
  };
12386
12457
  try {
12387
12458
  const handlers = [];
12388
- const observe = (doc2) => {
12389
- var _a3;
12459
+ const observe = (doc) => {
12460
+ var _a2;
12390
12461
  return callbackWrapper(initObservers)(
12391
12462
  {
12392
12463
  mutationCb: wrappedMutationEmit,
@@ -12489,7 +12560,7 @@ function record(options = {}) {
12489
12560
  inlineImages,
12490
12561
  userTriggeredOnInput,
12491
12562
  collectFonts,
12492
- doc: doc2,
12563
+ doc,
12493
12564
  maskInputFn,
12494
12565
  maskTextFn,
12495
12566
  keepIframeSrcFn,
@@ -12503,7 +12574,7 @@ function record(options = {}) {
12503
12574
  processedNodeManager,
12504
12575
  canvasManager,
12505
12576
  ignoreCSSAttributes,
12506
- plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
12577
+ plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
12507
12578
  observer: p.observer,
12508
12579
  options: p.options,
12509
12580
  callback: (payload) => wrappedEmit({
@@ -12527,10 +12598,10 @@ function record(options = {}) {
12527
12598
  });
12528
12599
  const init = () => {
12529
12600
  takeFullSnapshot$1();
12530
- handlers.push(observe(doc));
12601
+ handlers.push(observe(document));
12531
12602
  recording = true;
12532
12603
  };
12533
- if (doc.readyState === "interactive" || doc.readyState === "complete") {
12604
+ if (document.readyState === "interactive" || document.readyState === "complete") {
12534
12605
  init();
12535
12606
  } else {
12536
12607
  handlers.push(
@@ -12552,7 +12623,7 @@ function record(options = {}) {
12552
12623
  });
12553
12624
  if (recordAfter === "load") init();
12554
12625
  },
12555
- win
12626
+ window
12556
12627
  )
12557
12628
  );
12558
12629
  }