@posthog/rrweb 0.0.32 → 0.0.35

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.cjs CHANGED
@@ -893,6 +893,7 @@ function hrefFrom(n2) {
893
893
  return n2.href;
894
894
  }
895
895
  function serializeElementNode(n2, options) {
896
+ var _a2, _b;
896
897
  const {
897
898
  doc,
898
899
  blockClass,
@@ -1066,11 +1067,13 @@ function serializeElementNode(n2, options) {
1066
1067
  }
1067
1068
  }
1068
1069
  if (needBlock) {
1069
- const { width, height } = n2.getBoundingClientRect();
1070
+ const { width, height, left, top } = n2.getBoundingClientRect();
1070
1071
  attributes = {
1071
1072
  class: attributes.class,
1072
1073
  rr_width: `${width}px`,
1073
- rr_height: `${height}px`
1074
+ rr_height: `${height}px`,
1075
+ rr_left: `${Math.floor(left + (((_a2 = doc.defaultView) == null ? void 0 : _a2.scrollX) || 0))}px`,
1076
+ rr_top: `${Math.floor(top + (((_b = doc.defaultView) == null ? void 0 : _b.scrollY) || 0))}px`
1074
1077
  };
1075
1078
  }
1076
1079
  if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {
@@ -1475,7 +1478,7 @@ function getDefaultExportFromCjs$1(x) {
1475
1478
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1476
1479
  }
1477
1480
  function getAugmentedNamespace$1(n2) {
1478
- if (n2.__esModule) return n2;
1481
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
1479
1482
  var f2 = n2.default;
1480
1483
  if (typeof f2 == "function") {
1481
1484
  var a2 = function a3() {
@@ -1994,6 +1997,9 @@ function requireNode$1() {
1994
1997
  return offset;
1995
1998
  }
1996
1999
  class Node2 {
2000
+ get proxyOf() {
2001
+ return this;
2002
+ }
1997
2003
  constructor(defaults = {}) {
1998
2004
  this.raws = {};
1999
2005
  this[isClean] = false;
@@ -2112,7 +2118,7 @@ function requireNode$1() {
2112
2118
  let index2 = this.parent.index(this);
2113
2119
  return this.parent.nodes[index2 + 1];
2114
2120
  }
2115
- positionBy(opts) {
2121
+ positionBy(opts = {}) {
2116
2122
  let pos = this.source.start;
2117
2123
  if (opts.index) {
2118
2124
  pos = this.positionInside(opts.index);
@@ -2141,27 +2147,38 @@ function requireNode$1() {
2141
2147
  column += 1;
2142
2148
  }
2143
2149
  }
2144
- return { column, line };
2150
+ return { column, line, offset: end };
2145
2151
  }
2146
2152
  prev() {
2147
2153
  if (!this.parent) return void 0;
2148
2154
  let index2 = this.parent.index(this);
2149
2155
  return this.parent.nodes[index2 - 1];
2150
2156
  }
2151
- rangeBy(opts) {
2157
+ rangeBy(opts = {}) {
2158
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2152
2159
  let start = {
2153
2160
  column: this.source.start.column,
2154
- line: this.source.start.line
2161
+ line: this.source.start.line,
2162
+ offset: sourceOffset(inputString, this.source.start)
2155
2163
  };
2156
2164
  let end = this.source.end ? {
2157
2165
  column: this.source.end.column + 1,
2158
- line: this.source.end.line
2166
+ line: this.source.end.line,
2167
+ offset: typeof this.source.end.offset === "number" ? (
2168
+ // `source.end.offset` is exclusive, so we don't need to add 1
2169
+ this.source.end.offset
2170
+ ) : (
2171
+ // Since line/column in this.source.end is inclusive,
2172
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
2173
+ // So, we add 1 to convert it to exclusive.
2174
+ sourceOffset(inputString, this.source.end) + 1
2175
+ )
2159
2176
  } : {
2160
2177
  column: start.column + 1,
2161
- line: start.line
2178
+ line: start.line,
2179
+ offset: start.offset + 1
2162
2180
  };
2163
2181
  if (opts.word) {
2164
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2165
2182
  let stringRepresentation = inputString.slice(
2166
2183
  sourceOffset(inputString, this.source.start),
2167
2184
  sourceOffset(inputString, this.source.end)
@@ -2169,15 +2186,14 @@ function requireNode$1() {
2169
2186
  let index2 = stringRepresentation.indexOf(opts.word);
2170
2187
  if (index2 !== -1) {
2171
2188
  start = this.positionInside(index2);
2172
- end = this.positionInside(
2173
- index2 + opts.word.length
2174
- );
2189
+ end = this.positionInside(index2 + opts.word.length);
2175
2190
  }
2176
2191
  } else {
2177
2192
  if (opts.start) {
2178
2193
  start = {
2179
2194
  column: opts.start.column,
2180
- line: opts.start.line
2195
+ line: opts.start.line,
2196
+ offset: sourceOffset(inputString, opts.start)
2181
2197
  };
2182
2198
  } else if (opts.index) {
2183
2199
  start = this.positionInside(opts.index);
@@ -2185,7 +2201,8 @@ function requireNode$1() {
2185
2201
  if (opts.end) {
2186
2202
  end = {
2187
2203
  column: opts.end.column,
2188
- line: opts.end.line
2204
+ line: opts.end.line,
2205
+ offset: sourceOffset(inputString, opts.end)
2189
2206
  };
2190
2207
  } else if (typeof opts.endIndex === "number") {
2191
2208
  end = this.positionInside(opts.endIndex);
@@ -2194,7 +2211,11 @@ function requireNode$1() {
2194
2211
  }
2195
2212
  }
2196
2213
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
2197
- end = { column: start.column + 1, line: start.line };
2214
+ end = {
2215
+ column: start.column + 1,
2216
+ line: start.line,
2217
+ offset: start.offset + 1
2218
+ };
2198
2219
  }
2199
2220
  return { end, start };
2200
2221
  }
@@ -2258,6 +2279,7 @@ function requireNode$1() {
2258
2279
  } else if (typeof value === "object" && value.toJSON) {
2259
2280
  fixed[name] = value.toJSON(null, inputs);
2260
2281
  } else if (name === "source") {
2282
+ if (value == null) continue;
2261
2283
  let inputId = inputs.get(value.input);
2262
2284
  if (inputId == null) {
2263
2285
  inputId = inputsNextIndex;
@@ -2292,14 +2314,11 @@ function requireNode$1() {
2292
2314
  });
2293
2315
  return result2;
2294
2316
  }
2295
- warn(result2, text, opts) {
2317
+ warn(result2, text, opts = {}) {
2296
2318
  let data = { node: this };
2297
2319
  for (let i2 in opts) data[i2] = opts[i2];
2298
2320
  return result2.warn(text, data);
2299
2321
  }
2300
- get proxyOf() {
2301
- return this;
2302
- }
2303
2322
  }
2304
2323
  node$1 = Node2;
2305
2324
  Node2.default = Node2;
@@ -2328,6 +2347,9 @@ function requireDeclaration$1() {
2328
2347
  hasRequiredDeclaration$1 = 1;
2329
2348
  let Node2 = requireNode$1();
2330
2349
  class Declaration extends Node2 {
2350
+ get variable() {
2351
+ return this.prop.startsWith("--") || this.prop[0] === "$";
2352
+ }
2331
2353
  constructor(defaults) {
2332
2354
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2333
2355
  defaults = { ...defaults, value: String(defaults.value) };
@@ -2335,9 +2357,6 @@ function requireDeclaration$1() {
2335
2357
  super(defaults);
2336
2358
  this.type = "decl";
2337
2359
  }
2338
- get variable() {
2339
- return this.prop.startsWith("--") || this.prop[0] === "$";
2340
- }
2341
2360
  }
2342
2361
  declaration$1 = Declaration;
2343
2362
  Declaration.default = Declaration;
@@ -2369,6 +2388,14 @@ function requireContainer$1() {
2369
2388
  }
2370
2389
  }
2371
2390
  class Container extends Node2 {
2391
+ get first() {
2392
+ if (!this.proxyOf.nodes) return void 0;
2393
+ return this.proxyOf.nodes[0];
2394
+ }
2395
+ get last() {
2396
+ if (!this.proxyOf.nodes) return void 0;
2397
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2398
+ }
2372
2399
  append(...children) {
2373
2400
  for (let child of children) {
2374
2401
  let nodes = this.normalize(child, this.last);
@@ -2681,14 +2708,6 @@ function requireContainer$1() {
2681
2708
  }
2682
2709
  });
2683
2710
  }
2684
- get first() {
2685
- if (!this.proxyOf.nodes) return void 0;
2686
- return this.proxyOf.nodes[0];
2687
- }
2688
- get last() {
2689
- if (!this.proxyOf.nodes) return void 0;
2690
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2691
- }
2692
2711
  }
2693
2712
  Container.registerParse = (dependant) => {
2694
2713
  parse = dependant;
@@ -2938,10 +2957,25 @@ function requireInput$1() {
2938
2957
  let CssSyntaxError = requireCssSyntaxError$1();
2939
2958
  let PreviousMap = requirePreviousMap$1();
2940
2959
  let terminalHighlight = require$$2$1;
2941
- let fromOffsetCache = Symbol("fromOffsetCache");
2960
+ let lineToIndexCache = Symbol("lineToIndexCache");
2942
2961
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
2943
2962
  let pathAvailable = Boolean(resolve && isAbsolute);
2963
+ function getLineToIndex(input2) {
2964
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
2965
+ let lines = input2.css.split("\n");
2966
+ let lineToIndex = new Array(lines.length);
2967
+ let prevIndex = 0;
2968
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2969
+ lineToIndex[i2] = prevIndex;
2970
+ prevIndex += lines[i2].length + 1;
2971
+ }
2972
+ input2[lineToIndexCache] = lineToIndex;
2973
+ return lineToIndex;
2974
+ }
2944
2975
  class Input {
2976
+ get from() {
2977
+ return this.file || this.id;
2978
+ }
2945
2979
  constructor(css, opts = {}) {
2946
2980
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
2947
2981
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -2976,30 +3010,37 @@ function requireInput$1() {
2976
3010
  if (this.map) this.map.file = this.from;
2977
3011
  }
2978
3012
  error(message, line, column, opts = {}) {
2979
- let endColumn, endLine, result2;
3013
+ let endColumn, endLine, endOffset, offset, result2;
2980
3014
  if (line && typeof line === "object") {
2981
3015
  let start = line;
2982
3016
  let end = column;
2983
3017
  if (typeof start.offset === "number") {
2984
- let pos = this.fromOffset(start.offset);
3018
+ offset = start.offset;
3019
+ let pos = this.fromOffset(offset);
2985
3020
  line = pos.line;
2986
3021
  column = pos.col;
2987
3022
  } else {
2988
3023
  line = start.line;
2989
3024
  column = start.column;
3025
+ offset = this.fromLineAndColumn(line, column);
2990
3026
  }
2991
3027
  if (typeof end.offset === "number") {
2992
- let pos = this.fromOffset(end.offset);
3028
+ endOffset = end.offset;
3029
+ let pos = this.fromOffset(endOffset);
2993
3030
  endLine = pos.line;
2994
3031
  endColumn = pos.col;
2995
3032
  } else {
2996
3033
  endLine = end.line;
2997
3034
  endColumn = end.column;
3035
+ endOffset = this.fromLineAndColumn(end.line, end.column);
2998
3036
  }
2999
3037
  } else if (!column) {
3000
- let pos = this.fromOffset(line);
3038
+ offset = line;
3039
+ let pos = this.fromOffset(offset);
3001
3040
  line = pos.line;
3002
3041
  column = pos.col;
3042
+ } else {
3043
+ offset = this.fromLineAndColumn(line, column);
3003
3044
  }
3004
3045
  let origin = this.origin(line, column, endLine, endColumn);
3005
3046
  if (origin) {
@@ -3021,7 +3062,7 @@ function requireInput$1() {
3021
3062
  opts.plugin
3022
3063
  );
3023
3064
  }
3024
- result2.input = { column, endColumn, endLine, line, source: this.css };
3065
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
3025
3066
  if (this.file) {
3026
3067
  if (pathToFileURL) {
3027
3068
  result2.input.url = pathToFileURL(this.file).toString();
@@ -3030,21 +3071,14 @@ function requireInput$1() {
3030
3071
  }
3031
3072
  return result2;
3032
3073
  }
3074
+ fromLineAndColumn(line, column) {
3075
+ let lineToIndex = getLineToIndex(this);
3076
+ let index2 = lineToIndex[line - 1];
3077
+ return index2 + column - 1;
3078
+ }
3033
3079
  fromOffset(offset) {
3034
- let lastLine, lineToIndex;
3035
- if (!this[fromOffsetCache]) {
3036
- let lines = this.css.split("\n");
3037
- lineToIndex = new Array(lines.length);
3038
- let prevIndex = 0;
3039
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
3040
- lineToIndex[i2] = prevIndex;
3041
- prevIndex += lines[i2].length + 1;
3042
- }
3043
- this[fromOffsetCache] = lineToIndex;
3044
- } else {
3045
- lineToIndex = this[fromOffsetCache];
3046
- }
3047
- lastLine = lineToIndex[lineToIndex.length - 1];
3080
+ let lineToIndex = getLineToIndex(this);
3081
+ let lastLine = lineToIndex[lineToIndex.length - 1];
3048
3082
  let min = 0;
3049
3083
  if (offset >= lastLine) {
3050
3084
  min = lineToIndex.length - 1;
@@ -3125,9 +3159,6 @@ function requireInput$1() {
3125
3159
  }
3126
3160
  return json;
3127
3161
  }
3128
- get from() {
3129
- return this.file || this.id;
3130
- }
3131
3162
  }
3132
3163
  input$1 = Input;
3133
3164
  Input.default = Input;
@@ -3253,11 +3284,6 @@ function requireRule$1() {
3253
3284
  let Container = requireContainer$1();
3254
3285
  let list = requireList$1();
3255
3286
  class Rule extends Container {
3256
- constructor(defaults) {
3257
- super(defaults);
3258
- this.type = "rule";
3259
- if (!this.nodes) this.nodes = [];
3260
- }
3261
3287
  get selectors() {
3262
3288
  return list.comma(this.selector);
3263
3289
  }
@@ -3266,6 +3292,11 @@ function requireRule$1() {
3266
3292
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
3267
3293
  this.selector = values.join(sep);
3268
3294
  }
3295
+ constructor(defaults) {
3296
+ super(defaults);
3297
+ this.type = "rule";
3298
+ if (!this.nodes) this.nodes = [];
3299
+ }
3269
3300
  }
3270
3301
  rule$1 = Rule;
3271
3302
  Rule.default = Rule;
@@ -4165,6 +4196,8 @@ function requireParser$1() {
4165
4196
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
4166
4197
  prev.raws.ownSemicolon = this.spaces;
4167
4198
  this.spaces = "";
4199
+ prev.source.end = this.getPosition(token[2]);
4200
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
4168
4201
  }
4169
4202
  }
4170
4203
  }
@@ -4376,7 +4409,7 @@ function requireParser$1() {
4376
4409
  }
4377
4410
  unknownWord(tokens) {
4378
4411
  throw this.input.error(
4379
- "Unknown word",
4412
+ "Unknown word " + tokens[0][1],
4380
4413
  { offset: tokens[0][2] },
4381
4414
  { offset: tokens[0][2] + tokens[0][1].length }
4382
4415
  );
@@ -4469,12 +4502,15 @@ function requireResult$1() {
4469
4502
  hasRequiredResult$1 = 1;
4470
4503
  let Warning = requireWarning$1();
4471
4504
  class Result {
4505
+ get content() {
4506
+ return this.css;
4507
+ }
4472
4508
  constructor(processor2, root2, opts) {
4473
4509
  this.processor = processor2;
4474
4510
  this.messages = [];
4475
4511
  this.root = root2;
4476
4512
  this.opts = opts;
4477
- this.css = void 0;
4513
+ this.css = "";
4478
4514
  this.map = void 0;
4479
4515
  }
4480
4516
  toString() {
@@ -4493,9 +4529,6 @@ function requireResult$1() {
4493
4529
  warnings() {
4494
4530
  return this.messages.filter((i2) => i2.type === "warning");
4495
4531
  }
4496
- get content() {
4497
- return this.css;
4498
- }
4499
4532
  }
4500
4533
  result$1 = Result;
4501
4534
  Result.default = Result;
@@ -4614,6 +4647,30 @@ function requireLazyResult$1() {
4614
4647
  }
4615
4648
  let postcss2 = {};
4616
4649
  class LazyResult {
4650
+ get content() {
4651
+ return this.stringify().content;
4652
+ }
4653
+ get css() {
4654
+ return this.stringify().css;
4655
+ }
4656
+ get map() {
4657
+ return this.stringify().map;
4658
+ }
4659
+ get messages() {
4660
+ return this.sync().messages;
4661
+ }
4662
+ get opts() {
4663
+ return this.result.opts;
4664
+ }
4665
+ get processor() {
4666
+ return this.result.processor;
4667
+ }
4668
+ get root() {
4669
+ return this.sync().root;
4670
+ }
4671
+ get [Symbol.toStringTag]() {
4672
+ return "LazyResult";
4673
+ }
4617
4674
  constructor(processor2, css, opts) {
4618
4675
  this.stringified = false;
4619
4676
  this.processed = false;
@@ -4956,30 +5013,6 @@ function requireLazyResult$1() {
4956
5013
  warnings() {
4957
5014
  return this.sync().warnings();
4958
5015
  }
4959
- get content() {
4960
- return this.stringify().content;
4961
- }
4962
- get css() {
4963
- return this.stringify().css;
4964
- }
4965
- get map() {
4966
- return this.stringify().map;
4967
- }
4968
- get messages() {
4969
- return this.sync().messages;
4970
- }
4971
- get opts() {
4972
- return this.result.opts;
4973
- }
4974
- get processor() {
4975
- return this.result.processor;
4976
- }
4977
- get root() {
4978
- return this.sync().root;
4979
- }
4980
- get [Symbol.toStringTag]() {
4981
- return "LazyResult";
4982
- }
4983
5016
  }
4984
5017
  LazyResult.registerPostcss = (dependant) => {
4985
5018
  postcss2 = dependant;
@@ -5001,6 +5034,45 @@ function requireNoWorkResult$1() {
5001
5034
  let stringify = requireStringify$1();
5002
5035
  let warnOnce2 = requireWarnOnce$1();
5003
5036
  class NoWorkResult {
5037
+ get content() {
5038
+ return this.result.css;
5039
+ }
5040
+ get css() {
5041
+ return this.result.css;
5042
+ }
5043
+ get map() {
5044
+ return this.result.map;
5045
+ }
5046
+ get messages() {
5047
+ return [];
5048
+ }
5049
+ get opts() {
5050
+ return this.result.opts;
5051
+ }
5052
+ get processor() {
5053
+ return this.result.processor;
5054
+ }
5055
+ get root() {
5056
+ if (this._root) {
5057
+ return this._root;
5058
+ }
5059
+ let root2;
5060
+ let parser2 = parse;
5061
+ try {
5062
+ root2 = parser2(this._css, this._opts);
5063
+ } catch (error) {
5064
+ this.error = error;
5065
+ }
5066
+ if (this.error) {
5067
+ throw this.error;
5068
+ } else {
5069
+ this._root = root2;
5070
+ return root2;
5071
+ }
5072
+ }
5073
+ get [Symbol.toStringTag]() {
5074
+ return "NoWorkResult";
5075
+ }
5004
5076
  constructor(processor2, css, opts) {
5005
5077
  css = css.toString();
5006
5078
  this.stringified = false;
@@ -5062,45 +5134,6 @@ function requireNoWorkResult$1() {
5062
5134
  warnings() {
5063
5135
  return [];
5064
5136
  }
5065
- get content() {
5066
- return this.result.css;
5067
- }
5068
- get css() {
5069
- return this.result.css;
5070
- }
5071
- get map() {
5072
- return this.result.map;
5073
- }
5074
- get messages() {
5075
- return [];
5076
- }
5077
- get opts() {
5078
- return this.result.opts;
5079
- }
5080
- get processor() {
5081
- return this.result.processor;
5082
- }
5083
- get root() {
5084
- if (this._root) {
5085
- return this._root;
5086
- }
5087
- let root2;
5088
- let parser2 = parse;
5089
- try {
5090
- root2 = parser2(this._css, this._opts);
5091
- } catch (error) {
5092
- this.error = error;
5093
- }
5094
- if (this.error) {
5095
- throw this.error;
5096
- } else {
5097
- this._root = root2;
5098
- return root2;
5099
- }
5100
- }
5101
- get [Symbol.toStringTag]() {
5102
- return "NoWorkResult";
5103
- }
5104
5137
  }
5105
5138
  noWorkResult$1 = NoWorkResult;
5106
5139
  NoWorkResult.default = NoWorkResult;
@@ -5117,7 +5150,7 @@ function requireProcessor$1() {
5117
5150
  let Root = requireRoot$1();
5118
5151
  class Processor {
5119
5152
  constructor(plugins = []) {
5120
- this.version = "8.5.1";
5153
+ this.version = "8.5.6";
5121
5154
  this.plugins = this.normalize(plugins);
5122
5155
  }
5123
5156
  normalize(plugins) {
@@ -5573,6 +5606,12 @@ function buildNode(n2, options) {
5573
5606
  node2.style.setProperty("width", value.toString());
5574
5607
  } else if (name === "rr_height") {
5575
5608
  node2.style.setProperty("height", value.toString());
5609
+ } else if (name === "rr_left") {
5610
+ node2.style.setProperty("left", value.toString());
5611
+ node2.style.setProperty("position", "absolute");
5612
+ } else if (name === "rr_top") {
5613
+ node2.style.setProperty("top", value.toString());
5614
+ node2.style.setProperty("position", "absolute");
5576
5615
  } else if (name === "rr_mediaCurrentTime" && typeof value === "number") {
5577
5616
  node2.currentTime = value;
5578
5617
  } else if (name === "rr_mediaState") {
@@ -5832,7 +5871,7 @@ function getDefaultExportFromCjs(x) {
5832
5871
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5833
5872
  }
5834
5873
  function getAugmentedNamespace(n2) {
5835
- if (n2.__esModule) return n2;
5874
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
5836
5875
  var f2 = n2.default;
5837
5876
  if (typeof f2 == "function") {
5838
5877
  var a2 = function a3() {
@@ -6351,6 +6390,9 @@ function requireNode() {
6351
6390
  return offset;
6352
6391
  }
6353
6392
  class Node2 {
6393
+ get proxyOf() {
6394
+ return this;
6395
+ }
6354
6396
  constructor(defaults = {}) {
6355
6397
  this.raws = {};
6356
6398
  this[isClean] = false;
@@ -6469,7 +6511,7 @@ function requireNode() {
6469
6511
  let index2 = this.parent.index(this);
6470
6512
  return this.parent.nodes[index2 + 1];
6471
6513
  }
6472
- positionBy(opts) {
6514
+ positionBy(opts = {}) {
6473
6515
  let pos = this.source.start;
6474
6516
  if (opts.index) {
6475
6517
  pos = this.positionInside(opts.index);
@@ -6498,27 +6540,38 @@ function requireNode() {
6498
6540
  column += 1;
6499
6541
  }
6500
6542
  }
6501
- return { column, line };
6543
+ return { column, line, offset: end };
6502
6544
  }
6503
6545
  prev() {
6504
6546
  if (!this.parent) return void 0;
6505
6547
  let index2 = this.parent.index(this);
6506
6548
  return this.parent.nodes[index2 - 1];
6507
6549
  }
6508
- rangeBy(opts) {
6550
+ rangeBy(opts = {}) {
6551
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6509
6552
  let start = {
6510
6553
  column: this.source.start.column,
6511
- line: this.source.start.line
6554
+ line: this.source.start.line,
6555
+ offset: sourceOffset(inputString, this.source.start)
6512
6556
  };
6513
6557
  let end = this.source.end ? {
6514
6558
  column: this.source.end.column + 1,
6515
- line: this.source.end.line
6559
+ line: this.source.end.line,
6560
+ offset: typeof this.source.end.offset === "number" ? (
6561
+ // `source.end.offset` is exclusive, so we don't need to add 1
6562
+ this.source.end.offset
6563
+ ) : (
6564
+ // Since line/column in this.source.end is inclusive,
6565
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
6566
+ // So, we add 1 to convert it to exclusive.
6567
+ sourceOffset(inputString, this.source.end) + 1
6568
+ )
6516
6569
  } : {
6517
6570
  column: start.column + 1,
6518
- line: start.line
6571
+ line: start.line,
6572
+ offset: start.offset + 1
6519
6573
  };
6520
6574
  if (opts.word) {
6521
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6522
6575
  let stringRepresentation = inputString.slice(
6523
6576
  sourceOffset(inputString, this.source.start),
6524
6577
  sourceOffset(inputString, this.source.end)
@@ -6526,15 +6579,14 @@ function requireNode() {
6526
6579
  let index2 = stringRepresentation.indexOf(opts.word);
6527
6580
  if (index2 !== -1) {
6528
6581
  start = this.positionInside(index2);
6529
- end = this.positionInside(
6530
- index2 + opts.word.length
6531
- );
6582
+ end = this.positionInside(index2 + opts.word.length);
6532
6583
  }
6533
6584
  } else {
6534
6585
  if (opts.start) {
6535
6586
  start = {
6536
6587
  column: opts.start.column,
6537
- line: opts.start.line
6588
+ line: opts.start.line,
6589
+ offset: sourceOffset(inputString, opts.start)
6538
6590
  };
6539
6591
  } else if (opts.index) {
6540
6592
  start = this.positionInside(opts.index);
@@ -6542,7 +6594,8 @@ function requireNode() {
6542
6594
  if (opts.end) {
6543
6595
  end = {
6544
6596
  column: opts.end.column,
6545
- line: opts.end.line
6597
+ line: opts.end.line,
6598
+ offset: sourceOffset(inputString, opts.end)
6546
6599
  };
6547
6600
  } else if (typeof opts.endIndex === "number") {
6548
6601
  end = this.positionInside(opts.endIndex);
@@ -6551,7 +6604,11 @@ function requireNode() {
6551
6604
  }
6552
6605
  }
6553
6606
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
6554
- end = { column: start.column + 1, line: start.line };
6607
+ end = {
6608
+ column: start.column + 1,
6609
+ line: start.line,
6610
+ offset: start.offset + 1
6611
+ };
6555
6612
  }
6556
6613
  return { end, start };
6557
6614
  }
@@ -6615,6 +6672,7 @@ function requireNode() {
6615
6672
  } else if (typeof value === "object" && value.toJSON) {
6616
6673
  fixed[name] = value.toJSON(null, inputs);
6617
6674
  } else if (name === "source") {
6675
+ if (value == null) continue;
6618
6676
  let inputId = inputs.get(value.input);
6619
6677
  if (inputId == null) {
6620
6678
  inputId = inputsNextIndex;
@@ -6649,14 +6707,11 @@ function requireNode() {
6649
6707
  });
6650
6708
  return result2;
6651
6709
  }
6652
- warn(result2, text, opts) {
6710
+ warn(result2, text, opts = {}) {
6653
6711
  let data = { node: this };
6654
6712
  for (let i2 in opts) data[i2] = opts[i2];
6655
6713
  return result2.warn(text, data);
6656
6714
  }
6657
- get proxyOf() {
6658
- return this;
6659
- }
6660
6715
  }
6661
6716
  node = Node2;
6662
6717
  Node2.default = Node2;
@@ -6685,6 +6740,9 @@ function requireDeclaration() {
6685
6740
  hasRequiredDeclaration = 1;
6686
6741
  let Node2 = requireNode();
6687
6742
  class Declaration extends Node2 {
6743
+ get variable() {
6744
+ return this.prop.startsWith("--") || this.prop[0] === "$";
6745
+ }
6688
6746
  constructor(defaults) {
6689
6747
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6690
6748
  defaults = { ...defaults, value: String(defaults.value) };
@@ -6692,9 +6750,6 @@ function requireDeclaration() {
6692
6750
  super(defaults);
6693
6751
  this.type = "decl";
6694
6752
  }
6695
- get variable() {
6696
- return this.prop.startsWith("--") || this.prop[0] === "$";
6697
- }
6698
6753
  }
6699
6754
  declaration = Declaration;
6700
6755
  Declaration.default = Declaration;
@@ -6726,6 +6781,14 @@ function requireContainer() {
6726
6781
  }
6727
6782
  }
6728
6783
  class Container extends Node2 {
6784
+ get first() {
6785
+ if (!this.proxyOf.nodes) return void 0;
6786
+ return this.proxyOf.nodes[0];
6787
+ }
6788
+ get last() {
6789
+ if (!this.proxyOf.nodes) return void 0;
6790
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6791
+ }
6729
6792
  append(...children) {
6730
6793
  for (let child of children) {
6731
6794
  let nodes = this.normalize(child, this.last);
@@ -7038,14 +7101,6 @@ function requireContainer() {
7038
7101
  }
7039
7102
  });
7040
7103
  }
7041
- get first() {
7042
- if (!this.proxyOf.nodes) return void 0;
7043
- return this.proxyOf.nodes[0];
7044
- }
7045
- get last() {
7046
- if (!this.proxyOf.nodes) return void 0;
7047
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
7048
- }
7049
7104
  }
7050
7105
  Container.registerParse = (dependant) => {
7051
7106
  parse = dependant;
@@ -7295,10 +7350,25 @@ function requireInput() {
7295
7350
  let CssSyntaxError = requireCssSyntaxError();
7296
7351
  let PreviousMap = requirePreviousMap();
7297
7352
  let terminalHighlight = require$$2;
7298
- let fromOffsetCache = Symbol("fromOffsetCache");
7353
+ let lineToIndexCache = Symbol("lineToIndexCache");
7299
7354
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
7300
7355
  let pathAvailable = Boolean(resolve && isAbsolute);
7356
+ function getLineToIndex(input2) {
7357
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
7358
+ let lines = input2.css.split("\n");
7359
+ let lineToIndex = new Array(lines.length);
7360
+ let prevIndex = 0;
7361
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
7362
+ lineToIndex[i2] = prevIndex;
7363
+ prevIndex += lines[i2].length + 1;
7364
+ }
7365
+ input2[lineToIndexCache] = lineToIndex;
7366
+ return lineToIndex;
7367
+ }
7301
7368
  class Input {
7369
+ get from() {
7370
+ return this.file || this.id;
7371
+ }
7302
7372
  constructor(css, opts = {}) {
7303
7373
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
7304
7374
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -7333,30 +7403,37 @@ function requireInput() {
7333
7403
  if (this.map) this.map.file = this.from;
7334
7404
  }
7335
7405
  error(message, line, column, opts = {}) {
7336
- let endColumn, endLine, result2;
7406
+ let endColumn, endLine, endOffset, offset, result2;
7337
7407
  if (line && typeof line === "object") {
7338
7408
  let start = line;
7339
7409
  let end = column;
7340
7410
  if (typeof start.offset === "number") {
7341
- let pos = this.fromOffset(start.offset);
7411
+ offset = start.offset;
7412
+ let pos = this.fromOffset(offset);
7342
7413
  line = pos.line;
7343
7414
  column = pos.col;
7344
7415
  } else {
7345
7416
  line = start.line;
7346
7417
  column = start.column;
7418
+ offset = this.fromLineAndColumn(line, column);
7347
7419
  }
7348
7420
  if (typeof end.offset === "number") {
7349
- let pos = this.fromOffset(end.offset);
7421
+ endOffset = end.offset;
7422
+ let pos = this.fromOffset(endOffset);
7350
7423
  endLine = pos.line;
7351
7424
  endColumn = pos.col;
7352
7425
  } else {
7353
7426
  endLine = end.line;
7354
7427
  endColumn = end.column;
7428
+ endOffset = this.fromLineAndColumn(end.line, end.column);
7355
7429
  }
7356
7430
  } else if (!column) {
7357
- let pos = this.fromOffset(line);
7431
+ offset = line;
7432
+ let pos = this.fromOffset(offset);
7358
7433
  line = pos.line;
7359
7434
  column = pos.col;
7435
+ } else {
7436
+ offset = this.fromLineAndColumn(line, column);
7360
7437
  }
7361
7438
  let origin = this.origin(line, column, endLine, endColumn);
7362
7439
  if (origin) {
@@ -7378,7 +7455,7 @@ function requireInput() {
7378
7455
  opts.plugin
7379
7456
  );
7380
7457
  }
7381
- result2.input = { column, endColumn, endLine, line, source: this.css };
7458
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
7382
7459
  if (this.file) {
7383
7460
  if (pathToFileURL) {
7384
7461
  result2.input.url = pathToFileURL(this.file).toString();
@@ -7387,21 +7464,14 @@ function requireInput() {
7387
7464
  }
7388
7465
  return result2;
7389
7466
  }
7467
+ fromLineAndColumn(line, column) {
7468
+ let lineToIndex = getLineToIndex(this);
7469
+ let index2 = lineToIndex[line - 1];
7470
+ return index2 + column - 1;
7471
+ }
7390
7472
  fromOffset(offset) {
7391
- let lastLine, lineToIndex;
7392
- if (!this[fromOffsetCache]) {
7393
- let lines = this.css.split("\n");
7394
- lineToIndex = new Array(lines.length);
7395
- let prevIndex = 0;
7396
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
7397
- lineToIndex[i2] = prevIndex;
7398
- prevIndex += lines[i2].length + 1;
7399
- }
7400
- this[fromOffsetCache] = lineToIndex;
7401
- } else {
7402
- lineToIndex = this[fromOffsetCache];
7403
- }
7404
- lastLine = lineToIndex[lineToIndex.length - 1];
7473
+ let lineToIndex = getLineToIndex(this);
7474
+ let lastLine = lineToIndex[lineToIndex.length - 1];
7405
7475
  let min = 0;
7406
7476
  if (offset >= lastLine) {
7407
7477
  min = lineToIndex.length - 1;
@@ -7482,9 +7552,6 @@ function requireInput() {
7482
7552
  }
7483
7553
  return json;
7484
7554
  }
7485
- get from() {
7486
- return this.file || this.id;
7487
- }
7488
7555
  }
7489
7556
  input = Input;
7490
7557
  Input.default = Input;
@@ -7610,11 +7677,6 @@ function requireRule() {
7610
7677
  let Container = requireContainer();
7611
7678
  let list = requireList();
7612
7679
  class Rule extends Container {
7613
- constructor(defaults) {
7614
- super(defaults);
7615
- this.type = "rule";
7616
- if (!this.nodes) this.nodes = [];
7617
- }
7618
7680
  get selectors() {
7619
7681
  return list.comma(this.selector);
7620
7682
  }
@@ -7623,6 +7685,11 @@ function requireRule() {
7623
7685
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
7624
7686
  this.selector = values.join(sep);
7625
7687
  }
7688
+ constructor(defaults) {
7689
+ super(defaults);
7690
+ this.type = "rule";
7691
+ if (!this.nodes) this.nodes = [];
7692
+ }
7626
7693
  }
7627
7694
  rule = Rule;
7628
7695
  Rule.default = Rule;
@@ -8522,6 +8589,8 @@ function requireParser() {
8522
8589
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
8523
8590
  prev.raws.ownSemicolon = this.spaces;
8524
8591
  this.spaces = "";
8592
+ prev.source.end = this.getPosition(token[2]);
8593
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
8525
8594
  }
8526
8595
  }
8527
8596
  }
@@ -8733,7 +8802,7 @@ function requireParser() {
8733
8802
  }
8734
8803
  unknownWord(tokens) {
8735
8804
  throw this.input.error(
8736
- "Unknown word",
8805
+ "Unknown word " + tokens[0][1],
8737
8806
  { offset: tokens[0][2] },
8738
8807
  { offset: tokens[0][2] + tokens[0][1].length }
8739
8808
  );
@@ -8826,12 +8895,15 @@ function requireResult() {
8826
8895
  hasRequiredResult = 1;
8827
8896
  let Warning = requireWarning();
8828
8897
  class Result {
8898
+ get content() {
8899
+ return this.css;
8900
+ }
8829
8901
  constructor(processor2, root2, opts) {
8830
8902
  this.processor = processor2;
8831
8903
  this.messages = [];
8832
8904
  this.root = root2;
8833
8905
  this.opts = opts;
8834
- this.css = void 0;
8906
+ this.css = "";
8835
8907
  this.map = void 0;
8836
8908
  }
8837
8909
  toString() {
@@ -8850,9 +8922,6 @@ function requireResult() {
8850
8922
  warnings() {
8851
8923
  return this.messages.filter((i2) => i2.type === "warning");
8852
8924
  }
8853
- get content() {
8854
- return this.css;
8855
- }
8856
8925
  }
8857
8926
  result = Result;
8858
8927
  Result.default = Result;
@@ -8971,6 +9040,30 @@ function requireLazyResult() {
8971
9040
  }
8972
9041
  let postcss2 = {};
8973
9042
  class LazyResult {
9043
+ get content() {
9044
+ return this.stringify().content;
9045
+ }
9046
+ get css() {
9047
+ return this.stringify().css;
9048
+ }
9049
+ get map() {
9050
+ return this.stringify().map;
9051
+ }
9052
+ get messages() {
9053
+ return this.sync().messages;
9054
+ }
9055
+ get opts() {
9056
+ return this.result.opts;
9057
+ }
9058
+ get processor() {
9059
+ return this.result.processor;
9060
+ }
9061
+ get root() {
9062
+ return this.sync().root;
9063
+ }
9064
+ get [Symbol.toStringTag]() {
9065
+ return "LazyResult";
9066
+ }
8974
9067
  constructor(processor2, css, opts) {
8975
9068
  this.stringified = false;
8976
9069
  this.processed = false;
@@ -9313,30 +9406,6 @@ function requireLazyResult() {
9313
9406
  warnings() {
9314
9407
  return this.sync().warnings();
9315
9408
  }
9316
- get content() {
9317
- return this.stringify().content;
9318
- }
9319
- get css() {
9320
- return this.stringify().css;
9321
- }
9322
- get map() {
9323
- return this.stringify().map;
9324
- }
9325
- get messages() {
9326
- return this.sync().messages;
9327
- }
9328
- get opts() {
9329
- return this.result.opts;
9330
- }
9331
- get processor() {
9332
- return this.result.processor;
9333
- }
9334
- get root() {
9335
- return this.sync().root;
9336
- }
9337
- get [Symbol.toStringTag]() {
9338
- return "LazyResult";
9339
- }
9340
9409
  }
9341
9410
  LazyResult.registerPostcss = (dependant) => {
9342
9411
  postcss2 = dependant;
@@ -9358,6 +9427,45 @@ function requireNoWorkResult() {
9358
9427
  let stringify = requireStringify();
9359
9428
  let warnOnce2 = requireWarnOnce();
9360
9429
  class NoWorkResult {
9430
+ get content() {
9431
+ return this.result.css;
9432
+ }
9433
+ get css() {
9434
+ return this.result.css;
9435
+ }
9436
+ get map() {
9437
+ return this.result.map;
9438
+ }
9439
+ get messages() {
9440
+ return [];
9441
+ }
9442
+ get opts() {
9443
+ return this.result.opts;
9444
+ }
9445
+ get processor() {
9446
+ return this.result.processor;
9447
+ }
9448
+ get root() {
9449
+ if (this._root) {
9450
+ return this._root;
9451
+ }
9452
+ let root2;
9453
+ let parser2 = parse;
9454
+ try {
9455
+ root2 = parser2(this._css, this._opts);
9456
+ } catch (error) {
9457
+ this.error = error;
9458
+ }
9459
+ if (this.error) {
9460
+ throw this.error;
9461
+ } else {
9462
+ this._root = root2;
9463
+ return root2;
9464
+ }
9465
+ }
9466
+ get [Symbol.toStringTag]() {
9467
+ return "NoWorkResult";
9468
+ }
9361
9469
  constructor(processor2, css, opts) {
9362
9470
  css = css.toString();
9363
9471
  this.stringified = false;
@@ -9419,45 +9527,6 @@ function requireNoWorkResult() {
9419
9527
  warnings() {
9420
9528
  return [];
9421
9529
  }
9422
- get content() {
9423
- return this.result.css;
9424
- }
9425
- get css() {
9426
- return this.result.css;
9427
- }
9428
- get map() {
9429
- return this.result.map;
9430
- }
9431
- get messages() {
9432
- return [];
9433
- }
9434
- get opts() {
9435
- return this.result.opts;
9436
- }
9437
- get processor() {
9438
- return this.result.processor;
9439
- }
9440
- get root() {
9441
- if (this._root) {
9442
- return this._root;
9443
- }
9444
- let root2;
9445
- let parser2 = parse;
9446
- try {
9447
- root2 = parser2(this._css, this._opts);
9448
- } catch (error) {
9449
- this.error = error;
9450
- }
9451
- if (this.error) {
9452
- throw this.error;
9453
- } else {
9454
- this._root = root2;
9455
- return root2;
9456
- }
9457
- }
9458
- get [Symbol.toStringTag]() {
9459
- return "NoWorkResult";
9460
- }
9461
9530
  }
9462
9531
  noWorkResult = NoWorkResult;
9463
9532
  NoWorkResult.default = NoWorkResult;
@@ -9474,7 +9543,7 @@ function requireProcessor() {
9474
9543
  let Root = requireRoot();
9475
9544
  class Processor {
9476
9545
  constructor(plugins = []) {
9477
- this.version = "8.5.1";
9546
+ this.version = "8.5.6";
9478
9547
  this.plugins = this.normalize(plugins);
9479
9548
  }
9480
9549
  normalize(plugins) {
@@ -12276,7 +12345,7 @@ const callbackWrapper = (cb) => {
12276
12345
  if (!errorHandler) {
12277
12346
  return cb;
12278
12347
  }
12279
- const rrwebWrapped = (...rest) => {
12348
+ const rrwebWrapped = ((...rest) => {
12280
12349
  try {
12281
12350
  return cb(...rest);
12282
12351
  } catch (error) {
@@ -12285,7 +12354,7 @@ const callbackWrapper = (cb) => {
12285
12354
  }
12286
12355
  throw error;
12287
12356
  }
12288
- };
12357
+ });
12289
12358
  return rrwebWrapped;
12290
12359
  };
12291
12360
  const mutationBuffers = [];
@@ -13043,7 +13112,11 @@ function initFontObserver({ fontCb, doc }) {
13043
13112
  const fontMap = /* @__PURE__ */ new WeakMap();
13044
13113
  const originalFontFace = win.FontFace;
13045
13114
  win.FontFace = function FontFace2(family, source, descriptors) {
13046
- const fontFace = new originalFontFace(family, source, descriptors);
13115
+ const fontFace = new originalFontFace(
13116
+ family,
13117
+ source,
13118
+ descriptors
13119
+ );
13047
13120
  fontMap.set(fontFace, {
13048
13121
  family,
13049
13122
  buffer: typeof source !== "string",
@@ -13379,6 +13452,7 @@ class IframeManager {
13379
13452
  __publicField(this, "messageHandler");
13380
13453
  // Map window to handler for cleanup - windows are browser-owned and won't prevent GC
13381
13454
  __publicField(this, "nestedIframeListeners", /* @__PURE__ */ new Map());
13455
+ __publicField(this, "attachedIframes", /* @__PURE__ */ new Map());
13382
13456
  this.mutationCb = options.mutationCb;
13383
13457
  this.wrappedEmit = options.wrappedEmit;
13384
13458
  this.stylesheetManager = options.stylesheetManager;
@@ -13405,12 +13479,18 @@ class IframeManager {
13405
13479
  removeLoadListener() {
13406
13480
  this.loadListener = void 0;
13407
13481
  }
13482
+ trackIframeContent(iframeEl, content) {
13483
+ const iframeId = this.mirror.getId(iframeEl);
13484
+ this.attachedIframes.set(iframeId, { element: iframeEl, content });
13485
+ return iframeId;
13486
+ }
13408
13487
  attachIframe(iframeEl, childSn) {
13409
13488
  var _a2;
13489
+ const iframeId = this.trackIframeContent(iframeEl, childSn);
13410
13490
  this.mutationCb({
13411
13491
  adds: [
13412
13492
  {
13413
- parentId: this.mirror.getId(iframeEl),
13493
+ parentId: iframeId,
13414
13494
  nextId: null,
13415
13495
  node: childSn
13416
13496
  }
@@ -13462,6 +13542,7 @@ class IframeManager {
13462
13542
  const rootId = e2.data.node.id;
13463
13543
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
13464
13544
  this.patchRootIdOnNode(e2.data.node, rootId);
13545
+ this.trackIframeContent(iframeEl, e2.data.node);
13465
13546
  return {
13466
13547
  timestamp: e2.timestamp,
13467
13548
  type: EventType.IncrementalSnapshot,
@@ -13604,6 +13685,38 @@ class IframeManager {
13604
13685
  });
13605
13686
  }
13606
13687
  }
13688
+ removeIframeById(iframeId) {
13689
+ const entry = this.attachedIframes.get(iframeId);
13690
+ if (!entry) return;
13691
+ const win = entry.element.contentWindow;
13692
+ if (win && this.nestedIframeListeners.has(win)) {
13693
+ const handler = this.nestedIframeListeners.get(win);
13694
+ win.removeEventListener("message", handler);
13695
+ this.nestedIframeListeners.delete(win);
13696
+ }
13697
+ this.attachedIframes.delete(iframeId);
13698
+ }
13699
+ reattachIframes() {
13700
+ this.attachedIframes.forEach(({ content }, iframeId) => {
13701
+ if (!this.mirror.has(iframeId)) {
13702
+ this.attachedIframes.delete(iframeId);
13703
+ return;
13704
+ }
13705
+ this.mutationCb({
13706
+ adds: [
13707
+ {
13708
+ parentId: iframeId,
13709
+ nextId: null,
13710
+ node: content
13711
+ }
13712
+ ],
13713
+ removes: [],
13714
+ texts: [],
13715
+ attributes: [],
13716
+ isAttachIframe: true
13717
+ });
13718
+ });
13719
+ }
13607
13720
  destroy() {
13608
13721
  if (this.recordCrossOriginIframes) {
13609
13722
  window.removeEventListener("message", this.messageHandler);
@@ -13614,6 +13727,7 @@ class IframeManager {
13614
13727
  this.nestedIframeListeners.clear();
13615
13728
  this.crossOriginIframeMirror.reset();
13616
13729
  this.crossOriginIframeStyleMirror.reset();
13730
+ this.attachedIframes.clear();
13617
13731
  }
13618
13732
  }
13619
13733
  class ShadowDomManager {
@@ -14566,6 +14680,11 @@ function record(options = {}) {
14566
14680
  }
14567
14681
  };
14568
14682
  const wrappedMutationEmit = (m) => {
14683
+ if (recordCrossOriginIframes && m.removes) {
14684
+ m.removes.forEach(({ id }) => {
14685
+ iframeManager.removeIframeById(id);
14686
+ });
14687
+ }
14569
14688
  wrappedEmit({
14570
14689
  type: EventType.IncrementalSnapshot,
14571
14690
  data: {
@@ -14716,6 +14835,9 @@ function record(options = {}) {
14716
14835
  isCheckout
14717
14836
  );
14718
14837
  mutationBuffers.forEach((buf) => buf.unlock());
14838
+ if (recordCrossOriginIframes) {
14839
+ iframeManager.reattachIframes();
14840
+ }
14719
14841
  if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
14720
14842
  stylesheetManager.adoptStyleSheets(
14721
14843
  document.adoptedStyleSheets,
@@ -15281,9 +15403,9 @@ function t(t2, n2) {
15281
15403
  return a2;
15282
15404
  }
15283
15405
  var n;
15284
- !function(t2) {
15406
+ !(function(t2) {
15285
15407
  t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
15286
- }(n || (n = {}));
15408
+ })(n || (n = {}));
15287
15409
  var e = { type: "xstate.init" };
15288
15410
  function r(t2) {
15289
15411
  return void 0 === t2 ? [] : [].concat(t2);
@@ -15307,45 +15429,45 @@ function c(t2, n2) {
15307
15429
  }
15308
15430
  function f(t2, n2, e2) {
15309
15431
  var r2 = n2, o2 = false;
15310
- return [t2.filter(function(t3) {
15432
+ return [t2.filter((function(t3) {
15311
15433
  if ("xstate.assign" === t3.type) {
15312
15434
  o2 = true;
15313
15435
  var n3 = Object.assign({}, r2);
15314
- return "function" == typeof t3.assignment ? n3 = t3.assignment(r2, e2) : Object.keys(t3.assignment).forEach(function(o3) {
15436
+ return "function" == typeof t3.assignment ? n3 = t3.assignment(r2, e2) : Object.keys(t3.assignment).forEach((function(o3) {
15315
15437
  n3[o3] = "function" == typeof t3.assignment[o3] ? t3.assignment[o3](r2, e2) : t3.assignment[o3];
15316
- }), r2 = n3, false;
15438
+ })), r2 = n3, false;
15317
15439
  }
15318
15440
  return true;
15319
- }), r2, o2];
15441
+ })), r2, o2];
15320
15442
  }
15321
15443
  function s(n2, o2) {
15322
15444
  void 0 === o2 && (o2 = {});
15323
- var s2 = t(f(r(n2.states[n2.initial].entry).map(function(t2) {
15445
+ var s2 = t(f(r(n2.states[n2.initial].entry).map((function(t2) {
15324
15446
  return i(t2, o2.actions);
15325
- }), n2.context, e), 2), l2 = s2[0], v2 = s2[1], y = { config: n2, _options: o2, initialState: { value: n2.initial, actions: l2, context: v2, matches: a(n2.initial) }, transition: function(e2, o3) {
15447
+ })), n2.context, e), 2), l2 = s2[0], v2 = s2[1], y = { config: n2, _options: o2, initialState: { value: n2.initial, actions: l2, context: v2, matches: a(n2.initial) }, transition: function(e2, o3) {
15326
15448
  var s3, l3, v3 = "string" == typeof e2 ? { value: e2, context: n2.context } : e2, p = v3.value, g = v3.context, d = u(o3), x = n2.states[p];
15327
15449
  if (x.on) {
15328
15450
  var m = r(x.on[d.type]);
15329
15451
  try {
15330
- for (var h = function(t2) {
15452
+ for (var h = (function(t2) {
15331
15453
  var n3 = "function" == typeof Symbol && Symbol.iterator, e3 = n3 && t2[n3], r2 = 0;
15332
15454
  if (e3) return e3.call(t2);
15333
15455
  if (t2 && "number" == typeof t2.length) return { next: function() {
15334
15456
  return t2 && r2 >= t2.length && (t2 = void 0), { value: t2 && t2[r2++], done: !t2 };
15335
15457
  } };
15336
15458
  throw new TypeError(n3 ? "Object is not iterable." : "Symbol.iterator is not defined.");
15337
- }(m), b = h.next(); !b.done; b = h.next()) {
15459
+ })(m), b = h.next(); !b.done; b = h.next()) {
15338
15460
  var S = b.value;
15339
15461
  if (void 0 === S) return c(p, g);
15340
15462
  var w = "string" == typeof S ? { target: S } : S, j = w.target, E = w.actions, R = void 0 === E ? [] : E, N = w.cond, O = void 0 === N ? function() {
15341
15463
  return true;
15342
15464
  } : N, _ = void 0 === j, k = null != j ? j : p, T = n2.states[k];
15343
15465
  if (O(g, d)) {
15344
- var q = t(f((_ ? r(R) : [].concat(x.exit, R, T.entry).filter(function(t2) {
15466
+ var q = t(f((_ ? r(R) : [].concat(x.exit, R, T.entry).filter((function(t2) {
15345
15467
  return t2;
15346
- })).map(function(t2) {
15468
+ }))).map((function(t2) {
15347
15469
  return i(t2, y._options.actions);
15348
- }), g, d), 3), z = q[0], A = q[1], B = q[2], C = null != j ? j : p;
15470
+ })), g, d), 3), z = q[0], A = q[1], B = q[2], C = null != j ? j : p;
15349
15471
  return { value: C, context: A, actions: z, changed: j !== p || z.length > 0 || B, matches: a(C) };
15350
15472
  }
15351
15473
  }
@@ -15364,16 +15486,16 @@ function s(n2, o2) {
15364
15486
  return y;
15365
15487
  }
15366
15488
  var l = function(t2, n2) {
15367
- return t2.actions.forEach(function(e2) {
15489
+ return t2.actions.forEach((function(e2) {
15368
15490
  var r2 = e2.exec;
15369
15491
  return r2 && r2(t2.context, n2);
15370
- });
15492
+ }));
15371
15493
  };
15372
15494
  function v(t2) {
15373
15495
  var r2 = t2.initialState, o2 = n.NotStarted, i2 = /* @__PURE__ */ new Set(), c2 = { _machine: t2, send: function(e2) {
15374
- o2 === n.Running && (r2 = t2.transition(r2, e2), l(r2, u(e2)), i2.forEach(function(t3) {
15496
+ o2 === n.Running && (r2 = t2.transition(r2, e2), l(r2, u(e2)), i2.forEach((function(t3) {
15375
15497
  return t3(r2);
15376
- }));
15498
+ })));
15377
15499
  }, subscribe: function(t3) {
15378
15500
  return i2.add(t3), t3(r2), { unsubscribe: function() {
15379
15501
  return i2.delete(t3);