@stonecrop/graphql-client 0.4.16 → 0.4.18
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.
package/dist/graphql-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Lt(e, t) {
|
|
2
2
|
for (var n = 0; n < t.length; n++) {
|
|
3
3
|
const i = t[n];
|
|
4
4
|
if (typeof i != "string" && !Array.isArray(i)) {
|
|
@@ -21,7 +21,7 @@ function xt(e, t) {
|
|
|
21
21
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
22
22
|
* MIT Licence
|
|
23
23
|
*/
|
|
24
|
-
var
|
|
24
|
+
var le = 9e15, ie = 1e9, je = "0123456789abcdef", De = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Se = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", $e = {
|
|
25
25
|
// These values must be integers within the stated ranges (inclusive).
|
|
26
26
|
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
27
27
|
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
@@ -70,30 +70,30 @@ var Be = 9e15, ne = 1e9, Ue = "0123456789abcdef", Ie = "2.3025850929940456840179
|
|
|
70
70
|
// 0 to EXP_LIMIT
|
|
71
71
|
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
72
72
|
// JavaScript numbers: -324 (5e-324)
|
|
73
|
-
minE: -
|
|
73
|
+
minE: -le,
|
|
74
74
|
// -1 to -EXP_LIMIT
|
|
75
75
|
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
76
76
|
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
77
|
-
maxE:
|
|
77
|
+
maxE: le,
|
|
78
78
|
// 1 to EXP_LIMIT
|
|
79
79
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
80
80
|
crypto: !1
|
|
81
81
|
// true/false
|
|
82
|
-
},
|
|
83
|
-
|
|
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 };
|
|
83
|
+
g.absoluteValue = g.abs = function() {
|
|
84
84
|
var e = new this.constructor(this);
|
|
85
|
-
return e.s < 0 && (e.s = 1),
|
|
85
|
+
return e.s < 0 && (e.s = 1), v(e);
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
return
|
|
87
|
+
g.ceil = function() {
|
|
88
|
+
return v(new this.constructor(this), this.e + 1, 2);
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
g.clampedTo = g.clamp = function(e, t) {
|
|
91
91
|
var n, i = this, r = i.constructor;
|
|
92
92
|
if (e = new r(e), t = new r(t), !e.s || !t.s) return new r(NaN);
|
|
93
|
-
if (e.gt(t)) throw Error(
|
|
93
|
+
if (e.gt(t)) throw Error(ne + t);
|
|
94
94
|
return n = i.cmp(e), n < 0 ? e : i.cmp(t) > 0 ? t : new r(i);
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
g.comparedTo = g.cmp = function(e) {
|
|
97
97
|
var t, n, i, r, s = this, o = s.d, a = (e = new s.constructor(e)).d, u = s.s, c = e.s;
|
|
98
98
|
if (!o || !a)
|
|
99
99
|
return !u || !c ? NaN : u !== c ? u : o === a ? 0 : !o ^ u < 0 ? 1 : -1;
|
|
@@ -104,143 +104,143 @@ m.comparedTo = m.cmp = function(e) {
|
|
|
104
104
|
if (o[t] !== a[t]) return o[t] > a[t] ^ u < 0 ? 1 : -1;
|
|
105
105
|
return i === r ? 0 : i > r ^ u < 0 ? 1 : -1;
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
g.cosine = g.cos = function() {
|
|
108
108
|
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()) +
|
|
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);
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
g.cubeRoot = g.cbrt = function() {
|
|
112
112
|
var e, t, n, i, r, s, o, a, u, c, l = this, f = l.constructor;
|
|
113
113
|
if (!l.isFinite() || l.isZero()) return new f(l);
|
|
114
|
-
for (
|
|
115
|
-
if (a = i, u = a.times(a).times(a), c = u.plus(l), i =
|
|
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; ; )
|
|
115
|
+
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
116
|
if (n = n.slice(o - 3, o + 1), n == "9999" || !r && n == "4999") {
|
|
117
|
-
if (!r && (
|
|
117
|
+
if (!r && (v(a, e + 1, 0), a.times(a).times(a).eq(l))) {
|
|
118
118
|
i = a;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
o += 4, r = 1;
|
|
122
122
|
} else {
|
|
123
|
-
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (
|
|
123
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (v(i, e + 1, 1), t = !i.times(i).times(i).eq(l));
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
|
-
return
|
|
126
|
+
return I = !0, v(i, e, f.rounding, t);
|
|
127
127
|
};
|
|
128
|
-
|
|
128
|
+
g.decimalPlaces = g.dp = function() {
|
|
129
129
|
var e, t = this.d, n = NaN;
|
|
130
130
|
if (t) {
|
|
131
|
-
if (e = t.length - 1, n = (e -
|
|
131
|
+
if (e = t.length - 1, n = (e - j(this.e / T)) * T, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
|
|
132
132
|
n < 0 && (n = 0);
|
|
133
133
|
}
|
|
134
134
|
return n;
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
return
|
|
136
|
+
g.dividedBy = g.div = function(e) {
|
|
137
|
+
return R(this, new this.constructor(e));
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
g.dividedToIntegerBy = g.divToInt = function(e) {
|
|
140
140
|
var t = this, n = t.constructor;
|
|
141
|
-
return
|
|
141
|
+
return v(R(t, new n(e), 0, 1, 1), n.precision, n.rounding);
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
g.equals = g.eq = function(e) {
|
|
144
144
|
return this.cmp(e) === 0;
|
|
145
145
|
};
|
|
146
|
-
|
|
147
|
-
return
|
|
146
|
+
g.floor = function() {
|
|
147
|
+
return v(new this.constructor(this), this.e + 1, 3);
|
|
148
148
|
};
|
|
149
|
-
|
|
149
|
+
g.greaterThan = g.gt = function(e) {
|
|
150
150
|
return this.cmp(e) > 0;
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
g.greaterThanOrEqualTo = g.gte = function(e) {
|
|
153
153
|
var t = this.cmp(e);
|
|
154
154
|
return t == 1 || t === 0;
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
g.hyperbolicCosine = g.cosh = function() {
|
|
157
157
|
var e, t, n, i, r, s = this, o = s.constructor, a = new o(1);
|
|
158
158
|
if (!s.isFinite()) return new o(s.s ? 1 / 0 : NaN);
|
|
159
159
|
if (s.isZero()) return a;
|
|
160
|
-
n = o.precision, i = o.rounding, o.precision = n + Math.max(s.e, s.sd()) + 4, o.rounding = 1, r = s.d.length, r < 32 ? (e = Math.ceil(r / 3), t = (1 /
|
|
160
|
+
n = o.precision, i = o.rounding, o.precision = n + Math.max(s.e, s.sd()) + 4, o.rounding = 1, r = s.d.length, r < 32 ? (e = Math.ceil(r / 3), t = (1 / Le(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), s = he(o, 1, s.times(t), new o(1), !0);
|
|
161
161
|
for (var u, c = e, l = new o(8); c--; )
|
|
162
162
|
u = s.times(s), s = a.minus(u.times(l.minus(u.times(l))));
|
|
163
|
-
return
|
|
163
|
+
return v(s, o.precision = n, o.rounding = i, !0);
|
|
164
164
|
};
|
|
165
|
-
|
|
165
|
+
g.hyperbolicSine = g.sinh = function() {
|
|
166
166
|
var e, t, n, i, r = this, s = r.constructor;
|
|
167
167
|
if (!r.isFinite() || r.isZero()) return new s(r);
|
|
168
168
|
if (t = s.precision, n = s.rounding, s.precision = t + Math.max(r.e, r.sd()) + 4, s.rounding = 1, i = r.d.length, i < 3)
|
|
169
|
-
r =
|
|
169
|
+
r = he(s, 2, r, r, !0);
|
|
170
170
|
else {
|
|
171
|
-
e = 1.4 * Math.sqrt(i), e = e > 16 ? 16 : e | 0, r = r.times(1 /
|
|
171
|
+
e = 1.4 * Math.sqrt(i), e = e > 16 ? 16 : e | 0, r = r.times(1 / Le(5, e)), r = he(s, 2, r, r, !0);
|
|
172
172
|
for (var o, a = new s(5), u = new s(16), c = new s(20); e--; )
|
|
173
173
|
o = r.times(r), r = r.times(a.plus(o.times(u.times(o).plus(c))));
|
|
174
174
|
}
|
|
175
|
-
return s.precision = t, s.rounding = n,
|
|
175
|
+
return s.precision = t, s.rounding = n, v(r, t, n, !0);
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
g.hyperbolicTangent = g.tanh = function() {
|
|
178
178
|
var e, t, n = this, i = n.constructor;
|
|
179
|
-
return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 7, i.rounding = 1,
|
|
179
|
+
return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 7, i.rounding = 1, R(n.sinh(), n.cosh(), i.precision = e, i.rounding = t)) : new i(n.s);
|
|
180
180
|
};
|
|
181
|
-
|
|
181
|
+
g.inverseCosine = g.acos = function() {
|
|
182
182
|
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() ?
|
|
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));
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
g.inverseHyperbolicCosine = g.acosh = function() {
|
|
186
186
|
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,
|
|
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);
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
g.inverseHyperbolicSine = g.asinh = function() {
|
|
190
190
|
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,
|
|
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());
|
|
192
192
|
};
|
|
193
|
-
|
|
193
|
+
g.inverseHyperbolicTangent = g.atanh = function() {
|
|
194
194
|
var e, t, n, i, r = this, s = r.constructor;
|
|
195
|
-
return r.isFinite() ? r.e >= 0 ? new s(r.abs().eq(1) ? r.s / 0 : r.isZero() ? r : NaN) : (e = s.precision, t = s.rounding, i = r.sd(), Math.max(i, e) < 2 * -r.e - 1 ?
|
|
195
|
+
return r.isFinite() ? r.e >= 0 ? new s(r.abs().eq(1) ? r.s / 0 : r.isZero() ? r : NaN) : (e = s.precision, t = s.rounding, i = r.sd(), Math.max(i, e) < 2 * -r.e - 1 ? v(new s(r), e, t, !0) : (s.precision = n = i - r.e, r = R(r.plus(1), new s(1).minus(r), n + e, 1), s.precision = e + 4, s.rounding = 1, r = r.ln(), s.precision = e, s.rounding = t, r.times(0.5))) : new s(NaN);
|
|
196
196
|
};
|
|
197
|
-
|
|
197
|
+
g.inverseSine = g.asin = function() {
|
|
198
198
|
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 =
|
|
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)));
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
var e, t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision,
|
|
201
|
+
g.inverseTangent = g.atan = function() {
|
|
202
|
+
var e, t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, d = l.rounding;
|
|
203
203
|
if (c.isFinite()) {
|
|
204
204
|
if (c.isZero())
|
|
205
205
|
return new l(c);
|
|
206
|
-
if (c.abs().eq(1) && f + 4 <=
|
|
207
|
-
return o =
|
|
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;
|
|
208
208
|
} else {
|
|
209
209
|
if (!c.s) return new l(NaN);
|
|
210
|
-
if (f + 4 <=
|
|
211
|
-
return o =
|
|
210
|
+
if (f + 4 <= He)
|
|
211
|
+
return o = X(l, f + 4, d).times(0.5), o.s = c.s, o;
|
|
212
212
|
}
|
|
213
|
-
for (l.precision = a = f + 10, l.rounding = 1, n = Math.min(28, a /
|
|
214
|
-
for (
|
|
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; )
|
|
215
215
|
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)),
|
|
216
|
+
return n && (o = o.times(2 << n - 1)), I = !0, v(o, l.precision = f, l.rounding = d, !0);
|
|
217
217
|
};
|
|
218
|
-
|
|
218
|
+
g.isFinite = function() {
|
|
219
219
|
return !!this.d;
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
return !!this.d &&
|
|
221
|
+
g.isInteger = g.isInt = function() {
|
|
222
|
+
return !!this.d && j(this.e / T) > this.d.length - 2;
|
|
223
223
|
};
|
|
224
|
-
|
|
224
|
+
g.isNaN = function() {
|
|
225
225
|
return !this.s;
|
|
226
226
|
};
|
|
227
|
-
|
|
227
|
+
g.isNegative = g.isNeg = function() {
|
|
228
228
|
return this.s < 0;
|
|
229
229
|
};
|
|
230
|
-
|
|
230
|
+
g.isPositive = g.isPos = function() {
|
|
231
231
|
return this.s > 0;
|
|
232
232
|
};
|
|
233
|
-
|
|
233
|
+
g.isZero = function() {
|
|
234
234
|
return !!this.d && this.d[0] === 0;
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
g.lessThan = g.lt = function(e) {
|
|
237
237
|
return this.cmp(e) < 0;
|
|
238
238
|
};
|
|
239
|
-
|
|
239
|
+
g.lessThanOrEqualTo = g.lte = function(e) {
|
|
240
240
|
return this.cmp(e) < 1;
|
|
241
241
|
};
|
|
242
|
-
|
|
243
|
-
var t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision,
|
|
242
|
+
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;
|
|
244
244
|
if (e == null)
|
|
245
245
|
e = new l(10), t = !0;
|
|
246
246
|
else {
|
|
@@ -256,250 +256,250 @@ m.logarithm = m.log = function(e) {
|
|
|
256
256
|
for (r = n[0]; r % 10 === 0; ) r /= 10;
|
|
257
257
|
s = r !== 1;
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
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))
|
|
260
260
|
do
|
|
261
|
-
if (a += 10, o =
|
|
262
|
-
+
|
|
261
|
+
if (a += 10, o = te(c, a), i = t ? xe(l, a + 10) : te(e, a), u = R(o, i, a, 1), !s) {
|
|
262
|
+
+U(u.d).slice(r + 1, r + 15) + 1 == 1e14 && (u = v(u, f + 1, 0));
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
|
-
while (
|
|
266
|
-
return
|
|
265
|
+
while (ye(u.d, r += 10, d));
|
|
266
|
+
return I = !0, v(u, f, d);
|
|
267
267
|
};
|
|
268
|
-
|
|
269
|
-
var t, n, i, r, s, o, a, u, c, l, f,
|
|
270
|
-
if (e = new N(e), !
|
|
271
|
-
return !
|
|
272
|
-
if (
|
|
273
|
-
return e.s = -e.s,
|
|
274
|
-
if (c =
|
|
275
|
-
if (
|
|
276
|
-
else if (c[0]) e = new N(
|
|
268
|
+
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]) {
|
|
275
|
+
if (d[0]) e.s = -e.s;
|
|
276
|
+
else if (c[0]) e = new N(y);
|
|
277
277
|
else return new N(u === 3 ? -0 : 0);
|
|
278
|
-
return
|
|
278
|
+
return I ? v(e, a, u) : e;
|
|
279
279
|
}
|
|
280
|
-
if (n =
|
|
281
|
-
for (f = s < 0, f ? (t = c, s = -s, o =
|
|
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);
|
|
282
282
|
t.reverse();
|
|
283
283
|
} else {
|
|
284
|
-
for (i = c.length, o =
|
|
285
|
-
if (c[i] !=
|
|
286
|
-
f = c[i] <
|
|
284
|
+
for (i = c.length, o = d.length, f = i < o, f && (o = i), i = 0; i < o; i++)
|
|
285
|
+
if (c[i] != d[i]) {
|
|
286
|
+
f = c[i] < d[i];
|
|
287
287
|
break;
|
|
288
288
|
}
|
|
289
289
|
s = 0;
|
|
290
290
|
}
|
|
291
|
-
for (f && (t = c, c =
|
|
292
|
-
for (i =
|
|
293
|
-
if (c[--i] <
|
|
294
|
-
for (r = i; r && c[--r] === 0; ) c[r] =
|
|
295
|
-
--c[r], c[i] +=
|
|
291
|
+
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
|
+
for (i = d.length; i > s; ) {
|
|
293
|
+
if (c[--i] < d[i]) {
|
|
294
|
+
for (r = i; r && c[--r] === 0; ) c[r] = Q - 1;
|
|
295
|
+
--c[r], c[i] += Q;
|
|
296
296
|
}
|
|
297
|
-
c[i] -=
|
|
297
|
+
c[i] -= d[i];
|
|
298
298
|
}
|
|
299
299
|
for (; c[--o] === 0; ) c.pop();
|
|
300
300
|
for (; c[0] === 0; c.shift()) --n;
|
|
301
|
-
return c[0] ? (e.d = c, e.e =
|
|
301
|
+
return c[0] ? (e.d = c, e.e = Re(c, n), I ? v(e, a, u) : e) : new N(u === 3 ? -0 : 0);
|
|
302
302
|
};
|
|
303
|
-
|
|
303
|
+
g.modulo = g.mod = function(e) {
|
|
304
304
|
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] ?
|
|
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));
|
|
306
306
|
};
|
|
307
|
-
|
|
308
|
-
return
|
|
307
|
+
g.naturalExponential = g.exp = function() {
|
|
308
|
+
return Ge(this);
|
|
309
309
|
};
|
|
310
|
-
|
|
311
|
-
return
|
|
310
|
+
g.naturalLogarithm = g.ln = function() {
|
|
311
|
+
return te(this);
|
|
312
312
|
};
|
|
313
|
-
|
|
313
|
+
g.negated = g.neg = function() {
|
|
314
314
|
var e = new this.constructor(this);
|
|
315
|
-
return e.s = -e.s,
|
|
315
|
+
return e.s = -e.s, v(e);
|
|
316
316
|
};
|
|
317
|
-
|
|
318
|
-
var t, n, i, r, s, o, a, u, c, l, f = this,
|
|
319
|
-
if (e = new
|
|
320
|
-
return !f.s || !e.s ? e = new
|
|
317
|
+
g.plus = g.add = function(e) {
|
|
318
|
+
var t, n, i, r, s, o, a, u, c, l, f = this, d = f.constructor;
|
|
319
|
+
if (e = new d(e), !f.d || !e.d)
|
|
320
|
+
return !f.s || !e.s ? e = new d(NaN) : f.d || (e = new d(e.d || f.s === e.s ? f : NaN)), e;
|
|
321
321
|
if (f.s != e.s)
|
|
322
322
|
return e.s = -e.s, f.minus(e);
|
|
323
|
-
if (c = f.d, l = e.d, a =
|
|
324
|
-
return l[0] || (e = new
|
|
325
|
-
if (s =
|
|
326
|
-
for (r < 0 ? (n = c, r = -r, o = l.length) : (n = l, i = s, o = c.length), s = Math.ceil(a /
|
|
323
|
+
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);
|
|
327
327
|
n.reverse();
|
|
328
328
|
}
|
|
329
329
|
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) /
|
|
330
|
+
t = (c[--r] = c[r] + l[r] + t) / Q | 0, c[r] %= Q;
|
|
331
331
|
for (t && (c.unshift(t), ++i), o = c.length; c[--o] == 0; ) c.pop();
|
|
332
|
-
return e.d = c, e.e =
|
|
332
|
+
return e.d = c, e.e = Re(c, i), I ? v(e, a, u) : e;
|
|
333
333
|
};
|
|
334
|
-
|
|
334
|
+
g.precision = g.sd = function(e) {
|
|
335
335
|
var t, n = this;
|
|
336
|
-
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(
|
|
337
|
-
return n.d ? (t =
|
|
336
|
+
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(ne + e);
|
|
337
|
+
return n.d ? (t = Et(n.d), e && n.e + 1 > t && (t = n.e + 1)) : t = NaN, t;
|
|
338
338
|
};
|
|
339
|
-
|
|
339
|
+
g.round = function() {
|
|
340
340
|
var e = this, t = e.constructor;
|
|
341
|
-
return
|
|
341
|
+
return v(new t(e), e.e + 1, t.rounding);
|
|
342
342
|
};
|
|
343
|
-
|
|
343
|
+
g.sine = g.sin = function() {
|
|
344
344
|
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()) +
|
|
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);
|
|
346
346
|
};
|
|
347
|
-
|
|
347
|
+
g.squareRoot = g.sqrt = function() {
|
|
348
348
|
var e, t, n, i, r, s, o = this, a = o.d, u = o.e, c = o.s, l = o.constructor;
|
|
349
349
|
if (c !== 1 || !a || !a[0])
|
|
350
350
|
return new l(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
|
|
351
|
-
for (
|
|
352
|
-
if (s = i, i = s.plus(
|
|
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; ; )
|
|
352
|
+
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
353
|
if (t = t.slice(n - 3, n + 1), t == "9999" || !r && t == "4999") {
|
|
354
|
-
if (!r && (
|
|
354
|
+
if (!r && (v(s, u + 1, 0), s.times(s).eq(o))) {
|
|
355
355
|
i = s;
|
|
356
356
|
break;
|
|
357
357
|
}
|
|
358
358
|
n += 4, r = 1;
|
|
359
359
|
} else {
|
|
360
|
-
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (
|
|
360
|
+
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (v(i, u + 1, 1), e = !i.times(i).eq(o));
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
|
-
return
|
|
363
|
+
return I = !0, v(i, u, l.rounding, e);
|
|
364
364
|
};
|
|
365
|
-
|
|
365
|
+
g.tangent = g.tan = function() {
|
|
366
366
|
var e, t, n = this, i = n.constructor;
|
|
367
|
-
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 =
|
|
367
|
+
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
368
|
};
|
|
369
|
-
|
|
370
|
-
var t, n, i, r, s, o, a, u, c, l = this, f = l.constructor,
|
|
371
|
-
if (e.s *= l.s, !
|
|
372
|
-
return new f(!e.s ||
|
|
373
|
-
for (n =
|
|
369
|
+
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);
|
|
374
374
|
for (i = c; --i >= 0; ) {
|
|
375
375
|
for (t = 0, r = u + i; r > i; )
|
|
376
|
-
a = s[r] +
|
|
377
|
-
s[r] = (s[r] + t) %
|
|
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;
|
|
378
378
|
}
|
|
379
379
|
for (; !s[--o]; ) s.pop();
|
|
380
|
-
return t ? ++n : s.shift(), e.d = s, e.e =
|
|
380
|
+
return t ? ++n : s.shift(), e.d = s, e.e = Re(s, n), I ? v(e, f.precision, f.rounding) : e;
|
|
381
381
|
};
|
|
382
|
-
|
|
383
|
-
return
|
|
382
|
+
g.toBinary = function(e, t) {
|
|
383
|
+
return Qe(this, 2, e, t);
|
|
384
384
|
};
|
|
385
|
-
|
|
385
|
+
g.toDecimalPlaces = g.toDP = function(e, t) {
|
|
386
386
|
var n = this, i = n.constructor;
|
|
387
|
-
return n = new i(n), e === void 0 ? n : (
|
|
387
|
+
return n = new i(n), e === void 0 ? n : (G(e, 0, ie), t === void 0 ? t = i.rounding : G(t, 0, 8), v(n, e + n.e + 1, t));
|
|
388
388
|
};
|
|
389
|
-
|
|
389
|
+
g.toExponential = function(e, t) {
|
|
390
390
|
var n, i = this, r = i.constructor;
|
|
391
|
-
return e === void 0 ? n =
|
|
391
|
+
return e === void 0 ? n = Z(i, !0) : (G(e, 0, ie), t === void 0 ? t = r.rounding : G(t, 0, 8), i = v(new r(i), e + 1, t), n = Z(i, !0, e + 1)), i.isNeg() && !i.isZero() ? "-" + n : n;
|
|
392
392
|
};
|
|
393
|
-
|
|
393
|
+
g.toFixed = function(e, t) {
|
|
394
394
|
var n, i, r = this, s = r.constructor;
|
|
395
|
-
return e === void 0 ? n =
|
|
395
|
+
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
396
|
};
|
|
397
|
-
|
|
398
|
-
var t, n, i, r, s, o, a, u, c, l, f,
|
|
399
|
-
if (!N) return new y
|
|
400
|
-
if (c = n = new
|
|
397
|
+
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)
|
|
401
401
|
e = s > 0 ? t : c;
|
|
402
402
|
else {
|
|
403
|
-
if (a = new
|
|
403
|
+
if (a = new E(e), !a.isInt() || a.lt(c)) throw Error(ne + a);
|
|
404
404
|
e = a.gt(t) ? s > 0 ? t : c : a;
|
|
405
405
|
}
|
|
406
|
-
for (
|
|
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; )
|
|
407
407
|
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 =
|
|
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;
|
|
409
409
|
};
|
|
410
|
-
|
|
411
|
-
return
|
|
410
|
+
g.toHexadecimal = g.toHex = function(e, t) {
|
|
411
|
+
return Qe(this, 16, e, t);
|
|
412
412
|
};
|
|
413
|
-
|
|
413
|
+
g.toNearest = function(e, t) {
|
|
414
414
|
var n = this, i = n.constructor;
|
|
415
415
|
if (n = new i(n), e == null) {
|
|
416
416
|
if (!n.d) return n;
|
|
417
417
|
e = new i(1), t = i.rounding;
|
|
418
418
|
} else {
|
|
419
|
-
if (e = new i(e), t === void 0 ? t = i.rounding :
|
|
419
|
+
if (e = new i(e), t === void 0 ? t = i.rounding : G(t, 0, 8), !n.d) return e.s ? n : e;
|
|
420
420
|
if (!e.d)
|
|
421
421
|
return e.s && (e.s = n.s), e;
|
|
422
422
|
}
|
|
423
|
-
return e.d[0] ? (
|
|
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;
|
|
424
424
|
};
|
|
425
|
-
|
|
425
|
+
g.toNumber = function() {
|
|
426
426
|
return +this;
|
|
427
427
|
};
|
|
428
|
-
|
|
429
|
-
return
|
|
428
|
+
g.toOctal = function(e, t) {
|
|
429
|
+
return Qe(this, 8, e, t);
|
|
430
430
|
};
|
|
431
|
-
|
|
431
|
+
g.toPower = g.pow = function(e) {
|
|
432
432
|
var t, n, i, r, s, o, a = this, u = a.constructor, c = +(e = new u(e));
|
|
433
|
-
if (!a.d || !e.d || !a.d[0] || !e.d[0]) return new u(
|
|
433
|
+
if (!a.d || !e.d || !a.d[0] || !e.d[0]) return new u(P(+a, c));
|
|
434
434
|
if (a = new u(a), a.eq(1)) return a;
|
|
435
|
-
if (i = u.precision, s = u.rounding, e.eq(1)) return
|
|
436
|
-
if (t =
|
|
437
|
-
return r =
|
|
435
|
+
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);
|
|
438
438
|
if (o = a.s, o < 0) {
|
|
439
439
|
if (t < e.d.length - 1) return new u(NaN);
|
|
440
|
-
if (e.d[t] & 1
|
|
440
|
+
if ((e.d[t] & 1) == 0 && (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
441
441
|
return a.s = o, a;
|
|
442
442
|
}
|
|
443
|
-
return n =
|
|
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));
|
|
444
444
|
};
|
|
445
|
-
|
|
445
|
+
g.toPrecision = function(e, t) {
|
|
446
446
|
var n, i = this, r = i.constructor;
|
|
447
|
-
return e === void 0 ? n =
|
|
447
|
+
return e === void 0 ? n = Z(i, i.e <= r.toExpNeg || i.e >= r.toExpPos) : (G(e, 1, ie), t === void 0 ? t = r.rounding : G(t, 0, 8), i = v(new r(i), e, t), n = Z(i, e <= i.e || i.e <= r.toExpNeg, e)), i.isNeg() && !i.isZero() ? "-" + n : n;
|
|
448
448
|
};
|
|
449
|
-
|
|
449
|
+
g.toSignificantDigits = g.toSD = function(e, t) {
|
|
450
450
|
var n = this, i = n.constructor;
|
|
451
|
-
return e === void 0 ? (e = i.precision, t = i.rounding) : (
|
|
451
|
+
return e === void 0 ? (e = i.precision, t = i.rounding) : (G(e, 1, ie), t === void 0 ? t = i.rounding : G(t, 0, 8)), v(new i(n), e, t);
|
|
452
452
|
};
|
|
453
|
-
|
|
454
|
-
var e = this, t = e.constructor, n =
|
|
453
|
+
g.toString = function() {
|
|
454
|
+
var e = this, t = e.constructor, n = Z(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
455
455
|
return e.isNeg() && !e.isZero() ? "-" + n : n;
|
|
456
456
|
};
|
|
457
|
-
|
|
458
|
-
return
|
|
457
|
+
g.truncated = g.trunc = function() {
|
|
458
|
+
return v(new this.constructor(this), this.e + 1, 1);
|
|
459
459
|
};
|
|
460
|
-
|
|
461
|
-
var e = this, t = e.constructor, n =
|
|
460
|
+
g.valueOf = g.toJSON = function() {
|
|
461
|
+
var e = this, t = e.constructor, n = Z(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
462
462
|
return e.isNeg() ? "-" + n : n;
|
|
463
463
|
};
|
|
464
|
-
function
|
|
464
|
+
function U(e) {
|
|
465
465
|
var t, n, i, r = e.length - 1, s = "", o = e[0];
|
|
466
466
|
if (r > 0) {
|
|
467
467
|
for (s += o, t = 1; t < r; t++)
|
|
468
|
-
i = e[t] + "", n =
|
|
469
|
-
o = e[t], i = o + "", n =
|
|
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));
|
|
470
470
|
} else if (o === 0)
|
|
471
471
|
return "0";
|
|
472
472
|
for (; o % 10 === 0; ) o /= 10;
|
|
473
473
|
return s + o;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function G(e, t, n) {
|
|
476
476
|
if (e !== ~~e || e < t || e > n)
|
|
477
|
-
throw Error(
|
|
477
|
+
throw Error(ne + e);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function ye(e, t, n, i) {
|
|
480
480
|
var r, s, o, a;
|
|
481
481
|
for (s = e[0]; s >= 10; s /= 10) --t;
|
|
482
|
-
return --t < 0 ? (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;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Ie(e, t, n) {
|
|
485
485
|
for (var i, r = [0], s, o = 0, a = e.length; o < a; ) {
|
|
486
486
|
for (s = r.length; s--; ) r[s] *= t;
|
|
487
|
-
for (r[0] +=
|
|
487
|
+
for (r[0] += je.indexOf(e.charAt(o++)), i = 0; i < r.length; i++)
|
|
488
488
|
r[i] > n - 1 && (r[i + 1] === void 0 && (r[i + 1] = 0), r[i + 1] += r[i] / n | 0, r[i] %= n);
|
|
489
489
|
}
|
|
490
490
|
return r.reverse();
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function qt(e, t) {
|
|
493
493
|
var n, i, r;
|
|
494
494
|
if (t.isZero()) return t;
|
|
495
|
-
i = t.d.length, i < 32 ? (n = Math.ceil(i / 3), r = (1 /
|
|
495
|
+
i = t.d.length, i < 32 ? (n = Math.ceil(i / 3), r = (1 / Le(4, n)).toString()) : (n = 16, r = "2.3283064365386962890625e-10"), e.precision += n, t = he(e, 1, t.times(r), new e(1));
|
|
496
496
|
for (var s = n; s--; ) {
|
|
497
497
|
var o = t.times(t);
|
|
498
498
|
t = o.times(o).minus(o).times(8).plus(1);
|
|
499
499
|
}
|
|
500
500
|
return e.precision -= n, t;
|
|
501
501
|
}
|
|
502
|
-
var
|
|
502
|
+
var R = /* @__PURE__ */ function() {
|
|
503
503
|
function e(i, r, s) {
|
|
504
504
|
var o, a = 0, u = i.length;
|
|
505
505
|
for (i = i.slice(); u--; )
|
|
@@ -524,123 +524,123 @@ var k = /* @__PURE__ */ function() {
|
|
|
524
524
|
for (; !i[0] && i.length > 1; ) i.shift();
|
|
525
525
|
}
|
|
526
526
|
return function(i, r, s, o, a, u) {
|
|
527
|
-
var c, l, f,
|
|
528
|
-
if (!
|
|
529
|
-
return new
|
|
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])
|
|
529
|
+
return new ce(
|
|
530
530
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
531
|
-
!i.s || !r.s || (
|
|
531
|
+
!i.s || !r.s || (h ? p && h[0] == p[0] : !p) ? NaN : (
|
|
532
532
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
533
|
-
|
|
533
|
+
h && h[0] == 0 || !p ? re * 0 : re / 0
|
|
534
534
|
)
|
|
535
535
|
);
|
|
536
|
-
for (u ? (
|
|
537
|
-
if (
|
|
538
|
-
|
|
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;
|
|
539
539
|
else {
|
|
540
|
-
if (
|
|
541
|
-
for (
|
|
542
|
-
|
|
543
|
-
N =
|
|
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;
|
|
544
544
|
} else {
|
|
545
|
-
for (
|
|
546
|
-
|
|
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;
|
|
547
547
|
do
|
|
548
|
-
|
|
549
|
-
while ((
|
|
550
|
-
N =
|
|
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);
|
|
549
|
+
while ((ae++ < H || b[0] !== void 0) && $--);
|
|
550
|
+
N = b[0] !== void 0;
|
|
551
551
|
}
|
|
552
|
-
|
|
552
|
+
q[0] || q.shift();
|
|
553
553
|
}
|
|
554
|
-
if (
|
|
555
|
-
|
|
554
|
+
if (y == 1)
|
|
555
|
+
O.e = l, ht = N;
|
|
556
556
|
else {
|
|
557
|
-
for (f = 1,
|
|
558
|
-
|
|
557
|
+
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);
|
|
559
559
|
}
|
|
560
|
-
return
|
|
560
|
+
return O;
|
|
561
561
|
};
|
|
562
562
|
}();
|
|
563
|
-
function
|
|
564
|
-
var r, s, o, a, u, c, l, f,
|
|
563
|
+
function v(e, t, n, i) {
|
|
564
|
+
var r, s, o, a, u, c, l, f, d, y = e.constructor;
|
|
565
565
|
e: if (t != null) {
|
|
566
566
|
if (f = e.d, !f) return e;
|
|
567
567
|
for (r = 1, a = f[0]; a >= 10; a /= 10) r++;
|
|
568
568
|
if (s = t - r, s < 0)
|
|
569
|
-
s +=
|
|
570
|
-
else if (
|
|
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)
|
|
571
571
|
if (i) {
|
|
572
|
-
for (; a++ <=
|
|
573
|
-
l = u = 0, r = 1, s %=
|
|
572
|
+
for (; a++ <= d; ) f.push(0);
|
|
573
|
+
l = u = 0, r = 1, s %= T, o = s - T + 1;
|
|
574
574
|
} else
|
|
575
575
|
break e;
|
|
576
576
|
else {
|
|
577
|
-
for (l = a = f[
|
|
578
|
-
s %=
|
|
577
|
+
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;
|
|
579
579
|
}
|
|
580
|
-
if (i = i || t < 0 || f[
|
|
581
|
-
(s > 0 ? o > 0 ? l /
|
|
582
|
-
return f.length = 0, c ? (t -= e.e + 1, f[0] =
|
|
583
|
-
if (s == 0 ? (f.length =
|
|
580
|
+
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
|
+
(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)
|
|
584
584
|
for (; ; )
|
|
585
|
-
if (
|
|
585
|
+
if (d == 0) {
|
|
586
586
|
for (s = 1, o = f[0]; o >= 10; o /= 10) s++;
|
|
587
587
|
for (o = f[0] += a, a = 1; o >= 10; o /= 10) a++;
|
|
588
|
-
s != a && (e.e++, f[0] ==
|
|
588
|
+
s != a && (e.e++, f[0] == Q && (f[0] = 1));
|
|
589
589
|
break;
|
|
590
590
|
} else {
|
|
591
|
-
if (f[
|
|
592
|
-
f[
|
|
591
|
+
if (f[d] += a, f[d] != Q) break;
|
|
592
|
+
f[d--] = 0, a = 1;
|
|
593
593
|
}
|
|
594
594
|
for (s = f.length; f[--s] === 0; ) f.pop();
|
|
595
595
|
}
|
|
596
|
-
return
|
|
596
|
+
return I && (e.e > y.maxE ? (e.d = null, e.e = NaN) : e.e < y.minE && (e.e = 0, e.d = [0])), e;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
if (!e.isFinite()) return
|
|
600
|
-
var i, r = e.e, s =
|
|
601
|
-
return t ? (n && (i = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) +
|
|
598
|
+
function Z(e, t, n) {
|
|
599
|
+
if (!e.isFinite()) return wt(e);
|
|
600
|
+
var i, r = e.e, s = U(e.d), o = s.length;
|
|
601
|
+
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
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Re(e, t) {
|
|
604
604
|
var n = e[0];
|
|
605
|
-
for (t *=
|
|
605
|
+
for (t *= T; n >= 10; n /= 10) t++;
|
|
606
606
|
return t;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
if (t >
|
|
610
|
-
throw
|
|
611
|
-
return
|
|
608
|
+
function xe(e, t, n) {
|
|
609
|
+
if (t > Ut)
|
|
610
|
+
throw I = !0, n && (e.precision = n), Error(dt);
|
|
611
|
+
return v(new e(De), t, 1, !0);
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
if (t >
|
|
615
|
-
return
|
|
613
|
+
function X(e, t, n) {
|
|
614
|
+
if (t > He) throw Error(dt);
|
|
615
|
+
return v(new e(Se), t, n, !0);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
var t = e.length - 1, n = t *
|
|
617
|
+
function Et(e) {
|
|
618
|
+
var t = e.length - 1, n = t * T + 1;
|
|
619
619
|
if (t = e[t], t) {
|
|
620
620
|
for (; t % 10 == 0; t /= 10) n--;
|
|
621
621
|
for (t = e[0]; t >= 10; t /= 10) n++;
|
|
622
622
|
}
|
|
623
623
|
return n;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function ee(e) {
|
|
626
626
|
for (var t = ""; e--; ) t += "0";
|
|
627
627
|
return t;
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
var r, s = new e(1), o = Math.ceil(i /
|
|
631
|
-
for (
|
|
632
|
-
if (n % 2 && (s = s.times(t),
|
|
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) {
|
|
633
633
|
n = s.d.length - 1, r && s.d[n] === 0 && ++s.d[n];
|
|
634
634
|
break;
|
|
635
635
|
}
|
|
636
|
-
t = t.times(t),
|
|
636
|
+
t = t.times(t), nt(t.d, o);
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return I = !0, s;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function tt(e) {
|
|
641
641
|
return e.d[e.d.length - 1] & 1;
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Nt(e, t, n) {
|
|
644
644
|
for (var i, r = new e(t[0]), s = 0; ++s < t.length; )
|
|
645
645
|
if (i = new e(t[s]), i.s)
|
|
646
646
|
r[n](i) && (r = i);
|
|
@@ -650,141 +650,141 @@ function mt(e, t, n) {
|
|
|
650
650
|
}
|
|
651
651
|
return r;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
var n, i, r, s, o, a, u, c = 0, l = 0, f = 0,
|
|
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;
|
|
655
655
|
if (!e.d || !e.d[0] || e.e > 17)
|
|
656
|
-
return new
|
|
657
|
-
for (t == null ? (
|
|
656
|
+
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; )
|
|
658
658
|
e = e.times(a), f += 5;
|
|
659
|
-
for (i = Math.log(
|
|
660
|
-
if (s =
|
|
661
|
-
for (r = f; r--; ) o =
|
|
659
|
+
for (i = Math.log(P(2, f)) / Math.LN10 * 2 + 5 | 0, u += i, n = s = o = new d(1), d.precision = u; ; ) {
|
|
660
|
+
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
|
+
for (r = f; r--; ) o = v(o.times(o), u, 1);
|
|
662
662
|
if (t == null)
|
|
663
|
-
if (c < 3 &&
|
|
664
|
-
|
|
663
|
+
if (c < 3 && ye(o.d, u - i, y, c))
|
|
664
|
+
d.precision = u += 10, n = s = a = new d(1), l = 0, c++;
|
|
665
665
|
else
|
|
666
|
-
return
|
|
666
|
+
return v(o, d.precision = N, y, I = !0);
|
|
667
667
|
else
|
|
668
|
-
return
|
|
668
|
+
return d.precision = N, o;
|
|
669
669
|
}
|
|
670
670
|
o = a;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
var n, i, r, s, o, a, u, c, l, f,
|
|
675
|
-
if (
|
|
676
|
-
return new
|
|
677
|
-
if (t == null ? (
|
|
673
|
+
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;
|
|
675
|
+
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) {
|
|
678
678
|
for (; i < 7 && i != 1 || i == 1 && n.charAt(1) > 3; )
|
|
679
|
-
|
|
680
|
-
s =
|
|
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));
|
|
681
681
|
} else
|
|
682
|
-
return c =
|
|
683
|
-
for (f =
|
|
684
|
-
if (o =
|
|
685
|
-
if (u = u.times(2), s !== 0 && (u = u.plus(
|
|
686
|
-
if (
|
|
687
|
-
|
|
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;
|
|
683
|
+
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;
|
|
688
688
|
else
|
|
689
|
-
return
|
|
689
|
+
return v(u, O.precision = b, q, I = !0);
|
|
690
690
|
else
|
|
691
|
-
return
|
|
691
|
+
return O.precision = b, u;
|
|
692
692
|
u = c, r += 2;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function wt(e) {
|
|
696
696
|
return String(e.s * e.s / 0);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Ye(e, t) {
|
|
699
699
|
var n, i, r;
|
|
700
700
|
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
701
|
for (r = t.length; t.charCodeAt(r - 1) === 48; --r) ;
|
|
702
702
|
if (t = t.slice(i, r), t) {
|
|
703
|
-
if (r -= i, e.e = n = n - i - 1, e.d = [], i = (n + 1) %
|
|
704
|
-
for (i && e.d.push(+t.slice(0, i)), r -=
|
|
705
|
-
t = t.slice(i), i =
|
|
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;
|
|
706
706
|
} else
|
|
707
707
|
i -= r;
|
|
708
708
|
for (; i--; ) t += "0";
|
|
709
|
-
e.d.push(+t),
|
|
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]));
|
|
710
710
|
} else
|
|
711
711
|
e.e = 0, e.d = [0];
|
|
712
712
|
return e;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Vt(e, t) {
|
|
715
715
|
var n, i, r, s, o, a, u, c, l;
|
|
716
716
|
if (t.indexOf("_") > -1) {
|
|
717
|
-
if (t = t.replace(/(\d)_(?=\d)/g, "$1"),
|
|
717
|
+
if (t = t.replace(/(\d)_(?=\d)/g, "$1"), gt.test(t)) return Ye(e, t);
|
|
718
718
|
} else if (t === "Infinity" || t === "NaN")
|
|
719
719
|
return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
720
|
-
if (
|
|
720
|
+
if (Pt.test(t))
|
|
721
721
|
n = 16, t = t.toLowerCase();
|
|
722
|
-
else if (
|
|
722
|
+
else if (Ft.test(t))
|
|
723
723
|
n = 2;
|
|
724
|
-
else if (
|
|
724
|
+
else if (Mt.test(t))
|
|
725
725
|
n = 8;
|
|
726
726
|
else
|
|
727
|
-
throw Error(
|
|
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 =
|
|
729
|
-
return s < 0 ? new i(e.s * 0) : (e.e =
|
|
727
|
+
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);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function jt(e, t) {
|
|
732
732
|
var n, i = t.d.length;
|
|
733
733
|
if (i < 3)
|
|
734
|
-
return t.isZero() ? t :
|
|
735
|
-
n = 1.4 * Math.sqrt(i), n = n > 16 ? 16 : n | 0, t = t.times(1 /
|
|
734
|
+
return t.isZero() ? t : he(e, 2, t, t);
|
|
735
|
+
n = 1.4 * Math.sqrt(i), n = n > 16 ? 16 : n | 0, t = t.times(1 / Le(5, n)), t = he(e, 2, t, t);
|
|
736
736
|
for (var r, s = new e(5), o = new e(16), a = new e(20); n--; )
|
|
737
737
|
r = t.times(t), t = t.times(s.plus(r.times(o.times(r).minus(a))));
|
|
738
738
|
return t;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
var s, o, a, u, c = e.precision, l = Math.ceil(c /
|
|
742
|
-
for (
|
|
743
|
-
if (o =
|
|
740
|
+
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); ; ) {
|
|
743
|
+
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
744
|
for (s = l; o.d[s] === a.d[s] && s--; ) ;
|
|
745
745
|
if (s == -1) break;
|
|
746
746
|
}
|
|
747
747
|
s = a, a = i, i = o, o = s;
|
|
748
748
|
}
|
|
749
|
-
return
|
|
749
|
+
return I = !0, o.d.length = l + 1, o;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function Le(e, t) {
|
|
752
752
|
for (var n = e; --t; ) n *= e;
|
|
753
753
|
return n;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
var n, i = t.s < 0, r =
|
|
755
|
+
function vt(e, t) {
|
|
756
|
+
var n, i = t.s < 0, r = X(e, e.precision, 1), s = r.times(0.5);
|
|
757
757
|
if (t = t.abs(), t.lte(s))
|
|
758
|
-
return
|
|
758
|
+
return W = i ? 4 : 1, t;
|
|
759
759
|
if (n = t.divToInt(r), n.isZero())
|
|
760
|
-
|
|
760
|
+
W = i ? 3 : 2;
|
|
761
761
|
else {
|
|
762
762
|
if (t = t.minus(n.times(r)), t.lte(s))
|
|
763
|
-
return
|
|
764
|
-
|
|
763
|
+
return W = tt(n) ? i ? 2 : 3 : i ? 4 : 1, t;
|
|
764
|
+
W = tt(n) ? i ? 1 : 4 : i ? 3 : 2;
|
|
765
765
|
}
|
|
766
766
|
return t.minus(r).abs();
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
var r, s, o, a, u, c, l, f,
|
|
770
|
-
if (N ? (
|
|
771
|
-
l =
|
|
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);
|
|
772
772
|
else {
|
|
773
|
-
for (l =
|
|
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();
|
|
774
774
|
if (!f[0])
|
|
775
775
|
l = N ? "0p+0" : "0";
|
|
776
776
|
else {
|
|
777
|
-
if (o < 0 ? s-- : (e = new
|
|
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)
|
|
778
778
|
for (; ++f[--n] > r - 1; )
|
|
779
779
|
f[n] = 0, n || (++s, f.unshift(1));
|
|
780
780
|
for (u = f.length; !f[u - 1]; --u) ;
|
|
781
|
-
for (o = 0, l = ""; o < u; o++) l +=
|
|
781
|
+
for (o = 0, l = ""; o < u; o++) l += je.charAt(f[o]);
|
|
782
782
|
if (N) {
|
|
783
783
|
if (u > 1)
|
|
784
784
|
if (t == 16 || t == 8) {
|
|
785
785
|
for (o = t == 16 ? 4 : 3, --u; u % o; u++) l += "0";
|
|
786
|
-
for (f =
|
|
787
|
-
for (o = 1, l = "1."; o < u; o++) l +=
|
|
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]);
|
|
788
788
|
} else
|
|
789
789
|
l = l.charAt(0) + "." + l.slice(1);
|
|
790
790
|
l = l + (s < 0 ? "p" : "p+") + s;
|
|
@@ -798,103 +798,103 @@ function Je(e, t, n, i) {
|
|
|
798
798
|
}
|
|
799
799
|
return e.s < 0 ? "-" + l : l;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function nt(e, t) {
|
|
802
802
|
if (e.length > t)
|
|
803
803
|
return e.length = t, !0;
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function $t(e) {
|
|
806
806
|
return new this(e).abs();
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Ht(e) {
|
|
809
809
|
return new this(e).acos();
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function Gt(e) {
|
|
812
812
|
return new this(e).acosh();
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Yt(e, t) {
|
|
815
815
|
return new this(e).plus(t);
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function Jt(e) {
|
|
818
818
|
return new this(e).asin();
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function zt(e) {
|
|
821
821
|
return new this(e).asinh();
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Xt(e) {
|
|
824
824
|
return new this(e).atan();
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Qt(e) {
|
|
827
827
|
return new this(e).atanh();
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Zt(e, t) {
|
|
830
830
|
e = new this(e), t = new this(t);
|
|
831
831
|
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 =
|
|
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;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Wt(e) {
|
|
835
835
|
return new this(e).cbrt();
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
return
|
|
837
|
+
function Kt(e) {
|
|
838
|
+
return v(e = new this(e), e.e + 1, 2);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function en(e, t, n) {
|
|
841
841
|
return new this(e).clamp(t, n);
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
if (!e || typeof e != "object") throw Error(
|
|
843
|
+
function tn(e) {
|
|
844
|
+
if (!e || typeof e != "object") throw Error(ke + "Object expected");
|
|
845
845
|
var t, n, i, r = e.defaults === !0, s = [
|
|
846
846
|
"precision",
|
|
847
847
|
1,
|
|
848
|
-
|
|
848
|
+
ie,
|
|
849
849
|
"rounding",
|
|
850
850
|
0,
|
|
851
851
|
8,
|
|
852
852
|
"toExpNeg",
|
|
853
|
-
-
|
|
853
|
+
-le,
|
|
854
854
|
0,
|
|
855
855
|
"toExpPos",
|
|
856
856
|
0,
|
|
857
|
-
|
|
857
|
+
le,
|
|
858
858
|
"maxE",
|
|
859
859
|
0,
|
|
860
|
-
|
|
860
|
+
le,
|
|
861
861
|
"minE",
|
|
862
|
-
-
|
|
862
|
+
-le,
|
|
863
863
|
0,
|
|
864
864
|
"modulo",
|
|
865
865
|
0,
|
|
866
866
|
9
|
|
867
867
|
];
|
|
868
868
|
for (t = 0; t < s.length; t += 3)
|
|
869
|
-
if (n = s[t], r && (this[n] =
|
|
870
|
-
if (
|
|
871
|
-
else throw Error(
|
|
872
|
-
if (n = "crypto", r && (this[n] =
|
|
869
|
+
if (n = s[t], r && (this[n] = $e[n]), (i = e[n]) !== void 0)
|
|
870
|
+
if (j(i) === i && i >= s[t + 1] && i <= s[t + 2]) this[n] = i;
|
|
871
|
+
else throw Error(ne + n + ": " + i);
|
|
872
|
+
if (n = "crypto", r && (this[n] = $e[n]), (i = e[n]) !== void 0)
|
|
873
873
|
if (i === !0 || i === !1 || i === 0 || i === 1)
|
|
874
874
|
if (i)
|
|
875
875
|
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
876
876
|
this[n] = !0;
|
|
877
877
|
else
|
|
878
|
-
throw Error(
|
|
878
|
+
throw Error(pt);
|
|
879
879
|
else
|
|
880
880
|
this[n] = !1;
|
|
881
881
|
else
|
|
882
|
-
throw Error(
|
|
882
|
+
throw Error(ne + n + ": " + i);
|
|
883
883
|
return this;
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function nn(e) {
|
|
886
886
|
return new this(e).cos();
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function rn(e) {
|
|
889
889
|
return new this(e).cosh();
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Tt(e) {
|
|
892
892
|
var t, n, i;
|
|
893
893
|
function r(s) {
|
|
894
894
|
var o, a, u, c = this;
|
|
895
895
|
if (!(c instanceof r)) return new r(s);
|
|
896
|
-
if (c.constructor = r,
|
|
897
|
-
c.s = s.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);
|
|
898
898
|
return;
|
|
899
899
|
}
|
|
900
900
|
if (u = typeof s, u === "number") {
|
|
@@ -904,75 +904,75 @@ function Nt(e) {
|
|
|
904
904
|
}
|
|
905
905
|
if (s < 0 ? (s = -s, c.s = -1) : c.s = 1, s === ~~s && s < 1e7) {
|
|
906
906
|
for (o = 0, a = s; a >= 10; a /= 10) o++;
|
|
907
|
-
|
|
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]);
|
|
908
908
|
return;
|
|
909
909
|
} else if (s * 0 !== 0) {
|
|
910
910
|
s || (c.s = NaN), c.e = NaN, c.d = null;
|
|
911
911
|
return;
|
|
912
912
|
}
|
|
913
|
-
return
|
|
913
|
+
return Ye(c, s.toString());
|
|
914
914
|
} else if (u !== "string")
|
|
915
|
-
throw Error(
|
|
916
|
-
return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), c.s = -1) : (a === 43 && (s = s.slice(1)), c.s = 1),
|
|
915
|
+
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);
|
|
917
917
|
}
|
|
918
|
-
if (r.prototype =
|
|
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)
|
|
919
919
|
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
920
|
return r.config(e), r;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function sn(e, t) {
|
|
923
923
|
return new this(e).div(t);
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function on(e) {
|
|
926
926
|
return new this(e).exp();
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
928
|
+
function an(e) {
|
|
929
|
+
return v(e = new this(e), e.e + 1, 3);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function cn() {
|
|
932
932
|
var e, t, n = new this(0);
|
|
933
|
-
for (
|
|
933
|
+
for (I = !1, e = 0; e < arguments.length; )
|
|
934
934
|
if (t = new this(arguments[e++]), t.d)
|
|
935
935
|
n.d && (n = n.plus(t.times(t)));
|
|
936
936
|
else {
|
|
937
937
|
if (t.s)
|
|
938
|
-
return
|
|
938
|
+
return I = !0, new this(1 / 0);
|
|
939
939
|
n = t;
|
|
940
940
|
}
|
|
941
|
-
return
|
|
941
|
+
return I = !0, n.sqrt();
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
return e instanceof
|
|
943
|
+
function it(e) {
|
|
944
|
+
return e instanceof de || e && e.toStringTag === mt || !1;
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function un(e) {
|
|
947
947
|
return new this(e).ln();
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function ln(e, t) {
|
|
950
950
|
return new this(e).log(t);
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function fn(e) {
|
|
953
953
|
return new this(e).log(2);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function hn(e) {
|
|
956
956
|
return new this(e).log(10);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
return
|
|
958
|
+
function dn() {
|
|
959
|
+
return Nt(this, arguments, "lt");
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
return
|
|
961
|
+
function pn() {
|
|
962
|
+
return Nt(this, arguments, "gt");
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function mn(e, t) {
|
|
965
965
|
return new this(e).mod(t);
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function gn(e, t) {
|
|
968
968
|
return new this(e).mul(t);
|
|
969
969
|
}
|
|
970
|
-
function
|
|
970
|
+
function En(e, t) {
|
|
971
971
|
return new this(e).pow(t);
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function yn(e) {
|
|
974
974
|
var t, n, i, r, s = 0, o = new this(1), a = [];
|
|
975
|
-
if (e === void 0 ? e = this.precision :
|
|
975
|
+
if (e === void 0 ? e = this.precision : G(e, 1, ie), i = Math.ceil(e / T), this.crypto)
|
|
976
976
|
if (crypto.getRandomValues)
|
|
977
977
|
for (t = crypto.getRandomValues(new Uint32Array(i)); s < i; )
|
|
978
978
|
r = t[s], r >= 429e7 ? t[s] = crypto.getRandomValues(new Uint32Array(1))[0] : a[s++] = r % 1e7;
|
|
@@ -981,93 +981,93 @@ function pn(e) {
|
|
|
981
981
|
r = t[s] + (t[s + 1] << 8) + (t[s + 2] << 16) + ((t[s + 3] & 127) << 24), r >= 214e7 ? crypto.randomBytes(4).copy(t, s) : (a.push(r % 1e7), s += 4);
|
|
982
982
|
s = i / 4;
|
|
983
983
|
} else
|
|
984
|
-
throw Error(
|
|
984
|
+
throw Error(pt);
|
|
985
985
|
else for (; s < i; ) a[s++] = Math.random() * 1e7 | 0;
|
|
986
|
-
for (i = a[--s], e %=
|
|
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();
|
|
987
987
|
if (s < 0)
|
|
988
988
|
n = 0, a = [0];
|
|
989
989
|
else {
|
|
990
|
-
for (n = -1; a[0] === 0; n -=
|
|
990
|
+
for (n = -1; a[0] === 0; n -= T) a.shift();
|
|
991
991
|
for (i = 1, r = a[0]; r >= 10; r /= 10) i++;
|
|
992
|
-
i <
|
|
992
|
+
i < T && (n -= T - i);
|
|
993
993
|
}
|
|
994
994
|
return o.e = n, o.d = a, o;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
996
|
+
function Nn(e) {
|
|
997
|
+
return v(e = new this(e), e.e + 1, this.rounding);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function wn(e) {
|
|
1000
1000
|
return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function vn(e) {
|
|
1003
1003
|
return new this(e).sin();
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function Tn(e) {
|
|
1006
1006
|
return new this(e).sinh();
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function An(e) {
|
|
1009
1009
|
return new this(e).sqrt();
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function In(e, t) {
|
|
1012
1012
|
return new this(e).sub(t);
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function On() {
|
|
1015
1015
|
var e = 0, t = arguments, n = new this(t[e]);
|
|
1016
|
-
for (
|
|
1017
|
-
return
|
|
1016
|
+
for (I = !1; n.s && ++e < t.length; ) n = n.plus(t[e]);
|
|
1017
|
+
return I = !0, v(n, this.precision, this.rounding);
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function bn(e) {
|
|
1020
1020
|
return new this(e).tan();
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function _n(e) {
|
|
1023
1023
|
return new this(e).tanh();
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1025
|
+
function Dn(e) {
|
|
1026
|
+
return v(e = new this(e), e.e + 1, 1);
|
|
1027
1027
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
var
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
const
|
|
1028
|
+
g[Symbol.for("nodejs.util.inspect.custom")] = g.toString;
|
|
1029
|
+
g[Symbol.toStringTag] = "Decimal";
|
|
1030
|
+
var de = g.constructor = Tt($e);
|
|
1031
|
+
De = new de(De);
|
|
1032
|
+
Se = new de(Se);
|
|
1033
|
+
const Ze = JSON, Sn = (e) => e.toUpperCase(), xn = (e) => {
|
|
1034
1034
|
const t = {};
|
|
1035
1035
|
return e.forEach((n, i) => {
|
|
1036
1036
|
t[i] = n;
|
|
1037
1037
|
}), t;
|
|
1038
|
-
},
|
|
1038
|
+
}, Cn = (e, t, n) => e.document ? e : {
|
|
1039
1039
|
document: e,
|
|
1040
1040
|
variables: t,
|
|
1041
1041
|
requestHeaders: n,
|
|
1042
1042
|
signal: void 0
|
|
1043
|
-
},
|
|
1043
|
+
}, kn = (e, t, n) => e.query ? e : {
|
|
1044
1044
|
query: e,
|
|
1045
1045
|
variables: t,
|
|
1046
1046
|
requestHeaders: n,
|
|
1047
1047
|
signal: void 0
|
|
1048
|
-
},
|
|
1048
|
+
}, Rn = (e, t) => e.documents ? e : {
|
|
1049
1049
|
documents: e,
|
|
1050
1050
|
requestHeaders: t,
|
|
1051
1051
|
signal: void 0
|
|
1052
1052
|
};
|
|
1053
|
-
function
|
|
1053
|
+
function Oe(e, t) {
|
|
1054
1054
|
if (!!!e)
|
|
1055
1055
|
throw new Error(t);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function Ln(e) {
|
|
1058
1058
|
return typeof e == "object" && e !== null;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function Fn(e, t) {
|
|
1061
1061
|
if (!!!e)
|
|
1062
1062
|
throw new Error(
|
|
1063
1063
|
"Unexpected invariant triggered."
|
|
1064
1064
|
);
|
|
1065
1065
|
}
|
|
1066
|
-
const
|
|
1067
|
-
function
|
|
1066
|
+
const Pn = /\r\n|[\n\r]/g;
|
|
1067
|
+
function Je(e, t) {
|
|
1068
1068
|
let n = 0, i = 1;
|
|
1069
|
-
for (const r of e.body.matchAll(
|
|
1070
|
-
if (typeof r.index == "number" ||
|
|
1069
|
+
for (const r of e.body.matchAll(Pn)) {
|
|
1070
|
+
if (typeof r.index == "number" || Fn(!1), r.index >= t)
|
|
1071
1071
|
break;
|
|
1072
1072
|
n = r.index + r[0].length, i += 1;
|
|
1073
1073
|
}
|
|
@@ -1076,27 +1076,27 @@ function He(e, t) {
|
|
|
1076
1076
|
column: t + 1 - n
|
|
1077
1077
|
};
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1079
|
+
function Mn(e) {
|
|
1080
|
+
return At(
|
|
1081
1081
|
e.source,
|
|
1082
|
-
|
|
1082
|
+
Je(e.source, e.start)
|
|
1083
1083
|
);
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function At(e, t) {
|
|
1086
1086
|
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
1087
|
`, l = i.split(/\r\n|[\n\r]/g), f = l[r];
|
|
1088
1088
|
if (f.length > 120) {
|
|
1089
|
-
const
|
|
1090
|
-
for (let
|
|
1091
|
-
N.push(f.slice(
|
|
1092
|
-
return c +
|
|
1089
|
+
const d = Math.floor(u / 80), y = u % 80, N = [];
|
|
1090
|
+
for (let E = 0; E < f.length; E += 80)
|
|
1091
|
+
N.push(f.slice(E, E + 80));
|
|
1092
|
+
return c + rt([
|
|
1093
1093
|
[`${o} |`, N[0]],
|
|
1094
|
-
...N.slice(1,
|
|
1095
|
-
["|", "^".padStart(
|
|
1096
|
-
["|", N[
|
|
1094
|
+
...N.slice(1, d + 1).map((E) => ["|", E]),
|
|
1095
|
+
["|", "^".padStart(y)],
|
|
1096
|
+
["|", N[d + 1]]
|
|
1097
1097
|
]);
|
|
1098
1098
|
}
|
|
1099
|
-
return c +
|
|
1099
|
+
return c + rt([
|
|
1100
1100
|
// Lines specified like this: ["prefix", "string"],
|
|
1101
1101
|
[`${o - 1} |`, l[r - 1]],
|
|
1102
1102
|
[`${o} |`, f],
|
|
@@ -1104,12 +1104,12 @@ function yt(e, t) {
|
|
|
1104
1104
|
[`${o + 1} |`, l[r + 1]]
|
|
1105
1105
|
]);
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function rt(e) {
|
|
1108
1108
|
const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
1109
1109
|
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
1110
1110
|
`);
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1112
|
+
function Bn(e) {
|
|
1113
1113
|
const t = e[0];
|
|
1114
1114
|
return t == null || "kind" in t || "length" in t ? {
|
|
1115
1115
|
nodes: t,
|
|
@@ -1120,7 +1120,7 @@ function Ln(e) {
|
|
|
1120
1120
|
extensions: e[5]
|
|
1121
1121
|
} : t;
|
|
1122
1122
|
}
|
|
1123
|
-
class
|
|
1123
|
+
class We extends Error {
|
|
1124
1124
|
/**
|
|
1125
1125
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
1126
1126
|
* which correspond to this error.
|
|
@@ -1161,18 +1161,18 @@ class Xe extends Error {
|
|
|
1161
1161
|
*/
|
|
1162
1162
|
constructor(t, ...n) {
|
|
1163
1163
|
var i, r, s;
|
|
1164
|
-
const { nodes: o, source: a, positions: u, path: c, originalError: l, extensions: f } =
|
|
1165
|
-
super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = l ?? void 0, this.nodes =
|
|
1164
|
+
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(
|
|
1166
1166
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
1167
1167
|
);
|
|
1168
|
-
const
|
|
1168
|
+
const d = st(
|
|
1169
1169
|
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null)
|
|
1170
1170
|
);
|
|
1171
|
-
this.source = a ?? (
|
|
1172
|
-
const
|
|
1171
|
+
this.source = a ?? (d == null || (r = d[0]) === null || r === void 0 ? void 0 : r.source), this.positions = u ?? (d == null ? void 0 : d.map((N) => N.start)), this.locations = u && a ? u.map((N) => Je(a, N)) : d == null ? void 0 : d.map((N) => Je(N.source, N.start));
|
|
1172
|
+
const y = Ln(
|
|
1173
1173
|
l == null ? void 0 : l.extensions
|
|
1174
1174
|
) ? l == null ? void 0 : l.extensions : void 0;
|
|
1175
|
-
this.extensions = (s = f ??
|
|
1175
|
+
this.extensions = (s = f ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
1176
1176
|
message: {
|
|
1177
1177
|
writable: !0,
|
|
1178
1178
|
enumerable: !0
|
|
@@ -1196,7 +1196,7 @@ class Xe extends Error {
|
|
|
1196
1196
|
value: l.stack,
|
|
1197
1197
|
writable: !0,
|
|
1198
1198
|
configurable: !0
|
|
1199
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
1199
|
+
}) : Error.captureStackTrace ? Error.captureStackTrace(this, We) : Object.defineProperty(this, "stack", {
|
|
1200
1200
|
value: Error().stack,
|
|
1201
1201
|
writable: !0,
|
|
1202
1202
|
configurable: !0
|
|
@@ -1211,12 +1211,12 @@ class Xe extends Error {
|
|
|
1211
1211
|
for (const n of this.nodes)
|
|
1212
1212
|
n.loc && (t += `
|
|
1213
1213
|
|
|
1214
|
-
` +
|
|
1214
|
+
` + Mn(n.loc));
|
|
1215
1215
|
else if (this.source && this.locations)
|
|
1216
1216
|
for (const n of this.locations)
|
|
1217
1217
|
t += `
|
|
1218
1218
|
|
|
1219
|
-
` +
|
|
1219
|
+
` + At(this.source, n);
|
|
1220
1220
|
return t;
|
|
1221
1221
|
}
|
|
1222
1222
|
toJSON() {
|
|
@@ -1226,16 +1226,16 @@ class Xe extends Error {
|
|
|
1226
1226
|
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
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1229
|
+
function st(e) {
|
|
1230
1230
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return new
|
|
1232
|
+
function M(e, t, n) {
|
|
1233
|
+
return new We(`Syntax Error: ${n}`, {
|
|
1234
1234
|
source: e,
|
|
1235
1235
|
positions: [t]
|
|
1236
1236
|
});
|
|
1237
1237
|
}
|
|
1238
|
-
class
|
|
1238
|
+
class Un {
|
|
1239
1239
|
/**
|
|
1240
1240
|
* The character offset at which this Node begins.
|
|
1241
1241
|
*/
|
|
@@ -1264,7 +1264,7 @@ class Fn {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
|
-
class
|
|
1267
|
+
class It {
|
|
1268
1268
|
/**
|
|
1269
1269
|
* The kind of Token.
|
|
1270
1270
|
*/
|
|
@@ -1306,7 +1306,7 @@ class vt {
|
|
|
1306
1306
|
};
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1309
|
+
const Ot = {
|
|
1310
1310
|
Name: [],
|
|
1311
1311
|
Document: ["definitions"],
|
|
1312
1312
|
OperationDefinition: [
|
|
@@ -1380,45 +1380,45 @@ const wt = {
|
|
|
1380
1380
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
1381
1381
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
1382
1382
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
1383
|
-
},
|
|
1384
|
-
function
|
|
1383
|
+
}, qn = new Set(Object.keys(Ot));
|
|
1384
|
+
function ot(e) {
|
|
1385
1385
|
const t = e == null ? void 0 : e.kind;
|
|
1386
|
-
return typeof t == "string" &&
|
|
1386
|
+
return typeof t == "string" && qn.has(t);
|
|
1387
1387
|
}
|
|
1388
|
-
var
|
|
1388
|
+
var fe;
|
|
1389
1389
|
(function(e) {
|
|
1390
1390
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
1391
|
-
})(
|
|
1392
|
-
var
|
|
1391
|
+
})(fe || (fe = {}));
|
|
1392
|
+
var ze;
|
|
1393
1393
|
(function(e) {
|
|
1394
1394
|
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
|
-
})(
|
|
1396
|
-
var
|
|
1395
|
+
})(ze || (ze = {}));
|
|
1396
|
+
var A;
|
|
1397
1397
|
(function(e) {
|
|
1398
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
|
-
})(
|
|
1400
|
-
function
|
|
1399
|
+
})(A || (A = {}));
|
|
1400
|
+
function Xe(e) {
|
|
1401
1401
|
return e === 9 || e === 32;
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function Ne(e) {
|
|
1404
1404
|
return e >= 48 && e <= 57;
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function bt(e) {
|
|
1407
1407
|
return e >= 97 && e <= 122 || // A-Z
|
|
1408
1408
|
e >= 65 && e <= 90;
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return
|
|
1410
|
+
function _t(e) {
|
|
1411
|
+
return bt(e) || e === 95;
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return
|
|
1413
|
+
function Vn(e) {
|
|
1414
|
+
return bt(e) || Ne(e) || e === 95;
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function jn(e) {
|
|
1417
1417
|
var t;
|
|
1418
1418
|
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
1419
1419
|
for (let o = 0; o < e.length; ++o) {
|
|
1420
1420
|
var s;
|
|
1421
|
-
const a = e[o], u =
|
|
1421
|
+
const a = e[o], u = $n(a);
|
|
1422
1422
|
u !== a.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && u < n && (n = u));
|
|
1423
1423
|
}
|
|
1424
1424
|
return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
|
|
@@ -1426,28 +1426,28 @@ function Bn(e) {
|
|
|
1426
1426
|
r + 1
|
|
1427
1427
|
);
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function $n(e) {
|
|
1430
1430
|
let t = 0;
|
|
1431
|
-
for (; t < e.length &&
|
|
1431
|
+
for (; t < e.length && Xe(e.charCodeAt(t)); )
|
|
1432
1432
|
++t;
|
|
1433
1433
|
return t;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
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((
|
|
1435
|
+
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 = (
|
|
1437
1437
|
// add leading and trailing new lines only if it improves readability
|
|
1438
1438
|
!r || e.length > 70 || c || s || o
|
|
1439
1439
|
);
|
|
1440
1440
|
let f = "";
|
|
1441
|
-
const
|
|
1442
|
-
return (l && !
|
|
1441
|
+
const d = r && Xe(e.charCodeAt(0));
|
|
1442
|
+
return (l && !d || s) && (f += `
|
|
1443
1443
|
`), f += n, (l || c) && (f += `
|
|
1444
1444
|
`), '"""' + f + '"""';
|
|
1445
1445
|
}
|
|
1446
|
-
var
|
|
1446
|
+
var m;
|
|
1447
1447
|
(function(e) {
|
|
1448
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
|
-
})(
|
|
1450
|
-
class
|
|
1449
|
+
})(m || (m = {}));
|
|
1450
|
+
class Gn {
|
|
1451
1451
|
/**
|
|
1452
1452
|
* The previously focused non-ignored token.
|
|
1453
1453
|
*/
|
|
@@ -1461,7 +1461,7 @@ class Vn {
|
|
|
1461
1461
|
* The character offset at which the current line begins.
|
|
1462
1462
|
*/
|
|
1463
1463
|
constructor(t) {
|
|
1464
|
-
const n = new
|
|
1464
|
+
const n = new It(m.SOF, 0, 0, 0, 0);
|
|
1465
1465
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
1466
1466
|
}
|
|
1467
1467
|
get [Symbol.toStringTag]() {
|
|
@@ -1479,48 +1479,48 @@ class Vn {
|
|
|
1479
1479
|
*/
|
|
1480
1480
|
lookahead() {
|
|
1481
1481
|
let t = this.token;
|
|
1482
|
-
if (t.kind !==
|
|
1482
|
+
if (t.kind !== m.EOF)
|
|
1483
1483
|
do
|
|
1484
1484
|
if (t.next)
|
|
1485
1485
|
t = t.next;
|
|
1486
1486
|
else {
|
|
1487
|
-
const n =
|
|
1487
|
+
const n = Jn(this, t.end);
|
|
1488
1488
|
t.next = n, n.prev = t, t = n;
|
|
1489
1489
|
}
|
|
1490
|
-
while (t.kind ===
|
|
1490
|
+
while (t.kind === m.COMMENT);
|
|
1491
1491
|
return t;
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return e ===
|
|
1494
|
+
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;
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function pe(e) {
|
|
1498
1498
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1501
|
-
return
|
|
1500
|
+
function Fe(e, t) {
|
|
1501
|
+
return Dt(e.charCodeAt(t)) && St(e.charCodeAt(t + 1));
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1503
|
+
function Dt(e) {
|
|
1504
1504
|
return e >= 55296 && e <= 56319;
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1506
|
+
function St(e) {
|
|
1507
1507
|
return e >= 56320 && e <= 57343;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function oe(e, t) {
|
|
1510
1510
|
const n = e.source.body.codePointAt(t);
|
|
1511
1511
|
if (n === void 0)
|
|
1512
|
-
return
|
|
1512
|
+
return m.EOF;
|
|
1513
1513
|
if (n >= 32 && n <= 126) {
|
|
1514
1514
|
const i = String.fromCodePoint(n);
|
|
1515
1515
|
return i === '"' ? `'"'` : `"${i}"`;
|
|
1516
1516
|
}
|
|
1517
1517
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
1518
1518
|
}
|
|
1519
|
-
function
|
|
1519
|
+
function F(e, t, n, i, r) {
|
|
1520
1520
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
1521
|
-
return new
|
|
1521
|
+
return new It(t, n, i, s, o, r);
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function Jn(e, t) {
|
|
1524
1524
|
const n = e.source.body, i = n.length;
|
|
1525
1525
|
let r = t;
|
|
1526
1526
|
for (; r < i; ) {
|
|
@@ -1561,7 +1561,7 @@ function $n(e, t) {
|
|
|
1561
1561
|
continue;
|
|
1562
1562
|
// Comment
|
|
1563
1563
|
case 35:
|
|
1564
|
-
return
|
|
1564
|
+
return zn(e, r);
|
|
1565
1565
|
// Token ::
|
|
1566
1566
|
// - Punctuator
|
|
1567
1567
|
// - Name
|
|
@@ -1571,169 +1571,169 @@ function $n(e, t) {
|
|
|
1571
1571
|
//
|
|
1572
1572
|
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
1573
1573
|
case 33:
|
|
1574
|
-
return
|
|
1574
|
+
return F(e, m.BANG, r, r + 1);
|
|
1575
1575
|
case 36:
|
|
1576
|
-
return
|
|
1576
|
+
return F(e, m.DOLLAR, r, r + 1);
|
|
1577
1577
|
case 38:
|
|
1578
|
-
return
|
|
1578
|
+
return F(e, m.AMP, r, r + 1);
|
|
1579
1579
|
case 40:
|
|
1580
|
-
return
|
|
1580
|
+
return F(e, m.PAREN_L, r, r + 1);
|
|
1581
1581
|
case 41:
|
|
1582
|
-
return
|
|
1582
|
+
return F(e, m.PAREN_R, r, r + 1);
|
|
1583
1583
|
case 46:
|
|
1584
1584
|
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
1585
|
-
return
|
|
1585
|
+
return F(e, m.SPREAD, r, r + 3);
|
|
1586
1586
|
break;
|
|
1587
1587
|
case 58:
|
|
1588
|
-
return
|
|
1588
|
+
return F(e, m.COLON, r, r + 1);
|
|
1589
1589
|
case 61:
|
|
1590
|
-
return
|
|
1590
|
+
return F(e, m.EQUALS, r, r + 1);
|
|
1591
1591
|
case 64:
|
|
1592
|
-
return
|
|
1592
|
+
return F(e, m.AT, r, r + 1);
|
|
1593
1593
|
case 91:
|
|
1594
|
-
return
|
|
1594
|
+
return F(e, m.BRACKET_L, r, r + 1);
|
|
1595
1595
|
case 93:
|
|
1596
|
-
return
|
|
1596
|
+
return F(e, m.BRACKET_R, r, r + 1);
|
|
1597
1597
|
case 123:
|
|
1598
|
-
return
|
|
1598
|
+
return F(e, m.BRACE_L, r, r + 1);
|
|
1599
1599
|
case 124:
|
|
1600
|
-
return
|
|
1600
|
+
return F(e, m.PIPE, r, r + 1);
|
|
1601
1601
|
case 125:
|
|
1602
|
-
return
|
|
1602
|
+
return F(e, m.BRACE_R, r, r + 1);
|
|
1603
1603
|
// StringValue
|
|
1604
1604
|
case 34:
|
|
1605
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ?
|
|
1605
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ei(e, r) : Qn(e, r);
|
|
1606
1606
|
}
|
|
1607
|
-
if (
|
|
1608
|
-
return
|
|
1609
|
-
if (
|
|
1610
|
-
return
|
|
1611
|
-
throw
|
|
1607
|
+
if (Ne(s) || s === 45)
|
|
1608
|
+
return Xn(e, r, s);
|
|
1609
|
+
if (_t(s))
|
|
1610
|
+
return ti(e, r);
|
|
1611
|
+
throw M(
|
|
1612
1612
|
e.source,
|
|
1613
1613
|
r,
|
|
1614
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` :
|
|
1614
|
+
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
1615
|
);
|
|
1616
1616
|
}
|
|
1617
|
-
return
|
|
1617
|
+
return F(e, m.EOF, i, i);
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function zn(e, t) {
|
|
1620
1620
|
const n = e.source.body, i = n.length;
|
|
1621
1621
|
let r = t + 1;
|
|
1622
1622
|
for (; r < i; ) {
|
|
1623
1623
|
const s = n.charCodeAt(r);
|
|
1624
1624
|
if (s === 10 || s === 13)
|
|
1625
1625
|
break;
|
|
1626
|
-
if (
|
|
1626
|
+
if (pe(s))
|
|
1627
1627
|
++r;
|
|
1628
|
-
else if (
|
|
1628
|
+
else if (Fe(n, r))
|
|
1629
1629
|
r += 2;
|
|
1630
1630
|
else
|
|
1631
1631
|
break;
|
|
1632
1632
|
}
|
|
1633
|
-
return
|
|
1633
|
+
return F(
|
|
1634
1634
|
e,
|
|
1635
|
-
|
|
1635
|
+
m.COMMENT,
|
|
1636
1636
|
t,
|
|
1637
1637
|
r,
|
|
1638
1638
|
n.slice(t + 1, r)
|
|
1639
1639
|
);
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Xn(e, t, n) {
|
|
1642
1642
|
const i = e.source.body;
|
|
1643
1643
|
let r = t, s = n, o = !1;
|
|
1644
1644
|
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
1645
|
-
if (s = i.charCodeAt(++r),
|
|
1646
|
-
throw
|
|
1645
|
+
if (s = i.charCodeAt(++r), Ne(s))
|
|
1646
|
+
throw M(
|
|
1647
1647
|
e.source,
|
|
1648
1648
|
r,
|
|
1649
|
-
`Invalid number, unexpected digit after 0: ${
|
|
1649
|
+
`Invalid number, unexpected digit after 0: ${oe(
|
|
1650
1650
|
e,
|
|
1651
1651
|
r
|
|
1652
1652
|
)}.`
|
|
1653
1653
|
);
|
|
1654
1654
|
} else
|
|
1655
|
-
r =
|
|
1656
|
-
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r =
|
|
1657
|
-
throw
|
|
1655
|
+
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))
|
|
1657
|
+
throw M(
|
|
1658
1658
|
e.source,
|
|
1659
1659
|
r,
|
|
1660
|
-
`Invalid number, expected digit but got: ${
|
|
1660
|
+
`Invalid number, expected digit but got: ${oe(
|
|
1661
1661
|
e,
|
|
1662
1662
|
r
|
|
1663
1663
|
)}.`
|
|
1664
1664
|
);
|
|
1665
|
-
return
|
|
1665
|
+
return F(
|
|
1666
1666
|
e,
|
|
1667
|
-
o ?
|
|
1667
|
+
o ? m.FLOAT : m.INT,
|
|
1668
1668
|
t,
|
|
1669
1669
|
r,
|
|
1670
1670
|
i.slice(t, r)
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1674
|
-
if (!
|
|
1675
|
-
throw
|
|
1673
|
+
function Be(e, t, n) {
|
|
1674
|
+
if (!Ne(n))
|
|
1675
|
+
throw M(
|
|
1676
1676
|
e.source,
|
|
1677
1677
|
t,
|
|
1678
|
-
`Invalid number, expected digit but got: ${
|
|
1678
|
+
`Invalid number, expected digit but got: ${oe(
|
|
1679
1679
|
e,
|
|
1680
1680
|
t
|
|
1681
1681
|
)}.`
|
|
1682
1682
|
);
|
|
1683
1683
|
const i = e.source.body;
|
|
1684
1684
|
let r = t + 1;
|
|
1685
|
-
for (;
|
|
1685
|
+
for (; Ne(i.charCodeAt(r)); )
|
|
1686
1686
|
++r;
|
|
1687
1687
|
return r;
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function Qn(e, t) {
|
|
1690
1690
|
const n = e.source.body, i = n.length;
|
|
1691
1691
|
let r = t + 1, s = r, o = "";
|
|
1692
1692
|
for (; r < i; ) {
|
|
1693
1693
|
const a = n.charCodeAt(r);
|
|
1694
1694
|
if (a === 34)
|
|
1695
|
-
return o += n.slice(s, r),
|
|
1695
|
+
return o += n.slice(s, r), F(e, m.STRING, t, r + 1, o);
|
|
1696
1696
|
if (a === 92) {
|
|
1697
1697
|
o += n.slice(s, r);
|
|
1698
|
-
const u = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ?
|
|
1698
|
+
const u = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Zn(e, r) : Wn(e, r) : Kn(e, r);
|
|
1699
1699
|
o += u.value, r += u.size, s = r;
|
|
1700
1700
|
continue;
|
|
1701
1701
|
}
|
|
1702
1702
|
if (a === 10 || a === 13)
|
|
1703
1703
|
break;
|
|
1704
|
-
if (
|
|
1704
|
+
if (pe(a))
|
|
1705
1705
|
++r;
|
|
1706
|
-
else if (
|
|
1706
|
+
else if (Fe(n, r))
|
|
1707
1707
|
r += 2;
|
|
1708
1708
|
else
|
|
1709
|
-
throw
|
|
1709
|
+
throw M(
|
|
1710
1710
|
e.source,
|
|
1711
1711
|
r,
|
|
1712
|
-
`Invalid character within String: ${
|
|
1712
|
+
`Invalid character within String: ${oe(
|
|
1713
1713
|
e,
|
|
1714
1714
|
r
|
|
1715
1715
|
)}.`
|
|
1716
1716
|
);
|
|
1717
1717
|
}
|
|
1718
|
-
throw
|
|
1718
|
+
throw M(e.source, r, "Unterminated string.");
|
|
1719
1719
|
}
|
|
1720
|
-
function
|
|
1720
|
+
function Zn(e, t) {
|
|
1721
1721
|
const n = e.source.body;
|
|
1722
1722
|
let i = 0, r = 3;
|
|
1723
1723
|
for (; r < 12; ) {
|
|
1724
1724
|
const s = n.charCodeAt(t + r++);
|
|
1725
1725
|
if (s === 125) {
|
|
1726
|
-
if (r < 5 || !
|
|
1726
|
+
if (r < 5 || !pe(i))
|
|
1727
1727
|
break;
|
|
1728
1728
|
return {
|
|
1729
1729
|
value: String.fromCodePoint(i),
|
|
1730
1730
|
size: r
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
|
-
if (i = i << 4 |
|
|
1733
|
+
if (i = i << 4 | ge(s), i < 0)
|
|
1734
1734
|
break;
|
|
1735
1735
|
}
|
|
1736
|
-
throw
|
|
1736
|
+
throw M(
|
|
1737
1737
|
e.source,
|
|
1738
1738
|
t,
|
|
1739
1739
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -1742,34 +1742,34 @@ function Jn(e, t) {
|
|
|
1742
1742
|
)}".`
|
|
1743
1743
|
);
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1746
|
-
const n = e.source.body, i =
|
|
1747
|
-
if (
|
|
1745
|
+
function Wn(e, t) {
|
|
1746
|
+
const n = e.source.body, i = at(n, t + 2);
|
|
1747
|
+
if (pe(i))
|
|
1748
1748
|
return {
|
|
1749
1749
|
value: String.fromCodePoint(i),
|
|
1750
1750
|
size: 6
|
|
1751
1751
|
};
|
|
1752
|
-
if (
|
|
1753
|
-
const r =
|
|
1754
|
-
if (
|
|
1752
|
+
if (Dt(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
1753
|
+
const r = at(n, t + 8);
|
|
1754
|
+
if (St(r))
|
|
1755
1755
|
return {
|
|
1756
1756
|
value: String.fromCodePoint(i, r),
|
|
1757
1757
|
size: 12
|
|
1758
1758
|
};
|
|
1759
1759
|
}
|
|
1760
|
-
throw
|
|
1760
|
+
throw M(
|
|
1761
1761
|
e.source,
|
|
1762
1762
|
t,
|
|
1763
1763
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
1764
1764
|
);
|
|
1765
1765
|
}
|
|
1766
|
-
function
|
|
1767
|
-
return
|
|
1766
|
+
function at(e, t) {
|
|
1767
|
+
return ge(e.charCodeAt(t)) << 12 | ge(e.charCodeAt(t + 1)) << 8 | ge(e.charCodeAt(t + 2)) << 4 | ge(e.charCodeAt(t + 3));
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function ge(e) {
|
|
1770
1770
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function Kn(e, t) {
|
|
1773
1773
|
const n = e.source.body;
|
|
1774
1774
|
switch (n.charCodeAt(t + 1)) {
|
|
1775
1775
|
case 34:
|
|
@@ -1814,7 +1814,7 @@ function Xn(e, t) {
|
|
|
1814
1814
|
size: 2
|
|
1815
1815
|
};
|
|
1816
1816
|
}
|
|
1817
|
-
throw
|
|
1817
|
+
throw M(
|
|
1818
1818
|
e.source,
|
|
1819
1819
|
t,
|
|
1820
1820
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -1823,7 +1823,7 @@ function Xn(e, t) {
|
|
|
1823
1823
|
)}".`
|
|
1824
1824
|
);
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function ei(e, t) {
|
|
1827
1827
|
const n = e.source.body, i = n.length;
|
|
1828
1828
|
let r = e.lineStart, s = t + 3, o = s, a = "";
|
|
1829
1829
|
const u = [];
|
|
@@ -1831,13 +1831,13 @@ function Qn(e, t) {
|
|
|
1831
1831
|
const c = n.charCodeAt(s);
|
|
1832
1832
|
if (c === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
1833
1833
|
a += n.slice(o, s), u.push(a);
|
|
1834
|
-
const l =
|
|
1834
|
+
const l = F(
|
|
1835
1835
|
e,
|
|
1836
|
-
|
|
1836
|
+
m.BLOCK_STRING,
|
|
1837
1837
|
t,
|
|
1838
1838
|
s + 3,
|
|
1839
1839
|
// Return a string of the lines joined with U+000A.
|
|
1840
|
-
|
|
1840
|
+
jn(u).join(`
|
|
1841
1841
|
`)
|
|
1842
1842
|
);
|
|
1843
1843
|
return e.line += u.length - 1, e.lineStart = r, l;
|
|
@@ -1850,90 +1850,90 @@ function Qn(e, t) {
|
|
|
1850
1850
|
a += n.slice(o, s), u.push(a), c === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, a = "", o = s, r = s;
|
|
1851
1851
|
continue;
|
|
1852
1852
|
}
|
|
1853
|
-
if (
|
|
1853
|
+
if (pe(c))
|
|
1854
1854
|
++s;
|
|
1855
|
-
else if (
|
|
1855
|
+
else if (Fe(n, s))
|
|
1856
1856
|
s += 2;
|
|
1857
1857
|
else
|
|
1858
|
-
throw
|
|
1858
|
+
throw M(
|
|
1859
1859
|
e.source,
|
|
1860
1860
|
s,
|
|
1861
|
-
`Invalid character within String: ${
|
|
1861
|
+
`Invalid character within String: ${oe(
|
|
1862
1862
|
e,
|
|
1863
1863
|
s
|
|
1864
1864
|
)}.`
|
|
1865
1865
|
);
|
|
1866
1866
|
}
|
|
1867
|
-
throw
|
|
1867
|
+
throw M(e.source, s, "Unterminated string.");
|
|
1868
1868
|
}
|
|
1869
|
-
function
|
|
1869
|
+
function ti(e, t) {
|
|
1870
1870
|
const n = e.source.body, i = n.length;
|
|
1871
1871
|
let r = t + 1;
|
|
1872
1872
|
for (; r < i; ) {
|
|
1873
1873
|
const s = n.charCodeAt(r);
|
|
1874
|
-
if (
|
|
1874
|
+
if (Vn(s))
|
|
1875
1875
|
++r;
|
|
1876
1876
|
else
|
|
1877
1877
|
break;
|
|
1878
1878
|
}
|
|
1879
|
-
return
|
|
1879
|
+
return F(
|
|
1880
1880
|
e,
|
|
1881
|
-
|
|
1881
|
+
m.NAME,
|
|
1882
1882
|
t,
|
|
1883
1883
|
r,
|
|
1884
1884
|
n.slice(t, r)
|
|
1885
1885
|
);
|
|
1886
1886
|
}
|
|
1887
|
-
const
|
|
1888
|
-
function
|
|
1889
|
-
return
|
|
1887
|
+
const ni = 10, xt = 2;
|
|
1888
|
+
function Ke(e) {
|
|
1889
|
+
return Pe(e, []);
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function Pe(e, t) {
|
|
1892
1892
|
switch (typeof e) {
|
|
1893
1893
|
case "string":
|
|
1894
1894
|
return JSON.stringify(e);
|
|
1895
1895
|
case "function":
|
|
1896
1896
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
1897
1897
|
case "object":
|
|
1898
|
-
return
|
|
1898
|
+
return ii(e, t);
|
|
1899
1899
|
default:
|
|
1900
1900
|
return String(e);
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1903
|
+
function ii(e, t) {
|
|
1904
1904
|
if (e === null)
|
|
1905
1905
|
return "null";
|
|
1906
1906
|
if (t.includes(e))
|
|
1907
1907
|
return "[Circular]";
|
|
1908
1908
|
const n = [...t, e];
|
|
1909
|
-
if (
|
|
1909
|
+
if (ri(e)) {
|
|
1910
1910
|
const i = e.toJSON();
|
|
1911
1911
|
if (i !== e)
|
|
1912
|
-
return typeof i == "string" ? i :
|
|
1912
|
+
return typeof i == "string" ? i : Pe(i, n);
|
|
1913
1913
|
} else if (Array.isArray(e))
|
|
1914
|
-
return
|
|
1915
|
-
return
|
|
1914
|
+
return oi(e, n);
|
|
1915
|
+
return si(e, n);
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1917
|
+
function ri(e) {
|
|
1918
1918
|
return typeof e.toJSON == "function";
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function si(e, t) {
|
|
1921
1921
|
const n = Object.entries(e);
|
|
1922
|
-
return n.length === 0 ? "{}" : t.length >
|
|
1923
|
-
([r, s]) => r + ": " +
|
|
1922
|
+
return n.length === 0 ? "{}" : t.length > xt ? "[" + ai(e) + "]" : "{ " + n.map(
|
|
1923
|
+
([r, s]) => r + ": " + Pe(s, t)
|
|
1924
1924
|
).join(", ") + " }";
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function oi(e, t) {
|
|
1927
1927
|
if (e.length === 0)
|
|
1928
1928
|
return "[]";
|
|
1929
|
-
if (t.length >
|
|
1929
|
+
if (t.length > xt)
|
|
1930
1930
|
return "[Array]";
|
|
1931
|
-
const n = Math.min(
|
|
1931
|
+
const n = Math.min(ni, e.length), i = e.length - n, r = [];
|
|
1932
1932
|
for (let s = 0; s < n; ++s)
|
|
1933
|
-
r.push(
|
|
1933
|
+
r.push(Pe(e[s], t));
|
|
1934
1934
|
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function ai(e) {
|
|
1937
1937
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
1938
1938
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
1939
1939
|
const n = e.constructor.name;
|
|
@@ -1942,7 +1942,7 @@ function ii(e) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
return t;
|
|
1944
1944
|
}
|
|
1945
|
-
const
|
|
1945
|
+
const ci = (
|
|
1946
1946
|
/* c8 ignore next 6 */
|
|
1947
1947
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
1948
1948
|
// eslint-disable-next-line no-undef
|
|
@@ -1958,7 +1958,7 @@ const ri = (
|
|
|
1958
1958
|
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
1959
1959
|
);
|
|
1960
1960
|
if (r === s) {
|
|
1961
|
-
const o =
|
|
1961
|
+
const o = Ke(t);
|
|
1962
1962
|
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
1963
1963
|
|
|
1964
1964
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -1976,15 +1976,15 @@ spurious results.`);
|
|
|
1976
1976
|
return !1;
|
|
1977
1977
|
}
|
|
1978
1978
|
);
|
|
1979
|
-
class
|
|
1979
|
+
class Ct {
|
|
1980
1980
|
constructor(t, n = "GraphQL request", i = {
|
|
1981
1981
|
line: 1,
|
|
1982
1982
|
column: 1
|
|
1983
1983
|
}) {
|
|
1984
|
-
typeof t == "string" ||
|
|
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(
|
|
1985
1985
|
!1,
|
|
1986
1986
|
"line in locationOffset is 1-indexed and must be positive."
|
|
1987
|
-
), this.locationOffset.column > 0 ||
|
|
1987
|
+
), this.locationOffset.column > 0 || Oe(
|
|
1988
1988
|
!1,
|
|
1989
1989
|
"column in locationOffset is 1-indexed and must be positive."
|
|
1990
1990
|
);
|
|
@@ -1993,24 +1993,24 @@ class Dt {
|
|
|
1993
1993
|
return "Source";
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
return
|
|
1996
|
+
function ui(e) {
|
|
1997
|
+
return ci(e, Ct);
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return new
|
|
1999
|
+
function li(e, t) {
|
|
2000
|
+
return new fi(e, t).parseDocument();
|
|
2001
2001
|
}
|
|
2002
|
-
class
|
|
2002
|
+
class fi {
|
|
2003
2003
|
constructor(t, n = {}) {
|
|
2004
|
-
const i =
|
|
2005
|
-
this._lexer = new
|
|
2004
|
+
const i = ui(t) ? t : new Ct(t);
|
|
2005
|
+
this._lexer = new Gn(i), this._options = n, this._tokenCounter = 0;
|
|
2006
2006
|
}
|
|
2007
2007
|
/**
|
|
2008
2008
|
* Converts a name lex token into a name parse node.
|
|
2009
2009
|
*/
|
|
2010
2010
|
parseName() {
|
|
2011
|
-
const t = this.expectToken(
|
|
2011
|
+
const t = this.expectToken(m.NAME);
|
|
2012
2012
|
return this.node(t, {
|
|
2013
|
-
kind:
|
|
2013
|
+
kind: A.NAME,
|
|
2014
2014
|
value: t.value
|
|
2015
2015
|
});
|
|
2016
2016
|
}
|
|
@@ -2020,11 +2020,11 @@ class ai {
|
|
|
2020
2020
|
*/
|
|
2021
2021
|
parseDocument() {
|
|
2022
2022
|
return this.node(this._lexer.token, {
|
|
2023
|
-
kind:
|
|
2023
|
+
kind: A.DOCUMENT,
|
|
2024
2024
|
definitions: this.many(
|
|
2025
|
-
|
|
2025
|
+
m.SOF,
|
|
2026
2026
|
this.parseDefinition,
|
|
2027
|
-
|
|
2027
|
+
m.EOF
|
|
2028
2028
|
)
|
|
2029
2029
|
});
|
|
2030
2030
|
}
|
|
@@ -2052,10 +2052,10 @@ class ai {
|
|
|
2052
2052
|
* - InputObjectTypeDefinition
|
|
2053
2053
|
*/
|
|
2054
2054
|
parseDefinition() {
|
|
2055
|
-
if (this.peek(
|
|
2055
|
+
if (this.peek(m.BRACE_L))
|
|
2056
2056
|
return this.parseOperationDefinition();
|
|
2057
2057
|
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
2058
|
-
if (n.kind ===
|
|
2058
|
+
if (n.kind === m.NAME) {
|
|
2059
2059
|
switch (n.value) {
|
|
2060
2060
|
case "schema":
|
|
2061
2061
|
return this.parseSchemaDefinition();
|
|
@@ -2075,7 +2075,7 @@ class ai {
|
|
|
2075
2075
|
return this.parseDirectiveDefinition();
|
|
2076
2076
|
}
|
|
2077
2077
|
if (t)
|
|
2078
|
-
throw
|
|
2078
|
+
throw M(
|
|
2079
2079
|
this._lexer.source,
|
|
2080
2080
|
this._lexer.token.start,
|
|
2081
2081
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -2101,10 +2101,10 @@ class ai {
|
|
|
2101
2101
|
*/
|
|
2102
2102
|
parseOperationDefinition() {
|
|
2103
2103
|
const t = this._lexer.token;
|
|
2104
|
-
if (this.peek(
|
|
2104
|
+
if (this.peek(m.BRACE_L))
|
|
2105
2105
|
return this.node(t, {
|
|
2106
|
-
kind:
|
|
2107
|
-
operation:
|
|
2106
|
+
kind: A.OPERATION_DEFINITION,
|
|
2107
|
+
operation: fe.QUERY,
|
|
2108
2108
|
name: void 0,
|
|
2109
2109
|
variableDefinitions: [],
|
|
2110
2110
|
directives: [],
|
|
@@ -2112,8 +2112,8 @@ class ai {
|
|
|
2112
2112
|
});
|
|
2113
2113
|
const n = this.parseOperationType();
|
|
2114
2114
|
let i;
|
|
2115
|
-
return this.peek(
|
|
2116
|
-
kind:
|
|
2115
|
+
return this.peek(m.NAME) && (i = this.parseName()), this.node(t, {
|
|
2116
|
+
kind: A.OPERATION_DEFINITION,
|
|
2117
2117
|
operation: n,
|
|
2118
2118
|
name: i,
|
|
2119
2119
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
@@ -2125,14 +2125,14 @@ class ai {
|
|
|
2125
2125
|
* OperationType : one of query mutation subscription
|
|
2126
2126
|
*/
|
|
2127
2127
|
parseOperationType() {
|
|
2128
|
-
const t = this.expectToken(
|
|
2128
|
+
const t = this.expectToken(m.NAME);
|
|
2129
2129
|
switch (t.value) {
|
|
2130
2130
|
case "query":
|
|
2131
|
-
return
|
|
2131
|
+
return fe.QUERY;
|
|
2132
2132
|
case "mutation":
|
|
2133
|
-
return
|
|
2133
|
+
return fe.MUTATION;
|
|
2134
2134
|
case "subscription":
|
|
2135
|
-
return
|
|
2135
|
+
return fe.SUBSCRIPTION;
|
|
2136
2136
|
}
|
|
2137
2137
|
throw this.unexpected(t);
|
|
2138
2138
|
}
|
|
@@ -2141,9 +2141,9 @@ class ai {
|
|
|
2141
2141
|
*/
|
|
2142
2142
|
parseVariableDefinitions() {
|
|
2143
2143
|
return this.optionalMany(
|
|
2144
|
-
|
|
2144
|
+
m.PAREN_L,
|
|
2145
2145
|
this.parseVariableDefinition,
|
|
2146
|
-
|
|
2146
|
+
m.PAREN_R
|
|
2147
2147
|
);
|
|
2148
2148
|
}
|
|
2149
2149
|
/**
|
|
@@ -2151,10 +2151,10 @@ class ai {
|
|
|
2151
2151
|
*/
|
|
2152
2152
|
parseVariableDefinition() {
|
|
2153
2153
|
return this.node(this._lexer.token, {
|
|
2154
|
-
kind:
|
|
2154
|
+
kind: A.VARIABLE_DEFINITION,
|
|
2155
2155
|
variable: this.parseVariable(),
|
|
2156
|
-
type: (this.expectToken(
|
|
2157
|
-
defaultValue: this.expectOptionalToken(
|
|
2156
|
+
type: (this.expectToken(m.COLON), this.parseTypeReference()),
|
|
2157
|
+
defaultValue: this.expectOptionalToken(m.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
2158
2158
|
directives: this.parseConstDirectives()
|
|
2159
2159
|
});
|
|
2160
2160
|
}
|
|
@@ -2163,8 +2163,8 @@ class ai {
|
|
|
2163
2163
|
*/
|
|
2164
2164
|
parseVariable() {
|
|
2165
2165
|
const t = this._lexer.token;
|
|
2166
|
-
return this.expectToken(
|
|
2167
|
-
kind:
|
|
2166
|
+
return this.expectToken(m.DOLLAR), this.node(t, {
|
|
2167
|
+
kind: A.VARIABLE,
|
|
2168
2168
|
name: this.parseName()
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
@@ -2175,11 +2175,11 @@ class ai {
|
|
|
2175
2175
|
*/
|
|
2176
2176
|
parseSelectionSet() {
|
|
2177
2177
|
return this.node(this._lexer.token, {
|
|
2178
|
-
kind:
|
|
2178
|
+
kind: A.SELECTION_SET,
|
|
2179
2179
|
selections: this.many(
|
|
2180
|
-
|
|
2180
|
+
m.BRACE_L,
|
|
2181
2181
|
this.parseSelection,
|
|
2182
|
-
|
|
2182
|
+
m.BRACE_R
|
|
2183
2183
|
)
|
|
2184
2184
|
});
|
|
2185
2185
|
}
|
|
@@ -2190,7 +2190,7 @@ class ai {
|
|
|
2190
2190
|
* - InlineFragment
|
|
2191
2191
|
*/
|
|
2192
2192
|
parseSelection() {
|
|
2193
|
-
return this.peek(
|
|
2193
|
+
return this.peek(m.SPREAD) ? this.parseFragment() : this.parseField();
|
|
2194
2194
|
}
|
|
2195
2195
|
/**
|
|
2196
2196
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
@@ -2200,13 +2200,13 @@ class ai {
|
|
|
2200
2200
|
parseField() {
|
|
2201
2201
|
const t = this._lexer.token, n = this.parseName();
|
|
2202
2202
|
let i, r;
|
|
2203
|
-
return this.expectOptionalToken(
|
|
2204
|
-
kind:
|
|
2203
|
+
return this.expectOptionalToken(m.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
2204
|
+
kind: A.FIELD,
|
|
2205
2205
|
alias: i,
|
|
2206
2206
|
name: r,
|
|
2207
2207
|
arguments: this.parseArguments(!1),
|
|
2208
2208
|
directives: this.parseDirectives(!1),
|
|
2209
|
-
selectionSet: this.peek(
|
|
2209
|
+
selectionSet: this.peek(m.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
2210
2210
|
});
|
|
2211
2211
|
}
|
|
2212
2212
|
/**
|
|
@@ -2214,15 +2214,15 @@ class ai {
|
|
|
2214
2214
|
*/
|
|
2215
2215
|
parseArguments(t) {
|
|
2216
2216
|
const n = t ? this.parseConstArgument : this.parseArgument;
|
|
2217
|
-
return this.optionalMany(
|
|
2217
|
+
return this.optionalMany(m.PAREN_L, n, m.PAREN_R);
|
|
2218
2218
|
}
|
|
2219
2219
|
/**
|
|
2220
2220
|
* Argument[Const] : Name : Value[?Const]
|
|
2221
2221
|
*/
|
|
2222
2222
|
parseArgument(t = !1) {
|
|
2223
2223
|
const n = this._lexer.token, i = this.parseName();
|
|
2224
|
-
return this.expectToken(
|
|
2225
|
-
kind:
|
|
2224
|
+
return this.expectToken(m.COLON), this.node(n, {
|
|
2225
|
+
kind: A.ARGUMENT,
|
|
2226
2226
|
name: i,
|
|
2227
2227
|
value: this.parseValueLiteral(t)
|
|
2228
2228
|
});
|
|
@@ -2240,14 +2240,14 @@ class ai {
|
|
|
2240
2240
|
*/
|
|
2241
2241
|
parseFragment() {
|
|
2242
2242
|
const t = this._lexer.token;
|
|
2243
|
-
this.expectToken(
|
|
2243
|
+
this.expectToken(m.SPREAD);
|
|
2244
2244
|
const n = this.expectOptionalKeyword("on");
|
|
2245
|
-
return !n && this.peek(
|
|
2246
|
-
kind:
|
|
2245
|
+
return !n && this.peek(m.NAME) ? this.node(t, {
|
|
2246
|
+
kind: A.FRAGMENT_SPREAD,
|
|
2247
2247
|
name: this.parseFragmentName(),
|
|
2248
2248
|
directives: this.parseDirectives(!1)
|
|
2249
2249
|
}) : this.node(t, {
|
|
2250
|
-
kind:
|
|
2250
|
+
kind: A.INLINE_FRAGMENT,
|
|
2251
2251
|
typeCondition: n ? this.parseNamedType() : void 0,
|
|
2252
2252
|
directives: this.parseDirectives(!1),
|
|
2253
2253
|
selectionSet: this.parseSelectionSet()
|
|
@@ -2262,14 +2262,14 @@ class ai {
|
|
|
2262
2262
|
parseFragmentDefinition() {
|
|
2263
2263
|
const t = this._lexer.token;
|
|
2264
2264
|
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
|
|
2265
|
-
kind:
|
|
2265
|
+
kind: A.FRAGMENT_DEFINITION,
|
|
2266
2266
|
name: this.parseFragmentName(),
|
|
2267
2267
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
2268
2268
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
2269
2269
|
directives: this.parseDirectives(!1),
|
|
2270
2270
|
selectionSet: this.parseSelectionSet()
|
|
2271
2271
|
}) : this.node(t, {
|
|
2272
|
-
kind:
|
|
2272
|
+
kind: A.FRAGMENT_DEFINITION,
|
|
2273
2273
|
name: this.parseFragmentName(),
|
|
2274
2274
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
2275
2275
|
directives: this.parseDirectives(!1),
|
|
@@ -2306,50 +2306,50 @@ class ai {
|
|
|
2306
2306
|
parseValueLiteral(t) {
|
|
2307
2307
|
const n = this._lexer.token;
|
|
2308
2308
|
switch (n.kind) {
|
|
2309
|
-
case
|
|
2309
|
+
case m.BRACKET_L:
|
|
2310
2310
|
return this.parseList(t);
|
|
2311
|
-
case
|
|
2311
|
+
case m.BRACE_L:
|
|
2312
2312
|
return this.parseObject(t);
|
|
2313
|
-
case
|
|
2313
|
+
case m.INT:
|
|
2314
2314
|
return this.advanceLexer(), this.node(n, {
|
|
2315
|
-
kind:
|
|
2315
|
+
kind: A.INT,
|
|
2316
2316
|
value: n.value
|
|
2317
2317
|
});
|
|
2318
|
-
case
|
|
2318
|
+
case m.FLOAT:
|
|
2319
2319
|
return this.advanceLexer(), this.node(n, {
|
|
2320
|
-
kind:
|
|
2320
|
+
kind: A.FLOAT,
|
|
2321
2321
|
value: n.value
|
|
2322
2322
|
});
|
|
2323
|
-
case
|
|
2324
|
-
case
|
|
2323
|
+
case m.STRING:
|
|
2324
|
+
case m.BLOCK_STRING:
|
|
2325
2325
|
return this.parseStringLiteral();
|
|
2326
|
-
case
|
|
2326
|
+
case m.NAME:
|
|
2327
2327
|
switch (this.advanceLexer(), n.value) {
|
|
2328
2328
|
case "true":
|
|
2329
2329
|
return this.node(n, {
|
|
2330
|
-
kind:
|
|
2330
|
+
kind: A.BOOLEAN,
|
|
2331
2331
|
value: !0
|
|
2332
2332
|
});
|
|
2333
2333
|
case "false":
|
|
2334
2334
|
return this.node(n, {
|
|
2335
|
-
kind:
|
|
2335
|
+
kind: A.BOOLEAN,
|
|
2336
2336
|
value: !1
|
|
2337
2337
|
});
|
|
2338
2338
|
case "null":
|
|
2339
2339
|
return this.node(n, {
|
|
2340
|
-
kind:
|
|
2340
|
+
kind: A.NULL
|
|
2341
2341
|
});
|
|
2342
2342
|
default:
|
|
2343
2343
|
return this.node(n, {
|
|
2344
|
-
kind:
|
|
2344
|
+
kind: A.ENUM,
|
|
2345
2345
|
value: n.value
|
|
2346
2346
|
});
|
|
2347
2347
|
}
|
|
2348
|
-
case
|
|
2348
|
+
case m.DOLLAR:
|
|
2349
2349
|
if (t)
|
|
2350
|
-
if (this.expectToken(
|
|
2350
|
+
if (this.expectToken(m.DOLLAR), this._lexer.token.kind === m.NAME) {
|
|
2351
2351
|
const i = this._lexer.token.value;
|
|
2352
|
-
throw
|
|
2352
|
+
throw M(
|
|
2353
2353
|
this._lexer.source,
|
|
2354
2354
|
n.start,
|
|
2355
2355
|
`Unexpected variable "$${i}" in constant value.`
|
|
@@ -2367,9 +2367,9 @@ class ai {
|
|
|
2367
2367
|
parseStringLiteral() {
|
|
2368
2368
|
const t = this._lexer.token;
|
|
2369
2369
|
return this.advanceLexer(), this.node(t, {
|
|
2370
|
-
kind:
|
|
2370
|
+
kind: A.STRING,
|
|
2371
2371
|
value: t.value,
|
|
2372
|
-
block: t.kind ===
|
|
2372
|
+
block: t.kind === m.BLOCK_STRING
|
|
2373
2373
|
});
|
|
2374
2374
|
}
|
|
2375
2375
|
/**
|
|
@@ -2380,8 +2380,8 @@ class ai {
|
|
|
2380
2380
|
parseList(t) {
|
|
2381
2381
|
const n = () => this.parseValueLiteral(t);
|
|
2382
2382
|
return this.node(this._lexer.token, {
|
|
2383
|
-
kind:
|
|
2384
|
-
values: this.any(
|
|
2383
|
+
kind: A.LIST,
|
|
2384
|
+
values: this.any(m.BRACKET_L, n, m.BRACKET_R)
|
|
2385
2385
|
});
|
|
2386
2386
|
}
|
|
2387
2387
|
/**
|
|
@@ -2394,8 +2394,8 @@ class ai {
|
|
|
2394
2394
|
parseObject(t) {
|
|
2395
2395
|
const n = () => this.parseObjectField(t);
|
|
2396
2396
|
return this.node(this._lexer.token, {
|
|
2397
|
-
kind:
|
|
2398
|
-
fields: this.any(
|
|
2397
|
+
kind: A.OBJECT,
|
|
2398
|
+
fields: this.any(m.BRACE_L, n, m.BRACE_R)
|
|
2399
2399
|
});
|
|
2400
2400
|
}
|
|
2401
2401
|
/**
|
|
@@ -2403,8 +2403,8 @@ class ai {
|
|
|
2403
2403
|
*/
|
|
2404
2404
|
parseObjectField(t) {
|
|
2405
2405
|
const n = this._lexer.token, i = this.parseName();
|
|
2406
|
-
return this.expectToken(
|
|
2407
|
-
kind:
|
|
2406
|
+
return this.expectToken(m.COLON), this.node(n, {
|
|
2407
|
+
kind: A.OBJECT_FIELD,
|
|
2408
2408
|
name: i,
|
|
2409
2409
|
value: this.parseValueLiteral(t)
|
|
2410
2410
|
});
|
|
@@ -2415,7 +2415,7 @@ class ai {
|
|
|
2415
2415
|
*/
|
|
2416
2416
|
parseDirectives(t) {
|
|
2417
2417
|
const n = [];
|
|
2418
|
-
for (; this.peek(
|
|
2418
|
+
for (; this.peek(m.AT); )
|
|
2419
2419
|
n.push(this.parseDirective(t));
|
|
2420
2420
|
return n;
|
|
2421
2421
|
}
|
|
@@ -2429,8 +2429,8 @@ class ai {
|
|
|
2429
2429
|
*/
|
|
2430
2430
|
parseDirective(t) {
|
|
2431
2431
|
const n = this._lexer.token;
|
|
2432
|
-
return this.expectToken(
|
|
2433
|
-
kind:
|
|
2432
|
+
return this.expectToken(m.AT), this.node(n, {
|
|
2433
|
+
kind: A.DIRECTIVE,
|
|
2434
2434
|
name: this.parseName(),
|
|
2435
2435
|
arguments: this.parseArguments(t)
|
|
2436
2436
|
});
|
|
@@ -2445,16 +2445,16 @@ class ai {
|
|
|
2445
2445
|
parseTypeReference() {
|
|
2446
2446
|
const t = this._lexer.token;
|
|
2447
2447
|
let n;
|
|
2448
|
-
if (this.expectOptionalToken(
|
|
2448
|
+
if (this.expectOptionalToken(m.BRACKET_L)) {
|
|
2449
2449
|
const i = this.parseTypeReference();
|
|
2450
|
-
this.expectToken(
|
|
2451
|
-
kind:
|
|
2450
|
+
this.expectToken(m.BRACKET_R), n = this.node(t, {
|
|
2451
|
+
kind: A.LIST_TYPE,
|
|
2452
2452
|
type: i
|
|
2453
2453
|
});
|
|
2454
2454
|
} else
|
|
2455
2455
|
n = this.parseNamedType();
|
|
2456
|
-
return this.expectOptionalToken(
|
|
2457
|
-
kind:
|
|
2456
|
+
return this.expectOptionalToken(m.BANG) ? this.node(t, {
|
|
2457
|
+
kind: A.NON_NULL_TYPE,
|
|
2458
2458
|
type: n
|
|
2459
2459
|
}) : n;
|
|
2460
2460
|
}
|
|
@@ -2463,13 +2463,13 @@ class ai {
|
|
|
2463
2463
|
*/
|
|
2464
2464
|
parseNamedType() {
|
|
2465
2465
|
return this.node(this._lexer.token, {
|
|
2466
|
-
kind:
|
|
2466
|
+
kind: A.NAMED_TYPE,
|
|
2467
2467
|
name: this.parseName()
|
|
2468
2468
|
});
|
|
2469
2469
|
}
|
|
2470
2470
|
// Implements the parsing rules in the Type Definition section.
|
|
2471
2471
|
peekDescription() {
|
|
2472
|
-
return this.peek(
|
|
2472
|
+
return this.peek(m.STRING) || this.peek(m.BLOCK_STRING);
|
|
2473
2473
|
}
|
|
2474
2474
|
/**
|
|
2475
2475
|
* Description : StringValue
|
|
@@ -2487,12 +2487,12 @@ class ai {
|
|
|
2487
2487
|
const t = this._lexer.token, n = this.parseDescription();
|
|
2488
2488
|
this.expectKeyword("schema");
|
|
2489
2489
|
const i = this.parseConstDirectives(), r = this.many(
|
|
2490
|
-
|
|
2490
|
+
m.BRACE_L,
|
|
2491
2491
|
this.parseOperationTypeDefinition,
|
|
2492
|
-
|
|
2492
|
+
m.BRACE_R
|
|
2493
2493
|
);
|
|
2494
2494
|
return this.node(t, {
|
|
2495
|
-
kind:
|
|
2495
|
+
kind: A.SCHEMA_DEFINITION,
|
|
2496
2496
|
description: n,
|
|
2497
2497
|
directives: i,
|
|
2498
2498
|
operationTypes: r
|
|
@@ -2503,10 +2503,10 @@ class ai {
|
|
|
2503
2503
|
*/
|
|
2504
2504
|
parseOperationTypeDefinition() {
|
|
2505
2505
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
2506
|
-
this.expectToken(
|
|
2506
|
+
this.expectToken(m.COLON);
|
|
2507
2507
|
const i = this.parseNamedType();
|
|
2508
2508
|
return this.node(t, {
|
|
2509
|
-
kind:
|
|
2509
|
+
kind: A.OPERATION_TYPE_DEFINITION,
|
|
2510
2510
|
operation: n,
|
|
2511
2511
|
type: i
|
|
2512
2512
|
});
|
|
@@ -2519,7 +2519,7 @@ class ai {
|
|
|
2519
2519
|
this.expectKeyword("scalar");
|
|
2520
2520
|
const i = this.parseName(), r = this.parseConstDirectives();
|
|
2521
2521
|
return this.node(t, {
|
|
2522
|
-
kind:
|
|
2522
|
+
kind: A.SCALAR_TYPE_DEFINITION,
|
|
2523
2523
|
description: n,
|
|
2524
2524
|
name: i,
|
|
2525
2525
|
directives: r
|
|
@@ -2535,7 +2535,7 @@ class ai {
|
|
|
2535
2535
|
this.expectKeyword("type");
|
|
2536
2536
|
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
2537
2537
|
return this.node(t, {
|
|
2538
|
-
kind:
|
|
2538
|
+
kind: A.OBJECT_TYPE_DEFINITION,
|
|
2539
2539
|
description: n,
|
|
2540
2540
|
name: i,
|
|
2541
2541
|
interfaces: r,
|
|
@@ -2549,7 +2549,7 @@ class ai {
|
|
|
2549
2549
|
* - ImplementsInterfaces & NamedType
|
|
2550
2550
|
*/
|
|
2551
2551
|
parseImplementsInterfaces() {
|
|
2552
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(
|
|
2552
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(m.AMP, this.parseNamedType) : [];
|
|
2553
2553
|
}
|
|
2554
2554
|
/**
|
|
2555
2555
|
* ```
|
|
@@ -2558,9 +2558,9 @@ class ai {
|
|
|
2558
2558
|
*/
|
|
2559
2559
|
parseFieldsDefinition() {
|
|
2560
2560
|
return this.optionalMany(
|
|
2561
|
-
|
|
2561
|
+
m.BRACE_L,
|
|
2562
2562
|
this.parseFieldDefinition,
|
|
2563
|
-
|
|
2563
|
+
m.BRACE_R
|
|
2564
2564
|
);
|
|
2565
2565
|
}
|
|
2566
2566
|
/**
|
|
@@ -2569,10 +2569,10 @@ class ai {
|
|
|
2569
2569
|
*/
|
|
2570
2570
|
parseFieldDefinition() {
|
|
2571
2571
|
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
2572
|
-
this.expectToken(
|
|
2572
|
+
this.expectToken(m.COLON);
|
|
2573
2573
|
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
2574
2574
|
return this.node(t, {
|
|
2575
|
-
kind:
|
|
2575
|
+
kind: A.FIELD_DEFINITION,
|
|
2576
2576
|
description: n,
|
|
2577
2577
|
name: i,
|
|
2578
2578
|
arguments: r,
|
|
@@ -2585,9 +2585,9 @@ class ai {
|
|
|
2585
2585
|
*/
|
|
2586
2586
|
parseArgumentDefs() {
|
|
2587
2587
|
return this.optionalMany(
|
|
2588
|
-
|
|
2588
|
+
m.PAREN_L,
|
|
2589
2589
|
this.parseInputValueDef,
|
|
2590
|
-
|
|
2590
|
+
m.PAREN_R
|
|
2591
2591
|
);
|
|
2592
2592
|
}
|
|
2593
2593
|
/**
|
|
@@ -2596,13 +2596,13 @@ class ai {
|
|
|
2596
2596
|
*/
|
|
2597
2597
|
parseInputValueDef() {
|
|
2598
2598
|
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
2599
|
-
this.expectToken(
|
|
2599
|
+
this.expectToken(m.COLON);
|
|
2600
2600
|
const r = this.parseTypeReference();
|
|
2601
2601
|
let s;
|
|
2602
|
-
this.expectOptionalToken(
|
|
2602
|
+
this.expectOptionalToken(m.EQUALS) && (s = this.parseConstValueLiteral());
|
|
2603
2603
|
const o = this.parseConstDirectives();
|
|
2604
2604
|
return this.node(t, {
|
|
2605
|
-
kind:
|
|
2605
|
+
kind: A.INPUT_VALUE_DEFINITION,
|
|
2606
2606
|
description: n,
|
|
2607
2607
|
name: i,
|
|
2608
2608
|
type: r,
|
|
@@ -2619,7 +2619,7 @@ class ai {
|
|
|
2619
2619
|
this.expectKeyword("interface");
|
|
2620
2620
|
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
2621
2621
|
return this.node(t, {
|
|
2622
|
-
kind:
|
|
2622
|
+
kind: A.INTERFACE_TYPE_DEFINITION,
|
|
2623
2623
|
description: n,
|
|
2624
2624
|
name: i,
|
|
2625
2625
|
interfaces: r,
|
|
@@ -2636,7 +2636,7 @@ class ai {
|
|
|
2636
2636
|
this.expectKeyword("union");
|
|
2637
2637
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
2638
2638
|
return this.node(t, {
|
|
2639
|
-
kind:
|
|
2639
|
+
kind: A.UNION_TYPE_DEFINITION,
|
|
2640
2640
|
description: n,
|
|
2641
2641
|
name: i,
|
|
2642
2642
|
directives: r,
|
|
@@ -2649,7 +2649,7 @@ class ai {
|
|
|
2649
2649
|
* - UnionMemberTypes | NamedType
|
|
2650
2650
|
*/
|
|
2651
2651
|
parseUnionMemberTypes() {
|
|
2652
|
-
return this.expectOptionalToken(
|
|
2652
|
+
return this.expectOptionalToken(m.EQUALS) ? this.delimitedMany(m.PIPE, this.parseNamedType) : [];
|
|
2653
2653
|
}
|
|
2654
2654
|
/**
|
|
2655
2655
|
* EnumTypeDefinition :
|
|
@@ -2660,7 +2660,7 @@ class ai {
|
|
|
2660
2660
|
this.expectKeyword("enum");
|
|
2661
2661
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
2662
2662
|
return this.node(t, {
|
|
2663
|
-
kind:
|
|
2663
|
+
kind: A.ENUM_TYPE_DEFINITION,
|
|
2664
2664
|
description: n,
|
|
2665
2665
|
name: i,
|
|
2666
2666
|
directives: r,
|
|
@@ -2674,9 +2674,9 @@ class ai {
|
|
|
2674
2674
|
*/
|
|
2675
2675
|
parseEnumValuesDefinition() {
|
|
2676
2676
|
return this.optionalMany(
|
|
2677
|
-
|
|
2677
|
+
m.BRACE_L,
|
|
2678
2678
|
this.parseEnumValueDefinition,
|
|
2679
|
-
|
|
2679
|
+
m.BRACE_R
|
|
2680
2680
|
);
|
|
2681
2681
|
}
|
|
2682
2682
|
/**
|
|
@@ -2685,7 +2685,7 @@ class ai {
|
|
|
2685
2685
|
parseEnumValueDefinition() {
|
|
2686
2686
|
const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
2687
2687
|
return this.node(t, {
|
|
2688
|
-
kind:
|
|
2688
|
+
kind: A.ENUM_VALUE_DEFINITION,
|
|
2689
2689
|
description: n,
|
|
2690
2690
|
name: i,
|
|
2691
2691
|
directives: r
|
|
@@ -2696,10 +2696,10 @@ class ai {
|
|
|
2696
2696
|
*/
|
|
2697
2697
|
parseEnumValueName() {
|
|
2698
2698
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
2699
|
-
throw
|
|
2699
|
+
throw M(
|
|
2700
2700
|
this._lexer.source,
|
|
2701
2701
|
this._lexer.token.start,
|
|
2702
|
-
`${
|
|
2702
|
+
`${ve(
|
|
2703
2703
|
this._lexer.token
|
|
2704
2704
|
)} is reserved and cannot be used for an enum value.`
|
|
2705
2705
|
);
|
|
@@ -2714,7 +2714,7 @@ class ai {
|
|
|
2714
2714
|
this.expectKeyword("input");
|
|
2715
2715
|
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
2716
2716
|
return this.node(t, {
|
|
2717
|
-
kind:
|
|
2717
|
+
kind: A.INPUT_OBJECT_TYPE_DEFINITION,
|
|
2718
2718
|
description: n,
|
|
2719
2719
|
name: i,
|
|
2720
2720
|
directives: r,
|
|
@@ -2728,9 +2728,9 @@ class ai {
|
|
|
2728
2728
|
*/
|
|
2729
2729
|
parseInputFieldsDefinition() {
|
|
2730
2730
|
return this.optionalMany(
|
|
2731
|
-
|
|
2731
|
+
m.BRACE_L,
|
|
2732
2732
|
this.parseInputValueDef,
|
|
2733
|
-
|
|
2733
|
+
m.BRACE_R
|
|
2734
2734
|
);
|
|
2735
2735
|
}
|
|
2736
2736
|
/**
|
|
@@ -2748,7 +2748,7 @@ class ai {
|
|
|
2748
2748
|
*/
|
|
2749
2749
|
parseTypeSystemExtension() {
|
|
2750
2750
|
const t = this._lexer.lookahead();
|
|
2751
|
-
if (t.kind ===
|
|
2751
|
+
if (t.kind === m.NAME)
|
|
2752
2752
|
switch (t.value) {
|
|
2753
2753
|
case "schema":
|
|
2754
2754
|
return this.parseSchemaExtension();
|
|
@@ -2778,14 +2778,14 @@ class ai {
|
|
|
2778
2778
|
const t = this._lexer.token;
|
|
2779
2779
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
2780
2780
|
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
2781
|
-
|
|
2781
|
+
m.BRACE_L,
|
|
2782
2782
|
this.parseOperationTypeDefinition,
|
|
2783
|
-
|
|
2783
|
+
m.BRACE_R
|
|
2784
2784
|
);
|
|
2785
2785
|
if (n.length === 0 && i.length === 0)
|
|
2786
2786
|
throw this.unexpected();
|
|
2787
2787
|
return this.node(t, {
|
|
2788
|
-
kind:
|
|
2788
|
+
kind: A.SCHEMA_EXTENSION,
|
|
2789
2789
|
directives: n,
|
|
2790
2790
|
operationTypes: i
|
|
2791
2791
|
});
|
|
@@ -2801,7 +2801,7 @@ class ai {
|
|
|
2801
2801
|
if (i.length === 0)
|
|
2802
2802
|
throw this.unexpected();
|
|
2803
2803
|
return this.node(t, {
|
|
2804
|
-
kind:
|
|
2804
|
+
kind: A.SCALAR_TYPE_EXTENSION,
|
|
2805
2805
|
name: n,
|
|
2806
2806
|
directives: i
|
|
2807
2807
|
});
|
|
@@ -2819,7 +2819,7 @@ class ai {
|
|
|
2819
2819
|
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
2820
2820
|
throw this.unexpected();
|
|
2821
2821
|
return this.node(t, {
|
|
2822
|
-
kind:
|
|
2822
|
+
kind: A.OBJECT_TYPE_EXTENSION,
|
|
2823
2823
|
name: n,
|
|
2824
2824
|
interfaces: i,
|
|
2825
2825
|
directives: r,
|
|
@@ -2839,7 +2839,7 @@ class ai {
|
|
|
2839
2839
|
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
2840
2840
|
throw this.unexpected();
|
|
2841
2841
|
return this.node(t, {
|
|
2842
|
-
kind:
|
|
2842
|
+
kind: A.INTERFACE_TYPE_EXTENSION,
|
|
2843
2843
|
name: n,
|
|
2844
2844
|
interfaces: i,
|
|
2845
2845
|
directives: r,
|
|
@@ -2858,7 +2858,7 @@ class ai {
|
|
|
2858
2858
|
if (i.length === 0 && r.length === 0)
|
|
2859
2859
|
throw this.unexpected();
|
|
2860
2860
|
return this.node(t, {
|
|
2861
|
-
kind:
|
|
2861
|
+
kind: A.UNION_TYPE_EXTENSION,
|
|
2862
2862
|
name: n,
|
|
2863
2863
|
directives: i,
|
|
2864
2864
|
types: r
|
|
@@ -2876,7 +2876,7 @@ class ai {
|
|
|
2876
2876
|
if (i.length === 0 && r.length === 0)
|
|
2877
2877
|
throw this.unexpected();
|
|
2878
2878
|
return this.node(t, {
|
|
2879
|
-
kind:
|
|
2879
|
+
kind: A.ENUM_TYPE_EXTENSION,
|
|
2880
2880
|
name: n,
|
|
2881
2881
|
directives: i,
|
|
2882
2882
|
values: r
|
|
@@ -2894,7 +2894,7 @@ class ai {
|
|
|
2894
2894
|
if (i.length === 0 && r.length === 0)
|
|
2895
2895
|
throw this.unexpected();
|
|
2896
2896
|
return this.node(t, {
|
|
2897
|
-
kind:
|
|
2897
|
+
kind: A.INPUT_OBJECT_TYPE_EXTENSION,
|
|
2898
2898
|
name: n,
|
|
2899
2899
|
directives: i,
|
|
2900
2900
|
fields: r
|
|
@@ -2908,12 +2908,12 @@ class ai {
|
|
|
2908
2908
|
*/
|
|
2909
2909
|
parseDirectiveDefinition() {
|
|
2910
2910
|
const t = this._lexer.token, n = this.parseDescription();
|
|
2911
|
-
this.expectKeyword("directive"), this.expectToken(
|
|
2911
|
+
this.expectKeyword("directive"), this.expectToken(m.AT);
|
|
2912
2912
|
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
2913
2913
|
this.expectKeyword("on");
|
|
2914
2914
|
const o = this.parseDirectiveLocations();
|
|
2915
2915
|
return this.node(t, {
|
|
2916
|
-
kind:
|
|
2916
|
+
kind: A.DIRECTIVE_DEFINITION,
|
|
2917
2917
|
description: n,
|
|
2918
2918
|
name: i,
|
|
2919
2919
|
arguments: r,
|
|
@@ -2927,7 +2927,7 @@ class ai {
|
|
|
2927
2927
|
* - DirectiveLocations | DirectiveLocation
|
|
2928
2928
|
*/
|
|
2929
2929
|
parseDirectiveLocations() {
|
|
2930
|
-
return this.delimitedMany(
|
|
2930
|
+
return this.delimitedMany(m.PIPE, this.parseDirectiveLocation);
|
|
2931
2931
|
}
|
|
2932
2932
|
/*
|
|
2933
2933
|
* DirectiveLocation :
|
|
@@ -2958,7 +2958,7 @@ class ai {
|
|
|
2958
2958
|
*/
|
|
2959
2959
|
parseDirectiveLocation() {
|
|
2960
2960
|
const t = this._lexer.token, n = this.parseName();
|
|
2961
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2961
|
+
if (Object.prototype.hasOwnProperty.call(ze, n.value))
|
|
2962
2962
|
return n;
|
|
2963
2963
|
throw this.unexpected(t);
|
|
2964
2964
|
}
|
|
@@ -2969,7 +2969,7 @@ class ai {
|
|
|
2969
2969
|
* given parsed object.
|
|
2970
2970
|
*/
|
|
2971
2971
|
node(t, n) {
|
|
2972
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
2972
|
+
return this._options.noLocation !== !0 && (n.loc = new Un(
|
|
2973
2973
|
t,
|
|
2974
2974
|
this._lexer.lastToken,
|
|
2975
2975
|
this._lexer.source
|
|
@@ -2989,10 +2989,10 @@ class ai {
|
|
|
2989
2989
|
const n = this._lexer.token;
|
|
2990
2990
|
if (n.kind === t)
|
|
2991
2991
|
return this.advanceLexer(), n;
|
|
2992
|
-
throw
|
|
2992
|
+
throw M(
|
|
2993
2993
|
this._lexer.source,
|
|
2994
2994
|
n.start,
|
|
2995
|
-
`Expected ${
|
|
2995
|
+
`Expected ${kt(t)}, found ${ve(n)}.`
|
|
2996
2996
|
);
|
|
2997
2997
|
}
|
|
2998
2998
|
/**
|
|
@@ -3008,13 +3008,13 @@ class ai {
|
|
|
3008
3008
|
*/
|
|
3009
3009
|
expectKeyword(t) {
|
|
3010
3010
|
const n = this._lexer.token;
|
|
3011
|
-
if (n.kind ===
|
|
3011
|
+
if (n.kind === m.NAME && n.value === t)
|
|
3012
3012
|
this.advanceLexer();
|
|
3013
3013
|
else
|
|
3014
|
-
throw
|
|
3014
|
+
throw M(
|
|
3015
3015
|
this._lexer.source,
|
|
3016
3016
|
n.start,
|
|
3017
|
-
`Expected "${t}", found ${
|
|
3017
|
+
`Expected "${t}", found ${ve(n)}.`
|
|
3018
3018
|
);
|
|
3019
3019
|
}
|
|
3020
3020
|
/**
|
|
@@ -3023,17 +3023,17 @@ class ai {
|
|
|
3023
3023
|
*/
|
|
3024
3024
|
expectOptionalKeyword(t) {
|
|
3025
3025
|
const n = this._lexer.token;
|
|
3026
|
-
return n.kind ===
|
|
3026
|
+
return n.kind === m.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
|
|
3027
3027
|
}
|
|
3028
3028
|
/**
|
|
3029
3029
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
3030
3030
|
*/
|
|
3031
3031
|
unexpected(t) {
|
|
3032
3032
|
const n = t ?? this._lexer.token;
|
|
3033
|
-
return
|
|
3033
|
+
return M(
|
|
3034
3034
|
this._lexer.source,
|
|
3035
3035
|
n.start,
|
|
3036
|
-
`Unexpected ${
|
|
3036
|
+
`Unexpected ${ve(n)}.`
|
|
3037
3037
|
);
|
|
3038
3038
|
}
|
|
3039
3039
|
/**
|
|
@@ -3092,29 +3092,29 @@ class ai {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
advanceLexer() {
|
|
3094
3094
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
3095
|
-
if (t !== void 0 && n.kind !==
|
|
3096
|
-
throw
|
|
3095
|
+
if (t !== void 0 && n.kind !== m.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
3096
|
+
throw M(
|
|
3097
3097
|
this._lexer.source,
|
|
3098
3098
|
n.start,
|
|
3099
3099
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
3100
3100
|
);
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function ve(e) {
|
|
3104
3104
|
const t = e.value;
|
|
3105
|
-
return
|
|
3105
|
+
return kt(e.kind) + (t != null ? ` "${t}"` : "");
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return
|
|
3107
|
+
function kt(e) {
|
|
3108
|
+
return Yn(e) ? `"${e}"` : e;
|
|
3109
3109
|
}
|
|
3110
|
-
function
|
|
3111
|
-
return `"${e.replace(
|
|
3110
|
+
function hi(e) {
|
|
3111
|
+
return `"${e.replace(di, pi)}"`;
|
|
3112
3112
|
}
|
|
3113
|
-
const
|
|
3114
|
-
function
|
|
3115
|
-
return
|
|
3113
|
+
const di = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
3114
|
+
function pi(e) {
|
|
3115
|
+
return mi[e.charCodeAt(0)];
|
|
3116
3116
|
}
|
|
3117
|
-
const
|
|
3117
|
+
const mi = [
|
|
3118
3118
|
"\\u0000",
|
|
3119
3119
|
"\\u0001",
|
|
3120
3120
|
"\\u0002",
|
|
@@ -3280,75 +3280,75 @@ const fi = [
|
|
|
3280
3280
|
"\\u009D",
|
|
3281
3281
|
"\\u009E",
|
|
3282
3282
|
"\\u009F"
|
|
3283
|
-
],
|
|
3284
|
-
function
|
|
3283
|
+
], gi = Object.freeze({});
|
|
3284
|
+
function Ei(e, t, n = Ot) {
|
|
3285
3285
|
const i = /* @__PURE__ */ new Map();
|
|
3286
|
-
for (const
|
|
3287
|
-
i.set(
|
|
3286
|
+
for (const O of Object.values(A))
|
|
3287
|
+
i.set(O, yi(t, O));
|
|
3288
3288
|
let r, s = Array.isArray(e), o = [e], a = -1, u = [], c = e, l, f;
|
|
3289
|
-
const
|
|
3289
|
+
const d = [], y = [];
|
|
3290
3290
|
do {
|
|
3291
3291
|
a++;
|
|
3292
|
-
const
|
|
3293
|
-
if (
|
|
3294
|
-
if (l =
|
|
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)
|
|
3295
3295
|
if (s) {
|
|
3296
3296
|
c = c.slice();
|
|
3297
|
-
let
|
|
3298
|
-
for (const [
|
|
3299
|
-
const
|
|
3300
|
-
|
|
3297
|
+
let C = 0;
|
|
3298
|
+
for (const [J, $] of u) {
|
|
3299
|
+
const K = J - C;
|
|
3300
|
+
$ === null ? (c.splice(K, 1), C++) : c[K] = $;
|
|
3301
3301
|
}
|
|
3302
3302
|
} else {
|
|
3303
3303
|
c = Object.defineProperties(
|
|
3304
3304
|
{},
|
|
3305
3305
|
Object.getOwnPropertyDescriptors(c)
|
|
3306
3306
|
);
|
|
3307
|
-
for (const [
|
|
3308
|
-
c[
|
|
3307
|
+
for (const [C, J] of u)
|
|
3308
|
+
c[C] = J;
|
|
3309
3309
|
}
|
|
3310
3310
|
a = r.index, o = r.keys, u = r.edits, s = r.inArray, r = r.prev;
|
|
3311
3311
|
} else if (f) {
|
|
3312
3312
|
if (l = s ? a : o[a], c = f[l], c == null)
|
|
3313
3313
|
continue;
|
|
3314
|
-
|
|
3314
|
+
d.push(l);
|
|
3315
3315
|
}
|
|
3316
|
-
let
|
|
3316
|
+
let b;
|
|
3317
3317
|
if (!Array.isArray(c)) {
|
|
3318
|
-
var N,
|
|
3319
|
-
|
|
3320
|
-
const
|
|
3321
|
-
if (
|
|
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 == null ? void 0 : C.call(t, c, l, f, d, y), b === gi)
|
|
3322
3322
|
break;
|
|
3323
|
-
if (
|
|
3324
|
-
if (!
|
|
3325
|
-
|
|
3323
|
+
if (b === !1) {
|
|
3324
|
+
if (!O) {
|
|
3325
|
+
d.pop();
|
|
3326
3326
|
continue;
|
|
3327
3327
|
}
|
|
3328
|
-
} else if (
|
|
3329
|
-
if (
|
|
3330
|
-
c =
|
|
3328
|
+
} else if (b !== void 0 && (u.push([l, b]), !O))
|
|
3329
|
+
if (ot(b))
|
|
3330
|
+
c = b;
|
|
3331
3331
|
else {
|
|
3332
|
-
|
|
3332
|
+
d.pop();
|
|
3333
3333
|
continue;
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
|
-
if (
|
|
3337
|
-
|
|
3336
|
+
if (b === void 0 && q && u.push([l, c]), O)
|
|
3337
|
+
d.pop();
|
|
3338
3338
|
else {
|
|
3339
|
-
var
|
|
3339
|
+
var x;
|
|
3340
3340
|
r = {
|
|
3341
3341
|
inArray: s,
|
|
3342
3342
|
index: a,
|
|
3343
3343
|
keys: o,
|
|
3344
3344
|
edits: u,
|
|
3345
3345
|
prev: r
|
|
3346
|
-
}, s = Array.isArray(c), o = s ? c : (
|
|
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;
|
|
3347
3347
|
}
|
|
3348
3348
|
} while (r !== void 0);
|
|
3349
3349
|
return u.length !== 0 ? u[u.length - 1][1] : e;
|
|
3350
3350
|
}
|
|
3351
|
-
function
|
|
3351
|
+
function yi(e, t) {
|
|
3352
3352
|
const n = e[t];
|
|
3353
3353
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
3354
3354
|
enter: n,
|
|
@@ -3358,10 +3358,10 @@ function pi(e, t) {
|
|
|
3358
3358
|
leave: e.leave
|
|
3359
3359
|
};
|
|
3360
3360
|
}
|
|
3361
|
-
function
|
|
3362
|
-
return
|
|
3361
|
+
function Ni(e) {
|
|
3362
|
+
return Ei(e, vi);
|
|
3363
3363
|
}
|
|
3364
|
-
const
|
|
3364
|
+
const wi = 80, vi = {
|
|
3365
3365
|
Name: {
|
|
3366
3366
|
leave: (e) => e.value
|
|
3367
3367
|
},
|
|
@@ -3376,7 +3376,7 @@ const gi = 80, Ei = {
|
|
|
3376
3376
|
},
|
|
3377
3377
|
OperationDefinition: {
|
|
3378
3378
|
leave(e) {
|
|
3379
|
-
const t =
|
|
3379
|
+
const t = D("(", w(e.variableDefinitions, ", "), ")"), n = w(
|
|
3380
3380
|
[
|
|
3381
3381
|
e.operation,
|
|
3382
3382
|
w([e.name, t]),
|
|
@@ -3388,17 +3388,17 @@ const gi = 80, Ei = {
|
|
|
3388
3388
|
}
|
|
3389
3389
|
},
|
|
3390
3390
|
VariableDefinition: {
|
|
3391
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t +
|
|
3391
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + D(" = ", n) + D(" ", w(i, " "))
|
|
3392
3392
|
},
|
|
3393
3393
|
SelectionSet: {
|
|
3394
|
-
leave: ({ selections: e }) =>
|
|
3394
|
+
leave: ({ selections: e }) => z(e)
|
|
3395
3395
|
},
|
|
3396
3396
|
Field: {
|
|
3397
3397
|
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
3398
|
-
const s =
|
|
3399
|
-
let o = s +
|
|
3400
|
-
return o.length >
|
|
3401
|
-
`,
|
|
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, `
|
|
3402
3402
|
`)), `
|
|
3403
3403
|
)`)), w([o, w(i, " "), r], " ");
|
|
3404
3404
|
}
|
|
@@ -3408,13 +3408,13 @@ const gi = 80, Ei = {
|
|
|
3408
3408
|
},
|
|
3409
3409
|
// Fragments
|
|
3410
3410
|
FragmentSpread: {
|
|
3411
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
3411
|
+
leave: ({ name: e, directives: t }) => "..." + e + D(" ", w(t, " "))
|
|
3412
3412
|
},
|
|
3413
3413
|
InlineFragment: {
|
|
3414
3414
|
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => w(
|
|
3415
3415
|
[
|
|
3416
3416
|
"...",
|
|
3417
|
-
|
|
3417
|
+
D("on ", e),
|
|
3418
3418
|
w(t, " "),
|
|
3419
3419
|
n
|
|
3420
3420
|
],
|
|
@@ -3424,7 +3424,7 @@ const gi = 80, Ei = {
|
|
|
3424
3424
|
FragmentDefinition: {
|
|
3425
3425
|
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
3426
3426
|
// or removed in the future.
|
|
3427
|
-
`fragment ${e}${
|
|
3427
|
+
`fragment ${e}${D("(", w(n, ", "), ")")} on ${t} ${D("", w(i, " "), " ")}` + r
|
|
3428
3428
|
)
|
|
3429
3429
|
},
|
|
3430
3430
|
// Value
|
|
@@ -3435,7 +3435,7 @@ const gi = 80, Ei = {
|
|
|
3435
3435
|
leave: ({ value: e }) => e
|
|
3436
3436
|
},
|
|
3437
3437
|
StringValue: {
|
|
3438
|
-
leave: ({ value: e, block: t }) => t ?
|
|
3438
|
+
leave: ({ value: e, block: t }) => t ? Hn(e) : hi(e)
|
|
3439
3439
|
},
|
|
3440
3440
|
BooleanValue: {
|
|
3441
3441
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -3457,7 +3457,7 @@ const gi = 80, Ei = {
|
|
|
3457
3457
|
},
|
|
3458
3458
|
// Directive
|
|
3459
3459
|
Directive: {
|
|
3460
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
3460
|
+
leave: ({ name: e, arguments: t }) => "@" + e + D("(", w(t, ", "), ")")
|
|
3461
3461
|
},
|
|
3462
3462
|
// Type
|
|
3463
3463
|
NamedType: {
|
|
@@ -3471,85 +3471,85 @@ const gi = 80, Ei = {
|
|
|
3471
3471
|
},
|
|
3472
3472
|
// Type System Definitions
|
|
3473
3473
|
SchemaDefinition: {
|
|
3474
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
3475
|
-
`) + w(["schema", w(t, " "),
|
|
3474
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => D("", e, `
|
|
3475
|
+
`) + w(["schema", w(t, " "), z(n)], " ")
|
|
3476
3476
|
},
|
|
3477
3477
|
OperationTypeDefinition: {
|
|
3478
3478
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
3479
3479
|
},
|
|
3480
3480
|
ScalarTypeDefinition: {
|
|
3481
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
3481
|
+
leave: ({ description: e, name: t, directives: n }) => D("", e, `
|
|
3482
3482
|
`) + w(["scalar", t, w(n, " ")], " ")
|
|
3483
3483
|
},
|
|
3484
3484
|
ObjectTypeDefinition: {
|
|
3485
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
3485
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
|
|
3486
3486
|
`) + w(
|
|
3487
3487
|
[
|
|
3488
3488
|
"type",
|
|
3489
3489
|
t,
|
|
3490
|
-
|
|
3490
|
+
D("implements ", w(n, " & ")),
|
|
3491
3491
|
w(i, " "),
|
|
3492
|
-
|
|
3492
|
+
z(r)
|
|
3493
3493
|
],
|
|
3494
3494
|
" "
|
|
3495
3495
|
)
|
|
3496
3496
|
},
|
|
3497
3497
|
FieldDefinition: {
|
|
3498
|
-
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) =>
|
|
3499
|
-
`) + t + (
|
|
3500
|
-
`,
|
|
3498
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => D("", e, `
|
|
3499
|
+
`) + t + (ct(n) ? D(`(
|
|
3500
|
+
`, be(w(n, `
|
|
3501
3501
|
`)), `
|
|
3502
|
-
)`) :
|
|
3502
|
+
)`) : D("(", w(n, ", "), ")")) + ": " + i + D(" ", w(r, " "))
|
|
3503
3503
|
},
|
|
3504
3504
|
InputValueDefinition: {
|
|
3505
|
-
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) =>
|
|
3505
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => D("", e, `
|
|
3506
3506
|
`) + w(
|
|
3507
|
-
[t + ": " + n,
|
|
3507
|
+
[t + ": " + n, D("= ", i), w(r, " ")],
|
|
3508
3508
|
" "
|
|
3509
3509
|
)
|
|
3510
3510
|
},
|
|
3511
3511
|
InterfaceTypeDefinition: {
|
|
3512
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
3512
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
|
|
3513
3513
|
`) + w(
|
|
3514
3514
|
[
|
|
3515
3515
|
"interface",
|
|
3516
3516
|
t,
|
|
3517
|
-
|
|
3517
|
+
D("implements ", w(n, " & ")),
|
|
3518
3518
|
w(i, " "),
|
|
3519
|
-
|
|
3519
|
+
z(r)
|
|
3520
3520
|
],
|
|
3521
3521
|
" "
|
|
3522
3522
|
)
|
|
3523
3523
|
},
|
|
3524
3524
|
UnionTypeDefinition: {
|
|
3525
|
-
leave: ({ description: e, name: t, directives: n, types: i }) =>
|
|
3525
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => D("", e, `
|
|
3526
3526
|
`) + w(
|
|
3527
|
-
["union", t, w(n, " "),
|
|
3527
|
+
["union", t, w(n, " "), D("= ", w(i, " | "))],
|
|
3528
3528
|
" "
|
|
3529
3529
|
)
|
|
3530
3530
|
},
|
|
3531
3531
|
EnumTypeDefinition: {
|
|
3532
|
-
leave: ({ description: e, name: t, directives: n, values: i }) =>
|
|
3533
|
-
`) + w(["enum", t, w(n, " "),
|
|
3532
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => D("", e, `
|
|
3533
|
+
`) + w(["enum", t, w(n, " "), z(i)], " ")
|
|
3534
3534
|
},
|
|
3535
3535
|
EnumValueDefinition: {
|
|
3536
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
3536
|
+
leave: ({ description: e, name: t, directives: n }) => D("", e, `
|
|
3537
3537
|
`) + w([t, w(n, " ")], " ")
|
|
3538
3538
|
},
|
|
3539
3539
|
InputObjectTypeDefinition: {
|
|
3540
|
-
leave: ({ description: e, name: t, directives: n, fields: i }) =>
|
|
3541
|
-
`) + w(["input", t, w(n, " "),
|
|
3540
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => D("", e, `
|
|
3541
|
+
`) + w(["input", t, w(n, " "), z(i)], " ")
|
|
3542
3542
|
},
|
|
3543
3543
|
DirectiveDefinition: {
|
|
3544
|
-
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) =>
|
|
3545
|
-
`) + "directive @" + t + (
|
|
3546
|
-
`,
|
|
3544
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => D("", e, `
|
|
3545
|
+
`) + "directive @" + t + (ct(n) ? D(`(
|
|
3546
|
+
`, be(w(n, `
|
|
3547
3547
|
`)), `
|
|
3548
|
-
)`) :
|
|
3548
|
+
)`) : D("(", w(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + w(r, " | ")
|
|
3549
3549
|
},
|
|
3550
3550
|
SchemaExtension: {
|
|
3551
3551
|
leave: ({ directives: e, operationTypes: t }) => w(
|
|
3552
|
-
["extend schema", w(e, " "),
|
|
3552
|
+
["extend schema", w(e, " "), z(t)],
|
|
3553
3553
|
" "
|
|
3554
3554
|
)
|
|
3555
3555
|
},
|
|
@@ -3561,9 +3561,9 @@ const gi = 80, Ei = {
|
|
|
3561
3561
|
[
|
|
3562
3562
|
"extend type",
|
|
3563
3563
|
e,
|
|
3564
|
-
|
|
3564
|
+
D("implements ", w(t, " & ")),
|
|
3565
3565
|
w(n, " "),
|
|
3566
|
-
|
|
3566
|
+
z(i)
|
|
3567
3567
|
],
|
|
3568
3568
|
" "
|
|
3569
3569
|
)
|
|
@@ -3573,9 +3573,9 @@ const gi = 80, Ei = {
|
|
|
3573
3573
|
[
|
|
3574
3574
|
"extend interface",
|
|
3575
3575
|
e,
|
|
3576
|
-
|
|
3576
|
+
D("implements ", w(t, " & ")),
|
|
3577
3577
|
w(n, " "),
|
|
3578
|
-
|
|
3578
|
+
z(i)
|
|
3579
3579
|
],
|
|
3580
3580
|
" "
|
|
3581
3581
|
)
|
|
@@ -3586,78 +3586,79 @@ const gi = 80, Ei = {
|
|
|
3586
3586
|
"extend union",
|
|
3587
3587
|
e,
|
|
3588
3588
|
w(t, " "),
|
|
3589
|
-
|
|
3589
|
+
D("= ", w(n, " | "))
|
|
3590
3590
|
],
|
|
3591
3591
|
" "
|
|
3592
3592
|
)
|
|
3593
3593
|
},
|
|
3594
3594
|
EnumTypeExtension: {
|
|
3595
|
-
leave: ({ name: e, directives: t, values: n }) => w(["extend enum", e, w(t, " "),
|
|
3595
|
+
leave: ({ name: e, directives: t, values: n }) => w(["extend enum", e, w(t, " "), z(n)], " ")
|
|
3596
3596
|
},
|
|
3597
3597
|
InputObjectTypeExtension: {
|
|
3598
|
-
leave: ({ name: e, directives: t, fields: n }) => w(["extend input", e, w(t, " "),
|
|
3598
|
+
leave: ({ name: e, directives: t, fields: n }) => w(["extend input", e, w(t, " "), z(n)], " ")
|
|
3599
3599
|
}
|
|
3600
3600
|
};
|
|
3601
3601
|
function w(e, t = "") {
|
|
3602
3602
|
var n;
|
|
3603
3603
|
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
3604
3604
|
}
|
|
3605
|
-
function
|
|
3606
|
-
return
|
|
3607
|
-
`,
|
|
3605
|
+
function z(e) {
|
|
3606
|
+
return D(`{
|
|
3607
|
+
`, be(w(e, `
|
|
3608
3608
|
`)), `
|
|
3609
3609
|
}`);
|
|
3610
3610
|
}
|
|
3611
|
-
function
|
|
3611
|
+
function D(e, t, n = "") {
|
|
3612
3612
|
return t != null && t !== "" ? e + t + n : "";
|
|
3613
3613
|
}
|
|
3614
|
-
function
|
|
3615
|
-
return
|
|
3614
|
+
function be(e) {
|
|
3615
|
+
return D(" ", e.replace(/\n/g, `
|
|
3616
3616
|
`));
|
|
3617
3617
|
}
|
|
3618
|
-
function
|
|
3618
|
+
function ct(e) {
|
|
3619
3619
|
var t;
|
|
3620
3620
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
3621
3621
|
`))) !== null && t !== void 0 ? t : !1;
|
|
3622
3622
|
}
|
|
3623
|
-
const
|
|
3623
|
+
const ut = (e) => {
|
|
3624
3624
|
var i, r;
|
|
3625
3625
|
let t;
|
|
3626
3626
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
3627
3627
|
return n.length === 1 && (t = (r = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), t;
|
|
3628
|
-
},
|
|
3628
|
+
}, Ue = (e) => {
|
|
3629
3629
|
if (typeof e == "string") {
|
|
3630
3630
|
let n;
|
|
3631
3631
|
try {
|
|
3632
|
-
const i =
|
|
3633
|
-
n =
|
|
3632
|
+
const i = li(e);
|
|
3633
|
+
n = ut(i);
|
|
3634
3634
|
} catch {
|
|
3635
3635
|
}
|
|
3636
3636
|
return { query: e, operationName: n };
|
|
3637
3637
|
}
|
|
3638
|
-
const t =
|
|
3639
|
-
return { query:
|
|
3638
|
+
const t = ut(e);
|
|
3639
|
+
return { query: Ni(e), operationName: t };
|
|
3640
3640
|
};
|
|
3641
|
-
class
|
|
3641
|
+
class Ee extends Error {
|
|
3642
3642
|
constructor(t, n) {
|
|
3643
|
-
const i = `${
|
|
3643
|
+
const i = `${Ee.extractMessage(t)}: ${JSON.stringify({
|
|
3644
3644
|
response: t,
|
|
3645
3645
|
request: n
|
|
3646
3646
|
})}`;
|
|
3647
|
-
super(i), Object.setPrototypeOf(this,
|
|
3647
|
+
super(i), Object.setPrototypeOf(this, Ee.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Ee);
|
|
3648
3648
|
}
|
|
3649
3649
|
static extractMessage(t) {
|
|
3650
3650
|
var n, i;
|
|
3651
3651
|
return ((i = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
3652
3652
|
}
|
|
3653
3653
|
}
|
|
3654
|
-
|
|
3654
|
+
var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3655
|
+
function Ti(e) {
|
|
3655
3656
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3656
3657
|
}
|
|
3657
|
-
var
|
|
3658
|
-
function
|
|
3659
|
-
return
|
|
3660
|
-
var n = typeof self < "u"
|
|
3658
|
+
var Ae = { exports: {} }, lt;
|
|
3659
|
+
function Ai() {
|
|
3660
|
+
return lt || (lt = 1, function(e, t) {
|
|
3661
|
+
var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof Te < "u" && Te, i = function() {
|
|
3661
3662
|
function s() {
|
|
3662
3663
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
3663
3664
|
}
|
|
@@ -3665,24 +3666,25 @@ function vi() {
|
|
|
3665
3666
|
}();
|
|
3666
3667
|
(function(s) {
|
|
3667
3668
|
(function(o) {
|
|
3668
|
-
var a =
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3669
|
+
var a = typeof s < "u" && s || typeof self < "u" && self || // eslint-disable-next-line no-undef
|
|
3670
|
+
typeof Te < "u" && Te || {}, u = {
|
|
3671
|
+
searchParams: "URLSearchParams" in a,
|
|
3672
|
+
iterable: "Symbol" in a && "iterator" in Symbol,
|
|
3673
|
+
blob: "FileReader" in a && "Blob" in a && function() {
|
|
3672
3674
|
try {
|
|
3673
3675
|
return new Blob(), !0;
|
|
3674
3676
|
} catch {
|
|
3675
3677
|
return !1;
|
|
3676
3678
|
}
|
|
3677
3679
|
}(),
|
|
3678
|
-
formData: "FormData" in
|
|
3679
|
-
arrayBuffer: "ArrayBuffer" in
|
|
3680
|
+
formData: "FormData" in a,
|
|
3681
|
+
arrayBuffer: "ArrayBuffer" in a
|
|
3680
3682
|
};
|
|
3681
|
-
function
|
|
3682
|
-
return
|
|
3683
|
+
function c(h) {
|
|
3684
|
+
return h && DataView.prototype.isPrototypeOf(h);
|
|
3683
3685
|
}
|
|
3684
|
-
if (
|
|
3685
|
-
var
|
|
3686
|
+
if (u.arrayBuffer)
|
|
3687
|
+
var l = [
|
|
3686
3688
|
"[object Int8Array]",
|
|
3687
3689
|
"[object Uint8Array]",
|
|
3688
3690
|
"[object Uint8ClampedArray]",
|
|
@@ -3692,108 +3694,112 @@ function vi() {
|
|
|
3692
3694
|
"[object Uint32Array]",
|
|
3693
3695
|
"[object Float32Array]",
|
|
3694
3696
|
"[object Float64Array]"
|
|
3695
|
-
],
|
|
3696
|
-
return
|
|
3697
|
+
], f = ArrayBuffer.isView || function(h) {
|
|
3698
|
+
return h && l.indexOf(Object.prototype.toString.call(h)) > -1;
|
|
3697
3699
|
};
|
|
3698
|
-
function
|
|
3699
|
-
if (typeof
|
|
3700
|
-
throw new TypeError(
|
|
3701
|
-
return
|
|
3700
|
+
function d(h) {
|
|
3701
|
+
if (typeof h != "string" && (h = String(h)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h) || h === "")
|
|
3702
|
+
throw new TypeError('Invalid character in header field name: "' + h + '"');
|
|
3703
|
+
return h.toLowerCase();
|
|
3702
3704
|
}
|
|
3703
|
-
function h
|
|
3704
|
-
return typeof
|
|
3705
|
+
function y(h) {
|
|
3706
|
+
return typeof h != "string" && (h = String(h)), h;
|
|
3705
3707
|
}
|
|
3706
|
-
function
|
|
3707
|
-
var
|
|
3708
|
+
function N(h) {
|
|
3709
|
+
var p = {
|
|
3708
3710
|
next: function() {
|
|
3709
|
-
var
|
|
3710
|
-
return { done:
|
|
3711
|
+
var _ = h.shift();
|
|
3712
|
+
return { done: _ === void 0, value: _ };
|
|
3711
3713
|
}
|
|
3712
3714
|
};
|
|
3713
|
-
return
|
|
3714
|
-
return
|
|
3715
|
-
}),
|
|
3715
|
+
return u.iterable && (p[Symbol.iterator] = function() {
|
|
3716
|
+
return p;
|
|
3717
|
+
}), p;
|
|
3716
3718
|
}
|
|
3717
|
-
function
|
|
3718
|
-
this.map = {},
|
|
3719
|
-
this.append(
|
|
3720
|
-
}, this) : Array.isArray(
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
this.append(
|
|
3719
|
+
function E(h) {
|
|
3720
|
+
this.map = {}, h instanceof E ? h.forEach(function(p, _) {
|
|
3721
|
+
this.append(_, p);
|
|
3722
|
+
}, this) : Array.isArray(h) ? h.forEach(function(p) {
|
|
3723
|
+
if (p.length != 2)
|
|
3724
|
+
throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + p.length);
|
|
3725
|
+
this.append(p[0], p[1]);
|
|
3726
|
+
}, this) : h && Object.getOwnPropertyNames(h).forEach(function(p) {
|
|
3727
|
+
this.append(p, h[p]);
|
|
3724
3728
|
}, this);
|
|
3725
3729
|
}
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
var
|
|
3729
|
-
this.map[
|
|
3730
|
-
},
|
|
3731
|
-
delete this.map[
|
|
3732
|
-
},
|
|
3733
|
-
return
|
|
3734
|
-
},
|
|
3735
|
-
return this.map.hasOwnProperty(
|
|
3736
|
-
},
|
|
3737
|
-
this.map[
|
|
3738
|
-
},
|
|
3739
|
-
for (var
|
|
3740
|
-
this.map.hasOwnProperty(
|
|
3741
|
-
},
|
|
3742
|
-
var
|
|
3743
|
-
return this.forEach(function(
|
|
3744
|
-
|
|
3745
|
-
}),
|
|
3746
|
-
},
|
|
3747
|
-
var
|
|
3748
|
-
return this.forEach(function(
|
|
3749
|
-
|
|
3750
|
-
}),
|
|
3751
|
-
},
|
|
3752
|
-
var
|
|
3753
|
-
return this.forEach(function(
|
|
3754
|
-
|
|
3755
|
-
}),
|
|
3756
|
-
},
|
|
3757
|
-
function
|
|
3758
|
-
if (
|
|
3759
|
-
|
|
3760
|
-
|
|
3730
|
+
E.prototype.append = function(h, p) {
|
|
3731
|
+
h = d(h), p = y(p);
|
|
3732
|
+
var _ = this.map[h];
|
|
3733
|
+
this.map[h] = _ ? _ + ", " + p : p;
|
|
3734
|
+
}, E.prototype.delete = function(h) {
|
|
3735
|
+
delete this.map[d(h)];
|
|
3736
|
+
}, E.prototype.get = function(h) {
|
|
3737
|
+
return h = d(h), this.has(h) ? this.map[h] : null;
|
|
3738
|
+
}, E.prototype.has = function(h) {
|
|
3739
|
+
return this.map.hasOwnProperty(d(h));
|
|
3740
|
+
}, E.prototype.set = function(h, p) {
|
|
3741
|
+
this.map[d(h)] = y(p);
|
|
3742
|
+
}, E.prototype.forEach = function(h, p) {
|
|
3743
|
+
for (var _ in this.map)
|
|
3744
|
+
this.map.hasOwnProperty(_) && h.call(p, this.map[_], _, this);
|
|
3745
|
+
}, E.prototype.keys = function() {
|
|
3746
|
+
var h = [];
|
|
3747
|
+
return this.forEach(function(p, _) {
|
|
3748
|
+
h.push(_);
|
|
3749
|
+
}), N(h);
|
|
3750
|
+
}, E.prototype.values = function() {
|
|
3751
|
+
var h = [];
|
|
3752
|
+
return this.forEach(function(p) {
|
|
3753
|
+
h.push(p);
|
|
3754
|
+
}), N(h);
|
|
3755
|
+
}, E.prototype.entries = function() {
|
|
3756
|
+
var h = [];
|
|
3757
|
+
return this.forEach(function(p, _) {
|
|
3758
|
+
h.push([_, p]);
|
|
3759
|
+
}), N(h);
|
|
3760
|
+
}, u.iterable && (E.prototype[Symbol.iterator] = E.prototype.entries);
|
|
3761
|
+
function x(h) {
|
|
3762
|
+
if (!h._noBody) {
|
|
3763
|
+
if (h.bodyUsed)
|
|
3764
|
+
return Promise.reject(new TypeError("Already read"));
|
|
3765
|
+
h.bodyUsed = !0;
|
|
3766
|
+
}
|
|
3761
3767
|
}
|
|
3762
|
-
function
|
|
3763
|
-
return new Promise(function(
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
},
|
|
3767
|
-
|
|
3768
|
+
function O(h) {
|
|
3769
|
+
return new Promise(function(p, _) {
|
|
3770
|
+
h.onload = function() {
|
|
3771
|
+
p(h.result);
|
|
3772
|
+
}, h.onerror = function() {
|
|
3773
|
+
_(h.error);
|
|
3768
3774
|
};
|
|
3769
3775
|
});
|
|
3770
3776
|
}
|
|
3771
|
-
function
|
|
3772
|
-
var
|
|
3773
|
-
return
|
|
3777
|
+
function q(h) {
|
|
3778
|
+
var p = new FileReader(), _ = O(p);
|
|
3779
|
+
return p.readAsArrayBuffer(h), _;
|
|
3774
3780
|
}
|
|
3775
|
-
function
|
|
3776
|
-
var
|
|
3777
|
-
return
|
|
3781
|
+
function b(h) {
|
|
3782
|
+
var p = new FileReader(), _ = O(p), k = /charset=([A-Za-z0-9_-]+)/.exec(h.type), L = k ? k[1] : "utf-8";
|
|
3783
|
+
return p.readAsText(h, L), _;
|
|
3778
3784
|
}
|
|
3779
|
-
function
|
|
3780
|
-
for (var
|
|
3781
|
-
|
|
3782
|
-
return
|
|
3785
|
+
function C(h) {
|
|
3786
|
+
for (var p = new Uint8Array(h), _ = new Array(p.length), k = 0; k < p.length; k++)
|
|
3787
|
+
_[k] = String.fromCharCode(p[k]);
|
|
3788
|
+
return _.join("");
|
|
3783
3789
|
}
|
|
3784
|
-
function
|
|
3785
|
-
if (
|
|
3786
|
-
return
|
|
3787
|
-
var
|
|
3788
|
-
return
|
|
3790
|
+
function J(h) {
|
|
3791
|
+
if (h.slice)
|
|
3792
|
+
return h.slice(0);
|
|
3793
|
+
var p = new Uint8Array(h.byteLength);
|
|
3794
|
+
return p.set(new Uint8Array(h)), p.buffer;
|
|
3789
3795
|
}
|
|
3790
|
-
function
|
|
3791
|
-
return this.bodyUsed = !1, this._initBody = function(
|
|
3792
|
-
this._bodyInit =
|
|
3793
|
-
},
|
|
3794
|
-
var
|
|
3795
|
-
if (
|
|
3796
|
-
return
|
|
3796
|
+
function $() {
|
|
3797
|
+
return this.bodyUsed = !1, this._initBody = function(h) {
|
|
3798
|
+
this.bodyUsed = this.bodyUsed, this._bodyInit = h, h ? typeof h == "string" ? this._bodyText = h : u.blob && Blob.prototype.isPrototypeOf(h) ? this._bodyBlob = h : u.formData && FormData.prototype.isPrototypeOf(h) ? this._bodyFormData = h : u.searchParams && URLSearchParams.prototype.isPrototypeOf(h) ? this._bodyText = h.toString() : u.arrayBuffer && u.blob && c(h) ? (this._bodyArrayBuffer = J(h.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(h) || f(h)) ? this._bodyArrayBuffer = J(h) : this._bodyText = h = Object.prototype.toString.call(h) : (this._noBody = !0, this._bodyText = ""), this.headers.get("content-type") || (typeof h == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(h) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
3799
|
+
}, u.blob && (this.blob = function() {
|
|
3800
|
+
var h = x(this);
|
|
3801
|
+
if (h)
|
|
3802
|
+
return h;
|
|
3797
3803
|
if (this._bodyBlob)
|
|
3798
3804
|
return Promise.resolve(this._bodyBlob);
|
|
3799
3805
|
if (this._bodyArrayBuffer)
|
|
@@ -3801,237 +3807,299 @@ function vi() {
|
|
|
3801
3807
|
if (this._bodyFormData)
|
|
3802
3808
|
throw new Error("could not read FormData body as blob");
|
|
3803
3809
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
3804
|
-
}, this.arrayBuffer = function() {
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
+
}), this.arrayBuffer = function() {
|
|
3811
|
+
if (this._bodyArrayBuffer) {
|
|
3812
|
+
var h = x(this);
|
|
3813
|
+
return h || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
|
|
3814
|
+
this._bodyArrayBuffer.buffer.slice(
|
|
3815
|
+
this._bodyArrayBuffer.byteOffset,
|
|
3816
|
+
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
|
3817
|
+
)
|
|
3818
|
+
) : Promise.resolve(this._bodyArrayBuffer));
|
|
3819
|
+
} else {
|
|
3820
|
+
if (u.blob)
|
|
3821
|
+
return this.blob().then(q);
|
|
3822
|
+
throw new Error("could not read as ArrayBuffer");
|
|
3823
|
+
}
|
|
3824
|
+
}, this.text = function() {
|
|
3825
|
+
var h = x(this);
|
|
3826
|
+
if (h)
|
|
3827
|
+
return h;
|
|
3810
3828
|
if (this._bodyBlob)
|
|
3811
|
-
return
|
|
3829
|
+
return b(this._bodyBlob);
|
|
3812
3830
|
if (this._bodyArrayBuffer)
|
|
3813
|
-
return Promise.resolve(
|
|
3831
|
+
return Promise.resolve(C(this._bodyArrayBuffer));
|
|
3814
3832
|
if (this._bodyFormData)
|
|
3815
3833
|
throw new Error("could not read FormData body as text");
|
|
3816
3834
|
return Promise.resolve(this._bodyText);
|
|
3817
|
-
},
|
|
3818
|
-
return this.text().then(
|
|
3835
|
+
}, u.formData && (this.formData = function() {
|
|
3836
|
+
return this.text().then(me);
|
|
3819
3837
|
}), this.json = function() {
|
|
3820
3838
|
return this.text().then(JSON.parse);
|
|
3821
3839
|
}, this;
|
|
3822
3840
|
}
|
|
3823
|
-
var
|
|
3824
|
-
function
|
|
3825
|
-
var
|
|
3826
|
-
return
|
|
3841
|
+
var K = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
|
|
3842
|
+
function ae(h) {
|
|
3843
|
+
var p = h.toUpperCase();
|
|
3844
|
+
return K.indexOf(p) > -1 ? p : h;
|
|
3827
3845
|
}
|
|
3828
|
-
function H(
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3846
|
+
function H(h, p) {
|
|
3847
|
+
if (!(this instanceof H))
|
|
3848
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
3849
|
+
p = p || {};
|
|
3850
|
+
var _ = p.body;
|
|
3851
|
+
if (h instanceof H) {
|
|
3852
|
+
if (h.bodyUsed)
|
|
3833
3853
|
throw new TypeError("Already read");
|
|
3834
|
-
this.url =
|
|
3854
|
+
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);
|
|
3835
3855
|
} else
|
|
3836
|
-
this.url = String(
|
|
3837
|
-
if (this.credentials =
|
|
3856
|
+
this.url = String(h);
|
|
3857
|
+
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() {
|
|
3858
|
+
if ("AbortController" in a) {
|
|
3859
|
+
var S = new AbortController();
|
|
3860
|
+
return S.signal;
|
|
3861
|
+
}
|
|
3862
|
+
}(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && _)
|
|
3838
3863
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
3839
|
-
this._initBody(
|
|
3864
|
+
if (this._initBody(_), (this.method === "GET" || this.method === "HEAD") && (p.cache === "no-store" || p.cache === "no-cache")) {
|
|
3865
|
+
var k = /([?&])_=[^&]*/;
|
|
3866
|
+
if (k.test(this.url))
|
|
3867
|
+
this.url = this.url.replace(k, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
|
|
3868
|
+
else {
|
|
3869
|
+
var L = /\?/;
|
|
3870
|
+
this.url += (L.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3840
3873
|
}
|
|
3841
3874
|
H.prototype.clone = function() {
|
|
3842
3875
|
return new H(this, { body: this._bodyInit });
|
|
3843
3876
|
};
|
|
3844
|
-
function
|
|
3845
|
-
var
|
|
3846
|
-
return
|
|
3847
|
-
if (
|
|
3848
|
-
var
|
|
3849
|
-
|
|
3877
|
+
function me(h) {
|
|
3878
|
+
var p = new FormData();
|
|
3879
|
+
return h.trim().split("&").forEach(function(_) {
|
|
3880
|
+
if (_) {
|
|
3881
|
+
var k = _.split("="), L = k.shift().replace(/\+/g, " "), S = k.join("=").replace(/\+/g, " ");
|
|
3882
|
+
p.append(decodeURIComponent(L), decodeURIComponent(S));
|
|
3850
3883
|
}
|
|
3851
|
-
}),
|
|
3884
|
+
}), p;
|
|
3852
3885
|
}
|
|
3853
|
-
function
|
|
3854
|
-
var
|
|
3855
|
-
return
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3886
|
+
function Y(h) {
|
|
3887
|
+
var p = new E(), _ = h.replace(/\r?\n[\t ]+/g, " ");
|
|
3888
|
+
return _.split("\r").map(function(k) {
|
|
3889
|
+
return k.indexOf(`
|
|
3890
|
+
`) === 0 ? k.substr(1, k.length) : k;
|
|
3891
|
+
}).forEach(function(k) {
|
|
3892
|
+
var L = k.split(":"), S = L.shift().trim();
|
|
3893
|
+
if (S) {
|
|
3894
|
+
var we = L.join(":").trim();
|
|
3895
|
+
try {
|
|
3896
|
+
p.append(S, we);
|
|
3897
|
+
} catch (Me) {
|
|
3898
|
+
console.warn("Response " + Me.message);
|
|
3899
|
+
}
|
|
3860
3900
|
}
|
|
3861
|
-
}),
|
|
3901
|
+
}), p;
|
|
3862
3902
|
}
|
|
3863
|
-
|
|
3864
|
-
function
|
|
3865
|
-
|
|
3903
|
+
$.call(H.prototype);
|
|
3904
|
+
function V(h, p) {
|
|
3905
|
+
if (!(this instanceof V))
|
|
3906
|
+
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
|
|
3907
|
+
if (p || (p = {}), this.type = "default", this.status = p.status === void 0 ? 200 : p.status, this.status < 200 || this.status > 599)
|
|
3908
|
+
throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
|
|
3909
|
+
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);
|
|
3866
3910
|
}
|
|
3867
|
-
|
|
3868
|
-
return new
|
|
3911
|
+
$.call(V.prototype), V.prototype.clone = function() {
|
|
3912
|
+
return new V(this._bodyInit, {
|
|
3869
3913
|
status: this.status,
|
|
3870
3914
|
statusText: this.statusText,
|
|
3871
|
-
headers: new
|
|
3915
|
+
headers: new E(this.headers),
|
|
3872
3916
|
url: this.url
|
|
3873
3917
|
});
|
|
3874
|
-
},
|
|
3875
|
-
var
|
|
3876
|
-
return
|
|
3918
|
+
}, V.error = function() {
|
|
3919
|
+
var h = new V(null, { status: 200, statusText: "" });
|
|
3920
|
+
return h.ok = !1, h.status = 0, h.type = "error", h;
|
|
3877
3921
|
};
|
|
3878
|
-
var
|
|
3879
|
-
|
|
3880
|
-
if (
|
|
3922
|
+
var ce = [301, 302, 303, 307, 308];
|
|
3923
|
+
V.redirect = function(h, p) {
|
|
3924
|
+
if (ce.indexOf(p) === -1)
|
|
3881
3925
|
throw new RangeError("Invalid status code");
|
|
3882
|
-
return new
|
|
3883
|
-
}, o.DOMException =
|
|
3926
|
+
return new V(null, { status: p, headers: { location: h } });
|
|
3927
|
+
}, o.DOMException = a.DOMException;
|
|
3884
3928
|
try {
|
|
3885
3929
|
new o.DOMException();
|
|
3886
3930
|
} catch {
|
|
3887
|
-
o.DOMException = function(
|
|
3888
|
-
this.message =
|
|
3889
|
-
var
|
|
3890
|
-
this.stack =
|
|
3931
|
+
o.DOMException = function(p, _) {
|
|
3932
|
+
this.message = p, this.name = _;
|
|
3933
|
+
var k = Error(p);
|
|
3934
|
+
this.stack = k.stack;
|
|
3891
3935
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
3892
3936
|
}
|
|
3893
|
-
function
|
|
3894
|
-
return new Promise(function(
|
|
3895
|
-
var
|
|
3896
|
-
if (
|
|
3897
|
-
return
|
|
3898
|
-
var
|
|
3899
|
-
function
|
|
3900
|
-
|
|
3937
|
+
function re(h, p) {
|
|
3938
|
+
return new Promise(function(_, k) {
|
|
3939
|
+
var L = new H(h, p);
|
|
3940
|
+
if (L.signal && L.signal.aborted)
|
|
3941
|
+
return k(new o.DOMException("Aborted", "AbortError"));
|
|
3942
|
+
var S = new XMLHttpRequest();
|
|
3943
|
+
function we() {
|
|
3944
|
+
S.abort();
|
|
3901
3945
|
}
|
|
3902
|
-
|
|
3903
|
-
var
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
headers: fe(C.getAllResponseHeaders() || "")
|
|
3946
|
+
S.onload = function() {
|
|
3947
|
+
var B = {
|
|
3948
|
+
statusText: S.statusText,
|
|
3949
|
+
headers: Y(S.getAllResponseHeaders() || "")
|
|
3907
3950
|
};
|
|
3908
|
-
|
|
3909
|
-
var
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
},
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
},
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
}
|
|
3951
|
+
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");
|
|
3952
|
+
var se = "response" in S ? S.response : S.responseText;
|
|
3953
|
+
setTimeout(function() {
|
|
3954
|
+
_(new V(se, B));
|
|
3955
|
+
}, 0);
|
|
3956
|
+
}, S.onerror = function() {
|
|
3957
|
+
setTimeout(function() {
|
|
3958
|
+
k(new TypeError("Network request failed"));
|
|
3959
|
+
}, 0);
|
|
3960
|
+
}, S.ontimeout = function() {
|
|
3961
|
+
setTimeout(function() {
|
|
3962
|
+
k(new TypeError("Network request timed out"));
|
|
3963
|
+
}, 0);
|
|
3964
|
+
}, S.onabort = function() {
|
|
3965
|
+
setTimeout(function() {
|
|
3966
|
+
k(new o.DOMException("Aborted", "AbortError"));
|
|
3967
|
+
}, 0);
|
|
3968
|
+
};
|
|
3969
|
+
function Me(B) {
|
|
3970
|
+
try {
|
|
3971
|
+
return B === "" && a.location.href ? a.location.href : B;
|
|
3972
|
+
} catch {
|
|
3973
|
+
return B;
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3976
|
+
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)) {
|
|
3977
|
+
var et = [];
|
|
3978
|
+
Object.getOwnPropertyNames(p.headers).forEach(function(B) {
|
|
3979
|
+
et.push(d(B)), S.setRequestHeader(B, y(p.headers[B]));
|
|
3980
|
+
}), L.headers.forEach(function(B, se) {
|
|
3981
|
+
et.indexOf(se) === -1 && S.setRequestHeader(se, B);
|
|
3982
|
+
});
|
|
3983
|
+
} else
|
|
3984
|
+
L.headers.forEach(function(B, se) {
|
|
3985
|
+
S.setRequestHeader(se, B);
|
|
3986
|
+
});
|
|
3987
|
+
L.signal && (L.signal.addEventListener("abort", we), S.onreadystatechange = function() {
|
|
3988
|
+
S.readyState === 4 && L.signal.removeEventListener("abort", we);
|
|
3989
|
+
}), S.send(typeof L._bodyInit > "u" ? null : L._bodyInit);
|
|
3922
3990
|
});
|
|
3923
3991
|
}
|
|
3924
|
-
return
|
|
3992
|
+
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;
|
|
3925
3993
|
})({});
|
|
3926
3994
|
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
|
|
3927
|
-
var r = i;
|
|
3995
|
+
var r = n.fetch ? n : i;
|
|
3928
3996
|
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;
|
|
3929
|
-
}(
|
|
3997
|
+
}(Ae, Ae.exports)), Ae.exports;
|
|
3930
3998
|
}
|
|
3931
|
-
var
|
|
3932
|
-
const
|
|
3999
|
+
var Ce = Ai();
|
|
4000
|
+
const _e = /* @__PURE__ */ Ti(Ce), Ii = /* @__PURE__ */ Lt({
|
|
3933
4001
|
__proto__: null,
|
|
3934
|
-
default:
|
|
3935
|
-
}, [
|
|
4002
|
+
default: _e
|
|
4003
|
+
}, [Ce]), ue = (e) => {
|
|
3936
4004
|
let t = {};
|
|
3937
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
4005
|
+
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]) => {
|
|
3938
4006
|
n && i !== void 0 && (t[n] = i);
|
|
3939
4007
|
}) : t = e), t;
|
|
3940
|
-
},
|
|
4008
|
+
}, ft = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Oi = (e) => {
|
|
3941
4009
|
if (!Array.isArray(e.query)) {
|
|
3942
|
-
const i = e, r = [`query=${encodeURIComponent(
|
|
4010
|
+
const i = e, r = [`query=${encodeURIComponent(ft(i.query))}`];
|
|
3943
4011
|
return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
|
|
3944
4012
|
}
|
|
3945
4013
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
3946
4014
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
3947
4015
|
const t = e, n = e.query.reduce((i, r, s) => (i.push({
|
|
3948
|
-
query:
|
|
4016
|
+
query: ft(r),
|
|
3949
4017
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
3950
4018
|
}), i), []);
|
|
3951
4019
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3952
|
-
},
|
|
4020
|
+
}, bi = (e) => async (t) => {
|
|
3953
4021
|
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: a, middleware: u } = t, c = { ...t.headers };
|
|
3954
4022
|
let l = "", f;
|
|
3955
|
-
e === "POST" ? (f =
|
|
4023
|
+
e === "POST" ? (f = Di(i, r, s, a.jsonSerializer), typeof f == "string" && (c["Content-Type"] = "application/json")) : l = Oi({
|
|
3956
4024
|
query: i,
|
|
3957
4025
|
variables: r,
|
|
3958
4026
|
operationName: s,
|
|
3959
|
-
jsonSerializer: a.jsonSerializer ??
|
|
4027
|
+
jsonSerializer: a.jsonSerializer ?? Ze
|
|
3960
4028
|
});
|
|
3961
|
-
const
|
|
4029
|
+
const d = {
|
|
3962
4030
|
method: e,
|
|
3963
4031
|
headers: c,
|
|
3964
4032
|
body: f,
|
|
3965
4033
|
...a
|
|
3966
4034
|
};
|
|
3967
|
-
let
|
|
4035
|
+
let y = n, N = d;
|
|
3968
4036
|
if (u) {
|
|
3969
|
-
const
|
|
3970
|
-
|
|
4037
|
+
const E = await Promise.resolve(u({ ...d, url: n, operationName: s, variables: r })), { url: x, ...O } = E;
|
|
4038
|
+
y = x, N = O;
|
|
3971
4039
|
}
|
|
3972
|
-
return l && (
|
|
4040
|
+
return l && (y = `${y}?${l}`), await o(y, N);
|
|
3973
4041
|
};
|
|
3974
|
-
class
|
|
4042
|
+
class _i {
|
|
3975
4043
|
constructor(t, n = {}) {
|
|
3976
4044
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
|
|
3977
|
-
const [r, s, o] = i, a =
|
|
3978
|
-
a.signal !== void 0 && (
|
|
3979
|
-
const { operationName:
|
|
3980
|
-
return
|
|
4045
|
+
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;
|
|
4046
|
+
a.signal !== void 0 && (y.signal = a.signal);
|
|
4047
|
+
const { operationName: E } = Ue(a.query);
|
|
4048
|
+
return qe({
|
|
3981
4049
|
url: N,
|
|
3982
4050
|
query: a.query,
|
|
3983
4051
|
variables: a.variables,
|
|
3984
4052
|
headers: {
|
|
3985
|
-
...
|
|
3986
|
-
...
|
|
4053
|
+
...ue(Ve(u)),
|
|
4054
|
+
...ue(a.requestHeaders)
|
|
3987
4055
|
},
|
|
3988
|
-
operationName:
|
|
4056
|
+
operationName: E,
|
|
3989
4057
|
fetch: c,
|
|
3990
4058
|
method: l,
|
|
3991
|
-
fetchOptions:
|
|
4059
|
+
fetchOptions: y,
|
|
3992
4060
|
middleware: f
|
|
3993
|
-
}).then((
|
|
3994
|
-
throw
|
|
4061
|
+
}).then((x) => (d && d(x), x)).catch((x) => {
|
|
4062
|
+
throw d && d(x), x;
|
|
3995
4063
|
});
|
|
3996
4064
|
};
|
|
3997
4065
|
}
|
|
3998
4066
|
async request(t, ...n) {
|
|
3999
|
-
const [i, r] = n, s =
|
|
4067
|
+
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;
|
|
4000
4068
|
s.signal !== void 0 && (f.signal = s.signal);
|
|
4001
|
-
const { query:
|
|
4002
|
-
return
|
|
4003
|
-
url:
|
|
4004
|
-
query:
|
|
4069
|
+
const { query: y, operationName: N } = Ue(s.document);
|
|
4070
|
+
return qe({
|
|
4071
|
+
url: d,
|
|
4072
|
+
query: y,
|
|
4005
4073
|
variables: s.variables,
|
|
4006
4074
|
headers: {
|
|
4007
|
-
...
|
|
4008
|
-
...
|
|
4075
|
+
...ue(Ve(o)),
|
|
4076
|
+
...ue(s.requestHeaders)
|
|
4009
4077
|
},
|
|
4010
4078
|
operationName: N,
|
|
4011
4079
|
fetch: a,
|
|
4012
4080
|
method: u,
|
|
4013
4081
|
fetchOptions: f,
|
|
4014
4082
|
middleware: c
|
|
4015
|
-
}).then((
|
|
4016
|
-
throw l && l(
|
|
4083
|
+
}).then((E) => (l && l(E), E.data)).catch((E) => {
|
|
4084
|
+
throw l && l(E), E;
|
|
4017
4085
|
});
|
|
4018
4086
|
}
|
|
4019
4087
|
// prettier-ignore
|
|
4020
4088
|
batchRequests(t, n) {
|
|
4021
|
-
const i =
|
|
4089
|
+
const i = Rn(t, n), { headers: r, ...s } = this.requestConfig;
|
|
4022
4090
|
i.signal !== void 0 && (s.signal = i.signal);
|
|
4023
|
-
const o = i.documents.map(({ document: u }) =>
|
|
4024
|
-
return
|
|
4091
|
+
const o = i.documents.map(({ document: u }) => Ue(u).query), a = i.documents.map(({ variables: u }) => u);
|
|
4092
|
+
return qe({
|
|
4025
4093
|
url: this.url,
|
|
4026
4094
|
query: o,
|
|
4027
4095
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
4028
4096
|
variables: a,
|
|
4029
4097
|
headers: {
|
|
4030
|
-
...
|
|
4031
|
-
...
|
|
4098
|
+
...ue(Ve(r)),
|
|
4099
|
+
...ue(i.requestHeaders)
|
|
4032
4100
|
},
|
|
4033
4101
|
operationName: void 0,
|
|
4034
|
-
fetch: this.requestConfig.fetch ??
|
|
4102
|
+
fetch: this.requestConfig.fetch ?? _e,
|
|
4035
4103
|
method: this.requestConfig.method || "POST",
|
|
4036
4104
|
fetchOptions: s,
|
|
4037
4105
|
middleware: this.requestConfig.requestMiddleware
|
|
@@ -4056,12 +4124,12 @@ class Ii {
|
|
|
4056
4124
|
return this.url = t, this;
|
|
4057
4125
|
}
|
|
4058
4126
|
}
|
|
4059
|
-
const
|
|
4060
|
-
const { query: t, variables: n, fetchOptions: i } = e, r =
|
|
4127
|
+
const qe = async (e) => {
|
|
4128
|
+
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";
|
|
4061
4129
|
if (o.ok && c && u) {
|
|
4062
|
-
const { errors: l, ...f } = (Array.isArray(a), a),
|
|
4130
|
+
const { errors: l, ...f } = (Array.isArray(a), a), d = i.errorPolicy === "ignore" ? f : a;
|
|
4063
4131
|
return {
|
|
4064
|
-
...s ? { data:
|
|
4132
|
+
...s ? { data: d } : d,
|
|
4065
4133
|
headers: o.headers,
|
|
4066
4134
|
status: o.status
|
|
4067
4135
|
};
|
|
@@ -4069,27 +4137,27 @@ const Pe = async (e) => {
|
|
|
4069
4137
|
const l = typeof a == "string" ? {
|
|
4070
4138
|
error: a
|
|
4071
4139
|
} : a;
|
|
4072
|
-
throw new
|
|
4140
|
+
throw new Ee(
|
|
4073
4141
|
// @ts-expect-error TODO
|
|
4074
4142
|
{ ...l, status: o.status, headers: o.headers },
|
|
4075
4143
|
{ query: t, variables: n }
|
|
4076
4144
|
);
|
|
4077
4145
|
}
|
|
4078
|
-
},
|
|
4079
|
-
const r = i ??
|
|
4146
|
+
}, Di = (e, t, n, i) => {
|
|
4147
|
+
const r = i ?? Ze;
|
|
4080
4148
|
if (!Array.isArray(e))
|
|
4081
4149
|
return r.stringify({ query: e, variables: t, operationName: n });
|
|
4082
4150
|
if (typeof t < "u" && !Array.isArray(t))
|
|
4083
4151
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
4084
4152
|
const s = e.reduce((o, a, u) => (o.push({ query: a, variables: t ? t[u] : void 0 }), o), []);
|
|
4085
4153
|
return r.stringify(s);
|
|
4086
|
-
},
|
|
4154
|
+
}, Si = async (e, t) => {
|
|
4087
4155
|
let n;
|
|
4088
4156
|
return e.headers.forEach((i, r) => {
|
|
4089
4157
|
r.toLowerCase() === "content-type" && (n = i);
|
|
4090
4158
|
}), 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();
|
|
4091
|
-
},
|
|
4092
|
-
getMeta:
|
|
4159
|
+
}, Ve = (e) => typeof e == "function" ? e() : e, Rt = (e, ...t) => e.reduce((n, i, r) => `${n}${i}${r in t ? String(t[r]) : ""}`, ""), xi = {
|
|
4160
|
+
getMeta: Rt`
|
|
4093
4161
|
query getDoctype($doctype: String!) {
|
|
4094
4162
|
getMeta(doctype: $doctype) {
|
|
4095
4163
|
id
|
|
@@ -4100,7 +4168,7 @@ const Pe = async (e) => {
|
|
|
4100
4168
|
}
|
|
4101
4169
|
}
|
|
4102
4170
|
`
|
|
4103
|
-
},
|
|
4171
|
+
}, ki = Rt`
|
|
4104
4172
|
type Doctype {
|
|
4105
4173
|
id: ID!
|
|
4106
4174
|
name: String!
|
|
@@ -4146,35 +4214,35 @@ const Pe = async (e) => {
|
|
|
4146
4214
|
query: Query
|
|
4147
4215
|
mutation: Mutation
|
|
4148
4216
|
}
|
|
4149
|
-
`,
|
|
4217
|
+
`, Ci = (e) => JSON.parse(e, (t, n) => {
|
|
4150
4218
|
if (typeof n == "string")
|
|
4151
4219
|
try {
|
|
4152
|
-
return JSON.parse(n, (i, r) => typeof r == "string" && !isNaN(Number(r)) ? new
|
|
4220
|
+
return JSON.parse(n, (i, r) => typeof r == "string" && !isNaN(Number(r)) ? new de(r) : r);
|
|
4153
4221
|
} catch {
|
|
4154
4222
|
return n;
|
|
4155
4223
|
}
|
|
4156
4224
|
else if (!isNaN(Number(n)))
|
|
4157
|
-
return new
|
|
4225
|
+
return new de(n);
|
|
4158
4226
|
return n;
|
|
4159
|
-
}),
|
|
4227
|
+
}), Ri = {
|
|
4160
4228
|
getMeta: async (e, t) => {
|
|
4161
|
-
const n = new
|
|
4229
|
+
const n = new _i(t || "/graphql", {
|
|
4162
4230
|
jsonSerializer: {
|
|
4163
4231
|
stringify: (r) => JSON.stringify(r),
|
|
4164
4232
|
// process the request object before sending; leave as default JSON
|
|
4165
|
-
parse:
|
|
4233
|
+
parse: Ci
|
|
4166
4234
|
// process the response meta object
|
|
4167
4235
|
}
|
|
4168
4236
|
}), { getMeta: i } = await n.request({
|
|
4169
|
-
document:
|
|
4237
|
+
document: xi.getMeta,
|
|
4170
4238
|
variables: { doctype: e }
|
|
4171
4239
|
});
|
|
4172
4240
|
return i;
|
|
4173
4241
|
}
|
|
4174
4242
|
};
|
|
4175
4243
|
export {
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4244
|
+
Ri as methods,
|
|
4245
|
+
xi as queries,
|
|
4246
|
+
ki as typeDefs
|
|
4179
4247
|
};
|
|
4180
4248
|
//# sourceMappingURL=graphql-client.js.map
|