vite 8.2.1 → 8.3.0-beta.0

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.
@@ -1,6 +1,6 @@
1
1
  import { ft as __commonJSMin, pt as __require } from "./node.js";
2
2
  import { t as require_lib } from "./lib.js";
3
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/fs.js
3
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/fs.js
4
4
  var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  function _export(target, all) {
@@ -34,7 +34,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
34
34
  }
35
35
  }));
36
36
  //#endregion
37
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/unquote.js
37
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/unquote.js
38
38
  var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  Object.defineProperty(exports, "default", {
@@ -52,7 +52,7 @@ var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
52
52
  }
53
53
  }));
54
54
  //#endregion
55
- //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.25/node_modules/icss-utils/src/replaceValueSymbols.js
55
+ //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.26/node_modules/icss-utils/src/replaceValueSymbols.js
56
56
  var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
57
57
  const matchValueName = /[$]?[\w-]+/g;
58
58
  const replaceValueSymbols = (value, replacements) => {
@@ -69,7 +69,7 @@ var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, modul
69
69
  module.exports = replaceValueSymbols;
70
70
  }));
71
71
  //#endregion
72
- //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.25/node_modules/icss-utils/src/replaceSymbols.js
72
+ //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.26/node_modules/icss-utils/src/replaceSymbols.js
73
73
  var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74
74
  const replaceValueSymbols = require_replaceValueSymbols();
75
75
  const replaceSymbols = (css, replacements) => {
@@ -82,7 +82,7 @@ var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) =>
82
82
  module.exports = replaceSymbols;
83
83
  }));
84
84
  //#endregion
85
- //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.25/node_modules/icss-utils/src/extractICSS.js
85
+ //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.26/node_modules/icss-utils/src/extractICSS.js
86
86
  var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87
87
  const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
88
88
  const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
@@ -136,7 +136,7 @@ var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
136
136
  module.exports = extractICSS;
137
137
  }));
138
138
  //#endregion
139
- //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.25/node_modules/icss-utils/src/createICSSRules.js
139
+ //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.26/node_modules/icss-utils/src/createICSSRules.js
140
140
  var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
141
141
  const createImports = (imports, postcss, mode = "rule") => {
142
142
  return Object.keys(imports).map((path) => {
@@ -180,7 +180,7 @@ var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) =
180
180
  module.exports = createICSSRules;
181
181
  }));
182
182
  //#endregion
183
- //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.25/node_modules/icss-utils/src/index.js
183
+ //#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.26/node_modules/icss-utils/src/index.js
184
184
  var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
185
185
  module.exports = {
186
186
  replaceValueSymbols: require_replaceValueSymbols(),
@@ -190,7 +190,7 @@ var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
190
190
  };
191
191
  }));
192
192
  //#endregion
193
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/Parser.js
193
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/Parser.js
194
194
  var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
195
195
  Object.defineProperty(exports, "__esModule", { value: true });
196
196
  Object.defineProperty(exports, "default", {
@@ -262,7 +262,7 @@ var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
262
262
  };
263
263
  }));
264
264
  //#endregion
265
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/saveJSON.js
265
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/saveJSON.js
266
266
  var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
267
267
  Object.defineProperty(exports, "__esModule", { value: true });
268
268
  Object.defineProperty(exports, "default", {
@@ -944,7 +944,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
944
944
  module.exports = camelCase;
945
945
  }));
946
946
  //#endregion
947
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/localsConvention.js
947
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/localsConvention.js
948
948
  var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
949
949
  Object.defineProperty(exports, "__esModule", { value: true });
950
950
  Object.defineProperty(exports, "makeLocalsConventionReducer", {
@@ -999,7 +999,7 @@ var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
999
999
  }
1000
1000
  }));
1001
1001
  //#endregion
1002
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/FileSystemLoader.js
1002
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/FileSystemLoader.js
1003
1003
  var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
1004
1004
  Object.defineProperty(exports, "__esModule", { value: true });
