houdini 1.2.0-react.1 → 1.2.1

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 (80) hide show
  1. package/README.md +1 -1
  2. package/build/cmd-cjs/index.js +2285 -1577
  3. package/build/cmd-esm/index.js +2285 -1577
  4. package/build/codegen/generators/artifacts/selection.d.ts +2 -1
  5. package/build/codegen/generators/typescript/inlineType.d.ts +5 -2
  6. package/build/codegen/generators/typescript/loadingState.d.ts +8 -0
  7. package/build/codegen/transforms/fragmentVariables.d.ts +0 -11
  8. package/build/codegen/utils/flattenSelections.d.ts +2 -1
  9. package/build/codegen-cjs/index.js +2215 -1531
  10. package/build/codegen-esm/index.js +2215 -1531
  11. package/build/lib/config.d.ts +5 -0
  12. package/build/lib/graphql.d.ts +5 -1
  13. package/build/lib/parse.d.ts +10 -1
  14. package/build/lib-cjs/index.js +702 -578
  15. package/build/lib-esm/index.js +699 -578
  16. package/build/runtime/cache/cache.d.ts +9 -8
  17. package/build/runtime/cache/stuff.d.ts +1 -4
  18. package/build/runtime/client/documentStore.d.ts +3 -3
  19. package/build/runtime/client/index.d.ts +8 -7
  20. package/build/runtime/client/plugins/cache.d.ts +1 -1
  21. package/build/runtime/client/plugins/fetch.d.ts +1 -0
  22. package/build/runtime/client/plugins/subscription.d.ts +1 -0
  23. package/build/runtime/client/plugins/throwOnError.d.ts +2 -1
  24. package/build/runtime/lib/pagination.d.ts +4 -6
  25. package/build/runtime/lib/selection.d.ts +1 -1
  26. package/build/runtime/lib/types.d.ts +37 -4
  27. package/build/runtime-cjs/cache/cache.d.ts +9 -8
  28. package/build/runtime-cjs/cache/cache.js +108 -43
  29. package/build/runtime-cjs/cache/stuff.d.ts +1 -4
  30. package/build/runtime-cjs/cache/stuff.js +2 -2
  31. package/build/runtime-cjs/cache/subscription.js +5 -5
  32. package/build/runtime-cjs/client/documentStore.d.ts +3 -3
  33. package/build/runtime-cjs/client/documentStore.js +10 -2
  34. package/build/runtime-cjs/client/index.d.ts +8 -7
  35. package/build/runtime-cjs/client/index.js +12 -4
  36. package/build/runtime-cjs/client/plugins/cache.d.ts +1 -1
  37. package/build/runtime-cjs/client/plugins/cache.js +10 -2
  38. package/build/runtime-cjs/client/plugins/fetch.d.ts +1 -0
  39. package/build/runtime-cjs/client/plugins/fetch.js +3 -2
  40. package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -0
  41. package/build/runtime-cjs/client/plugins/subscription.js +1 -0
  42. package/build/runtime-cjs/client/plugins/throwOnError.d.ts +2 -1
  43. package/build/runtime-cjs/lib/config.js +2 -1
  44. package/build/runtime-cjs/lib/pagination.d.ts +4 -6
  45. package/build/runtime-cjs/lib/pagination.js +0 -12
  46. package/build/runtime-cjs/lib/scalars.js +1 -1
  47. package/build/runtime-cjs/lib/selection.d.ts +1 -1
  48. package/build/runtime-cjs/lib/selection.js +28 -1
  49. package/build/runtime-cjs/lib/types.d.ts +37 -4
  50. package/build/runtime-cjs/lib/types.js +3 -0
  51. package/build/runtime-esm/cache/cache.d.ts +9 -8
  52. package/build/runtime-esm/cache/cache.js +109 -44
  53. package/build/runtime-esm/cache/stuff.d.ts +1 -4
  54. package/build/runtime-esm/cache/stuff.js +2 -2
  55. package/build/runtime-esm/cache/subscription.js +5 -5
  56. package/build/runtime-esm/client/documentStore.d.ts +3 -3
  57. package/build/runtime-esm/client/documentStore.js +10 -2
  58. package/build/runtime-esm/client/index.d.ts +8 -7
  59. package/build/runtime-esm/client/index.js +15 -7
  60. package/build/runtime-esm/client/plugins/cache.d.ts +1 -1
  61. package/build/runtime-esm/client/plugins/cache.js +10 -2
  62. package/build/runtime-esm/client/plugins/fetch.d.ts +1 -0
  63. package/build/runtime-esm/client/plugins/fetch.js +3 -2
  64. package/build/runtime-esm/client/plugins/subscription.d.ts +1 -0
  65. package/build/runtime-esm/client/plugins/subscription.js +1 -0
  66. package/build/runtime-esm/client/plugins/throwOnError.d.ts +2 -1
  67. package/build/runtime-esm/lib/config.js +2 -1
  68. package/build/runtime-esm/lib/pagination.d.ts +4 -6
  69. package/build/runtime-esm/lib/pagination.js +0 -12
  70. package/build/runtime-esm/lib/scalars.js +1 -1
  71. package/build/runtime-esm/lib/selection.d.ts +1 -1
  72. package/build/runtime-esm/lib/selection.js +28 -1
  73. package/build/runtime-esm/lib/types.d.ts +37 -4
  74. package/build/runtime-esm/lib/types.js +2 -0
  75. package/build/test/index.d.ts +15 -0
  76. package/build/test-cjs/index.js +2248 -1534
  77. package/build/test-esm/index.js +2248 -1534
  78. package/build/vite-cjs/index.js +2315 -1605
  79. package/build/vite-esm/index.js +2315 -1605
  80. package/package.json +7 -1
@@ -3074,10 +3074,10 @@ var require_printer = __commonJS({
3074
3074
  Object.defineProperty(exports, "__esModule", {
3075
3075
  value: true
3076
3076
  });
3077
- exports.print = print4;
3077
+ exports.print = print5;
3078
3078
  var _visitor = require_visitor();
3079
3079
  var _blockString = require_blockString();
3080
- function print4(ast) {
3080
+ function print5(ast) {
3081
3081
  return (0, _visitor.visit)(ast, {
3082
3082
  leave: printDocASTReducer2
3083
3083
  });
@@ -42024,109 +42024,6 @@ var require_lib3 = __commonJS({
42024
42024
  }
42025
42025
  });
42026
42026
 
42027
- // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
42028
- var require_cjs = __commonJS({
42029
- "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
42030
- "use strict";
42031
- var isMergeableObject = function isMergeableObject2(value) {
42032
- return isNonNullObject(value) && !isSpecial(value);
42033
- };
42034
- function isNonNullObject(value) {
42035
- return !!value && typeof value === "object";
42036
- }
42037
- function isSpecial(value) {
42038
- var stringValue = Object.prototype.toString.call(value);
42039
- return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
42040
- }
42041
- var canUseSymbol = typeof Symbol === "function" && Symbol.for;
42042
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
42043
- function isReactElement(value) {
42044
- return value.$$typeof === REACT_ELEMENT_TYPE;
42045
- }
42046
- function emptyTarget(val) {
42047
- return Array.isArray(val) ? [] : {};
42048
- }
42049
- function cloneUnlessOtherwiseSpecified(value, options) {
42050
- return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
42051
- }
42052
- function defaultArrayMerge(target, source, options) {
42053
- return target.concat(source).map(function(element) {
42054
- return cloneUnlessOtherwiseSpecified(element, options);
42055
- });
42056
- }
42057
- function getMergeFunction(key, options) {
42058
- if (!options.customMerge) {
42059
- return deepmerge;
42060
- }
42061
- var customMerge = options.customMerge(key);
42062
- return typeof customMerge === "function" ? customMerge : deepmerge;
42063
- }
42064
- function getEnumerableOwnPropertySymbols(target) {
42065
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
42066
- return target.propertyIsEnumerable(symbol);
42067
- }) : [];
42068
- }
42069
- function getKeys(target) {
42070
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
42071
- }
42072
- function propertyIsOnObject(object, property) {
42073
- try {
42074
- return property in object;
42075
- } catch (_) {
42076
- return false;
42077
- }
42078
- }
42079
- function propertyIsUnsafe(target, key) {
42080
- return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
42081
- }
42082
- function mergeObject(target, source, options) {
42083
- var destination = {};
42084
- if (options.isMergeableObject(target)) {
42085
- getKeys(target).forEach(function(key) {
42086
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
42087
- });
42088
- }
42089
- getKeys(source).forEach(function(key) {
42090
- if (propertyIsUnsafe(target, key)) {
42091
- return;
42092
- }
42093
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
42094
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
42095
- } else {
42096
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
42097
- }
42098
- });
42099
- return destination;
42100
- }
42101
- function deepmerge(target, source, options) {
42102
- options = options || {};
42103
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
42104
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
42105
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
42106
- var sourceIsArray = Array.isArray(source);
42107
- var targetIsArray = Array.isArray(target);
42108
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
42109
- if (!sourceAndTargetTypesMatch) {
42110
- return cloneUnlessOtherwiseSpecified(source, options);
42111
- } else if (sourceIsArray) {
42112
- return options.arrayMerge(target, source, options);
42113
- } else {
42114
- return mergeObject(target, source, options);
42115
- }
42116
- }
42117
- deepmerge.all = function deepmergeAll(array, options) {
42118
- if (!Array.isArray(array)) {
42119
- throw new Error("first argument should be an array");
42120
- }
42121
- return array.reduce(function(prev, next) {
42122
- return deepmerge(prev, next, options);
42123
- }, {});
42124
- };
42125
- var deepmerge_1 = deepmerge;
42126
- module.exports = deepmerge_1;
42127
- }
42128
- });
42129
-
42130
42027
  // ../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js
