@diagonal-hq/cli 0.22.1 → 0.22.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +1155 -564
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -8951,7 +8951,7 @@ var require_typescript = __commonJS({
8951
8951
  isBuilderProgram: () => isBuilderProgram,
8952
8952
  isBundle: () => isBundle,
8953
8953
  isCallChain: () => isCallChain,
8954
- isCallExpression: () => isCallExpression5,
8954
+ isCallExpression: () => isCallExpression4,
8955
8955
  isCallExpressionTarget: () => isCallExpressionTarget,
8956
8956
  isCallLikeExpression: () => isCallLikeExpression,
8957
8957
  isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
@@ -9313,7 +9313,7 @@ var require_typescript = __commonJS({
9313
9313
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
9314
9314
  isNamespaceImport: () => isNamespaceImport,
9315
9315
  isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
9316
- isNewExpression: () => isNewExpression4,
9316
+ isNewExpression: () => isNewExpression3,
9317
9317
  isNewExpressionTarget: () => isNewExpressionTarget,
9318
9318
  isNewScopeNode: () => isNewScopeNode,
9319
9319
  isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
@@ -23535,7 +23535,7 @@ ${lanes.join("\n")}
23535
23535
  return isElementAccessExpression(node) && !!(node.flags & 64);
23536
23536
  }
23537
23537
  function isCallChain(node) {
23538
- return isCallExpression5(node) && !!(node.flags & 64);
23538
+ return isCallExpression4(node) && !!(node.flags & 64);
23539
23539
  }
23540
23540
  function isOptionalChain(node) {
23541
23541
  const kind = node.kind;
@@ -26855,7 +26855,7 @@ ${lanes.join("\n")}
26855
26855
  return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34;
26856
26856
  }
26857
26857
  function isAssignmentDeclaration(decl) {
26858
- return isBinaryExpression2(decl) || isAccessExpression(decl) || isIdentifier5(decl) || isCallExpression5(decl);
26858
+ return isBinaryExpression2(decl) || isAccessExpression(decl) || isIdentifier5(decl) || isCallExpression4(decl);
26859
26859
  }
26860
26860
  function getEffectiveInitializer(node) {
26861
26861
  if (isInJSFile(node) && node.initializer && isBinaryExpression2(node.initializer) && (node.initializer.operatorToken.kind === 57 || node.initializer.operatorToken.kind === 61) && node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {
@@ -26875,7 +26875,7 @@ ${lanes.join("\n")}
26875
26875
  const isPrototypeAssignment = isPrototypeAccess(node.parent.left);
26876
26876
  return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment);
26877
26877
  }
26878
- if (node && isCallExpression5(node) && isBindableObjectDefinePropertyCall(node)) {
26878
+ if (node && isCallExpression4(node) && isBindableObjectDefinePropertyCall(node)) {
26879
26879
  const result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype");
26880
26880
  if (result) {
26881
26881
  return result;
@@ -26883,7 +26883,7 @@ ${lanes.join("\n")}
26883
26883
  }
26884
26884
  }
26885
26885
  function getExpandoInitializer(initializer, isPrototypeAssignment) {
26886
- if (isCallExpression5(initializer)) {
26886
+ if (isCallExpression4(initializer)) {
26887
26887
  const e = skipParentheses(initializer.expression);
26888
26888
  return e.kind === 219 || e.kind === 220 ? initializer : void 0;
26889
26889
  }
@@ -26986,7 +26986,7 @@ ${lanes.join("\n")}
26986
26986
  return expr.argumentExpression;
26987
26987
  }
26988
26988
  function getAssignmentDeclarationKindWorker(expr) {
26989
- if (isCallExpression5(expr)) {
26989
+ if (isCallExpression4(expr)) {
26990
26990
  if (!isBindableObjectDefinePropertyCall(expr)) {
26991
26991
  return 0;
26992
26992
  }
@@ -33059,7 +33059,7 @@ ${lanes.join("\n")}
33059
33059
  }
33060
33060
  function parenthesizeExpressionOfExpressionStatement(expression2) {
33061
33061
  const emittedExpression = skipPartiallyEmittedExpressions(expression2);
33062
- if (isCallExpression5(emittedExpression)) {
33062
+ if (isCallExpression4(emittedExpression)) {
33063
33063
  const callee = emittedExpression.expression;
33064
33064
  const kind = skipPartiallyEmittedExpressions(callee).kind;
33065
33065
  if (kind === 219 || kind === 220) {
@@ -40015,7 +40015,7 @@ ${lanes.join("\n")}
40015
40015
  })(name => super[name], (name, value) => super[name] = value);`
40016
40016
  };
40017
40017
  function isCallToHelper(firstSegment, helperName) {
40018
- return isCallExpression5(firstSegment) && isIdentifier5(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192) !== 0 && firstSegment.expression.escapedText === helperName;
40018
+ return isCallExpression4(firstSegment) && isIdentifier5(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192) !== 0 && firstSegment.expression.escapedText === helperName;
40019
40019
  }
40020
40020
  function isNumericLiteral2(node) {
40021
40021
  return node.kind === 9;
@@ -40260,10 +40260,10 @@ ${lanes.join("\n")}
40260
40260
  function isElementAccessExpression(node) {
40261
40261
  return node.kind === 213;
40262
40262
  }
40263
- function isCallExpression5(node) {
40263
+ function isCallExpression4(node) {
40264
40264
  return node.kind === 214;
40265
40265
  }
40266
- function isNewExpression4(node) {
40266
+ function isNewExpression3(node) {
40267
40267
  return node.kind === 215;
40268
40268
  }
40269
40269
  function isTaggedTemplateExpression3(node) {
@@ -60677,7 +60677,7 @@ ${lanes.join("\n")}
60677
60677
  if (isFunctionLikeDeclaration(getAssignedExpandoInitializer(declaration))) {
60678
60678
  includes = 8192;
60679
60679
  excludes = 103359;
60680
- } else if (isCallExpression5(declaration) && isBindableObjectDefinePropertyCall(declaration)) {
60680
+ } else if (isCallExpression4(declaration) && isBindableObjectDefinePropertyCall(declaration)) {
60681
60681
  if (some(declaration.arguments[2].properties, (p) => {
60682
60682
  const id = getNameOfDeclaration(p);
60683
60683
  return !!id && isIdentifier5(id) && idText(id) === "set";
@@ -60720,7 +60720,7 @@ ${lanes.join("\n")}
60720
60720
  return true;
60721
60721
  }
60722
60722
  const node = symbol.valueDeclaration;
60723
- if (node && isCallExpression5(node)) {
60723
+ if (node && isCallExpression4(node)) {
60724
60724
  return !!getAssignedExpandoInitializer(node);
60725
60725
  }
60726
60726
  let init = !node ? void 0 : isVariableDeclaration3(node) ? node.initializer : isBinaryExpression2(node) ? node.right : isPropertyAccessExpression(node) && isBinaryExpression2(node.parent) ? node.parent.right : void 0;
@@ -71804,7 +71804,7 @@ ${lanes.join("\n")}
71804
71804
  if (d.kind === 179) {
71805
71805
  return d;
71806
71806
  }
71807
- if (isCallExpression5(d) && isBindableObjectDefinePropertyCall(d)) {
71807
+ if (isCallExpression4(d) && isBindableObjectDefinePropertyCall(d)) {
71808
71808
  return forEach(d.arguments[2].properties, (propDecl) => {
71809
71809
  const id = getNameOfDeclaration(propDecl);
71810
71810
  if (!!id && isIdentifier5(id) && idText(id) === "set") {
@@ -72296,7 +72296,7 @@ ${lanes.join("\n")}
72296
72296
  let declaration = firstDefined(symbol.declarations, (d) => getNameOfDeclaration(d) ? d : void 0);
72297
72297
  const name2 = declaration && getNameOfDeclaration(declaration);
72298
72298
  if (declaration && name2) {
72299
- if (isCallExpression5(declaration) && isBindableObjectDefinePropertyCall(declaration)) {
72299
+ if (isCallExpression4(declaration) && isBindableObjectDefinePropertyCall(declaration)) {
72300
72300
  return symbolName(symbol);
72301
72301
  }
72302
72302
  if (isComputedPropertyName(name2) && !(getCheckFlags(symbol) & 4096)) {
@@ -73035,7 +73035,7 @@ ${lanes.join("\n")}
73035
73035
  if (symbol.declarations) {
73036
73036
  let jsdocType;
73037
73037
  for (const declaration of symbol.declarations) {
73038
- const expression2 = isBinaryExpression2(declaration) || isCallExpression5(declaration) ? declaration : isAccessExpression(declaration) ? isBinaryExpression2(declaration.parent) ? declaration.parent : declaration : void 0;
73038
+ const expression2 = isBinaryExpression2(declaration) || isCallExpression4(declaration) ? declaration : isAccessExpression(declaration) ? isBinaryExpression2(declaration.parent) ? declaration.parent : declaration : void 0;
73039
73039
  if (!expression2) {
73040
73040
  continue;
73041
73041
  }
@@ -73047,11 +73047,11 @@ ${lanes.join("\n")}
73047
73047
  definedInMethod = true;
73048
73048
  }
73049
73049
  }
73050
- if (!isCallExpression5(expression2)) {
73050
+ if (!isCallExpression4(expression2)) {
73051
73051
  jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression2, symbol, declaration);
73052
73052
  }
73053
73053
  if (!jsdocType) {
73054
- (types2 || (types2 = [])).push(isBinaryExpression2(expression2) || isCallExpression5(expression2) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression2, kind) : neverType);
73054
+ (types2 || (types2 = [])).push(isBinaryExpression2(expression2) || isCallExpression4(expression2) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression2, kind) : neverType);
73055
73055
  }
73056
73056
  }
73057
73057
  type = jsdocType;
@@ -73137,7 +73137,7 @@ ${lanes.join("\n")}
73137
73137
  return declaredType;
73138
73138
  }
73139
73139
  function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression2, kind) {
73140
- if (isCallExpression5(expression2)) {
73140
+ if (isCallExpression4(expression2)) {
73141
73141
  if (resolvedSymbol) {
73142
73142
  return getTypeOfSymbol(resolvedSymbol);
73143
73143
  }
@@ -73483,7 +73483,7 @@ ${lanes.join("\n")}
73483
73483
  let type;
73484
73484
  if (declaration.kind === 278) {
73485
73485
  type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration);
73486
- } else if (isBinaryExpression2(declaration) || isInJSFile(declaration) && (isCallExpression5(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression2(declaration.parent))) {
73486
+ } else if (isBinaryExpression2(declaration) || isInJSFile(declaration) && (isCallExpression4(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression2(declaration.parent))) {
73487
73487
  type = getWidenedTypeForAssignmentDeclaration(symbol);
73488
73488
  } else if (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isIdentifier5(declaration) || isStringLiteralLike(declaration) || isNumericLiteral2(declaration) || isClassDeclaration4(declaration) || isFunctionDeclaration3(declaration) || isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration) || isMethodSignature(declaration) || isSourceFile(declaration)) {
73489
73489
  if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) {
@@ -86908,7 +86908,7 @@ ${lanes.join("\n")}
86908
86908
  case "BigUint64Array":
86909
86909
  return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;
86910
86910
  case "await":
86911
- if (isCallExpression5(node.parent)) {
86911
+ if (isCallExpression4(node.parent)) {
86912
86912
  return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
86913
86913
  }
86914
86914
  // falls through
@@ -90308,9 +90308,9 @@ ${lanes.join("\n")}
90308
90308
  return container.parent.parent.left.expression;
90309
90309
  } else if (container.kind === 219 && container.parent.kind === 304 && container.parent.parent.kind === 211 && isBinaryExpression2(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6) {
90310
90310
  return container.parent.parent.parent.left.expression;
90311
- } else if (container.kind === 219 && isPropertyAssignment(container.parent) && isIdentifier5(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression5(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9) {
90311
+ } else if (container.kind === 219 && isPropertyAssignment(container.parent) && isIdentifier5(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression4(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9) {
90312
90312
  return container.parent.parent.parent.arguments[0].expression;
90313
- } else if (isMethodDeclaration(container) && isIdentifier5(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression5(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9) {
90313
+ } else if (isMethodDeclaration(container) && isIdentifier5(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression4(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9) {
90314
90314
  return container.parent.parent.arguments[0].expression;
90315
90315
  }
90316
90316
  }
@@ -94291,7 +94291,7 @@ ${lanes.join("\n")}
94291
94291
  return void 0;
94292
94292
  }
94293
94293
  const thisType = getThisTypeOfSignature(signature);
94294
- if (thisType && thisType !== voidType && !(isNewExpression4(node) || isCallExpression5(node) && isSuperProperty(node.expression))) {
94294
+ if (thisType && thisType !== voidType && !(isNewExpression3(node) || isCallExpression4(node) && isSuperProperty(node.expression))) {
94295
94295
  const thisArgumentNode = getThisArgumentOfCall(node);
94296
94296
  const thisArgumentType = getThisArgumentType(thisArgumentNode);
94297
94297
  const errorNode = reportErrors2 ? thisArgumentNode || node : void 0;
@@ -94469,7 +94469,7 @@ ${lanes.join("\n")}
94469
94469
  return { start, length: length2, sourceFile };
94470
94470
  }
94471
94471
  function getDiagnosticForCallNode(node, message, ...args) {
94472
- if (isCallExpression5(node)) {
94472
+ if (isCallExpression4(node)) {
94473
94473
  const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node);
94474
94474
  if ("message" in message) {
94475
94475
  return createFileDiagnostic(sourceFile, start, length2, message, ...args);
@@ -94495,7 +94495,7 @@ ${lanes.join("\n")}
94495
94495
  return callLike;
94496
94496
  }
94497
94497
  function isPromiseResolveArityError(node) {
94498
- if (!isCallExpression5(node) || !isIdentifier5(node.expression)) return false;
94498
+ if (!isCallExpression4(node) || !isIdentifier5(node.expression)) return false;
94499
94499
  const symbol = resolveName(
94500
94500
  node.expression,
94501
94501
  node.expression.escapedText,
@@ -94506,7 +94506,7 @@ ${lanes.join("\n")}
94506
94506
  false
94507
94507
  );
94508
94508
  const decl = symbol == null ? void 0 : symbol.valueDeclaration;
94509
- if (!decl || !isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !isNewExpression4(decl.parent.parent) || !isIdentifier5(decl.parent.parent.expression)) {
94509
+ if (!decl || !isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !isNewExpression3(decl.parent.parent) || !isIdentifier5(decl.parent.parent.expression)) {
94510
94510
  return false;
94511
94511
  }
94512
94512
  const globalPromiseSymbol = getGlobalPromiseConstructorSymbol(
@@ -95370,7 +95370,7 @@ ${lanes.join("\n")}
95370
95370
  );
95371
95371
  }
95372
95372
  let headMessage = isCall2 ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable;
95373
- if (isCallExpression5(errorTarget.parent) && errorTarget.parent.arguments.length === 0) {
95373
+ if (isCallExpression4(errorTarget.parent) && errorTarget.parent.arguments.length === 0) {
95374
95374
  const { resolvedSymbol } = getNodeLinks(errorTarget);
95375
95375
  if (resolvedSymbol && resolvedSymbol.flags & 32768) {
95376
95376
  headMessage = Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without;
@@ -95387,7 +95387,7 @@ ${lanes.join("\n")}
95387
95387
  if (relatedInfo) {
95388
95388
  addRelatedInfo(diagnostic2, createDiagnosticForNode(errorTarget, relatedInfo));
95389
95389
  }
95390
- if (isCallExpression5(errorTarget.parent)) {
95390
+ if (isCallExpression4(errorTarget.parent)) {
95391
95391
  const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent);
95392
95392
  diagnostic2.start = start;
95393
95393
  diagnostic2.length = length2;
@@ -95915,7 +95915,7 @@ ${lanes.join("\n")}
95915
95915
  }
95916
95916
  }
95917
95917
  function isSymbolOrSymbolForCall(node) {
95918
- if (!isCallExpression5(node)) return false;
95918
+ if (!isCallExpression4(node)) return false;
95919
95919
  let left = node.expression;
95920
95920
  if (isPropertyAccessExpression(left) && left.name.escapedText === "for") {
95921
95921
  left = left.expression;
@@ -96318,7 +96318,7 @@ ${lanes.join("\n")}
96318
96318
  }
96319
96319
  if (node.keywordToken === 102) {
96320
96320
  if (node.name.escapedText === "defer") {
96321
- Debug.assert(!isCallExpression5(node.parent) || node.parent.expression !== node, "Trying to get the type of `import.defer` in `import.defer(...)`");
96321
+ Debug.assert(!isCallExpression4(node.parent) || node.parent.expression !== node, "Trying to get the type of `import.defer` in `import.defer(...)`");
96322
96322
  return errorType;
96323
96323
  }
96324
96324
  return checkImportMetaProperty(node);
@@ -97540,7 +97540,7 @@ ${lanes.join("\n")}
97540
97540
  return true;
97541
97541
  }
97542
97542
  function isReadonlyAssignmentDeclaration(d) {
97543
- if (!isCallExpression5(d)) {
97543
+ if (!isCallExpression4(d)) {
97544
97544
  return false;
97545
97545
  }
97546
97546
  if (!isBindableObjectDefinePropertyCall(d)) {
@@ -98763,7 +98763,7 @@ ${lanes.join("\n")}
98763
98763
  }
98764
98764
  }
98765
98765
  function isIndirectCall(node) {
98766
- return node.parent.kind === 218 && isNumericLiteral2(node.left) && node.left.text === "0" && (isCallExpression5(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 216) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
98766
+ return node.parent.kind === 218 && isNumericLiteral2(node.left) && node.left.text === "0" && (isCallExpression4(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 216) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
98767
98767
  (isAccessExpression(node.right) || isIdentifier5(node.right) && node.right.escapedText === "eval");
98768
98768
  }
98769
98769
  function checkForDisallowedESSymbolOperand(operator2) {
@@ -99512,7 +99512,7 @@ ${lanes.join("\n")}
99512
99512
  const type = getQuickTypeOfExpression(expr.expression);
99513
99513
  return type ? getAwaitedType(type) : void 0;
99514
99514
  }
99515
- if (isCallExpression5(expr) && expr.expression.kind !== 108 && !isRequireCall(
99515
+ if (isCallExpression4(expr) && expr.expression.kind !== 108 && !isRequireCall(
99516
99516
  expr,
99517
99517
  /*requireStringLiteralLikeArgument*/
99518
99518
  true
@@ -101305,7 +101305,7 @@ ${lanes.join("\n")}
101305
101305
  node = node.expression;
101306
101306
  continue;
101307
101307
  }
101308
- if (isCallExpression5(node)) {
101308
+ if (isCallExpression4(node)) {
101309
101309
  if (!canHaveCallExpression) {
101310
101310
  errorNode = node;
101311
101311
  }
@@ -102486,7 +102486,7 @@ ${lanes.join("\n")}
102486
102486
  }
102487
102487
  childExpression = childExpression.expression;
102488
102488
  testedExpression = testedExpression.expression;
102489
- } else if (isCallExpression5(testedExpression) && isCallExpression5(childExpression)) {
102489
+ } else if (isCallExpression4(testedExpression) && isCallExpression4(childExpression)) {
102490
102490
  childExpression = childExpression.expression;
102491
102491
  testedExpression = testedExpression.expression;
102492
102492
  } else {
@@ -106595,7 +106595,7 @@ ${lanes.join("\n")}
106595
106595
  ) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) {
106596
106596
  return resolveExternalModuleName(node, node, ignoreErrors);
106597
106597
  }
106598
- if (isCallExpression5(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) {
106598
+ if (isCallExpression4(parent2) && isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) {
106599
106599
  return getSymbolOfDeclaration(parent2);
106600
106600
  }
106601
106601
  // falls through
@@ -109358,7 +109358,7 @@ ${lanes.join("\n")}
109358
109358
  break;
109359
109359
  case 102:
109360
109360
  if (escapedText !== "meta") {
109361
- const isCallee = isCallExpression5(node.parent) && node.parent.expression === node;
109361
+ const isCallee = isCallExpression4(node.parent) && node.parent.expression === node;
109362
109362
  if (escapedText === "defer") {
109363
109363
  if (!isCallee) {
109364
109364
  return grammarErrorAtPos(node, node.end, 0, Diagnostics._0_expected, "(");
@@ -126013,7 +126013,7 @@ ${lanes.join("\n")}
126013
126013
  ) && isCapturedThis(node.left);
126014
126014
  }
126015
126015
  function isTransformedSuperCall(node) {
126016
- return isCallExpression5(node) && isPropertyAccessExpression(node.expression) && isSyntheticSuper(node.expression.expression) && isIdentifier5(node.expression.name) && (idText(node.expression.name) === "call" || idText(node.expression.name) === "apply") && node.arguments.length >= 1 && node.arguments[0].kind === 110;
126016
+ return isCallExpression4(node) && isPropertyAccessExpression(node.expression) && isSyntheticSuper(node.expression.expression) && isIdentifier5(node.expression.name) && (idText(node.expression.name) === "call" || idText(node.expression.name) === "apply") && node.arguments.length >= 1 && node.arguments[0].kind === 110;
126017
126017
  }
126018
126018
  function isTransformedSuperCallWithFallback(node) {
126019
126019
  return isBinaryExpression2(node) && node.operatorToken.kind === 57 && node.right.kind === 110 && isTransformedSuperCall(node.left);
@@ -128565,7 +128565,7 @@ ${lanes.join("\n")}
128565
128565
  if (!aliasAssignment && isBinaryExpression2(initializer) && initializer.operatorToken.kind === 28) {
128566
128566
  aliasAssignment = tryCast(initializer.left, isAssignmentExpression3);
128567
128567
  }
128568
- const call = cast3(aliasAssignment ? skipOuterExpressions(aliasAssignment.right) : initializer, isCallExpression5);
128568
+ const call = cast3(aliasAssignment ? skipOuterExpressions(aliasAssignment.right) : initializer, isCallExpression4);
128569
128569
  const func = cast3(skipOuterExpressions(call.expression), isFunctionExpression2);
128570
128570
  const funcStatements = func.body.statements;
128571
128571
  let classBodyStart = 0;
@@ -156635,7 +156635,7 @@ ${lanes.join("\n")}
156635
156635
  }
156636
156636
  function isContextuallyTyped(node) {
156637
156637
  return findAncestor(node.parent, (n) => {
156638
- return isCallExpression5(n) || !isFunctionLikeDeclaration(n) && !!getEffectiveTypeAnnotationNode(n) || isJsxElement(n) || isJsxExpression(n);
156638
+ return isCallExpression4(n) || !isFunctionLikeDeclaration(n) && !!getEffectiveTypeAnnotationNode(n) || isJsxElement(n) || isJsxExpression(n);
156639
156639
  });
156640
156640
  }
156641
156641
  }
@@ -157403,10 +157403,10 @@ ${lanes.join("\n")}
157403
157403
  return false;
157404
157404
  }
157405
157405
  function isCallExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) {
157406
- return isCalleeWorker(node, isCallExpression5, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);
157406
+ return isCalleeWorker(node, isCallExpression4, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);
157407
157407
  }
157408
157408
  function isNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) {
157409
- return isCalleeWorker(node, isNewExpression4, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);
157409
+ return isCalleeWorker(node, isNewExpression3, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);
157410
157410
  }
157411
157411
  function isCallOrNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) {
157412
157412
  return isCalleeWorker(node, isCallOrNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);
@@ -158031,7 +158031,7 @@ ${lanes.join("\n")}
158031
158031
  return parent2.type.elementType.typeName;
158032
158032
  }
158033
158033
  if (!forRename) {
158034
- if (node.kind === 105 && isNewExpression4(parent2) || node.kind === 116 && isVoidExpression(parent2) || node.kind === 114 && isTypeOfExpression(parent2) || node.kind === 135 && isAwaitExpression2(parent2) || node.kind === 127 && isYieldExpression3(parent2) || node.kind === 91 && isDeleteExpression(parent2)) {
158034
+ if (node.kind === 105 && isNewExpression3(parent2) || node.kind === 116 && isVoidExpression(parent2) || node.kind === 114 && isTypeOfExpression(parent2) || node.kind === 135 && isAwaitExpression2(parent2) || node.kind === 127 && isYieldExpression3(parent2) || node.kind === 91 && isDeleteExpression(parent2)) {
158035
158035
  if (parent2.expression) {
158036
158036
  return skipOuterExpressions(parent2.expression);
158037
158037
  }
@@ -158397,7 +158397,7 @@ ${lanes.join("\n")}
158397
158397
  true
158398
158398
  );
158399
158399
  }
158400
- const signatures = isNewExpression4(called.parent) ? type.getConstructSignatures() : type.getCallSignatures();
158400
+ const signatures = isNewExpression3(called.parent) ? type.getConstructSignatures() : type.getCallSignatures();
158401
158401
  return signatures.filter((candidate) => !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount);
158402
158402
  }
158403
158403
  function getPossibleTypeArgumentsInfo(tokenIn, sourceFile) {
@@ -163427,7 +163427,7 @@ ${lanes.join("\n")}
163427
163427
  }
163428
163428
  let currentNode = node.expression.expression;
163429
163429
  while (isPromiseHandler(currentNode) || isPropertyAccessExpression(currentNode)) {
163430
- if (isCallExpression5(currentNode)) {
163430
+ if (isCallExpression4(currentNode)) {
163431
163431
  if (!hasSupportedNumberOfArguments(currentNode) || !currentNode.arguments.every((arg) => isFixablePromiseArgument(arg, checker))) {
163432
163432
  return false;
163433
163433
  }
@@ -163439,7 +163439,7 @@ ${lanes.join("\n")}
163439
163439
  return true;
163440
163440
  }
163441
163441
  function isPromiseHandler(node) {
163442
- return isCallExpression5(node) && (hasPropertyAccessExpressionWithName(node, "then") || hasPropertyAccessExpressionWithName(node, "catch") || hasPropertyAccessExpressionWithName(node, "finally"));
163442
+ return isCallExpression4(node) && (hasPropertyAccessExpressionWithName(node, "then") || hasPropertyAccessExpressionWithName(node, "catch") || hasPropertyAccessExpressionWithName(node, "finally"));
163443
163443
  }
163444
163444
  function hasSupportedNumberOfArguments(node) {
163445
163445
  const name = node.expression.name.text;
@@ -164033,7 +164033,7 @@ interface Symbol {
164033
164033
  break;
164034
164034
  case 278: {
164035
164035
  const expression22 = skipOuterExpressions(node.expression);
164036
- const child = isObjectLiteralExpression(expression22) || isCallExpression5(expression22) || isClassExpression2(expression22) ? expression22 : isArrowFunction(expression22) || isFunctionExpression2(expression22) ? expression22.body : void 0;
164036
+ const child = isObjectLiteralExpression(expression22) || isCallExpression4(expression22) || isClassExpression2(expression22) ? expression22 : isArrowFunction(expression22) || isFunctionExpression2(expression22) ? expression22.body : void 0;
164037
164037
  if (child) {
164038
164038
  startNode(node);
164039
164039
  addChildrenRecursively(child);
@@ -164219,8 +164219,8 @@ interface Symbol {
164219
164219
  function isPossibleConstructor(node) {
164220
164220
  return isFunctionExpression2(node) || isFunctionDeclaration3(node) || isVariableDeclaration3(node);
164221
164221
  }
164222
- const bAssignmentDeclarationKind = isBinaryExpression2(b2.node) || isCallExpression5(b2.node) ? getAssignmentDeclarationKind(b2.node) : 0;
164223
- const aAssignmentDeclarationKind = isBinaryExpression2(a.node) || isCallExpression5(a.node) ? getAssignmentDeclarationKind(a.node) : 0;
164222
+ const bAssignmentDeclarationKind = isBinaryExpression2(b2.node) || isCallExpression4(b2.node) ? getAssignmentDeclarationKind(b2.node) : 0;
164223
+ const aAssignmentDeclarationKind = isBinaryExpression2(a.node) || isCallExpression4(a.node) ? getAssignmentDeclarationKind(a.node) : 0;
164224
164224
  if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(b2.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration4(a.node) && isSynthesized(a.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isClassDeclaration4(b2.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration4(a.node) && isSynthesized(a.node) && isPossibleConstructor(b2.node) || isClassDeclaration4(b2.node) && isPossibleConstructor(a.node) && isSynthesized(a.node)) {
164225
164225
  let lastANode = a.additionalNodes && lastOrUndefined(a.additionalNodes) || a.node;
164226
164226
  if (!isClassDeclaration4(a.node) && !isClassDeclaration4(b2.node) || isPossibleConstructor(a.node) || isPossibleConstructor(b2.node)) {
@@ -164542,7 +164542,7 @@ interface Symbol {
164542
164542
  return "default";
164543
164543
  } else if (isClassLike(node)) {
164544
164544
  return "<class>";
164545
- } else if (isCallExpression5(parent2)) {
164545
+ } else if (isCallExpression4(parent2)) {
164546
164546
  let name = getCalledExpressionName(parent2.expression);
164547
164547
  if (name !== void 0) {
164548
164548
  name = cleanText(name);
@@ -168022,7 +168022,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
168022
168022
  return chainStartsWith(chain2, subchain) ? subchain : void 0;
168023
168023
  }
168024
168024
  function chainStartsWith(chain2, subchain) {
168025
- while (isCallExpression5(chain2) || isPropertyAccessExpression(chain2) || isElementAccessExpression(chain2)) {
168025
+ while (isCallExpression4(chain2) || isPropertyAccessExpression(chain2) || isElementAccessExpression(chain2)) {
168026
168026
  if (getTextOfChainNode(chain2) === getTextOfChainNode(subchain)) break;
168027
168027
  chain2 = chain2.expression;
168028
168028
  }
@@ -168078,18 +168078,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
168078
168078
  node = skipParentheses(node);
168079
168079
  if (isBinaryExpression2(node)) {
168080
168080
  return getFinalExpressionInChain(node.left);
168081
- } else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression5(node)) && !isOptionalChain(node)) {
168081
+ } else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression4(node)) && !isOptionalChain(node)) {
168082
168082
  return node;
168083
168083
  }
168084
168084
  return void 0;
168085
168085
  }
168086
168086
  function convertOccurrences(checker, toConvert, occurrences) {
168087
- if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression5(toConvert)) {
168087
+ if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression4(toConvert)) {
168088
168088
  const chain2 = convertOccurrences(checker, toConvert.expression, occurrences);
168089
168089
  const lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : void 0;
168090
168090
  const isOccurrence = (lastOccurrence == null ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText();
168091
168091
  if (isOccurrence) occurrences.pop();
168092
- if (isCallExpression5(toConvert)) {
168092
+ if (isCallExpression4(toConvert)) {
168093
168093
  return isOccurrence ? factory.createCallChain(chain2, factory.createToken(
168094
168094
  29
168095
168095
  /* QuestionDotToken */
@@ -168112,7 +168112,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
168112
168112
  const { finalExpression, occurrences, expression: expression2 } = info;
168113
168113
  const firstOccurrence = occurrences[occurrences.length - 1];
168114
168114
  const convertedChain = convertOccurrences(checker, finalExpression, occurrences);
168115
- if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression5(convertedChain))) {
168115
+ if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression4(convertedChain))) {
168116
168116
  if (isBinaryExpression2(expression2)) {
168117
168117
  changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain);
168118
168118
  } else if (isConditionalExpression2(expression2)) {
@@ -170182,7 +170182,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
170182
170182
  while (isRightSideOfQualifiedNameOrPropertyAccess2(node)) {
170183
170183
  node = node.parent;
170184
170184
  }
170185
- return isCallExpression5(node.parent) && node.parent.expression === node;
170185
+ return isCallExpression4(node.parent) && node.parent.expression === node;
170186
170186
  }
170187
170187
  function isRightSideOfQualifiedNameOrPropertyAccess2(node) {
170188
170188
  return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node;
@@ -171761,7 +171761,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
171761
171761
  );
171762
171762
  }
171763
171763
  function getNodeForQuickInfo(node) {
171764
- if (isNewExpression4(node.parent) && node.pos === node.parent.pos) {
171764
+ if (isNewExpression3(node.parent) && node.pos === node.parent.pos) {
171765
171765
  return node.parent.expression;
171766
171766
  }
171767
171767
  if (isNamedTupleMember(node.parent) && node.pos === node.parent.pos) {
@@ -174471,7 +174471,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
174471
174471
  return { source: errorNode.parent.right, target: errorNode.parent.left };
174472
174472
  } else if (isVariableDeclaration3(errorNode.parent) && errorNode.parent.initializer) {
174473
174473
  return { source: errorNode.parent.initializer, target: errorNode.parent.name };
174474
- } else if (isCallExpression5(errorNode.parent)) {
174474
+ } else if (isCallExpression4(errorNode.parent)) {
174475
174475
  const n = checker.getSymbolAtLocation(errorNode.parent.expression);
174476
174476
  if (!(n == null ? void 0 : n.valueDeclaration) || !isFunctionLikeKind(n.valueDeclaration.kind)) return void 0;
174477
174477
  if (!isExpression4(errorNode)) return void 0;
@@ -175042,7 +175042,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
175042
175042
  changes.insertModifierAt(sourceFile, pos, 134, { suffix: " " });
175043
175043
  for (const returnStatement3 of returnStatements) {
175044
175044
  forEachChild(returnStatement3, function visit(node) {
175045
- if (isCallExpression5(node)) {
175045
+ if (isCallExpression4(node)) {
175046
175046
  const newNodes = transformExpression(
175047
175047
  node,
175048
175048
  node,
@@ -175094,7 +175094,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
175094
175094
  return setOfExpressionsToReturn;
175095
175095
  }
175096
175096
  function isPromiseReturningCallExpression(node, checker, name) {
175097
- if (!isCallExpression5(node)) return false;
175097
+ if (!isCallExpression4(node)) return false;
175098
175098
  const isExpressionOfName = hasPropertyAccessExpressionWithName(node, name);
175099
175099
  const nodeType = isExpressionOfName && checker.getTypeAtLocation(node);
175100
175100
  return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType));
@@ -175632,7 +175632,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
175632
175632
  function transformReturnStatementWithFixablePromiseHandler(transformer, innerRetStmt, hasContinuation, continuationArgName) {
175633
175633
  let innerCbBody = [];
175634
175634
  forEachChild(innerRetStmt, function visit(node) {
175635
- if (isCallExpression5(node)) {
175635
+ if (isCallExpression4(node)) {
175636
175636
  const temp = transformExpression(node, node, transformer, hasContinuation, continuationArgName);
175637
175637
  innerCbBody = innerCbBody.concat(temp);
175638
175638
  if (innerCbBody.length > 0) {
@@ -179346,7 +179346,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
179346
179346
  false
179347
179347
  );
179348
179348
  case Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:
179349
- if (!declaration || !isCallExpression5(declaration.parent) || !declaration.body) return void 0;
179349
+ if (!declaration || !isCallExpression4(declaration.parent) || !declaration.body) return void 0;
179350
179350
  const pos = declaration.parent.arguments.indexOf(declaration);
179351
179351
  if (pos === -1) return void 0;
179352
179352
  const type = checker.getContextualTypeForArgumentAtIndex(declaration.parent, pos);
@@ -179535,7 +179535,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
179535
179535
  const token = getTokenAtPosition(sourceFile, tokenPos);
179536
179536
  const parent2 = token.parent;
179537
179537
  if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
179538
- if (!(token.kind === 19 && isObjectLiteralExpression(parent2) && isCallExpression5(parent2.parent))) return void 0;
179538
+ if (!(token.kind === 19 && isObjectLiteralExpression(parent2) && isCallExpression4(parent2.parent))) return void 0;
179539
179539
  const argIndex = findIndex(parent2.parent.arguments, (arg) => arg === parent2);
179540
179540
  if (argIndex < 0) return void 0;
179541
179541
  const signature = checker.getResolvedSignature(parent2.parent);
@@ -179600,7 +179600,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
179600
179600
  if (signature === void 0) return void 0;
179601
179601
  return { kind: 5, token, signature, sourceFile, parentDeclaration: findScope(token) };
179602
179602
  }
179603
- if (isCallExpression5(parent2) && parent2.expression === token) {
179603
+ if (isCallExpression4(parent2) && parent2.expression === token) {
179604
179604
  return { kind: 2, token, call: parent2, sourceFile, modifierFlags: 0, parentDeclaration: findScope(token) };
179605
179605
  }
179606
179606
  }
@@ -179608,7 +179608,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
179608
179608
  const leftExpressionType = skipConstraint(checker.getTypeAtLocation(parent2.expression));
179609
179609
  const symbol = leftExpressionType.symbol;
179610
179610
  if (!symbol || !symbol.declarations) return void 0;
179611
- if (isIdentifier5(token) && isCallExpression5(parent2.parent)) {
179611
+ if (isIdentifier5(token) && isCallExpression4(parent2.parent)) {
179612
179612
  const moduleDeclaration = find2(symbol.declarations, isModuleDeclaration2);
179613
179613
  const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile();
179614
179614
  if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program3, moduleDeclarationSourceFile)) {
@@ -179629,7 +179629,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
179629
179629
  const declSourceFile = declaration.getSourceFile();
179630
179630
  const modifierFlags = isTypeLiteralNode(declaration) ? 0 : (makeStatic ? 256 : 0) | (startsWithUnderscore(token.text) ? 2 : 0);
179631
179631
  const isJSFile = isSourceFileJS(declSourceFile);
179632
- const call = tryCast(parent2.parent, isCallExpression5);
179632
+ const call = tryCast(parent2.parent, isCallExpression4);
179633
179633
  return { kind: 0, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile };
179634
179634
  }
179635
179635
  const enumDeclaration2 = find2(symbol.declarations, isEnumDeclaration2);
@@ -180131,7 +180131,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
180131
180131
  getAllCodeActions: (context) => codeFixAll(context, errorCodes29, (changes, diag2) => addMissingNewOperator(changes, context.sourceFile, diag2))
180132
180132
  });
180133
180133
  function addMissingNewOperator(changes, sourceFile, span) {
180134
- const call = cast3(findAncestorMatchingSpan2(sourceFile, span), isCallExpression5);
180134
+ const call = cast3(findAncestorMatchingSpan2(sourceFile, span), isCallExpression4);
180135
180135
  const newExpression2 = factory.createNewExpression(call.expression, call.typeArguments, call.arguments);
180136
180136
  changes.replaceNode(sourceFile, call, newExpression2);
180137
180137
  }
@@ -180195,7 +180195,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
180195
180195
  });
180196
180196
  function getInfo11(sourceFile, program3, pos) {
180197
180197
  const token = getTokenAtPosition(sourceFile, pos);
180198
- const callExpression3 = findAncestor(token, isCallExpression5);
180198
+ const callExpression3 = findAncestor(token, isCallExpression4);
180199
180199
  if (callExpression3 === void 0 || length(callExpression3.arguments) === 0) {
180200
180200
  return void 0;
180201
180201
  }
@@ -181272,8 +181272,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
181272
181272
  for (const entry of entries) {
181273
181273
  for (const reference of entry.references) {
181274
181274
  if (reference.kind === ts_FindAllReferences_exports.EntryKind.Node) {
181275
- const isSuperCall2 = isSuperKeyword(reference.node) && isCallExpression5(reference.node.parent) && reference.node.parent.arguments.length > index3;
181276
- const isSuperMethodCall = isPropertyAccessExpression(reference.node.parent) && isSuperKeyword(reference.node.parent.expression) && isCallExpression5(reference.node.parent.parent) && reference.node.parent.parent.arguments.length > index3;
181275
+ const isSuperCall2 = isSuperKeyword(reference.node) && isCallExpression4(reference.node.parent) && reference.node.parent.arguments.length > index3;
181276
+ const isSuperMethodCall = isPropertyAccessExpression(reference.node.parent) && isSuperKeyword(reference.node.parent.expression) && isCallExpression4(reference.node.parent.parent) && reference.node.parent.parent.arguments.length > index3;
181277
181277
  const isOverriddenMethod = (isMethodDeclaration(reference.node.parent) || isMethodSignature(reference.node.parent)) && reference.node.parent !== parameter.parent && reference.node.parent.parameters.length > index3;
181278
181278
  if (isSuperCall2 || isSuperMethodCall || isOverriddenMethod) return false;
181279
181279
  }
@@ -181299,7 +181299,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
181299
181299
  }
181300
181300
  }
181301
181301
  function isCallbackLike(checker, sourceFile, name) {
181302
- return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier5(reference) && isCallExpression5(reference.parent) && reference.parent.arguments.includes(reference));
181302
+ return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier5(reference) && isCallExpression4(reference.parent) && reference.parent.arguments.includes(reference));
181303
181303
  }
181304
181304
  function isLastParameter(func, parameter, isFixAll) {
181305
181305
  const parameters = func.parameters;
@@ -181700,7 +181700,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
181700
181700
  return [Diagnostics.Annotate_types_of_properties_expando_function_in_a_namespace];
181701
181701
  }
181702
181702
  function needsParenthesizedExpressionForAssertion(node) {
181703
- return !isEntityNameExpression(node) && !isCallExpression5(node) && !isObjectLiteralExpression(node) && !isArrayLiteralExpression(node);
181703
+ return !isEntityNameExpression(node) && !isCallExpression4(node) && !isObjectLiteralExpression(node) && !isArrayLiteralExpression(node);
181704
181704
  }
181705
181705
  function createAsExpression(node, type) {
181706
181706
  if (needsParenthesizedExpressionForAssertion(node)) {
@@ -183220,7 +183220,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
183220
183220
  }
183221
183221
  }
183222
183222
  function inferTypeFromExpressionStatement(node, usage) {
183223
- addCandidateType(usage, isCallExpression5(node) ? checker.getVoidType() : checker.getAnyType());
183223
+ addCandidateType(usage, isCallExpression4(node) ? checker.getVoidType() : checker.getAnyType());
183224
183224
  }
183225
183225
  function inferTypeFromPrefixUnaryExpression(node, usage) {
183226
183226
  switch (node.operator) {
@@ -185336,7 +185336,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
185336
185336
  registerCodeFix({
185337
185337
  errorCodes: errorCodes62,
185338
185338
  getCodeActions(context) {
185339
- const callExpression3 = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression5);
185339
+ const callExpression3 = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression4);
185340
185340
  if (!callExpression3) {
185341
185341
  return void 0;
185342
185342
  }
@@ -185552,11 +185552,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
185552
185552
  });
185553
185553
  function makeChange13(changes, sourceFile, span, program3, seen) {
185554
185554
  const node = getTokenAtPosition(sourceFile, span.start);
185555
- if (!isIdentifier5(node) || !isCallExpression5(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) return;
185555
+ if (!isIdentifier5(node) || !isCallExpression4(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) return;
185556
185556
  const checker = program3.getTypeChecker();
185557
185557
  const symbol = checker.getSymbolAtLocation(node);
185558
185558
  const decl = symbol == null ? void 0 : symbol.valueDeclaration;
185559
- if (!decl || !isParameter(decl) || !isNewExpression4(decl.parent.parent)) return;
185559
+ if (!decl || !isParameter(decl) || !isNewExpression3(decl.parent.parent)) return;
185560
185560
  if (seen == null ? void 0 : seen.has(decl)) return;
185561
185561
  seen == null ? void 0 : seen.add(decl);
185562
185562
  const typeArguments = getEffectiveTypeArguments(decl.parent.parent);
@@ -187898,7 +187898,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
187898
187898
  propertyAccessToConvert = parent2;
187899
187899
  node = propertyAccessToConvert.expression;
187900
187900
  const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert);
187901
- if (nodeIsMissing(leftmostAccessExpression) || (isCallExpression5(node) || isFunctionLike(node)) && node.end === contextToken.pos && node.getChildCount(sourceFile) && last2(node.getChildren(sourceFile)).kind !== 22) {
187901
+ if (nodeIsMissing(leftmostAccessExpression) || (isCallExpression4(node) || isFunctionLike(node)) && node.end === contextToken.pos && node.getChildCount(sourceFile) && last2(node.getChildren(sourceFile)).kind !== 22) {
187902
187902
  return void 0;
187903
187903
  }
187904
187904
  break;
@@ -190954,7 +190954,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
190954
190954
  return fragment.includes(directorySeparator);
190955
190955
  }
190956
190956
  function isRequireCallArgument(node) {
190957
- return isCallExpression5(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier5(node.parent.expression) && node.parent.expression.escapedText === "require";
190957
+ return isCallExpression4(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier5(node.parent.expression) && node.parent.expression.escapedText === "require";
190958
190958
  }
190959
190959
  var ts_FindAllReferences_exports = {};
190960
190960
  __export2(ts_FindAllReferences_exports, {
@@ -192695,7 +192695,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
192695
192695
  for (const name of getPossibleSymbolReferenceNodes(sourceFile, symbol.name)) {
192696
192696
  if (!isIdentifier5(name) || name === signature.name || name.escapedText !== signature.name.escapedText) continue;
192697
192697
  const called = climbPastPropertyAccess(name);
192698
- const call = isCallExpression5(called.parent) && called.parent.expression === called ? called.parent : void 0;
192698
+ const call = isCallExpression4(called.parent) && called.parent.expression === called ? called.parent : void 0;
192699
192699
  const referenceSymbol = checker.getSymbolAtLocation(name);
192700
192700
  if (referenceSymbol && checker.getRootSymbols(referenceSymbol).some((s) => s === symbol)) {
192701
192701
  if (cb(name, call)) {
@@ -192761,7 +192761,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
192761
192761
  case 15:
192762
192762
  case 11: {
192763
192763
  const str = node;
192764
- return str.text.length === searchSymbolName.length && (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression5(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node || isImportOrExportSpecifier(node.parent));
192764
+ return str.text.length === searchSymbolName.length && (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression4(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node || isImportOrExportSpecifier(node.parent));
192765
192765
  }
192766
192766
  case 9:
192767
192767
  return isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length;
@@ -194184,7 +194184,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
194184
194184
  visitVariableLikeDeclaration(node);
194185
194185
  } else if (preferences.includeInlayEnumMemberValueHints && isEnumMember2(node)) {
194186
194186
  visitEnumMember(node);
194187
- } else if (shouldShowParameterNameHints(preferences) && (isCallExpression5(node) || isNewExpression4(node))) {
194187
+ } else if (shouldShowParameterNameHints(preferences) && (isCallExpression4(node) || isNewExpression3(node))) {
194188
194188
  visitCallOrNewExpression(node);
194189
194189
  } else {
194190
194190
  if (preferences.includeInlayFunctionParameterTypeHints && isFunctionLikeDeclaration(node) && hasContextSensitiveParameters(node)) {
@@ -194922,7 +194922,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
194922
194922
  function isHintableDeclaration(node) {
194923
194923
  if ((isPartOfParameterDeclaration(node) || isVariableDeclaration3(node) && isVarConst(node)) && node.initializer) {
194924
194924
  const initializer = skipParentheses(node.initializer);
194925
- return !(isHintableLiteral(initializer) || isNewExpression4(initializer) || isObjectLiteralExpression(initializer) || isAssertionExpression(initializer));
194925
+ return !(isHintableLiteral(initializer) || isNewExpression3(initializer) || isObjectLiteralExpression(initializer) || isAssertionExpression(initializer));
194926
194926
  }
194927
194927
  return true;
194928
194928
  }
@@ -196293,7 +196293,7 @@ ${content}
196293
196293
  const span = getOutliningSpanForNode(n2, sourceFile);
196294
196294
  if (span) out.push(span);
196295
196295
  depthRemaining--;
196296
- if (isCallExpression5(n2)) {
196296
+ if (isCallExpression4(n2)) {
196297
196297
  depthRemaining++;
196298
196298
  visitNode3(n2.expression);
196299
196299
  depthRemaining--;
@@ -196604,7 +196604,7 @@ ${content}
196604
196604
  /*autoCollapse*/
196605
196605
  false,
196606
196606
  /*useFullStart*/
196607
- !isArrayLiteralExpression(node.parent) && !isCallExpression5(node.parent),
196607
+ !isArrayLiteralExpression(node.parent) && !isCallExpression4(node.parent),
196608
196608
  open
196609
196609
  );
196610
196610
  }
@@ -197768,7 +197768,7 @@ ${content}
197768
197768
  }
197769
197769
  if (callExpressionLike) {
197770
197770
  signature = typeChecker.getResolvedSignature(callExpressionLike);
197771
- const useConstructSignatures = callExpressionLike.kind === 215 || isCallExpression5(callExpressionLike) && callExpressionLike.expression.kind === 108;
197771
+ const useConstructSignatures = callExpressionLike.kind === 215 || isCallExpression4(callExpressionLike) && callExpressionLike.expression.kind === 108;
197772
197772
  const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
197773
197773
  if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
197774
197774
  signature = allSignatures.length ? allSignatures[0] : void 0;
@@ -199878,7 +199878,7 @@ ${options2.prefix}` : "\n" : options2.prefix
199878
199878
  deleteNode(changes, sourceFile, node);
199879
199879
  } else if (isImportClause(node.parent) && node.parent.name === node) {
199880
199880
  deleteDefaultImport(changes, sourceFile, node.parent);
199881
- } else if (isCallExpression5(node.parent) && contains(node.parent.arguments, node)) {
199881
+ } else if (isCallExpression4(node.parent) && contains(node.parent.arguments, node)) {
199882
199882
  deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);
199883
199883
  } else {
199884
199884
  deleteNode(changes, sourceFile, node);
@@ -203565,7 +203565,7 @@ ${options2.prefix}` : "\n" : options2.prefix
203565
203565
  return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));
203566
203566
  }
203567
203567
  function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent2, child, childStartLine, sourceFile) {
203568
- if (!(isCallExpression5(parent2) && contains(parent2.arguments, child))) {
203568
+ if (!(isCallExpression4(parent2) && contains(parent2.arguments, child))) {
203569
203569
  return false;
203570
203570
  }
203571
203571
  const expressionOfCallExpressionEnd = parent2.expression.getEnd();
@@ -205208,7 +205208,7 @@ ${options2.prefix}` : "\n" : options2.prefix
205208
205208
  isBuilderProgram: () => isBuilderProgram,
205209
205209
  isBundle: () => isBundle,
205210
205210
  isCallChain: () => isCallChain,
205211
- isCallExpression: () => isCallExpression5,
205211
+ isCallExpression: () => isCallExpression4,
205212
205212
  isCallExpressionTarget: () => isCallExpressionTarget,
205213
205213
  isCallLikeExpression: () => isCallLikeExpression,
205214
205214
  isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
@@ -205570,7 +205570,7 @@ ${options2.prefix}` : "\n" : options2.prefix
205570
205570
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
205571
205571
  isNamespaceImport: () => isNamespaceImport,
205572
205572
  isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
205573
- isNewExpression: () => isNewExpression4,
205573
+ isNewExpression: () => isNewExpression3,
205574
205574
  isNewExpressionTarget: () => isNewExpressionTarget,
205575
205575
  isNewScopeNode: () => isNewScopeNode,
205576
205576
  isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
@@ -245057,6 +245057,7 @@ var require_globals = __commonJS({
245057
245057
  CompressionStream: false,
245058
245058
  console: false,
245059
245059
  CountQueuingStrategy: false,
245060
+ CSS: false,
245060
245061
  CSSImageValue: false,
245061
245062
  CSSKeywordValue: false,
245062
245063
  CSSMathClamp: false,
@@ -245076,6 +245077,7 @@ var require_globals = __commonJS({
245076
245077
  currentFrame: false,
245077
245078
  currentTime: false,
245078
245079
  DecompressionStream: false,
245080
+ DOMException: false,
245079
245081
  Event: false,
245080
245082
  EventTarget: false,
245081
245083
  MessageEvent: false,
@@ -245179,6 +245181,7 @@ var require_globals = __commonJS({
245179
245181
  CanvasCaptureMediaStream: false,
245180
245182
  CanvasCaptureMediaStreamTrack: false,
245181
245183
  CanvasGradient: false,
245184
+ CanvasPaintEvent: false,
245182
245185
  CanvasPattern: false,
245183
245186
  CanvasRenderingContext2D: false,
245184
245187
  CaptureController: false,
@@ -245339,6 +245342,8 @@ var require_globals = __commonJS({
245339
245342
  DynamicsCompressorNode: false,
245340
245343
  EditContext: false,
245341
245344
  Element: false,
245345
+ ElementGeometryUpdateEvent: false,
245346
+ ElementImage: false,
245342
245347
  ElementInternals: false,
245343
245348
  EncodedAudioChunk: false,
245344
245349
  EncodedVideoChunk: false,
@@ -245487,6 +245492,7 @@ var require_globals = __commonJS({
245487
245492
  HTMLIFrameElement: false,
245488
245493
  HTMLImageElement: false,
245489
245494
  HTMLInputElement: false,
245495
+ HTMLInstallElement: false,
245490
245496
  HTMLLabelElement: false,
245491
245497
  HTMLLegendElement: false,
245492
245498
  HTMLLIElement: false,
@@ -245566,6 +245572,7 @@ var require_globals = __commonJS({
245566
245572
  InputDeviceCapabilities: false,
245567
245573
  InputDeviceInfo: false,
245568
245574
  InputEvent: false,
245575
+ InstallResultEvent: false,
245569
245576
  IntegrityViolationReportBody: false,
245570
245577
  InteractionContentfulPaint: false,
245571
245578
  InterestEvent: false,
@@ -245737,6 +245744,7 @@ var require_globals = __commonJS({
245737
245744
  ongotpointercapture: true,
245738
245745
  onhashchange: true,
245739
245746
  oninput: true,
245747
+ oninstallresult: true,
245740
245748
  oninvalid: true,
245741
245749
  onkeydown: true,
245742
245750
  onkeypress: true,
@@ -246166,6 +246174,7 @@ var require_globals = __commonJS({
246166
246174
  Translator: false,
246167
246175
  TreeWalker: false,
246168
246176
  TrustedHTML: false,
246177
+ TrustedHTMLParserOptions: false,
246169
246178
  TrustedParserOptions: false,
246170
246179
  TrustedScript: false,
246171
246180
  TrustedScriptURL: false,
@@ -248185,6 +248194,7 @@ var require_globals = __commonJS({
248185
248194
  crypto: false,
248186
248195
  Crypto: false,
248187
248196
  CryptoKey: false,
248197
+ CSS: false,
248188
248198
  CSSImageValue: false,
248189
248199
  CSSKeywordValue: false,
248190
248200
  CSSMathClamp: false,
@@ -248223,6 +248233,7 @@ var require_globals = __commonJS({
248223
248233
  DOMRect: false,
248224
248234
  DOMRectReadOnly: false,
248225
248235
  DOMStringList: false,
248236
+ ElementImage: false,
248226
248237
  ErrorEvent: false,
248227
248238
  Event: false,
248228
248239
  EventSource: false,
@@ -248574,6 +248585,7 @@ var require_globals = __commonJS({
248574
248585
  crypto: false,
248575
248586
  Crypto: false,
248576
248587
  CryptoKey: false,
248588
+ CSS: false,
248577
248589
  CSSImageValue: false,
248578
248590
  CSSKeywordValue: false,
248579
248591
  CSSMathClamp: false,
@@ -248612,6 +248624,7 @@ var require_globals = __commonJS({
248612
248624
  DOMRect: false,
248613
248625
  DOMRectReadOnly: false,
248614
248626
  DOMStringList: false,
248627
+ ElementImage: false,
248615
248628
  ErrorEvent: false,
248616
248629
  Event: false,
248617
248630
  EventSource: false,
@@ -248971,6 +248984,7 @@ var require_globals = __commonJS({
248971
248984
  crypto: false,
248972
248985
  Crypto: false,
248973
248986
  CryptoKey: false,
248987
+ CSS: false,
248974
248988
  CSSImageValue: false,
248975
248989
  CSSKeywordValue: false,
248976
248990
  CSSMathClamp: false,
@@ -249010,6 +249024,7 @@ var require_globals = __commonJS({
249010
249024
  DOMRect: false,
249011
249025
  DOMRectReadOnly: false,
249012
249026
  DOMStringList: false,
249027
+ ElementImage: false,
249013
249028
  EncodedAudioChunk: false,
249014
249029
  EncodedVideoChunk: false,
249015
249030
  ErrorEvent: false,
@@ -252644,6 +252659,8 @@ __export(lib_exports, {
252644
252659
  StringLiteral: () => StringLiteral,
252645
252660
  StringLiteralTypeAnnotation: () => StringLiteralTypeAnnotation,
252646
252661
  StringTypeAnnotation: () => StringTypeAnnotation,
252662
+ StructBody: () => StructBody,
252663
+ StructDeclaration: () => StructDeclaration,
252647
252664
  Super: () => Super,
252648
252665
  SwitchCase: () => SwitchCase,
252649
252666
  SwitchStatement: () => SwitchStatement,
@@ -252962,6 +252979,8 @@ __export(lib_exports, {
252962
252979
  assertStringLiteral: () => assertStringLiteral,
252963
252980
  assertStringLiteralTypeAnnotation: () => assertStringLiteralTypeAnnotation,
252964
252981
  assertStringTypeAnnotation: () => assertStringTypeAnnotation,
252982
+ assertStructBody: () => assertStructBody,
252983
+ assertStructDeclaration: () => assertStructDeclaration,
252965
252984
  assertSuper: () => assertSuper,
252966
252985
  assertSwitchCase: () => assertSwitchCase,
252967
252986
  assertSwitchStatement: () => assertSwitchStatement,
@@ -253382,6 +253401,8 @@ __export(lib_exports, {
253382
253401
  isStringLiteral: () => isStringLiteral,
253383
253402
  isStringLiteralTypeAnnotation: () => isStringLiteralTypeAnnotation,
253384
253403
  isStringTypeAnnotation: () => isStringTypeAnnotation,
253404
+ isStructBody: () => isStructBody,
253405
+ isStructDeclaration: () => isStructDeclaration,
253385
253406
  isSuper: () => isSuper,
253386
253407
  isSwitchCase: () => isSwitchCase,
253387
253408
  isSwitchStatement: () => isSwitchStatement,
@@ -253563,6 +253584,8 @@ __export(lib_exports, {
253563
253584
  stringLiteral: () => stringLiteral,
253564
253585
  stringLiteralTypeAnnotation: () => stringLiteralTypeAnnotation,
253565
253586
  stringTypeAnnotation: () => stringTypeAnnotation,
253587
+ structBody: () => structBody,
253588
+ structDeclaration: () => structDeclaration,
253566
253589
  super: () => _super,
253567
253590
  switchCase: () => switchCase,
253568
253591
  switchStatement: () => switchStatement,
@@ -254634,6 +254657,12 @@ function isTopicReference(node, opts) {
254634
254657
  function isVoidPattern(node, opts) {
254635
254658
  return isType$1("VoidPattern", node, opts);
254636
254659
  }
254660
+ function isStructDeclaration(node, opts) {
254661
+ return isType$1("StructDeclaration", node, opts);
254662
+ }
254663
+ function isStructBody(node, opts) {
254664
+ return isType$1("StructBody", node, opts);
254665
+ }
254637
254666
  function isTSParameterProperty(node, opts) {
254638
254667
  return isType$1("TSParameterProperty", node, opts);
254639
254668
  }
@@ -255041,6 +255070,7 @@ function isScopable(node, opts) {
255041
255070
  case "ClassMethod":
255042
255071
  case "ClassPrivateMethod":
255043
255072
  case "StaticBlock":
255073
+ case "StructDeclaration":
255044
255074
  case "TSModuleBlock":
255045
255075
  break;
255046
255076
  case "Placeholder":
@@ -255134,6 +255164,7 @@ function isStatement(node, opts) {
255134
255164
  case "OpaqueType":
255135
255165
  case "TypeAlias":
255136
255166
  case "EnumDeclaration":
255167
+ case "StructDeclaration":
255137
255168
  case "TSDeclareFunction":
255138
255169
  case "TSInterfaceDeclaration":
255139
255170
  case "TSTypeAliasDeclaration":
@@ -255333,6 +255364,7 @@ function isDeclaration(node, opts) {
255333
255364
  case "OpaqueType":
255334
255365
  case "TypeAlias":
255335
255366
  case "EnumDeclaration":
255367
+ case "StructDeclaration":
255336
255368
  case "TSDeclareFunction":
255337
255369
  case "TSInterfaceDeclaration":
255338
255370
  case "TSTypeAliasDeclaration":
@@ -257115,7 +257147,7 @@ defineType$4("ObjectProperty", {
257115
257147
  visitor: ["decorators", "key", "value"],
257116
257148
  aliases: ["UserWhitespacable", "Property", "ObjectMember"],
257117
257149
  validate: (function() {
257118
- const pattern = assertNodeType("Identifier", "Pattern", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion");
257150
+ const pattern = assertNodeType("Identifier", "Pattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion");
257119
257151
  const expression2 = assertNodeType("Expression");
257120
257152
  return function(parent, key, node) {
257121
257153
  const validator = is("ObjectPattern", parent) ? pattern : expression2;
@@ -257515,7 +257547,7 @@ defineType$4("ExportDefaultDeclaration", {
257515
257547
  visitor: ["declaration"],
257516
257548
  aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"],
257517
257549
  fields: {
257518
- declaration: validateType("FunctionDeclaration", "ClassDeclaration", "Expression", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
257550
+ declaration: validateType("FunctionDeclaration", "ClassDeclaration", "Expression", "StructDeclaration", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
257519
257551
  exportKind: validateOptional(assertOneOf("value"))
257520
257552
  }
257521
257553
  });
@@ -257534,10 +257566,14 @@ defineType$4("ExportNamedDeclaration", {
257534
257566
  throw new TypeError("Cannot export a declaration from a source");
257535
257567
  }
257536
257568
  }, {
257537
- oneOfNodeTypes: ["VariableDeclaration", "FunctionDeclaration", "ClassDeclaration", "TSDeclareFunction", "TSEnumDeclaration", "TSImportEqualsDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration", "EnumDeclaration", "InterfaceDeclaration", "OpaqueType", "TypeAlias"]
257569
+ oneOfNodeTypes: ["VariableDeclaration", "FunctionDeclaration", "ClassDeclaration", "StructDeclaration", "TSDeclareFunction", "TSEnumDeclaration", "TSImportEqualsDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration", "EnumDeclaration", "InterfaceDeclaration", "OpaqueType", "TypeAlias"]
257538
257570
  }))
257539
257571
  },
257540
257572
  ...importAttributes,
257573
+ phase: {
257574
+ default: null,
257575
+ validate: assertOneOf("defer")
257576
+ },
257541
257577
  specifiers: {
257542
257578
  default: [],
257543
257579
  validate: arrayOf((function() {
@@ -257639,11 +257675,16 @@ defineType$4("ImportDefaultSpecifier", {
257639
257675
  }
257640
257676
  });
257641
257677
  defineType$4("ImportNamespaceSpecifier", {
257642
- visitor: ["local"],
257678
+ visitor: ["exportsFilter", "local"],
257679
+ builder: ["local"],
257643
257680
  aliases: ["ModuleSpecifier"],
257644
257681
  fields: {
257645
257682
  local: {
257646
257683
  validate: assertNodeType("Identifier")
257684
+ },
257685
+ exportsFilter: {
257686
+ optional: true,
257687
+ validate: arrayOfType("Identifier", "StringLiteral")
257647
257688
  }
257648
257689
  }
257649
257690
  });
@@ -257896,6 +257937,10 @@ defineType$4("ImportExpression", {
257896
257937
  default: null,
257897
257938
  validate: assertOneOf("source", "defer")
257898
257939
  },
257940
+ sync: {
257941
+ optional: true,
257942
+ validate: assertValueType("boolean")
257943
+ },
257899
257944
  source: {
257900
257945
  validate: assertNodeType("Expression")
257901
257946
  },
@@ -257916,11 +257961,16 @@ defineType$4("BigIntLiteral", {
257916
257961
  aliases: ["Expression", "Pureish", "Literal", "Immutable"]
257917
257962
  });
257918
257963
  defineType$4("ExportNamespaceSpecifier", {
257919
- visitor: ["exported"],
257964
+ visitor: ["exportsFilter", "exported"],
257965
+ builder: ["exported"],
257920
257966
  aliases: ["ModuleSpecifier"],
257921
257967
  fields: {
257922
257968
  exported: {
257923
257969
  validate: assertNodeType("Identifier", "StringLiteral")
257970
+ },
257971
+ exportsFilter: {
257972
+ optional: true,
257973
+ validate: arrayOfType("Identifier", "StringLiteral")
257924
257974
  }
257925
257975
  }
257926
257976
  });
@@ -258887,6 +258937,29 @@ defineType$5("TopicReference", {
258887
258937
  defineType$5("VoidPattern", {
258888
258938
  aliases: ["Pattern", "PatternLike", "FunctionParameter"]
258889
258939
  });
258940
+ defineType$5("StructDeclaration", {
258941
+ visitor: ["id", "superClass", "body"],
258942
+ aliases: ["Scopable", "Statement", "Declaration"],
258943
+ fields: {
258944
+ id: {
258945
+ validate: assertNodeType("Identifier"),
258946
+ optional: true
258947
+ },
258948
+ body: {
258949
+ validate: assertNodeType("StructBody")
258950
+ },
258951
+ superClass: {
258952
+ optional: true,
258953
+ validate: assertNodeType("Expression")
258954
+ }
258955
+ }
258956
+ });
258957
+ defineType$5("StructBody", {
258958
+ visitor: ["body"],
258959
+ fields: {
258960
+ body: validateArrayOfType("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "StaticBlock", "ClassAccessorProperty")
258961
+ }
258962
+ });
258890
258963
  var defineType = defineAliasedType("TypeScript");
258891
258964
  var bool = assertValueType("boolean");
258892
258965
  var tSFunctionTypeAnnotationCommon = () => ({
@@ -261399,6 +261472,28 @@ function voidPattern() {
261399
261472
  type: "VoidPattern"
261400
261473
  };
261401
261474
  }
261475
+ function structDeclaration(id = null, superClass = null, body) {
261476
+ const node = {
261477
+ type: "StructDeclaration",
261478
+ id,
261479
+ superClass,
261480
+ body
261481
+ };
261482
+ const defs2 = NODE_FIELDS.StructDeclaration;
261483
+ validate(defs2.id, node, "id", id, 1);
261484
+ validate(defs2.superClass, node, "superClass", superClass, 1);
261485
+ validate(defs2.body, node, "body", body, 1);
261486
+ return node;
261487
+ }
261488
+ function structBody(body) {
261489
+ const node = {
261490
+ type: "StructBody",
261491
+ body
261492
+ };
261493
+ const defs2 = NODE_FIELDS.StructBody;
261494
+ validate(defs2.body, node, "body", body, 1);
261495
+ return node;
261496
+ }
261402
261497
  function tsParameterProperty(parameter) {
261403
261498
  const node = {
261404
261499
  type: "TSParameterProperty",
@@ -262244,6 +262339,8 @@ var b = /* @__PURE__ */ Object.defineProperty({
262244
262339
  stringLiteral,
262245
262340
  stringLiteralTypeAnnotation,
262246
262341
  stringTypeAnnotation,
262342
+ structBody,
262343
+ structDeclaration,
262247
262344
  super: _super,
262248
262345
  switchCase,
262249
262346
  switchStatement,
@@ -262531,6 +262628,8 @@ var ExportDefaultSpecifier = alias("exportDefaultSpecifier");
262531
262628
  var ModuleExpression = alias("moduleExpression");
262532
262629
  var TopicReference = alias("topicReference");
262533
262630
  var VoidPattern = alias("voidPattern");
262631
+ var StructDeclaration = alias("structDeclaration");
262632
+ var StructBody = alias("structBody");
262534
262633
  var TSParameterProperty = alias("tsParameterProperty");
262535
262634
  var TSDeclareFunction = alias("tsDeclareFunction");
262536
262635
  var TSDeclareMethod = alias("tsDeclareMethod");
@@ -263197,6 +263296,12 @@ function assertTopicReference(node, opts) {
263197
263296
  function assertVoidPattern(node, opts) {
263198
263297
  assert("VoidPattern", node, opts);
263199
263298
  }
263299
+ function assertStructDeclaration(node, opts) {
263300
+ assert("StructDeclaration", node, opts);
263301
+ }
263302
+ function assertStructBody(node, opts) {
263303
+ assert("StructBody", node, opts);
263304
+ }
263200
263305
  function assertTSParameterProperty(node, opts) {
263201
263306
  assert("TSParameterProperty", node, opts);
263202
263307
  }
@@ -265546,17 +265651,24 @@ var SourceMap = class {
265546
265651
  _map;
265547
265652
  _rawMappings;
265548
265653
  _sourceFileName;
265549
- _lastGenLine = 0;
265550
- _lastSourceLine = 0;
265551
- _lastSourceColumn = 0;
265552
265654
  _inputMap = null;
265655
+ #mappingsBuffer0 = null;
265656
+ #mappingsBuffer1 = null;
265657
+ #mappingsBuffer2 = null;
265658
+ #droppedMappingForRange = false;
265659
+ #allowRangeMappings;
265553
265660
  constructor(opts, code2) {
265554
265661
  const map = this._map = new GenMapping({
265555
265662
  sourceRoot: opts.sourceRoot
265556
265663
  });
265557
265664
  this._sourceFileName = opts.sourceFileName?.replace(/\\/g, "/");
265558
265665
  this._rawMappings = void 0;
265666
+ this.#allowRangeMappings = opts.sourceMapRanges ?? false;
265559
265667
  if (opts.inputSourceMap) {
265668
+ if (this.#allowRangeMappings) {
265669
+ this.#allowRangeMappings = false;
265670
+ console.warn(`[BABEL] Note: The code generator has disabled source map ranges for ${opts.filename ?? "the generated code"}, because they cannot be used together with \`inputSourceMap\` yet.`);
265671
+ }
265560
265672
  this._inputMap = new TraceMap(opts.inputSourceMap);
265561
265673
  const resolvedSources = this._inputMap.resolvedSources;
265562
265674
  if (resolvedSources.length) {
@@ -265574,16 +265686,19 @@ var SourceMap = class {
265574
265686
  }
265575
265687
  }
265576
265688
  get() {
265689
+ this.#flushBuffer();
265577
265690
  const encoded = toEncodedMap(this._map);
265578
265691
  encoded.ignoreList ??= [];
265579
265692
  return encoded;
265580
265693
  }
265581
265694
  getDecoded() {
265695
+ this.#flushBuffer();
265582
265696
  const decoded = toDecodedMap(this._map);
265583
265697
  decoded.ignoreList ??= [];
265584
265698
  return decoded;
265585
265699
  }
265586
265700
  getRawMappings() {
265701
+ this.#flushBuffer();
265587
265702
  return this._rawMappings ||= allMappings(this._map);
265588
265703
  }
265589
265704
  mark(generated, generatedIdentifierName, line, column, identifierName, identifierNamePos, filename) {
@@ -265615,12 +265730,96 @@ var SourceMap = class {
265615
265730
  if (identifierName != null && identifierName === generatedIdentifierName) {
265616
265731
  identifierName = null;
265617
265732
  }
265618
- maybeAddMapping(this._map, {
265619
- name: identifierName,
265620
- generated,
265733
+ const newMapping = {
265734
+ name: identifierName ?? null,
265735
+ generated: {
265736
+ line: generated.line,
265737
+ column: generated.column
265738
+ },
265621
265739
  source: originalMapping?.source,
265622
- original: originalMapping
265623
- });
265740
+ original: originalMapping,
265741
+ isRange: false
265742
+ };
265743
+ if (newMapping.name !== null) {
265744
+ this.#flushBuffer();
265745
+ maybeAddMapping(this._map, newMapping);
265746
+ return;
265747
+ }
265748
+ if (this.#allowRangeMappings) {
265749
+ if (this.#mappingsBuffer2 !== null) {
265750
+ const buf2 = this.#mappingsBuffer2;
265751
+ this.#mappingsBuffer2 = null;
265752
+ const prev2 = this.#mappingsBuffer1 ?? this.#mappingsBuffer0;
265753
+ if (this.#isRangeCandidate(prev2, newMapping)) {
265754
+ this.#droppedMappingForRange = true;
265755
+ } else {
265756
+ this.#bufferMapping(buf2);
265757
+ }
265758
+ }
265759
+ const prev = this.#mappingsBuffer1 ?? this.#mappingsBuffer0;
265760
+ const prevOriginal = prev?.original;
265761
+ if (prevOriginal && prev.source === newMapping.source && prevOriginal.line === newMapping.original?.line && prevOriginal.column === newMapping.original.column) {
265762
+ if (prev.generated.line === newMapping.generated.line) return;
265763
+ this.#mappingsBuffer2 = newMapping;
265764
+ return;
265765
+ }
265766
+ }
265767
+ this.#bufferMapping(newMapping);
265768
+ }
265769
+ #bufferMapping(newMapping) {
265770
+ if (this.#mappingsBuffer0 === null) {
265771
+ this.#mappingsBuffer0 = newMapping;
265772
+ return;
265773
+ }
265774
+ if (this.#mappingsBuffer1 === null) {
265775
+ if (this.#isRangeCandidate(this.#mappingsBuffer0, newMapping)) {
265776
+ this.#mappingsBuffer1 = newMapping;
265777
+ } else {
265778
+ maybeAddMapping(this._map, this.#mappingsBuffer0);
265779
+ this.#mappingsBuffer0 = newMapping;
265780
+ }
265781
+ return;
265782
+ }
265783
+ if (this.#isRangeCandidate(this.#mappingsBuffer1, newMapping)) {
265784
+ this.#mappingsBuffer1 = newMapping;
265785
+ this.#droppedMappingForRange = true;
265786
+ } else {
265787
+ if (this.#droppedMappingForRange) this.#mappingsBuffer0.isRange = true;
265788
+ maybeAddMapping(this._map, this.#mappingsBuffer0);
265789
+ maybeAddMapping(this._map, this.#mappingsBuffer1);
265790
+ this.#mappingsBuffer0 = newMapping;
265791
+ this.#mappingsBuffer1 = null;
265792
+ this.#droppedMappingForRange = false;
265793
+ }
265794
+ }
265795
+ #flushBuffer() {
265796
+ if (this.#mappingsBuffer2 !== null) {
265797
+ this.#bufferMapping(this.#mappingsBuffer2);
265798
+ this.#mappingsBuffer2 = null;
265799
+ }
265800
+ const buf0 = this.#mappingsBuffer0;
265801
+ const buf1 = this.#mappingsBuffer1;
265802
+ if (buf0 !== null) {
265803
+ if (buf1 !== null && this.#droppedMappingForRange) buf0.isRange = true;
265804
+ maybeAddMapping(this._map, buf0);
265805
+ this.#mappingsBuffer0 = null;
265806
+ }
265807
+ if (buf1 !== null) {
265808
+ maybeAddMapping(this._map, buf1);
265809
+ this.#mappingsBuffer1 = null;
265810
+ }
265811
+ }
265812
+ #isRangeCandidate(prev, next) {
265813
+ if (!this.#allowRangeMappings) return false;
265814
+ const prevOriginal = prev.original;
265815
+ const nextOriginal = next.original;
265816
+ if (!prevOriginal || !nextOriginal) return false;
265817
+ if (prev.source !== next.source) return false;
265818
+ const generatedLineDelta = next.generated.line - prev.generated.line;
265819
+ const generatedColumnDelta = generatedLineDelta === 0 ? next.generated.column - prev.generated.column : next.generated.column;
265820
+ const originalLineDelta = nextOriginal.line - prevOriginal.line;
265821
+ const originalColumnDelta = originalLineDelta === 0 ? nextOriginal.column - prevOriginal.column : nextOriginal.column;
265822
+ return generatedLineDelta >= 0 && originalColumnDelta >= 0 && generatedLineDelta === originalLineDelta && generatedColumnDelta === originalColumnDelta;
265624
265823
  }
265625
265824
  };
265626
265825
  var spaceIndents = [];
@@ -265866,12 +266065,12 @@ var {
265866
266065
  } = lib_exports;
265867
266066
  var PRECEDENCE = /* @__PURE__ */ new Map([["||", 0], ["??", 1], ["&&", 2], ["|", 3], ["^", 4], ["&", 5], ["==", 6], ["===", 6], ["!=", 6], ["!==", 6], ["<", 7], [">", 7], ["<=", 7], [">=", 7], ["in", 7], ["instanceof", 7], [">>", 8], ["<<", 8], [">>>", 8], ["+", 9], ["-", 9], ["*", 10], ["/", 10], ["%", 10], ["**", 11]]);
265868
266067
  function isTSTypeExpression(nodeId) {
265869
- return nodeId === 154 || nodeId === 199 || nodeId === 207;
266068
+ return nodeId === 156 || nodeId === 201 || nodeId === 209;
265870
266069
  }
265871
266070
  var isClassExtendsClause = (node, parent, parentId) => {
265872
- return (parentId === 22 || parentId === 23) && parent.superClass === node;
266071
+ return (parentId === 22 || parentId === 23 || parentId === 149) && parent.superClass === node;
265873
266072
  };
265874
- var hasPostfixPart = (node, parent, parentId) => {
266073
+ var hasPostfixPart$1 = (node, parent, parentId) => {
265875
266074
  switch (parentId) {
265876
266075
  case 109:
265877
266076
  case 133:
@@ -265880,10 +266079,12 @@ var hasPostfixPart = (node, parent, parentId) => {
265880
266079
  case 131:
265881
266080
  case 113:
265882
266081
  return parent.callee === node;
265883
- case 220:
266082
+ case 222:
265884
266083
  return parent.tag === node;
265885
- case 189:
266084
+ case 191:
265886
266085
  return true;
266086
+ case 177:
266087
+ return parent.expression === node;
265887
266088
  }
265888
266089
  return false;
265889
266090
  };
@@ -265891,10 +266092,10 @@ function NullableTypeAnnotation$1(node, parent, parentId) {
265891
266092
  return parentId === 4;
265892
266093
  }
265893
266094
  function FunctionTypeAnnotation$1(node, parent, parentId, tokenContext) {
265894
- return parentId === 237 || parentId === 91 || parentId === 4 || (tokenContext & 8) > 0;
266095
+ return parentId === 239 || parentId === 91 || parentId === 4 || (tokenContext & 8) > 0;
265895
266096
  }
265896
266097
  function UpdateExpression$1(node, parent, parentId) {
265897
- return hasPostfixPart(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
266098
+ return hasPostfixPart$1(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
265898
266099
  }
265899
266100
  function needsParenBeforeExpressionBrace(tokenContext) {
265900
266101
  return (tokenContext & (1 | 2)) > 0;
@@ -265909,7 +266110,7 @@ function BinaryLike(node, parent, parentId, nodeType) {
265909
266110
  if (isClassExtendsClause(node, parent, parentId)) {
265910
266111
  return true;
265911
266112
  }
265912
- if (hasPostfixPart(node, parent, parentId) || parentId === 236 || parentId === 143 || parentId === 8) {
266113
+ if (hasPostfixPart$1(node, parent, parentId) || parentId === 238 || parentId === 143 || parentId === 8) {
265913
266114
  return true;
265914
266115
  }
265915
266116
  let parentPos;
@@ -265918,8 +266119,8 @@ function BinaryLike(node, parent, parentId, nodeType) {
265918
266119
  case 108:
265919
266120
  parentPos = PRECEDENCE.get(parent.operator);
265920
266121
  break;
265921
- case 154:
265922
- case 199:
266122
+ case 156:
266123
+ case 201:
265923
266124
  parentPos = 7;
265924
266125
  }
265925
266126
  if (parentPos !== void 0) {
@@ -265939,7 +266140,7 @@ function UnionTypeAnnotation$1(node, parent, parentId) {
265939
266140
  case 4:
265940
266141
  case 116:
265941
266142
  case 91:
265942
- case 237:
266143
+ case 239:
265943
266144
  return true;
265944
266145
  }
265945
266146
  return false;
@@ -265948,7 +266149,7 @@ function OptionalIndexedAccessType$1(node, parent, parentId) {
265948
266149
  return parentId === 85 && parent.objectType === node;
265949
266150
  }
265950
266151
  function TSAsExpression$1(node, parent, parentId) {
265951
- if ((parentId === 6 || parentId === 7) && parent.left === node) {
266152
+ if (parentId === 240 || (parentId === 6 || parentId === 7) && parent.left === node) {
265952
266153
  return true;
265953
266154
  }
265954
266155
  if (parentId === 11 && (parent.operator === "|" || parent.operator === "&") && node === parent.left) {
@@ -265956,52 +266157,55 @@ function TSAsExpression$1(node, parent, parentId) {
265956
266157
  }
265957
266158
  return BinaryLike(node, parent, parentId, 2);
265958
266159
  }
266160
+ function TSTypeAssertion$1(node, parent, parentId) {
266161
+ return parentId === 240 || (parentId === 6 || parentId === 7) && parent.left === node || UnaryLike(node, parent, parentId);
266162
+ }
265959
266163
  function TSConditionalType$1(node, parent, parentId) {
265960
266164
  switch (parentId) {
265961
- case 153:
265962
- case 193:
265963
- case 209:
265964
- case 210:
265965
- case 179:
265966
- case 217:
266165
+ case 155:
266166
+ case 195:
266167
+ case 211:
266168
+ case 212:
266169
+ case 181:
266170
+ case 219:
265967
266171
  return true;
265968
- case 173:
266172
+ case 175:
265969
266173
  return parent.objectType === node;
265970
- case 159:
266174
+ case 161:
265971
266175
  return parent.checkType === node || parent.extendsType === node;
265972
266176
  }
265973
266177
  return false;
265974
266178
  }
265975
266179
  function TSUnionType$1(node, parent, parentId) {
265976
266180
  switch (parentId) {
265977
- case 179:
265978
- case 209:
265979
- case 153:
265980
- case 193:
266181
+ case 181:
266182
+ case 211:
266183
+ case 155:
266184
+ case 195:
265981
266185
  return true;
265982
- case 173:
266186
+ case 175:
265983
266187
  return parent.objectType === node;
265984
266188
  }
265985
266189
  return false;
265986
266190
  }
265987
266191
  function TSIntersectionType$1(node, parent, parentId) {
265988
- return parentId === 209 || TSTypeOperator$1(node, parent, parentId);
266192
+ return parentId === 211 || TSTypeOperator$1(node, parent, parentId);
265989
266193
  }
265990
266194
  function TSInferType$1(node, parent, parentId) {
265991
266195
  if (TSTypeOperator$1(node, parent, parentId)) {
265992
266196
  return true;
265993
266197
  }
265994
- if ((parentId === 179 || parentId === 217) && node.typeParameter.constraint != null) {
266198
+ if ((parentId === 181 || parentId === 219) && node.typeParameter.constraint != null) {
265995
266199
  return true;
265996
266200
  }
265997
266201
  return false;
265998
266202
  }
265999
266203
  function TSTypeOperator$1(node, parent, parentId) {
266000
266204
  switch (parentId) {
266001
- case 153:
266002
- case 193:
266205
+ case 155:
266206
+ case 195:
266003
266207
  return true;
266004
- case 173:
266208
+ case 175:
266005
266209
  if (parent.objectType === node) {
266006
266210
  return true;
266007
266211
  }
@@ -266013,14 +266217,19 @@ function TSInstantiationExpression$1(node, parent, parentId) {
266013
266217
  case 18:
266014
266218
  case 131:
266015
266219
  case 113:
266016
- case 175:
266220
+ case 177:
266017
266221
  return parent.typeArguments != null;
266222
+ case 109:
266223
+ case 133:
266224
+ return parent.object === node;
266225
+ case 191:
266226
+ return true;
266018
266227
  }
266019
266228
  return false;
266020
266229
  }
266021
266230
  function TSFunctionType$1(node, parent, parentId) {
266022
266231
  if (TSUnionType$1(node, parent, parentId)) return true;
266023
- return parentId === 217 || parentId === 159 && (parent.checkType === node || parent.extendsType === node);
266232
+ return parentId === 219 || parentId === 161 && (parent.checkType === node || parent.extendsType === node);
266024
266233
  }
266025
266234
  function BinaryExpression$1(node, parent, parentId, tokenContext) {
266026
266235
  if (BinaryLike(node, parent, parentId, 0)) return true;
@@ -266030,10 +266239,10 @@ function LogicalExpression2(node, parent, parentId) {
266030
266239
  return BinaryLike(node, parent, parentId, 1);
266031
266240
  }
266032
266241
  function SequenceExpression$1(node, parent, parentId) {
266033
- if (parentId === 142 || parentId === 134 || parentId === 109 && parent.property === node || parentId === 133 && parent.property === node || parentId === 222) {
266242
+ if (parentId === 142 || parentId === 134 || parentId === 109 && parent.property === node || parentId === 133 && parent.property === node || parentId === 224) {
266034
266243
  return false;
266035
266244
  }
266036
- if (parentId === 22) {
266245
+ if (parentId === 22 || parentId === 149) {
266037
266246
  return true;
266038
266247
  }
266039
266248
  if (parentId === 69) {
@@ -266045,20 +266254,20 @@ function SequenceExpression$1(node, parent, parentId) {
266045
266254
  return !isStatement$4(parent);
266046
266255
  }
266047
266256
  function YieldExpression$1(node, parent, parentId) {
266048
- return parentId === 11 || parentId === 108 || parentId === 236 || parentId === 143 || hasPostfixPart(node, parent, parentId) || parentId === 8 && isYieldExpression2(node) || parentId === 29 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
266257
+ return parentId === 11 || parentId === 108 || parentId === 238 || parentId === 143 || hasPostfixPart$1(node, parent, parentId) || parentId === 8 && isYieldExpression2(node) || parentId === 29 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
266049
266258
  }
266050
266259
  function ClassExpression2(node, parent, parentId, tokenContext) {
266051
266260
  return (tokenContext & (1 | 4)) > 0;
266052
266261
  }
266053
266262
  function UnaryLike(node, parent, parentId) {
266054
- return hasPostfixPart(node, parent, parentId) || parentId === 11 && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent, parentId);
266263
+ return hasPostfixPart$1(node, parent, parentId) || parentId === 11 && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent, parentId);
266055
266264
  }
266056
266265
  function FunctionExpression$1(node, parent, parentId, tokenContext) {
266057
266266
  return (tokenContext & (1 | 4)) > 0;
266058
266267
  }
266059
266268
  function ConditionalExpression$1(node, parent, parentId) {
266060
266269
  switch (parentId) {
266061
- case 236:
266270
+ case 238:
266062
266271
  case 143:
266063
266272
  case 11:
266064
266273
  case 108:
@@ -266146,13 +266355,14 @@ var parens = /* @__PURE__ */ Object.defineProperty({
266146
266355
  TSInstantiationExpression: TSInstantiationExpression$1,
266147
266356
  TSIntersectionType: TSIntersectionType$1,
266148
266357
  TSSatisfiesExpression: TSAsExpression$1,
266149
- TSTypeAssertion: UnaryLike,
266358
+ TSTypeAssertion: TSTypeAssertion$1,
266150
266359
  TSTypeOperator: TSTypeOperator$1,
266151
266360
  TSUnionType: TSUnionType$1,
266152
266361
  UnaryExpression: UnaryLike,
266153
266362
  UnionTypeAnnotation: UnionTypeAnnotation$1,
266154
266363
  UpdateExpression: UpdateExpression$1,
266155
- YieldExpression: YieldExpression$1
266364
+ YieldExpression: YieldExpression$1,
266365
+ hasPostfixPart: hasPostfixPart$1
266156
266366
  }, Symbol.toStringTag, {
266157
266367
  value: "Module"
266158
266368
  });
@@ -266180,10 +266390,8 @@ function TemplateLiteral2(node) {
266180
266390
  _printTemplate.call(this, node, node.expressions);
266181
266391
  }
266182
266392
  var {
266183
- isCallExpression: isCallExpression2,
266184
266393
  isLiteral: isLiteral2,
266185
266394
  isMemberExpression: isMemberExpression2,
266186
- isNewExpression: isNewExpression2,
266187
266395
  isPattern: isPattern2
266188
266396
  } = lib_exports;
266189
266397
  function UnaryExpression2(node) {
@@ -266243,16 +266451,18 @@ function _printExpressionArguments(node) {
266243
266451
  this.rightParens(node);
266244
266452
  }
266245
266453
  function NewExpression2(node, parent) {
266454
+ const omitArguments = this.format.minified && node.arguments.length === 0 && !node.typeArguments;
266455
+ const wrapInParens = omitArguments && hasPostfixPart(node, parent);
266456
+ if (wrapInParens) this.tokenChar(40);
266246
266457
  this.word("new");
266247
266458
  this.space();
266248
266459
  this.print(node.callee);
266249
- if (this.format.minified && node.arguments.length === 0 && !isCallExpression2(parent, {
266250
- callee: node
266251
- }) && !isMemberExpression2(parent) && !isNewExpression2(parent)) {
266460
+ if (omitArguments) {
266461
+ if (wrapInParens) this.tokenChar(41);
266252
266462
  return;
266253
266463
  }
266254
266464
  this.print(node.typeArguments);
266255
- if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) {
266465
+ if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")") && (!hasPostfixPart(node, parent) || node.extra?.parenthesized)) {
266256
266466
  return;
266257
266467
  }
266258
266468
  _printExpressionArguments.call(this, node);
@@ -267446,10 +267656,15 @@ function TSImportType2(node) {
267446
267656
  function TSImportEqualsDeclaration2(node) {
267447
267657
  const {
267448
267658
  id,
267449
- moduleReference
267659
+ moduleReference,
267660
+ importKind: importKind2
267450
267661
  } = node;
267451
267662
  this.word("import");
267452
267663
  this.space();
267664
+ if (importKind2 === "type") {
267665
+ this.word("type");
267666
+ this.space();
267667
+ }
267453
267668
  this.print(id);
267454
267669
  this.space();
267455
267670
  this.tokenChar(61);
@@ -267534,18 +267749,31 @@ function printModifiersList(printer, node, modifiers) {
267534
267749
  var {
267535
267750
  isClassDeclaration: isClassDeclaration2,
267536
267751
  isExportDefaultSpecifier: isExportDefaultSpecifier2,
267537
- isExportNamespaceSpecifier: isExportNamespaceSpecifier2,
267752
+ isExportNamespaceSpecifier: isExportNamespaceSpecifier$1,
267538
267753
  isImportDefaultSpecifier: isImportDefaultSpecifier2,
267539
267754
  isImportNamespaceSpecifier: isImportNamespaceSpecifier2,
267540
267755
  isStatement: isStatement$2
267541
267756
  } = lib_exports;
267757
+ function isSameModuleExportName(a, b2) {
267758
+ if (a.type === "Identifier") {
267759
+ return b2.type === "Identifier" && a.name === b2.name;
267760
+ }
267761
+ return b2.type === "StringLiteral" && a.value === b2.value;
267762
+ }
267763
+ function shouldPrintModuleSpecifierAlias(printer, node, a, b2) {
267764
+ if (!isSameModuleExportName(a, b2)) return true;
267765
+ if (printer.tokenMap) {
267766
+ return printer.tokenMap.findMatching(node, "as") !== null;
267767
+ }
267768
+ return false;
267769
+ }
267542
267770
  function ImportSpecifier2(node) {
267543
267771
  if (node.importKind === "type" || node.importKind === "typeof") {
267544
267772
  this.word(node.importKind);
267545
267773
  this.space();
267546
267774
  }
267547
267775
  this.print(node.imported);
267548
- if (node.local && node.local.name !== node.imported.name) {
267776
+ if (node.local && shouldPrintModuleSpecifierAlias(this, node, node.imported, node.local)) {
267549
267777
  this.space();
267550
267778
  this.word("as");
267551
267779
  this.space();
@@ -267564,15 +267792,28 @@ function ExportSpecifier2(node) {
267564
267792
  this.space();
267565
267793
  }
267566
267794
  this.print(node.local);
267567
- if (node.exported && node.local.name !== node.exported.name) {
267795
+ if (node.exported && shouldPrintModuleSpecifierAlias(this, node, node.local, node.exported)) {
267568
267796
  this.space();
267569
267797
  this.word("as");
267570
267798
  this.space();
267571
267799
  this.print(node.exported);
267572
267800
  }
267573
267801
  }
267802
+ function _printNamespaceFilter(exportsFilter) {
267803
+ if (exportsFilter) {
267804
+ this.tokenChar(123);
267805
+ if (exportsFilter.length) {
267806
+ this.space();
267807
+ this.printList(exportsFilter, this.shouldPrintTrailingComma("}"));
267808
+ this.space();
267809
+ }
267810
+ this.tokenChar(125);
267811
+ } else {
267812
+ this.tokenChar(42);
267813
+ }
267814
+ }
267574
267815
  function ExportNamespaceSpecifier2(node) {
267575
- this.tokenChar(42);
267816
+ _printNamespaceFilter.call(this, node.exportsFilter);
267576
267817
  this.space();
267577
267818
  this.word("as");
267578
267819
  this.space();
@@ -267598,16 +267839,18 @@ function ExportAllDeclaration2(node) {
267598
267839
  this.word("type");
267599
267840
  this.space();
267600
267841
  }
267842
+ if (node.phase === "defer") {
267843
+ this.word("defer");
267844
+ this.space();
267845
+ }
267601
267846
  this.tokenChar(42);
267602
267847
  this.space();
267603
267848
  this.word("from");
267604
267849
  this.space();
267850
+ this.print(node.source);
267605
267851
  if (node.attributes?.length) {
267606
- this.print(node.source, true);
267607
267852
  this.space();
267608
267853
  _printAttributes.call(this, node, false);
267609
- } else {
267610
- this.print(node.source);
267611
267854
  }
267612
267855
  this.semicolon();
267613
267856
  }
@@ -267629,11 +267872,15 @@ function ExportNamedDeclaration2(node) {
267629
267872
  this.word("type");
267630
267873
  this.space();
267631
267874
  }
267875
+ if (node.phase === "defer") {
267876
+ this.word("defer");
267877
+ this.space();
267878
+ }
267632
267879
  const specifiers = node.specifiers.slice(0);
267633
267880
  let hasSpecial = false;
267634
267881
  for (; ; ) {
267635
267882
  const first = specifiers[0];
267636
- if (isExportDefaultSpecifier2(first) || isExportNamespaceSpecifier2(first)) {
267883
+ if (isExportDefaultSpecifier2(first) || isExportNamespaceSpecifier$1(first)) {
267637
267884
  hasSpecial = true;
267638
267885
  this.print(specifiers.shift());
267639
267886
  if (specifiers.length) {
@@ -267659,12 +267906,10 @@ function ExportNamedDeclaration2(node) {
267659
267906
  this.space();
267660
267907
  this.word("from");
267661
267908
  this.space();
267909
+ this.print(node.source);
267662
267910
  if (node.attributes?.length) {
267663
- this.print(node.source, true);
267664
267911
  this.space();
267665
267912
  _printAttributes.call(this, node, hasBrace);
267666
- } else {
267667
- this.print(node.source);
267668
267913
  }
267669
267914
  }
267670
267915
  this.semicolon();
@@ -267731,12 +267976,10 @@ function ImportDeclaration2(node) {
267731
267976
  this.word("from");
267732
267977
  this.space();
267733
267978
  }
267979
+ this.print(node.source);
267734
267980
  if (node.attributes?.length) {
267735
- this.print(node.source, true);
267736
267981
  this.space();
267737
267982
  _printAttributes.call(this, node, hasBrace);
267738
- } else {
267739
- this.print(node.source);
267740
267983
  }
267741
267984
  this.semicolon();
267742
267985
  }
@@ -267747,7 +267990,7 @@ function ImportAttribute2(node) {
267747
267990
  this.print(node.value);
267748
267991
  }
267749
267992
  function ImportNamespaceSpecifier2(node) {
267750
- this.tokenChar(42);
267993
+ _printNamespaceFilter.call(this, node.exportsFilter);
267751
267994
  this.space();
267752
267995
  this.word("as");
267753
267996
  this.space();
@@ -267758,6 +268001,9 @@ function ImportExpression2(node) {
267758
268001
  if (node.phase) {
267759
268002
  this.tokenChar(46);
267760
268003
  this.word(node.phase);
268004
+ } else if (node.sync) {
268005
+ this.tokenChar(46);
268006
+ this.word("sync");
267761
268007
  }
267762
268008
  this.tokenChar(40);
267763
268009
  const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")");
@@ -267918,6 +268164,7 @@ function VoidPattern2() {
267918
268164
  }
267919
268165
  var {
267920
268166
  isDeclareExportDeclaration: isDeclareExportDeclaration2,
268167
+ isExportNamespaceSpecifier: isExportNamespaceSpecifier2,
267921
268168
  isStatement: isStatement$1
267922
268169
  } = lib_exports;
267923
268170
  function AnyTypeAnnotation2() {
@@ -268125,13 +268372,18 @@ function FlowExportDeclaration(node) {
268125
268372
  this.print(declar);
268126
268373
  if (!isStatement$1(declar)) this.semicolon();
268127
268374
  } else {
268128
- this.tokenChar(123);
268129
- if (node.specifiers.length) {
268130
- this.space();
268131
- this.printList(node.specifiers);
268132
- this.space();
268375
+ const specifiers = node.specifiers;
268376
+ if (specifiers.length === 1 && isExportNamespaceSpecifier2(specifiers[0])) {
268377
+ this.print(specifiers[0]);
268378
+ } else {
268379
+ this.tokenChar(123);
268380
+ if (specifiers.length) {
268381
+ this.space();
268382
+ this.printList(specifiers);
268383
+ this.space();
268384
+ }
268385
+ this.tokenChar(125);
268133
268386
  }
268134
- this.tokenChar(125);
268135
268387
  if (node.source) {
268136
268388
  this.space();
268137
268389
  this.word("from");
@@ -268678,6 +268930,21 @@ function StaticBlock2(node) {
268678
268930
  this.rightBrace(node);
268679
268931
  }
268680
268932
  }
268933
+ function StructDeclaration2(node) {
268934
+ this.word("struct", true);
268935
+ if (node.id) {
268936
+ this.space();
268937
+ this.print(node.id);
268938
+ }
268939
+ if (node.superClass) {
268940
+ this.space();
268941
+ this.word("extends");
268942
+ this.space();
268943
+ this.print(node.superClass);
268944
+ }
268945
+ this.space();
268946
+ this.print(node.body);
268947
+ }
268681
268948
  function File2(node) {
268682
268949
  if (node.program) {
268683
268950
  this.print(node.program.interpreter);
@@ -268995,6 +269262,8 @@ var generatorFunctions = /* @__PURE__ */ Object.defineProperty({
268995
269262
  StringLiteral: StringLiteral2,
268996
269263
  StringLiteralTypeAnnotation: StringLiteral2,
268997
269264
  StringTypeAnnotation: StringTypeAnnotation2,
269265
+ StructBody: ClassBody2,
269266
+ StructDeclaration: StructDeclaration2,
268998
269267
  Super: Super2,
268999
269268
  SwitchCase: SwitchCase2,
269000
269269
  SwitchStatement: SwitchStatement2,
@@ -269128,6 +269397,9 @@ for (const type of Object.keys(parens)) {
269128
269397
  generatorInfosMap.get(type)[2] = func;
269129
269398
  }
269130
269399
  }
269400
+ function hasPostfixPart(node, parent) {
269401
+ return parent != null && hasPostfixPart$1(node, parent, generatorInfosMap.get(parent.type)[1]);
269402
+ }
269131
269403
  function newCalleeNeedsParens(node) {
269132
269404
  let current = node;
269133
269405
  while (true) {
@@ -269175,7 +269447,7 @@ function parentNeedsParens(node, parent, parentId) {
269175
269447
  return newCalleeNeedsParens(node);
269176
269448
  }
269177
269449
  break;
269178
- case 220:
269450
+ case 222:
269179
269451
  if (parent.tag === node) {
269180
269452
  return templateTagNeedsParens(node);
269181
269453
  }
@@ -269777,7 +270049,7 @@ var Printer = class {
269777
270049
  if (!shouldPrintParens && parenthesized && node.leadingComments?.length && node.leadingComments[0].type === "CommentBlock") {
269778
270050
  switch (parentId) {
269779
270051
  case 66:
269780
- case 241:
270052
+ case 243:
269781
270053
  case 6:
269782
270054
  case 141:
269783
270055
  break;
@@ -271019,6 +271291,7 @@ var StandardErrors = {
271019
271291
  DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
271020
271292
  DecoratorStaticBlock: "Decorators can't be used with a static block.",
271021
271293
  DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.',
271294
+ DeferExportInvalidAll: '`export defer * from "./module"` is invalid. Explicitly list the re-exported names.',
271022
271295
  DeletePrivateField: "Deleting a private field is not allowed.",
271023
271296
  DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
271024
271297
  DuplicateConstructor: "Duplicate constructor in the same class.",
@@ -271036,6 +271309,11 @@ var StandardErrors = {
271036
271309
  }) => `A string literal cannot be used as an exported binding without \`from\`.
271037
271310
  - Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
271038
271311
  ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
271312
+ FilteredNamespaceDuplicateName: ({
271313
+ name
271314
+ }) => `Duplicate name '${name}' in filtered namespace.`,
271315
+ FilteredNamespaceRename: "Names in a filtered namespace cannot be renamed using `as`.",
271316
+ FilteredNamespaceTypeModifier: "Names in a filtered namespace cannot have a type modifier.",
271039
271317
  ForInOfLoopInitializer: ({
271040
271318
  type
271041
271319
  }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
@@ -271053,14 +271331,17 @@ var StandardErrors = {
271053
271331
  }) => `A string literal cannot be used as an imported binding.
271054
271332
  - Did you mean \`import { "${importName}" as foo }\`?`,
271055
271333
  ImportCallArity: ({
271056
- phase
271057
- }) => `\`import${phase ? `.${phase}` : ""}()\` requires exactly one or two arguments.`,
271334
+ phase,
271335
+ sync
271336
+ }) => `\`import${phase ? `.${phase}` : sync ? ".sync" : ""}()\` requires exactly one or two arguments.`,
271058
271337
  ImportCallNotNewExpression: ({
271059
- phase
271060
- }) => `Cannot use new with import${phase ? `.${phase}` : ""}().`,
271338
+ phase,
271339
+ sync
271340
+ }) => `Cannot use new with import${phase ? `.${phase}` : sync ? ".sync" : ""}().`,
271061
271341
  ImportCallSpreadArgument: ({
271062
- phase
271063
- }) => `\`...\` is not allowed in \`import${phase ? `.${phase}` : ""}()\`.`,
271342
+ phase,
271343
+ sync
271344
+ }) => `\`...\` is not allowed in \`import${phase ? `.${phase}` : sync ? ".sync" : ""}()\`.`,
271064
271345
  IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
271065
271346
  InvalidBigIntLiteral: "Invalid BigIntLiteral.",
271066
271347
  InvalidCodePoint: "Code point out of bounds.",
@@ -271086,7 +271367,6 @@ var StandardErrors = {
271086
271367
  InvalidLhsOptionalChaining: ({
271087
271368
  ancestor
271088
271369
  }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`,
271089
- InvalidNumber: "Invalid number.",
271090
271370
  InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
271091
271371
  InvalidOrUnexpectedToken: ({
271092
271372
  unexpected
@@ -271386,12 +271666,14 @@ function getOptions(opts) {
271386
271666
  return options2;
271387
271667
  }
271388
271668
  function toESTreeLocation(node) {
271389
- const {
271390
- start,
271391
- end
271392
- } = node.loc;
271393
- node.loc.start = new Position(start.line, start.column);
271394
- node.loc.end = new Position(end.line, end.column);
271669
+ if (node.loc) {
271670
+ const {
271671
+ start,
271672
+ end
271673
+ } = node.loc;
271674
+ node.loc.start = new Position(start.line, start.column);
271675
+ node.loc.end = new Position(end.line, end.column);
271676
+ }
271395
271677
  return node;
271396
271678
  }
271397
271679
  var estree = (superClass) => class ESTreeParserMixin extends superClass {
@@ -271669,7 +271951,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
271669
271951
  node.exported = null;
271670
271952
  break;
271671
271953
  case "ExportNamedDeclaration":
271672
- if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
271954
+ if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier" && !node.specifiers[0].exportsFilter) {
271673
271955
  this.castNodeTo(node, "ExportAllDeclaration");
271674
271956
  node.exported = node.specifiers[0].exported;
271675
271957
  delete node.specifiers;
@@ -272104,6 +272386,12 @@ var tt = {
272104
272386
  _static: createKeywordLike("static", {
272105
272387
  startsExpr
272106
272388
  }),
272389
+ _struct: createKeywordLike("struct", {
272390
+ startsExpr
272391
+ }),
272392
+ _sync: createKeywordLike("sync", {
272393
+ startsExpr
272394
+ }),
272107
272395
  _using: createKeywordLike("using", {
272108
272396
  startsExpr
272109
272397
  }),
@@ -272211,16 +272499,16 @@ var tt = {
272211
272499
  jsxTagEnd: createToken("jsxTagEnd")
272212
272500
  };
272213
272501
  function tokenIsIdentifier(token) {
272214
- return token >= 89 && token <= 130;
272502
+ return token >= 89 && token <= 132;
272215
272503
  }
272216
272504
  function tokenKeywordOrIdentifierIsKeyword(token) {
272217
272505
  return token <= 88;
272218
272506
  }
272219
272507
  function tokenIsKeywordOrIdentifier(token) {
272220
- return token >= 54 && token <= 130;
272508
+ return token >= 54 && token <= 132;
272221
272509
  }
272222
272510
  function tokenIsLiteralPropertyName(token) {
272223
- return token >= 54 && token <= 133;
272511
+ return token >= 54 && token <= 135;
272224
272512
  }
272225
272513
  function tokenComesBeforeExpression(token) {
272226
272514
  return tokenBeforeExprs[token];
@@ -272232,7 +272520,7 @@ function tokenIsAssignment(token) {
272232
272520
  return token >= 25 && token <= 29;
272233
272521
  }
272234
272522
  function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
272235
- return token >= 126 && token <= 128;
272523
+ return token >= 128 && token <= 130;
272236
272524
  }
272237
272525
  function tokenIsLoop(token) {
272238
272526
  return token >= 86 && token <= 88;
@@ -272250,10 +272538,10 @@ function tokenIsPrefix(token) {
272250
272538
  return tokenPrefixes[token];
272251
272539
  }
272252
272540
  function tokenIsTSTypeOperator(token) {
272253
- return token >= 118 && token <= 120;
272541
+ return token >= 120 && token <= 122;
272254
272542
  }
272255
272543
  function tokenIsTSDeclarationStart(token) {
272256
- return token >= 121 && token <= 127;
272544
+ return token >= 123 && token <= 129;
272257
272545
  }
272258
272546
  function tokenLabelName(token) {
272259
272547
  return tokenLabels[token];
@@ -272663,7 +272951,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272663
272951
  return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
272664
272952
  }
272665
272953
  finishToken(type, val) {
272666
- if (type !== 131 && type !== 9 && type !== 24) {
272954
+ if (type !== 133 && type !== 9 && type !== 24) {
272667
272955
  if (this.flowPragma === void 0) {
272668
272956
  this.flowPragma = null;
272669
272957
  }
@@ -272696,7 +272984,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272696
272984
  const node = this.startNode();
272697
272985
  const moduloLoc = this.state.startLoc;
272698
272986
  this.next();
272699
- this.expectContextual(107);
272987
+ this.expectContextual(109);
272700
272988
  if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
272701
272989
  this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
272702
272990
  }
@@ -272762,7 +273050,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272762
273050
  return this.flowParseDeclareFunction(node);
272763
273051
  } else if (this.match(70)) {
272764
273052
  return this.flowParseDeclareVariable(node);
272765
- } else if (this.eatContextual(124)) {
273053
+ } else if (this.eatContextual(126)) {
272766
273054
  if (this.match(12)) {
272767
273055
  return this.flowParseDeclareModuleExports(node);
272768
273056
  } else {
@@ -272771,11 +273059,11 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272771
273059
  }
272772
273060
  return this.flowParseDeclareModule(node);
272773
273061
  }
272774
- } else if (this.isContextual(127)) {
273062
+ } else if (this.isContextual(129)) {
272775
273063
  return this.flowParseDeclareTypeAlias(node);
272776
- } else if (this.isContextual(128)) {
273064
+ } else if (this.isContextual(130)) {
272777
273065
  return this.flowParseDeclareOpaqueType(node);
272778
- } else if (this.isContextual(126)) {
273066
+ } else if (this.isContextual(128)) {
272779
273067
  return this.flowParseDeclareInterface(node);
272780
273068
  } else if (this.match(78)) {
272781
273069
  return this.flowParseDeclareExportDeclaration(node, insideModule);
@@ -272791,7 +273079,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272791
273079
  }
272792
273080
  flowParseDeclareModule(node) {
272793
273081
  this.scope.enter(0);
272794
- if (this.match(131)) {
273082
+ if (this.match(133)) {
272795
273083
  node.id = super.parseExprAtom();
272796
273084
  } else {
272797
273085
  node.id = this.parseIdentifier();
@@ -272803,12 +273091,12 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272803
273091
  const bodyNode2 = this.startNode();
272804
273092
  if (this.match(79)) {
272805
273093
  this.next();
272806
- if (!this.isContextual(127) && !this.match(83)) {
273094
+ if (!this.isContextual(129) && !this.match(83)) {
272807
273095
  this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
272808
273096
  }
272809
273097
  body.push(super.parseImport(bodyNode2));
272810
273098
  } else {
272811
- this.expectContextual(122, FlowErrors.UnsupportedStatementInDeclareModule);
273099
+ this.expectContextual(124, FlowErrors.UnsupportedStatementInDeclareModule);
272812
273100
  body.push(this.flowParseDeclare(bodyNode2, true));
272813
273101
  }
272814
273102
  }
@@ -272849,18 +273137,18 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272849
273137
  node.default = true;
272850
273138
  return this.finishNode(node, "DeclareExportDeclaration");
272851
273139
  } else {
272852
- if (this.match(71) || this.isLet() || (this.isContextual(127) || this.isContextual(126)) && !insideModule) {
273140
+ if (this.match(71) || this.isLet() || (this.isContextual(129) || this.isContextual(128)) && !insideModule) {
272853
273141
  const label = this.state.value;
272854
273142
  throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
272855
273143
  unsupportedExportKind: label,
272856
273144
  suggestion: exportSuggestions[label]
272857
273145
  });
272858
273146
  }
272859
- if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(128)) {
273147
+ if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(130)) {
272860
273148
  node.declaration = this.flowParseDeclare(this.startNode());
272861
273149
  node.default = false;
272862
273150
  return this.finishNode(node, "DeclareExportDeclaration");
272863
- } else if (this.match(51) || this.match(2) || this.isContextual(126) || this.isContextual(127) || this.isContextual(128)) {
273151
+ } else if (this.match(51) || this.match(2) || this.isContextual(128) || this.isContextual(129) || this.isContextual(130)) {
272864
273152
  const result = this.parseExport(node, null);
272865
273153
  if (result.type === "ExportNamedDeclaration") {
272866
273154
  result.default = false;
@@ -272875,7 +273163,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272875
273163
  }
272876
273164
  flowParseDeclareModuleExports(node) {
272877
273165
  this.next();
272878
- this.expectContextual(108);
273166
+ this.expectContextual(110);
272879
273167
  node.typeAnnotation = this.flowParseTypeAnnotation();
272880
273168
  this.semicolon();
272881
273169
  return this.finishNode(node, "DeclareModuleExports");
@@ -272912,12 +273200,12 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272912
273200
  if (isClass3) {
272913
273201
  const implemented = [];
272914
273202
  const mixins = [];
272915
- if (this.eatContextual(114)) {
273203
+ if (this.eatContextual(116)) {
272916
273204
  do {
272917
273205
  mixins.push(this.flowParseInterfaceExtends());
272918
273206
  } while (this.eat(8));
272919
273207
  }
272920
- if (this.eatContextual(110)) {
273208
+ if (this.eatContextual(112)) {
272921
273209
  do {
272922
273210
  implemented.push(this.flowParseClassImplements());
272923
273211
  } while (this.eat(8));
@@ -272980,7 +273268,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
272980
273268
  return this.finishNode(node, "TypeAlias");
272981
273269
  }
272982
273270
  flowParseOpaqueType(node, declare) {
272983
- this.expectContextual(127);
273271
+ this.expectContextual(129);
272984
273272
  node.id = this.flowParseRestrictedIdentifier(true, true);
272985
273273
  this.scope.declareName(node.id.name, 8201, node.id.start);
272986
273274
  if (this.match(43)) {
@@ -273029,7 +273317,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273029
273317
  const node = this.startNode();
273030
273318
  node.params = [];
273031
273319
  this.state.inType = true;
273032
- if (this.match(43) || this.match(139)) {
273320
+ if (this.match(43) || this.match(141)) {
273033
273321
  this.next();
273034
273322
  } else {
273035
273323
  this.unexpected();
@@ -273109,7 +273397,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273109
273397
  }
273110
273398
  flowParseInterfaceType() {
273111
273399
  const node = this.startNode();
273112
- this.expectContextual(126);
273400
+ this.expectContextual(128);
273113
273401
  node.extends = [];
273114
273402
  if (this.eat(77)) {
273115
273403
  do {
@@ -273126,7 +273414,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273126
273414
  return this.finishNode(node, "InterfaceTypeAnnotation");
273127
273415
  }
273128
273416
  flowParseObjectPropertyKey() {
273129
- return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true);
273417
+ return this.match(134) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true);
273130
273418
  }
273131
273419
  flowParseObjectTypeIndexer(node, isStatic2, variance2) {
273132
273420
  node.static = isStatic2;
@@ -273227,7 +273515,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273227
273515
  let protoStartLoc = null;
273228
273516
  let inexactStartLoc = null;
273229
273517
  const node = this.startNode();
273230
- if (allowProto && this.isContextual(115)) {
273518
+ if (allowProto && this.isContextual(117)) {
273231
273519
  const lookahead = this.lookahead();
273232
273520
  if (lookahead.type !== 10 && lookahead.type !== 13) {
273233
273521
  this.next();
@@ -273567,7 +273855,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273567
273855
  node2.typeParameters = null;
273568
273856
  return this.finishNode(node2, "FunctionTypeAnnotation");
273569
273857
  }
273570
- case 131:
273858
+ case 133:
273571
273859
  return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
273572
273860
  case 81:
273573
273861
  case 82:
@@ -273577,18 +273865,18 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273577
273865
  case 49:
273578
273866
  if (this.state.value === "-") {
273579
273867
  this.next();
273580
- if (this.match(132)) {
273868
+ if (this.match(134)) {
273581
273869
  return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
273582
273870
  }
273583
- if (this.match(133)) {
273871
+ if (this.match(135)) {
273584
273872
  return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
273585
273873
  }
273586
273874
  throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
273587
273875
  }
273588
273876
  throw this.unexpected();
273589
- case 132:
273877
+ case 134:
273590
273878
  return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
273591
- case 133:
273879
+ case 135:
273592
273880
  return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
273593
273881
  case 84:
273594
273882
  this.next();
@@ -273610,7 +273898,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273610
273898
  this.next();
273611
273899
  return super.createIdentifier(node, label);
273612
273900
  } else if (tokenIsIdentifier(this.state.type)) {
273613
- if (this.isContextual(126)) {
273901
+ if (this.isContextual(128)) {
273614
273902
  return this.flowParseInterfaceType();
273615
273903
  }
273616
273904
  return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
@@ -273695,7 +273983,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273695
273983
  return type;
273696
273984
  }
273697
273985
  flowParseTypeOrImplicitInstantiation() {
273698
- if (this.state.type === 129 && this.state.value === "_") {
273986
+ if (this.state.type === 131 && this.state.value === "_") {
273699
273987
  const startLoc = this.state.startLoc;
273700
273988
  const node = this.parseIdentifier();
273701
273989
  return this.flowParseGenericType(startLoc, node);
@@ -273755,14 +274043,14 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273755
274043
  return super.parseFunctionBodyAndFinish(node, type, isMethod3);
273756
274044
  }
273757
274045
  parseStatementLike(flags) {
273758
- if (this.state.strict && this.isContextual(126)) {
274046
+ if (this.state.strict && this.isContextual(128)) {
273759
274047
  const lookahead = this.lookahead();
273760
274048
  if (tokenIsKeywordOrIdentifier(lookahead.type)) {
273761
274049
  const node = this.startNode();
273762
274050
  this.next();
273763
274051
  return this.flowParseInterface(node);
273764
274052
  }
273765
- } else if (this.isContextual(123)) {
274053
+ } else if (this.isContextual(125)) {
273766
274054
  const node = this.startNode();
273767
274055
  this.next();
273768
274056
  return this.flowParseEnumDeclaration(node);
@@ -273795,7 +274083,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273795
274083
  const {
273796
274084
  type
273797
274085
  } = this.state;
273798
- if (type === 123 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
274086
+ if (type === 125 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
273799
274087
  return !this.state.containsEsc;
273800
274088
  }
273801
274089
  return super.shouldParseExportDeclaration();
@@ -273804,13 +274092,13 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273804
274092
  const {
273805
274093
  type
273806
274094
  } = this.state;
273807
- if (type === 123 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
274095
+ if (type === 125 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
273808
274096
  return this.state.containsEsc;
273809
274097
  }
273810
274098
  return super.isExportDefaultSpecifier();
273811
274099
  }
273812
274100
  parseExportDefaultExpression() {
273813
- if (this.isContextual(123)) {
274101
+ if (this.isContextual(125)) {
273814
274102
  const node = this.startNode();
273815
274103
  this.next();
273816
274104
  return this.flowParseEnumDeclaration(node);
@@ -273944,7 +274232,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273944
274232
  super.assertModuleNodeAllowed(node);
273945
274233
  }
273946
274234
  parseExportDeclaration(node) {
273947
- if (this.isContextual(127)) {
274235
+ if (this.isContextual(129)) {
273948
274236
  node.exportKind = "type";
273949
274237
  const declarationNode = this.startNode();
273950
274238
  this.next();
@@ -273955,17 +274243,17 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273955
274243
  } else {
273956
274244
  return this.flowParseTypeAlias(declarationNode);
273957
274245
  }
273958
- } else if (this.isContextual(128)) {
274246
+ } else if (this.isContextual(130)) {
273959
274247
  node.exportKind = "type";
273960
274248
  const declarationNode = this.startNode();
273961
274249
  this.next();
273962
274250
  return this.flowParseOpaqueType(declarationNode, false);
273963
- } else if (this.isContextual(126)) {
274251
+ } else if (this.isContextual(128)) {
273964
274252
  node.exportKind = "type";
273965
274253
  const declarationNode = this.startNode();
273966
274254
  this.next();
273967
274255
  return this.flowParseInterface(declarationNode);
273968
- } else if (this.isContextual(123)) {
274256
+ } else if (this.isContextual(125)) {
273969
274257
  node.exportKind = "value";
273970
274258
  const declarationNode = this.startNode();
273971
274259
  this.next();
@@ -273976,7 +274264,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273976
274264
  }
273977
274265
  eatExportStar(node) {
273978
274266
  if (super.eatExportStar(node)) return true;
273979
- if (this.isContextual(127) && this.lookahead().type === 51) {
274267
+ if (this.isContextual(129) && this.lookahead().type === 51) {
273980
274268
  node.exportKind = "type";
273981
274269
  this.next();
273982
274270
  this.next();
@@ -273994,8 +274282,16 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
273994
274282
  }
273995
274283
  return hasNamespace;
273996
274284
  }
274285
+ maybeParseExportNamedSpecifiers(node) {
274286
+ if (!super.maybeParseExportNamedSpecifiers(node)) return false;
274287
+ const specifier = node.specifiers[node.specifiers.length - 1];
274288
+ if (node.exportKind === "type" && specifier?.type === "ExportNamespaceSpecifier") {
274289
+ this.unexpected(specifier.start);
274290
+ }
274291
+ return true;
274292
+ }
273997
274293
  parseClassId(node, isStatement5, optionalId) {
273998
- if ((!isStatement5 || optionalId) && this.isContextual(110)) {
274294
+ if ((!isStatement5 || optionalId) && this.isContextual(112)) {
273999
274295
  node.id = null;
274000
274296
  return;
274001
274297
  }
@@ -274008,7 +274304,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274008
274304
  const {
274009
274305
  startLoc
274010
274306
  } = this.state;
274011
- if (this.isContextual(122)) {
274307
+ if (this.isContextual(124)) {
274012
274308
  if (super.parseClassMemberFromModifier(classBody2, member)) {
274013
274309
  return;
274014
274310
  }
@@ -274034,7 +274330,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274034
274330
  identifierName: fullWord
274035
274331
  });
274036
274332
  }
274037
- this.finishToken(129, fullWord);
274333
+ this.finishToken(131, fullWord);
274038
274334
  }
274039
274335
  getTokenFromCode(code2) {
274040
274336
  const next = this.input.charCodeAt(this.state.pos + 1);
@@ -274161,7 +274457,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274161
274457
  if (node.superClass && (this.match(43) || this.match(47))) {
274162
274458
  node.superTypeArguments = this.flowParseTypeParameterInstantiationInExpression();
274163
274459
  }
274164
- if (this.eatContextual(110)) {
274460
+ if (this.eatContextual(112)) {
274165
274461
  const implemented = node.implements = [];
274166
274462
  do {
274167
274463
  implemented.push(this.flowParseClassImplements());
@@ -274233,7 +274529,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274233
274529
  }
274234
274530
  isPotentialImportPhase(isExport) {
274235
274531
  if (super.isPotentialImportPhase(isExport)) return true;
274236
- if (this.isContextual(127)) {
274532
+ if (this.isContextual(129)) {
274237
274533
  if (!isExport) return true;
274238
274534
  const ch = this.lookaheadCharCode();
274239
274535
  return ch === 123 || ch === 42;
@@ -274252,7 +274548,14 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274252
274548
  node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
274253
274549
  }
274254
274550
  }
274255
- parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
274551
+ parseNamedOrFilteredImportSpecifiers(node) {
274552
+ super.parseNamedOrFilteredImportSpecifiers(node);
274553
+ const specifier = node.specifiers[node.specifiers.length - 1];
274554
+ if (hasTypeImportKind(node) && specifier?.type === "ImportNamespaceSpecifier") {
274555
+ this.unexpected(specifier.start);
274556
+ }
274557
+ }
274558
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
274256
274559
  const firstIdent = specifier.imported;
274257
274560
  let specifierTypeKind = null;
274258
274561
  if (firstIdent.type === "Identifier") {
@@ -274262,7 +274565,6 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274262
274565
  specifierTypeKind = "typeof";
274263
274566
  }
274264
274567
  }
274265
- let isBinding3 = false;
274266
274568
  if (this.isContextual(90) && !this.isLookaheadContextual("as")) {
274267
274569
  const as_ident = this.parseIdentifier(true);
274268
274570
  if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
@@ -274279,32 +274581,30 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274279
274581
  specifier.imported = this.parseIdentifier(true);
274280
274582
  specifier.importKind = specifierTypeKind;
274281
274583
  } else {
274282
- if (importedIsString) {
274283
- throw this.raise(Errors.ImportBindingIsString, specifier, {
274284
- importName: firstIdent.value
274285
- });
274286
- }
274287
274584
  specifier.imported = firstIdent;
274288
274585
  specifier.importKind = null;
274289
274586
  }
274290
274587
  if (this.eatContextual(90)) {
274291
274588
  specifier.local = this.parseIdentifier();
274292
274589
  } else {
274293
- isBinding3 = true;
274294
274590
  specifier.local = this.cloneIdentifier(specifier.imported);
274295
274591
  }
274296
274592
  }
274593
+ return this.finishNode(specifier, "ImportSpecifier");
274594
+ }
274595
+ checkImportSpecifier(specifier, isInTypeOnlyImport) {
274297
274596
  const specifierIsTypeImport = hasTypeImportKind(specifier);
274298
- if (isInTypeOnlyImport && specifierIsTypeImport) {
274299
- this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
274300
- }
274301
- if (isInTypeOnlyImport || specifierIsTypeImport) {
274302
- this.checkReservedType(specifier.local.name, specifier.local.start, true);
274303
- }
274304
- if (isBinding3 && !isInTypeOnlyImport && !specifierIsTypeImport) {
274305
- this.checkReservedWord(specifier.local.name, specifier.start, true, true);
274597
+ const isTypeImport = isInTypeOnlyImport || specifierIsTypeImport;
274598
+ if (isTypeImport) {
274599
+ if (isInTypeOnlyImport && specifierIsTypeImport) {
274600
+ this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
274601
+ }
274602
+ const {
274603
+ local
274604
+ } = specifier;
274605
+ this.checkReservedType(local.name, local.start, true);
274306
274606
  }
274307
- return this.finishImportSpecifier(specifier, "ImportSpecifier");
274607
+ super.checkImportSpecifier(specifier, isInTypeOnlyImport, 8201, !isTypeImport);
274308
274608
  }
274309
274609
  parseBindingAtom() {
274310
274610
  switch (this.state.type) {
@@ -274343,7 +274643,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274343
274643
  parseMaybeAssign(refExpressionErrors, isParenItem) {
274344
274644
  let state = null;
274345
274645
  let jsx2;
274346
- if (this.hasPlugin("jsx") && (this.match(139) || this.match(43))) {
274646
+ if (this.hasPlugin("jsx") && (this.match(141) || this.match(43))) {
274347
274647
  state = this.state.clone();
274348
274648
  jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, isParenItem), state);
274349
274649
  if (!jsx2.error) return jsx2.node;
@@ -274594,7 +274894,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274594
274894
  const startLoc = this.state.startLoc;
274595
274895
  const endOfInit = () => this.match(8) || this.match(4);
274596
274896
  switch (this.state.type) {
274597
- case 132: {
274897
+ case 134: {
274598
274898
  const literal2 = this.parseNumericLiteral(this.state.value);
274599
274899
  if (endOfInit()) {
274600
274900
  return {
@@ -274605,7 +274905,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
274605
274905
  }
274606
274906
  break;
274607
274907
  }
274608
- case 131: {
274908
+ case 133: {
274609
274909
  const literal2 = this.parseStringLiteral(this.state.value);
274610
274910
  if (endOfInit()) {
274611
274911
  return {
@@ -275277,14 +275577,14 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275277
275577
  if (this.state.pos === this.state.start) {
275278
275578
  if (ch === 60 && this.state.canStartJSXElement) {
275279
275579
  ++this.state.pos;
275280
- this.finishToken(139);
275580
+ this.finishToken(141);
275281
275581
  } else {
275282
275582
  super.getTokenFromCode(ch);
275283
275583
  }
275284
275584
  return;
275285
275585
  }
275286
275586
  out += this.input.slice(chunkStart, this.state.pos);
275287
- this.finishToken(138, out);
275587
+ this.finishToken(140, out);
275288
275588
  return;
275289
275589
  case 38:
275290
275590
  out += this.input.slice(chunkStart, this.state.pos);
@@ -275344,7 +275644,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275344
275644
  }
275345
275645
  }
275346
275646
  out += this.input.slice(chunkStart, this.state.pos++);
275347
- this.finishToken(131, out);
275647
+ this.finishToken(133, out);
275348
275648
  }
275349
275649
  jsxReadEntity() {
275350
275650
  const startPos = ++this.state.pos;
@@ -275384,11 +275684,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275384
275684
  do {
275385
275685
  ch = this.input.charCodeAt(++this.state.pos);
275386
275686
  } while (isIdentifierChar2(ch) || ch === 45);
275387
- this.finishToken(137, this.input.slice(start, this.state.pos));
275687
+ this.finishToken(139, this.input.slice(start, this.state.pos));
275388
275688
  }
275389
275689
  jsxParseIdentifier() {
275390
275690
  const node = this.startNode();
275391
- if (this.match(137)) {
275691
+ if (this.match(139)) {
275392
275692
  node.name = this.state.value;
275393
275693
  } else if (tokenIsKeyword(this.state.type)) {
275394
275694
  node.name = tokenLabelName(this.state.type);
@@ -275433,8 +275733,8 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275433
275733
  this.raise(JsxErrors.AttributeIsEmpty, node);
275434
275734
  }
275435
275735
  return node;
275436
- case 139:
275437
- case 131:
275736
+ case 141:
275737
+ case 133:
275438
275738
  return this.parseExprAtom();
275439
275739
  default:
275440
275740
  throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
@@ -275485,7 +275785,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275485
275785
  return this.finishNode(node, "JSXAttribute");
275486
275786
  }
275487
275787
  jsxParseOpeningElementAt(startLoc) {
275488
- if (this.eat(140)) {
275788
+ if (this.eat(142)) {
275489
275789
  const node2 = this.startNodeAt(startLoc);
275490
275790
  return this.finishNode(node2, "JSXOpeningFragment");
275491
275791
  }
@@ -275495,22 +275795,22 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275495
275795
  }
275496
275796
  jsxParseOpeningElementAfterName(node) {
275497
275797
  const attributes = [];
275498
- while (!this.match(52) && !this.match(140)) {
275798
+ while (!this.match(52) && !this.match(142)) {
275499
275799
  attributes.push(this.jsxParseAttribute());
275500
275800
  }
275501
275801
  node.attributes = attributes;
275502
275802
  node.selfClosing = this.eat(52);
275503
- this.expect(140);
275803
+ this.expect(142);
275504
275804
  return this.finishNode(node, "JSXOpeningElement");
275505
275805
  }
275506
275806
  jsxParseClosingElementAt(startLoc) {
275507
- if (this.eat(140)) {
275807
+ if (this.eat(142)) {
275508
275808
  const node2 = this.startNodeAt(startLoc);
275509
275809
  return this.finishNode(node2, "JSXClosingFragment");
275510
275810
  }
275511
275811
  const node = this.startNodeAt(startLoc);
275512
275812
  node.name = this.jsxParseElementName();
275513
- this.expect(140);
275813
+ this.expect(142);
275514
275814
  return this.finishNode(node, "JSXClosingElement");
275515
275815
  }
275516
275816
  jsxParseElementAt(startLoc) {
@@ -275521,17 +275821,16 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275521
275821
  if (!openingElement.selfClosing) {
275522
275822
  contents: for (; ; ) {
275523
275823
  switch (this.state.type) {
275524
- case 139:
275824
+ case 141:
275525
275825
  startLoc = this.state.startLoc;
275526
275826
  this.next();
275527
275827
  if (this.eat(52)) {
275528
- this.setLoc(startLoc);
275529
275828
  closingElement = this.jsxParseClosingElementAt(startLoc);
275530
275829
  break contents;
275531
275830
  }
275532
275831
  children.push(this.jsxParseElementAt(startLoc));
275533
275832
  break;
275534
- case 138:
275833
+ case 140:
275535
275834
  children.push(this.parseLiteral(this.state.value, "JSXText"));
275536
275835
  break;
275537
275836
  case 2: {
@@ -275588,10 +275887,10 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275588
275887
  context[context.length - 1] = newContext;
275589
275888
  }
275590
275889
  parseExprAtom(refExpressionErrors) {
275591
- if (this.match(139)) {
275890
+ if (this.match(141)) {
275592
275891
  return this.jsxParseElement();
275593
275892
  } else if (this.match(43) && this.input.charCodeAt(this.state.pos) !== 33) {
275594
- this.replaceToken(139);
275893
+ this.replaceToken(141);
275595
275894
  return this.jsxParseElement();
275596
275895
  } else {
275597
275896
  return super.parseExprAtom(refExpressionErrors);
@@ -275614,7 +275913,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275614
275913
  }
275615
275914
  if (code2 === 62) {
275616
275915
  ++this.state.pos;
275617
- this.finishToken(140);
275916
+ this.finishToken(142);
275618
275917
  return;
275619
275918
  }
275620
275919
  if ((code2 === 34 || code2 === 39) && context === types.j_oTag) {
@@ -275624,7 +275923,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275624
275923
  }
275625
275924
  if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
275626
275925
  ++this.state.pos;
275627
- this.finishToken(139);
275926
+ this.finishToken(141);
275628
275927
  return;
275629
275928
  }
275630
275929
  super.getTokenFromCode(code2);
@@ -275634,12 +275933,12 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
275634
275933
  context,
275635
275934
  type
275636
275935
  } = this.state;
275637
- if (type === 52 && prevType === 139) {
275936
+ if (type === 52 && prevType === 141) {
275638
275937
  context.splice(-2, 2, types.j_cTag);
275639
275938
  this.state.canStartJSXElement = false;
275640
- } else if (type === 139) {
275939
+ } else if (type === 141) {
275641
275940
  context.push(types.j_oTag);
275642
- } else if (type === 140) {
275941
+ } else if (type === 142) {
275643
275942
  const out = context[context.length - 1];
275644
275943
  if (out === types.j_oTag && prevType === 52 || out === types.j_cTag) {
275645
275944
  context.pop();
@@ -275913,6 +276212,10 @@ var CommentsParser = class extends BaseParser {
275913
276212
  case "ImportDeclaration":
275914
276213
  adjustInnerComments(node, node.specifiers, commentWS);
275915
276214
  break;
276215
+ case "ImportNamespaceSpecifier":
276216
+ case "ExportNamespaceSpecifier":
276217
+ adjustInnerComments(node, node.exportsFilter ?? [], commentWS);
276218
+ break;
275916
276219
  case "TSEnumBody":
275917
276220
  adjustInnerComments(node, node.members, commentWS);
275918
276221
  break;
@@ -275950,6 +276253,12 @@ var CommentsParser = class extends BaseParser {
275950
276253
  commentWS.leadingNode = null;
275951
276254
  }
275952
276255
  }
276256
+ replaceNodeInPendingComments(oldNode, newNode) {
276257
+ for (const commentWS of this.state.commentStack) {
276258
+ if (commentWS.leadingNode === oldNode) commentWS.leadingNode = newNode;
276259
+ if (commentWS.trailingNode === oldNode) commentWS.trailingNode = newNode;
276260
+ }
276261
+ }
275953
276262
  takeSurroundingComments(node, start, end) {
275954
276263
  const {
275955
276264
  commentStack
@@ -276076,7 +276385,7 @@ var State = class _State {
276076
276385
  commentsLen = 0;
276077
276386
  commentStack = [];
276078
276387
  pos = 0;
276079
- type = 136;
276388
+ type = 138;
276080
276389
  value = null;
276081
276390
  start = 0;
276082
276391
  end = 0;
@@ -276496,6 +276805,7 @@ var Tokenizer = class extends CommentsParser {
276496
276805
  end: state.end,
276497
276806
  context: [this.curContext()],
276498
276807
  inType: state.inType,
276808
+ strict: state.strict,
276499
276809
  startLoc: state.startLoc,
276500
276810
  lastTokEndLoc: state.lastTokEndLoc,
276501
276811
  curLine: state.curLine,
@@ -276562,7 +276872,7 @@ var Tokenizer = class extends CommentsParser {
276562
276872
  this.state.start = this.state.pos;
276563
276873
  if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
276564
276874
  if (this.state.pos >= this.length) {
276565
- this.finishToken(136);
276875
+ this.finishToken(138);
276566
276876
  return;
276567
276877
  }
276568
276878
  this.getTokenFromCode(this.codePointAtPos(this.state.pos));
@@ -276736,10 +277046,10 @@ var Tokenizer = class extends CommentsParser {
276736
277046
  }
276737
277047
  if (isIdentifierStart2(next)) {
276738
277048
  ++this.state.pos;
276739
- this.finishToken(135, this.readWord1(next));
277049
+ this.finishToken(137, this.readWord1(next));
276740
277050
  } else if (next === 92) {
276741
277051
  ++this.state.pos;
276742
- this.finishToken(135, this.readWord1());
277052
+ this.finishToken(137, this.readWord1());
276743
277053
  } else {
276744
277054
  this.finishOp(23, 1);
276745
277055
  }
@@ -277118,7 +277428,7 @@ var Tokenizer = class extends CommentsParser {
277118
277428
  mods += char;
277119
277429
  }
277120
277430
  this.state.pos = pos;
277121
- this.finishToken(134, {
277431
+ this.finishToken(136, {
277122
277432
  pattern: content,
277123
277433
  flags: mods
277124
277434
  });
@@ -277131,41 +277441,63 @@ var Tokenizer = class extends CommentsParser {
277131
277441
  this.state.pos = pos;
277132
277442
  return n;
277133
277443
  }
277444
+ readLiteralInt(radix) {
277445
+ let pos = this.state.pos;
277446
+ let val = 0;
277447
+ let code2;
277448
+ for (; ; ) {
277449
+ code2 = this.input.charCodeAt(pos);
277450
+ let digit;
277451
+ if (code2 >= 48 && code2 <= 57) {
277452
+ digit = code2 - 48;
277453
+ } else {
277454
+ digit = (code2 | 32) - 97;
277455
+ if (digit < 0 || digit > 5) break;
277456
+ digit += 10;
277457
+ }
277458
+ if (digit >= radix) break;
277459
+ val = val * radix + digit;
277460
+ ++pos;
277461
+ }
277462
+ if (code2 === 95 || code2 >= 48 && code2 <= 57) {
277463
+ return this.readInt(radix);
277464
+ }
277465
+ if (pos === this.state.pos) return null;
277466
+ this.state.pos = pos;
277467
+ return val;
277468
+ }
277134
277469
  readRadixNumber(radix) {
277135
277470
  const start = this.state.pos;
277136
277471
  const startLoc = this.state.curPosition();
277137
- let isBigInt = false;
277138
277472
  this.state.pos += 2;
277139
- const val = this.readInt(radix);
277473
+ let val = this.readLiteralInt(radix);
277474
+ const end = this.state.pos;
277140
277475
  if (val == null) {
277141
277476
  this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
277142
277477
  radix
277143
277478
  });
277144
277479
  }
277145
- const next = this.input.charCodeAt(this.state.pos);
277146
- if (next === 110) {
277147
- ++this.state.pos;
277148
- isBigInt = true;
277149
- }
277480
+ const isBigInt = this.input.charCodeAt(this.state.pos) === 110;
277481
+ if (isBigInt) ++this.state.pos;
277150
277482
  if (isIdentifierStart2(this.codePointAtPos(this.state.pos))) {
277151
277483
  throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
277152
277484
  }
277153
- if (isBigInt) {
277154
- const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
277155
- this.finishToken(133, str);
277156
- return;
277485
+ if (isBigInt || val !== null && val > Number.MAX_SAFE_INTEGER) {
277486
+ const str = this.input.slice(start, end).replaceAll("_", "");
277487
+ if (isBigInt) {
277488
+ this.finishToken(135, str);
277489
+ return;
277490
+ }
277491
+ val = Number(radix !== 16 && this.optionFlags & 4096 ? str.replace(radix === 2 ? /[2-9]/g : /[89]/g, "0") : str);
277157
277492
  }
277158
- this.finishToken(132, val);
277493
+ this.finishToken(134, val);
277159
277494
  }
277160
277495
  readNumber(startsWithDot) {
277161
277496
  const start = this.state.pos;
277162
277497
  const startLoc = this.state.curPosition();
277163
277498
  let isFloat = false;
277164
- let isBigInt = false;
277165
277499
  let isOctal = false;
277166
- if (!startsWithDot && this.readInt(10) === null) {
277167
- this.raise(Errors.InvalidNumber, this.state.curPosition());
277168
- }
277500
+ const integerValue = startsWithDot ? 0 : this.readLiteralInt(10);
277169
277501
  const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
277170
277502
  if (hasLeadingZero) {
277171
277503
  const integer = this.input.slice(start, this.state.pos);
@@ -277176,12 +277508,12 @@ var Tokenizer = class extends CommentsParser {
277176
277508
  this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
277177
277509
  }
277178
277510
  }
277179
- isOctal = hasLeadingZero && !/[89]/.test(integer);
277511
+ isOctal = !/[89]/.test(integer);
277180
277512
  }
277181
277513
  let next = this.input.charCodeAt(this.state.pos);
277182
277514
  if (next === 46 && !isOctal) {
277183
277515
  ++this.state.pos;
277184
- this.readInt(10);
277516
+ this.readLiteralInt(10);
277185
277517
  isFloat = true;
277186
277518
  next = this.input.charCodeAt(this.state.pos);
277187
277519
  }
@@ -277190,29 +277522,34 @@ var Tokenizer = class extends CommentsParser {
277190
277522
  if (next === 43 || next === 45) {
277191
277523
  ++this.state.pos;
277192
277524
  }
277193
- if (this.readInt(10) === null) {
277525
+ if (this.readLiteralInt(10) === null) {
277194
277526
  this.raise(Errors.InvalidOrMissingExponent, startLoc);
277195
277527
  }
277196
277528
  isFloat = true;
277197
277529
  next = this.input.charCodeAt(this.state.pos);
277198
277530
  }
277199
- const str = this.input.slice(start, this.state.pos).replaceAll("_", "");
277200
- if (next === 110) {
277531
+ const end = this.state.pos;
277532
+ const isBigInt = next === 110;
277533
+ if (isBigInt) {
277201
277534
  if (isFloat || hasLeadingZero) {
277202
277535
  this.raise(Errors.InvalidBigIntLiteral, startLoc);
277203
277536
  }
277204
277537
  ++this.state.pos;
277205
- isBigInt = true;
277206
277538
  }
277207
277539
  if (isIdentifierStart2(this.codePointAtPos(this.state.pos))) {
277208
277540
  throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
277209
277541
  }
277542
+ if (!isFloat && !isBigInt && !hasLeadingZero && integerValue <= Number.MAX_SAFE_INTEGER) {
277543
+ this.finishToken(134, integerValue);
277544
+ return;
277545
+ }
277546
+ const str = this.input.slice(start, end).replaceAll("_", "");
277210
277547
  if (isBigInt) {
277211
- this.finishToken(133, str);
277548
+ this.finishToken(135, str);
277212
277549
  return;
277213
277550
  }
277214
277551
  const val = isOctal ? parseInt(str, 8) : parseFloat(str);
277215
- this.finishToken(132, val);
277552
+ this.finishToken(134, val);
277216
277553
  }
277217
277554
  readCodePoint(throwOnInvalid) {
277218
277555
  const {
@@ -277232,7 +277569,7 @@ var Tokenizer = class extends CommentsParser {
277232
277569
  this.state.pos = pos + 1;
277233
277570
  this.state.lineStart = lineStart2;
277234
277571
  this.state.curLine = curLine;
277235
- this.finishToken(131, str);
277572
+ this.finishToken(133, str);
277236
277573
  }
277237
277574
  readTemplateContinuation() {
277238
277575
  if (!this.match(4)) {
@@ -277264,6 +277601,7 @@ var Tokenizer = class extends CommentsParser {
277264
277601
  }
277265
277602
  }
277266
277603
  recordStrictModeErrors(toParseError, at) {
277604
+ if (this.isLookahead) return;
277267
277605
  const index3 = at.index;
277268
277606
  if (this.state.strict && !this.state.strictErrors.has(index3)) {
277269
277607
  this.raise(toParseError, at);
@@ -277314,7 +277652,7 @@ var Tokenizer = class extends CommentsParser {
277314
277652
  if (type !== void 0) {
277315
277653
  this.finishToken(type, tokenLabelName(type));
277316
277654
  } else {
277317
- this.finishToken(129, word);
277655
+ this.finishToken(131, word);
277318
277656
  }
277319
277657
  }
277320
277658
  checkKeywordEscapes() {
@@ -277490,6 +277828,9 @@ var ExpressionScope = class {
277490
277828
  isCertainlyParameterDeclaration() {
277491
277829
  return this.type === 3;
277492
277830
  }
277831
+ isInitializer() {
277832
+ return this.type === 4;
277833
+ }
277493
277834
  };
277494
277835
  var ArrowHeadParsingScope = class extends ExpressionScope {
277495
277836
  declarationErrors = /* @__PURE__ */ new Map();
@@ -277518,6 +277859,10 @@ var ExpressionScopeHandler = class {
277518
277859
  exit() {
277519
277860
  this.stack.pop();
277520
277861
  }
277862
+ canBeInParameters() {
277863
+ const scope2 = this.stack[this.stack.length - 1];
277864
+ return scope2.canBeArrowParameterDeclaration() || scope2.isCertainlyParameterDeclaration();
277865
+ }
277521
277866
  recordParameterInitializerError(toParseError, loc) {
277522
277867
  const {
277523
277868
  stack
@@ -277527,7 +277872,7 @@ var ExpressionScopeHandler = class {
277527
277872
  while (!scope2.isCertainlyParameterDeclaration()) {
277528
277873
  if (scope2.canBeArrowParameterDeclaration()) {
277529
277874
  scope2.recordDeclarationError(toParseError, loc);
277530
- } else {
277875
+ } else if (!scope2.isInitializer()) {
277531
277876
  return;
277532
277877
  }
277533
277878
  scope2 = stack[--i];
@@ -277552,13 +277897,15 @@ var ExpressionScopeHandler = class {
277552
277897
  const {
277553
277898
  stack
277554
277899
  } = this;
277555
- let i = stack.length - 1;
277556
- let scope2 = stack[i];
277557
- while (scope2.canBeArrowParameterDeclaration()) {
277558
- if (scope2.type === 2) {
277559
- scope2.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
277900
+ for (let i = stack.length - 1; ; i--) {
277901
+ const scope2 = stack[i];
277902
+ if (scope2.canBeArrowParameterDeclaration()) {
277903
+ if (scope2.type === 2) {
277904
+ scope2.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
277905
+ }
277906
+ } else if (!scope2.isInitializer()) {
277907
+ return;
277560
277908
  }
277561
- scope2 = stack[--i];
277562
277909
  }
277563
277910
  }
277564
277911
  validateAsPattern() {
@@ -277569,27 +277916,26 @@ var ExpressionScopeHandler = class {
277569
277916
  if (!currentScope.canBeArrowParameterDeclaration()) return;
277570
277917
  currentScope.iterateErrors((toParseError, key) => {
277571
277918
  this.parser.raise(toParseError, key);
277572
- let i = stack.length - 2;
277573
- let scope2 = stack[i];
277574
- while (scope2.canBeArrowParameterDeclaration()) {
277575
- scope2.clearDeclarationError(key);
277576
- scope2 = stack[--i];
277919
+ for (let i = stack.length - 2; ; i--) {
277920
+ const scope2 = stack[i];
277921
+ if (scope2.canBeArrowParameterDeclaration()) {
277922
+ scope2.clearDeclarationError(key);
277923
+ } else if (!scope2.isInitializer()) {
277924
+ break;
277925
+ }
277577
277926
  }
277578
277927
  });
277579
277928
  }
277580
277929
  };
277581
- function newParameterDeclarationScope() {
277582
- return new ExpressionScope(3);
277583
- }
277584
277930
  function newArrowHeadScope() {
277585
277931
  return new ArrowHeadParsingScope(1);
277586
277932
  }
277587
277933
  function newAsyncArrowScope() {
277588
277934
  return new ArrowHeadParsingScope(2);
277589
277935
  }
277590
- function newExpressionScope() {
277591
- return new ExpressionScope();
277592
- }
277936
+ var sharedExpressionScope = new ExpressionScope();
277937
+ var parameterDeclarationScope = new ExpressionScope(3);
277938
+ var initializerScope = new ExpressionScope(4);
277593
277939
  var ProductionParameterHandler = class {
277594
277940
  stacks = [];
277595
277941
  enter(flags) {
@@ -277645,7 +277991,7 @@ var UtilParser = class extends Tokenizer {
277645
277991
  isUnparsedContextual(nameStart, name) {
277646
277992
  if (this.input.startsWith(name, nameStart)) {
277647
277993
  const nextCh = this.input.charCodeAt(nameStart + name.length);
277648
- return !(isIdentifierChar2(nextCh) || (nextCh & 64512) === 55296);
277994
+ return !(isIdentifierChar2(nextCh) || nextCh === 92 || (nextCh & 64512) === 55296);
277649
277995
  }
277650
277996
  return false;
277651
277997
  }
@@ -277669,7 +278015,7 @@ var UtilParser = class extends Tokenizer {
277669
278015
  }
277670
278016
  }
277671
278017
  canInsertSemicolon() {
277672
- return this.match(136) || this.match(4) || this.hasPrecedingLineBreak();
278018
+ return this.match(138) || this.match(4) || this.hasPrecedingLineBreak();
277673
278019
  }
277674
278020
  hasPrecedingLineBreak() {
277675
278021
  return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
@@ -277689,10 +278035,28 @@ var UtilParser = class extends Tokenizer {
277689
278035
  this.unexpected(loc, type);
277690
278036
  }
277691
278037
  }
278038
+ snapshotScopeStacks() {
278039
+ return {
278040
+ scopeDepth: this.scope.scopeStack.length,
278041
+ prodParamDepth: this.prodParam.stacks.length,
278042
+ classScopeDepth: this.classScope.stack.length,
278043
+ expressionScopeDepth: this.expressionScope.stack.length
278044
+ };
278045
+ }
278046
+ restoreScopeStacks(snapshot) {
278047
+ const {
278048
+ scope: scope2
278049
+ } = this;
278050
+ while (scope2.scopeStack.length > snapshot.scopeDepth) scope2.exit();
278051
+ this.prodParam.stacks.length = snapshot.prodParamDepth;
278052
+ this.classScope.stack.length = snapshot.classScopeDepth;
278053
+ this.expressionScope.stack.length = snapshot.expressionScopeDepth;
278054
+ }
277692
278055
  tryParse(fn, oldState = this.state.clone()) {
277693
278056
  const abortSignal = {
277694
278057
  node: null
277695
278058
  };
278059
+ const scopeStacksSnapshot = this.snapshotScopeStacks();
277696
278060
  try {
277697
278061
  const node = fn((node2 = null) => {
277698
278062
  abortSignal.node = node2;
@@ -277720,6 +278084,7 @@ var UtilParser = class extends Tokenizer {
277720
278084
  } catch (error) {
277721
278085
  const failState = this.state;
277722
278086
  this.state = oldState;
278087
+ this.restoreScopeStacks(scopeStacksSnapshot);
277723
278088
  if (error instanceof SyntaxError) {
277724
278089
  return {
277725
278090
  node: null,
@@ -277870,13 +278235,10 @@ var NodeUtils = class extends UtilParser {
277870
278235
  return loc;
277871
278236
  }
277872
278237
  startNode() {
277873
- const {
277874
- startLoc
277875
- } = this.state;
277876
- this.setLoc(startLoc);
277877
- return this.startNodeAt(startLoc);
278238
+ return this.startNodeAt(this.state.startLoc);
277878
278239
  }
277879
278240
  startNodeAt(loc) {
278241
+ this.setLoc(loc);
277880
278242
  const {
277881
278243
  optionFlags,
277882
278244
  filename
@@ -278012,6 +278374,20 @@ var unwrapParenthesizedExpression = (node) => {
278012
278374
  return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
278013
278375
  };
278014
278376
  var LValParser = class extends NodeUtils {
278377
+ raiseOnce(toParseError, node) {
278378
+ const {
278379
+ errors
278380
+ } = this.state;
278381
+ const length = errors.length;
278382
+ const error = this.raise(toParseError, node);
278383
+ if (errors.length === length) return;
278384
+ for (let i = length - 1; i >= 0; i--) {
278385
+ if (errors[i].pos === error.pos && errors[i].reasonCode === error.reasonCode) {
278386
+ errors.pop();
278387
+ return;
278388
+ }
278389
+ }
278390
+ }
278015
278391
  toAssignable(node, isLHS = false) {
278016
278392
  let parenthesized = void 0;
278017
278393
  if (node.type === "ParenthesizedExpression" || node.extra?.parenthesized) {
@@ -278020,10 +278396,10 @@ var LValParser = class extends NodeUtils {
278020
278396
  if (parenthesized.type === "Identifier") {
278021
278397
  this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
278022
278398
  } else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
278023
- this.raise(Errors.InvalidParenthesizedAssignment, node);
278399
+ this.raiseOnce(Errors.InvalidParenthesizedAssignment, node);
278024
278400
  }
278025
278401
  } else {
278026
- this.raise(Errors.InvalidParenthesizedAssignment, node);
278402
+ this.raiseOnce(Errors.InvalidParenthesizedAssignment, node);
278027
278403
  }
278028
278404
  }
278029
278405
  switch (node.type) {
@@ -278245,7 +278621,7 @@ var LValParser = class extends NodeUtils {
278245
278621
  return this.parseBindingRestProperty(this.startNode());
278246
278622
  }
278247
278623
  const prop = this.startNode();
278248
- if (type === 135) {
278624
+ if (type === 137) {
278249
278625
  this.expectPlugin("destructuringPrivate", startLoc);
278250
278626
  this.classScope.usePrivateName(this.state.value, startLoc);
278251
278627
  prop.key = this.parsePrivateName();
@@ -278452,11 +278828,11 @@ var ExpressionParser = class extends LValParser {
278452
278828
  getExpression() {
278453
278829
  this.enterInitialScopes();
278454
278830
  this.nextToken();
278455
- if (this.match(136)) {
278831
+ if (this.match(138)) {
278456
278832
  throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc);
278457
278833
  }
278458
278834
  const expr = this.parseExpression();
278459
- if (!this.match(136)) {
278835
+ if (!this.match(138)) {
278460
278836
  throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, {
278461
278837
  unexpected: this.input.codePointAt(this.state.start)
278462
278838
  });
@@ -278500,7 +278876,7 @@ var ExpressionParser = class extends LValParser {
278500
278876
  }
278501
278877
  parseMaybeAssign(refExpressionErrors, isParenItem) {
278502
278878
  const startLoc = this.state.startLoc;
278503
- const isYield = this.isContextual(105);
278879
+ const isYield = this.isContextual(107);
278504
278880
  if (isYield) {
278505
278881
  if (this.prodParam.hasYield) {
278506
278882
  this.next();
@@ -278512,11 +278888,16 @@ var ExpressionParser = class extends LValParser {
278512
278888
  }
278513
278889
  }
278514
278890
  let ownExpressionErrors;
278891
+ let inInitializerScope = false;
278515
278892
  if (refExpressionErrors) {
278516
278893
  ownExpressionErrors = false;
278517
278894
  } else {
278518
278895
  refExpressionErrors = new ExpressionErrors();
278519
278896
  ownExpressionErrors = true;
278897
+ if (this.expressionScope.canBeInParameters()) {
278898
+ this.expressionScope.enter(initializerScope);
278899
+ inInitializerScope = true;
278900
+ }
278520
278901
  }
278521
278902
  this.state.canStartArrow = true;
278522
278903
  let left = this.parseMaybeConditional(refExpressionErrors);
@@ -278549,10 +278930,12 @@ var ExpressionParser = class extends LValParser {
278549
278930
  }
278550
278931
  this.next();
278551
278932
  node.right = this.parseMaybeAssign();
278933
+ if (inInitializerScope) this.expressionScope.exit();
278552
278934
  this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), void 0, void 0, void 0, void 0, operator === "||=" || operator === "&&=" || operator === "??=");
278553
278935
  return node;
278554
278936
  } else if (ownExpressionErrors) {
278555
278937
  this.checkExpressionErrors(refExpressionErrors, true);
278938
+ if (inInitializerScope) this.expressionScope.exit();
278556
278939
  }
278557
278940
  if (isYield) {
278558
278941
  const {
@@ -278586,7 +278969,7 @@ var ExpressionParser = class extends LValParser {
278586
278969
  return expr;
278587
278970
  }
278588
278971
  parseMaybeUnaryOrPrivate(refExpressionErrors) {
278589
- return this.match(135) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
278972
+ return this.match(137) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
278590
278973
  }
278591
278974
  parseExprOps(refExpressionErrors) {
278592
278975
  const startLoc = this.state.startLoc;
@@ -278755,7 +279138,6 @@ var ExpressionParser = class extends LValParser {
278755
279138
  }
278756
279139
  parseExprSubscripts(refExpressionErrors) {
278757
279140
  const startLoc = this.state.startLoc;
278758
- this.setLoc(startLoc);
278759
279141
  if (refExpressionErrors != null && (this.match(2) || this.match(0))) {
278760
279142
  const atomExpressionErrors = new ExpressionErrors();
278761
279143
  const expr2 = this.parseExprAtom(atomExpressionErrors);
@@ -278831,7 +279213,7 @@ var ExpressionParser = class extends LValParser {
278831
279213
  if (computed) {
278832
279214
  node.property = this.parseExpression();
278833
279215
  this.expect(1);
278834
- } else if (this.match(135)) {
279216
+ } else if (this.match(137)) {
278835
279217
  if (base2.type === "Super") {
278836
279218
  this.raise(Errors.SuperPrivateField, startLoc);
278837
279219
  }
@@ -278982,7 +279364,7 @@ var ExpressionParser = class extends LValParser {
278982
279364
  node = this.startNode();
278983
279365
  this.next();
278984
279366
  if (this.match(12)) {
278985
- return this.parseImportMetaPropertyOrPhaseCall(node);
279367
+ return this.parseImportMetaPropertyOrPhaseCallOrSyncCall(node);
278986
279368
  }
278987
279369
  if (this.match(6)) {
278988
279370
  if (this.optionFlags & 1024) {
@@ -279006,11 +279388,11 @@ var ExpressionParser = class extends LValParser {
279006
279388
  this.readRegexp();
279007
279389
  return this.parseRegExpLiteral(this.state.value);
279008
279390
  }
279009
- case 132:
279391
+ case 134:
279010
279392
  return this.parseNumericLiteral(this.state.value);
279011
- case 133:
279393
+ case 135:
279012
279394
  return this.parseBigIntLiteral(this.state.value);
279013
- case 131:
279395
+ case 133:
279014
279396
  return this.parseStringLiteral(this.state.value);
279015
279397
  case 80:
279016
279398
  return this.parseNullLiteral();
@@ -279051,7 +279433,7 @@ var ExpressionParser = class extends LValParser {
279051
279433
  throw this.raise(Errors.UnsupportedBind, callee);
279052
279434
  }
279053
279435
  }
279054
- case 135: {
279436
+ case 137: {
279055
279437
  this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
279056
279438
  identifierName: this.state.value
279057
279439
  });
@@ -279079,13 +279461,13 @@ var ExpressionParser = class extends LValParser {
279079
279461
  case 43: {
279080
279462
  const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
279081
279463
  if (isIdentifierStart2(lookaheadCh) || lookaheadCh === 62) {
279082
- throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
279464
+ this.expectOnePlugin(["jsx", "flow", "typescript"]);
279083
279465
  }
279084
279466
  throw this.unexpected();
279085
279467
  }
279086
279468
  default:
279087
279469
  if (tokenIsIdentifier(type)) {
279088
- if (this.isContextual(124) && this.lookaheadInLineCharCode() === 123) {
279470
+ if (this.isContextual(126) && this.lookaheadInLineCharCode() === 123) {
279089
279471
  return this.parseModuleExpression();
279090
279472
  }
279091
279473
  const {
@@ -279242,7 +279624,7 @@ var ExpressionParser = class extends LValParser {
279242
279624
  }
279243
279625
  return this.finishNode(node, "MetaProperty");
279244
279626
  }
279245
- parseImportMetaPropertyOrPhaseCall(node) {
279627
+ parseImportMetaPropertyOrPhaseCallOrSyncCall(node) {
279246
279628
  this.next();
279247
279629
  if (this.isContextual(102) || this.isContextual(94)) {
279248
279630
  const isSource = this.isContextual(102);
@@ -279250,6 +279632,11 @@ var ExpressionParser = class extends LValParser {
279250
279632
  this.next();
279251
279633
  node.phase = isSource ? "source" : "defer";
279252
279634
  return this.parseImportCall(node);
279635
+ } else if (this.isContextual(105)) {
279636
+ this.expectPlugin("importSync");
279637
+ this.next();
279638
+ node.sync = true;
279639
+ return this.parseImportCall(node);
279253
279640
  } else {
279254
279641
  const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc);
279255
279642
  if (this.isContextual(98)) {
@@ -279641,16 +280028,16 @@ var ExpressionParser = class extends LValParser {
279641
280028
  key = this.parseIdentifier(true);
279642
280029
  } else {
279643
280030
  switch (type) {
279644
- case 132:
280031
+ case 134:
279645
280032
  key = this.parseNumericLiteral(value);
279646
280033
  break;
279647
- case 131:
280034
+ case 133:
279648
280035
  key = this.parseStringLiteral(value);
279649
280036
  break;
279650
- case 133:
280037
+ case 135:
279651
280038
  key = this.parseBigIntLiteral(value);
279652
280039
  break;
279653
- case 135: {
280040
+ case 137: {
279654
280041
  const privateKeyLoc = this.state.startLoc;
279655
280042
  if (refExpressionErrors != null) {
279656
280043
  if (refExpressionErrors.privateKeyLoc === null) {
@@ -279667,7 +280054,7 @@ var ExpressionParser = class extends LValParser {
279667
280054
  }
279668
280055
  }
279669
280056
  prop.key = key;
279670
- if (type !== 135) {
280057
+ if (type !== 137) {
279671
280058
  prop.computed = false;
279672
280059
  }
279673
280060
  }
@@ -279724,7 +280111,7 @@ var ExpressionParser = class extends LValParser {
279724
280111
  }
279725
280112
  parseFunctionBody(node, allowExpression, isMethod3 = false) {
279726
280113
  const isExpression4 = allowExpression && !this.match(2);
279727
- this.expressionScope.enter(newExpressionScope());
280114
+ this.expressionScope.enter(sharedExpressionScope);
279728
280115
  if (isExpression4) {
279729
280116
  node.body = this.parseMaybeAssign();
279730
280117
  this.checkParams(node, false, allowExpression, false);
@@ -279845,7 +280232,7 @@ var ExpressionParser = class extends LValParser {
279845
280232
  const tokenIsKeyword2 = tokenKeywordOrIdentifierIsKeyword(type);
279846
280233
  if (liberal) {
279847
280234
  if (tokenIsKeyword2) {
279848
- this.replaceToken(129);
280235
+ this.replaceToken(131);
279849
280236
  }
279850
280237
  } else {
279851
280238
  this.checkReservedWord(name, this.sourceToOffsetPos(start), tokenIsKeyword2, false);
@@ -279903,7 +280290,6 @@ var ExpressionParser = class extends LValParser {
279903
280290
  }
279904
280291
  parseAwait(startLoc, soloAwait) {
279905
280292
  const startIndex = startLoc.index;
279906
- this.setLoc(startLoc);
279907
280293
  const node = this.startNodeAt(startLoc);
279908
280294
  this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, startIndex);
279909
280295
  if (this.eat(51)) {
@@ -279927,10 +280313,9 @@ var ExpressionParser = class extends LValParser {
279927
280313
  const {
279928
280314
  type
279929
280315
  } = this.state;
279930
- return type === 49 || type === 6 || type === 0 || tokenIsTemplate(type) || type === 99 && !this.state.containsEsc || type === 134 || type === 52 || this.hasPlugin("v8intrinsic") && type === 50;
280316
+ return type === 49 || type === 6 || type === 0 || tokenIsTemplate(type) || type === 99 && !this.state.containsEsc || type === 136 || type === 52 || this.hasPlugin("v8intrinsic") && type === 50;
279931
280317
  }
279932
280318
  parseYield(startLoc) {
279933
- this.setLoc(startLoc);
279934
280319
  const node = this.startNodeAt(startLoc);
279935
280320
  this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, startLoc.index);
279936
280321
  let delegating = false;
@@ -279939,7 +280324,7 @@ var ExpressionParser = class extends LValParser {
279939
280324
  delegating = this.eat(51);
279940
280325
  switch (this.state.type) {
279941
280326
  case 9:
279942
- case 136:
280327
+ case 138:
279943
280328
  case 4:
279944
280329
  case 7:
279945
280330
  case 1:
@@ -279947,6 +280332,8 @@ var ExpressionParser = class extends LValParser {
279947
280332
  case 10:
279948
280333
  case 8:
279949
280334
  if (!delegating) break;
280335
+ case 54:
280336
+ if (this.options.annexB && !delegating) break;
279950
280337
  default:
279951
280338
  argument = this.parseMaybeAssign();
279952
280339
  }
@@ -280087,6 +280474,7 @@ var switchLabel = {
280087
280474
  };
280088
280475
  var loneSurrogate = /[\uD800-\uDFFF]/u;
280089
280476
  var keywordRelationalOperator = /in(?:stanceof)?/y;
280477
+ var keywordLikeWord = /[a-z]{2,10}/y;
280090
280478
  function createExportedTokens(tokens) {
280091
280479
  for (let i = 0; i < tokens.length; i++) {
280092
280480
  const token = tokens[i];
@@ -280101,7 +280489,7 @@ function createExportedTokens(tokens) {
280101
280489
  }
280102
280490
  var StatementParser = class extends ExpressionParser {
280103
280491
  parseTopLevel(file2, program3) {
280104
- file2.program = this.parseProgram(program3, 136, this.options.sourceType === "module" ? "module" : "script");
280492
+ file2.program = this.parseProgram(program3, 138, this.options.sourceType === "module" ? "module" : "script");
280105
280493
  file2.comments = this.comments;
280106
280494
  if (this.optionFlags & 512) {
280107
280495
  file2.tokens = createExportedTokens(this.tokens);
@@ -280123,7 +280511,7 @@ var StatementParser = class extends ExpressionParser {
280123
280511
  this.addExtra(program3, "topLevelAwait", this.state.hasTopLevelAwait);
280124
280512
  }
280125
280513
  let finishedProgram;
280126
- if (end === 136) {
280514
+ if (end === 138) {
280127
280515
  finishedProgram = this.finishNode(program3, "Program");
280128
280516
  } else {
280129
280517
  finishedProgram = this.finishNodeAt(program3, "Program", createPositionWithColumnOffset(this.state.startLoc, -1));
@@ -280159,13 +280547,13 @@ var StatementParser = class extends ExpressionParser {
280159
280547
  return this.hasFollowingBindingAtom();
280160
280548
  }
280161
280549
  isUsing() {
280162
- if (!this.isContextual(104)) {
280550
+ if (!this.isContextual(106)) {
280163
280551
  return false;
280164
280552
  }
280165
280553
  return this.nextTokenIsIdentifierOnSameLine();
280166
280554
  }
280167
280555
  isForUsing() {
280168
- if (!this.isContextual(104)) {
280556
+ if (!this.isContextual(106)) {
280169
280557
  return false;
280170
280558
  }
280171
280559
  const next = this.nextTokenInLineStart();
@@ -280216,6 +280604,22 @@ var StatementParser = class extends ExpressionParser {
280216
280604
  return false;
280217
280605
  }
280218
280606
  }
280607
+ isReservedWordOnNewLineAfterLet(pos) {
280608
+ if (!hasNewLine(this.input, this.state.end, pos)) {
280609
+ return false;
280610
+ }
280611
+ keywordLikeWord.lastIndex = pos;
280612
+ if (!keywordLikeWord.test(this.input)) {
280613
+ return false;
280614
+ }
280615
+ const end = keywordLikeWord.lastIndex;
280616
+ const endCh = this.codePointAtPos(end);
280617
+ if (isIdentifierChar2(endCh) || endCh === 92) {
280618
+ return false;
280619
+ }
280620
+ const word = this.input.slice(pos, end);
280621
+ return isKeyword2(word) || isReservedWord2(word, false);
280622
+ }
280219
280623
  chStartsBindingPattern(ch) {
280220
280624
  return ch === 91 || ch === 123;
280221
280625
  }
@@ -280284,6 +280688,13 @@ var StatementParser = class extends ExpressionParser {
280284
280688
  case 76:
280285
280689
  if (!allowDeclaration) this.unexpected();
280286
280690
  return this.parseClass(this.maybeTakeDecorators(decorators, node), true);
280691
+ case 104:
280692
+ if (!this.state.containsEsc && this.nextTokenIsIdentifierOnSameLine()) {
280693
+ this.expectPlugin("structs");
280694
+ if (!allowDeclaration) this.unexpected();
280695
+ return this.parseStructDeclaration(node, false);
280696
+ }
280697
+ break;
280287
280698
  case 65:
280288
280699
  return this.parseIfStatement(node);
280289
280700
  case 66:
@@ -280307,7 +280718,7 @@ var StatementParser = class extends ExpressionParser {
280307
280718
  return this.parseVarStatement(node, "await using");
280308
280719
  }
280309
280720
  break;
280310
- case 104:
280721
+ case 106:
280311
280722
  if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
280312
280723
  break;
280313
280724
  }
@@ -280328,6 +280739,7 @@ var StatementParser = class extends ExpressionParser {
280328
280739
  if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {
280329
280740
  break;
280330
280741
  }
280742
+ if (this.isReservedWordOnNewLineAfterLet(next)) break;
280331
280743
  }
280332
280744
  }
280333
280745
  case 71: {
@@ -280448,7 +280860,7 @@ var StatementParser = class extends ExpressionParser {
280448
280860
  while (this.eat(12)) {
280449
280861
  const node2 = this.startNodeAt(startLoc);
280450
280862
  node2.object = expr;
280451
- if (this.match(135)) {
280863
+ if (this.match(137)) {
280452
280864
  this.classScope.usePrivateName(this.state.value, this.state.startLoc);
280453
280865
  node2.property = this.parsePrivateName();
280454
280866
  } else {
@@ -280924,7 +281336,7 @@ var StatementParser = class extends ExpressionParser {
280924
281336
  this.scope.enter(514);
280925
281337
  this.prodParam.enter(functionFlags(isAsync, node.generator));
280926
281338
  if (!isDeclaration2 && tokenIsIdentifier(this.state.type)) {
280927
- this.expressionScope.enter(newExpressionScope());
281339
+ this.expressionScope.enter(sharedExpressionScope);
280928
281340
  node.id = this.parseFunctionId();
280929
281341
  this.expressionScope.exit();
280930
281342
  }
@@ -280942,7 +281354,7 @@ var StatementParser = class extends ExpressionParser {
280942
281354
  }
280943
281355
  parseFunctionParams(node, isConstructor) {
280944
281356
  this.expect(6);
280945
- this.expressionScope.enter(newParameterDeclarationScope());
281357
+ this.expressionScope.enter(parameterDeclarationScope);
280946
281358
  node.params = this.parseBindingList(7, 41, 2 | (isConstructor ? 4 : 0));
280947
281359
  this.expressionScope.exit();
280948
281360
  }
@@ -281054,7 +281466,7 @@ var StatementParser = class extends ExpressionParser {
281054
281466
  this.parsePropertyNamePrefixOperator(member);
281055
281467
  if (this.eat(51)) {
281056
281468
  method.kind = "method";
281057
- const isPrivateName3 = this.match(135);
281469
+ const isPrivateName3 = this.match(137);
281058
281470
  this.parseClassElementName(method);
281059
281471
  this.parsePostMemberNameModifiers(method);
281060
281472
  if (isPrivateName3) {
@@ -281109,7 +281521,7 @@ var StatementParser = class extends ExpressionParser {
281109
281521
  this.unexpected(maybeQuestionTokenStartLoc);
281110
281522
  }
281111
281523
  method.kind = "method";
281112
- const isPrivate3 = this.match(135);
281524
+ const isPrivate3 = this.match(137);
281113
281525
  this.parseClassElementName(method);
281114
281526
  this.parsePostMemberNameModifiers(publicMember);
281115
281527
  if (isPrivate3) {
@@ -281123,7 +281535,7 @@ var StatementParser = class extends ExpressionParser {
281123
281535
  } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(51) && this.isLineTerminator())) {
281124
281536
  this.resetPreviousNodeTrailingComments(key);
281125
281537
  method.kind = maybeContextualKw;
281126
- const isPrivate3 = this.match(135);
281538
+ const isPrivate3 = this.match(137);
281127
281539
  this.parseClassElementName(publicMethod);
281128
281540
  if (isPrivate3) {
281129
281541
  this.pushClassPrivateMethod(classBody2, privateMethod, false, false);
@@ -281137,7 +281549,7 @@ var StatementParser = class extends ExpressionParser {
281137
281549
  } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
281138
281550
  this.expectPlugin("decoratorAutoAccessors");
281139
281551
  this.resetPreviousNodeTrailingComments(key);
281140
- const isPrivate3 = this.match(135);
281552
+ const isPrivate3 = this.match(137);
281141
281553
  this.parseClassElementName(publicProp);
281142
281554
  this.pushClassAccessorProperty(classBody2, accessorProp, isPrivate3);
281143
281555
  } else if (this.isLineTerminator()) {
@@ -281155,10 +281567,10 @@ var StatementParser = class extends ExpressionParser {
281155
281567
  type,
281156
281568
  value
281157
281569
  } = this.state;
281158
- if ((type === 129 || type === 131) && member.static && value === "prototype") {
281570
+ if ((type === 131 || type === 133) && member.static && value === "prototype") {
281159
281571
  this.raise(Errors.StaticPrototype, this.state.startLoc);
281160
281572
  }
281161
- if (type === 135) {
281573
+ if (type === 137) {
281162
281574
  if (value === "constructor") {
281163
281575
  this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
281164
281576
  }
@@ -281236,7 +281648,7 @@ var StatementParser = class extends ExpressionParser {
281236
281648
  }
281237
281649
  parseInitializer(node) {
281238
281650
  this.scope.enter(576 | 16);
281239
- this.expressionScope.enter(newExpressionScope());
281651
+ this.expressionScope.enter(sharedExpressionScope);
281240
281652
  this.prodParam.enter(0);
281241
281653
  node.value = this.eat(25) ? this.parseMaybeAssignAllowIn() : null;
281242
281654
  this.expressionScope.exit();
@@ -281266,6 +281678,36 @@ var StatementParser = class extends ExpressionParser {
281266
281678
  node.superClass = null;
281267
281679
  }
281268
281680
  }
281681
+ parseStructDeclaration(node, optionalId) {
281682
+ this.next();
281683
+ const oldStrict = this.state.strict;
281684
+ this.state.strict = true;
281685
+ this.parseClassId(node, true, optionalId);
281686
+ this.parseClassSuper(node);
281687
+ node.body = this.parseStructBody(!!node.superClass, oldStrict);
281688
+ return this.finishNode(node, "StructDeclaration");
281689
+ }
281690
+ parseStructBody(hadSuperClass, oldStrict) {
281691
+ this.classScope.enter();
281692
+ const state = {
281693
+ hadConstructor: false,
281694
+ hadSuperClass
281695
+ };
281696
+ const structBody2 = this.startNode();
281697
+ structBody2.body = [];
281698
+ this.expect(2);
281699
+ while (!this.match(4)) {
281700
+ if (this.eat(9)) {
281701
+ continue;
281702
+ }
281703
+ const member = this.startNode();
281704
+ this.parseClassMember(structBody2, member, state);
281705
+ }
281706
+ this.state.strict = oldStrict;
281707
+ this.next();
281708
+ this.classScope.exit();
281709
+ return this.finishNode(structBody2, "StructBody");
281710
+ }
281269
281711
  parseExport(node, decorators) {
281270
281712
  const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
281271
281713
  const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
@@ -281273,17 +281715,20 @@ var StatementParser = class extends ExpressionParser {
281273
281715
  const hasStar = parseAfterDefault && this.eatExportStar(node);
281274
281716
  const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
281275
281717
  const parseAfterNamespace = parseAfterDefault && !hasNamespace;
281276
- const isFromRequired = hasDefault || hasStar;
281277
281718
  if (hasStar && !hasNamespace) {
281278
281719
  if (hasDefault) this.unexpected();
281279
281720
  if (decorators) {
281280
281721
  throw this.raise(Errors.UnsupportedDecoratorExport, node);
281281
281722
  }
281723
+ if (node.phase === "defer") {
281724
+ this.raise(Errors.DeferExportInvalidAll, node);
281725
+ }
281282
281726
  this.parseExportFrom(node, true);
281283
281727
  this.sawUnambiguousESM = true;
281284
281728
  return this.finishNode(node, "ExportAllDeclaration");
281285
281729
  }
281286
281730
  const hasSpecifiers = parseAfterNamespace && this.maybeParseExportNamedSpecifiers(node);
281731
+ const isFromRequired = hasDefault || hasStar || node.phase === "defer" || hasSpecifiers && node.specifiers[0]?.type === "ExportNamespaceSpecifier";
281287
281732
  if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {
281288
281733
  this.unexpected(null, 2);
281289
281734
  }
@@ -281305,6 +281750,7 @@ var StatementParser = class extends ExpressionParser {
281305
281750
  } else if (decorators) {
281306
281751
  throw this.raise(Errors.UnsupportedDecoratorExport, node);
281307
281752
  }
281753
+ if (this.hasPlugin("deferredReexports")) node2.phase ??= null;
281308
281754
  this.sawUnambiguousESM = true;
281309
281755
  return this.finishNode(node2, "ExportNamedDeclaration");
281310
281756
  }
@@ -281358,7 +281804,19 @@ var StatementParser = class extends ExpressionParser {
281358
281804
  const node2 = node;
281359
281805
  if (!node2.specifiers) node2.specifiers = [];
281360
281806
  const isTypeExport = node2.exportKind === "type";
281361
- node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
281807
+ const startLoc = this.state.startLoc;
281808
+ this.setLoc(startLoc);
281809
+ const specifiers = this.parseExportSpecifiers(isTypeExport);
281810
+ if (this.isContextual(90) && !this.hasPrecedingLineBreak()) {
281811
+ this.expectPlugin("namespaceImportFilter");
281812
+ const specifier = this.startNodeAt(startLoc);
281813
+ specifier.exportsFilter = this.toNamespaceExportsFilter(specifiers);
281814
+ this.next();
281815
+ specifier.exported = this.parseModuleExportName();
281816
+ node2.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
281817
+ } else {
281818
+ node2.specifiers.push(...specifiers);
281819
+ }
281362
281820
  node2.source = null;
281363
281821
  node2.attributes = [];
281364
281822
  node2.declaration = null;
@@ -281394,10 +281852,18 @@ var StatementParser = class extends ExpressionParser {
281394
281852
  if (this.match(76)) {
281395
281853
  return this.parseClass(expr, true, true);
281396
281854
  }
281855
+ if (this.isContextual(104)) {
281856
+ const next = this.nextTokenInLineStart();
281857
+ const nextCh = this.codePointAtPos(next);
281858
+ if (nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next)) {
281859
+ this.expectPlugin("structs");
281860
+ return this.parseStructDeclaration(expr, true);
281861
+ }
281862
+ }
281397
281863
  if (this.match(22)) {
281398
281864
  return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
281399
281865
  }
281400
- if (this.match(71) || this.match(70) || this.isLet() || this.isUsing() || this.isAwaitUsing()) {
281866
+ if (this.match(71) || this.match(70) || this.isLet() && !this.isReservedWordOnNewLineAfterLet(this.nextTokenStart()) || this.isUsing() || this.isAwaitUsing()) {
281401
281867
  throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
281402
281868
  }
281403
281869
  const res = this.parseMaybeAssignAllowIn();
@@ -281409,6 +281875,14 @@ var StatementParser = class extends ExpressionParser {
281409
281875
  const node2 = this.parseClass(this.startNode(), true, false);
281410
281876
  return node2;
281411
281877
  }
281878
+ if (this.isContextual(104) && this.nextTokenIsIdentifierOnSameLine()) {
281879
+ this.expectPlugin("structs");
281880
+ const node2 = this.parseStructDeclaration(this.startNode(), false);
281881
+ return node2;
281882
+ }
281883
+ if (this.isContextual(97)) {
281884
+ return this.parseVarStatement(this.startNode(), "let");
281885
+ }
281412
281886
  return this.parseStatementListItem();
281413
281887
  }
281414
281888
  isExportDefaultSpecifier() {
@@ -281419,11 +281893,13 @@ var StatementParser = class extends ExpressionParser {
281419
281893
  if (type === 92 && !this.state.containsEsc || type === 97) {
281420
281894
  return false;
281421
281895
  }
281422
- if ((type === 127 || type === 126) && !this.state.containsEsc) {
281896
+ if ((type === 129 || type === 128 || type === 104) && !this.state.containsEsc) {
281423
281897
  const next2 = this.nextTokenStart();
281424
281898
  const nextChar = this.input.charCodeAt(next2);
281425
- if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next2) && !this.input.startsWith("from", next2)) {
281426
- this.expectOnePlugin(["flow", "typescript"]);
281899
+ if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next2) && !this.isUnparsedContextual(next2, "from")) {
281900
+ if (type !== 104) {
281901
+ this.expectOnePlugin(["flow", "typescript"]);
281902
+ }
281427
281903
  return false;
281428
281904
  }
281429
281905
  }
@@ -281468,7 +281944,7 @@ var StatementParser = class extends ExpressionParser {
281468
281944
  this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
281469
281945
  return true;
281470
281946
  }
281471
- return type === 70 || type === 71 || type === 64 || type === 76 || this.isLet() || this.isAsyncFunction();
281947
+ return type === 70 || type === 71 || type === 64 || type === 76 || this.isLet() || this.isAsyncFunction() || this.isContextual(104) && this.nextTokenIsIdentifierOnSameLine();
281472
281948
  }
281473
281949
  checkNamedExport(node, isFrom) {
281474
281950
  if (node.specifiers?.length) {
@@ -281495,7 +281971,7 @@ var StatementParser = class extends ExpressionParser {
281495
281971
  }
281496
281972
  } else if (node.declaration) {
281497
281973
  const decl = node.declaration;
281498
- if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
281974
+ if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration" || decl.type === "StructDeclaration") {
281499
281975
  const {
281500
281976
  id
281501
281977
  } = decl;
@@ -281552,8 +282028,8 @@ var StatementParser = class extends ExpressionParser {
281552
282028
  this.expect(8);
281553
282029
  if (this.eat(4)) break;
281554
282030
  }
281555
- const isMaybeTypeOnly = this.isContextual(127);
281556
- const isString = this.match(131);
282031
+ const isMaybeTypeOnly = this.isContextual(129);
282032
+ const isString = this.match(133);
281557
282033
  const node = this.startNode();
281558
282034
  node.local = this.parseModuleExportName();
281559
282035
  nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
@@ -281571,7 +282047,7 @@ var StatementParser = class extends ExpressionParser {
281571
282047
  return this.finishNode(node, "ExportSpecifier");
281572
282048
  }
281573
282049
  parseModuleExportName() {
281574
- if (this.match(131)) {
282050
+ if (this.match(133)) {
281575
282051
  const result = this.parseStringLiteral(this.state.value);
281576
282052
  const surrogate = loneSurrogate.exec(result.value);
281577
282053
  if (surrogate) {
@@ -281583,27 +282059,80 @@ var StatementParser = class extends ExpressionParser {
281583
282059
  }
281584
282060
  return this.parseIdentifier(true);
281585
282061
  }
282062
+ toNamespaceExportsFilter(specifiers) {
282063
+ const seen = /* @__PURE__ */ new Set();
282064
+ return specifiers.map((specifier) => {
282065
+ let name, alias2, kind;
282066
+ if (specifier.type === "ImportSpecifier") {
282067
+ ({
282068
+ imported: name,
282069
+ local: alias2,
282070
+ importKind: kind
282071
+ } = specifier);
282072
+ } else {
282073
+ ({
282074
+ local: name,
282075
+ exported: alias2,
282076
+ exportKind: kind
282077
+ } = specifier);
282078
+ }
282079
+ const nameString = name.type === "Identifier" ? name.name : this.isStringModuleExportName(name) ? name.value : null;
282080
+ if (nameString !== null) {
282081
+ if (seen.has(nameString)) {
282082
+ this.raise(Errors.FilteredNamespaceDuplicateName, name, {
282083
+ name: nameString
282084
+ });
282085
+ }
282086
+ seen.add(nameString);
282087
+ }
282088
+ let invalid = false;
282089
+ if (alias2.start !== name.start) {
282090
+ this.raise(Errors.FilteredNamespaceRename, alias2);
282091
+ invalid = true;
282092
+ }
282093
+ if (kind === "type" || kind === "typeof") {
282094
+ this.raise(Errors.FilteredNamespaceTypeModifier, specifier);
282095
+ invalid = true;
282096
+ }
282097
+ if (invalid) {
282098
+ return specifier;
282099
+ }
282100
+ this.replaceNodeInPendingComments(specifier, name);
282101
+ return name;
282102
+ });
282103
+ }
281586
282104
  checkImportPhase(node) {
282105
+ if (node.phase == null) {
282106
+ return;
282107
+ }
281587
282108
  const {
281588
282109
  specifiers
281589
282110
  } = node;
281590
282111
  const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
281591
282112
  if (node.phase === "source") {
281592
282113
  if (singleBindingType !== "ImportDefaultSpecifier") {
281593
- this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0]);
282114
+ this.raise(Errors.SourcePhaseImportRequiresDefault, node);
281594
282115
  }
281595
282116
  } else if (node.phase === "defer") {
281596
282117
  if (singleBindingType !== "ImportNamespaceSpecifier") {
281597
- this.raise(Errors.DeferImportRequiresNamespace, specifiers[0]);
282118
+ this.raise(Errors.DeferImportRequiresNamespace, node);
281598
282119
  }
281599
282120
  }
281600
282121
  }
281601
282122
  isPotentialImportPhase(isExport) {
281602
- if (isExport) return false;
282123
+ if (isExport) {
282124
+ if (!this.isContextual(94)) return false;
282125
+ const ch = this.lookaheadCharCode();
282126
+ return ch === 123 || ch === 42;
282127
+ }
281603
282128
  return this.isContextual(102) || this.isContextual(94);
281604
282129
  }
281605
282130
  applyImportPhase(node, isExport, phase, loc) {
281606
282131
  if (isExport) {
282132
+ if (phase === "defer") {
282133
+ this.expectPlugin("deferredReexports", loc);
282134
+ node.phase = "defer";
282135
+ }
281607
282136
  return;
281608
282137
  }
281609
282138
  if (phase === "source") {
@@ -281642,7 +282171,7 @@ var StatementParser = class extends ExpressionParser {
281642
282171
  return tokenIsIdentifier(type) ? type !== 95 || this.lookaheadCharCode() === 102 : type !== 8;
281643
282172
  }
281644
282173
  parseImport(node) {
281645
- if (this.match(131)) {
282174
+ if (this.match(133)) {
281646
282175
  return this.parseImportSourceAndAttributes(node);
281647
282176
  }
281648
282177
  return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false));
@@ -281652,7 +282181,7 @@ var StatementParser = class extends ExpressionParser {
281652
282181
  const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier);
281653
282182
  const parseNext = !hasDefault || this.eat(8);
281654
282183
  const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
281655
- if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
282184
+ if (parseNext && !hasStar) this.parseNamedOrFilteredImportSpecifiers(node);
281656
282185
  this.expectContextual(95);
281657
282186
  return this.parseImportSourceAndAttributes(node);
281658
282187
  }
@@ -281666,17 +282195,17 @@ var StatementParser = class extends ExpressionParser {
281666
282195
  return this.finishNode(node, "ImportDeclaration");
281667
282196
  }
281668
282197
  parseImportSource() {
281669
- if (!this.match(131)) this.unexpected();
282198
+ if (!this.match(133)) this.unexpected();
281670
282199
  return this.parseExprAtom();
281671
282200
  }
281672
282201
  parseImportSpecifierLocal(node, specifier, type) {
281673
282202
  specifier.local = this.parseIdentifier();
281674
282203
  node.specifiers.push(this.finishImportSpecifier(specifier, type));
281675
282204
  }
281676
- finishImportSpecifier(specifier, type, bindingType = 8201) {
282205
+ finishImportSpecifier(specifier, type) {
281677
282206
  this.checkLVal(specifier.local, {
281678
282207
  type
281679
- }, bindingType);
282208
+ }, 8201);
281680
282209
  return this.finishNode(specifier, type);
281681
282210
  }
281682
282211
  parseImportAttributes() {
@@ -281695,13 +282224,13 @@ var StatementParser = class extends ExpressionParser {
281695
282224
  });
281696
282225
  }
281697
282226
  attrNames.add(keyName);
281698
- if (this.match(131)) {
282227
+ if (this.match(133)) {
281699
282228
  node.key = this.parseStringLiteral(keyName);
281700
282229
  } else {
281701
282230
  node.key = this.parseIdentifier(true);
281702
282231
  }
281703
282232
  this.expect(10);
281704
- if (!this.match(131)) {
282233
+ if (!this.match(133)) {
281705
282234
  throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
281706
282235
  }
281707
282236
  node.value = this.parseStringLiteral(this.state.value);
@@ -281745,6 +282274,24 @@ var StatementParser = class extends ExpressionParser {
281745
282274
  }
281746
282275
  return false;
281747
282276
  }
282277
+ parseNamedOrFilteredImportSpecifiers(node) {
282278
+ const startLoc = this.state.startLoc;
282279
+ this.setLoc(startLoc);
282280
+ const specifiersStart = node.specifiers.length;
282281
+ this.parseNamedImportSpecifiers(node);
282282
+ if (this.isContextual(90)) {
282283
+ this.expectPlugin("namespaceImportFilter");
282284
+ const specifier = this.startNodeAt(startLoc);
282285
+ specifier.exportsFilter = this.toNamespaceExportsFilter(node.specifiers.splice(specifiersStart));
282286
+ this.next();
282287
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier");
282288
+ return;
282289
+ }
282290
+ const isInTypeOnlyImport = node.importKind === "type" || node.importKind === "typeof";
282291
+ for (let i = specifiersStart; i < node.specifiers.length; i++) {
282292
+ this.checkImportSpecifier(node.specifiers[i], isInTypeOnlyImport);
282293
+ }
282294
+ }
281748
282295
  parseNamedImportSpecifiers(node) {
281749
282296
  let first = true;
281750
282297
  this.expect(2);
@@ -281759,31 +282306,40 @@ var StatementParser = class extends ExpressionParser {
281759
282306
  if (this.eat(4)) break;
281760
282307
  }
281761
282308
  const specifier = this.startNode();
281762
- const importedIsString = this.match(131);
281763
- const isMaybeTypeOnly = this.isContextual(127);
282309
+ const importedIsString = this.match(133);
282310
+ const isMaybeTypeOnly = this.isContextual(129);
281764
282311
  specifier.imported = this.parseModuleExportName();
281765
- const importSpecifier2 = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, void 0);
282312
+ const importSpecifier2 = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly);
281766
282313
  node.specifiers.push(importSpecifier2);
281767
282314
  }
281768
282315
  }
281769
- parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
282316
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
281770
282317
  if (this.eatContextual(90)) {
281771
282318
  specifier.local = this.parseIdentifier();
281772
282319
  } else {
281773
- const {
281774
- imported
281775
- } = specifier;
281776
- if (importedIsString) {
281777
- throw this.raise(Errors.ImportBindingIsString, specifier, {
281778
- importName: imported.value
281779
- });
281780
- }
281781
- this.checkReservedWord(imported.name, specifier.start, true, true);
281782
- if (!specifier.local) {
281783
- specifier.local = this.cloneIdentifier(imported);
281784
- }
282320
+ specifier.local ??= this.cloneIdentifier(specifier.imported);
282321
+ }
282322
+ return this.finishNode(specifier, "ImportSpecifier");
282323
+ }
282324
+ checkImportSpecifier(specifier, isInTypeOnlyImport, bindingType = 8201, checkReservedWord = true) {
282325
+ const {
282326
+ imported,
282327
+ local
282328
+ } = specifier;
282329
+ if (this.isStringModuleExportName(local)) {
282330
+ throw this.raise(Errors.ImportBindingIsString, specifier, {
282331
+ importName: imported.value
282332
+ });
281785
282333
  }
281786
- return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
282334
+ if (checkReservedWord && local.start === imported.start) {
282335
+ this.checkReservedWord(local.name, local.start, true, true);
282336
+ }
282337
+ this.checkLVal(local, {
282338
+ type: "ImportSpecifier"
282339
+ }, bindingType);
282340
+ }
282341
+ isStringModuleExportName(node) {
282342
+ return node.type === "StringLiteral" || node.type === "Literal";
281787
282343
  }
281788
282344
  isThisParam(param) {
281789
282345
  return param.type === "Identifier" && param.name === "this";
@@ -281961,6 +282517,17 @@ function tsIsEntityName(node) {
281961
282517
  return false;
281962
282518
  }
281963
282519
  }
282520
+ function tsIsTypeCast(node) {
282521
+ switch (node.type) {
282522
+ case "TSAsExpression":
282523
+ case "TSSatisfiesExpression":
282524
+ case "TSNonNullExpression":
282525
+ case "TSTypeAssertion":
282526
+ return true;
282527
+ default:
282528
+ return false;
282529
+ }
282530
+ }
281964
282531
  var ClassMemberModifiers = buildModifiersMap(["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"], ["in", "out"]);
281965
282532
  var IndexSignatureModifiers = buildModifiersMap(["readonly"], ["declare", "abstract", "private", "protected", "public", "static", "override"]);
281966
282533
  var BindingElementModifiers = buildModifiersMap(["public", "private", "protected", "override", "readonly"]);
@@ -281973,7 +282540,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
281973
282540
  return tokenIsIdentifier(this.state.type);
281974
282541
  }
281975
282542
  tsTokenCanFollowModifier() {
281976
- return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(135) || this.isLiteralPropertyName();
282543
+ return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(137) || this.isLiteralPropertyName();
281977
282544
  }
281978
282545
  tsNextTokenOnSameLineAndCanFollowModifier() {
281979
282546
  this.next();
@@ -282150,7 +282717,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282150
282717
  const node = this.startNode();
282151
282718
  this.expect(79);
282152
282719
  this.expect(6);
282153
- if (!this.match(131)) {
282720
+ if (!this.match(133)) {
282154
282721
  this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
282155
282722
  node.source = this.tsParseNonConditionalType();
282156
282723
  } else {
@@ -282195,7 +282762,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282195
282762
  this.expect(2);
282196
282763
  while (!this.match(4)) {
282197
282764
  const type = this.state.type;
282198
- if (tokenIsIdentifier(type) || type === 131) {
282765
+ if (tokenIsIdentifier(type) || type === 133) {
282199
282766
  properties.push(super.parsePropertyDefinition(null));
282200
282767
  } else {
282201
282768
  this.unexpected();
@@ -282279,7 +282846,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282279
282846
  }
282280
282847
  tsParseTypeParameters(parseModifiers) {
282281
282848
  const node = this.startNode();
282282
- if (this.match(43) || this.match(139)) {
282849
+ if (this.match(43) || this.match(141)) {
282283
282850
  this.next();
282284
282851
  } else {
282285
282852
  this.unexpected();
@@ -282450,9 +283017,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282450
283017
  tsIsStartOfMappedType() {
282451
283018
  this.next();
282452
283019
  if (this.eat(49)) {
282453
- return this.isContextual(119);
283020
+ return this.isContextual(121);
282454
283021
  }
282455
- if (this.isContextual(119)) {
283022
+ if (this.isContextual(121)) {
282456
283023
  this.next();
282457
283024
  }
282458
283025
  if (!this.match(0)) {
@@ -282471,8 +283038,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282471
283038
  if (this.match(49)) {
282472
283039
  node.readonly = this.state.value;
282473
283040
  this.next();
282474
- this.expectContextual(119);
282475
- } else if (this.eatContextual(119)) {
283041
+ this.expectContextual(121);
283042
+ } else if (this.eatContextual(121)) {
282476
283043
  node.readonly = true;
282477
283044
  }
282478
283045
  this.expect(0);
@@ -282596,9 +283163,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282596
283163
  tsParseLiteralTypeNode() {
282597
283164
  const node = this.startNode();
282598
283165
  switch (this.state.type) {
282599
- case 132:
283166
+ case 134:
283167
+ case 135:
282600
283168
  case 133:
282601
- case 131:
282602
283169
  case 81:
282603
283170
  case 82:
282604
283171
  node.literal = super.parseExprAtom();
@@ -282638,7 +283205,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282638
283205
  }
282639
283206
  tsParseThisTypeOrThisTypePredicate() {
282640
283207
  const thisKeyword = this.tsParseThisTypeNode();
282641
- if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
283208
+ if (this.isContextual(115) && !this.hasPrecedingLineBreak()) {
282642
283209
  return this.tsParseThisTypePredicate(thisKeyword);
282643
283210
  } else {
282644
283211
  return thisKeyword;
@@ -282646,9 +283213,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282646
283213
  }
282647
283214
  tsParseNonArrayType() {
282648
283215
  switch (this.state.type) {
282649
- case 131:
282650
- case 132:
282651
283216
  case 133:
283217
+ case 134:
283218
+ case 135:
282652
283219
  case 81:
282653
283220
  case 82:
282654
283221
  return this.tsParseLiteralTypeNode();
@@ -282656,7 +283223,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282656
283223
  if (this.state.value === "-") {
282657
283224
  const node = this.startNode();
282658
283225
  const nextToken = this.lookahead();
282659
- if (nextToken.type !== 132 && nextToken.type !== 133) {
283226
+ if (nextToken.type !== 134 && nextToken.type !== 135) {
282660
283227
  this.unexpected();
282661
283228
  }
282662
283229
  node.literal = this.parseMaybeUnary();
@@ -282747,7 +283314,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282747
283314
  }
282748
283315
  tsParseInferType() {
282749
283316
  const node = this.startNode();
282750
- this.expectContextual(112);
283317
+ this.expectContextual(114);
282751
283318
  const typeParameter2 = this.startNode();
282752
283319
  typeParameter2.name = this.tsParseTypeParameterName();
282753
283320
  typeParameter2.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
@@ -282764,7 +283331,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282764
283331
  }
282765
283332
  tsParseTypeOperatorOrHigher() {
282766
283333
  const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
282767
- return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(112) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
283334
+ return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(114) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
282768
283335
  }
282769
283336
  tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
282770
283337
  const node = this.startNode();
@@ -282796,28 +283363,23 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282796
283363
  this.next();
282797
283364
  return true;
282798
283365
  }
282799
- if (this.match(2)) {
282800
- const {
282801
- errors
282802
- } = this.state;
282803
- const previousErrorCount = errors.length;
282804
- try {
282805
- this.parseObjectLike(4, true);
282806
- return errors.length === previousErrorCount;
282807
- } catch {
282808
- return false;
282809
- }
282810
- }
282811
- if (this.match(0)) {
282812
- this.next();
283366
+ const isObjectPattern2 = this.match(2);
283367
+ if (isObjectPattern2 || this.match(0)) {
283368
+ if (!isObjectPattern2) this.next();
282813
283369
  const {
282814
283370
  errors
282815
283371
  } = this.state;
282816
283372
  const previousErrorCount = errors.length;
283373
+ const scopeStacksSnapshot = this.snapshotScopeStacks();
282817
283374
  try {
282818
- super.parseBindingList(1, 93, 1);
283375
+ if (isObjectPattern2) {
283376
+ this.parseObjectLike(4, true);
283377
+ } else {
283378
+ super.parseBindingList(1, 93, 1);
283379
+ }
282819
283380
  return errors.length === previousErrorCount;
282820
283381
  } catch {
283382
+ this.restoreScopeStacks(scopeStacksSnapshot);
282821
283383
  return false;
282822
283384
  }
282823
283385
  }
@@ -282895,13 +283457,13 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282895
283457
  }
282896
283458
  tsParseTypePredicatePrefix() {
282897
283459
  const id = this.parseIdentifier();
282898
- if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
283460
+ if (this.isContextual(115) && !this.hasPrecedingLineBreak()) {
282899
283461
  this.next();
282900
283462
  return id;
282901
283463
  }
282902
283464
  }
282903
283465
  tsParseTypePredicateAsserts() {
282904
- if (this.state.type !== 106) {
283466
+ if (this.state.type !== 108) {
282905
283467
  return false;
282906
283468
  }
282907
283469
  const containsEsc = this.state.containsEsc;
@@ -282939,7 +283501,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282939
283501
  return this.finishNode(node, "TSConditionalType");
282940
283502
  }
282941
283503
  isAbstractConstructorSignature() {
282942
- return this.isContextual(121) && this.isLookaheadContextual("new");
283504
+ return this.isContextual(123) && this.isLookaheadContextual("new");
282943
283505
  }
282944
283506
  tsParseNonConditionalType() {
282945
283507
  if (this.tsIsStartOfFunctionType()) {
@@ -282996,7 +283558,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
282996
283558
  }
282997
283559
  tsParseInterfaceDeclaration(node, properties = {}) {
282998
283560
  if (this.hasFollowingLineBreak()) return null;
282999
- this.expectContextual(126);
283561
+ this.expectContextual(128);
283000
283562
  if (properties.declare) node.declare = true;
283001
283563
  if (tokenIsIdentifier(this.state.type)) {
283002
283564
  node.id = this.parseIdentifier();
@@ -283020,7 +283582,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283020
283582
  node.typeAnnotation = this.tsInType(() => {
283021
283583
  node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
283022
283584
  this.expect(25);
283023
- if (this.isContextual(111) && this.lookaheadCharCode() !== 46) {
283585
+ if (this.isContextual(113) && this.lookaheadCharCode() !== 46) {
283024
283586
  const node2 = this.startNode();
283025
283587
  this.next();
283026
283588
  return this.finishNode(node2, "TSIntrinsicKeyword");
@@ -283089,7 +283651,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283089
283651
  }
283090
283652
  tsParseEnumMember() {
283091
283653
  const node = this.startNode();
283092
- node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
283654
+ node.id = this.match(133) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
283093
283655
  if (this.eat(25)) {
283094
283656
  node.initializer = super.parseMaybeAssignAllowIn();
283095
283657
  }
@@ -283098,7 +283660,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283098
283660
  tsParseEnumDeclaration(node, properties = {}) {
283099
283661
  if (properties.const) node.const = true;
283100
283662
  if (properties.declare) node.declare = true;
283101
- this.expectContextual(123);
283663
+ this.expectContextual(125);
283102
283664
  node.id = this.parseIdentifier();
283103
283665
  this.checkIdentifier(node.id, node.const ? 8971 : 8459);
283104
283666
  node.body = this.tsParseEnumBody();
@@ -283136,7 +283698,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283136
283698
  return this.finishNode(node, "TSModuleDeclaration");
283137
283699
  }
283138
283700
  tsParseAmbientExternalModuleDeclaration(node) {
283139
- const isGlobal = this.isContextual(109);
283701
+ const isGlobal = this.isContextual(111);
283140
283702
  if (isGlobal) {
283141
283703
  node.kind = "global";
283142
283704
  node.id = this.parseIdentifier();
@@ -283146,7 +283708,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283146
283708
  type,
283147
283709
  value
283148
283710
  } = this.state;
283149
- if (type === 131) {
283711
+ if (type === 133) {
283150
283712
  node.id = super.parseStringLiteral(value);
283151
283713
  } else if (tokenIsIdentifier(type)) {
283152
283714
  this.raise(TSErrors.InlineModuleDeclarationMustUseString, this.state.startLoc);
@@ -283186,16 +283748,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283186
283748
  return this.finishNode(node, "TSImportEqualsDeclaration");
283187
283749
  }
283188
283750
  tsIsExternalModuleReference() {
283189
- return this.isContextual(116) && this.lookaheadCharCode() === 40;
283751
+ return this.isContextual(118) && this.lookaheadCharCode() === 40;
283190
283752
  }
283191
283753
  tsParseModuleReference() {
283192
283754
  return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0);
283193
283755
  }
283194
283756
  tsParseExternalModuleReference() {
283195
283757
  const node = this.startNode();
283196
- this.expectContextual(116);
283758
+ this.expectContextual(118);
283197
283759
  this.expect(6);
283198
- if (!this.match(131)) {
283760
+ if (!this.match(133)) {
283199
283761
  this.unexpected();
283200
283762
  }
283201
283763
  node.expression = super.parseExprAtom();
@@ -283236,11 +283798,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283236
283798
  case 76:
283237
283799
  node.declare = true;
283238
283800
  return this.parseClass(node, true, false);
283239
- case 123:
283801
+ case 125:
283240
283802
  return this.tsParseEnumDeclaration(node, {
283241
283803
  declare: true
283242
283804
  });
283243
- case 109:
283805
+ case 111:
283244
283806
  return this.tsParseAmbientExternalModuleDeclaration(node);
283245
283807
  case 97:
283246
283808
  if (this.state.containsEsc) {
@@ -283257,7 +283819,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283257
283819
  const: true,
283258
283820
  declare: true
283259
283821
  });
283260
- case 104:
283822
+ case 106:
283261
283823
  if (this.isUsing()) {
283262
283824
  this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare");
283263
283825
  node.declare = true;
@@ -283272,7 +283834,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283272
283834
  return this.parseVarStatement(node, "await using", true);
283273
283835
  }
283274
283836
  break;
283275
- case 126: {
283837
+ case 128: {
283276
283838
  const result = this.tsParseInterfaceDeclaration(node, {
283277
283839
  declare: true
283278
283840
  });
@@ -283290,23 +283852,23 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283290
283852
  }
283291
283853
  tsParseDeclaration(node, type, next, decorators) {
283292
283854
  switch (type) {
283293
- case 121:
283855
+ case 123:
283294
283856
  if (this.tsCheckLineTerminator(next) && (this.match(76) || tokenIsIdentifier(this.state.type))) {
283295
283857
  return this.tsParseAbstractDeclaration(node, decorators);
283296
283858
  }
283297
283859
  break;
283298
- case 124:
283860
+ case 126:
283299
283861
  if (this.tsCheckLineTerminator(next)) {
283300
283862
  return this.tsParseAmbientExternalModuleDeclaration(node);
283301
283863
  }
283302
283864
  break;
283303
- case 125:
283865
+ case 127:
283304
283866
  if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
283305
283867
  node.kind = "namespace";
283306
283868
  return this.tsParseNamespaceDeclaration(node);
283307
283869
  }
283308
283870
  break;
283309
- case 127:
283871
+ case 129:
283310
283872
  if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
283311
283873
  return this.tsParseTypeAliasDeclaration(node);
283312
283874
  }
@@ -283379,8 +283941,6 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283379
283941
  const pp = startLoc ? this.startNodeAt(startLoc) : this.startNodeAtNode(decorators[0]);
283380
283942
  if (decorators.length) {
283381
283943
  pp.decorators = decorators;
283382
- } else {
283383
- this.setLoc(startLoc);
283384
283944
  }
283385
283945
  if (accessibility) pp.accessibility = accessibility;
283386
283946
  if (readonly) pp.readonly = readonly;
@@ -283517,7 +284077,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283517
284077
  return this.finishCallExpression(node2, state.optionalChainMember);
283518
284078
  }
283519
284079
  const tokenType = this.state.type;
283520
- if (tokenType === 44 || tokenType === 48 || tokenType !== 6 && tokenType !== 90 && tokenType !== 117 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
284080
+ if (tokenType === 44 || tokenType === 48 || tokenType !== 6 && tokenType !== 90 && tokenType !== 119 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
283521
284081
  return;
283522
284082
  }
283523
284083
  const node = this.startNodeAt(startLoc);
@@ -283554,7 +284114,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283554
284114
  }
283555
284115
  parseExprOp(left, leftStartLoc, minPrec) {
283556
284116
  let isSatisfies;
283557
- if (tokenOperatorPrecedence(54) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(90) || (isSatisfies = this.isContextual(117)))) {
284117
+ if (tokenOperatorPrecedence(54) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(90) || (isSatisfies = this.isContextual(119)))) {
283558
284118
  const node = this.startNodeAt(leftStartLoc);
283559
284119
  node.expression = left;
283560
284120
  node.typeAnnotation = this.tsInType(() => {
@@ -283584,7 +284144,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283584
284144
  }
283585
284145
  isPotentialImportPhase(isExport) {
283586
284146
  if (super.isPotentialImportPhase(isExport)) return true;
283587
- if (this.isContextual(127)) {
284147
+ if (this.isContextual(129)) {
283588
284148
  const ch = this.lookaheadCharCode();
283589
284149
  return isExport ? ch === 123 || ch === 42 : ch !== 61;
283590
284150
  }
@@ -283599,7 +284159,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283599
284159
  }
283600
284160
  }
283601
284161
  parseImport(node) {
283602
- if (this.match(131)) {
284162
+ if (this.match(133)) {
283603
284163
  node.importKind = "value";
283604
284164
  if (this.scope.inTSNamespace) {
283605
284165
  this.raise(TSErrors.ImportInTSNamespace, node);
@@ -283614,7 +284174,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283614
284174
  this.raise(TSErrors.ImportInTSNamespace, node);
283615
284175
  }
283616
284176
  return result;
283617
- } else if (this.isContextual(127)) {
284177
+ } else if (this.isContextual(129)) {
283618
284178
  const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false);
283619
284179
  if (this.lookaheadCharCode() === 61) {
283620
284180
  if (this.scope.inTSNamespace) {
@@ -283639,7 +284199,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283639
284199
  const nodeImportEquals = this.startNode();
283640
284200
  this.next();
283641
284201
  let maybeDefaultIdentifier = null;
283642
- if (this.isContextual(127) && this.isPotentialImportPhase(false)) {
284202
+ if (this.isContextual(129) && this.isPotentialImportPhase(false)) {
283643
284203
  maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
283644
284204
  } else {
283645
284205
  nodeImportEquals.importKind = "value";
@@ -283662,7 +284222,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283662
284222
  return this.finishNode(assign, "TSExportAssignment");
283663
284223
  } else if (this.eatContextual(90)) {
283664
284224
  const decl = node;
283665
- this.expectContextual(125);
284225
+ this.expectContextual(127);
283666
284226
  decl.id = this.parseIdentifier();
283667
284227
  this.checkIdentifier(decl.id, 8201);
283668
284228
  this.semicolon();
@@ -283679,7 +284239,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283679
284239
  }
283680
284240
  }
283681
284241
  isAbstractClass() {
283682
- return this.isContextual(121) && this.isLookaheadContextual("class");
284242
+ return this.isContextual(123) && this.isLookaheadContextual("class");
283683
284243
  }
283684
284244
  parseExportDefaultExpression() {
283685
284245
  if (this.isAbstractClass()) {
@@ -283688,7 +284248,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283688
284248
  cls.abstract = true;
283689
284249
  return this.parseClass(cls, true, true);
283690
284250
  }
283691
- if (this.match(126)) {
284251
+ if (this.match(128)) {
283692
284252
  const result = this.tsParseInterfaceDeclaration(this.startNode());
283693
284253
  if (result) return result;
283694
284254
  }
@@ -283740,29 +284300,29 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283740
284300
  }
283741
284301
  break;
283742
284302
  }
283743
- case 121:
283744
- case 122: {
284303
+ case 123:
284304
+ case 124: {
283745
284305
  if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
283746
284306
  const token = this.state.type;
283747
284307
  const node = this.startNode();
283748
284308
  this.next();
283749
- const declaration = token === 122 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
284309
+ const declaration = token === 124 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
283750
284310
  if (declaration) {
283751
- if (token === 122) {
284311
+ if (token === 124) {
283752
284312
  declaration.declare = true;
283753
284313
  }
283754
284314
  return declaration;
283755
284315
  } else {
283756
- node.expression = this.createIdentifier(this.startNodeAtNode(node), token === 122 ? "declare" : "abstract");
284316
+ node.expression = this.createIdentifier(this.startNodeAtNode(node), token === 124 ? "declare" : "abstract");
283757
284317
  this.semicolon(false);
283758
284318
  return this.finishNode(node, "ExpressionStatement");
283759
284319
  }
283760
284320
  }
283761
284321
  break;
283762
284322
  }
283763
- case 123:
284323
+ case 125:
283764
284324
  return this.tsParseEnumDeclaration(this.startNode());
283765
- case 109: {
284325
+ case 111: {
283766
284326
  const nextCh = this.lookaheadCharCode();
283767
284327
  if (nextCh === 123) {
283768
284328
  const node = this.startNode();
@@ -283770,7 +284330,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283770
284330
  }
283771
284331
  break;
283772
284332
  }
283773
- case 126: {
284333
+ case 128: {
283774
284334
  const result = this.tsParseInterfaceDeclaration(this.startNode());
283775
284335
  if (result) {
283776
284336
  if (!allowDeclaration) {
@@ -283780,28 +284340,28 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283780
284340
  }
283781
284341
  break;
283782
284342
  }
283783
- case 124: {
284343
+ case 126: {
283784
284344
  if (this.nextTokenIsStringLiteralOnSameLine()) {
283785
284345
  const node = this.startNode();
283786
284346
  this.next();
283787
- return this.tsParseDeclaration(node, 124, false, decorators);
284347
+ return this.tsParseDeclaration(node, 126, false, decorators);
283788
284348
  } else if (this.nextTokenIsIdentifierOnSameLine()) {
283789
284349
  this.raise(TSErrors.InlineModuleDeclarationMustUseString, this.state.startLoc);
283790
284350
  const node = this.startNode();
283791
284351
  this.next();
283792
- return this.tsParseDeclaration(node, 125, false, decorators);
284352
+ return this.tsParseDeclaration(node, 127, false, decorators);
283793
284353
  }
283794
284354
  break;
283795
284355
  }
283796
- case 125: {
284356
+ case 127: {
283797
284357
  if (this.nextTokenIsIdentifierOnSameLine()) {
283798
284358
  const node = this.startNode();
283799
284359
  this.next();
283800
- return this.tsParseDeclaration(node, 125, false, decorators);
284360
+ return this.tsParseDeclaration(node, 127, false, decorators);
283801
284361
  }
283802
284362
  break;
283803
284363
  }
283804
- case 127: {
284364
+ case 129: {
283805
284365
  if (this.nextTokenIsIdentifierOnSameLine()) {
283806
284366
  const node = this.startNode();
283807
284367
  if (!allowDeclaration) {
@@ -283940,12 +284500,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283940
284500
  return node;
283941
284501
  }
283942
284502
  parseExportDeclaration(node) {
283943
- if (!this.state.isAmbientContext && this.isContextual(122)) {
284503
+ if (!this.state.isAmbientContext && this.isContextual(124)) {
283944
284504
  return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
283945
284505
  }
283946
284506
  const startLoc = this.state.startLoc;
283947
- const isDeclare = this.eatContextual(122);
283948
- if (isDeclare && (this.isContextual(122) || !this.shouldParseExportDeclaration())) {
284507
+ const isDeclare = this.eatContextual(124);
284508
+ if (isDeclare && (this.isContextual(124) || !this.shouldParseExportDeclaration())) {
283949
284509
  throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
283950
284510
  }
283951
284511
  const isIdentifier5 = tokenIsIdentifier(this.state.type);
@@ -283961,7 +284521,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
283961
284521
  return declaration;
283962
284522
  }
283963
284523
  parseClassId(node, isStatement5, optionalId, bindingType) {
283964
- if ((!isStatement5 || optionalId) && this.isContextual(110)) {
284524
+ if ((!isStatement5 || optionalId) && this.isContextual(112)) {
283965
284525
  node.id = null;
283966
284526
  return;
283967
284527
  }
@@ -284065,7 +284625,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284065
284625
  node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
284066
284626
  }
284067
284627
  }
284068
- if (this.eatContextual(110)) {
284628
+ if (this.eatContextual(112)) {
284069
284629
  node.implements = this.tsParseHeritageClause("implements");
284070
284630
  }
284071
284631
  }
@@ -284100,7 +284660,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284100
284660
  let state;
284101
284661
  let jsx2;
284102
284662
  let typeCast;
284103
- if (this.hasPlugin("jsx") && (this.match(139) || this.match(43))) {
284663
+ if (this.hasPlugin("jsx") && (this.match(141) || this.match(43))) {
284104
284664
  state = this.state.clone();
284105
284665
  jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, isParenItem), state);
284106
284666
  if (!jsx2.error) return jsx2.node;
@@ -284207,21 +284767,19 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284207
284767
  }
284208
284768
  }
284209
284769
  toAssignable(node, isLHS = false) {
284770
+ if (tsIsTypeCast(node)) {
284771
+ if (isLHS) {
284772
+ this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
284773
+ } else {
284774
+ this.raiseOnce(TSErrors.UnexpectedTypeCastInParameter, node);
284775
+ }
284776
+ this.toAssignable(node.expression, isLHS);
284777
+ return;
284778
+ }
284210
284779
  switch (node.type) {
284211
284780
  case "ParenthesizedExpression":
284212
284781
  this.toAssignableParenthesizedExpression(node, isLHS);
284213
284782
  break;
284214
- case "TSAsExpression":
284215
- case "TSSatisfiesExpression":
284216
- case "TSNonNullExpression":
284217
- case "TSTypeAssertion":
284218
- if (isLHS) {
284219
- this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
284220
- } else {
284221
- this.raise(TSErrors.UnexpectedTypeCastInParameter, node);
284222
- }
284223
- this.toAssignable(node.expression, isLHS);
284224
- break;
284225
284783
  case "AssignmentExpression":
284226
284784
  if (!isLHS && node.left.type === "TSTypeCastExpression") {
284227
284785
  node.left = this.typeCastToParameter(node.left);
@@ -284231,28 +284789,17 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284231
284789
  }
284232
284790
  }
284233
284791
  toAssignableParenthesizedExpression(node, isLHS) {
284234
- switch (node.expression.type) {
284235
- case "TSAsExpression":
284236
- case "TSSatisfiesExpression":
284237
- case "TSNonNullExpression":
284238
- case "TSTypeAssertion":
284239
- case "ParenthesizedExpression":
284240
- this.toAssignable(node.expression, isLHS);
284241
- break;
284242
- default:
284243
- super.toAssignable(node, isLHS);
284792
+ if (tsIsTypeCast(node.expression) || node.expression.type === "ParenthesizedExpression") {
284793
+ this.toAssignable(node.expression, isLHS);
284794
+ } else {
284795
+ super.toAssignable(node, isLHS);
284244
284796
  }
284245
284797
  }
284246
284798
  checkToRestConversion(node, allowPattern) {
284247
- switch (node.type) {
284248
- case "TSAsExpression":
284249
- case "TSSatisfiesExpression":
284250
- case "TSTypeAssertion":
284251
- case "TSNonNullExpression":
284252
- this.checkToRestConversion(node.expression, false);
284253
- break;
284254
- default:
284255
- super.checkToRestConversion(node, allowPattern);
284799
+ if (tsIsTypeCast(node)) {
284800
+ this.checkToRestConversion(node.expression, false);
284801
+ } else {
284802
+ super.checkToRestConversion(node, allowPattern);
284256
284803
  }
284257
284804
  }
284258
284805
  isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
@@ -284432,7 +284979,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284432
284979
  if (this.match(76)) {
284433
284980
  node.abstract = true;
284434
284981
  return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
284435
- } else if (this.isContextual(126)) {
284982
+ } else if (this.isContextual(128)) {
284436
284983
  if (!this.hasFollowingLineBreak()) {
284437
284984
  node.abstract = true;
284438
284985
  this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
@@ -284485,15 +285032,22 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284485
285032
  node.exportKind = "value";
284486
285033
  return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
284487
285034
  }
284488
- parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
285035
+ parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
284489
285036
  if (!importedIsString && isMaybeTypeOnly) {
284490
- this.parseTypeOnlyImportSpecifier(specifier, isInTypeOnlyImport);
285037
+ this.parseTypeOnlyImportSpecifier(specifier);
284491
285038
  return this.finishNode(specifier, "ImportSpecifier");
284492
285039
  }
284493
285040
  specifier.importKind = "value";
284494
- return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096);
285041
+ return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly);
284495
285042
  }
284496
- parseTypeOnlyImportSpecifier(node, isInTypeOnly) {
285043
+ checkImportSpecifier(specifier, isInTypeOnlyImport) {
285044
+ const hasTypeSpecifier = specifier.importKind === "type";
285045
+ if (hasTypeSpecifier && isInTypeOnlyImport) {
285046
+ this.raise(TSErrors.TypeModifierIsUsedInTypeImports, specifier);
285047
+ }
285048
+ super.checkImportSpecifier(specifier, isInTypeOnlyImport, hasTypeSpecifier || isInTypeOnlyImport ? 4098 : 4096);
285049
+ }
285050
+ parseTypeOnlyImportSpecifier(node) {
284497
285051
  let leftOfAs = node.imported;
284498
285052
  let hasTypeSpecifier = false;
284499
285053
  if (this.isContextual(90)) {
@@ -284516,16 +285070,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
284516
285070
  } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
284517
285071
  hasTypeSpecifier = true;
284518
285072
  leftOfAs = this.parseIdentifier(true);
284519
- if (!this.isContextual(90)) {
284520
- this.checkReservedWord(leftOfAs.name, leftOfAs.start, true, true);
284521
- }
284522
- }
284523
- if (hasTypeSpecifier && isInTypeOnly) {
284524
- this.raise(TSErrors.TypeModifierIsUsedInTypeImports, node.imported);
284525
285073
  }
284526
285074
  node.imported = leftOfAs;
284527
285075
  node.importKind = hasTypeSpecifier ? "type" : "value";
284528
- this.checkIdentifier(node.local ??= this.eatContextual(90) ? this.parseIdentifier() : this.cloneIdentifier(node.imported), hasTypeSpecifier ? 4098 : 4096);
285076
+ node.local ??= this.eatContextual(90) ? this.parseIdentifier() : this.cloneIdentifier(node.imported);
284529
285077
  }
284530
285078
  parseTypeOnlyExportSpecifier(node, isInTypeOnly) {
284531
285079
  const local = node.local;
@@ -284779,13 +285327,13 @@ var PlaceholderErrorTemplates = {
284779
285327
  var PlaceholderErrors = ParseErrorEnum`placeholders`(PlaceholderErrorTemplates);
284780
285328
  var placeholders = (superClass) => class PlaceholdersParserMixin extends superClass {
284781
285329
  parsePlaceholder(expectedNode) {
284782
- if (this.match(130)) {
285330
+ if (this.match(132)) {
284783
285331
  const node = this.startNode();
284784
285332
  this.next();
284785
285333
  this.assertNoSpace();
284786
285334
  node.name = super.parseIdentifier(true);
284787
285335
  this.assertNoSpace();
284788
- this.expect(130);
285336
+ this.expect(132);
284789
285337
  return this.finishPlaceholder(node, expectedNode);
284790
285338
  }
284791
285339
  }
@@ -284799,7 +285347,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
284799
285347
  }
284800
285348
  getTokenFromCode(code2) {
284801
285349
  if (code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
284802
- this.finishOp(130, 2);
285350
+ this.finishOp(132, 2);
284803
285351
  } else {
284804
285352
  super.getTokenFromCode(code2);
284805
285353
  }
@@ -284883,7 +285431,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
284883
285431
  const oldStrict = this.state.strict;
284884
285432
  const placeholder2 = this.parsePlaceholder("Identifier");
284885
285433
  if (placeholder2) {
284886
- if (this.match(77) || this.match(130) || this.match(2)) {
285434
+ if (this.match(77) || this.match(132) || this.match(2)) {
284887
285435
  node.id = placeholder2;
284888
285436
  } else if (optionalId || !isStatement5) {
284889
285437
  node.id = null;
@@ -284919,7 +285467,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
284919
285467
  if (this.match(61)) {
284920
285468
  const next = this.nextTokenStart();
284921
285469
  if (this.isUnparsedContextual(next, "from")) {
284922
- if (this.input.startsWith(tokenLabelName(130), this.hasPlugin("exportDefaultFrom") ? this.nextTokenStartSince(next + 4) : this.nextTokenInLineStartSince(next + 4))) {
285470
+ if (this.input.startsWith(tokenLabelName(132), this.hasPlugin("exportDefaultFrom") ? this.nextTokenStartSince(next + 4) : this.nextTokenInLineStartSince(next + 4))) {
284923
285471
  return true;
284924
285472
  }
284925
285473
  }
@@ -284948,7 +285496,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
284948
285496
  node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
284949
285497
  if (this.eat(8)) {
284950
285498
  const hasStarImport = this.maybeParseStarImportSpecifier(node);
284951
- if (!hasStarImport) this.parseNamedImportSpecifiers(node);
285499
+ if (!hasStarImport) this.parseNamedOrFilteredImportSpecifiers(node);
284952
285500
  }
284953
285501
  this.expectContextual(95);
284954
285502
  node.source = this.parseImportSource();
@@ -284971,6 +285519,7 @@ var v8intrinsic = (superClass) => class V8IntrinsicMixin extends superClass {
284971
285519
  const node = this.startNode();
284972
285520
  this.next();
284973
285521
  if (tokenIsIdentifier(this.state.type)) {
285522
+ this.setLoc(this.state.startLoc);
284974
285523
  const name = this.parseIdentifierName();
284975
285524
  const identifier4 = this.createIdentifier(node, name);
284976
285525
  this.castNodeTo(identifier4, "V8IntrinsicIdentifier");
@@ -285050,6 +285599,9 @@ function validatePlugins(pluginsMap) {
285050
285599
  if (pluginsMap.has("importReflection")) {
285051
285600
  throw new Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.");
285052
285601
  }
285602
+ if (pluginsMap.has("deferredReexports") && !pluginsMap.has("deferredImportEvaluation")) {
285603
+ throw new Error("The 'deferredReexports' plugin requires 'deferredImportEvaluation'.");
285604
+ }
285053
285605
  }
285054
285606
  var mixinPlugins = {
285055
285607
  estree,
@@ -285342,12 +285894,12 @@ function normalizeReplacements(replacements) {
285342
285894
  throw new Error("Template replacements must be an array, object, null, or undefined");
285343
285895
  }
285344
285896
  var {
285345
- isCallExpression: isCallExpression3,
285897
+ isCallExpression: isCallExpression2,
285346
285898
  isExpressionStatement: isExpressionStatement2,
285347
285899
  isFunction: isFunction3,
285348
285900
  isIdentifier: isIdentifier3,
285349
285901
  isJSXIdentifier: isJSXIdentifier2,
285350
- isNewExpression: isNewExpression3,
285902
+ isNewExpression: isNewExpression2,
285351
285903
  isPlaceholder: isPlaceholder2,
285352
285904
  isStatement: isStatement$12,
285353
285905
  isStringLiteral: isStringLiteral$1,
@@ -285420,7 +285972,7 @@ function placeholderVisitorHandler(node, ancestors, state) {
285420
285972
  expectedNode: "StringLiteral"
285421
285973
  })) {
285422
285974
  type = "string";
285423
- } else if (isNewExpression3(parent) && key === "arguments" || isCallExpression3(parent) && key === "arguments" || isFunction3(parent) && key === "params") {
285975
+ } else if (isNewExpression2(parent) && key === "arguments" || isCallExpression2(parent) && key === "arguments" || isFunction3(parent) && key === "params") {
285424
285976
  type = "param";
285425
285977
  } else if (isExpressionStatement2(parent) && !isPlaceholder2(node)) {
285426
285978
  type = "statement";
@@ -286167,7 +286719,7 @@ function verify$1(visitor) {
286167
286719
  }
286168
286720
  if (shouldIgnoreKey(nodeType)) continue;
286169
286721
  if (!TYPES2.includes(nodeType)) {
286170
- throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"8.0.7"}`);
286722
+ throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"8.1.0"}`);
286171
286723
  }
286172
286724
  const visitors2 = visitor[nodeType];
286173
286725
  if (typeof visitors2 === "object") {
@@ -286614,6 +287166,7 @@ var {
286614
287166
  isProperty: isProperty2,
286615
287167
  isPureish: isPureish2,
286616
287168
  isRegExpLiteral: isRegExpLiteral2,
287169
+ isRestElement: isRestElement$1,
286617
287170
  isSuper: isSuper$1,
286618
287171
  isTaggedTemplateExpression: isTaggedTemplateExpression2,
286619
287172
  isTemplateLiteral: isTemplateLiteral2,
@@ -286747,6 +287300,13 @@ function gatherNodeParts(node, parts) {
286747
287300
  break;
286748
287301
  }
286749
287302
  }
287303
+ var uidCandidateStart = /* @__PURE__ */ new WeakMap();
287304
+ function uidCandidate(name, i) {
287305
+ if (i >= 11) return `_${name}${i - 1}`;
287306
+ if (i >= 9) return `_${name}${i - 9}`;
287307
+ if (i >= 1) return `_${name}${i + 1}`;
287308
+ return `_${name}`;
287309
+ }
286750
287310
  function resetScope(scope2) {
286751
287311
  if (scope2.path.type === "Program") {
286752
287312
  scope2.referencesSet = /* @__PURE__ */ new Set();
@@ -286931,17 +287491,20 @@ var Scope2 = class _Scope {
286931
287491
  }
286932
287492
  generateUid(name = "temp") {
286933
287493
  name = toIdentifier2(name).replace(/^_+/, "").replace(/\d+$/g, "");
287494
+ const program3 = this.getProgramParent();
287495
+ const {
287496
+ referencesSet
287497
+ } = program3;
287498
+ let starts = uidCandidateStart.get(referencesSet);
287499
+ if (!starts) uidCandidateStart.set(referencesSet, starts = /* @__PURE__ */ new Map());
287500
+ let i = starts.get(name) ?? 0;
287501
+ while (referencesSet.has(uidCandidate(name, i))) i++;
287502
+ starts.set(name, i);
286934
287503
  let uid2;
286935
- let i = 0;
286936
287504
  do {
286937
- uid2 = `_${name}`;
286938
- if (i >= 11) uid2 += i - 1;
286939
- else if (i >= 9) uid2 += i - 9;
286940
- else if (i >= 1) uid2 += i + 1;
286941
- i++;
286942
- } while (this.hasLabel(uid2) || this.hasBinding(uid2) || this.hasGlobal(uid2) || this.hasReference(uid2));
286943
- const program3 = this.getProgramParent();
286944
- program3.referencesSet.add(uid2);
287505
+ uid2 = uidCandidate(name, i++);
287506
+ } while (referencesSet.has(uid2) || this.hasLabel(uid2) || this.hasBinding(uid2) || this.hasGlobal(uid2));
287507
+ referencesSet.add(uid2);
286945
287508
  program3.uidsSet.add(uid2);
286946
287509
  return uid2;
286947
287510
  }
@@ -287279,7 +287842,7 @@ var Scope2 = class _Scope {
287279
287842
  } = opts;
287280
287843
  if (!init && !unique && (kind === "var" || kind === "let") && isAnonymousFunctionExpression(path) && isCallExpression$1(path.parent, {
287281
287844
  callee: path.node
287282
- }) && path.parent.arguments.length <= path.node.params.length && isIdentifier$4(id)) {
287845
+ }) && path.parent.arguments.length <= path.node.params.length && (path.node.params.length === 0 || !isRestElement$1(path.node.params[path.node.params.length - 1])) && isIdentifier$4(id)) {
287283
287846
  path.pushContainer("params", id);
287284
287847
  path.scope.registerBinding("param", path.get("params")[path.node.params.length - 1]);
287285
287848
  return;
@@ -287298,8 +287861,17 @@ var Scope2 = class _Scope {
287298
287861
  if (!unique) path.setData(dataKey, declarPath);
287299
287862
  }
287300
287863
  const declarator = variableDeclarator$1(id, init);
287301
- const len = declarPath.node.declarations.push(declarator);
287302
- path.scope.registerBinding(kind, declarPath.get("declarations")[len - 1]);
287864
+ const {
287865
+ declarations
287866
+ } = declarPath.node;
287867
+ const len = declarations.push(declarator);
287868
+ path.scope.registerBinding(kind, NodePath_Final.get({
287869
+ listKey: "declarations",
287870
+ parentPath: declarPath,
287871
+ parent: declarPath.node,
287872
+ container: declarations,
287873
+ key: len - 1
287874
+ }).setContext(declarPath.context));
287303
287875
  }
287304
287876
  getProgramParent() {
287305
287877
  let scope2 = this;
@@ -288150,7 +288722,7 @@ var {
288150
288722
  cloneNode: cloneNode$2,
288151
288723
  expressionStatement: expressionStatement$2,
288152
288724
  isAssignmentExpression: isAssignmentExpression2,
288153
- isCallExpression: isCallExpression4,
288725
+ isCallExpression: isCallExpression3,
288154
288726
  isExportNamedDeclaration: isExportNamedDeclaration3,
288155
288727
  isExpression: isExpression$2,
288156
288728
  isIdentifier: isIdentifier$12,
@@ -288249,7 +288821,7 @@ function insertAfter(nodes_) {
288249
288821
  }
288250
288822
  if (isHiddenInSequenceExpression(self2)) {
288251
288823
  nodes.unshift(node);
288252
- } else if (isCallExpression4(node) && isSuper2(node.callee)) {
288824
+ } else if (isCallExpression3(node) && isSuper2(node.callee)) {
288253
288825
  nodes.unshift(node);
288254
288826
  nodes.push(thisExpression$1());
288255
288827
  } else if (isAlmostConstantAssignment(node, scope2)) {
@@ -289587,7 +290159,19 @@ function referencesImport(moduleSource, importName) {
289587
290159
  value: importName
289588
290160
  }) : this.node.property.name === importName)) {
289589
290161
  const object = this.get("object");
289590
- return object.isReferencedIdentifier() && object.referencesImport(moduleSource, "*");
290162
+ if (!object.isReferencedIdentifier()) return false;
290163
+ const binding2 = object.scope.getBinding(object.node.name);
290164
+ if (binding2?.kind !== "module") return false;
290165
+ const {
290166
+ path: path2
290167
+ } = binding2;
290168
+ if (!path2.isImportNamespaceSpecifier() || path2.parent.source.value !== moduleSource) {
290169
+ return false;
290170
+ }
290171
+ const {
290172
+ exportsFilter
290173
+ } = path2.node;
290174
+ return !exportsFilter || isInExportsFilter(exportsFilter, importName);
289591
290175
  }
289592
290176
  return false;
289593
290177
  }
@@ -289604,8 +290188,8 @@ function referencesImport(moduleSource, importName) {
289604
290188
  if (path.isImportDefaultSpecifier() && importName === "default") {
289605
290189
  return true;
289606
290190
  }
289607
- if (path.isImportNamespaceSpecifier() && importName === "*") {
289608
- return true;
290191
+ if (path.isImportNamespaceSpecifier()) {
290192
+ return !path.node.exportsFilter && importName === "*";
289609
290193
  }
289610
290194
  if (path.isImportSpecifier() && isIdentifier4(path.node.imported, {
289611
290195
  name: importName
@@ -289614,6 +290198,13 @@ function referencesImport(moduleSource, importName) {
289614
290198
  }
289615
290199
  return false;
289616
290200
  }
290201
+ function isInExportsFilter(exportsFilter, importName) {
290202
+ return exportsFilter.some((name) => isIdentifier4(name, {
290203
+ name: importName
290204
+ }) || isStringLiteral3(name, {
290205
+ value: importName
290206
+ }));
290207
+ }
289617
290208
  function getSource() {
289618
290209
  const node = this.node;
289619
290210
  if (node.end) {