1005
1005
  Object.defineProperty(exports, "default", {
@@ -1088,7 +1088,7 @@ var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
1088
1088
  };
1089
1089
  }));
1090
1090
  //#endregion
1091
- //#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.25/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
1091
+ //#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.26/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
1092
1092
  var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1093
1093
  const PERMANENT_MARKER = 2;
1094
1094
  const TEMPORARY_MARKER = 1;
@@ -1127,7 +1127,7 @@ var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) =
1127
1127
  module.exports = topologicalSort;
1128
1128
  }));
1129
1129
  //#endregion
1130
- //#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.25/node_modules/postcss-modules-extract-imports/src/index.js
1130
+ //#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.26/node_modules/postcss-modules-extract-imports/src/index.js
1131
1131
  var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1132
1132
  const topologicalSort = require_topologicalSort();
1133
1133
  const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
@@ -1260,7 +1260,7 @@ var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1260
1260
  //#endregion
1261
1261
  //#region ../../node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/wasm-hash.js
1262
1262
  var require_wasm_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1263
- const MAX_SHORT_STRING = Math.floor(65472 / 4) & -4;
1263
+ const MAX_SHORT_STRING = Math.floor(16368) & -4;
1264
1264
  var WasmHash = class {
1265
1265
  /**
1266
1266
  * @param {WebAssembly.Instance} instance wasm instance
@@ -1307,28 +1307,29 @@ var require_wasm_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1307
1307
  _updateWithShortString(data, encoding) {
1308
1308
  const { exports: exports$3, buffered, mem, chunkSize } = this;
1309
1309
  let endPos;
1310
- if (data.length < 70) if (!encoding || encoding === "utf-8" || encoding === "utf8") {
1311
- endPos = buffered;
1312
- for (let i = 0; i < data.length; i++) {
1313
- const cc = data.charCodeAt(i);
1314
- if (cc < 128) mem[endPos++] = cc;
1315
- else if (cc < 2048) {
1316
- mem[endPos] = cc >> 6 | 192;
1317
- mem[endPos + 1] = cc & 63 | 128;
1318
- endPos += 2;
1319
- } else {
1320
- endPos += mem.write(data.slice(i), endPos, encoding);
1321
- break;
1310
+ if (data.length < 70) {
1311
+ if (!encoding || encoding === "utf-8" || encoding === "utf8") {
1312
+ endPos = buffered;
1313
+ for (let i = 0; i < data.length; i++) {
1314
+ const cc = data.charCodeAt(i);
1315
+ if (cc < 128) mem[endPos++] = cc;
1316
+ else if (cc < 2048) {
1317
+ mem[endPos] = cc >> 6 | 192;
1318
+ mem[endPos + 1] = cc & 63 | 128;
1319
+ endPos += 2;
1320
+ } else {
1321
+ endPos += mem.write(data.slice(i), endPos, encoding);
1322
+ break;
1323
+ }
1322
1324
  }
1323
- }
1324
- } else if (encoding === "latin1") {
1325
- endPos = buffered;
1326
- for (let i = 0; i < data.length; i++) {
1327
- const cc = data.charCodeAt(i);
1328
- mem[endPos++] = cc;
1329
- }
1325
+ } else if (encoding === "latin1") {
1326
+ endPos = buffered;
1327
+ for (let i = 0; i < data.length; i++) {
1328
+ const cc = data.charCodeAt(i);
1329
+ mem[endPos++] = cc;
1330
+ }
1331
+ } else endPos = buffered + mem.write(data, buffered, encoding);
1330
1332
  } else endPos = buffered + mem.write(data, buffered, encoding);
1331
- else endPos = buffered + mem.write(data, buffered, encoding);
1332
1333
  if (endPos < chunkSize) this.buffered = endPos;
1333
1334
  else {
1334
1335
  const l = endPos & ~(this.chunkSize - 1);
@@ -1423,11 +1424,12 @@ var require_BatchedHash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1423
1424
  this.hash.update(this.string, this.encoding);
1424
1425
  this.string = void 0;
1425
1426
  }
1426
- if (typeof data === "string") if (data.length < MAX_SHORT_STRING && (!inputEncoding || !inputEncoding.startsWith("ba"))) {
1427
- this.string = data;
1428
- this.encoding = inputEncoding;
1429
- } else this.hash.update(data, inputEncoding);
1430
- else this.hash.update(data);
1427
+ if (typeof data === "string") {
1428
+ if (data.length < MAX_SHORT_STRING && (!inputEncoding || !inputEncoding.startsWith("ba"))) {
1429
+ this.string = data;
1430
+ this.encoding = inputEncoding;
1431
+ } else this.hash.update(data, inputEncoding);
1432
+ } else this.hash.update(data);
1431
1433
  return this;
1432
1434
  }
1433
1435
  /**
@@ -2420,9 +2422,10 @@ var require_cssesc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2420
2422
  else counter--;
2421
2423
  }
2422
2424
  value = "\\" + codePoint.toString(16).toUpperCase() + " ";
2423
- } else if (options.escapeEverything) if (regexAnySingleEscape.test(character)) value = "\\" + character;
2424
- else value = "\\" + codePoint.toString(16).toUpperCase() + " ";
2425
- else if (/[\t\n\f\r\x0B]/.test(character)) value = "\\" + codePoint.toString(16).toUpperCase() + " ";
2425
+ } else if (options.escapeEverything) {
2426
+ if (regexAnySingleEscape.test(character)) value = "\\" + character;
2427
+ else value = "\\" + codePoint.toString(16).toUpperCase() + " ";
2428
+ } else if (/[\t\n\f\r\x0B]/.test(character)) value = "\\" + codePoint.toString(16).toUpperCase() + " ";
2426
2429
  else if (character == "\\" || !isIdentifier && (character == "\"" && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) value = "\\" + character;
2427
2430
  else value = character;
2428
2431
  output += value;
@@ -3833,18 +3836,19 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3833
3836
  spaceAfterMeaningfulToken = false;
3834
3837
  break;
3835
3838
  case tokens.comment:
3836
- if (lastAdded) if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") {
3837
- var lastComment = (0, _util.getProp)(node, "spaces", lastAdded, "after") || "";
3838
- var rawLastComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
3839
- (0, _util.ensureObject)(node, "raws", "spaces", lastAdded);
3840
- node.raws.spaces[lastAdded].after = rawLastComment + content;
3841
- } else {
3842
- var lastValue = node[lastAdded] || "";
3843
- var rawLastValue = (0, _util.getProp)(node, "raws", lastAdded) || lastValue;
3844
- (0, _util.ensureObject)(node, "raws");
3845
- node.raws[lastAdded] = rawLastValue + content;
3846
- }
3847
- else commentBefore = commentBefore + content;
3839
+ if (lastAdded) {
3840
+ if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") {
3841
+ var lastComment = (0, _util.getProp)(node, "spaces", lastAdded, "after") || "";
3842
+ var rawLastComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
3843
+ (0, _util.ensureObject)(node, "raws", "spaces", lastAdded);
3844
+ node.raws.spaces[lastAdded].after = rawLastComment + content;
3845
+ } else {
3846
+ var lastValue = node[lastAdded] || "";
3847
+ var rawLastValue = (0, _util.getProp)(node, "raws", lastAdded) || lastValue;
3848
+ (0, _util.ensureObject)(node, "raws");
3849
+ node.raws[lastAdded] = rawLastValue + content;
3850
+ }
3851
+ } else commentBefore = commentBefore + content;
3848
3852
  break;
3849
3853
  default: return this.error("Unexpected \"" + content + "\" found.", { index: token[_tokenize.FIELDS.START_POS] });
3850
3854
  }
@@ -4650,7 +4654,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4650
4654
  module.exports = exports.default;
4651
4655
  }));
4652
4656
  //#endregion
4653
- //#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.25/node_modules/postcss-modules-local-by-default/src/index.js
4657
+ //#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.26/node_modules/postcss-modules-local-by-default/src/index.js
4654
4658
  var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4655
4659
  const selectorParser = require_dist();
4656
4660
  const valueParser = require_lib();
@@ -4932,10 +4936,12 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4932
4936
  } else if (node.type !== "word") return;
4933
4937
  const value = node.type === "word" ? node.value.toLowerCase() : null;
4934
4938
  let shouldParseAnimationName = false;
4935
- if (value && validIdent.test(value)) if ("$" + value in animationKeywords) {
4936
- parsedAnimationKeywords["$" + value] = "$" + value in parsedAnimationKeywords ? parsedAnimationKeywords["$" + value] + 1 : 0;
4937
- shouldParseAnimationName = parsedAnimationKeywords["$" + value] >= animationKeywords["$" + value];
4938
- } else shouldParseAnimationName = true;
4939
+ if (value && validIdent.test(value)) {
4940
+ if ("$" + value in animationKeywords) {
4941
+ parsedAnimationKeywords["$" + value] = "$" + value in parsedAnimationKeywords ? parsedAnimationKeywords["$" + value] + 1 : 0;
4942
+ shouldParseAnimationName = parsedAnimationKeywords["$" + value] >= animationKeywords["$" + value];
4943
+ } else shouldParseAnimationName = true;
4944
+ }
4939
4945
  return localizeDeclNode(node, {
4940
4946
  options: context.options,
4941
4947
  global: context.global,
@@ -5044,7 +5050,7 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5044
5050
  module.exports.postcss = true;
5045
5051
  }));
5046
5052
  //#endregion
5047
- //#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.25/node_modules/postcss-modules-scope/src/index.js
5053
+ //#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.26/node_modules/postcss-modules-scope/src/index.js
5048
5054
  var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5049
5055
  const selectorParser = require_dist();
5050
5056
  const hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -5222,7 +5228,7 @@ var require_string_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5222
5228
  module.exports = hash;
5223
5229
  }));
5224
5230
  //#endregion
5225
- //#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.25/node_modules/postcss-modules-values/src/index.js
5231
+ //#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.26/node_modules/postcss-modules-values/src/index.js
5226
5232
  var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5227
5233
  const ICSSUtils = require_src$4();
5228
5234
  const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
@@ -5309,7 +5315,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5309
5315
  module.exports.postcss = true;
5310
5316
  }));
5311
5317
  //#endregion
5312
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/scoping.js
5318
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/scoping.js
5313
5319
  var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
5314
5320
  Object.defineProperty(exports, "__esModule", { value: true });
5315
5321
  function _export(target, all) {
@@ -5388,7 +5394,7 @@ var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
5388
5394
  }
5389
5395
  }));
5390
5396
  //#endregion
5391
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/pluginFactory.js
5397
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/pluginFactory.js
5392
5398
  var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
5393
5399
  Object.defineProperty(exports, "__esModule", { value: true });
5394
5400
  Object.defineProperty(exports, "makePlugin", {
@@ -5470,7 +5476,7 @@ var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
5470
5476
  }
5471
5477
  }));
5472
5478
  //#endregion
5473
- //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.25/node_modules/postcss-modules/build/index.js
5479
+ //#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.26/node_modules/postcss-modules/build/index.js
5474
5480
  var require_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5475
5481
  Object.defineProperty(exports, "__esModule", { value: true });
5476
5482
  const _fs = __require("fs");
@@ -1650,13 +1650,15 @@ var Tokenizer = class {
1650
1650
  this.active = false;
1651
1651
  }
1652
1652
  _appendCharToCurrentCharacterToken(type, ch) {
1653
- if (this.currentCharacterToken) if (this.currentCharacterToken.type === type) {
1654
- this.currentCharacterToken.chars += ch;
1655
- return;
1656
- } else {
1657
- this.currentLocation = this.getCurrentLocation(0);
1658
- this._emitCurrentCharacterToken(this.currentLocation);
1659
- this.preprocessor.dropParsedChunk();
1653
+ if (this.currentCharacterToken) {
1654
+ if (this.currentCharacterToken.type === type) {
1655
+ this.currentCharacterToken.chars += ch;
1656
+ return;
1657
+ } else {
1658
+ this.currentLocation = this.getCurrentLocation(0);
1659
+ this._emitCurrentCharacterToken(this.currentLocation);
1660
+ this.preprocessor.dropParsedChunk();
1661
+ }
1660
1662
  }
1661
1663
  this._createCharacterToken(type, ch);
1662
1664
  }
@@ -2632,14 +2634,15 @@ var Tokenizer = class {
2632
2634
  } else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) {
2633
2635
  this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1);
2634
2636
  this.state = State.DOCTYPE;
2635
- } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) if (this.inForeignNode) this.state = State.CDATA_SECTION;
2636
- else {
2637
- this._err(ERR.cdataInHtmlContent);
2638
- this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
2639
- this.currentToken.data = "[CDATA[";
2640
- this.state = State.BOGUS_COMMENT;
2641
- }
2642
- else if (!this._ensureHibernation()) {
2637
+ } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) {
2638
+ if (this.inForeignNode) this.state = State.CDATA_SECTION;
2639
+ else {
2640
+ this._err(ERR.cdataInHtmlContent);
2641
+ this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
2642
+ this.currentToken.data = "[CDATA[";
2643
+ this.state = State.BOGUS_COMMENT;
2644
+ }
2645
+ } else if (!this._ensureHibernation()) {
2643
2646
  this._err(ERR.incorrectlyOpenedComment);
2644
2647
  this._createCommentToken(2);
2645
2648
  this.state = State.BOGUS_COMMENT;
@@ -3308,13 +3311,15 @@ var Tokenizer = class {
3308
3311
  }
3309
3312
  _stateCharacterReference() {
3310
3313
  let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
3311
- if (length < 0) if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
3312
- else {
3313
- this.active = false;
3314
- this.preprocessor.pos = this.preprocessor.html.length - 1;
3315
- this.consumedAfterSnapshot = 0;
3316
- this.preprocessor.endOfChunkHit = true;
3317
- return;
3314
+ if (length < 0) {
3315
+ if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
3316
+ else {
3317
+ this.active = false;
3318
+ this.preprocessor.pos = this.preprocessor.html.length - 1;
3319
+ this.consumedAfterSnapshot = 0;
3320
+ this.preprocessor.endOfChunkHit = true;
3321
+ return;
3322
+ }
3318
3323
  }
3319
3324
  if (length === 0) {
3320
3325
  this.preprocessor.pos = this.entityStartPos;
@@ -3510,13 +3515,15 @@ var OpenElementStack = class {
3510
3515
  }
3511
3516
  remove(element) {
3512
3517
  const idx = this._indexOf(element);
3513
- if (idx >= 0) if (idx === this.stackTop) this.pop();
3514
- else {
3515
- this.items.splice(idx, 1);
3516
- this.tagIDs.splice(idx, 1);
3517
- this.stackTop--;
3518
- this._updateCurrentElement();
3519
- this.handler.onItemPop(element, false);
3518
+ if (idx >= 0) {
3519
+ if (idx === this.stackTop) this.pop();
3520
+ else {
3521
+ this.items.splice(idx, 1);
3522
+ this.tagIDs.splice(idx, 1);
3523
+ this.stackTop--;
3524
+ this._updateCurrentElement();
3525
+ this.handler.onItemPop(element, false);
3526
+ }
3520
3527
  }
3521
3528
  }
3522
3529
  tryPeekProperlyNestedBodyElement() {