@angular/ssr 19.2.0-next.0 → 19.2.0-next.2

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.
@@ -48,7 +48,7 @@ function notImplementedAsync(name) {
48
48
  function callbackify(fn) {
49
49
  const fnc = function(...args) {
50
50
  const cb = args.pop();
51
- fn().catch((error) => cb(error)).then((val) => cb(undefined, val));
51
+ fn().catch((error) => cb(error)).then((val) => cb(void 0, val));
52
52
  };
53
53
  fnc.__promisify__ = fn;
54
54
  fnc.native = fnc;
@@ -197,14 +197,14 @@ const join = function(...arguments_) {
197
197
  let joined;
198
198
  for (const argument of arguments_) {
199
199
  if (argument && argument.length > 0) {
200
- if (joined === undefined) {
200
+ if (joined === void 0) {
201
201
  joined = argument;
202
202
  } else {
203
203
  joined += `/${argument}`;
204
204
  }
205
205
  }
206
206
  }
207
- if (joined === undefined) {
207
+ if (joined === void 0) {
208
208
  return ".";
209
209
  }
210
210
  return normalize(joined.replace(/\/\/+/g, "/"));
@@ -389,8 +389,8 @@ var _path = /*#__PURE__*/Object.freeze({
389
389
  const _pathModule = {
390
390
  ..._path,
391
391
  platform: "posix",
392
- posix: undefined,
393
- win32: undefined
392
+ posix: void 0,
393
+ win32: void 0
394
394
  };
395
395
  _pathModule.posix = _pathModule;
396
396
  _pathModule.win32 = _pathModule;
@@ -3696,6 +3696,8 @@ function requireParser () {
3696
3696
  if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
3697
3697
  prev.raws.ownSemicolon = this.spaces;
3698
3698
  this.spaces = '';
3699
+ prev.source.end = this.getPosition(token[2]);
3700
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
3699
3701
  }
3700
3702
  }
3701
3703
  }
@@ -4844,7 +4846,7 @@ function requireProcessor () {
4844
4846
 
4845
4847
  class Processor {
4846
4848
  constructor(plugins = []) {
4847
- this.version = '8.5.1';
4849
+ this.version = '8.5.2';
4848
4850
  this.plugins = this.normalize(plugins);
4849
4851
  }
4850
4852
 
@@ -5326,7 +5328,7 @@ function requireParsers () {
5326
5328
  // Has any keyword, media type, media feature expression or interpolation
5327
5329
  // ('element' hereafter) started
5328
5330
  var insideSomeValue = false;
5329
- var node = undefined;
5331
+ var node = void 0;
5330
5332
 
5331
5333
  function resetNode() {
5332
5334
  return {
@@ -5789,7 +5791,7 @@ class NodeWithChildren extends Node {
5789
5791
  /** First child of the node. */
5790
5792
  get firstChild() {
5791
5793
  var _a;
5792
- return (_a = this.children[0]) !== null && _a !== undefined ? _a : null;
5794
+ return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
5793
5795
  }
5794
5796
  /** Last child of the node. */
5795
5797
  get lastChild() {
@@ -5868,8 +5870,8 @@ class Element extends NodeWithChildren {
5868
5870
  return ({
5869
5871
  name,
5870
5872
  value: this.attribs[name],
5871
- namespace: (_a = this["x-attribsNamespace"]) === null || _a === undefined ? undefined : _a[name],
5872
- prefix: (_b = this["x-attribsPrefix"]) === null || _b === undefined ? undefined : _b[name],
5873
+ namespace: (_a = this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
5874
+ prefix: (_b = this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
5873
5875
  });
5874
5876
  });
5875
5877
  }
@@ -6029,9 +6031,9 @@ class DomHandler {
6029
6031
  options = callback;
6030
6032
  callback = undefined;
6031
6033
  }
6032
- this.callback = callback !== null && callback !== undefined ? callback : null;
6033
- this.options = options !== null && options !== undefined ? options : defaultOpts;
6034
- this.elementCB = elementCB !== null && elementCB !== undefined ? elementCB : null;
6034
+ this.callback = callback !== null && callback !== void 0 ? callback : null;
6035
+ this.options = options !== null && options !== void 0 ? options : defaultOpts;
6036
+ this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
6035
6037
  }
6036
6038
  onparserinit(parser) {
6037
6039
  this.parser = parser;
@@ -6190,7 +6192,7 @@ const decodeMap = new Map([
6190
6192
  */
6191
6193
  const fromCodePoint =
6192
6194
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
6193
- (_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function (codePoint) {
6195
+ (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
6194
6196
  let output = "";
6195
6197
  if (codePoint > 0xffff) {
6196
6198
  codePoint -= 0x10000;
@@ -6210,7 +6212,7 @@ function replaceCodePoint(codePoint) {
6210
6212
  if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
6211
6213
  return 0xfffd;
6212
6214
  }
6213
- return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
6215
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
6214
6216
  }
6215
6217
 
6216
6218
  var CharCodes$1;
@@ -6454,7 +6456,7 @@ class EntityDecoder {
6454
6456
  var _a;
6455
6457
  // Ensure we consumed at least one digit.
6456
6458
  if (this.consumed <= expectedLength) {
6457
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
6459
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
6458
6460
  return 0;
6459
6461
  }
6460
6462
  // Figure out if this is a legit end of the entity
@@ -6529,7 +6531,7 @@ class EntityDecoder {
6529
6531
  const { result, decodeTree } = this;
6530
6532
  const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
6531
6533
  this.emitNamedEntityData(result, valueLength, this.consumed);
6532
- (_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
6534
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
6533
6535
  return this.consumed;
6534
6536
  }
6535
6537
  /**
@@ -6578,7 +6580,7 @@ class EntityDecoder {
6578
6580
  return this.emitNumericEntity(0, 3);
6579
6581
  }
6580
6582
  case EntityDecoderState.NumericStart: {
6581
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
6583
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
6582
6584
  return 0;
6583
6585
  }
6584
6586
  case EntityDecoderState.EntityStart: {
@@ -6936,7 +6938,7 @@ function formatAttributes(attributes, opts) {
6936
6938
  var _a;
6937
6939
  if (!attributes)
6938
6940
  return;
6939
- const encode = ((_a = opts.encodeEntities) !== null && _a !== undefined ? _a : opts.decodeEntities) === false
6941
+ const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
6940
6942
  ? replaceQuotes
6941
6943
  : opts.xmlMode || opts.encodeEntities !== "utf8"
6942
6944
  ? encodeXML
@@ -6944,10 +6946,10 @@ function formatAttributes(attributes, opts) {
6944
6946
  return Object.keys(attributes)
6945
6947
  .map((key) => {
6946
6948
  var _a, _b;
6947
- const value = (_a = attributes[key]) !== null && _a !== undefined ? _a : "";
6949
+ const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
6948
6950
  if (opts.xmlMode === "foreign") {
6949
6951
  /* Fix up mixed-case attribute names */
6950
- key = (_b = attributeNames.get(key)) !== null && _b !== undefined ? _b : key;
6952
+ key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
6951
6953
  }
6952
6954
  if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
6953
6955
  return key;
@@ -7033,7 +7035,7 @@ function renderTag(elem, opts) {
7033
7035
  // Handle SVG / MathML in HTML
7034
7036
  if (opts.xmlMode === "foreign") {
7035
7037
  /* Fix up mixed-case element names */
7036
- elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== undefined ? _a : elem.name;
7038
+ elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
7037
7039
  /* Exit foreign mode at integration points */
7038
7040
  if (elem.parent &&
7039
7041
  foreignModeIntegrationPoints.has(elem.parent.name)) {
@@ -7076,7 +7078,7 @@ function renderText(elem, opts) {
7076
7078
  var _a;
7077
7079
  let data = elem.data || "";
7078
7080
  // If entities weren't decoded, no need to encode them back
7079
- if (((_a = opts.encodeEntities) !== null && _a !== undefined ? _a : opts.decodeEntities) !== false &&
7081
+ if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
7080
7082
  !(!opts.xmlMode &&
7081
7083
  elem.parent &&
7082
7084
  unencodedElements.has(elem.parent.name))) {
@@ -7229,7 +7231,7 @@ function getSiblings(elem) {
7229
7231
  */
7230
7232
  function getAttributeValue(elem, name) {
7231
7233
  var _a;
7232
- return (_a = elem.attribs) === null || _a === undefined ? undefined : _a[name];
7234
+ return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];
7233
7235
  }
7234
7236
  /**
7235
7237
  * Checks whether an element has an attribute.
@@ -7875,7 +7877,7 @@ function getAtomFeed(feedRoot) {
7875
7877
  const entry = { media: getMediaElements(children) };
7876
7878
  addConditionally(entry, "id", "id", children);
7877
7879
  addConditionally(entry, "title", "title", children);
7878
- const href = (_a = getOneElement("link", children)) === null || _a === undefined ? undefined : _a.attribs["href"];
7880
+ const href = (_a = getOneElement("link", children)) === null || _a === void 0 ? void 0 : _a.attribs["href"];
7879
7881
  if (href) {
7880
7882
  entry.link = href;
7881
7883
  }
@@ -7892,7 +7894,7 @@ function getAtomFeed(feedRoot) {
7892
7894
  };
7893
7895
  addConditionally(feed, "id", "id", childs);
7894
7896
  addConditionally(feed, "title", "title", childs);
7895
- const href = (_a = getOneElement("link", childs)) === null || _a === undefined ? undefined : _a.attribs["href"];
7897
+ const href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs["href"];
7896
7898
  if (href) {
7897
7899
  feed.link = href;
7898
7900
  }
@@ -7912,7 +7914,7 @@ function getAtomFeed(feedRoot) {
7912
7914
  */
7913
7915
  function getRssFeed(feedRoot) {
7914
7916
  var _a, _b;
7915
- const childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === undefined ? undefined : _a.children) !== null && _b !== undefined ? _b : [];
7917
+ const childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
7916
7918
  const feed = {
7917
7919
  type: feedRoot.name.substr(0, 3),
7918
7920
  id: "",
@@ -8598,9 +8600,9 @@ function sortByProcedure(arr) {
8598
8600
  }
8599
8601
  function getProcedure(token) {
8600
8602
  var _a, _b;
8601
- let proc = (_a = procedure.get(token.type)) !== null && _a !== undefined ? _a : -1;
8603
+ let proc = (_a = procedure.get(token.type)) !== null && _a !== void 0 ? _a : -1;
8602
8604
  if (token.type === SelectorType.Attribute) {
8603
- proc = (_b = attributes.get(token.action)) !== null && _b !== undefined ? _b : 4;
8605
+ proc = (_b = attributes.get(token.action)) !== null && _b !== void 0 ? _b : 4;
8604
8606
  if (token.action === AttributeAction.Equals && token.name === "id") {
8605
8607
  // Prefer ID selectors (eg. #ID)
8606
8608
  proc = 9;
@@ -8787,7 +8789,7 @@ const attributeRules = {
8787
8789
  }
8788
8790
  return (elem) => {
8789
8791
  var _a;
8790
- return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === undefined ? undefined : _a.startsWith(value)) &&
8792
+ return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) &&
8791
8793
  next(elem);
8792
8794
  };
8793
8795
  },
@@ -8804,12 +8806,12 @@ const attributeRules = {
8804
8806
  return (elem) => {
8805
8807
  var _a;
8806
8808
  return ((_a = adapter
8807
- .getAttributeValue(elem, name)) === null || _a === undefined ? undefined : _a.substr(len).toLowerCase()) === value && next(elem);
8809
+ .getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem);
8808
8810
  };
8809
8811
  }
8810
8812
  return (elem) => {
8811
8813
  var _a;
8812
- return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === undefined ? undefined : _a.endsWith(value)) &&
8814
+ return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) &&
8813
8815
  next(elem);
8814
8816
  };
8815
8817
  },
@@ -8831,7 +8833,7 @@ const attributeRules = {
8831
8833
  }
8832
8834
  return (elem) => {
8833
8835
  var _a;
8834
- return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === undefined ? undefined : _a.includes(value)) &&
8836
+ return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) &&
8835
8837
  next(elem);
8836
8838
  };
8837
8839
  },
@@ -8883,7 +8885,7 @@ function parse(formula) {
8883
8885
  let number = readNumber();
8884
8886
  if (idx < formula.length && formula.charAt(idx) === "n") {
8885
8887
  idx++;
8886
- a = sign * (number !== null && number !== undefined ? number : 1);
8888
+ a = sign * (number !== null && number !== void 0 ? number : 1);
8887
8889
  skipWhitespace();
8888
8890
  if (idx < formula.length) {
8889
8891
  sign = readSign();
@@ -9366,7 +9368,7 @@ function compilePseudoSelector(next, selector, options, context, compileToken) {
9366
9368
  }
9367
9369
  return subselects[name](next, data, options, context, compileToken);
9368
9370
  }
9369
- const userPseudo = (_a = options.pseudos) === null || _a === undefined ? undefined : _a[name];
9371
+ const userPseudo = (_a = options.pseudos) === null || _a === void 0 ? void 0 : _a[name];
9370
9372
  const stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases[name];
9371
9373
  if (typeof stringPseudo === "string") {
9372
9374
  if (data != null) {
@@ -9557,7 +9559,7 @@ const SCOPE_TOKEN = {
9557
9559
  */
9558
9560
  function absolutize(token, { adapter }, context) {
9559
9561
  // TODO Use better check if the context is a document
9560
- const hasContext = !!(context === null || context === undefined ? undefined : context.every((e) => {
9562
+ const hasContext = !!(context === null || context === void 0 ? void 0 : context.every((e) => {
9561
9563
  const parent = adapter.isTag(e) && adapter.getParent(e);
9562
9564
  return e === PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
9563
9565
  }));
@@ -9577,7 +9579,7 @@ function absolutize(token, { adapter }, context) {
9577
9579
  function compileToken(token, options, context) {
9578
9580
  var _a;
9579
9581
  token.forEach(sortByProcedure);
9580
- context = (_a = options.context) !== null && _a !== undefined ? _a : context;
9582
+ context = (_a = options.context) !== null && _a !== void 0 ? _a : context;
9581
9583
  const isArrayContext = Array.isArray(context);
9582
9584
  const finalContext = context && (Array.isArray(context) ? context : [context]);
9583
9585
  // Check if the selector is relative
@@ -9613,7 +9615,7 @@ function compileRules(rules, options, context) {
9613
9615
  var _a;
9614
9616
  return rules.reduce((previous, rule) => previous === boolbase.falseFunc
9615
9617
  ? boolbase.falseFunc
9616
- : compileGeneralSelector(previous, rule, options, context, compileToken), (_a = options.rootFunc) !== null && _a !== undefined ? _a : boolbase.trueFunc);
9618
+ : compileGeneralSelector(previous, rule, options, context, compileToken), (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase.trueFunc);
9617
9619
  }
9618
9620
  function reduceRules(a, b) {
9619
9621
  if (b === boolbase.falseFunc || a === boolbase.trueFunc) {
@@ -9638,11 +9640,11 @@ function convertOptionFormats(options) {
9638
9640
  * We force one format of options to the other one.
9639
9641
  */
9640
9642
  // @ts-expect-error Default options may have incompatible `Node` / `ElementNode`.
9641
- const opts = options !== null && options !== undefined ? options : defaultOptions;
9643
+ const opts = options !== null && options !== void 0 ? options : defaultOptions;
9642
9644
  // @ts-expect-error Same as above.
9643
- (_a = opts.adapter) !== null && _a !== undefined ? _a : (opts.adapter = DomUtils);
9645
+ (_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils);
9644
9646
  // @ts-expect-error `equals` does not exist on `Options`
9645
- (_b = opts.equals) !== null && _b !== undefined ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === undefined ? undefined : _c.equals) !== null && _d !== undefined ? _d : defaultEquals);
9647
+ (_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals);
9646
9648
  return opts;
9647
9649
  }
9648
9650
  function getSelectorFunc(searchFunc) {
@@ -10599,16 +10601,16 @@ class Parser {
10599
10601
  this.writeIndex = 0;
10600
10602
  /** Indicates whether the parser has finished running / `.end` has been called. */
10601
10603
  this.ended = false;
10602
- this.cbs = cbs !== null && cbs !== undefined ? cbs : {};
10604
+ this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
10603
10605
  this.htmlMode = !this.options.xmlMode;
10604
- this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== undefined ? _a : this.htmlMode;
10606
+ this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : this.htmlMode;
10605
10607
  this.lowerCaseAttributeNames =
10606
- (_b = options.lowerCaseAttributeNames) !== null && _b !== undefined ? _b : this.htmlMode;
10608
+ (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : this.htmlMode;
10607
10609
  this.recognizeSelfClosing =
10608
- (_c = options.recognizeSelfClosing) !== null && _c !== undefined ? _c : !this.htmlMode;
10609
- this.tokenizer = new ((_d = options.Tokenizer) !== null && _d !== undefined ? _d : Tokenizer)(this.options, this);
10610
+ (_c = options.recognizeSelfClosing) !== null && _c !== void 0 ? _c : !this.htmlMode;
10611
+ this.tokenizer = new ((_d = options.Tokenizer) !== null && _d !== void 0 ? _d : Tokenizer)(this.options, this);
10610
10612
  this.foreignContext = [!this.htmlMode];
10611
- (_f = (_e = this.cbs).onparserinit) === null || _f === undefined ? undefined : _f.call(_e, this);
10613
+ (_f = (_e = this.cbs).onparserinit) === null || _f === void 0 ? void 0 : _f.call(_e, this);
10612
10614
  }
10613
10615
  // Tokenizer event handlers
10614
10616
  /** @internal */
@@ -10616,14 +10618,14 @@ class Parser {
10616
10618
  var _a, _b;
10617
10619
  const data = this.getSlice(start, endIndex);
10618
10620
  this.endIndex = endIndex - 1;
10619
- (_b = (_a = this.cbs).ontext) === null || _b === undefined ? undefined : _b.call(_a, data);
10621
+ (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
10620
10622
  this.startIndex = endIndex;
10621
10623
  }
10622
10624
  /** @internal */
10623
10625
  ontextentity(cp, endIndex) {
10624
10626
  var _a, _b;
10625
10627
  this.endIndex = endIndex - 1;
10626
- (_b = (_a = this.cbs).ontext) === null || _b === undefined ? undefined : _b.call(_a, fromCodePoint(cp));
10628
+ (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));
10627
10629
  this.startIndex = endIndex;
10628
10630
  }
10629
10631
  /**
@@ -10650,7 +10652,7 @@ class Parser {
10650
10652
  if (impliesClose) {
10651
10653
  while (this.stack.length > 0 && impliesClose.has(this.stack[0])) {
10652
10654
  const element = this.stack.shift();
10653
- (_b = (_a = this.cbs).onclosetag) === null || _b === undefined ? undefined : _b.call(_a, element, true);
10655
+ (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, true);
10654
10656
  }
10655
10657
  }
10656
10658
  if (!this.isVoidElement(name)) {
@@ -10664,7 +10666,7 @@ class Parser {
10664
10666
  }
10665
10667
  }
10666
10668
  }
10667
- (_d = (_c = this.cbs).onopentagname) === null || _d === undefined ? undefined : _d.call(_c, name);
10669
+ (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);
10668
10670
  if (this.cbs.onopentag)
10669
10671
  this.attribs = {};
10670
10672
  }
@@ -10672,7 +10674,7 @@ class Parser {
10672
10674
  var _a, _b;
10673
10675
  this.startIndex = this.openTagStart;
10674
10676
  if (this.attribs) {
10675
- (_b = (_a = this.cbs).onopentag) === null || _b === undefined ? undefined : _b.call(_a, this.tagname, this.attribs, isImplied);
10677
+ (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);
10676
10678
  this.attribs = null;
10677
10679
  }
10678
10680
  if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
@@ -10706,7 +10708,7 @@ class Parser {
10706
10708
  for (let index = 0; index <= pos; index++) {
10707
10709
  const element = this.stack.shift();
10708
10710
  // We know the stack has sufficient elements.
10709
- (_b = (_a = this.cbs).onclosetag) === null || _b === undefined ? undefined : _b.call(_a, element, index !== pos);
10711
+ (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, index !== pos);
10710
10712
  }
10711
10713
  }
10712
10714
  else if (this.htmlMode && name === "p") {
@@ -10717,9 +10719,9 @@ class Parser {
10717
10719
  }
10718
10720
  else if (this.htmlMode && name === "br") {
10719
10721
  // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.
10720
- (_d = (_c = this.cbs).onopentagname) === null || _d === undefined ? undefined : _d.call(_c, "br");
10721
- (_f = (_e = this.cbs).onopentag) === null || _f === undefined ? undefined : _f.call(_e, "br", {}, true);
10722
- (_h = (_g = this.cbs).onclosetag) === null || _h === undefined ? undefined : _h.call(_g, "br", false);
10722
+ (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, "br");
10723
+ (_f = (_e = this.cbs).onopentag) === null || _f === void 0 ? void 0 : _f.call(_e, "br", {}, true);
10724
+ (_h = (_g = this.cbs).onclosetag) === null || _h === void 0 ? void 0 : _h.call(_g, "br", false);
10723
10725
  }
10724
10726
  // Set `startIndex` for next node
10725
10727
  this.startIndex = endIndex + 1;
@@ -10744,7 +10746,7 @@ class Parser {
10744
10746
  // Self-closing tags will be on the top of the stack
10745
10747
  if (this.stack[0] === name) {
10746
10748
  // If the opening tag isn't implied, the closing tag has to be implied.
10747
- (_b = (_a = this.cbs).onclosetag) === null || _b === undefined ? undefined : _b.call(_a, name, !isOpenImplied);
10749
+ (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);
10748
10750
  this.stack.shift();
10749
10751
  }
10750
10752
  }
@@ -10768,7 +10770,7 @@ class Parser {
10768
10770
  onattribend(quote, endIndex) {
10769
10771
  var _a, _b;
10770
10772
  this.endIndex = endIndex;
10771
- (_b = (_a = this.cbs).onattribute) === null || _b === undefined ? undefined : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double
10773
+ (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double
10772
10774
  ? '"'
10773
10775
  : quote === QuoteType.Single
10774
10776
  ? "'"
@@ -10815,8 +10817,8 @@ class Parser {
10815
10817
  oncomment(start, endIndex, offset) {
10816
10818
  var _a, _b, _c, _d;
10817
10819
  this.endIndex = endIndex;
10818
- (_b = (_a = this.cbs).oncomment) === null || _b === undefined ? undefined : _b.call(_a, this.getSlice(start, endIndex - offset));
10819
- (_d = (_c = this.cbs).oncommentend) === null || _d === undefined ? undefined : _d.call(_c);
10820
+ (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));
10821
+ (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
10820
10822
  // Set `startIndex` for next node
10821
10823
  this.startIndex = endIndex + 1;
10822
10824
  }
@@ -10826,13 +10828,13 @@ class Parser {
10826
10828
  this.endIndex = endIndex;
10827
10829
  const value = this.getSlice(start, endIndex - offset);
10828
10830
  if (!this.htmlMode || this.options.recognizeCDATA) {
10829
- (_b = (_a = this.cbs).oncdatastart) === null || _b === undefined ? undefined : _b.call(_a);
10830
- (_d = (_c = this.cbs).ontext) === null || _d === undefined ? undefined : _d.call(_c, value);
10831
- (_f = (_e = this.cbs).oncdataend) === null || _f === undefined ? undefined : _f.call(_e);
10831
+ (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
10832
+ (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
10833
+ (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
10832
10834
  }
10833
10835
  else {
10834
- (_h = (_g = this.cbs).oncomment) === null || _h === undefined ? undefined : _h.call(_g, `[CDATA[${value}]]`);
10835
- (_k = (_j = this.cbs).oncommentend) === null || _k === undefined ? undefined : _k.call(_j);
10836
+ (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);
10837
+ (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
10836
10838
  }
10837
10839
  // Set `startIndex` for next node
10838
10840
  this.startIndex = endIndex + 1;
@@ -10847,14 +10849,14 @@ class Parser {
10847
10849
  this.cbs.onclosetag(this.stack[index], true);
10848
10850
  }
10849
10851
  }
10850
- (_b = (_a = this.cbs).onend) === null || _b === undefined ? undefined : _b.call(_a);
10852
+ (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
10851
10853
  }
10852
10854
  /**
10853
10855
  * Resets the parser to a blank state, ready to parse a new HTML document
10854
10856
  */
10855
10857
  reset() {
10856
10858
  var _a, _b, _c, _d;
10857
- (_b = (_a = this.cbs).onreset) === null || _b === undefined ? undefined : _b.call(_a);
10859
+ (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
10858
10860
  this.tokenizer.reset();
10859
10861
  this.tagname = "";
10860
10862
  this.attribname = "";
@@ -10862,7 +10864,7 @@ class Parser {
10862
10864
  this.stack.length = 0;
10863
10865
  this.startIndex = 0;
10864
10866
  this.endIndex = 0;
10865
- (_d = (_c = this.cbs).onparserinit) === null || _d === undefined ? undefined : _d.call(_c, this);
10867
+ (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
10866
10868
  this.buffers.length = 0;
10867
10869
  this.foreignContext.length = 0;
10868
10870
  this.foreignContext.unshift(!this.htmlMode);
@@ -10904,7 +10906,7 @@ class Parser {
10904
10906
  write(chunk) {
10905
10907
  var _a, _b;
10906
10908
  if (this.ended) {
10907
- (_b = (_a = this.cbs).onerror) === null || _b === undefined ? undefined : _b.call(_a, new Error(".write() after done!"));
10909
+ (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".write() after done!"));
10908
10910
  return;
10909
10911
  }
10910
10912
  this.buffers.push(chunk);
@@ -10921,7 +10923,7 @@ class Parser {
10921
10923
  end(chunk) {
10922
10924
  var _a, _b;
10923
10925
  if (this.ended) {
10924
- (_b = (_a = this.cbs).onerror) === null || _b === undefined ? undefined : _b.call(_a, new Error(".end() after done!"));
10926
+ (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".end() after done!"));
10925
10927
  return;
10926
10928
  }
10927
10929
  if (chunk)
@@ -11027,7 +11029,7 @@ function serializeStylesheet(ast, options) {
11027
11029
  }
11028
11030
  function markOnly(predicate) {
11029
11031
  return (rule) => {
11030
- const sel = "selectors" in rule ? rule.selectors : undefined;
11032
+ const sel = "selectors" in rule ? rule.selectors : void 0;
11031
11033
  if (predicate(rule) === false) {
11032
11034
  rule.$$remove = true;
11033
11035
  }
@@ -11056,7 +11058,7 @@ function walkStyleRules(node, iterator) {
11056
11058
  if (hasNestedRules(rule)) {
11057
11059
  walkStyleRules(rule, iterator);
11058
11060
  }
11059
- rule._other = undefined;
11061
+ rule._other = void 0;
11060
11062
  rule.filterSelectors = filterSelectors;
11061
11063
  return iterator(rule) !== false;
11062
11064
  });
@@ -11369,7 +11371,7 @@ function extendDocument(document) {
11369
11371
  const selectorTokensCache = /* @__PURE__ */ new Map();
11370
11372
  function cachedQuerySelector(sel, node) {
11371
11373
  let selectorTokens = selectorTokensCache.get(sel);
11372
- if (selectorTokens === undefined) {
11374
+ if (selectorTokens === void 0) {
11373
11375
  selectorTokens = parseRelevantSelectors(sel);
11374
11376
  selectorTokensCache.set(sel, selectorTokens);
11375
11377
  }
@@ -11560,11 +11562,11 @@ class Beasties {
11560
11562
  normalizedPath = normalizedPath.substring(pathPrefix.length).replace(/^\//, "");
11561
11563
  }
11562
11564
  if (/^https?:\/\//.test(normalizedPath) || href.startsWith("//")) {
11563
- return undefined;
11565
+ return void 0;
11564
11566
  }
11565
11567
  const filename = _pathModule.resolve(outputPath, normalizedPath);
11566
11568
  if (!isSubpath(outputPath, filename)) {
11567
- return undefined;
11569
+ return void 0;
11568
11570
  }
11569
11571
  let sheet;
11570
11572
  try {
@@ -11616,11 +11618,11 @@ class Beasties {
11616
11618
  const href = link.getAttribute("href");
11617
11619
  let media = link.getAttribute("media");
11618
11620
  if (media && !validateMediaQuery(media)) {
11619
- media = undefined;
11621
+ media = void 0;
11620
11622
  }
11621
11623
  const preloadMode = this.options.preload;
11622
11624
  if (!href?.endsWith(".css")) {
11623
- return undefined;
11625
+ return void 0;
11624
11626
  }
11625
11627
  const style = document.createElement("style");
11626
11628
  style.$$external = true;
@@ -11918,7 +11920,7 @@ class Beasties {
11918
11920
  }
11919
11921
  normalizeCssSelector(sel) {
11920
11922
  let normalizedSelector = __privateGet(this, _selectorCache).get(sel);
11921
- if (normalizedSelector !== undefined) {
11923
+ if (normalizedSelector !== void 0) {
11922
11924
  return normalizedSelector;
11923
11925
  }
11924
11926
  normalizedSelector = sel.replace(removePseudoClassesAndElementsPattern, "").replace(removeTrailingCommasPattern, (match) => match.includes("(") ? "(" : ")").trim();