@kubb/core 4.3.1 → 4.4.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 (128) hide show
  1. package/dist/{URLPath-BYceu_vY.js → URLPath-Bpc_OJmh.js} +2 -3
  2. package/dist/{URLPath-BYceu_vY.js.map → URLPath-Bpc_OJmh.js.map} +1 -1
  3. package/dist/{URLPath-8WVzHBnA.cjs → URLPath-Bu6Wkco7.cjs} +6 -7
  4. package/dist/{URLPath-8WVzHBnA.cjs.map → URLPath-Bu6Wkco7.cjs.map} +1 -1
  5. package/dist/{chunk-CZg_9w7l.cjs → chunk-CUT6urMc.cjs} +0 -23
  6. package/dist/{fs-RSVoUw3S.cjs → fs-CM7ohZSu.cjs} +2 -2
  7. package/dist/{fs-RSVoUw3S.cjs.map → fs-CM7ohZSu.cjs.map} +1 -1
  8. package/dist/fs.cjs +2 -2
  9. package/dist/fs.d.ts +1 -1
  10. package/dist/hooks.cjs +6 -6
  11. package/dist/hooks.cjs.map +1 -1
  12. package/dist/hooks.d.cts +1 -1
  13. package/dist/hooks.d.ts +4 -4
  14. package/dist/hooks.js +1 -1
  15. package/dist/hooks.js.map +1 -1
  16. package/dist/{index-BTe91LHd.d.ts → index-DdO15F70.d.ts} +2 -3
  17. package/dist/index.cjs +46 -53
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +15 -11
  20. package/dist/index.d.ts +18 -14
  21. package/dist/index.js +40 -48
  22. package/dist/index.js.map +1 -1
  23. package/dist/{logger-BXL0YCrv.cjs → logger-C7JFdYpj.cjs} +4 -4
  24. package/dist/{logger-BXL0YCrv.cjs.map → logger-C7JFdYpj.cjs.map} +1 -1
  25. package/dist/{logger-BA-za85-.d.ts → logger-D_jvWsUF.d.ts} +1 -1
  26. package/dist/{logger-CDxSrFkR.js → logger-khF_Lft4.js} +2 -2
  27. package/dist/{logger-CDxSrFkR.js.map → logger-khF_Lft4.js.map} +1 -1
  28. package/dist/logger.cjs +2 -2
  29. package/dist/logger.d.ts +1 -1
  30. package/dist/logger.js +1 -1
  31. package/dist/{prompt-DBVnG4Me.js → prompt-CIpZjUDy.js} +1 -1
  32. package/dist/{prompt-DBVnG4Me.js.map → prompt-CIpZjUDy.js.map} +1 -1
  33. package/dist/{prompt-DgONOpPH.cjs → prompt-CgJLZzbf.cjs} +2 -2
  34. package/dist/{prompt-DgONOpPH.cjs.map → prompt-CgJLZzbf.cjs.map} +1 -1
  35. package/dist/transformers-BN5jfIAt.js +339 -0
  36. package/dist/transformers-BN5jfIAt.js.map +1 -0
  37. package/dist/transformers-BpnIvSiH.cjs +443 -0
  38. package/dist/transformers-BpnIvSiH.cjs.map +1 -0
  39. package/dist/transformers.cjs +7 -6
  40. package/dist/transformers.js +1 -3
  41. package/dist/{types-DPeNK0FO.d.ts → types-CCUiy4jG.d.ts} +43 -45
  42. package/dist/{types-BzI9JlV8.d.ts → types-ClXc6HFo.d.ts} +1 -1
  43. package/dist/{types-DNxlynJr.d.cts → types-EV6-sImo.d.cts} +40 -42
  44. package/dist/utils.cjs +7 -7
  45. package/dist/utils.cjs.map +1 -1
  46. package/dist/utils.d.ts +1 -1
  47. package/dist/utils.js +4 -6
  48. package/dist/utils.js.map +1 -1
  49. package/dist/{write-BJfM7G1_.cjs → write-BsFt8M9e.cjs} +2 -2
  50. package/dist/{write-BJfM7G1_.cjs.map → write-BsFt8M9e.cjs.map} +1 -1
  51. package/package.json +8 -14
  52. package/src/PluginManager.ts +3 -7
  53. package/src/build.ts +37 -41
  54. package/src/hooks/useMode.ts +1 -1
  55. package/src/hooks/usePlugin.ts +1 -1
  56. package/src/hooks/usePluginManager.ts +1 -1
  57. package/src/plugin.ts +10 -5
  58. package/src/types.ts +2 -1
  59. package/dist/acorn-BAVXZMtK.cjs +0 -5082
  60. package/dist/acorn-BAVXZMtK.cjs.map +0 -1
  61. package/dist/acorn-D-VhIOLw.js +0 -5080
  62. package/dist/acorn-D-VhIOLw.js.map +0 -1
  63. package/dist/angular-Bp0XO9db.cjs +0 -3631
  64. package/dist/angular-Bp0XO9db.cjs.map +0 -1
  65. package/dist/angular-Czhp4eq5.js +0 -3629
  66. package/dist/angular-Czhp4eq5.js.map +0 -1
  67. package/dist/babel-DCR_B4Qn.js +0 -10033
  68. package/dist/babel-DCR_B4Qn.js.map +0 -1
  69. package/dist/babel-NI0v59ga.cjs +0 -10035
  70. package/dist/babel-NI0v59ga.cjs.map +0 -1
  71. package/dist/casing-BSeq_teY.js +0 -100
  72. package/dist/casing-BSeq_teY.js.map +0 -1
  73. package/dist/casing-CP-9GGdK.cjs +0 -112
  74. package/dist/casing-CP-9GGdK.cjs.map +0 -1
  75. package/dist/chunk-1SJ2vVWa.js +0 -35
  76. package/dist/estree-C3BZPlpU.cjs +0 -6930
  77. package/dist/estree-C3BZPlpU.cjs.map +0 -1
  78. package/dist/estree-DU2NummP.js +0 -6926
  79. package/dist/estree-DU2NummP.js.map +0 -1
  80. package/dist/flow-CWUBUkoi.cjs +0 -52252
  81. package/dist/flow-CWUBUkoi.cjs.map +0 -1
  82. package/dist/flow-JiEbweKj.js +0 -52250
  83. package/dist/flow-JiEbweKj.js.map +0 -1
  84. package/dist/glimmer-CX9OqG1j.cjs +0 -7275
  85. package/dist/glimmer-CX9OqG1j.cjs.map +0 -1
  86. package/dist/glimmer-t9nWn9aE.js +0 -7271
  87. package/dist/glimmer-t9nWn9aE.js.map +0 -1
  88. package/dist/graphql-DjErlIi5.js +0 -1897
  89. package/dist/graphql-DjErlIi5.js.map +0 -1
  90. package/dist/graphql-GOxQAKxM.cjs +0 -1902
  91. package/dist/graphql-GOxQAKxM.cjs.map +0 -1
  92. package/dist/html-CWrdYAhQ.cjs +0 -6560
  93. package/dist/html-CWrdYAhQ.cjs.map +0 -1
  94. package/dist/html-_apcbx34.js +0 -6555
  95. package/dist/html-_apcbx34.js.map +0 -1
  96. package/dist/markdown-ckUc3Q6q.js +0 -6750
  97. package/dist/markdown-ckUc3Q6q.js.map +0 -1
  98. package/dist/markdown-pzqiRmft.cjs +0 -6755
  99. package/dist/markdown-pzqiRmft.cjs.map +0 -1
  100. package/dist/meriyah-BjnGqpUs.js +0 -8928
  101. package/dist/meriyah-BjnGqpUs.js.map +0 -1
  102. package/dist/meriyah-D_x7itbT.cjs +0 -8930
  103. package/dist/meriyah-D_x7itbT.cjs.map +0 -1
  104. package/dist/mocks.cjs +0 -16830
  105. package/dist/mocks.cjs.map +0 -1
  106. package/dist/mocks.d.cts +0 -13
  107. package/dist/mocks.d.ts +0 -13
  108. package/dist/mocks.js +0 -16818
  109. package/dist/mocks.js.map +0 -1
  110. package/dist/postcss-B_c2wbFu.cjs +0 -6689
  111. package/dist/postcss-B_c2wbFu.cjs.map +0 -1
  112. package/dist/postcss-v7BP6SZ-.js +0 -6684
  113. package/dist/postcss-v7BP6SZ-.js.map +0 -1
  114. package/dist/transformers-BH0KLJJP.cjs +0 -804
  115. package/dist/transformers-BH0KLJJP.cjs.map +0 -1
  116. package/dist/transformers-DzHGqYO2.js +0 -702
  117. package/dist/transformers-DzHGqYO2.js.map +0 -1
  118. package/dist/typescript-6kMN6Wqz.cjs +0 -23014
  119. package/dist/typescript-6kMN6Wqz.cjs.map +0 -1
  120. package/dist/typescript-B_IBfKSe.js +0 -23002
  121. package/dist/typescript-B_IBfKSe.js.map +0 -1
  122. package/dist/typescript-C5hce4HG.cjs +0 -4
  123. package/dist/typescript-Cas1XcNz.js +0 -3
  124. package/dist/yaml-BfWM_B73.js +0 -5209
  125. package/dist/yaml-BfWM_B73.js.map +0 -1
  126. package/dist/yaml-DZs6MhV1.cjs +0 -5215
  127. package/dist/yaml-DZs6MhV1.cjs.map +0 -1
  128. package/src/mocks/index.ts +0 -82
