@screeb/rrweb 1.0.6 → 1.0.7

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.
package/dist/rrweb.d.cts CHANGED
@@ -2,7 +2,7 @@ import { actionWithDelay } from '@rrweb/types';
2
2
  import { addedNodeMutation } from '@rrweb/types';
3
3
  import { blockClass } from '@rrweb/types';
4
4
  import { canvasMutationData } from '@rrweb/types';
5
- import { DataURLOptions } from 'rrweb-snapshot';
5
+ import { DataURLOptions } from '@rrweb/types';
6
6
  import { DeprecatedMirror } from '@rrweb/types';
7
7
  import { DocumentDimension } from '@rrweb/types';
8
8
  import { Emitter } from '@rrweb/types';
@@ -11,7 +11,7 @@ import { eventWithTime } from '@rrweb/types';
11
11
  import { Handler } from '@rrweb/types';
12
12
  import { hookResetter } from '@rrweb/types';
13
13
  import { hooksParam } from '@rrweb/types';
14
- import { IMirror } from 'rrweb-snapshot';
14
+ import { IMirror } from '@rrweb/types';
15
15
  import { IncrementalSource } from '@rrweb/types';
16
16
  import { IWindow } from '@rrweb/types';
17
17
  import { KeepIframeSrcFn } from '@rrweb/types';
package/dist/rrweb.d.ts CHANGED
@@ -2,7 +2,7 @@ import { actionWithDelay } from '@rrweb/types';
2
2
  import { addedNodeMutation } from '@rrweb/types';
3
3
  import { blockClass } from '@rrweb/types';
4
4
  import { canvasMutationData } from '@rrweb/types';
5
- import { DataURLOptions } from 'rrweb-snapshot';
5
+ import { DataURLOptions } from '@rrweb/types';
6
6
  import { DeprecatedMirror } from '@rrweb/types';
7
7
  import { DocumentDimension } from '@rrweb/types';
8
8
  import { Emitter } from '@rrweb/types';
@@ -11,7 +11,7 @@ import { eventWithTime } from '@rrweb/types';
11
11
  import { Handler } from '@rrweb/types';
12
12
  import { hookResetter } from '@rrweb/types';
13
13
  import { hooksParam } from '@rrweb/types';
14
- import { IMirror } from 'rrweb-snapshot';
14
+ import { IMirror } from '@rrweb/types';
15
15
  import { IncrementalSource } from '@rrweb/types';
16
16
  import { IWindow } from '@rrweb/types';
17
17
  import { KeepIframeSrcFn } from '@rrweb/types';
package/dist/rrweb.js CHANGED
@@ -5,7 +5,7 @@ var _a;
5
5
  var __defProp$1 = Object.defineProperty;
6
6
  var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
7
  var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
8
- var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
8
+ var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
9
9
  NodeType2[NodeType2["Document"] = 0] = "Document";
10
10
  NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
11
11
  NodeType2[NodeType2["Element"] = 2] = "Element";
@@ -13,7 +13,7 @@ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
13
13
  NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
14
14
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
15
15
  return NodeType2;
16
- })(NodeType$2 || {});
16
+ })(NodeType$3 || {});
17
17
  const testableAccessors$1 = {
18
18
  Node: ["childNodes", "parentNode", "parentElement", "textContent"],
19
19
  ShadowRoot: ["host", "styleSheets"],
@@ -27,6 +27,9 @@ const testableMethods$1 = {
27
27
  MutationObserver: ["constructor"]
28
28
  };
29
29
  const untaintedBasePrototype$1 = {};
30
+ const isAngularZonePresent$1 = () => {
31
+ return !!globalThis.Zone;
32
+ };
30
33
  function getUntaintedPrototype$1(key) {
31
34
  if (untaintedBasePrototype$1[key])
32
35
  return untaintedBasePrototype$1[key];
@@ -54,7 +57,7 @@ function getUntaintedPrototype$1(key) {
54
57
  }
55
58
  )
56
59
  );
