@posthog/rrweb-record 0.0.34 → 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.
@@ -1430,7 +1430,7 @@ function getDefaultExportFromCjs$1(x) {
1430
1430
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1431
1431
  }
1432
1432
  function getAugmentedNamespace$1(n2) {
1433
- if (n2.__esModule) return n2;
1433
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
1434
1434
  var f2 = n2.default;
1435
1435
  if (typeof f2 == "function") {
1436
1436
  var a2 = function a3() {
@@ -1949,6 +1949,9 @@ function requireNode$1() {
1949
1949
  return offset;
1950
1950
  }
1951
1951
  class Node2 {
1952
+ get proxyOf() {
1953
+ return this;
1954
+ }
1952
1955
  constructor(defaults = {}) {
1953
1956
  this.raws = {};
1954
1957
  this[isClean] = false;
@@ -2067,7 +2070,7 @@ function requireNode$1() {
2067
2070
  let index2 = this.parent.index(this);
2068
2071
  return this.parent.nodes[index2 + 1];
2069
2072
  }
2070
- positionBy(opts) {
2073
+ positionBy(opts = {}) {
2071
2074
  let pos = this.source.start;
2072
2075
  if (opts.index) {
2073
2076
  pos = this.positionInside(opts.index);
@@ -2096,27 +2099,38 @@ function requireNode$1() {
2096
2099
  column += 1;
2097
2100
  }
2098
2101
  }
2099
- return { column, line };
2102
+ return { column, line, offset: end };
2100
2103
  }
2101
2104
  prev() {
2102
2105
  if (!this.parent) return void 0;
2103
2106
  let index2 = this.parent.index(this);
2104
2107
  return this.parent.nodes[index2 - 1];
2105
2108
  }
2106
- rangeBy(opts) {
2109
+ rangeBy(opts = {}) {
2110
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2107
2111
  let start = {
2108
2112
  column: this.source.start.column,
2109
- line: this.source.start.line
2113
+ line: this.source.start.line,
2114
+ offset: sourceOffset(inputString, this.source.start)
2110
2115
  };
2111
2116
  let end = this.source.end ? {
2112
2117
  column: this.source.end.column + 1,
2113
- line: this.source.end.line
2118
+ line: this.source.end.line,
2119
+ offset: typeof this.source.end.offset === "number" ? (
2120
+ // `source.end.offset` is exclusive, so we don't need to add 1
2121
+ this.source.end.offset
2122
+ ) : (
2123
+ // Since line/column in this.source.end is inclusive,
2124
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
2125
+ // So, we add 1 to convert it to exclusive.
2126
+ sourceOffset(inputString, this.source.end) + 1
2127
+ )
2114
2128
  } : {
2115
2129
  column: start.column + 1,
2116
- line: start.line
2130
+ line: start.line,
2131
+ offset: start.offset + 1
2117
2132
  };
2118
2133
  if (opts.word) {
2119
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2120
2134
  let stringRepresentation = inputString.slice(
2121
2135
  sourceOffset(inputString, this.source.start),
2122
2136
  sourceOffset(inputString, this.source.end)
@@ -2124,15 +2138,14 @@ function requireNode$1() {
2124
2138
  let index2 = stringRepresentation.indexOf(opts.word);
2125
2139
  if (index2 !== -1) {
2126
2140
  start = this.positionInside(index2);
2127
- end = this.positionInside(
2128
- index2 + opts.word.length
2129
- );
2141
+ end = this.positionInside(index2 + opts.word.length);
2130
2142
  }
2131
2143
  } else {
2132
2144
  if (opts.start) {
2133
2145
  start = {
2134
2146
  column: opts.start.column,
2135
- line: opts.start.line
2147
+ line: opts.start.line,
2148
+ offset: sourceOffset(inputString, opts.start)
2136
2149
  };
2137
2150
  } else if (opts.index) {
2138
2151
  start = this.positionInside(opts.index);
@@ -2140,7 +2153,8 @@ function requireNode$1() {
2140
2153
  if (opts.end) {
2141
2154
  end = {
2142
2155
  column: opts.end.column,
2143
- line: opts.end.line
2156
+ line: opts.end.line,
2157
+ offset: sourceOffset(inputString, opts.end)
2144
2158
  };
2145
2159
  } else if (typeof opts.endIndex === "number") {
2146
2160
  end = this.positionInside(opts.endIndex);
@@ -2149,7 +2163,11 @@ function requireNode$1() {
2149
2163
  }
2150
2164
  }
2151
2165
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
2152
- end = { column: start.column + 1, line: start.line };
2166
+ end = {
2167
+ column: start.column + 1,
2168
+ line: start.line,
2169
+ offset: start.offset + 1
2170
+ };
2153
2171
  }
2154
2172
  return { end, start };
2155
2173
  }
@@ -2213,6 +2231,7 @@ function requireNode$1() {
2213
2231
  } else if (typeof value === "object" && value.toJSON) {
2214
2232
  fixed[name] = value.toJSON(null, inputs);
2215
2233
  } else if (name === "source") {
2234
+ if (value == null) continue;
2216
2235
  let inputId = inputs.get(value.input);
2217
2236
  if (inputId == null) {
2218
2237
  inputId = inputsNextIndex;
@@ -2247,14 +2266,11 @@ function requireNode$1() {
2247
2266
  });
2248
2267
  return result2;
2249
2268
  }
2250
- warn(result2, text, opts) {
2269
+ warn(result2, text, opts = {}) {
2251
2270
  let data = { node: this };
2252
2271
  for (let i2 in opts) data[i2] = opts[i2];
2253
2272
  return result2.warn(text, data);
2254
2273
  }
2255
- get proxyOf() {
2256
- return this;
2257
- }
2258
2274
  }
2259
2275
  node$1 = Node2;
2260
2276
  Node2.default = Node2;
@@ -2283,6 +2299,9 @@ function requireDeclaration$1() {
2283
2299
  hasRequiredDeclaration$1 = 1;
2284
2300
  let Node2 = requireNode$1();
2285
2301
  class Declaration extends Node2 {
2302
+ get variable() {
2303
+ return this.prop.startsWith("--") || this.prop[0] === "$";
2304
+ }
2286
2305
  constructor(defaults) {
2287
2306
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2288
2307
  defaults = { ...defaults, value: String(defaults.value) };
@@ -2290,9 +2309,6 @@ function requireDeclaration$1() {
2290
2309
  super(defaults);
2291
2310
  this.type = "decl";
2292
2311
  }
2293
- get variable() {
2294
- return this.prop.startsWith("--") || this.prop[0] === "$";
2295
- }
2296
2312
  }
2297
2313
  declaration$1 = Declaration;
2298
2314
  Declaration.default = Declaration;
@@ -2324,6 +2340,14 @@ function requireContainer$1() {
2324
2340
  }
2325
2341
  }
2326
2342
  class Container extends Node2 {
2343
+ get first() {
2344
+ if (!this.proxyOf.nodes) return void 0;
2345
+ return this.proxyOf.nodes[0];
2346
+ }
2347
+ get last() {
2348
+ if (!this.proxyOf.nodes) return void 0;
2349
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2350
+ }
2327
2351
  append(...children) {
2328
2352
  for (let child of children) {
2329
2353
  let nodes = this.normalize(child, this.last);
@@ -2636,14 +2660,6 @@ function requireContainer$1() {
2636
2660
  }
2637
2661
  });
2638
2662
  }
2639
- get first() {
2640
- if (!this.proxyOf.nodes) return void 0;
2641
- return this.proxyOf.nodes[0];
2642
- }
2643
- get last() {
2644
- if (!this.proxyOf.nodes) return void 0;
2645
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2646
- }
2647
2663
  }
2648
2664
  Container.registerParse = (dependant) => {
2649
2665
  parse = dependant;
@@ -2893,10 +2909,25 @@ function requireInput$1() {
2893
2909
  let CssSyntaxError = requireCssSyntaxError$1();
2894
2910
  let PreviousMap = requirePreviousMap$1();
2895
2911
  let terminalHighlight = require$$2$1;
2896
- let fromOffsetCache = Symbol("fromOffsetCache");
2912
+ let lineToIndexCache = Symbol("lineToIndexCache");
2897
2913
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
2898
2914
  let pathAvailable = Boolean(resolve && isAbsolute);
2915
+ function getLineToIndex(input2) {
2916
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
2917
+ let lines = input2.css.split("\n");
2918
+ let lineToIndex = new Array(lines.length);
2919
+ let prevIndex = 0;
2920
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2921
+ lineToIndex[i2] = prevIndex;
2922
+ prevIndex += lines[i2].length + 1;
2923
+ }
2924
+ input2[lineToIndexCache] = lineToIndex;
2925
+ return lineToIndex;
2926
+ }
2899
2927
  class Input {
2928
+ get from() {
2929
+ return this.file || this.id;
2930
+ }
2900
2931
  constructor(css, opts = {}) {
2901
2932
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
2902
2933
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -2931,30 +2962,37 @@ function requireInput$1() {
2931
2962
  if (this.map) this.map.file = this.from;
2932
2963
  }
2933
2964
  error(message, line, column, opts = {}) {
2934
- let endColumn, endLine, result2;
2965
+ let endColumn, endLine, endOffset, offset, result2;
2935
2966
  if (line && typeof line === "object") {
2936
2967
  let start = line;
2937
2968
  let end = column;
2938
2969
  if (typeof start.offset === "number") {
2939
- let pos = this.fromOffset(start.offset);
2970
+ offset = start.offset;
2971
+ let pos = this.fromOffset(offset);
2940
2972
  line = pos.line;
2941
2973
  column = pos.col;
2942
2974
  } else {
2943
2975
  line = start.line;
2944
2976
  column = start.column;
2977
+ offset = this.fromLineAndColumn(line, column);
2945
2978
  }
2946
2979
  if (typeof end.offset === "number") {
2947
- let pos = this.fromOffset(end.offset);
2980
+ endOffset = end.offset;
2981
+ let pos = this.fromOffset(endOffset);
2948
2982
  endLine = pos.line;
2949
2983
  endColumn = pos.col;
2950
2984
  } else {
2951
2985
  endLine = end.line;
2952
2986
  endColumn = end.column;
2987
+ endOffset = this.fromLineAndColumn(end.line, end.column);
2953
2988
  }
2954
2989
  } else if (!column) {
2955
- let pos = this.fromOffset(line);
2990
+ offset = line;
2991
+ let pos = this.fromOffset(offset);
2956
2992
  line = pos.line;
2957
2993
  column = pos.col;
2994
+ } else {
2995
+ offset = this.fromLineAndColumn(line, column);
2958
2996
  }
2959
2997
  let origin = this.origin(line, column, endLine, endColumn);
2960
2998
  if (origin) {
@@ -2976,7 +3014,7 @@ function requireInput$1() {
2976
3014
  opts.plugin
2977
3015
  );
2978
3016
  }
2979
- result2.input = { column, endColumn, endLine, line, source: this.css };
3017
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
2980
3018
  if (this.file) {
2981
3019
  if (pathToFileURL) {
2982
3020
  result2.input.url = pathToFileURL(this.file).toString();
@@ -2985,21 +3023,14 @@ function requireInput$1() {
2985
3023
  }
2986
3024
  return result2;
2987
3025
  }
3026
+ fromLineAndColumn(line, column) {
3027
+ let lineToIndex = getLineToIndex(this);
3028
+ let index2 = lineToIndex[line - 1];
3029
+ return index2 + column - 1;
3030
+ }
2988
3031
  fromOffset(offset) {
2989
- let lastLine, lineToIndex;
2990
- if (!this[fromOffsetCache]) {
2991
- let lines = this.css.split("\n");
2992
- lineToIndex = new Array(lines.length);
2993
- let prevIndex = 0;
2994
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2995
- lineToIndex[i2] = prevIndex;
2996
- prevIndex += lines[i2].length + 1;
2997
- }
2998
- this[fromOffsetCache] = lineToIndex;
2999
- } else {
3000
- lineToIndex = this[fromOffsetCache];
3001
- }
3002
- lastLine = lineToIndex[lineToIndex.length - 1];
3032
+ let lineToIndex = getLineToIndex(this);
3033
+ let lastLine = lineToIndex[lineToIndex.length - 1];
3003
3034
  let min = 0;
3004
3035
  if (offset >= lastLine) {
3005
3036
  min = lineToIndex.length - 1;
@@ -3080,9 +3111,6 @@ function requireInput$1() {
3080
3111
  }
3081
3112
  return json;
3082
3113
  }
3083
- get from() {
3084
- return this.file || this.id;
3085
- }
3086
3114
  }
3087
3115
  input$1 = Input;
3088
3116
  Input.default = Input;
@@ -3208,11 +3236,6 @@ function requireRule$1() {
3208
3236
  let Container = requireContainer$1();
3209
3237
  let list = requireList$1();
3210
3238
  class Rule extends Container {
3211
- constructor(defaults) {
3212
- super(defaults);
3213
- this.type = "rule";
3214
- if (!this.nodes) this.nodes = [];
3215
- }
3216
3239
  get selectors() {
3217
3240
  return list.comma(this.selector);
3218
3241
  }
@@ -3221,6 +3244,11 @@ function requireRule$1() {
3221
3244
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
3222
3245
  this.selector = values.join(sep);
3223
3246
  }
3247
+ constructor(defaults) {
3248
+ super(defaults);
3249
+ this.type = "rule";
3250
+ if (!this.nodes) this.nodes = [];
3251
+ }
3224
3252
  }
3225
3253
  rule$1 = Rule;
3226
3254
  Rule.default = Rule;
@@ -4120,6 +4148,8 @@ function requireParser$1() {
4120
4148
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
4121
4149
  prev.raws.ownSemicolon = this.spaces;
4122
4150
  this.spaces = "";
4151
+ prev.source.end = this.getPosition(token[2]);
4152
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
4123
4153
  }
4124
4154
  }
4125
4155
  }
@@ -4331,7 +4361,7 @@ function requireParser$1() {
4331
4361
  }
4332
4362
  unknownWord(tokens) {
4333
4363
  throw this.input.error(
4334
- "Unknown word",
4364
+ "Unknown word " + tokens[0][1],
4335
4365
  { offset: tokens[0][2] },
4336
4366
  { offset: tokens[0][2] + tokens[0][1].length }
4337
4367
  );
@@ -4424,12 +4454,15 @@ function requireResult$1() {
4424
4454
  hasRequiredResult$1 = 1;
4425
4455
  let Warning = requireWarning$1();
4426
4456
  class Result {
4457
+ get content() {
4458
+ return this.css;
4459
+ }
4427
4460
  constructor(processor2, root2, opts) {
4428
4461
  this.processor = processor2;
4429
4462
  this.messages = [];
4430
4463
  this.root = root2;
4431
4464
  this.opts = opts;
4432
- this.css = void 0;
4465
+ this.css = "";
4433
4466
  this.map = void 0;
4434
4467
  }
4435
4468
  toString() {
@@ -4448,9 +4481,6 @@ function requireResult$1() {
4448
4481
  warnings() {
4449
4482
  return this.messages.filter((i2) => i2.type === "warning");
4450
4483
  }
4451
- get content() {
4452
- return this.css;
4453
- }
4454
4484
  }
4455
4485
  result$1 = Result;
4456
4486
  Result.default = Result;
@@ -4569,6 +4599,30 @@ function requireLazyResult$1() {
4569
4599
  }
4570
4600
  let postcss2 = {};
4571
4601
  class LazyResult {
4602
+ get content() {
4603
+ return this.stringify().content;
4604
+ }
4605
+ get css() {
4606
+ return this.stringify().css;
4607
+ }
4608
+ get map() {
4609
+ return this.stringify().map;
4610
+ }
4611
+ get messages() {
4612
+ return this.sync().messages;
4613
+ }
4614
+ get opts() {
4615
+ return this.result.opts;
4616
+ }
4617
+ get processor() {
4618
+ return this.result.processor;
4619
+ }
4620
+ get root() {
4621
+ return this.sync().root;
4622
+ }
4623
+ get [Symbol.toStringTag]() {
4624
+ return "LazyResult";
4625
+ }
4572
4626
  constructor(processor2, css, opts) {
4573
4627
  this.stringified = false;
4574
4628
  this.processed = false;
@@ -4911,30 +4965,6 @@ function requireLazyResult$1() {
4911
4965
  warnings() {
4912
4966
  return this.sync().warnings();
4913
4967
  }
4914
- get content() {
4915
- return this.stringify().content;
4916
- }
4917
- get css() {
4918
- return this.stringify().css;
4919
- }
4920
- get map() {
4921
- return this.stringify().map;
4922
- }
4923
- get messages() {
4924
- return this.sync().messages;
4925
- }
4926
- get opts() {
4927
- return this.result.opts;
4928
- }
4929
- get processor() {
4930
- return this.result.processor;
4931
- }
4932
- get root() {
4933
- return this.sync().root;
4934
- }
4935
- get [Symbol.toStringTag]() {
4936
- return "LazyResult";
4937
- }
4938
4968
  }
4939
4969
  LazyResult.registerPostcss = (dependant) => {
4940
4970
  postcss2 = dependant;
@@ -4956,6 +4986,45 @@ function requireNoWorkResult$1() {
4956
4986
  let stringify = requireStringify$1();
4957
4987
  let warnOnce2 = requireWarnOnce$1();
4958
4988
  class NoWorkResult {
4989
+ get content() {
4990
+ return this.result.css;
4991
+ }
4992
+ get css() {
4993
+ return this.result.css;
4994
+ }
4995
+ get map() {
4996
+ return this.result.map;
4997
+ }
4998
+ get messages() {
4999
+ return [];
5000
+ }
5001
+ get opts() {
5002
+ return this.result.opts;
5003
+ }
5004
+ get processor() {
5005
+ return this.result.processor;
5006
+ }
5007
+ get root() {
5008
+ if (this._root) {
5009
+ return this._root;
5010
+ }
5011
+ let root2;
5012
+ let parser2 = parse;
5013
+ try {
5014
+ root2 = parser2(this._css, this._opts);
5015
+ } catch (error) {
5016
+ this.error = error;
5017
+ }
5018
+ if (this.error) {
5019
+ throw this.error;
5020
+ } else {
5021
+ this._root = root2;
5022
+ return root2;
5023
+ }
5024
+ }
5025
+ get [Symbol.toStringTag]() {
5026
+ return "NoWorkResult";
5027
+ }
4959
5028
  constructor(processor2, css, opts) {
4960
5029
  css = css.toString();
4961
5030
  this.stringified = false;
@@ -5017,45 +5086,6 @@ function requireNoWorkResult$1() {
5017
5086
  warnings() {
5018
5087
  return [];
5019
5088
  }
5020
- get content() {
5021
- return this.result.css;
5022
- }
5023
- get css() {
5024
- return this.result.css;
5025
- }
5026
- get map() {
5027
- return this.result.map;
5028
- }
5029
- get messages() {
5030
- return [];
5031
- }
5032
- get opts() {
5033
- return this.result.opts;
5034
- }
5035
- get processor() {
5036
- return this.result.processor;
5037
- }
5038
- get root() {
5039
- if (this._root) {
5040
- return this._root;
5041
- }
5042
- let root2;
5043
- let parser2 = parse;
5044
- try {
5045
- root2 = parser2(this._css, this._opts);
5046
- } catch (error) {
5047
- this.error = error;
5048
- }
5049
- if (this.error) {
5050
- throw this.error;
5051
- } else {
5052
- this._root = root2;
5053
- return root2;
5054
- }
5055
- }
5056
- get [Symbol.toStringTag]() {
5057
- return "NoWorkResult";
5058
- }
5059
5089
  }
5060
5090
  noWorkResult$1 = NoWorkResult;
5061
5091
  NoWorkResult.default = NoWorkResult;
@@ -5072,7 +5102,7 @@ function requireProcessor$1() {
5072
5102
  let Root = requireRoot$1();
5073
5103
  class Processor {
5074
5104
  constructor(plugins = []) {
5075
- this.version = "8.5.1";
5105
+ this.version = "8.5.6";
5076
5106
  this.plugins = this.normalize(plugins);
5077
5107
  }
5078
5108
  normalize(plugins) {
@@ -5345,7 +5375,7 @@ function getDefaultExportFromCjs(x) {
5345
5375
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5346
5376
  }
5347
5377
  function getAugmentedNamespace(n2) {
5348
- if (n2.__esModule) return n2;
5378
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
5349
5379
  var f2 = n2.default;
5350
5380
  if (typeof f2 == "function") {
5351
5381
  var a2 = function a3() {
@@ -5864,6 +5894,9 @@ function requireNode() {
5864
5894
  return offset;
5865
5895
  }
5866
5896
  class Node2 {
5897
+ get proxyOf() {
5898
+ return this;
5899
+ }
5867
5900
  constructor(defaults = {}) {
5868
5901
  this.raws = {};
5869
5902
  this[isClean] = false;
@@ -5982,7 +6015,7 @@ function requireNode() {
5982
6015
  let index2 = this.parent.index(this);
5983
6016
  return this.parent.nodes[index2 + 1];
5984
6017
  }
5985
- positionBy(opts) {
6018
+ positionBy(opts = {}) {
5986
6019
  let pos = this.source.start;
5987
6020
  if (opts.index) {
5988
6021
  pos = this.positionInside(opts.index);
@@ -6011,27 +6044,38 @@ function requireNode() {
6011
6044
  column += 1;
6012
6045
  }
6013
6046
  }
6014
- return { column, line };
6047
+ return { column, line, offset: end };
6015
6048
  }
6016
6049
  prev() {
6017
6050
  if (!this.parent) return void 0;
6018
6051
  let index2 = this.parent.index(this);
6019
6052
  return this.parent.nodes[index2 - 1];
6020
6053
  }
6021
- rangeBy(opts) {
6054
+ rangeBy(opts = {}) {
6055
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6022
6056
  let start = {
6023
6057
  column: this.source.start.column,
6024
- line: this.source.start.line
6058
+ line: this.source.start.line,
6059
+ offset: sourceOffset(inputString, this.source.start)
6025
6060
  };
6026
6061
  let end = this.source.end ? {
6027
6062
  column: this.source.end.column + 1,
6028
- line: this.source.end.line
6063
+ line: this.source.end.line,
6064
+ offset: typeof this.source.end.offset === "number" ? (
6065
+ // `source.end.offset` is exclusive, so we don't need to add 1
6066
+ this.source.end.offset
6067
+ ) : (
6068
+ // Since line/column in this.source.end is inclusive,
6069
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
6070
+ // So, we add 1 to convert it to exclusive.
6071
+ sourceOffset(inputString, this.source.end) + 1
6072
+ )
6029
6073
  } : {
6030
6074
  column: start.column + 1,
6031
- line: start.line
6075
+ line: start.line,
6076
+ offset: start.offset + 1
6032
6077
  };
6033
6078
  if (opts.word) {
6034
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6035
6079
  let stringRepresentation = inputString.slice(
6036
6080
  sourceOffset(inputString, this.source.start),
6037
6081
  sourceOffset(inputString, this.source.end)
@@ -6039,15 +6083,14 @@ function requireNode() {
6039
6083
  let index2 = stringRepresentation.indexOf(opts.word);
6040
6084
  if (index2 !== -1) {
6041
6085
  start = this.positionInside(index2);
6042
- end = this.positionInside(
6043
- index2 + opts.word.length
6044
- );
6086
+ end = this.positionInside(index2 + opts.word.length);
6045
6087
  }
6046
6088
  } else {
6047
6089
  if (opts.start) {
6048
6090
  start = {
6049
6091
  column: opts.start.column,
6050
- line: opts.start.line
6092
+ line: opts.start.line,
6093
+ offset: sourceOffset(inputString, opts.start)
6051
6094
  };
6052
6095
  } else if (opts.index) {
6053
6096
  start = this.positionInside(opts.index);
@@ -6055,7 +6098,8 @@ function requireNode() {
6055
6098
  if (opts.end) {
6056
6099
  end = {
6057
6100
  column: opts.end.column,
6058
- line: opts.end.line
6101
+ line: opts.end.line,
6102
+ offset: sourceOffset(inputString, opts.end)
6059
6103
  };
6060
6104
  } else if (typeof opts.endIndex === "number") {
6061
6105
  end = this.positionInside(opts.endIndex);
@@ -6064,7 +6108,11 @@ function requireNode() {
6064
6108
  }
6065
6109
  }
6066
6110
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
6067
- end = { column: start.column + 1, line: start.line };
6111
+ end = {
6112
+ column: start.column + 1,
6113
+ line: start.line,
6114
+ offset: start.offset + 1
6115
+ };
6068
6116
  }
6069
6117
  return { end, start };
6070
6118
  }
@@ -6128,6 +6176,7 @@ function requireNode() {
6128
6176
  } else if (typeof value === "object" && value.toJSON) {
6129
6177
  fixed[name] = value.toJSON(null, inputs);
6130
6178
  } else if (name === "source") {
6179
+ if (value == null) continue;
6131
6180
  let inputId = inputs.get(value.input);
6132
6181
  if (inputId == null) {
6133
6182
  inputId = inputsNextIndex;
@@ -6162,14 +6211,11 @@ function requireNode() {
6162
6211
  });
6163
6212
  return result2;
6164
6213
  }
6165
- warn(result2, text, opts) {
6214
+ warn(result2, text, opts = {}) {
6166
6215
  let data = { node: this };
6167
6216
  for (let i2 in opts) data[i2] = opts[i2];
6168
6217
  return result2.warn(text, data);
6169
6218
  }
6170
- get proxyOf() {
6171
- return this;
6172
- }
6173
6219
  }
6174
6220
  node = Node2;
6175
6221
  Node2.default = Node2;
@@ -6198,6 +6244,9 @@ function requireDeclaration() {
6198
6244
  hasRequiredDeclaration = 1;
6199
6245
  let Node2 = requireNode();
6200
6246
  class Declaration extends Node2 {
6247
+ get variable() {
6248
+ return this.prop.startsWith("--") || this.prop[0] === "$";
6249
+ }
6201
6250
  constructor(defaults) {
6202
6251
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6203
6252
  defaults = { ...defaults, value: String(defaults.value) };
@@ -6205,9 +6254,6 @@ function requireDeclaration() {
6205
6254
  super(defaults);
6206
6255
  this.type = "decl";
6207
6256
  }
6208
- get variable() {
6209
- return this.prop.startsWith("--") || this.prop[0] === "$";
6210
- }
6211
6257
  }
6212
6258
  declaration = Declaration;
6213
6259
  Declaration.default = Declaration;
@@ -6239,6 +6285,14 @@ function requireContainer() {
6239
6285
  }
6240
6286
  }
6241
6287
  class Container extends Node2 {
6288
+ get first() {
6289
+ if (!this.proxyOf.nodes) return void 0;
6290
+ return this.proxyOf.nodes[0];
6291
+ }
6292
+ get last() {
6293
+ if (!this.proxyOf.nodes) return void 0;
6294
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6295
+ }
6242
6296
  append(...children) {
6243
6297
  for (let child of children) {
6244
6298
  let nodes = this.normalize(child, this.last);
@@ -6551,14 +6605,6 @@ function requireContainer() {
6551
6605
  }
6552
6606
  });
6553
6607
  }
6554
- get first() {
6555
- if (!this.proxyOf.nodes) return void 0;
6556
- return this.proxyOf.nodes[0];
6557
- }
6558
- get last() {
6559
- if (!this.proxyOf.nodes) return void 0;
6560
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6561
- }
6562
6608
  }
6563
6609
  Container.registerParse = (dependant) => {
6564
6610
  parse = dependant;
@@ -6808,10 +6854,25 @@ function requireInput() {
6808
6854
  let CssSyntaxError = requireCssSyntaxError();
6809
6855
  let PreviousMap = requirePreviousMap();
6810
6856
  let terminalHighlight = require$$2;
6811
- let fromOffsetCache = Symbol("fromOffsetCache");
6857
+ let lineToIndexCache = Symbol("lineToIndexCache");
6812
6858
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
6813
6859
  let pathAvailable = Boolean(resolve && isAbsolute);
6860
+ function getLineToIndex(input2) {
6861
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
6862
+ let lines = input2.css.split("\n");
6863
+ let lineToIndex = new Array(lines.length);
6864
+ let prevIndex = 0;
6865
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6866
+ lineToIndex[i2] = prevIndex;
6867
+ prevIndex += lines[i2].length + 1;
6868
+ }
6869
+ input2[lineToIndexCache] = lineToIndex;
6870
+ return lineToIndex;
6871
+ }
6814
6872
  class Input {
6873
+ get from() {
6874
+ return this.file || this.id;
6875
+ }
6815
6876
  constructor(css, opts = {}) {
6816
6877
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
6817
6878
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -6846,30 +6907,37 @@ function requireInput() {
6846
6907
  if (this.map) this.map.file = this.from;
6847
6908
  }
6848
6909
  error(message, line, column, opts = {}) {
6849
- let endColumn, endLine, result2;
6910
+ let endColumn, endLine, endOffset, offset, result2;
6850
6911
  if (line && typeof line === "object") {
6851
6912
  let start = line;
6852
6913
  let end = column;
6853
6914
  if (typeof start.offset === "number") {
6854
- let pos = this.fromOffset(start.offset);
6915
+ offset = start.offset;
6916
+ let pos = this.fromOffset(offset);
6855
6917
  line = pos.line;
6856
6918
  column = pos.col;
6857
6919
  } else {
6858
6920
  line = start.line;
6859
6921
  column = start.column;
6922
+ offset = this.fromLineAndColumn(line, column);
6860
6923
  }
6861
6924
  if (typeof end.offset === "number") {
6862
- let pos = this.fromOffset(end.offset);
6925
+ endOffset = end.offset;
6926
+ let pos = this.fromOffset(endOffset);
6863
6927
  endLine = pos.line;
6864
6928
  endColumn = pos.col;
6865
6929
  } else {
6866
6930
  endLine = end.line;
6867
6931
  endColumn = end.column;
6932
+ endOffset = this.fromLineAndColumn(end.line, end.column);
6868
6933
  }
6869
6934
  } else if (!column) {
6870
- let pos = this.fromOffset(line);
6935
+ offset = line;
6936
+ let pos = this.fromOffset(offset);
6871
6937
  line = pos.line;
6872
6938
  column = pos.col;
6939
+ } else {
6940
+ offset = this.fromLineAndColumn(line, column);
6873
6941
  }
6874
6942
  let origin = this.origin(line, column, endLine, endColumn);
6875
6943
  if (origin) {
@@ -6891,7 +6959,7 @@ function requireInput() {
6891
6959
  opts.plugin
6892
6960
  );
6893
6961
  }
6894
- result2.input = { column, endColumn, endLine, line, source: this.css };
6962
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
6895
6963
  if (this.file) {
6896
6964
  if (pathToFileURL) {
6897
6965
  result2.input.url = pathToFileURL(this.file).toString();
@@ -6900,21 +6968,14 @@ function requireInput() {
6900
6968
  }
6901
6969
  return result2;
6902
6970
  }
6971
+ fromLineAndColumn(line, column) {
6972
+ let lineToIndex = getLineToIndex(this);
6973
+ let index2 = lineToIndex[line - 1];
6974
+ return index2 + column - 1;
6975
+ }
6903
6976
  fromOffset(offset) {
6904
- let lastLine, lineToIndex;
6905
- if (!this[fromOffsetCache]) {
6906
- let lines = this.css.split("\n");
6907
- lineToIndex = new Array(lines.length);
6908
- let prevIndex = 0;
6909
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6910
- lineToIndex[i2] = prevIndex;
6911
- prevIndex += lines[i2].length + 1;
6912
- }
6913
- this[fromOffsetCache] = lineToIndex;
6914
- } else {
6915
- lineToIndex = this[fromOffsetCache];
6916
- }
6917
- lastLine = lineToIndex[lineToIndex.length - 1];
6977
+ let lineToIndex = getLineToIndex(this);
6978
+ let lastLine = lineToIndex[lineToIndex.length - 1];
6918
6979
  let min = 0;
6919
6980
  if (offset >= lastLine) {
6920
6981
  min = lineToIndex.length - 1;
@@ -6995,9 +7056,6 @@ function requireInput() {
6995
7056
  }
6996
7057
  return json;
6997
7058
  }
6998
- get from() {
6999
- return this.file || this.id;
7000
- }
7001
7059
  }
7002
7060
  input = Input;
7003
7061
  Input.default = Input;
@@ -7123,11 +7181,6 @@ function requireRule() {
7123
7181
  let Container = requireContainer();
7124
7182
  let list = requireList();
7125
7183
  class Rule extends Container {
7126
- constructor(defaults) {
7127
- super(defaults);
7128
- this.type = "rule";
7129
- if (!this.nodes) this.nodes = [];
7130
- }
7131
7184
  get selectors() {
7132
7185
  return list.comma(this.selector);
7133
7186
  }
@@ -7136,6 +7189,11 @@ function requireRule() {
7136
7189
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
7137
7190
  this.selector = values.join(sep);
7138
7191
  }
7192
+ constructor(defaults) {
7193
+ super(defaults);
7194
+ this.type = "rule";
7195
+ if (!this.nodes) this.nodes = [];
7196
+ }
7139
7197
  }
7140
7198
  rule = Rule;
7141
7199
  Rule.default = Rule;
@@ -8035,6 +8093,8 @@ function requireParser() {
8035
8093
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
8036
8094
  prev.raws.ownSemicolon = this.spaces;
8037
8095
  this.spaces = "";
8096
+ prev.source.end = this.getPosition(token[2]);
8097
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
8038
8098
  }
8039
8099
  }
8040
8100
  }
@@ -8246,7 +8306,7 @@ function requireParser() {
8246
8306
  }
8247
8307
  unknownWord(tokens) {
8248
8308
  throw this.input.error(
8249
- "Unknown word",
8309
+ "Unknown word " + tokens[0][1],
8250
8310
  { offset: tokens[0][2] },
8251
8311
  { offset: tokens[0][2] + tokens[0][1].length }
8252
8312
  );
@@ -8339,12 +8399,15 @@ function requireResult() {
8339
8399
  hasRequiredResult = 1;
8340
8400
  let Warning = requireWarning();
8341
8401
  class Result {
8402
+ get content() {
8403
+ return this.css;
8404
+ }
8342
8405
  constructor(processor2, root2, opts) {
8343
8406
  this.processor = processor2;
8344
8407
  this.messages = [];
8345
8408
  this.root = root2;
8346
8409
  this.opts = opts;
8347
- this.css = void 0;
8410
+ this.css = "";
8348
8411
  this.map = void 0;
8349
8412
  }
8350
8413
  toString() {
@@ -8363,9 +8426,6 @@ function requireResult() {
8363
8426
  warnings() {
8364
8427
  return this.messages.filter((i2) => i2.type === "warning");
8365
8428
  }
8366
- get content() {
8367
- return this.css;
8368
- }
8369
8429
  }
8370
8430
  result = Result;
8371
8431
  Result.default = Result;
@@ -8484,6 +8544,30 @@ function requireLazyResult() {
8484
8544
  }
8485
8545
  let postcss2 = {};
8486
8546
  class LazyResult {
8547
+ get content() {
8548
+ return this.stringify().content;
8549
+ }
8550
+ get css() {
8551
+ return this.stringify().css;
8552
+ }
8553
+ get map() {
8554
+ return this.stringify().map;
8555
+ }
8556
+ get messages() {
8557
+ return this.sync().messages;
8558
+ }
8559
+ get opts() {
8560
+ return this.result.opts;
8561
+ }
8562
+ get processor() {
8563
+ return this.result.processor;
8564
+ }
8565
+ get root() {
8566
+ return this.sync().root;
8567
+ }
8568
+ get [Symbol.toStringTag]() {
8569
+ return "LazyResult";
8570
+ }
8487
8571
  constructor(processor2, css, opts) {
8488
8572
  this.stringified = false;
8489
8573
  this.processed = false;
@@ -8826,30 +8910,6 @@ function requireLazyResult() {
8826
8910
  warnings() {
8827
8911
  return this.sync().warnings();
8828
8912
  }
8829
- get content() {
8830
- return this.stringify().content;
8831
- }
8832
- get css() {
8833
- return this.stringify().css;
8834
- }
8835
- get map() {
8836
- return this.stringify().map;
8837
- }
8838
- get messages() {
8839
- return this.sync().messages;
8840
- }
8841
- get opts() {
8842
- return this.result.opts;
8843
- }
8844
- get processor() {
8845
- return this.result.processor;
8846
- }
8847
- get root() {
8848
- return this.sync().root;
8849
- }
8850
- get [Symbol.toStringTag]() {
8851
- return "LazyResult";
8852
- }
8853
8913
  }
8854
8914
  LazyResult.registerPostcss = (dependant) => {
8855
8915
  postcss2 = dependant;
@@ -8871,6 +8931,45 @@ function requireNoWorkResult() {
8871
8931
  let stringify = requireStringify();
8872
8932
  let warnOnce2 = requireWarnOnce();
8873
8933
  class NoWorkResult {
8934
+ get content() {
8935
+ return this.result.css;
8936
+ }
8937
+ get css() {
8938
+ return this.result.css;
8939
+ }
8940
+ get map() {
8941
+ return this.result.map;
8942
+ }
8943
+ get messages() {
8944
+ return [];
8945
+ }
8946
+ get opts() {
8947
+ return this.result.opts;
8948
+ }
8949
+ get processor() {
8950
+ return this.result.processor;
8951
+ }
8952
+ get root() {
8953
+ if (this._root) {
8954
+ return this._root;
8955
+ }
8956
+ let root2;
8957
+ let parser2 = parse;
8958
+ try {
8959
+ root2 = parser2(this._css, this._opts);
8960
+ } catch (error) {
8961
+ this.error = error;
8962
+ }
8963
+ if (this.error) {
8964
+ throw this.error;
8965
+ } else {
8966
+ this._root = root2;
8967
+ return root2;
8968
+ }
8969
+ }
8970
+ get [Symbol.toStringTag]() {
8971
+ return "NoWorkResult";
8972
+ }
8874
8973
  constructor(processor2, css, opts) {
8875
8974
  css = css.toString();
8876
8975
  this.stringified = false;
@@ -8932,45 +9031,6 @@ function requireNoWorkResult() {
8932
9031
  warnings() {
8933
9032
  return [];
8934
9033
  }
8935
- get content() {
8936
- return this.result.css;
8937
- }
8938
- get css() {
8939
- return this.result.css;
8940
- }
8941
- get map() {
8942
- return this.result.map;
8943
- }
8944
- get messages() {
8945
- return [];
8946
- }
8947
- get opts() {
8948
- return this.result.opts;
8949
- }
8950
- get processor() {
8951
- return this.result.processor;
8952
- }
8953
- get root() {
8954
- if (this._root) {
8955
- return this._root;
8956
- }
8957
- let root2;
8958
- let parser2 = parse;
8959
- try {
8960
- root2 = parser2(this._css, this._opts);
8961
- } catch (error) {
8962
- this.error = error;
8963
- }
8964
- if (this.error) {
8965
- throw this.error;
8966
- } else {
8967
- this._root = root2;
8968
- return root2;
8969
- }
8970
- }
8971
- get [Symbol.toStringTag]() {
8972
- return "NoWorkResult";
8973
- }
8974
9034
  }
8975
9035
  noWorkResult = NoWorkResult;
8976
9036
  NoWorkResult.default = NoWorkResult;
@@ -8987,7 +9047,7 @@ function requireProcessor() {
8987
9047
  let Root = requireRoot();
8988
9048
  class Processor {
8989
9049
  constructor(plugins = []) {
8990
- this.version = "8.5.1";
9050
+ this.version = "8.5.6";
8991
9051
  this.plugins = this.normalize(plugins);
8992
9052
  }
8993
9053
  normalize(plugins) {
@@ -10402,7 +10462,7 @@ const callbackWrapper = (cb) => {
10402
10462
  if (!errorHandler) {
10403
10463
  return cb;
10404
10464
  }
10405
- const rrwebWrapped = (...rest) => {
10465
+ const rrwebWrapped = ((...rest) => {
10406
10466
  try {
10407
10467
  return cb(...rest);
10408
10468
  } catch (error) {
@@ -10411,7 +10471,7 @@ const callbackWrapper = (cb) => {
10411
10471
  }
10412
10472
  throw error;
10413
10473
  }
10414
- };
10474
+ });
10415
10475
  return rrwebWrapped;
10416
10476
  };
10417
10477
  const mutationBuffers = [];
@@ -11169,7 +11229,11 @@ function initFontObserver({ fontCb, doc }) {
11169
11229
  const fontMap = /* @__PURE__ */ new WeakMap();
11170
11230
  const originalFontFace = win.FontFace;
11171
11231
  win.FontFace = function FontFace2(family, source, descriptors) {
11172
- const fontFace = new originalFontFace(family, source, descriptors);
11232
+ const fontFace = new originalFontFace(
11233
+ family,
11234
+ source,
11235
+ descriptors
11236
+ );
11173
11237
  fontMap.set(fontFace, {
11174
11238
  family,
11175
11239
  buffer: typeof source !== "string",
@@ -11531,13 +11595,18 @@ class IframeManager {
11531
11595
  removeLoadListener() {
11532
11596
  this.loadListener = void 0;
11533
11597
  }
11598
+ trackIframeContent(iframeEl, content) {
11599
+ const iframeId = this.mirror.getId(iframeEl);
11600
+ this.attachedIframes.set(iframeId, { element: iframeEl, content });
11601
+ return iframeId;
11602
+ }
11534
11603
  attachIframe(iframeEl, childSn) {
11535
11604
  var _a2;
11536
- this.attachedIframes.set(iframeEl, childSn);
11605
+ const iframeId = this.trackIframeContent(iframeEl, childSn);
11537
11606
  this.mutationCb({
11538
11607
  adds: [
11539
11608
  {
11540
- parentId: this.mirror.getId(iframeEl),
11609
+ parentId: iframeId,
11541
11610
  nextId: null,
11542
11611
  node: childSn
11543
11612
  }
@@ -11589,7 +11658,7 @@ class IframeManager {
11589
11658
  const rootId = e2.data.node.id;
11590
11659
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
11591
11660
  this.patchRootIdOnNode(e2.data.node, rootId);
11592
- this.attachedIframes.set(iframeEl, e2.data.node);
11661
+ this.trackIframeContent(iframeEl, e2.data.node);
11593
11662
  return {
11594
11663
  timestamp: e2.timestamp,
11595
11664
  type: EventType.IncrementalSnapshot,
@@ -11732,21 +11801,27 @@ class IframeManager {
11732
11801
  });
11733
11802
  }
11734
11803
  }
11804
+ removeIframeById(iframeId) {
11805
+ const entry = this.attachedIframes.get(iframeId);
11806
+ if (!entry) return;
11807
+ const win = entry.element.contentWindow;
11808
+ if (win && this.nestedIframeListeners.has(win)) {
11809
+ const handler = this.nestedIframeListeners.get(win);
11810
+ win.removeEventListener("message", handler);
11811
+ this.nestedIframeListeners.delete(win);
11812
+ }
11813
+ this.attachedIframes.delete(iframeId);
11814
+ }
11735
11815
  reattachIframes() {
11736
- this.attachedIframes.forEach((content, iframe) => {
11737
- if (!iframe.isConnected) {
11738
- this.attachedIframes.delete(iframe);
11739
- return;
11740
- }
11741
- const parentId = this.mirror.getId(iframe);
11742
- if (parentId === -1) {
11743
- this.attachedIframes.delete(iframe);
11816
+ this.attachedIframes.forEach(({ content }, iframeId) => {
11817
+ if (!this.mirror.has(iframeId)) {
11818
+ this.attachedIframes.delete(iframeId);
11744
11819
  return;
11745
11820
  }
11746
11821
  this.mutationCb({
11747
11822
  adds: [
11748
11823
  {
11749
- parentId,
11824
+ parentId: iframeId,
11750
11825
  nextId: null,
11751
11826
  node: content
11752
11827
  }
@@ -12701,6 +12776,11 @@ function record(options = {}) {
12701
12776
  }
12702
12777
  };
12703
12778
  const wrappedMutationEmit = (m) => {
12779
+ if (recordCrossOriginIframes && m.removes) {
12780
+ m.removes.forEach(({ id }) => {
12781
+ iframeManager.removeIframeById(id);
12782
+ });
12783
+ }
12704
12784
  wrappedEmit({
12705
12785
  type: EventType.IncrementalSnapshot,
12706
12786
  data: {
@@ -13060,9 +13140,9 @@ record.takeFullSnapshot = (isCheckout) => {
13060
13140
  };
13061
13141
  record.mirror = mirror;
13062
13142
  var n;
13063
- !function(t2) {
13143
+ !(function(t2) {
13064
13144
  t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
13065
- }(n || (n = {}));
13145
+ })(n || (n = {}));
13066
13146
  const { addCustomEvent } = record;
13067
13147
  const { freezePage } = record;
13068
13148
  const { takeFullSnapshot } = record;