@danielx/civet 0.10.7 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // ../Hera/dist/machine.js
32
+ // node_modules/@danielx/hera/dist/machine.js
33
33
  var require_machine = __commonJS({
34
- "../Hera/dist/machine.js"(exports2, module2) {
34
+ "node_modules/@danielx/hera/dist/machine.js"(exports2, module2) {
35
35
  "use strict";
36
36
  var __defProp2 = Object.defineProperty;
37
37
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -624,7 +624,7 @@ function addParentPointers(node, parent) {
624
624
  node.parent = parent;
625
625
  }
626
626
  if (node.children) {
627
- for (let ref = node.children, i1 = 0, len1 = ref.length; i1 < len1; i1++) {
627
+ for (let ref = node.children, i1 = 0, len12 = ref.length; i1 < len12; i1++) {
628
628
  const child = ref[i1];
629
629
  addParentPointers(child, node);
630
630
  }
@@ -1608,7 +1608,7 @@ function findChildIndex(parent, child) {
1608
1608
  }
1609
1609
  }
1610
1610
  function arrayRecurse(array) {
1611
- for (let i2 = 0, len1 = array.length; i2 < len1; i2++) {
1611
+ for (let i2 = 0, len12 = array.length; i2 < len12; i2++) {
1612
1612
  const c = array[i2];
1613
1613
  if (c === child || Array.isArray(c) && arrayRecurse(c)) {
1614
1614
  return true;
@@ -1815,7 +1815,7 @@ function adjustBindingElements(elements) {
1815
1815
  const names = elements.flatMap(($2) => $2.names || []);
1816
1816
  const { length } = elements;
1817
1817
  let blockPrefix, restIndex = -1, restCount = 0;
1818
- for (let i2 = 0, len1 = elements.length; i2 < len1; i2++) {
1818
+ for (let i2 = 0, len12 = elements.length; i2 < len12; i2++) {
1819
1819
  const i = i2;
1820
1820
  const { type } = elements[i2];
1821
1821
  if (type === "BindingRestElement") {
@@ -3074,7 +3074,7 @@ function patternBindings(pattern) {
3074
3074
  function recurse(pattern2) {
3075
3075
  switch (pattern2.type) {
3076
3076
  case "ArrayBindingPattern": {
3077
- for (let ref3 = pattern2.elements, i2 = 0, len1 = ref3.length; i2 < len1; i2++) {
3077
+ for (let ref3 = pattern2.elements, i2 = 0, len12 = ref3.length; i2 < len12; i2++) {
3078
3078
  const element = ref3[i2];
3079
3079
  recurse(element);
3080
3080
  }
@@ -4077,14 +4077,23 @@ function expressionizeIteration(exp) {
4077
4077
  if (generator) {
4078
4078
  iterationDefaultBody(statement);
4079
4079
  assignResults(block, (node) => {
4080
+ let star;
4081
+ if (node && typeof node === "object" && "type" in node && node.type === "SpreadElement" && "expression" in node) {
4082
+ const { expression } = node;
4083
+ star = "*";
4084
+ node = expression;
4085
+ }
4080
4086
  return {
4081
4087
  type: "YieldExpression",
4082
4088
  expression: node,
4089
+ star,
4083
4090
  children: [
4084
4091
  {
4085
4092
  type: "Yield",
4086
- token: "yield "
4093
+ children: ["yield"]
4087
4094
  },
4095
+ star,
4096
+ " ",
4088
4097
  node
4089
4098
  ]
4090
4099
  };
@@ -4278,6 +4287,17 @@ function braceBlock(block) {
4278
4287
  }
4279
4288
  }
4280
4289
  }
4290
+ function unbraceBlock(block) {
4291
+ if (block.bare) {
4292
+ return;
4293
+ }
4294
+ let ref;
4295
+ if (block.children[0] === " {" && (ref = block.children)[ref.length - 1] === "}") {
4296
+ block.children.shift();
4297
+ block.children.pop();
4298
+ block.bare = true;
4299
+ }
4300
+ }
4281
4301
  function duplicateBlock(block) {
4282
4302
  const expressions = [...block.expressions];
4283
4303
  let children;
@@ -4376,16 +4396,58 @@ function insertHoistDec(block, node, dec) {
4376
4396
  }
4377
4397
  function processBlocks(statements) {
4378
4398
  insertSemicolon(statements);
4379
- for (let ref = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len1 = ref.length; i2 < len1; i2++) {
4380
- const { expressions } = ref[i2];
4381
- processBlocks(expressions);
4399
+ for (let ref1 = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len12 = ref1.length; i2 < len12; i2++) {
4400
+ const block = ref1[i2];
4401
+ let m;
4402
+ if (block.unwrapObject && block.expressions.length === 1 && (m = block.expressions[0][1], typeof m === "object" && m != null && "type" in m && m.type === "ParenthesizedExpression" && "implicit" in m && m.implicit === true && "expression" in m && typeof m.expression === "object" && m.expression != null && "type" in m.expression && m.expression.type === "ObjectExpression")) {
4403
+ const object = block.expressions[0][1].expression;
4404
+ if (!(() => {
4405
+ let results = true;
4406
+ for (const prop of object.properties) {
4407
+ if (!(prop.type === "Property" && prop.implicitName)) {
4408
+ results = false;
4409
+ break;
4410
+ }
4411
+ }
4412
+ return results;
4413
+ })()) {
4414
+ continue;
4415
+ }
4416
+ block.expressions[0][1] = block.expressions[0][1].expression;
4417
+ unbraceBlock(block);
4418
+ for (let ref2 = object.properties, i3 = 0, len22 = ref2.length; i3 < len22; i3++) {
4419
+ const i = i3;
4420
+ const prop = ref2[i3];
4421
+ let m1;
4422
+ if (m1 = prop.name, typeof m1 === "object" && m1 != null && "type" in m1 && m1.type === "ComputedPropertyName" && "implicit" in m1 && m1.implicit === true) {
4423
+ replaceNode(prop.name, prop.name.expression, prop);
4424
+ }
4425
+ if (prop.delim?.implicit) {
4426
+ if (needsPrecedingSemicolon(object.properties[i + 1])) {
4427
+ prop.delim.token = ";";
4428
+ } else {
4429
+ replaceNode(prop.delim, void 0, prop);
4430
+ prop.delim = void 0;
4431
+ }
4432
+ }
4433
+ const colon = prop.children.indexOf(": ");
4434
+ if (colon < 0) {
4435
+ continue;
4436
+ }
4437
+ if (!(prop.children[colon - 1] === prop.name)) {
4438
+ continue;
4439
+ }
4440
+ prop.children.splice(colon - 1, 2);
4441
+ }
4442
+ }
4443
+ processBlocks(block.expressions);
4382
4444
  }
4383
4445
  }
4384
4446
  function insertSemicolon(statements) {
4385
4447
  const l = statements.length;
4386
- for (let i3 = 0, len22 = statements.length; i3 < len22; i3++) {
4387
- const i = i3;
4388
- const s = statements[i3];
4448
+ for (let i4 = 0, len3 = statements.length; i4 < len3; i4++) {
4449
+ const i = i4;
4450
+ const s = statements[i4];
4389
4451
  if (i < l - 1) {
4390
4452
  if (needsPrecedingSemicolon(statements[i + 1][1])) {
4391
4453
  const delim = s[2];
@@ -4403,8 +4465,8 @@ function needsPrecedingSemicolon(exp) {
4403
4465
  return false;
4404
4466
  }
4405
4467
  if (Array.isArray(exp)) {
4406
- for (let i4 = 0, len3 = exp.length; i4 < len3; i4++) {
4407
- const child = exp[i4];
4468
+ for (let i5 = 0, len4 = exp.length; i5 < len4; i5++) {
4469
+ const child = exp[i5];
4408
4470
  if (!(child != null)) {
4409
4471
  continue;
4410
4472
  }
@@ -4450,8 +4512,8 @@ function needsPrecedingSemicolon(exp) {
4450
4512
  function blockContainingStatement(exp) {
4451
4513
  let child = exp;
4452
4514
  let parent = exp.parent;
4453
- let m;
4454
- while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
4515
+ let m2;
4516
+ while (parent != null && (m2 = parent.type, m2 === "StatementExpression" || m2 === "PipelineExpression" || m2 === "UnwrappedExpression")) {
4455
4517
  child = parent;
4456
4518
  parent = parent.parent;
4457
4519
  }
@@ -4504,7 +4566,7 @@ var precedenceMap = /* @__PURE__ */ new Map();
4504
4566
  for (let i1 = 0, len3 = precedenceOrder.length; i1 < len3; i1++) {
4505
4567
  const prec = i1;
4506
4568
  const ops = precedenceOrder[i1];
4507
- for (let i2 = 0, len1 = ops.length; i2 < len1; i2++) {
4569
+ for (let i2 = 0, len12 = ops.length; i2 < len12; i2++) {
4508
4570
  const op = ops[i2];
4509
4571
  precedenceMap.set(op, prec);
4510
4572
  }
@@ -4835,7 +4897,7 @@ function processPatternMatching(statements) {
4835
4897
  let isPattern = false;
4836
4898
  if (clauses.some(($4) => $4.type === "PatternClause")) {
4837
4899
  isPattern = true;
4838
- for (let i2 = 0, len1 = clauses.length; i2 < len1; i2++) {
4900
+ for (let i2 = 0, len12 = clauses.length; i2 < len12; i2++) {
4839
4901
  const c = clauses[i2];
4840
4902
  if (!(c.type === "PatternClause" || c.type === "DefaultClause")) {
4841
4903
  errors = true;
@@ -5369,7 +5431,7 @@ function processAssignmentDeclaration(decl, pattern, typeSuffix, ws, assign, e)
5369
5431
  });
5370
5432
  }
5371
5433
  function processDeclarations(statements) {
5372
- for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len1 = ref1.length; i1 < len1; i1++) {
5434
+ for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len12 = ref1.length; i1 < len12; i1++) {
5373
5435
  const declaration = ref1[i1];
5374
5436
  const { bindings } = declaration;
5375
5437
  if (!(bindings != null)) {
@@ -5456,7 +5518,7 @@ function prependStatementExpressionBlock(initializer, statement) {
5456
5518
  }
5457
5519
  const pre = [];
5458
5520
  const statementExp = exp.statement;
5459
- const blockStatement = ["", statementExp];
5521
+ const blockStatement = [ws || "", statementExp, ";"];
5460
5522
  let ref;
5461
5523
  if (statementExp.type === "IterationExpression") {
5462
5524
  if (statementExp.async || statementExp.generator) {
@@ -5478,9 +5540,9 @@ function prependStatementExpressionBlock(initializer, statement) {
5478
5540
  });
5479
5541
  const refDec = {
5480
5542
  type: "Declaration",
5481
- children: ["let ", ref, ";"]
5543
+ children: ["let ", ref]
5482
5544
  };
5483
- pre.unshift(refDec);
5545
+ pre.unshift(["", refDec, ";"]);
5484
5546
  } else {
5485
5547
  wrapIterationReturningResults(statement2, () => void 0);
5486
5548
  ref = initializer.expression = initializer.children[2] = statement2.resultsRef;
@@ -5496,14 +5558,11 @@ function prependStatementExpressionBlock(initializer, statement) {
5496
5558
  });
5497
5559
  const refDec = {
5498
5560
  type: "Declaration",
5499
- children: ["let ", ref, ";"]
5561
+ children: ["let ", ref]
5500
5562
  };
5501
- pre.unshift(refDec);
5502
- if (ws) {
5503
- pre.push(ws);
5504
- }
5563
+ pre.unshift(["", refDec, ";"]);
5505
5564
  }
5506
- statement.children.unshift(pre, blockStatement, ";");
5565
+ statement.children.unshift(...pre, blockStatement);
5507
5566
  updateParentPointers(blockStatement, statement);
5508
5567
  return ref;
5509
5568
  }
@@ -5824,26 +5883,60 @@ function dynamizeImportDeclaration(decl) {
5824
5883
  };
5825
5884
  }
5826
5885
  function dynamizeImportDeclarationExpression($0) {
5827
- const [imp, ws1, named, ws2, from] = $0;
5828
- const object = convertNamedImportsToObject(named);
5829
- const dot = ".";
5830
- return processCallMemberExpression({
5831
- type: "CallExpression",
5886
+ const [imp, ws1, imports, ws2, from] = $0;
5887
+ const awaitExpression = {
5888
+ type: "AwaitExpression",
5832
5889
  children: [
5833
- { type: "Await", children: "await" },
5890
+ { type: "Await", children: ["await"] },
5834
5891
  " ",
5835
5892
  imp,
5836
5893
  trimFirstSpace(ws2),
5837
- dynamizeFromClause(from),
5838
- {
5839
- type: "PropertyGlob",
5840
- dot,
5841
- object,
5842
- children: [ws1, dot, object],
5843
- reversed: true
5844
- }
5894
+ dynamizeFromClause(from)
5845
5895
  ]
5846
- });
5896
+ };
5897
+ const dot = {
5898
+ type: "AccessStart",
5899
+ children: ["."],
5900
+ optional: false
5901
+ };
5902
+ switch (imports?.type) {
5903
+ case "Identifier": {
5904
+ return processCallMemberExpression({
5905
+ type: "CallExpression",
5906
+ children: [
5907
+ parenthesizeExpression(awaitExpression),
5908
+ {
5909
+ type: "PropertyAccess",
5910
+ dot,
5911
+ name: "default",
5912
+ children: [ws1, dot, "default"]
5913
+ }
5914
+ ]
5915
+ });
5916
+ }
5917
+ case "Star": {
5918
+ return parenthesizeExpression(awaitExpression);
5919
+ }
5920
+ case "Declaration": {
5921
+ const object = convertNamedImportsToObject(imports);
5922
+ return processCallMemberExpression({
5923
+ type: "CallExpression",
5924
+ children: [
5925
+ parenthesizeExpression(awaitExpression),
5926
+ {
5927
+ type: "PropertyGlob",
5928
+ dot,
5929
+ object,
5930
+ children: [ws1, dot, object],
5931
+ reversed: true
5932
+ }
5933
+ ]
5934
+ });
5935
+ }
5936
+ default: {
5937
+ throw new Error("Unsupported dynamic import");
5938
+ }
5939
+ }
5847
5940
  }
5848
5941
  function convertWithClause(withClause, extendsClause) {
5849
5942
  let extendsToken, extendsTarget, ws;
@@ -6143,7 +6236,7 @@ function processPipelineExpressions(statements) {
6143
6236
  const children = [ws];
6144
6237
  const comma = blockContainingStatement(s) ? ";" : ",";
6145
6238
  let usingRef = null;
6146
- for (let i2 = 0, len1 = body.length; i2 < len1; i2++) {
6239
+ for (let i2 = 0, len12 = body.length; i2 < len12; i2++) {
6147
6240
  const i = i2;
6148
6241
  const step = body[i2];
6149
6242
  const [leadingComment, pipe, trailingComment, expr] = step;
@@ -6935,7 +7028,7 @@ function dedentBlockSubstitutions($0, tab) {
6935
7028
  }
6936
7029
  const stringPart = (() => {
6937
7030
  const results1 = [];
6938
- for (let i2 = 0, len1 = strWithSubstitutions.length; i2 < len1; i2++) {
7031
+ for (let i2 = 0, len12 = strWithSubstitutions.length; i2 < len12; i2++) {
6939
7032
  const part = strWithSubstitutions[i2];
6940
7033
  results1.push(part.token ?? "s");
6941
7034
  }
@@ -7025,6 +7118,9 @@ function quoteString(str) {
7025
7118
 
7026
7119
  // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
7027
7120
  var xor = (a, b) => a ? !b && a : b;
7121
+ function len1(arr, length) {
7122
+ return arr.length === length;
7123
+ }
7028
7124
  function addPostfixStatement(statement, ws, post) {
7029
7125
  const expressions = [
7030
7126
  ...post.blockPrefix || [],
@@ -7402,7 +7498,7 @@ function processCallMemberExpression(node) {
7402
7498
  isComma(args[args.length - 1]).token = "";
7403
7499
  }
7404
7500
  let commaCount = 0;
7405
- for (let i2 = 0, len1 = args.length; i2 < len1; i2++) {
7501
+ for (let i2 = 0, len22 = args.length; i2 < len22; i2++) {
7406
7502
  const i = i2;
7407
7503
  let arg = args[i2];
7408
7504
  if (isComma(arg)) {
@@ -7432,19 +7528,22 @@ function processCallMemberExpression(node) {
7432
7528
  }
7433
7529
  }
7434
7530
  }
7435
- for (let i3 = 0, len22 = children.length; i3 < len22; i3++) {
7531
+ for (let i3 = 0, len3 = children.length; i3 < len3; i3++) {
7436
7532
  const i = i3;
7437
7533
  const glob = children[i3];
7438
7534
  if (glob?.type === "PropertyGlob") {
7439
7535
  let prefix = children.slice(0, i);
7440
7536
  const parts = [];
7441
7537
  let ref;
7442
- if (prefix.length > 1 && glob.object.properties.length > 1) {
7538
+ if (needsRef(prefix) && glob.object.properties.length > 1) {
7539
+ if (Array.isArray(prefix) && len1(prefix, 1) && typeof prefix[0] === "object" && prefix[0] != null && "type" in prefix[0] && prefix[0].type === "ParenthesizedExpression" && "implicit" in prefix[0] && prefix[0].implicit === true) {
7540
+ prefix = [prefix[0].expression];
7541
+ }
7443
7542
  ref = makeRef();
7444
7543
  const { refAssignment } = makeRefAssignment(ref, prefix);
7445
7544
  prefix = [makeLeftHandSideExpression(refAssignment)];
7446
7545
  }
7447
- prefix = prefix.concat(glob.dot);
7546
+ let prefixDot = [...prefix, glob.dot];
7448
7547
  for (const part of glob.object.properties) {
7449
7548
  if (part.type === "Error") {
7450
7549
  parts.push(part);
@@ -7457,7 +7556,7 @@ function processCallMemberExpression(node) {
7457
7556
  });
7458
7557
  continue;
7459
7558
  }
7460
- if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
7559
+ if (part.value && !["CallExpression", "MemberExpression", "Identifier", "StringLiteral", "ComputedPropertyName"].includes(part.value.type)) {
7461
7560
  parts.push({
7462
7561
  type: "Error",
7463
7562
  message: `Glob pattern must have call or member expression value, found ${JSON.stringify(part.value)}`
@@ -7473,9 +7572,28 @@ function processCallMemberExpression(node) {
7473
7572
  [name, value] = [value, name];
7474
7573
  }
7475
7574
  if (!suppressPrefix) {
7476
- value = prefix.concat(trimFirstSpace(value));
7575
+ if (value.type === "StringLiteral") {
7576
+ value = [
7577
+ ...prefix,
7578
+ {
7579
+ type: "Index",
7580
+ children: ["[", trimFirstSpace(value), "]"]
7581
+ }
7582
+ ];
7583
+ } else if (value.type === "ComputedPropertyName") {
7584
+ value = [
7585
+ ...prefix,
7586
+ {
7587
+ type: "Index",
7588
+ children: [trimFirstSpace(value)]
7589
+ }
7590
+ ];
7591
+ } else {
7592
+ value = [...prefixDot, trimFirstSpace(value)];
7593
+ }
7477
7594
  if (ref != null) {
7478
- prefix = [ref].concat(glob.dot);
7595
+ prefix = [ref];
7596
+ prefixDot = [...prefix, glob.dot];
7479
7597
  }
7480
7598
  }
7481
7599
  if (wValue) value.unshift(wValue);
@@ -7878,7 +7996,7 @@ function processBindingPatternLHS(lhs, tail) {
7878
7996
  );
7879
7997
  }
7880
7998
  function processAssignments(statements) {
7881
- for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len3 = ref8.length; i5 < len3; i5++) {
7999
+ for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref8.length; i5 < len4; i5++) {
7882
8000
  let extractAssignment = function(lhs) {
7883
8001
  let expr = lhs;
7884
8002
  while (expr.type === "ParenthesizedExpression") {
@@ -7907,7 +8025,7 @@ function processAssignments(statements) {
7907
8025
  if (!exp.lhs) {
7908
8026
  continue;
7909
8027
  }
7910
- for (let ref10 = exp.lhs, i6 = 0, len4 = ref10.length; i6 < len4; i6++) {
8028
+ for (let ref10 = exp.lhs, i6 = 0, len5 = ref10.length; i6 < len5; i6++) {
7911
8029
  const lhsPart = ref10[i6];
7912
8030
  let ref11;
7913
8031
  if (ref11 = extractAssignment(lhsPart[1])) {
@@ -7952,7 +8070,7 @@ function processAssignments(statements) {
7952
8070
  }
7953
8071
  }
7954
8072
  }
7955
- for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len5 = ref12.length; i7 < len5; i7++) {
8073
+ for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref12.length; i7 < len6; i7++) {
7956
8074
  const exp = ref12[i7];
7957
8075
  if (!(exp.names === null)) {
7958
8076
  continue;
@@ -8023,7 +8141,7 @@ function processAssignments(statements) {
8023
8141
  c[1] = start;
8024
8142
  c[2] = ", ";
8025
8143
  if (end) {
8026
- c[3] = [end, " - ", start];
8144
+ c[3] = [makeLeftHandSideExpression(end), " - ", makeLeftHandSideExpression(start)];
8027
8145
  } else {
8028
8146
  c[3] = ["1/0"];
8029
8147
  }
@@ -8186,7 +8304,7 @@ function attachPostfixStatementAsExpression(exp, post) {
8186
8304
  }
8187
8305
  function processTypes(node) {
8188
8306
  const results1 = [];
8189
- for (let ref16 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len6 = ref16.length; i8 < len6; i8++) {
8307
+ for (let ref16 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len7 = ref16.length; i8 < len7; i8++) {
8190
8308
  const unary = ref16[i8];
8191
8309
  let suffixIndex = unary.suffix.length - 1;
8192
8310
  const results2 = [];
@@ -8314,7 +8432,7 @@ function processTypes(node) {
8314
8432
  return results1;
8315
8433
  }
8316
8434
  function processStatementExpressions(statements) {
8317
- for (let ref18 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len7 = ref18.length; i9 < len7; i9++) {
8435
+ for (let ref18 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len8 = ref18.length; i9 < len8; i9++) {
8318
8436
  const exp = ref18[i9];
8319
8437
  const { maybe, statement } = exp;
8320
8438
  if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
@@ -8384,7 +8502,7 @@ function processNegativeIndexAccess(statements) {
8384
8502
  });
8385
8503
  }
8386
8504
  function processFinallyClauses(statements) {
8387
- for (let ref20 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len8 = ref20.length; i10 < len8; i10++) {
8505
+ for (let ref20 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len9 = ref20.length; i10 < len9; i10++) {
8388
8506
  let f = ref20[i10];
8389
8507
  let ref21;
8390
8508
  if (!((ref21 = blockContainingStatement(f)) && typeof ref21 === "object" && "block" in ref21 && "index" in ref21)) {
@@ -8462,7 +8580,7 @@ function processBreaksContinues(statements) {
8462
8580
  }
8463
8581
  }
8464
8582
  function processCoffeeClasses(statements) {
8465
- for (let ref22 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len9 = ref22.length; i11 < len9; i11++) {
8583
+ for (let ref22 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len10 = ref22.length; i11 < len10; i11++) {
8466
8584
  const ce = ref22[i11];
8467
8585
  const { expressions } = ce.body;
8468
8586
  const indent = expressions[0]?.[0] ?? "\n";
@@ -8507,7 +8625,7 @@ function processCoffeeClasses(statements) {
8507
8625
  0,
8508
8626
  ...(() => {
8509
8627
  const results3 = [];
8510
- for (let i12 = 0, len10 = autoBinds.length; i12 < len10; i12++) {
8628
+ for (let i12 = 0, len11 = autoBinds.length; i12 < len11; i12++) {
8511
8629
  const [, a] = autoBinds[i12];
8512
8630
  results3.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
8513
8631
  }
@@ -8623,7 +8741,7 @@ async function processProgramAsync(root) {
8623
8741
  function processRepl(root, rootIIFE) {
8624
8742
  const topBlock = gatherRecursive(rootIIFE, ($21) => $21.type === "BlockStatement")[0];
8625
8743
  let i = 0;
8626
- for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len11 = ref23.length; i14 < len11; i14++) {
8744
+ for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len12 = ref23.length; i14 < len12; i14++) {
8627
8745
  const decl = ref23[i14];
8628
8746
  if (!decl.names?.length) {
8629
8747
  continue;
@@ -8637,7 +8755,7 @@ function processRepl(root, rootIIFE) {
8637
8755
  root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")}`, ";"]);
8638
8756
  }
8639
8757
  }
8640
- for (let ref24 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len12 = ref24.length; i15 < len12; i15++) {
8758
+ for (let ref24 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len13 = ref24.length; i15 < len13; i15++) {
8641
8759
  const func = ref24[i15];
8642
8760
  if (func.name && func.parent?.type === "BlockStatement") {
8643
8761
  if (func.parent === topBlock) {
@@ -8650,7 +8768,7 @@ function processRepl(root, rootIIFE) {
8650
8768
  }
8651
8769
  }
8652
8770
  }
8653
- for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len13 = ref25.length; i16 < len13; i16++) {
8771
+ for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len14 = ref25.length; i16 < len14; i16++) {
8654
8772
  const classExp = ref25[i16];
8655
8773
  let m8;
8656
8774
  if (classExp.name && classExp.parent === topBlock || (m8 = classExp.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ReturnStatement" && "parent" in m8 && m8.parent === topBlock)) {
@@ -8662,7 +8780,7 @@ function processRepl(root, rootIIFE) {
8662
8780
  function processPlaceholders(statements) {
8663
8781
  const placeholderMap = /* @__PURE__ */ new Map();
8664
8782
  const liftedIfs = /* @__PURE__ */ new Set();
8665
- for (let ref26 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len14 = ref26.length; i17 < len14; i17++) {
8783
+ for (let ref26 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len15 = ref26.length; i17 < len15; i17++) {
8666
8784
  const exp = ref26[i17];
8667
8785
  let ancestor;
8668
8786
  if (exp.subtype === ".") {
@@ -8772,7 +8890,7 @@ function processPlaceholders(statements) {
8772
8890
  for (const [ancestor, placeholders] of placeholderMap) {
8773
8891
  let ref = makeRef("$");
8774
8892
  let typeSuffix;
8775
- for (let i18 = 0, len15 = placeholders.length; i18 < len15; i18++) {
8893
+ for (let i18 = 0, len16 = placeholders.length; i18 < len16; i18++) {
8776
8894
  const placeholder = placeholders[i18];
8777
8895
  typeSuffix ??= placeholder.typeSuffix;
8778
8896
  let ref27;
@@ -8886,10 +9004,12 @@ function reorderBindingRestProperty(props) {
8886
9004
  }
8887
9005
  function typeOfJSX(node, config2) {
8888
9006
  switch (node.type) {
8889
- case "JSXElement":
9007
+ case "JSXElement": {
8890
9008
  return typeOfJSXElement(node, config2);
8891
- case "JSXFragment":
9009
+ }
9010
+ case "JSXFragment": {
8892
9011
  return typeOfJSXFragment(node, config2);
9012
+ }
8893
9013
  }
8894
9014
  }
8895
9015
  function typeOfJSXElement(node, config2) {
@@ -8897,7 +9017,7 @@ function typeOfJSXElement(node, config2) {
8897
9017
  if (config2.server && !config2.client) {
8898
9018
  return ["string"];
8899
9019
  }
8900
- let { tag } = node;
9020
+ const { tag } = node;
8901
9021
  const clientType = tag[0] === tag[0].toLowerCase() ? [getHelperRef("IntrinsicElements"), '<"', tag, '">'] : ["ReturnType<typeof ", tag, ">"];
8902
9022
  if (config2.server) {
8903
9023
  return ["string", " | ", clientType];
@@ -8912,33 +9032,40 @@ function typeOfJSXFragment(node, config2) {
8912
9032
  if (config2.solid) {
8913
9033
  let type = [];
8914
9034
  let lastType;
8915
- for (let child of node.jsxChildren) {
9035
+ for (const child of node.jsxChildren) {
8916
9036
  switch (child.type) {
8917
- case "JSXText":
8918
- if (lastType !== "JSXText") {
9037
+ case "JSXText": {
9038
+ if (!(lastType === "JSXText")) {
8919
9039
  type.push("string");
8920
9040
  }
9041
+ ;
8921
9042
  break;
8922
- case "JSXElement":
9043
+ }
9044
+ case "JSXElement": {
8923
9045
  type.push(typeOfJSXElement(child, config2));
8924
9046
  break;
8925
- case "JSXFragment":
9047
+ }
9048
+ case "JSXFragment": {
8926
9049
  type.push(...typeOfJSXFragment(child, config2));
8927
9050
  break;
8928
- case "JSXChildExpression":
9051
+ }
9052
+ case "JSXChildExpression": {
8929
9053
  if (child.expression) {
8930
9054
  type.push(["typeof ", child.expression]);
8931
9055
  }
9056
+ ;
8932
9057
  break;
8933
- default:
9058
+ }
9059
+ default: {
8934
9060
  throw new Error(`unknown child in JSXFragment: ${JSON.stringify(child)}`);
9061
+ }
8935
9062
  }
8936
9063
  lastType = child.type;
8937
9064
  }
8938
9065
  if (type.length === 1) {
8939
9066
  return type[0];
8940
9067
  } else {
8941
- type = type.flatMap((t) => [t, ", "]);
9068
+ type = type.flatMap(($26) => [$26, ", "]);
8942
9069
  type.pop();
8943
9070
  return ["[", type, "]"];
8944
9071
  }
@@ -9163,6 +9290,8 @@ var grammar = {
9163
9290
  NonSingleBracedBlock,
9164
9291
  DeclarationOrStatement,
9165
9292
  SingleLineStatements,
9293
+ ObjectSingleLineStatements,
9294
+ BracedObjectSingleLineStatements,
9166
9295
  PostfixedSingleLineStatements,
9167
9296
  PostfixedSingleLineNoCommaStatements,
9168
9297
  NestedBlockStatements,
@@ -9343,6 +9472,10 @@ var grammar = {
9343
9472
  ForbidNewlineBinaryOp,
9344
9473
  RestoreNewlineBinaryOp,
9345
9474
  NewlineBinaryOpAllowed,
9475
+ AllowImplicitFragment,
9476
+ ForbidImplicitFragment,
9477
+ RestoreImplicitFragment,
9478
+ ImplicitFragmentAllowed,
9346
9479
  AllowPipeline,
9347
9480
  ForbidPipeline,
9348
9481
  RestorePipeline,
@@ -9368,11 +9501,15 @@ var grammar = {
9368
9501
  NameSpaceImport,
9369
9502
  NamedImports,
9370
9503
  OperatorNamedImports,
9504
+ DynamicNamedImports,
9505
+ DynamicImportContents,
9371
9506
  FromClause,
9372
9507
  ImportAssertion,
9373
9508
  TypeAndImportSpecifier,
9374
9509
  ImportSpecifier,
9375
9510
  OperatorImportSpecifier,
9511
+ DynamicImportSpecifier,
9512
+ DynamicModuleExportName,
9376
9513
  ImportAsToken,
9377
9514
  ModuleExportName,
9378
9515
  ModuleSpecifier,
@@ -10650,7 +10787,11 @@ function SingleLineBinaryOpRHS(ctx, state2) {
10650
10787
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineBinaryOpRHS", SingleLineBinaryOpRHS$0);
10651
10788
  }
10652
10789
  var RHS$0 = ExpressionizedStatementWithTrailingCallExpressions;
10653
- var RHS$1 = UnaryExpression;
10790
+ var RHS$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(UnaryExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
10791
+ var exp = $2;
10792
+ if (!exp) return $skip;
10793
+ return exp;
10794
+ });
10654
10795
  var RHS$$ = [RHS$0, RHS$1];
10655
10796
  function RHS(ctx, state2) {
10656
10797
  return (0, import_lib2.$EVENT_C)(ctx, state2, "RHS", RHS$$);
@@ -10984,8 +11125,9 @@ var FatArrowBody$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N
10984
11125
  implicitlyReturned: true
10985
11126
  };
10986
11127
  });
10987
- var FatArrowBody$1 = NoCommaBracedOrEmptyBlock;
10988
- var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1];
11128
+ var FatArrowBody$1 = BracedObjectSingleLineStatements;
11129
+ var FatArrowBody$2 = NoCommaBracedOrEmptyBlock;
11130
+ var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1, FatArrowBody$2];
10989
11131
  function FatArrowBody(ctx, state2) {
10990
11132
  return (0, import_lib2.$EVENT_C)(ctx, state2, "FatArrowBody", FatArrowBody$$);
10991
11133
  }
@@ -11696,10 +11838,10 @@ var CallExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Super, Arguments
11696
11838
  children: [$1, ...$2, ...rest.flat()]
11697
11839
  });
11698
11840
  });
11699
- var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11841
+ var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, DynamicImportContents, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11700
11842
  return dynamizeImportDeclarationExpression($0);
11701
11843
  });
11702
- var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, NamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11844
+ var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, DynamicImportContents), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11703
11845
  var from = $1;
11704
11846
  var fws = $2;
11705
11847
  var i = $3;
@@ -13140,7 +13282,7 @@ var OperatorAssociativity$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
13140
13282
  function OperatorAssociativity(ctx, state2) {
13141
13283
  return (0, import_lib2.$EVENT)(ctx, state2, "OperatorAssociativity", OperatorAssociativity$0);
13142
13284
  }
13143
- var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, NoCommaBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
13285
+ var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, (0, import_lib2.$C)(BracedObjectSingleLineStatements, NoCommaBracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
13144
13286
  var async = $1;
13145
13287
  var parameters = $2;
13146
13288
  var returnType = $3;
@@ -13294,8 +13436,9 @@ var ThenBlock$0 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock),
13294
13436
  return value[1];
13295
13437
  });
13296
13438
  var ThenBlock$1 = ImplicitNestedBlock;
13297
- var ThenBlock$2 = SingleLineStatements;
13298
- var ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2];
13439
+ var ThenBlock$2 = ObjectSingleLineStatements;
13440
+ var ThenBlock$3 = SingleLineStatements;
13441
+ var ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2, ThenBlock$3];
13299
13442
  function ThenBlock(ctx, state2) {
13300
13443
  return (0, import_lib2.$EVENT_C)(ctx, state2, "ThenBlock", ThenBlock$$);
13301
13444
  }
@@ -13354,11 +13497,12 @@ var BlockOrEmptyStatement$$ = [BlockOrEmptyStatement$0, BlockOrEmptyStatement$1]
13354
13497
  function BlockOrEmptyStatement(ctx, state2) {
13355
13498
  return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmptyStatement", BlockOrEmptyStatement$$);
13356
13499
  }
13357
- var BlockOrEmpty$0 = Block;
13358
- var BlockOrEmpty$1 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
13500
+ var BlockOrEmpty$0 = ObjectSingleLineStatements;
13501
+ var BlockOrEmpty$1 = Block;
13502
+ var BlockOrEmpty$2 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
13359
13503
  return value[1];
13360
13504
  });
13361
- var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1];
13505
+ var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1, BlockOrEmpty$2];
13362
13506
  function BlockOrEmpty(ctx, state2) {
13363
13507
  return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmpty", BlockOrEmpty$$);
13364
13508
  }
@@ -13494,6 +13638,26 @@ var SingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidNewl
13494
13638
  function SingleLineStatements(ctx, state2) {
13495
13639
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineStatements", SingleLineStatements$0);
13496
13640
  }
13641
+ var ObjectSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Y)((0, import_lib2.$S)((0, import_lib2.$E)(_), BracedObjectLiteral)), SingleLineStatements), function($skip, $loc, $0, $1, $2) {
13642
+ var block = $2;
13643
+ if (block.bare && block.expressions.length === 1) {
13644
+ const expression = block.expressions[0][1];
13645
+ if (expression.type === "ParenthesizedExpression" && expression.implicit && expression.expression.type === "ObjectExpression") {
13646
+ block = { ...block, unwrapObject: true };
13647
+ }
13648
+ }
13649
+ return block;
13650
+ });
13651
+ function ObjectSingleLineStatements(ctx, state2) {
13652
+ return (0, import_lib2.$EVENT)(ctx, state2, "ObjectSingleLineStatements", ObjectSingleLineStatements$0);
13653
+ }
13654
+ var BracedObjectSingleLineStatements$0 = (0, import_lib2.$TV)(ObjectSingleLineStatements, function($skip, $loc, $0, $1) {
13655
+ var block = $0;
13656
+ return bracedBlock(block);
13657
+ });
13658
+ function BracedObjectSingleLineStatements(ctx, state2) {
13659
+ return (0, import_lib2.$EVENT)(ctx, state2, "BracedObjectSingleLineStatements", BracedObjectSingleLineStatements$0);
13660
+ }
13497
13661
  var PostfixedSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Q)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, SemicolonDelimiter)), (0, import_lib2.$E)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, (0, import_lib2.$E)(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
13498
13662
  var stmts = $1;
13499
13663
  var last = $2;
@@ -14344,7 +14508,8 @@ var PropertyDefinition$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14344
14508
  children: [ws, id],
14345
14509
  name: id,
14346
14510
  names: id.names,
14347
- value: id
14511
+ value: id,
14512
+ implicitName: true
14348
14513
  };
14349
14514
  });
14350
14515
  var PropertyDefinition$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
@@ -14403,7 +14568,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14403
14568
  if (refAssignment) {
14404
14569
  name = {
14405
14570
  type: "ComputedPropertyName",
14406
- children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)]
14571
+ children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)],
14572
+ implicit: true
14407
14573
  };
14408
14574
  value = {
14409
14575
  ...value,
@@ -14418,7 +14584,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14418
14584
  } else {
14419
14585
  name = {
14420
14586
  type: "ComputedPropertyName",
14421
- children: last.children
14587
+ children: last.children,
14588
+ implicit: true
14422
14589
  };
14423
14590
  }
14424
14591
  } else {
@@ -14431,7 +14598,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14431
14598
  children: [ws, name, ": ", processUnaryExpression(pre, value, post)],
14432
14599
  name,
14433
14600
  names: [],
14434
- value
14601
+ value,
14602
+ implicitName: true
14435
14603
  };
14436
14604
  });
14437
14605
  var PropertyDefinition$$ = [PropertyDefinition$0, PropertyDefinition$1, PropertyDefinition$2, PropertyDefinition$3, PropertyDefinition$4, PropertyDefinition$5];
@@ -14634,6 +14802,7 @@ function MethodDefinition(ctx, state2) {
14634
14802
  var MethodModifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(GetOrSet, (0, import_lib2.$E)(_), (0, import_lib2.$Y)(ClassElementName)), function($skip, $loc, $0, $1, $2, $3) {
14635
14803
  var kind = $1;
14636
14804
  var ws = $2;
14805
+ if (!ws) ws = " ";
14637
14806
  return {
14638
14807
  // no async or generator, because getters and setters can't be
14639
14808
  modifier: {
@@ -15351,7 +15520,7 @@ function ShouldExpressionize(ctx, state2) {
15351
15520
  var NoCommaStatement$0 = KeywordStatement;
15352
15521
  var NoCommaStatement$1 = VariableStatement;
15353
15522
  var NoCommaStatement$2 = IfStatement;
15354
- var NoCommaStatement$3 = IterationStatement;
15523
+ var NoCommaStatement$3 = IterationActualStatement;
15355
15524
  var NoCommaStatement$4 = SwitchStatement;
15356
15525
  var NoCommaStatement$5 = TryStatement;
15357
15526
  var NoCommaStatement$6 = EmptyStatement;
@@ -16383,8 +16552,8 @@ var SingleLineExpressionWithIndentedApplicationForbidden$0 = (0, import_lib2.$TS
16383
16552
  function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
16384
16553
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
16385
16554
  }
16386
- var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16387
- var exp = $3;
16555
+ var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication, RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
16556
+ var exp = $4;
16388
16557
  if (exp) return exp;
16389
16558
  return $skip;
16390
16559
  });
@@ -16561,6 +16730,33 @@ var NewlineBinaryOpAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0
16561
16730
  function NewlineBinaryOpAllowed(ctx, state2) {
16562
16731
  return (0, import_lib2.$EVENT)(ctx, state2, "NewlineBinaryOpAllowed", NewlineBinaryOpAllowed$0);
16563
16732
  }
16733
+ var AllowImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowImplicitFragment ""'), function($skip, $loc, $0, $1) {
16734
+ state.forbidImplicitFragment.push(false);
16735
+ });
16736
+ function AllowImplicitFragment(ctx, state2) {
16737
+ return (0, import_lib2.$EVENT)(ctx, state2, "AllowImplicitFragment", AllowImplicitFragment$0);
16738
+ }
16739
+ var ForbidImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ForbidImplicitFragment ""'), function($skip, $loc, $0, $1) {
16740
+ state.forbidImplicitFragment.push(true);
16741
+ });
16742
+ function ForbidImplicitFragment(ctx, state2) {
16743
+ return (0, import_lib2.$EVENT)(ctx, state2, "ForbidImplicitFragment", ForbidImplicitFragment$0);
16744
+ }
16745
+ var RestoreImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'RestoreImplicitFragment ""'), function($skip, $loc, $0, $1) {
16746
+ state.forbidImplicitFragment.pop();
16747
+ });
16748
+ function RestoreImplicitFragment(ctx, state2) {
16749
+ return (0, import_lib2.$EVENT)(ctx, state2, "RestoreImplicitFragment", RestoreImplicitFragment$0);
16750
+ }
16751
+ var ImplicitFragmentAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ImplicitFragmentAllowed ""'), function($skip, $loc, $0, $1) {
16752
+ if (config.verbose) {
16753
+ console.log("forbidImplicitFragment:", state.forbidImplicitFragment);
16754
+ }
16755
+ if (state.implicitFragmentForbidden) return $skip;
16756
+ });
16757
+ function ImplicitFragmentAllowed(ctx, state2) {
16758
+ return (0, import_lib2.$EVENT)(ctx, state2, "ImplicitFragmentAllowed", ImplicitFragmentAllowed$0);
16759
+ }
16564
16760
  var AllowPipeline$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowPipeline ""'), function($skip, $loc, $0, $1) {
16565
16761
  state.forbidPipeline.push(false);
16566
16762
  });
@@ -16588,11 +16784,11 @@ var PipelineAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Pipe
16588
16784
  function PipelineAllowed(ctx, state2) {
16589
16785
  return (0, import_lib2.$EVENT)(ctx, state2, "PipelineAllowed", PipelineAllowed$0);
16590
16786
  }
16591
- var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowPipeline);
16787
+ var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowImplicitFragment, AllowPipeline);
16592
16788
  function AllowAll(ctx, state2) {
16593
16789
  return (0, import_lib2.$EVENT)(ctx, state2, "AllowAll", AllowAll$0);
16594
16790
  }
16595
- var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestorePipeline);
16791
+ var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestoreImplicitFragment, RestorePipeline);
16596
16792
  function RestoreAll(ctx, state2) {
16597
16793
  return (0, import_lib2.$EVENT)(ctx, state2, "RestoreAll", RestoreAll$0);
16598
16794
  }
@@ -16695,7 +16891,11 @@ var MaybeNestedNonPipelineExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S
16695
16891
  if (!trailing) return expression;
16696
16892
  return [expression, trailing];
16697
16893
  });
16698
- var MaybeNestedNonPipelineExpression$1 = NonPipelineExpression;
16894
+ var MaybeNestedNonPipelineExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(NonPipelineExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16895
+ var expression = $2;
16896
+ if (!expression) return $skip;
16897
+ return expression;
16898
+ });
16699
16899
  var MaybeNestedNonPipelineExpression$$ = [MaybeNestedNonPipelineExpression$0, MaybeNestedNonPipelineExpression$1];
16700
16900
  function MaybeNestedNonPipelineExpression(ctx, state2) {
16701
16901
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedNonPipelineExpression", MaybeNestedNonPipelineExpression$$);
@@ -16707,7 +16907,11 @@ var MaybeNestedPostfixedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(
16707
16907
  if (!trailing) return expression;
16708
16908
  return [expression, trailing];
16709
16909
  });
16710
- var MaybeNestedPostfixedExpression$1 = PostfixedExpression;
16910
+ var MaybeNestedPostfixedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(PostfixedExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16911
+ var expression = $2;
16912
+ if (!expression) return $skip;
16913
+ return expression;
16914
+ });
16711
16915
  var MaybeNestedPostfixedExpression$$ = [MaybeNestedPostfixedExpression$0, MaybeNestedPostfixedExpression$1];
16712
16916
  function MaybeNestedPostfixedExpression(ctx, state2) {
16713
16917
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedPostfixedExpression", MaybeNestedPostfixedExpression$$);
@@ -16730,7 +16934,11 @@ var MaybeNestedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
16730
16934
  if (!trailing) return expression;
16731
16935
  return [expression, trailing];
16732
16936
  });
16733
- var MaybeNestedExpression$1 = Expression;
16937
+ var MaybeNestedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16938
+ var expression = $2;
16939
+ if (!expression) return $skip;
16940
+ return expression;
16941
+ });
16734
16942
  var MaybeNestedExpression$$ = [MaybeNestedExpression$0, MaybeNestedExpression$1];
16735
16943
  function MaybeNestedExpression(ctx, state2) {
16736
16944
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedExpression", MaybeNestedExpression$$);
@@ -16925,6 +17133,24 @@ var OperatorNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace,
16925
17133
  function OperatorNamedImports(ctx, state2) {
16926
17134
  return (0, import_lib2.$EVENT)(ctx, state2, "OperatorNamedImports", OperatorNamedImports$0);
16927
17135
  }
17136
+ var DynamicNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace, (0, import_lib2.$Q)(DynamicImportSpecifier), (0, import_lib2.$E)((0, import_lib2.$S)(__, Comma)), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17137
+ var specifiers = $2;
17138
+ return {
17139
+ type: "Declaration",
17140
+ children: $0,
17141
+ specifiers
17142
+ };
17143
+ });
17144
+ function DynamicNamedImports(ctx, state2) {
17145
+ return (0, import_lib2.$EVENT)(ctx, state2, "DynamicNamedImports", DynamicNamedImports$0);
17146
+ }
17147
+ var DynamicImportContents$0 = DynamicNamedImports;
17148
+ var DynamicImportContents$1 = IdentifierName;
17149
+ var DynamicImportContents$2 = Star;
17150
+ var DynamicImportContents$$ = [DynamicImportContents$0, DynamicImportContents$1, DynamicImportContents$2];
17151
+ function DynamicImportContents(ctx, state2) {
17152
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicImportContents", DynamicImportContents$$);
17153
+ }
16928
17154
  var FromClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(From, __, ModuleSpecifier), function($skip, $loc, $0, $1, $2, $3) {
16929
17155
  var module2 = $3;
16930
17156
  if (!Array.isArray(module2)) return $0;
@@ -16946,11 +17172,11 @@ var ImportAssertion$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2
16946
17172
  function ImportAssertion(ctx, state2) {
16947
17173
  return (0, import_lib2.$EVENT)(ctx, state2, "ImportAssertion", ImportAssertion$0);
16948
17174
  }
16949
- var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(__, TypeKeyword)), ImportSpecifier), function($skip, $loc, $0, $1, $2) {
16950
- if (!$1) return $2;
16951
- return { ts: true, children: $0, binding: $2.binding };
17175
+ var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, TypeKeyword, ImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
17176
+ return { ts: true, children: $0, binding: $3.binding };
16952
17177
  });
16953
- var TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
17178
+ var TypeAndImportSpecifier$1 = ImportSpecifier;
17179
+ var TypeAndImportSpecifier$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
16954
17180
  var ws = $1;
16955
17181
  var spec = $3;
16956
17182
  if (spec.binding.type !== "Identifier") {
@@ -16966,7 +17192,7 @@ var TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Oper
16966
17192
  ]
16967
17193
  };
16968
17194
  });
16969
- var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1];
17195
+ var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1, TypeAndImportSpecifier$2];
16970
17196
  function TypeAndImportSpecifier(ctx, state2) {
16971
17197
  return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeAndImportSpecifier", TypeAndImportSpecifier$$);
16972
17198
  }
@@ -17013,6 +17239,27 @@ var OperatorImportSpecifier$$ = [OperatorImportSpecifier$0, OperatorImportSpecif
17013
17239
  function OperatorImportSpecifier(ctx, state2) {
17014
17240
  return (0, import_lib2.$EVENT_C)(ctx, state2, "OperatorImportSpecifier", OperatorImportSpecifier$$);
17015
17241
  }
17242
+ var DynamicImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, (0, import_lib2.$E)((0, import_lib2.$S)(TypeKeyword, __, (0, import_lib2.$Y)(DynamicModuleExportName))), DynamicModuleExportName, (0, import_lib2.$E)((0, import_lib2.$S)(ImportAsToken, __, DynamicModuleExportName)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17243
+ var ts2 = $2;
17244
+ var source = $3;
17245
+ var binding = $4;
17246
+ return {
17247
+ source,
17248
+ binding: binding?.[2],
17249
+ ts: !!ts2,
17250
+ // true causes an error later
17251
+ children: $0
17252
+ };
17253
+ });
17254
+ function DynamicImportSpecifier(ctx, state2) {
17255
+ return (0, import_lib2.$EVENT)(ctx, state2, "DynamicImportSpecifier", DynamicImportSpecifier$0);
17256
+ }
17257
+ var DynamicModuleExportName$0 = ModuleExportName;
17258
+ var DynamicModuleExportName$1 = ComputedPropertyName;
17259
+ var DynamicModuleExportName$$ = [DynamicModuleExportName$0, DynamicModuleExportName$1];
17260
+ function DynamicModuleExportName(ctx, state2) {
17261
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicModuleExportName", DynamicModuleExportName$$);
17262
+ }
17016
17263
  var ImportAsToken$0 = (0, import_lib2.$S)(__, As);
17017
17264
  var ImportAsToken$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Loc, __, Colon, (0, import_lib2.$E)((0, import_lib2.$EXPECT)($L17, 'ImportAsToken " "'))), function($skip, $loc, $0, $1, $2, $3, $4) {
17018
17265
  var l = $1;
@@ -18304,7 +18551,7 @@ function SingleQuote(ctx, state2) {
18304
18551
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleQuote", SingleQuote$0);
18305
18552
  }
18306
18553
  var Star$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L75, 'Star "*"'), function($skip, $loc, $0, $1) {
18307
- return { $loc, token: $1 };
18554
+ return { $loc, token: $1, type: "Star" };
18308
18555
  });
18309
18556
  function Star(ctx, state2) {
18310
18557
  return (0, import_lib2.$EVENT)(ctx, state2, "Star", Star$0);
@@ -18457,18 +18704,22 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18457
18704
  function Yield(ctx, state2) {
18458
18705
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18459
18706
  }
18460
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18461
- const jsx = $2.length === 0 ? $1 : {
18707
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$E)((0, import_lib2.$S)(ImplicitFragmentAllowed, NestedBinaryOpAllowed, NewlineBinaryOpAllowed, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))))), function($skip, $loc, $0, $1, $2) {
18708
+ var first = $1;
18709
+ var rest = $2;
18710
+ rest = rest ? rest[3] : [];
18711
+ const jsx = rest.length === 0 ? first : {
18462
18712
  type: "JSXFragment",
18463
18713
  children: [
18464
18714
  "<>\n",
18465
18715
  state.currentIndent.token,
18466
- ...$0,
18716
+ first,
18717
+ ...rest,
18467
18718
  "\n",
18468
18719
  state.currentIndent.token,
18469
18720
  "</>"
18470
18721
  ],
18471
- jsxChildren: [$1].concat($2.map(([, tag]) => tag))
18722
+ jsxChildren: [first, ...rest.map(([, tag]) => tag)]
18472
18723
  };
18473
18724
  const type = typeOfJSX(jsx, config);
18474
18725
  return type ? [
@@ -19203,13 +19454,7 @@ var JSXAngleChild$0 = (0, import_lib2.$T)((0, import_lib2.$S)(CloseAngleBracket,
19203
19454
  function JSXAngleChild(ctx, state2) {
19204
19455
  return (0, import_lib2.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
19205
19456
  }
19206
- var JSXCodeChild$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
19207
- var open = $1;
19208
- var expression = $2;
19209
- var close = $3;
19210
- if (!expression) return $skip;
19211
- return [open, expression, close];
19212
- });
19457
+ var JSXCodeChild$0 = (0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace);
19213
19458
  function JSXCodeChild(ctx, state2) {
19214
19459
  return (0, import_lib2.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
19215
19460
  }
@@ -20873,6 +21118,7 @@ var Reset$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Reset ""'), fu
20873
21118
  state.forbidTrailingMemberProperty = [false];
20874
21119
  state.forbidNestedBinaryOp = [false];
20875
21120
  state.forbidNewlineBinaryOp = [false];
21121
+ state.forbidImplicitFragment = [false];
20876
21122
  state.forbidPipeline = [false];
20877
21123
  state.JSXTagStack = [void 0];
20878
21124
  state.operators = /* @__PURE__ */ new Map();
@@ -21154,6 +21400,7 @@ var state = {
21154
21400
  forbidTrailingMemberProperty: [false],
21155
21401
  forbidNestedBinaryOp: [false],
21156
21402
  forbidNewlineBinaryOp: [false],
21403
+ forbidImplicitFragment: [false],
21157
21404
  forbidPipeline: [false],
21158
21405
  JSXTagStack: [void 0]
21159
21406
  };
@@ -21205,6 +21452,12 @@ Object.defineProperties(state, {
21205
21452
  return s[s.length - 1];
21206
21453
  }
21207
21454
  },
21455
+ implicitFragmentForbidden: {
21456
+ get() {
21457
+ const { forbidImplicitFragment: s } = state;
21458
+ return s[s.length - 1];
21459
+ }
21460
+ },
21208
21461
  pipelineForbidden: {
21209
21462
  get() {
21210
21463
  const { forbidPipeline: s } = state;
@@ -21227,7 +21480,7 @@ function setOperatorBehavior(name, behavior) {
21227
21480
  }
21228
21481
  }
21229
21482
  function getStateKey() {
21230
- const stateInt = state.currentIndent.level % 256 << 8 | state.classImplicitCallForbidden << 7 | state.indentedApplicationForbidden << 6 | state.bracedApplicationForbidden << 5 | state.trailingMemberPropertyForbidden << 4 | state.nestedBinaryOpForbidden << 3 | state.newlineBinaryOpForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
21483
+ const stateInt = state.currentIndent.level % 256 << 9 | state.classImplicitCallForbidden << 8 | state.indentedApplicationForbidden << 7 | state.bracedApplicationForbidden << 6 | state.trailingMemberPropertyForbidden << 5 | state.nestedBinaryOpForbidden << 4 | state.newlineBinaryOpForbidden << 3 | state.implicitFragmentForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
21231
21484
  // since it is affected by the directive prologue and may be hit
21232
21485
  // by the EOL rule early in the parse. Later if we wanted to
21233
21486
  // allow block scoping of the compat directives we would need to
@@ -21327,7 +21580,7 @@ var SourceMap = class {
21327
21580
  const line = ref1[i1];
21328
21581
  results.push((() => {
21329
21582
  const results1 = [];
21330
- for (let i2 = 0, len1 = line.length; i2 < len1; i2++) {
21583
+ for (let i2 = 0, len12 = line.length; i2 < len12; i2++) {
21331
21584
  const entry = line[i2];
21332
21585
  if (entry.length === 4) {
21333
21586
  let [colDelta, sourceFileIndex, srcLine, srcCol] = entry;
@@ -21667,10 +21920,11 @@ var WorkerPool = class {
21667
21920
  const { Worker } = await import("node:worker_threads");
21668
21921
  const path = (await import("node:path")).default;
21669
21922
  const worker = new Worker(path.join(__dirname, "node-worker.mjs"));
21670
- worker.on("message", (response) => {
21923
+ worker.on("message", async (response) => {
21671
21924
  const callback = this.callbacks.get(response.id);
21672
21925
  this.callbacks.delete(response.id);
21673
21926
  if (response.error) {
21927
+ await new Promise((done) => setTimeout(done, 0));
21674
21928
  const message = `${response.error.name}: ${response.error.message}`;
21675
21929
  let ref;
21676
21930
  if (response.error.type in globalThis) {