@posthog/rrweb-player 0.0.22 → 0.0.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.
@@ -12853,16 +12853,6 @@ class Replayer {
12853
12853
  });
12854
12854
  const legacy_missingNodeMap = __spreadValues({}, this.legacy_missingNodeRetryMap);
12855
12855
  const queue = [];
12856
- const nextNotInDOM = (mutation) => {
12857
- let next = null;
12858
- if (mutation.nextId) {
12859
- next = mirror2.getNode(mutation.nextId);
12860
- }
12861
- if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {
12862
- return true;
12863
- }
12864
- return false;
12865
- };
12866
12856
  const appendNode = (mutation) => {
12867
12857
  var _a2, _b2;
12868
12858
  if (!this.iframe.contentDocument) {
@@ -12875,7 +12865,10 @@ class Replayer {
12875
12865
  if (mutation.node.type === NodeType.Document) {
12876
12866
  return this.newDocumentQueue.push(mutation);
12877
12867
  }
12878
- return queue.push(mutation);
12868
+ const parentIdInCurrentBatch = d.adds.some(
12869
+ (add) => add.node.id === mutation.parentId
12870
+ );
12871
+ return parentIdInCurrentBatch ? queue.push(mutation) : void 0;
12879
12872
  }
12880
12873
  if (mutation.node.isShadow) {
12881
12874
  if (!hasShadowRoot(parent)) {
@@ -12891,9 +12884,6 @@ class Replayer {
12891
12884
  if (mutation.nextId) {
12892
12885
  next = mirror2.getNode(mutation.nextId);
12893
12886
  }
12894
- if (nextNotInDOM(mutation)) {
12895
- return queue.push(mutation);
12896
- }
12897
12887
  if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {
12898
12888
  return;
12899
12889
  }
@@ -12999,11 +12989,11 @@ class Replayer {
12999
12989
  d.adds.forEach((mutation) => {
13000
12990
  appendNode(mutation);
13001
12991
  });
13002
- const startTime = Date.now();
12992
+ const startTime = performance.now();
13003
12993
  while (queue.length) {
13004
12994
  const resolveTrees = queueToResolveTrees(queue);
13005
12995
  queue.length = 0;
13006
- if (Date.now() - startTime > 500) {
12996
+ if (performance.now() - startTime > 150) {
13007
12997
  this.warn(
13008
12998
  "Timeout in the loop, please check the resolve tree data:",
13009
12999
  resolveTrees
@@ -13258,12 +13248,13 @@ class Replayer {
13258
13248
  }
13259
13249
  }
13260
13250
  applyStyleDeclaration(data, styleSheet) {
13251
+ var _a2, _b2;
13261
13252
  if (data.set) {
13262
13253
  const rule2 = getNestedRule(
13263
13254
  styleSheet.rules,
13264
13255
  data.index
13265
13256
  );
13266
- rule2.style.setProperty(
13257
+ (_a2 = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _a2.setProperty(
13267
13258
  data.set.property,
13268
13259
  data.set.value,
13269
13260
  data.set.priority
@@ -13274,7 +13265,7 @@ class Replayer {
13274
13265
  styleSheet.rules,
13275
13266
  data.index
13276
13267
  );
13277
- rule2.style.removeProperty(data.remove.property);
13268
+ (_b2 = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _b2.removeProperty(data.remove.property);
13278
13269
  }
13279
13270
  }
13280
13271
  applyAdoptedStyleSheet(data) {