@c4a/extract-ts 0.6.0-beta.8 → 0.6.1-beta.3

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -28
  3. package/index.js +216 -1963
  4. package/package.json +8 -1
package/index.js CHANGED
@@ -295,8 +295,8 @@ var require_directives = __commonJS((exports) => {
295
295
  if (parts.length < 2)
296
296
  return false;
297
297
  }
298
- const [handle2, prefix] = parts;
299
- this.tags[handle2] = prefix;
298
+ const [handle, prefix] = parts;
299
+ this.tags[handle] = prefix;
300
300
  return true;
301
301
  }
302
302
  case "%YAML": {
@@ -337,10 +337,10 @@ var require_directives = __commonJS((exports) => {
337
337
  onError("Verbatim tags must end with a >");
338
338
  return verbatim;
339
339
  }
340
- const [, handle2, suffix] = source2.match(/^(.*!)([^!]*)$/s);
340
+ const [, handle, suffix] = source2.match(/^(.*!)([^!]*)$/s);
341
341
  if (!suffix)
342
342
  onError(`The ${source2} tag has no suffix`);
343
- const prefix = this.tags[handle2];
343
+ const prefix = this.tags[handle];
344
344
  if (prefix) {
345
345
  try {
346
346
  return prefix + decodeURIComponent(suffix);
@@ -349,15 +349,15 @@ var require_directives = __commonJS((exports) => {
349
349
  return null;
350
350
  }
351
351
  }
352
- if (handle2 === "!")
352
+ if (handle === "!")
353
353
  return source2;
354
354
  onError(`Could not resolve tag: ${source2}`);
355
355
  return null;
356
356
  }
357
357
  tagString(tag) {
358
- for (const [handle2, prefix] of Object.entries(this.tags)) {
358
+ for (const [handle, prefix] of Object.entries(this.tags)) {
359
359
  if (tag.startsWith(prefix))
360
- return handle2 + escapeTagName(tag.substring(prefix.length));
360
+ return handle + escapeTagName(tag.substring(prefix.length));
361
361
  }
362
362
  return tag[0] === "!" ? tag : `!<${tag}>`;
363
363
  }
@@ -374,11 +374,11 @@ var require_directives = __commonJS((exports) => {
374
374
  tagNames = Object.keys(tags);
375
375
  } else
376
376
  tagNames = [];
377
- for (const [handle2, prefix] of tagEntries) {
378
- if (handle2 === "!!" && prefix === "tag:yaml.org,2002:")
377
+ for (const [handle, prefix] of tagEntries) {
378
+ if (handle === "!!" && prefix === "tag:yaml.org,2002:")
379
379
  continue;
380
380
  if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
381
- lines.push(`%TAG ${handle2} ${prefix}`);
381
+ lines.push(`%TAG ${handle} ${prefix}`);
382
382
  }
383
383
  return lines.join(`
384
384
  `);
@@ -567,10 +567,10 @@ var require_Alias = __commonJS((exports) => {
567
567
  var anchors = require_anchors();
568
568
  var visit = require_visit();
569
569
  var identity = require_identity();
570
- var Node2 = require_Node();
570
+ var Node = require_Node();
571
571
  var toJS = require_toJS();
572
572
 
573
- class Alias extends Node2.NodeBase {
573
+ class Alias extends Node.NodeBase {
574
574
  constructor(source2) {
575
575
  super(identity.ALIAS);
576
576
  this.source = source2;
@@ -673,11 +673,11 @@ var require_Alias = __commonJS((exports) => {
673
673
  // ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js
674
674
  var require_Scalar = __commonJS((exports) => {
675
675
  var identity = require_identity();
676
- var Node2 = require_Node();
676
+ var Node = require_Node();
677
677
  var toJS = require_toJS();
678
678
  var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
679
679
 
680
- class Scalar extends Node2.NodeBase {
680
+ class Scalar extends Node.NodeBase {
681
681
  constructor(value) {
682
682
  super(identity.SCALAR);
683
683
  this.value = value;
@@ -774,7 +774,7 @@ var require_createNode = __commonJS((exports) => {
774
774
  var require_Collection = __commonJS((exports) => {
775
775
  var createNode = require_createNode();
776
776
  var identity = require_identity();
777
- var Node2 = require_Node();
777
+ var Node = require_Node();
778
778
  function collectionFromPath(schema, path, value) {
779
779
  let v = value;
780
780
  for (let i = path.length - 1;i >= 0; --i) {
@@ -799,7 +799,7 @@ var require_Collection = __commonJS((exports) => {
799
799
  }
800
800
  var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
801
801
 
802
- class Collection extends Node2.NodeBase {
802
+ class Collection extends Node.NodeBase {
803
803
  constructor(type, schema) {
804
804
  super(type);
805
805
  Object.defineProperty(this, "schema", {
@@ -1016,10 +1016,10 @@ ${indent}${text.slice(fold + 1, end2)}`;
1016
1016
  }
1017
1017
  function consumeMoreIndentedLines(text, i, indent) {
1018
1018
  let end = i;
1019
- let start2 = i + 1;
1020
- let ch = text[start2];
1019
+ let start = i + 1;
1020
+ let ch = text[start];
1021
1021
  while (ch === " " || ch === "\t") {
1022
- if (i < start2 + indent) {
1022
+ if (i < start + indent) {
1023
1023
  ch = text[++i];
1024
1024
  } else {
1025
1025
  do {
@@ -1027,8 +1027,8 @@ ${indent}${text.slice(fold + 1, end2)}`;
1027
1027
  } while (ch && ch !== `
1028
1028
  `);
1029
1029
  end = i;
1030
- start2 = i + 1;
1031
- ch = text[start2];
1030
+ start = i + 1;
1031
+ ch = text[start];
1032
1032
  }
1033
1033
  }
1034
1034
  return end;
@@ -1056,13 +1056,13 @@ var require_stringifyString = __commonJS((exports) => {
1056
1056
  const strLen = str.length;
1057
1057
  if (strLen <= limit)
1058
1058
  return false;
1059
- for (let i = 0, start2 = 0;i < strLen; ++i) {
1059
+ for (let i = 0, start = 0;i < strLen; ++i) {
1060
1060
  if (str[i] === `
1061
1061
  `) {
1062
- if (i - start2 > limit)
1062
+ if (i - start > limit)
1063
1063
  return true;
1064
- start2 = i + 1;
1065
- if (strLen - start2 <= limit)
1064
+ start = i + 1;
1065
+ if (strLen - start <= limit)
1066
1066
  return false;
1067
1067
  }
1068
1068
  }
@@ -1076,19 +1076,19 @@ var require_stringifyString = __commonJS((exports) => {
1076
1076
  const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
1077
1077
  const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
1078
1078
  let str = "";
1079
- let start2 = 0;
1079
+ let start = 0;
1080
1080
  for (let i = 0, ch = json[i];ch; ch = json[++i]) {
1081
1081
  if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
1082
- str += json.slice(start2, i) + "\\ ";
1082
+ str += json.slice(start, i) + "\\ ";
1083
1083
  i += 1;
1084
- start2 = i;
1084
+ start = i;
1085
1085
  ch = "\\";
1086
1086
  }
1087
1087
  if (ch === "\\")
1088
1088
  switch (json[i + 1]) {
1089
1089
  case "u":
1090
1090
  {
1091
- str += json.slice(start2, i);
1091
+ str += json.slice(start, i);
1092
1092
  const code = json.substr(i + 2, 4);
1093
1093
  switch (code) {
1094
1094
  case "0000":
@@ -1122,14 +1122,14 @@ var require_stringifyString = __commonJS((exports) => {
1122
1122
  str += json.substr(i, 6);
1123
1123
  }
1124
1124
  i += 5;
1125
- start2 = i + 1;
1125
+ start = i + 1;
1126
1126
  }
1127
1127
  break;
1128
1128
  case "n":
1129
1129
  if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
1130
1130
  i += 1;
1131
1131
  } else {
1132
- str += json.slice(start2, i) + `
1132
+ str += json.slice(start, i) + `
1133
1133
 
1134
1134
  `;
1135
1135
  while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
@@ -1141,14 +1141,14 @@ var require_stringifyString = __commonJS((exports) => {
1141
1141
  if (json[i + 2] === " ")
1142
1142
  str += "\\";
1143
1143
  i += 1;
1144
- start2 = i + 1;
1144
+ start = i + 1;
1145
1145
  }
1146
1146
  break;
1147
1147
  default:
1148
1148
  i += 1;
1149
1149
  }
1150
1150
  }
1151
- str = start2 ? str + json.slice(start2) : json;
1151
+ str = start ? str + json.slice(start) : json;
1152
1152
  return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
1153
1153
  }
1154
1154
  function singleQuotedString(value, ctx) {
@@ -1237,10 +1237,10 @@ ${indent}`) + "'";
1237
1237
  else
1238
1238
  break;
1239
1239
  }
1240
- let start2 = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
1241
- if (start2) {
1242
- value = value.substring(start2.length);
1243
- start2 = start2.replace(/\n+/g, `$&${indent}`);
1240
+ let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
1241
+ if (start) {
1242
+ value = value.substring(start.length);
1243
+ start = start.replace(/\n+/g, `$&${indent}`);
1244
1244
  }
1245
1245
  const indentSize = indent ? "2" : "1";
1246
1246
  let header = (startWithSpace ? indentSize : "") + chomp;
@@ -1259,14 +1259,14 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/
1259
1259
  literalFallback = true;
1260
1260
  };
1261
1261
  }
1262
- const body2 = foldFlowLines.foldFlowLines(`${start2}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
1262
+ const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
1263
1263
  if (!literalFallback)
1264
1264
  return `>${header}
1265
- ${indent}${body2}`;
1265
+ ${indent}${body}`;
1266
1266
  }
1267
1267
  value = value.replace(/\n+/g, `$&${indent}`);
1268
1268
  return `|${header}
1269
- ${indent}${start2}${value}${end}`;
1269
+ ${indent}${start}${value}${end}`;
1270
1270
  }
1271
1271
  function plainString(item, ctx, onComment, onChompKeep) {
1272
1272
  const { type, value } = item;
@@ -1878,16 +1878,16 @@ ${indent}${line}` : `
1878
1878
  lines.push(str);
1879
1879
  linesAtValue = lines.length;
1880
1880
  }
1881
- const { start: start2, end } = flowChars;
1881
+ const { start, end } = flowChars;
1882
1882
  if (lines.length === 0) {
1883
- return start2 + end;
1883
+ return start + end;
1884
1884
  } else {
1885
1885
  if (!reqNewline) {
1886
1886
  const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
1887
1887
  reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
1888
1888
  }
1889
1889
  if (reqNewline) {
1890
- let str = start2;
1890
+ let str = start;
1891
1891
  for (const line of lines)
1892
1892
  str += line ? `
1893
1893
  ${indentStep}${indent}${line}` : `
@@ -1895,7 +1895,7 @@ ${indentStep}${indent}${line}` : `
1895
1895
  return `${str}
1896
1896
  ${indent}${end}`;
1897
1897
  } else {
1898
- return `${start2}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
1898
+ return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
1899
1899
  }
1900
1900
  }
1901
1901
  }
@@ -2423,7 +2423,7 @@ var require_binary = __commonJS((exports) => {
2423
2423
  var node_buffer = __require("buffer");
2424
2424
  var Scalar = require_Scalar();
2425
2425
  var stringifyString = require_stringifyString();
2426
- var binary2 = {
2426
+ var binary = {
2427
2427
  identify: (value) => value instanceof Uint8Array,
2428
2428
  default: false,
2429
2429
  tag: "tag:yaml.org,2002:binary",
@@ -2432,10 +2432,10 @@ var require_binary = __commonJS((exports) => {
2432
2432
  return node_buffer.Buffer.from(src, "base64");
2433
2433
  } else if (typeof atob === "function") {
2434
2434
  const str = atob(src.replace(/[\n\r]/g, ""));
2435
- const buffer2 = new Uint8Array(str.length);
2435
+ const buffer = new Uint8Array(str.length);
2436
2436
  for (let i = 0;i < str.length; ++i)
2437
- buffer2[i] = str.charCodeAt(i);
2438
- return buffer2;
2437
+ buffer[i] = str.charCodeAt(i);
2438
+ return buffer;
2439
2439
  } else {
2440
2440
  onError("This environment does not support reading binary tags; either Buffer or atob is required");
2441
2441
  return src;
@@ -2470,7 +2470,7 @@ var require_binary = __commonJS((exports) => {
2470
2470
  return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
2471
2471
  }
2472
2472
  };
2473
- exports.binary = binary2;
2473
+ exports.binary = binary;
2474
2474
  });
2475
2475
 
2476
2476
  // ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
@@ -2942,7 +2942,7 @@ var require_schema3 = __commonJS((exports) => {
2942
2942
  var _null = require_null();
2943
2943
  var seq = require_seq();
2944
2944
  var string = require_string();
2945
- var binary2 = require_binary();
2945
+ var binary = require_binary();
2946
2946
  var bool = require_bool2();
2947
2947
  var float = require_float2();
2948
2948
  var int = require_int2();
@@ -2965,7 +2965,7 @@ var require_schema3 = __commonJS((exports) => {
2965
2965
  float.floatNaN,
2966
2966
  float.floatExp,
2967
2967
  float.float,
2968
- binary2.binary,
2968
+ binary.binary,
2969
2969
  merge.merge,
2970
2970
  omap.omap,
2971
2971
  pairs.pairs,
@@ -2988,7 +2988,7 @@ var require_tags = __commonJS((exports) => {
2988
2988
  var int = require_int();
2989
2989
  var schema = require_schema();
2990
2990
  var schema$1 = require_schema2();
2991
- var binary2 = require_binary();
2991
+ var binary = require_binary();
2992
2992
  var merge = require_merge();
2993
2993
  var omap = require_omap();
2994
2994
  var pairs = require_pairs();
@@ -3003,7 +3003,7 @@ var require_tags = __commonJS((exports) => {
3003
3003
  ["yaml-1.1", schema$2.schema]
3004
3004
  ]);
3005
3005
  var tagsByName = {
3006
- binary: binary2.binary,
3006
+ binary: binary.binary,
3007
3007
  bool: bool.boolTag,
3008
3008
  float: float.float,
3009
3009
  floatExp: float.floatExp,
@@ -3023,7 +3023,7 @@ var require_tags = __commonJS((exports) => {
3023
3023
  timestamp: timestamp.timestamp
3024
3024
  };
3025
3025
  var coreKnownTags = {
3026
- "tag:yaml.org,2002:binary": binary2.binary,
3026
+ "tag:yaml.org,2002:binary": binary.binary,
3027
3027
  "tag:yaml.org,2002:merge": merge.merge,
3028
3028
  "tag:yaml.org,2002:omap": omap.omap,
3029
3029
  "tag:yaml.org,2002:pairs": pairs.pairs,
@@ -3138,13 +3138,13 @@ var require_stringifyDocument = __commonJS((exports) => {
3138
3138
  contentComment = doc.contents.comment;
3139
3139
  }
3140
3140
  const onChompKeep = contentComment ? undefined : () => chompKeep = true;
3141
- let body2 = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
3141
+ let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
3142
3142
  if (contentComment)
3143
- body2 += stringifyComment.lineComment(body2, "", commentString(contentComment));
3144
- if ((body2[0] === "|" || body2[0] === ">") && lines[lines.length - 1] === "---") {
3145
- lines[lines.length - 1] = `--- ${body2}`;
3143
+ body += stringifyComment.lineComment(body, "", commentString(contentComment));
3144
+ if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
3145
+ lines[lines.length - 1] = `--- ${body}`;
3146
3146
  } else
3147
- lines.push(body2);
3147
+ lines.push(body);
3148
3148
  } else {
3149
3149
  lines.push(stringify.stringify(doc.contents, ctx));
3150
3150
  }
@@ -3494,7 +3494,7 @@ var require_resolve_props = __commonJS((exports) => {
3494
3494
  let newlineAfterProp = null;
3495
3495
  let comma = null;
3496
3496
  let found = null;
3497
- let start2 = null;
3497
+ let start = null;
3498
3498
  for (const token of tokens) {
3499
3499
  if (reqSpace) {
3500
3500
  if (token.type !== "space" && token.type !== "newline" && token.type !== "comma")
@@ -3546,7 +3546,7 @@ var require_resolve_props = __commonJS((exports) => {
3546
3546
  if (token.source.endsWith(":"))
3547
3547
  onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
3548
3548
  anchor = token;
3549
- start2 ?? (start2 = token.offset);
3549
+ start ?? (start = token.offset);
3550
3550
  atNewline = false;
3551
3551
  hasSpace = false;
3552
3552
  reqSpace = true;
@@ -3555,7 +3555,7 @@ var require_resolve_props = __commonJS((exports) => {
3555
3555
  if (tag)
3556
3556
  onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
3557
3557
  tag = token;
3558
- start2 ?? (start2 = token.offset);
3558
+ start ?? (start = token.offset);
3559
3559
  atNewline = false;
3560
3560
  hasSpace = false;
3561
3561
  reqSpace = true;
@@ -3602,7 +3602,7 @@ var require_resolve_props = __commonJS((exports) => {
3602
3602
  tag,
3603
3603
  newlineAfterProp,
3604
3604
  end,
3605
- start: start2 ?? end
3605
+ start: start ?? end
3606
3606
  };
3607
3607
  }
3608
3608
  exports.resolveProps = resolveProps;
@@ -3693,8 +3693,8 @@ var require_resolve_block_map = __commonJS((exports) => {
3693
3693
  let offset = bm.offset;
3694
3694
  let commentEnd = null;
3695
3695
  for (const collItem of bm.items) {
3696
- const { start: start2, key, sep, value } = collItem;
3697
- const keyProps = resolveProps.resolveProps(start2, {
3696
+ const { start, key, sep, value } = collItem;
3697
+ const keyProps = resolveProps.resolveProps(start, {
3698
3698
  indicator: "explicit-key-ind",
3699
3699
  next: key ?? sep?.[0],
3700
3700
  offset,
@@ -3722,14 +3722,14 @@ var require_resolve_block_map = __commonJS((exports) => {
3722
3722
  continue;
3723
3723
  }
3724
3724
  if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
3725
- onError(key ?? start2[start2.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
3725
+ onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
3726
3726
  }
3727
3727
  } else if (keyProps.found?.indent !== bm.indent) {
3728
3728
  onError(offset, "BAD_INDENT", startColMsg);
3729
3729
  }
3730
3730
  ctx.atKey = true;
3731
3731
  const keyStart = keyProps.end;
3732
- const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start2, null, keyProps, onError);
3732
+ const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
3733
3733
  if (ctx.schema.compat)
3734
3734
  utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
3735
3735
  ctx.atKey = false;
@@ -3797,8 +3797,8 @@ var require_resolve_block_seq = __commonJS((exports) => {
3797
3797
  ctx.atKey = false;
3798
3798
  let offset = bs.offset;
3799
3799
  let commentEnd = null;
3800
- for (const { start: start2, value } of bs.items) {
3801
- const props = resolveProps.resolveProps(start2, {
3800
+ for (const { start, value } of bs.items) {
3801
+ const props = resolveProps.resolveProps(start, {
3802
3802
  indicator: "seq-item-ind",
3803
3803
  next: value,
3804
3804
  offset,
@@ -3819,7 +3819,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
3819
3819
  continue;
3820
3820
  }
3821
3821
  }
3822
- const node2 = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start2, null, props, onError);
3822
+ const node2 = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
3823
3823
  if (ctx.schema.compat)
3824
3824
  utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
3825
3825
  offset = node2.range[2];
@@ -3897,8 +3897,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
3897
3897
  let offset = fc.offset + fc.start.source.length;
3898
3898
  for (let i = 0;i < fc.items.length; ++i) {
3899
3899
  const collItem = fc.items[i];
3900
- const { start: start2, key, sep, value } = collItem;
3901
- const props = resolveProps.resolveProps(start2, {
3900
+ const { start, key, sep, value } = collItem;
3901
+ const props = resolveProps.resolveProps(start, {
3902
3902
  flow: fcName,
3903
3903
  indicator: "explicit-key-ind",
3904
3904
  next: key ?? sep?.[0],
@@ -3935,7 +3935,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
3935
3935
  if (props.comment) {
3936
3936
  let prevItemComment = "";
3937
3937
  loop:
3938
- for (const st of start2) {
3938
+ for (const st of start) {
3939
3939
  switch (st.type) {
3940
3940
  case "comma":
3941
3941
  case "space":
@@ -3969,7 +3969,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
3969
3969
  } else {
3970
3970
  ctx.atKey = true;
3971
3971
  const keyStart = props.end;
3972
- const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start2, null, props, onError);
3972
+ const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError);
3973
3973
  if (isBlock(key))
3974
3974
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
3975
3975
  ctx.atKey = false;
@@ -4128,10 +4128,10 @@ var require_compose_collection = __commonJS((exports) => {
4128
4128
  var require_resolve_block_scalar = __commonJS((exports) => {
4129
4129
  var Scalar = require_Scalar();
4130
4130
  function resolveBlockScalar(ctx, scalar, onError) {
4131
- const start2 = scalar.offset;
4131
+ const start = scalar.offset;
4132
4132
  const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
4133
4133
  if (!header)
4134
- return { value: "", type: null, comment: "", range: [start2, start2, start2] };
4134
+ return { value: "", type: null, comment: "", range: [start, start, start] };
4135
4135
  const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
4136
4136
  const lines = scalar.source ? splitLines(scalar.source) : [];
4137
4137
  let chompStart = lines.length;
@@ -4145,10 +4145,10 @@ var require_resolve_block_scalar = __commonJS((exports) => {
4145
4145
  if (chompStart === 0) {
4146
4146
  const value2 = header.chomp === "+" && lines.length > 0 ? `
4147
4147
  `.repeat(Math.max(1, lines.length - 1)) : "";
4148
- let end2 = start2 + header.length;
4148
+ let end2 = start + header.length;
4149
4149
  if (scalar.source)
4150
4150
  end2 += scalar.source.length;
4151
- return { value: value2, type, comment: header.comment, range: [start2, end2, end2] };
4151
+ return { value: value2, type, comment: header.comment, range: [start, end2, end2] };
4152
4152
  }
4153
4153
  let trimIndent = scalar.indent + header.indent;
4154
4154
  let offset = scalar.offset + header.length;
@@ -4243,8 +4243,8 @@ var require_resolve_block_scalar = __commonJS((exports) => {
4243
4243
  value += `
4244
4244
  `;
4245
4245
  }
4246
- const end = start2 + header.length + scalar.source.length;
4247
- return { value, type, comment: header.comment, range: [start2, end, end] };
4246
+ const end = start + header.length + scalar.source.length;
4247
+ return { value, type, comment: header.comment, range: [start, end, end] };
4248
4248
  }
4249
4249
  function parseBlockScalarHeader({ offset, props }, strict, onError) {
4250
4250
  if (props[0].type !== "block-scalar-header") {
@@ -4742,7 +4742,7 @@ var require_compose_doc = __commonJS((exports) => {
4742
4742
  var composeNode = require_compose_node();
4743
4743
  var resolveEnd = require_resolve_end();
4744
4744
  var resolveProps = require_resolve_props();
4745
- function composeDoc(options, directives, { offset, start: start2, value, end }, onError) {
4745
+ function composeDoc(options, directives, { offset, start, value, end }, onError) {
4746
4746
  const opts = Object.assign({ _directives: directives }, options);
4747
4747
  const doc = new Document.Document(undefined, opts);
4748
4748
  const ctx = {
@@ -4752,7 +4752,7 @@ var require_compose_doc = __commonJS((exports) => {
4752
4752
  options: doc.options,
4753
4753
  schema: doc.schema
4754
4754
  };
4755
- const props = resolveProps.resolveProps(start2, {
4755
+ const props = resolveProps.resolveProps(start, {
4756
4756
  indicator: "doc-start",
4757
4757
  next: value ?? end?.[0],
4758
4758
  offset,
@@ -4765,7 +4765,7 @@ var require_compose_doc = __commonJS((exports) => {
4765
4765
  if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
4766
4766
  onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
4767
4767
  }
4768
- doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start2, null, props, onError);
4768
+ doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
4769
4769
  const contentEnd = doc.contents.range[2];
4770
4770
  const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
4771
4771
  if (re.comment)
@@ -5009,7 +5009,7 @@ var require_cst_scalar = __commonJS((exports) => {
5009
5009
  const he = source2.indexOf(`
5010
5010
  `);
5011
5011
  const head = source2.substring(0, he);
5012
- const body2 = source2.substring(he + 1) + `
5012
+ const body = source2.substring(he + 1) + `
5013
5013
  `;
5014
5014
  const props = [
5015
5015
  { type: "block-scalar-header", offset, indent, source: head }
@@ -5017,7 +5017,7 @@ var require_cst_scalar = __commonJS((exports) => {
5017
5017
  if (!addEndtoBlockProps(props, end))
5018
5018
  props.push({ type: "newline", offset: -1, indent, source: `
5019
5019
  ` });
5020
- return { type: "block-scalar", offset, indent, props, source: body2 };
5020
+ return { type: "block-scalar", offset, indent, props, source: body };
5021
5021
  }
5022
5022
  case '"':
5023
5023
  return { type: "double-quoted-scalar", offset, indent, source: source2, end };
@@ -5075,14 +5075,14 @@ var require_cst_scalar = __commonJS((exports) => {
5075
5075
  const he = source2.indexOf(`
5076
5076
  `);
5077
5077
  const head = source2.substring(0, he);
5078
- const body2 = source2.substring(he + 1) + `
5078
+ const body = source2.substring(he + 1) + `
5079
5079
  `;
5080
5080
  if (token.type === "block-scalar") {
5081
5081
  const header = token.props[0];
5082
5082
  if (header.type !== "block-scalar-header")
5083
5083
  throw new Error("Invalid block scalar header");
5084
5084
  header.source = head;
5085
- token.source = body2;
5085
+ token.source = body;
5086
5086
  } else {
5087
5087
  const { offset } = token;
5088
5088
  const indent = "indent" in token ? token.indent : -1;
@@ -5095,7 +5095,7 @@ var require_cst_scalar = __commonJS((exports) => {
5095
5095
  for (const key of Object.keys(token))
5096
5096
  if (key !== "type" && key !== "offset")
5097
5097
  delete token[key];
5098
- Object.assign(token, { type: "block-scalar", indent, props, source: body2 });
5098
+ Object.assign(token, { type: "block-scalar", indent, props, source: body });
5099
5099
  }
5100
5100
  }
5101
5101
  function addEndtoBlockProps(props, end) {
@@ -5197,9 +5197,9 @@ var require_cst_stringify = __commonJS((exports) => {
5197
5197
  }
5198
5198
  }
5199
5199
  }
5200
- function stringifyItem({ start: start2, key, sep, value }) {
5200
+ function stringifyItem({ start, key, sep, value }) {
5201
5201
  let res = "";
5202
- for (const st of start2)
5202
+ for (const st of start)
5203
5203
  res += st.source;
5204
5204
  if (key)
5205
5205
  res += stringifyToken(key);
@@ -5979,8 +5979,8 @@ var require_line_counter = __commonJS((exports) => {
5979
5979
  return { line: low + 1, col: 1 };
5980
5980
  if (low === 0)
5981
5981
  return { line: 0, col: offset };
5982
- const start2 = this.lineStarts[low - 1];
5983
- return { line: low, col: offset - start2 + 1 };
5982
+ const start = this.lineStarts[low - 1];
5983
+ return { line: low, col: offset - start + 1 };
5984
5984
  };
5985
5985
  }
5986
5986
  }
@@ -6075,7 +6075,7 @@ var require_parser = __commonJS((exports) => {
6075
6075
  }
6076
6076
  }
6077
6077
 
6078
- class Parser2 {
6078
+ class Parser {
6079
6079
  constructor(onNewLine) {
6080
6080
  this.atNewLine = true;
6081
6081
  this.atScalar = false;
@@ -6333,7 +6333,7 @@ var require_parser = __commonJS((exports) => {
6333
6333
  *scalar(scalar) {
6334
6334
  if (this.type === "map-value-ind") {
6335
6335
  const prev = getPrevProps(this.peek(2));
6336
- const start2 = getFirstKeyStartProps(prev);
6336
+ const start = getFirstKeyStartProps(prev);
6337
6337
  let sep;
6338
6338
  if (scalar.end) {
6339
6339
  sep = scalar.end;
@@ -6345,7 +6345,7 @@ var require_parser = __commonJS((exports) => {
6345
6345
  type: "block-map",
6346
6346
  offset: scalar.offset,
6347
6347
  indent: scalar.indent,
6348
- items: [{ start: start2, key: scalar, sep }]
6348
+ items: [{ start, key: scalar, sep }]
6349
6349
  };
6350
6350
  this.onKeyLine = true;
6351
6351
  this.stack[this.stack.length - 1] = map;
@@ -6421,7 +6421,7 @@ var require_parser = __commonJS((exports) => {
6421
6421
  if (this.indent >= map.indent) {
6422
6422
  const atMapIndent = !this.onKeyLine && this.indent === map.indent;
6423
6423
  const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
6424
- let start2 = [];
6424
+ let start = [];
6425
6425
  if (atNextItem && it.sep && !it.value) {
6426
6426
  const nl = [];
6427
6427
  for (let i = 0;i < it.sep.length; ++i) {
@@ -6441,14 +6441,14 @@ var require_parser = __commonJS((exports) => {
6441
6441
  }
6442
6442
  }
6443
6443
  if (nl.length >= 2)
6444
- start2 = it.sep.splice(nl[1]);
6444
+ start = it.sep.splice(nl[1]);
6445
6445
  }
6446
6446
  switch (this.type) {
6447
6447
  case "anchor":
6448
6448
  case "tag":
6449
6449
  if (atNextItem || it.value) {
6450
- start2.push(this.sourceToken);
6451
- map.items.push({ start: start2 });
6450
+ start.push(this.sourceToken);
6451
+ map.items.push({ start });
6452
6452
  this.onKeyLine = true;
6453
6453
  } else if (it.sep) {
6454
6454
  it.sep.push(this.sourceToken);
@@ -6461,8 +6461,8 @@ var require_parser = __commonJS((exports) => {
6461
6461
  it.start.push(this.sourceToken);
6462
6462
  it.explicitKey = true;
6463
6463
  } else if (atNextItem || it.value) {
6464
- start2.push(this.sourceToken);
6465
- map.items.push({ start: start2, explicitKey: true });
6464
+ start.push(this.sourceToken);
6465
+ map.items.push({ start, explicitKey: true });
6466
6466
  } else {
6467
6467
  this.stack.push({
6468
6468
  type: "block-map",
@@ -6479,12 +6479,12 @@ var require_parser = __commonJS((exports) => {
6479
6479
  if (includesToken(it.start, "newline")) {
6480
6480
  Object.assign(it, { key: null, sep: [this.sourceToken] });
6481
6481
  } else {
6482
- const start3 = getFirstKeyStartProps(it.start);
6482
+ const start2 = getFirstKeyStartProps(it.start);
6483
6483
  this.stack.push({
6484
6484
  type: "block-map",
6485
6485
  offset: this.offset,
6486
6486
  indent: this.indent,
6487
- items: [{ start: start3, key: null, sep: [this.sourceToken] }]
6487
+ items: [{ start: start2, key: null, sep: [this.sourceToken] }]
6488
6488
  });
6489
6489
  }
6490
6490
  } else if (it.value) {
@@ -6494,10 +6494,10 @@ var require_parser = __commonJS((exports) => {
6494
6494
  type: "block-map",
6495
6495
  offset: this.offset,
6496
6496
  indent: this.indent,
6497
- items: [{ start: start2, key: null, sep: [this.sourceToken] }]
6497
+ items: [{ start, key: null, sep: [this.sourceToken] }]
6498
6498
  });
6499
6499
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
6500
- const start3 = getFirstKeyStartProps(it.start);
6500
+ const start2 = getFirstKeyStartProps(it.start);
6501
6501
  const key = it.key;
6502
6502
  const sep = it.sep;
6503
6503
  sep.push(this.sourceToken);
@@ -6507,10 +6507,10 @@ var require_parser = __commonJS((exports) => {
6507
6507
  type: "block-map",
6508
6508
  offset: this.offset,
6509
6509
  indent: this.indent,
6510
- items: [{ start: start3, key, sep }]
6510
+ items: [{ start: start2, key, sep }]
6511
6511
  });
6512
- } else if (start2.length > 0) {
6513
- it.sep = it.sep.concat(start2, this.sourceToken);
6512
+ } else if (start.length > 0) {
6513
+ it.sep = it.sep.concat(start, this.sourceToken);
6514
6514
  } else {
6515
6515
  it.sep.push(this.sourceToken);
6516
6516
  }
@@ -6518,7 +6518,7 @@ var require_parser = __commonJS((exports) => {
6518
6518
  if (!it.sep) {
6519
6519
  Object.assign(it, { key: null, sep: [this.sourceToken] });
6520
6520
  } else if (it.value || atNextItem) {
6521
- map.items.push({ start: start2, key: null, sep: [this.sourceToken] });
6521
+ map.items.push({ start, key: null, sep: [this.sourceToken] });
6522
6522
  } else if (includesToken(it.sep, "map-value-ind")) {
6523
6523
  this.stack.push({
6524
6524
  type: "block-map",
@@ -6536,14 +6536,14 @@ var require_parser = __commonJS((exports) => {
6536
6536
  case "scalar":
6537
6537
  case "single-quoted-scalar":
6538
6538
  case "double-quoted-scalar": {
6539
- const fs2 = this.flowScalar(this.type);
6539
+ const fs = this.flowScalar(this.type);
6540
6540
  if (atNextItem || it.value) {
6541
- map.items.push({ start: start2, key: fs2, sep: [] });
6541
+ map.items.push({ start, key: fs, sep: [] });
6542
6542
  this.onKeyLine = true;
6543
6543
  } else if (it.sep) {
6544
- this.stack.push(fs2);
6544
+ this.stack.push(fs);
6545
6545
  } else {
6546
- Object.assign(it, { key: fs2, sep: [] });
6546
+ Object.assign(it, { key: fs, sep: [] });
6547
6547
  this.onKeyLine = true;
6548
6548
  }
6549
6549
  return;
@@ -6562,7 +6562,7 @@ var require_parser = __commonJS((exports) => {
6562
6562
  return;
6563
6563
  }
6564
6564
  } else if (atMapIndent) {
6565
- map.items.push({ start: start2 });
6565
+ map.items.push({ start });
6566
6566
  }
6567
6567
  this.stack.push(bv);
6568
6568
  return;
@@ -6671,13 +6671,13 @@ var require_parser = __commonJS((exports) => {
6671
6671
  case "scalar":
6672
6672
  case "single-quoted-scalar":
6673
6673
  case "double-quoted-scalar": {
6674
- const fs2 = this.flowScalar(this.type);
6674
+ const fs = this.flowScalar(this.type);
6675
6675
  if (!it || it.value)
6676
- fc.items.push({ start: [], key: fs2, sep: [] });
6676
+ fc.items.push({ start: [], key: fs, sep: [] });
6677
6677
  else if (it.sep)
6678
- this.stack.push(fs2);
6678
+ this.stack.push(fs);
6679
6679
  else
6680
- Object.assign(it, { key: fs2, sep: [] });
6680
+ Object.assign(it, { key: fs, sep: [] });
6681
6681
  return;
6682
6682
  }
6683
6683
  case "flow-map-end":
@@ -6699,7 +6699,7 @@ var require_parser = __commonJS((exports) => {
6699
6699
  yield* this.step();
6700
6700
  } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
6701
6701
  const prev = getPrevProps(parent);
6702
- const start2 = getFirstKeyStartProps(prev);
6702
+ const start = getFirstKeyStartProps(prev);
6703
6703
  fixFlowSeqItems(fc);
6704
6704
  const sep = fc.end.splice(1, fc.end.length);
6705
6705
  sep.push(this.sourceToken);
@@ -6707,7 +6707,7 @@ var require_parser = __commonJS((exports) => {
6707
6707
  type: "block-map",
6708
6708
  offset: fc.offset,
6709
6709
  indent: fc.indent,
6710
- items: [{ start: start2, key: fc, sep }]
6710
+ items: [{ start, key: fc, sep }]
6711
6711
  };
6712
6712
  this.onKeyLine = true;
6713
6713
  this.stack[this.stack.length - 1] = map;
@@ -6768,35 +6768,35 @@ var require_parser = __commonJS((exports) => {
6768
6768
  case "explicit-key-ind": {
6769
6769
  this.onKeyLine = true;
6770
6770
  const prev = getPrevProps(parent);
6771
- const start2 = getFirstKeyStartProps(prev);
6772
- start2.push(this.sourceToken);
6771
+ const start = getFirstKeyStartProps(prev);
6772
+ start.push(this.sourceToken);
6773
6773
  return {
6774
6774
  type: "block-map",
6775
6775
  offset: this.offset,
6776
6776
  indent: this.indent,
6777
- items: [{ start: start2, explicitKey: true }]
6777
+ items: [{ start, explicitKey: true }]
6778
6778
  };
6779
6779
  }
6780
6780
  case "map-value-ind": {
6781
6781
  this.onKeyLine = true;
6782
6782
  const prev = getPrevProps(parent);
6783
- const start2 = getFirstKeyStartProps(prev);
6783
+ const start = getFirstKeyStartProps(prev);
6784
6784
  return {
6785
6785
  type: "block-map",
6786
6786
  offset: this.offset,
6787
6787
  indent: this.indent,
6788
- items: [{ start: start2, key: null, sep: [this.sourceToken] }]
6788
+ items: [{ start, key: null, sep: [this.sourceToken] }]
6789
6789
  };
6790
6790
  }
6791
6791
  }
6792
6792
  return null;
6793
6793
  }
6794
- atIndentedComment(start2, indent) {
6794
+ atIndentedComment(start, indent) {
6795
6795
  if (this.type !== "comment")
6796
6796
  return false;
6797
6797
  if (this.indent <= indent)
6798
6798
  return false;
6799
- return start2.every((st) => st.type === "newline" || st.type === "space");
6799
+ return start.every((st) => st.type === "newline" || st.type === "space");
6800
6800
  }
6801
6801
  *documentEnd(docEnd) {
6802
6802
  if (this.type !== "doc-mode") {
@@ -6833,7 +6833,7 @@ var require_parser = __commonJS((exports) => {
6833
6833
  }
6834
6834
  }
6835
6835
  }
6836
- exports.Parser = Parser2;
6836
+ exports.Parser = Parser;
6837
6837
  });
6838
6838
 
6839
6839
  // ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/public-api.js
@@ -6979,1753 +6979,6 @@ var require_dist = __commonJS((exports) => {
6979
6979
  exports.visitAsync = visit.visitAsync;
6980
6980
  });
6981
6981
 
6982
- // ../../node_modules/.bun/web-tree-sitter@0.20.8/node_modules/web-tree-sitter/tree-sitter.js
6983
- var require_tree_sitter = __commonJS((exports, module2) => {
6984
- var __dirname = "/Users/bytedance/github/c4a/context/node_modules/.bun/web-tree-sitter@0.20.8/node_modules/web-tree-sitter";
6985
- var Module = Module !== undefined ? Module : {};
6986
- var TreeSitter = function() {
6987
- var initPromise, document = typeof window == "object" ? { currentScript: window.document.currentScript } : null;
6988
-
6989
- class Parser {
6990
- constructor() {
6991
- this.initialize();
6992
- }
6993
- initialize() {
6994
- throw new Error("cannot construct a Parser before calling `init()`");
6995
- }
6996
- static init(moduleOptions) {
6997
- return initPromise || (Module = Object.assign({}, Module, moduleOptions), initPromise = new Promise((resolveInitPromise) => {
6998
- var moduleOverrides = Object.assign({}, Module), arguments_ = [], thisProgram = "./this.program", quit_ = (e, t) => {
6999
- throw t;
7000
- }, ENVIRONMENT_IS_WEB = typeof window == "object", ENVIRONMENT_IS_WORKER = typeof importScripts == "function", ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", scriptDirectory = "", read_, readAsync, readBinary, setWindowTitle;
7001
- function locateFile(e) {
7002
- return Module.locateFile ? Module.locateFile(e, scriptDirectory) : scriptDirectory + e;
7003
- }
7004
- function logExceptionOnExit(e) {
7005
- if (e instanceof ExitStatus)
7006
- return;
7007
- err("exiting due to exception: " + e);
7008
- }
7009
- if (ENVIRONMENT_IS_NODE) {
7010
- var fs = __require("fs"), nodePath = __require("path");
7011
- scriptDirectory = ENVIRONMENT_IS_WORKER ? nodePath.dirname(scriptDirectory) + "/" : __dirname + "/", read_ = (e, t) => (e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFileSync(e, t ? undefined : "utf8")), readBinary = (e) => {
7012
- var t = read_(e, true);
7013
- return t.buffer || (t = new Uint8Array(t)), t;
7014
- }, readAsync = (e, t, r) => {
7015
- e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFile(e, function(e2, _) {
7016
- e2 ? r(e2) : t(_.buffer);
7017
- });
7018
- }, process.argv.length > 1 && (thisProgram = process.argv[1].replace(/\\/g, "/")), arguments_ = process.argv.slice(2), typeof module2 != "undefined" && (module2.exports = Module), quit_ = (e, t) => {
7019
- if (keepRuntimeAlive())
7020
- throw process.exitCode = e, t;
7021
- logExceptionOnExit(t), process.exit(e);
7022
- }, Module.inspect = function() {
7023
- return "[Emscripten Module object]";
7024
- };
7025
- } else
7026
- (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && (ENVIRONMENT_IS_WORKER ? scriptDirectory = self.location.href : document !== undefined && document.currentScript && (scriptDirectory = document.currentScript.src), scriptDirectory = scriptDirectory.indexOf("blob:") !== 0 ? scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", read_ = (e) => {
7027
- var t = new XMLHttpRequest;
7028
- return t.open("GET", e, false), t.send(null), t.responseText;
7029
- }, ENVIRONMENT_IS_WORKER && (readBinary = (e) => {
7030
- var t = new XMLHttpRequest;
7031
- return t.open("GET", e, false), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
7032
- }), readAsync = (e, t, r) => {
7033
- var _ = new XMLHttpRequest;
7034
- _.open("GET", e, true), _.responseType = "arraybuffer", _.onload = () => {
7035
- _.status == 200 || _.status == 0 && _.response ? t(_.response) : r();
7036
- }, _.onerror = r, _.send(null);
7037
- }, setWindowTitle = (e) => document.title = e);
7038
- var out = Module.print || console.log.bind(console), err = Module.printErr || console.warn.bind(console);
7039
- Object.assign(Module, moduleOverrides), moduleOverrides = null, Module.arguments && (arguments_ = Module.arguments), Module.thisProgram && (thisProgram = Module.thisProgram), Module.quit && (quit_ = Module.quit);
7040
- var STACK_ALIGN = 16, dynamicLibraries = Module.dynamicLibraries || [], wasmBinary;
7041
- Module.wasmBinary && (wasmBinary = Module.wasmBinary);
7042
- var noExitRuntime = Module.noExitRuntime || true, wasmMemory;
7043
- typeof WebAssembly != "object" && abort("no native wasm support detected");
7044
- var ABORT = false, EXITSTATUS, UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined, buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
7045
- function UTF8ArrayToString(e, t, r) {
7046
- for (var _ = t + r, n = t;e[n] && !(n >= _); )
7047
- ++n;
7048
- if (n - t > 16 && e.buffer && UTF8Decoder)
7049
- return UTF8Decoder.decode(e.subarray(t, n));
7050
- for (var s = "";t < n; ) {
7051
- var a = e[t++];
7052
- if (128 & a) {
7053
- var o = 63 & e[t++];
7054
- if ((224 & a) != 192) {
7055
- var i = 63 & e[t++];
7056
- if ((a = (240 & a) == 224 ? (15 & a) << 12 | o << 6 | i : (7 & a) << 18 | o << 12 | i << 6 | 63 & e[t++]) < 65536)
7057
- s += String.fromCharCode(a);
7058
- else {
7059
- var l = a - 65536;
7060
- s += String.fromCharCode(55296 | l >> 10, 56320 | 1023 & l);
7061
- }
7062
- } else
7063
- s += String.fromCharCode((31 & a) << 6 | o);
7064
- } else
7065
- s += String.fromCharCode(a);
7066
- }
7067
- return s;
7068
- }
7069
- function UTF8ToString(e, t) {
7070
- return e ? UTF8ArrayToString(HEAPU8, e, t) : "";
7071
- }
7072
- function stringToUTF8Array(e, t, r, _) {
7073
- if (!(_ > 0))
7074
- return 0;
7075
- for (var n = r, s = r + _ - 1, a = 0;a < e.length; ++a) {
7076
- var o = e.charCodeAt(a);
7077
- if (o >= 55296 && o <= 57343)
7078
- o = 65536 + ((1023 & o) << 10) | 1023 & e.charCodeAt(++a);
7079
- if (o <= 127) {
7080
- if (r >= s)
7081
- break;
7082
- t[r++] = o;
7083
- } else if (o <= 2047) {
7084
- if (r + 1 >= s)
7085
- break;
7086
- t[r++] = 192 | o >> 6, t[r++] = 128 | 63 & o;
7087
- } else if (o <= 65535) {
7088
- if (r + 2 >= s)
7089
- break;
7090
- t[r++] = 224 | o >> 12, t[r++] = 128 | o >> 6 & 63, t[r++] = 128 | 63 & o;
7091
- } else {
7092
- if (r + 3 >= s)
7093
- break;
7094
- t[r++] = 240 | o >> 18, t[r++] = 128 | o >> 12 & 63, t[r++] = 128 | o >> 6 & 63, t[r++] = 128 | 63 & o;
7095
- }
7096
- }
7097
- return t[r] = 0, r - n;
7098
- }
7099
- function stringToUTF8(e, t, r) {
7100
- return stringToUTF8Array(e, HEAPU8, t, r);
7101
- }
7102
- function lengthBytesUTF8(e) {
7103
- for (var t = 0, r = 0;r < e.length; ++r) {
7104
- var _ = e.charCodeAt(r);
7105
- _ <= 127 ? t++ : _ <= 2047 ? t += 2 : _ >= 55296 && _ <= 57343 ? (t += 4, ++r) : t += 3;
7106
- }
7107
- return t;
7108
- }
7109
- function updateGlobalBufferAndViews(e) {
7110
- buffer = e, Module.HEAP8 = HEAP8 = new Int8Array(e), Module.HEAP16 = HEAP16 = new Int16Array(e), Module.HEAP32 = HEAP32 = new Int32Array(e), Module.HEAPU8 = HEAPU8 = new Uint8Array(e), Module.HEAPU16 = HEAPU16 = new Uint16Array(e), Module.HEAPU32 = HEAPU32 = new Uint32Array(e), Module.HEAPF32 = HEAPF32 = new Float32Array(e), Module.HEAPF64 = HEAPF64 = new Float64Array(e);
7111
- }
7112
- var INITIAL_MEMORY = Module.INITIAL_MEMORY || 33554432;
7113
- wasmMemory = Module.wasmMemory ? Module.wasmMemory : new WebAssembly.Memory({ initial: INITIAL_MEMORY / 65536, maximum: 32768 }), wasmMemory && (buffer = wasmMemory.buffer), INITIAL_MEMORY = buffer.byteLength, updateGlobalBufferAndViews(buffer);
7114
- var wasmTable = new WebAssembly.Table({ initial: 20, element: "anyfunc" }), __ATPRERUN__ = [], __ATINIT__ = [], __ATMAIN__ = [], __ATPOSTRUN__ = [], __RELOC_FUNCS__ = [], runtimeInitialized = false;
7115
- function keepRuntimeAlive() {
7116
- return noExitRuntime;
7117
- }
7118
- function preRun() {
7119
- if (Module.preRun)
7120
- for (typeof Module.preRun == "function" && (Module.preRun = [Module.preRun]);Module.preRun.length; )
7121
- addOnPreRun(Module.preRun.shift());
7122
- callRuntimeCallbacks(__ATPRERUN__);
7123
- }
7124
- function initRuntime() {
7125
- runtimeInitialized = true, callRuntimeCallbacks(__RELOC_FUNCS__), callRuntimeCallbacks(__ATINIT__);
7126
- }
7127
- function preMain() {
7128
- callRuntimeCallbacks(__ATMAIN__);
7129
- }
7130
- function postRun() {
7131
- if (Module.postRun)
7132
- for (typeof Module.postRun == "function" && (Module.postRun = [Module.postRun]);Module.postRun.length; )
7133
- addOnPostRun(Module.postRun.shift());
7134
- callRuntimeCallbacks(__ATPOSTRUN__);
7135
- }
7136
- function addOnPreRun(e) {
7137
- __ATPRERUN__.unshift(e);
7138
- }
7139
- function addOnInit(e) {
7140
- __ATINIT__.unshift(e);
7141
- }
7142
- function addOnPostRun(e) {
7143
- __ATPOSTRUN__.unshift(e);
7144
- }
7145
- var runDependencies = 0, runDependencyWatcher = null, dependenciesFulfilled = null;
7146
- function addRunDependency(e) {
7147
- runDependencies++, Module.monitorRunDependencies && Module.monitorRunDependencies(runDependencies);
7148
- }
7149
- function removeRunDependency(e) {
7150
- if (runDependencies--, Module.monitorRunDependencies && Module.monitorRunDependencies(runDependencies), runDependencies == 0 && (runDependencyWatcher !== null && (clearInterval(runDependencyWatcher), runDependencyWatcher = null), dependenciesFulfilled)) {
7151
- var t = dependenciesFulfilled;
7152
- dependenciesFulfilled = null, t();
7153
- }
7154
- }
7155
- function abort(e) {
7156
- throw Module.onAbort && Module.onAbort(e), err(e = "Aborted(" + e + ")"), ABORT = true, EXITSTATUS = 1, e += ". Build with -sASSERTIONS for more info.", new WebAssembly.RuntimeError(e);
7157
- }
7158
- var dataURIPrefix = "data:application/octet-stream;base64,", wasmBinaryFile, tempDouble, tempI64;
7159
- function isDataURI(e) {
7160
- return e.startsWith(dataURIPrefix);
7161
- }
7162
- function isFileURI(e) {
7163
- return e.startsWith("file://");
7164
- }
7165
- function getBinary(e) {
7166
- try {
7167
- if (e == wasmBinaryFile && wasmBinary)
7168
- return new Uint8Array(wasmBinary);
7169
- if (readBinary)
7170
- return readBinary(e);
7171
- throw "both async and sync fetching of the wasm failed";
7172
- } catch (e2) {
7173
- abort(e2);
7174
- }
7175
- }
7176
- function getBinaryPromise() {
7177
- if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
7178
- if (typeof fetch == "function" && !isFileURI(wasmBinaryFile))
7179
- return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(e) {
7180
- if (!e.ok)
7181
- throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
7182
- return e.arrayBuffer();
7183
- }).catch(function() {
7184
- return getBinary(wasmBinaryFile);
7185
- });
7186
- if (readAsync)
7187
- return new Promise(function(e, t) {
7188
- readAsync(wasmBinaryFile, function(t2) {
7189
- e(new Uint8Array(t2));
7190
- }, t);
7191
- });
7192
- }
7193
- return Promise.resolve().then(function() {
7194
- return getBinary(wasmBinaryFile);
7195
- });
7196
- }
7197
- function createWasm() {
7198
- var e = { env: asmLibraryArg, wasi_snapshot_preview1: asmLibraryArg, "GOT.mem": new Proxy(asmLibraryArg, GOTHandler), "GOT.func": new Proxy(asmLibraryArg, GOTHandler) };
7199
- function t(e2, t2) {
7200
- var r2 = e2.exports;
7201
- r2 = relocateExports(r2, 1024);
7202
- var _2 = getDylinkMetadata(t2);
7203
- _2.neededDynlibs && (dynamicLibraries = _2.neededDynlibs.concat(dynamicLibraries)), mergeLibSymbols(r2, "main"), Module.asm = r2, addOnInit(Module.asm.__wasm_call_ctors), __RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs), removeRunDependency("wasm-instantiate");
7204
- }
7205
- function r(e2) {
7206
- t(e2.instance, e2.module);
7207
- }
7208
- function _(t2) {
7209
- return getBinaryPromise().then(function(t3) {
7210
- return WebAssembly.instantiate(t3, e);
7211
- }).then(function(e2) {
7212
- return e2;
7213
- }).then(t2, function(e2) {
7214
- err("failed to asynchronously prepare wasm: " + e2), abort(e2);
7215
- });
7216
- }
7217
- if (addRunDependency("wasm-instantiate"), Module.instantiateWasm)
7218
- try {
7219
- return Module.instantiateWasm(e, t);
7220
- } catch (e2) {
7221
- return err("Module.instantiateWasm callback failed with error: " + e2), false;
7222
- }
7223
- return wasmBinary || typeof WebAssembly.instantiateStreaming != "function" || isDataURI(wasmBinaryFile) || isFileURI(wasmBinaryFile) || ENVIRONMENT_IS_NODE || typeof fetch != "function" ? _(r) : fetch(wasmBinaryFile, { credentials: "same-origin" }).then(function(t2) {
7224
- return WebAssembly.instantiateStreaming(t2, e).then(r, function(e2) {
7225
- return err("wasm streaming compile failed: " + e2), err("falling back to ArrayBuffer instantiation"), _(r);
7226
- });
7227
- }), {};
7228
- }
7229
- wasmBinaryFile = "tree-sitter.wasm", isDataURI(wasmBinaryFile) || (wasmBinaryFile = locateFile(wasmBinaryFile));
7230
- var ASM_CONSTS = {};
7231
- function ExitStatus(e) {
7232
- this.name = "ExitStatus", this.message = "Program terminated with exit(" + e + ")", this.status = e;
7233
- }
7234
- var GOT = {}, CurrentModuleWeakSymbols = new Set([]), GOTHandler = { get: function(e, t) {
7235
- var r = GOT[t];
7236
- return r || (r = GOT[t] = new WebAssembly.Global({ value: "i32", mutable: true })), CurrentModuleWeakSymbols.has(t) || (r.required = true), r;
7237
- } };
7238
- function callRuntimeCallbacks(e) {
7239
- for (;e.length > 0; )
7240
- e.shift()(Module);
7241
- }
7242
- function getDylinkMetadata(e) {
7243
- var t = 0, r = 0;
7244
- function _() {
7245
- for (var r2 = 0, _2 = 1;; ) {
7246
- var n2 = e[t++];
7247
- if (r2 += (127 & n2) * _2, _2 *= 128, !(128 & n2))
7248
- break;
7249
- }
7250
- return r2;
7251
- }
7252
- function n() {
7253
- var r2 = _();
7254
- return UTF8ArrayToString(e, (t += r2) - r2, r2);
7255
- }
7256
- function s(e2, t2) {
7257
- if (e2)
7258
- throw new Error(t2);
7259
- }
7260
- var a = "dylink.0";
7261
- if (e instanceof WebAssembly.Module) {
7262
- var o = WebAssembly.Module.customSections(e, a);
7263
- o.length === 0 && (a = "dylink", o = WebAssembly.Module.customSections(e, a)), s(o.length === 0, "need dylink section"), r = (e = new Uint8Array(o[0])).length;
7264
- } else {
7265
- s(!(new Uint32Array(new Uint8Array(e.subarray(0, 24)).buffer)[0] == 1836278016), "need to see wasm magic number"), s(e[8] !== 0, "need the dylink section to be first"), t = 9;
7266
- var i = _();
7267
- r = t + i, a = n();
7268
- }
7269
- var l = { neededDynlibs: [], tlsExports: new Set, weakImports: new Set };
7270
- if (a == "dylink") {
7271
- l.memorySize = _(), l.memoryAlign = _(), l.tableSize = _(), l.tableAlign = _();
7272
- for (var u = _(), d = 0;d < u; ++d) {
7273
- var c = n();
7274
- l.neededDynlibs.push(c);
7275
- }
7276
- } else {
7277
- s(a !== "dylink.0");
7278
- for (;t < r; ) {
7279
- var m = e[t++], p = _();
7280
- if (m === 1)
7281
- l.memorySize = _(), l.memoryAlign = _(), l.tableSize = _(), l.tableAlign = _();
7282
- else if (m === 2)
7283
- for (u = _(), d = 0;d < u; ++d)
7284
- c = n(), l.neededDynlibs.push(c);
7285
- else if (m === 3)
7286
- for (var f = _();f--; ) {
7287
- var h = n();
7288
- 256 & _() && l.tlsExports.add(h);
7289
- }
7290
- else if (m === 4)
7291
- for (f = _();f--; ) {
7292
- n(), h = n();
7293
- (3 & _()) == 1 && l.weakImports.add(h);
7294
- }
7295
- else
7296
- t += p;
7297
- }
7298
- }
7299
- return l;
7300
- }
7301
- function getValue(e, t = "i8") {
7302
- switch (t.endsWith("*") && (t = "*"), t) {
7303
- case "i1":
7304
- case "i8":
7305
- return HEAP8[e >> 0];
7306
- case "i16":
7307
- return HEAP16[e >> 1];
7308
- case "i32":
7309
- case "i64":
7310
- return HEAP32[e >> 2];
7311
- case "float":
7312
- return HEAPF32[e >> 2];
7313
- case "double":
7314
- return HEAPF64[e >> 3];
7315
- case "*":
7316
- return HEAPU32[e >> 2];
7317
- default:
7318
- abort("invalid type for getValue: " + t);
7319
- }
7320
- return null;
7321
- }
7322
- function asmjsMangle(e) {
7323
- return e.indexOf("dynCall_") == 0 || ["stackAlloc", "stackSave", "stackRestore", "getTempRet0", "setTempRet0"].includes(e) ? e : "_" + e;
7324
- }
7325
- function mergeLibSymbols(e, t) {
7326
- for (var r in e)
7327
- if (e.hasOwnProperty(r)) {
7328
- asmLibraryArg.hasOwnProperty(r) || (asmLibraryArg[r] = e[r]);
7329
- var _ = asmjsMangle(r);
7330
- Module.hasOwnProperty(_) || (Module[_] = e[r]), r == "__main_argc_argv" && (Module._main = e[r]);
7331
- }
7332
- }
7333
- var LDSO = { loadedLibsByName: {}, loadedLibsByHandle: {} };
7334
- function dynCallLegacy(e, t, r) {
7335
- var _ = Module["dynCall_" + e];
7336
- return r && r.length ? _.apply(null, [t].concat(r)) : _.call(null, t);
7337
- }
7338
- var wasmTableMirror = [];
7339
- function getWasmTableEntry(e) {
7340
- var t = wasmTableMirror[e];
7341
- return t || (e >= wasmTableMirror.length && (wasmTableMirror.length = e + 1), wasmTableMirror[e] = t = wasmTable.get(e)), t;
7342
- }
7343
- function dynCall(e, t, r) {
7344
- return e.includes("j") ? dynCallLegacy(e, t, r) : getWasmTableEntry(t).apply(null, r);
7345
- }
7346
- function createInvokeFunction(e) {
7347
- return function() {
7348
- var t = stackSave();
7349
- try {
7350
- return dynCall(e, arguments[0], Array.prototype.slice.call(arguments, 1));
7351
- } catch (e2) {
7352
- if (stackRestore(t), e2 !== e2 + 0)
7353
- throw e2;
7354
- _setThrew(1, 0);
7355
- }
7356
- };
7357
- }
7358
- var ___heap_base = 78144;
7359
- function zeroMemory(e, t) {
7360
- return HEAPU8.fill(0, e, e + t), e;
7361
- }
7362
- function getMemory(e) {
7363
- if (runtimeInitialized)
7364
- return zeroMemory(_malloc(e), e);
7365
- var t = ___heap_base, r = t + e + 15 & -16;
7366
- return ___heap_base = r, GOT.__heap_base.value = r, t;
7367
- }
7368
- function isInternalSym(e) {
7369
- return ["__cpp_exception", "__c_longjmp", "__wasm_apply_data_relocs", "__dso_handle", "__tls_size", "__tls_align", "__set_stack_limits", "_emscripten_tls_init", "__wasm_init_tls", "__wasm_call_ctors", "__start_em_asm", "__stop_em_asm"].includes(e);
7370
- }
7371
- function uleb128Encode(e, t) {
7372
- e < 128 ? t.push(e) : t.push(e % 128 | 128, e >> 7);
7373
- }
7374
- function sigToWasmTypes(e) {
7375
- for (var t = { i: "i32", j: "i32", f: "f32", d: "f64", p: "i32" }, r = { parameters: [], results: e[0] == "v" ? [] : [t[e[0]]] }, _ = 1;_ < e.length; ++_)
7376
- r.parameters.push(t[e[_]]), e[_] === "j" && r.parameters.push("i32");
7377
- return r;
7378
- }
7379
- function generateFuncType(e, t) {
7380
- var r = e.slice(0, 1), _ = e.slice(1), n = { i: 127, p: 127, j: 126, f: 125, d: 124 };
7381
- t.push(96), uleb128Encode(_.length, t);
7382
- for (var s = 0;s < _.length; ++s)
7383
- t.push(n[_[s]]);
7384
- r == "v" ? t.push(0) : t.push(1, n[r]);
7385
- }
7386
- function convertJsFunctionToWasm(e, t) {
7387
- if (typeof WebAssembly.Function == "function")
7388
- return new WebAssembly.Function(sigToWasmTypes(t), e);
7389
- var r = [1];
7390
- generateFuncType(t, r);
7391
- var _ = [0, 97, 115, 109, 1, 0, 0, 0, 1];
7392
- uleb128Encode(r.length, _), _.push.apply(_, r), _.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
7393
- var n = new WebAssembly.Module(new Uint8Array(_));
7394
- return new WebAssembly.Instance(n, { e: { f: e } }).exports.f;
7395
- }
7396
- function updateTableMap(e, t) {
7397
- if (functionsInTableMap)
7398
- for (var r = e;r < e + t; r++) {
7399
- var _ = getWasmTableEntry(r);
7400
- _ && functionsInTableMap.set(_, r);
7401
- }
7402
- }
7403
- var functionsInTableMap = undefined, freeTableIndexes = [];
7404
- function getEmptyTableSlot() {
7405
- if (freeTableIndexes.length)
7406
- return freeTableIndexes.pop();
7407
- try {
7408
- wasmTable.grow(1);
7409
- } catch (e) {
7410
- if (!(e instanceof RangeError))
7411
- throw e;
7412
- throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";
7413
- }
7414
- return wasmTable.length - 1;
7415
- }
7416
- function setWasmTableEntry(e, t) {
7417
- wasmTable.set(e, t), wasmTableMirror[e] = wasmTable.get(e);
7418
- }
7419
- function addFunction(e, t) {
7420
- if (functionsInTableMap || (functionsInTableMap = new WeakMap, updateTableMap(0, wasmTable.length)), functionsInTableMap.has(e))
7421
- return functionsInTableMap.get(e);
7422
- var r = getEmptyTableSlot();
7423
- try {
7424
- setWasmTableEntry(r, e);
7425
- } catch (_) {
7426
- if (!(_ instanceof TypeError))
7427
- throw _;
7428
- setWasmTableEntry(r, convertJsFunctionToWasm(e, t));
7429
- }
7430
- return functionsInTableMap.set(e, r), r;
7431
- }
7432
- function updateGOT(e, t) {
7433
- for (var r in e)
7434
- if (!isInternalSym(r)) {
7435
- var _ = e[r];
7436
- r.startsWith("orig$") && (r = r.split("$")[1], t = true), GOT[r] || (GOT[r] = new WebAssembly.Global({ value: "i32", mutable: true })), (t || GOT[r].value == 0) && (typeof _ == "function" ? GOT[r].value = addFunction(_) : typeof _ == "number" ? GOT[r].value = _ : err("unhandled export type for `" + r + "`: " + typeof _));
7437
- }
7438
- }
7439
- function relocateExports(e, t, r) {
7440
- var _ = {};
7441
- for (var n in e) {
7442
- var s = e[n];
7443
- typeof s == "object" && (s = s.value), typeof s == "number" && (s += t), _[n] = s;
7444
- }
7445
- return updateGOT(_, r), _;
7446
- }
7447
- function resolveGlobalSymbol(e, t) {
7448
- var r;
7449
- return t && (r = asmLibraryArg["orig$" + e]), r || (r = asmLibraryArg[e]) && r.stub && (r = undefined), r || (r = Module[asmjsMangle(e)]), !r && e.startsWith("invoke_") && (r = createInvokeFunction(e.split("_")[1])), r;
7450
- }
7451
- function alignMemory(e, t) {
7452
- return Math.ceil(e / t) * t;
7453
- }
7454
- function loadWebAssemblyModule(binary, flags, handle) {
7455
- var metadata = getDylinkMetadata(binary);
7456
- function loadModule() {
7457
- var firstLoad = !handle || !HEAP8[handle + 12 >> 0];
7458
- if (firstLoad) {
7459
- var memAlign = Math.pow(2, metadata.memoryAlign);
7460
- memAlign = Math.max(memAlign, STACK_ALIGN);
7461
- var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0, tableBase = metadata.tableSize ? wasmTable.length : 0;
7462
- handle && (HEAP8[handle + 12 >> 0] = 1, HEAPU32[handle + 16 >> 2] = memoryBase, HEAP32[handle + 20 >> 2] = metadata.memorySize, HEAPU32[handle + 24 >> 2] = tableBase, HEAP32[handle + 28 >> 2] = metadata.tableSize);
7463
- } else
7464
- memoryBase = HEAPU32[handle + 16 >> 2], tableBase = HEAPU32[handle + 24 >> 2];
7465
- var tableGrowthNeeded = tableBase + metadata.tableSize - wasmTable.length, moduleExports;
7466
- function resolveSymbol(e) {
7467
- var t = resolveGlobalSymbol(e, false);
7468
- return t || (t = moduleExports[e]), t;
7469
- }
7470
- tableGrowthNeeded > 0 && wasmTable.grow(tableGrowthNeeded);
7471
- var proxyHandler = { get: function(e, t) {
7472
- switch (t) {
7473
- case "__memory_base":
7474
- return memoryBase;
7475
- case "__table_base":
7476
- return tableBase;
7477
- }
7478
- if (t in asmLibraryArg)
7479
- return asmLibraryArg[t];
7480
- var r;
7481
- t in e || (e[t] = function() {
7482
- return r || (r = resolveSymbol(t)), r.apply(null, arguments);
7483
- });
7484
- return e[t];
7485
- } }, proxy = new Proxy({}, proxyHandler), info = { "GOT.mem": new Proxy({}, GOTHandler), "GOT.func": new Proxy({}, GOTHandler), env: proxy, wasi_snapshot_preview1: proxy };
7486
- function postInstantiation(instance) {
7487
- function addEmAsm(addr, body) {
7488
- for (var args = [], arity = 0;arity < 16 && body.indexOf("$" + arity) != -1; arity++)
7489
- args.push("$" + arity);
7490
- args = args.join(",");
7491
- var func = "(" + args + " ) => { " + body + "};";
7492
- ASM_CONSTS[start] = eval(func);
7493
- }
7494
- if (updateTableMap(tableBase, metadata.tableSize), moduleExports = relocateExports(instance.exports, memoryBase), flags.allowUndefined || reportUndefinedSymbols(), "__start_em_asm" in moduleExports)
7495
- for (var { __start_em_asm: start, __stop_em_asm: stop } = moduleExports;start < stop; ) {
7496
- var jsString = UTF8ToString(start);
7497
- addEmAsm(start, jsString), start = HEAPU8.indexOf(0, start) + 1;
7498
- }
7499
- var applyRelocs = moduleExports.__wasm_apply_data_relocs;
7500
- applyRelocs && (runtimeInitialized ? applyRelocs() : __RELOC_FUNCS__.push(applyRelocs));
7501
- var init = moduleExports.__wasm_call_ctors;
7502
- return init && (runtimeInitialized ? init() : __ATINIT__.push(init)), moduleExports;
7503
- }
7504
- if (flags.loadAsync) {
7505
- if (binary instanceof WebAssembly.Module) {
7506
- var instance = new WebAssembly.Instance(binary, info);
7507
- return Promise.resolve(postInstantiation(instance));
7508
- }
7509
- return WebAssembly.instantiate(binary, info).then(function(e) {
7510
- return postInstantiation(e.instance);
7511
- });
7512
- }
7513
- var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary), instance = new WebAssembly.Instance(module, info);
7514
- return postInstantiation(instance);
7515
- }
7516
- return CurrentModuleWeakSymbols = metadata.weakImports, flags.loadAsync ? metadata.neededDynlibs.reduce(function(e, t) {
7517
- return e.then(function() {
7518
- return loadDynamicLibrary(t, flags);
7519
- });
7520
- }, Promise.resolve()).then(function() {
7521
- return loadModule();
7522
- }) : (metadata.neededDynlibs.forEach(function(e) {
7523
- loadDynamicLibrary(e, flags);
7524
- }), loadModule());
7525
- }
7526
- function loadDynamicLibrary(e, t, r) {
7527
- t = t || { global: true, nodelete: true };
7528
- var _ = LDSO.loadedLibsByName[e];
7529
- if (_)
7530
- return t.global && !_.global && (_.global = true, _.module !== "loading" && mergeLibSymbols(_.module, e)), t.nodelete && _.refcount !== 1 / 0 && (_.refcount = 1 / 0), _.refcount++, r && (LDSO.loadedLibsByHandle[r] = _), !t.loadAsync || Promise.resolve(true);
7531
- function n(e2) {
7532
- if (t.fs && t.fs.findObject(e2)) {
7533
- var r2 = t.fs.readFile(e2, { encoding: "binary" });
7534
- return r2 instanceof Uint8Array || (r2 = new Uint8Array(r2)), t.loadAsync ? Promise.resolve(r2) : r2;
7535
- }
7536
- if (e2 = locateFile(e2), t.loadAsync)
7537
- return new Promise(function(t2, r3) {
7538
- readAsync(e2, (e3) => t2(new Uint8Array(e3)), r3);
7539
- });
7540
- if (!readBinary)
7541
- throw new Error(e2 + ": file not found, and synchronous loading of external files is not available");
7542
- return readBinary(e2);
7543
- }
7544
- function s() {
7545
- if (typeof preloadedWasm != "undefined" && preloadedWasm[e]) {
7546
- var _2 = preloadedWasm[e];
7547
- return t.loadAsync ? Promise.resolve(_2) : _2;
7548
- }
7549
- return t.loadAsync ? n(e).then(function(e2) {
7550
- return loadWebAssemblyModule(e2, t, r);
7551
- }) : loadWebAssemblyModule(n(e), t, r);
7552
- }
7553
- function a(t2) {
7554
- _.global && mergeLibSymbols(t2, e), _.module = t2;
7555
- }
7556
- return _ = { refcount: t.nodelete ? 1 / 0 : 1, name: e, module: "loading", global: t.global }, LDSO.loadedLibsByName[e] = _, r && (LDSO.loadedLibsByHandle[r] = _), t.loadAsync ? s().then(function(e2) {
7557
- return a(e2), true;
7558
- }) : (a(s()), true);
7559
- }
7560
- function reportUndefinedSymbols() {
7561
- for (var e in GOT)
7562
- if (GOT[e].value == 0) {
7563
- var t = resolveGlobalSymbol(e, true);
7564
- if (!t && !GOT[e].required)
7565
- continue;
7566
- if (typeof t == "function")
7567
- GOT[e].value = addFunction(t, t.sig);
7568
- else {
7569
- if (typeof t != "number")
7570
- throw new Error("bad export type for `" + e + "`: " + typeof t);
7571
- GOT[e].value = t;
7572
- }
7573
- }
7574
- }
7575
- function preloadDylibs() {
7576
- dynamicLibraries.length ? (addRunDependency("preloadDylibs"), dynamicLibraries.reduce(function(e, t) {
7577
- return e.then(function() {
7578
- return loadDynamicLibrary(t, { loadAsync: true, global: true, nodelete: true, allowUndefined: true });
7579
- });
7580
- }, Promise.resolve()).then(function() {
7581
- reportUndefinedSymbols(), removeRunDependency("preloadDylibs");
7582
- })) : reportUndefinedSymbols();
7583
- }
7584
- function setValue(e, t, r = "i8") {
7585
- switch (r.endsWith("*") && (r = "*"), r) {
7586
- case "i1":
7587
- case "i8":
7588
- HEAP8[e >> 0] = t;
7589
- break;
7590
- case "i16":
7591
- HEAP16[e >> 1] = t;
7592
- break;
7593
- case "i32":
7594
- HEAP32[e >> 2] = t;
7595
- break;
7596
- case "i64":
7597
- tempI64 = [t >>> 0, (tempDouble = t, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[e >> 2] = tempI64[0], HEAP32[e + 4 >> 2] = tempI64[1];
7598
- break;
7599
- case "float":
7600
- HEAPF32[e >> 2] = t;
7601
- break;
7602
- case "double":
7603
- HEAPF64[e >> 3] = t;
7604
- break;
7605
- case "*":
7606
- HEAPU32[e >> 2] = t;
7607
- break;
7608
- default:
7609
- abort("invalid type for setValue: " + r);
7610
- }
7611
- }
7612
- var ___memory_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1024), ___stack_pointer = new WebAssembly.Global({ value: "i32", mutable: true }, 78144), ___table_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1), nowIsMonotonic = true, _emscripten_get_now;
7613
- function __emscripten_get_now_is_monotonic() {
7614
- return nowIsMonotonic;
7615
- }
7616
- function _abort() {
7617
- abort("");
7618
- }
7619
- function _emscripten_date_now() {
7620
- return Date.now();
7621
- }
7622
- function _emscripten_memcpy_big(e, t, r) {
7623
- HEAPU8.copyWithin(e, t, t + r);
7624
- }
7625
- function getHeapMax() {
7626
- return 2147483648;
7627
- }
7628
- function emscripten_realloc_buffer(e) {
7629
- try {
7630
- return wasmMemory.grow(e - buffer.byteLength + 65535 >>> 16), updateGlobalBufferAndViews(wasmMemory.buffer), 1;
7631
- } catch (e2) {}
7632
- }
7633
- function _emscripten_resize_heap(e) {
7634
- var t = HEAPU8.length;
7635
- e >>>= 0;
7636
- var r = getHeapMax();
7637
- if (e > r)
7638
- return false;
7639
- for (var _ = 1;_ <= 4; _ *= 2) {
7640
- var n = t * (1 + 0.2 / _);
7641
- if (n = Math.min(n, e + 100663296), emscripten_realloc_buffer(Math.min(r, (s = Math.max(e, n)) + ((a = 65536) - s % a) % a)))
7642
- return true;
7643
- }
7644
- var s, a;
7645
- return false;
7646
- }
7647
- __emscripten_get_now_is_monotonic.sig = "i", Module._abort = _abort, _abort.sig = "v", _emscripten_date_now.sig = "d", _emscripten_get_now = ENVIRONMENT_IS_NODE ? () => {
7648
- var e = process.hrtime();
7649
- return 1000 * e[0] + e[1] / 1e6;
7650
- } : () => performance.now(), _emscripten_get_now.sig = "d", _emscripten_memcpy_big.sig = "vppp", _emscripten_resize_heap.sig = "ip";
7651
- var SYSCALLS = { DEFAULT_POLLMASK: 5, calculateAt: function(e, t, r) {
7652
- if (PATH.isAbs(t))
7653
- return t;
7654
- var _;
7655
- e === -100 ? _ = FS.cwd() : _ = SYSCALLS.getStreamFromFD(e).path;
7656
- if (t.length == 0) {
7657
- if (!r)
7658
- throw new FS.ErrnoError(44);
7659
- return _;
7660
- }
7661
- return PATH.join2(_, t);
7662
- }, doStat: function(e, t, r) {
7663
- try {
7664
- var _ = e(t);
7665
- } catch (e2) {
7666
- if (e2 && e2.node && PATH.normalize(t) !== PATH.normalize(FS.getPath(e2.node)))
7667
- return -54;
7668
- throw e2;
7669
- }
7670
- HEAP32[r >> 2] = _.dev, HEAP32[r + 8 >> 2] = _.ino, HEAP32[r + 12 >> 2] = _.mode, HEAPU32[r + 16 >> 2] = _.nlink, HEAP32[r + 20 >> 2] = _.uid, HEAP32[r + 24 >> 2] = _.gid, HEAP32[r + 28 >> 2] = _.rdev, tempI64 = [_.size >>> 0, (tempDouble = _.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 40 >> 2] = tempI64[0], HEAP32[r + 44 >> 2] = tempI64[1], HEAP32[r + 48 >> 2] = 4096, HEAP32[r + 52 >> 2] = _.blocks;
7671
- var n = _.atime.getTime(), s = _.mtime.getTime(), a = _.ctime.getTime();
7672
- return tempI64 = [Math.floor(n / 1000) >>> 0, (tempDouble = Math.floor(n / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 56 >> 2] = tempI64[0], HEAP32[r + 60 >> 2] = tempI64[1], HEAPU32[r + 64 >> 2] = n % 1000 * 1000, tempI64 = [Math.floor(s / 1000) >>> 0, (tempDouble = Math.floor(s / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 72 >> 2] = tempI64[0], HEAP32[r + 76 >> 2] = tempI64[1], HEAPU32[r + 80 >> 2] = s % 1000 * 1000, tempI64 = [Math.floor(a / 1000) >>> 0, (tempDouble = Math.floor(a / 1000), +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 88 >> 2] = tempI64[0], HEAP32[r + 92 >> 2] = tempI64[1], HEAPU32[r + 96 >> 2] = a % 1000 * 1000, tempI64 = [_.ino >>> 0, (tempDouble = _.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[r + 104 >> 2] = tempI64[0], HEAP32[r + 108 >> 2] = tempI64[1], 0;
7673
- }, doMsync: function(e, t, r, _, n) {
7674
- if (!FS.isFile(t.node.mode))
7675
- throw new FS.ErrnoError(43);
7676
- if (2 & _)
7677
- return 0;
7678
- var s = HEAPU8.slice(e, e + r);
7679
- FS.msync(t, s, n, r, _);
7680
- }, varargs: undefined, get: function() {
7681
- return SYSCALLS.varargs += 4, HEAP32[SYSCALLS.varargs - 4 >> 2];
7682
- }, getStr: function(e) {
7683
- return UTF8ToString(e);
7684
- }, getStreamFromFD: function(e) {
7685
- var t = FS.getStream(e);
7686
- if (!t)
7687
- throw new FS.ErrnoError(8);
7688
- return t;
7689
- } };
7690
- function _proc_exit(e) {
7691
- EXITSTATUS = e, keepRuntimeAlive() || (Module.onExit && Module.onExit(e), ABORT = true), quit_(e, new ExitStatus(e));
7692
- }
7693
- function exitJS(e, t) {
7694
- EXITSTATUS = e, _proc_exit(e);
7695
- }
7696
- _proc_exit.sig = "vi";
7697
- var _exit = exitJS;
7698
- function _fd_close(e) {
7699
- try {
7700
- var t = SYSCALLS.getStreamFromFD(e);
7701
- return FS.close(t), 0;
7702
- } catch (e2) {
7703
- if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
7704
- throw e2;
7705
- return e2.errno;
7706
- }
7707
- }
7708
- function convertI32PairToI53Checked(e, t) {
7709
- return t + 2097152 >>> 0 < 4194305 - !!e ? (e >>> 0) + 4294967296 * t : NaN;
7710
- }
7711
- function _fd_seek(e, t, r, _, n) {
7712
- try {
7713
- var s = convertI32PairToI53Checked(t, r);
7714
- if (isNaN(s))
7715
- return 61;
7716
- var a = SYSCALLS.getStreamFromFD(e);
7717
- return FS.llseek(a, s, _), tempI64 = [a.position >>> 0, (tempDouble = a.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (0 | Math.min(+Math.floor(tempDouble / 4294967296), 4294967295)) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0)], HEAP32[n >> 2] = tempI64[0], HEAP32[n + 4 >> 2] = tempI64[1], a.getdents && s === 0 && _ === 0 && (a.getdents = null), 0;
7718
- } catch (e2) {
7719
- if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
7720
- throw e2;
7721
- return e2.errno;
7722
- }
7723
- }
7724
- function doWritev(e, t, r, _) {
7725
- for (var n = 0, s = 0;s < r; s++) {
7726
- var a = HEAPU32[t >> 2], o = HEAPU32[t + 4 >> 2];
7727
- t += 8;
7728
- var i = FS.write(e, HEAP8, a, o, _);
7729
- if (i < 0)
7730
- return -1;
7731
- n += i, _ !== undefined && (_ += i);
7732
- }
7733
- return n;
7734
- }
7735
- function _fd_write(e, t, r, _) {
7736
- try {
7737
- var n = doWritev(SYSCALLS.getStreamFromFD(e), t, r);
7738
- return HEAPU32[_ >> 2] = n, 0;
7739
- } catch (e2) {
7740
- if (typeof FS == "undefined" || !(e2 instanceof FS.ErrnoError))
7741
- throw e2;
7742
- return e2.errno;
7743
- }
7744
- }
7745
- function _tree_sitter_log_callback(e, t) {
7746
- if (currentLogCallback) {
7747
- const r = UTF8ToString(t);
7748
- currentLogCallback(r, e !== 0);
7749
- }
7750
- }
7751
- function _tree_sitter_parse_callback(e, t, r, _, n) {
7752
- var s = currentParseCallback(t, { row: r, column: _ });
7753
- typeof s == "string" ? (setValue(n, s.length, "i32"), stringToUTF16(s, e, 10240)) : setValue(n, 0, "i32");
7754
- }
7755
- function handleException(e) {
7756
- if (e instanceof ExitStatus || e == "unwind")
7757
- return EXITSTATUS;
7758
- quit_(1, e);
7759
- }
7760
- function allocateUTF8OnStack(e) {
7761
- var t = lengthBytesUTF8(e) + 1, r = stackAlloc(t);
7762
- return stringToUTF8Array(e, HEAP8, r, t), r;
7763
- }
7764
- function stringToUTF16(e, t, r) {
7765
- if (r === undefined && (r = 2147483647), r < 2)
7766
- return 0;
7767
- for (var _ = t, n = (r -= 2) < 2 * e.length ? r / 2 : e.length, s = 0;s < n; ++s) {
7768
- var a = e.charCodeAt(s);
7769
- HEAP16[t >> 1] = a, t += 2;
7770
- }
7771
- return HEAP16[t >> 1] = 0, t - _;
7772
- }
7773
- function AsciiToString(e) {
7774
- for (var t = "";; ) {
7775
- var r = HEAPU8[e++ >> 0];
7776
- if (!r)
7777
- return t;
7778
- t += String.fromCharCode(r);
7779
- }
7780
- }
7781
- _exit.sig = "vi", _fd_close.sig = "ii", _fd_seek.sig = "iijip", _fd_write.sig = "iippp";
7782
- var asmLibraryArg = { __heap_base: ___heap_base, __indirect_function_table: wasmTable, __memory_base: ___memory_base, __stack_pointer: ___stack_pointer, __table_base: ___table_base, _emscripten_get_now_is_monotonic: __emscripten_get_now_is_monotonic, abort: _abort, emscripten_get_now: _emscripten_get_now, emscripten_memcpy_big: _emscripten_memcpy_big, emscripten_resize_heap: _emscripten_resize_heap, exit: _exit, fd_close: _fd_close, fd_seek: _fd_seek, fd_write: _fd_write, memory: wasmMemory, tree_sitter_log_callback: _tree_sitter_log_callback, tree_sitter_parse_callback: _tree_sitter_parse_callback }, asm = createWasm(), ___wasm_call_ctors = Module.___wasm_call_ctors = function() {
7783
- return (___wasm_call_ctors = Module.___wasm_call_ctors = Module.asm.__wasm_call_ctors).apply(null, arguments);
7784
- }, ___wasm_apply_data_relocs = Module.___wasm_apply_data_relocs = function() {
7785
- return (___wasm_apply_data_relocs = Module.___wasm_apply_data_relocs = Module.asm.__wasm_apply_data_relocs).apply(null, arguments);
7786
- }, _malloc = Module._malloc = function() {
7787
- return (_malloc = Module._malloc = Module.asm.malloc).apply(null, arguments);
7788
- }, _calloc = Module._calloc = function() {
7789
- return (_calloc = Module._calloc = Module.asm.calloc).apply(null, arguments);
7790
- }, _realloc = Module._realloc = function() {
7791
- return (_realloc = Module._realloc = Module.asm.realloc).apply(null, arguments);
7792
- }, _free = Module._free = function() {
7793
- return (_free = Module._free = Module.asm.free).apply(null, arguments);
7794
- }, _ts_language_symbol_count = Module._ts_language_symbol_count = function() {
7795
- return (_ts_language_symbol_count = Module._ts_language_symbol_count = Module.asm.ts_language_symbol_count).apply(null, arguments);
7796
- }, _ts_language_version = Module._ts_language_version = function() {
7797
- return (_ts_language_version = Module._ts_language_version = Module.asm.ts_language_version).apply(null, arguments);
7798
- }, _ts_language_field_count = Module._ts_language_field_count = function() {
7799
- return (_ts_language_field_count = Module._ts_language_field_count = Module.asm.ts_language_field_count).apply(null, arguments);
7800
- }, _ts_language_symbol_name = Module._ts_language_symbol_name = function() {
7801
- return (_ts_language_symbol_name = Module._ts_language_symbol_name = Module.asm.ts_language_symbol_name).apply(null, arguments);
7802
- }, _ts_language_symbol_for_name = Module._ts_language_symbol_for_name = function() {
7803
- return (_ts_language_symbol_for_name = Module._ts_language_symbol_for_name = Module.asm.ts_language_symbol_for_name).apply(null, arguments);
7804
- }, _ts_language_symbol_type = Module._ts_language_symbol_type = function() {
7805
- return (_ts_language_symbol_type = Module._ts_language_symbol_type = Module.asm.ts_language_symbol_type).apply(null, arguments);
7806
- }, _ts_language_field_name_for_id = Module._ts_language_field_name_for_id = function() {
7807
- return (_ts_language_field_name_for_id = Module._ts_language_field_name_for_id = Module.asm.ts_language_field_name_for_id).apply(null, arguments);
7808
- }, _memset = Module._memset = function() {
7809
- return (_memset = Module._memset = Module.asm.memset).apply(null, arguments);
7810
- }, _memcpy = Module._memcpy = function() {
7811
- return (_memcpy = Module._memcpy = Module.asm.memcpy).apply(null, arguments);
7812
- }, _ts_parser_delete = Module._ts_parser_delete = function() {
7813
- return (_ts_parser_delete = Module._ts_parser_delete = Module.asm.ts_parser_delete).apply(null, arguments);
7814
- }, _ts_parser_reset = Module._ts_parser_reset = function() {
7815
- return (_ts_parser_reset = Module._ts_parser_reset = Module.asm.ts_parser_reset).apply(null, arguments);
7816
- }, _ts_parser_set_language = Module._ts_parser_set_language = function() {
7817
- return (_ts_parser_set_language = Module._ts_parser_set_language = Module.asm.ts_parser_set_language).apply(null, arguments);
7818
- }, _ts_parser_timeout_micros = Module._ts_parser_timeout_micros = function() {
7819
- return (_ts_parser_timeout_micros = Module._ts_parser_timeout_micros = Module.asm.ts_parser_timeout_micros).apply(null, arguments);
7820
- }, _ts_parser_set_timeout_micros = Module._ts_parser_set_timeout_micros = function() {
7821
- return (_ts_parser_set_timeout_micros = Module._ts_parser_set_timeout_micros = Module.asm.ts_parser_set_timeout_micros).apply(null, arguments);
7822
- }, _memmove = Module._memmove = function() {
7823
- return (_memmove = Module._memmove = Module.asm.memmove).apply(null, arguments);
7824
- }, _memcmp = Module._memcmp = function() {
7825
- return (_memcmp = Module._memcmp = Module.asm.memcmp).apply(null, arguments);
7826
- }, _ts_query_new = Module._ts_query_new = function() {
7827
- return (_ts_query_new = Module._ts_query_new = Module.asm.ts_query_new).apply(null, arguments);
7828
- }, _ts_query_delete = Module._ts_query_delete = function() {
7829
- return (_ts_query_delete = Module._ts_query_delete = Module.asm.ts_query_delete).apply(null, arguments);
7830
- }, _iswspace = Module._iswspace = function() {
7831
- return (_iswspace = Module._iswspace = Module.asm.iswspace).apply(null, arguments);
7832
- }, _iswalnum = Module._iswalnum = function() {
7833
- return (_iswalnum = Module._iswalnum = Module.asm.iswalnum).apply(null, arguments);
7834
- }, _ts_query_pattern_count = Module._ts_query_pattern_count = function() {
7835
- return (_ts_query_pattern_count = Module._ts_query_pattern_count = Module.asm.ts_query_pattern_count).apply(null, arguments);
7836
- }, _ts_query_capture_count = Module._ts_query_capture_count = function() {
7837
- return (_ts_query_capture_count = Module._ts_query_capture_count = Module.asm.ts_query_capture_count).apply(null, arguments);
7838
- }, _ts_query_string_count = Module._ts_query_string_count = function() {
7839
- return (_ts_query_string_count = Module._ts_query_string_count = Module.asm.ts_query_string_count).apply(null, arguments);
7840
- }, _ts_query_capture_name_for_id = Module._ts_query_capture_name_for_id = function() {
7841
- return (_ts_query_capture_name_for_id = Module._ts_query_capture_name_for_id = Module.asm.ts_query_capture_name_for_id).apply(null, arguments);
7842
- }, _ts_query_string_value_for_id = Module._ts_query_string_value_for_id = function() {
7843
- return (_ts_query_string_value_for_id = Module._ts_query_string_value_for_id = Module.asm.ts_query_string_value_for_id).apply(null, arguments);
7844
- }, _ts_query_predicates_for_pattern = Module._ts_query_predicates_for_pattern = function() {
7845
- return (_ts_query_predicates_for_pattern = Module._ts_query_predicates_for_pattern = Module.asm.ts_query_predicates_for_pattern).apply(null, arguments);
7846
- }, _ts_tree_copy = Module._ts_tree_copy = function() {
7847
- return (_ts_tree_copy = Module._ts_tree_copy = Module.asm.ts_tree_copy).apply(null, arguments);
7848
- }, _ts_tree_delete = Module._ts_tree_delete = function() {
7849
- return (_ts_tree_delete = Module._ts_tree_delete = Module.asm.ts_tree_delete).apply(null, arguments);
7850
- }, _ts_init = Module._ts_init = function() {
7851
- return (_ts_init = Module._ts_init = Module.asm.ts_init).apply(null, arguments);
7852
- }, _ts_parser_new_wasm = Module._ts_parser_new_wasm = function() {
7853
- return (_ts_parser_new_wasm = Module._ts_parser_new_wasm = Module.asm.ts_parser_new_wasm).apply(null, arguments);
7854
- }, _ts_parser_enable_logger_wasm = Module._ts_parser_enable_logger_wasm = function() {
7855
- return (_ts_parser_enable_logger_wasm = Module._ts_parser_enable_logger_wasm = Module.asm.ts_parser_enable_logger_wasm).apply(null, arguments);
7856
- }, _ts_parser_parse_wasm = Module._ts_parser_parse_wasm = function() {
7857
- return (_ts_parser_parse_wasm = Module._ts_parser_parse_wasm = Module.asm.ts_parser_parse_wasm).apply(null, arguments);
7858
- }, _ts_language_type_is_named_wasm = Module._ts_language_type_is_named_wasm = function() {
7859
- return (_ts_language_type_is_named_wasm = Module._ts_language_type_is_named_wasm = Module.asm.ts_language_type_is_named_wasm).apply(null, arguments);
7860
- }, _ts_language_type_is_visible_wasm = Module._ts_language_type_is_visible_wasm = function() {
7861
- return (_ts_language_type_is_visible_wasm = Module._ts_language_type_is_visible_wasm = Module.asm.ts_language_type_is_visible_wasm).apply(null, arguments);
7862
- }, _ts_tree_root_node_wasm = Module._ts_tree_root_node_wasm = function() {
7863
- return (_ts_tree_root_node_wasm = Module._ts_tree_root_node_wasm = Module.asm.ts_tree_root_node_wasm).apply(null, arguments);
7864
- }, _ts_tree_edit_wasm = Module._ts_tree_edit_wasm = function() {
7865
- return (_ts_tree_edit_wasm = Module._ts_tree_edit_wasm = Module.asm.ts_tree_edit_wasm).apply(null, arguments);
7866
- }, _ts_tree_get_changed_ranges_wasm = Module._ts_tree_get_changed_ranges_wasm = function() {
7867
- return (_ts_tree_get_changed_ranges_wasm = Module._ts_tree_get_changed_ranges_wasm = Module.asm.ts_tree_get_changed_ranges_wasm).apply(null, arguments);
7868
- }, _ts_tree_cursor_new_wasm = Module._ts_tree_cursor_new_wasm = function() {
7869
- return (_ts_tree_cursor_new_wasm = Module._ts_tree_cursor_new_wasm = Module.asm.ts_tree_cursor_new_wasm).apply(null, arguments);
7870
- }, _ts_tree_cursor_delete_wasm = Module._ts_tree_cursor_delete_wasm = function() {
7871
- return (_ts_tree_cursor_delete_wasm = Module._ts_tree_cursor_delete_wasm = Module.asm.ts_tree_cursor_delete_wasm).apply(null, arguments);
7872
- }, _ts_tree_cursor_reset_wasm = Module._ts_tree_cursor_reset_wasm = function() {
7873
- return (_ts_tree_cursor_reset_wasm = Module._ts_tree_cursor_reset_wasm = Module.asm.ts_tree_cursor_reset_wasm).apply(null, arguments);
7874
- }, _ts_tree_cursor_goto_first_child_wasm = Module._ts_tree_cursor_goto_first_child_wasm = function() {
7875
- return (_ts_tree_cursor_goto_first_child_wasm = Module._ts_tree_cursor_goto_first_child_wasm = Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null, arguments);
7876
- }, _ts_tree_cursor_goto_next_sibling_wasm = Module._ts_tree_cursor_goto_next_sibling_wasm = function() {
7877
- return (_ts_tree_cursor_goto_next_sibling_wasm = Module._ts_tree_cursor_goto_next_sibling_wasm = Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null, arguments);
7878
- }, _ts_tree_cursor_goto_parent_wasm = Module._ts_tree_cursor_goto_parent_wasm = function() {
7879
- return (_ts_tree_cursor_goto_parent_wasm = Module._ts_tree_cursor_goto_parent_wasm = Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null, arguments);
7880
- }, _ts_tree_cursor_current_node_type_id_wasm = Module._ts_tree_cursor_current_node_type_id_wasm = function() {
7881
- return (_ts_tree_cursor_current_node_type_id_wasm = Module._ts_tree_cursor_current_node_type_id_wasm = Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null, arguments);
7882
- }, _ts_tree_cursor_current_node_is_named_wasm = Module._ts_tree_cursor_current_node_is_named_wasm = function() {
7883
- return (_ts_tree_cursor_current_node_is_named_wasm = Module._ts_tree_cursor_current_node_is_named_wasm = Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null, arguments);
7884
- }, _ts_tree_cursor_current_node_is_missing_wasm = Module._ts_tree_cursor_current_node_is_missing_wasm = function() {
7885
- return (_ts_tree_cursor_current_node_is_missing_wasm = Module._ts_tree_cursor_current_node_is_missing_wasm = Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null, arguments);
7886
- }, _ts_tree_cursor_current_node_id_wasm = Module._ts_tree_cursor_current_node_id_wasm = function() {
7887
- return (_ts_tree_cursor_current_node_id_wasm = Module._ts_tree_cursor_current_node_id_wasm = Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null, arguments);
7888
- }, _ts_tree_cursor_start_position_wasm = Module._ts_tree_cursor_start_position_wasm = function() {
7889
- return (_ts_tree_cursor_start_position_wasm = Module._ts_tree_cursor_start_position_wasm = Module.asm.ts_tree_cursor_start_position_wasm).apply(null, arguments);
7890
- }, _ts_tree_cursor_end_position_wasm = Module._ts_tree_cursor_end_position_wasm = function() {
7891
- return (_ts_tree_cursor_end_position_wasm = Module._ts_tree_cursor_end_position_wasm = Module.asm.ts_tree_cursor_end_position_wasm).apply(null, arguments);
7892
- }, _ts_tree_cursor_start_index_wasm = Module._ts_tree_cursor_start_index_wasm = function() {
7893
- return (_ts_tree_cursor_start_index_wasm = Module._ts_tree_cursor_start_index_wasm = Module.asm.ts_tree_cursor_start_index_wasm).apply(null, arguments);
7894
- }, _ts_tree_cursor_end_index_wasm = Module._ts_tree_cursor_end_index_wasm = function() {
7895
- return (_ts_tree_cursor_end_index_wasm = Module._ts_tree_cursor_end_index_wasm = Module.asm.ts_tree_cursor_end_index_wasm).apply(null, arguments);
7896
- }, _ts_tree_cursor_current_field_id_wasm = Module._ts_tree_cursor_current_field_id_wasm = function() {
7897
- return (_ts_tree_cursor_current_field_id_wasm = Module._ts_tree_cursor_current_field_id_wasm = Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null, arguments);
7898
- }, _ts_tree_cursor_current_node_wasm = Module._ts_tree_cursor_current_node_wasm = function() {
7899
- return (_ts_tree_cursor_current_node_wasm = Module._ts_tree_cursor_current_node_wasm = Module.asm.ts_tree_cursor_current_node_wasm).apply(null, arguments);
7900
- }, _ts_node_symbol_wasm = Module._ts_node_symbol_wasm = function() {
7901
- return (_ts_node_symbol_wasm = Module._ts_node_symbol_wasm = Module.asm.ts_node_symbol_wasm).apply(null, arguments);
7902
- }, _ts_node_child_count_wasm = Module._ts_node_child_count_wasm = function() {
7903
- return (_ts_node_child_count_wasm = Module._ts_node_child_count_wasm = Module.asm.ts_node_child_count_wasm).apply(null, arguments);
7904
- }, _ts_node_named_child_count_wasm = Module._ts_node_named_child_count_wasm = function() {
7905
- return (_ts_node_named_child_count_wasm = Module._ts_node_named_child_count_wasm = Module.asm.ts_node_named_child_count_wasm).apply(null, arguments);
7906
- }, _ts_node_child_wasm = Module._ts_node_child_wasm = function() {
7907
- return (_ts_node_child_wasm = Module._ts_node_child_wasm = Module.asm.ts_node_child_wasm).apply(null, arguments);
7908
- }, _ts_node_named_child_wasm = Module._ts_node_named_child_wasm = function() {
7909
- return (_ts_node_named_child_wasm = Module._ts_node_named_child_wasm = Module.asm.ts_node_named_child_wasm).apply(null, arguments);
7910
- }, _ts_node_child_by_field_id_wasm = Module._ts_node_child_by_field_id_wasm = function() {
7911
- return (_ts_node_child_by_field_id_wasm = Module._ts_node_child_by_field_id_wasm = Module.asm.ts_node_child_by_field_id_wasm).apply(null, arguments);
7912
- }, _ts_node_next_sibling_wasm = Module._ts_node_next_sibling_wasm = function() {
7913
- return (_ts_node_next_sibling_wasm = Module._ts_node_next_sibling_wasm = Module.asm.ts_node_next_sibling_wasm).apply(null, arguments);
7914
- }, _ts_node_prev_sibling_wasm = Module._ts_node_prev_sibling_wasm = function() {
7915
- return (_ts_node_prev_sibling_wasm = Module._ts_node_prev_sibling_wasm = Module.asm.ts_node_prev_sibling_wasm).apply(null, arguments);
7916
- }, _ts_node_next_named_sibling_wasm = Module._ts_node_next_named_sibling_wasm = function() {
7917
- return (_ts_node_next_named_sibling_wasm = Module._ts_node_next_named_sibling_wasm = Module.asm.ts_node_next_named_sibling_wasm).apply(null, arguments);
7918
- }, _ts_node_prev_named_sibling_wasm = Module._ts_node_prev_named_sibling_wasm = function() {
7919
- return (_ts_node_prev_named_sibling_wasm = Module._ts_node_prev_named_sibling_wasm = Module.asm.ts_node_prev_named_sibling_wasm).apply(null, arguments);
7920
- }, _ts_node_parent_wasm = Module._ts_node_parent_wasm = function() {
7921
- return (_ts_node_parent_wasm = Module._ts_node_parent_wasm = Module.asm.ts_node_parent_wasm).apply(null, arguments);
7922
- }, _ts_node_descendant_for_index_wasm = Module._ts_node_descendant_for_index_wasm = function() {
7923
- return (_ts_node_descendant_for_index_wasm = Module._ts_node_descendant_for_index_wasm = Module.asm.ts_node_descendant_for_index_wasm).apply(null, arguments);
7924
- }, _ts_node_named_descendant_for_index_wasm = Module._ts_node_named_descendant_for_index_wasm = function() {
7925
- return (_ts_node_named_descendant_for_index_wasm = Module._ts_node_named_descendant_for_index_wasm = Module.asm.ts_node_named_descendant_for_index_wasm).apply(null, arguments);
7926
- }, _ts_node_descendant_for_position_wasm = Module._ts_node_descendant_for_position_wasm = function() {
7927
- return (_ts_node_descendant_for_position_wasm = Module._ts_node_descendant_for_position_wasm = Module.asm.ts_node_descendant_for_position_wasm).apply(null, arguments);
7928
- }, _ts_node_named_descendant_for_position_wasm = Module._ts_node_named_descendant_for_position_wasm = function() {
7929
- return (_ts_node_named_descendant_for_position_wasm = Module._ts_node_named_descendant_for_position_wasm = Module.asm.ts_node_named_descendant_for_position_wasm).apply(null, arguments);
7930
- }, _ts_node_start_point_wasm = Module._ts_node_start_point_wasm = function() {
7931
- return (_ts_node_start_point_wasm = Module._ts_node_start_point_wasm = Module.asm.ts_node_start_point_wasm).apply(null, arguments);
7932
- }, _ts_node_end_point_wasm = Module._ts_node_end_point_wasm = function() {
7933
- return (_ts_node_end_point_wasm = Module._ts_node_end_point_wasm = Module.asm.ts_node_end_point_wasm).apply(null, arguments);
7934
- }, _ts_node_start_index_wasm = Module._ts_node_start_index_wasm = function() {
7935
- return (_ts_node_start_index_wasm = Module._ts_node_start_index_wasm = Module.asm.ts_node_start_index_wasm).apply(null, arguments);
7936
- }, _ts_node_end_index_wasm = Module._ts_node_end_index_wasm = function() {
7937
- return (_ts_node_end_index_wasm = Module._ts_node_end_index_wasm = Module.asm.ts_node_end_index_wasm).apply(null, arguments);
7938
- }, _ts_node_to_string_wasm = Module._ts_node_to_string_wasm = function() {
7939
- return (_ts_node_to_string_wasm = Module._ts_node_to_string_wasm = Module.asm.ts_node_to_string_wasm).apply(null, arguments);
7940
- }, _ts_node_children_wasm = Module._ts_node_children_wasm = function() {
7941
- return (_ts_node_children_wasm = Module._ts_node_children_wasm = Module.asm.ts_node_children_wasm).apply(null, arguments);
7942
- }, _ts_node_named_children_wasm = Module._ts_node_named_children_wasm = function() {
7943
- return (_ts_node_named_children_wasm = Module._ts_node_named_children_wasm = Module.asm.ts_node_named_children_wasm).apply(null, arguments);
7944
- }, _ts_node_descendants_of_type_wasm = Module._ts_node_descendants_of_type_wasm = function() {
7945
- return (_ts_node_descendants_of_type_wasm = Module._ts_node_descendants_of_type_wasm = Module.asm.ts_node_descendants_of_type_wasm).apply(null, arguments);
7946
- }, _ts_node_is_named_wasm = Module._ts_node_is_named_wasm = function() {
7947
- return (_ts_node_is_named_wasm = Module._ts_node_is_named_wasm = Module.asm.ts_node_is_named_wasm).apply(null, arguments);
7948
- }, _ts_node_has_changes_wasm = Module._ts_node_has_changes_wasm = function() {
7949
- return (_ts_node_has_changes_wasm = Module._ts_node_has_changes_wasm = Module.asm.ts_node_has_changes_wasm).apply(null, arguments);
7950
- }, _ts_node_has_error_wasm = Module._ts_node_has_error_wasm = function() {
7951
- return (_ts_node_has_error_wasm = Module._ts_node_has_error_wasm = Module.asm.ts_node_has_error_wasm).apply(null, arguments);
7952
- }, _ts_node_is_missing_wasm = Module._ts_node_is_missing_wasm = function() {
7953
- return (_ts_node_is_missing_wasm = Module._ts_node_is_missing_wasm = Module.asm.ts_node_is_missing_wasm).apply(null, arguments);
7954
- }, _ts_query_matches_wasm = Module._ts_query_matches_wasm = function() {
7955
- return (_ts_query_matches_wasm = Module._ts_query_matches_wasm = Module.asm.ts_query_matches_wasm).apply(null, arguments);
7956
- }, _ts_query_captures_wasm = Module._ts_query_captures_wasm = function() {
7957
- return (_ts_query_captures_wasm = Module._ts_query_captures_wasm = Module.asm.ts_query_captures_wasm).apply(null, arguments);
7958
- }, ___cxa_atexit = Module.___cxa_atexit = function() {
7959
- return (___cxa_atexit = Module.___cxa_atexit = Module.asm.__cxa_atexit).apply(null, arguments);
7960
- }, _iswdigit = Module._iswdigit = function() {
7961
- return (_iswdigit = Module._iswdigit = Module.asm.iswdigit).apply(null, arguments);
7962
- }, _iswalpha = Module._iswalpha = function() {
7963
- return (_iswalpha = Module._iswalpha = Module.asm.iswalpha).apply(null, arguments);
7964
- }, _iswlower = Module._iswlower = function() {
7965
- return (_iswlower = Module._iswlower = Module.asm.iswlower).apply(null, arguments);
7966
- }, _memchr = Module._memchr = function() {
7967
- return (_memchr = Module._memchr = Module.asm.memchr).apply(null, arguments);
7968
- }, _strlen = Module._strlen = function() {
7969
- return (_strlen = Module._strlen = Module.asm.strlen).apply(null, arguments);
7970
- }, _towupper = Module._towupper = function() {
7971
- return (_towupper = Module._towupper = Module.asm.towupper).apply(null, arguments);
7972
- }, _setThrew = Module._setThrew = function() {
7973
- return (_setThrew = Module._setThrew = Module.asm.setThrew).apply(null, arguments);
7974
- }, stackSave = Module.stackSave = function() {
7975
- return (stackSave = Module.stackSave = Module.asm.stackSave).apply(null, arguments);
7976
- }, stackRestore = Module.stackRestore = function() {
7977
- return (stackRestore = Module.stackRestore = Module.asm.stackRestore).apply(null, arguments);
7978
- }, stackAlloc = Module.stackAlloc = function() {
7979
- return (stackAlloc = Module.stackAlloc = Module.asm.stackAlloc).apply(null, arguments);
7980
- }, __Znwm = Module.__Znwm = function() {
7981
- return (__Znwm = Module.__Znwm = Module.asm._Znwm).apply(null, arguments);
7982
- }, __ZdlPv = Module.__ZdlPv = function() {
7983
- return (__ZdlPv = Module.__ZdlPv = Module.asm._ZdlPv).apply(null, arguments);
7984
- }, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = function() {
7985
- return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null, arguments);
7986
- }, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = function() {
7987
- return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null, arguments);
7988
- }, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = function() {
7989
- return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null, arguments);
7990
- }, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = function() {
7991
- return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null, arguments);
7992
- }, __ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = function() {
7993
- return (__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm = Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null, arguments);
7994
- }, __ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = function() {
7995
- return (__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc = Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null, arguments);
7996
- }, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = function() {
7997
- return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null, arguments);
7998
- }, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = function() {
7999
- return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null, arguments);
8000
- }, __ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = function() {
8001
- return (__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw = Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null, arguments);
8002
- }, dynCall_jiji = Module.dynCall_jiji = function() {
8003
- return (dynCall_jiji = Module.dynCall_jiji = Module.asm.dynCall_jiji).apply(null, arguments);
8004
- }, _orig$ts_parser_timeout_micros = Module._orig$ts_parser_timeout_micros = function() {
8005
- return (_orig$ts_parser_timeout_micros = Module._orig$ts_parser_timeout_micros = Module.asm.orig$ts_parser_timeout_micros).apply(null, arguments);
8006
- }, _orig$ts_parser_set_timeout_micros = Module._orig$ts_parser_set_timeout_micros = function() {
8007
- return (_orig$ts_parser_set_timeout_micros = Module._orig$ts_parser_set_timeout_micros = Module.asm.orig$ts_parser_set_timeout_micros).apply(null, arguments);
8008
- }, calledRun;
8009
- function callMain(e) {
8010
- var t = Module._main;
8011
- if (t) {
8012
- (e = e || []).unshift(thisProgram);
8013
- var r = e.length, _ = stackAlloc(4 * (r + 1)), n = _ >> 2;
8014
- e.forEach((e2) => {
8015
- HEAP32[n++] = allocateUTF8OnStack(e2);
8016
- }), HEAP32[n] = 0;
8017
- try {
8018
- var s = t(r, _);
8019
- return exitJS(s, true), s;
8020
- } catch (e2) {
8021
- return handleException(e2);
8022
- }
8023
- }
8024
- }
8025
- Module.AsciiToString = AsciiToString, Module.stringToUTF16 = stringToUTF16, dependenciesFulfilled = function e() {
8026
- calledRun || run(), calledRun || (dependenciesFulfilled = e);
8027
- };
8028
- var dylibsLoaded = false;
8029
- function run(e) {
8030
- function t() {
8031
- calledRun || (calledRun = true, Module.calledRun = true, ABORT || (initRuntime(), preMain(), Module.onRuntimeInitialized && Module.onRuntimeInitialized(), shouldRunNow && callMain(e), postRun()));
8032
- }
8033
- e = e || arguments_, runDependencies > 0 || !dylibsLoaded && (preloadDylibs(), dylibsLoaded = true, runDependencies > 0) || (preRun(), runDependencies > 0 || (Module.setStatus ? (Module.setStatus("Running..."), setTimeout(function() {
8034
- setTimeout(function() {
8035
- Module.setStatus("");
8036
- }, 1), t();
8037
- }, 1)) : t()));
8038
- }
8039
- if (Module.preInit)
8040
- for (typeof Module.preInit == "function" && (Module.preInit = [Module.preInit]);Module.preInit.length > 0; )
8041
- Module.preInit.pop()();
8042
- var shouldRunNow = true;
8043
- Module.noInitialRun && (shouldRunNow = false), run();
8044
- const C = Module, INTERNAL = {}, SIZE_OF_INT = 4, SIZE_OF_NODE = 5 * SIZE_OF_INT, SIZE_OF_POINT = 2 * SIZE_OF_INT, SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT, ZERO_POINT = { row: 0, column: 0 }, QUERY_WORD_REGEX = /[\w-.]*/g, PREDICATE_STEP_TYPE_CAPTURE = 1, PREDICATE_STEP_TYPE_STRING = 2, LANGUAGE_FUNCTION_REGEX = /^_?tree_sitter_\w+/;
8045
- var VERSION, MIN_COMPATIBLE_VERSION, TRANSFER_BUFFER, currentParseCallback, currentLogCallback;
8046
-
8047
- class ParserImpl {
8048
- static init() {
8049
- TRANSFER_BUFFER = C._ts_init(), VERSION = getValue(TRANSFER_BUFFER, "i32"), MIN_COMPATIBLE_VERSION = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
8050
- }
8051
- initialize() {
8052
- C._ts_parser_new_wasm(), this[0] = getValue(TRANSFER_BUFFER, "i32"), this[1] = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
8053
- }
8054
- delete() {
8055
- C._ts_parser_delete(this[0]), C._free(this[1]), this[0] = 0, this[1] = 0;
8056
- }
8057
- setLanguage(e) {
8058
- let t;
8059
- if (e) {
8060
- if (e.constructor !== Language)
8061
- throw new Error("Argument must be a Language");
8062
- {
8063
- t = e[0];
8064
- const r = C._ts_language_version(t);
8065
- if (r < MIN_COMPATIBLE_VERSION || VERSION < r)
8066
- throw new Error(`Incompatible language version ${r}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`);
8067
- }
8068
- } else
8069
- t = 0, e = null;
8070
- return this.language = e, C._ts_parser_set_language(this[0], t), this;
8071
- }
8072
- getLanguage() {
8073
- return this.language;
8074
- }
8075
- parse(e, t, r) {
8076
- if (typeof e == "string")
8077
- currentParseCallback = (t2, r2, _2) => e.slice(t2, _2);
8078
- else {
8079
- if (typeof e != "function")
8080
- throw new Error("Argument must be a string or a function");
8081
- currentParseCallback = e;
8082
- }
8083
- this.logCallback ? (currentLogCallback = this.logCallback, C._ts_parser_enable_logger_wasm(this[0], 1)) : (currentLogCallback = null, C._ts_parser_enable_logger_wasm(this[0], 0));
8084
- let _ = 0, n = 0;
8085
- if (r && r.includedRanges) {
8086
- _ = r.includedRanges.length, n = C._calloc(_, SIZE_OF_RANGE);
8087
- let e2 = n;
8088
- for (let t2 = 0;t2 < _; t2++)
8089
- marshalRange(e2, r.includedRanges[t2]), e2 += SIZE_OF_RANGE;
8090
- }
8091
- const s = C._ts_parser_parse_wasm(this[0], this[1], t ? t[0] : 0, n, _);
8092
- if (!s)
8093
- throw currentParseCallback = null, currentLogCallback = null, new Error("Parsing failed");
8094
- const a = new Tree(INTERNAL, s, this.language, currentParseCallback);
8095
- return currentParseCallback = null, currentLogCallback = null, a;
8096
- }
8097
- reset() {
8098
- C._ts_parser_reset(this[0]);
8099
- }
8100
- setTimeoutMicros(e) {
8101
- C._ts_parser_set_timeout_micros(this[0], e);
8102
- }
8103
- getTimeoutMicros() {
8104
- return C._ts_parser_timeout_micros(this[0]);
8105
- }
8106
- setLogger(e) {
8107
- if (e) {
8108
- if (typeof e != "function")
8109
- throw new Error("Logger callback must be a function");
8110
- } else
8111
- e = null;
8112
- return this.logCallback = e, this;
8113
- }
8114
- getLogger() {
8115
- return this.logCallback;
8116
- }
8117
- }
8118
-
8119
- class Tree {
8120
- constructor(e, t, r, _) {
8121
- assertInternal(e), this[0] = t, this.language = r, this.textCallback = _;
8122
- }
8123
- copy() {
8124
- const e = C._ts_tree_copy(this[0]);
8125
- return new Tree(INTERNAL, e, this.language, this.textCallback);
8126
- }
8127
- delete() {
8128
- C._ts_tree_delete(this[0]), this[0] = 0;
8129
- }
8130
- edit(e) {
8131
- marshalEdit(e), C._ts_tree_edit_wasm(this[0]);
8132
- }
8133
- get rootNode() {
8134
- return C._ts_tree_root_node_wasm(this[0]), unmarshalNode(this);
8135
- }
8136
- getLanguage() {
8137
- return this.language;
8138
- }
8139
- walk() {
8140
- return this.rootNode.walk();
8141
- }
8142
- getChangedRanges(e) {
8143
- if (e.constructor !== Tree)
8144
- throw new TypeError("Argument must be a Tree");
8145
- C._ts_tree_get_changed_ranges_wasm(this[0], e[0]);
8146
- const t = getValue(TRANSFER_BUFFER, "i32"), r = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _ = new Array(t);
8147
- if (t > 0) {
8148
- let e2 = r;
8149
- for (let r2 = 0;r2 < t; r2++)
8150
- _[r2] = unmarshalRange(e2), e2 += SIZE_OF_RANGE;
8151
- C._free(r);
8152
- }
8153
- return _;
8154
- }
8155
- }
8156
-
8157
- class Node {
8158
- constructor(e, t) {
8159
- assertInternal(e), this.tree = t;
8160
- }
8161
- get typeId() {
8162
- return marshalNode(this), C._ts_node_symbol_wasm(this.tree[0]);
8163
- }
8164
- get type() {
8165
- return this.tree.language.types[this.typeId] || "ERROR";
8166
- }
8167
- get endPosition() {
8168
- return marshalNode(this), C._ts_node_end_point_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
8169
- }
8170
- get endIndex() {
8171
- return marshalNode(this), C._ts_node_end_index_wasm(this.tree[0]);
8172
- }
8173
- get text() {
8174
- return getText(this.tree, this.startIndex, this.endIndex);
8175
- }
8176
- isNamed() {
8177
- return marshalNode(this), C._ts_node_is_named_wasm(this.tree[0]) === 1;
8178
- }
8179
- hasError() {
8180
- return marshalNode(this), C._ts_node_has_error_wasm(this.tree[0]) === 1;
8181
- }
8182
- hasChanges() {
8183
- return marshalNode(this), C._ts_node_has_changes_wasm(this.tree[0]) === 1;
8184
- }
8185
- isMissing() {
8186
- return marshalNode(this), C._ts_node_is_missing_wasm(this.tree[0]) === 1;
8187
- }
8188
- equals(e) {
8189
- return this.id === e.id;
8190
- }
8191
- child(e) {
8192
- return marshalNode(this), C._ts_node_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
8193
- }
8194
- namedChild(e) {
8195
- return marshalNode(this), C._ts_node_named_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
8196
- }
8197
- childForFieldId(e) {
8198
- return marshalNode(this), C._ts_node_child_by_field_id_wasm(this.tree[0], e), unmarshalNode(this.tree);
8199
- }
8200
- childForFieldName(e) {
8201
- const t = this.tree.language.fields.indexOf(e);
8202
- if (t !== -1)
8203
- return this.childForFieldId(t);
8204
- }
8205
- get childCount() {
8206
- return marshalNode(this), C._ts_node_child_count_wasm(this.tree[0]);
8207
- }
8208
- get namedChildCount() {
8209
- return marshalNode(this), C._ts_node_named_child_count_wasm(this.tree[0]);
8210
- }
8211
- get firstChild() {
8212
- return this.child(0);
8213
- }
8214
- get firstNamedChild() {
8215
- return this.namedChild(0);
8216
- }
8217
- get lastChild() {
8218
- return this.child(this.childCount - 1);
8219
- }
8220
- get lastNamedChild() {
8221
- return this.namedChild(this.namedChildCount - 1);
8222
- }
8223
- get children() {
8224
- if (!this._children) {
8225
- marshalNode(this), C._ts_node_children_wasm(this.tree[0]);
8226
- const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
8227
- if (this._children = new Array(e), e > 0) {
8228
- let r = t;
8229
- for (let t2 = 0;t2 < e; t2++)
8230
- this._children[t2] = unmarshalNode(this.tree, r), r += SIZE_OF_NODE;
8231
- C._free(t);
8232
- }
8233
- }
8234
- return this._children;
8235
- }
8236
- get namedChildren() {
8237
- if (!this._namedChildren) {
8238
- marshalNode(this), C._ts_node_named_children_wasm(this.tree[0]);
8239
- const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
8240
- if (this._namedChildren = new Array(e), e > 0) {
8241
- let r = t;
8242
- for (let t2 = 0;t2 < e; t2++)
8243
- this._namedChildren[t2] = unmarshalNode(this.tree, r), r += SIZE_OF_NODE;
8244
- C._free(t);
8245
- }
8246
- }
8247
- return this._namedChildren;
8248
- }
8249
- descendantsOfType(e, t, r) {
8250
- Array.isArray(e) || (e = [e]), t || (t = ZERO_POINT), r || (r = ZERO_POINT);
8251
- const _ = [], n = this.tree.language.types;
8252
- for (let t2 = 0, r2 = n.length;t2 < r2; t2++)
8253
- e.includes(n[t2]) && _.push(t2);
8254
- const s = C._malloc(SIZE_OF_INT * _.length);
8255
- for (let e2 = 0, t2 = _.length;e2 < t2; e2++)
8256
- setValue(s + e2 * SIZE_OF_INT, _[e2], "i32");
8257
- marshalNode(this), C._ts_node_descendants_of_type_wasm(this.tree[0], s, _.length, t.row, t.column, r.row, r.column);
8258
- const a = getValue(TRANSFER_BUFFER, "i32"), o = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), i = new Array(a);
8259
- if (a > 0) {
8260
- let e2 = o;
8261
- for (let t2 = 0;t2 < a; t2++)
8262
- i[t2] = unmarshalNode(this.tree, e2), e2 += SIZE_OF_NODE;
8263
- }
8264
- return C._free(o), C._free(s), i;
8265
- }
8266
- get nextSibling() {
8267
- return marshalNode(this), C._ts_node_next_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
8268
- }
8269
- get previousSibling() {
8270
- return marshalNode(this), C._ts_node_prev_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
8271
- }
8272
- get nextNamedSibling() {
8273
- return marshalNode(this), C._ts_node_next_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
8274
- }
8275
- get previousNamedSibling() {
8276
- return marshalNode(this), C._ts_node_prev_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
8277
- }
8278
- get parent() {
8279
- return marshalNode(this), C._ts_node_parent_wasm(this.tree[0]), unmarshalNode(this.tree);
8280
- }
8281
- descendantForIndex(e, t = e) {
8282
- if (typeof e != "number" || typeof t != "number")
8283
- throw new Error("Arguments must be numbers");
8284
- marshalNode(this);
8285
- let r = TRANSFER_BUFFER + SIZE_OF_NODE;
8286
- return setValue(r, e, "i32"), setValue(r + SIZE_OF_INT, t, "i32"), C._ts_node_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
8287
- }
8288
- namedDescendantForIndex(e, t = e) {
8289
- if (typeof e != "number" || typeof t != "number")
8290
- throw new Error("Arguments must be numbers");
8291
- marshalNode(this);
8292
- let r = TRANSFER_BUFFER + SIZE_OF_NODE;
8293
- return setValue(r, e, "i32"), setValue(r + SIZE_OF_INT, t, "i32"), C._ts_node_named_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
8294
- }
8295
- descendantForPosition(e, t = e) {
8296
- if (!isPoint(e) || !isPoint(t))
8297
- throw new Error("Arguments must be {row, column} objects");
8298
- marshalNode(this);
8299
- let r = TRANSFER_BUFFER + SIZE_OF_NODE;
8300
- return marshalPoint(r, e), marshalPoint(r + SIZE_OF_POINT, t), C._ts_node_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
8301
- }
8302
- namedDescendantForPosition(e, t = e) {
8303
- if (!isPoint(e) || !isPoint(t))
8304
- throw new Error("Arguments must be {row, column} objects");
8305
- marshalNode(this);
8306
- let r = TRANSFER_BUFFER + SIZE_OF_NODE;
8307
- return marshalPoint(r, e), marshalPoint(r + SIZE_OF_POINT, t), C._ts_node_named_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
8308
- }
8309
- walk() {
8310
- return marshalNode(this), C._ts_tree_cursor_new_wasm(this.tree[0]), new TreeCursor(INTERNAL, this.tree);
8311
- }
8312
- toString() {
8313
- marshalNode(this);
8314
- const e = C._ts_node_to_string_wasm(this.tree[0]), t = AsciiToString(e);
8315
- return C._free(e), t;
8316
- }
8317
- }
8318
-
8319
- class TreeCursor {
8320
- constructor(e, t) {
8321
- assertInternal(e), this.tree = t, unmarshalTreeCursor(this);
8322
- }
8323
- delete() {
8324
- marshalTreeCursor(this), C._ts_tree_cursor_delete_wasm(this.tree[0]), this[0] = this[1] = this[2] = 0;
8325
- }
8326
- reset(e) {
8327
- marshalNode(e), marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE), C._ts_tree_cursor_reset_wasm(this.tree[0]), unmarshalTreeCursor(this);
8328
- }
8329
- get nodeType() {
8330
- return this.tree.language.types[this.nodeTypeId] || "ERROR";
8331
- }
8332
- get nodeTypeId() {
8333
- return marshalTreeCursor(this), C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);
8334
- }
8335
- get nodeId() {
8336
- return marshalTreeCursor(this), C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);
8337
- }
8338
- get nodeIsNamed() {
8339
- return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;
8340
- }
8341
- get nodeIsMissing() {
8342
- return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;
8343
- }
8344
- get nodeText() {
8345
- marshalTreeCursor(this);
8346
- const e = C._ts_tree_cursor_start_index_wasm(this.tree[0]), t = C._ts_tree_cursor_end_index_wasm(this.tree[0]);
8347
- return getText(this.tree, e, t);
8348
- }
8349
- get startPosition() {
8350
- return marshalTreeCursor(this), C._ts_tree_cursor_start_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
8351
- }
8352
- get endPosition() {
8353
- return marshalTreeCursor(this), C._ts_tree_cursor_end_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
8354
- }
8355
- get startIndex() {
8356
- return marshalTreeCursor(this), C._ts_tree_cursor_start_index_wasm(this.tree[0]);
8357
- }
8358
- get endIndex() {
8359
- return marshalTreeCursor(this), C._ts_tree_cursor_end_index_wasm(this.tree[0]);
8360
- }
8361
- currentNode() {
8362
- return marshalTreeCursor(this), C._ts_tree_cursor_current_node_wasm(this.tree[0]), unmarshalNode(this.tree);
8363
- }
8364
- currentFieldId() {
8365
- return marshalTreeCursor(this), C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);
8366
- }
8367
- currentFieldName() {
8368
- return this.tree.language.fields[this.currentFieldId()];
8369
- }
8370
- gotoFirstChild() {
8371
- marshalTreeCursor(this);
8372
- const e = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);
8373
- return unmarshalTreeCursor(this), e === 1;
8374
- }
8375
- gotoNextSibling() {
8376
- marshalTreeCursor(this);
8377
- const e = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);
8378
- return unmarshalTreeCursor(this), e === 1;
8379
- }
8380
- gotoParent() {
8381
- marshalTreeCursor(this);
8382
- const e = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);
8383
- return unmarshalTreeCursor(this), e === 1;
8384
- }
8385
- }
8386
-
8387
- class Language {
8388
- constructor(e, t) {
8389
- assertInternal(e), this[0] = t, this.types = new Array(C._ts_language_symbol_count(this[0]));
8390
- for (let e2 = 0, t2 = this.types.length;e2 < t2; e2++)
8391
- C._ts_language_symbol_type(this[0], e2) < 2 && (this.types[e2] = UTF8ToString(C._ts_language_symbol_name(this[0], e2)));
8392
- this.fields = new Array(C._ts_language_field_count(this[0]) + 1);
8393
- for (let e2 = 0, t2 = this.fields.length;e2 < t2; e2++) {
8394
- const t3 = C._ts_language_field_name_for_id(this[0], e2);
8395
- this.fields[e2] = t3 !== 0 ? UTF8ToString(t3) : null;
8396
- }
8397
- }
8398
- get version() {
8399
- return C._ts_language_version(this[0]);
8400
- }
8401
- get fieldCount() {
8402
- return this.fields.length - 1;
8403
- }
8404
- fieldIdForName(e) {
8405
- const t = this.fields.indexOf(e);
8406
- return t !== -1 ? t : null;
8407
- }
8408
- fieldNameForId(e) {
8409
- return this.fields[e] || null;
8410
- }
8411
- idForNodeType(e, t) {
8412
- const r = lengthBytesUTF8(e), _ = C._malloc(r + 1);
8413
- stringToUTF8(e, _, r + 1);
8414
- const n = C._ts_language_symbol_for_name(this[0], _, r, t);
8415
- return C._free(_), n || null;
8416
- }
8417
- get nodeTypeCount() {
8418
- return C._ts_language_symbol_count(this[0]);
8419
- }
8420
- nodeTypeForId(e) {
8421
- const t = C._ts_language_symbol_name(this[0], e);
8422
- return t ? UTF8ToString(t) : null;
8423
- }
8424
- nodeTypeIsNamed(e) {
8425
- return !!C._ts_language_type_is_named_wasm(this[0], e);
8426
- }
8427
- nodeTypeIsVisible(e) {
8428
- return !!C._ts_language_type_is_visible_wasm(this[0], e);
8429
- }
8430
- query(e) {
8431
- const t = lengthBytesUTF8(e), r = C._malloc(t + 1);
8432
- stringToUTF8(e, r, t + 1);
8433
- const _ = C._ts_query_new(this[0], r, t, TRANSFER_BUFFER, TRANSFER_BUFFER + SIZE_OF_INT);
8434
- if (!_) {
8435
- const t2 = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _2 = UTF8ToString(r, getValue(TRANSFER_BUFFER, "i32")).length, n2 = e.substr(_2, 100).split(`
8436
- `)[0];
8437
- let s2, a2 = n2.match(QUERY_WORD_REGEX)[0];
8438
- switch (t2) {
8439
- case 2:
8440
- s2 = new RangeError(`Bad node name '${a2}'`);
8441
- break;
8442
- case 3:
8443
- s2 = new RangeError(`Bad field name '${a2}'`);
8444
- break;
8445
- case 4:
8446
- s2 = new RangeError(`Bad capture name @${a2}`);
8447
- break;
8448
- case 5:
8449
- s2 = new TypeError(`Bad pattern structure at offset ${_2}: '${n2}'...`), a2 = "";
8450
- break;
8451
- default:
8452
- s2 = new SyntaxError(`Bad syntax at offset ${_2}: '${n2}'...`), a2 = "";
8453
- }
8454
- throw s2.index = _2, s2.length = a2.length, C._free(r), s2;
8455
- }
8456
- const n = C._ts_query_string_count(_), s = C._ts_query_capture_count(_), a = C._ts_query_pattern_count(_), o = new Array(s), i = new Array(n);
8457
- for (let e2 = 0;e2 < s; e2++) {
8458
- const t2 = C._ts_query_capture_name_for_id(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
8459
- o[e2] = UTF8ToString(t2, r2);
8460
- }
8461
- for (let e2 = 0;e2 < n; e2++) {
8462
- const t2 = C._ts_query_string_value_for_id(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
8463
- i[e2] = UTF8ToString(t2, r2);
8464
- }
8465
- const l = new Array(a), u = new Array(a), d = new Array(a), c = new Array(a), m = new Array(a);
8466
- for (let e2 = 0;e2 < a; e2++) {
8467
- const t2 = C._ts_query_predicates_for_pattern(_, e2, TRANSFER_BUFFER), r2 = getValue(TRANSFER_BUFFER, "i32");
8468
- c[e2] = [], m[e2] = [];
8469
- const n2 = [];
8470
- let s2 = t2;
8471
- for (let t3 = 0;t3 < r2; t3++) {
8472
- const t4 = getValue(s2, "i32");
8473
- s2 += SIZE_OF_INT;
8474
- const r3 = getValue(s2, "i32");
8475
- if (s2 += SIZE_OF_INT, t4 === PREDICATE_STEP_TYPE_CAPTURE)
8476
- n2.push({ type: "capture", name: o[r3] });
8477
- else if (t4 === PREDICATE_STEP_TYPE_STRING)
8478
- n2.push({ type: "string", value: i[r3] });
8479
- else if (n2.length > 0) {
8480
- if (n2[0].type !== "string")
8481
- throw new Error("Predicates must begin with a literal value");
8482
- const t5 = n2[0].value;
8483
- let r4 = true;
8484
- switch (t5) {
8485
- case "not-eq?":
8486
- r4 = false;
8487
- case "eq?":
8488
- if (n2.length !== 3)
8489
- throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got " + (n2.length - 1));
8490
- if (n2[1].type !== "capture")
8491
- throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${n2[1].value}"`);
8492
- if (n2[2].type === "capture") {
8493
- const t6 = n2[1].name, _3 = n2[2].name;
8494
- m[e2].push(function(e3) {
8495
- let n3, s4;
8496
- for (const r5 of e3)
8497
- r5.name === t6 && (n3 = r5.node), r5.name === _3 && (s4 = r5.node);
8498
- return n3 === undefined || s4 === undefined || n3.text === s4.text === r4;
8499
- });
8500
- } else {
8501
- const t6 = n2[1].name, _3 = n2[2].value;
8502
- m[e2].push(function(e3) {
8503
- for (const n3 of e3)
8504
- if (n3.name === t6)
8505
- return n3.node.text === _3 === r4;
8506
- return true;
8507
- });
8508
- }
8509
- break;
8510
- case "not-match?":
8511
- r4 = false;
8512
- case "match?":
8513
- if (n2.length !== 3)
8514
- throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${n2.length - 1}.`);
8515
- if (n2[1].type !== "capture")
8516
- throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${n2[1].value}".`);
8517
- if (n2[2].type !== "string")
8518
- throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${n2[2].value}.`);
8519
- const _2 = n2[1].name, s3 = new RegExp(n2[2].value);
8520
- m[e2].push(function(e3) {
8521
- for (const t6 of e3)
8522
- if (t6.name === _2)
8523
- return s3.test(t6.node.text) === r4;
8524
- return true;
8525
- });
8526
- break;
8527
- case "set!":
8528
- if (n2.length < 2 || n2.length > 3)
8529
- throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${n2.length - 1}.`);
8530
- if (n2.some((e3) => e3.type !== "string"))
8531
- throw new Error('Arguments to `#set!` predicate must be a strings.".');
8532
- l[e2] || (l[e2] = {}), l[e2][n2[1].value] = n2[2] ? n2[2].value : null;
8533
- break;
8534
- case "is?":
8535
- case "is-not?":
8536
- if (n2.length < 2 || n2.length > 3)
8537
- throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected 1 or 2. Got ${n2.length - 1}.`);
8538
- if (n2.some((e3) => e3.type !== "string"))
8539
- throw new Error(`Arguments to \`#${t5}\` predicate must be a strings.".`);
8540
- const a2 = t5 === "is?" ? u : d;
8541
- a2[e2] || (a2[e2] = {}), a2[e2][n2[1].value] = n2[2] ? n2[2].value : null;
8542
- break;
8543
- default:
8544
- c[e2].push({ operator: t5, operands: n2.slice(1) });
8545
- }
8546
- n2.length = 0;
8547
- }
8548
- }
8549
- Object.freeze(l[e2]), Object.freeze(u[e2]), Object.freeze(d[e2]);
8550
- }
8551
- return C._free(r), new Query(INTERNAL, _, o, m, c, Object.freeze(l), Object.freeze(u), Object.freeze(d));
8552
- }
8553
- static load(e) {
8554
- let t;
8555
- if (e instanceof Uint8Array)
8556
- t = Promise.resolve(e);
8557
- else {
8558
- const r2 = e;
8559
- if (typeof process != "undefined" && process.versions && process.versions.node) {
8560
- const e2 = __require("fs");
8561
- t = Promise.resolve(e2.readFileSync(r2));
8562
- } else
8563
- t = fetch(r2).then((e2) => e2.arrayBuffer().then((t2) => {
8564
- if (e2.ok)
8565
- return new Uint8Array(t2);
8566
- {
8567
- const r3 = new TextDecoder("utf-8").decode(t2);
8568
- throw new Error(`Language.load failed with status ${e2.status}.
8569
-
8570
- ${r3}`);
8571
- }
8572
- }));
8573
- }
8574
- const r = typeof loadSideModule == "function" ? loadSideModule : loadWebAssemblyModule;
8575
- return t.then((e2) => r(e2, { loadAsync: true })).then((e2) => {
8576
- const t2 = Object.keys(e2), r2 = t2.find((e3) => LANGUAGE_FUNCTION_REGEX.test(e3) && !e3.includes("external_scanner_"));
8577
- r2 || console.log(`Couldn't find language function in WASM file. Symbols:
8578
- ${JSON.stringify(t2, null, 2)}`);
8579
- const _ = e2[r2]();
8580
- return new Language(INTERNAL, _);
8581
- });
8582
- }
8583
- }
8584
-
8585
- class Query {
8586
- constructor(e, t, r, _, n, s, a, o) {
8587
- assertInternal(e), this[0] = t, this.captureNames = r, this.textPredicates = _, this.predicates = n, this.setProperties = s, this.assertedProperties = a, this.refutedProperties = o, this.exceededMatchLimit = false;
8588
- }
8589
- delete() {
8590
- C._ts_query_delete(this[0]), this[0] = 0;
8591
- }
8592
- matches(e, t, r, _) {
8593
- t || (t = ZERO_POINT), r || (r = ZERO_POINT), _ || (_ = {});
8594
- let n = _.matchLimit;
8595
- if (n === undefined)
8596
- n = 0;
8597
- else if (typeof n != "number")
8598
- throw new Error("Arguments must be numbers");
8599
- marshalNode(e), C._ts_query_matches_wasm(this[0], e.tree[0], t.row, t.column, r.row, r.column, n);
8600
- const s = getValue(TRANSFER_BUFFER, "i32"), a = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), i = new Array(s);
8601
- this.exceededMatchLimit = !!o;
8602
- let l = 0, u = a;
8603
- for (let t2 = 0;t2 < s; t2++) {
8604
- const r2 = getValue(u, "i32");
8605
- u += SIZE_OF_INT;
8606
- const _2 = getValue(u, "i32");
8607
- u += SIZE_OF_INT;
8608
- const n2 = new Array(_2);
8609
- if (u = unmarshalCaptures(this, e.tree, u, n2), this.textPredicates[r2].every((e2) => e2(n2))) {
8610
- i[l++] = { pattern: r2, captures: n2 };
8611
- const e2 = this.setProperties[r2];
8612
- e2 && (i[t2].setProperties = e2);
8613
- const _3 = this.assertedProperties[r2];
8614
- _3 && (i[t2].assertedProperties = _3);
8615
- const s2 = this.refutedProperties[r2];
8616
- s2 && (i[t2].refutedProperties = s2);
8617
- }
8618
- }
8619
- return i.length = l, C._free(a), i;
8620
- }
8621
- captures(e, t, r, _) {
8622
- t || (t = ZERO_POINT), r || (r = ZERO_POINT), _ || (_ = {});
8623
- let n = _.matchLimit;
8624
- if (n === undefined)
8625
- n = 0;
8626
- else if (typeof n != "number")
8627
- throw new Error("Arguments must be numbers");
8628
- marshalNode(e), C._ts_query_captures_wasm(this[0], e.tree[0], t.row, t.column, r.row, r.column, n);
8629
- const s = getValue(TRANSFER_BUFFER, "i32"), a = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), i = [];
8630
- this.exceededMatchLimit = !!o;
8631
- const l = [];
8632
- let u = a;
8633
- for (let t2 = 0;t2 < s; t2++) {
8634
- const t3 = getValue(u, "i32");
8635
- u += SIZE_OF_INT;
8636
- const r2 = getValue(u, "i32");
8637
- u += SIZE_OF_INT;
8638
- const _2 = getValue(u, "i32");
8639
- if (u += SIZE_OF_INT, l.length = r2, u = unmarshalCaptures(this, e.tree, u, l), this.textPredicates[t3].every((e2) => e2(l))) {
8640
- const e2 = l[_2], r3 = this.setProperties[t3];
8641
- r3 && (e2.setProperties = r3);
8642
- const n2 = this.assertedProperties[t3];
8643
- n2 && (e2.assertedProperties = n2);
8644
- const s2 = this.refutedProperties[t3];
8645
- s2 && (e2.refutedProperties = s2), i.push(e2);
8646
- }
8647
- }
8648
- return C._free(a), i;
8649
- }
8650
- predicatesForPattern(e) {
8651
- return this.predicates[e];
8652
- }
8653
- didExceedMatchLimit() {
8654
- return this.exceededMatchLimit;
8655
- }
8656
- }
8657
- function getText(e, t, r) {
8658
- const _ = r - t;
8659
- let n = e.textCallback(t, null, r);
8660
- for (t += n.length;t < r; ) {
8661
- const _2 = e.textCallback(t, null, r);
8662
- if (!(_2 && _2.length > 0))
8663
- break;
8664
- t += _2.length, n += _2;
8665
- }
8666
- return t > r && (n = n.slice(0, _)), n;
8667
- }
8668
- function unmarshalCaptures(e, t, r, _) {
8669
- for (let n = 0, s = _.length;n < s; n++) {
8670
- const s2 = getValue(r, "i32"), a = unmarshalNode(t, r += SIZE_OF_INT);
8671
- r += SIZE_OF_NODE, _[n] = { name: e.captureNames[s2], node: a };
8672
- }
8673
- return r;
8674
- }
8675
- function assertInternal(e) {
8676
- if (e !== INTERNAL)
8677
- throw new Error("Illegal constructor");
8678
- }
8679
- function isPoint(e) {
8680
- return e && typeof e.row == "number" && typeof e.column == "number";
8681
- }
8682
- function marshalNode(e) {
8683
- let t = TRANSFER_BUFFER;
8684
- setValue(t, e.id, "i32"), t += SIZE_OF_INT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.row, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.column, "i32"), t += SIZE_OF_INT, setValue(t, e[0], "i32");
8685
- }
8686
- function unmarshalNode(e, t = TRANSFER_BUFFER) {
8687
- const r = getValue(t, "i32");
8688
- if (r === 0)
8689
- return null;
8690
- const _ = getValue(t += SIZE_OF_INT, "i32"), n = getValue(t += SIZE_OF_INT, "i32"), s = getValue(t += SIZE_OF_INT, "i32"), a = getValue(t += SIZE_OF_INT, "i32"), o = new Node(INTERNAL, e);
8691
- return o.id = r, o.startIndex = _, o.startPosition = { row: n, column: s }, o[0] = a, o;
8692
- }
8693
- function marshalTreeCursor(e, t = TRANSFER_BUFFER) {
8694
- setValue(t + 0 * SIZE_OF_INT, e[0], "i32"), setValue(t + 1 * SIZE_OF_INT, e[1], "i32"), setValue(t + 2 * SIZE_OF_INT, e[2], "i32");
8695
- }
8696
- function unmarshalTreeCursor(e) {
8697
- e[0] = getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32"), e[1] = getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32"), e[2] = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32");
8698
- }
8699
- function marshalPoint(e, t) {
8700
- setValue(e, t.row, "i32"), setValue(e + SIZE_OF_INT, t.column, "i32");
8701
- }
8702
- function unmarshalPoint(e) {
8703
- return { row: getValue(e, "i32"), column: getValue(e + SIZE_OF_INT, "i32") };
8704
- }
8705
- function marshalRange(e, t) {
8706
- marshalPoint(e, t.startPosition), marshalPoint(e += SIZE_OF_POINT, t.endPosition), setValue(e += SIZE_OF_POINT, t.startIndex, "i32"), setValue(e += SIZE_OF_INT, t.endIndex, "i32"), e += SIZE_OF_INT;
8707
- }
8708
- function unmarshalRange(e) {
8709
- const t = {};
8710
- return t.startPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.endPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.startIndex = getValue(e, "i32"), e += SIZE_OF_INT, t.endIndex = getValue(e, "i32"), t;
8711
- }
8712
- function marshalEdit(e) {
8713
- let t = TRANSFER_BUFFER;
8714
- marshalPoint(t, e.startPosition), t += SIZE_OF_POINT, marshalPoint(t, e.oldEndPosition), t += SIZE_OF_POINT, marshalPoint(t, e.newEndPosition), t += SIZE_OF_POINT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.oldEndIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.newEndIndex, "i32"), t += SIZE_OF_INT;
8715
- }
8716
- for (const e of Object.getOwnPropertyNames(ParserImpl.prototype))
8717
- Object.defineProperty(Parser.prototype, e, { value: ParserImpl.prototype[e], enumerable: false, writable: false });
8718
- Parser.Language = Language, Module.onRuntimeInitialized = () => {
8719
- ParserImpl.init(), resolveInitPromise();
8720
- };
8721
- }));
8722
- }
8723
- }
8724
- return Parser;
8725
- }();
8726
- typeof exports == "object" && (module2.exports = TreeSitter);
8727
- });
8728
-
8729
6982
  // ../core/src/types/node.ts
8730
6983
  var NodeType;
8731
6984
  ((NodeType2) => {
@@ -9725,8 +7978,8 @@ class ZodType {
9725
7978
  } : {
9726
7979
  issues: ctx.common.issues
9727
7980
  };
9728
- } catch (err2) {
9729
- if (err2?.message?.toLowerCase()?.includes("encountered")) {
7981
+ } catch (err) {
7982
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
9730
7983
  this["~standard"].async = true;
9731
7984
  }
9732
7985
  ctx.common = {
@@ -9943,24 +8196,24 @@ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=)
9943
8196
  var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
9944
8197
  var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
9945
8198
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
9946
- function timeRegexSource(args2) {
8199
+ function timeRegexSource(args) {
9947
8200
  let secondsRegexSource = `[0-5]\\d`;
9948
- if (args2.precision) {
9949
- secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`;
9950
- } else if (args2.precision == null) {
8201
+ if (args.precision) {
8202
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
8203
+ } else if (args.precision == null) {
9951
8204
  secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
9952
8205
  }
9953
- const secondsQuantifier = args2.precision ? "+" : "?";
8206
+ const secondsQuantifier = args.precision ? "+" : "?";
9954
8207
  return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
9955
8208
  }
9956
- function timeRegex(args2) {
9957
- return new RegExp(`^${timeRegexSource(args2)}$`);
8209
+ function timeRegex(args) {
8210
+ return new RegExp(`^${timeRegexSource(args)}$`);
9958
8211
  }
9959
- function datetimeRegex(args2) {
9960
- let regex = `${dateRegexSource}T${timeRegexSource(args2)}`;
8212
+ function datetimeRegex(args) {
8213
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
9961
8214
  const opts = [];
9962
- opts.push(args2.local ? `Z?` : `Z`);
9963
- if (args2.offset)
8215
+ opts.push(args.local ? `Z?` : `Z`);
8216
+ if (args.offset)
9964
8217
  opts.push(`([+-]\\d{2}:?\\d{2})`);
9965
8218
  regex = `${regex}(${opts.join("|")})`;
9966
8219
  return new RegExp(`^${regex}$`);
@@ -12194,9 +10447,9 @@ class ZodFunction extends ZodType {
12194
10447
  });
12195
10448
  return INVALID;
12196
10449
  }
12197
- function makeArgsIssue(args2, error) {
10450
+ function makeArgsIssue(args, error) {
12198
10451
  return makeIssue({
12199
- data: args2,
10452
+ data: args,
12200
10453
  path: ctx.path,
12201
10454
  errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
12202
10455
  issueData: {
@@ -12220,10 +10473,10 @@ class ZodFunction extends ZodType {
12220
10473
  const fn = ctx.data;
12221
10474
  if (this._def.returns instanceof ZodPromise) {
12222
10475
  const me = this;
12223
- return OK(async function(...args2) {
10476
+ return OK(async function(...args) {
12224
10477
  const error = new ZodError([]);
12225
- const parsedArgs = await me._def.args.parseAsync(args2, params).catch((e) => {
12226
- error.addIssue(makeArgsIssue(args2, e));
10478
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
10479
+ error.addIssue(makeArgsIssue(args, e));
12227
10480
  throw error;
12228
10481
  });
12229
10482
  const result = await Reflect.apply(fn, this, parsedArgs);
@@ -12235,10 +10488,10 @@ class ZodFunction extends ZodType {
12235
10488
  });
12236
10489
  } else {
12237
10490
  const me = this;
12238
- return OK(function(...args2) {
12239
- const parsedArgs = me._def.args.safeParse(args2, params);
10491
+ return OK(function(...args) {
10492
+ const parsedArgs = me._def.args.safeParse(args, params);
12240
10493
  if (!parsedArgs.success) {
12241
- throw new ZodError([makeArgsIssue(args2, parsedArgs.error)]);
10494
+ throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
12242
10495
  }
12243
10496
  const result = Reflect.apply(fn, this, parsedArgs.data);
12244
10497
  const parsedReturns = me._def.returns.safeParse(result, params);
@@ -12267,17 +10520,17 @@ class ZodFunction extends ZodType {
12267
10520
  returns: returnType
12268
10521
  });
12269
10522
  }
12270
- implement(func2) {
12271
- const validatedFunc = this.parse(func2);
10523
+ implement(func) {
10524
+ const validatedFunc = this.parse(func);
12272
10525
  return validatedFunc;
12273
10526
  }
12274
- strictImplement(func2) {
12275
- const validatedFunc = this.parse(func2);
10527
+ strictImplement(func) {
10528
+ const validatedFunc = this.parse(func);
12276
10529
  return validatedFunc;
12277
10530
  }
12278
- static create(args2, returns, params) {
10531
+ static create(args, returns, params) {
12279
10532
  return new ZodFunction({
12280
- args: args2 ? args2 : ZodTuple.create([]).rest(ZodUnknown.create()),
10533
+ args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
12281
10534
  returns: returns || ZodUnknown.create(),
12282
10535
  typeName: ZodFirstPartyTypeKind.ZodFunction,
12283
10536
  ...processCreateParams(params)
@@ -13628,27 +11881,27 @@ function pathMappings(input, baseUrl) {
13628
11881
  return exactDifference || right.prefix.length - left.prefix.length;
13629
11882
  });
13630
11883
  }
13631
- async function loadTsConfigPathResolver(fs2) {
13632
- const configPath = await fs2.exists("tsconfig.json") ? "tsconfig.json" : await fs2.exists("jsconfig.json") ? "jsconfig.json" : undefined;
13633
- return configPath === undefined ? { mappings: [] } : loadResolverFromConfig(fs2, configPath, new Set);
11884
+ async function loadTsConfigPathResolver(fs) {
11885
+ const configPath = await fs.exists("tsconfig.json") ? "tsconfig.json" : await fs.exists("jsconfig.json") ? "jsconfig.json" : undefined;
11886
+ return configPath === undefined ? { mappings: [] } : loadResolverFromConfig(fs, configPath, new Set);
13634
11887
  }
13635
- async function resolveExtendsPath(fs2, configPath, value) {
11888
+ async function resolveExtendsPath(fs, configPath, value) {
13636
11889
  const configDir = posix.dirname(configPath);
13637
11890
  const base = value.startsWith(".") ? normalizedPath(posix.join(configDir, value)) : normalizedPath(posix.join("node_modules", value));
13638
11891
  const candidates = [base, `${base}.json`, posix.join(base, "tsconfig.json")];
13639
11892
  for (const candidate of candidates) {
13640
- if (await fs2.exists(candidate))
11893
+ if (await fs.exists(candidate))
13641
11894
  return candidate;
13642
11895
  }
13643
11896
  return;
13644
11897
  }
13645
- async function loadResolverFromConfig(fs2, configPath, seen) {
11898
+ async function loadResolverFromConfig(fs, configPath, seen) {
13646
11899
  if (seen.has(configPath))
13647
11900
  return { mappings: [] };
13648
11901
  seen.add(configPath);
13649
- const config = parseJsonConfig(await fs2.readFile(configPath));
13650
- const extended = typeof config?.extends === "string" ? await resolveExtendsPath(fs2, configPath, config.extends) : undefined;
13651
- const parent = extended === undefined ? { mappings: [] } : await loadResolverFromConfig(fs2, extended, seen);
11902
+ const config = parseJsonConfig(await fs.readFile(configPath));
11903
+ const extended = typeof config?.extends === "string" ? await resolveExtendsPath(fs, configPath, config.extends) : undefined;
11904
+ const parent = extended === undefined ? { mappings: [] } : await loadResolverFromConfig(fs, extended, seen);
13652
11905
  const compilerOptions = config?.compilerOptions;
13653
11906
  if (compilerOptions === null || typeof compilerOptions !== "object" || Array.isArray(compilerOptions)) {
13654
11907
  return parent;
@@ -13779,22 +12032,22 @@ var createCandidatePaths = (value, options = {}) => {
13779
12032
  return [...candidates].map(normalizeRelativePath);
13780
12033
  };
13781
12034
  var isRelativeModuleSpecifier = (value) => value.startsWith("./") || value.startsWith("../");
13782
- var resolveEntrySourcePath = async (packageDir, targetPath, fs2, options = {}) => {
12035
+ var resolveEntrySourcePath = async (packageDir, targetPath, fs, options = {}) => {
13783
12036
  for (const candidate of createCandidatePaths(targetPath, options)) {
13784
12037
  const fullPath = packageDir ? posix2.join(packageDir, candidate) : candidate;
13785
- if (await fs2.exists(fullPath)) {
12038
+ if (await fs.exists(fullPath)) {
13786
12039
  return fullPath;
13787
12040
  }
13788
12041
  }
13789
12042
  return null;
13790
12043
  };
13791
- var resolveImportSourcePath = async (fromFile, specifier, fs2, resolver) => {
12044
+ var resolveImportSourcePath = async (fromFile, specifier, fs, resolver) => {
13792
12045
  if (!isRelativeModuleSpecifier(specifier)) {
13793
12046
  if (resolver === undefined)
13794
12047
  return null;
13795
12048
  for (const target of resolveTsConfigCandidates(specifier, resolver)) {
13796
12049
  for (const candidate of createCandidatePaths(target, { allowIndexFallback: false })) {
13797
- if (await fs2.exists(candidate))
12050
+ if (await fs.exists(candidate))
13798
12051
  return normalizeRelativePath(candidate);
13799
12052
  }
13800
12053
  }
@@ -13803,7 +12056,7 @@ var resolveImportSourcePath = async (fromFile, specifier, fs2, resolver) => {
13803
12056
  const baseDir = posix2.dirname(fromFile);
13804
12057
  for (const candidate of createCandidatePaths(specifier)) {
13805
12058
  const fullPath = baseDir === "." ? candidate : posix2.join(baseDir, candidate);
13806
- if (await fs2.exists(fullPath)) {
12059
+ if (await fs.exists(fullPath)) {
13807
12060
  return normalizeRelativePath(fullPath);
13808
12061
  }
13809
12062
  }
@@ -13888,16 +12141,16 @@ var detectPackageKind = (pkg) => {
13888
12141
  }
13889
12142
  return "lib" /* Lib */;
13890
12143
  };
13891
- var expandWorkspacePattern = async (rootDir, pattern, fs2) => {
12144
+ var expandWorkspacePattern = async (rootDir, pattern, fs) => {
13892
12145
  if (pattern.endsWith("/*")) {
13893
12146
  const prefix = pattern.slice(0, -2);
13894
12147
  const baseDir = prefix ? `${rootDir}/${prefix}` : rootDir;
13895
- const entries = await fs2.readdir(baseDir);
12148
+ const entries = await fs.readdir(baseDir);
13896
12149
  return entries.map((entry) => `${baseDir}/${entry}`.replace(/^\.\//, ""));
13897
12150
  }
13898
12151
  return [`${rootDir}/${pattern}`.replace(/^\.\//, "")];
13899
12152
  };
13900
- var detectSubPackages = async (rootDir, pkg, fs2) => {
12153
+ var detectSubPackages = async (rootDir, pkg, fs) => {
13901
12154
  const workspaceConfig = asRecord(pkg.workspaces);
13902
12155
  const workspaces = [
13903
12156
  ...asStringArray(pkg.workspaces),
@@ -13907,23 +12160,23 @@ var detectSubPackages = async (rootDir, pkg, fs2) => {
13907
12160
  return;
13908
12161
  const subPackages = [];
13909
12162
  for (const pattern of workspaces) {
13910
- const candidates = await expandWorkspacePattern(rootDir, pattern, fs2);
12163
+ const candidates = await expandWorkspacePattern(rootDir, pattern, fs);
13911
12164
  for (const candidate of candidates) {
13912
12165
  const manifestPath = `${candidate}/package.json`.replace(/^\.\//, "");
13913
- if (!await fs2.exists(manifestPath))
12166
+ if (!await fs.exists(manifestPath))
13914
12167
  continue;
13915
- const manifestContent = await fs2.readJson(manifestPath);
12168
+ const manifestContent = await fs.readJson(manifestPath);
13916
12169
  const childManifest = {
13917
12170
  type: "package.json",
13918
12171
  path: manifestPath,
13919
12172
  content: manifestContent
13920
12173
  };
13921
- subPackages.push(await detectEntries(childManifest, fs2));
12174
+ subPackages.push(await detectEntries(childManifest, fs));
13922
12175
  }
13923
12176
  }
13924
12177
  return subPackages.length > 0 ? subPackages : undefined;
13925
12178
  };
13926
- var detectEntries = async (manifest, fs2) => {
12179
+ var detectEntries = async (manifest, fs) => {
13927
12180
  if (manifest.type !== "package.json") {
13928
12181
  throw new Error(`TypeScriptPlugin only supports package.json manifests, got ${manifest.type}`);
13929
12182
  }
@@ -13934,7 +12187,7 @@ var detectEntries = async (manifest, fs2) => {
13934
12187
  for (const entryTarget of entryTargets) {
13935
12188
  const allowIndexFallback = entryTarget.subpath === ".";
13936
12189
  for (const targetPath of entryTarget.targetPaths) {
13937
- const resolvedPath = await resolveEntrySourcePath(packageDir, targetPath, fs2, { allowIndexFallback });
12190
+ const resolvedPath = await resolveEntrySourcePath(packageDir, targetPath, fs, { allowIndexFallback });
13938
12191
  if (!resolvedPath)
13939
12192
  continue;
13940
12193
  entries.push({
@@ -13945,7 +12198,7 @@ var detectEntries = async (manifest, fs2) => {
13945
12198
  break;
13946
12199
  }
13947
12200
  }
13948
- const subPackages = await detectSubPackages(packageDir || ".", pkg, fs2);
12201
+ const subPackages = await detectSubPackages(packageDir || ".", pkg, fs);
13949
12202
  return {
13950
12203
  package: {
13951
12204
  name: readString(pkg.name) ?? "unknown-package",
@@ -14214,7 +12467,7 @@ var codeExtractRunnerInputSchema = exports_external.object({
14214
12467
  }).optional()
14215
12468
  });
14216
12469
  // ../extract/src/parser.ts
14217
- var import_web_tree_sitter = __toESM(require_tree_sitter(), 1);
12470
+ import Parser from "web-tree-sitter";
14218
12471
  import { existsSync } from "node:fs";
14219
12472
  import { fileURLToPath } from "node:url";
14220
12473
  var parserInitPromise = null;
@@ -14225,10 +12478,10 @@ var resolveWasmPath = (relativePath) => fileURLToPath(new URL(relativePath, impo
14225
12478
  var createParserInstance = async () => {
14226
12479
  const localWasm = resolveWasmPath("./wasm/tree-sitter.wasm");
14227
12480
  const initOptions = existsSync(localWasm) ? { locateFile: (scriptName) => resolveWasmPath(`./wasm/${scriptName}`) } : undefined;
14228
- await import_web_tree_sitter.default.init(initOptions);
14229
- const parser = new import_web_tree_sitter.default;
14230
- const tsLanguage = await import_web_tree_sitter.default.Language.load(resolveWasmPath("./wasm/tree-sitter-typescript.wasm"));
14231
- const tsxLanguage = await import_web_tree_sitter.default.Language.load(resolveWasmPath("./wasm/tree-sitter-tsx.wasm"));
12481
+ await Parser.init(initOptions);
12482
+ const parser = new Parser;
12483
+ const tsLanguage = await Parser.Language.load(resolveWasmPath("./wasm/tree-sitter-typescript.wasm"));
12484
+ const tsxLanguage = await Parser.Language.load(resolveWasmPath("./wasm/tree-sitter-tsx.wasm"));
14232
12485
  return { parser, tsLanguage, tsxLanguage };
14233
12486
  };
14234
12487
  var initParser = async () => {
@@ -14372,11 +12625,11 @@ var uniqueExports = (exportsList) => {
14372
12625
  return true;
14373
12626
  });
14374
12627
  };
14375
- var traceImportedBinding = async (filePath, binding, exportedName, fs2, state) => {
14376
- const targetPath = await resolveImportSourcePath(filePath, binding.source, fs2, state.resolver);
12628
+ var traceImportedBinding = async (filePath, binding, exportedName, fs, state) => {
12629
+ const targetPath = await resolveImportSourcePath(filePath, binding.source, fs, state.resolver);
14377
12630
  if (!targetPath)
14378
12631
  return [];
14379
- const traced = await traceFile(targetPath, fs2, state);
12632
+ const traced = await traceFile(targetPath, fs, state);
14380
12633
  const match = traced.find((item) => item.exportedName === binding.importedName || binding.importedName === "default" && item.exportedName === item.localName);
14381
12634
  if (!match)
14382
12635
  return [];
@@ -14386,7 +12639,7 @@ var traceImportedBinding = async (filePath, binding, exportedName, fs2, state) =
14386
12639
  declarationFile: match.declarationFile
14387
12640
  }];
14388
12641
  };
14389
- var traceFile = async (filePath, fs2, state) => {
12642
+ var traceFile = async (filePath, fs, state) => {
14390
12643
  const cached = state.cache.get(filePath);
14391
12644
  if (cached)
14392
12645
  return cached;
@@ -14395,7 +12648,7 @@ var traceFile = async (filePath, fs2, state) => {
14395
12648
  const promise = (async () => {
14396
12649
  state.inFlight.add(filePath);
14397
12650
  state.files.add(filePath);
14398
- const source2 = await fs2.readFile(filePath);
12651
+ const source2 = await fs.readFile(filePath);
14399
12652
  const tree = await parseFile(source2, filePath.endsWith(".tsx"));
14400
12653
  if (!tree)
14401
12654
  return [];
@@ -14428,9 +12681,9 @@ var traceFile = async (filePath, fs2, state) => {
14428
12681
  }
14429
12682
  if (!exportClause) {
14430
12683
  if (stringNode && node2.text.startsWith("export *")) {
14431
- const targetPath2 = await resolveImportSourcePath(filePath, stripQuotes(stringNode.text), fs2, state.resolver);
12684
+ const targetPath2 = await resolveImportSourcePath(filePath, stripQuotes(stringNode.text), fs, state.resolver);
14432
12685
  if (targetPath2) {
14433
- exportsList.push(...await traceFile(targetPath2, fs2, state));
12686
+ exportsList.push(...await traceFile(targetPath2, fs, state));
14434
12687
  }
14435
12688
  }
14436
12689
  continue;
@@ -14450,15 +12703,15 @@ var traceFile = async (filePath, fs2, state) => {
14450
12703
  }
14451
12704
  const importBinding = importBindings.get(parsed.localName);
14452
12705
  if (importBinding) {
14453
- exportsList.push(...await traceImportedBinding(filePath, importBinding, parsed.exportedName, fs2, state));
12706
+ exportsList.push(...await traceImportedBinding(filePath, importBinding, parsed.exportedName, fs, state));
14454
12707
  }
14455
12708
  }
14456
12709
  continue;
14457
12710
  }
14458
- const targetPath = await resolveImportSourcePath(filePath, stripQuotes(stringNode.text), fs2, state.resolver);
12711
+ const targetPath = await resolveImportSourcePath(filePath, stripQuotes(stringNode.text), fs, state.resolver);
14459
12712
  if (!targetPath)
14460
12713
  continue;
14461
- const traced = await traceFile(targetPath, fs2, state);
12714
+ const traced = await traceFile(targetPath, fs, state);
14462
12715
  for (const specifier of exportClause.namedChildren.filter((child) => child.type === "export_specifier")) {
14463
12716
  const parsed = parseExportSpecifier(specifier);
14464
12717
  if (!parsed)
@@ -14479,14 +12732,14 @@ var traceFile = async (filePath, fs2, state) => {
14479
12732
  state.cache.set(filePath, promise);
14480
12733
  return promise;
14481
12734
  };
14482
- var traceExports = async (entryPath, fs2, resolver = { mappings: [] }) => {
12735
+ var traceExports = async (entryPath, fs, resolver = { mappings: [] }) => {
14483
12736
  const state = {
14484
12737
  files: new Set,
14485
12738
  cache: new Map,
14486
12739
  inFlight: new Set,
14487
12740
  resolver
14488
12741
  };
14489
- const exportsList = await traceFile(entryPath, fs2, state);
12742
+ const exportsList = await traceFile(entryPath, fs, state);
14490
12743
  return {
14491
12744
  exports: uniqueExports(exportsList),
14492
12745
  files: [...state.files].sort()
@@ -14726,11 +12979,11 @@ var indexSignatureMember = (node2) => {
14726
12979
  };
14727
12980
  };
14728
12981
  var collectEnumValues = (node2) => {
14729
- const body2 = node2.namedChildren.find((child) => child.type === "enum_body") ?? null;
14730
- if (!body2)
12982
+ const body = node2.namedChildren.find((child) => child.type === "enum_body") ?? null;
12983
+ if (!body)
14731
12984
  return;
14732
12985
  const values = [];
14733
- for (const member of body2.namedChildren.filter((child) => child.type === "enum_assignment" || child.type === "property_identifier")) {
12986
+ for (const member of body.namedChildren.filter((child) => child.type === "enum_assignment" || child.type === "property_identifier")) {
14734
12987
  if (member.type === "property_identifier") {
14735
12988
  values.push(member.text);
14736
12989
  continue;
@@ -14891,8 +13144,8 @@ var analyzeClassDeclaration = (node2, name, symbolDoc, filePath, declarations, i
14891
13144
  const implementsClause = heritage?.namedChildren.find((child) => child.type === "implements_clause") ?? null;
14892
13145
  const extendsValue = extendsClause?.namedChildren[0]?.text ?? null;
14893
13146
  const implementsValues = implementsClause?.namedChildren.map((child) => child.text) ?? [];
14894
- const body2 = node2.namedChildren.find((child) => child.type === "class_body") ?? null;
14895
- const members = collectMembers(body2, declarations, importBindings, name, relations);
13147
+ const body = node2.namedChildren.find((child) => child.type === "class_body") ?? null;
13148
+ const members = collectMembers(body, declarations, importBindings, name, relations);
14896
13149
  declarations.set(name, {
14897
13150
  info: {
14898
13151
  name,
@@ -14915,8 +13168,8 @@ var analyzeClassDeclaration = (node2, name, symbolDoc, filePath, declarations, i
14915
13168
  }
14916
13169
  };
14917
13170
  var analyzeInterfaceDeclaration = (node2, name, symbolDoc, filePath, declarations, importBindings, relations) => {
14918
- const body2 = node2.namedChildren.find((child) => child.type === "interface_body") ?? null;
14919
- const members = collectMembers(body2, declarations, importBindings, name, relations);
13171
+ const body = node2.namedChildren.find((child) => child.type === "interface_body") ?? null;
13172
+ const members = collectMembers(body, declarations, importBindings, name, relations);
14920
13173
  declarations.set(name, {
14921
13174
  info: {
14922
13175
  name,
@@ -14976,14 +13229,14 @@ var analyzeEnumDeclaration = (node2, name, symbolDoc, filePath, declarations) =>
14976
13229
  }
14977
13230
  });
14978
13231
  };
14979
- var collectImportBindings2 = async (root, filePath, fs2, resolver, relations) => {
13232
+ var collectImportBindings2 = async (root, filePath, fs, resolver, relations) => {
14980
13233
  const bindings = new Map;
14981
13234
  for (const node2 of root.namedChildren.filter((child) => child.type === "import_statement")) {
14982
13235
  const specifierNode = node2.namedChildren.find((child) => child.type === "string");
14983
13236
  if (!specifierNode)
14984
13237
  continue;
14985
13238
  const specifier = specifierNode.text.replace(/^['"]/, "").replace(/['"]$/, "");
14986
- const resolvedAlias = isRelativeModuleSpecifier(specifier) ? null : await resolveImportSourcePath(filePath, specifier, fs2, resolver);
13239
+ const resolvedAlias = isRelativeModuleSpecifier(specifier) ? null : await resolveImportSourcePath(filePath, specifier, fs, resolver);
14987
13240
  const isExternal = !isRelativeModuleSpecifier(specifier) && resolvedAlias === null;
14988
13241
  const relationTarget = resolvedAlias ?? specifier;
14989
13242
  const statementTypeOnly = node2.text.startsWith("import type ");
@@ -15024,8 +13277,8 @@ var collectImportBindings2 = async (root, filePath, fs2, resolver, relations) =>
15024
13277
  }
15025
13278
  return bindings;
15026
13279
  };
15027
- var analyzeFile = async (filePath, fs2, resolver = { mappings: [] }) => {
15028
- const source2 = await fs2.readFile(filePath);
13280
+ var analyzeFile = async (filePath, fs, resolver = { mappings: [] }) => {
13281
+ const source2 = await fs.readFile(filePath);
15029
13282
  const tree = await parseFile(source2, filePath.endsWith(".tsx"));
15030
13283
  if (!tree) {
15031
13284
  return {
@@ -15037,7 +13290,7 @@ var analyzeFile = async (filePath, fs2, resolver = { mappings: [] }) => {
15037
13290
  }
15038
13291
  const root = tree.rootNode;
15039
13292
  const relations = [];
15040
- const importBindings = await collectImportBindings2(root, filePath, fs2, resolver, relations);
13293
+ const importBindings = await collectImportBindings2(root, filePath, fs, resolver, relations);
15041
13294
  const declarations = new Map;
15042
13295
  for (const relation of relations) {
15043
13296
  if (relation.from === "") {
@@ -15065,8 +13318,8 @@ var analyzeFile = async (filePath, fs2, resolver = { mappings: [] }) => {
15065
13318
  };
15066
13319
 
15067
13320
  // src/symbolExtractor.ts
15068
- var extractSymbols = async (entries, fs2, options) => {
15069
- const resolver = await loadTsConfigPathResolver(fs2);
13321
+ var extractSymbols = async (entries, fs, options) => {
13322
+ const resolver = await loadTsConfigPathResolver(fs);
15070
13323
  const exportedSymbols = [];
15071
13324
  const internalSymbols = [];
15072
13325
  const relations = [];
@@ -15074,11 +13327,11 @@ var extractSymbols = async (entries, fs2, options) => {
15074
13327
  const exportedDeclarationKeys = new Set;
15075
13328
  const analyses = new Map;
15076
13329
  for (const entry of entries) {
15077
- const traced = await traceExports(entry.path, fs2, resolver);
13330
+ const traced = await traceExports(entry.path, fs, resolver);
15078
13331
  traced.files.forEach((filePath) => filePaths.add(filePath));
15079
13332
  for (const filePath of traced.files) {
15080
13333
  if (!analyses.has(filePath)) {
15081
- analyses.set(filePath, await analyzeFile(filePath, fs2, resolver));
13334
+ analyses.set(filePath, await analyzeFile(filePath, fs, resolver));
15082
13335
  }
15083
13336
  }
15084
13337
  for (const tracedExport of traced.exports) {
@@ -15175,17 +13428,17 @@ class TypeScriptPlugin {
15175
13428
  canHandle(source2) {
15176
13429
  return source2.manifests.some((manifest) => manifest.type === "package.json");
15177
13430
  }
15178
- async detectEntries(manifest, fs2) {
15179
- const result = await detectEntries(manifest, fs2);
13431
+ async detectEntries(manifest, fs) {
13432
+ const result = await detectEntries(manifest, fs);
15180
13433
  this.#lastDetection = result;
15181
13434
  return result;
15182
13435
  }
15183
- async extractSymbols(entries, fs2) {
13436
+ async extractSymbols(entries, fs) {
15184
13437
  const packageInfo = this.#lastDetection?.package;
15185
13438
  if (!packageInfo) {
15186
13439
  throw new Error("TypeScriptPlugin.extractSymbols requires detectEntries to run first");
15187
13440
  }
15188
- const result = await extractSymbols(entries, fs2, {
13441
+ const result = await extractSymbols(entries, fs, {
15189
13442
  packageInfo,
15190
13443
  pluginId: this.id
15191
13444
  });