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