@jixo/cli 0.21.2 → 0.21.3

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