@@ -1,1902 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/graphql.mjs
3
- var Et = Object.defineProperty;
4
- var xe = (e, t) => {
5
- for (var n in t) Et(e, n, {
6
- get: t[n],
7
- enumerable: !0
8
- });
9
- };
10
- var Ne = {};
11
- xe(Ne, {
12
- languages: () => Qe,
13
- options: () => Ke,
14
- parsers: () => _e,
15
- printers: () => pn
16
- });
17
- var Tt = (e, t, n, i) => {
18
- if (!(e && t == null)) return t.replaceAll ? t.replaceAll(n, i) : n.global ? t.replace(n, i) : t.split(n).join(i);
19
- }, G = Tt;
20
- var j = "indent";
21
- var $ = "group";
22
- var w = "if-break";
23
- var S = "line";
24
- var X = "break-parent";
25
- var Re = () => {}, L = Re, le = Re;
26
- function N(e) {
27
- return L(e), {
28
- type: j,
29
- contents: e
30
- };
31
- }
32
- function y(e, t = {}) {
33
- return L(e), le(t.expandedStates, !0), {
34
- type: $,
35
- id: t.id,
36
- contents: e,
37
- break: !!t.shouldBreak,
38
- expandedStates: t.expandedStates
39
- };
40
- }
41
- function I(e, t = "", n = {}) {
42
- return L(e), t !== "" && L(t), {
43
- type: w,
44
- breakContents: e,
45
- flatContents: t,
46
- groupId: n.groupId
47
- };
48
- }
49
- var yt = { type: X };
50
- var Ot = {
51
- type: S,
52
- hard: !0
53
- };
54
- var k = { type: S }, p = {
55
- type: S,
56
- soft: !0
57
- }, f = [Ot, yt];
58
- function E(e, t) {
59
- L(e), le(t);
60
- let n = [];
61
- for (let i = 0; i < t.length; i++) i !== 0 && n.push(e), n.push(t[i]);
62
- return n;
63
- }
64
- function H(e) {
65
- return (t, n, i) => {
66
- let r = !!(i != null && i.backwards);
67
- if (n === !1) return !1;
68
- let { length: s } = t, a = n;
69
- for (; a >= 0 && a < s;) {
70
- let u = t.charAt(a);
71
- if (e instanceof RegExp) {
72
- if (!e.test(u)) return a;
73
- } else if (!e.includes(u)) return a;
74
- r ? a-- : a++;
75
- }
76
- return a === -1 || a === s ? a : !1;
77
- };
78
- }
79
- H(/\s/u);
80
- var J = H(" "), ve = H(",; "), Le = H(/[^\n\r]/u);
81
- function It(e, t, n) {
82
- let i = !!(n != null && n.backwards);
83
- if (t === !1) return !1;
84
- let r = e.charAt(t);
85
- if (i) {
86
- if (e.charAt(t - 1) === "\r" && r === `
87
- `) return t - 2;
88
- if (r === `
89
- ` || r === "\r" || r === "\u2028" || r === "\u2029") return t - 1;
90
- } else {
91
- if (r === "\r" && e.charAt(t + 1) === `
92
- `) return t + 2;
93
- if (r === `
94
- ` || r === "\r" || r === "\u2028" || r === "\u2029") return t + 1;
95
- }
96
- return t;
97
- }
98
- var q = It;
99
- function At(e, t, n = {}) {
100
- let i = J(e, n.backwards ? t - 1 : t, n);
101
- return i !== q(e, i, n);
102
- }
103
- var be = At;
104
- function Dt(e, t) {
105
- if (t === !1) return !1;
106
- if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
107
- for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
108
- }
109
- return t;
110
- }
111
- var Pe = Dt;
112
- function gt(e, t) {
113
- return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Le(e, t) : t;
114
- }
115
- var we = gt;
116
- function kt(e, t) {
117
- let n = null, i = t;
118
- for (; i !== n;) n = i, i = ve(e, i), i = Pe(e, i), i = J(e, i);
119
- return i = we(e, i), i = q(e, i), i !== !1 && be(e, i);
120
- }
121
- var Fe = kt;
122
- function St(e) {
123
- return Array.isArray(e) && e.length > 0;
124
- }
125
- var pe = St;
126
- var fe = class extends Error {
127
- name = "UnexpectedNodeError";
128
- constructor(t, n, i = "type") {
129
- super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
130
- }
131
- }, Be = fe;
132
- var F = null;
133
- function B(e) {
134
- if (F !== null && typeof F.property) {
135
- let t = F;
136
- return F = B.prototype = null, t;
137
- }
138
- return F = B.prototype = e ?? Object.create(null), new B();
139
- }
140
- var Ct = 10;
141
- for (let e = 0; e <= Ct; e++) B();
142
- function he(e) {
143
- return B(e);
144
- }
145
- function Rt(e, t = "type") {
146
- he(e);
147
- function n(i) {
148
- let r = i[t], s = e[r];
149
- if (!Array.isArray(s)) throw Object.assign(/* @__PURE__ */ new Error(`Missing visitor keys for '${r}'.`), { node: i });
150
- return s;
151
- }
152
- return n;
153
- }
154
- var Ue = Rt, Q = class {
155
- constructor(t, n, i) {
156
- this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
157
- }
158
- get [Symbol.toStringTag]() {
159
- return "Location";
160
- }
161
- toJSON() {
162
- return {
163
- start: this.start,
164
- end: this.end
165
- };
166
- }
167
- }, U = class {
168
- constructor(t, n, i, r, s, a) {
169
- this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
170
- }
171
- get [Symbol.toStringTag]() {
172
- return "Token";
173
- }
174
- toJSON() {
175
- return {
176
- kind: this.kind,
177
- value: this.value,
178
- line: this.line,
179
- column: this.column
180
- };
181
- }
182
- }, W = {
183
- Name: [],
184
- Document: ["definitions"],
185
- OperationDefinition: [
186
- "name",
187
- "variableDefinitions",
188
- "directives",
189
- "selectionSet"
190
- ],
191
- VariableDefinition: [
192
- "variable",
193
- "type",
194
- "defaultValue",
195
- "directives"
196
- ],
197
- Variable: ["name"],
198
- SelectionSet: ["selections"],
199
- Field: [
200
- "alias",
201
- "name",
202
- "arguments",
203
- "directives",
204
- "selectionSet"
205
- ],
206
- Argument: ["name", "value"],
207
- FragmentSpread: ["name", "directives"],
208
- InlineFragment: [
209
- "typeCondition",
210
- "directives",
211
- "selectionSet"
212
- ],
213
- FragmentDefinition: [
214
- "name",
215
- "variableDefinitions",
216
- "typeCondition",
217
- "directives",
218
- "selectionSet"
219
- ],
220
- IntValue: [],
221
- FloatValue: [],
222
- StringValue: [],
223
- BooleanValue: [],
224
- NullValue: [],
225
- EnumValue: [],
226
- ListValue: ["values"],
227
- ObjectValue: ["fields"],
228
- ObjectField: ["name", "value"],
229
- Directive: ["name", "arguments"],
230
- NamedType: ["name"],
231
- ListType: ["type"],
232
- NonNullType: ["type"],
233
- SchemaDefinition: [
234
- "description",
235
- "directives",
236
- "operationTypes"
237
- ],
238
- OperationTypeDefinition: ["type"],
239
- ScalarTypeDefinition: [
240
- "description",
241
- "name",
242
- "directives"
243
- ],
244
- ObjectTypeDefinition: [
245
- "description",
246
- "name",
247
- "interfaces",
248
- "directives",
249
- "fields"
250
- ],
251
- FieldDefinition: [
252
- "description",
253
- "name",
254
- "arguments",
255
- "type",
256
- "directives"
257
- ],
258
- InputValueDefinition: [
259
- "description",
260
- "name",
261
- "type",
262
- "defaultValue",
263
- "directives"
264
- ],
265
- InterfaceTypeDefinition: [
266
- "description",
267
- "name",
268
- "interfaces",
269
- "directives",
270
- "fields"
271
- ],
272
- UnionTypeDefinition: [
273
- "description",
274
- "name",
275
- "directives",
276
- "types"
277
- ],
278
- EnumTypeDefinition: [
279
- "description",
280
- "name",
281
- "directives",
282
- "values"
283
- ],
284
- EnumValueDefinition: [
285
- "description",
286
- "name",
287
- "directives"
288
- ],
289
- InputObjectTypeDefinition: [
290
- "description",
291
- "name",
292
- "directives",
293
- "fields"
294
- ],
295
- DirectiveDefinition: [
296
- "description",
297
- "name",
298
- "arguments",
299
- "locations"
300
- ],
301
- SchemaExtension: ["directives", "operationTypes"],
302
- ScalarTypeExtension: ["name", "directives"],
303
- ObjectTypeExtension: [
304
- "name",
305
- "interfaces",
306
- "directives",
307
- "fields"
308
- ],
309
- InterfaceTypeExtension: [
310
- "name",
311
- "interfaces",
312
- "directives",
313
- "fields"
314
- ],
315
- UnionTypeExtension: [
316
- "name",
317
- "directives",
318
- "types"
319
- ],
320
- EnumTypeExtension: [
321
- "name",
322
- "directives",
323
- "values"
324
- ],
325
- InputObjectTypeExtension: [
326
- "name",
327
- "directives",
328
- "fields"
329
- ]
330
- };
331
- var C;
332
- (function(e) {
333
- e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
334
- })(C || (C = {}));
335
- var Me = Ue(W, "kind");
336
- function K(e) {
337
- return e.loc.start;
338
- }
339
- function z(e) {
340
- return e.loc.end;
341
- }
342
- var Ve = "format", Ye = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, Ge = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
343
- function je(e) {
344
- return Ge.test(e);
345
- }
346
- function $e(e) {
347
- return Ye.test(e);
348
- }
349
- function Xe(e) {
350
- return `# @${Ve}
351
-
352
- ${e}`;
353
- }
354
- function Lt(e, t, n) {
355
- let { node: i } = e;
356
- if (!i.description) return "";
357
- let r = [n("description")];
358
- return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
359
- }
360
- var D = Lt;
361
- function bt(e, t, n) {
362
- let { node: i } = e;
363
- switch (i.kind) {
364
- case "Document": return [...E(f, g(e, t, n, "definitions")), f];
365
- case "OperationDefinition": {
366
- let r = t.originalText[K(i)] !== "{", s = !!i.name;
367
- return [
368
- r ? i.operation : "",
369
- r && s ? [" ", n("name")] : "",
370
- r && !s && pe(i.variableDefinitions) ? " " : "",
371
- He(e, n),
372
- x(e, n, i),
373
- !r && !s ? "" : " ",
374
- n("selectionSet")
375
- ];
376
- }
377
- case "FragmentDefinition": return [
378
- "fragment ",
379
- n("name"),
380
- He(e, n),
381
- " on ",
382
- n("typeCondition"),
383
- x(e, n, i),
384
- " ",
385
- n("selectionSet")
386
- ];
387
- case "SelectionSet": return [
388
- "{",
389
- N([f, E(f, g(e, t, n, "selections"))]),
390
- f,
391
- "}"
392
- ];
393
- case "Field": return y([
394
- i.alias ? [n("alias"), ": "] : "",
395
- n("name"),
396
- i.arguments.length > 0 ? y([
397
- "(",
398
- N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
399
- p,
400
- ")"
401
- ]) : "",
402
- x(e, n, i),
403
- i.selectionSet ? " " : "",
404
- n("selectionSet")
405
- ]);
406
- case "Name": return i.value;
407
- case "StringValue":
408
- if (i.block) {
409
- let r = G(!1, i.value, "\"\"\"", String.raw`\"""`).split(`
410
- `);
411
- return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, [
412
- "\"\"\"",
413
- ...r,
414
- "\"\"\""
415
- ]);
416
- }
417
- return [
418
- "\"",
419
- G(!1, G(!1, i.value, /["\\]/gu, String.raw`\$&`), `
420
- `, String.raw`\n`),
421
- "\""
422
- ];
423
- case "IntValue":
424
- case "FloatValue":
425
- case "EnumValue": return i.value;
426
- case "BooleanValue": return i.value ? "true" : "false";
427
- case "NullValue": return "null";
428
- case "Variable": return ["$", n("name")];
429
- case "ListValue": return y([
430
- "[",
431
- N([p, E([I("", ", "), p], e.map(n, "values"))]),
432
- p,
433
- "]"
434
- ]);
435
- case "ObjectValue": {
436
- let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
437
- return y([
438
- "{",
439
- r,
440
- N([p, E([I("", ", "), p], e.map(n, "fields"))]),
441
- p,
442
- I("", r),
443
- "}"
444
- ]);
445
- }
446
- case "ObjectField":
447
- case "Argument": return [
448
- n("name"),
449
- ": ",
450
- n("value")
451
- ];
452
- case "Directive": return [
453
- "@",
454
- n("name"),
455
- i.arguments.length > 0 ? y([
456
- "(",
457
- N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
458
- p,
459
- ")"
460
- ]) : ""
461
- ];
462
- case "NamedType": return n("name");
463
- case "VariableDefinition": return [
464
- n("variable"),
465
- ": ",
466
- n("type"),
467
- i.defaultValue ? [" = ", n("defaultValue")] : "",
468
- x(e, n, i)
469
- ];
470
- case "ObjectTypeExtension":
471
- case "ObjectTypeDefinition":
472
- case "InputObjectTypeExtension":
473
- case "InputObjectTypeDefinition":
474
- case "InterfaceTypeExtension":
475
- case "InterfaceTypeDefinition": {
476
- let { kind: r } = i, s = [];
477
- 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([
478
- " {",
479
- N([f, E(f, g(e, t, n, "fields"))]),
480
- f,
481
- "}"
482
- ]), s;
483
- }
484
- case "FieldDefinition": return [
485
- D(e, t, n),
486
- n("name"),
487
- i.arguments.length > 0 ? y([
488
- "(",
489
- N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
490
- p,
491
- ")"
492
- ]) : "",
493
- ": ",
494
- n("type"),
495
- x(e, n, i)
496
- ];
497
- case "DirectiveDefinition": return [
498
- D(e, t, n),
499
- "directive ",
500
- "@",
501
- n("name"),
502
- i.arguments.length > 0 ? y([
503
- "(",
504
- N([p, E([I("", ", "), p], g(e, t, n, "arguments"))]),
505
- p,
506
- ")"
507
- ]) : "",
508
- i.repeatable ? " repeatable" : "",
509
- " on ",
510
- ...E(" | ", e.map(n, "locations"))
511
- ];
512
- case "EnumTypeExtension":
513
- case "EnumTypeDefinition": return [
514
- D(e, t, n),
515
- i.kind === "EnumTypeExtension" ? "extend " : "",
516
- "enum ",
517
- n("name"),
518
- x(e, n, i),
519
- i.values.length > 0 ? [
520
- " {",
521
- N([f, E(f, g(e, t, n, "values"))]),
522
- f,
523
- "}"
524
- ] : ""
525
- ];
526
- case "EnumValueDefinition": return [
527
- D(e, t, n),
528
- n("name"),
529
- x(e, n, i)
530
- ];
531
- case "InputValueDefinition": return [
532
- D(e, t, n),
533
- n("name"),
534
- ": ",
535
- n("type"),
536
- i.defaultValue ? [" = ", n("defaultValue")] : "",
537
- x(e, n, i)
538
- ];
539
- case "SchemaExtension": return [
540
- "extend schema",
541
- x(e, n, i),
542
- ...i.operationTypes.length > 0 ? [
543
- " {",
544
- N([f, E(f, g(e, t, n, "operationTypes"))]),
545
- f,
546
- "}"
547
- ] : []
548
- ];
549
- case "SchemaDefinition": return [
550
- D(e, t, n),
551
- "schema",
552
- x(e, n, i),
553
- " {",
554
- i.operationTypes.length > 0 ? N([f, E(f, g(e, t, n, "operationTypes"))]) : "",
555
- f,
556
- "}"
557
- ];
558
- case "OperationTypeDefinition": return [
559
- i.operation,
560
- ": ",
561
- n("type")
562
- ];
563
- case "FragmentSpread": return [
564
- "...",
565
- n("name"),
566
- x(e, n, i)
567
- ];
568
- case "InlineFragment": return [
569
- "...",
570
- i.typeCondition ? [" on ", n("typeCondition")] : "",
571
- x(e, n, i),
572
- " ",
573
- n("selectionSet")
574
- ];
575
- case "UnionTypeExtension":
576
- case "UnionTypeDefinition": return y([D(e, t, n), y([
577
- i.kind === "UnionTypeExtension" ? "extend " : "",
578
- "union ",
579
- n("name"),
580
- x(e, n, i),
581
- i.types.length > 0 ? [
582
- " =",
583
- I("", " "),
584
- N([I([k, "| "]), E([k, "| "], e.map(n, "types"))])
585
- ] : ""
586
- ])]);
587
- case "ScalarTypeExtension":
588
- case "ScalarTypeDefinition": return [
589
- D(e, t, n),
590
- i.kind === "ScalarTypeExtension" ? "extend " : "",
591
- "scalar ",
592
- n("name"),
593
- x(e, n, i)
594
- ];
595
- case "NonNullType": return [n("type"), "!"];
596
- case "ListType": return [
597
- "[",
598
- n("type"),
599
- "]"
600
- ];
601
- default: throw new Be(i, "Graphql", "kind");
602
- }
603
- }
604
- function x(e, t, n) {
605
- if (n.directives.length === 0) return "";
606
- let i = E(k, e.map(t, "directives"));
607
- return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(N([p, i]))];
608
- }
609
- function g(e, t, n, i) {
610
- return e.map(({ isLast: r, node: s }) => {
611
- let a = n();
612
- return !r && Fe(t.originalText, z(s)) ? [a, f] : a;
613
- }, i);
614
- }
615
- function Pt(e) {
616
- return e.kind !== "Comment";
617
- }
618
- function wt(e) {
619
- let t = e.node;
620
- if (t.kind === "Comment") return "#" + t.value.trimEnd();
621
- throw new Error("Not a comment: " + JSON.stringify(t));
622
- }
623
- function Ft(e, t, n) {
624
- let { node: i } = e, r = [], { interfaces: s } = i, a = e.map(n, "interfaces");
625
- for (let u = 0; u < s.length; u++) {
626
- let l = s[u];
627
- r.push(a[u]);
628
- let T = s[u + 1];
629
- if (T) {
630
- let A = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
631
- r.push(" &", A ? k : " ");
632
- }
633
- }
634
- return r;
635
- }
636
- function He(e, t) {
637
- let { node: n } = e;
638
- return pe(n.variableDefinitions) ? y([
639
- "(",
640
- N([p, E([I("", ", "), p], e.map(t, "variableDefinitions"))]),
641
- p,
642
- ")"
643
- ]) : "";
644
- }
645
- function Je(e, t) {
646
- e.kind === "StringValue" && e.block && !e.value.includes(`
647
- `) && (t.value = e.value.trim());
648
- }
649
- Je.ignoredProperties = new Set(["loc", "comments"]);
650
- function Bt(e) {
651
- var n;
652
- let { node: t } = e;
653
- return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((i) => i.value.trim() === "prettier-ignore");
654
- }
655
- var qe = {
656
- print: bt,
657
- massageAstNode: Je,
658
- hasPrettierIgnore: Bt,
659
- insertPragma: Xe,
660
- printComment: wt,
661
- canAttachComment: Pt,
662
- getVisitorKeys: Me
663
- };
664
- var Qe = [{
665
- name: "GraphQL",
666
- type: "data",
667
- extensions: [
668
- ".graphql",
669
- ".gql",
670
- ".graphqls"
671
- ],
672
- tmScope: "source.graphql",
673
- aceMode: "text",
674
- parsers: ["graphql"],
675
- vscodeLanguageIds: ["graphql"],
676
- linguistLanguageId: 139
677
- }];
678
- var Ke = { bracketSpacing: {
679
- bracketSpacing: {
680
- category: "Common",
681
- type: "boolean",
682
- default: !0,
683
- description: "Print spaces between brackets.",
684
- oppositeDescription: "Do not print spaces between brackets."
685
- },
686
- objectWrap: {
687
- category: "Common",
688
- type: "choice",
689
- default: "preserve",
690
- description: "How to wrap object literals.",
691
- choices: [{
692
- value: "preserve",
693
- description: "Keep as multi-line, if there is a newline between the opening brace and first property."
694
- }, {
695
- value: "collapse",
696
- description: "Fit to a single line when possible."
697
- }]
698
- },
699
- singleQuote: {
700
- category: "Common",
701
- type: "boolean",
702
- default: !1,
703
- description: "Use single quotes instead of double quotes."
704
- },
705
- proseWrap: {
706
- category: "Common",
707
- type: "choice",
708
- default: "preserve",
709
- description: "How to wrap prose.",
710
- choices: [
711
- {
712
- value: "always",
713
- description: "Wrap prose if it exceeds the print width."
714
- },
715
- {
716
- value: "never",
717
- description: "Do not wrap prose."
718
- },
719
- {
720
- value: "preserve",
721
- description: "Wrap prose as-is."
722
- }
723
- ]
724
- },
725
- bracketSameLine: {
726
- category: "Common",
727
- type: "boolean",
728
- default: !1,
729
- description: "Put > of opening tags on the last line instead of on a new line."
730
- },
731
- singleAttributePerLine: {
732
- category: "Common",
733
- type: "boolean",
734
- default: !1,
735
- description: "Enforce single attribute per line in HTML, Vue and JSX."
736
- }
737
- }.bracketSpacing };
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;
943
- return new U(t, n, i, s, 1 + n - e.lineStart, 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;) if (st(n.charCodeAt(r))) ++r;
1132
- else break;
1133
- return m(e, o.NAME, t, r, n.slice(t, r));
1134
- }
1135
- function re(e, t) {
1136
- if (!!!e) throw new Error(t);
1137
- }
1138
- function ie(e) {
1139
- return se(e, []);
1140
- }
1141
- function se(e, t) {
1142
- switch (typeof e) {
1143
- case "string": return JSON.stringify(e);
1144
- case "function": return e.name ? `[function ${e.name}]` : "[function]";
1145
- case "object": return zt(e, t);
1146
- default: return String(e);
1147
- }
1148
- }
1149
- function zt(e, t) {
1150
- if (e === null) return "null";
1151
- if (t.includes(e)) return "[Circular]";
1152
- let n = [...t, e];
1153
- if (Zt(e)) {
1154
- let i = e.toJSON();
1155
- if (i !== e) return typeof i == "string" ? i : se(i, n);
1156
- } else if (Array.isArray(e)) return tn(e, n);
1157
- return en(e, n);
1158
- }
1159
- function Zt(e) {
1160
- return typeof e.toJSON == "function";
1161
- }
1162
- function en(e, t) {
1163
- let n = Object.entries(e);
1164
- return n.length === 0 ? "{}" : t.length > 2 ? "[" + nn(e) + "]" : "{ " + n.map(([r, s]) => r + ": " + se(s, t)).join(", ") + " }";
1165
- }
1166
- function tn(e, t) {
1167
- if (e.length === 0) return "[]";
1168
- if (t.length > 2) return "[Array]";
1169
- let n = Math.min(10, e.length), i = e.length - n, r = [];
1170
- for (let s = 0; s < n; ++s) r.push(se(e[s], t));
1171
- return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
1172
- }
1173
- function nn(e) {
1174
- let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
1175
- if (t === "Object" && typeof e.constructor == "function") {
1176
- let n = e.constructor.name;
1177
- if (typeof n == "string" && n !== "") return n;
1178
- }
1179
- return t;
1180
- }
1181
- var pt = globalThis.process && !0 ? function(t, n) {
1182
- return t instanceof n;
1183
- } : function(t, n) {
1184
- if (t instanceof n) return !0;
1185
- if (typeof t == "object" && t !== null) {
1186
- var i;
1187
- let r = n.prototype[Symbol.toStringTag];
1188
- if (r === (Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name)) {
1189
- let a = ie(t);
1190
- throw new Error(`Cannot use ${r} "${a}" from another module or realm.
1191
-
1192
- Ensure that there is only one instance of "graphql" in the node_modules
1193
- directory. If different versions of "graphql" are the dependencies of other
1194
- relied on modules, use "resolutions" to ensure only one version is installed.
1195
-
1196
- https://yarnpkg.com/en/docs/selective-version-resolutions
1197
-
1198
- Duplicate "graphql" modules cannot be used at the same time since different
1199
- versions may have different capabilities and behavior. The data from one
1200
- version used in the function from another could produce confusing and
1201
- spurious results.`);
1202
- }
1203
- }
1204
- return !1;
1205
- };
1206
- var Y = class {
1207
- constructor(t, n = "GraphQL request", i = {
1208
- line: 1,
1209
- column: 1
1210
- }) {
1211
- 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.");
1212
- }
1213
- get [Symbol.toStringTag]() {
1214
- return "Source";
1215
- }
1216
- };
1217
- function ft(e) {
1218
- return pt(e, Y);
1219
- }
1220
- function ht(e, t) {
1221
- let n = new Te(e, t), i = n.parseDocument();
1222
- return Object.defineProperty(i, "tokenCount", {
1223
- enumerable: !1,
1224
- value: n.tokenCount
1225
- }), i;
1226
- }
1227
- var Te = class {
1228
- constructor(t, n = {}) {
1229
- this._lexer = new te(ft(t) ? t : new Y(t)), this._options = n, this._tokenCounter = 0;
1230
- }
1231
- get tokenCount() {
1232
- return this._tokenCounter;
1233
- }
1234
- parseName() {
1235
- let t = this.expectToken(o.NAME);
1236
- return this.node(t, {
1237
- kind: c.NAME,
1238
- value: t.value
1239
- });
1240
- }
1241
- parseDocument() {
1242
- return this.node(this._lexer.token, {
1243
- kind: c.DOCUMENT,
1244
- definitions: this.many(o.SOF, this.parseDefinition, o.EOF)
1245
- });
1246
- }
1247
- parseDefinition() {
1248
- if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
1249
- let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1250
- if (n.kind === o.NAME) {
1251
- switch (n.value) {
1252
- case "schema": return this.parseSchemaDefinition();
1253
- case "scalar": return this.parseScalarTypeDefinition();
1254
- case "type": return this.parseObjectTypeDefinition();
1255
- case "interface": return this.parseInterfaceTypeDefinition();
1256
- case "union": return this.parseUnionTypeDefinition();
1257
- case "enum": return this.parseEnumTypeDefinition();
1258
- case "input": return this.parseInputObjectTypeDefinition();
1259
- case "directive": return this.parseDirectiveDefinition();
1260
- }
1261
- if (t) throw d(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions.");
1262
- switch (n.value) {
1263
- case "query":
1264
- case "mutation":
1265
- case "subscription": return this.parseOperationDefinition();
1266
- case "fragment": return this.parseFragmentDefinition();
1267
- case "extend": return this.parseTypeSystemExtension();
1268
- }
1269
- }
1270
- throw this.unexpected(n);
1271
- }
1272
- parseOperationDefinition() {
1273
- let t = this._lexer.token;
1274
- if (this.peek(o.BRACE_L)) return this.node(t, {
1275
- kind: c.OPERATION_DEFINITION,
1276
- operation: C.QUERY,
1277
- name: void 0,
1278
- variableDefinitions: [],
1279
- directives: [],
1280
- selectionSet: this.parseSelectionSet()
1281
- });
1282
- let n = this.parseOperationType(), i;
1283
- return this.peek(o.NAME) && (i = this.parseName()), this.node(t, {
1284
- kind: c.OPERATION_DEFINITION,
1285
- operation: n,
1286
- name: i,
1287
- variableDefinitions: this.parseVariableDefinitions(),
1288
- directives: this.parseDirectives(!1),
1289
- selectionSet: this.parseSelectionSet()
1290
- });
1291
- }
1292
- parseOperationType() {
1293
- let t = this.expectToken(o.NAME);
1294
- switch (t.value) {
1295
- case "query": return C.QUERY;
1296
- case "mutation": return C.MUTATION;
1297
- case "subscription": return C.SUBSCRIPTION;
1298
- }
1299
- throw this.unexpected(t);
1300
- }
1301
- parseVariableDefinitions() {
1302
- return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
1303
- }
1304
- parseVariableDefinition() {
1305
- return this.node(this._lexer.token, {
1306
- kind: c.VARIABLE_DEFINITION,
1307
- variable: this.parseVariable(),
1308
- type: (this.expectToken(o.COLON), this.parseTypeReference()),
1309
- defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
1310
- directives: this.parseConstDirectives()
1311
- });
1312
- }
1313
- parseVariable() {
1314
- let t = this._lexer.token;
1315
- return this.expectToken(o.DOLLAR), this.node(t, {
1316
- kind: c.VARIABLE,
1317
- name: this.parseName()
1318
- });
1319
- }
1320
- parseSelectionSet() {
1321
- return this.node(this._lexer.token, {
1322
- kind: c.SELECTION_SET,
1323
- selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R)
1324
- });
1325
- }
1326
- parseSelection() {
1327
- return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
1328
- }
1329
- parseField() {
1330
- let t = this._lexer.token, n = this.parseName(), i, r;
1331
- return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1332
- kind: c.FIELD,
1333
- alias: i,
1334
- name: r,
1335
- arguments: this.parseArguments(!1),
1336
- directives: this.parseDirectives(!1),
1337
- selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
1338
- });
1339
- }
1340
- parseArguments(t) {
1341
- let n = t ? this.parseConstArgument : this.parseArgument;
1342
- return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
1343
- }
1344
- parseArgument(t = !1) {
1345
- let n = this._lexer.token, i = this.parseName();
1346
- return this.expectToken(o.COLON), this.node(n, {
1347
- kind: c.ARGUMENT,
1348
- name: i,
1349
- value: this.parseValueLiteral(t)
1350
- });
1351
- }
1352
- parseConstArgument() {
1353
- return this.parseArgument(!0);
1354
- }
1355
- parseFragment() {
1356
- let t = this._lexer.token;
1357
- this.expectToken(o.SPREAD);
1358
- let n = this.expectOptionalKeyword("on");
1359
- return !n && this.peek(o.NAME) ? this.node(t, {
1360
- kind: c.FRAGMENT_SPREAD,
1361
- name: this.parseFragmentName(),
1362
- directives: this.parseDirectives(!1)
1363
- }) : this.node(t, {
1364
- kind: c.INLINE_FRAGMENT,
1365
- typeCondition: n ? this.parseNamedType() : void 0,
1366
- directives: this.parseDirectives(!1),
1367
- selectionSet: this.parseSelectionSet()
1368
- });
1369
- }
1370
- parseFragmentDefinition() {
1371
- let t = this._lexer.token;
1372
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1373
- kind: c.FRAGMENT_DEFINITION,
1374
- name: this.parseFragmentName(),
1375
- variableDefinitions: this.parseVariableDefinitions(),
1376
- typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1377
- directives: this.parseDirectives(!1),
1378
- selectionSet: this.parseSelectionSet()
1379
- }) : this.node(t, {
1380
- kind: c.FRAGMENT_DEFINITION,
1381
- name: this.parseFragmentName(),
1382
- typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1383
- directives: this.parseDirectives(!1),
1384
- selectionSet: this.parseSelectionSet()
1385
- });
1386
- }
1387
- parseFragmentName() {
1388
- if (this._lexer.token.value === "on") throw this.unexpected();
1389
- return this.parseName();
1390
- }
1391
- parseValueLiteral(t) {
1392
- let n = this._lexer.token;
1393
- switch (n.kind) {
1394
- case o.BRACKET_L: return this.parseList(t);
1395
- case o.BRACE_L: return this.parseObject(t);
1396
- case o.INT: return this.advanceLexer(), this.node(n, {
1397
- kind: c.INT,
1398
- value: n.value
1399
- });
1400
- case o.FLOAT: return this.advanceLexer(), this.node(n, {
1401
- kind: c.FLOAT,
1402
- value: n.value
1403
- });
1404
- case o.STRING:
1405
- case o.BLOCK_STRING: return this.parseStringLiteral();
1406
- case o.NAME: switch (this.advanceLexer(), n.value) {
1407
- case "true": return this.node(n, {
1408
- kind: c.BOOLEAN,
1409
- value: !0
1410
- });
1411
- case "false": return this.node(n, {
1412
- kind: c.BOOLEAN,
1413
- value: !1
1414
- });
1415
- case "null": return this.node(n, { kind: c.NULL });
1416
- default: return this.node(n, {
1417
- kind: c.ENUM,
1418
- value: n.value
1419
- });
1420
- }
1421
- case o.DOLLAR:
1422
- if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
1423
- let i = this._lexer.token.value;
1424
- throw d(this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.`);
1425
- } else throw this.unexpected(n);
1426
- return this.parseVariable();
1427
- default: throw this.unexpected();
1428
- }
1429
- }
1430
- parseConstValueLiteral() {
1431
- return this.parseValueLiteral(!0);
1432
- }
1433
- parseStringLiteral() {
1434
- let t = this._lexer.token;
1435
- return this.advanceLexer(), this.node(t, {
1436
- kind: c.STRING,
1437
- value: t.value,
1438
- block: t.kind === o.BLOCK_STRING
1439
- });
1440
- }
1441
- parseList(t) {
1442
- let n = () => this.parseValueLiteral(t);
1443
- return this.node(this._lexer.token, {
1444
- kind: c.LIST,
1445
- values: this.any(o.BRACKET_L, n, o.BRACKET_R)
1446
- });
1447
- }
1448
- parseObject(t) {
1449
- let n = () => this.parseObjectField(t);
1450
- return this.node(this._lexer.token, {
1451
- kind: c.OBJECT,
1452
- fields: this.any(o.BRACE_L, n, o.BRACE_R)
1453
- });
1454
- }
1455
- parseObjectField(t) {
1456
- let n = this._lexer.token, i = this.parseName();
1457
- return this.expectToken(o.COLON), this.node(n, {
1458
- kind: c.OBJECT_FIELD,
1459
- name: i,
1460
- value: this.parseValueLiteral(t)
1461
- });
1462
- }
1463
- parseDirectives(t) {
1464
- let n = [];
1465
- for (; this.peek(o.AT);) n.push(this.parseDirective(t));
1466
- return n;
1467
- }
1468
- parseConstDirectives() {
1469
- return this.parseDirectives(!0);
1470
- }
1471
- parseDirective(t) {
1472
- let n = this._lexer.token;
1473
- return this.expectToken(o.AT), this.node(n, {
1474
- kind: c.DIRECTIVE,
1475
- name: this.parseName(),
1476
- arguments: this.parseArguments(t)
1477
- });
1478
- }
1479
- parseTypeReference() {
1480
- let t = this._lexer.token, n;
1481
- if (this.expectOptionalToken(o.BRACKET_L)) {
1482
- let i = this.parseTypeReference();
1483
- this.expectToken(o.BRACKET_R), n = this.node(t, {
1484
- kind: c.LIST_TYPE,
1485
- type: i
1486
- });
1487
- } else n = this.parseNamedType();
1488
- return this.expectOptionalToken(o.BANG) ? this.node(t, {
1489
- kind: c.NON_NULL_TYPE,
1490
- type: n
1491
- }) : n;
1492
- }
1493
- parseNamedType() {
1494
- return this.node(this._lexer.token, {
1495
- kind: c.NAMED_TYPE,
1496
- name: this.parseName()
1497
- });
1498
- }
1499
- peekDescription() {
1500
- return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
1501
- }
1502
- parseDescription() {
1503
- if (this.peekDescription()) return this.parseStringLiteral();
1504
- }
1505
- parseSchemaDefinition() {
1506
- let t = this._lexer.token, n = this.parseDescription();
1507
- this.expectKeyword("schema");
1508
- let i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1509
- return this.node(t, {
1510
- kind: c.SCHEMA_DEFINITION,
1511
- description: n,
1512
- directives: i,
1513
- operationTypes: r
1514
- });
1515
- }
1516
- parseOperationTypeDefinition() {
1517
- let t = this._lexer.token, n = this.parseOperationType();
1518
- this.expectToken(o.COLON);
1519
- let i = this.parseNamedType();
1520
- return this.node(t, {
1521
- kind: c.OPERATION_TYPE_DEFINITION,
1522
- operation: n,
1523
- type: i
1524
- });
1525
- }
1526
- parseScalarTypeDefinition() {
1527
- let t = this._lexer.token, n = this.parseDescription();
1528
- this.expectKeyword("scalar");
1529
- let i = this.parseName(), r = this.parseConstDirectives();
1530
- return this.node(t, {
1531
- kind: c.SCALAR_TYPE_DEFINITION,
1532
- description: n,
1533
- name: i,
1534
- directives: r
1535
- });
1536
- }
1537
- parseObjectTypeDefinition() {
1538
- let t = this._lexer.token, n = this.parseDescription();
1539
- this.expectKeyword("type");
1540
- let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1541
- return this.node(t, {
1542
- kind: c.OBJECT_TYPE_DEFINITION,
1543
- description: n,
1544
- name: i,
1545
- interfaces: r,
1546
- directives: s,
1547
- fields: a
1548
- });
1549
- }
1550
- parseImplementsInterfaces() {
1551
- return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
1552
- }
1553
- parseFieldsDefinition() {
1554
- return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
1555
- }
1556
- parseFieldDefinition() {
1557
- let t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1558
- this.expectToken(o.COLON);
1559
- let s = this.parseTypeReference(), a = this.parseConstDirectives();
1560
- return this.node(t, {
1561
- kind: c.FIELD_DEFINITION,
1562
- description: n,
1563
- name: i,
1564
- arguments: r,
1565
- type: s,
1566
- directives: a
1567
- });
1568
- }
1569
- parseArgumentDefs() {
1570
- return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
1571
- }
1572
- parseInputValueDef() {
1573
- let t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1574
- this.expectToken(o.COLON);
1575
- let r = this.parseTypeReference(), s;
1576
- this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
1577
- let a = this.parseConstDirectives();
1578
- return this.node(t, {
1579
- kind: c.INPUT_VALUE_DEFINITION,
1580
- description: n,
1581
- name: i,
1582
- type: r,
1583
- defaultValue: s,
1584
- directives: a
1585
- });
1586
- }
1587
- parseInterfaceTypeDefinition() {
1588
- let t = this._lexer.token, n = this.parseDescription();
1589
- this.expectKeyword("interface");
1590
- let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1591
- return this.node(t, {
1592
- kind: c.INTERFACE_TYPE_DEFINITION,
1593
- description: n,
1594
- name: i,
1595
- interfaces: r,
1596
- directives: s,
1597
- fields: a
1598
- });
1599
- }
1600
- parseUnionTypeDefinition() {
1601
- let t = this._lexer.token, n = this.parseDescription();
1602
- this.expectKeyword("union");
1603
- let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1604
- return this.node(t, {
1605
- kind: c.UNION_TYPE_DEFINITION,
1606
- description: n,
1607
- name: i,
1608
- directives: r,
1609
- types: s
1610
- });
1611
- }
1612
- parseUnionMemberTypes() {
1613
- return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1614
- }
1615
- parseEnumTypeDefinition() {
1616
- let t = this._lexer.token, n = this.parseDescription();
1617
- this.expectKeyword("enum");
1618
- let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1619
- return this.node(t, {
1620
- kind: c.ENUM_TYPE_DEFINITION,
1621
- description: n,
1622
- name: i,
1623
- directives: r,
1624
- values: s
1625
- });
1626
- }
1627
- parseEnumValuesDefinition() {
1628
- return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
1629
- }
1630
- parseEnumValueDefinition() {
1631
- let t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1632
- return this.node(t, {
1633
- kind: c.ENUM_VALUE_DEFINITION,
1634
- description: n,
1635
- name: i,
1636
- directives: r
1637
- });
1638
- }
1639
- parseEnumValueName() {
1640
- 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.`);
1641
- return this.parseName();
1642
- }
1643
- parseInputObjectTypeDefinition() {
1644
- let t = this._lexer.token, n = this.parseDescription();
1645
- this.expectKeyword("input");
1646
- let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1647
- return this.node(t, {
1648
- kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1649
- description: n,
1650
- name: i,
1651
- directives: r,
1652
- fields: s
1653
- });
1654
- }
1655
- parseInputFieldsDefinition() {
1656
- return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
1657
- }
1658
- parseTypeSystemExtension() {
1659
- let t = this._lexer.lookahead();
1660
- if (t.kind === o.NAME) switch (t.value) {
1661
- case "schema": return this.parseSchemaExtension();
1662
- case "scalar": return this.parseScalarTypeExtension();
1663
- case "type": return this.parseObjectTypeExtension();
1664
- case "interface": return this.parseInterfaceTypeExtension();
1665
- case "union": return this.parseUnionTypeExtension();
1666
- case "enum": return this.parseEnumTypeExtension();
1667
- case "input": return this.parseInputObjectTypeExtension();
1668
- }
1669
- throw this.unexpected(t);
1670
- }
1671
- parseSchemaExtension() {
1672
- let t = this._lexer.token;
1673
- this.expectKeyword("extend"), this.expectKeyword("schema");
1674
- let n = this.parseConstDirectives(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1675
- if (n.length === 0 && i.length === 0) throw this.unexpected();
1676
- return this.node(t, {
1677
- kind: c.SCHEMA_EXTENSION,
1678
- directives: n,
1679
- operationTypes: i
1680
- });
1681
- }
1682
- parseScalarTypeExtension() {
1683
- let t = this._lexer.token;
1684
- this.expectKeyword("extend"), this.expectKeyword("scalar");
1685
- let n = this.parseName(), i = this.parseConstDirectives();
1686
- if (i.length === 0) throw this.unexpected();
1687
- return this.node(t, {
1688
- kind: c.SCALAR_TYPE_EXTENSION,
1689
- name: n,
1690
- directives: i
1691
- });
1692
- }
1693
- parseObjectTypeExtension() {
1694
- let t = this._lexer.token;
1695
- this.expectKeyword("extend"), this.expectKeyword("type");
1696
- let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1697
- if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1698
- return this.node(t, {
1699
- kind: c.OBJECT_TYPE_EXTENSION,
1700
- name: n,
1701
- interfaces: i,
1702
- directives: r,
1703
- fields: s
1704
- });
1705
- }
1706
- parseInterfaceTypeExtension() {
1707
- let t = this._lexer.token;
1708
- this.expectKeyword("extend"), this.expectKeyword("interface");
1709
- let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1710
- if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1711
- return this.node(t, {
1712
- kind: c.INTERFACE_TYPE_EXTENSION,
1713
- name: n,
1714
- interfaces: i,
1715
- directives: r,
1716
- fields: s
1717
- });
1718
- }
1719
- parseUnionTypeExtension() {
1720
- let t = this._lexer.token;
1721
- this.expectKeyword("extend"), this.expectKeyword("union");
1722
- let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1723
- if (i.length === 0 && r.length === 0) throw this.unexpected();
1724
- return this.node(t, {
1725
- kind: c.UNION_TYPE_EXTENSION,
1726
- name: n,
1727
- directives: i,
1728
- types: r
1729
- });
1730
- }
1731
- parseEnumTypeExtension() {
1732
- let t = this._lexer.token;
1733
- this.expectKeyword("extend"), this.expectKeyword("enum");
1734
- let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1735
- if (i.length === 0 && r.length === 0) throw this.unexpected();
1736
- return this.node(t, {
1737
- kind: c.ENUM_TYPE_EXTENSION,
1738
- name: n,
1739
- directives: i,
1740
- values: r
1741
- });
1742
- }
1743
- parseInputObjectTypeExtension() {
1744
- let t = this._lexer.token;
1745
- this.expectKeyword("extend"), this.expectKeyword("input");
1746
- let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1747
- if (i.length === 0 && r.length === 0) throw this.unexpected();
1748
- return this.node(t, {
1749
- kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1750
- name: n,
1751
- directives: i,
1752
- fields: r
1753
- });
1754
- }
1755
- parseDirectiveDefinition() {
1756
- let t = this._lexer.token, n = this.parseDescription();
1757
- this.expectKeyword("directive"), this.expectToken(o.AT);
1758
- let i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1759
- this.expectKeyword("on");
1760
- let a = this.parseDirectiveLocations();
1761
- return this.node(t, {
1762
- kind: c.DIRECTIVE_DEFINITION,
1763
- description: n,
1764
- name: i,
1765
- arguments: r,
1766
- repeatable: s,
1767
- locations: a
1768
- });
1769
- }
1770
- parseDirectiveLocations() {
1771
- return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
1772
- }
1773
- parseDirectiveLocation() {
1774
- let t = this._lexer.token, n = this.parseName();
1775
- if (Object.prototype.hasOwnProperty.call(ee, n.value)) return n;
1776
- throw this.unexpected(t);
1777
- }
1778
- node(t, n) {
1779
- return this._options.noLocation !== !0 && (n.loc = new Q(t, this._lexer.lastToken, this._lexer.source)), n;
1780
- }
1781
- peek(t) {
1782
- return this._lexer.token.kind === t;
1783
- }
1784
- expectToken(t) {
1785
- let n = this._lexer.token;
1786
- if (n.kind === t) return this.advanceLexer(), n;
1787
- throw d(this._lexer.source, n.start, `Expected ${dt(t)}, found ${oe(n)}.`);
1788
- }
1789
- expectOptionalToken(t) {
1790
- return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
1791
- }
1792
- expectKeyword(t) {
1793
- let n = this._lexer.token;
1794
- if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1795
- else throw d(this._lexer.source, n.start, `Expected "${t}", found ${oe(n)}.`);
1796
- }
1797
- expectOptionalKeyword(t) {
1798
- let n = this._lexer.token;
1799
- return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1800
- }
1801
- unexpected(t) {
1802
- let n = t ?? this._lexer.token;
1803
- return d(this._lexer.source, n.start, `Unexpected ${oe(n)}.`);
1804
- }
1805
- any(t, n, i) {
1806
- this.expectToken(t);
1807
- let r = [];
1808
- for (; !this.expectOptionalToken(i);) r.push(n.call(this));
1809
- return r;
1810
- }
1811
- optionalMany(t, n, i) {
1812
- if (this.expectOptionalToken(t)) {
1813
- let r = [];
1814
- do
1815
- r.push(n.call(this));
1816
- while (!this.expectOptionalToken(i));
1817
- return r;
1818
- }
1819
- return [];
1820
- }
1821
- many(t, n, i) {
1822
- this.expectToken(t);
1823
- let r = [];
1824
- do
1825
- r.push(n.call(this));
1826
- while (!this.expectOptionalToken(i));
1827
- return r;
1828
- }
1829
- delimitedMany(t, n) {
1830
- this.expectOptionalToken(t);
1831
- let i = [];
1832
- do
1833
- i.push(n.call(this));
1834
- while (this.expectOptionalToken(t));
1835
- return i;
1836
- }
1837
- advanceLexer() {
1838
- let { maxTokens: t } = this._options, n = this._lexer.advance();
1839
- 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.`);
1840
- }
1841
- };
1842
- function oe(e) {
1843
- let t = e.value;
1844
- return dt(e.kind) + (t != null ? ` "${t}"` : "");
1845
- }
1846
- function dt(e) {
1847
- return ct(e) ? `"${e}"` : e;
1848
- }
1849
- function sn(e, t) {
1850
- let n = /* @__PURE__ */ new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1851
- return Object.assign(n, t);
1852
- }
1853
- var mt = sn;
1854
- function on(e) {
1855
- let t = [], { startToken: n, endToken: i } = e.loc;
1856
- for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({
1857
- ...r,
1858
- loc: {
1859
- start: r.start,
1860
- end: r.end
1861
- }
1862
- });
1863
- return t;
1864
- }
1865
- var an = { allowLegacyFragmentVariables: !0 };
1866
- function cn(e) {
1867
- if ((e == null ? void 0 : e.name) === "GraphQLError") {
1868
- let { message: t, locations: [n] } = e;
1869
- return mt(t, {
1870
- loc: { start: n },
1871
- cause: e
1872
- });
1873
- }
1874
- return e;
1875
- }
1876
- function un(e) {
1877
- let t;
1878
- try {
1879
- t = ht(e, an);
1880
- } catch (n) {
1881
- throw cn(n);
1882
- }
1883
- return t.comments = on(t), t;
1884
- }
1885
- var ln = {
1886
- parse: un,
1887
- astFormat: "graphql",
1888
- hasPragma: je,
1889
- hasIgnorePragma: $e,
1890
- locStart: K,
1891
- locEnd: z
1892
- };
1893
- var pn = { graphql: qe };
1894
- var Ui = Ne;
1895
-
1896
- //#endregion
1897
- exports.default = Ui;
1898
- exports.languages = Qe;
1899
- exports.options = Ke;
1900
- exports.parsers = _e;
1901
- exports.printers = pn;
1902
- //# sourceMappingURL=graphql-GOxQAKxM.cjs.map