57
- if (isUntaintedAccessors && isUntaintedMethods) {
60
+ if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent$1()) {
58
61
  untaintedBasePrototype$1[key] = defaultObj.prototype;
59
62
  return defaultObj.prototype;
60
63
  }
@@ -356,13 +359,13 @@ function is2DCanvasBlank(canvas) {
356
359
  }
357
360
  function isNodeMetaEqual(a2, b) {
358
361
  if (!a2 || !b || a2.type !== b.type) return false;
359
- if (a2.type === NodeType$2.Document)
362
+ if (a2.type === NodeType$3.Document)
360
363
  return a2.compatMode === b.compatMode;
361
- else if (a2.type === NodeType$2.DocumentType)
364
+ else if (a2.type === NodeType$3.DocumentType)
362
365
  return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;
363
- else if (a2.type === NodeType$2.Comment || a2.type === NodeType$2.Text || a2.type === NodeType$2.CDATA)
366
+ else if (a2.type === NodeType$3.Comment || a2.type === NodeType$3.Text || a2.type === NodeType$3.CDATA)
364
367
  return a2.textContent === b.textContent;
365
- else if (a2.type === NodeType$2.Element)
368
+ else if (a2.type === NodeType$3.Element)
366
369
  return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;
367
370
  return false;
368
371
  }