42131
42028
  var require_tslib = __commonJS({
42132
42029
  "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module) {
@@ -55246,12 +55143,12 @@ var require_comments = __commonJS({
55246
55143
  comment.trailing = true;
55247
55144
  addCommentHelper(node, comment);
55248
55145
  }
55249
- function printLeadingComment(commentPath, print4) {
55146
+ function printLeadingComment(commentPath, print5) {
55250
55147
  var comment = commentPath.getValue();
55251
55148
  n.Comment.assert(comment);
55252
55149
  var loc = comment.loc;
55253
55150
  var lines = loc && loc.lines;
55254
- var parts = [print4(commentPath)];
55151
+ var parts = [print5(commentPath)];
55255
55152
  if (comment.trailing) {
55256
55153
  parts.push("\n");
55257
55154
  } else if (lines instanceof lines_1.Lines) {
@@ -55266,7 +55163,7 @@ var require_comments = __commonJS({
55266
55163
  }
55267
55164
  return (0, lines_1.concat)(parts);
55268
55165
  }
55269
- function printTrailingComment(commentPath, print4) {
55166
+ function printTrailingComment(commentPath, print5) {
55270
55167
  var comment = commentPath.getValue(commentPath);
55271
55168
  n.Comment.assert(comment);
55272
55169
  var loc = comment.loc;
@@ -55281,12 +55178,12 @@ var require_comments = __commonJS({
55281
55178
  parts.push(new Array(leadingSpace.length).join("\n"));
55282
55179
  }
55283
55180
  }
55284
- parts.push(print4(commentPath));
55181
+ parts.push(print5(commentPath));
55285
55182
  return (0, lines_1.concat)(parts);
55286
55183
  }
55287
- function printComments(path2, print4) {
55184
+ function printComments(path2, print5) {
55288
55185
  var value = path2.getValue();
55289
- var innerLines = print4(path2);
55186
+ var innerLines = print5(path2);
55290
55187
  var comments = n.Node.check(value) && types4.getFieldValue(value, "comments");
55291
55188
  if (!comments || comments.length === 0) {
55292
55189
  return innerLines;
@@ -55298,9 +55195,9 @@ var require_comments = __commonJS({
55298
55195
  var leading = types4.getFieldValue(comment, "leading");
55299
55196
  var trailing = types4.getFieldValue(comment, "trailing");
55300
55197
  if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
55301
- leadingParts.push(printLeadingComment(commentPath, print4));
55198
+ leadingParts.push(printLeadingComment(commentPath, print5));
55302
55199
  } else if (trailing) {
55303
- trailingParts.push(printTrailingComment(commentPath, print4));
55200
+ trailingParts.push(printTrailingComment(commentPath, print5));
55304
55201
  }
55305
55202
  }, "comments");
55306
55203
  leadingParts.push.apply(leadingParts, trailingParts);
@@ -55991,7 +55888,7 @@ var require_patcher = __commonJS({
55991
55888
  };
55992
55889
  exports.Patcher = Patcher;
55993
55890
  var Pp = Patcher.prototype;
55994
- Pp.tryToReprintComments = function(newNode, oldNode, print4) {
55891
+ Pp.tryToReprintComments = function(newNode, oldNode, print5) {
55995
55892
  var patcher = this;
55996
55893
  if (!newNode.comments && !oldNode.comments) {
55997
55894
  return true;
@@ -56008,7 +55905,7 @@ var require_patcher = __commonJS({
56008
55905
  assert_1.default.ok(oldComment.leading || oldComment.trailing);
56009
55906
  patcher.replace(
56010
55907
  oldComment.loc,
56011
- print4(reprint.newPath).indentTail(oldComment.loc.indent)
55908
+ print5(reprint.newPath).indentTail(oldComment.loc.indent)
56012
55909
  );
56013
55910
  });
56014
55911
  }
@@ -56055,17 +55952,17 @@ var require_patcher = __commonJS({
56055
55952
  var reprints = [];
56056
55953
  if (!lines || !findReprints(path2, reprints))
56057
55954
  return;
56058
- return function(print4) {
55955
+ return function(print5) {
56059
55956
  var patcher = new Patcher(lines);
56060
55957
  reprints.forEach(function(reprint) {
56061
55958
  var newNode = reprint.newPath.getValue();
56062
55959
  var oldNode = reprint.oldPath.getValue();
56063
55960
  SourceLocation.assert(oldNode.loc, true);
56064
- var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print4);
55961
+ var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print5);
56065
55962
  if (needToPrintNewPathWithComments) {
56066
55963
  patcher.deleteComments(oldNode);
56067
55964
  }
56068
- var newLines = print4(reprint.newPath, {
55965
+ var newLines = print5(reprint.newPath, {
56069
55966
  includeComments: needToPrintNewPathWithComments,
56070
55967
  avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
56071
55968
  }).indentTail(oldNode.loc.indent);
@@ -56282,10 +56179,10 @@ var require_printer2 = __commonJS({
56282
56179
  function makePrintFunctionWith(options, overrides) {
56283
56180
  options = Object.assign({}, options, overrides);
56284
56181
  return function(path2) {
56285
- return print4(path2, options);
56182
+ return print5(path2, options);
56286
56183
  };
56287
56184
  }
56288
- function print4(path2, options) {
56185
+ function print5(path2, options) {
56289
56186
  assert_1.default.ok(path2 instanceof fast_path_1.default);
56290
56187
  options = options || {};
56291
56188
  if (options.includeComments) {
@@ -56301,7 +56198,7 @@ var require_printer2 = __commonJS({
56301
56198
  }
56302
56199
  }
56303
56200
  var reprinter = (0, patcher_1.getReprinter)(path2);
56304
- var lines = reprinter ? reprinter(print4) : genericPrint(path2, config, options, makePrintFunctionWith(options, {
56201
+ var lines = reprinter ? reprinter(print5) : genericPrint(path2, config, options, makePrintFunctionWith(options, {
56305
56202
  includeComments: true,
56306
56203
  avoidRootParens: false
56307
56204
  }));
@@ -56312,7 +56209,7 @@ var require_printer2 = __commonJS({
56312
56209
  if (!ast) {
56313
56210
  return emptyPrintResult;
56314
56211
  }
56315
- var lines = print4(fast_path_1.default.from(ast), {
56212
+ var lines = print5(fast_path_1.default.from(ast), {
56316
56213
  includeComments: true,
56317
56214
  avoidRootParens: false
56318
56215
  });
@@ -56365,7 +56262,7 @@ var require_printer2 = __commonJS({
56365
56262
  }
56366
56263
  return (0, lines_1.concat)(parts);
56367
56264
  }
56368
- function genericPrintNoParens(path2, options, print4) {
56265
+ function genericPrintNoParens(path2, options, print5) {
56369
56266
  var n = path2.getValue();
56370
56267
  if (!n) {
56371
56268
  return (0, lines_1.fromString)("");
@@ -56377,45 +56274,45 @@ var require_printer2 = __commonJS({
56377
56274
  var parts = [];
56378
56275
  switch (n.type) {
56379
56276
  case "File":
56380
- return path2.call(print4, "program");
56277
+ return path2.call(print5, "program");
56381
56278
  case "Program":
56382
56279
  if (n.directives) {
56383
56280
  path2.each(function(childPath) {
56384
- parts.push(print4(childPath), ";\n");
56281
+ parts.push(print5(childPath), ";\n");
56385
56282
  }, "directives");
56386
56283
  }
56387
56284
  if (n.interpreter) {
56388
- parts.push(path2.call(print4, "interpreter"));
56285
+ parts.push(path2.call(print5, "interpreter"));
56389
56286
  }
56390
56287
  parts.push(path2.call(function(bodyPath) {
56391
- return printStatementSequence(bodyPath, options, print4);
56288
+ return printStatementSequence(bodyPath, options, print5);
56392
56289
  }, "body"));
56393
56290
  return (0, lines_1.concat)(parts);
56394
56291
  case "Noop":
56395
56292
  case "EmptyStatement":
56396
56293
  return (0, lines_1.fromString)("");
56397
56294
  case "ExpressionStatement":
56398
- return (0, lines_1.concat)([path2.call(print4, "expression"), ";"]);
56295
+ return (0, lines_1.concat)([path2.call(print5, "expression"), ";"]);
56399
56296
  case "ParenthesizedExpression":
56400
- return (0, lines_1.concat)(["(", path2.call(print4, "expression"), ")"]);
56297
+ return (0, lines_1.concat)(["(", path2.call(print5, "expression"), ")"]);
56401
56298
  case "BinaryExpression":
56402
56299
  case "LogicalExpression":
56403
56300
  case "AssignmentExpression":
56404
56301
  return (0, lines_1.fromString)(" ").join([
56405
- path2.call(print4, "left"),
56302
+ path2.call(print5, "left"),
56406
56303
  n.operator,
56407
- path2.call(print4, "right")
56304
+ path2.call(print5, "right")
56408
56305
  ]);
56409
56306
  case "AssignmentPattern":
56410
56307
  return (0, lines_1.concat)([
56411
- path2.call(print4, "left"),
56308
+ path2.call(print5, "left"),
56412
56309
  " = ",
56413
- path2.call(print4, "right")
56310
+ path2.call(print5, "right")
56414
56311
  ]);
56415
56312
  case "MemberExpression":
56416
56313
  case "OptionalMemberExpression": {
56417
- parts.push(path2.call(print4, "object"));
56418
- var property = path2.call(print4, "property");
56314
+ parts.push(path2.call(print5, "object"));
56315
+ var property = path2.call(print5, "property");
56419
56316
  var optional = types4.getFieldValue(n, "optional");
56420
56317
  if (n.computed) {
56421
56318
  parts.push(optional ? "?.[" : "[", property, "]");
@@ -56425,18 +56322,18 @@ var require_printer2 = __commonJS({
56425
56322
  return (0, lines_1.concat)(parts);
56426
56323
  }
56427
56324
  case "ChainExpression":
56428
- return path2.call(print4, "expression");
56325
+ return path2.call(print5, "expression");
56429
56326
  case "MetaProperty":
56430
56327
  return (0, lines_1.concat)([
56431
- path2.call(print4, "meta"),
56328
+ path2.call(print5, "meta"),
56432
56329
  ".",
56433
- path2.call(print4, "property")
56330
+ path2.call(print5, "property")
56434
56331
  ]);
56435
56332
  case "BindExpression":
56436
56333
  if (n.object) {
56437
- parts.push(path2.call(print4, "object"));
56334
+ parts.push(path2.call(print5, "object"));
56438
56335
  }
56439
- parts.push("::", path2.call(print4, "callee"));
56336
+ parts.push("::", path2.call(print5, "callee"));
56440
56337
  return (0, lines_1.concat)(parts);
56441
56338
  case "Path":
56442
56339
  return (0, lines_1.fromString)(".").join(n.body);
@@ -56444,7 +56341,7 @@ var require_printer2 = __commonJS({
56444
56341
  return (0, lines_1.concat)([
56445
56342
  (0, lines_1.fromString)(n.name, options),
56446
56343
  n.optional ? "?" : "",
56447
- path2.call(print4, "typeAnnotation")
56344
+ path2.call(print5, "typeAnnotation")
56448
56345
  ]);
56449
56346
  case "SpreadElement":
56450
56347
  case "SpreadElementPattern":
@@ -56455,8 +56352,8 @@ var require_printer2 = __commonJS({
56455
56352
  case "RestElement":
56456
56353
  return (0, lines_1.concat)([
56457
56354
  "...",
56458
- path2.call(print4, "argument"),
56459
- path2.call(print4, "typeAnnotation")
56355
+ path2.call(print5, "argument"),
56356
+ path2.call(print5, "typeAnnotation")
56460
56357
  ]);
56461
56358
  case "FunctionDeclaration":
56462
56359
  case "FunctionExpression":
@@ -56471,15 +56368,15 @@ var require_printer2 = __commonJS({
56471
56368
  if (n.generator)
56472
56369
  parts.push("*");
56473
56370
  if (n.id) {
56474
- parts.push(" ", path2.call(print4, "id"), path2.call(print4, "typeParameters"));
56371
+ parts.push(" ", path2.call(print5, "id"), path2.call(print5, "typeParameters"));
56475
56372
  } else {
56476
56373
  if (n.typeParameters) {
56477
- parts.push(path2.call(print4, "typeParameters"));
56374
+ parts.push(path2.call(print5, "typeParameters"));
56478
56375
  }
56479
56376
  }
56480
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
56377
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
56481
56378
  if (n.body) {
56482
- parts.push(" ", path2.call(print4, "body"));
56379
+ parts.push(" ", path2.call(print5, "body"));
56483
56380
  }
56484
56381
  return (0, lines_1.concat)(parts);
56485
56382
  case "ArrowFunctionExpression":
@@ -56487,44 +56384,44 @@ var require_printer2 = __commonJS({
56487
56384
  parts.push("async ");
56488
56385
  }
56489
56386
  if (n.typeParameters) {
56490
- parts.push(path2.call(print4, "typeParameters"));
56387
+ parts.push(path2.call(print5, "typeParameters"));
56491
56388
  }
56492
56389
  if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
56493
- parts.push(path2.call(print4, "params", 0));
56390
+ parts.push(path2.call(print5, "params", 0));
56494
56391
  } else {
56495
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
56392
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
56496
56393
  }
56497
- parts.push(" => ", path2.call(print4, "body"));
56394
+ parts.push(" => ", path2.call(print5, "body"));
56498
56395
  return (0, lines_1.concat)(parts);
56499
56396
  case "MethodDefinition":
56500
- return printMethod(path2, options, print4);
56397
+ return printMethod(path2, options, print5);
56501
56398
  case "YieldExpression":
56502
56399
  parts.push("yield");
56503
56400
  if (n.delegate)
56504
56401
  parts.push("*");
56505
56402
  if (n.argument)
56506
- parts.push(" ", path2.call(print4, "argument"));
56403
+ parts.push(" ", path2.call(print5, "argument"));
56507
56404
  return (0, lines_1.concat)(parts);
56508
56405
  case "AwaitExpression":
56509
56406
  parts.push("await");
56510
56407
  if (n.all)
56511
56408
  parts.push("*");
56512
56409
  if (n.argument)
56513
- parts.push(" ", path2.call(print4, "argument"));
56410
+ parts.push(" ", path2.call(print5, "argument"));
56514
56411
  return (0, lines_1.concat)(parts);
56515
56412
  case "ModuleExpression":
56516
56413
  return (0, lines_1.concat)([
56517
56414
  "module {\n",
56518
- path2.call(print4, "body").indent(options.tabWidth),
56415
+ path2.call(print5, "body").indent(options.tabWidth),
56519
56416
  "\n}"
56520
56417
  ]);
56521
56418
  case "ModuleDeclaration":
56522
- parts.push("module", path2.call(print4, "id"));
56419
+ parts.push("module", path2.call(print5, "id"));
56523
56420
  if (n.source) {
56524
56421
  assert_1.default.ok(!n.body);
56525
- parts.push("from", path2.call(print4, "source"));
56422
+ parts.push("from", path2.call(print5, "source"));
56526
56423
  } else {
56527
- parts.push(path2.call(print4, "body"));
56424
+ parts.push(path2.call(print5, "body"));
56528
56425
  }
56529
56426
  return (0, lines_1.fromString)(" ").join(parts);
56530
56427
  case "ImportSpecifier":
@@ -56532,27 +56429,27 @@ var require_printer2 = __commonJS({
56532
56429
  parts.push(n.importKind + " ");
56533
56430
  }
56534
56431
  if (n.imported) {
56535
- parts.push(path2.call(print4, "imported"));
56432
+ parts.push(path2.call(print5, "imported"));
56536
56433
  if (n.local && n.local.name !== n.imported.name) {
56537
- parts.push(" as ", path2.call(print4, "local"));
56434
+ parts.push(" as ", path2.call(print5, "local"));
56538
56435
  }
56539
56436
  } else if (n.id) {
56540
- parts.push(path2.call(print4, "id"));
56437
+ parts.push(path2.call(print5, "id"));
56541
56438
  if (n.name) {
56542
- parts.push(" as ", path2.call(print4, "name"));
56439
+ parts.push(" as ", path2.call(print5, "name"));
56543
56440
  }
56544
56441
  }
56545
56442
  return (0, lines_1.concat)(parts);
56546
56443
  case "ExportSpecifier":
56547
56444
  if (n.local) {
56548
- parts.push(path2.call(print4, "local"));
56445
+ parts.push(path2.call(print5, "local"));
56549
56446
  if (n.exported && n.exported.name !== n.local.name) {
56550
- parts.push(" as ", path2.call(print4, "exported"));
56447
+ parts.push(" as ", path2.call(print5, "exported"));
56551
56448
  }
56552
56449
  } else if (n.id) {
56553
- parts.push(path2.call(print4, "id"));
56450
+ parts.push(path2.call(print5, "id"));
56554
56451
  if (n.name) {
56555
- parts.push(" as ", path2.call(print4, "name"));
56452
+ parts.push(" as ", path2.call(print5, "name"));
56556
56453
  }
56557
56454
  }
56558
56455
  return (0, lines_1.concat)(parts);
@@ -56561,40 +56458,40 @@ var require_printer2 = __commonJS({
56561
56458
  case "ImportNamespaceSpecifier":
56562
56459
  parts.push("* as ");
56563
56460
  if (n.local) {
56564
- parts.push(path2.call(print4, "local"));
56461
+ parts.push(path2.call(print5, "local"));
56565
56462
  } else if (n.id) {
56566
- parts.push(path2.call(print4, "id"));
56463
+ parts.push(path2.call(print5, "id"));
56567
56464
  }
56568
56465
  return (0, lines_1.concat)(parts);
56569
56466
  case "ImportDefaultSpecifier":
56570
56467
  if (n.local) {
56571
- return path2.call(print4, "local");
56468
+ return path2.call(print5, "local");
56572
56469
  }
56573
- return path2.call(print4, "id");
56470
+ return path2.call(print5, "id");
56574
56471
  case "TSExportAssignment":
56575
- return (0, lines_1.concat)(["export = ", path2.call(print4, "expression")]);
56472
+ return (0, lines_1.concat)(["export = ", path2.call(print5, "expression")]);
56576
56473
  case "ExportDeclaration":
56577
56474
  case "ExportDefaultDeclaration":
56578
56475
  case "ExportNamedDeclaration":
56579
- return printExportDeclaration(path2, options, print4);
56476
+ return printExportDeclaration(path2, options, print5);
56580
56477
  case "ExportAllDeclaration":
56581
56478
  parts.push("export *");
56582
56479
  if (n.exported) {
56583
- parts.push(" as ", path2.call(print4, "exported"));
56480
+ parts.push(" as ", path2.call(print5, "exported"));
56584
56481
  }
56585
- parts.push(" from ", path2.call(print4, "source"), ";");
56482
+ parts.push(" from ", path2.call(print5, "source"), ";");
56586
56483
  return (0, lines_1.concat)(parts);
56587
56484
  case "TSNamespaceExportDeclaration":
56588
- parts.push("export as namespace ", path2.call(print4, "id"));
56485
+ parts.push("export as namespace ", path2.call(print5, "id"));
56589
56486
  return maybeAddSemicolon((0, lines_1.concat)(parts));
56590
56487
  case "ExportNamespaceSpecifier":
56591
- return (0, lines_1.concat)(["* as ", path2.call(print4, "exported")]);
56488
+ return (0, lines_1.concat)(["* as ", path2.call(print5, "exported")]);
56592
56489
  case "ExportDefaultSpecifier":
56593
- return path2.call(print4, "exported");
56490
+ return path2.call(print5, "exported");
56594
56491
  case "Import":
56595
56492
  return (0, lines_1.fromString)("import", options);
56596
56493
  case "ImportExpression":
56597
- return (0, lines_1.concat)(["import(", path2.call(print4, "source"), ")"]);
56494
+ return (0, lines_1.concat)(["import(", path2.call(print5, "source"), ")"]);
56598
56495
  case "ImportDeclaration": {
56599
56496
  parts.push("import ");
56600
56497
  if (n.importKind && n.importKind !== "value") {
@@ -56606,9 +56503,9 @@ var require_printer2 = __commonJS({
56606
56503
  path2.each(function(specifierPath) {
56607
56504
  var spec = specifierPath.getValue();
56608
56505
  if (spec.type === "ImportSpecifier") {
56609
- bracedSpecifiers_1.push(print4(specifierPath));
56506
+ bracedSpecifiers_1.push(print5(specifierPath));
56610
56507
  } else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
56611
- unbracedSpecifiers_1.push(print4(specifierPath));
56508
+ unbracedSpecifiers_1.push(print5(specifierPath));
56612
56509
  }
56613
56510
  }, "specifiers");
56614
56511
  unbracedSpecifiers_1.forEach(function(lines2, i2) {
@@ -56638,16 +56535,16 @@ var require_printer2 = __commonJS({
56638
56535
  }
56639
56536
  parts.push(" from ");
56640
56537
  }
56641
- parts.push(path2.call(print4, "source"), maybePrintImportAssertions(path2, options, print4), ";");
56538
+ parts.push(path2.call(print5, "source"), maybePrintImportAssertions(path2, options, print5), ";");
56642
56539
  return (0, lines_1.concat)(parts);
56643
56540
  }
56644
56541
  case "ImportAttribute":
56645
- return (0, lines_1.concat)([path2.call(print4, "key"), ": ", path2.call(print4, "value")]);
56542
+ return (0, lines_1.concat)([path2.call(print5, "key"), ": ", path2.call(print5, "value")]);
56646
56543
  case "StaticBlock":
56647
56544
  parts.push("static ");
56648
56545
  case "BlockStatement": {
56649
56546
  var naked_1 = path2.call(function(bodyPath) {
56650
- return printStatementSequence(bodyPath, options, print4);
56547
+ return printStatementSequence(bodyPath, options, print5);
56651
56548
  }, "body");
56652
56549
  if (naked_1.isEmpty()) {
56653
56550
  if (!n.directives || n.directives.length === 0) {
@@ -56658,7 +56555,7 @@ var require_printer2 = __commonJS({
56658
56555
  parts.push("{\n");
56659
56556
  if (n.directives) {
56660
56557
  path2.each(function(childPath) {
56661
- parts.push(maybeAddSemicolon(print4(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
56558
+ parts.push(maybeAddSemicolon(print5(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
56662
56559
  }, "directives");
56663
56560
  }
56664
56561
  parts.push(naked_1.indent(options.tabWidth));
@@ -56668,7 +56565,7 @@ var require_printer2 = __commonJS({
56668
56565
  case "ReturnStatement": {
56669
56566
  parts.push("return");
56670
56567
  if (n.argument) {
56671
- var argLines = path2.call(print4, "argument");
56568
+ var argLines = path2.call(print5, "argument");
56672
56569
  if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
56673
56570
  parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
56674
56571
  } else {
@@ -56680,17 +56577,17 @@ var require_printer2 = __commonJS({
56680
56577
  }
56681
56578
  case "CallExpression":
56682
56579
  case "OptionalCallExpression":
56683
- parts.push(path2.call(print4, "callee"));
56580
+ parts.push(path2.call(print5, "callee"));
56684
56581
  if (n.typeParameters) {
56685
- parts.push(path2.call(print4, "typeParameters"));
56582
+ parts.push(path2.call(print5, "typeParameters"));
56686
56583
  }
56687
56584
  if (n.typeArguments) {
56688
- parts.push(path2.call(print4, "typeArguments"));
56585
+ parts.push(path2.call(print5, "typeArguments"));
56689
56586
  }
56690
56587
  if (types4.getFieldValue(n, "optional")) {
56691
56588
  parts.push("?.");
56692
56589
  }
56693
- parts.push(printArgumentsList(path2, options, print4));
56590
+ parts.push(printArgumentsList(path2, options, print5));
56694
56591
  return (0, lines_1.concat)(parts);
56695
56592
  case "RecordExpression":
56696
56593
  parts.push("#");
@@ -56720,7 +56617,7 @@ var require_printer2 = __commonJS({
56720
56617
  var i_1 = 0;
56721
56618
  fields.forEach(function(field) {
56722
56619
  path2.each(function(childPath) {
56723
- var lines2 = print4(childPath);
56620
+ var lines2 = print5(childPath);
56724
56621
  if (!oneLine_1) {
56725
56622
  lines2 = lines2.indent(options.tabWidth);
56726
56623
  }
@@ -56757,32 +56654,32 @@ var require_printer2 = __commonJS({
56757
56654
  parts[parts.length - 1] = " " + rightBrace;
56758
56655
  }
56759
56656
  if (n.typeAnnotation) {
56760
- parts.push(path2.call(print4, "typeAnnotation"));
56657
+ parts.push(path2.call(print5, "typeAnnotation"));
56761
56658
  }
56762
56659
  return (0, lines_1.concat)(parts);
56763
56660
  }
56764
56661
  case "PropertyPattern":
56765
56662
  return (0, lines_1.concat)([
56766
- path2.call(print4, "key"),
56663
+ path2.call(print5, "key"),
56767
56664
  ": ",
56768
- path2.call(print4, "pattern")
56665
+ path2.call(print5, "pattern")
56769
56666
  ]);
56770
56667
  case "ObjectProperty":
56771
56668
  case "Property": {
56772
56669
  if (n.method || n.kind === "get" || n.kind === "set") {
56773
- return printMethod(path2, options, print4);
56670
+ return printMethod(path2, options, print5);
56774
56671
  }
56775
56672
  if (n.shorthand && n.value.type === "AssignmentPattern") {
56776
- return path2.call(print4, "value");
56673
+ return path2.call(print5, "value");
56777
56674
  }
56778
- var key = path2.call(print4, "key");
56675
+ var key = path2.call(print5, "key");
56779
56676
  if (n.computed) {
56780
56677
  parts.push("[", key, "]");
56781
56678
  } else {
56782
56679
  parts.push(key);
56783
56680
  }
56784
56681
  if (!n.shorthand || n.key.name !== n.value.name) {
56785
- parts.push(": ", path2.call(print4, "value"));
56682
+ parts.push(": ", path2.call(print5, "value"));
56786
56683
  }
56787
56684
  return (0, lines_1.concat)(parts);
56788
56685
  }
@@ -56790,18 +56687,18 @@ var require_printer2 = __commonJS({
56790
56687
  case "ObjectMethod":
56791
56688
  case "ClassPrivateMethod":
56792
56689
  case "TSDeclareMethod":
56793
- return printMethod(path2, options, print4);
56690
+ return printMethod(path2, options, print5);
56794
56691
  case "PrivateName":
56795
- return (0, lines_1.concat)(["#", path2.call(print4, "id")]);
56692
+ return (0, lines_1.concat)(["#", path2.call(print5, "id")]);
56796
56693
  case "Decorator":
56797
- return (0, lines_1.concat)(["@", path2.call(print4, "expression")]);
56694
+ return (0, lines_1.concat)(["@", path2.call(print5, "expression")]);
56798
56695
  case "TupleExpression":
56799
56696
  parts.push("#");
56800
56697
  case "ArrayExpression":
56801
56698
  case "ArrayPattern": {
56802
56699
  var elems = n.elements;
56803
56700
  var len_2 = elems.length;
56804
- var printed_1 = path2.map(print4, "elements");
56701
+ var printed_1 = path2.map(print5, "elements");
56805
56702
  var joined = (0, lines_1.fromString)(", ").join(printed_1);
56806
56703
  var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
56807
56704
  if (oneLine_2) {
@@ -56839,12 +56736,12 @@ var require_printer2 = __commonJS({
56839
56736
  parts.push("]");
56840
56737
  }
56841
56738
  if (n.typeAnnotation) {
56842
- parts.push(path2.call(print4, "typeAnnotation"));
56739
+ parts.push(path2.call(print5, "typeAnnotation"));
56843
56740
  }
56844
56741
  return (0, lines_1.concat)(parts);
56845
56742
  }
56846
56743
  case "SequenceExpression":
56847
- return (0, lines_1.fromString)(", ").join(path2.map(print4, "expressions"));
56744
+ return (0, lines_1.fromString)(", ").join(path2.map(print5, "expressions"));
56848
56745
  case "ThisExpression":
56849
56746
  return (0, lines_1.fromString)("this");
56850
56747
  case "Super":
@@ -56865,7 +56762,7 @@ var require_printer2 = __commonJS({
56865
56762
  case "Literal":
56866
56763
  return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
56867
56764
  case "Directive":
56868
- return path2.call(print4, "value");
56765
+ return path2.call(print5, "value");
56869
56766
  case "DirectiveLiteral":
56870
56767
  return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
56871
56768
  case "InterpreterDirective":
@@ -56879,32 +56776,32 @@ var require_printer2 = __commonJS({
56879
56776
  parts.push(n.operator);
56880
56777
  if (/[a-z]$/.test(n.operator))
56881
56778
  parts.push(" ");
56882
- parts.push(path2.call(print4, "argument"));
56779
+ parts.push(path2.call(print5, "argument"));
56883
56780
  return (0, lines_1.concat)(parts);
56884
56781
  case "UpdateExpression":
56885
- parts.push(path2.call(print4, "argument"), n.operator);
56782
+ parts.push(path2.call(print5, "argument"), n.operator);
56886
56783
  if (n.prefix)
56887
56784
  parts.reverse();
56888
56785
  return (0, lines_1.concat)(parts);
56889
56786
  case "ConditionalExpression":
56890
56787
  return (0, lines_1.concat)([
56891
- path2.call(print4, "test"),
56788
+ path2.call(print5, "test"),
56892
56789
  " ? ",
56893
- path2.call(print4, "consequent"),
56790
+ path2.call(print5, "consequent"),
56894
56791
  " : ",
56895
- path2.call(print4, "alternate")
56792
+ path2.call(print5, "alternate")
56896
56793
  ]);
56897
56794
  case "NewExpression": {
56898
- parts.push("new ", path2.call(print4, "callee"));
56795
+ parts.push("new ", path2.call(print5, "callee"));
56899
56796
  if (n.typeParameters) {
56900
- parts.push(path2.call(print4, "typeParameters"));
56797
+ parts.push(path2.call(print5, "typeParameters"));
56901
56798
  }
56902
56799
  if (n.typeArguments) {
56903
- parts.push(path2.call(print4, "typeArguments"));
56800
+ parts.push(path2.call(print5, "typeArguments"));
56904
56801
  }
56905
56802
  var args = n.arguments;
56906
56803
  if (args) {
56907
- parts.push(printArgumentsList(path2, options, print4));
56804
+ parts.push(printArgumentsList(path2, options, print5));
56908
56805
  }
56909
56806
  return (0, lines_1.concat)(parts);
56910
56807
  }
@@ -56915,7 +56812,7 @@ var require_printer2 = __commonJS({
56915
56812
  parts.push(n.kind, " ");
56916
56813
  var maxLen_1 = 0;
56917
56814
  var printed = path2.map(function(childPath) {
56918
- var lines2 = print4(childPath);
56815
+ var lines2 = print5(childPath);
56919
56816
  maxLen_1 = Math.max(lines2.length, maxLen_1);
56920
56817
  return lines2;
56921
56818
  }, "declarations");
@@ -56934,30 +56831,30 @@ var require_printer2 = __commonJS({
56934
56831
  }
56935
56832
  case "VariableDeclarator":
56936
56833
  return n.init ? (0, lines_1.fromString)(" = ").join([
56937
- path2.call(print4, "id"),
56938
- path2.call(print4, "init")
56939
- ]) : path2.call(print4, "id");
56834
+ path2.call(print5, "id"),
56835
+ path2.call(print5, "init")
56836
+ ]) : path2.call(print5, "id");
56940
56837
  case "WithStatement":
56941
56838
  return (0, lines_1.concat)([
56942
56839
  "with (",
56943
- path2.call(print4, "object"),
56840
+ path2.call(print5, "object"),
56944
56841
  ") ",
56945
- path2.call(print4, "body")
56842
+ path2.call(print5, "body")
56946
56843
  ]);
56947
56844
  case "IfStatement": {
56948
- var con = adjustClause(path2.call(print4, "consequent"), options);
56949
- parts.push("if (", path2.call(print4, "test"), ")", con);
56845
+ var con = adjustClause(path2.call(print5, "consequent"), options);
56846
+ parts.push("if (", path2.call(print5, "test"), ")", con);
56950
56847
  if (n.alternate)
56951
- parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print4, "alternate"), options));
56848
+ parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print5, "alternate"), options));
56952
56849
  return (0, lines_1.concat)(parts);
56953
56850
  }
56954
56851
  case "ForStatement": {
56955
- var init = path2.call(print4, "init");
56852
+ var init = path2.call(print5, "init");
56956
56853
  var sep2 = init.length > 1 ? ";\n" : "; ";
56957
56854
  var forParen = "for (";
56958
- var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print4, "test"), path2.call(print4, "update")]).indentTail(forParen.length);
56855
+ var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print5, "test"), path2.call(print5, "update")]).indentTail(forParen.length);
56959
56856
  var head = (0, lines_1.concat)([forParen, indented, ")"]);
56960
- var clause = adjustClause(path2.call(print4, "body"), options);
56857
+ var clause = adjustClause(path2.call(print5, "body"), options);
56961
56858
  parts.push(head);
56962
56859
  if (head.length > 1) {
56963
56860
  parts.push("\n");
@@ -56969,18 +56866,18 @@ var require_printer2 = __commonJS({
56969
56866
  case "WhileStatement":
56970
56867
  return (0, lines_1.concat)([
56971
56868
  "while (",
56972
- path2.call(print4, "test"),
56869
+ path2.call(print5, "test"),
56973
56870
  ")",
56974
- adjustClause(path2.call(print4, "body"), options)
56871
+ adjustClause(path2.call(print5, "body"), options)
56975
56872
  ]);
56976
56873
  case "ForInStatement":
56977
56874
  return (0, lines_1.concat)([
56978
56875
  n.each ? "for each (" : "for (",
56979
- path2.call(print4, "left"),
56876
+ path2.call(print5, "left"),
56980
56877
  " in ",
56981
- path2.call(print4, "right"),
56878
+ path2.call(print5, "right"),
56982
56879
  ")",
56983
- adjustClause(path2.call(print4, "body"), options)
56880
+ adjustClause(path2.call(print5, "body"), options)
56984
56881
  ]);
56985
56882
  case "ForOfStatement":
56986
56883
  case "ForAwaitStatement":
@@ -56988,122 +56885,122 @@ var require_printer2 = __commonJS({
56988
56885
  if (n.await || n.type === "ForAwaitStatement") {
56989
56886
  parts.push("await ");
56990
56887
  }
56991
- parts.push("(", path2.call(print4, "left"), " of ", path2.call(print4, "right"), ")", adjustClause(path2.call(print4, "body"), options));
56888
+ parts.push("(", path2.call(print5, "left"), " of ", path2.call(print5, "right"), ")", adjustClause(path2.call(print5, "body"), options));
56992
56889
  return (0, lines_1.concat)(parts);
56993
56890
  case "DoWhileStatement": {
56994
56891
  var doBody = (0, lines_1.concat)([
56995
56892
  "do",
56996
- adjustClause(path2.call(print4, "body"), options)
56893
+ adjustClause(path2.call(print5, "body"), options)
56997
56894
  ]);
56998
56895
  parts.push(doBody);
56999
56896
  if (endsWithBrace(doBody))
57000
56897
  parts.push(" while");
57001
56898
  else
57002
56899
  parts.push("\nwhile");
57003
- parts.push(" (", path2.call(print4, "test"), ");");
56900
+ parts.push(" (", path2.call(print5, "test"), ");");
57004
56901
  return (0, lines_1.concat)(parts);
57005
56902
  }
57006
56903
  case "DoExpression": {
57007
56904
  var statements = path2.call(function(bodyPath) {
57008
- return printStatementSequence(bodyPath, options, print4);
56905
+ return printStatementSequence(bodyPath, options, print5);
57009
56906
  }, "body");
57010
56907
  return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
57011
56908
  }
57012
56909
  case "BreakStatement":
57013
56910
  parts.push("break");
57014
56911
  if (n.label)
57015
- parts.push(" ", path2.call(print4, "label"));
56912
+ parts.push(" ", path2.call(print5, "label"));
57016
56913
  parts.push(";");
57017
56914
  return (0, lines_1.concat)(parts);
57018
56915
  case "ContinueStatement":
57019
56916
  parts.push("continue");
57020
56917
  if (n.label)
57021
- parts.push(" ", path2.call(print4, "label"));
56918
+ parts.push(" ", path2.call(print5, "label"));
57022
56919
  parts.push(";");
57023
56920
  return (0, lines_1.concat)(parts);
57024
56921
  case "LabeledStatement":
57025
56922
  return (0, lines_1.concat)([
57026
- path2.call(print4, "label"),
56923
+ path2.call(print5, "label"),
57027
56924
  ":\n",
57028
- path2.call(print4, "body")
56925
+ path2.call(print5, "body")
57029
56926
  ]);
57030
56927
  case "TryStatement":
57031
- parts.push("try ", path2.call(print4, "block"));
56928
+ parts.push("try ", path2.call(print5, "block"));
57032
56929
  if (n.handler) {
57033
- parts.push(" ", path2.call(print4, "handler"));
56930
+ parts.push(" ", path2.call(print5, "handler"));
57034
56931
  } else if (n.handlers) {
57035
56932
  path2.each(function(handlerPath) {
57036
- parts.push(" ", print4(handlerPath));
56933
+ parts.push(" ", print5(handlerPath));
57037
56934
  }, "handlers");
57038
56935
  }
57039
56936
  if (n.finalizer) {
57040
- parts.push(" finally ", path2.call(print4, "finalizer"));
56937
+ parts.push(" finally ", path2.call(print5, "finalizer"));
57041
56938
  }
57042
56939
  return (0, lines_1.concat)(parts);
57043
56940
  case "CatchClause":
57044
56941
  parts.push("catch ");
57045
56942
  if (n.param) {
57046
- parts.push("(", path2.call(print4, "param"));
56943
+ parts.push("(", path2.call(print5, "param"));
57047
56944
  }
57048
56945
  if (n.guard) {
57049
- parts.push(" if ", path2.call(print4, "guard"));
56946
+ parts.push(" if ", path2.call(print5, "guard"));
57050
56947
  }
57051
56948
  if (n.param) {
57052
56949
  parts.push(") ");
57053
56950
  }
57054
- parts.push(path2.call(print4, "body"));
56951
+ parts.push(path2.call(print5, "body"));
57055
56952
  return (0, lines_1.concat)(parts);
57056
56953
  case "ThrowStatement":
57057
- return (0, lines_1.concat)(["throw ", path2.call(print4, "argument"), ";"]);
56954
+ return (0, lines_1.concat)(["throw ", path2.call(print5, "argument"), ";"]);
57058
56955
  case "SwitchStatement":
57059
56956
  return (0, lines_1.concat)([
57060
56957
  "switch (",
57061
- path2.call(print4, "discriminant"),
56958
+ path2.call(print5, "discriminant"),
57062
56959
  ") {\n",
57063
- (0, lines_1.fromString)("\n").join(path2.map(print4, "cases")),
56960
+ (0, lines_1.fromString)("\n").join(path2.map(print5, "cases")),
57064
56961
  "\n}"
57065
56962
  ]);
57066
56963
  case "SwitchCase":
57067
56964
  if (n.test)
57068
- parts.push("case ", path2.call(print4, "test"), ":");
56965
+ parts.push("case ", path2.call(print5, "test"), ":");
57069
56966
  else
57070
56967
  parts.push("default:");
57071
56968
  if (n.consequent.length > 0) {
57072
56969
  parts.push("\n", path2.call(function(consequentPath) {
57073
- return printStatementSequence(consequentPath, options, print4);
56970
+ return printStatementSequence(consequentPath, options, print5);
57074
56971
  }, "consequent").indent(options.tabWidth));
57075
56972
  }
57076
56973
  return (0, lines_1.concat)(parts);
57077
56974
  case "DebuggerStatement":
57078
56975
  return (0, lines_1.fromString)("debugger;");
57079
56976
  case "JSXAttribute":
57080
- parts.push(path2.call(print4, "name"));
56977
+ parts.push(path2.call(print5, "name"));
57081
56978
  if (n.value)
57082
- parts.push("=", path2.call(print4, "value"));
56979
+ parts.push("=", path2.call(print5, "value"));
57083
56980
  return (0, lines_1.concat)(parts);
57084
56981
  case "JSXIdentifier":
57085
56982
  return (0, lines_1.fromString)(n.name, options);
57086
56983
  case "JSXNamespacedName":
57087
56984
  return (0, lines_1.fromString)(":").join([
57088
- path2.call(print4, "namespace"),
57089
- path2.call(print4, "name")
56985
+ path2.call(print5, "namespace"),
56986
+ path2.call(print5, "name")
57090
56987
  ]);
57091
56988
  case "JSXMemberExpression":
57092
56989
  return (0, lines_1.fromString)(".").join([
57093
- path2.call(print4, "object"),
57094
- path2.call(print4, "property")
56990
+ path2.call(print5, "object"),
56991
+ path2.call(print5, "property")
57095
56992
  ]);
57096
56993
  case "JSXSpreadAttribute":
57097
- return (0, lines_1.concat)(["{...", path2.call(print4, "argument"), "}"]);
56994
+ return (0, lines_1.concat)(["{...", path2.call(print5, "argument"), "}"]);
57098
56995
  case "JSXSpreadChild":
57099
- return (0, lines_1.concat)(["{...", path2.call(print4, "expression"), "}"]);
56996
+ return (0, lines_1.concat)(["{...", path2.call(print5, "expression"), "}"]);
57100
56997
  case "JSXExpressionContainer":
57101
- return (0, lines_1.concat)(["{", path2.call(print4, "expression"), "}"]);
56998
+ return (0, lines_1.concat)(["{", path2.call(print5, "expression"), "}"]);
57102
56999
  case "JSXElement":
57103
57000
  case "JSXFragment": {
57104
57001
  var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
57105
57002
  var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
57106
- var openingLines = path2.call(print4, openingPropName);
57003
+ var openingLines = path2.call(print5, openingPropName);
57107
57004
  if (n[openingPropName].selfClosing) {
57108
57005
  assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
57109
57006
  return openingLines;
@@ -57117,16 +57014,16 @@ var require_printer2 = __commonJS({
57117
57014
  return "\n";
57118
57015
  }
57119
57016
  }
57120
- return print4(childPath);
57017
+ return print5(childPath);
57121
57018
  }, "children")).indentTail(options.tabWidth);
57122
- var closingLines = path2.call(print4, closingPropName);
57019
+ var closingLines = path2.call(print5, closingPropName);
57123
57020
  return (0, lines_1.concat)([openingLines, childLines, closingLines]);
57124
57021
  }
57125
57022
  case "JSXOpeningElement": {
57126
- parts.push("<", path2.call(print4, "name"));
57023
+ parts.push("<", path2.call(print5, "name"));
57127
57024
  var attrParts_1 = [];
57128
57025
  path2.each(function(attrPath) {
57129
- attrParts_1.push(" ", print4(attrPath));
57026
+ attrParts_1.push(" ", print5(attrPath));
57130
57027
  }, "attributes");
57131
57028
  var attrLines = (0, lines_1.concat)(attrParts_1);
57132
57029
  var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
@@ -57143,7 +57040,7 @@ var require_printer2 = __commonJS({
57143
57040
  return (0, lines_1.concat)(parts);
57144
57041
  }
57145
57042
  case "JSXClosingElement":
57146
- return (0, lines_1.concat)(["</", path2.call(print4, "name"), ">"]);
57043
+ return (0, lines_1.concat)(["</", path2.call(print5, "name"), ">"]);
57147
57044
  case "JSXOpeningFragment":
57148
57045
  return (0, lines_1.fromString)("<>");
57149
57046
  case "JSXClosingFragment":
@@ -57154,9 +57051,9 @@ var require_printer2 = __commonJS({
57154
57051
  return (0, lines_1.fromString)("");
57155
57052
  case "TypeAnnotatedIdentifier":
57156
57053
  return (0, lines_1.concat)([
57157
- path2.call(print4, "annotation"),
57054
+ path2.call(print5, "annotation"),
57158
57055
  " ",
57159
- path2.call(print4, "identifier")
57056
+ path2.call(print5, "identifier")
57160
57057
  ]);
57161
57058
  case "ClassBody":
57162
57059
  if (n.body.length === 0) {
@@ -57165,12 +57062,12 @@ var require_printer2 = __commonJS({
57165
57062
  return (0, lines_1.concat)([
57166
57063
  "{\n",
57167
57064
  path2.call(function(bodyPath) {
57168
- return printStatementSequence(bodyPath, options, print4);
57065
+ return printStatementSequence(bodyPath, options, print5);
57169
57066
  }, "body").indent(options.tabWidth),
57170
57067
  "\n}"
57171
57068
  ]);
57172
57069
  case "ClassPropertyDefinition":
57173
- parts.push("static ", path2.call(print4, "definition"));
57070
+ parts.push("static ", path2.call(print5, "definition"));
57174
57071
  if (!namedTypes.MethodDefinition.check(n.definition))
57175
57072
  parts.push(";");
57176
57073
  return (0, lines_1.concat)(parts);
@@ -57191,12 +57088,12 @@ var require_printer2 = __commonJS({
57191
57088
  if (n.readonly) {
57192
57089
  parts.push("readonly ");
57193
57090
  }
57194
- var key = path2.call(print4, "key");
57091
+ var key = path2.call(print5, "key");
57195
57092
  if (n.computed) {
57196
57093
  key = (0, lines_1.concat)(["[", key, "]"]);
57197
57094
  }
57198
57095
  if (n.variance) {
57199
- key = (0, lines_1.concat)([printVariance(path2, print4), key]);
57096
+ key = (0, lines_1.concat)([printVariance(path2, print5), key]);
57200
57097
  }
57201
57098
  parts.push(key);
57202
57099
  if (n.optional) {
@@ -57206,10 +57103,10 @@ var require_printer2 = __commonJS({
57206
57103
  parts.push("!");
57207
57104
  }
57208
57105
  if (n.typeAnnotation) {
57209
- parts.push(path2.call(print4, "typeAnnotation"));
57106
+ parts.push(path2.call(print5, "typeAnnotation"));
57210
57107
  }
57211
57108
  if (n.value) {
57212
- parts.push(" = ", path2.call(print4, "value"));
57109
+ parts.push(" = ", path2.call(print5, "value"));
57213
57110
  }
57214
57111
  parts.push(";");
57215
57112
  return (0, lines_1.concat)(parts);
@@ -57218,21 +57115,21 @@ var require_printer2 = __commonJS({
57218
57115
  if (n.static) {
57219
57116
  parts.push("static ");
57220
57117
  }
57221
- parts.push(path2.call(print4, "key"));
57118
+ parts.push(path2.call(print5, "key"));
57222
57119
  if (n.typeAnnotation) {
57223
- parts.push(path2.call(print4, "typeAnnotation"));
57120
+ parts.push(path2.call(print5, "typeAnnotation"));
57224
57121
  }
57225
57122
  if (n.value) {
57226
- parts.push(" = ", path2.call(print4, "value"));
57123
+ parts.push(" = ", path2.call(print5, "value"));
57227
57124
  }
57228
57125
  parts.push(";");
57229
57126
  return (0, lines_1.concat)(parts);
57230
57127
  case "ClassAccessorProperty": {
57231
57128
  parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
57232
57129
  if (n.computed) {
57233
- parts.push("[", path2.call(print4, "key"), "]");
57130
+ parts.push("[", path2.call(print5, "key"), "]");
57234
57131
  } else {
57235
- parts.push(path2.call(print4, "key"));
57132
+ parts.push(path2.call(print5, "key"));
57236
57133
  }
57237
57134
  if (n.optional) {
57238
57135
  parts.push("?");
@@ -57241,10 +57138,10 @@ var require_printer2 = __commonJS({
57241
57138
  parts.push("!");
57242
57139
  }
57243
57140
  if (n.typeAnnotation) {
57244
- parts.push(path2.call(print4, "typeAnnotation"));
57141
+ parts.push(path2.call(print5, "typeAnnotation"));
57245
57142
  }
57246
57143
  if (n.value) {
57247
- parts.push(" = ", path2.call(print4, "value"));
57144
+ parts.push(" = ", path2.call(print5, "value"));
57248
57145
  }
57249
57146
  parts.push(";");
57250
57147
  return (0, lines_1.concat)(parts);
@@ -57260,21 +57157,21 @@ var require_printer2 = __commonJS({
57260
57157
  }
57261
57158
  parts.push("class");
57262
57159
  if (n.id) {
57263
- parts.push(" ", path2.call(print4, "id"));
57160
+ parts.push(" ", path2.call(print5, "id"));
57264
57161
  }
57265
57162
  if (n.typeParameters) {
57266
- parts.push(path2.call(print4, "typeParameters"));
57163
+ parts.push(path2.call(print5, "typeParameters"));
57267
57164
  }
57268
57165
  if (n.superClass) {
57269
- parts.push(" extends ", path2.call(print4, "superClass"), path2.call(print4, "superTypeParameters"));
57166
+ parts.push(" extends ", path2.call(print5, "superClass"), path2.call(print5, "superTypeParameters"));
57270
57167
  }
57271
57168
  if (n.extends && n.extends.length > 0) {
57272
- parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")));
57169
+ parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")));
57273
57170
  }
57274
57171
  if (n["implements"] && n["implements"].length > 0) {
57275
- parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print4, "implements")));
57172
+ parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print5, "implements")));
57276
57173
  }
57277
- parts.push(" ", path2.call(print4, "body"));
57174
+ parts.push(" ", path2.call(print5, "body"));
57278
57175
  if (n.type === "DeclareClass") {
57279
57176
  return printFlowDeclaration(path2, parts);
57280
57177
  } else {
@@ -57283,11 +57180,11 @@ var require_printer2 = __commonJS({
57283
57180
  case "TemplateElement":
57284
57181
  return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
57285
57182
  case "TemplateLiteral": {
57286
- var expressions_1 = path2.map(print4, "expressions");
57183
+ var expressions_1 = path2.map(print5, "expressions");
57287
57184
  parts.push("`");
57288
57185
  path2.each(function(childPath) {
57289
57186
  var i2 = childPath.getName();
57290
- parts.push(print4(childPath));
57187
+ parts.push(print5(childPath));
57291
57188
  if (i2 < expressions_1.length) {
57292
57189
  parts.push("${", expressions_1[i2], "}");
57293
57190
  }
@@ -57296,7 +57193,7 @@ var require_printer2 = __commonJS({
57296
57193
  return (0, lines_1.concat)(parts).lockIndentTail();
57297
57194
  }
57298
57195
  case "TaggedTemplateExpression":
57299
- return (0, lines_1.concat)([path2.call(print4, "tag"), path2.call(print4, "quasi")]);
57196
+ return (0, lines_1.concat)([path2.call(print5, "tag"), path2.call(print5, "quasi")]);
57300
57197
  case "Node":
57301
57198
  case "Printable":
57302
57199
  case "SourceLocation":
@@ -57330,7 +57227,7 @@ var require_printer2 = __commonJS({
57330
57227
  if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
57331
57228
  parts.push(": ");
57332
57229
  }
57333
- parts.push(path2.call(print4, "typeAnnotation"));
57230
+ parts.push(path2.call(print5, "typeAnnotation"));
57334
57231
  return (0, lines_1.concat)(parts);
57335
57232
  }
57336
57233
  return (0, lines_1.fromString)("");
@@ -57344,9 +57241,9 @@ var require_printer2 = __commonJS({
57344
57241
  case "MixedTypeAnnotation":
57345
57242
  return (0, lines_1.fromString)("mixed", options);
57346
57243
  case "ArrayTypeAnnotation":
57347
- return (0, lines_1.concat)([path2.call(print4, "elementType"), "[]"]);
57244
+ return (0, lines_1.concat)([path2.call(print5, "elementType"), "[]"]);
57348
57245
  case "TupleTypeAnnotation": {
57349
- var printed_2 = path2.map(print4, "types");
57246
+ var printed_2 = path2.map(print5, "types");
57350
57247
  var joined = (0, lines_1.fromString)(", ").join(printed_2);
57351
57248
  var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
57352
57249
  if (oneLine_3) {
@@ -57393,38 +57290,38 @@ var require_printer2 = __commonJS({
57393
57290
  case "InterfaceTypeAnnotation":
57394
57291
  parts.push("interface");
57395
57292
  if (n.extends && n.extends.length > 0) {
57396
- parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")));
57293
+ parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")));
57397
57294
  }
57398
- parts.push(" ", path2.call(print4, "body"));
57295
+ parts.push(" ", path2.call(print5, "body"));
57399
57296
  return (0, lines_1.concat)(parts);
57400
57297
  case "DeclareFunction":
57401
57298
  return printFlowDeclaration(path2, [
57402
57299
  "function ",
57403
- path2.call(print4, "id"),
57300
+ path2.call(print5, "id"),
57404
57301
  ";"
57405
57302
  ]);
57406
57303
  case "DeclareModule":
57407
57304
  return printFlowDeclaration(path2, [
57408
57305
  "module ",
57409
- path2.call(print4, "id"),
57306
+ path2.call(print5, "id"),
57410
57307
  " ",
57411
- path2.call(print4, "body")
57308
+ path2.call(print5, "body")
57412
57309
  ]);
57413
57310
  case "DeclareModuleExports":
57414
57311
  return printFlowDeclaration(path2, [
57415
57312
  "module.exports",
57416
- path2.call(print4, "typeAnnotation")
57313
+ path2.call(print5, "typeAnnotation")
57417
57314
  ]);
57418
57315
  case "DeclareVariable":
57419
- return printFlowDeclaration(path2, ["var ", path2.call(print4, "id"), ";"]);
57316
+ return printFlowDeclaration(path2, ["var ", path2.call(print5, "id"), ";"]);
57420
57317
  case "DeclareExportDeclaration":
57421
57318
  case "DeclareExportAllDeclaration":
57422
- return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print4)]);
57319
+ return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print5)]);
57423
57320
  case "EnumDeclaration":
57424
57321
  return (0, lines_1.concat)([
57425
57322
  "enum ",
57426
- path2.call(print4, "id"),
57427
- path2.call(print4, "body")
57323
+ path2.call(print5, "id"),
57324
+ path2.call(print5, "body")
57428
57325
  ]);
57429
57326
  case "EnumBooleanBody":
57430
57327
  case "EnumNumberBody":
@@ -57436,24 +57333,24 @@ var require_printer2 = __commonJS({
57436
57333
  n.type.slice(4, -4).toLowerCase()
57437
57334
  );
57438
57335
  }
57439
- parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print4, "members")).indent(options.tabWidth), "\n}");
57336
+ parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print5, "members")).indent(options.tabWidth), "\n}");
57440
57337
  return (0, lines_1.concat)(parts);
57441
57338
  }
57442
57339
  case "EnumDefaultedMember":
57443
- return (0, lines_1.concat)([path2.call(print4, "id"), ","]);
57340
+ return (0, lines_1.concat)([path2.call(print5, "id"), ","]);
57444
57341
  case "EnumBooleanMember":
57445
57342
  case "EnumNumberMember":
57446
57343
  case "EnumStringMember":
57447
57344
  return (0, lines_1.concat)([
57448
- path2.call(print4, "id"),
57345
+ path2.call(print5, "id"),
57449
57346
  " = ",
57450
- path2.call(print4, "init"),
57347
+ path2.call(print5, "init"),
57451
57348
  ","
57452
57349
  ]);
57453
57350
  case "InferredPredicate":
57454
57351
  return (0, lines_1.fromString)("%checks", options);
57455
57352
  case "DeclaredPredicate":
57456
- return (0, lines_1.concat)(["%checks(", path2.call(print4, "value"), ")"]);
57353
+ return (0, lines_1.concat)(["%checks(", path2.call(print5, "value"), ")"]);
57457
57354
  case "FunctionTypeAnnotation": {
57458
57355
  var parent = path2.getParentNode(0);
57459
57356
  var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
@@ -57463,14 +57360,14 @@ var require_printer2 = __commonJS({
57463
57360
  }
57464
57361
  var hasTypeParameters = !!n.typeParameters;
57465
57362
  var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
57466
- parts.push(hasTypeParameters ? path2.call(print4, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print4), needsParens ? ")" : "");
57363
+ parts.push(hasTypeParameters ? path2.call(print5, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print5), needsParens ? ")" : "");
57467
57364
  if (n.returnType) {
57468
- parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print4, "returnType"));
57365
+ parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print5, "returnType"));
57469
57366
  }
57470
57367
  return (0, lines_1.concat)(parts);
57471
57368
  }
57472
57369
  case "FunctionTypeParam": {
57473
- var name = path2.call(print4, "name");
57370
+ var name = path2.call(print5, "name");
57474
57371
  parts.push(name);
57475
57372
  if (n.optional) {
57476
57373
  parts.push("?");
@@ -57478,13 +57375,13 @@ var require_printer2 = __commonJS({
57478
57375
  if (name.infos[0].line) {
57479
57376
  parts.push(": ");
57480
57377
  }
57481
- parts.push(path2.call(print4, "typeAnnotation"));
57378
+ parts.push(path2.call(print5, "typeAnnotation"));
57482
57379
  return (0, lines_1.concat)(parts);
57483
57380
  }
57484
57381
  case "GenericTypeAnnotation":
57485
57382
  return (0, lines_1.concat)([
57486
- path2.call(print4, "id"),
57487
- path2.call(print4, "typeParameters")
57383
+ path2.call(print5, "id"),
57384
+ path2.call(print5, "typeParameters")
57488
57385
  ]);
57489
57386
  case "DeclareInterface":
57490
57387
  parts.push("declare ");
@@ -57493,24 +57390,24 @@ var require_printer2 = __commonJS({
57493
57390
  if (n.declare) {
57494
57391
  parts.push("declare ");
57495
57392
  }
57496
- parts.push("interface ", path2.call(print4, "id"), path2.call(print4, "typeParameters"), " ");
57393
+ parts.push("interface ", path2.call(print5, "id"), path2.call(print5, "typeParameters"), " ");
57497
57394
  if (n["extends"] && n["extends"].length > 0) {
57498
- parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print4, "extends")), " ");
57395
+ parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print5, "extends")), " ");
57499
57396
  }
57500
57397
  if (n.body) {
57501
- parts.push(path2.call(print4, "body"));
57398
+ parts.push(path2.call(print5, "body"));
57502
57399
  }
57503
57400
  return (0, lines_1.concat)(parts);
57504
57401
  case "ClassImplements":
57505
57402
  case "InterfaceExtends":
57506
57403
  return (0, lines_1.concat)([
57507
- path2.call(print4, "id"),
57508
- path2.call(print4, "typeParameters")
57404
+ path2.call(print5, "id"),
57405
+ path2.call(print5, "typeParameters")
57509
57406
  ]);
57510
57407
  case "IntersectionTypeAnnotation":
57511
- return (0, lines_1.fromString)(" & ").join(path2.map(print4, "types"));
57408
+ return (0, lines_1.fromString)(" & ").join(path2.map(print5, "types"));
57512
57409
  case "NullableTypeAnnotation":
57513
- return (0, lines_1.concat)(["?", path2.call(print4, "typeAnnotation")]);
57410
+ return (0, lines_1.concat)(["?", path2.call(print5, "typeAnnotation")]);
57514
57411
  case "NullLiteralTypeAnnotation":
57515
57412
  return (0, lines_1.fromString)("null", options);
57516
57413
  case "ThisTypeAnnotation":
@@ -57518,40 +57415,40 @@ var require_printer2 = __commonJS({
57518
57415
  case "NumberTypeAnnotation":
57519
57416
  return (0, lines_1.fromString)("number", options);
57520
57417
  case "ObjectTypeCallProperty":
57521
- return path2.call(print4, "value");
57418
+ return path2.call(print5, "value");
57522
57419
  case "ObjectTypeIndexer":
57523
57420
  if (n.static) {
57524
57421
  parts.push("static ");
57525
57422
  }
57526
- parts.push(printVariance(path2, print4), "[");
57423
+ parts.push(printVariance(path2, print5), "[");
57527
57424
  if (n.id) {
57528
- parts.push(path2.call(print4, "id"), ": ");
57425
+ parts.push(path2.call(print5, "id"), ": ");
57529
57426
  }
57530
- parts.push(path2.call(print4, "key"), "]: ", path2.call(print4, "value"));
57427
+ parts.push(path2.call(print5, "key"), "]: ", path2.call(print5, "value"));
57531
57428
  return (0, lines_1.concat)(parts);
57532
57429
  case "ObjectTypeProperty":
57533
57430
  return (0, lines_1.concat)([
57534
- printVariance(path2, print4),
57535
- path2.call(print4, "key"),
57431
+ printVariance(path2, print5),
57432
+ path2.call(print5, "key"),
57536
57433
  n.optional ? "?" : "",
57537
57434
  ": ",
57538
- path2.call(print4, "value")
57435
+ path2.call(print5, "value")
57539
57436
  ]);
57540
57437
  case "ObjectTypeInternalSlot":
57541
57438
  return (0, lines_1.concat)([
57542
57439
  n.static ? "static " : "",
57543
57440
  "[[",
57544
- path2.call(print4, "id"),
57441
+ path2.call(print5, "id"),
57545
57442
  "]]",
57546
57443
  n.optional ? "?" : "",
57547
57444
  n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
57548
- path2.call(print4, "value")
57445
+ path2.call(print5, "value")
57549
57446
  ]);
57550
57447
  case "QualifiedTypeIdentifier":
57551
57448
  return (0, lines_1.concat)([
57552
- path2.call(print4, "qualification"),
57449
+ path2.call(print5, "qualification"),
57553
57450
  ".",
57554
- path2.call(print4, "id")
57451
+ path2.call(print5, "id")
57555
57452
  ]);
57556
57453
  case "StringLiteralTypeAnnotation":
57557
57454
  return (0, lines_1.fromString)(nodeStr(n.value, options), options);
@@ -57568,36 +57465,36 @@ var require_printer2 = __commonJS({
57568
57465
  case "TypeAlias":
57569
57466
  return (0, lines_1.concat)([
57570
57467
  "type ",
57571
- path2.call(print4, "id"),
57572
- path2.call(print4, "typeParameters"),
57468
+ path2.call(print5, "id"),
57469
+ path2.call(print5, "typeParameters"),
57573
57470
  " = ",
57574
- path2.call(print4, "right"),
57471
+ path2.call(print5, "right"),
57575
57472
  ";"
57576
57473
  ]);
57577
57474
  case "DeclareOpaqueType":
57578
57475
  parts.push("declare ");
57579
57476
  case "OpaqueType":
57580
- parts.push("opaque type ", path2.call(print4, "id"), path2.call(print4, "typeParameters"));
57477
+ parts.push("opaque type ", path2.call(print5, "id"), path2.call(print5, "typeParameters"));
57581
57478
  if (n["supertype"]) {
57582
- parts.push(": ", path2.call(print4, "supertype"));
57479
+ parts.push(": ", path2.call(print5, "supertype"));
57583
57480
  }
57584
57481
  if (n["impltype"]) {
57585
- parts.push(" = ", path2.call(print4, "impltype"));
57482
+ parts.push(" = ", path2.call(print5, "impltype"));
57586
57483
  }
57587
57484
  parts.push(";");
57588
57485
  return (0, lines_1.concat)(parts);
57589
57486
  case "TypeCastExpression":
57590
57487
  return (0, lines_1.concat)([
57591
57488
  "(",
57592
- path2.call(print4, "expression"),
57593
- path2.call(print4, "typeAnnotation"),
57489
+ path2.call(print5, "expression"),
57490
+ path2.call(print5, "typeAnnotation"),
57594
57491
  ")"
57595
57492
  ]);
57596
57493
  case "TypeParameterDeclaration":
57597
57494
  case "TypeParameterInstantiation":
57598
57495
  return (0, lines_1.concat)([
57599
57496
  "<",
57600
- (0, lines_1.fromString)(", ").join(path2.map(print4, "params")),
57497
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "params")),
57601
57498
  ">"
57602
57499
  ]);
57603
57500
  case "Variance":
@@ -57610,32 +57507,32 @@ var require_printer2 = __commonJS({
57610
57507
  return (0, lines_1.fromString)("");
57611
57508
  case "TypeParameter":
57612
57509
  if (n.variance) {
57613
- parts.push(printVariance(path2, print4));
57510
+ parts.push(printVariance(path2, print5));
57614
57511
  }
57615
- parts.push(path2.call(print4, "name"));
57512
+ parts.push(path2.call(print5, "name"));
57616
57513
  if (n.bound) {
57617
- parts.push(path2.call(print4, "bound"));
57514
+ parts.push(path2.call(print5, "bound"));
57618
57515
  }
57619
57516
  if (n["default"]) {
57620
- parts.push("=", path2.call(print4, "default"));
57517
+ parts.push("=", path2.call(print5, "default"));
57621
57518
  }
57622
57519
  return (0, lines_1.concat)(parts);
57623
57520
  case "TypeofTypeAnnotation":
57624
57521
  return (0, lines_1.concat)([
57625
57522
  (0, lines_1.fromString)("typeof ", options),
57626
- path2.call(print4, "argument")
57523
+ path2.call(print5, "argument")
57627
57524
  ]);
57628
57525
  case "IndexedAccessType":
57629
57526
  case "OptionalIndexedAccessType":
57630
57527
  return (0, lines_1.concat)([
57631
- path2.call(print4, "objectType"),
57528
+ path2.call(print5, "objectType"),
57632
57529
  n.optional ? "?." : "",
57633
57530
  "[",
57634
- path2.call(print4, "indexType"),
57531
+ path2.call(print5, "indexType"),
57635
57532
  "]"
57636
57533
  ]);
57637
57534
  case "UnionTypeAnnotation":
57638
- return (0, lines_1.fromString)(" | ").join(path2.map(print4, "types"));
57535
+ return (0, lines_1.fromString)(" | ").join(path2.map(print5, "types"));
57639
57536
  case "VoidTypeAnnotation":
57640
57537
  return (0, lines_1.fromString)("void", options);
57641
57538
  case "NullTypeAnnotation":
@@ -57675,77 +57572,77 @@ var require_printer2 = __commonJS({
57675
57572
  case "TSNeverKeyword":
57676
57573
  return (0, lines_1.fromString)("never", options);
57677
57574
  case "TSArrayType":
57678
- return (0, lines_1.concat)([path2.call(print4, "elementType"), "[]"]);
57575
+ return (0, lines_1.concat)([path2.call(print5, "elementType"), "[]"]);
57679
57576
  case "TSLiteralType":
57680
- return path2.call(print4, "literal");
57577
+ return path2.call(print5, "literal");
57681
57578
  case "TSUnionType":
57682
- return (0, lines_1.fromString)(" | ").join(path2.map(print4, "types"));
57579
+ return (0, lines_1.fromString)(" | ").join(path2.map(print5, "types"));
57683
57580
  case "TSIntersectionType":
57684
- return (0, lines_1.fromString)(" & ").join(path2.map(print4, "types"));
57581
+ return (0, lines_1.fromString)(" & ").join(path2.map(print5, "types"));
57685
57582
  case "TSConditionalType":
57686
- parts.push(path2.call(print4, "checkType"), " extends ", path2.call(print4, "extendsType"), " ? ", path2.call(print4, "trueType"), " : ", path2.call(print4, "falseType"));
57583
+ parts.push(path2.call(print5, "checkType"), " extends ", path2.call(print5, "extendsType"), " ? ", path2.call(print5, "trueType"), " : ", path2.call(print5, "falseType"));
57687
57584
  return (0, lines_1.concat)(parts);
57688
57585
  case "TSInferType":
57689
- parts.push("infer ", path2.call(print4, "typeParameter"));
57586
+ parts.push("infer ", path2.call(print5, "typeParameter"));
57690
57587
  return (0, lines_1.concat)(parts);
57691
57588
  case "TSParenthesizedType":
57692
- return (0, lines_1.concat)(["(", path2.call(print4, "typeAnnotation"), ")"]);
57589
+ return (0, lines_1.concat)(["(", path2.call(print5, "typeAnnotation"), ")"]);
57693
57590
  case "TSFunctionType":
57694
57591
  return (0, lines_1.concat)([
57695
- path2.call(print4, "typeParameters"),
57592
+ path2.call(print5, "typeParameters"),
57696
57593
  "(",
57697
- printFunctionParams(path2, options, print4),
57594
+ printFunctionParams(path2, options, print5),
57698
57595
  ") => ",
57699
- path2.call(print4, "typeAnnotation", "typeAnnotation")
57596
+ path2.call(print5, "typeAnnotation", "typeAnnotation")
57700
57597
  ]);
57701
57598
  case "TSConstructorType":
57702
57599
  return (0, lines_1.concat)([
57703
57600
  "new ",
57704
- path2.call(print4, "typeParameters"),
57601
+ path2.call(print5, "typeParameters"),
57705
57602
  "(",
57706
- printFunctionParams(path2, options, print4),
57603
+ printFunctionParams(path2, options, print5),
57707
57604
  ") => ",
57708
- path2.call(print4, "typeAnnotation", "typeAnnotation")
57605
+ path2.call(print5, "typeAnnotation", "typeAnnotation")
57709
57606
  ]);
57710
57607
  case "TSMappedType": {
57711
- parts.push(n.readonly ? "readonly " : "", "[", path2.call(print4, "typeParameter"), "]", n.optional ? "?" : "");
57608
+ parts.push(n.readonly ? "readonly " : "", "[", path2.call(print5, "typeParameter"), "]", n.optional ? "?" : "");
57712
57609
  if (n.typeAnnotation) {
57713
- parts.push(": ", path2.call(print4, "typeAnnotation"), ";");
57610
+ parts.push(": ", path2.call(print5, "typeAnnotation"), ";");
57714
57611
  }
57715
57612
  return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
57716
57613
  }
57717
57614
  case "TSTupleType":
57718
57615
  return (0, lines_1.concat)([
57719
57616
  "[",
57720
- (0, lines_1.fromString)(", ").join(path2.map(print4, "elementTypes")),
57617
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "elementTypes")),
57721
57618
  "]"
57722
57619
  ]);
57723
57620
  case "TSNamedTupleMember":
57724
- parts.push(path2.call(print4, "label"));
57621
+ parts.push(path2.call(print5, "label"));
57725
57622
  if (n.optional) {
57726
57623
  parts.push("?");
57727
57624
  }
57728
- parts.push(": ", path2.call(print4, "elementType"));
57625
+ parts.push(": ", path2.call(print5, "elementType"));
57729
57626
  return (0, lines_1.concat)(parts);
57730
57627
  case "TSRestType":
57731
- return (0, lines_1.concat)(["...", path2.call(print4, "typeAnnotation")]);
57628
+ return (0, lines_1.concat)(["...", path2.call(print5, "typeAnnotation")]);
57732
57629
  case "TSOptionalType":
57733
- return (0, lines_1.concat)([path2.call(print4, "typeAnnotation"), "?"]);
57630
+ return (0, lines_1.concat)([path2.call(print5, "typeAnnotation"), "?"]);
57734
57631
  case "TSIndexedAccessType":
57735
57632
  return (0, lines_1.concat)([
57736
- path2.call(print4, "objectType"),
57633
+ path2.call(print5, "objectType"),
57737
57634
  "[",
57738
- path2.call(print4, "indexType"),
57635
+ path2.call(print5, "indexType"),
57739
57636
  "]"
57740
57637
  ]);
57741
57638
  case "TSTypeOperator":
57742
57639
  return (0, lines_1.concat)([
57743
- path2.call(print4, "operator"),
57640
+ path2.call(print5, "operator"),
57744
57641
  " ",
57745
- path2.call(print4, "typeAnnotation")
57642
+ path2.call(print5, "typeAnnotation")
57746
57643
  ]);
57747
57644
  case "TSTypeLiteral": {
57748
- var members = (0, lines_1.fromString)("\n").join(path2.map(print4, "members").map(function(member) {
57645
+ var members = (0, lines_1.fromString)("\n").join(path2.map(print5, "members").map(function(member) {
57749
57646
  if (lastNonSpaceCharacter(member) !== ";") {
57750
57647
  return member.concat(";");
57751
57648
  }
@@ -57758,13 +57655,13 @@ var require_printer2 = __commonJS({
57758
57655
  return (0, lines_1.concat)(parts);
57759
57656
  }
57760
57657
  case "TSEnumMember":
57761
- parts.push(path2.call(print4, "id"));
57658
+ parts.push(path2.call(print5, "id"));
57762
57659
  if (n.initializer) {
57763
- parts.push(" = ", path2.call(print4, "initializer"));
57660
+ parts.push(" = ", path2.call(print5, "initializer"));
57764
57661
  }
57765
57662
  return (0, lines_1.concat)(parts);
57766
57663
  case "TSTypeQuery":
57767
- return (0, lines_1.concat)(["typeof ", path2.call(print4, "exprName")]);
57664
+ return (0, lines_1.concat)(["typeof ", path2.call(print5, "exprName")]);
57768
57665
  case "TSParameterProperty":
57769
57666
  if (n.accessibility) {
57770
57667
  parts.push(n.accessibility, " ");
@@ -57778,119 +57675,119 @@ var require_printer2 = __commonJS({
57778
57675
  if (n.readonly) {
57779
57676
  parts.push("readonly ");
57780
57677
  }
57781
- parts.push(path2.call(print4, "parameter"));
57678
+ parts.push(path2.call(print5, "parameter"));
57782
57679
  return (0, lines_1.concat)(parts);
57783
57680
  case "TSTypeReference":
57784
57681
  return (0, lines_1.concat)([
57785
- path2.call(print4, "typeName"),
57786
- path2.call(print4, "typeParameters")
57682
+ path2.call(print5, "typeName"),
57683
+ path2.call(print5, "typeParameters")
57787
57684
  ]);
57788
57685
  case "TSQualifiedName":
57789
- return (0, lines_1.concat)([path2.call(print4, "left"), ".", path2.call(print4, "right")]);
57686
+ return (0, lines_1.concat)([path2.call(print5, "left"), ".", path2.call(print5, "right")]);
57790
57687
  case "TSAsExpression":
57791
57688
  case "TSSatisfiesExpression": {
57792
- var expression = path2.call(print4, "expression");
57793
- parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print4, "typeAnnotation"));
57689
+ var expression = path2.call(print5, "expression");
57690
+ parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print5, "typeAnnotation"));
57794
57691
  return (0, lines_1.concat)(parts);
57795
57692
  }
57796
57693
  case "TSTypeCastExpression":
57797
57694
  return (0, lines_1.concat)([
57798
- path2.call(print4, "expression"),
57799
- path2.call(print4, "typeAnnotation")
57695
+ path2.call(print5, "expression"),
57696
+ path2.call(print5, "typeAnnotation")
57800
57697
  ]);
57801
57698
  case "TSNonNullExpression":
57802
- return (0, lines_1.concat)([path2.call(print4, "expression"), "!"]);
57699
+ return (0, lines_1.concat)([path2.call(print5, "expression"), "!"]);
57803
57700
  case "TSTypeAnnotation":
57804
- return (0, lines_1.concat)([": ", path2.call(print4, "typeAnnotation")]);
57701
+ return (0, lines_1.concat)([": ", path2.call(print5, "typeAnnotation")]);
57805
57702
  case "TSIndexSignature":
57806
57703
  return (0, lines_1.concat)([
57807
57704
  n.readonly ? "readonly " : "",
57808
57705
  "[",
57809
- path2.map(print4, "parameters"),
57706
+ path2.map(print5, "parameters"),
57810
57707
  "]",
57811
- path2.call(print4, "typeAnnotation")
57708
+ path2.call(print5, "typeAnnotation")
57812
57709
  ]);
57813
57710
  case "TSPropertySignature":
57814
- parts.push(printVariance(path2, print4), n.readonly ? "readonly " : "");
57711
+ parts.push(printVariance(path2, print5), n.readonly ? "readonly " : "");
57815
57712
  if (n.computed) {
57816
- parts.push("[", path2.call(print4, "key"), "]");
57713
+ parts.push("[", path2.call(print5, "key"), "]");
57817
57714
  } else {
57818
- parts.push(path2.call(print4, "key"));
57715
+ parts.push(path2.call(print5, "key"));
57819
57716
  }
57820
- parts.push(n.optional ? "?" : "", path2.call(print4, "typeAnnotation"));
57717
+ parts.push(n.optional ? "?" : "", path2.call(print5, "typeAnnotation"));
57821
57718
  return (0, lines_1.concat)(parts);
57822
57719
  case "TSMethodSignature":
57823
57720
  if (n.computed) {
57824
- parts.push("[", path2.call(print4, "key"), "]");
57721
+ parts.push("[", path2.call(print5, "key"), "]");
57825
57722
  } else {
57826
- parts.push(path2.call(print4, "key"));
57723
+ parts.push(path2.call(print5, "key"));
57827
57724
  }
57828
57725
  if (n.optional) {
57829
57726
  parts.push("?");
57830
57727
  }
57831
- parts.push(path2.call(print4, "typeParameters"), "(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "typeAnnotation"));
57728
+ parts.push(path2.call(print5, "typeParameters"), "(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "typeAnnotation"));
57832
57729
  return (0, lines_1.concat)(parts);
57833
57730
  case "TSTypePredicate":
57834
57731
  if (n.asserts) {
57835
57732
  parts.push("asserts ");
57836
57733
  }
57837
- parts.push(path2.call(print4, "parameterName"));
57734
+ parts.push(path2.call(print5, "parameterName"));
57838
57735
  if (n.typeAnnotation) {
57839
- parts.push(" is ", path2.call(print4, "typeAnnotation", "typeAnnotation"));
57736
+ parts.push(" is ", path2.call(print5, "typeAnnotation", "typeAnnotation"));
57840
57737
  }
57841
57738
  return (0, lines_1.concat)(parts);
57842
57739
  case "TSCallSignatureDeclaration":
57843
57740
  return (0, lines_1.concat)([
57844
- path2.call(print4, "typeParameters"),
57741
+ path2.call(print5, "typeParameters"),
57845
57742
  "(",
57846
- printFunctionParams(path2, options, print4),
57743
+ printFunctionParams(path2, options, print5),
57847
57744
  ")",
57848
- path2.call(print4, "typeAnnotation")
57745
+ path2.call(print5, "typeAnnotation")
57849
57746
  ]);
57850
57747
  case "TSConstructSignatureDeclaration":
57851
57748
  if (n.typeParameters) {
57852
- parts.push("new", path2.call(print4, "typeParameters"));
57749
+ parts.push("new", path2.call(print5, "typeParameters"));
57853
57750
  } else {
57854
57751
  parts.push("new ");
57855
57752
  }
57856
- parts.push("(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "typeAnnotation"));
57753
+ parts.push("(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "typeAnnotation"));
57857
57754
  return (0, lines_1.concat)(parts);
57858
57755
  case "TSTypeAliasDeclaration":
57859
57756
  return (0, lines_1.concat)([
57860
57757
  n.declare ? "declare " : "",
57861
57758
  "type ",
57862
- path2.call(print4, "id"),
57863
- path2.call(print4, "typeParameters"),
57759
+ path2.call(print5, "id"),
57760
+ path2.call(print5, "typeParameters"),
57864
57761
  " = ",
57865
- path2.call(print4, "typeAnnotation"),
57762
+ path2.call(print5, "typeAnnotation"),
57866
57763
  ";"
57867
57764
  ]);
57868
57765
  case "TSTypeParameter": {
57869
- parts.push(path2.call(print4, "name"));
57766
+ parts.push(path2.call(print5, "name"));
57870
57767
  var parent = path2.getParentNode(0);
57871
57768
  var isInMappedType = namedTypes.TSMappedType.check(parent);
57872
57769
  if (n.constraint) {
57873
- parts.push(isInMappedType ? " in " : " extends ", path2.call(print4, "constraint"));
57770
+ parts.push(isInMappedType ? " in " : " extends ", path2.call(print5, "constraint"));
57874
57771
  }
57875
57772
  if (n["default"]) {
57876
- parts.push(" = ", path2.call(print4, "default"));
57773
+ parts.push(" = ", path2.call(print5, "default"));
57877
57774
  }
57878
57775
  return (0, lines_1.concat)(parts);
57879
57776
  }
57880
57777
  case "TSTypeAssertion": {
57881
- parts.push("<", path2.call(print4, "typeAnnotation"), "> ", path2.call(print4, "expression"));
57778
+ parts.push("<", path2.call(print5, "typeAnnotation"), "> ", path2.call(print5, "expression"));
57882
57779
  return (0, lines_1.concat)(parts);
57883
57780
  }
57884
57781
  case "TSTypeParameterDeclaration":
57885
57782
  case "TSTypeParameterInstantiation":
57886
57783
  return (0, lines_1.concat)([
57887
57784
  "<",
57888
- (0, lines_1.fromString)(", ").join(path2.map(print4, "params")),
57785
+ (0, lines_1.fromString)(", ").join(path2.map(print5, "params")),
57889
57786
  ">"
57890
57787
  ]);
57891
57788
  case "TSEnumDeclaration": {
57892
- parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print4, "id"));
57893
- var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print4, "members"));
57789
+ parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print5, "id"));
57790
+ var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print5, "members"));
57894
57791
  if (memberLines.isEmpty()) {
57895
57792
  parts.push(" {}");
57896
57793
  } else {
@@ -57900,11 +57797,11 @@ var require_printer2 = __commonJS({
57900
57797
  }
57901
57798
  case "TSExpressionWithTypeArguments":
57902
57799
  return (0, lines_1.concat)([
57903
- path2.call(print4, "expression"),
57904
- path2.call(print4, "typeParameters")
57800
+ path2.call(print5, "expression"),
57801
+ path2.call(print5, "typeParameters")
57905
57802
  ]);
57906
57803
  case "TSInterfaceBody": {
57907
- var lines = (0, lines_1.fromString)("\n").join(path2.map(print4, "body").map(function(element) {
57804
+ var lines = (0, lines_1.fromString)("\n").join(path2.map(print5, "body").map(function(element) {
57908
57805
  if (lastNonSpaceCharacter(element) !== ";") {
57909
57806
  return element.concat(";");
57910
57807
  }
@@ -57916,22 +57813,22 @@ var require_printer2 = __commonJS({
57916
57813
  return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
57917
57814
  }
57918
57815
  case "TSImportType":
57919
- parts.push("import(", path2.call(print4, "argument"), ")");
57816
+ parts.push("import(", path2.call(print5, "argument"), ")");
57920
57817
  if (n.qualifier) {
57921
- parts.push(".", path2.call(print4, "qualifier"));
57818
+ parts.push(".", path2.call(print5, "qualifier"));
57922
57819
  }
57923
57820
  if (n.typeParameters) {
57924
- parts.push(path2.call(print4, "typeParameters"));
57821
+ parts.push(path2.call(print5, "typeParameters"));
57925
57822
  }
57926
57823
  return (0, lines_1.concat)(parts);
57927
57824
  case "TSImportEqualsDeclaration":
57928
57825
  if (n.isExport) {
57929
57826
  parts.push("export ");
57930
57827
  }
57931
- parts.push("import ", path2.call(print4, "id"), " = ", path2.call(print4, "moduleReference"));
57828
+ parts.push("import ", path2.call(print5, "id"), " = ", path2.call(print5, "moduleReference"));
57932
57829
  return maybeAddSemicolon((0, lines_1.concat)(parts));
57933
57830
  case "TSExternalModuleReference":
57934
- return (0, lines_1.concat)(["require(", path2.call(print4, "expression"), ")"]);
57831
+ return (0, lines_1.concat)(["require(", path2.call(print5, "expression"), ")"]);
57935
57832
  case "TSModuleDeclaration": {
57936
57833
  var parent = path2.getParentNode();
57937
57834
  if (parent.type === "TSModuleDeclaration") {
@@ -57956,16 +57853,16 @@ var require_printer2 = __commonJS({
57956
57853
  }
57957
57854
  }
57958
57855
  }
57959
- parts.push(path2.call(print4, "id"));
57856
+ parts.push(path2.call(print5, "id"));
57960
57857
  if (n.body) {
57961
57858
  parts.push(" ");
57962
- parts.push(path2.call(print4, "body"));
57859
+ parts.push(path2.call(print5, "body"));
57963
57860
  }
57964
57861
  return (0, lines_1.concat)(parts);
57965
57862
  }
57966
57863
  case "TSModuleBlock": {
57967
57864
  var naked = path2.call(function(bodyPath) {
57968
- return printStatementSequence(bodyPath, options, print4);
57865
+ return printStatementSequence(bodyPath, options, print5);
57969
57866
  }, "body");
57970
57867
  if (naked.isEmpty()) {
57971
57868
  parts.push("{}");
@@ -57975,11 +57872,11 @@ var require_printer2 = __commonJS({
57975
57872
  return (0, lines_1.concat)(parts);
57976
57873
  }
57977
57874
  case "TSInstantiationExpression": {
57978
- parts.push(path2.call(print4, "expression"), path2.call(print4, "typeParameters"));
57875
+ parts.push(path2.call(print5, "expression"), path2.call(print5, "typeParameters"));
57979
57876
  return (0, lines_1.concat)(parts);
57980
57877
  }
57981
57878
  case "V8IntrinsicIdentifier":
57982
- return (0, lines_1.concat)(["%", path2.call(print4, "name")]);
57879
+ return (0, lines_1.concat)(["%", path2.call(print5, "name")]);
57983
57880
  case "TopicReference":
57984
57881
  return (0, lines_1.fromString)("#");
57985
57882
  case "ClassHeritage":
@@ -58029,7 +57926,7 @@ var require_printer2 = __commonJS({
58029
57926
  }
58030
57927
  return (0, lines_1.concat)(parts);
58031
57928
  }
58032
- function printStatementSequence(path2, options, print4) {
57929
+ function printStatementSequence(path2, options, print5) {
58033
57930
  var filtered = [];
58034
57931
  var sawComment = false;
58035
57932
  var sawStatement = false;
@@ -58050,7 +57947,7 @@ var require_printer2 = __commonJS({
58050
57947
  }
58051
57948
  filtered.push({
58052
57949
  node: stmt,
58053
- printed: print4(stmtPath)
57950
+ printed: print5(stmtPath)
58054
57951
  });
58055
57952
  });
58056
57953
  if (sawComment) {
@@ -58142,7 +58039,7 @@ var require_printer2 = __commonJS({
58142
58039
  }
58143
58040
  return parts;
58144
58041
  }
58145
- function printMethod(path2, options, print4) {
58042
+ function printMethod(path2, options, print5) {
58146
58043
  var node = path2.getNode();
58147
58044
  var kind = node.kind;
58148
58045
  var parts = [];
@@ -58160,7 +58057,7 @@ var require_printer2 = __commonJS({
58160
58057
  if (kind === "get" || kind === "set") {
58161
58058
  parts.push(kind, " ");
58162
58059
  }
58163
- var key = path2.call(print4, "key");
58060
+ var key = path2.call(print5, "key");
58164
58061
  if (node.computed) {
58165
58062
  key = (0, lines_1.concat)(["[", key, "]"]);
58166
58063
  }
@@ -58169,26 +58066,26 @@ var require_printer2 = __commonJS({
58169
58066
  parts.push("?");
58170
58067
  }
58171
58068
  if (node === nodeValue) {
58172
- parts.push(path2.call(print4, "typeParameters"), "(", printFunctionParams(path2, options, print4), ")", path2.call(print4, "returnType"));
58069
+ parts.push(path2.call(print5, "typeParameters"), "(", printFunctionParams(path2, options, print5), ")", path2.call(print5, "returnType"));
58173
58070
  if (node.body) {
58174
- parts.push(" ", path2.call(print4, "body"));
58071
+ parts.push(" ", path2.call(print5, "body"));
58175
58072
  } else {
58176
58073
  parts.push(";");
58177
58074
  }
58178
58075
  } else {
58179
- parts.push(path2.call(print4, "value", "typeParameters"), "(", path2.call(function(valuePath) {
58180
- return printFunctionParams(valuePath, options, print4);
58181
- }, "value"), ")", path2.call(print4, "value", "returnType"));
58076
+ parts.push(path2.call(print5, "value", "typeParameters"), "(", path2.call(function(valuePath) {
58077
+ return printFunctionParams(valuePath, options, print5);
58078
+ }, "value"), ")", path2.call(print5, "value", "returnType"));
58182
58079
  if (nodeValue.body) {
58183
- parts.push(" ", path2.call(print4, "value", "body"));
58080
+ parts.push(" ", path2.call(print5, "value", "body"));
58184
58081
  } else {
58185
58082
  parts.push(";");
58186
58083
  }
58187
58084
  }
58188
58085
  return (0, lines_1.concat)(parts);
58189
58086
  }
58190
- function printArgumentsList(path2, options, print4) {
58191
- var printed = path2.map(print4, "arguments");
58087
+ function printArgumentsList(path2, options, print5) {
58088
+ var printed = path2.map(print5, "arguments");
58192
58089
  var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
58193
58090
  var joined = (0, lines_1.fromString)(", ").join(printed);
58194
58091
  if (joined.getLineLength(1) > options.wrapColumn) {
@@ -58201,28 +58098,28 @@ var require_printer2 = __commonJS({
58201
58098
  }
58202
58099
  return (0, lines_1.concat)(["(", joined, ")"]);
58203
58100
  }
58204
- function printFunctionParams(path2, options, print4) {
58101
+ function printFunctionParams(path2, options, print5) {
58205
58102
  var fun = path2.getValue();
58206
58103
  var params;
58207
58104
  var printed = [];
58208
58105
  if (fun.params) {
58209
58106
  params = fun.params;
58210
- printed = path2.map(print4, "params");
58107
+ printed = path2.map(print5, "params");
58211
58108
  } else if (fun.parameters) {
58212
58109
  params = fun.parameters;
58213
- printed = path2.map(print4, "parameters");
58110
+ printed = path2.map(print5, "parameters");
58214
58111
  }
58215
58112
  if (fun.defaults) {
58216
58113
  path2.each(function(defExprPath) {
58217
58114
  var i2 = defExprPath.getName();
58218
58115
  var p = printed[i2];
58219
58116
  if (p && defExprPath.getValue()) {
58220
- printed[i2] = (0, lines_1.concat)([p, " = ", print4(defExprPath)]);
58117
+ printed[i2] = (0, lines_1.concat)([p, " = ", print5(defExprPath)]);
58221
58118
  }
58222
58119
  }, "defaults");
58223
58120
  }
58224
58121
  if (fun.rest) {
58225
- printed.push((0, lines_1.concat)(["...", path2.call(print4, "rest")]));
58122
+ printed.push((0, lines_1.concat)(["...", path2.call(print5, "rest")]));
58226
58123
  }
58227
58124
  var joined = (0, lines_1.fromString)(", ").join(printed);
58228
58125
  if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
@@ -58236,11 +58133,11 @@ var require_printer2 = __commonJS({
58236
58133
  }
58237
58134
  return joined;
58238
58135
  }
58239
- function maybePrintImportAssertions(path2, options, print4) {
58136
+ function maybePrintImportAssertions(path2, options, print5) {
58240
58137
  var n = path2.getValue();
58241
58138
  if (n.assertions && n.assertions.length > 0) {
58242
58139
  var parts = [" assert {"];
58243
- var printed = path2.map(print4, "assertions");
58140
+ var printed = path2.map(print5, "assertions");
58244
58141
  var flat = (0, lines_1.fromString)(", ").join(printed);
58245
58142
  if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
58246
58143
  parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
@@ -58251,7 +58148,7 @@ var require_printer2 = __commonJS({
58251
58148
  }
58252
58149
  return (0, lines_1.fromString)("");
58253
58150
  }
58254
- function printExportDeclaration(path2, options, print4) {
58151
+ function printExportDeclaration(path2, options, print5) {
58255
58152
  var decl = path2.getValue();
58256
58153
  var parts = ["export "];
58257
58154
  if (decl.exportKind && decl.exportKind === "type") {
@@ -58265,7 +58162,7 @@ var require_printer2 = __commonJS({
58265
58162
  parts.push("default ");
58266
58163
  }
58267
58164
  if (decl.declaration) {
58268
- parts.push(path2.call(print4, "declaration"));
58165
+ parts.push(path2.call(print5, "declaration"));
58269
58166
  } else if (decl.specifiers) {
58270
58167
  if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
58271
58168
  parts.push("*");
@@ -58277,9 +58174,9 @@ var require_printer2 = __commonJS({
58277
58174
  path2.each(function(specifierPath) {
58278
58175
  var spec = specifierPath.getValue();
58279
58176
  if (spec.type === "ExportDefaultSpecifier") {
58280
- unbracedSpecifiers_2.push(print4(specifierPath));
58177
+ unbracedSpecifiers_2.push(print5(specifierPath));
58281
58178
  } else {
58282
- bracedSpecifiers_2.push(print4(specifierPath));
58179
+ bracedSpecifiers_2.push(print5(specifierPath));
58283
58180
  }
58284
58181
  }, "specifiers");
58285
58182
  unbracedSpecifiers_2.forEach(function(lines2, i2) {
@@ -58308,10 +58205,10 @@ var require_printer2 = __commonJS({
58308
58205
  }
58309
58206
  }
58310
58207
  } else {
58311
- parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print4, "specifiers")), shouldPrintSpaces ? " }" : "}");
58208
+ parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print5, "specifiers")), shouldPrintSpaces ? " }" : "}");
58312
58209
  }
58313
58210
  if (decl.source) {
58314
- parts.push(" from ", path2.call(print4, "source"), maybePrintImportAssertions(path2, options, print4));
58211
+ parts.push(" from ", path2.call(print5, "source"), maybePrintImportAssertions(path2, options, print5));
58315
58212
  }
58316
58213
  }
58317
58214
  var lines = (0, lines_1.concat)(parts);
@@ -58329,7 +58226,7 @@ var require_printer2 = __commonJS({
58329
58226
  }
58330
58227
  return (0, lines_1.concat)(parts);
58331
58228
  }
58332
- function printVariance(path2, print4) {
58229
+ function printVariance(path2, print5) {
58333
58230
  return path2.call(function(variancePath) {
58334
58231
  var value = variancePath.getValue();
58335
58232
  if (value) {
@@ -58339,7 +58236,7 @@ var require_printer2 = __commonJS({
58339
58236
  if (value === "minus") {
58340
58237
  return (0, lines_1.fromString)("-");
58341
58238
  }
58342
- return print4(variancePath);
58239
+ return print5(variancePath);
58343
58240
  }
58344
58241
  return (0, lines_1.fromString)("");
58345
58242
  }, "variance");
@@ -58426,14 +58323,14 @@ var require_main2 = __commonJS({
58426
58323
  Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
58427
58324
  return ast_types_1.visit;
58428
58325
  } });
58429
- function print4(node, options) {
58326
+ function print5(node, options) {
58430
58327
  return new printer_1.Printer(options).print(node);
58431
58328
  }
58432
- exports.print = print4;
58433
- function prettyPrint(node, options) {
58329
+ exports.print = print5;
58330
+ function prettyPrint2(node, options) {
58434
58331
  return new printer_1.Printer(options).printGenerically(node);
58435
58332
  }
58436
- exports.prettyPrint = prettyPrint;
58333
+ exports.prettyPrint = prettyPrint2;
58437
58334
  function run(transformer, options) {
58438
58335
  return runFile(process.argv[2], transformer, options);
58439
58336
  }
@@ -58453,12 +58350,115 @@ var require_main2 = __commonJS({
58453
58350
  function runString(code, transformer, options) {
58454
58351
  var writeback = options && options.writeback || defaultWriteback;
58455
58352
  transformer((0, parser_1.parse)(code, options), function(node) {
58456
- writeback(print4(node, options).code);
58353
+ writeback(print5(node, options).code);
58457
58354
  });
58458
58355
  }
58459
58356
  }
58460
58357
  });
58461
58358
 
58359
+ // ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
58360
+ var require_cjs = __commonJS({
58361
+ "../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
58362
+ "use strict";
58363
+ var isMergeableObject = function isMergeableObject2(value) {
58364
+ return isNonNullObject(value) && !isSpecial(value);
58365
+ };
58366
+ function isNonNullObject(value) {
58367
+ return !!value && typeof value === "object";
58368
+ }
58369
+ function isSpecial(value) {
58370
+ var stringValue = Object.prototype.toString.call(value);
58371
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
58372
+ }
58373
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
58374
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
58375
+ function isReactElement(value) {
58376
+ return value.$$typeof === REACT_ELEMENT_TYPE;
58377
+ }
58378
+ function emptyTarget(val) {
58379
+ return Array.isArray(val) ? [] : {};
58380
+ }
58381
+ function cloneUnlessOtherwiseSpecified(value, options) {
58382
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
58383
+ }
58384
+ function defaultArrayMerge(target, source, options) {
58385
+ return target.concat(source).map(function(element) {
58386
+ return cloneUnlessOtherwiseSpecified(element, options);
58387
+ });
58388
+ }
58389
+ function getMergeFunction(key, options) {
58390
+ if (!options.customMerge) {
58391
+ return deepmerge;
58392
+ }
58393
+ var customMerge = options.customMerge(key);
58394
+ return typeof customMerge === "function" ? customMerge : deepmerge;
58395
+ }
58396
+ function getEnumerableOwnPropertySymbols(target) {
58397
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
58398
+ return target.propertyIsEnumerable(symbol);
58399
+ }) : [];
58400
+ }
58401
+ function getKeys(target) {
58402
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
58403
+ }
58404
+ function propertyIsOnObject(object, property) {
58405
+ try {
58406
+ return property in object;
58407
+ } catch (_) {
58408
+ return false;
58409
+ }
58410
+ }
58411
+ function propertyIsUnsafe(target, key) {
58412
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
58413
+ }
58414
+ function mergeObject(target, source, options) {
58415
+ var destination = {};
58416
+ if (options.isMergeableObject(target)) {
58417
+ getKeys(target).forEach(function(key) {
58418
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
58419
+ });
58420
+ }
58421
+ getKeys(source).forEach(function(key) {
58422
+ if (propertyIsUnsafe(target, key)) {
58423
+ return;
58424
+ }
58425
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
58426
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
58427
+ } else {
58428
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
58429
+ }
58430
+ });
58431
+ return destination;
58432
+ }
58433
+ function deepmerge(target, source, options) {
58434
+ options = options || {};
58435
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
58436
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
58437
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
58438
+ var sourceIsArray = Array.isArray(source);
58439
+ var targetIsArray = Array.isArray(target);
58440
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
58441
+ if (!sourceAndTargetTypesMatch) {
58442
+ return cloneUnlessOtherwiseSpecified(source, options);
58443
+ } else if (sourceIsArray) {
58444
+ return options.arrayMerge(target, source, options);
58445
+ } else {
58446
+ return mergeObject(target, source, options);
58447
+ }
58448
+ }
58449
+ deepmerge.all = function deepmergeAll(array, options) {
58450
+ if (!Array.isArray(array)) {
58451
+ throw new Error("first argument should be an array");
58452
+ }
58453
+ return array.reduce(function(prev, next) {
58454
+ return deepmerge(prev, next, options);
58455
+ }, {});
58456
+ };
58457
+ var deepmerge_1 = deepmerge;
58458
+ module.exports = deepmerge_1;
58459
+ }
58460
+ });
58461
+
58462
58462
  // src/lib/pipeline.ts
58463
58463
  async function runPipeline(config, pipeline2, target) {
58464
58464
  for (const transform of pipeline2) {
@@ -61619,7 +61619,8 @@ function defaultConfigValues(file) {
61619
61619
  };
61620
61620
  }
61621
61621
  function keyFieldsForType(configFile, type) {
61622
- return configFile.types?.[type]?.keys || configFile.defaultKeys;
61622
+ const withDefault = defaultConfigValues(configFile);
61623
+ return withDefault.types?.[type]?.keys || withDefault.defaultKeys;
61623
61624
  }
61624
61625
  function computeID(configFile, type, data) {
61625
61626
  const fields = keyFieldsForType(configFile, type);
@@ -61676,7 +61677,15 @@ function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
61676
61677
  }
61677
61678
 
61678
61679
  // src/runtime/lib/selection.ts
61679
- function getFieldsForType(selection, __typename) {
61680
+ function getFieldsForType(selection, __typename, loading) {
61681
+ if (loading) {
61682
+ if (selection.loadingTypes && selection.loadingTypes.length > 0) {
61683
+ return deepMerge(
61684
+ ...selection.loadingTypes.map((type) => selection.abstractFields?.fields[type])
61685
+ );
61686
+ }
61687
+ return selection.fields ?? {};
61688
+ }
61680
61689
  let targetSelection = selection.fields || {};
61681
61690
  if (selection.abstractFields && __typename) {
61682
61691
  const mappedType = selection.abstractFields.typeMap[__typename];
@@ -61688,6 +61697,25 @@ function getFieldsForType(selection, __typename) {
61688
61697
  }
61689
61698
  return targetSelection;
61690
61699
  }
61700
+ function deepMerge(...objects) {
61701
+ const mergedObj = {};
61702
+ for (let obj of objects) {
61703
+ if (!obj) {
61704
+ continue;
61705
+ }
61706
+ for (let prop in obj) {
61707
+ if (prop in obj) {
61708
+ const val = obj[prop];
61709
+ if (typeof val === "object" && val !== null && !Array.isArray(val)) {
61710
+ mergedObj[prop] = deepMerge(mergedObj[prop] || {}, val);
61711
+ } else {
61712
+ mergedObj[prop] = val;
61713
+ }
61714
+ }
61715
+ }
61716
+ }
61717
+ return mergedObj;
61718
+ }
61691
61719
 
61692
61720
  // src/runtime/lib/scalars.ts
61693
61721
  async function marshalSelection({
@@ -61701,7 +61729,7 @@ async function marshalSelection({
61701
61729
  if (Array.isArray(data)) {
61702
61730
  return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
61703
61731
  }
61704
- const targetSelection = getFieldsForType(selection, data["__typename"]);
61732
+ const targetSelection = getFieldsForType(selection, data["__typename"], false);
61705
61733
  return Object.fromEntries(
61706
61734
  await Promise.all(
61707
61735
  Object.entries(data).map(async ([fieldName, value]) => {
@@ -61801,6 +61829,7 @@ var DataSource = {
61801
61829
  Ssr: "ssr"
61802
61830
  };
61803
61831
  var fragmentKey = " $fragments";
61832
+ var PendingValue = Symbol("houdini_loading");
61804
61833
 
61805
61834
  // src/runtime/lib/store.ts
61806
61835
  var subscriber_queue = [];
@@ -63460,6 +63489,7 @@ var fetch2 = (target) => {
63460
63489
  }
63461
63490
  const fetch3 = ctx.fetch ?? globalThis.fetch;
63462
63491
  const fetchParams2 = {
63492
+ name: ctx.artifact.name,
63463
63493
  text: ctx.text,
63464
63494
  hash: ctx.hash,
63465
63495
  variables: marshalVariables2(ctx)
@@ -63500,10 +63530,10 @@ var defaultFetch = (url, params) => {
63500
63530
  "Could not find configured client url. Please specify one in your HoudiniClient constructor."
63501
63531
  );
63502
63532
  }
63503
- return async ({ fetch: fetch3, text, variables }) => {
63533
+ return async ({ fetch: fetch3, name, text, variables }) => {
63504
63534
  const result = await fetch3(url, {
63505
63535
  method: "POST",
63506
- body: JSON.stringify({ query: text, variables }),
63536
+ body: JSON.stringify({ operationName: name, query: text, variables }),
63507
63537
  ...params,
63508
63538
  headers: {
63509
63539
  Accept: "application/graphql+json, application/json",
@@ -64033,46 +64063,6 @@ var ListCollection = class {
64033
64063
  }
64034
64064
  };
64035
64065
 
64036
- // src/runtime/cache/schema.ts
64037
- var SchemaManager = class {
64038
- cache;
64039
- fieldTypes = {};
64040
- constructor(cache) {
64041
- this.cache = cache;
64042
- }
64043
- setFieldType({
64044
- parent,
64045
- key,
64046
- type,
64047
- nullable = false,
64048
- link
64049
- }) {
64050
- let parensIndex = key.indexOf("(");
64051
- if (parensIndex !== -1) {
64052
- key = key.substring(0, parensIndex);
64053
- }
64054
- if (parent === rootID) {
64055
- parent = "Query";
64056
- } else if (parent.includes(":")) {
64057
- parent = parent.substring(0, parent.indexOf(":"));
64058
- }
64059
- if (!this.fieldTypes[parent]) {
64060
- this.fieldTypes[parent] = {};
64061
- }
64062
- this.fieldTypes[parent][key] = {
64063
- type,
64064
- nullable,
64065
- link: !!link
64066
- };
64067
- }
64068
- fieldType(type, field) {
64069
- return this.fieldTypes[type]?.[field] || null;
64070
- }
64071
- get config() {
64072
- return this.cache._internal_unstable.config;
64073
- }
64074
- };
64075
-
64076
64066
  // src/runtime/cache/staleManager.ts
64077
64067
  var StaleManager = class {
64078
64068
  cache;
@@ -64505,7 +64495,7 @@ var OperationKind = {
64505
64495
  };
64506
64496
 
64507
64497
  // src/runtime/cache/stuff.ts
64508
- function evaluateKey(key, variables = {}) {
64498
+ function evaluateKey(key, variables = null) {
64509
64499
  let evaluated = "";
64510
64500
  let varName = "";
64511
64501
  let inString = false;
@@ -64515,7 +64505,7 @@ function evaluateKey(key, variables = {}) {
64515
64505
  varName += char;
64516
64506
  continue;
64517
64507
  }
64518
- const value = variables[varName.slice(1)];
64508
+ const value = variables?.[varName.slice(1)];
64519
64509
  evaluated += typeof value !== "undefined" ? JSON.stringify(value) : "undefined";
64520
64510
  varName = "";
64521
64511
  }
@@ -64549,7 +64539,7 @@ var InMemorySubscriptions = class {
64549
64539
  parentType
64550
64540
  }) {
64551
64541
  const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
64552
- let targetSelection = getFieldsForType(selection, __typename);
64542
+ let targetSelection = getFieldsForType(selection, __typename, false);
64553
64543
  for (const fieldSelection of Object.values(targetSelection || {})) {
64554
64544
  const {
64555
64545
  keyRaw,
@@ -64566,7 +64556,7 @@ var InMemorySubscriptions = class {
64566
64556
  let targetSelection2;
64567
64557
  if (innerSelection) {
64568
64558
  const __typename2 = this.cache._internal_unstable.storage.get(parent, "__typename").value;
64569
- targetSelection2 = getFieldsForType(innerSelection, __typename2);
64559
+ targetSelection2 = getFieldsForType(innerSelection, __typename2, false);
64570
64560
  }
64571
64561
  this.addFieldSubscription({
64572
64562
  id: parent,
@@ -64677,7 +64667,7 @@ var InMemorySubscriptions = class {
64677
64667
  filters
64678
64668
  } = selection;
64679
64669
  const key = evaluateKey(keyRaw, variables);
64680
- const fieldSelection = innerSelection ? getFieldsForType(innerSelection, parentType) : void 0;
64670
+ const fieldSelection = innerSelection ? getFieldsForType(innerSelection, parentType, false) : void 0;
64681
64671
  this.addFieldSubscription({
64682
64672
  id: parent,
64683
64673
  key,
@@ -64707,7 +64697,7 @@ var InMemorySubscriptions = class {
64707
64697
  linkedRecord,
64708
64698
  "__typename"
64709
64699
  ).value;
64710
- let targetSelection2 = getFieldsForType(childSelection, __typename);
64700
+ let targetSelection2 = getFieldsForType(childSelection, __typename, false);
64711
64701
  this.addMany({
64712
64702
  parent: linkedRecord,
64713
64703
  variables,
@@ -64726,7 +64716,7 @@ var InMemorySubscriptions = class {
64726
64716
  visited.push(id);
64727
64717
  const linkedIDs = [];
64728
64718
  const __typename = this.cache._internal_unstable.storage.get(id, "__typename").value;
64729
- let targetSelection = getFieldsForType(selection, __typename);
64719
+ let targetSelection = getFieldsForType(selection, __typename, false);
64730
64720
  for (const fieldSelection of Object.values(targetSelection || {})) {
64731
64721
  const key = evaluateKey(fieldSelection.keyRaw, variables);
64732
64722
  this.removeSubscribers(id, key, targets);
@@ -64796,7 +64786,6 @@ var Cache = class {
64796
64786
  lists: new ListManager(this, rootID),
64797
64787
  lifetimes: new GarbageCollector(this),
64798
64788
  staleManager: new StaleManager(this),
64799
- schema: new SchemaManager(this),
64800
64789
  disabled: disabled ?? typeof globalThis.window === "undefined"
64801
64790
  });
64802
64791
  if (Object.keys(config).length > 0) {
@@ -64907,7 +64896,6 @@ var CacheInternal = class {
64907
64896
  cache;
64908
64897
  lifetimes;
64909
64898
  staleManager;
64910
- schema;
64911
64899
  constructor({
64912
64900
  storage,
64913
64901
  subscriptions,
@@ -64915,7 +64903,6 @@ var CacheInternal = class {
64915
64903
  cache,
64916
64904
  lifetimes,
64917
64905
  staleManager,
64918
- schema,
64919
64906
  disabled,
64920
64907
  config
64921
64908
  }) {
@@ -64925,7 +64912,6 @@ var CacheInternal = class {
64925
64912
  this.cache = cache;
64926
64913
  this.lifetimes = lifetimes;
64927
64914
  this.staleManager = staleManager;
64928
- this.schema = schema;
64929
64915
  this._config = config;
64930
64916
  this._disabled = disabled;
64931
64917
  try {
@@ -64955,7 +64941,11 @@ var CacheInternal = class {
64955
64941
  if (this._disabled) {
64956
64942
  return [];
64957
64943
  }
64958
- let targetSelection = getFieldsForType(selection, data["__typename"]);
64944
+ let targetSelection = getFieldsForType(
64945
+ selection,
64946
+ data["__typename"],
64947
+ false
64948
+ );
64959
64949
  for (const [field, value] of Object.entries(data)) {
64960
64950
  if (!selection || !targetSelection[field]) {
64961
64951
  continue;
@@ -64966,17 +64956,9 @@ var CacheInternal = class {
64966
64956
  selection: fieldSelection,
64967
64957
  operations,
64968
64958
  abstract: isAbstract,
64969
- updates,
64970
- nullable
64959
+ updates
64971
64960
  } = targetSelection[field];
64972
64961
  const key = evaluateKey(keyRaw, variables);
64973
- this.schema.setFieldType({
64974
- parent,
64975
- key: keyRaw,
64976
- type: linkedType,
64977
- nullable,
64978
- link: !!fieldSelection
64979
- });
64980
64962
  if (value && typeof value === "object" && "__typename" in value && value["__typename"]) {
64981
64963
  linkedType = value["__typename"];
64982
64964
  }
@@ -65221,42 +65203,83 @@ var CacheInternal = class {
65221
65203
  parent = rootID,
65222
65204
  variables,
65223
65205
  stepsFromConnection = null,
65224
- ignoreMasking
65206
+ ignoreMasking,
65207
+ fullCheck = false,
65208
+ loading: generateLoading
65225
65209
  }) {
65226
65210
  if (parent === null) {
65227
65211
  return { data: null, partial: false, stale: false, hasData: true };
65228
65212
  }
65229
65213
  const target = {};
65230
65214
  if (selection.fragments) {
65231
- target[fragmentKey] = Object.fromEntries(
65232
- Object.entries(selection.fragments).map(([key, value]) => [
65233
- key,
65234
- {
65235
- parent,
65236
- variables: evaluateFragmentVariables(value, variables ?? {})
65237
- }
65238
- ])
65239
- );
65215
+ target[fragmentKey] = {
65216
+ loading: Boolean(generateLoading),
65217
+ values: Object.fromEntries(
65218
+ Object.entries(selection.fragments).filter(([, value]) => !generateLoading || value.loading).map(([key, value]) => [
65219
+ key,
65220
+ {
65221
+ parent,
65222
+ variables: evaluateFragmentVariables(
65223
+ value.arguments,
65224
+ variables ?? {}
65225
+ )
65226
+ }
65227
+ ])
65228
+ )
65229
+ };
65240
65230
  }
65241
65231
  let hasData = !!selection.fragments;
65242
65232
  let partial = false;
65243
65233
  let cascadeNull = false;
65244
65234
  let stale = false;
65245
65235
  const typename = this.storage.get(parent, "__typename").value;
65246
- let targetSelection = getFieldsForType(selection, typename);
65236
+ let targetSelection = getFieldsForType(selection, typename, !!generateLoading);
65247
65237
  for (const [
65248
65238
  attributeName,
65249
- { type, keyRaw, selection: fieldSelection, nullable, list, visible }
65239
+ {
65240
+ type,
65241
+ keyRaw,
65242
+ selection: fieldSelection,
65243
+ nullable,
65244
+ list,
65245
+ visible,
65246
+ directives,
65247
+ loading: fieldLoading,
65248
+ abstractHasRequired
65249
+ }
65250
65250
  ] of Object.entries(targetSelection)) {
65251
- if (!visible && !ignoreMasking) {
65251
+ if (!visible && !ignoreMasking && !fullCheck) {
65252
65252
  continue;
65253
65253
  }
65254
+ const includeDirective = directives?.find((d) => {
65255
+ return d.name === "include";
65256
+ });
65257
+ if (includeDirective) {
65258
+ if (!evaluateFragmentVariables(includeDirective.arguments, variables ?? {})["if"]) {
65259
+ continue;
65260
+ }
65261
+ }
65262
+ const skipDirective = directives?.find((d) => {
65263
+ return d.name === "skip";
65264
+ });
65265
+ if (skipDirective) {
65266
+ if (evaluateFragmentVariables(skipDirective.arguments, variables ?? {})["if"]) {
65267
+ continue;
65268
+ }
65269
+ }
65270
+ const fieldTarget = visible || ignoreMasking ? target : {};
65254
65271
  const key = evaluateKey(keyRaw, variables);
65255
- const { value } = this.storage.get(parent, key);
65272
+ if (generateLoading && !fieldLoading) {
65273
+ continue;
65274
+ }
65275
+ let { value } = this.storage.get(parent, key);
65256
65276
  const dt_field = this.staleManager.getFieldTime(parent, key);
65257
65277
  if (dt_field === null) {
65258
65278
  stale = true;
65259
65279
  }
65280
+ if (generateLoading) {
65281
+ value = void 0;
65282
+ }
65260
65283
  let nextStep = stepsFromConnection;
65261
65284
  if (nextStep !== null) {
65262
65285
  if (nextStep >= 2) {
@@ -65272,17 +65295,20 @@ var CacheInternal = class {
65272
65295
  if (typeof value === "undefined" && !embeddedCursor) {
65273
65296
  partial = true;
65274
65297
  }
65275
- if (typeof value === "undefined" || value === null) {
65276
- target[attributeName] = null;
65298
+ if (generateLoading && fieldLoading?.kind === "value") {
65299
+ fieldTarget[attributeName] = PendingValue;
65300
+ hasData = true;
65301
+ } else if (!generateLoading && typeof value === "undefined" || value === null) {
65302
+ fieldTarget[attributeName] = null;
65277
65303
  if (typeof value !== "undefined") {
65278
65304
  hasData = true;
65279
65305
  }
65280
65306
  } else if (!fieldSelection) {
65281
65307
  const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
65282
65308
  if (fnUnmarshal) {
65283
- target[attributeName] = fnUnmarshal(value);
65309
+ fieldTarget[attributeName] = fnUnmarshal(value);
65284
65310
  } else {
65285
- target[attributeName] = value;
65311
+ fieldTarget[attributeName] = value;
65286
65312
  }
65287
65313
  hasData = true;
65288
65314
  } else if (Array.isArray(value)) {
@@ -65291,9 +65317,11 @@ var CacheInternal = class {
65291
65317
  variables,
65292
65318
  linkedList: value,
65293
65319
  stepsFromConnection: nextStep,
65294
- ignoreMasking: !!ignoreMasking
65320
+ ignoreMasking: !!ignoreMasking,
65321
+ fullCheck,
65322
+ loading: generateLoading
65295
65323
  });
65296
- target[attributeName] = listValue.data;
65324
+ fieldTarget[attributeName] = listValue.data;
65297
65325
  if (listValue.partial) {
65298
65326
  partial = true;
65299
65327
  }
@@ -65309,9 +65337,11 @@ var CacheInternal = class {
65309
65337
  selection: fieldSelection,
65310
65338
  variables,
65311
65339
  stepsFromConnection: nextStep,
65312
- ignoreMasking
65340
+ ignoreMasking,
65341
+ fullCheck,
65342
+ loading: generateLoading
65313
65343
  });
65314
- target[attributeName] = objectFields.data;
65344
+ fieldTarget[attributeName] = objectFields.data;
65315
65345
  if (objectFields.partial) {
65316
65346
  partial = true;
65317
65347
  }
@@ -65322,13 +65352,27 @@ var CacheInternal = class {
65322
65352
  hasData = true;
65323
65353
  }
65324
65354
  }
65325
- if (target[attributeName] === null && !nullable && !embeddedCursor) {
65326
- cascadeNull = true;
65355
+ if (generateLoading && fieldLoading?.list) {
65356
+ fieldTarget[attributeName] = wrapInLists(
65357
+ Array.from({ length: fieldLoading.list.count }).fill(
65358
+ fieldTarget[attributeName]
65359
+ ),
65360
+ fieldLoading.list.depth - 1
65361
+ );
65362
+ }
65363
+ if (fieldTarget[attributeName] === null && !nullable && !embeddedCursor) {
65364
+ if (abstractHasRequired) {
65365
+ target[attributeName] = {
65366
+ __typename: "@required field missing; don't match this"
65367
+ };
65368
+ } else {
65369
+ cascadeNull = true;
65370
+ }
65327
65371
  }
65328
65372
  }
65329
65373
  return {
65330
65374
  data: cascadeNull ? null : target,
65331
- partial: hasData && partial,
65375
+ partial: !generateLoading && hasData && partial,
65332
65376
  stale: hasData && stale,
65333
65377
  hasData
65334
65378
  };
@@ -65354,7 +65398,9 @@ var CacheInternal = class {
65354
65398
  variables,
65355
65399
  linkedList,
65356
65400
  stepsFromConnection,
65357
- ignoreMasking
65401
+ ignoreMasking,
65402
+ fullCheck,
65403
+ loading
65358
65404
  }) {
65359
65405
  const result = [];
65360
65406
  let partialData = false;
@@ -65367,7 +65413,9 @@ var CacheInternal = class {
65367
65413
  variables,
65368
65414
  linkedList: entry,
65369
65415
  stepsFromConnection,
65370
- ignoreMasking
65416
+ ignoreMasking,
65417
+ fullCheck,
65418
+ loading
65371
65419
  });
65372
65420
  result.push(nestedValue.data);
65373
65421
  if (nestedValue.partial) {
@@ -65389,7 +65437,9 @@ var CacheInternal = class {
65389
65437
  selection: fields,
65390
65438
  variables,
65391
65439
  stepsFromConnection,
65392
- ignoreMasking
65440
+ ignoreMasking,
65441
+ fullCheck,
65442
+ loading
65393
65443
  });
65394
65444
  result.push(data);
65395
65445
  if (partial) {
@@ -65496,6 +65546,12 @@ function evaluateFragmentVariables(variables, args) {
65496
65546
  Object.entries(variables).map(([key, value]) => [key, fragmentVariableValue(value, args)])
65497
65547
  );
65498
65548
  }
65549
+ function wrapInLists(target, count = 0) {
65550
+ if (count === 0) {
65551
+ return target;
65552
+ }
65553
+ return wrapInLists([target], count - 1);
65554
+ }
65499
65555
  function fragmentVariableValue(value, args) {
65500
65556
  if (value.kind === "StringValue") {
65501
65557
  return value.value;
@@ -65553,7 +65609,7 @@ var cachePolicy = ({
65553
65609
  const value = localCache.read({
65554
65610
  selection: artifact.selection,
65555
65611
  variables: marshalVariables2(ctx),
65556
- parent: ctx.stuff?.parentID
65612
+ fullCheck: true
65557
65613
  });
65558
65614
  const allowed = !value.partial || artifact.kind === ArtifactKind.Query && artifact.partial;
65559
65615
  if (policy === CachePolicy.CacheOnly) {
@@ -65590,7 +65646,15 @@ var cachePolicy = ({
65590
65646
  }, 0);
65591
65647
  }
65592
65648
  if (!ctx.stuff?.silenceLoading) {
65593
- setFetching(!useCache);
65649
+ let fetchingState = null;
65650
+ if (!useCache && "enableLoadingState" in artifact && artifact.enableLoadingState) {
65651
+ fetchingState = localCache.read({
65652
+ selection: artifact.selection,
65653
+ variables: marshalVariables2(ctx),
65654
+ loading: true
65655
+ }).data;
65656
+ }
65657
+ setFetching(!useCache, fetchingState);
65594
65658
  }
65595
65659
  return next(ctx);
65596
65660
  },
@@ -65832,6 +65896,7 @@ function subscription(factory) {
65832
65896
  clearSubscription?.();
65833
65897
  clearSubscription = client.subscribe(
65834
65898
  {
65899
+ operationName: ctx.artifact.name,
65835
65900
  query: ctx.artifact.raw,
65836
65901
  variables: marshalVariables2(ctx)
65837
65902
  },
@@ -65971,7 +66036,15 @@ var DocumentStore = class extends Writable {
65971
66036
  this.#plugins = pipeline2 ?? [
65972
66037
  cachePolicy({
65973
66038
  enabled: cache,
65974
- setFetching: (fetching2) => this.update((state) => ({ ...state, fetching: fetching2 }))
66039
+ setFetching: (fetching2, data) => {
66040
+ this.update((state) => {
66041
+ const newState = { ...state, fetching: fetching2 };
66042
+ if (fetching2 && data) {
66043
+ newState.data = data;
66044
+ }
66045
+ return newState;
66046
+ });
66047
+ }
65975
66048
  })(),
65976
66049
  ...plugins2 ?? []
65977
66050
  ];
@@ -66215,7 +66288,7 @@ var ClientPluginContextWrapper = class {
66215
66288
  };
66216
66289
  const firstInit = !ctx.stuff.inputs || !ctx.stuff.inputs.init;
66217
66290
  const hasChanged = Object.keys(changed).length > 0 || firstInit;
66218
- if (artifact.kind !== ArtifactKind.Fragment && hasChanged) {
66291
+ if (hasChanged) {
66219
66292
  const newVariables = {
66220
66293
  ...ctx.stuff.inputs?.marshaled,
66221
66294
  ...marshalInputs({
@@ -66265,14 +66338,22 @@ var injectedPlugins_default = plugins;
66265
66338
  // src/runtime/client/index.ts
66266
66339
  var HoudiniClient = class {
66267
66340
  url;
66268
- #plugins;
66269
- constructor({ url, fetchParams: fetchParams2, plugins: plugins2, pipeline: pipeline2, throwOnError: throwOnError2 }) {
66341
+ plugins;
66342
+ throwOnError_operations;
66343
+ constructor({
66344
+ url,
66345
+ fetchParams: fetchParams2,
66346
+ plugins: plugins2,
66347
+ pipeline: pipeline2,
66348
+ throwOnError: throwOnError2
66349
+ }) {
66270
66350
  if (plugins2 && pipeline2) {
66271
66351
  throw new Error(
66272
66352
  "A client cannot be given a pipeline and a list of plugins at the same time."
66273
66353
  );
66274
66354
  }
66275
- this.#plugins = flatten(
66355
+ this.throwOnError_operations = throwOnError2?.operations ?? [];
66356
+ this.plugins = flatten(
66276
66357
  [].concat(
66277
66358
  throwOnError2 ? [throwOnError(throwOnError2)] : [],
66278
66359
  fetchParams(fetchParams2),
@@ -66298,7 +66379,7 @@ var HoudiniClient = class {
66298
66379
  return new DocumentStore({
66299
66380
  client: this,
66300
66381
  artifact,
66301
- plugins: createPluginHooks(this.#plugins),
66382
+ plugins: createPluginHooks(this.plugins),
66302
66383
  cache,
66303
66384
  initialValue,
66304
66385
  fetching
@@ -66431,7 +66512,7 @@ var Config = class {
66431
66512
  this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
66432
66513
  this.defaultFragmentMasking = defaultFragmentMasking;
66433
66514
  this.routesDir = join2(this.projectRoot, "src", "routes");
66434
- this.schemaPollInterval = watchSchema?.interval ?? 2e3;
66515
+ this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
66435
66516
  this.schemaPollHeaders = watchSchema?.headers ?? {};
66436
66517
  this.rootDir = join2(this.projectRoot, "$houdini");
66437
66518
  this.#fragmentVariableMaps = {};
@@ -66570,7 +66651,16 @@ var Config = class {
66570
66651
  return "$houdini.d.ts";
66571
66652
  }
66572
66653
  get runtimeSource() {
66573
- const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : findModule("houdini", join2(dirname(this.filepath)));
66654
+ let relative2;
66655
+ if (houdini_mode.is_testing) {
66656
+ relative2 = join2(currentDir, "..", "..");
66657
+ } else if (process.versions.pnp) {
66658
+ const { findPnpApi } = __require("node:module");
66659
+ const pnp = findPnpApi(this.filepath);
66660
+ relative2 = pnp.resolveToUnqualified("houdini", this.filepath);
66661
+ } else {
66662
+ relative2 = findModule("houdini", join2(dirname(this.filepath)));
66663
+ }
66574
66664
  const which = this.module === "esm" ? "esm" : "cjs";
66575
66665
  return resolve(relative2, "build", `runtime-${which}`);
66576
66666
  }
@@ -66685,6 +66775,12 @@ var Config = class {
66685
66775
  get listParentDirective() {
66686
66776
  return "parentID";
66687
66777
  }
66778
+ get blockingDirective() {
66779
+ return "blocking";
66780
+ }
66781
+ get blockingDisableDirective() {
66782
+ return "blocking_disable";
66783
+ }
66688
66784
  get deprecatedlistDirectiveParentIDArg() {
66689
66785
  return "parentID";
66690
66786
  }
@@ -66706,6 +66802,9 @@ var Config = class {
66706
66802
  get deleteDirectiveSuffix() {
66707
66803
  return `_delete`;
66708
66804
  }
66805
+ get loadingDirective() {
66806
+ return `loading`;
66807
+ }
66709
66808
  get whenDirective() {
66710
66809
  return "when";
66711
66810
  }
@@ -66736,6 +66835,9 @@ var Config = class {
66736
66835
  get cachePolicyArg() {
66737
66836
  return "policy";
66738
66837
  }
66838
+ get requiredDirective() {
66839
+ return "required";
66840
+ }
66739
66841
  paginationQueryName(documentName) {
66740
66842
  return documentName + "_Pagination_Query";
66741
66843
  }
@@ -66793,7 +66895,7 @@ var Config = class {
66793
66895
  fragment: fragment2
66794
66896
  }) {
66795
66897
  this.#fragmentVariableMaps[hash] = {
66796
- args: this.#serializeValueMap(args),
66898
+ args: this.serializeValueMap(args),
66797
66899
  fragment: fragment2
66798
66900
  };
66799
66901
  }
@@ -66804,7 +66906,7 @@ var Config = class {
66804
66906
  hash
66805
66907
  };
66806
66908
  }
66807
- #serializeValueMap(map) {
66909
+ serializeValueMap(map) {
66808
66910
  if (!map) {
66809
66911
  return null;
66810
66912
  }
@@ -66819,7 +66921,7 @@ var Config = class {
66819
66921
  }
66820
66922
  if ("values" in input) {
66821
66923
  result.values = input.values.map(
66822
- (value) => this.#serializeValueMap({ foo: value }).foo
66924
+ (value) => this.serializeValueMap({ foo: value }).foo
66823
66925
  );
66824
66926
  }
66825
66927
  if ("name" in input) {
@@ -66828,7 +66930,7 @@ var Config = class {
66828
66930
  if ("fields" in input) {
66829
66931
  result.fields = input.fields.map((field) => ({
66830
66932
  name: field.name,
66831
- value: this.#serializeValueMap({ foo: field.value }).foo
66933
+ value: this.serializeValueMap({ foo: field.value }).foo
66832
66934
  }));
66833
66935
  }
66834
66936
  }
@@ -67040,6 +67142,11 @@ var orderedPlugins = (plugins2) => {
67040
67142
  };
67041
67143
  async function pluginPath(plugin_name, config_path) {
67042
67144
  try {
67145
+ if (process.versions.pnp) {
67146
+ const { findPnpApi } = __require("node:module");
67147
+ const pnp = findPnpApi(config_path);
67148
+ return pnp.resolveRequest(plugin_name, config_path, { conditions: /* @__PURE__ */ new Set(["import"]) });
67149
+ }
67043
67150
  const pluginDirectory = findModule(plugin_name, config_path);
67044
67151
  const packageJsonSrc = await readFile(join2(pluginDirectory, "package.json"));
67045
67152
  if (!packageJsonSrc) {
@@ -67127,6 +67234,16 @@ function hashDocument({
67127
67234
  const docString = typeof document === "string" ? document : document.originalString;
67128
67235
  return crypto.createHash("sha256").update(docString ?? "").digest("hex");
67129
67236
  }
67237
+ function parentField(ancestors) {
67238
+ return walkParentField([...ancestors].sort(() => -1));
67239
+ }
67240
+ function walkParentField(ancestors) {
67241
+ let head = ancestors.shift();
67242
+ if (Array.isArray(head) || head.kind === "SelectionSet") {
67243
+ return walkParentField(ancestors);
67244
+ }
67245
+ return head;
67246
+ }
67130
67247
  function parentTypeFromAncestors(schema, filepath, ancestors) {
67131
67248
  const parents = [...ancestors];
67132
67249
  parents.reverse();
@@ -67197,7 +67314,7 @@ function definitionFromAncestors(ancestors) {
67197
67314
  while (Array.isArray(definition) && definition) {
67198
67315
  definition = parents.shift();
67199
67316
  }
67200
- return definition;
67317
+ return { parents, definition };
67201
67318
  }
67202
67319
  function formatErrors(e2, afterError) {
67203
67320
  const errors = Array.isArray(e2) ? e2 : [e2];
@@ -67281,10 +67398,11 @@ var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
67281
67398
 
67282
67399
  // src/lib/parse.ts
67283
67400
  var import_parser = __toESM(require_lib3(), 1);
67401
+ var import_recast = __toESM(require_main2(), 1);
67284
67402
 
67285
67403
  // src/lib/deepMerge.ts
67286
67404
  var import_deepmerge = __toESM(require_cjs(), 1);
67287
- function deepMerge(filepath, ...targets) {
67405
+ function deepMerge2(filepath, ...targets) {
67288
67406
  try {
67289
67407
  if (targets.length === 1) {
67290
67408
  return targets[0];
@@ -67293,7 +67411,7 @@ function deepMerge(filepath, ...targets) {
67293
67411
  arrayMerge: (source, update) => [...new Set(source.concat(update))]
67294
67412
  });
67295
67413
  }
67296
- return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
67414
+ return deepMerge2(filepath, targets[0], deepMerge2(filepath, ...targets.slice(1)));
67297
67415
  } catch (e2) {
67298
67416
  throw new HoudiniError({
67299
67417
  filepath,
@@ -67306,22 +67424,22 @@ function deepMerge(filepath, ...targets) {
67306
67424
  // src/lib/parse.ts
67307
67425
  async function parseJS(str, config) {
67308
67426
  const defaultConfig = {
67309
- plugins: ["typescript"],
67427
+ plugins: ["typescript", "importAssertions"],
67310
67428
  sourceType: "module"
67311
67429
  };
67312
- return {
67313
- start: 0,
67314
- script: (0, import_parser.parse)(
67315
- str || "",
67316
- config ? deepMerge("", defaultConfig, config) : defaultConfig
67317
- ).program,
67318
- end: str.length
67319
- };
67430
+ return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
67320
67431
  }
67321
67432
  function parseJSON(str) {
67322
67433
  str = str.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m2, g) => g ? "" : m2);
67323
67434
  return JSON.parse(str);
67324
67435
  }
67436
+ async function printJS(script, options) {
67437
+ if (options?.pretty) {
67438
+ return (0, import_recast.prettyPrint)(script, options);
67439
+ } else {
67440
+ return (0, import_recast.print)(script, options);
67441
+ }
67442
+ }
67325
67443
 
67326
67444
  // src/lib/imports.ts
67327
67445
  var recast = __toESM(require_main2(), 1);
@@ -67630,12 +67748,13 @@ export {
67630
67748
  HoudiniError,
67631
67749
  LogLevel,
67632
67750
  PaginateMode,
67751
+ PendingValue,
67633
67752
  RefetchUpdateMode,
67634
67753
  TypeWrapper,
67635
67754
  cleanupFiles,
67636
67755
  computeID,
67637
67756
  createPluginHooks,
67638
- deepMerge,
67757
+ deepMerge2 as deepMerge,
67639
67758
  defaultConfigValues,
67640
67759
  definitionFromAncestors,
67641
67760
  detectFromPackageJSON,
@@ -67657,11 +67776,13 @@ export {
67657
67776
  mutation,
67658
67777
  operation_requires_variables,
67659
67778
  orderedPlugins,
67779
+ parentField,
67660
67780
  parentTypeFromAncestors,
67661
67781
  parseJS,
67662
67782
  parseJSON,
67663
67783
  path_exports as path,
67664
67784
  plugin,
67785
+ printJS,
67665
67786
  pullSchema,
67666
67787
  query,
67667
67788
  readConfigFile,