@posthog/rrweb-player 0.0.49 → 0.0.50

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.
@@ -10813,14 +10813,14 @@ function hasShadowRoot(n2) {
10813
10813
  return Boolean(index.shadowRoot(n2));
10814
10814
  }
10815
10815
  function getNestedRule(rules2, position2) {
10816
- const rule2 = rules2[position2[0]];
10816
+ const rule2 = rules2 == null ? void 0 : rules2[position2[0]];
10817
+ if (!rule2) {
10818
+ return null;
10819
+ }
10817
10820
  if (position2.length === 1) {
10818
10821
  return rule2;
10819
10822
  } else {
10820
- return getNestedRule(
10821
- rule2.cssRules[position2[1]].cssRules,
10822
- position2.slice(2)
10823
- );
10823
+ return getNestedRule(rule2.cssRules, position2.slice(1));
10824
10824
  }
10825
10825
  }
10826
10826
  function getPositionsAndIndex(nestedIndex) {
@@ -13526,18 +13526,27 @@ class Replayer {
13526
13526
  const newSn = mirror2.getMeta(
13527
13527
  target
13528
13528
  );
13529
+ const newNode = buildNodeWithSN(
13530
+ {
13531
+ ...newSn,
13532
+ attributes: {
13533
+ ...newSn.attributes,
13534
+ ...mutation.attributes
13535
+ }
13536
+ },
13537
+ {
13538
+ doc: target.ownerDocument,
13539
+ // can be Document or RRDocument
13540
+ mirror: mirror2,
13541
+ skipChild: true,
13542
+ hackCss: true,
13543
+ cache: this.cache
13544
+ }
13545
+ );
13529
13546
  Object.assign(
13530
13547
  newSn.attributes,
13531
13548
  mutation.attributes
13532
13549
  );
13533
- const newNode = buildNodeWithSN(newSn, {
13534
- doc: target.ownerDocument,
13535
- // can be Document or RRDocument
13536
- mirror: mirror2,
13537
- skipChild: true,
13538
- hackCss: true,
13539
- cache: this.cache
13540
- });
13541
13550
  const siblingNode = target.nextSibling;
13542
13551
  const parentNode2 = target.parentNode;
13543
13552
  if (newNode && parentNode2) {
@@ -13687,7 +13696,7 @@ class Replayer {
13687
13696
  if (Array.isArray(nestedIndex)) {
13688
13697
  const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);
13689
13698
  const nestedRule = getNestedRule(styleSheet.cssRules, positions);
13690
- nestedRule.insertRule(rule2, index2);
13699
+ nestedRule == null ? void 0 : nestedRule.insertRule(rule2, index2);
13691
13700
  } else {
13692
13701
  const index2 = nestedIndex === void 0 ? void 0 : Math.min(nestedIndex, styleSheet.cssRules.length);
13693
13702
  styleSheet == null ? void 0 : styleSheet.insertRule(rule2, index2);
@@ -13700,19 +13709,19 @@ class Replayer {
13700
13709
  if (Array.isArray(nestedIndex)) {
13701
13710
  const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);
13702
13711
  const nestedRule = getNestedRule(styleSheet.cssRules, positions);
13703
- nestedRule.deleteRule(index2 || 0);
13712
+ nestedRule == null ? void 0 : nestedRule.deleteRule(index2 || 0);
13704
13713
  } else {
13705
13714
  styleSheet == null ? void 0 : styleSheet.deleteRule(nestedIndex);
13706
13715
  }
13707
13716
  } catch (e2) {
13708
13717
  }
13709
13718
  });
13710
- if (data.replace)
13719
+ if (typeof data.replace === "string")
13711
13720
  try {
13712
13721
  void ((_c = styleSheet.replace) == null ? void 0 : _c.call(styleSheet, data.replace));
13713
13722
  } catch (e2) {
13714
13723
  }
13715
- if (data.replaceSync)
13724
+ if (typeof data.replaceSync === "string")
13716
13725
  try {
13717
13726
  (_d = styleSheet.replaceSync) == null ? void 0 : _d.call(styleSheet, data.replaceSync);
13718
13727
  } catch (e2) {