@stonecrop/graphql-client 0.6.2 → 0.6.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.
@@ -14,14 +14,7 @@ function Lt(e, t) {
14
14
  }
15
15
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
16
16
  }
17
- /*!
18
- * decimal.js v10.4.3
19
- * An arbitrary-precision Decimal type for JavaScript.
20
- * https://github.com/MikeMcl/decimal.js
21
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
22
- * MIT Licence
23
- */
24
- var le = 9e15, ie = 1e9, je = "0123456789abcdef", De = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Se = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", $e = {
17
+ var le = 9e15, ie = 1e9, $e = "0123456789abcdef", De = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Ce = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", He = {
25
18
  // These values must be integers within the stated ranges (inclusive).
26
19
  // Most of these values can be changed at run-time using the `Decimal.config` method.
27
20
  // The maximum number of significant digits of the result of a calculation or base conversion.
@@ -79,7 +72,7 @@ var le = 9e15, ie = 1e9, je = "0123456789abcdef", De = "2.3025850929940456840179
79
72
  // Whether to use cryptographically-secure random number generation, if available.
80
73
  crypto: !1
81
74
  // true/false
82
- }, ht, W, I = !0, ke = "[DecimalError] ", ne = ke + "Invalid argument: ", dt = ke + "Precision limit exceeded", pt = ke + "crypto unavailable", mt = "[object Decimal]", j = Math.floor, P = Math.pow, Ft = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Pt = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Mt = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, gt = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Q = 1e7, T = 7, Bt = 9007199254740991, Ut = De.length - 1, He = Se.length - 1, g = { toStringTag: mt };
75
+ }, ht, W, O = !0, ke = "[DecimalError] ", ne = ke + "Invalid argument: ", dt = ke + "Precision limit exceeded", pt = ke + "crypto unavailable", mt = "[object Decimal]", j = Math.floor, P = Math.pow, Ft = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Pt = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Mt = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, gt = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, X = 1e7, A = 7, Bt = 9007199254740991, Ut = De.length - 1, Ge = Ce.length - 1, g = { toStringTag: mt };
83
76
  g.absoluteValue = g.abs = function() {
84
77
  var e = new this.constructor(this);
85
78
  return e.s < 0 && (e.s = 1), v(e);
@@ -106,12 +99,12 @@ g.comparedTo = g.cmp = function(e) {
106
99
  };
107
100
  g.cosine = g.cos = function() {
108
101
  var e, t, n = this, i = n.constructor;
109
- return n.d ? n.d[0] ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + T, i.rounding = 1, n = qt(i, vt(i, n)), i.precision = e, i.rounding = t, v(W == 2 || W == 3 ? n.neg() : n, e, t, !0)) : new i(1) : new i(NaN);
102
+ return n.d ? n.d[0] ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + A, i.rounding = 1, n = qt(i, vt(i, n)), i.precision = e, i.rounding = t, v(W == 2 || W == 3 ? n.neg() : n, e, t, !0)) : new i(1) : new i(NaN);
110
103
  };
