@kubb/core 3.17.0 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/{FileManager-DsRjYJa_.cjs → FileManager-8HHGE4Dj.cjs} +41 -62
  2. package/dist/FileManager-8HHGE4Dj.cjs.map +1 -0
  3. package/dist/{FileManager-Dk759iZ3.js → FileManager-QMZbSUsa.js} +39 -60
  4. package/dist/FileManager-QMZbSUsa.js.map +1 -0
  5. package/dist/{PluginManager-Cvj5AlsU.d.cts → PluginManager-C62HGihR.d.cts} +23 -2
  6. package/dist/{PluginManager-1jPxuyQK.d.ts → PluginManager-H8G0i6KS.d.ts} +24 -3
  7. package/dist/acorn-3HQnxDj2.js +5106 -0
  8. package/dist/acorn-3HQnxDj2.js.map +1 -0
  9. package/dist/acorn-Biw1D1Ce.cjs +5108 -0
  10. package/dist/acorn-Biw1D1Ce.cjs.map +1 -0
  11. package/dist/angular-B3ddRl90.cjs +3637 -0
  12. package/dist/angular-B3ddRl90.cjs.map +1 -0
  13. package/dist/angular-n5qYWkcx.js +3635 -0
  14. package/dist/angular-n5qYWkcx.js.map +1 -0
  15. package/dist/babel-BrKqHp9Q.cjs +10056 -0
  16. package/dist/babel-BrKqHp9Q.cjs.map +1 -0
  17. package/dist/babel-mOBF3g2e.js +10054 -0
  18. package/dist/babel-mOBF3g2e.js.map +1 -0
  19. package/dist/{chunk-DWy1uDak.cjs → chunk-DoeelZqw.cjs} +12 -0
  20. package/dist/estree-D6ftINJ3.cjs +6948 -0
  21. package/dist/estree-D6ftINJ3.cjs.map +1 -0
  22. package/dist/estree-QGbwcVbp.js +6944 -0
  23. package/dist/estree-QGbwcVbp.js.map +1 -0
  24. package/dist/flow-BWEc100n.cjs +52419 -0
  25. package/dist/flow-BWEc100n.cjs.map +1 -0
  26. package/dist/flow-C1RsRESZ.js +52417 -0
  27. package/dist/flow-C1RsRESZ.js.map +1 -0
  28. package/dist/{fs-BazSaf2y.cjs → fs-CeOer54w.cjs} +27 -15
  29. package/dist/fs-CeOer54w.cjs.map +1 -0
  30. package/dist/{fs-BacxV1CO.js → fs-DkMVXz_s.js} +21 -15
  31. package/dist/fs-DkMVXz_s.js.map +1 -0
  32. package/dist/fs.cjs +3 -2
  33. package/dist/fs.d.cts +2 -2
  34. package/dist/fs.d.ts +2 -2
  35. package/dist/fs.js +2 -2
  36. package/dist/glimmer-CwkHq8v_.cjs +7307 -0
  37. package/dist/glimmer-CwkHq8v_.cjs.map +1 -0
  38. package/dist/glimmer-DZXQWVfc.js +7303 -0
  39. package/dist/glimmer-DZXQWVfc.js.map +1 -0
  40. package/dist/graphql-DWNpg5AH.js +1902 -0
  41. package/dist/graphql-DWNpg5AH.js.map +1 -0
  42. package/dist/graphql-ftPsRNd8.cjs +1907 -0
  43. package/dist/graphql-ftPsRNd8.cjs.map +1 -0
  44. package/dist/html-DMFSHL-z.cjs +6563 -0
  45. package/dist/html-DMFSHL-z.cjs.map +1 -0
  46. package/dist/html-Lx7YOmUI.js +6558 -0
  47. package/dist/html-Lx7YOmUI.js.map +1 -0
  48. package/dist/{index-BfD6z1P5.d.cts → index-3smcdUnJ.d.ts} +11 -9
  49. package/dist/{index-Cb4pChs8.d.ts → index-B428LQ0Z.d.ts} +4 -5
  50. package/dist/{index-BKHQGQVq.d.ts → index-Bglrijef.d.cts} +12 -8
  51. package/dist/{index-D2ptHzfn.d.cts → index-DERUIhQK.d.cts} +3 -4
  52. package/dist/index.cjs +6 -6
  53. package/dist/index.d.cts +3 -3
  54. package/dist/index.d.ts +4 -4
  55. package/dist/index.js +4 -4
  56. package/dist/{logger-xcdTETKy.d.ts → logger-B-4AXUmB.d.ts} +1 -1
  57. package/dist/{logger-Cs45J4yy.js → logger-M0gDQMDh.js} +2 -2
  58. package/dist/{logger-Cs45J4yy.js.map → logger-M0gDQMDh.js.map} +1 -1
  59. package/dist/{logger-BxvJpQMX.cjs → logger-OgWv9Jyy.cjs} +4 -4
  60. package/dist/{logger-BxvJpQMX.cjs.map → logger-OgWv9Jyy.cjs.map} +1 -1
  61. package/dist/logger.cjs +2 -2
  62. package/dist/logger.d.ts +1 -1
  63. package/dist/logger.js +1 -1
  64. package/dist/markdown-BYsFO1cu.cjs +6761 -0
  65. package/dist/markdown-BYsFO1cu.cjs.map +1 -0
  66. package/dist/markdown-Dt7fmgWb.js +6756 -0
  67. package/dist/markdown-Dt7fmgWb.js.map +1 -0
  68. package/dist/meriyah-BA-YCwVg.cjs +8940 -0
  69. package/dist/meriyah-BA-YCwVg.cjs.map +1 -0
  70. package/dist/meriyah-CEYm-XS7.js +8938 -0
  71. package/dist/meriyah-CEYm-XS7.js.map +1 -0
  72. package/dist/mocks.cjs +16962 -11
  73. package/dist/mocks.cjs.map +1 -1
  74. package/dist/mocks.d.cts +2 -2
  75. package/dist/mocks.d.ts +3 -3
  76. package/dist/mocks.js +16964 -9
  77. package/dist/mocks.js.map +1 -1
  78. package/dist/postcss-BQcSCAcI.cjs +6723 -0
  79. package/dist/postcss-BQcSCAcI.cjs.map +1 -0
  80. package/dist/postcss-CI4qZzdL.js +6718 -0
  81. package/dist/postcss-CI4qZzdL.js.map +1 -0
  82. package/dist/{prompt-DwEAzq0q.js → prompt-D3dP3KNu.js} +1 -1
  83. package/dist/{prompt-DwEAzq0q.js.map → prompt-D3dP3KNu.js.map} +1 -1
  84. package/dist/{prompt-qiwl6Be9.cjs → prompt-DslNpUPc.cjs} +2 -2
  85. package/dist/{prompt-qiwl6Be9.cjs.map → prompt-DslNpUPc.cjs.map} +1 -1
  86. package/dist/{transformers-CJqBQFIl.js → transformers-BL8vcCaM.js} +9 -23
  87. package/dist/{transformers-CJqBQFIl.js.map → transformers-BL8vcCaM.js.map} +1 -1
  88. package/dist/{transformers-B3CHtwuB.cjs → transformers-BUNfHgNe.cjs} +9 -29
  89. package/dist/{transformers-B3CHtwuB.cjs.map → transformers-BUNfHgNe.cjs.map} +1 -1
  90. package/dist/transformers.cjs +2 -3
  91. package/dist/transformers.d.cts +1 -6
  92. package/dist/transformers.d.ts +1 -6
  93. package/dist/transformers.js +2 -2
  94. package/dist/typescript-Bq-hjiJ0.js +3 -0
  95. package/dist/typescript-DDBRxbn7.cjs +23121 -0
  96. package/dist/typescript-DDBRxbn7.cjs.map +1 -0
  97. package/dist/typescript-DvVkagAX.cjs +4 -0
  98. package/dist/typescript-eE7YJ2-c.js +23109 -0
  99. package/dist/typescript-eE7YJ2-c.js.map +1 -0
  100. package/dist/utils.cjs +4 -4
  101. package/dist/utils.d.cts +3 -3
  102. package/dist/utils.d.ts +4 -4
  103. package/dist/utils.js +3 -3
  104. package/dist/{write-l_NzIqyy.cjs → write-cvT4uBev.cjs} +2 -2
  105. package/dist/{write-l_NzIqyy.cjs.map → write-cvT4uBev.cjs.map} +1 -1
  106. package/dist/yaml-DZASOrDL.js +5304 -0
  107. package/dist/yaml-DZASOrDL.js.map +1 -0
  108. package/dist/yaml-v1i11ZlS.cjs +5310 -0
  109. package/dist/yaml-v1i11ZlS.cjs.map +1 -0
  110. package/package.json +4 -4
  111. package/src/FileManager.ts +3 -7
  112. package/src/fs/index.ts +3 -2
  113. package/src/fs/unlink.ts +5 -0
  114. package/src/mocks/index.ts +7 -1
  115. package/src/transformers/index.ts +5 -6
  116. package/src/transformers/toRegExp.ts +9 -26
  117. package/src/types.ts +24 -4
  118. package/src/utils/parser.ts +2 -17
  119. package/dist/FileManager-Dk759iZ3.js.map +0 -1
  120. package/dist/FileManager-DsRjYJa_.cjs.map +0 -1
  121. package/dist/fs-BacxV1CO.js.map +0 -1
  122. package/dist/fs-BazSaf2y.cjs.map +0 -1