@@ -747,20 +750,20 @@ function serializeNode(n2, options) {
747
750
  case n2.DOCUMENT_NODE:
748
751
  if (n2.compatMode !== "CSS1Compat") {
749
752
  return {
750
- type: NodeType$2.Document,
753
+ type: NodeType$3.Document,
751
754
  childNodes: [],
752
755
  compatMode: n2.compatMode
753
756
  // probably "BackCompat"
754
757
  };
755
758
  } else {
756
759
  return {
757
- type: NodeType$2.Document,
760
+ type: NodeType$3.Document,
758
761
  childNodes: []
759
762
  };
760
763
  }
761
764
  case n2.DOCUMENT_TYPE_NODE:
762
765
  return {
763
- type: NodeType$2.DocumentType,
766
+ type: NodeType$3.DocumentType,
764
767
  name: n2.name,
765
768
  publicId: n2.publicId,
766
769
  systemId: n2.systemId,
@@ -791,13 +794,13 @@ function serializeNode(n2, options) {
791
794
  });
792
795
  case n2.CDATA_SECTION_NODE:
793
796
  return {
794
- type: NodeType$2.CDATA,
797
+ type: NodeType$3.CDATA,
795
798
  textContent: "",
796
799
  rootId
797
800
  };
798
801
  case n2.COMMENT_NODE:
799
802
  return {
800
- type: NodeType$2.Comment,
803
+ type: NodeType$3.Comment,
801
804
  textContent: index$1.textContent(n2) || "",
802
805
  rootId
803
806
  };
@@ -829,7 +832,7 @@ function serializeTextNode(n2, options) {
829
832
  textContent2 = maskTextFn ? maskTextFn(textContent2, index$1.parentElement(n2)) : textContent2.replace(/[\S]/g, "*");
830
833
  }
831
834
  return {
832
- type: NodeType$2.Text,
835
+ type: NodeType$3.Text,
833
836
  textContent: textContent2 || "",
834
837
  rootId
835
838
  };
@@ -1015,7 +1018,7 @@ function serializeElementNode(n2, options) {
1015
1018
  } catch (e2) {
1016
1019
  }
1017
1020
  return {
1018
- type: NodeType$2.Element,
1021
+ type: NodeType$3.Element,
1019
1022
  tagName,
1020
1023
  attributes,
1021
1024
  childNodes: [],
@@ -1033,9 +1036,9 @@ function lowerIfExists(maybeAttr) {
1033
1036
  }
1034
1037
  }
1035
1038
  function slimDOMExcluded(sn, slimDOMOptions) {
1036
- if (slimDOMOptions.comment && sn.type === NodeType$2.Comment) {
1039
+ if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {
1037
1040
  return true;
1038
- } else if (sn.type === NodeType$2.Element) {
1041
+ } else if (sn.type === NodeType$3.Element) {
1039
1042
  if (slimDOMOptions.script && // script tag
1040
1043
  (sn.tagName === "script" || // (module)preload link
1041
1044
  sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") && sn.attributes.as === "script" || // prefetch link
@@ -1125,7 +1128,7 @@ function serializeNodeWithId(n2, options) {
1125
1128
  let id;
1126
1129
  if (mirror2.hasNode(n2)) {
1127
1130
  id = mirror2.getId(n2);
1128
- } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$2.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
1131
+ } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
1129
1132
  id = IGNORED_NODE;
1130
1133
  } else {
1131
1134
  id = genId();
@@ -1139,15 +1142,15 @@ function serializeNodeWithId(n2, options) {
1139
1142
  onSerialize(n2);
1140
1143
  }
1141
1144
  let recordChild = !skipChild;
1142
- if (serializedNode.type === NodeType$2.Element) {
1145
+ if (serializedNode.type === NodeType$3.Element) {
1143
1146
  recordChild = recordChild && !serializedNode.needBlock;
1144
1147
  delete serializedNode.needBlock;
1145
1148
  const shadowRootEl = index$1.shadowRoot(n2);
1146
1149
  if (shadowRootEl && isNativeShadowDom(shadowRootEl))
1147
1150
  serializedNode.isShadowHost = true;
1148
1151
  }
1149
- if ((serializedNode.type === NodeType$2.Document || serializedNode.type === NodeType$2.Element) && recordChild) {
1150
- if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$2.Element && serializedNode.tagName === "head") {
1152
+ if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {
1153
+ if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") {
1151
1154
  preserveWhiteSpace = false;
1152
1155
  }
1153
1156
  const bypassOptions = {
@@ -1176,9 +1179,9 @@ function serializeNodeWithId(n2, options) {
1176
1179
  keepIframeSrcFn,
1177
1180
  cssCaptured: false
1178
1181
  };
1179
- if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
1182
+ if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
1180
1183
  else {
1181
- if (serializedNode.type === NodeType$2.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
1184
+ if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === "string") {
1182
1185
  bypassOptions.cssCaptured = true;
1183
1186
  }
1184
1187
  for (const childN of Array.from(index$1.childNodes(n2))) {
@@ -1203,7 +1206,7 @@ function serializeNodeWithId(n2, options) {
1203
1206
  if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
1204
1207
  serializedNode.isShadow = true;
1205
1208
  }
1206
- if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "iframe") {
1209
+ if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") {
1207
1210
  onceIframeLoaded(
1208
1211
  n2,
1209
1212
  () => {
@@ -1245,7 +1248,7 @@ function serializeNodeWithId(n2, options) {
1245
1248
  iframeLoadTimeout
1246
1249
  );
1247
1250
  }
1248
- if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "link" && typeof serializedNode.attributes.rel === "string" && (serializedNode.attributes.rel === "stylesheet" || serializedNode.attributes.rel === "preload" && typeof serializedNode.attributes.href === "string" && extractFileExtension(serializedNode.attributes.href) === "css")) {
1251
+ if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "link" && typeof serializedNode.attributes.rel === "string" && (serializedNode.attributes.rel === "stylesheet" || serializedNode.attributes.rel === "preload" && typeof serializedNode.attributes.href === "string" && extractFileExtension(serializedNode.attributes.href) === "css")) {
1249
1252
  onceStylesheetLoaded(
1250
1253
  n2,
1251
1254
  () => {
@@ -5023,7 +5026,7 @@ function createCache() {
5023
5026
  function applyCssSplits(n2, cssText, hackCss, cache) {
5024
5027
  const childTextNodes = [];
5025
5028
  for (const scn of n2.childNodes) {
5026
- if (scn.type === NodeType$2.Text) {
5029
+ if (scn.type === NodeType$3.Text) {
5027
5030
  childTextNodes.push(scn);
5028
5031
  }
5029
5032
  }
@@ -5054,15 +5057,15 @@ function buildNode(n2, options) {
5054
5057
  var _a2;
5055
5058
  const { doc, hackCss, cache } = options;
5056
5059
  switch (n2.type) {
5057
- case NodeType$2.Document:
5060
+ case NodeType$3.Document:
5058
5061
  return doc.implementation.createDocument(null, "", null);
5059
- case NodeType$2.DocumentType:
5062
+ case NodeType$3.DocumentType:
5060
5063
  return doc.implementation.createDocumentType(
5061
5064
  n2.name || "html",
5062
5065
  n2.publicId,
5063
5066
  n2.systemId
5064
5067
  );
5065
- case NodeType$2.Element: {
5068
+ case NodeType$3.Element: {
5066
5069
  const tagName = getTagName(n2);
5067
5070
  let node2;
5068
5071
  if (n2.isSVG) {
@@ -5196,14 +5199,14 @@ function buildNode(n2, options) {
5196
5199
  }
5197
5200
  return node2;
5198
5201
  }
5199
- case NodeType$2.Text:
5202
+ case NodeType$3.Text:
5200
5203
  if (n2.isStyle && hackCss) {
5201
5204
  return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));
5202
5205
  }
5203
5206
  return doc.createTextNode(n2.textContent);
5204
- case NodeType$2.CDATA:
5207
+ case NodeType$3.CDATA:
5205
5208
  return doc.createCDATASection(n2.textContent);
5206
- case NodeType$2.Comment:
5209
+ case NodeType$3.Comment:
5207
5210
  return doc.createComment(n2.textContent);
5208
5211
  default:
5209
5212
  return null;
@@ -5230,11 +5233,11 @@ function buildNodeWithSN(n2, options) {
5230
5233
  if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {
5231
5234
  mirror2.replace(n2.rootId, doc);
5232
5235
  }
5233
- if (n2.type === NodeType$2.Document) {
5236
+ if (n2.type === NodeType$3.Document) {
5234
5237
  doc.close();
5235
5238
  doc.open();
5236
- if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$2.DocumentType) {
5237
- if (n2.childNodes[0].type === NodeType$2.Element && "xmlns" in n2.childNodes[0].attributes && n2.childNodes[0].attributes.xmlns === "http://www.w3.org/1999/xhtml") {
5239
+ if (n2.compatMode === "BackCompat" && n2.childNodes && n2.childNodes[0].type !== NodeType$3.DocumentType) {
5240
+ if (n2.childNodes[0].type === NodeType$3.Element && "xmlns" in n2.childNodes[0].attributes && n2.childNodes[0].attributes.xmlns === "http://www.w3.org/1999/xhtml") {
5238
5241
  doc.write(
5239
5242
  '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'
5240
5243
  );
@@ -5247,7 +5250,7 @@ function buildNodeWithSN(n2, options) {
5247
5250
  node2 = doc;
5248
5251
  }
5249
5252
  mirror2.add(node2, n2);
5250
- if ((n2.type === NodeType$2.Document || n2.type === NodeType$2.Element) && !skipChild) {
5253
+ if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {
5251
5254
  for (const childN of n2.childNodes) {
5252
5255
  const childNode = buildNodeWithSN(childN, {
5253
5256
  doc,
@@ -5263,7 +5266,7 @@ function buildNodeWithSN(n2, options) {
5263
5266
  }
5264
5267
  if (childN.isShadow && isElement(node2) && node2.shadowRoot) {
5265
5268
  node2.shadowRoot.appendChild(childNode);
5266
- } else if (n2.type === NodeType$2.Document && childN.type == NodeType$2.Element) {
5269
+ } else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {
5267
5270
  const htmlElement = childNode;
5268
5271
  let body = null;
5269
5272
  htmlElement.childNodes.forEach((child) => {
@@ -5298,7 +5301,7 @@ function visit(mirror2, onVisit) {
5298
5301
  }
5299
5302
  function handleScroll(node2, mirror2) {
5300
5303
  const n2 = mirror2.getMeta(node2);
5301
- if ((n2 == null ? void 0 : n2.type) !== NodeType$2.Element) {
5304
+ if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {
5302
5305
  return;
5303
5306
  }
5304
5307
  const el = node2;
@@ -5346,15 +5349,6 @@ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "
5346
5349
  var __defProp22 = Object.defineProperty;
5347
5350
  var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5348
5351
  var __publicField22 = (obj, key, value) => __defNormalProp22(obj, typeof key !== "symbol" ? key + "" : key, value);
5349
- var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
5350
- NodeType2[NodeType2["Document"] = 0] = "Document";
5351
- NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
5352
- NodeType2[NodeType2["Element"] = 2] = "Element";
5353
- NodeType2[NodeType2["Text"] = 3] = "Text";
5354
- NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
5355
- NodeType2[NodeType2["Comment"] = 5] = "Comment";
5356
- return NodeType2;
5357
- })(NodeType$1 || {});
5358
5352
  let Mirror$1 = class Mirror2 {
5359
5353
  constructor() {
5360
5354
  __publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
@@ -8962,6 +8956,15 @@ postcss$1.Input;
8962
8956
  postcss$1.Rule;
8963
8957
  postcss$1.Root;
8964
8958
  postcss$1.Node;
8959
+ var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
8960
+ NodeType2[NodeType2["Document"] = 0] = "Document";
8961
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
8962
+ NodeType2[NodeType2["Element"] = 2] = "Element";
8963
+ NodeType2[NodeType2["Text"] = 3] = "Text";
8964
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
8965
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
8966
+ return NodeType2;
8967
+ })(NodeType$1 || {});
8965
8968
  function parseCSSText(cssText) {
8966
8969
  const res = {};
8967
8970
  const listDelimiter = /;(?![^(]*\))/g;
@@ -9471,7 +9474,7 @@ function removeChild(parent, child) {
9471
9474
  child.parentNode = null;
9472
9475
  return child;
9473
9476
  }
9474
- var NodeType = /* @__PURE__ */ ((NodeType2) => {
9477
+ var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
9475
9478
  NodeType2[NodeType2["PLACEHOLDER"] = 0] = "PLACEHOLDER";
9476
9479
  NodeType2[NodeType2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
9477
9480
  NodeType2[NodeType2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
@@ -9485,7 +9488,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
9485
9488
  NodeType2[NodeType2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
9486
9489
  NodeType2[NodeType2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
9487
9490
  return NodeType2;
9488
- })(NodeType || {});
9491
+ })(NodeType$2 || {});
9489
9492
  const NAMESPACES = {
9490
9493
  svg: "http://www.w3.org/2000/svg",
9491
9494
  "xlink:href": "http://www.w3.org/1999/xlink",
@@ -10044,7 +10047,7 @@ function getValidTagName(element) {
10044
10047
  function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
10045
10048
  let rrNode;
10046
10049
  switch (node2.nodeType) {
10047
- case NodeType.DOCUMENT_NODE:
10050
+ case NodeType$2.DOCUMENT_NODE:
10048
10051
  if (parentRRNode && parentRRNode.nodeName === "IFRAME")
10049
10052
  rrNode = parentRRNode.contentDocument;
10050
10053
  else {
@@ -10052,7 +10055,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
10052
10055
  rrNode.compatMode = node2.compatMode;
10053
10056
  }
10054
10057
  break;
10055
- case NodeType.DOCUMENT_TYPE_NODE: {
10058
+ case NodeType$2.DOCUMENT_TYPE_NODE: {
10056
10059
  const documentType = node2;
10057
10060
  rrNode = rrdom.createDocumentType(
10058
10061
  documentType.name,
@@ -10061,7 +10064,7 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
10061
10064
  );
10062
10065
  break;
10063
10066
  }
10064
- case NodeType.ELEMENT_NODE: {
10067
+ case NodeType$2.ELEMENT_NODE: {
10065
10068
  const elementNode = node2;
10066
10069
  const tagName = getValidTagName(elementNode);
10067
10070
  rrNode = rrdom.createElement(tagName);
@@ -10073,16 +10076,16 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
10073
10076
  elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);
10074
10077
  break;
10075
10078
  }
10076
- case NodeType.TEXT_NODE:
10079
+ case NodeType$2.TEXT_NODE:
10077
10080
  rrNode = rrdom.createTextNode(node2.textContent || "");
10078
10081
  break;
10079
- case NodeType.CDATA_SECTION_NODE:
10082
+ case NodeType$2.CDATA_SECTION_NODE:
10080
10083
  rrNode = rrdom.createCDATASection(node2.data);
10081
10084
  break;
10082
- case NodeType.COMMENT_NODE:
10085
+ case NodeType$2.COMMENT_NODE:
10083
10086
  rrNode = rrdom.createComment(node2.textContent || "");
10084
10087
  break;
10085
- case NodeType.DOCUMENT_FRAGMENT_NODE:
10088
+ case NodeType$2.DOCUMENT_FRAGMENT_NODE:
10086
10089
  rrNode = parentRRNode.attachShadow({ mode: "open" });
10087
10090
  break;
10088
10091
  default:
@@ -10105,7 +10108,7 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
10105
10108
  if (
10106
10109
  // if the parentRRNode isn't a RRIFrameElement
10107
10110
  (parentRRNode == null ? void 0 : parentRRNode.nodeName) !== "IFRAME" && // if node isn't a shadow root
10108
- node2.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE
10111
+ node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE
10109
10112
  ) {
10110
10113
  parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);
10111
10114
  rrNode.parentNode = parentRRNode;
@@ -10114,8 +10117,8 @@ function buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument(
10114
10117
  if (node2.nodeName === "IFRAME") {
10115
10118
  const iframeDoc = node2.contentDocument;
10116
10119
  iframeDoc && walk2(iframeDoc, rrNode);
10117
- } else if (node2.nodeType === NodeType.DOCUMENT_NODE || node2.nodeType === NodeType.ELEMENT_NODE || node2.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {
10118
- if (node2.nodeType === NodeType.ELEMENT_NODE && node2.shadowRoot)
10120
+ } else if (node2.nodeType === NodeType$2.DOCUMENT_NODE || node2.nodeType === NodeType$2.ELEMENT_NODE || node2.nodeType === NodeType$2.DOCUMENT_FRAGMENT_NODE) {
10121
+ if (node2.nodeType === NodeType$2.ELEMENT_NODE && node2.shadowRoot)
10119
10122
  walk2(node2.shadowRoot, rrNode);
10120
10123
  node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));
10121
10124
  }
@@ -10239,6 +10242,9 @@ const testableMethods = {
10239
10242
  MutationObserver: ["constructor"]
10240
10243
  };
10241
10244
  const untaintedBasePrototype = {};
10245
+ const isAngularZonePresent = () => {
10246
+ return !!globalThis.Zone;
10247
+ };
10242
10248
  function getUntaintedPrototype(key) {
10243
10249
  if (untaintedBasePrototype[key])
10244
10250
  return untaintedBasePrototype[key];
@@ -10266,7 +10272,7 @@ function getUntaintedPrototype(key) {
10266
10272
  }
10267
10273
  )
10268
10274
  );
10269
- if (isUntaintedAccessors && isUntaintedMethods) {
10275
+ if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {
10270
10276
  untaintedBasePrototype[key] = defaultObj.prototype;
10271
10277
  return defaultObj.prototype;
10272
10278
  }
@@ -10848,6 +10854,15 @@ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
10848
10854
  ReplayerEvents2["Destroy"] = "destroy";
10849
10855
  return ReplayerEvents2;
10850
10856
  })(ReplayerEvents || {});
10857
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
10858
+ NodeType2[NodeType2["Document"] = 0] = "Document";
10859
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
10860
+ NodeType2[NodeType2["Element"] = 2] = "Element";
10861
+ NodeType2[NodeType2["Text"] = 3] = "Text";
10862
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
10863
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
10864
+ return NodeType2;
10865
+ })(NodeType || {});
10851
10866
  function isNodeInLinkedList(n2) {
10852
10867
  return "__ln" in n2;
10853
10868
  }
@@ -12784,7 +12799,7 @@ class IframeManager {
12784
12799
  }
12785
12800
  }
12786
12801
  patchRootIdOnNode(node2, rootId) {
12787
- if (node2.type !== NodeType$2.Document && !node2.rootId) node2.rootId = rootId;
12802
+ if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;
12788
12803
  if ("childNodes" in node2) {
12789
12804
  node2.childNodes.forEach((child) => {
12790
12805
  this.patchRootIdOnNode(child, rootId);
@@ -15871,7 +15886,7 @@ class Replayer {
15871
15886
  collectedDialogs.add(builtNode);
15872
15887
  this.collectIframeAndAttachDocument(collectedIframes, builtNode);
15873
15888
  const sn = mirror2.getMeta(builtNode);
15874
- if ((sn == null ? void 0 : sn.type) === NodeType$2.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === "HTML") {
15889
+ if ((sn == null ? void 0 : sn.type) === NodeType.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === "HTML") {
15875
15890
  const { documentElement, head } = iframeEl.contentDocument;
15876
15891
  this.insertStyleRules(
15877
15892
  documentElement,
@@ -16347,7 +16362,7 @@ class Replayer {
16347
16362
  mutation.parentId
16348
16363
  );
16349
16364
  if (!parent) {
16350
- if (mutation.node.type === NodeType$2.Document) {
16365
+ if (mutation.node.type === NodeType.Document) {
16351
16366
  return this.newDocumentQueue.push(mutation);
16352
16367
  }
16353
16368
  return queue.push(mutation);
@@ -16409,7 +16424,7 @@ class Replayer {
16409
16424
  return;
16410
16425
  }
16411
16426
  const parentSn = mirror2.getMeta(parent);
16412
- if (parentSn && parentSn.type === NodeType$2.Element && mutation.node.type === NodeType$2.Text) {
16427
+ if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {
16413
16428
  const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);
16414
16429
  if (parentSn.tagName === "textarea") {
16415
16430
  for (const c2 of prospectiveSiblings) {
@@ -16425,9 +16440,9 @@ class Replayer {
16425
16440
  }
16426
16441
  }
16427
16442
  }
16428
- } else if ((parentSn == null ? void 0 : parentSn.type) === NodeType$2.Document) {
16443
+ } else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {
16429
16444
  const parentDoc = parent;
16430
- if (mutation.node.type === NodeType$2.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)
16445
+ if (mutation.node.type === NodeType.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)
16431
16446
  parentDoc.removeChild(parentDoc.childNodes[0]);
16432
16447
  if (target.nodeName === "HTML" && parentDoc.documentElement)
16433
16448
  parentDoc.removeChild(
@@ -16633,7 +16648,7 @@ class Replayer {
16633
16648
  left: d.x,
16634
16649
  behavior: isSync ? "auto" : "smooth"
16635
16650
  });
16636
- } else if ((sn == null ? void 0 : sn.type) === NodeType$2.Document) {
16651
+ } else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {
16637
16652
  (_b = target.defaultView) == null ? void 0 : _b.scrollTo({
16638
16653
  top: d.y,
16639
16654
  left: d.x,