111
104
  g.cubeRoot = g.cbrt = function() {
112
105
  var e, t, n, i, r, s, o, a, u, c, l = this, f = l.constructor;
113
106
  if (!l.isFinite() || l.isZero()) return new f(l);
114
- for (I = !1, s = l.s * P(l.s * l, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = U(l.d), e = l.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = P(n, 1 / 3), e = j((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), i = new f(n), i.s = l.s) : i = new f(s.toString()), o = (e = f.precision) + 3; ; )
107
+ for (O = !1, s = l.s * P(l.s * l, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = U(l.d), e = l.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = P(n, 1 / 3), e = j((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), i = new f(n), i.s = l.s) : i = new f(s.toString()), o = (e = f.precision) + 3; ; )
115
108
  if (a = i, u = a.times(a).times(a), c = u.plus(l), i = R(c.plus(l).times(a), c.plus(u), o + 2, 1), U(a.d).slice(0, o) === (n = U(i.d)).slice(0, o))
116
109
  if (n = n.slice(o - 3, o + 1), n == "9999" || !r && n == "4999") {
117
110
  if (!r && (v(a, e + 1, 0), a.times(a).times(a).eq(l))) {
@@ -123,12 +116,12 @@ g.cubeRoot = g.cbrt = function() {
123
116
  (!+n || !+n.slice(1) && n.charAt(0) == "5") && (v(i, e + 1, 1), t = !i.times(i).times(i).eq(l));
124
117
  break;
125
118
  }
126
- return I = !0, v(i, e, f.rounding, t);
119
+ return O = !0, v(i, e, f.rounding, t);
127
120
  };
128
121
  g.decimalPlaces = g.dp = function() {
129
122
  var e, t = this.d, n = NaN;
130
123
  if (t) {
131
- if (e = t.length - 1, n = (e - j(this.e / T)) * T, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
124
+ if (e = t.length - 1, n = (e - j(this.e / A)) * A, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
132
125
  n < 0 && (n = 0);
133
126
  }
134
127
  return n;
@@ -180,15 +173,15 @@ g.hyperbolicTangent = g.tanh = function() {
180
173
  };
181
174
  g.inverseCosine = g.acos = function() {
182
175
  var e, t = this, n = t.constructor, i = t.abs().cmp(1), r = n.precision, s = n.rounding;
183
- return i !== -1 ? i === 0 ? t.isNeg() ? X(n, r, s) : new n(0) : new n(NaN) : t.isZero() ? X(n, r + 4, s).times(0.5) : (n.precision = r + 6, n.rounding = 1, t = t.asin(), e = X(n, r + 4, s).times(0.5), n.precision = r, n.rounding = s, e.minus(t));
176
+ return i !== -1 ? i === 0 ? t.isNeg() ? Q(n, r, s) : new n(0) : new n(NaN) : t.isZero() ? Q(n, r + 4, s).times(0.5) : (n.precision = r + 6, n.rounding = 1, t = t.asin(), e = Q(n, r + 4, s).times(0.5), n.precision = r, n.rounding = s, e.minus(t));
184
177
  };
185
178
  g.inverseHyperbolicCosine = g.acosh = function() {
186
179
  var e, t, n = this, i = n.constructor;
187
- return n.lte(1) ? new i(n.eq(1) ? 0 : NaN) : n.isFinite() ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(Math.abs(n.e), n.sd()) + 4, i.rounding = 1, I = !1, n = n.times(n).minus(1).sqrt().plus(n), I = !0, i.precision = e, i.rounding = t, n.ln()) : new i(n);
180
+ return n.lte(1) ? new i(n.eq(1) ? 0 : NaN) : n.isFinite() ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(Math.abs(n.e), n.sd()) + 4, i.rounding = 1, O = !1, n = n.times(n).minus(1).sqrt().plus(n), O = !0, i.precision = e, i.rounding = t, n.ln()) : new i(n);
188
181
  };
189
182
  g.inverseHyperbolicSine = g.asinh = function() {
190
183
  var e, t, n = this, i = n.constructor;
191
- return !n.isFinite() || n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 2 * Math.max(Math.abs(n.e), n.sd()) + 6, i.rounding = 1, I = !1, n = n.times(n).plus(1).sqrt().plus(n), I = !0, i.precision = e, i.rounding = t, n.ln());
184
+ return !n.isFinite() || n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 2 * Math.max(Math.abs(n.e), n.sd()) + 6, i.rounding = 1, O = !1, n = n.times(n).plus(1).sqrt().plus(n), O = !0, i.precision = e, i.rounding = t, n.ln());
192
185
  };
193
186
  g.inverseHyperbolicTangent = g.atanh = function() {
194
187
  var e, t, n, i, r = this, s = r.constructor;
@@ -196,30 +189,30 @@ g.inverseHyperbolicTangent = g.atanh = function() {
196
189
  };
197
190
  g.inverseSine = g.asin = function() {
198
191
  var e, t, n, i, r = this, s = r.constructor;
199
- return r.isZero() ? new s(r) : (t = r.abs().cmp(1), n = s.precision, i = s.rounding, t !== -1 ? t === 0 ? (e = X(s, n + 4, i).times(0.5), e.s = r.s, e) : new s(NaN) : (s.precision = n + 6, s.rounding = 1, r = r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(), s.precision = n, s.rounding = i, r.times(2)));
192
+ return r.isZero() ? new s(r) : (t = r.abs().cmp(1), n = s.precision, i = s.rounding, t !== -1 ? t === 0 ? (e = Q(s, n + 4, i).times(0.5), e.s = r.s, e) : new s(NaN) : (s.precision = n + 6, s.rounding = 1, r = r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(), s.precision = n, s.rounding = i, r.times(2)));
200
193
  };
201
194
  g.inverseTangent = g.atan = function() {
202
195
  var e, t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, d = l.rounding;
203
196
  if (c.isFinite()) {
204
197
  if (c.isZero())
205
198
  return new l(c);
206
- if (c.abs().eq(1) && f + 4 <= He)
207
- return o = X(l, f + 4, d).times(0.25), o.s = c.s, o;
199
+ if (c.abs().eq(1) && f + 4 <= Ge)
200
+ return o = Q(l, f + 4, d).times(0.25), o.s = c.s, o;
208
201
  } else {
209
202
  if (!c.s) return new l(NaN);
210
- if (f + 4 <= He)
211
- return o = X(l, f + 4, d).times(0.5), o.s = c.s, o;
203
+ if (f + 4 <= Ge)
204
+ return o = Q(l, f + 4, d).times(0.5), o.s = c.s, o;
212
205
  }
213
- for (l.precision = a = f + 10, l.rounding = 1, n = Math.min(28, a / T + 2 | 0), e = n; e; --e) c = c.div(c.times(c).plus(1).sqrt().plus(1));
214
- for (I = !1, t = Math.ceil(a / T), i = 1, u = c.times(c), o = new l(c), r = c; e !== -1; )
206
+ for (l.precision = a = f + 10, l.rounding = 1, n = Math.min(28, a / A + 2 | 0), e = n; e; --e) c = c.div(c.times(c).plus(1).sqrt().plus(1));
207
+ for (O = !1, t = Math.ceil(a / A), i = 1, u = c.times(c), o = new l(c), r = c; e !== -1; )
215
208
  if (r = r.times(u), s = o.minus(r.div(i += 2)), r = r.times(u), o = s.plus(r.div(i += 2)), o.d[t] !== void 0) for (e = t; o.d[e] === s.d[e] && e--; ) ;
216
- return n && (o = o.times(2 << n - 1)), I = !0, v(o, l.precision = f, l.rounding = d, !0);
209
+ return n && (o = o.times(2 << n - 1)), O = !0, v(o, l.precision = f, l.rounding = d, !0);
217
210
  };
218
211
  g.isFinite = function() {
219
212
  return !!this.d;
220
213
  };
221
214
  g.isInteger = g.isInt = function() {
222
- return !!this.d && j(this.e / T) > this.d.length - 2;
215
+ return !!this.d && j(this.e / A) > this.d.length - 2;
223
216
  };
224
217
  g.isNaN = function() {
225
218
  return !this.s;
@@ -240,7 +233,7 @@ g.lessThanOrEqualTo = g.lte = function(e) {
240
233
  return this.cmp(e) < 1;
241
234
  };
242
235
  g.logarithm = g.log = function(e) {
243
- var t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, d = l.rounding, y = 5;
236
+ var t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, d = l.rounding, N = 5;
244
237
  if (e == null)
245
238
  e = new l(10), t = !0;
246
239
  else {
@@ -256,29 +249,29 @@ g.logarithm = g.log = function(e) {
256
249
  for (r = n[0]; r % 10 === 0; ) r /= 10;
257
250
  s = r !== 1;
258
251
  }
259
- if (I = !1, a = f + y, o = te(c, a), i = t ? xe(l, a + 10) : te(e, a), u = R(o, i, a, 1), ye(u.d, r = f, d))
252
+ if (O = !1, a = f + N, o = te(c, a), i = t ? xe(l, a + 10) : te(e, a), u = R(o, i, a, 1), Ne(u.d, r = f, d))
260
253
  do
261
254
  if (a += 10, o = te(c, a), i = t ? xe(l, a + 10) : te(e, a), u = R(o, i, a, 1), !s) {
262
255
  +U(u.d).slice(r + 1, r + 15) + 1 == 1e14 && (u = v(u, f + 1, 0));
263
256
  break;
264
257
  }
265
- while (ye(u.d, r += 10, d));
266
- return I = !0, v(u, f, d);
258
+ while (Ne(u.d, r += 10, d));
259
+ return O = !0, v(u, f, d);
267
260
  };
268
261
  g.minus = g.sub = function(e) {
269
- var t, n, i, r, s, o, a, u, c, l, f, d, y = this, N = y.constructor;
270
- if (e = new N(e), !y.d || !e.d)
271
- return !y.s || !e.s ? e = new N(NaN) : y.d ? e.s = -e.s : e = new N(e.d || y.s !== e.s ? y : NaN), e;
272
- if (y.s != e.s)
273
- return e.s = -e.s, y.plus(e);
274
- if (c = y.d, d = e.d, a = N.precision, u = N.rounding, !c[0] || !d[0]) {
262
+ var t, n, i, r, s, o, a, u, c, l, f, d, N = this, T = N.constructor;
263
+ if (e = new T(e), !N.d || !e.d)
264
+ return !N.s || !e.s ? e = new T(NaN) : N.d ? e.s = -e.s : e = new T(e.d || N.s !== e.s ? N : NaN), e;
265
+ if (N.s != e.s)
266
+ return e.s = -e.s, N.plus(e);
267
+ if (c = N.d, d = e.d, a = T.precision, u = T.rounding, !c[0] || !d[0]) {
275
268
  if (d[0]) e.s = -e.s;
276
- else if (c[0]) e = new N(y);
277
- else return new N(u === 3 ? -0 : 0);
278
- return I ? v(e, a, u) : e;
269
+ else if (c[0]) e = new T(N);
270
+ else return new T(u === 3 ? -0 : 0);
271
+ return O ? v(e, a, u) : e;
279
272
  }
280
- if (n = j(e.e / T), l = j(y.e / T), c = c.slice(), s = l - n, s) {
281
- for (f = s < 0, f ? (t = c, s = -s, o = d.length) : (t = d, n = l, o = c.length), i = Math.max(Math.ceil(a / T), o) + 2, s > i && (s = i, t.length = 1), t.reverse(), i = s; i--; ) t.push(0);
273
+ if (n = j(e.e / A), l = j(N.e / A), c = c.slice(), s = l - n, s) {
274
+ for (f = s < 0, f ? (t = c, s = -s, o = d.length) : (t = d, n = l, o = c.length), i = Math.max(Math.ceil(a / A), o) + 2, s > i && (s = i, t.length = 1), t.reverse(), i = s; i--; ) t.push(0);
282
275
  t.reverse();
283
276
  } else {
284
277
  for (i = c.length, o = d.length, f = i < o, f && (o = i), i = 0; i < o; i++)
@@ -291,21 +284,21 @@ g.minus = g.sub = function(e) {
291
284
  for (f && (t = c, c = d, d = t, e.s = -e.s), o = c.length, i = d.length - o; i > 0; --i) c[o++] = 0;
292
285
  for (i = d.length; i > s; ) {
293
286
  if (c[--i] < d[i]) {
294
- for (r = i; r && c[--r] === 0; ) c[r] = Q - 1;
295
- --c[r], c[i] += Q;
287
+ for (r = i; r && c[--r] === 0; ) c[r] = X - 1;
288
+ --c[r], c[i] += X;
296
289
  }
297
290
  c[i] -= d[i];
298
291
  }
299
292
  for (; c[--o] === 0; ) c.pop();
300
293
  for (; c[0] === 0; c.shift()) --n;
301
- return c[0] ? (e.d = c, e.e = Re(c, n), I ? v(e, a, u) : e) : new N(u === 3 ? -0 : 0);
294
+ return c[0] ? (e.d = c, e.e = Re(c, n), O ? v(e, a, u) : e) : new T(u === 3 ? -0 : 0);
302
295
  };
303
296
  g.modulo = g.mod = function(e) {
304
297
  var t, n = this, i = n.constructor;
305
- return e = new i(e), !n.d || !e.s || e.d && !e.d[0] ? new i(NaN) : !e.d || n.d && !n.d[0] ? v(new i(n), i.precision, i.rounding) : (I = !1, i.modulo == 9 ? (t = R(n, e.abs(), 0, 3, 1), t.s *= e.s) : t = R(n, e, 0, i.modulo, 1), t = t.times(e), I = !0, n.minus(t));
298
+ return e = new i(e), !n.d || !e.s || e.d && !e.d[0] ? new i(NaN) : !e.d || n.d && !n.d[0] ? v(new i(n), i.precision, i.rounding) : (O = !1, i.modulo == 9 ? (t = R(n, e.abs(), 0, 3, 1), t.s *= e.s) : t = R(n, e, 0, i.modulo, 1), t = t.times(e), O = !0, n.minus(t));
306
299
  };
307
300
  g.naturalExponential = g.exp = function() {
308
- return Ge(this);
301
+ return Ye(this);
309
302
  };
310
303
  g.naturalLogarithm = g.ln = function() {
311
304
  return te(this);
@@ -321,15 +314,15 @@ g.plus = g.add = function(e) {
321
314
  if (f.s != e.s)
322
315
  return e.s = -e.s, f.minus(e);
323
316
  if (c = f.d, l = e.d, a = d.precision, u = d.rounding, !c[0] || !l[0])
324
- return l[0] || (e = new d(f)), I ? v(e, a, u) : e;
325
- if (s = j(f.e / T), i = j(e.e / T), c = c.slice(), r = s - i, r) {
326
- for (r < 0 ? (n = c, r = -r, o = l.length) : (n = l, i = s, o = c.length), s = Math.ceil(a / T), o = s > o ? s + 1 : o + 1, r > o && (r = o, n.length = 1), n.reverse(); r--; ) n.push(0);
317
+ return l[0] || (e = new d(f)), O ? v(e, a, u) : e;
318
+ if (s = j(f.e / A), i = j(e.e / A), c = c.slice(), r = s - i, r) {
319
+ for (r < 0 ? (n = c, r = -r, o = l.length) : (n = l, i = s, o = c.length), s = Math.ceil(a / A), o = s > o ? s + 1 : o + 1, r > o && (r = o, n.length = 1), n.reverse(); r--; ) n.push(0);
327
320
  n.reverse();
328
321
  }
329
322
  for (o = c.length, r = l.length, o - r < 0 && (r = o, n = l, l = c, c = n), t = 0; r; )
330
- t = (c[--r] = c[r] + l[r] + t) / Q | 0, c[r] %= Q;
323
+ t = (c[--r] = c[r] + l[r] + t) / X | 0, c[r] %= X;
331
324
  for (t && (c.unshift(t), ++i), o = c.length; c[--o] == 0; ) c.pop();
332
- return e.d = c, e.e = Re(c, i), I ? v(e, a, u) : e;
325
+ return e.d = c, e.e = Re(c, i), O ? v(e, a, u) : e;
333
326
  };
334
327
  g.precision = g.sd = function(e) {
335
328
  var t, n = this;
@@ -342,13 +335,13 @@ g.round = function() {
342
335
  };
343
336
  g.sine = g.sin = function() {
344
337
  var e, t, n = this, i = n.constructor;
345
- return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + T, i.rounding = 1, n = jt(i, vt(i, n)), i.precision = e, i.rounding = t, v(W > 2 ? n.neg() : n, e, t, !0)) : new i(NaN);
338
+ return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + A, i.rounding = 1, n = jt(i, vt(i, n)), i.precision = e, i.rounding = t, v(W > 2 ? n.neg() : n, e, t, !0)) : new i(NaN);
346
339
  };
347
340
  g.squareRoot = g.sqrt = function() {
348
341
  var e, t, n, i, r, s, o = this, a = o.d, u = o.e, c = o.s, l = o.constructor;
349
342
  if (c !== 1 || !a || !a[0])
350
343
  return new l(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
351
- for (I = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (t = U(a), (t.length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(t), u = j((u + 1) / 2) - (u < 0 || u % 2), c == 1 / 0 ? t = "5e" + u : (t = c.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + u), i = new l(t)) : i = new l(c.toString()), n = (u = l.precision) + 3; ; )
344
+ for (O = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (t = U(a), (t.length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(t), u = j((u + 1) / 2) - (u < 0 || u % 2), c == 1 / 0 ? t = "5e" + u : (t = c.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + u), i = new l(t)) : i = new l(c.toString()), n = (u = l.precision) + 3; ; )
352
345
  if (s = i, i = s.plus(R(o, s, n + 2, 1)).times(0.5), U(s.d).slice(0, n) === (t = U(i.d)).slice(0, n))
353
346
  if (t = t.slice(n - 3, n + 1), t == "9999" || !r && t == "4999") {
354
347
  if (!r && (v(s, u + 1, 0), s.times(s).eq(o))) {
@@ -360,27 +353,27 @@ g.squareRoot = g.sqrt = function() {
360
353
  (!+t || !+t.slice(1) && t.charAt(0) == "5") && (v(i, u + 1, 1), e = !i.times(i).eq(o));
361
354
  break;
362
355
  }
363
- return I = !0, v(i, u, l.rounding, e);
356
+ return O = !0, v(i, u, l.rounding, e);
364
357
  };
365
358
  g.tangent = g.tan = function() {
366
359
  var e, t, n = this, i = n.constructor;
367
360
  return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 10, i.rounding = 1, n = n.sin(), n.s = 1, n = R(n, new i(1).minus(n.times(n)).sqrt(), e + 10, 0), i.precision = e, i.rounding = t, v(W == 2 || W == 4 ? n.neg() : n, e, t, !0)) : new i(NaN);
368
361
  };
369
362
  g.times = g.mul = function(e) {
370
- var t, n, i, r, s, o, a, u, c, l = this, f = l.constructor, d = l.d, y = (e = new f(e)).d;
371
- if (e.s *= l.s, !d || !d[0] || !y || !y[0])
372
- return new f(!e.s || d && !d[0] && !y || y && !y[0] && !d ? NaN : !d || !y ? e.s / 0 : e.s * 0);
373
- for (n = j(l.e / T) + j(e.e / T), u = d.length, c = y.length, u < c && (s = d, d = y, y = s, o = u, u = c, c = o), s = [], o = u + c, i = o; i--; ) s.push(0);
363
+ var t, n, i, r, s, o, a, u, c, l = this, f = l.constructor, d = l.d, N = (e = new f(e)).d;
364
+ if (e.s *= l.s, !d || !d[0] || !N || !N[0])
365
+ return new f(!e.s || d && !d[0] && !N || N && !N[0] && !d ? NaN : !d || !N ? e.s / 0 : e.s * 0);
366
+ for (n = j(l.e / A) + j(e.e / A), u = d.length, c = N.length, u < c && (s = d, d = N, N = s, o = u, u = c, c = o), s = [], o = u + c, i = o; i--; ) s.push(0);
374
367
  for (i = c; --i >= 0; ) {
375
368
  for (t = 0, r = u + i; r > i; )
376
- a = s[r] + y[i] * d[r - i - 1] + t, s[r--] = a % Q | 0, t = a / Q | 0;
377
- s[r] = (s[r] + t) % Q | 0;
369
+ a = s[r] + N[i] * d[r - i - 1] + t, s[r--] = a % X | 0, t = a / X | 0;
370
+ s[r] = (s[r] + t) % X | 0;
378
371
  }
379
372
  for (; !s[--o]; ) s.pop();
380
- return t ? ++n : s.shift(), e.d = s, e.e = Re(s, n), I ? v(e, f.precision, f.rounding) : e;
373
+ return t ? ++n : s.shift(), e.d = s, e.e = Re(s, n), O ? v(e, f.precision, f.rounding) : e;
381
374
  };
382
375
  g.toBinary = function(e, t) {
383
- return Qe(this, 2, e, t);
376
+ return Ze(this, 2, e, t);
384
377
  };
385
378
  g.toDecimalPlaces = g.toDP = function(e, t) {
386
379
  var n = this, i = n.constructor;
@@ -395,20 +388,20 @@ g.toFixed = function(e, t) {
395
388
  return e === void 0 ? n = Z(r) : (G(e, 0, ie), t === void 0 ? t = s.rounding : G(t, 0, 8), i = v(new s(r), e + r.e + 1, t), n = Z(i, !1, e + i.e + 1)), r.isNeg() && !r.isZero() ? "-" + n : n;
396
389
  };
397
390
  g.toFraction = function(e) {
398
- var t, n, i, r, s, o, a, u, c, l, f, d, y = this, N = y.d, E = y.constructor;
399
- if (!N) return new E(y);
400
- if (c = n = new E(1), i = u = new E(0), t = new E(i), s = t.e = Et(N) - y.e - 1, o = s % T, t.d[0] = P(10, o < 0 ? T + o : o), e == null)
391
+ var t, n, i, r, s, o, a, u, c, l, f, d, N = this, T = N.d, E = N.constructor;
392
+ if (!T) return new E(N);
393
+ if (c = n = new E(1), i = u = new E(0), t = new E(i), s = t.e = Et(T) - N.e - 1, o = s % A, t.d[0] = P(10, o < 0 ? A + o : o), e == null)
401
394
  e = s > 0 ? t : c;
402
395
  else {
403
396
  if (a = new E(e), !a.isInt() || a.lt(c)) throw Error(ne + a);
404
397
  e = a.gt(t) ? s > 0 ? t : c : a;
405
398
  }
406
- for (I = !1, a = new E(U(N)), l = E.precision, E.precision = s = N.length * T * 2; f = R(a, t, 0, 1, 1), r = n.plus(f.times(i)), r.cmp(e) != 1; )
399
+ for (O = !1, a = new E(U(T)), l = E.precision, E.precision = s = T.length * A * 2; f = R(a, t, 0, 1, 1), r = n.plus(f.times(i)), r.cmp(e) != 1; )
407
400
  n = i, i = r, r = c, c = u.plus(f.times(r)), u = r, r = t, t = a.minus(f.times(r)), a = r;
408
- return r = R(e.minus(n), i, 0, 1, 1), u = u.plus(r.times(c)), n = n.plus(r.times(i)), u.s = c.s = y.s, d = R(c, i, s, 1).minus(y).abs().cmp(R(u, n, s, 1).minus(y).abs()) < 1 ? [c, i] : [u, n], E.precision = l, I = !0, d;
401
+ return r = R(e.minus(n), i, 0, 1, 1), u = u.plus(r.times(c)), n = n.plus(r.times(i)), u.s = c.s = N.s, d = R(c, i, s, 1).minus(N).abs().cmp(R(u, n, s, 1).minus(N).abs()) < 1 ? [c, i] : [u, n], E.precision = l, O = !0, d;
409
402
  };
410
403
  g.toHexadecimal = g.toHex = function(e, t) {
411
- return Qe(this, 16, e, t);
404
+ return Ze(this, 16, e, t);
412
405
  };
413
406
  g.toNearest = function(e, t) {
414
407
  var n = this, i = n.constructor;
@@ -420,27 +413,27 @@ g.toNearest = function(e, t) {
420
413
  if (!e.d)
421
414
  return e.s && (e.s = n.s), e;
422
415
  }
423
- return e.d[0] ? (I = !1, n = R(n, e, 0, t, 1).times(e), I = !0, v(n)) : (e.s = n.s, n = e), n;
416
+ return e.d[0] ? (O = !1, n = R(n, e, 0, t, 1).times(e), O = !0, v(n)) : (e.s = n.s, n = e), n;
424
417
  };
425
418
  g.toNumber = function() {
426
419
  return +this;
427
420
  };
428
421
  g.toOctal = function(e, t) {
429
- return Qe(this, 8, e, t);
422
+ return Ze(this, 8, e, t);
430
423
  };
431
424
  g.toPower = g.pow = function(e) {
432
425
  var t, n, i, r, s, o, a = this, u = a.constructor, c = +(e = new u(e));
433
426
  if (!a.d || !e.d || !a.d[0] || !e.d[0]) return new u(P(+a, c));
434
427
  if (a = new u(a), a.eq(1)) return a;
435
428
  if (i = u.precision, s = u.rounding, e.eq(1)) return v(a, i, s);
436
- if (t = j(e.e / T), t >= e.d.length - 1 && (n = c < 0 ? -c : c) <= Bt)
437
- return r = yt(u, a, n, i), e.s < 0 ? new u(1).div(r) : v(r, i, s);
429
+ if (t = j(e.e / A), t >= e.d.length - 1 && (n = c < 0 ? -c : c) <= Bt)
430
+ return r = Nt(u, a, n, i), e.s < 0 ? new u(1).div(r) : v(r, i, s);
438
431
  if (o = a.s, o < 0) {
439
432
  if (t < e.d.length - 1) return new u(NaN);
440
433
  if ((e.d[t] & 1) == 0 && (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
441
434
  return a.s = o, a;
442
435
  }
443
- return n = P(+a, c), t = n == 0 || !isFinite(n) ? j(c * (Math.log("0." + U(a.d)) / Math.LN10 + a.e + 1)) : new u(n + "").e, t > u.maxE + 1 || t < u.minE - 1 ? new u(t > 0 ? o / 0 : 0) : (I = !1, u.rounding = a.s = 1, n = Math.min(12, (t + "").length), r = Ge(e.times(te(a, i + n)), i), r.d && (r = v(r, i + 5, 1), ye(r.d, i, s) && (t = i + 10, r = v(Ge(e.times(te(a, t + n)), t), t + 5, 1), +U(r.d).slice(i + 1, i + 15) + 1 == 1e14 && (r = v(r, i + 1, 0)))), r.s = o, I = !0, u.rounding = s, v(r, i, s));
436
+ return n = P(+a, c), t = n == 0 || !isFinite(n) ? j(c * (Math.log("0." + U(a.d)) / Math.LN10 + a.e + 1)) : new u(n + "").e, t > u.maxE + 1 || t < u.minE - 1 ? new u(t > 0 ? o / 0 : 0) : (O = !1, u.rounding = a.s = 1, n = Math.min(12, (t + "").length), r = Ye(e.times(te(a, i + n)), i), r.d && (r = v(r, i + 5, 1), Ne(r.d, i, s) && (t = i + 10, r = v(Ye(e.times(te(a, t + n)), t), t + 5, 1), +U(r.d).slice(i + 1, i + 15) + 1 == 1e14 && (r = v(r, i + 1, 0)))), r.s = o, O = !0, u.rounding = s, v(r, i, s));
444
437
  };
445
438
  g.toPrecision = function(e, t) {
446
439
  var n, i = this, r = i.constructor;
@@ -465,8 +458,8 @@ function U(e) {
465
458
  var t, n, i, r = e.length - 1, s = "", o = e[0];
466
459
  if (r > 0) {
467
460
  for (s += o, t = 1; t < r; t++)
468
- i = e[t] + "", n = T - i.length, n && (s += ee(n)), s += i;
469
- o = e[t], i = o + "", n = T - i.length, n && (s += ee(n));
461
+ i = e[t] + "", n = A - i.length, n && (s += ee(n)), s += i;
462
+ o = e[t], i = o + "", n = A - i.length, n && (s += ee(n));
470
463
  } else if (o === 0)
471
464
  return "0";
472
465
  for (; o % 10 === 0; ) o /= 10;
@@ -476,15 +469,15 @@ function G(e, t, n) {
476
469
  if (e !== ~~e || e < t || e > n)
477
470
  throw Error(ne + e);
478
471
  }
479
- function ye(e, t, n, i) {
472
+ function Ne(e, t, n, i) {
480
473
  var r, s, o, a;
481
474
  for (s = e[0]; s >= 10; s /= 10) --t;
482
- return --t < 0 ? (t += T, r = 0) : (r = Math.ceil((t + 1) / T), t %= T), s = P(10, T - t), a = e[r] % s | 0, i == null ? t < 3 ? (t == 0 ? a = a / 100 | 0 : t == 1 && (a = a / 10 | 0), o = n < 4 && a == 99999 || n > 3 && a == 49999 || a == 5e4 || a == 0) : o = (n < 4 && a + 1 == s || n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 100 | 0) == P(10, t - 2) - 1 || (a == s / 2 || a == 0) && (e[r + 1] / s / 100 | 0) == 0 : t < 4 ? (t == 0 ? a = a / 1e3 | 0 : t == 1 ? a = a / 100 | 0 : t == 2 && (a = a / 10 | 0), o = (i || n < 4) && a == 9999 || !i && n > 3 && a == 4999) : o = ((i || n < 4) && a + 1 == s || !i && n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 1e3 | 0) == P(10, t - 3) - 1, o;
475
+ return --t < 0 ? (t += A, r = 0) : (r = Math.ceil((t + 1) / A), t %= A), s = P(10, A - t), a = e[r] % s | 0, i == null ? t < 3 ? (t == 0 ? a = a / 100 | 0 : t == 1 && (a = a / 10 | 0), o = n < 4 && a == 99999 || n > 3 && a == 49999 || a == 5e4 || a == 0) : o = (n < 4 && a + 1 == s || n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 100 | 0) == P(10, t - 2) - 1 || (a == s / 2 || a == 0) && (e[r + 1] / s / 100 | 0) == 0 : t < 4 ? (t == 0 ? a = a / 1e3 | 0 : t == 1 ? a = a / 100 | 0 : t == 2 && (a = a / 10 | 0), o = (i || n < 4) && a == 9999 || !i && n > 3 && a == 4999) : o = ((i || n < 4) && a + 1 == s || !i && n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 1e3 | 0) == P(10, t - 3) - 1, o;
483
476
  }
484
- function Ie(e, t, n) {
477
+ function Oe(e, t, n) {
485
478
  for (var i, r = [0], s, o = 0, a = e.length; o < a; ) {
486
479
  for (s = r.length; s--; ) r[s] *= t;
487
- for (r[0] += je.indexOf(e.charAt(o++)), i = 0; i < r.length; i++)
480
+ for (r[0] += $e.indexOf(e.charAt(o++)), i = 0; i < r.length; i++)
488
481
  r[i] > n - 1 && (r[i + 1] === void 0 && (r[i + 1] = 0), r[i + 1] += r[i] / n | 0, r[i] %= n);
489
482
  }
490
483
  return r.reverse();
@@ -524,98 +517,98 @@ var R = /* @__PURE__ */ (function() {
524
517
  for (; !i[0] && i.length > 1; ) i.shift();
525
518
  }
526
519
  return function(i, r, s, o, a, u) {
527
- var c, l, f, d, y, N, E, x, O, q, b, C, J, $, K, ae, H, me, Y, V, ce = i.constructor, re = i.s == r.s ? 1 : -1, h = i.d, p = r.d;
528
- if (!h || !h[0] || !p || !p[0])
520
+ var c, l, f, d, N, T, E, x, _, q, b, S, J, $, K, ae, H, me, Y, V, ce = i.constructor, re = i.s == r.s ? 1 : -1, h = i.d, m = r.d;
521
+ if (!h || !h[0] || !m || !m[0])
529
522
  return new ce(
530
523
  // Return NaN if either NaN, or both Infinity or 0.
531
- !i.s || !r.s || (h ? p && h[0] == p[0] : !p) ? NaN : (
524
+ !i.s || !r.s || (h ? m && h[0] == m[0] : !m) ? NaN : (
532
525
  // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
533
- h && h[0] == 0 || !p ? re * 0 : re / 0
526
+ h && h[0] == 0 || !m ? re * 0 : re / 0
534
527
  )
535
528
  );
536
- for (u ? (y = 1, l = i.e - r.e) : (u = Q, y = T, l = j(i.e / y) - j(r.e / y)), Y = p.length, H = h.length, O = new ce(re), q = O.d = [], f = 0; p[f] == (h[f] || 0); f++) ;
537
- if (p[f] > (h[f] || 0) && l--, s == null ? ($ = s = ce.precision, o = ce.rounding) : a ? $ = s + (i.e - r.e) + 1 : $ = s, $ < 0)
538
- q.push(1), N = !0;
529
+ for (u ? (N = 1, l = i.e - r.e) : (u = X, N = A, l = j(i.e / N) - j(r.e / N)), Y = m.length, H = h.length, _ = new ce(re), q = _.d = [], f = 0; m[f] == (h[f] || 0); f++) ;
530
+ if (m[f] > (h[f] || 0) && l--, s == null ? ($ = s = ce.precision, o = ce.rounding) : a ? $ = s + (i.e - r.e) + 1 : $ = s, $ < 0)
531
+ q.push(1), T = !0;
539
532
  else {
540
- if ($ = $ / y + 2 | 0, f = 0, Y == 1) {
541
- for (d = 0, p = p[0], $++; (f < H || d) && $--; f++)
542
- K = d * u + (h[f] || 0), q[f] = K / p | 0, d = K % p | 0;
543
- N = d || f < H;
533
+ if ($ = $ / N + 2 | 0, f = 0, Y == 1) {
534
+ for (d = 0, m = m[0], $++; (f < H || d) && $--; f++)
535
+ K = d * u + (h[f] || 0), q[f] = K / m | 0, d = K % m | 0;
536
+ T = d || f < H;
544
537
  } else {
545
- for (d = u / (p[0] + 1) | 0, d > 1 && (p = e(p, d, u), h = e(h, d, u), Y = p.length, H = h.length), ae = Y, b = h.slice(0, Y), C = b.length; C < Y; ) b[C++] = 0;
546
- V = p.slice(), V.unshift(0), me = p[0], p[1] >= u / 2 && ++me;
538
+ for (d = u / (m[0] + 1) | 0, d > 1 && (m = e(m, d, u), h = e(h, d, u), Y = m.length, H = h.length), ae = Y, b = h.slice(0, Y), S = b.length; S < Y; ) b[S++] = 0;
539
+ V = m.slice(), V.unshift(0), me = m[0], m[1] >= u / 2 && ++me;
547
540
  do
548
- d = 0, c = t(p, b, Y, C), c < 0 ? (J = b[0], Y != C && (J = J * u + (b[1] || 0)), d = J / me | 0, d > 1 ? (d >= u && (d = u - 1), E = e(p, d, u), x = E.length, C = b.length, c = t(E, b, x, C), c == 1 && (d--, n(E, Y < x ? V : p, x, u))) : (d == 0 && (c = d = 1), E = p.slice()), x = E.length, x < C && E.unshift(0), n(b, E, C, u), c == -1 && (C = b.length, c = t(p, b, Y, C), c < 1 && (d++, n(b, Y < C ? V : p, C, u))), C = b.length) : c === 0 && (d++, b = [0]), q[f++] = d, c && b[0] ? b[C++] = h[ae] || 0 : (b = [h[ae]], C = 1);
541
+ d = 0, c = t(m, b, Y, S), c < 0 ? (J = b[0], Y != S && (J = J * u + (b[1] || 0)), d = J / me | 0, d > 1 ? (d >= u && (d = u - 1), E = e(m, d, u), x = E.length, S = b.length, c = t(E, b, x, S), c == 1 && (d--, n(E, Y < x ? V : m, x, u))) : (d == 0 && (c = d = 1), E = m.slice()), x = E.length, x < S && E.unshift(0), n(b, E, S, u), c == -1 && (S = b.length, c = t(m, b, Y, S), c < 1 && (d++, n(b, Y < S ? V : m, S, u))), S = b.length) : c === 0 && (d++, b = [0]), q[f++] = d, c && b[0] ? b[S++] = h[ae] || 0 : (b = [h[ae]], S = 1);
549
542
  while ((ae++ < H || b[0] !== void 0) && $--);
550
- N = b[0] !== void 0;
543
+ T = b[0] !== void 0;
551
544
  }
552
545
  q[0] || q.shift();
553
546
  }
554
- if (y == 1)
555
- O.e = l, ht = N;
547
+ if (N == 1)
548
+ _.e = l, ht = T;
556
549
  else {
557
550
  for (f = 1, d = q[0]; d >= 10; d /= 10) f++;
558
- O.e = f + l * y - 1, v(O, a ? s + O.e + 1 : s, o, N);
551
+ _.e = f + l * N - 1, v(_, a ? s + _.e + 1 : s, o, T);
559
552
  }
560
- return O;
553
+ return _;
561
554
  };
562
555
  })();
563
556
  function v(e, t, n, i) {
564
- var r, s, o, a, u, c, l, f, d, y = e.constructor;
557
+ var r, s, o, a, u, c, l, f, d, N = e.constructor;
565
558
  e: if (t != null) {
566
559
  if (f = e.d, !f) return e;
567
560
  for (r = 1, a = f[0]; a >= 10; a /= 10) r++;
568
561
  if (s = t - r, s < 0)
569
- s += T, o = t, l = f[d = 0], u = l / P(10, r - o - 1) % 10 | 0;
570
- else if (d = Math.ceil((s + 1) / T), a = f.length, d >= a)
562
+ s += A, o = t, l = f[d = 0], u = l / P(10, r - o - 1) % 10 | 0;
563
+ else if (d = Math.ceil((s + 1) / A), a = f.length, d >= a)
571
564
  if (i) {
572
565
  for (; a++ <= d; ) f.push(0);
573
- l = u = 0, r = 1, s %= T, o = s - T + 1;
566
+ l = u = 0, r = 1, s %= A, o = s - A + 1;
574
567
  } else
575
568
  break e;
576
569
  else {
577
570
  for (l = a = f[d], r = 1; a >= 10; a /= 10) r++;
578
- s %= T, o = s - T + r, u = o < 0 ? 0 : l / P(10, r - o - 1) % 10 | 0;
571
+ s %= A, o = s - A + r, u = o < 0 ? 0 : l / P(10, r - o - 1) % 10 | 0;
579
572
  }
580
573
  if (i = i || t < 0 || f[d + 1] !== void 0 || (o < 0 ? l : l % P(10, r - o - 1)), c = n < 4 ? (u || i) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : u > 5 || u == 5 && (n == 4 || i || n == 6 && // Check whether the digit to the left of the rounding digit is odd.
581
574
  (s > 0 ? o > 0 ? l / P(10, r - o) : 0 : f[d - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7)), t < 1 || !f[0])
582
- return f.length = 0, c ? (t -= e.e + 1, f[0] = P(10, (T - t % T) % T), e.e = -t || 0) : f[0] = e.e = 0, e;
583
- if (s == 0 ? (f.length = d, a = 1, d--) : (f.length = d + 1, a = P(10, T - s), f[d] = o > 0 ? (l / P(10, r - o) % P(10, o) | 0) * a : 0), c)
575
+ return f.length = 0, c ? (t -= e.e + 1, f[0] = P(10, (A - t % A) % A), e.e = -t || 0) : f[0] = e.e = 0, e;
576
+ if (s == 0 ? (f.length = d, a = 1, d--) : (f.length = d + 1, a = P(10, A - s), f[d] = o > 0 ? (l / P(10, r - o) % P(10, o) | 0) * a : 0), c)
584
577
  for (; ; )
585
578
  if (d == 0) {
586
579
  for (s = 1, o = f[0]; o >= 10; o /= 10) s++;
587
580
  for (o = f[0] += a, a = 1; o >= 10; o /= 10) a++;
588
- s != a && (e.e++, f[0] == Q && (f[0] = 1));
581
+ s != a && (e.e++, f[0] == X && (f[0] = 1));
589
582
  break;
590
583
  } else {
591
- if (f[d] += a, f[d] != Q) break;
584
+ if (f[d] += a, f[d] != X) break;
592
585
  f[d--] = 0, a = 1;
593
586
  }
594
587
  for (s = f.length; f[--s] === 0; ) f.pop();
595
588
  }
596
- return I && (e.e > y.maxE ? (e.d = null, e.e = NaN) : e.e < y.minE && (e.e = 0, e.d = [0])), e;
589
+ return O && (e.e > N.maxE ? (e.d = null, e.e = NaN) : e.e < N.minE && (e.e = 0, e.d = [0])), e;
597
590
  }
598
591
  function Z(e, t, n) {
599
- if (!e.isFinite()) return wt(e);
592
+ if (!e.isFinite()) return Tt(e);
600
593
  var i, r = e.e, s = U(e.d), o = s.length;
601
594
  return t ? (n && (i = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) + ee(i) : o > 1 && (s = s.charAt(0) + "." + s.slice(1)), s = s + (e.e < 0 ? "e" : "e+") + e.e) : r < 0 ? (s = "0." + ee(-r - 1) + s, n && (i = n - o) > 0 && (s += ee(i))) : r >= o ? (s += ee(r + 1 - o), n && (i = n - r - 1) > 0 && (s = s + "." + ee(i))) : ((i = r + 1) < o && (s = s.slice(0, i) + "." + s.slice(i)), n && (i = n - o) > 0 && (r + 1 === o && (s += "."), s += ee(i))), s;
602
595
  }
603
596
  function Re(e, t) {
604
597
  var n = e[0];
605
- for (t *= T; n >= 10; n /= 10) t++;
598
+ for (t *= A; n >= 10; n /= 10) t++;
606
599
  return t;
607
600
  }
608
601
  function xe(e, t, n) {
609
602
  if (t > Ut)
610
- throw I = !0, n && (e.precision = n), Error(dt);
603
+ throw O = !0, n && (e.precision = n), Error(dt);
611
604
  return v(new e(De), t, 1, !0);
612
605
  }
613
- function X(e, t, n) {
614
- if (t > He) throw Error(dt);
615
- return v(new e(Se), t, n, !0);
606
+ function Q(e, t, n) {
607
+ if (t > Ge) throw Error(dt);
608
+ return v(new e(Ce), t, n, !0);
616
609
  }
617
610
  function Et(e) {
618
- var t = e.length - 1, n = t * T + 1;
611
+ var t = e.length - 1, n = t * A + 1;
619
612
  if (t = e[t], t) {
620
613
  for (; t % 10 == 0; t /= 10) n--;
621
614
  for (t = e[0]; t >= 10; t /= 10) n++;
@@ -626,21 +619,21 @@ function ee(e) {
626
619
  for (var t = ""; e--; ) t += "0";
627
620
  return t;
628
621
  }
629
- function yt(e, t, n, i) {
630
- var r, s = new e(1), o = Math.ceil(i / T + 4);
631
- for (I = !1; ; ) {
632
- if (n % 2 && (s = s.times(t), nt(s.d, o) && (r = !0)), n = j(n / 2), n === 0) {
622
+ function Nt(e, t, n, i) {
623
+ var r, s = new e(1), o = Math.ceil(i / A + 4);
624
+ for (O = !1; ; ) {
625
+ if (n % 2 && (s = s.times(t), it(s.d, o) && (r = !0)), n = j(n / 2), n === 0) {
633
626
  n = s.d.length - 1, r && s.d[n] === 0 && ++s.d[n];
634
627
  break;
635
628
  }
636
- t = t.times(t), nt(t.d, o);
629
+ t = t.times(t), it(t.d, o);
637
630
  }
638
- return I = !0, s;
631
+ return O = !0, s;
639
632
  }
640
- function tt(e) {
633
+ function nt(e) {
641
634
  return e.d[e.d.length - 1] & 1;
642
635
  }
643
- function Nt(e, t, n) {
636
+ function yt(e, t, n) {
644
637
  for (var i, r = new e(t[0]), s = 0; ++s < t.length; )
645
638
  if (i = new e(t[s]), i.s)
646
639
  r[n](i) && (r = i);
@@ -650,63 +643,63 @@ function Nt(e, t, n) {
650
643
  }
651
644
  return r;
652
645
  }
653
- function Ge(e, t) {
654
- var n, i, r, s, o, a, u, c = 0, l = 0, f = 0, d = e.constructor, y = d.rounding, N = d.precision;
646
+ function Ye(e, t) {
647
+ var n, i, r, s, o, a, u, c = 0, l = 0, f = 0, d = e.constructor, N = d.rounding, T = d.precision;
655
648
  if (!e.d || !e.d[0] || e.e > 17)
656
649
  return new d(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : NaN);
657
- for (t == null ? (I = !1, u = N) : u = t, a = new d(0.03125); e.e > -2; )
650
+ for (t == null ? (O = !1, u = T) : u = t, a = new d(0.03125); e.e > -2; )
658
651
  e = e.times(a), f += 5;
659
652
  for (i = Math.log(P(2, f)) / Math.LN10 * 2 + 5 | 0, u += i, n = s = o = new d(1), d.precision = u; ; ) {
660
653
  if (s = v(s.times(e), u, 1), n = n.times(++l), a = o.plus(R(s, n, u, 1)), U(a.d).slice(0, u) === U(o.d).slice(0, u)) {
661
654
  for (r = f; r--; ) o = v(o.times(o), u, 1);
662
655
  if (t == null)
663
- if (c < 3 && ye(o.d, u - i, y, c))
656
+ if (c < 3 && Ne(o.d, u - i, N, c))
664
657
  d.precision = u += 10, n = s = a = new d(1), l = 0, c++;
665
658
  else
666
- return v(o, d.precision = N, y, I = !0);
659
+ return v(o, d.precision = T, N, O = !0);
667
660
  else
668
- return d.precision = N, o;
661
+ return d.precision = T, o;
669
662
  }
670
663
  o = a;
671
664
  }
672
665
  }
673
666
  function te(e, t) {
674
- var n, i, r, s, o, a, u, c, l, f, d, y = 1, N = 10, E = e, x = E.d, O = E.constructor, q = O.rounding, b = O.precision;
667
+ var n, i, r, s, o, a, u, c, l, f, d, N = 1, T = 10, E = e, x = E.d, _ = E.constructor, q = _.rounding, b = _.precision;
675
668
  if (E.s < 0 || !x || !x[0] || !E.e && x[0] == 1 && x.length == 1)
676
- return new O(x && !x[0] ? -1 / 0 : E.s != 1 ? NaN : x ? 0 : E);
677
- if (t == null ? (I = !1, l = b) : l = t, O.precision = l += N, n = U(x), i = n.charAt(0), Math.abs(s = E.e) < 15e14) {
669
+ return new _(x && !x[0] ? -1 / 0 : E.s != 1 ? NaN : x ? 0 : E);
670
+ if (t == null ? (O = !1, l = b) : l = t, _.precision = l += T, n = U(x), i = n.charAt(0), Math.abs(s = E.e) < 15e14) {
678
671
  for (; i < 7 && i != 1 || i == 1 && n.charAt(1) > 3; )
679
- E = E.times(e), n = U(E.d), i = n.charAt(0), y++;
680
- s = E.e, i > 1 ? (E = new O("0." + n), s++) : E = new O(i + "." + n.slice(1));
672
+ E = E.times(e), n = U(E.d), i = n.charAt(0), N++;
673
+ s = E.e, i > 1 ? (E = new _("0." + n), s++) : E = new _(i + "." + n.slice(1));
681
674
  } else
682
- return c = xe(O, l + 2, b).times(s + ""), E = te(new O(i + "." + n.slice(1)), l - N).plus(c), O.precision = b, t == null ? v(E, b, q, I = !0) : E;
675
+ return c = xe(_, l + 2, b).times(s + ""), E = te(new _(i + "." + n.slice(1)), l - T).plus(c), _.precision = b, t == null ? v(E, b, q, O = !0) : E;
683
676
  for (f = E, u = o = E = R(E.minus(1), E.plus(1), l, 1), d = v(E.times(E), l, 1), r = 3; ; ) {
684
- if (o = v(o.times(d), l, 1), c = u.plus(R(o, new O(r), l, 1)), U(c.d).slice(0, l) === U(u.d).slice(0, l))
685
- if (u = u.times(2), s !== 0 && (u = u.plus(xe(O, l + 2, b).times(s + ""))), u = R(u, new O(y), l, 1), t == null)
686
- if (ye(u.d, l - N, q, a))
687
- O.precision = l += N, c = o = E = R(f.minus(1), f.plus(1), l, 1), d = v(E.times(E), l, 1), r = a = 1;
677
+ if (o = v(o.times(d), l, 1), c = u.plus(R(o, new _(r), l, 1)), U(c.d).slice(0, l) === U(u.d).slice(0, l))
678
+ if (u = u.times(2), s !== 0 && (u = u.plus(xe(_, l + 2, b).times(s + ""))), u = R(u, new _(N), l, 1), t == null)
679
+ if (Ne(u.d, l - T, q, a))
680
+ _.precision = l += T, c = o = E = R(f.minus(1), f.plus(1), l, 1), d = v(E.times(E), l, 1), r = a = 1;
688
681
  else
689
- return v(u, O.precision = b, q, I = !0);
682
+ return v(u, _.precision = b, q, O = !0);
690
683
  else
691
- return O.precision = b, u;
684
+ return _.precision = b, u;
692
685
  u = c, r += 2;
693
686
  }
694
687
  }
695
- function wt(e) {
688
+ function Tt(e) {
696
689
  return String(e.s * e.s / 0);
697
690
  }
698
- function Ye(e, t) {
691
+ function Je(e, t) {
699
692
  var n, i, r;
700
693
  for ((n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (i = t.search(/e/i)) > 0 ? (n < 0 && (n = i), n += +t.slice(i + 1), t = t.substring(0, i)) : n < 0 && (n = t.length), i = 0; t.charCodeAt(i) === 48; i++) ;
701
694
  for (r = t.length; t.charCodeAt(r - 1) === 48; --r) ;
702
695
  if (t = t.slice(i, r), t) {
703
- if (r -= i, e.e = n = n - i - 1, e.d = [], i = (n + 1) % T, n < 0 && (i += T), i < r) {
704
- for (i && e.d.push(+t.slice(0, i)), r -= T; i < r; ) e.d.push(+t.slice(i, i += T));
705
- t = t.slice(i), i = T - t.length;
696
+ if (r -= i, e.e = n = n - i - 1, e.d = [], i = (n + 1) % A, n < 0 && (i += A), i < r) {
697
+ for (i && e.d.push(+t.slice(0, i)), r -= A; i < r; ) e.d.push(+t.slice(i, i += A));
698
+ t = t.slice(i), i = A - t.length;
706
699
  } else
707
700
  i -= r;
708
701
  for (; i--; ) t += "0";
709
- e.d.push(+t), I && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
702
+ e.d.push(+t), O && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
710
703
  } else
711
704
  e.e = 0, e.d = [0];
712
705
  return e;
@@ -714,7 +707,7 @@ function Ye(e, t) {
714
707
  function Vt(e, t) {
715
708
  var n, i, r, s, o, a, u, c, l;
716
709
  if (t.indexOf("_") > -1) {
717
- if (t = t.replace(/(\d)_(?=\d)/g, "$1"), gt.test(t)) return Ye(e, t);
710
+ if (t = t.replace(/(\d)_(?=\d)/g, "$1"), gt.test(t)) return Je(e, t);
718
711
  } else if (t === "Infinity" || t === "NaN")
719
712
  return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
720
713
  if (Pt.test(t))
@@ -725,8 +718,8 @@ function Vt(e, t) {
725
718
  n = 8;
726
719
  else
727
720
  throw Error(ne + t);
728
- for (s = t.search(/p/i), s > 0 ? (u = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), o = s >= 0, i = e.constructor, o && (t = t.replace(".", ""), a = t.length, s = a - s, r = yt(i, new i(n), s, s * 2)), c = Ie(t, n, Q), l = c.length - 1, s = l; c[s] === 0; --s) c.pop();
729
- return s < 0 ? new i(e.s * 0) : (e.e = Re(c, l), e.d = c, I = !1, o && (e = R(e, r, a * 4)), u && (e = e.times(Math.abs(u) < 54 ? P(2, u) : de.pow(2, u))), I = !0, e);
721
+ for (s = t.search(/p/i), s > 0 ? (u = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), o = s >= 0, i = e.constructor, o && (t = t.replace(".", ""), a = t.length, s = a - s, r = Nt(i, new i(n), s, s * 2)), c = Oe(t, n, X), l = c.length - 1, s = l; c[s] === 0; --s) c.pop();
722
+ return s < 0 ? new i(e.s * 0) : (e.e = Re(c, l), e.d = c, O = !1, o && (e = R(e, r, a * 4)), u && (e = e.times(Math.abs(u) < 54 ? P(2, u) : de.pow(2, u))), O = !0, e);
730
723
  }
731
724
  function jt(e, t) {
732
725
  var n, i = t.d.length;
@@ -738,53 +731,53 @@ function jt(e, t) {
738
731
  return t;
739
732
  }
740
733
  function he(e, t, n, i, r) {
741
- var s, o, a, u, c = e.precision, l = Math.ceil(c / T);
742
- for (I = !1, u = n.times(n), a = new e(i); ; ) {
734
+ var s, o, a, u, c = e.precision, l = Math.ceil(c / A);
735
+ for (O = !1, u = n.times(n), a = new e(i); ; ) {
743
736
  if (o = R(a.times(u), new e(t++ * t++), c, 1), a = r ? i.plus(o) : i.minus(o), i = R(o.times(u), new e(t++ * t++), c, 1), o = a.plus(i), o.d[l] !== void 0) {
744
737
  for (s = l; o.d[s] === a.d[s] && s--; ) ;
745
738
  if (s == -1) break;
746
739
  }
747
740
  s = a, a = i, i = o, o = s;
748
741
  }
749
- return I = !0, o.d.length = l + 1, o;
742
+ return O = !0, o.d.length = l + 1, o;
750
743
  }
751
744
  function Le(e, t) {
752
745
  for (var n = e; --t; ) n *= e;
753
746
  return n;
754
747
  }
755
748
  function vt(e, t) {
756
- var n, i = t.s < 0, r = X(e, e.precision, 1), s = r.times(0.5);
749
+ var n, i = t.s < 0, r = Q(e, e.precision, 1), s = r.times(0.5);
757
750
  if (t = t.abs(), t.lte(s))
758
751
  return W = i ? 4 : 1, t;
759
752
  if (n = t.divToInt(r), n.isZero())
760
753
  W = i ? 3 : 2;
761
754
  else {
762
755
  if (t = t.minus(n.times(r)), t.lte(s))
763
- return W = tt(n) ? i ? 2 : 3 : i ? 4 : 1, t;
764
- W = tt(n) ? i ? 1 : 4 : i ? 3 : 2;
756
+ return W = nt(n) ? i ? 2 : 3 : i ? 4 : 1, t;
757
+ W = nt(n) ? i ? 1 : 4 : i ? 3 : 2;
765
758
  }
766
759
  return t.minus(r).abs();
767
760
  }
768
- function Qe(e, t, n, i) {
769
- var r, s, o, a, u, c, l, f, d, y = e.constructor, N = n !== void 0;
770
- if (N ? (G(n, 1, ie), i === void 0 ? i = y.rounding : G(i, 0, 8)) : (n = y.precision, i = y.rounding), !e.isFinite())
771
- l = wt(e);
761
+ function Ze(e, t, n, i) {
762
+ var r, s, o, a, u, c, l, f, d, N = e.constructor, T = n !== void 0;
763
+ if (T ? (G(n, 1, ie), i === void 0 ? i = N.rounding : G(i, 0, 8)) : (n = N.precision, i = N.rounding), !e.isFinite())
764
+ l = Tt(e);
772
765
  else {
773
- for (l = Z(e), o = l.indexOf("."), N ? (r = 2, t == 16 ? n = n * 4 - 3 : t == 8 && (n = n * 3 - 2)) : r = t, o >= 0 && (l = l.replace(".", ""), d = new y(1), d.e = l.length - o, d.d = Ie(Z(d), 10, r), d.e = d.d.length), f = Ie(l, 10, r), s = u = f.length; f[--u] == 0; ) f.pop();
766
+ for (l = Z(e), o = l.indexOf("."), T ? (r = 2, t == 16 ? n = n * 4 - 3 : t == 8 && (n = n * 3 - 2)) : r = t, o >= 0 && (l = l.replace(".", ""), d = new N(1), d.e = l.length - o, d.d = Oe(Z(d), 10, r), d.e = d.d.length), f = Oe(l, 10, r), s = u = f.length; f[--u] == 0; ) f.pop();
774
767
  if (!f[0])
775
- l = N ? "0p+0" : "0";
768
+ l = T ? "0p+0" : "0";
776
769
  else {
777
- if (o < 0 ? s-- : (e = new y(e), e.d = f, e.e = s, e = R(e, d, n, i, 0, r), f = e.d, s = e.e, c = ht), o = f[n], a = r / 2, c = c || f[n + 1] !== void 0, c = i < 4 ? (o !== void 0 || c) && (i === 0 || i === (e.s < 0 ? 3 : 2)) : o > a || o === a && (i === 4 || c || i === 6 && f[n - 1] & 1 || i === (e.s < 0 ? 8 : 7)), f.length = n, c)
770
+ if (o < 0 ? s-- : (e = new N(e), e.d = f, e.e = s, e = R(e, d, n, i, 0, r), f = e.d, s = e.e, c = ht), o = f[n], a = r / 2, c = c || f[n + 1] !== void 0, c = i < 4 ? (o !== void 0 || c) && (i === 0 || i === (e.s < 0 ? 3 : 2)) : o > a || o === a && (i === 4 || c || i === 6 && f[n - 1] & 1 || i === (e.s < 0 ? 8 : 7)), f.length = n, c)
778
771
  for (; ++f[--n] > r - 1; )
779
772
  f[n] = 0, n || (++s, f.unshift(1));
780
773
  for (u = f.length; !f[u - 1]; --u) ;
781
- for (o = 0, l = ""; o < u; o++) l += je.charAt(f[o]);
782
- if (N) {
774
+ for (o = 0, l = ""; o < u; o++) l += $e.charAt(f[o]);
775
+ if (T) {
783
776
  if (u > 1)
784
777
  if (t == 16 || t == 8) {
785
778
  for (o = t == 16 ? 4 : 3, --u; u % o; u++) l += "0";
786
- for (f = Ie(l, r, t), u = f.length; !f[u - 1]; --u) ;
787
- for (o = 1, l = "1."; o < u; o++) l += je.charAt(f[o]);
779
+ for (f = Oe(l, r, t), u = f.length; !f[u - 1]; --u) ;
780
+ for (o = 1, l = "1."; o < u; o++) l += $e.charAt(f[o]);
788
781
  } else
789
782
  l = l.charAt(0) + "." + l.slice(1);
790
783
  l = l + (s < 0 ? "p" : "p+") + s;
@@ -798,7 +791,7 @@ function Qe(e, t, n, i) {
798
791
  }
799
792
  return e.s < 0 ? "-" + l : l;
800
793
  }
801
- function nt(e, t) {
794
+ function it(e, t) {
802
795
  if (e.length > t)
803
796
  return e.length = t, !0;
804
797
  }
@@ -820,16 +813,16 @@ function Jt(e) {
820
813
  function zt(e) {
821
814
  return new this(e).asinh();
822
815
  }
823
- function Xt(e) {
816
+ function Qt(e) {
824
817
  return new this(e).atan();
825
818
  }
826
- function Qt(e) {
819
+ function Xt(e) {
827
820
  return new this(e).atanh();
828
821
  }
829
822
  function Zt(e, t) {
830
823
  e = new this(e), t = new this(t);
831
824
  var n, i = this.precision, r = this.rounding, s = i + 4;
832
- return !e.s || !t.s ? n = new this(NaN) : !e.d && !t.d ? (n = X(this, s, 1).times(t.s > 0 ? 0.25 : 0.75), n.s = e.s) : !t.d || e.isZero() ? (n = t.s < 0 ? X(this, i, r) : new this(0), n.s = e.s) : !e.d || t.isZero() ? (n = X(this, s, 1).times(0.5), n.s = e.s) : t.s < 0 ? (this.precision = s, this.rounding = 1, n = this.atan(R(e, t, s, 1)), t = X(this, s, 1), this.precision = i, this.rounding = r, n = e.s < 0 ? n.minus(t) : n.plus(t)) : n = this.atan(R(e, t, s, 1)), n;
825
+ return !e.s || !t.s ? n = new this(NaN) : !e.d && !t.d ? (n = Q(this, s, 1).times(t.s > 0 ? 0.25 : 0.75), n.s = e.s) : !t.d || e.isZero() ? (n = t.s < 0 ? Q(this, i, r) : new this(0), n.s = e.s) : !e.d || t.isZero() ? (n = Q(this, s, 1).times(0.5), n.s = e.s) : t.s < 0 ? (this.precision = s, this.rounding = 1, n = this.atan(R(e, t, s, 1)), t = Q(this, s, 1), this.precision = i, this.rounding = r, n = e.s < 0 ? n.minus(t) : n.plus(t)) : n = this.atan(R(e, t, s, 1)), n;
833
826
  }
834
827
  function Wt(e) {
835
828
  return new this(e).cbrt();
@@ -866,10 +859,10 @@ function tn(e) {
866
859
  9
867
860
  ];
868
861
  for (t = 0; t < s.length; t += 3)
869
- if (n = s[t], r && (this[n] = $e[n]), (i = e[n]) !== void 0)
862
+ if (n = s[t], r && (this[n] = He[n]), (i = e[n]) !== void 0)
870
863
  if (j(i) === i && i >= s[t + 1] && i <= s[t + 2]) this[n] = i;
871
864
  else throw Error(ne + n + ": " + i);
872
- if (n = "crypto", r && (this[n] = $e[n]), (i = e[n]) !== void 0)
865
+ if (n = "crypto", r && (this[n] = He[n]), (i = e[n]) !== void 0)
873
866
  if (i === !0 || i === !1 || i === 0 || i === 1)
874
867
  if (i)
875
868
  if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
@@ -888,13 +881,13 @@ function nn(e) {
888
881
  function rn(e) {
889
882
  return new this(e).cosh();
890
883
  }
891
- function Tt(e) {
884
+ function wt(e) {
892
885
  var t, n, i;
893
886
  function r(s) {
894
887
  var o, a, u, c = this;
895
888
  if (!(c instanceof r)) return new r(s);
896
- if (c.constructor = r, it(s)) {
897
- c.s = s.s, I ? !s.d || s.e > r.maxE ? (c.e = NaN, c.d = null) : s.e < r.minE ? (c.e = 0, c.d = [0]) : (c.e = s.e, c.d = s.d.slice()) : (c.e = s.e, c.d = s.d ? s.d.slice() : s.d);
889
+ if (c.constructor = r, rt(s)) {
890
+ c.s = s.s, O ? !s.d || s.e > r.maxE ? (c.e = NaN, c.d = null) : s.e < r.minE ? (c.e = 0, c.d = [0]) : (c.e = s.e, c.d = s.d.slice()) : (c.e = s.e, c.d = s.d ? s.d.slice() : s.d);
898
891
  return;
899
892
  }
900
893
  if (u = typeof s, u === "number") {
@@ -904,18 +897,18 @@ function Tt(e) {
904
897
  }
905
898
  if (s < 0 ? (s = -s, c.s = -1) : c.s = 1, s === ~~s && s < 1e7) {
906
899
  for (o = 0, a = s; a >= 10; a /= 10) o++;
907
- I ? o > r.maxE ? (c.e = NaN, c.d = null) : o < r.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [s]) : (c.e = o, c.d = [s]);
900
+ O ? o > r.maxE ? (c.e = NaN, c.d = null) : o < r.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [s]) : (c.e = o, c.d = [s]);
908
901
  return;
909
902
  } else if (s * 0 !== 0) {
910
903
  s || (c.s = NaN), c.e = NaN, c.d = null;
911
904
  return;
912
905
  }
913
- return Ye(c, s.toString());
906
+ return Je(c, s.toString());
914
907
  } else if (u !== "string")
915
908
  throw Error(ne + s);
916
- return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), c.s = -1) : (a === 43 && (s = s.slice(1)), c.s = 1), gt.test(s) ? Ye(c, s) : Vt(c, s);
909
+ return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), c.s = -1) : (a === 43 && (s = s.slice(1)), c.s = 1), gt.test(s) ? Je(c, s) : Vt(c, s);
917
910
  }
918
- if (r.prototype = g, r.ROUND_UP = 0, r.ROUND_DOWN = 1, r.ROUND_CEIL = 2, r.ROUND_FLOOR = 3, r.ROUND_HALF_UP = 4, r.ROUND_HALF_DOWN = 5, r.ROUND_HALF_EVEN = 6, r.ROUND_HALF_CEIL = 7, r.ROUND_HALF_FLOOR = 8, r.EUCLID = 9, r.config = r.set = tn, r.clone = Tt, r.isDecimal = it, r.abs = $t, r.acos = Ht, r.acosh = Gt, r.add = Yt, r.asin = Jt, r.asinh = zt, r.atan = Xt, r.atanh = Qt, r.atan2 = Zt, r.cbrt = Wt, r.ceil = Kt, r.clamp = en, r.cos = nn, r.cosh = rn, r.div = sn, r.exp = on, r.floor = an, r.hypot = cn, r.ln = un, r.log = ln, r.log10 = hn, r.log2 = fn, r.max = dn, r.min = pn, r.mod = mn, r.mul = gn, r.pow = En, r.random = yn, r.round = Nn, r.sign = wn, r.sin = vn, r.sinh = Tn, r.sqrt = An, r.sub = In, r.sum = On, r.tan = bn, r.tanh = _n, r.trunc = Dn, e === void 0 && (e = {}), e && e.defaults !== !0)
911
+ if (r.prototype = g, r.ROUND_UP = 0, r.ROUND_DOWN = 1, r.ROUND_CEIL = 2, r.ROUND_FLOOR = 3, r.ROUND_HALF_UP = 4, r.ROUND_HALF_DOWN = 5, r.ROUND_HALF_EVEN = 6, r.ROUND_HALF_CEIL = 7, r.ROUND_HALF_FLOOR = 8, r.EUCLID = 9, r.config = r.set = tn, r.clone = wt, r.isDecimal = rt, r.abs = $t, r.acos = Ht, r.acosh = Gt, r.add = Yt, r.asin = Jt, r.asinh = zt, r.atan = Qt, r.atanh = Xt, r.atan2 = Zt, r.cbrt = Wt, r.ceil = Kt, r.clamp = en, r.cos = nn, r.cosh = rn, r.div = sn, r.exp = on, r.floor = an, r.hypot = cn, r.ln = un, r.log = ln, r.log10 = hn, r.log2 = fn, r.max = dn, r.min = pn, r.mod = mn, r.mul = gn, r.pow = En, r.random = Nn, r.round = yn, r.sign = Tn, r.sin = vn, r.sinh = wn, r.sqrt = An, r.sub = On, r.sum = In, r.tan = _n, r.tanh = bn, r.trunc = Dn, e === void 0 && (e = {}), e && e.defaults !== !0)
919
912
  for (i = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], t = 0; t < i.length; ) e.hasOwnProperty(n = i[t++]) || (e[n] = this[n]);
920
913
  return r.config(e), r;
921
914
  }
@@ -930,17 +923,17 @@ function an(e) {
930
923
  }
931
924
  function cn() {
932
925
  var e, t, n = new this(0);
933
- for (I = !1, e = 0; e < arguments.length; )
926
+ for (O = !1, e = 0; e < arguments.length; )
934
927
  if (t = new this(arguments[e++]), t.d)
935
928
  n.d && (n = n.plus(t.times(t)));
936
929
  else {
937
930
  if (t.s)
938
- return I = !0, new this(1 / 0);
931
+ return O = !0, new this(1 / 0);
939
932
  n = t;
940
933
  }
941
- return I = !0, n.sqrt();
934
+ return O = !0, n.sqrt();
942
935
  }
943
- function it(e) {
936
+ function rt(e) {
944
937
  return e instanceof de || e && e.toStringTag === mt || !1;
945
938
  }
946
939
  function un(e) {
@@ -956,10 +949,10 @@ function hn(e) {
956
949
  return new this(e).log(10);
957
950
  }
958
951
  function dn() {
959
- return Nt(this, arguments, "lt");
952
+ return yt(this, arguments, "lt");
960
953
  }
961
954
  function pn() {
962
- return Nt(this, arguments, "gt");
955
+ return yt(this, arguments, "gt");
963
956
  }
964
957
  function mn(e, t) {
965
958
  return new this(e).mod(t);
@@ -970,9 +963,9 @@ function gn(e, t) {
970
963
  function En(e, t) {
971
964
  return new this(e).pow(t);
972
965
  }
973
- function yn(e) {
966
+ function Nn(e) {
974
967
  var t, n, i, r, s = 0, o = new this(1), a = [];
975
- if (e === void 0 ? e = this.precision : G(e, 1, ie), i = Math.ceil(e / T), this.crypto)
968
+ if (e === void 0 ? e = this.precision : G(e, 1, ie), i = Math.ceil(e / A), this.crypto)
976
969
  if (crypto.getRandomValues)
977
970
  for (t = crypto.getRandomValues(new Uint32Array(i)); s < i; )
978
971
  r = t[s], r >= 429e7 ? t[s] = crypto.getRandomValues(new Uint32Array(1))[0] : a[s++] = r % 1e7;
@@ -983,59 +976,59 @@ function yn(e) {
983
976
  } else
984
977
  throw Error(pt);
985
978
  else for (; s < i; ) a[s++] = Math.random() * 1e7 | 0;
986
- for (i = a[--s], e %= T, i && e && (r = P(10, T - e), a[s] = (i / r | 0) * r); a[s] === 0; s--) a.pop();
979
+ for (i = a[--s], e %= A, i && e && (r = P(10, A - e), a[s] = (i / r | 0) * r); a[s] === 0; s--) a.pop();
987
980
  if (s < 0)
988
981
  n = 0, a = [0];
989
982
  else {
990
- for (n = -1; a[0] === 0; n -= T) a.shift();
983
+ for (n = -1; a[0] === 0; n -= A) a.shift();
991
984
  for (i = 1, r = a[0]; r >= 10; r /= 10) i++;
992
- i < T && (n -= T - i);
985
+ i < A && (n -= A - i);
993
986
  }
994
987
  return o.e = n, o.d = a, o;
995
988
  }
996
- function Nn(e) {
989
+ function yn(e) {
997
990
  return v(e = new this(e), e.e + 1, this.rounding);
998
991
  }
999
- function wn(e) {
992
+ function Tn(e) {
1000
993
  return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
1001
994
  }
1002
995
  function vn(e) {
1003
996
  return new this(e).sin();
1004
997
  }
1005
- function Tn(e) {
998
+ function wn(e) {
1006
999
  return new this(e).sinh();
1007
1000
  }
1008
1001
  function An(e) {
1009
1002
  return new this(e).sqrt();
1010
1003
  }
1011
- function In(e, t) {
1004
+ function On(e, t) {
1012
1005
  return new this(e).sub(t);
1013
1006
  }
1014
- function On() {
1007
+ function In() {
1015
1008
  var e = 0, t = arguments, n = new this(t[e]);
1016
- for (I = !1; n.s && ++e < t.length; ) n = n.plus(t[e]);
1017
- return I = !0, v(n, this.precision, this.rounding);
1009
+ for (O = !1; n.s && ++e < t.length; ) n = n.plus(t[e]);
1010
+ return O = !0, v(n, this.precision, this.rounding);
1018
1011
  }
1019
- function bn(e) {
1012
+ function _n(e) {
1020
1013
  return new this(e).tan();
1021
1014
  }
1022
- function _n(e) {
1015
+ function bn(e) {
1023
1016
  return new this(e).tanh();
1024
1017
  }
1025
1018
  function Dn(e) {
1026
1019
  return v(e = new this(e), e.e + 1, 1);
1027
1020
  }
1028
- g[Symbol.for("nodejs.util.inspect.custom")] = g.toString;
1021
+ g[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = g.toString;
1029
1022
  g[Symbol.toStringTag] = "Decimal";
1030
- var de = g.constructor = Tt($e);
1023
+ var de = g.constructor = wt(He);
1031
1024
  De = new de(De);
1032
- Se = new de(Se);
1033
- const Ze = JSON, Sn = (e) => e.toUpperCase(), xn = (e) => {
1025
+ Ce = new de(Ce);
1026
+ const We = JSON, Cn = (e) => e.toUpperCase(), xn = (e) => {
1034
1027
  const t = {};
1035
1028
  return e.forEach((n, i) => {
1036
1029
  t[i] = n;
1037
1030
  }), t;
1038
- }, Cn = (e, t, n) => e.document ? e : {
1031
+ }, Sn = (e, t, n) => e.document ? e : {
1039
1032
  document: e,
1040
1033
  variables: t,
1041
1034
  requestHeaders: n,
@@ -1050,7 +1043,7 @@ const Ze = JSON, Sn = (e) => e.toUpperCase(), xn = (e) => {
1050
1043
  requestHeaders: t,
1051
1044
  signal: void 0
1052
1045
  };
1053
- function Oe(e, t) {
1046
+ function Ie(e, t) {
1054
1047
  if (!!!e)
1055
1048
  throw new Error(t);
1056
1049
  }
@@ -1064,7 +1057,7 @@ function Fn(e, t) {
1064
1057
  );
1065
1058
  }
1066
1059
  const Pn = /\r\n|[\n\r]/g;
1067
- function Je(e, t) {
1060
+ function ze(e, t) {
1068
1061
  let n = 0, i = 1;
1069
1062
  for (const r of e.body.matchAll(Pn)) {
1070
1063
  if (typeof r.index == "number" || Fn(!1), r.index >= t)
@@ -1079,24 +1072,24 @@ function Je(e, t) {
1079
1072
  function Mn(e) {
1080
1073
  return At(
1081
1074
  e.source,
1082
- Je(e.source, e.start)
1075
+ ze(e.source, e.start)
1083
1076
  );
1084
1077
  }
1085
1078
  function At(e, t) {
1086
1079
  const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, a = t.line === 1 ? n : 0, u = t.column + a, c = `${e.name}:${o}:${u}
1087
1080
  `, l = i.split(/\r\n|[\n\r]/g), f = l[r];
1088
1081
  if (f.length > 120) {
1089
- const d = Math.floor(u / 80), y = u % 80, N = [];
1082
+ const d = Math.floor(u / 80), N = u % 80, T = [];
1090
1083
  for (let E = 0; E < f.length; E += 80)
1091
- N.push(f.slice(E, E + 80));
1092
- return c + rt([
1093
- [`${o} |`, N[0]],
1094
- ...N.slice(1, d + 1).map((E) => ["|", E]),
1095
- ["|", "^".padStart(y)],
1096
- ["|", N[d + 1]]
1084
+ T.push(f.slice(E, E + 80));
1085
+ return c + st([
1086
+ [`${o} |`, T[0]],
1087
+ ...T.slice(1, d + 1).map((E) => ["|", E]),
1088
+ ["|", "^".padStart(N)],
1089
+ ["|", T[d + 1]]
1097
1090
  ]);
1098
1091
  }
1099
- return c + rt([
1092
+ return c + st([
1100
1093
  // Lines specified like this: ["prefix", "string"],
1101
1094
  [`${o - 1} |`, l[r - 1]],
1102
1095
  [`${o} |`, f],
@@ -1104,7 +1097,7 @@ function At(e, t) {
1104
1097
  [`${o + 1} |`, l[r + 1]]
1105
1098
  ]);
1106
1099
  }
1107
- function rt(e) {
1100
+ function st(e) {
1108
1101
  const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
1109
1102
  return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
1110
1103
  `);
@@ -1120,7 +1113,7 @@ function Bn(e) {
1120
1113
  extensions: e[5]
1121
1114
  } : t;
1122
1115
  }
1123
- class We extends Error {
1116
+ class Ke extends Error {
1124
1117
  /**
1125
1118
  * An array of `{ line, column }` locations within the source GraphQL document
1126
1119
  * which correspond to this error.
@@ -1162,17 +1155,17 @@ class We extends Error {
1162
1155
  constructor(t, ...n) {
1163
1156
  var i, r, s;
1164
1157
  const { nodes: o, source: a, positions: u, path: c, originalError: l, extensions: f } = Bn(n);
1165
- super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = l ?? void 0, this.nodes = st(
1158
+ super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = l ?? void 0, this.nodes = ot(
1166
1159
  Array.isArray(o) ? o : o ? [o] : void 0
1167
1160
  );
1168
- const d = st(
1169
- (i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null)
1161
+ const d = ot(
1162
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((T) => T.loc).filter((T) => T != null)
1170
1163
  );
1171
- this.source = a ?? (d == null || (r = d[0]) === null || r === void 0 ? void 0 : r.source), this.positions = u ?? d?.map((N) => N.start), this.locations = u && a ? u.map((N) => Je(a, N)) : d?.map((N) => Je(N.source, N.start));
1172
- const y = Ln(
1164
+ this.source = a ?? (d == null || (r = d[0]) === null || r === void 0 ? void 0 : r.source), this.positions = u ?? d?.map((T) => T.start), this.locations = u && a ? u.map((T) => ze(a, T)) : d?.map((T) => ze(T.source, T.start));
1165
+ const N = Ln(
1173
1166
  l?.extensions
1174
1167
  ) ? l?.extensions : void 0;
1175
- this.extensions = (s = f ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
1168
+ this.extensions = (s = f ?? N) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
1176
1169
  message: {
1177
1170
  writable: !0,
1178
1171
  enumerable: !0
@@ -1196,7 +1189,7 @@ class We extends Error {
1196
1189
  value: l.stack,
1197
1190
  writable: !0,
1198
1191
  configurable: !0
1199
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, We) : Object.defineProperty(this, "stack", {
1192
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ke) : Object.defineProperty(this, "stack", {
1200
1193
  value: Error().stack,
1201
1194
  writable: !0,
1202
1195
  configurable: !0
@@ -1226,11 +1219,11 @@ class We extends Error {
1226
1219
  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;
1227
1220
  }
1228
1221
  }
1229
- function st(e) {
1222
+ function ot(e) {
1230
1223
  return e === void 0 || e.length === 0 ? void 0 : e;
1231
1224
  }
1232
1225
  function M(e, t, n) {
1233
- return new We(`Syntax Error: ${n}`, {
1226
+ return new Ke(`Syntax Error: ${n}`, {
1234
1227
  source: e,
1235
1228
  positions: [t]
1236
1229
  });
@@ -1264,7 +1257,7 @@ class Un {
1264
1257
  };
1265
1258
  }
1266
1259
  }
1267
- class It {
1260
+ class Ot {
1268
1261
  /**
1269
1262
  * The kind of Token.
1270
1263
  */
@@ -1306,16 +1299,23 @@ class It {
1306
1299
  };
1307
1300
  }
1308
1301
  }
1309
- const Ot = {
1302
+ const It = {
1310
1303
  Name: [],
1311
1304
  Document: ["definitions"],
1312
1305
  OperationDefinition: [
1306
+ "description",
1313
1307
  "name",
1314
1308
  "variableDefinitions",
1315
1309
  "directives",
1316
1310
  "selectionSet"
1317
1311
  ],
1318
- VariableDefinition: ["variable", "type", "defaultValue", "directives"],
1312
+ VariableDefinition: [
1313
+ "description",
1314
+ "variable",
1315
+ "type",
1316
+ "defaultValue",
1317
+ "directives"
1318
+ ],
1319
1319
  Variable: ["name"],
1320
1320
  SelectionSet: ["selections"],
1321
1321
  Field: ["alias", "name", "arguments", "directives", "selectionSet"],
@@ -1323,6 +1323,7 @@ const Ot = {
1323
1323
  FragmentSpread: ["name", "directives"],
1324
1324
  InlineFragment: ["typeCondition", "directives", "selectionSet"],
1325
1325
  FragmentDefinition: [
1326
+ "description",
1326
1327
  "name",
1327
1328
  // Note: fragment variable definitions are deprecated and will removed in v17.0.0
1328
1329
  "variableDefinitions",
@@ -1379,9 +1380,14 @@ const Ot = {
1379
1380
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
1380
1381
  UnionTypeExtension: ["name", "directives", "types"],
1381
1382
  EnumTypeExtension: ["name", "directives", "values"],
1382
- InputObjectTypeExtension: ["name", "directives", "fields"]
1383
- }, qn = new Set(Object.keys(Ot));
1384
- function ot(e) {
1383
+ InputObjectTypeExtension: ["name", "directives", "fields"],
1384
+ TypeCoordinate: ["name"],
1385
+ MemberCoordinate: ["name", "memberName"],
1386
+ ArgumentCoordinate: ["name", "fieldName", "argumentName"],
1387
+ DirectiveCoordinate: ["name"],
1388
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
1389
+ }, qn = new Set(Object.keys(It));
1390
+ function at(e) {
1385
1391
  const t = e?.kind;
1386
1392
  return typeof t == "string" && qn.has(t);
1387
1393
  }
@@ -1389,29 +1395,29 @@ var fe;
1389
1395
  (function(e) {
1390
1396
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
1391
1397
  })(fe || (fe = {}));
1392
- var ze;
1398
+ var Qe;
1393
1399
  (function(e) {
1394
1400
  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";
1395
- })(ze || (ze = {}));
1396
- var A;
1401
+ })(Qe || (Qe = {}));
1402
+ var w;
1397
1403
  (function(e) {
1398
- 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";
1399
- })(A || (A = {}));
1404
+ e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
1405
+ })(w || (w = {}));
1400
1406
  function Xe(e) {
1401
1407
  return e === 9 || e === 32;
1402
1408
  }
1403
- function Ne(e) {
1409
+ function ye(e) {
1404
1410
  return e >= 48 && e <= 57;
1405
1411
  }
1406
- function bt(e) {
1412
+ function _t(e) {
1407
1413
  return e >= 97 && e <= 122 || // A-Z
1408
1414
  e >= 65 && e <= 90;
1409
1415
  }
1410
- function _t(e) {
1411
- return bt(e) || e === 95;
1416
+ function bt(e) {
1417
+ return _t(e) || e === 95;
1412
1418
  }
1413
1419
  function Vn(e) {
1414
- return bt(e) || Ne(e) || e === 95;
1420
+ return _t(e) || ye(e) || e === 95;
1415
1421
  }
1416
1422
  function jn(e) {
1417
1423
  var t;
@@ -1433,7 +1439,7 @@ function $n(e) {
1433
1439
  return t;
1434
1440
  }
1435
1441
  function Hn(e, t) {
1436
- const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((y) => y.length === 0 || Xe(y.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, u = e.endsWith("\\"), c = a || u, l = (
1442
+ const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((N) => N.length === 0 || Xe(N.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, u = e.endsWith("\\"), c = a || u, l = (
1437
1443
  // add leading and trailing new lines only if it improves readability
1438
1444
  !r || e.length > 70 || c || s || o
1439
1445
  );
@@ -1443,10 +1449,10 @@ function Hn(e, t) {
1443
1449
  `), f += n, (l || c) && (f += `
1444
1450
  `), '"""' + f + '"""';
1445
1451
  }
1446
- var m;
1452
+ var p;
1447
1453
  (function(e) {
1448
- 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";
1449
- })(m || (m = {}));
1454
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
1455
+ })(p || (p = {}));
1450
1456
  class Gn {
1451
1457
  /**
1452
1458
  * The previously focused non-ignored token.
@@ -1461,7 +1467,7 @@ class Gn {
1461
1467
  * The character offset at which the current line begins.
1462
1468
  */
1463
1469
  constructor(t) {
1464
- const n = new It(m.SOF, 0, 0, 0, 0);
1470
+ const n = new Ot(p.SOF, 0, 0, 0, 0);
1465
1471
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
1466
1472
  }
1467
1473
  get [Symbol.toStringTag]() {
@@ -1479,7 +1485,7 @@ class Gn {
1479
1485
  */
1480
1486
  lookahead() {
1481
1487
  let t = this.token;
1482
- if (t.kind !== m.EOF)
1488
+ if (t.kind !== p.EOF)
1483
1489
  do
1484
1490
  if (t.next)
1485
1491
  t = t.next;
@@ -1487,29 +1493,29 @@ class Gn {
1487
1493
  const n = Jn(this, t.end);
1488
1494
  t.next = n, n.prev = t, t = n;
1489
1495
  }
1490
- while (t.kind === m.COMMENT);
1496
+ while (t.kind === p.COMMENT);
1491
1497
  return t;
1492
1498
  }
1493
1499
  }
1494
1500
  function Yn(e) {
1495
- return e === m.BANG || e === m.DOLLAR || e === m.AMP || e === m.PAREN_L || e === m.PAREN_R || e === m.SPREAD || e === m.COLON || e === m.EQUALS || e === m.AT || e === m.BRACKET_L || e === m.BRACKET_R || e === m.BRACE_L || e === m.PIPE || e === m.BRACE_R;
1501
+ return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.DOT || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
1496
1502
  }
1497
1503
  function pe(e) {
1498
1504
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
1499
1505
  }
1500
1506
  function Fe(e, t) {
1501
- return Dt(e.charCodeAt(t)) && St(e.charCodeAt(t + 1));
1507
+ return Dt(e.charCodeAt(t)) && Ct(e.charCodeAt(t + 1));
1502
1508
  }
1503
1509
  function Dt(e) {
1504
1510
  return e >= 55296 && e <= 56319;
1505
1511
  }
1506
- function St(e) {
1512
+ function Ct(e) {
1507
1513
  return e >= 56320 && e <= 57343;
1508
1514
  }
1509
1515
  function oe(e, t) {
1510
1516
  const n = e.source.body.codePointAt(t);
1511
1517
  if (n === void 0)
1512
- return m.EOF;
1518
+ return p.EOF;
1513
1519
  if (n >= 32 && n <= 126) {
1514
1520
  const i = String.fromCodePoint(n);
1515
1521
  return i === '"' ? `'"'` : `"${i}"`;
@@ -1518,7 +1524,7 @@ function oe(e, t) {
1518
1524
  }
1519
1525
  function F(e, t, n, i, r) {
1520
1526
  const s = e.line, o = 1 + n - e.lineStart;
1521
- return new It(t, n, i, s, o, r);
1527
+ return new Ot(t, n, i, s, o, r);
1522
1528
  }
1523
1529
  function Jn(e, t) {
1524
1530
  const n = e.source.body, i = n.length;
@@ -1571,42 +1577,42 @@ function Jn(e, t) {
1571
1577
  //
1572
1578
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
1573
1579
  case 33:
1574
- return F(e, m.BANG, r, r + 1);
1580
+ return F(e, p.BANG, r, r + 1);
1575
1581
  case 36:
1576
- return F(e, m.DOLLAR, r, r + 1);
1582
+ return F(e, p.DOLLAR, r, r + 1);
1577
1583
  case 38:
1578
- return F(e, m.AMP, r, r + 1);
1584
+ return F(e, p.AMP, r, r + 1);
1579
1585
  case 40:
1580
- return F(e, m.PAREN_L, r, r + 1);
1586
+ return F(e, p.PAREN_L, r, r + 1);
1581
1587
  case 41:
1582
- return F(e, m.PAREN_R, r, r + 1);
1588
+ return F(e, p.PAREN_R, r, r + 1);
1583
1589
  case 46:
1584
1590
  if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
1585
- return F(e, m.SPREAD, r, r + 3);
1591
+ return F(e, p.SPREAD, r, r + 3);
1586
1592
  break;
1587
1593
  case 58:
1588
- return F(e, m.COLON, r, r + 1);
1594
+ return F(e, p.COLON, r, r + 1);
1589
1595
  case 61:
1590
- return F(e, m.EQUALS, r, r + 1);
1596
+ return F(e, p.EQUALS, r, r + 1);
1591
1597
  case 64:
1592
- return F(e, m.AT, r, r + 1);
1598
+ return F(e, p.AT, r, r + 1);
1593
1599
  case 91:
1594
- return F(e, m.BRACKET_L, r, r + 1);
1600
+ return F(e, p.BRACKET_L, r, r + 1);
1595
1601
  case 93:
1596
- return F(e, m.BRACKET_R, r, r + 1);
1602
+ return F(e, p.BRACKET_R, r, r + 1);
1597
1603
  case 123:
1598
- return F(e, m.BRACE_L, r, r + 1);
1604
+ return F(e, p.BRACE_L, r, r + 1);
1599
1605
  case 124:
1600
- return F(e, m.PIPE, r, r + 1);
1606
+ return F(e, p.PIPE, r, r + 1);
1601
1607
  case 125:
1602
- return F(e, m.BRACE_R, r, r + 1);
1608
+ return F(e, p.BRACE_R, r, r + 1);
1603
1609
  // StringValue
1604
1610
  case 34:
1605
- return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ei(e, r) : Qn(e, r);
1611
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ei(e, r) : Xn(e, r);
1606
1612
  }
1607
- if (Ne(s) || s === 45)
1608
- return Xn(e, r, s);
1609
- if (_t(s))
1613
+ if (ye(s) || s === 45)
1614
+ return Qn(e, r, s);
1615
+ if (bt(s))
1610
1616
  return ti(e, r);
1611
1617
  throw M(
1612
1618
  e.source,
@@ -1614,7 +1620,7 @@ function Jn(e, t) {
1614
1620
  s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : pe(s) || Fe(n, r) ? `Unexpected character: ${oe(e, r)}.` : `Invalid character: ${oe(e, r)}.`
1615
1621
  );
1616
1622
  }
1617
- return F(e, m.EOF, i, i);
1623
+ return F(e, p.EOF, i, i);
1618
1624
  }
1619
1625
  function zn(e, t) {
1620
1626
  const n = e.source.body, i = n.length;
@@ -1632,17 +1638,17 @@ function zn(e, t) {
1632
1638
  }
1633
1639
  return F(
1634
1640
  e,
1635
- m.COMMENT,
1641
+ p.COMMENT,
1636
1642
  t,
1637
1643
  r,
1638
1644
  n.slice(t + 1, r)
1639
1645
  );
1640
1646
  }
1641
- function Xn(e, t, n) {
1647
+ function Qn(e, t, n) {
1642
1648
  const i = e.source.body;
1643
1649
  let r = t, s = n, o = !1;
1644
1650
  if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
1645
- if (s = i.charCodeAt(++r), Ne(s))
1651
+ if (s = i.charCodeAt(++r), ye(s))
1646
1652
  throw M(
1647
1653
  e.source,
1648
1654
  r,
@@ -1653,7 +1659,7 @@ function Xn(e, t, n) {
1653
1659
  );
1654
1660
  } else
1655
1661
  r = Be(e, r, s), s = i.charCodeAt(r);
1656
- if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = Be(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Be(e, r, s), s = i.charCodeAt(r)), s === 46 || _t(s))
1662
+ if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = Be(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Be(e, r, s), s = i.charCodeAt(r)), s === 46 || bt(s))
1657
1663
  throw M(
1658
1664
  e.source,
1659
1665
  r,
@@ -1664,14 +1670,14 @@ function Xn(e, t, n) {
1664
1670
  );
1665
1671
  return F(
1666
1672
  e,
1667
- o ? m.FLOAT : m.INT,
1673
+ o ? p.FLOAT : p.INT,
1668
1674
  t,
1669
1675
  r,
1670
1676
  i.slice(t, r)
1671
1677
  );
1672
1678
  }
1673
1679
  function Be(e, t, n) {
1674
- if (!Ne(n))
1680
+ if (!ye(n))
1675
1681
  throw M(
1676
1682
  e.source,
1677
1683
  t,
@@ -1682,17 +1688,17 @@ function Be(e, t, n) {
1682
1688
  );
1683
1689
  const i = e.source.body;
1684
1690
  let r = t + 1;
1685
- for (; Ne(i.charCodeAt(r)); )
1691
+ for (; ye(i.charCodeAt(r)); )
1686
1692
  ++r;
1687
1693
  return r;
1688
1694
  }
1689
- function Qn(e, t) {
1695
+ function Xn(e, t) {
1690
1696
  const n = e.source.body, i = n.length;
1691
1697
  let r = t + 1, s = r, o = "";
1692
1698
  for (; r < i; ) {
1693
1699
  const a = n.charCodeAt(r);
1694
1700
  if (a === 34)
1695
- return o += n.slice(s, r), F(e, m.STRING, t, r + 1, o);
1701
+ return o += n.slice(s, r), F(e, p.STRING, t, r + 1, o);
1696
1702
  if (a === 92) {
1697
1703
  o += n.slice(s, r);
1698
1704
  const u = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Zn(e, r) : Wn(e, r) : Kn(e, r);
@@ -1743,15 +1749,15 @@ function Zn(e, t) {
1743
1749
  );
1744
1750
  }
1745
1751
  function Wn(e, t) {
1746
- const n = e.source.body, i = at(n, t + 2);
1752
+ const n = e.source.body, i = ct(n, t + 2);
1747
1753
  if (pe(i))
1748
1754
  return {
1749
1755
  value: String.fromCodePoint(i),
1750
1756
  size: 6
1751
1757
  };
1752
1758
  if (Dt(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
1753
- const r = at(n, t + 8);
1754
- if (St(r))
1759
+ const r = ct(n, t + 8);
1760
+ if (Ct(r))
1755
1761
  return {
1756
1762
  value: String.fromCodePoint(i, r),
1757
1763
  size: 12
@@ -1763,7 +1769,7 @@ function Wn(e, t) {
1763
1769
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
1764
1770
  );
1765
1771
  }
1766
- function at(e, t) {
1772
+ function ct(e, t) {
1767
1773
  return ge(e.charCodeAt(t)) << 12 | ge(e.charCodeAt(t + 1)) << 8 | ge(e.charCodeAt(t + 2)) << 4 | ge(e.charCodeAt(t + 3));
1768
1774
  }
1769
1775
  function ge(e) {
@@ -1833,7 +1839,7 @@ function ei(e, t) {
1833
1839
  a += n.slice(o, s), u.push(a);
1834
1840
  const l = F(
1835
1841
  e,
1836
- m.BLOCK_STRING,
1842
+ p.BLOCK_STRING,
1837
1843
  t,
1838
1844
  s + 3,
1839
1845
  // Return a string of the lines joined with U+000A.
@@ -1878,14 +1884,14 @@ function ti(e, t) {
1878
1884
  }
1879
1885
  return F(
1880
1886
  e,
1881
- m.NAME,
1887
+ p.NAME,
1882
1888
  t,
1883
1889
  r,
1884
1890
  n.slice(t, r)
1885
1891
  );
1886
1892
  }
1887
1893
  const ni = 10, xt = 2;
1888
- function Ke(e) {
1894
+ function et(e) {
1889
1895
  return Pe(e, []);
1890
1896
  }
1891
1897
  function Pe(e, t) {
@@ -1942,11 +1948,11 @@ function ai(e) {
1942
1948
  }
1943
1949
  return t;
1944
1950
  }
1945
- const ci = (
1951
+ const ci = globalThis.process && // eslint-disable-next-line no-undef
1952
+ process.env.NODE_ENV === "production", ui = (
1946
1953
  /* c8 ignore next 6 */
1947
1954
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
1948
- // eslint-disable-next-line no-undef
1949
- process.env.NODE_ENV === "production" ? function(t, n) {
1955
+ ci ? function(t, n) {
1950
1956
  return t instanceof n;
1951
1957
  } : function(t, n) {
1952
1958
  if (t instanceof n)
@@ -1958,7 +1964,7 @@ const ci = (
1958
1964
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
1959
1965
  );
1960
1966
  if (r === s) {
1961
- const o = Ke(t);
1967
+ const o = et(t);
1962
1968
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
1963
1969
 
1964
1970
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -1976,15 +1982,15 @@ spurious results.`);
1976
1982
  return !1;
1977
1983
  }
1978
1984
  );
1979
- class Ct {
1985
+ class St {
1980
1986
  constructor(t, n = "GraphQL request", i = {
1981
1987
  line: 1,
1982
1988
  column: 1
1983
1989
  }) {
1984
- typeof t == "string" || Oe(!1, `Body must be a string. Received: ${Ke(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Oe(
1990
+ typeof t == "string" || Ie(!1, `Body must be a string. Received: ${et(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Ie(
1985
1991
  !1,
1986
1992
  "line in locationOffset is 1-indexed and must be positive."
1987
- ), this.locationOffset.column > 0 || Oe(
1993
+ ), this.locationOffset.column > 0 || Ie(
1988
1994
  !1,
1989
1995
  "column in locationOffset is 1-indexed and must be positive."
1990
1996
  );
@@ -1993,24 +1999,37 @@ class Ct {
1993
1999
  return "Source";
1994
2000
  }
1995
2001
  }
1996
- function ui(e) {
1997
- return ci(e, Ct);
2002
+ function li(e) {
2003
+ return ui(e, St);
1998
2004
  }
1999
- function li(e, t) {
2000
- return new fi(e, t).parseDocument();
2005
+ function fi(e, t) {
2006
+ const n = new hi(e, t), i = n.parseDocument();
2007
+ return Object.defineProperty(i, "tokenCount", {
2008
+ enumerable: !1,
2009
+ value: n.tokenCount
2010
+ }), i;
2001
2011
  }
2002
- class fi {
2012
+ class hi {
2003
2013
  constructor(t, n = {}) {
2004
- const i = ui(t) ? t : new Ct(t);
2005
- this._lexer = new Gn(i), this._options = n, this._tokenCounter = 0;
2014
+ const { lexer: i, ...r } = n;
2015
+ if (i)
2016
+ this._lexer = i;
2017
+ else {
2018
+ const s = li(t) ? t : new St(t);
2019
+ this._lexer = new Gn(s);
2020
+ }
2021
+ this._options = r, this._tokenCounter = 0;
2022
+ }
2023
+ get tokenCount() {
2024
+ return this._tokenCounter;
2006
2025
  }
2007
2026
  /**
2008
2027
  * Converts a name lex token into a name parse node.
2009
2028
  */
2010
2029
  parseName() {
2011
- const t = this.expectToken(m.NAME);
2030
+ const t = this.expectToken(p.NAME);
2012
2031
  return this.node(t, {
2013
- kind: A.NAME,
2032
+ kind: w.NAME,
2014
2033
  value: t.value
2015
2034
  });
2016
2035
  }
@@ -2020,11 +2039,11 @@ class fi {
2020
2039
  */
2021
2040
  parseDocument() {
2022
2041
  return this.node(this._lexer.token, {
2023
- kind: A.DOCUMENT,
2042
+ kind: w.DOCUMENT,
2024
2043
  definitions: this.many(
2025
- m.SOF,
2044
+ p.SOF,
2026
2045
  this.parseDefinition,
2027
- m.EOF
2046
+ p.EOF
2028
2047
  )
2029
2048
  });
2030
2049
  }
@@ -2052,10 +2071,16 @@ class fi {
2052
2071
  * - InputObjectTypeDefinition
2053
2072
  */
2054
2073
  parseDefinition() {
2055
- if (this.peek(m.BRACE_L))
2074
+ if (this.peek(p.BRACE_L))
2056
2075
  return this.parseOperationDefinition();
2057
2076
  const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
2058
- if (n.kind === m.NAME) {
2077
+ if (t && n.kind === p.BRACE_L)
2078
+ throw M(
2079
+ this._lexer.source,
2080
+ this._lexer.token.start,
2081
+ "Unexpected description, descriptions are not supported on shorthand queries."
2082
+ );
2083
+ if (n.kind === p.NAME) {
2059
2084
  switch (n.value) {
2060
2085
  case "schema":
2061
2086
  return this.parseSchemaDefinition();
@@ -2074,12 +2099,6 @@ class fi {
2074
2099
  case "directive":
2075
2100
  return this.parseDirectiveDefinition();
2076
2101
  }
2077
- if (t)
2078
- throw M(
2079
- this._lexer.source,
2080
- this._lexer.token.start,
2081
- "Unexpected description, descriptions are supported only on type definitions."
2082
- );
2083
2102
  switch (n.value) {
2084
2103
  case "query":
2085
2104
  case "mutation":
@@ -2087,9 +2106,15 @@ class fi {
2087
2106
  return this.parseOperationDefinition();
2088
2107
  case "fragment":
2089
2108
  return this.parseFragmentDefinition();
2090
- case "extend":
2091
- return this.parseTypeSystemExtension();
2092
2109
  }
2110
+ if (t)
2111
+ throw M(
2112
+ this._lexer.source,
2113
+ this._lexer.token.start,
2114
+ "Unexpected description, only GraphQL definitions support descriptions."
2115
+ );
2116
+ if (n.value === "extend")
2117
+ return this.parseTypeSystemExtension();
2093
2118
  }
2094
2119
  throw this.unexpected(n);
2095
2120
  }
@@ -2101,21 +2126,23 @@ class fi {
2101
2126
  */
2102
2127
  parseOperationDefinition() {
2103
2128
  const t = this._lexer.token;
2104
- if (this.peek(m.BRACE_L))
2129
+ if (this.peek(p.BRACE_L))
2105
2130
  return this.node(t, {
2106
- kind: A.OPERATION_DEFINITION,
2131
+ kind: w.OPERATION_DEFINITION,
2107
2132
  operation: fe.QUERY,
2133
+ description: void 0,
2108
2134
  name: void 0,
2109
2135
  variableDefinitions: [],
2110
2136
  directives: [],
2111
2137
  selectionSet: this.parseSelectionSet()
2112
2138
  });
2113
- const n = this.parseOperationType();
2114
- let i;
2115
- return this.peek(m.NAME) && (i = this.parseName()), this.node(t, {
2116
- kind: A.OPERATION_DEFINITION,
2117
- operation: n,
2118
- name: i,
2139
+ const n = this.parseDescription(), i = this.parseOperationType();
2140
+ let r;
2141
+ return this.peek(p.NAME) && (r = this.parseName()), this.node(t, {
2142
+ kind: w.OPERATION_DEFINITION,
2143
+ operation: i,
2144
+ description: n,
2145
+ name: r,
2119
2146
  variableDefinitions: this.parseVariableDefinitions(),
2120
2147
  directives: this.parseDirectives(!1),
2121
2148
  selectionSet: this.parseSelectionSet()
@@ -2125,7 +2152,7 @@ class fi {
2125
2152
  * OperationType : one of query mutation subscription
2126
2153
  */
2127
2154
  parseOperationType() {
2128
- const t = this.expectToken(m.NAME);
2155
+ const t = this.expectToken(p.NAME);
2129
2156
  switch (t.value) {
2130
2157
  case "query":
2131
2158
  return fe.QUERY;
@@ -2141,9 +2168,9 @@ class fi {
2141
2168
  */
2142
2169
  parseVariableDefinitions() {
2143
2170
  return this.optionalMany(
2144
- m.PAREN_L,
2171
+ p.PAREN_L,
2145
2172
  this.parseVariableDefinition,
2146
- m.PAREN_R
2173
+ p.PAREN_R
2147
2174
  );
2148
2175
  }
2149
2176
  /**
@@ -2151,10 +2178,11 @@ class fi {
2151
2178
  */
2152
2179
  parseVariableDefinition() {
2153
2180
  return this.node(this._lexer.token, {
2154
- kind: A.VARIABLE_DEFINITION,
2181
+ kind: w.VARIABLE_DEFINITION,
2182
+ description: this.parseDescription(),
2155
2183
  variable: this.parseVariable(),
2156
- type: (this.expectToken(m.COLON), this.parseTypeReference()),
2157
- defaultValue: this.expectOptionalToken(m.EQUALS) ? this.parseConstValueLiteral() : void 0,
2184
+ type: (this.expectToken(p.COLON), this.parseTypeReference()),
2185
+ defaultValue: this.expectOptionalToken(p.EQUALS) ? this.parseConstValueLiteral() : void 0,
2158
2186
  directives: this.parseConstDirectives()
2159
2187
  });
2160
2188
  }
@@ -2163,8 +2191,8 @@ class fi {
2163
2191
  */
2164
2192
  parseVariable() {
2165
2193
  const t = this._lexer.token;
2166
- return this.expectToken(m.DOLLAR), this.node(t, {
2167
- kind: A.VARIABLE,
2194
+ return this.expectToken(p.DOLLAR), this.node(t, {
2195
+ kind: w.VARIABLE,
2168
2196
  name: this.parseName()
2169
2197
  });
2170
2198
  }
@@ -2175,11 +2203,11 @@ class fi {
2175
2203
  */
2176
2204
  parseSelectionSet() {
2177
2205
  return this.node(this._lexer.token, {
2178
- kind: A.SELECTION_SET,
2206
+ kind: w.SELECTION_SET,
2179
2207
  selections: this.many(
2180
- m.BRACE_L,
2208
+ p.BRACE_L,
2181
2209
  this.parseSelection,
2182
- m.BRACE_R
2210
+ p.BRACE_R
2183
2211
  )
2184
2212
  });
2185
2213
  }
@@ -2190,7 +2218,7 @@ class fi {
2190
2218
  * - InlineFragment
2191
2219
  */
2192
2220
  parseSelection() {
2193
- return this.peek(m.SPREAD) ? this.parseFragment() : this.parseField();
2221
+ return this.peek(p.SPREAD) ? this.parseFragment() : this.parseField();
2194
2222
  }
2195
2223
  /**
2196
2224
  * Field : Alias? Name Arguments? Directives? SelectionSet?
@@ -2200,13 +2228,13 @@ class fi {
2200
2228
  parseField() {
2201
2229
  const t = this._lexer.token, n = this.parseName();
2202
2230
  let i, r;
2203
- return this.expectOptionalToken(m.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
2204
- kind: A.FIELD,
2231
+ return this.expectOptionalToken(p.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
2232
+ kind: w.FIELD,
2205
2233
  alias: i,
2206
2234
  name: r,
2207
2235
  arguments: this.parseArguments(!1),
2208
2236
  directives: this.parseDirectives(!1),
2209
- selectionSet: this.peek(m.BRACE_L) ? this.parseSelectionSet() : void 0
2237
+ selectionSet: this.peek(p.BRACE_L) ? this.parseSelectionSet() : void 0
2210
2238
  });
2211
2239
  }
2212
2240
  /**
@@ -2214,15 +2242,15 @@ class fi {
2214
2242
  */
2215
2243
  parseArguments(t) {
2216
2244
  const n = t ? this.parseConstArgument : this.parseArgument;
2217
- return this.optionalMany(m.PAREN_L, n, m.PAREN_R);
2245
+ return this.optionalMany(p.PAREN_L, n, p.PAREN_R);
2218
2246
  }
2219
2247
  /**
2220
2248
  * Argument[Const] : Name : Value[?Const]
2221
2249
  */
2222
2250
  parseArgument(t = !1) {
2223
2251
  const n = this._lexer.token, i = this.parseName();
2224
- return this.expectToken(m.COLON), this.node(n, {
2225
- kind: A.ARGUMENT,
2252
+ return this.expectToken(p.COLON), this.node(n, {
2253
+ kind: w.ARGUMENT,
2226
2254
  name: i,
2227
2255
  value: this.parseValueLiteral(t)
2228
2256
  });
@@ -2240,14 +2268,14 @@ class fi {
2240
2268
  */
2241
2269
  parseFragment() {
2242
2270
  const t = this._lexer.token;
2243
- this.expectToken(m.SPREAD);
2271
+ this.expectToken(p.SPREAD);
2244
2272
  const n = this.expectOptionalKeyword("on");
2245
- return !n && this.peek(m.NAME) ? this.node(t, {
2246
- kind: A.FRAGMENT_SPREAD,
2273
+ return !n && this.peek(p.NAME) ? this.node(t, {
2274
+ kind: w.FRAGMENT_SPREAD,
2247
2275
  name: this.parseFragmentName(),
2248
2276
  directives: this.parseDirectives(!1)
2249
2277
  }) : this.node(t, {
2250
- kind: A.INLINE_FRAGMENT,
2278
+ kind: w.INLINE_FRAGMENT,
2251
2279
  typeCondition: n ? this.parseNamedType() : void 0,
2252
2280
  directives: this.parseDirectives(!1),
2253
2281
  selectionSet: this.parseSelectionSet()
@@ -2260,16 +2288,18 @@ class fi {
2260
2288
  * TypeCondition : NamedType
2261
2289
  */
2262
2290
  parseFragmentDefinition() {
2263
- const t = this._lexer.token;
2291
+ const t = this._lexer.token, n = this.parseDescription();
2264
2292
  return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
2265
- kind: A.FRAGMENT_DEFINITION,
2293
+ kind: w.FRAGMENT_DEFINITION,
2294
+ description: n,
2266
2295
  name: this.parseFragmentName(),
2267
2296
  variableDefinitions: this.parseVariableDefinitions(),
2268
2297
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
2269
2298
  directives: this.parseDirectives(!1),
2270
2299
  selectionSet: this.parseSelectionSet()
2271
2300
  }) : this.node(t, {
2272
- kind: A.FRAGMENT_DEFINITION,
2301
+ kind: w.FRAGMENT_DEFINITION,
2302
+ description: n,
2273
2303
  name: this.parseFragmentName(),
2274
2304
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
2275
2305
  directives: this.parseDirectives(!1),
@@ -2306,48 +2336,48 @@ class fi {
2306
2336
  parseValueLiteral(t) {
2307
2337
  const n = this._lexer.token;
2308
2338
  switch (n.kind) {
2309
- case m.BRACKET_L:
2339
+ case p.BRACKET_L:
2310
2340
  return this.parseList(t);
2311
- case m.BRACE_L:
2341
+ case p.BRACE_L:
2312
2342
  return this.parseObject(t);
2313
- case m.INT:
2343
+ case p.INT:
2314
2344
  return this.advanceLexer(), this.node(n, {
2315
- kind: A.INT,
2345
+ kind: w.INT,
2316
2346
  value: n.value
2317
2347
  });
2318
- case m.FLOAT:
2348
+ case p.FLOAT:
2319
2349
  return this.advanceLexer(), this.node(n, {
2320
- kind: A.FLOAT,
2350
+ kind: w.FLOAT,
2321
2351
  value: n.value
2322
2352
  });
2323
- case m.STRING:
2324
- case m.BLOCK_STRING:
2353
+ case p.STRING:
2354
+ case p.BLOCK_STRING:
2325
2355
  return this.parseStringLiteral();
2326
- case m.NAME:
2356
+ case p.NAME:
2327
2357
  switch (this.advanceLexer(), n.value) {
2328
2358
  case "true":
2329
2359
  return this.node(n, {
2330
- kind: A.BOOLEAN,
2360
+ kind: w.BOOLEAN,
2331
2361
  value: !0
2332
2362
  });
2333
2363
  case "false":
2334
2364
  return this.node(n, {
2335
- kind: A.BOOLEAN,
2365
+ kind: w.BOOLEAN,
2336
2366
  value: !1
2337
2367
  });
2338
2368
  case "null":
2339
2369
  return this.node(n, {
2340
- kind: A.NULL
2370
+ kind: w.NULL
2341
2371
  });
2342
2372
  default:
2343
2373
  return this.node(n, {
2344
- kind: A.ENUM,
2374
+ kind: w.ENUM,
2345
2375
  value: n.value
2346
2376
  });
2347
2377
  }
2348
- case m.DOLLAR:
2378
+ case p.DOLLAR:
2349
2379
  if (t)
2350
- if (this.expectToken(m.DOLLAR), this._lexer.token.kind === m.NAME) {
2380
+ if (this.expectToken(p.DOLLAR), this._lexer.token.kind === p.NAME) {
2351
2381
  const i = this._lexer.token.value;
2352
2382
  throw M(
2353
2383
  this._lexer.source,
@@ -2367,9 +2397,9 @@ class fi {
2367
2397
  parseStringLiteral() {
2368
2398
  const t = this._lexer.token;
2369
2399
  return this.advanceLexer(), this.node(t, {
2370
- kind: A.STRING,
2400
+ kind: w.STRING,
2371
2401
  value: t.value,
2372
- block: t.kind === m.BLOCK_STRING
2402
+ block: t.kind === p.BLOCK_STRING
2373
2403
  });
2374
2404
  }
2375
2405
  /**
@@ -2380,8 +2410,8 @@ class fi {
2380
2410
  parseList(t) {
2381
2411
  const n = () => this.parseValueLiteral(t);
2382
2412
  return this.node(this._lexer.token, {
2383
- kind: A.LIST,
2384
- values: this.any(m.BRACKET_L, n, m.BRACKET_R)
2413
+ kind: w.LIST,
2414
+ values: this.any(p.BRACKET_L, n, p.BRACKET_R)
2385
2415
  });
2386
2416
  }
2387
2417
  /**
@@ -2394,8 +2424,8 @@ class fi {
2394
2424
  parseObject(t) {
2395
2425
  const n = () => this.parseObjectField(t);
2396
2426
  return this.node(this._lexer.token, {
2397
- kind: A.OBJECT,
2398
- fields: this.any(m.BRACE_L, n, m.BRACE_R)
2427
+ kind: w.OBJECT,
2428
+ fields: this.any(p.BRACE_L, n, p.BRACE_R)
2399
2429
  });
2400
2430
  }
2401
2431
  /**
@@ -2403,8 +2433,8 @@ class fi {
2403
2433
  */
2404
2434
  parseObjectField(t) {
2405
2435
  const n = this._lexer.token, i = this.parseName();
2406
- return this.expectToken(m.COLON), this.node(n, {
2407
- kind: A.OBJECT_FIELD,
2436
+ return this.expectToken(p.COLON), this.node(n, {
2437
+ kind: w.OBJECT_FIELD,
2408
2438
  name: i,
2409
2439
  value: this.parseValueLiteral(t)
2410
2440
  });
@@ -2415,7 +2445,7 @@ class fi {
2415
2445
  */
2416
2446
  parseDirectives(t) {
2417
2447
  const n = [];
2418
- for (; this.peek(m.AT); )
2448
+ for (; this.peek(p.AT); )
2419
2449
  n.push(this.parseDirective(t));
2420
2450
  return n;
2421
2451
  }
@@ -2429,8 +2459,8 @@ class fi {
2429
2459
  */
2430
2460
  parseDirective(t) {
2431
2461
  const n = this._lexer.token;
2432
- return this.expectToken(m.AT), this.node(n, {
2433
- kind: A.DIRECTIVE,
2462
+ return this.expectToken(p.AT), this.node(n, {
2463
+ kind: w.DIRECTIVE,
2434
2464
  name: this.parseName(),
2435
2465
  arguments: this.parseArguments(t)
2436
2466
  });
@@ -2445,16 +2475,16 @@ class fi {
2445
2475
  parseTypeReference() {
2446
2476
  const t = this._lexer.token;
2447
2477
  let n;
2448
- if (this.expectOptionalToken(m.BRACKET_L)) {
2478
+ if (this.expectOptionalToken(p.BRACKET_L)) {
2449
2479
  const i = this.parseTypeReference();
2450
- this.expectToken(m.BRACKET_R), n = this.node(t, {
2451
- kind: A.LIST_TYPE,
2480
+ this.expectToken(p.BRACKET_R), n = this.node(t, {
2481
+ kind: w.LIST_TYPE,
2452
2482
  type: i
2453
2483
  });
2454
2484
  } else
2455
2485
  n = this.parseNamedType();
2456
- return this.expectOptionalToken(m.BANG) ? this.node(t, {
2457
- kind: A.NON_NULL_TYPE,
2486
+ return this.expectOptionalToken(p.BANG) ? this.node(t, {
2487
+ kind: w.NON_NULL_TYPE,
2458
2488
  type: n
2459
2489
  }) : n;
2460
2490
  }
@@ -2463,13 +2493,13 @@ class fi {
2463
2493
  */
2464
2494
  parseNamedType() {
2465
2495
  return this.node(this._lexer.token, {
2466
- kind: A.NAMED_TYPE,
2496
+ kind: w.NAMED_TYPE,
2467
2497
  name: this.parseName()
2468
2498
  });
2469
2499
  }
2470
2500
  // Implements the parsing rules in the Type Definition section.
2471
2501
  peekDescription() {
2472
- return this.peek(m.STRING) || this.peek(m.BLOCK_STRING);
2502
+ return this.peek(p.STRING) || this.peek(p.BLOCK_STRING);
2473
2503
  }
2474
2504
  /**
2475
2505
  * Description : StringValue
@@ -2487,12 +2517,12 @@ class fi {
2487
2517
  const t = this._lexer.token, n = this.parseDescription();
2488
2518
  this.expectKeyword("schema");
2489
2519
  const i = this.parseConstDirectives(), r = this.many(
2490
- m.BRACE_L,
2520
+ p.BRACE_L,
2491
2521
  this.parseOperationTypeDefinition,
2492
- m.BRACE_R
2522
+ p.BRACE_R
2493
2523
  );
2494
2524
  return this.node(t, {
2495
- kind: A.SCHEMA_DEFINITION,
2525
+ kind: w.SCHEMA_DEFINITION,
2496
2526
  description: n,
2497
2527
  directives: i,
2498
2528
  operationTypes: r
@@ -2503,10 +2533,10 @@ class fi {
2503
2533
  */
2504
2534
  parseOperationTypeDefinition() {
2505
2535
  const t = this._lexer.token, n = this.parseOperationType();
2506
- this.expectToken(m.COLON);
2536
+ this.expectToken(p.COLON);
2507
2537
  const i = this.parseNamedType();
2508
2538
  return this.node(t, {
2509
- kind: A.OPERATION_TYPE_DEFINITION,
2539
+ kind: w.OPERATION_TYPE_DEFINITION,
2510
2540
  operation: n,
2511
2541
  type: i
2512
2542
  });
@@ -2519,7 +2549,7 @@ class fi {
2519
2549
  this.expectKeyword("scalar");
2520
2550
  const i = this.parseName(), r = this.parseConstDirectives();
2521
2551
  return this.node(t, {
2522
- kind: A.SCALAR_TYPE_DEFINITION,
2552
+ kind: w.SCALAR_TYPE_DEFINITION,
2523
2553
  description: n,
2524
2554
  name: i,
2525
2555
  directives: r
@@ -2535,7 +2565,7 @@ class fi {
2535
2565
  this.expectKeyword("type");
2536
2566
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
2537
2567
  return this.node(t, {
2538
- kind: A.OBJECT_TYPE_DEFINITION,
2568
+ kind: w.OBJECT_TYPE_DEFINITION,
2539
2569
  description: n,
2540
2570
  name: i,
2541
2571
  interfaces: r,
@@ -2549,7 +2579,7 @@ class fi {
2549
2579
  * - ImplementsInterfaces & NamedType
2550
2580
  */
2551
2581
  parseImplementsInterfaces() {
2552
- return this.expectOptionalKeyword("implements") ? this.delimitedMany(m.AMP, this.parseNamedType) : [];
2582
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(p.AMP, this.parseNamedType) : [];
2553
2583
  }
2554
2584
  /**
2555
2585
  * ```
@@ -2558,9 +2588,9 @@ class fi {
2558
2588
  */
2559
2589
  parseFieldsDefinition() {
2560
2590
  return this.optionalMany(
2561
- m.BRACE_L,
2591
+ p.BRACE_L,
2562
2592
  this.parseFieldDefinition,
2563
- m.BRACE_R
2593
+ p.BRACE_R
2564
2594
  );
2565
2595
  }
2566
2596
  /**
@@ -2569,10 +2599,10 @@ class fi {
2569
2599
  */
2570
2600
  parseFieldDefinition() {
2571
2601
  const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
2572
- this.expectToken(m.COLON);
2602
+ this.expectToken(p.COLON);
2573
2603
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
2574
2604
  return this.node(t, {
2575
- kind: A.FIELD_DEFINITION,
2605
+ kind: w.FIELD_DEFINITION,
2576
2606
  description: n,
2577
2607
  name: i,
2578
2608
  arguments: r,
@@ -2585,9 +2615,9 @@ class fi {
2585
2615
  */
2586
2616
  parseArgumentDefs() {
2587
2617
  return this.optionalMany(
2588
- m.PAREN_L,
2618
+ p.PAREN_L,
2589
2619
  this.parseInputValueDef,
2590
- m.PAREN_R
2620
+ p.PAREN_R
2591
2621
  );
2592
2622
  }
2593
2623
  /**
@@ -2596,13 +2626,13 @@ class fi {
2596
2626
  */
2597
2627
  parseInputValueDef() {
2598
2628
  const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
2599
- this.expectToken(m.COLON);
2629
+ this.expectToken(p.COLON);
2600
2630
  const r = this.parseTypeReference();
2601
2631
  let s;
2602
- this.expectOptionalToken(m.EQUALS) && (s = this.parseConstValueLiteral());
2632
+ this.expectOptionalToken(p.EQUALS) && (s = this.parseConstValueLiteral());
2603
2633
  const o = this.parseConstDirectives();
2604
2634
  return this.node(t, {
2605
- kind: A.INPUT_VALUE_DEFINITION,
2635
+ kind: w.INPUT_VALUE_DEFINITION,
2606
2636
  description: n,
2607
2637
  name: i,
2608
2638
  type: r,
@@ -2619,7 +2649,7 @@ class fi {
2619
2649
  this.expectKeyword("interface");
2620
2650
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
2621
2651
  return this.node(t, {
2622
- kind: A.INTERFACE_TYPE_DEFINITION,
2652
+ kind: w.INTERFACE_TYPE_DEFINITION,
2623
2653
  description: n,
2624
2654
  name: i,
2625
2655
  interfaces: r,
@@ -2636,7 +2666,7 @@ class fi {
2636
2666
  this.expectKeyword("union");
2637
2667
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
2638
2668
  return this.node(t, {
2639
- kind: A.UNION_TYPE_DEFINITION,
2669
+ kind: w.UNION_TYPE_DEFINITION,
2640
2670
  description: n,
2641
2671
  name: i,
2642
2672
  directives: r,
@@ -2649,7 +2679,7 @@ class fi {
2649
2679
  * - UnionMemberTypes | NamedType
2650
2680
  */
2651
2681
  parseUnionMemberTypes() {
2652
- return this.expectOptionalToken(m.EQUALS) ? this.delimitedMany(m.PIPE, this.parseNamedType) : [];
2682
+ return this.expectOptionalToken(p.EQUALS) ? this.delimitedMany(p.PIPE, this.parseNamedType) : [];
2653
2683
  }
2654
2684
  /**
2655
2685
  * EnumTypeDefinition :
@@ -2660,7 +2690,7 @@ class fi {
2660
2690
  this.expectKeyword("enum");
2661
2691
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
2662
2692
  return this.node(t, {
2663
- kind: A.ENUM_TYPE_DEFINITION,
2693
+ kind: w.ENUM_TYPE_DEFINITION,
2664
2694
  description: n,
2665
2695
  name: i,
2666
2696
  directives: r,
@@ -2674,9 +2704,9 @@ class fi {
2674
2704
  */
2675
2705
  parseEnumValuesDefinition() {
2676
2706
  return this.optionalMany(
2677
- m.BRACE_L,
2707
+ p.BRACE_L,
2678
2708
  this.parseEnumValueDefinition,
2679
- m.BRACE_R
2709
+ p.BRACE_R
2680
2710
  );
2681
2711
  }
2682
2712
  /**
@@ -2685,7 +2715,7 @@ class fi {
2685
2715
  parseEnumValueDefinition() {
2686
2716
  const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
2687
2717
  return this.node(t, {
2688
- kind: A.ENUM_VALUE_DEFINITION,
2718
+ kind: w.ENUM_VALUE_DEFINITION,
2689
2719
  description: n,
2690
2720
  name: i,
2691
2721
  directives: r
@@ -2714,7 +2744,7 @@ class fi {
2714
2744
  this.expectKeyword("input");
2715
2745
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
2716
2746
  return this.node(t, {
2717
- kind: A.INPUT_OBJECT_TYPE_DEFINITION,
2747
+ kind: w.INPUT_OBJECT_TYPE_DEFINITION,
2718
2748
  description: n,
2719
2749
  name: i,
2720
2750
  directives: r,
@@ -2728,9 +2758,9 @@ class fi {
2728
2758
  */
2729
2759
  parseInputFieldsDefinition() {
2730
2760
  return this.optionalMany(
2731
- m.BRACE_L,
2761
+ p.BRACE_L,
2732
2762
  this.parseInputValueDef,
2733
- m.BRACE_R
2763
+ p.BRACE_R
2734
2764
  );
2735
2765
  }
2736
2766
  /**
@@ -2748,7 +2778,7 @@ class fi {
2748
2778
  */
2749
2779
  parseTypeSystemExtension() {
2750
2780
  const t = this._lexer.lookahead();
2751
- if (t.kind === m.NAME)
2781
+ if (t.kind === p.NAME)
2752
2782
  switch (t.value) {
2753
2783
  case "schema":
2754
2784
  return this.parseSchemaExtension();
@@ -2778,14 +2808,14 @@ class fi {
2778
2808
  const t = this._lexer.token;
2779
2809
  this.expectKeyword("extend"), this.expectKeyword("schema");
2780
2810
  const n = this.parseConstDirectives(), i = this.optionalMany(
2781
- m.BRACE_L,
2811
+ p.BRACE_L,
2782
2812
  this.parseOperationTypeDefinition,
2783
- m.BRACE_R
2813
+ p.BRACE_R
2784
2814
  );
2785
2815
  if (n.length === 0 && i.length === 0)
2786
2816
  throw this.unexpected();
2787
2817
  return this.node(t, {
2788
- kind: A.SCHEMA_EXTENSION,
2818
+ kind: w.SCHEMA_EXTENSION,
2789
2819
  directives: n,
2790
2820
  operationTypes: i
2791
2821
  });
@@ -2801,7 +2831,7 @@ class fi {
2801
2831
  if (i.length === 0)
2802
2832
  throw this.unexpected();
2803
2833
  return this.node(t, {
2804
- kind: A.SCALAR_TYPE_EXTENSION,
2834
+ kind: w.SCALAR_TYPE_EXTENSION,
2805
2835
  name: n,
2806
2836
  directives: i
2807
2837
  });
@@ -2819,7 +2849,7 @@ class fi {
2819
2849
  if (i.length === 0 && r.length === 0 && s.length === 0)
2820
2850
  throw this.unexpected();
2821
2851
  return this.node(t, {
2822
- kind: A.OBJECT_TYPE_EXTENSION,
2852
+ kind: w.OBJECT_TYPE_EXTENSION,
2823
2853
  name: n,
2824
2854
  interfaces: i,
2825
2855
  directives: r,
@@ -2839,7 +2869,7 @@ class fi {
2839
2869
  if (i.length === 0 && r.length === 0 && s.length === 0)
2840
2870
  throw this.unexpected();
2841
2871
  return this.node(t, {
2842
- kind: A.INTERFACE_TYPE_EXTENSION,
2872
+ kind: w.INTERFACE_TYPE_EXTENSION,
2843
2873
  name: n,
2844
2874
  interfaces: i,
2845
2875
  directives: r,
@@ -2858,7 +2888,7 @@ class fi {
2858
2888
  if (i.length === 0 && r.length === 0)
2859
2889
  throw this.unexpected();
2860
2890
  return this.node(t, {
2861
- kind: A.UNION_TYPE_EXTENSION,
2891
+ kind: w.UNION_TYPE_EXTENSION,
2862
2892
  name: n,
2863
2893
  directives: i,
2864
2894
  types: r
@@ -2876,7 +2906,7 @@ class fi {
2876
2906
  if (i.length === 0 && r.length === 0)
2877
2907
  throw this.unexpected();
2878
2908
  return this.node(t, {
2879
- kind: A.ENUM_TYPE_EXTENSION,
2909
+ kind: w.ENUM_TYPE_EXTENSION,
2880
2910
  name: n,
2881
2911
  directives: i,
2882
2912
  values: r
@@ -2894,7 +2924,7 @@ class fi {
2894
2924
  if (i.length === 0 && r.length === 0)
2895
2925
  throw this.unexpected();
2896
2926
  return this.node(t, {
2897
- kind: A.INPUT_OBJECT_TYPE_EXTENSION,
2927
+ kind: w.INPUT_OBJECT_TYPE_EXTENSION,
2898
2928
  name: n,
2899
2929
  directives: i,
2900
2930
  fields: r
@@ -2908,12 +2938,12 @@ class fi {
2908
2938
  */
2909
2939
  parseDirectiveDefinition() {
2910
2940
  const t = this._lexer.token, n = this.parseDescription();
2911
- this.expectKeyword("directive"), this.expectToken(m.AT);
2941
+ this.expectKeyword("directive"), this.expectToken(p.AT);
2912
2942
  const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
2913
2943
  this.expectKeyword("on");
2914
2944
  const o = this.parseDirectiveLocations();
2915
2945
  return this.node(t, {
2916
- kind: A.DIRECTIVE_DEFINITION,
2946
+ kind: w.DIRECTIVE_DEFINITION,
2917
2947
  description: n,
2918
2948
  name: i,
2919
2949
  arguments: r,
@@ -2927,7 +2957,7 @@ class fi {
2927
2957
  * - DirectiveLocations | DirectiveLocation
2928
2958
  */
2929
2959
  parseDirectiveLocations() {
2930
- return this.delimitedMany(m.PIPE, this.parseDirectiveLocation);
2960
+ return this.delimitedMany(p.PIPE, this.parseDirectiveLocation);
2931
2961
  }
2932
2962
  /*
2933
2963
  * DirectiveLocation :
@@ -2958,10 +2988,45 @@ class fi {
2958
2988
  */
2959
2989
  parseDirectiveLocation() {
2960
2990
  const t = this._lexer.token, n = this.parseName();
2961
- if (Object.prototype.hasOwnProperty.call(ze, n.value))
2991
+ if (Object.prototype.hasOwnProperty.call(Qe, n.value))
2962
2992
  return n;
2963
2993
  throw this.unexpected(t);
2964
2994
  }
2995
+ // Schema Coordinates
2996
+ /**
2997
+ * SchemaCoordinate :
2998
+ * - Name
2999
+ * - Name . Name
3000
+ * - Name . Name ( Name : )
3001
+ * - \@ Name
3002
+ * - \@ Name ( Name : )
3003
+ */
3004
+ parseSchemaCoordinate() {
3005
+ const t = this._lexer.token, n = this.expectOptionalToken(p.AT), i = this.parseName();
3006
+ let r;
3007
+ !n && this.expectOptionalToken(p.DOT) && (r = this.parseName());
3008
+ let s;
3009
+ return (n || r) && this.expectOptionalToken(p.PAREN_L) && (s = this.parseName(), this.expectToken(p.COLON), this.expectToken(p.PAREN_R)), n ? s ? this.node(t, {
3010
+ kind: w.DIRECTIVE_ARGUMENT_COORDINATE,
3011
+ name: i,
3012
+ argumentName: s
3013
+ }) : this.node(t, {
3014
+ kind: w.DIRECTIVE_COORDINATE,
3015
+ name: i
3016
+ }) : r ? s ? this.node(t, {
3017
+ kind: w.ARGUMENT_COORDINATE,
3018
+ name: i,
3019
+ fieldName: r,
3020
+ argumentName: s
3021
+ }) : this.node(t, {
3022
+ kind: w.MEMBER_COORDINATE,
3023
+ name: i,
3024
+ memberName: r
3025
+ }) : this.node(t, {
3026
+ kind: w.TYPE_COORDINATE,
3027
+ name: i
3028
+ });
3029
+ }
2965
3030
  // Core parsing utility functions
2966
3031
  /**
2967
3032
  * Returns a node that, if configured to do so, sets a "loc" field as a
@@ -3008,7 +3073,7 @@ class fi {
3008
3073
  */
3009
3074
  expectKeyword(t) {
3010
3075
  const n = this._lexer.token;
3011
- if (n.kind === m.NAME && n.value === t)
3076
+ if (n.kind === p.NAME && n.value === t)
3012
3077
  this.advanceLexer();
3013
3078
  else
3014
3079
  throw M(
@@ -3023,7 +3088,7 @@ class fi {
3023
3088
  */
3024
3089
  expectOptionalKeyword(t) {
3025
3090
  const n = this._lexer.token;
3026
- return n.kind === m.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
3091
+ return n.kind === p.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
3027
3092
  }
3028
3093
  /**
3029
3094
  * Helper function for creating an error when an unexpected lexed token is encountered.
@@ -3092,7 +3157,7 @@ class fi {
3092
3157
  }
3093
3158
  advanceLexer() {
3094
3159
  const { maxTokens: t } = this._options, n = this._lexer.advance();
3095
- if (t !== void 0 && n.kind !== m.EOF && (++this._tokenCounter, this._tokenCounter > t))
3160
+ if (n.kind !== p.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
3096
3161
  throw M(
3097
3162
  this._lexer.source,
3098
3163
  n.start,
@@ -3107,14 +3172,14 @@ function ve(e) {
3107
3172
  function kt(e) {
3108
3173
  return Yn(e) ? `"${e}"` : e;
3109
3174
  }
3110
- function hi(e) {
3111
- return `"${e.replace(di, pi)}"`;
3175
+ function di(e) {
3176
+ return `"${e.replace(pi, mi)}"`;
3112
3177
  }
3113
- const di = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
3114
- function pi(e) {
3115
- return mi[e.charCodeAt(0)];
3178
+ const pi = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
3179
+ function mi(e) {
3180
+ return gi[e.charCodeAt(0)];
3116
3181
  }
3117
- const mi = [
3182
+ const gi = [
3118
3183
  "\\u0000",
3119
3184
  "\\u0001",
3120
3185
  "\\u0002",
@@ -3280,32 +3345,29 @@ const mi = [
3280
3345
  "\\u009D",
3281
3346
  "\\u009E",
3282
3347
  "\\u009F"
3283
- ], gi = Object.freeze({});
3284
- function Ei(e, t, n = Ot) {
3348
+ ], Ei = Object.freeze({});
3349
+ function Ni(e, t, n = It) {
3285
3350
  const i = /* @__PURE__ */ new Map();
3286
- for (const O of Object.values(A))
3287
- i.set(O, yi(t, O));
3351
+ for (const _ of Object.values(w))
3352
+ i.set(_, yi(t, _));
3288
3353
  let r, s = Array.isArray(e), o = [e], a = -1, u = [], c = e, l, f;
3289
- const d = [], y = [];
3354
+ const d = [], N = [];
3290
3355
  do {
3291
3356
  a++;
3292
- const O = a === o.length, q = O && u.length !== 0;
3293
- if (O) {
3294
- if (l = y.length === 0 ? void 0 : d[d.length - 1], c = f, f = y.pop(), q)
3357
+ const _ = a === o.length, q = _ && u.length !== 0;
3358
+ if (_) {
3359
+ if (l = N.length === 0 ? void 0 : d[d.length - 1], c = f, f = N.pop(), q)
3295
3360
  if (s) {
3296
3361
  c = c.slice();
3297
- let C = 0;
3362
+ let S = 0;
3298
3363
  for (const [J, $] of u) {
3299
- const K = J - C;
3300
- $ === null ? (c.splice(K, 1), C++) : c[K] = $;
3364
+ const K = J - S;
3365
+ $ === null ? (c.splice(K, 1), S++) : c[K] = $;
3301
3366
  }
3302
3367
  } else {
3303
- c = Object.defineProperties(
3304
- {},
3305
- Object.getOwnPropertyDescriptors(c)
3306
- );
3307
- for (const [C, J] of u)
3308
- c[C] = J;
3368
+ c = { ...c };
3369
+ for (const [S, J] of u)
3370
+ c[S] = J;
3309
3371
  }
3310
3372
  a = r.index, o = r.keys, u = r.edits, s = r.inArray, r = r.prev;
3311
3373
  } else if (f) {
@@ -3315,25 +3377,25 @@ function Ei(e, t, n = Ot) {
3315
3377
  }
3316
3378
  let b;
3317
3379
  if (!Array.isArray(c)) {
3318
- var N, E;
3319
- ot(c) || Oe(!1, `Invalid AST Node: ${Ke(c)}.`);
3320
- const C = O ? (N = i.get(c.kind)) === null || N === void 0 ? void 0 : N.leave : (E = i.get(c.kind)) === null || E === void 0 ? void 0 : E.enter;
3321
- if (b = C?.call(t, c, l, f, d, y), b === gi)
3380
+ var T, E;
3381
+ at(c) || Ie(!1, `Invalid AST Node: ${et(c)}.`);
3382
+ const S = _ ? (T = i.get(c.kind)) === null || T === void 0 ? void 0 : T.leave : (E = i.get(c.kind)) === null || E === void 0 ? void 0 : E.enter;
3383
+ if (b = S?.call(t, c, l, f, d, N), b === Ei)
3322
3384
  break;
3323
3385
  if (b === !1) {
3324
- if (!O) {
3386
+ if (!_) {
3325
3387
  d.pop();
3326
3388
  continue;
3327
3389
  }
3328
- } else if (b !== void 0 && (u.push([l, b]), !O))
3329
- if (ot(b))
3390
+ } else if (b !== void 0 && (u.push([l, b]), !_))
3391
+ if (at(b))
3330
3392
  c = b;
3331
3393
  else {
3332
3394
  d.pop();
3333
3395
  continue;
3334
3396
  }
3335
3397
  }
3336
- if (b === void 0 && q && u.push([l, c]), O)
3398
+ if (b === void 0 && q && u.push([l, c]), _)
3337
3399
  d.pop();
3338
3400
  else {
3339
3401
  var x;
@@ -3343,7 +3405,7 @@ function Ei(e, t, n = Ot) {
3343
3405
  keys: o,
3344
3406
  edits: u,
3345
3407
  prev: r
3346
- }, s = Array.isArray(c), o = s ? c : (x = n[c.kind]) !== null && x !== void 0 ? x : [], a = -1, u = [], f && y.push(f), f = c;
3408
+ }, s = Array.isArray(c), o = s ? c : (x = n[c.kind]) !== null && x !== void 0 ? x : [], a = -1, u = [], f && N.push(f), f = c;
3347
3409
  }
3348
3410
  } while (r !== void 0);
3349
3411
  return u.length !== 0 ? u[u.length - 1][1] : e;
@@ -3358,10 +3420,10 @@ function yi(e, t) {
3358
3420
  leave: e.leave
3359
3421
  };
3360
3422
  }
3361
- function Ni(e) {
3362
- return Ei(e, vi);
3423
+ function Ti(e) {
3424
+ return Ni(e, wi);
3363
3425
  }
3364
- const wi = 80, vi = {
3426
+ const vi = 80, wi = {
3365
3427
  Name: {
3366
3428
  leave: (e) => e.value
3367
3429
  },
@@ -3370,17 +3432,21 @@ const wi = 80, vi = {
3370
3432
  },
3371
3433
  // Document
3372
3434
  Document: {
3373
- leave: (e) => w(e.definitions, `
3435
+ leave: (e) => y(e.definitions, `
3374
3436
 
3375
3437
  `)
3376
3438
  },
3377
3439
  OperationDefinition: {
3378
3440
  leave(e) {
3379
- const t = D("(", w(e.variableDefinitions, ", "), ")"), n = w(
3441
+ const t = Ue(e.variableDefinitions) ? I(`(
3442
+ `, y(e.variableDefinitions, `
3443
+ `), `
3444
+ )`) : I("(", y(e.variableDefinitions, ", "), ")"), n = I("", e.description, `
3445
+ `) + y(
3380
3446
  [
3381
3447
  e.operation,
3382
- w([e.name, t]),
3383
- w(e.directives, " ")
3448
+ y([e.name, t]),
3449
+ y(e.directives, " ")
3384
3450
  ],
3385
3451
  " "
3386
3452
  );
@@ -3388,19 +3454,20 @@ const wi = 80, vi = {
3388
3454
  }
3389
3455
  },
3390
3456
  VariableDefinition: {
3391
- leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + D(" = ", n) + D(" ", w(i, " "))
3457
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i, description: r }) => I("", r, `
3458
+ `) + e + ": " + t + I(" = ", n) + I(" ", y(i, " "))
3392
3459
  },
3393
3460
  SelectionSet: {
3394
3461
  leave: ({ selections: e }) => z(e)
3395
3462
  },
3396
3463
  Field: {
3397
3464
  leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
3398
- const s = D("", e, ": ") + t;
3399
- let o = s + D("(", w(n, ", "), ")");
3400
- return o.length > wi && (o = s + D(`(
3401
- `, be(w(n, `
3465
+ const s = I("", e, ": ") + t;
3466
+ let o = s + I("(", y(n, ", "), ")");
3467
+ return o.length > vi && (o = s + I(`(
3468
+ `, _e(y(n, `
3402
3469
  `)), `
3403
- )`)), w([o, w(i, " "), r], " ");
3470
+ )`)), y([o, y(i, " "), r], " ");
3404
3471
  }
3405
3472
  },
3406
3473
  Argument: {
@@ -3408,24 +3475,31 @@ const wi = 80, vi = {
3408
3475
  },
3409
3476
  // Fragments
3410
3477
  FragmentSpread: {
3411
- leave: ({ name: e, directives: t }) => "..." + e + D(" ", w(t, " "))
3478
+ leave: ({ name: e, directives: t }) => "..." + e + I(" ", y(t, " "))
3412
3479
  },
3413
3480
  InlineFragment: {
3414
- leave: ({ typeCondition: e, directives: t, selectionSet: n }) => w(
3481
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => y(
3415
3482
  [
3416
3483
  "...",
3417
- D("on ", e),
3418
- w(t, " "),
3484
+ I("on ", e),
3485
+ y(t, " "),
3419
3486
  n
3420
3487
  ],
3421
3488
  " "
3422
3489
  )
3423
3490
  },
3424
3491
  FragmentDefinition: {
3425
- leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
3426
- // or removed in the future.
3427
- `fragment ${e}${D("(", w(n, ", "), ")")} on ${t} ${D("", w(i, " "), " ")}` + r
3428
- )
3492
+ leave: ({
3493
+ name: e,
3494
+ typeCondition: t,
3495
+ variableDefinitions: n,
3496
+ directives: i,
3497
+ selectionSet: r,
3498
+ description: s
3499
+ }) => I("", s, `
3500
+ `) + // Note: fragment variable definitions are experimental and may be changed
3501
+ // or removed in the future.
3502
+ `fragment ${e}${I("(", y(n, ", "), ")")} on ${t} ${I("", y(i, " "), " ")}` + r
3429
3503
  },
3430
3504
  // Value
3431
3505
  IntValue: {
@@ -3435,7 +3509,7 @@ const wi = 80, vi = {
3435
3509
  leave: ({ value: e }) => e
3436
3510
  },
3437
3511
  StringValue: {
3438
- leave: ({ value: e, block: t }) => t ? Hn(e) : hi(e)
3512
+ leave: ({ value: e, block: t }) => t ? Hn(e) : di(e)
3439
3513
  },
3440
3514
  BooleanValue: {
3441
3515
  leave: ({ value: e }) => e ? "true" : "false"
@@ -3447,17 +3521,17 @@ const wi = 80, vi = {
3447
3521
  leave: ({ value: e }) => e
3448
3522
  },
3449
3523
  ListValue: {
3450
- leave: ({ values: e }) => "[" + w(e, ", ") + "]"
3524
+ leave: ({ values: e }) => "[" + y(e, ", ") + "]"
3451
3525
  },
3452
3526
  ObjectValue: {
3453
- leave: ({ fields: e }) => "{" + w(e, ", ") + "}"
3527
+ leave: ({ fields: e }) => "{" + y(e, ", ") + "}"
3454
3528
  },
3455
3529
  ObjectField: {
3456
3530
  leave: ({ name: e, value: t }) => e + ": " + t
3457
3531
  },
3458
3532
  // Directive
3459
3533
  Directive: {
3460
- leave: ({ name: e, arguments: t }) => "@" + e + D("(", w(t, ", "), ")")
3534
+ leave: ({ name: e, arguments: t }) => "@" + e + I("(", y(t, ", "), ")")
3461
3535
  },
3462
3536
  // Type
3463
3537
  NamedType: {
@@ -3471,151 +3545,167 @@ const wi = 80, vi = {
3471
3545
  },
3472
3546
  // Type System Definitions
3473
3547
  SchemaDefinition: {
3474
- leave: ({ description: e, directives: t, operationTypes: n }) => D("", e, `
3475
- `) + w(["schema", w(t, " "), z(n)], " ")
3548
+ leave: ({ description: e, directives: t, operationTypes: n }) => I("", e, `
3549
+ `) + y(["schema", y(t, " "), z(n)], " ")
3476
3550
  },
3477
3551
  OperationTypeDefinition: {
3478
3552
  leave: ({ operation: e, type: t }) => e + ": " + t
3479
3553
  },
3480
3554
  ScalarTypeDefinition: {
3481
- leave: ({ description: e, name: t, directives: n }) => D("", e, `
3482
- `) + w(["scalar", t, w(n, " ")], " ")
3555
+ leave: ({ description: e, name: t, directives: n }) => I("", e, `
3556
+ `) + y(["scalar", t, y(n, " ")], " ")
3483
3557
  },
3484
3558
  ObjectTypeDefinition: {
3485
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
3486
- `) + w(
3559
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => I("", e, `
3560
+ `) + y(
3487
3561
  [
3488
3562
  "type",
3489
3563
  t,
3490
- D("implements ", w(n, " & ")),
3491
- w(i, " "),
3564
+ I("implements ", y(n, " & ")),
3565
+ y(i, " "),
3492
3566
  z(r)
3493
3567
  ],
3494
3568
  " "
3495
3569
  )
3496
3570
  },
3497
3571
  FieldDefinition: {
3498
- leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => D("", e, `
3499
- `) + t + (ct(n) ? D(`(
3500
- `, be(w(n, `
3572
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => I("", e, `
3573
+ `) + t + (Ue(n) ? I(`(
3574
+ `, _e(y(n, `
3501
3575
  `)), `
3502
- )`) : D("(", w(n, ", "), ")")) + ": " + i + D(" ", w(r, " "))
3576
+ )`) : I("(", y(n, ", "), ")")) + ": " + i + I(" ", y(r, " "))
3503
3577
  },
3504
3578
  InputValueDefinition: {
3505
- leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => D("", e, `
3506
- `) + w(
3507
- [t + ": " + n, D("= ", i), w(r, " ")],
3579
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => I("", e, `
3580
+ `) + y(
3581
+ [t + ": " + n, I("= ", i), y(r, " ")],
3508
3582
  " "
3509
3583
  )
3510
3584
  },
3511
3585
  InterfaceTypeDefinition: {
3512
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
3513
- `) + w(
3586
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => I("", e, `
3587
+ `) + y(
3514
3588
  [
3515
3589
  "interface",
3516
3590
  t,
3517
- D("implements ", w(n, " & ")),
3518
- w(i, " "),
3591
+ I("implements ", y(n, " & ")),
3592
+ y(i, " "),
3519
3593
  z(r)
3520
3594
  ],
3521
3595
  " "
3522
3596
  )
3523
3597
  },
3524
3598
  UnionTypeDefinition: {
3525
- leave: ({ description: e, name: t, directives: n, types: i }) => D("", e, `
3526
- `) + w(
3527
- ["union", t, w(n, " "), D("= ", w(i, " | "))],
3599
+ leave: ({ description: e, name: t, directives: n, types: i }) => I("", e, `
3600
+ `) + y(
3601
+ ["union", t, y(n, " "), I("= ", y(i, " | "))],
3528
3602
  " "
3529
3603
  )
3530
3604
  },
3531
3605
  EnumTypeDefinition: {
3532
- leave: ({ description: e, name: t, directives: n, values: i }) => D("", e, `
3533
- `) + w(["enum", t, w(n, " "), z(i)], " ")
3606
+ leave: ({ description: e, name: t, directives: n, values: i }) => I("", e, `
3607
+ `) + y(["enum", t, y(n, " "), z(i)], " ")
3534
3608
  },
3535
3609
  EnumValueDefinition: {
3536
- leave: ({ description: e, name: t, directives: n }) => D("", e, `
3537
- `) + w([t, w(n, " ")], " ")
3610
+ leave: ({ description: e, name: t, directives: n }) => I("", e, `
3611
+ `) + y([t, y(n, " ")], " ")
3538
3612
  },
3539
3613
  InputObjectTypeDefinition: {
3540
- leave: ({ description: e, name: t, directives: n, fields: i }) => D("", e, `
3541
- `) + w(["input", t, w(n, " "), z(i)], " ")
3614
+ leave: ({ description: e, name: t, directives: n, fields: i }) => I("", e, `
3615
+ `) + y(["input", t, y(n, " "), z(i)], " ")
3542
3616
  },
3543
3617
  DirectiveDefinition: {
3544
- leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => D("", e, `
3545
- `) + "directive @" + t + (ct(n) ? D(`(
3546
- `, be(w(n, `
3618
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => I("", e, `
3619
+ `) + "directive @" + t + (Ue(n) ? I(`(
3620
+ `, _e(y(n, `
3547
3621
  `)), `
3548
- )`) : D("(", w(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + w(r, " | ")
3622
+ )`) : I("(", y(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + y(r, " | ")
3549
3623
  },
3550
3624
  SchemaExtension: {
3551
- leave: ({ directives: e, operationTypes: t }) => w(
3552
- ["extend schema", w(e, " "), z(t)],
3625
+ leave: ({ directives: e, operationTypes: t }) => y(
3626
+ ["extend schema", y(e, " "), z(t)],
3553
3627
  " "
3554
3628
  )
3555
3629
  },
3556
3630
  ScalarTypeExtension: {
3557
- leave: ({ name: e, directives: t }) => w(["extend scalar", e, w(t, " ")], " ")
3631
+ leave: ({ name: e, directives: t }) => y(["extend scalar", e, y(t, " ")], " ")
3558
3632
  },
3559
3633
  ObjectTypeExtension: {
3560
- leave: ({ name: e, interfaces: t, directives: n, fields: i }) => w(
3634
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => y(
3561
3635
  [
3562
3636
  "extend type",
3563
3637
  e,
3564
- D("implements ", w(t, " & ")),
3565
- w(n, " "),
3638
+ I("implements ", y(t, " & ")),
3639
+ y(n, " "),
3566
3640
  z(i)
3567
3641
  ],
3568
3642
  " "
3569
3643
  )
3570
3644
  },
3571
3645
  InterfaceTypeExtension: {
3572
- leave: ({ name: e, interfaces: t, directives: n, fields: i }) => w(
3646
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => y(
3573
3647
  [
3574
3648
  "extend interface",
3575
3649
  e,
3576
- D("implements ", w(t, " & ")),
3577
- w(n, " "),
3650
+ I("implements ", y(t, " & ")),
3651
+ y(n, " "),
3578
3652
  z(i)
3579
3653
  ],
3580
3654
  " "
3581
3655
  )
3582
3656
  },
3583
3657
  UnionTypeExtension: {
3584
- leave: ({ name: e, directives: t, types: n }) => w(
3658
+ leave: ({ name: e, directives: t, types: n }) => y(
3585
3659
  [
3586
3660
  "extend union",
3587
3661
  e,
3588
- w(t, " "),
3589
- D("= ", w(n, " | "))
3662
+ y(t, " "),
3663
+ I("= ", y(n, " | "))
3590
3664
  ],
3591
3665
  " "
3592
3666
  )
3593
3667
  },
3594
3668
  EnumTypeExtension: {
3595
- leave: ({ name: e, directives: t, values: n }) => w(["extend enum", e, w(t, " "), z(n)], " ")
3669
+ leave: ({ name: e, directives: t, values: n }) => y(["extend enum", e, y(t, " "), z(n)], " ")
3596
3670
  },
3597
3671
  InputObjectTypeExtension: {
3598
- leave: ({ name: e, directives: t, fields: n }) => w(["extend input", e, w(t, " "), z(n)], " ")
3672
+ leave: ({ name: e, directives: t, fields: n }) => y(["extend input", e, y(t, " "), z(n)], " ")
3673
+ },
3674
+ // Schema Coordinates
3675
+ TypeCoordinate: {
3676
+ leave: ({ name: e }) => e
3677
+ },
3678
+ MemberCoordinate: {
3679
+ leave: ({ name: e, memberName: t }) => y([e, I(".", t)])
3680
+ },
3681
+ ArgumentCoordinate: {
3682
+ leave: ({ name: e, fieldName: t, argumentName: n }) => y([e, I(".", t), I("(", n, ":)")])
3683
+ },
3684
+ DirectiveCoordinate: {
3685
+ leave: ({ name: e }) => y(["@", e])
3686
+ },
3687
+ DirectiveArgumentCoordinate: {
3688
+ leave: ({ name: e, argumentName: t }) => y(["@", e, I("(", t, ":)")])
3599
3689
  }
3600
3690
  };
3601
- function w(e, t = "") {
3691
+ function y(e, t = "") {
3602
3692
  var n;
3603
3693
  return (n = e?.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
3604
3694
  }
3605
3695
  function z(e) {
3606
- return D(`{
3607
- `, be(w(e, `
3696
+ return I(`{
3697
+ `, _e(y(e, `
3608
3698
  `)), `
3609
3699
  }`);
3610
3700
  }
3611
- function D(e, t, n = "") {
3701
+ function I(e, t, n = "") {
3612
3702
  return t != null && t !== "" ? e + t + n : "";
3613
3703
  }
3614
- function be(e) {
3615
- return D(" ", e.replace(/\n/g, `
3704
+ function _e(e) {
3705
+ return I(" ", e.replace(/\n/g, `
3616
3706
  `));
3617
3707
  }
3618
- function ct(e) {
3708
+ function Ue(e) {
3619
3709
  var t;
3620
3710
  return (t = e?.some((n) => n.includes(`
3621
3711
  `))) !== null && t !== void 0 ? t : !1;
@@ -3624,18 +3714,18 @@ const ut = (e) => {
3624
3714
  let t;
3625
3715
  const n = e.definitions.filter((i) => i.kind === "OperationDefinition");
3626
3716
  return n.length === 1 && (t = n[0]?.name?.value), t;
3627
- }, Ue = (e) => {
3717
+ }, qe = (e) => {
3628
3718
  if (typeof e == "string") {
3629
3719
  let n;
3630
3720
  try {
3631
- const i = li(e);
3721
+ const i = fi(e);
3632
3722
  n = ut(i);
3633
3723
  } catch {
3634
3724
  }
3635
3725
  return { query: e, operationName: n };
3636
3726
  }
3637
3727
  const t = ut(e);
3638
- return { query: Ni(e), operationName: t };
3728
+ return { query: Ti(e), operationName: t };
3639
3729
  };
3640
3730
  class Ee extends Error {
3641
3731
  constructor(t, n) {
@@ -3649,14 +3739,14 @@ class Ee extends Error {
3649
3739
  return t.errors?.[0]?.message ?? `GraphQL Error (Code: ${t.status})`;
3650
3740
  }
3651
3741
  }
3652
- var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3653
- function Ti(e) {
3742
+ var we = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3743
+ function Ai(e) {
3654
3744
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3655
3745
  }
3656
3746
  var Ae = { exports: {} }, lt;
3657
- function Ai() {
3747
+ function Oi() {
3658
3748
  return lt || (lt = 1, (function(e, t) {
3659
- var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof Te < "u" && Te, i = (function() {
3749
+ var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof we < "u" && we, i = (function() {
3660
3750
  function s() {
3661
3751
  this.fetch = !1, this.DOMException = n.DOMException;
3662
3752
  }
@@ -3665,7 +3755,7 @@ function Ai() {
3665
3755
  (function(s) {
3666
3756
  (function(o) {
3667
3757
  var a = typeof s < "u" && s || typeof self < "u" && self || // eslint-disable-next-line no-undef
3668
- typeof Te < "u" && Te || {}, u = {
3758
+ typeof we < "u" && we || {}, u = {
3669
3759
  searchParams: "URLSearchParams" in a,
3670
3760
  iterable: "Symbol" in a && "iterator" in Symbol,
3671
3761
  blob: "FileReader" in a && "Blob" in a && (function() {
@@ -3700,61 +3790,61 @@ function Ai() {
3700
3790
  throw new TypeError('Invalid character in header field name: "' + h + '"');
3701
3791
  return h.toLowerCase();
3702
3792
  }
3703
- function y(h) {
3793
+ function N(h) {
3704
3794
  return typeof h != "string" && (h = String(h)), h;
3705
3795
  }
3706
- function N(h) {
3707
- var p = {
3796
+ function T(h) {
3797
+ var m = {
3708
3798
  next: function() {
3709
- var _ = h.shift();
3710
- return { done: _ === void 0, value: _ };
3799
+ var D = h.shift();
3800
+ return { done: D === void 0, value: D };
3711
3801
  }
3712
3802
  };
3713
- return u.iterable && (p[Symbol.iterator] = function() {
3714
- return p;
3715
- }), p;
3803
+ return u.iterable && (m[Symbol.iterator] = function() {
3804
+ return m;
3805
+ }), m;
3716
3806
  }
3717
3807
  function E(h) {
3718
- this.map = {}, h instanceof E ? h.forEach(function(p, _) {
3719
- this.append(_, p);
3720
- }, this) : Array.isArray(h) ? h.forEach(function(p) {
3721
- if (p.length != 2)
3722
- throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + p.length);
3723
- this.append(p[0], p[1]);
3724
- }, this) : h && Object.getOwnPropertyNames(h).forEach(function(p) {
3725
- this.append(p, h[p]);
3808
+ this.map = {}, h instanceof E ? h.forEach(function(m, D) {
3809
+ this.append(D, m);
3810
+ }, this) : Array.isArray(h) ? h.forEach(function(m) {
3811
+ if (m.length != 2)
3812
+ throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + m.length);
3813
+ this.append(m[0], m[1]);
3814
+ }, this) : h && Object.getOwnPropertyNames(h).forEach(function(m) {
3815
+ this.append(m, h[m]);
3726
3816
  }, this);
3727
3817
  }
3728
- E.prototype.append = function(h, p) {
3729
- h = d(h), p = y(p);
3730
- var _ = this.map[h];
3731
- this.map[h] = _ ? _ + ", " + p : p;
3818
+ E.prototype.append = function(h, m) {
3819
+ h = d(h), m = N(m);
3820
+ var D = this.map[h];
3821
+ this.map[h] = D ? D + ", " + m : m;
3732
3822
  }, E.prototype.delete = function(h) {
3733
3823
  delete this.map[d(h)];
3734
3824
  }, E.prototype.get = function(h) {
3735
3825
  return h = d(h), this.has(h) ? this.map[h] : null;
3736
3826
  }, E.prototype.has = function(h) {
3737
3827
  return this.map.hasOwnProperty(d(h));
3738
- }, E.prototype.set = function(h, p) {
3739
- this.map[d(h)] = y(p);
3740
- }, E.prototype.forEach = function(h, p) {
3741
- for (var _ in this.map)
3742
- this.map.hasOwnProperty(_) && h.call(p, this.map[_], _, this);
3828
+ }, E.prototype.set = function(h, m) {
3829
+ this.map[d(h)] = N(m);
3830
+ }, E.prototype.forEach = function(h, m) {
3831
+ for (var D in this.map)
3832
+ this.map.hasOwnProperty(D) && h.call(m, this.map[D], D, this);
3743
3833
  }, E.prototype.keys = function() {
3744
3834
  var h = [];
3745
- return this.forEach(function(p, _) {
3746
- h.push(_);
3747
- }), N(h);
3835
+ return this.forEach(function(m, D) {
3836
+ h.push(D);
3837
+ }), T(h);
3748
3838
  }, E.prototype.values = function() {
3749
3839
  var h = [];
3750
- return this.forEach(function(p) {
3751
- h.push(p);
3752
- }), N(h);
3840
+ return this.forEach(function(m) {
3841
+ h.push(m);
3842
+ }), T(h);
3753
3843
  }, E.prototype.entries = function() {
3754
3844
  var h = [];
3755
- return this.forEach(function(p, _) {
3756
- h.push([_, p]);
3757
- }), N(h);
3845
+ return this.forEach(function(m, D) {
3846
+ h.push([D, m]);
3847
+ }), T(h);
3758
3848
  }, u.iterable && (E.prototype[Symbol.iterator] = E.prototype.entries);
3759
3849
  function x(h) {
3760
3850
  if (!h._noBody) {
@@ -3763,33 +3853,33 @@ function Ai() {
3763
3853
  h.bodyUsed = !0;
3764
3854
  }
3765
3855
  }
3766
- function O(h) {
3767
- return new Promise(function(p, _) {
3856
+ function _(h) {
3857
+ return new Promise(function(m, D) {
3768
3858
  h.onload = function() {
3769
- p(h.result);
3859
+ m(h.result);
3770
3860
  }, h.onerror = function() {
3771
- _(h.error);
3861
+ D(h.error);
3772
3862
  };
3773
3863
  });
3774
3864
  }
3775
3865
  function q(h) {
3776
- var p = new FileReader(), _ = O(p);
3777
- return p.readAsArrayBuffer(h), _;
3866
+ var m = new FileReader(), D = _(m);
3867
+ return m.readAsArrayBuffer(h), D;
3778
3868
  }
3779
3869
  function b(h) {
3780
- var p = new FileReader(), _ = O(p), k = /charset=([A-Za-z0-9_-]+)/.exec(h.type), L = k ? k[1] : "utf-8";
3781
- return p.readAsText(h, L), _;
3870
+ var m = new FileReader(), D = _(m), k = /charset=([A-Za-z0-9_-]+)/.exec(h.type), L = k ? k[1] : "utf-8";
3871
+ return m.readAsText(h, L), D;
3782
3872
  }
3783
- function C(h) {
3784
- for (var p = new Uint8Array(h), _ = new Array(p.length), k = 0; k < p.length; k++)
3785
- _[k] = String.fromCharCode(p[k]);
3786
- return _.join("");
3873
+ function S(h) {
3874
+ for (var m = new Uint8Array(h), D = new Array(m.length), k = 0; k < m.length; k++)
3875
+ D[k] = String.fromCharCode(m[k]);
3876
+ return D.join("");
3787
3877
  }
3788
3878
  function J(h) {
3789
3879
  if (h.slice)
3790
3880
  return h.slice(0);
3791
- var p = new Uint8Array(h.byteLength);
3792
- return p.set(new Uint8Array(h)), p.buffer;
3881
+ var m = new Uint8Array(h.byteLength);
3882
+ return m.set(new Uint8Array(h)), m.buffer;
3793
3883
  }
3794
3884
  function $() {
3795
3885
  return this.bodyUsed = !1, this._initBody = function(h) {
@@ -3826,7 +3916,7 @@ function Ai() {
3826
3916
  if (this._bodyBlob)
3827
3917
  return b(this._bodyBlob);
3828
3918
  if (this._bodyArrayBuffer)
3829
- return Promise.resolve(C(this._bodyArrayBuffer));
3919
+ return Promise.resolve(S(this._bodyArrayBuffer));
3830
3920
  if (this._bodyFormData)
3831
3921
  throw new Error("could not read FormData body as text");
3832
3922
  return Promise.resolve(this._bodyText);
@@ -3838,28 +3928,28 @@ function Ai() {
3838
3928
  }
3839
3929
  var K = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
3840
3930
  function ae(h) {
3841
- var p = h.toUpperCase();
3842
- return K.indexOf(p) > -1 ? p : h;
3931
+ var m = h.toUpperCase();
3932
+ return K.indexOf(m) > -1 ? m : h;
3843
3933
  }
3844
- function H(h, p) {
3934
+ function H(h, m) {
3845
3935
  if (!(this instanceof H))
3846
3936
  throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
3847
- p = p || {};
3848
- var _ = p.body;
3937
+ m = m || {};
3938
+ var D = m.body;
3849
3939
  if (h instanceof H) {
3850
3940
  if (h.bodyUsed)
3851
3941
  throw new TypeError("Already read");
3852
- this.url = h.url, this.credentials = h.credentials, p.headers || (this.headers = new E(h.headers)), this.method = h.method, this.mode = h.mode, this.signal = h.signal, !_ && h._bodyInit != null && (_ = h._bodyInit, h.bodyUsed = !0);
3942
+ this.url = h.url, this.credentials = h.credentials, m.headers || (this.headers = new E(h.headers)), this.method = h.method, this.mode = h.mode, this.signal = h.signal, !D && h._bodyInit != null && (D = h._bodyInit, h.bodyUsed = !0);
3853
3943
  } else
3854
3944
  this.url = String(h);
3855
- if (this.credentials = p.credentials || this.credentials || "same-origin", (p.headers || !this.headers) && (this.headers = new E(p.headers)), this.method = ae(p.method || this.method || "GET"), this.mode = p.mode || this.mode || null, this.signal = p.signal || this.signal || (function() {
3945
+ if (this.credentials = m.credentials || this.credentials || "same-origin", (m.headers || !this.headers) && (this.headers = new E(m.headers)), this.method = ae(m.method || this.method || "GET"), this.mode = m.mode || this.mode || null, this.signal = m.signal || this.signal || (function() {
3856
3946
  if ("AbortController" in a) {
3857
- var S = new AbortController();
3858
- return S.signal;
3947
+ var C = new AbortController();
3948
+ return C.signal;
3859
3949
  }
3860
- })(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
3950
+ })(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && D)
3861
3951
  throw new TypeError("Body not allowed for GET or HEAD requests");
3862
- if (this._initBody(_), (this.method === "GET" || this.method === "HEAD") && (p.cache === "no-store" || p.cache === "no-cache")) {
3952
+ if (this._initBody(D), (this.method === "GET" || this.method === "HEAD") && (m.cache === "no-store" || m.cache === "no-cache")) {
3863
3953
  var k = /([?&])_=[^&]*/;
3864
3954
  if (k.test(this.url))
3865
3955
  this.url = this.url.replace(k, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
@@ -3873,38 +3963,38 @@ function Ai() {
3873
3963
  return new H(this, { body: this._bodyInit });
3874
3964
  };
3875
3965
  function me(h) {
3876
- var p = new FormData();
3877
- return h.trim().split("&").forEach(function(_) {
3878
- if (_) {
3879
- var k = _.split("="), L = k.shift().replace(/\+/g, " "), S = k.join("=").replace(/\+/g, " ");
3880
- p.append(decodeURIComponent(L), decodeURIComponent(S));
3966
+ var m = new FormData();
3967
+ return h.trim().split("&").forEach(function(D) {
3968
+ if (D) {
3969
+ var k = D.split("="), L = k.shift().replace(/\+/g, " "), C = k.join("=").replace(/\+/g, " ");
3970
+ m.append(decodeURIComponent(L), decodeURIComponent(C));
3881
3971
  }
3882
- }), p;
3972
+ }), m;
3883
3973
  }
3884
3974
  function Y(h) {
3885
- var p = new E(), _ = h.replace(/\r?\n[\t ]+/g, " ");
3886
- return _.split("\r").map(function(k) {
3975
+ var m = new E(), D = h.replace(/\r?\n[\t ]+/g, " ");
3976
+ return D.split("\r").map(function(k) {
3887
3977
  return k.indexOf(`
3888
3978
  `) === 0 ? k.substr(1, k.length) : k;
3889
3979
  }).forEach(function(k) {
3890
- var L = k.split(":"), S = L.shift().trim();
3891
- if (S) {
3892
- var we = L.join(":").trim();
3980
+ var L = k.split(":"), C = L.shift().trim();
3981
+ if (C) {
3982
+ var Te = L.join(":").trim();
3893
3983
  try {
3894
- p.append(S, we);
3984
+ m.append(C, Te);
3895
3985
  } catch (Me) {
3896
3986
  console.warn("Response " + Me.message);
3897
3987
  }
3898
3988
  }
3899
- }), p;
3989
+ }), m;
3900
3990
  }
3901
3991
  $.call(H.prototype);
3902
- function V(h, p) {
3992
+ function V(h, m) {
3903
3993
  if (!(this instanceof V))
3904
3994
  throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
3905
- if (p || (p = {}), this.type = "default", this.status = p.status === void 0 ? 200 : p.status, this.status < 200 || this.status > 599)
3995
+ if (m || (m = {}), this.type = "default", this.status = m.status === void 0 ? 200 : m.status, this.status < 200 || this.status > 599)
3906
3996
  throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
3907
- this.ok = this.status >= 200 && this.status < 300, this.statusText = p.statusText === void 0 ? "" : "" + p.statusText, this.headers = new E(p.headers), this.url = p.url || "", this._initBody(h);
3997
+ this.ok = this.status >= 200 && this.status < 300, this.statusText = m.statusText === void 0 ? "" : "" + m.statusText, this.headers = new E(m.headers), this.url = m.url || "", this._initBody(h);
3908
3998
  }
3909
3999
  $.call(V.prototype), V.prototype.clone = function() {
3910
4000
  return new V(this._bodyInit, {
@@ -3918,48 +4008,48 @@ function Ai() {
3918
4008
  return h.ok = !1, h.status = 0, h.type = "error", h;
3919
4009
  };
3920
4010
  var ce = [301, 302, 303, 307, 308];
3921
- V.redirect = function(h, p) {
3922
- if (ce.indexOf(p) === -1)
4011
+ V.redirect = function(h, m) {
4012
+ if (ce.indexOf(m) === -1)
3923
4013
  throw new RangeError("Invalid status code");
3924
- return new V(null, { status: p, headers: { location: h } });
4014
+ return new V(null, { status: m, headers: { location: h } });
3925
4015
  }, o.DOMException = a.DOMException;
3926
4016
  try {
3927
4017
  new o.DOMException();
3928
4018
  } catch {
3929
- o.DOMException = function(p, _) {
3930
- this.message = p, this.name = _;
3931
- var k = Error(p);
4019
+ o.DOMException = function(m, D) {
4020
+ this.message = m, this.name = D;
4021
+ var k = Error(m);
3932
4022
  this.stack = k.stack;
3933
4023
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
3934
4024
  }
3935
- function re(h, p) {
3936
- return new Promise(function(_, k) {
3937
- var L = new H(h, p);
4025
+ function re(h, m) {
4026
+ return new Promise(function(D, k) {
4027
+ var L = new H(h, m);
3938
4028
  if (L.signal && L.signal.aborted)
3939
4029
  return k(new o.DOMException("Aborted", "AbortError"));
3940
- var S = new XMLHttpRequest();
3941
- function we() {
3942
- S.abort();
4030
+ var C = new XMLHttpRequest();
4031
+ function Te() {
4032
+ C.abort();
3943
4033
  }
3944
- S.onload = function() {
4034
+ C.onload = function() {
3945
4035
  var B = {
3946
- statusText: S.statusText,
3947
- headers: Y(S.getAllResponseHeaders() || "")
4036
+ statusText: C.statusText,
4037
+ headers: Y(C.getAllResponseHeaders() || "")
3948
4038
  };
3949
- L.url.indexOf("file://") === 0 && (S.status < 200 || S.status > 599) ? B.status = 200 : B.status = S.status, B.url = "responseURL" in S ? S.responseURL : B.headers.get("X-Request-URL");
3950
- var se = "response" in S ? S.response : S.responseText;
4039
+ L.url.indexOf("file://") === 0 && (C.status < 200 || C.status > 599) ? B.status = 200 : B.status = C.status, B.url = "responseURL" in C ? C.responseURL : B.headers.get("X-Request-URL");
4040
+ var se = "response" in C ? C.response : C.responseText;
3951
4041
  setTimeout(function() {
3952
- _(new V(se, B));
4042
+ D(new V(se, B));
3953
4043
  }, 0);
3954
- }, S.onerror = function() {
4044
+ }, C.onerror = function() {
3955
4045
  setTimeout(function() {
3956
4046
  k(new TypeError("Network request failed"));
3957
4047
  }, 0);
3958
- }, S.ontimeout = function() {
4048
+ }, C.ontimeout = function() {
3959
4049
  setTimeout(function() {
3960
4050
  k(new TypeError("Network request timed out"));
3961
4051
  }, 0);
3962
- }, S.onabort = function() {
4052
+ }, C.onabort = function() {
3963
4053
  setTimeout(function() {
3964
4054
  k(new o.DOMException("Aborted", "AbortError"));
3965
4055
  }, 0);
@@ -3971,20 +4061,20 @@ function Ai() {
3971
4061
  return B;
3972
4062
  }
3973
4063
  }
3974
- if (S.open(L.method, Me(L.url), !0), L.credentials === "include" ? S.withCredentials = !0 : L.credentials === "omit" && (S.withCredentials = !1), "responseType" in S && (u.blob ? S.responseType = "blob" : u.arrayBuffer && (S.responseType = "arraybuffer")), p && typeof p.headers == "object" && !(p.headers instanceof E || a.Headers && p.headers instanceof a.Headers)) {
3975
- var et = [];
3976
- Object.getOwnPropertyNames(p.headers).forEach(function(B) {
3977
- et.push(d(B)), S.setRequestHeader(B, y(p.headers[B]));
4064
+ if (C.open(L.method, Me(L.url), !0), L.credentials === "include" ? C.withCredentials = !0 : L.credentials === "omit" && (C.withCredentials = !1), "responseType" in C && (u.blob ? C.responseType = "blob" : u.arrayBuffer && (C.responseType = "arraybuffer")), m && typeof m.headers == "object" && !(m.headers instanceof E || a.Headers && m.headers instanceof a.Headers)) {
4065
+ var tt = [];
4066
+ Object.getOwnPropertyNames(m.headers).forEach(function(B) {
4067
+ tt.push(d(B)), C.setRequestHeader(B, N(m.headers[B]));
3978
4068
  }), L.headers.forEach(function(B, se) {
3979
- et.indexOf(se) === -1 && S.setRequestHeader(se, B);
4069
+ tt.indexOf(se) === -1 && C.setRequestHeader(se, B);
3980
4070
  });
3981
4071
  } else
3982
4072
  L.headers.forEach(function(B, se) {
3983
- S.setRequestHeader(se, B);
4073
+ C.setRequestHeader(se, B);
3984
4074
  });
3985
- L.signal && (L.signal.addEventListener("abort", we), S.onreadystatechange = function() {
3986
- S.readyState === 4 && L.signal.removeEventListener("abort", we);
3987
- }), S.send(typeof L._bodyInit > "u" ? null : L._bodyInit);
4075
+ L.signal && (L.signal.addEventListener("abort", Te), C.onreadystatechange = function() {
4076
+ C.readyState === 4 && L.signal.removeEventListener("abort", Te);
4077
+ }), C.send(typeof L._bodyInit > "u" ? null : L._bodyInit);
3988
4078
  });
3989
4079
  }
3990
4080
  return re.polyfill = !0, a.fetch || (a.fetch = re, a.Headers = E, a.Request = H, a.Response = V), o.Headers = E, o.Request = H, o.Response = V, o.fetch = re, Object.defineProperty(o, "__esModule", { value: !0 }), o;
@@ -3994,16 +4084,16 @@ function Ai() {
3994
4084
  t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
3995
4085
  })(Ae, Ae.exports)), Ae.exports;
3996
4086
  }
3997
- var Ce = Ai();
3998
- const _e = /* @__PURE__ */ Ti(Ce), Ii = /* @__PURE__ */ Lt({
4087
+ var Se = Oi();
4088
+ const be = /* @__PURE__ */ Ai(Se), Ii = /* @__PURE__ */ Lt({
3999
4089
  __proto__: null,
4000
- default: _e
4001
- }, [Ce]), ue = (e) => {
4090
+ default: be
4091
+ }, [Se]), ue = (e) => {
4002
4092
  let t = {};
4003
- return e && (typeof Headers < "u" && e instanceof Headers || Ii && Ce.Headers && e instanceof Ce.Headers ? t = xn(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
4093
+ return e && (typeof Headers < "u" && e instanceof Headers || Ii && Se.Headers && e instanceof Se.Headers ? t = xn(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
4004
4094
  n && i !== void 0 && (t[n] = i);
4005
4095
  }) : t = e), t;
4006
- }, ft = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Oi = (e) => {
4096
+ }, ft = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), _i = (e) => {
4007
4097
  if (!Array.isArray(e.query)) {
4008
4098
  const i = e, r = [`query=${encodeURIComponent(ft(i.query))}`];
4009
4099
  return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
@@ -4018,11 +4108,11 @@ const _e = /* @__PURE__ */ Ti(Ce), Ii = /* @__PURE__ */ Lt({
4018
4108
  }, bi = (e) => async (t) => {
4019
4109
  const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: a, middleware: u } = t, c = { ...t.headers };
4020
4110
  let l = "", f;
4021
- e === "POST" ? (f = Di(i, r, s, a.jsonSerializer), typeof f == "string" && (c["Content-Type"] = "application/json")) : l = Oi({
4111
+ e === "POST" ? (f = Ci(i, r, s, a.jsonSerializer), typeof f == "string" && (c["Content-Type"] = "application/json")) : l = _i({
4022
4112
  query: i,
4023
4113
  variables: r,
4024
4114
  operationName: s,
4025
- jsonSerializer: a.jsonSerializer ?? Ze
4115
+ jsonSerializer: a.jsonSerializer ?? We
4026
4116
  });
4027
4117
  const d = {
4028
4118
  method: e,
@@ -4030,31 +4120,31 @@ const _e = /* @__PURE__ */ Ti(Ce), Ii = /* @__PURE__ */ Lt({
4030
4120
  body: f,
4031
4121
  ...a
4032
4122
  };
4033
- let y = n, N = d;
4123
+ let N = n, T = d;
4034
4124
  if (u) {
4035
- const E = await Promise.resolve(u({ ...d, url: n, operationName: s, variables: r })), { url: x, ...O } = E;
4036
- y = x, N = O;
4125
+ const E = await Promise.resolve(u({ ...d, url: n, operationName: s, variables: r })), { url: x, ..._ } = E;
4126
+ N = x, T = _;
4037
4127
  }
4038
- return l && (y = `${y}?${l}`), await o(y, N);
4128
+ return l && (N = `${N}?${l}`), await o(N, T);
4039
4129
  };
4040
- class _i {
4130
+ class Di {
4041
4131
  constructor(t, n = {}) {
4042
4132
  this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
4043
- const [r, s, o] = i, a = kn(r, s, o), { headers: u, fetch: c = _e, method: l = "POST", requestMiddleware: f, responseMiddleware: d, ...y } = this.requestConfig, { url: N } = this;
4044
- a.signal !== void 0 && (y.signal = a.signal);
4045
- const { operationName: E } = Ue(a.query);
4046
- return qe({
4047
- url: N,
4133
+ const [r, s, o] = i, a = kn(r, s, o), { headers: u, fetch: c = be, method: l = "POST", requestMiddleware: f, responseMiddleware: d, ...N } = this.requestConfig, { url: T } = this;
4134
+ a.signal !== void 0 && (N.signal = a.signal);
4135
+ const { operationName: E } = qe(a.query);
4136
+ return Ve({
4137
+ url: T,
4048
4138
  query: a.query,
4049
4139
  variables: a.variables,
4050
4140
  headers: {
4051
- ...ue(Ve(u)),
4141
+ ...ue(je(u)),
4052
4142
  ...ue(a.requestHeaders)
4053
4143
  },
4054
4144
  operationName: E,
4055
4145
  fetch: c,
4056
4146
  method: l,
4057
- fetchOptions: y,
4147
+ fetchOptions: N,
4058
4148
  middleware: f
4059
4149
  }).then((x) => (d && d(x), x)).catch((x) => {
4060
4150
  throw d && d(x), x;
@@ -4062,18 +4152,18 @@ class _i {
4062
4152
  };
4063
4153
  }
4064
4154
  async request(t, ...n) {
4065
- const [i, r] = n, s = Cn(t, i, r), { headers: o, fetch: a = _e, method: u = "POST", requestMiddleware: c, responseMiddleware: l, ...f } = this.requestConfig, { url: d } = this;
4155
+ const [i, r] = n, s = Sn(t, i, r), { headers: o, fetch: a = be, method: u = "POST", requestMiddleware: c, responseMiddleware: l, ...f } = this.requestConfig, { url: d } = this;
4066
4156
  s.signal !== void 0 && (f.signal = s.signal);
4067
- const { query: y, operationName: N } = Ue(s.document);
4068
- return qe({
4157
+ const { query: N, operationName: T } = qe(s.document);
4158
+ return Ve({
4069
4159
  url: d,
4070
- query: y,
4160
+ query: N,
4071
4161
  variables: s.variables,
4072
4162
  headers: {
4073
- ...ue(Ve(o)),
4163
+ ...ue(je(o)),
4074
4164
  ...ue(s.requestHeaders)
4075
4165
  },
4076
- operationName: N,
4166
+ operationName: T,
4077
4167
  fetch: a,
4078
4168
  method: u,
4079
4169
  fetchOptions: f,
@@ -4086,18 +4176,18 @@ class _i {
4086
4176
  batchRequests(t, n) {
4087
4177
  const i = Rn(t, n), { headers: r, ...s } = this.requestConfig;
4088
4178
  i.signal !== void 0 && (s.signal = i.signal);
4089
- const o = i.documents.map(({ document: u }) => Ue(u).query), a = i.documents.map(({ variables: u }) => u);
4090
- return qe({
4179
+ const o = i.documents.map(({ document: u }) => qe(u).query), a = i.documents.map(({ variables: u }) => u);
4180
+ return Ve({
4091
4181
  url: this.url,
4092
4182
  query: o,
4093
4183
  // @ts-expect-error TODO reconcile batch variables into system.
4094
4184
  variables: a,
4095
4185
  headers: {
4096
- ...ue(Ve(r)),
4186
+ ...ue(je(r)),
4097
4187
  ...ue(i.requestHeaders)
4098
4188
  },
4099
4189
  operationName: void 0,
4100
- fetch: this.requestConfig.fetch ?? _e,
4190
+ fetch: this.requestConfig.fetch ?? be,
4101
4191
  method: this.requestConfig.method || "POST",
4102
4192
  fetchOptions: s,
4103
4193
  middleware: this.requestConfig.requestMiddleware
@@ -4122,8 +4212,8 @@ class _i {
4122
4212
  return this.url = t, this;
4123
4213
  }
4124
4214
  }
4125
- const qe = async (e) => {
4126
- const { query: t, variables: n, fetchOptions: i } = e, r = bi(Sn(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), a = await Si(o, i.jsonSerializer ?? Ze), u = Array.isArray(a) ? !a.some(({ data: l }) => !l) : !!a.data, c = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
4215
+ const Ve = async (e) => {
4216
+ const { query: t, variables: n, fetchOptions: i } = e, r = bi(Cn(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), a = await xi(o, i.jsonSerializer ?? We), u = Array.isArray(a) ? !a.some(({ data: l }) => !l) : !!a.data, c = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
4127
4217
  if (o.ok && c && u) {
4128
4218
  const { errors: l, ...f } = (Array.isArray(a), a), d = i.errorPolicy === "ignore" ? f : a;
4129
4219
  return {
@@ -4141,20 +4231,20 @@ const qe = async (e) => {
4141
4231
  { query: t, variables: n }
4142
4232
  );
4143
4233
  }
4144
- }, Di = (e, t, n, i) => {
4145
- const r = i ?? Ze;
4234
+ }, Ci = (e, t, n, i) => {
4235
+ const r = i ?? We;
4146
4236
  if (!Array.isArray(e))
4147
4237
  return r.stringify({ query: e, variables: t, operationName: n });
4148
4238
  if (typeof t < "u" && !Array.isArray(t))
4149
4239
  throw new Error("Cannot create request body with given variable type, array expected");
4150
4240
  const s = e.reduce((o, a, u) => (o.push({ query: a, variables: t ? t[u] : void 0 }), o), []);
4151
4241
  return r.stringify(s);
4152
- }, Si = async (e, t) => {
4242
+ }, xi = async (e, t) => {
4153
4243
  let n;
4154
4244
  return e.headers.forEach((i, r) => {
4155
4245
  r.toLowerCase() === "content-type" && (n = i);
4156
4246
  }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
4157
- }, Ve = (e) => typeof e == "function" ? e() : e, Rt = (e, ...t) => e.reduce((n, i, r) => `${n}${i}${r in t ? String(t[r]) : ""}`, ""), xi = {
4247
+ }, je = (e) => typeof e == "function" ? e() : e, Rt = (e, ...t) => e.reduce((n, i, r) => `${n}${i}${r in t ? String(t[r]) : ""}`, ""), Si = {
4158
4248
  getMeta: Rt`
4159
4249
  query getDoctype($doctype: String!) {
4160
4250
  getMeta(doctype: $doctype) {
@@ -4166,7 +4256,7 @@ const qe = async (e) => {
4166
4256
  }
4167
4257
  }
4168
4258
  `
4169
- }, ki = Rt`
4259
+ }, Ri = Rt`
4170
4260
  type Doctype {
4171
4261
  id: ID!
4172
4262
  name: String!
@@ -4212,7 +4302,7 @@ const qe = async (e) => {
4212
4302
  query: Query
4213
4303
  mutation: Mutation
4214
4304
  }
4215
- `, Ci = (e) => JSON.parse(e, (t, n) => {
4305
+ `, ki = (e) => JSON.parse(e, (t, n) => {
4216
4306
  if (typeof n == "string")
4217
4307
  try {
4218
4308
  return JSON.parse(n, (i, r) => typeof r == "string" && !isNaN(Number(r)) ? new de(r) : r);
@@ -4222,26 +4312,26 @@ const qe = async (e) => {
4222
4312
  else if (!isNaN(Number(n)))
4223
4313
  return new de(n);
4224
4314
  return n;
4225
- }), Ri = {
4315
+ }), Li = {
4226
4316
  getMeta: async (e, t) => {
4227
- const n = new _i(t || "/graphql", {
4317
+ const n = new Di(t || "/graphql", {
4228
4318
  fetch: window.fetch,
4229
4319
  jsonSerializer: {
4230
4320
  stringify: (r) => JSON.stringify(r),
4231
4321
  // process the request object before sending; leave as default JSON
4232
- parse: Ci
4322
+ parse: ki
4233
4323
  // process the response meta object
4234
4324
  }
4235
4325
  }), { getMeta: i } = await n.request({
4236
- document: xi.getMeta,
4326
+ document: Si.getMeta,
4237
4327
  variables: { doctype: e }
4238
4328
  });
4239
4329
  return i;
4240
4330
  }
4241
4331
  };
4242
4332
  export {
4243
- Ri as methods,
4244
- xi as queries,
4245
- ki as typeDefs
4333
+ Li as methods,
4334
+ Si as queries,
4335
+ Ri as typeDefs
4246
4336
  };
4247
4337
  //# sourceMappingURL=graphql-client.js.map