@@ -0,0 +1,1902 @@
1
+ //#region ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/graphql.mjs
2
+ var Et = Object.defineProperty;
3
+ var xe = (e, t) => {
4
+ for (var n in t) Et(e, n, {
5
+ get: t[n],
6
+ enumerable: !0
7
+ });
8
+ };
9
+ var Ne = {};
10
+ xe(Ne, {
11
+ languages: () => Qe,
12
+ options: () => Ke,
13
+ parsers: () => _e,
14
+ printers: () => pn
15
+ });
16
+ var Tt = (e, t, n, i) => {
17
+ if (!(e && t == null)) return t.replaceAll ? t.replaceAll(n, i) : n.global ? t.replace(n, i) : t.split(n).join(i);
18
+ }, G = Tt;
19
+ var j = "indent";
20
+ var $ = "group";
21
+ var w = "if-break";
22
+ var S = "line";
23
+ var X = "break-parent";
24
+ var Re = () => {}, L = Re, le = Re;
25
+ function N(e) {
26
+ return L(e), {
27
+ type: j,
28
+ contents: e
29
+ };
30
+ }
31
+ function y(e, t = {}) {
32
+ return L(e), le(t.expandedStates, !0), {
33
+ type: $,
34
+ id: t.id,
35
+ contents: e,
36
+ break: !!t.shouldBreak,
37
+ expandedStates: t.expandedStates
38
+ };
39
+ }
40
+ function I(e, t = "", n = {}) {
41
+ return L(e), t !== "" && L(t), {
42
+ type: w,
43
+ breakContents: e,
44
+ flatContents: t,
45
+ groupId: n.groupId
46
+ };
47
+ }
48
+ var yt = { type: X };
49
+ var Ot = {
50
+ type: S,
51
+ hard: !0
52
+ };
53
+ var k = { type: S }, p = {
54
+ type: S,
55
+ soft: !0
56
+ }, f = [Ot, yt];
57
+ function E(e, t) {
58
+ L(e), le(t);
59
+ let n = [];
60
+ for (let i = 0; i < t.length; i++) i !== 0 && n.push(e), n.push(t[i]);
61
+ return n;
62
+ }
63
+ function H(e) {
64
+ return (t, n, i) => {
65
+ let r = !!(i != null && i.backwards);
66
+ if (n === !1) return !1;
67
+ let { length: s } = t, a = n;
68
+ for (; a >= 0 && a < s;) {
69
+ let u = t.charAt(a);
70
+ if (e instanceof RegExp) {
71
+ if (!e.test(u)) return a;
72
+ } else if (!e.includes(u)) return a;
73
+ r ? a-- : a++;
74
+ }
75
+ return a === -1 || a === s ? a : !1;
76
+ };
77
+ }
78
+ H(/\s/u);
79
+ var J = H(" "), ve = H(",; "), Le = H(/[^\n\r]/u);
80
+ function It(e, t, n) {
81
+ let i = !!(n != null && n.backwards);
82
+ if (t === !1) return !1;
83
+ let r = e.charAt(t);
84
+ if (i) {
85
+ if (e.charAt(t - 1) === "\r" && r === `
86
+ `) return t - 2;
87
+ if (r === `
88
+ ` || r === "\r" || r === "\u2028" || r === "\u2029") return t - 1;
89
+ } else {
90
+ if (r === "\r" && e.charAt(t + 1) === `
91
+ `) return t + 2;
92
+ if (r === `
93
+ ` || r === "\r" || r === "\u2028" || r === "\u2029") return t + 1;
94
+ }
95
+ return t;
96
+ }
97
+ var q = It;
98
+ function At(e, t, n = {}) {
99
+ let i = J(e, n.backwards ? t - 1 : t, n), r = q(e, i, n);
100
+ return i !== r;
101
+ }
102
+ var be = At;
103
+ function Dt(e, t) {
104
+ if (t === !1) return !1;
105
+ if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
106
+ for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
107
+ }
108
+ return t;
109
+ }
110
+ var Pe = Dt;
111
+ function gt(e, t) {
112
+ return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Le(e, t) : t;
113
+ }
114
+ var we = gt;
115
+ function kt(e, t) {
116
+ let n = null, i = t;
117
+ for (; i !== n;) n = i, i = ve(e, i), i = Pe(e, i), i = J(e, i);
118
+ return i = we(e, i), i = q(e, i), i !== !1 && be(e, i);
119
+ }
120
+ var Fe = kt;
121
+ function St(e) {
122
+ return Array.isArray(e) && e.length > 0;
123
+ }
124
+ var pe = St;
125
+ var fe = class extends Error {
126
+ name = "UnexpectedNodeError";
127
+ constructor(t, n, i = "type") {
128
+ super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
129
+ }
130
+ }, Be = fe;
131
+ var F = null;
132
+ function B(e) {
133
+ if (F !== null && typeof F.property) {
134
+ let t = F;
135
+ return F = B.prototype = null, t;
136
+ }
137
+ return F = B.prototype = e ?? Object.create(null), new B();
138
+ }
139
+ var Ct = 10;
140
+ for (let e = 0; e <= Ct; e++) B();
141
+ function he(e) {
142
+ return B(e);
143
+ }
144
+ function Rt(e, t = "type") {
145
+ he(e);
146
+ function n(i) {
147
+ let r = i[t], s = e[r];
148
+ if (!Array.isArray(s)) throw Object.assign(/* @__PURE__ */ new Error(`Missing visitor keys for '${r}'.`), { node: i });
149
+ return s;
150
+ }
151
+ return n;
152
+ }
153
+ var Ue = Rt, Q = class {
154
+ constructor(t, n, i) {
155
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
156
+ }
157
+ get [Symbol.toStringTag]() {
158
+ return "Location";
159
+ }
160
+ toJSON() {
161
+ return {
162
+ start: this.start,
163
+ end: this.end
164
+ };
165
+ }
166
+ }, U = class {
167
+ constructor(t, n, i, r, s, a) {
168
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
169
+ }
170
+ get [Symbol.toStringTag]() {
171
+ return "Token";
172
+ }
173
+ toJSON() {
174
+ return {
175
+ kind: this.kind,
176
+ value: this.value,
177
+ line: this.line,
178
+ column: this.column
179
+ };
180
+ }
181
+ }, W = {
182
+ Name: [],
183
+ Document: ["definitions"],
184
+ OperationDefinition: [
185
+ "name",
186
+ "variableDefinitions",
187
+ "directives",
188
+ "selectionSet"
189
+ ],
190
+ VariableDefinition: [
191
+ "variable",
192
+ "type",
193
+ "defaultValue",
194
+ "directives"
195
+ ],
196
+ Variable: ["name"],
197
+ SelectionSet: ["selections"],
198
+ Field: [
199
+ "alias",
200
+ "name",
201
+ "arguments",
202
+ "directives",
203
+ "selectionSet"
204
+ ],
205
+ Argument: ["name", "value"],
206
+ FragmentSpread: ["name", "directives"],
207
+ InlineFragment: [
208
+ "typeCondition",
209
+ "directives",
210
+ "selectionSet"
211
+ ],
212
+ FragmentDefinition: [
213
+ "name",
214
+ "variableDefinitions",
215
+ "typeCondition",
216
+ "directives",
217
+ "selectionSet"
218
+ ],
219
+ IntValue: [],
220
+ FloatValue: [],
221
+ StringValue: [],
222
+ BooleanValue: [],
223
+ NullValue: [],
224
+ EnumValue: [],
225
+ ListValue: ["values"],
226
+ ObjectValue: ["fields"],
227
+ ObjectField: ["name", "value"],
228
+ Directive: ["name", "arguments"],
229
+ NamedType: ["name"],
230
+ ListType: ["type"],
231
+ NonNullType: ["type"],
232
+ SchemaDefinition: [
233
+ "description",
234
+ "directives",
235
+ "operationTypes"
236
+ ],
237
+ OperationTypeDefinition: ["type"],
238
+ ScalarTypeDefinition: [
239
+ "description",
240
+ "name",
241
+ "directives"
242
+ ],
243
+ ObjectTypeDefinition: [
244
+ "description",
245
+ "name",
246
+ "interfaces",
247
+ "directives",
248
+ "fields"
249
+ ],
250
+ FieldDefinition: [
251
+ "description",
252
+ "name",
253
+ "arguments",
254
+ "type",
255
+ "directives"
256
+ ],
257
+ InputValueDefinition: [
258
+ "description",
259
+ "name",
260
+ "type",
261
+ "defaultValue",
262
+ "directives"
263
+ ],
264
+ InterfaceTypeDefinition: [
265
+ "description",
266
+ "name",
267
+ "interfaces",
268
+ "directives",
269
+ "fields"
270
+ ],
271
+ UnionTypeDefinition: [
272
+ "description",
273
+ "name",
274
+ "directives",
275
+ "types"
276
+ ],
277
+ EnumTypeDefinition: [
278
+ "description",
279
+ "name",
280
+ "directives",
281
+ "values"
282
+ ],
283
+ EnumValueDefinition: [
284
+ "description",
285
+ "name",
286
+ "directives"
287
+ ],
288
+ InputObjectTypeDefinition: [
289
+ "description",
290
+ "name",
291
+ "directives",
292
+ "fields"
293
+ ],
294
+ DirectiveDefinition: [
295
+ "description",
296
+ "name",
297
+ "arguments",
298
+ "locations"
299
+ ],
300
+ SchemaExtension: ["directives", "operationTypes"],
301
+ ScalarTypeExtension: ["name", "directives"],
302
+ ObjectTypeExtension: [
303
+ "name",
304
+ "interfaces",
305
+ "directives",
306
+ "fields"
307
+ ],
308
+ InterfaceTypeExtension: [
309
+ "name",
310
+ "interfaces",
311
+ "directives",
312
+ "fields"
313
+ ],
314
+ UnionTypeExtension: [
315
+ "name",
316
+ "directives",
317
+ "types"
318
+ ],
319
+ EnumTypeExtension: [
320
+ "name",
321
+ "directives",
322
+ "values"
323
+ ],
324
+ InputObjectTypeExtension: [
325
+ "name",
326
+ "directives",
327
+ "fields"
328
+ ]
329
+ };
330
+ var C;
331
+ (function(e) {
332
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
333
+ })(C || (C = {}));
334
+ var vt = Ue(W, "kind"), Me = vt;
335
+ function K(e) {
336
+ return e.loc.start;
337
+ }
338
+ function z(e) {
339
+ return e.loc.end;
340
+ }
341
+ var Ve = "format", Ye = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, Ge = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
342
+ function je(e) {
343
+ return Ge.test(e);
344
+ }
345
+ function $e(e) {
346
+ return Ye.test(e);
347
+ }
348
+ function Xe(e) {
349
+ return `# @${Ve}
350
+
351
+ ${e}`;
352
+ }
353
+ function Lt(e, t, n) {
354
+ let { node: i } = e;
355
+ if (!i.description) return "";
356
+ let r = [n("description")];
357
+ return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
358
+ }
359
+ var D = Lt;
360
+ function bt(e, t, n) {
361
+ let { node: i } = e;
362
+ switch (i.kind) {
363
+ case "Document": return [...E(f, g(e, t, n, "definitions")), f];
364
+ case "OperationDefinition": {
365
+ let r = t.originalText[K(i)] !== "{", s = !!i.name;
366
+ return [
367
+ r ? i.operation : "",
368
+ r && s ? [" ", n("name")] : "",
369
+ r && !s && pe(i.variableDefinitions) ? " " : "",
370
+ He(e, n),
371
+ x(e, n, i),
372
+ !r && !s ? "" : " ",
373
+ n("selectionSet")
374
+ ];
375
+ }
376
+ case "FragmentDefinition": return [
377
+ "fragment ",
378
+ n("name"),
379
+ He(e, n),
380
+ " on ",
381
+ n("typeCondition"),
382
+ x(e, n, i),
383
+ " ",
384
+ n("selectionSet")
385
+ ];
386
+ case "SelectionSet": return [
387
+ "{",
388
+ N([f, E(f, g(e, t, n, "selections"))]),
389
+ f,
390
+ "}"
391
+ ];
392
+ case "Field": return y([
393
+ i.alias ? [n("alias"), ": "] : "",
394
+ n("name"),
395
+ i.arguments.length > 0 ? y([
396
+ "(",
397
+ N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
398
+ p,
399
+ ")"
400
+ ]) : "",
401
+ x(e, n, i),
402
+ i.selectionSet ? " " : "",
403
+ n("selectionSet")
404
+ ]);
405
+ case "Name": return i.value;
406
+ case "StringValue":
407
+ if (i.block) {
408
+ let r = G(!1, i.value, "\"\"\"", String.raw`\"""`).split(`
409
+ `);
410
+ return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, [
411
+ "\"\"\"",
412
+ ...r,
413
+ "\"\"\""
414
+ ]);
415
+ }
416
+ return [
417
+ "\"",
418
+ G(!1, G(!1, i.value, /["\\]/gu, String.raw`\$&`), `
419
+ `, String.raw`\n`),
420
+ "\""
421
+ ];
422
+ case "IntValue":
423
+ case "FloatValue":
424
+ case "EnumValue": return i.value;
425
+ case "BooleanValue": return i.value ? "true" : "false";
426
+ case "NullValue": return "null";
427
+ case "Variable": return ["$", n("name")];
428
+ case "ListValue": return y([
429
+ "[",
430
+ N([p, E([I("", ", "), p], e.map(n, "values"))]),
431
+ p,
432
+ "]"
433
+ ]);
434
+ case "ObjectValue": {
435
+ let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
436
+ return y([
437
+ "{",
438
+ r,
439
+ N([p, E([I("", ", "), p], e.map(n, "fields"))]),
440
+ p,
441
+ I("", r),
442
+ "}"
443
+ ]);
444
+ }
445
+ case "ObjectField":
446
+ case "Argument": return [
447
+ n("name"),
448
+ ": ",
449
+ n("value")
450
+ ];
451
+ case "Directive": return [
452
+ "@",
453
+ n("name"),
454
+ i.arguments.length > 0 ? y([
455
+ "(",
456
+ N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
457
+ p,
458
+ ")"
459
+ ]) : ""
460
+ ];
461
+ case "NamedType": return n("name");
462
+ case "VariableDefinition": return [
463
+ n("variable"),
464
+ ": ",
465
+ n("type"),
466
+ i.defaultValue ? [" = ", n("defaultValue")] : "",
467
+ x(e, n, i)
468
+ ];
469
+ case "ObjectTypeExtension":
470
+ case "ObjectTypeDefinition":
471
+ case "InputObjectTypeExtension":
472
+ case "InputObjectTypeDefinition":
473
+ case "InterfaceTypeExtension":
474
+ case "InterfaceTypeDefinition": {
475
+ let { kind: r } = i, s = [];
476
+ return r.endsWith("TypeDefinition") ? s.push(D(e, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...Ft(e, t, n)), s.push(x(e, n, i)), i.fields.length > 0 && s.push([
477
+ " {",
478
+ N([f, E(f, g(e, t, n, "fields"))]),
479
+ f,
480
+ "}"
481
+ ]), s;
482
+ }
483
+ case "FieldDefinition": return [
484
+ D(e, t, n),
485
+ n("name"),
486
+ i.arguments.length > 0 ? y([
487
+ "(",
488
+ N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
489
+ p,
490
+ ")"
491
+ ]) : "",
492
+ ": ",
493
+ n("type"),
494
+ x(e, n, i)
495
+ ];
496
+ case "DirectiveDefinition": return [
497
+ D(e, t, n),
498
+ "directive ",
499
+ "@",
500
+ n("name"),
501
+ i.arguments.length > 0 ? y([
502
+ "(",
503
+ N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
504
+ p,
505
+ ")"
506
+ ]) : "",
507
+ i.repeatable ? " repeatable" : "",
508
+ " on ",
509
+ ...E(" | ", e.map(n, "locations"))
510
+ ];
511
+ case "EnumTypeExtension":
512
+ case "EnumTypeDefinition": return [
513
+ D(e, t, n),
514
+ i.kind === "EnumTypeExtension" ? "extend " : "",
515
+ "enum ",
516
+ n("name"),
517
+ x(e, n, i),
518
+ i.values.length > 0 ? [
519
+ " {",
520
+ N([f, E(f, g(e, t, n, "values"))]),
521
+ f,
522
+ "}"
523
+ ] : ""
524
+ ];
525
+ case "EnumValueDefinition": return [
526
+ D(e, t, n),
527
+ n("name"),
528
+ x(e, n, i)
529
+ ];
530
+ case "InputValueDefinition": return [
531
+ D(e, t, n),
532
+ n("name"),
533
+ ": ",
534
+ n("type"),
535
+ i.defaultValue ? [" = ", n("defaultValue")] : "",
536
+ x(e, n, i)
537
+ ];
538
+ case "SchemaExtension": return [
539
+ "extend schema",
540
+ x(e, n, i),
541
+ ...i.operationTypes.length > 0 ? [
542
+ " {",
543
+ N([f, E(f, g(e, t, n, "operationTypes"))]),
544
+ f,
545
+ "}"
546
+ ] : []
547
+ ];
548
+ case "SchemaDefinition": return [
549
+ D(e, t, n),
550
+ "schema",
551
+ x(e, n, i),
552
+ " {",
553
+ i.operationTypes.length > 0 ? N([f, E(f, g(e, t, n, "operationTypes"))]) : "",
554
+ f,
555
+ "}"
556
+ ];
557
+ case "OperationTypeDefinition": return [
558
+ i.operation,
559
+ ": ",
560
+ n("type")
561
+ ];
562
+ case "FragmentSpread": return [
563
+ "...",
564
+ n("name"),
565
+ x(e, n, i)
566
+ ];
567
+ case "InlineFragment": return [
568
+ "...",
569
+ i.typeCondition ? [" on ", n("typeCondition")] : "",
570
+ x(e, n, i),
571
+ " ",
572
+ n("selectionSet")
573
+ ];
574
+ case "UnionTypeExtension":
575
+ case "UnionTypeDefinition": return y([D(e, t, n), y([
576
+ i.kind === "UnionTypeExtension" ? "extend " : "",
577
+ "union ",
578
+ n("name"),
579
+ x(e, n, i),
580
+ i.types.length > 0 ? [
581
+ " =",
582
+ I("", " "),
583
+ N([I([k, "| "]), E([k, "| "], e.map(n, "types"))])
584
+ ] : ""
585
+ ])]);
586
+ case "ScalarTypeExtension":
587
+ case "ScalarTypeDefinition": return [
588
+ D(e, t, n),
589
+ i.kind === "ScalarTypeExtension" ? "extend " : "",
590
+ "scalar ",
591
+ n("name"),
592
+ x(e, n, i)
593
+ ];
594
+ case "NonNullType": return [n("type"), "!"];
595
+ case "ListType": return [
596
+ "[",
597
+ n("type"),
598
+ "]"
599
+ ];
600
+ default: throw new Be(i, "Graphql", "kind");
601
+ }
602
+ }
603
+ function x(e, t, n) {
604
+ if (n.directives.length === 0) return "";
605
+ let i = E(k, e.map(t, "directives"));
606
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(N([p, i]))];
607
+ }
608
+ function g(e, t, n, i) {
609
+ return e.map(({ isLast: r, node: s }) => {
610
+ let a = n();
611
+ return !r && Fe(t.originalText, z(s)) ? [a, f] : a;
612
+ }, i);
613
+ }
614
+ function Pt(e) {
615
+ return e.kind !== "Comment";
616
+ }
617
+ function wt(e) {
618
+ let t = e.node;
619
+ if (t.kind === "Comment") return "#" + t.value.trimEnd();
620
+ throw new Error("Not a comment: " + JSON.stringify(t));
621
+ }
622
+ function Ft(e, t, n) {
623
+ let { node: i } = e, r = [], { interfaces: s } = i, a = e.map(n, "interfaces");
624
+ for (let u = 0; u < s.length; u++) {
625
+ let l = s[u];
626
+ r.push(a[u]);
627
+ let T = s[u + 1];
628
+ if (T) {
629
+ let A = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
630
+ r.push(" &", A ? k : " ");
631
+ }
632
+ }
633
+ return r;
634
+ }
635
+ function He(e, t) {
636
+ let { node: n } = e;
637
+ return pe(n.variableDefinitions) ? y([
638
+ "(",
639
+ N([p, E([I("", ", "), p], e.map(t, "variableDefinitions"))]),
640
+ p,
641
+ ")"
642
+ ]) : "";
643
+ }
644
+ function Je(e, t) {
645
+ e.kind === "StringValue" && e.block && !e.value.includes(`
646
+ `) && (t.value = e.value.trim());
647
+ }
648
+ Je.ignoredProperties = new Set(["loc", "comments"]);
649
+ function Bt(e) {
650
+ var n;
651
+ let { node: t } = e;
652
+ return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((i) => i.value.trim() === "prettier-ignore");
653
+ }
654
+ var Ut = {
655
+ print: bt,
656
+ massageAstNode: Je,
657
+ hasPrettierIgnore: Bt,
658
+ insertPragma: Xe,
659
+ printComment: wt,
660
+ canAttachComment: Pt,
661
+ getVisitorKeys: Me
662
+ }, qe = Ut;
663
+ var Qe = [{
664
+ name: "GraphQL",
665
+ type: "data",
666
+ extensions: [
667
+ ".graphql",
668
+ ".gql",
669
+ ".graphqls"
670
+ ],
671
+ tmScope: "source.graphql",
672
+ aceMode: "text",
673
+ parsers: ["graphql"],
674
+ vscodeLanguageIds: ["graphql"],
675
+ linguistLanguageId: 139
676
+ }];
677
+ var We = {
678
+ bracketSpacing: {
679
+ category: "Common",
680
+ type: "boolean",
681
+ default: !0,
682
+ description: "Print spaces between brackets.",
683
+ oppositeDescription: "Do not print spaces between brackets."
684
+ },
685
+ objectWrap: {
686
+ category: "Common",
687
+ type: "choice",
688
+ default: "preserve",
689
+ description: "How to wrap object literals.",
690
+ choices: [{
691
+ value: "preserve",
692
+ description: "Keep as multi-line, if there is a newline between the opening brace and first property."
693
+ }, {
694
+ value: "collapse",
695
+ description: "Fit to a single line when possible."
696
+ }]
697
+ },
698
+ singleQuote: {
699
+ category: "Common",
700
+ type: "boolean",
701
+ default: !1,
702
+ description: "Use single quotes instead of double quotes."
703
+ },
704
+ proseWrap: {
705
+ category: "Common",
706
+ type: "choice",
707
+ default: "preserve",
708
+ description: "How to wrap prose.",
709
+ choices: [
710
+ {
711
+ value: "always",
712
+ description: "Wrap prose if it exceeds the print width."
713
+ },
714
+ {
715
+ value: "never",
716
+ description: "Do not wrap prose."
717
+ },
718
+ {
719
+ value: "preserve",
720
+ description: "Wrap prose as-is."
721
+ }
722
+ ]
723
+ },
724
+ bracketSameLine: {
725
+ category: "Common",
726
+ type: "boolean",
727
+ default: !1,
728
+ description: "Put > of opening tags on the last line instead of on a new line."
729
+ },
730
+ singleAttributePerLine: {
731
+ category: "Common",
732
+ type: "boolean",
733
+ default: !1,
734
+ description: "Enforce single attribute per line in HTML, Vue and JSX."
735
+ }
736
+ };
737
+ var Mt = { bracketSpacing: We.bracketSpacing }, Ke = Mt;
738
+ var _e = {};
739
+ xe(_e, { graphql: () => ln });
740
+ function ze(e) {
741
+ return typeof e == "object" && e !== null;
742
+ }
743
+ function Ze(e, t) {
744
+ if (!!!e) throw new Error(t ?? "Unexpected invariant triggered.");
745
+ }
746
+ var Vt = /\r\n|[\n\r]/g;
747
+ function M(e, t) {
748
+ let n = 0, i = 1;
749
+ for (let r of e.body.matchAll(Vt)) {
750
+ if (typeof r.index == "number" || Ze(!1), r.index >= t) break;
751
+ n = r.index + r[0].length, i += 1;
752
+ }
753
+ return {
754
+ line: i,
755
+ column: t + 1 - n
756
+ };
757
+ }
758
+ function tt(e) {
759
+ return de(e.source, M(e.source, e.start));
760
+ }
761
+ function de(e, t) {
762
+ let n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, l = t.column + u, T = `${e.name}:${a}:${l}
763
+ `, h = i.split(/\r\n|[\n\r]/g), A = h[r];
764
+ if (A.length > 120) {
765
+ let O = Math.floor(l / 80), ae = l % 80, _ = [];
766
+ for (let v = 0; v < A.length; v += 80) _.push(A.slice(v, v + 80));
767
+ return T + et([
768
+ [`${a} |`, _[0]],
769
+ ..._.slice(1, O + 1).map((v) => ["|", v]),
770
+ ["|", "^".padStart(ae)],
771
+ ["|", _[O + 1]]
772
+ ]);
773
+ }
774
+ return T + et([
775
+ [`${a - 1} |`, h[r - 1]],
776
+ [`${a} |`, A],
777
+ ["|", "^".padStart(l)],
778
+ [`${a + 1} |`, h[r + 1]]
779
+ ]);
780
+ }
781
+ function et(e) {
782
+ let t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
783
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
784
+ `);
785
+ }
786
+ function Yt(e) {
787
+ let t = e[0];
788
+ return t == null || "kind" in t || "length" in t ? {
789
+ nodes: t,
790
+ source: e[1],
791
+ positions: e[2],
792
+ path: e[3],
793
+ originalError: e[4],
794
+ extensions: e[5]
795
+ } : t;
796
+ }
797
+ var Z = class e extends Error {
798
+ constructor(t, ...n) {
799
+ var i, r, s;
800
+ let { nodes: a, source: u, positions: l, path: T, originalError: h, extensions: A } = Yt(n);
801
+ super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = h ?? void 0, this.nodes = nt(Array.isArray(a) ? a : a ? [a] : void 0);
802
+ let O = nt((i = this.nodes) === null || i === void 0 ? void 0 : i.map((_) => _.loc).filter((_) => _ != null));
803
+ this.source = u ?? (O == null || (r = O[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? (O == null ? void 0 : O.map((_) => _.start)), this.locations = l && u ? l.map((_) => M(u, _)) : O == null ? void 0 : O.map((_) => M(_.source, _.start));
804
+ let ae = ze(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
805
+ this.extensions = (s = A ?? ae) !== null && s !== void 0 ? s : Object.create(null), Object.defineProperties(this, {
806
+ message: {
807
+ writable: !0,
808
+ enumerable: !0
809
+ },
810
+ name: { enumerable: !1 },
811
+ nodes: { enumerable: !1 },
812
+ source: { enumerable: !1 },
813
+ positions: { enumerable: !1 },
814
+ originalError: { enumerable: !1 }
815
+ }), h != null && h.stack ? Object.defineProperty(this, "stack", {
816
+ value: h.stack,
817
+ writable: !0,
818
+ configurable: !0
819
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", {
820
+ value: Error().stack,
821
+ writable: !0,
822
+ configurable: !0
823
+ });
824
+ }
825
+ get [Symbol.toStringTag]() {
826
+ return "GraphQLError";
827
+ }
828
+ toString() {
829
+ let t = this.message;
830
+ if (this.nodes) for (let n of this.nodes) n.loc && (t += `
831
+
832
+ ` + tt(n.loc));
833
+ else if (this.source && this.locations) for (let n of this.locations) t += `
834
+
835
+ ` + de(this.source, n);
836
+ return t;
837
+ }
838
+ toJSON() {
839
+ let t = { message: this.message };
840
+ return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
841
+ }
842
+ };
843
+ function nt(e) {
844
+ return e === void 0 || e.length === 0 ? void 0 : e;
845
+ }
846
+ function d(e, t, n) {
847
+ return new Z(`Syntax Error: ${n}`, {
848
+ source: e,
849
+ positions: [t]
850
+ });
851
+ }
852
+ var ee;
853
+ (function(e) {
854
+ e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
855
+ })(ee || (ee = {}));
856
+ var c;
857
+ (function(e) {
858
+ e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
859
+ })(c || (c = {}));
860
+ function rt(e) {
861
+ return e === 9 || e === 32;
862
+ }
863
+ function b(e) {
864
+ return e >= 48 && e <= 57;
865
+ }
866
+ function it(e) {
867
+ return e >= 97 && e <= 122 || e >= 65 && e <= 90;
868
+ }
869
+ function me(e) {
870
+ return it(e) || e === 95;
871
+ }
872
+ function st(e) {
873
+ return it(e) || b(e) || e === 95;
874
+ }
875
+ function ot(e) {
876
+ var t;
877
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
878
+ for (let a = 0; a < e.length; ++a) {
879
+ var s;
880
+ let u = e[a], l = Gt(u);
881
+ l !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && l < n && (n = l));
882
+ }
883
+ return e.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
884
+ }
885
+ function Gt(e) {
886
+ let t = 0;
887
+ for (; t < e.length && rt(e.charCodeAt(t));) ++t;
888
+ return t;
889
+ }
890
+ var o;
891
+ (function(e) {
892
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
893
+ })(o || (o = {}));
894
+ var te = class {
895
+ constructor(t) {
896
+ let n = new U(o.SOF, 0, 0, 0, 0);
897
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
898
+ }
899
+ get [Symbol.toStringTag]() {
900
+ return "Lexer";
901
+ }
902
+ advance() {
903
+ return this.lastToken = this.token, this.token = this.lookahead();
904
+ }
905
+ lookahead() {
906
+ let t = this.token;
907
+ if (t.kind !== o.EOF) do
908
+ if (t.next) t = t.next;
909
+ else {
910
+ let n = jt(this, t.end);
911
+ t.next = n, n.prev = t, t = n;
912
+ }
913
+ while (t.kind === o.COMMENT);
914
+ return t;
915
+ }
916
+ };
917
+ function ct(e) {
918
+ return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
919
+ }
920
+ function P(e) {
921
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
922
+ }
923
+ function ne(e, t) {
924
+ return ut(e.charCodeAt(t)) && lt(e.charCodeAt(t + 1));
925
+ }
926
+ function ut(e) {
927
+ return e >= 55296 && e <= 56319;
928
+ }
929
+ function lt(e) {
930
+ return e >= 56320 && e <= 57343;
931
+ }
932
+ function R(e, t) {
933
+ let n = e.source.body.codePointAt(t);
934
+ if (n === void 0) return o.EOF;
935
+ if (n >= 32 && n <= 126) {
936
+ let i = String.fromCodePoint(n);
937
+ return i === "\"" ? `'"'` : `"${i}"`;
938
+ }
939
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
940
+ }
941
+ function m(e, t, n, i, r) {
942
+ let s = e.line, a = 1 + n - e.lineStart;
943
+ return new U(t, n, i, s, a, r);
944
+ }
945
+ function jt(e, t) {
946
+ let n = e.source.body, i = n.length, r = t;
947
+ for (; r < i;) {
948
+ let s = n.charCodeAt(r);
949
+ switch (s) {
950
+ case 65279:
951
+ case 9:
952
+ case 32:
953
+ case 44:
954
+ ++r;
955
+ continue;
956
+ case 10:
957
+ ++r, ++e.line, e.lineStart = r;
958
+ continue;
959
+ case 13:
960
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
961
+ continue;
962
+ case 35: return $t(e, r);
963
+ case 33: return m(e, o.BANG, r, r + 1);
964
+ case 36: return m(e, o.DOLLAR, r, r + 1);
965
+ case 38: return m(e, o.AMP, r, r + 1);
966
+ case 40: return m(e, o.PAREN_L, r, r + 1);
967
+ case 41: return m(e, o.PAREN_R, r, r + 1);
968
+ case 46:
969
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return m(e, o.SPREAD, r, r + 3);
970
+ break;
971
+ case 58: return m(e, o.COLON, r, r + 1);
972
+ case 61: return m(e, o.EQUALS, r, r + 1);
973
+ case 64: return m(e, o.AT, r, r + 1);
974
+ case 91: return m(e, o.BRACKET_L, r, r + 1);
975
+ case 93: return m(e, o.BRACKET_R, r, r + 1);
976
+ case 123: return m(e, o.BRACE_L, r, r + 1);
977
+ case 124: return m(e, o.PIPE, r, r + 1);
978
+ case 125: return m(e, o.BRACE_R, r, r + 1);
979
+ case 34: return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Wt(e, r) : Ht(e, r);
980
+ }
981
+ if (b(s) || s === 45) return Xt(e, r, s);
982
+ if (me(s)) return Kt(e, r);
983
+ throw d(e.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || ne(n, r) ? `Unexpected character: ${R(e, r)}.` : `Invalid character: ${R(e, r)}.`);
984
+ }
985
+ return m(e, o.EOF, i, i);
986
+ }
987
+ function $t(e, t) {
988
+ let n = e.source.body, i = n.length, r = t + 1;
989
+ for (; r < i;) {
990
+ let s = n.charCodeAt(r);
991
+ if (s === 10 || s === 13) break;
992
+ if (P(s)) ++r;
993
+ else if (ne(n, r)) r += 2;
994
+ else break;
995
+ }
996
+ return m(e, o.COMMENT, t, r, n.slice(t + 1, r));
997
+ }
998
+ function Xt(e, t, n) {
999
+ let i = e.source.body, r = t, s = n, a = !1;
1000
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
1001
+ if (s = i.charCodeAt(++r), b(s)) throw d(e.source, r, `Invalid number, unexpected digit after 0: ${R(e, r)}.`);
1002
+ } else r = Ee(e, r, s), s = i.charCodeAt(r);
1003
+ if (s === 46 && (a = !0, s = i.charCodeAt(++r), r = Ee(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Ee(e, r, s), s = i.charCodeAt(r)), s === 46 || me(s)) throw d(e.source, r, `Invalid number, expected digit but got: ${R(e, r)}.`);
1004
+ return m(e, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
1005
+ }
1006
+ function Ee(e, t, n) {
1007
+ if (!b(n)) throw d(e.source, t, `Invalid number, expected digit but got: ${R(e, t)}.`);
1008
+ let i = e.source.body, r = t + 1;
1009
+ for (; b(i.charCodeAt(r));) ++r;
1010
+ return r;
1011
+ }
1012
+ function Ht(e, t) {
1013
+ let n = e.source.body, i = n.length, r = t + 1, s = r, a = "";
1014
+ for (; r < i;) {
1015
+ let u = n.charCodeAt(r);
1016
+ if (u === 34) return a += n.slice(s, r), m(e, o.STRING, t, r + 1, a);
1017
+ if (u === 92) {
1018
+ a += n.slice(s, r);
1019
+ let l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Jt(e, r) : qt(e, r) : Qt(e, r);
1020
+ a += l.value, r += l.size, s = r;
1021
+ continue;
1022
+ }
1023
+ if (u === 10 || u === 13) break;
1024
+ if (P(u)) ++r;
1025
+ else if (ne(n, r)) r += 2;
1026
+ else throw d(e.source, r, `Invalid character within String: ${R(e, r)}.`);
1027
+ }
1028
+ throw d(e.source, r, "Unterminated string.");
1029
+ }
1030
+ function Jt(e, t) {
1031
+ let n = e.source.body, i = 0, r = 3;
1032
+ for (; r < 12;) {
1033
+ let s = n.charCodeAt(t + r++);
1034
+ if (s === 125) {
1035
+ if (r < 5 || !P(i)) break;
1036
+ return {
1037
+ value: String.fromCodePoint(i),
1038
+ size: r
1039
+ };
1040
+ }
1041
+ if (i = i << 4 | V(s), i < 0) break;
1042
+ }
1043
+ throw d(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
1044
+ }
1045
+ function qt(e, t) {
1046
+ let n = e.source.body, i = at(n, t + 2);
1047
+ if (P(i)) return {
1048
+ value: String.fromCodePoint(i),
1049
+ size: 6
1050
+ };
1051
+ if (ut(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
1052
+ let r = at(n, t + 8);
1053
+ if (lt(r)) return {
1054
+ value: String.fromCodePoint(i, r),
1055
+ size: 12
1056
+ };
1057
+ }
1058
+ throw d(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
1059
+ }
1060
+ function at(e, t) {
1061
+ return V(e.charCodeAt(t)) << 12 | V(e.charCodeAt(t + 1)) << 8 | V(e.charCodeAt(t + 2)) << 4 | V(e.charCodeAt(t + 3));
1062
+ }
1063
+ function V(e) {
1064
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
1065
+ }
1066
+ function Qt(e, t) {
1067
+ let n = e.source.body;
1068
+ switch (n.charCodeAt(t + 1)) {
1069
+ case 34: return {
1070
+ value: "\"",
1071
+ size: 2
1072
+ };
1073
+ case 92: return {
1074
+ value: "\\",
1075
+ size: 2
1076
+ };
1077
+ case 47: return {
1078
+ value: "/",
1079
+ size: 2
1080
+ };
1081
+ case 98: return {
1082
+ value: "\b",
1083
+ size: 2
1084
+ };
1085
+ case 102: return {
1086
+ value: "\f",
1087
+ size: 2
1088
+ };
1089
+ case 110: return {
1090
+ value: `
1091
+ `,
1092
+ size: 2
1093
+ };
1094
+ case 114: return {
1095
+ value: "\r",
1096
+ size: 2
1097
+ };
1098
+ case 116: return {
1099
+ value: " ",
1100
+ size: 2
1101
+ };
1102
+ }
1103
+ throw d(e.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
1104
+ }
1105
+ function Wt(e, t) {
1106
+ let n = e.source.body, i = n.length, r = e.lineStart, s = t + 3, a = s, u = "", l = [];
1107
+ for (; s < i;) {
1108
+ let T = n.charCodeAt(s);
1109
+ if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
1110
+ u += n.slice(a, s), l.push(u);
1111
+ let h = m(e, o.BLOCK_STRING, t, s + 3, ot(l).join(`
1112
+ `));
1113
+ return e.line += l.length - 1, e.lineStart = r, h;
1114
+ }
1115
+ if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
1116
+ u += n.slice(a, s), a = s + 1, s += 4;
1117
+ continue;
1118
+ }
1119
+ if (T === 10 || T === 13) {
1120
+ u += n.slice(a, s), l.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, r = s;
1121
+ continue;
1122
+ }
1123
+ if (P(T)) ++s;
1124
+ else if (ne(n, s)) s += 2;
1125
+ else throw d(e.source, s, `Invalid character within String: ${R(e, s)}.`);
1126
+ }
1127
+ throw d(e.source, s, "Unterminated string.");
1128
+ }
1129
+ function Kt(e, t) {
1130
+ let n = e.source.body, i = n.length, r = t + 1;
1131
+ for (; r < i;) {
1132
+ let s = n.charCodeAt(r);
1133
+ if (st(s)) ++r;
1134
+ else break;
1135
+ }
1136
+ return m(e, o.NAME, t, r, n.slice(t, r));
1137
+ }
1138
+ function re(e, t) {
1139
+ if (!!!e) throw new Error(t);
1140
+ }
1141
+ function ie(e) {
1142
+ return se(e, []);
1143
+ }
1144
+ function se(e, t) {
1145
+ switch (typeof e) {
1146
+ case "string": return JSON.stringify(e);
1147
+ case "function": return e.name ? `[function ${e.name}]` : "[function]";
1148
+ case "object": return zt(e, t);
1149
+ default: return String(e);
1150
+ }
1151
+ }
1152
+ function zt(e, t) {
1153
+ if (e === null) return "null";
1154
+ if (t.includes(e)) return "[Circular]";
1155
+ let n = [...t, e];
1156
+ if (Zt(e)) {
1157
+ let i = e.toJSON();
1158
+ if (i !== e) return typeof i == "string" ? i : se(i, n);
1159
+ } else if (Array.isArray(e)) return tn(e, n);
1160
+ return en(e, n);
1161
+ }
1162
+ function Zt(e) {
1163
+ return typeof e.toJSON == "function";
1164
+ }
1165
+ function en(e, t) {
1166
+ let n = Object.entries(e);
1167
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + nn(e) + "]" : "{ " + n.map(([r, s]) => r + ": " + se(s, t)).join(", ") + " }";
1168
+ }
1169
+ function tn(e, t) {
1170
+ if (e.length === 0) return "[]";
1171
+ if (t.length > 2) return "[Array]";
1172
+ let n = Math.min(10, e.length), i = e.length - n, r = [];
1173
+ for (let s = 0; s < n; ++s) r.push(se(e[s], t));
1174
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
1175
+ }
1176
+ function nn(e) {
1177
+ let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
1178
+ if (t === "Object" && typeof e.constructor == "function") {
1179
+ let n = e.constructor.name;
1180
+ if (typeof n == "string" && n !== "") return n;
1181
+ }
1182
+ return t;
1183
+ }
1184
+ var rn = globalThis.process && !0, pt = rn ? function(t, n) {
1185
+ return t instanceof n;
1186
+ } : function(t, n) {
1187
+ if (t instanceof n) return !0;
1188
+ if (typeof t == "object" && t !== null) {
1189
+ var i;
1190
+ let r = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name;
1191
+ if (r === s) {
1192
+ let a = ie(t);
1193
+ throw new Error(`Cannot use ${r} "${a}" from another module or realm.
1194
+
1195
+ Ensure that there is only one instance of "graphql" in the node_modules
1196
+ directory. If different versions of "graphql" are the dependencies of other
1197
+ relied on modules, use "resolutions" to ensure only one version is installed.
1198
+
1199
+ https://yarnpkg.com/en/docs/selective-version-resolutions
1200
+
1201
+ Duplicate "graphql" modules cannot be used at the same time since different
1202
+ versions may have different capabilities and behavior. The data from one
1203
+ version used in the function from another could produce confusing and
1204
+ spurious results.`);
1205
+ }
1206
+ }
1207
+ return !1;
1208
+ };
1209
+ var Y = class {
1210
+ constructor(t, n = "GraphQL request", i = {
1211
+ line: 1,
1212
+ column: 1
1213
+ }) {
1214
+ typeof t == "string" || re(!1, `Body must be a string. Received: ${ie(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || re(!1, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || re(!1, "column in locationOffset is 1-indexed and must be positive.");
1215
+ }
1216
+ get [Symbol.toStringTag]() {
1217
+ return "Source";
1218
+ }
1219
+ };
1220
+ function ft(e) {
1221
+ return pt(e, Y);
1222
+ }
1223
+ function ht(e, t) {
1224
+ let n = new Te(e, t), i = n.parseDocument();
1225
+ return Object.defineProperty(i, "tokenCount", {
1226
+ enumerable: !1,
1227
+ value: n.tokenCount
1228
+ }), i;
1229
+ }
1230
+ var Te = class {
1231
+ constructor(t, n = {}) {
1232
+ let i = ft(t) ? t : new Y(t);
1233
+ this._lexer = new te(i), this._options = n, this._tokenCounter = 0;
1234
+ }
1235
+ get tokenCount() {
1236
+ return this._tokenCounter;
1237
+ }
1238
+ parseName() {
1239
+ let t = this.expectToken(o.NAME);
1240
+ return this.node(t, {
1241
+ kind: c.NAME,
1242
+ value: t.value
1243
+ });
1244
+ }
1245
+ parseDocument() {
1246
+ return this.node(this._lexer.token, {
1247
+ kind: c.DOCUMENT,
1248
+ definitions: this.many(o.SOF, this.parseDefinition, o.EOF)
1249
+ });
1250
+ }
1251
+ parseDefinition() {
1252
+ if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
1253
+ let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1254
+ if (n.kind === o.NAME) {
1255
+ switch (n.value) {
1256
+ case "schema": return this.parseSchemaDefinition();
1257
+ case "scalar": return this.parseScalarTypeDefinition();
1258
+ case "type": return this.parseObjectTypeDefinition();
1259
+ case "interface": return this.parseInterfaceTypeDefinition();
1260
+ case "union": return this.parseUnionTypeDefinition();
1261
+ case "enum": return this.parseEnumTypeDefinition();
1262
+ case "input": return this.parseInputObjectTypeDefinition();
1263
+ case "directive": return this.parseDirectiveDefinition();
1264
+ }
1265
+ if (t) throw d(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions.");
1266
+ switch (n.value) {
1267
+ case "query":
1268
+ case "mutation":
1269
+ case "subscription": return this.parseOperationDefinition();
1270
+ case "fragment": return this.parseFragmentDefinition();
1271
+ case "extend": return this.parseTypeSystemExtension();
1272
+ }
1273
+ }
1274
+ throw this.unexpected(n);
1275
+ }
1276
+ parseOperationDefinition() {
1277
+ let t = this._lexer.token;
1278
+ if (this.peek(o.BRACE_L)) return this.node(t, {
1279
+ kind: c.OPERATION_DEFINITION,
1280
+ operation: C.QUERY,
1281
+ name: void 0,
1282
+ variableDefinitions: [],
1283
+ directives: [],
1284
+ selectionSet: this.parseSelectionSet()
1285
+ });
1286
+ let n = this.parseOperationType(), i;
1287
+ return this.peek(o.NAME) && (i = this.parseName()), this.node(t, {
1288
+ kind: c.OPERATION_DEFINITION,
1289
+ operation: n,
1290
+ name: i,
1291
+ variableDefinitions: this.parseVariableDefinitions(),
1292
+ directives: this.parseDirectives(!1),
1293
+ selectionSet: this.parseSelectionSet()
1294
+ });
1295
+ }
1296
+ parseOperationType() {
1297
+ let t = this.expectToken(o.NAME);
1298
+ switch (t.value) {
1299
+ case "query": return C.QUERY;
1300
+ case "mutation": return C.MUTATION;
1301
+ case "subscription": return C.SUBSCRIPTION;
1302
+ }
1303
+ throw this.unexpected(t);
1304
+ }
1305
+ parseVariableDefinitions() {
1306
+ return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
1307
+ }
1308
+ parseVariableDefinition() {
1309
+ return this.node(this._lexer.token, {
1310
+ kind: c.VARIABLE_DEFINITION,
1311
+ variable: this.parseVariable(),
1312
+ type: (this.expectToken(o.COLON), this.parseTypeReference()),
1313
+ defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
1314
+ directives: this.parseConstDirectives()
1315
+ });
1316
+ }
1317
+ parseVariable() {
1318
+ let t = this._lexer.token;
1319
+ return this.expectToken(o.DOLLAR), this.node(t, {
1320
+ kind: c.VARIABLE,
1321
+ name: this.parseName()
1322
+ });
1323
+ }
1324
+ parseSelectionSet() {
1325
+ return this.node(this._lexer.token, {
1326
+ kind: c.SELECTION_SET,
1327
+ selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R)
1328
+ });
1329
+ }
1330
+ parseSelection() {
1331
+ return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
1332
+ }
1333
+ parseField() {
1334
+ let t = this._lexer.token, n = this.parseName(), i, r;
1335
+ return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1336
+ kind: c.FIELD,
1337
+ alias: i,
1338
+ name: r,
1339
+ arguments: this.parseArguments(!1),
1340
+ directives: this.parseDirectives(!1),
1341
+ selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
1342
+ });
1343
+ }
1344
+ parseArguments(t) {
1345
+ let n = t ? this.parseConstArgument : this.parseArgument;
1346
+ return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
1347
+ }
1348
+ parseArgument(t = !1) {
1349
+ let n = this._lexer.token, i = this.parseName();
1350
+ return this.expectToken(o.COLON), this.node(n, {
1351
+ kind: c.ARGUMENT,
1352
+ name: i,
1353
+ value: this.parseValueLiteral(t)
1354
+ });
1355
+ }
1356
+ parseConstArgument() {
1357
+ return this.parseArgument(!0);
1358
+ }
1359
+ parseFragment() {
1360
+ let t = this._lexer.token;
1361
+ this.expectToken(o.SPREAD);
1362
+ let n = this.expectOptionalKeyword("on");
1363
+ return !n && this.peek(o.NAME) ? this.node(t, {
1364
+ kind: c.FRAGMENT_SPREAD,
1365
+ name: this.parseFragmentName(),
1366
+ directives: this.parseDirectives(!1)
1367
+ }) : this.node(t, {
1368
+ kind: c.INLINE_FRAGMENT,
1369
+ typeCondition: n ? this.parseNamedType() : void 0,
1370
+ directives: this.parseDirectives(!1),
1371
+ selectionSet: this.parseSelectionSet()
1372
+ });
1373
+ }
1374
+ parseFragmentDefinition() {
1375
+ let t = this._lexer.token;
1376
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1377
+ kind: c.FRAGMENT_DEFINITION,
1378
+ name: this.parseFragmentName(),
1379
+ variableDefinitions: this.parseVariableDefinitions(),
1380
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1381
+ directives: this.parseDirectives(!1),
1382
+ selectionSet: this.parseSelectionSet()
1383
+ }) : this.node(t, {
1384
+ kind: c.FRAGMENT_DEFINITION,
1385
+ name: this.parseFragmentName(),
1386
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1387
+ directives: this.parseDirectives(!1),
1388
+ selectionSet: this.parseSelectionSet()
1389
+ });
1390
+ }
1391
+ parseFragmentName() {
1392
+ if (this._lexer.token.value === "on") throw this.unexpected();
1393
+ return this.parseName();
1394
+ }
1395
+ parseValueLiteral(t) {
1396
+ let n = this._lexer.token;
1397
+ switch (n.kind) {
1398
+ case o.BRACKET_L: return this.parseList(t);
1399
+ case o.BRACE_L: return this.parseObject(t);
1400
+ case o.INT: return this.advanceLexer(), this.node(n, {
1401
+ kind: c.INT,
1402
+ value: n.value
1403
+ });
1404
+ case o.FLOAT: return this.advanceLexer(), this.node(n, {
1405
+ kind: c.FLOAT,
1406
+ value: n.value
1407
+ });
1408
+ case o.STRING:
1409
+ case o.BLOCK_STRING: return this.parseStringLiteral();
1410
+ case o.NAME: switch (this.advanceLexer(), n.value) {
1411
+ case "true": return this.node(n, {
1412
+ kind: c.BOOLEAN,
1413
+ value: !0
1414
+ });
1415
+ case "false": return this.node(n, {
1416
+ kind: c.BOOLEAN,
1417
+ value: !1
1418
+ });
1419
+ case "null": return this.node(n, { kind: c.NULL });
1420
+ default: return this.node(n, {
1421
+ kind: c.ENUM,
1422
+ value: n.value
1423
+ });
1424
+ }
1425
+ case o.DOLLAR:
1426
+ if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
1427
+ let i = this._lexer.token.value;
1428
+ throw d(this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.`);
1429
+ } else throw this.unexpected(n);
1430
+ return this.parseVariable();
1431
+ default: throw this.unexpected();
1432
+ }
1433
+ }
1434
+ parseConstValueLiteral() {
1435
+ return this.parseValueLiteral(!0);
1436
+ }
1437
+ parseStringLiteral() {
1438
+ let t = this._lexer.token;
1439
+ return this.advanceLexer(), this.node(t, {
1440
+ kind: c.STRING,
1441
+ value: t.value,
1442
+ block: t.kind === o.BLOCK_STRING
1443
+ });
1444
+ }
1445
+ parseList(t) {
1446
+ let n = () => this.parseValueLiteral(t);
1447
+ return this.node(this._lexer.token, {
1448
+ kind: c.LIST,
1449
+ values: this.any(o.BRACKET_L, n, o.BRACKET_R)
1450
+ });
1451
+ }
1452
+ parseObject(t) {
1453
+ let n = () => this.parseObjectField(t);
1454
+ return this.node(this._lexer.token, {
1455
+ kind: c.OBJECT,
1456
+ fields: this.any(o.BRACE_L, n, o.BRACE_R)
1457
+ });
1458
+ }
1459
+ parseObjectField(t) {
1460
+ let n = this._lexer.token, i = this.parseName();
1461
+ return this.expectToken(o.COLON), this.node(n, {
1462
+ kind: c.OBJECT_FIELD,
1463
+ name: i,
1464
+ value: this.parseValueLiteral(t)
1465
+ });
1466
+ }
1467
+ parseDirectives(t) {
1468
+ let n = [];
1469
+ for (; this.peek(o.AT);) n.push(this.parseDirective(t));
1470
+ return n;
1471
+ }
1472
+ parseConstDirectives() {
1473
+ return this.parseDirectives(!0);
1474
+ }
1475
+ parseDirective(t) {
1476
+ let n = this._lexer.token;
1477
+ return this.expectToken(o.AT), this.node(n, {
1478
+ kind: c.DIRECTIVE,
1479
+ name: this.parseName(),
1480
+ arguments: this.parseArguments(t)
1481
+ });
1482
+ }
1483
+ parseTypeReference() {
1484
+ let t = this._lexer.token, n;
1485
+ if (this.expectOptionalToken(o.BRACKET_L)) {
1486
+ let i = this.parseTypeReference();
1487
+ this.expectToken(o.BRACKET_R), n = this.node(t, {
1488
+ kind: c.LIST_TYPE,
1489
+ type: i
1490
+ });
1491
+ } else n = this.parseNamedType();
1492
+ return this.expectOptionalToken(o.BANG) ? this.node(t, {
1493
+ kind: c.NON_NULL_TYPE,
1494
+ type: n
1495
+ }) : n;
1496
+ }
1497
+ parseNamedType() {
1498
+ return this.node(this._lexer.token, {
1499
+ kind: c.NAMED_TYPE,
1500
+ name: this.parseName()
1501
+ });
1502
+ }
1503
+ peekDescription() {
1504
+ return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
1505
+ }
1506
+ parseDescription() {
1507
+ if (this.peekDescription()) return this.parseStringLiteral();
1508
+ }
1509
+ parseSchemaDefinition() {
1510
+ let t = this._lexer.token, n = this.parseDescription();
1511
+ this.expectKeyword("schema");
1512
+ let i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1513
+ return this.node(t, {
1514
+ kind: c.SCHEMA_DEFINITION,
1515
+ description: n,
1516
+ directives: i,
1517
+ operationTypes: r
1518
+ });
1519
+ }
1520
+ parseOperationTypeDefinition() {
1521
+ let t = this._lexer.token, n = this.parseOperationType();
1522
+ this.expectToken(o.COLON);
1523
+ let i = this.parseNamedType();
1524
+ return this.node(t, {
1525
+ kind: c.OPERATION_TYPE_DEFINITION,
1526
+ operation: n,
1527
+ type: i
1528
+ });
1529
+ }
1530
+ parseScalarTypeDefinition() {
1531
+ let t = this._lexer.token, n = this.parseDescription();
1532
+ this.expectKeyword("scalar");
1533
+ let i = this.parseName(), r = this.parseConstDirectives();
1534
+ return this.node(t, {
1535
+ kind: c.SCALAR_TYPE_DEFINITION,
1536
+ description: n,
1537
+ name: i,
1538
+ directives: r
1539
+ });
1540
+ }
1541
+ parseObjectTypeDefinition() {
1542
+ let t = this._lexer.token, n = this.parseDescription();
1543
+ this.expectKeyword("type");
1544
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1545
+ return this.node(t, {
1546
+ kind: c.OBJECT_TYPE_DEFINITION,
1547
+ description: n,
1548
+ name: i,
1549
+ interfaces: r,
1550
+ directives: s,
1551
+ fields: a
1552
+ });
1553
+ }
1554
+ parseImplementsInterfaces() {
1555
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
1556
+ }
1557
+ parseFieldsDefinition() {
1558
+ return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
1559
+ }
1560
+ parseFieldDefinition() {
1561
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1562
+ this.expectToken(o.COLON);
1563
+ let s = this.parseTypeReference(), a = this.parseConstDirectives();
1564
+ return this.node(t, {
1565
+ kind: c.FIELD_DEFINITION,
1566
+ description: n,
1567
+ name: i,
1568
+ arguments: r,
1569
+ type: s,
1570
+ directives: a
1571
+ });
1572
+ }
1573
+ parseArgumentDefs() {
1574
+ return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
1575
+ }
1576
+ parseInputValueDef() {
1577
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1578
+ this.expectToken(o.COLON);
1579
+ let r = this.parseTypeReference(), s;
1580
+ this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
1581
+ let a = this.parseConstDirectives();
1582
+ return this.node(t, {
1583
+ kind: c.INPUT_VALUE_DEFINITION,
1584
+ description: n,
1585
+ name: i,
1586
+ type: r,
1587
+ defaultValue: s,
1588
+ directives: a
1589
+ });
1590
+ }
1591
+ parseInterfaceTypeDefinition() {
1592
+ let t = this._lexer.token, n = this.parseDescription();
1593
+ this.expectKeyword("interface");
1594
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1595
+ return this.node(t, {
1596
+ kind: c.INTERFACE_TYPE_DEFINITION,
1597
+ description: n,
1598
+ name: i,
1599
+ interfaces: r,
1600
+ directives: s,
1601
+ fields: a
1602
+ });
1603
+ }
1604
+ parseUnionTypeDefinition() {
1605
+ let t = this._lexer.token, n = this.parseDescription();
1606
+ this.expectKeyword("union");
1607
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1608
+ return this.node(t, {
1609
+ kind: c.UNION_TYPE_DEFINITION,
1610
+ description: n,
1611
+ name: i,
1612
+ directives: r,
1613
+ types: s
1614
+ });
1615
+ }
1616
+ parseUnionMemberTypes() {
1617
+ return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1618
+ }
1619
+ parseEnumTypeDefinition() {
1620
+ let t = this._lexer.token, n = this.parseDescription();
1621
+ this.expectKeyword("enum");
1622
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1623
+ return this.node(t, {
1624
+ kind: c.ENUM_TYPE_DEFINITION,
1625
+ description: n,
1626
+ name: i,
1627
+ directives: r,
1628
+ values: s
1629
+ });
1630
+ }
1631
+ parseEnumValuesDefinition() {
1632
+ return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
1633
+ }
1634
+ parseEnumValueDefinition() {
1635
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1636
+ return this.node(t, {
1637
+ kind: c.ENUM_VALUE_DEFINITION,
1638
+ description: n,
1639
+ name: i,
1640
+ directives: r
1641
+ });
1642
+ }
1643
+ parseEnumValueName() {
1644
+ if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw d(this._lexer.source, this._lexer.token.start, `${oe(this._lexer.token)} is reserved and cannot be used for an enum value.`);
1645
+ return this.parseName();
1646
+ }
1647
+ parseInputObjectTypeDefinition() {
1648
+ let t = this._lexer.token, n = this.parseDescription();
1649
+ this.expectKeyword("input");
1650
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1651
+ return this.node(t, {
1652
+ kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1653
+ description: n,
1654
+ name: i,
1655
+ directives: r,
1656
+ fields: s
1657
+ });
1658
+ }
1659
+ parseInputFieldsDefinition() {
1660
+ return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
1661
+ }
1662
+ parseTypeSystemExtension() {
1663
+ let t = this._lexer.lookahead();
1664
+ if (t.kind === o.NAME) switch (t.value) {
1665
+ case "schema": return this.parseSchemaExtension();
1666
+ case "scalar": return this.parseScalarTypeExtension();
1667
+ case "type": return this.parseObjectTypeExtension();
1668
+ case "interface": return this.parseInterfaceTypeExtension();
1669
+ case "union": return this.parseUnionTypeExtension();
1670
+ case "enum": return this.parseEnumTypeExtension();
1671
+ case "input": return this.parseInputObjectTypeExtension();
1672
+ }
1673
+ throw this.unexpected(t);
1674
+ }
1675
+ parseSchemaExtension() {
1676
+ let t = this._lexer.token;
1677
+ this.expectKeyword("extend"), this.expectKeyword("schema");
1678
+ let n = this.parseConstDirectives(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1679
+ if (n.length === 0 && i.length === 0) throw this.unexpected();
1680
+ return this.node(t, {
1681
+ kind: c.SCHEMA_EXTENSION,
1682
+ directives: n,
1683
+ operationTypes: i
1684
+ });
1685
+ }
1686
+ parseScalarTypeExtension() {
1687
+ let t = this._lexer.token;
1688
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1689
+ let n = this.parseName(), i = this.parseConstDirectives();
1690
+ if (i.length === 0) throw this.unexpected();
1691
+ return this.node(t, {
1692
+ kind: c.SCALAR_TYPE_EXTENSION,
1693
+ name: n,
1694
+ directives: i
1695
+ });
1696
+ }
1697
+ parseObjectTypeExtension() {
1698
+ let t = this._lexer.token;
1699
+ this.expectKeyword("extend"), this.expectKeyword("type");
1700
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1701
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1702
+ return this.node(t, {
1703
+ kind: c.OBJECT_TYPE_EXTENSION,
1704
+ name: n,
1705
+ interfaces: i,
1706
+ directives: r,
1707
+ fields: s
1708
+ });
1709
+ }
1710
+ parseInterfaceTypeExtension() {
1711
+ let t = this._lexer.token;
1712
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1713
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1714
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1715
+ return this.node(t, {
1716
+ kind: c.INTERFACE_TYPE_EXTENSION,
1717
+ name: n,
1718
+ interfaces: i,
1719
+ directives: r,
1720
+ fields: s
1721
+ });
1722
+ }
1723
+ parseUnionTypeExtension() {
1724
+ let t = this._lexer.token;
1725
+ this.expectKeyword("extend"), this.expectKeyword("union");
1726
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1727
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1728
+ return this.node(t, {
1729
+ kind: c.UNION_TYPE_EXTENSION,
1730
+ name: n,
1731
+ directives: i,
1732
+ types: r
1733
+ });
1734
+ }
1735
+ parseEnumTypeExtension() {
1736
+ let t = this._lexer.token;
1737
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1738
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1739
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1740
+ return this.node(t, {
1741
+ kind: c.ENUM_TYPE_EXTENSION,
1742
+ name: n,
1743
+ directives: i,
1744
+ values: r
1745
+ });
1746
+ }
1747
+ parseInputObjectTypeExtension() {
1748
+ let t = this._lexer.token;
1749
+ this.expectKeyword("extend"), this.expectKeyword("input");
1750
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1751
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1752
+ return this.node(t, {
1753
+ kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1754
+ name: n,
1755
+ directives: i,
1756
+ fields: r
1757
+ });
1758
+ }
1759
+ parseDirectiveDefinition() {
1760
+ let t = this._lexer.token, n = this.parseDescription();
1761
+ this.expectKeyword("directive"), this.expectToken(o.AT);
1762
+ let i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1763
+ this.expectKeyword("on");
1764
+ let a = this.parseDirectiveLocations();
1765
+ return this.node(t, {
1766
+ kind: c.DIRECTIVE_DEFINITION,
1767
+ description: n,
1768
+ name: i,
1769
+ arguments: r,
1770
+ repeatable: s,
1771
+ locations: a
1772
+ });
1773
+ }
1774
+ parseDirectiveLocations() {
1775
+ return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
1776
+ }
1777
+ parseDirectiveLocation() {
1778
+ let t = this._lexer.token, n = this.parseName();
1779
+ if (Object.prototype.hasOwnProperty.call(ee, n.value)) return n;
1780
+ throw this.unexpected(t);
1781
+ }
1782
+ node(t, n) {
1783
+ return this._options.noLocation !== !0 && (n.loc = new Q(t, this._lexer.lastToken, this._lexer.source)), n;
1784
+ }
1785
+ peek(t) {
1786
+ return this._lexer.token.kind === t;
1787
+ }
1788
+ expectToken(t) {
1789
+ let n = this._lexer.token;
1790
+ if (n.kind === t) return this.advanceLexer(), n;
1791
+ throw d(this._lexer.source, n.start, `Expected ${dt(t)}, found ${oe(n)}.`);
1792
+ }
1793
+ expectOptionalToken(t) {
1794
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
1795
+ }
1796
+ expectKeyword(t) {
1797
+ let n = this._lexer.token;
1798
+ if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1799
+ else throw d(this._lexer.source, n.start, `Expected "${t}", found ${oe(n)}.`);
1800
+ }
1801
+ expectOptionalKeyword(t) {
1802
+ let n = this._lexer.token;
1803
+ return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1804
+ }
1805
+ unexpected(t) {
1806
+ let n = t ?? this._lexer.token;
1807
+ return d(this._lexer.source, n.start, `Unexpected ${oe(n)}.`);
1808
+ }
1809
+ any(t, n, i) {
1810
+ this.expectToken(t);
1811
+ let r = [];
1812
+ for (; !this.expectOptionalToken(i);) r.push(n.call(this));
1813
+ return r;
1814
+ }
1815
+ optionalMany(t, n, i) {
1816
+ if (this.expectOptionalToken(t)) {
1817
+ let r = [];
1818
+ do
1819
+ r.push(n.call(this));
1820
+ while (!this.expectOptionalToken(i));
1821
+ return r;
1822
+ }
1823
+ return [];
1824
+ }
1825
+ many(t, n, i) {
1826
+ this.expectToken(t);
1827
+ let r = [];
1828
+ do
1829
+ r.push(n.call(this));
1830
+ while (!this.expectOptionalToken(i));
1831
+ return r;
1832
+ }
1833
+ delimitedMany(t, n) {
1834
+ this.expectOptionalToken(t);
1835
+ let i = [];
1836
+ do
1837
+ i.push(n.call(this));
1838
+ while (this.expectOptionalToken(t));
1839
+ return i;
1840
+ }
1841
+ advanceLexer() {
1842
+ let { maxTokens: t } = this._options, n = this._lexer.advance();
1843
+ if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw d(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
1844
+ }
1845
+ };
1846
+ function oe(e) {
1847
+ let t = e.value;
1848
+ return dt(e.kind) + (t != null ? ` "${t}"` : "");
1849
+ }
1850
+ function dt(e) {
1851
+ return ct(e) ? `"${e}"` : e;
1852
+ }
1853
+ function sn(e, t) {
1854
+ let n = /* @__PURE__ */ new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1855
+ return Object.assign(n, t);
1856
+ }
1857
+ var mt = sn;
1858
+ function on(e) {
1859
+ let t = [], { startToken: n, endToken: i } = e.loc;
1860
+ for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({
1861
+ ...r,
1862
+ loc: {
1863
+ start: r.start,
1864
+ end: r.end
1865
+ }
1866
+ });
1867
+ return t;
1868
+ }
1869
+ var an = { allowLegacyFragmentVariables: !0 };
1870
+ function cn(e) {
1871
+ if ((e == null ? void 0 : e.name) === "GraphQLError") {
1872
+ let { message: t, locations: [n] } = e;
1873
+ return mt(t, {
1874
+ loc: { start: n },
1875
+ cause: e
1876
+ });
1877
+ }
1878
+ return e;
1879
+ }
1880
+ function un(e) {
1881
+ let t;
1882
+ try {
1883
+ t = ht(e, an);
1884
+ } catch (n) {
1885
+ throw cn(n);
1886
+ }
1887
+ return t.comments = on(t), t;
1888
+ }
1889
+ var ln = {
1890
+ parse: un,
1891
+ astFormat: "graphql",
1892
+ hasPragma: je,
1893
+ hasIgnorePragma: $e,
1894
+ locStart: K,
1895
+ locEnd: z
1896
+ };
1897
+ var pn = { graphql: qe };
1898
+ var Ui = Ne;
1899
+
1900
+ //#endregion
1901
+ export { Ui as default, Qe as languages, Ke as options, _e as parsers, pn as printers };
1902
+ //# sourceMappingURL=graphql-DWNpg5AH.js.map