@builtbystack/sq-shopify-theme-sdk 0.0.33 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,92 +1,102 @@
1
- var He = Object.defineProperty;
2
- var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ve = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- function ze(e, t) {
1
+ var Je = Object.defineProperty;
2
+ var Xe = (e, t, n) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var Pe = (e, t, n) => Xe(e, typeof t != "symbol" ? t + "" : t, n);
4
+ function Ke(e, t) {
5
5
  for (var n = 0; n < t.length; n++) {
6
- const r = t[n];
7
- if (typeof r != "string" && !Array.isArray(r)) {
8
- for (const i in r)
9
- if (i !== "default" && !(i in e)) {
10
- const s = Object.getOwnPropertyDescriptor(r, i);
11
- s && Object.defineProperty(e, i, s.get ? s : {
6
+ const i = t[n];
7
+ if (typeof i != "string" && !Array.isArray(i)) {
8
+ for (const r in i)
9
+ if (r !== "default" && !(r in e)) {
10
+ const s = Object.getOwnPropertyDescriptor(i, r);
11
+ s && Object.defineProperty(e, r, s.get ? s : {
12
12
  enumerable: !0,
13
- get: () => r[i]
13
+ get: () => i[r]
14
14
  });
15
15
  }
16
16
  }
17
17
  }
18
18
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
19
19
  }
20
- var ne = function() {
21
- return ne = Object.assign || function(t) {
22
- for (var n, r = 1, i = arguments.length; r < i; r++) {
23
- n = arguments[r];
24
- for (var s in n)
25
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
26
- }
27
- return t;
28
- }, ne.apply(this, arguments);
20
+ const Ae = JSON, Ze = (e) => e.toUpperCase(), We = (e) => {
21
+ const t = {};
22
+ return e.forEach((n, i) => {
23
+ t[i] = n;
24
+ }), t;
25
+ }, et = (e, t, n) => e.document ? e : {
26
+ document: e,
27
+ variables: t,
28
+ requestHeaders: n,
29
+ signal: void 0
30
+ }, tt = (e, t, n) => e.query ? e : {
31
+ query: e,
32
+ variables: t,
33
+ requestHeaders: n,
34
+ signal: void 0
35
+ }, nt = (e, t) => e.documents ? e : {
36
+ documents: e,
37
+ requestHeaders: t,
38
+ signal: void 0
29
39
  };
30
- function Z(e, t) {
40
+ function ee(e, t) {
31
41
  if (!!!e)
32
42
  throw new Error(t);
33
43
  }
34
- function Je(e) {
44
+ function rt(e) {
35
45
  return typeof e == "object" && e !== null;
36
46
  }
37
- function Qe(e, t) {
47
+ function it(e, t) {
38
48
  if (!!!e)
39
49
  throw new Error(
40
- t ?? "Unexpected invariant triggered."
50
+ "Unexpected invariant triggered."
41
51
  );
42
52
  }
43
- const Xe = /\r\n|[\n\r]/g;
44
- function he(e, t) {
45
- let n = 0, r = 1;
46
- for (const i of e.body.matchAll(Xe)) {
47
- if (typeof i.index == "number" || Qe(!1), i.index >= t)
53
+ const st = /\r\n|[\n\r]/g;
54
+ function ge(e, t) {
55
+ let n = 0, i = 1;
56
+ for (const r of e.body.matchAll(st)) {
57
+ if (typeof r.index == "number" || it(!1), r.index >= t)
48
58
  break;
49
- n = i.index + i[0].length, r += 1;
59
+ n = r.index + r[0].length, i += 1;
50
60
  }
51
61
  return {
52
- line: r,
62
+ line: i,
53
63
  column: t + 1 - n
54
64
  };
55
65
  }
56
- function Ke(e) {
57
- return Ne(
66
+ function at(e) {
67
+ return ke(
58
68
  e.source,
59
- he(e.source, e.start)
69
+ ge(e.source, e.start)
60
70
  );
61
71
  }
62
- function Ne(e, t) {
63
- const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${a}:${p}
64
- `, f = r.split(/\r\n|[\n\r]/g), C = f[i];
65
- if (C.length > 120) {
66
- const y = Math.floor(p / 80), I = p % 80, g = [];
67
- for (let T = 0; T < C.length; T += 80)
68
- g.push(C.slice(T, T + 80));
69
- return h + Ie([
70
- [`${a} |`, g[0]],
71
- ...g.slice(1, y + 1).map((T) => ["|", T]),
72
- ["|", "^".padStart(I)],
73
- ["|", g[y + 1]]
72
+ function ke(e, t) {
73
+ const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, l = t.column + c, m = `${e.name}:${a}:${l}
74
+ `, f = i.split(/\r\n|[\n\r]/g), A = f[r];
75
+ if (A.length > 120) {
76
+ const C = Math.floor(l / 80), S = l % 80, I = [];
77
+ for (let y = 0; y < A.length; y += 80)
78
+ I.push(A.slice(y, y + 80));
79
+ return m + Se([
80
+ [`${a} |`, I[0]],
81
+ ...I.slice(1, C + 1).map((y) => ["|", y]),
82
+ ["|", "^".padStart(S)],
83
+ ["|", I[C + 1]]
74
84
  ]);
75
85
  }
76
- return h + Ie([
86
+ return m + Se([
77
87
  // Lines specified like this: ["prefix", "string"],
78
- [`${a - 1} |`, f[i - 1]],
79
- [`${a} |`, C],
80
- ["|", "^".padStart(p)],
81
- [`${a + 1} |`, f[i + 1]]
88
+ [`${a - 1} |`, f[r - 1]],
89
+ [`${a} |`, A],
90
+ ["|", "^".padStart(l)],
91
+ [`${a + 1} |`, f[r + 1]]
82
92
  ]);
83
93
  }
84
- function Ie(e) {
85
- const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
86
- return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
94
+ function Se(e) {
95
+ const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
96
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
87
97
  `);
88
98
  }
89
- function Ze(e) {
99
+ function ot(e) {
90
100
  const t = e[0];
91
101
  return t == null || "kind" in t || "length" in t ? {
92
102
  nodes: t,
@@ -97,7 +107,7 @@ function Ze(e) {
97
107
  extensions: e[5]
98
108
  } : t;
99
109
  }
100
- class ye extends Error {
110
+ class ve extends Error {
101
111
  /**
102
112
  * An array of `{ line, column }` locations within the source GraphQL document
103
113
  * which correspond to this error.
@@ -137,19 +147,19 @@ class ye extends Error {
137
147
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
138
148
  */
139
149
  constructor(t, ...n) {
140
- var r, i, s;
141
- const { nodes: a, source: c, positions: p, path: h, originalError: f, extensions: C } = Ze(n);
142
- super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = f ?? void 0, this.nodes = Se(
150
+ var i, r, s;
151
+ const { nodes: a, source: c, positions: l, path: m, originalError: f, extensions: A } = ot(n);
152
+ super(t), this.name = "GraphQLError", this.path = m ?? void 0, this.originalError = f ?? void 0, this.nodes = Oe(
143
153
  Array.isArray(a) ? a : a ? [a] : void 0
144
154
  );
145
- const y = Se(
146
- (r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
155
+ const C = Oe(
156
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((I) => I.loc).filter((I) => I != null)
147
157
  );
148
- this.source = c ?? (y == null || (i = y[0]) === null || i === void 0 ? void 0 : i.source), this.positions = p ?? (y == null ? void 0 : y.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : y == null ? void 0 : y.map((g) => he(g.source, g.start));
149
- const I = Je(
158
+ this.source = c ?? (C == null || (r = C[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? (C == null ? void 0 : C.map((I) => I.start)), this.locations = l && c ? l.map((I) => ge(c, I)) : C == null ? void 0 : C.map((I) => ge(I.source, I.start));
159
+ const S = rt(
150
160
  f == null ? void 0 : f.extensions
151
161
  ) ? f == null ? void 0 : f.extensions : void 0;
152
- this.extensions = (s = C ?? I) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
162
+ this.extensions = (s = A ?? S) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
153
163
  message: {
154
164
  writable: !0,
155
165
  enumerable: !0
@@ -173,7 +183,7 @@ class ye extends Error {
173
183
  value: f.stack,
174
184
  writable: !0,
175
185
  configurable: !0
176
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ye) : Object.defineProperty(this, "stack", {
186
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, ve) : Object.defineProperty(this, "stack", {
177
187
  value: Error().stack,
178
188
  writable: !0,
179
189
  configurable: !0
@@ -188,12 +198,12 @@ class ye extends Error {
188
198
  for (const n of this.nodes)
189
199
  n.loc && (t += `
190
200
 
191
- ` + Ke(n.loc));
201
+ ` + at(n.loc));
192
202
  else if (this.source && this.locations)
193
203
  for (const n of this.locations)
194
204
  t += `
195
205
 
196
- ` + Ne(this.source, n);
206
+ ` + ke(this.source, n);
197
207
  return t;
198
208
  }
199
209
  toJSON() {
@@ -203,16 +213,16 @@ class ye extends Error {
203
213
  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;
204
214
  }
205
215
  }
206
- function Se(e) {
216
+ function Oe(e) {
207
217
  return e === void 0 || e.length === 0 ? void 0 : e;
208
218
  }
209
- function P(e, t, n) {
210
- return new ye(`Syntax Error: ${n}`, {
219
+ function x(e, t, n) {
220
+ return new ve(`Syntax Error: ${n}`, {
211
221
  source: e,
212
222
  positions: [t]
213
223
  });
214
224
  }
215
- class We {
225
+ class ut {
216
226
  /**
217
227
  * The character offset at which this Node begins.
218
228
  */
@@ -228,8 +238,8 @@ class We {
228
238
  /**
229
239
  * The Source document the AST represents.
230
240
  */
231
- constructor(t, n, r) {
232
- this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
241
+ constructor(t, n, i) {
242
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
233
243
  }
234
244
  get [Symbol.toStringTag]() {
235
245
  return "Location";
@@ -241,7 +251,7 @@ class We {
241
251
  };
242
252
  }
243
253
  }
244
- class De {
254
+ class _e {
245
255
  /**
246
256
  * The kind of Token.
247
257
  */
@@ -268,8 +278,8 @@ class De {
268
278
  * including ignored tokens. <SOF> is always the first node and <EOF>
269
279
  * the last.
270
280
  */
271
- constructor(t, n, r, i, s, a) {
272
- this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
281
+ constructor(t, n, i, r, s, a) {
282
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
273
283
  }
274
284
  get [Symbol.toStringTag]() {
275
285
  return "Token";
@@ -283,16 +293,23 @@ class De {
283
293
  };
284
294
  }
285
295
  }
286
- const be = {
296
+ const Le = {
287
297
  Name: [],
288
298
  Document: ["definitions"],
289
299
  OperationDefinition: [
300
+ "description",
290
301
  "name",
291
302
  "variableDefinitions",
292
303
  "directives",
293
304
  "selectionSet"
294
305
  ],
295
- VariableDefinition: ["variable", "type", "defaultValue", "directives"],
306
+ VariableDefinition: [
307
+ "description",
308
+ "variable",
309
+ "type",
310
+ "defaultValue",
311
+ "directives"
312
+ ],
296
313
  Variable: ["name"],
297
314
  SelectionSet: ["selections"],
298
315
  Field: ["alias", "name", "arguments", "directives", "selectionSet"],
@@ -300,6 +317,7 @@ const be = {
300
317
  FragmentSpread: ["name", "directives"],
301
318
  InlineFragment: ["typeCondition", "directives", "selectionSet"],
302
319
  FragmentDefinition: [
320
+ "description",
303
321
  "name",
304
322
  // Note: fragment variable definitions are deprecated and will removed in v17.0.0
305
323
  "variableDefinitions",
@@ -356,73 +374,80 @@ const be = {
356
374
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
357
375
  UnionTypeExtension: ["name", "directives", "types"],
358
376
  EnumTypeExtension: ["name", "directives", "values"],
359
- InputObjectTypeExtension: ["name", "directives", "fields"]
360
- }, et = new Set(Object.keys(be));
361
- function Te(e) {
377
+ InputObjectTypeExtension: ["name", "directives", "fields"],
378
+ TypeCoordinate: ["name"],
379
+ MemberCoordinate: ["name", "memberName"],
380
+ ArgumentCoordinate: ["name", "fieldName", "argumentName"],
381
+ DirectiveCoordinate: ["name"],
382
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
383
+ }, ct = new Set(Object.keys(Le));
384
+ function Re(e) {
362
385
  const t = e == null ? void 0 : e.kind;
363
- return typeof t == "string" && et.has(t);
386
+ return typeof t == "string" && ct.has(t);
364
387
  }
365
- var q;
388
+ var V;
366
389
  (function(e) {
367
390
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
368
- })(q || (q = {}));
369
- var me;
391
+ })(V || (V = {}));
392
+ var Ce;
370
393
  (function(e) {
371
394
  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";
372
- })(me || (me = {}));
373
- var m;
395
+ })(Ce || (Ce = {}));
396
+ var h;
374
397
  (function(e) {
375
- 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";
376
- })(m || (m = {}));
377
- function fe(e) {
398
+ e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
399
+ })(h || (h = {}));
400
+ function ye(e) {
378
401
  return e === 9 || e === 32;
379
402
  }
380
- function Y(e) {
403
+ function Q(e) {
381
404
  return e >= 48 && e <= 57;
382
405
  }
383
- function ke(e) {
406
+ function we(e) {
384
407
  return e >= 97 && e <= 122 || // A-Z
385
408
  e >= 65 && e <= 90;
386
409
  }
387
- function _e(e) {
388
- return ke(e) || e === 95;
410
+ function Me(e) {
411
+ return we(e) || e === 95;
389
412
  }
390
- function tt(e) {
391
- return ke(e) || Y(e) || e === 95;
413
+ function dt(e) {
414
+ return we(e) || Q(e) || e === 95;
392
415
  }
393
- function nt(e) {
416
+ function lt(e) {
394
417
  var t;
395
- let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
418
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
396
419
  for (let a = 0; a < e.length; ++a) {
397
420
  var s;
398
- const c = e[a], p = it(c);
399
- p !== c.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && p < n && (n = p));
421
+ const c = e[a], l = pt(c);
422
+ l !== c.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && l < n && (n = l));
400
423
  }
401
424
  return e.map((a, c) => c === 0 ? a : a.slice(n)).slice(
402
- (t = r) !== null && t !== void 0 ? t : 0,
403
- i + 1
425
+ (t = i) !== null && t !== void 0 ? t : 0,
426
+ r + 1
404
427
  );
405
428
  }
406
- function it(e) {
429
+ function pt(e) {
407
430
  let t = 0;
408
- for (; t < e.length && fe(e.charCodeAt(t)); )
431
+ for (; t < e.length && ye(e.charCodeAt(t)); )
409
432
  ++t;
410
433
  return t;
411
434
  }
412
- function rt(e, t) {
413
- const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((I) => I.length === 0 || fe(I.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, p = e.endsWith("\\"), h = c || p, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
414
- (!i || e.length > 70 || h || s || a);
415
- let C = "";
416
- const y = i && fe(e.charCodeAt(0));
417
- return (f && !y || s) && (C += `
418
- `), C += n, (f || h) && (C += `
419
- `), '"""' + C + '"""';
435
+ function ht(e, t) {
436
+ 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((S) => S.length === 0 || ye(S.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, l = e.endsWith("\\"), m = c || l, f = (
437
+ // add leading and trailing new lines only if it improves readability
438
+ !r || e.length > 70 || m || s || a
439
+ );
440
+ let A = "";
441
+ const C = r && ye(e.charCodeAt(0));
442
+ return (f && !C || s) && (A += `
443
+ `), A += n, (f || m) && (A += `
444
+ `), '"""' + A + '"""';
420
445
  }
421
446
  var u;
422
447
  (function(e) {
423
- 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";
448
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
424
449
  })(u || (u = {}));
425
- class st {
450
+ class mt {
426
451
  /**
427
452
  * The previously focused non-ignored token.
428
453
  */
@@ -436,7 +461,7 @@ class st {
436
461
  * The character offset at which the current line begins.
437
462
  */
438
463
  constructor(t) {
439
- const n = new De(u.SOF, 0, 0, 0, 0);
464
+ const n = new _e(u.SOF, 0, 0, 0, 0);
440
465
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
441
466
  }
442
467
  get [Symbol.toStringTag]() {
@@ -459,261 +484,292 @@ class st {
459
484
  if (t.next)
460
485
  t = t.next;
461
486
  else {
462
- const n = ot(this, t.end);
487
+ const n = gt(this, t.end);
463
488
  t.next = n, n.prev = t, t = n;
464
489
  }
465
490
  while (t.kind === u.COMMENT);
466
491
  return t;
467
492
  }
468
493
  }
469
- function at(e) {
470
- return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
494
+ function ft(e) {
495
+ return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.DOT || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
471
496
  }
472
497
  function G(e) {
473
498
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
474
499
  }
475
- function se(e, t) {
476
- return Le(e.charCodeAt(t)) && we(e.charCodeAt(t + 1));
500
+ function oe(e, t) {
501
+ return qe(e.charCodeAt(t)) && Fe(e.charCodeAt(t + 1));
477
502
  }
478
- function Le(e) {
503
+ function qe(e) {
479
504
  return e >= 55296 && e <= 56319;
480
505
  }
481
- function we(e) {
506
+ function Fe(e) {
482
507
  return e >= 56320 && e <= 57343;
483
508
  }
484
- function M(e, t) {
509
+ function F(e, t) {
485
510
  const n = e.source.body.codePointAt(t);
486
511
  if (n === void 0)
487
512
  return u.EOF;
488
513
  if (n >= 32 && n <= 126) {
489
- const r = String.fromCodePoint(n);
490
- return r === '"' ? `'"'` : `"${r}"`;
514
+ const i = String.fromCodePoint(n);
515
+ return i === '"' ? `'"'` : `"${i}"`;
491
516
  }
492
517
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
493
518
  }
494
- function x(e, t, n, r, i) {
519
+ function R(e, t, n, i, r) {
495
520
  const s = e.line, a = 1 + n - e.lineStart;
496
- return new De(t, n, r, s, a, i);
521
+ return new _e(t, n, i, s, a, r);
497
522
  }
498
- function ot(e, t) {
499
- const n = e.source.body, r = n.length;
500
- let i = t;
501
- for (; i < r; ) {
502
- const s = n.charCodeAt(i);
523
+ function gt(e, t) {
524
+ const n = e.source.body, i = n.length;
525
+ let r = t;
526
+ for (; r < i; ) {
527
+ const s = n.charCodeAt(r);
503
528
  switch (s) {
529
+ // Ignored ::
530
+ // - UnicodeBOM
531
+ // - WhiteSpace
532
+ // - LineTerminator
533
+ // - Comment
534
+ // - Comma
535
+ //
536
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
537
+ //
538
+ // WhiteSpace ::
539
+ // - "Horizontal Tab (U+0009)"
540
+ // - "Space (U+0020)"
541
+ //
542
+ // Comma :: ,
504
543
  case 65279:
544
+ // <BOM>
505
545
  case 9:
546
+ // \t
506
547
  case 32:
548
+ // <space>
507
549
  case 44:
508
- ++i;
550
+ ++r;
509
551
  continue;
552
+ // LineTerminator ::
553
+ // - "New Line (U+000A)"
554
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
555
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
510
556
  case 10:
511
- ++i, ++e.line, e.lineStart = i;
557
+ ++r, ++e.line, e.lineStart = r;
512
558
  continue;
513
559
  case 13:
514
- n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
560
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
515
561
  continue;
562
+ // Comment
516
563
  case 35:
517
- return ut(e, i);
564
+ return Ct(e, r);
565
+ // Token ::
566
+ // - Punctuator
567
+ // - Name
568
+ // - IntValue
569
+ // - FloatValue
570
+ // - StringValue
571
+ //
572
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
518
573
  case 33:
519
- return x(e, u.BANG, i, i + 1);
574
+ return R(e, u.BANG, r, r + 1);
520
575
  case 36:
521
- return x(e, u.DOLLAR, i, i + 1);
576
+ return R(e, u.DOLLAR, r, r + 1);
522
577
  case 38:
523
- return x(e, u.AMP, i, i + 1);
578
+ return R(e, u.AMP, r, r + 1);
524
579
  case 40:
525
- return x(e, u.PAREN_L, i, i + 1);
580
+ return R(e, u.PAREN_L, r, r + 1);
526
581
  case 41:
527
- return x(e, u.PAREN_R, i, i + 1);
582
+ return R(e, u.PAREN_R, r, r + 1);
528
583
  case 46:
529
- if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
530
- return x(e, u.SPREAD, i, i + 3);
584
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
585
+ return R(e, u.SPREAD, r, r + 3);
531
586
  break;
532
587
  case 58:
533
- return x(e, u.COLON, i, i + 1);
588
+ return R(e, u.COLON, r, r + 1);
534
589
  case 61:
535
- return x(e, u.EQUALS, i, i + 1);
590
+ return R(e, u.EQUALS, r, r + 1);
536
591
  case 64:
537
- return x(e, u.AT, i, i + 1);
592
+ return R(e, u.AT, r, r + 1);
538
593
  case 91:
539
- return x(e, u.BRACKET_L, i, i + 1);
594
+ return R(e, u.BRACKET_L, r, r + 1);
540
595
  case 93:
541
- return x(e, u.BRACKET_R, i, i + 1);
596
+ return R(e, u.BRACKET_R, r, r + 1);
542
597
  case 123:
543
- return x(e, u.BRACE_L, i, i + 1);
598
+ return R(e, u.BRACE_L, r, r + 1);
544
599
  case 124:
545
- return x(e, u.PIPE, i, i + 1);
600
+ return R(e, u.PIPE, r, r + 1);
546
601
  case 125:
547
- return x(e, u.BRACE_R, i, i + 1);
602
+ return R(e, u.BRACE_R, r, r + 1);
603
+ // StringValue
548
604
  case 34:
549
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? mt(e, i) : lt(e, i);
605
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? It(e, r) : Et(e, r);
550
606
  }
551
- if (Y(s) || s === 45)
552
- return ct(e, i, s);
553
- if (_e(s))
554
- return ft(e, i);
555
- throw P(
607
+ if (Q(s) || s === 45)
608
+ return yt(e, r, s);
609
+ if (Me(s))
610
+ return Pt(e, r);
611
+ throw x(
556
612
  e.source,
557
- i,
558
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, i) ? `Unexpected character: ${M(e, i)}.` : `Invalid character: ${M(e, i)}.`
613
+ r,
614
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || oe(n, r) ? `Unexpected character: ${F(e, r)}.` : `Invalid character: ${F(e, r)}.`
559
615
  );
560
616
  }
561
- return x(e, u.EOF, r, r);
617
+ return R(e, u.EOF, i, i);
562
618
  }
563
- function ut(e, t) {
564
- const n = e.source.body, r = n.length;
565
- let i = t + 1;
566
- for (; i < r; ) {
567
- const s = n.charCodeAt(i);
619
+ function Ct(e, t) {
620
+ const n = e.source.body, i = n.length;
621
+ let r = t + 1;
622
+ for (; r < i; ) {
623
+ const s = n.charCodeAt(r);
568
624
  if (s === 10 || s === 13)
569
625
  break;
570
626
  if (G(s))
571
- ++i;
572
- else if (se(n, i))
573
- i += 2;
627
+ ++r;
628
+ else if (oe(n, r))
629
+ r += 2;
574
630
  else
575
631
  break;
576
632
  }
577
- return x(
633
+ return R(
578
634
  e,
579
635
  u.COMMENT,
580
636
  t,
581
- i,
582
- n.slice(t + 1, i)
637
+ r,
638
+ n.slice(t + 1, r)
583
639
  );
584
640
  }
585
- function ct(e, t, n) {
586
- const r = e.source.body;
587
- let i = t, s = n, a = !1;
588
- if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
589
- if (s = r.charCodeAt(++i), Y(s))
590
- throw P(
641
+ function yt(e, t, n) {
642
+ const i = e.source.body;
643
+ let r = t, s = n, a = !1;
644
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
645
+ if (s = i.charCodeAt(++r), Q(s))
646
+ throw x(
591
647
  e.source,
592
- i,
593
- `Invalid number, unexpected digit after 0: ${M(
648
+ r,
649
+ `Invalid number, unexpected digit after 0: ${F(
594
650
  e,
595
- i
651
+ r
596
652
  )}.`
597
653
  );
598
654
  } else
599
- i = ce(e, i, s), s = r.charCodeAt(i);
600
- if (s === 46 && (a = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ce(e, i, s), s = r.charCodeAt(i)), s === 46 || _e(s))
601
- throw P(
655
+ r = le(e, r, s), s = i.charCodeAt(r);
656
+ if (s === 46 && (a = !0, s = i.charCodeAt(++r), r = le(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = le(e, r, s), s = i.charCodeAt(r)), s === 46 || Me(s))
657
+ throw x(
602
658
  e.source,
603
- i,
604
- `Invalid number, expected digit but got: ${M(
659
+ r,
660
+ `Invalid number, expected digit but got: ${F(
605
661
  e,
606
- i
662
+ r
607
663
  )}.`
608
664
  );
609
- return x(
665
+ return R(
610
666
  e,
611
667
  a ? u.FLOAT : u.INT,
612
668
  t,
613
- i,
614
- r.slice(t, i)
669
+ r,
670
+ i.slice(t, r)
615
671
  );
616
672
  }
617
- function ce(e, t, n) {
618
- if (!Y(n))
619
- throw P(
673
+ function le(e, t, n) {
674
+ if (!Q(n))
675
+ throw x(
620
676
  e.source,
621
677
  t,
622
- `Invalid number, expected digit but got: ${M(
678
+ `Invalid number, expected digit but got: ${F(
623
679
  e,
624
680
  t
625
681
  )}.`
626
682
  );
627
- const r = e.source.body;
628
- let i = t + 1;
629
- for (; Y(r.charCodeAt(i)); )
630
- ++i;
631
- return i;
683
+ const i = e.source.body;
684
+ let r = t + 1;
685
+ for (; Q(i.charCodeAt(r)); )
686
+ ++r;
687
+ return r;
632
688
  }
633
- function lt(e, t) {
634
- const n = e.source.body, r = n.length;
635
- let i = t + 1, s = i, a = "";
636
- for (; i < r; ) {
637
- const c = n.charCodeAt(i);
689
+ function Et(e, t) {
690
+ const n = e.source.body, i = n.length;
691
+ let r = t + 1, s = r, a = "";
692
+ for (; r < i; ) {
693
+ const c = n.charCodeAt(r);
638
694
  if (c === 34)
639
- return a += n.slice(s, i), x(e, u.STRING, t, i + 1, a);
695
+ return a += n.slice(s, r), R(e, u.STRING, t, r + 1, a);
640
696
  if (c === 92) {
641
- a += n.slice(s, i);
642
- const p = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : pt(e, i) : ht(e, i);
643
- a += p.value, i += p.size, s = i;
697
+ a += n.slice(s, r);
698
+ const l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? At(e, r) : vt(e, r) : Tt(e, r);
699
+ a += l.value, r += l.size, s = r;
644
700
  continue;
645
701
  }
646
702
  if (c === 10 || c === 13)
647
703
  break;
648
704
  if (G(c))
649
- ++i;
650
- else if (se(n, i))
651
- i += 2;
705
+ ++r;
706
+ else if (oe(n, r))
707
+ r += 2;
652
708
  else
653
- throw P(
709
+ throw x(
654
710
  e.source,
655
- i,
656
- `Invalid character within String: ${M(
711
+ r,
712
+ `Invalid character within String: ${F(
657
713
  e,
658
- i
714
+ r
659
715
  )}.`
660
716
  );
661
717
  }
662
- throw P(e.source, i, "Unterminated string.");
718
+ throw x(e.source, r, "Unterminated string.");
663
719
  }
664
- function dt(e, t) {
720
+ function At(e, t) {
665
721
  const n = e.source.body;
666
- let r = 0, i = 3;
667
- for (; i < 12; ) {
668
- const s = n.charCodeAt(t + i++);
722
+ let i = 0, r = 3;
723
+ for (; r < 12; ) {
724
+ const s = n.charCodeAt(t + r++);
669
725
  if (s === 125) {
670
- if (i < 5 || !G(r))
726
+ if (r < 5 || !G(i))
671
727
  break;
672
728
  return {
673
- value: String.fromCodePoint(r),
674
- size: i
729
+ value: String.fromCodePoint(i),
730
+ size: r
675
731
  };
676
732
  }
677
- if (r = r << 4 | j(s), r < 0)
733
+ if (i = i << 4 | H(s), i < 0)
678
734
  break;
679
735
  }
680
- throw P(
736
+ throw x(
681
737
  e.source,
682
738
  t,
683
739
  `Invalid Unicode escape sequence: "${n.slice(
684
740
  t,
685
- t + i
741
+ t + r
686
742
  )}".`
687
743
  );
688
744
  }
689
- function pt(e, t) {
690
- const n = e.source.body, r = xe(n, t + 2);
691
- if (G(r))
745
+ function vt(e, t) {
746
+ const n = e.source.body, i = xe(n, t + 2);
747
+ if (G(i))
692
748
  return {
693
- value: String.fromCodePoint(r),
749
+ value: String.fromCodePoint(i),
694
750
  size: 6
695
751
  };
696
- if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
697
- const i = xe(n, t + 8);
698
- if (we(i))
752
+ if (qe(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
753
+ const r = xe(n, t + 8);
754
+ if (Fe(r))
699
755
  return {
700
- value: String.fromCodePoint(r, i),
756
+ value: String.fromCodePoint(i, r),
701
757
  size: 12
702
758
  };
703
759
  }
704
- throw P(
760
+ throw x(
705
761
  e.source,
706
762
  t,
707
763
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
708
764
  );
709
765
  }
710
766
  function xe(e, t) {
711
- return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
767
+ return H(e.charCodeAt(t)) << 12 | H(e.charCodeAt(t + 1)) << 8 | H(e.charCodeAt(t + 2)) << 4 | H(e.charCodeAt(t + 3));
712
768
  }
713
- function j(e) {
769
+ function H(e) {
714
770
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
715
771
  }
716
- function ht(e, t) {
772
+ function Tt(e, t) {
717
773
  const n = e.source.body;
718
774
  switch (n.charCodeAt(t + 1)) {
719
775
  case 34:
@@ -758,7 +814,7 @@ function ht(e, t) {
758
814
  size: 2
759
815
  };
760
816
  }
761
- throw P(
817
+ throw x(
762
818
  e.source,
763
819
  t,
764
820
  `Invalid character escape sequence: "${n.slice(
@@ -767,117 +823,117 @@ function ht(e, t) {
767
823
  )}".`
768
824
  );
769
825
  }
770
- function mt(e, t) {
771
- const n = e.source.body, r = n.length;
772
- let i = e.lineStart, s = t + 3, a = s, c = "";
773
- const p = [];
774
- for (; s < r; ) {
775
- const h = n.charCodeAt(s);
776
- if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
777
- c += n.slice(a, s), p.push(c);
778
- const f = x(
826
+ function It(e, t) {
827
+ const n = e.source.body, i = n.length;
828
+ let r = e.lineStart, s = t + 3, a = s, c = "";
829
+ const l = [];
830
+ for (; s < i; ) {
831
+ const m = n.charCodeAt(s);
832
+ if (m === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
833
+ c += n.slice(a, s), l.push(c);
834
+ const f = R(
779
835
  e,
780
836
  u.BLOCK_STRING,
781
837
  t,
782
838
  s + 3,
783
839
  // Return a string of the lines joined with U+000A.
784
- nt(p).join(`
840
+ lt(l).join(`
785
841
  `)
786
842
  );
787
- return e.line += p.length - 1, e.lineStart = i, f;
843
+ return e.line += l.length - 1, e.lineStart = r, f;
788
844
  }
789
- if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
845
+ if (m === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
790
846
  c += n.slice(a, s), a = s + 1, s += 4;
791
847
  continue;
792
848
  }
793
- if (h === 10 || h === 13) {
794
- c += n.slice(a, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, i = s;
849
+ if (m === 10 || m === 13) {
850
+ c += n.slice(a, s), l.push(c), m === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", a = s, r = s;
795
851
  continue;
796
852
  }
797
- if (G(h))
853
+ if (G(m))
798
854
  ++s;
799
- else if (se(n, s))
855
+ else if (oe(n, s))
800
856
  s += 2;
801
857
  else
802
- throw P(
858
+ throw x(
803
859
  e.source,
804
860
  s,
805
- `Invalid character within String: ${M(
861
+ `Invalid character within String: ${F(
806
862
  e,
807
863
  s
808
864
  )}.`
809
865
  );
810
866
  }
811
- throw P(e.source, s, "Unterminated string.");
867
+ throw x(e.source, s, "Unterminated string.");
812
868
  }
813
- function ft(e, t) {
814
- const n = e.source.body, r = n.length;
815
- let i = t + 1;
816
- for (; i < r; ) {
817
- const s = n.charCodeAt(i);
818
- if (tt(s))
819
- ++i;
869
+ function Pt(e, t) {
870
+ const n = e.source.body, i = n.length;
871
+ let r = t + 1;
872
+ for (; r < i; ) {
873
+ const s = n.charCodeAt(r);
874
+ if (dt(s))
875
+ ++r;
820
876
  else
821
877
  break;
822
878
  }
823
- return x(
879
+ return R(
824
880
  e,
825
881
  u.NAME,
826
882
  t,
827
- i,
828
- n.slice(t, i)
883
+ r,
884
+ n.slice(t, r)
829
885
  );
830
886
  }
831
- const gt = 10, Me = 2;
832
- function Ee(e) {
833
- return ae(e, []);
887
+ const St = 10, Be = 2;
888
+ function Te(e) {
889
+ return ue(e, []);
834
890
  }
835
- function ae(e, t) {
891
+ function ue(e, t) {
836
892
  switch (typeof e) {
837
893
  case "string":
838
894
  return JSON.stringify(e);
839
895
  case "function":
840
896
  return e.name ? `[function ${e.name}]` : "[function]";
841
897
  case "object":
842
- return Ct(e, t);
898
+ return Ot(e, t);
843
899
  default:
844
900
  return String(e);
845
901
  }
846
902
  }
847
- function Ct(e, t) {
903
+ function Ot(e, t) {
848
904
  if (e === null)
849
905
  return "null";
850
906
  if (t.includes(e))
851
907
  return "[Circular]";
852
908
  const n = [...t, e];
853
- if (yt(e)) {
854
- const r = e.toJSON();
855
- if (r !== e)
856
- return typeof r == "string" ? r : ae(r, n);
909
+ if (Rt(e)) {
910
+ const i = e.toJSON();
911
+ if (i !== e)
912
+ return typeof i == "string" ? i : ue(i, n);
857
913
  } else if (Array.isArray(e))
858
- return At(e, n);
859
- return Et(e, n);
914
+ return Dt(e, n);
915
+ return xt(e, n);
860
916
  }
861
- function yt(e) {
917
+ function Rt(e) {
862
918
  return typeof e.toJSON == "function";
863
919
  }
864
- function Et(e, t) {
920
+ function xt(e, t) {
865
921
  const n = Object.entries(e);
866
- return n.length === 0 ? "{}" : t.length > Me ? "[" + vt(e) + "]" : "{ " + n.map(
867
- ([i, s]) => i + ": " + ae(s, t)
922
+ return n.length === 0 ? "{}" : t.length > Be ? "[" + Nt(e) + "]" : "{ " + n.map(
923
+ ([r, s]) => r + ": " + ue(s, t)
868
924
  ).join(", ") + " }";
869
925
  }
870
- function At(e, t) {
926
+ function Dt(e, t) {
871
927
  if (e.length === 0)
872
928
  return "[]";
873
- if (t.length > Me)
929
+ if (t.length > Be)
874
930
  return "[Array]";
875
- const n = Math.min(gt, e.length), r = e.length - n, i = [];
931
+ const n = Math.min(St, e.length), i = e.length - n, r = [];
876
932
  for (let s = 0; s < n; ++s)
877
- i.push(ae(e[s], t));
878
- return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
933
+ r.push(ue(e[s], t));
934
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
879
935
  }
880
- function vt(e) {
936
+ function Nt(e) {
881
937
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
882
938
  if (t === "Object" && typeof e.constructor == "function") {
883
939
  const n = e.constructor.name;
@@ -886,23 +942,24 @@ function vt(e) {
886
942
  }
887
943
  return t;
888
944
  }
889
- const It = (
945
+ const bt = globalThis.process && // eslint-disable-next-line no-undef
946
+ process.env.NODE_ENV === "production", kt = (
890
947
  /* c8 ignore next 6 */
891
948
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
892
- globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
949
+ bt ? function(t, n) {
893
950
  return t instanceof n;
894
951
  } : function(t, n) {
895
952
  if (t instanceof n)
896
953
  return !0;
897
954
  if (typeof t == "object" && t !== null) {
898
- var r;
899
- const i = n.prototype[Symbol.toStringTag], s = (
955
+ var i;
956
+ const r = n.prototype[Symbol.toStringTag], s = (
900
957
  // We still need to support constructor's name to detect conflicts with older versions of this library.
901
- Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
958
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
902
959
  );
903
- if (i === s) {
904
- const a = Ee(t);
905
- throw new Error(`Cannot use ${i} "${a}" from another module or realm.
960
+ if (r === s) {
961
+ const a = Te(t);
962
+ throw new Error(`Cannot use ${r} "${a}" from another module or realm.
906
963
 
907
964
  Ensure that there is only one instance of "graphql" in the node_modules
908
965
  directory. If different versions of "graphql" are the dependencies of other
@@ -919,15 +976,15 @@ spurious results.`);
919
976
  return !1;
920
977
  }
921
978
  );
922
- class Fe {
923
- constructor(t, n = "GraphQL request", r = {
979
+ class Ue {
980
+ constructor(t, n = "GraphQL request", i = {
924
981
  line: 1,
925
982
  column: 1
926
983
  }) {
927
- typeof t == "string" || Z(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Z(
984
+ typeof t == "string" || ee(!1, `Body must be a string. Received: ${Te(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || ee(
928
985
  !1,
929
986
  "line in locationOffset is 1-indexed and must be positive."
930
- ), this.locationOffset.column > 0 || Z(
987
+ ), this.locationOffset.column > 0 || ee(
931
988
  !1,
932
989
  "column in locationOffset is 1-indexed and must be positive."
933
990
  );
@@ -936,16 +993,29 @@ class Fe {
936
993
  return "Source";
937
994
  }
938
995
  }
939
- function St(e) {
940
- return It(e, Fe);
996
+ function _t(e) {
997
+ return kt(e, Ue);
941
998
  }
942
- function Be(e, t) {
943
- return new Tt(e, t).parseDocument();
999
+ function Ve(e, t) {
1000
+ const n = new Lt(e, t), i = n.parseDocument();
1001
+ return Object.defineProperty(i, "tokenCount", {
1002
+ enumerable: !1,
1003
+ value: n.tokenCount
1004
+ }), i;
944
1005
  }
945
- class Tt {
1006
+ class Lt {
946
1007
  constructor(t, n = {}) {
947
- const r = St(t) ? t : new Fe(t);
948
- this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
1008
+ const { lexer: i, ...r } = n;
1009
+ if (i)
1010
+ this._lexer = i;
1011
+ else {
1012
+ const s = _t(t) ? t : new Ue(t);
1013
+ this._lexer = new mt(s);
1014
+ }
1015
+ this._options = r, this._tokenCounter = 0;
1016
+ }
1017
+ get tokenCount() {
1018
+ return this._tokenCounter;
949
1019
  }
950
1020
  /**
951
1021
  * Converts a name lex token into a name parse node.
@@ -953,7 +1023,7 @@ class Tt {
953
1023
  parseName() {
954
1024
  const t = this.expectToken(u.NAME);
955
1025
  return this.node(t, {
956
- kind: m.NAME,
1026
+ kind: h.NAME,
957
1027
  value: t.value
958
1028
  });
959
1029
  }
@@ -963,7 +1033,7 @@ class Tt {
963
1033
  */
964
1034
  parseDocument() {
965
1035
  return this.node(this._lexer.token, {
966
- kind: m.DOCUMENT,
1036
+ kind: h.DOCUMENT,
967
1037
  definitions: this.many(
968
1038
  u.SOF,
969
1039
  this.parseDefinition,
@@ -998,6 +1068,12 @@ class Tt {
998
1068
  if (this.peek(u.BRACE_L))
999
1069
  return this.parseOperationDefinition();
1000
1070
  const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1071
+ if (t && n.kind === u.BRACE_L)
1072
+ throw x(
1073
+ this._lexer.source,
1074
+ this._lexer.token.start,
1075
+ "Unexpected description, descriptions are not supported on shorthand queries."
1076
+ );
1001
1077
  if (n.kind === u.NAME) {
1002
1078
  switch (n.value) {
1003
1079
  case "schema":
@@ -1017,12 +1093,6 @@ class Tt {
1017
1093
  case "directive":
1018
1094
  return this.parseDirectiveDefinition();
1019
1095
  }
1020
- if (t)
1021
- throw P(
1022
- this._lexer.source,
1023
- this._lexer.token.start,
1024
- "Unexpected description, descriptions are supported only on type definitions."
1025
- );
1026
1096
  switch (n.value) {
1027
1097
  case "query":
1028
1098
  case "mutation":
@@ -1030,6 +1100,14 @@ class Tt {
1030
1100
  return this.parseOperationDefinition();
1031
1101
  case "fragment":
1032
1102
  return this.parseFragmentDefinition();
1103
+ }
1104
+ if (t)
1105
+ throw x(
1106
+ this._lexer.source,
1107
+ this._lexer.token.start,
1108
+ "Unexpected description, only GraphQL definitions support descriptions."
1109
+ );
1110
+ switch (n.value) {
1033
1111
  case "extend":
1034
1112
  return this.parseTypeSystemExtension();
1035
1113
  }
@@ -1046,18 +1124,20 @@ class Tt {
1046
1124
  const t = this._lexer.token;
1047
1125
  if (this.peek(u.BRACE_L))
1048
1126
  return this.node(t, {
1049
- kind: m.OPERATION_DEFINITION,
1050
- operation: q.QUERY,
1127
+ kind: h.OPERATION_DEFINITION,
1128
+ operation: V.QUERY,
1129
+ description: void 0,
1051
1130
  name: void 0,
1052
1131
  variableDefinitions: [],
1053
1132
  directives: [],
1054
1133
  selectionSet: this.parseSelectionSet()
1055
1134
  });
1056
- const n = this.parseOperationType();
1135
+ const n = this.parseDescription(), i = this.parseOperationType();
1057
1136
  let r;
1058
1137
  return this.peek(u.NAME) && (r = this.parseName()), this.node(t, {
1059
- kind: m.OPERATION_DEFINITION,
1060
- operation: n,
1138
+ kind: h.OPERATION_DEFINITION,
1139
+ operation: i,
1140
+ description: n,
1061
1141
  name: r,
1062
1142
  variableDefinitions: this.parseVariableDefinitions(),
1063
1143
  directives: this.parseDirectives(!1),
@@ -1071,11 +1151,11 @@ class Tt {
1071
1151
  const t = this.expectToken(u.NAME);
1072
1152
  switch (t.value) {
1073
1153
  case "query":
1074
- return q.QUERY;
1154
+ return V.QUERY;
1075
1155
  case "mutation":
1076
- return q.MUTATION;
1156
+ return V.MUTATION;
1077
1157
  case "subscription":
1078
- return q.SUBSCRIPTION;
1158
+ return V.SUBSCRIPTION;
1079
1159
  }
1080
1160
  throw this.unexpected(t);
1081
1161
  }
@@ -1094,7 +1174,8 @@ class Tt {
1094
1174
  */
1095
1175
  parseVariableDefinition() {
1096
1176
  return this.node(this._lexer.token, {
1097
- kind: m.VARIABLE_DEFINITION,
1177
+ kind: h.VARIABLE_DEFINITION,
1178
+ description: this.parseDescription(),
1098
1179
  variable: this.parseVariable(),
1099
1180
  type: (this.expectToken(u.COLON), this.parseTypeReference()),
1100
1181
  defaultValue: this.expectOptionalToken(u.EQUALS) ? this.parseConstValueLiteral() : void 0,
@@ -1107,7 +1188,7 @@ class Tt {
1107
1188
  parseVariable() {
1108
1189
  const t = this._lexer.token;
1109
1190
  return this.expectToken(u.DOLLAR), this.node(t, {
1110
- kind: m.VARIABLE,
1191
+ kind: h.VARIABLE,
1111
1192
  name: this.parseName()
1112
1193
  });
1113
1194
  }
@@ -1118,7 +1199,7 @@ class Tt {
1118
1199
  */
1119
1200
  parseSelectionSet() {
1120
1201
  return this.node(this._lexer.token, {
1121
- kind: m.SELECTION_SET,
1202
+ kind: h.SELECTION_SET,
1122
1203
  selections: this.many(
1123
1204
  u.BRACE_L,
1124
1205
  this.parseSelection,
@@ -1142,11 +1223,11 @@ class Tt {
1142
1223
  */
1143
1224
  parseField() {
1144
1225
  const t = this._lexer.token, n = this.parseName();
1145
- let r, i;
1146
- return this.expectOptionalToken(u.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1147
- kind: m.FIELD,
1148
- alias: r,
1149
- name: i,
1226
+ let i, r;
1227
+ return this.expectOptionalToken(u.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1228
+ kind: h.FIELD,
1229
+ alias: i,
1230
+ name: r,
1150
1231
  arguments: this.parseArguments(!1),
1151
1232
  directives: this.parseDirectives(!1),
1152
1233
  selectionSet: this.peek(u.BRACE_L) ? this.parseSelectionSet() : void 0
@@ -1163,10 +1244,10 @@ class Tt {
1163
1244
  * Argument[Const] : Name : Value[?Const]
1164
1245
  */
1165
1246
  parseArgument(t = !1) {
1166
- const n = this._lexer.token, r = this.parseName();
1247
+ const n = this._lexer.token, i = this.parseName();
1167
1248
  return this.expectToken(u.COLON), this.node(n, {
1168
- kind: m.ARGUMENT,
1169
- name: r,
1249
+ kind: h.ARGUMENT,
1250
+ name: i,
1170
1251
  value: this.parseValueLiteral(t)
1171
1252
  });
1172
1253
  }
@@ -1186,11 +1267,11 @@ class Tt {
1186
1267
  this.expectToken(u.SPREAD);
1187
1268
  const n = this.expectOptionalKeyword("on");
1188
1269
  return !n && this.peek(u.NAME) ? this.node(t, {
1189
- kind: m.FRAGMENT_SPREAD,
1270
+ kind: h.FRAGMENT_SPREAD,
1190
1271
  name: this.parseFragmentName(),
1191
1272
  directives: this.parseDirectives(!1)
1192
1273
  }) : this.node(t, {
1193
- kind: m.INLINE_FRAGMENT,
1274
+ kind: h.INLINE_FRAGMENT,
1194
1275
  typeCondition: n ? this.parseNamedType() : void 0,
1195
1276
  directives: this.parseDirectives(!1),
1196
1277
  selectionSet: this.parseSelectionSet()
@@ -1203,16 +1284,18 @@ class Tt {
1203
1284
  * TypeCondition : NamedType
1204
1285
  */
1205
1286
  parseFragmentDefinition() {
1206
- const t = this._lexer.token;
1287
+ const t = this._lexer.token, n = this.parseDescription();
1207
1288
  return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1208
- kind: m.FRAGMENT_DEFINITION,
1289
+ kind: h.FRAGMENT_DEFINITION,
1290
+ description: n,
1209
1291
  name: this.parseFragmentName(),
1210
1292
  variableDefinitions: this.parseVariableDefinitions(),
1211
1293
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1212
1294
  directives: this.parseDirectives(!1),
1213
1295
  selectionSet: this.parseSelectionSet()
1214
1296
  }) : this.node(t, {
1215
- kind: m.FRAGMENT_DEFINITION,
1297
+ kind: h.FRAGMENT_DEFINITION,
1298
+ description: n,
1216
1299
  name: this.parseFragmentName(),
1217
1300
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1218
1301
  directives: this.parseDirectives(!1),
@@ -1255,12 +1338,12 @@ class Tt {
1255
1338
  return this.parseObject(t);
1256
1339
  case u.INT:
1257
1340
  return this.advanceLexer(), this.node(n, {
1258
- kind: m.INT,
1341
+ kind: h.INT,
1259
1342
  value: n.value
1260
1343
  });
1261
1344
  case u.FLOAT:
1262
1345
  return this.advanceLexer(), this.node(n, {
1263
- kind: m.FLOAT,
1346
+ kind: h.FLOAT,
1264
1347
  value: n.value
1265
1348
  });
1266
1349
  case u.STRING:
@@ -1270,32 +1353,32 @@ class Tt {
1270
1353
  switch (this.advanceLexer(), n.value) {
1271
1354
  case "true":
1272
1355
  return this.node(n, {
1273
- kind: m.BOOLEAN,
1356
+ kind: h.BOOLEAN,
1274
1357
  value: !0
1275
1358
  });
1276
1359
  case "false":
1277
1360
  return this.node(n, {
1278
- kind: m.BOOLEAN,
1361
+ kind: h.BOOLEAN,
1279
1362
  value: !1
1280
1363
  });
1281
1364
  case "null":
1282
1365
  return this.node(n, {
1283
- kind: m.NULL
1366
+ kind: h.NULL
1284
1367
  });
1285
1368
  default:
1286
1369
  return this.node(n, {
1287
- kind: m.ENUM,
1370
+ kind: h.ENUM,
1288
1371
  value: n.value
1289
1372
  });
1290
1373
  }
1291
1374
  case u.DOLLAR:
1292
1375
  if (t)
1293
1376
  if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
1294
- const r = this._lexer.token.value;
1295
- throw P(
1377
+ const i = this._lexer.token.value;
1378
+ throw x(
1296
1379
  this._lexer.source,
1297
1380
  n.start,
1298
- `Unexpected variable "$${r}" in constant value.`
1381
+ `Unexpected variable "$${i}" in constant value.`
1299
1382
  );
1300
1383
  } else
1301
1384
  throw this.unexpected(n);
@@ -1310,7 +1393,7 @@ class Tt {
1310
1393
  parseStringLiteral() {
1311
1394
  const t = this._lexer.token;
1312
1395
  return this.advanceLexer(), this.node(t, {
1313
- kind: m.STRING,
1396
+ kind: h.STRING,
1314
1397
  value: t.value,
1315
1398
  block: t.kind === u.BLOCK_STRING
1316
1399
  });
@@ -1323,7 +1406,7 @@ class Tt {
1323
1406
  parseList(t) {
1324
1407
  const n = () => this.parseValueLiteral(t);
1325
1408
  return this.node(this._lexer.token, {
1326
- kind: m.LIST,
1409
+ kind: h.LIST,
1327
1410
  values: this.any(u.BRACKET_L, n, u.BRACKET_R)
1328
1411
  });
1329
1412
  }
@@ -1337,7 +1420,7 @@ class Tt {
1337
1420
  parseObject(t) {
1338
1421
  const n = () => this.parseObjectField(t);
1339
1422
  return this.node(this._lexer.token, {
1340
- kind: m.OBJECT,
1423
+ kind: h.OBJECT,
1341
1424
  fields: this.any(u.BRACE_L, n, u.BRACE_R)
1342
1425
  });
1343
1426
  }
@@ -1345,10 +1428,10 @@ class Tt {
1345
1428
  * ObjectField[Const] : Name : Value[?Const]
1346
1429
  */
1347
1430
  parseObjectField(t) {
1348
- const n = this._lexer.token, r = this.parseName();
1431
+ const n = this._lexer.token, i = this.parseName();
1349
1432
  return this.expectToken(u.COLON), this.node(n, {
1350
- kind: m.OBJECT_FIELD,
1351
- name: r,
1433
+ kind: h.OBJECT_FIELD,
1434
+ name: i,
1352
1435
  value: this.parseValueLiteral(t)
1353
1436
  });
1354
1437
  }
@@ -1373,7 +1456,7 @@ class Tt {
1373
1456
  parseDirective(t) {
1374
1457
  const n = this._lexer.token;
1375
1458
  return this.expectToken(u.AT), this.node(n, {
1376
- kind: m.DIRECTIVE,
1459
+ kind: h.DIRECTIVE,
1377
1460
  name: this.parseName(),
1378
1461
  arguments: this.parseArguments(t)
1379
1462
  });
@@ -1389,15 +1472,15 @@ class Tt {
1389
1472
  const t = this._lexer.token;
1390
1473
  let n;
1391
1474
  if (this.expectOptionalToken(u.BRACKET_L)) {
1392
- const r = this.parseTypeReference();
1475
+ const i = this.parseTypeReference();
1393
1476
  this.expectToken(u.BRACKET_R), n = this.node(t, {
1394
- kind: m.LIST_TYPE,
1395
- type: r
1477
+ kind: h.LIST_TYPE,
1478
+ type: i
1396
1479
  });
1397
1480
  } else
1398
1481
  n = this.parseNamedType();
1399
1482
  return this.expectOptionalToken(u.BANG) ? this.node(t, {
1400
- kind: m.NON_NULL_TYPE,
1483
+ kind: h.NON_NULL_TYPE,
1401
1484
  type: n
1402
1485
  }) : n;
1403
1486
  }
@@ -1406,7 +1489,7 @@ class Tt {
1406
1489
  */
1407
1490
  parseNamedType() {
1408
1491
  return this.node(this._lexer.token, {
1409
- kind: m.NAMED_TYPE,
1492
+ kind: h.NAMED_TYPE,
1410
1493
  name: this.parseName()
1411
1494
  });
1412
1495
  }
@@ -1429,16 +1512,16 @@ class Tt {
1429
1512
  parseSchemaDefinition() {
1430
1513
  const t = this._lexer.token, n = this.parseDescription();
1431
1514
  this.expectKeyword("schema");
1432
- const r = this.parseConstDirectives(), i = this.many(
1515
+ const i = this.parseConstDirectives(), r = this.many(
1433
1516
  u.BRACE_L,
1434
1517
  this.parseOperationTypeDefinition,
1435
1518
  u.BRACE_R
1436
1519
  );
1437
1520
  return this.node(t, {
1438
- kind: m.SCHEMA_DEFINITION,
1521
+ kind: h.SCHEMA_DEFINITION,
1439
1522
  description: n,
1440
- directives: r,
1441
- operationTypes: i
1523
+ directives: i,
1524
+ operationTypes: r
1442
1525
  });
1443
1526
  }
1444
1527
  /**
@@ -1447,11 +1530,11 @@ class Tt {
1447
1530
  parseOperationTypeDefinition() {
1448
1531
  const t = this._lexer.token, n = this.parseOperationType();
1449
1532
  this.expectToken(u.COLON);
1450
- const r = this.parseNamedType();
1533
+ const i = this.parseNamedType();
1451
1534
  return this.node(t, {
1452
- kind: m.OPERATION_TYPE_DEFINITION,
1535
+ kind: h.OPERATION_TYPE_DEFINITION,
1453
1536
  operation: n,
1454
- type: r
1537
+ type: i
1455
1538
  });
1456
1539
  }
1457
1540
  /**
@@ -1460,12 +1543,12 @@ class Tt {
1460
1543
  parseScalarTypeDefinition() {
1461
1544
  const t = this._lexer.token, n = this.parseDescription();
1462
1545
  this.expectKeyword("scalar");
1463
- const r = this.parseName(), i = this.parseConstDirectives();
1546
+ const i = this.parseName(), r = this.parseConstDirectives();
1464
1547
  return this.node(t, {
1465
- kind: m.SCALAR_TYPE_DEFINITION,
1548
+ kind: h.SCALAR_TYPE_DEFINITION,
1466
1549
  description: n,
1467
- name: r,
1468
- directives: i
1550
+ name: i,
1551
+ directives: r
1469
1552
  });
1470
1553
  }
1471
1554
  /**
@@ -1476,12 +1559,12 @@ class Tt {
1476
1559
  parseObjectTypeDefinition() {
1477
1560
  const t = this._lexer.token, n = this.parseDescription();
1478
1561
  this.expectKeyword("type");
1479
- const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1562
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1480
1563
  return this.node(t, {
1481
- kind: m.OBJECT_TYPE_DEFINITION,
1564
+ kind: h.OBJECT_TYPE_DEFINITION,
1482
1565
  description: n,
1483
- name: r,
1484
- interfaces: i,
1566
+ name: i,
1567
+ interfaces: r,
1485
1568
  directives: s,
1486
1569
  fields: a
1487
1570
  });
@@ -1511,14 +1594,14 @@ class Tt {
1511
1594
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1512
1595
  */
1513
1596
  parseFieldDefinition() {
1514
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
1597
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1515
1598
  this.expectToken(u.COLON);
1516
1599
  const s = this.parseTypeReference(), a = this.parseConstDirectives();
1517
1600
  return this.node(t, {
1518
- kind: m.FIELD_DEFINITION,
1601
+ kind: h.FIELD_DEFINITION,
1519
1602
  description: n,
1520
- name: r,
1521
- arguments: i,
1603
+ name: i,
1604
+ arguments: r,
1522
1605
  type: s,
1523
1606
  directives: a
1524
1607
  });
@@ -1538,17 +1621,17 @@ class Tt {
1538
1621
  * - Description? Name : Type DefaultValue? Directives[Const]?
1539
1622
  */
1540
1623
  parseInputValueDef() {
1541
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1624
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1542
1625
  this.expectToken(u.COLON);
1543
- const i = this.parseTypeReference();
1626
+ const r = this.parseTypeReference();
1544
1627
  let s;
1545
1628
  this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
1546
1629
  const a = this.parseConstDirectives();
1547
1630
  return this.node(t, {
1548
- kind: m.INPUT_VALUE_DEFINITION,
1631
+ kind: h.INPUT_VALUE_DEFINITION,
1549
1632
  description: n,
1550
- name: r,
1551
- type: i,
1633
+ name: i,
1634
+ type: r,
1552
1635
  defaultValue: s,
1553
1636
  directives: a
1554
1637
  });
@@ -1560,12 +1643,12 @@ class Tt {
1560
1643
  parseInterfaceTypeDefinition() {
1561
1644
  const t = this._lexer.token, n = this.parseDescription();
1562
1645
  this.expectKeyword("interface");
1563
- const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1646
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1564
1647
  return this.node(t, {
1565
- kind: m.INTERFACE_TYPE_DEFINITION,
1648
+ kind: h.INTERFACE_TYPE_DEFINITION,
1566
1649
  description: n,
1567
- name: r,
1568
- interfaces: i,
1650
+ name: i,
1651
+ interfaces: r,
1569
1652
  directives: s,
1570
1653
  fields: a
1571
1654
  });
@@ -1577,12 +1660,12 @@ class Tt {
1577
1660
  parseUnionTypeDefinition() {
1578
1661
  const t = this._lexer.token, n = this.parseDescription();
1579
1662
  this.expectKeyword("union");
1580
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1663
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1581
1664
  return this.node(t, {
1582
- kind: m.UNION_TYPE_DEFINITION,
1665
+ kind: h.UNION_TYPE_DEFINITION,
1583
1666
  description: n,
1584
- name: r,
1585
- directives: i,
1667
+ name: i,
1668
+ directives: r,
1586
1669
  types: s
1587
1670
  });
1588
1671
  }
@@ -1601,12 +1684,12 @@ class Tt {
1601
1684
  parseEnumTypeDefinition() {
1602
1685
  const t = this._lexer.token, n = this.parseDescription();
1603
1686
  this.expectKeyword("enum");
1604
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1687
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1605
1688
  return this.node(t, {
1606
- kind: m.ENUM_TYPE_DEFINITION,
1689
+ kind: h.ENUM_TYPE_DEFINITION,
1607
1690
  description: n,
1608
- name: r,
1609
- directives: i,
1691
+ name: i,
1692
+ directives: r,
1610
1693
  values: s
1611
1694
  });
1612
1695
  }
@@ -1626,12 +1709,12 @@ class Tt {
1626
1709
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1627
1710
  */
1628
1711
  parseEnumValueDefinition() {
1629
- const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1712
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1630
1713
  return this.node(t, {
1631
- kind: m.ENUM_VALUE_DEFINITION,
1714
+ kind: h.ENUM_VALUE_DEFINITION,
1632
1715
  description: n,
1633
- name: r,
1634
- directives: i
1716
+ name: i,
1717
+ directives: r
1635
1718
  });
1636
1719
  }
1637
1720
  /**
@@ -1639,7 +1722,7 @@ class Tt {
1639
1722
  */
1640
1723
  parseEnumValueName() {
1641
1724
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1642
- throw P(
1725
+ throw x(
1643
1726
  this._lexer.source,
1644
1727
  this._lexer.token.start,
1645
1728
  `${K(
@@ -1655,12 +1738,12 @@ class Tt {
1655
1738
  parseInputObjectTypeDefinition() {
1656
1739
  const t = this._lexer.token, n = this.parseDescription();
1657
1740
  this.expectKeyword("input");
1658
- const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1741
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1659
1742
  return this.node(t, {
1660
- kind: m.INPUT_OBJECT_TYPE_DEFINITION,
1743
+ kind: h.INPUT_OBJECT_TYPE_DEFINITION,
1661
1744
  description: n,
1662
- name: r,
1663
- directives: i,
1745
+ name: i,
1746
+ directives: r,
1664
1747
  fields: s
1665
1748
  });
1666
1749
  }
@@ -1720,17 +1803,17 @@ class Tt {
1720
1803
  parseSchemaExtension() {
1721
1804
  const t = this._lexer.token;
1722
1805
  this.expectKeyword("extend"), this.expectKeyword("schema");
1723
- const n = this.parseConstDirectives(), r = this.optionalMany(
1806
+ const n = this.parseConstDirectives(), i = this.optionalMany(
1724
1807
  u.BRACE_L,
1725
1808
  this.parseOperationTypeDefinition,
1726
1809
  u.BRACE_R
1727
1810
  );
1728
- if (n.length === 0 && r.length === 0)
1811
+ if (n.length === 0 && i.length === 0)
1729
1812
  throw this.unexpected();
1730
1813
  return this.node(t, {
1731
- kind: m.SCHEMA_EXTENSION,
1814
+ kind: h.SCHEMA_EXTENSION,
1732
1815
  directives: n,
1733
- operationTypes: r
1816
+ operationTypes: i
1734
1817
  });
1735
1818
  }
1736
1819
  /**
@@ -1740,13 +1823,13 @@ class Tt {
1740
1823
  parseScalarTypeExtension() {
1741
1824
  const t = this._lexer.token;
1742
1825
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1743
- const n = this.parseName(), r = this.parseConstDirectives();
1744
- if (r.length === 0)
1826
+ const n = this.parseName(), i = this.parseConstDirectives();
1827
+ if (i.length === 0)
1745
1828
  throw this.unexpected();
1746
1829
  return this.node(t, {
1747
- kind: m.SCALAR_TYPE_EXTENSION,
1830
+ kind: h.SCALAR_TYPE_EXTENSION,
1748
1831
  name: n,
1749
- directives: r
1832
+ directives: i
1750
1833
  });
1751
1834
  }
1752
1835
  /**
@@ -1758,14 +1841,14 @@ class Tt {
1758
1841
  parseObjectTypeExtension() {
1759
1842
  const t = this._lexer.token;
1760
1843
  this.expectKeyword("extend"), this.expectKeyword("type");
1761
- const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1762
- if (r.length === 0 && i.length === 0 && s.length === 0)
1844
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1845
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1763
1846
  throw this.unexpected();
1764
1847
  return this.node(t, {
1765
- kind: m.OBJECT_TYPE_EXTENSION,
1848
+ kind: h.OBJECT_TYPE_EXTENSION,
1766
1849
  name: n,
1767
- interfaces: r,
1768
- directives: i,
1850
+ interfaces: i,
1851
+ directives: r,
1769
1852
  fields: s
1770
1853
  });
1771
1854
  }
@@ -1778,14 +1861,14 @@ class Tt {
1778
1861
  parseInterfaceTypeExtension() {
1779
1862
  const t = this._lexer.token;
1780
1863
  this.expectKeyword("extend"), this.expectKeyword("interface");
1781
- const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1782
- if (r.length === 0 && i.length === 0 && s.length === 0)
1864
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1865
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1783
1866
  throw this.unexpected();
1784
1867
  return this.node(t, {
1785
- kind: m.INTERFACE_TYPE_EXTENSION,
1868
+ kind: h.INTERFACE_TYPE_EXTENSION,
1786
1869
  name: n,
1787
- interfaces: r,
1788
- directives: i,
1870
+ interfaces: i,
1871
+ directives: r,
1789
1872
  fields: s
1790
1873
  });
1791
1874
  }
@@ -1797,14 +1880,14 @@ class Tt {
1797
1880
  parseUnionTypeExtension() {
1798
1881
  const t = this._lexer.token;
1799
1882
  this.expectKeyword("extend"), this.expectKeyword("union");
1800
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1801
- if (r.length === 0 && i.length === 0)
1883
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1884
+ if (i.length === 0 && r.length === 0)
1802
1885
  throw this.unexpected();
1803
1886
  return this.node(t, {
1804
- kind: m.UNION_TYPE_EXTENSION,
1887
+ kind: h.UNION_TYPE_EXTENSION,
1805
1888
  name: n,
1806
- directives: r,
1807
- types: i
1889
+ directives: i,
1890
+ types: r
1808
1891
  });
1809
1892
  }
1810
1893
  /**
@@ -1815,14 +1898,14 @@ class Tt {
1815
1898
  parseEnumTypeExtension() {
1816
1899
  const t = this._lexer.token;
1817
1900
  this.expectKeyword("extend"), this.expectKeyword("enum");
1818
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1819
- if (r.length === 0 && i.length === 0)
1901
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1902
+ if (i.length === 0 && r.length === 0)
1820
1903
  throw this.unexpected();
1821
1904
  return this.node(t, {
1822
- kind: m.ENUM_TYPE_EXTENSION,
1905
+ kind: h.ENUM_TYPE_EXTENSION,
1823
1906
  name: n,
1824
- directives: r,
1825
- values: i
1907
+ directives: i,
1908
+ values: r
1826
1909
  });
1827
1910
  }
1828
1911
  /**
@@ -1833,14 +1916,14 @@ class Tt {
1833
1916
  parseInputObjectTypeExtension() {
1834
1917
  const t = this._lexer.token;
1835
1918
  this.expectKeyword("extend"), this.expectKeyword("input");
1836
- const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1837
- if (r.length === 0 && i.length === 0)
1919
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1920
+ if (i.length === 0 && r.length === 0)
1838
1921
  throw this.unexpected();
1839
1922
  return this.node(t, {
1840
- kind: m.INPUT_OBJECT_TYPE_EXTENSION,
1923
+ kind: h.INPUT_OBJECT_TYPE_EXTENSION,
1841
1924
  name: n,
1842
- directives: r,
1843
- fields: i
1925
+ directives: i,
1926
+ fields: r
1844
1927
  });
1845
1928
  }
1846
1929
  /**
@@ -1852,14 +1935,14 @@ class Tt {
1852
1935
  parseDirectiveDefinition() {
1853
1936
  const t = this._lexer.token, n = this.parseDescription();
1854
1937
  this.expectKeyword("directive"), this.expectToken(u.AT);
1855
- const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1938
+ const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1856
1939
  this.expectKeyword("on");
1857
1940
  const a = this.parseDirectiveLocations();
1858
1941
  return this.node(t, {
1859
- kind: m.DIRECTIVE_DEFINITION,
1942
+ kind: h.DIRECTIVE_DEFINITION,
1860
1943
  description: n,
1861
- name: r,
1862
- arguments: i,
1944
+ name: i,
1945
+ arguments: r,
1863
1946
  repeatable: s,
1864
1947
  locations: a
1865
1948
  });
@@ -1901,10 +1984,45 @@ class Tt {
1901
1984
  */
1902
1985
  parseDirectiveLocation() {
1903
1986
  const t = this._lexer.token, n = this.parseName();
1904
- if (Object.prototype.hasOwnProperty.call(me, n.value))
1987
+ if (Object.prototype.hasOwnProperty.call(Ce, n.value))
1905
1988
  return n;
1906
1989
  throw this.unexpected(t);
1907
1990
  }
1991
+ // Schema Coordinates
1992
+ /**
1993
+ * SchemaCoordinate :
1994
+ * - Name
1995
+ * - Name . Name
1996
+ * - Name . Name ( Name : )
1997
+ * - \@ Name
1998
+ * - \@ Name ( Name : )
1999
+ */
2000
+ parseSchemaCoordinate() {
2001
+ const t = this._lexer.token, n = this.expectOptionalToken(u.AT), i = this.parseName();
2002
+ let r;
2003
+ !n && this.expectOptionalToken(u.DOT) && (r = this.parseName());
2004
+ let s;
2005
+ return (n || r) && this.expectOptionalToken(u.PAREN_L) && (s = this.parseName(), this.expectToken(u.COLON), this.expectToken(u.PAREN_R)), n ? s ? this.node(t, {
2006
+ kind: h.DIRECTIVE_ARGUMENT_COORDINATE,
2007
+ name: i,
2008
+ argumentName: s
2009
+ }) : this.node(t, {
2010
+ kind: h.DIRECTIVE_COORDINATE,
2011
+ name: i
2012
+ }) : r ? s ? this.node(t, {
2013
+ kind: h.ARGUMENT_COORDINATE,
2014
+ name: i,
2015
+ fieldName: r,
2016
+ argumentName: s
2017
+ }) : this.node(t, {
2018
+ kind: h.MEMBER_COORDINATE,
2019
+ name: i,
2020
+ memberName: r
2021
+ }) : this.node(t, {
2022
+ kind: h.TYPE_COORDINATE,
2023
+ name: i
2024
+ });
2025
+ }
1908
2026
  // Core parsing utility functions
1909
2027
  /**
1910
2028
  * Returns a node that, if configured to do so, sets a "loc" field as a
@@ -1912,7 +2030,7 @@ class Tt {
1912
2030
  * given parsed object.
1913
2031
  */
1914
2032
  node(t, n) {
1915
- return this._options.noLocation !== !0 && (n.loc = new We(
2033
+ return this._options.noLocation !== !0 && (n.loc = new ut(
1916
2034
  t,
1917
2035
  this._lexer.lastToken,
1918
2036
  this._lexer.source
@@ -1932,10 +2050,10 @@ class Tt {
1932
2050
  const n = this._lexer.token;
1933
2051
  if (n.kind === t)
1934
2052
  return this.advanceLexer(), n;
1935
- throw P(
2053
+ throw x(
1936
2054
  this._lexer.source,
1937
2055
  n.start,
1938
- `Expected ${qe(t)}, found ${K(n)}.`
2056
+ `Expected ${Ge(t)}, found ${K(n)}.`
1939
2057
  );
1940
2058
  }
1941
2059
  /**
@@ -1954,7 +2072,7 @@ class Tt {
1954
2072
  if (n.kind === u.NAME && n.value === t)
1955
2073
  this.advanceLexer();
1956
2074
  else
1957
- throw P(
2075
+ throw x(
1958
2076
  this._lexer.source,
1959
2077
  n.start,
1960
2078
  `Expected "${t}", found ${K(n)}.`
@@ -1973,7 +2091,7 @@ class Tt {
1973
2091
  */
1974
2092
  unexpected(t) {
1975
2093
  const n = t ?? this._lexer.token;
1976
- return P(
2094
+ return x(
1977
2095
  this._lexer.source,
1978
2096
  n.start,
1979
2097
  `Unexpected ${K(n)}.`
@@ -1984,12 +2102,12 @@ class Tt {
1984
2102
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
1985
2103
  * Advances the parser to the next lex token after the closing token.
1986
2104
  */
1987
- any(t, n, r) {
2105
+ any(t, n, i) {
1988
2106
  this.expectToken(t);
1989
- const i = [];
1990
- for (; !this.expectOptionalToken(r); )
1991
- i.push(n.call(this));
1992
- return i;
2107
+ const r = [];
2108
+ for (; !this.expectOptionalToken(i); )
2109
+ r.push(n.call(this));
2110
+ return r;
1993
2111
  }
1994
2112
  /**
1995
2113
  * Returns a list of parse nodes, determined by the parseFn.
@@ -1997,13 +2115,13 @@ class Tt {
1997
2115
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
1998
2116
  * Advances the parser to the next lex token after the closing token.
1999
2117
  */
2000
- optionalMany(t, n, r) {
2118
+ optionalMany(t, n, i) {
2001
2119
  if (this.expectOptionalToken(t)) {
2002
- const i = [];
2120
+ const r = [];
2003
2121
  do
2004
- i.push(n.call(this));
2005
- while (!this.expectOptionalToken(r));
2006
- return i;
2122
+ r.push(n.call(this));
2123
+ while (!this.expectOptionalToken(i));
2124
+ return r;
2007
2125
  }
2008
2126
  return [];
2009
2127
  }
@@ -2012,13 +2130,13 @@ class Tt {
2012
2130
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2013
2131
  * Advances the parser to the next lex token after the closing token.
2014
2132
  */
2015
- many(t, n, r) {
2133
+ many(t, n, i) {
2016
2134
  this.expectToken(t);
2017
- const i = [];
2135
+ const r = [];
2018
2136
  do
2019
- i.push(n.call(this));
2020
- while (!this.expectOptionalToken(r));
2021
- return i;
2137
+ r.push(n.call(this));
2138
+ while (!this.expectOptionalToken(i));
2139
+ return r;
2022
2140
  }
2023
2141
  /**
2024
2142
  * Returns a non-empty list of parse nodes, determined by the parseFn.
@@ -2027,16 +2145,16 @@ class Tt {
2027
2145
  */
2028
2146
  delimitedMany(t, n) {
2029
2147
  this.expectOptionalToken(t);
2030
- const r = [];
2148
+ const i = [];
2031
2149
  do
2032
- r.push(n.call(this));
2150
+ i.push(n.call(this));
2033
2151
  while (this.expectOptionalToken(t));
2034
- return r;
2152
+ return i;
2035
2153
  }
2036
2154
  advanceLexer() {
2037
2155
  const { maxTokens: t } = this._options, n = this._lexer.advance();
2038
- if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
2039
- throw P(
2156
+ if (n.kind !== u.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2157
+ throw x(
2040
2158
  this._lexer.source,
2041
2159
  n.start,
2042
2160
  `Document contains more that ${t} tokens. Parsing aborted.`
@@ -2045,19 +2163,19 @@ class Tt {
2045
2163
  }
2046
2164
  function K(e) {
2047
2165
  const t = e.value;
2048
- return qe(e.kind) + (t != null ? ` "${t}"` : "");
2166
+ return Ge(e.kind) + (t != null ? ` "${t}"` : "");
2049
2167
  }
2050
- function qe(e) {
2051
- return at(e) ? `"${e}"` : e;
2168
+ function Ge(e) {
2169
+ return ft(e) ? `"${e}"` : e;
2052
2170
  }
2053
- function xt(e) {
2054
- return `"${e.replace(Pt, Rt)}"`;
2171
+ function wt(e) {
2172
+ return `"${e.replace(Mt, qt)}"`;
2055
2173
  }
2056
- const Pt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2057
- function Rt(e) {
2058
- return Ot[e.charCodeAt(0)];
2174
+ const Mt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2175
+ function qt(e) {
2176
+ return Ft[e.charCodeAt(0)];
2059
2177
  }
2060
- const Ot = [
2178
+ const Ft = [
2061
2179
  "\\u0000",
2062
2180
  "\\u0001",
2063
2181
  "\\u0002",
@@ -2223,75 +2341,72 @@ const Ot = [
2223
2341
  "\\u009D",
2224
2342
  "\\u009E",
2225
2343
  "\\u009F"
2226
- ], Nt = Object.freeze({});
2227
- function Dt(e, t, n = be) {
2228
- const r = /* @__PURE__ */ new Map();
2229
- for (const D of Object.values(m))
2230
- r.set(D, bt(t, D));
2231
- let i, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, f, C;
2232
- const y = [], I = [];
2344
+ ], Bt = Object.freeze({});
2345
+ function Ut(e, t, n = Le) {
2346
+ const i = /* @__PURE__ */ new Map();
2347
+ for (const b of Object.values(h))
2348
+ i.set(b, Vt(t, b));
2349
+ let r, s = Array.isArray(e), a = [e], c = -1, l = [], m = e, f, A;
2350
+ const C = [], S = [];
2233
2351
  do {
2234
2352
  c++;
2235
- const D = c === a.length, z = D && p.length !== 0;
2236
- if (D) {
2237
- if (f = I.length === 0 ? void 0 : y[y.length - 1], h = C, C = I.pop(), z)
2353
+ const b = c === a.length, z = b && l.length !== 0;
2354
+ if (b) {
2355
+ if (f = S.length === 0 ? void 0 : C[C.length - 1], m = A, A = S.pop(), z)
2238
2356
  if (s) {
2239
- h = h.slice();
2240
- let b = 0;
2241
- for (const [F, J] of p) {
2242
- const Q = F - b;
2243
- J === null ? (h.splice(Q, 1), b++) : h[Q] = J;
2357
+ m = m.slice();
2358
+ let w = 0;
2359
+ for (const [B, $] of l) {
2360
+ const J = B - w;
2361
+ $ === null ? (m.splice(J, 1), w++) : m[J] = $;
2244
2362
  }
2245
2363
  } else {
2246
- h = Object.defineProperties(
2247
- {},
2248
- Object.getOwnPropertyDescriptors(h)
2249
- );
2250
- for (const [b, F] of p)
2251
- h[b] = F;
2364
+ m = { ...m };
2365
+ for (const [w, B] of l)
2366
+ m[w] = B;
2252
2367
  }
2253
- c = i.index, a = i.keys, p = i.edits, s = i.inArray, i = i.prev;
2254
- } else if (C) {
2255
- if (f = s ? c : a[c], h = C[f], h == null)
2368
+ c = r.index, a = r.keys, l = r.edits, s = r.inArray, r = r.prev;
2369
+ } else if (A) {
2370
+ if (f = s ? c : a[c], m = A[f], m == null)
2256
2371
  continue;
2257
- y.push(f);
2372
+ C.push(f);
2258
2373
  }
2259
- let _;
2260
- if (!Array.isArray(h)) {
2261
- var g, T;
2262
- Te(h) || Z(!1, `Invalid AST Node: ${Ee(h)}.`);
2263
- const b = D ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (T = r.get(h.kind)) === null || T === void 0 ? void 0 : T.enter;
2264
- if (_ = b == null ? void 0 : b.call(t, h, f, C, y, I), _ === Nt)
2374
+ let L;
2375
+ if (!Array.isArray(m)) {
2376
+ var I, y;
2377
+ Re(m) || ee(!1, `Invalid AST Node: ${Te(m)}.`);
2378
+ const w = b ? (I = i.get(m.kind)) === null || I === void 0 ? void 0 : I.leave : (y = i.get(m.kind)) === null || y === void 0 ? void 0 : y.enter;
2379
+ if (L = w == null ? void 0 : w.call(t, m, f, A, C, S), L === Bt)
2265
2380
  break;
2266
- if (_ === !1) {
2267
- if (!D) {
2268
- y.pop();
2381
+ if (L === !1) {
2382
+ if (!b) {
2383
+ C.pop();
2269
2384
  continue;
2270
2385
  }
2271
- } else if (_ !== void 0 && (p.push([f, _]), !D))
2272
- if (Te(_))
2273
- h = _;
2386
+ } else if (L !== void 0 && (l.push([f, L]), !b))
2387
+ if (Re(L))
2388
+ m = L;
2274
2389
  else {
2275
- y.pop();
2390
+ C.pop();
2276
2391
  continue;
2277
2392
  }
2278
2393
  }
2279
- if (_ === void 0 && z && p.push([f, h]), D)
2280
- y.pop();
2394
+ if (L === void 0 && z && l.push([f, m]), b)
2395
+ C.pop();
2281
2396
  else {
2282
2397
  var N;
2283
- i = {
2398
+ r = {
2284
2399
  inArray: s,
2285
2400
  index: c,
2286
2401
  keys: a,
2287
- edits: p,
2288
- prev: i
2289
- }, s = Array.isArray(h), a = s ? h : (N = n[h.kind]) !== null && N !== void 0 ? N : [], c = -1, p = [], C && I.push(C), C = h;
2402
+ edits: l,
2403
+ prev: r
2404
+ }, s = Array.isArray(m), a = s ? m : (N = n[m.kind]) !== null && N !== void 0 ? N : [], c = -1, l = [], A && S.push(A), A = m;
2290
2405
  }
2291
- } while (i !== void 0);
2292
- return p.length !== 0 ? p[p.length - 1][1] : e;
2406
+ } while (r !== void 0);
2407
+ return l.length !== 0 ? l[l.length - 1][1] : e;
2293
2408
  }
2294
- function bt(e, t) {
2409
+ function Vt(e, t) {
2295
2410
  const n = e[t];
2296
2411
  return typeof n == "object" ? n : typeof n == "function" ? {
2297
2412
  enter: n,
@@ -2301,10 +2416,10 @@ function bt(e, t) {
2301
2416
  leave: e.leave
2302
2417
  };
2303
2418
  }
2304
- function kt(e) {
2305
- return Dt(e, Lt);
2419
+ function Gt(e) {
2420
+ return Ut(e, jt);
2306
2421
  }
2307
- const _t = 80, Lt = {
2422
+ const $t = 80, jt = {
2308
2423
  Name: {
2309
2424
  leave: (e) => e.value
2310
2425
  },
@@ -2313,17 +2428,21 @@ const _t = 80, Lt = {
2313
2428
  },
2314
2429
  // Document
2315
2430
  Document: {
2316
- leave: (e) => d(e.definitions, `
2431
+ leave: (e) => p(e.definitions, `
2317
2432
 
2318
2433
  `)
2319
2434
  },
2320
2435
  OperationDefinition: {
2321
2436
  leave(e) {
2322
- const t = A("(", d(e.variableDefinitions, ", "), ")"), n = d(
2437
+ const t = pe(e.variableDefinitions) ? g(`(
2438
+ `, p(e.variableDefinitions, `
2439
+ `), `
2440
+ )`) : g("(", p(e.variableDefinitions, ", "), ")"), n = g("", e.description, `
2441
+ `) + p(
2323
2442
  [
2324
2443
  e.operation,
2325
- d([e.name, t]),
2326
- d(e.directives, " ")
2444
+ p([e.name, t]),
2445
+ p(e.directives, " ")
2327
2446
  ],
2328
2447
  " "
2329
2448
  );
@@ -2331,19 +2450,20 @@ const _t = 80, Lt = {
2331
2450
  }
2332
2451
  },
2333
2452
  VariableDefinition: {
2334
- leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + A(" = ", n) + A(" ", d(r, " "))
2453
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i, description: r }) => g("", r, `
2454
+ `) + e + ": " + t + g(" = ", n) + g(" ", p(i, " "))
2335
2455
  },
2336
2456
  SelectionSet: {
2337
- leave: ({ selections: e }) => k(e)
2457
+ leave: ({ selections: e }) => _(e)
2338
2458
  },
2339
2459
  Field: {
2340
- leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2341
- const s = A("", e, ": ") + t;
2342
- let a = s + A("(", d(n, ", "), ")");
2343
- return a.length > _t && (a = s + A(`(
2344
- `, W(d(n, `
2460
+ leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2461
+ const s = g("", e, ": ") + t;
2462
+ let a = s + g("(", p(n, ", "), ")");
2463
+ return a.length > $t && (a = s + g(`(
2464
+ `, te(p(n, `
2345
2465
  `)), `
2346
- )`)), d([a, d(r, " "), i], " ");
2466
+ )`)), p([a, p(i, " "), r], " ");
2347
2467
  }
2348
2468
  },
2349
2469
  Argument: {
@@ -2351,24 +2471,31 @@ const _t = 80, Lt = {
2351
2471
  },
2352
2472
  // Fragments
2353
2473
  FragmentSpread: {
2354
- leave: ({ name: e, directives: t }) => "..." + e + A(" ", d(t, " "))
2474
+ leave: ({ name: e, directives: t }) => "..." + e + g(" ", p(t, " "))
2355
2475
  },
2356
2476
  InlineFragment: {
2357
- leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2477
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => p(
2358
2478
  [
2359
2479
  "...",
2360
- A("on ", e),
2361
- d(t, " "),
2480
+ g("on ", e),
2481
+ p(t, " "),
2362
2482
  n
2363
2483
  ],
2364
2484
  " "
2365
2485
  )
2366
2486
  },
2367
2487
  FragmentDefinition: {
2368
- leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: r, selectionSet: i }) => (
2369
- // or removed in the future.
2370
- `fragment ${e}${A("(", d(n, ", "), ")")} on ${t} ${A("", d(r, " "), " ")}` + i
2371
- )
2488
+ leave: ({
2489
+ name: e,
2490
+ typeCondition: t,
2491
+ variableDefinitions: n,
2492
+ directives: i,
2493
+ selectionSet: r,
2494
+ description: s
2495
+ }) => g("", s, `
2496
+ `) + // Note: fragment variable definitions are experimental and may be changed
2497
+ // or removed in the future.
2498
+ `fragment ${e}${g("(", p(n, ", "), ")")} on ${t} ${g("", p(i, " "), " ")}` + r
2372
2499
  },
2373
2500
  // Value
2374
2501
  IntValue: {
@@ -2378,7 +2505,7 @@ const _t = 80, Lt = {
2378
2505
  leave: ({ value: e }) => e
2379
2506
  },
2380
2507
  StringValue: {
2381
- leave: ({ value: e, block: t }) => t ? rt(e) : xt(e)
2508
+ leave: ({ value: e, block: t }) => t ? ht(e) : wt(e)
2382
2509
  },
2383
2510
  BooleanValue: {
2384
2511
  leave: ({ value: e }) => e ? "true" : "false"
@@ -2390,17 +2517,17 @@ const _t = 80, Lt = {
2390
2517
  leave: ({ value: e }) => e
2391
2518
  },
2392
2519
  ListValue: {
2393
- leave: ({ values: e }) => "[" + d(e, ", ") + "]"
2520
+ leave: ({ values: e }) => "[" + p(e, ", ") + "]"
2394
2521
  },
2395
2522
  ObjectValue: {
2396
- leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
2523
+ leave: ({ fields: e }) => "{" + p(e, ", ") + "}"
2397
2524
  },
2398
2525
  ObjectField: {
2399
2526
  leave: ({ name: e, value: t }) => e + ": " + t
2400
2527
  },
2401
2528
  // Directive
2402
2529
  Directive: {
2403
- leave: ({ name: e, arguments: t }) => "@" + e + A("(", d(t, ", "), ")")
2530
+ leave: ({ name: e, arguments: t }) => "@" + e + g("(", p(t, ", "), ")")
2404
2531
  },
2405
2532
  // Type
2406
2533
  NamedType: {
@@ -2414,231 +2541,793 @@ const _t = 80, Lt = {
2414
2541
  },
2415
2542
  // Type System Definitions
2416
2543
  SchemaDefinition: {
2417
- leave: ({ description: e, directives: t, operationTypes: n }) => A("", e, `
2418
- `) + d(["schema", d(t, " "), k(n)], " ")
2544
+ leave: ({ description: e, directives: t, operationTypes: n }) => g("", e, `
2545
+ `) + p(["schema", p(t, " "), _(n)], " ")
2419
2546
  },
2420
2547
  OperationTypeDefinition: {
2421
2548
  leave: ({ operation: e, type: t }) => e + ": " + t
2422
2549
  },
2423
2550
  ScalarTypeDefinition: {
2424
- leave: ({ description: e, name: t, directives: n }) => A("", e, `
2425
- `) + d(["scalar", t, d(n, " ")], " ")
2551
+ leave: ({ description: e, name: t, directives: n }) => g("", e, `
2552
+ `) + p(["scalar", t, p(n, " ")], " ")
2426
2553
  },
2427
2554
  ObjectTypeDefinition: {
2428
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
2429
- `) + d(
2555
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => g("", e, `
2556
+ `) + p(
2430
2557
  [
2431
2558
  "type",
2432
2559
  t,
2433
- A("implements ", d(n, " & ")),
2434
- d(r, " "),
2435
- k(i)
2560
+ g("implements ", p(n, " & ")),
2561
+ p(i, " "),
2562
+ _(r)
2436
2563
  ],
2437
2564
  " "
2438
2565
  )
2439
2566
  },
2440
2567
  FieldDefinition: {
2441
- leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => A("", e, `
2442
- `) + t + (Pe(n) ? A(`(
2443
- `, W(d(n, `
2568
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => g("", e, `
2569
+ `) + t + (pe(n) ? g(`(
2570
+ `, te(p(n, `
2444
2571
  `)), `
2445
- )`) : A("(", d(n, ", "), ")")) + ": " + r + A(" ", d(i, " "))
2572
+ )`) : g("(", p(n, ", "), ")")) + ": " + i + g(" ", p(r, " "))
2446
2573
  },
2447
2574
  InputValueDefinition: {
2448
- leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => A("", e, `
2449
- `) + d(
2450
- [t + ": " + n, A("= ", r), d(i, " ")],
2575
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => g("", e, `
2576
+ `) + p(
2577
+ [t + ": " + n, g("= ", i), p(r, " ")],
2451
2578
  " "
2452
2579
  )
2453
2580
  },
2454
2581
  InterfaceTypeDefinition: {
2455
- leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => A("", e, `
2456
- `) + d(
2582
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => g("", e, `
2583
+ `) + p(
2457
2584
  [
2458
2585
  "interface",
2459
2586
  t,
2460
- A("implements ", d(n, " & ")),
2461
- d(r, " "),
2462
- k(i)
2587
+ g("implements ", p(n, " & ")),
2588
+ p(i, " "),
2589
+ _(r)
2463
2590
  ],
2464
2591
  " "
2465
2592
  )
2466
2593
  },
2467
2594
  UnionTypeDefinition: {
2468
- leave: ({ description: e, name: t, directives: n, types: r }) => A("", e, `
2469
- `) + d(
2470
- ["union", t, d(n, " "), A("= ", d(r, " | "))],
2595
+ leave: ({ description: e, name: t, directives: n, types: i }) => g("", e, `
2596
+ `) + p(
2597
+ ["union", t, p(n, " "), g("= ", p(i, " | "))],
2471
2598
  " "
2472
2599
  )
2473
2600
  },
2474
2601
  EnumTypeDefinition: {
2475
- leave: ({ description: e, name: t, directives: n, values: r }) => A("", e, `
2476
- `) + d(["enum", t, d(n, " "), k(r)], " ")
2602
+ leave: ({ description: e, name: t, directives: n, values: i }) => g("", e, `
2603
+ `) + p(["enum", t, p(n, " "), _(i)], " ")
2477
2604
  },
2478
2605
  EnumValueDefinition: {
2479
- leave: ({ description: e, name: t, directives: n }) => A("", e, `
2480
- `) + d([t, d(n, " ")], " ")
2606
+ leave: ({ description: e, name: t, directives: n }) => g("", e, `
2607
+ `) + p([t, p(n, " ")], " ")
2481
2608
  },
2482
2609
  InputObjectTypeDefinition: {
2483
- leave: ({ description: e, name: t, directives: n, fields: r }) => A("", e, `
2484
- `) + d(["input", t, d(n, " "), k(r)], " ")
2610
+ leave: ({ description: e, name: t, directives: n, fields: i }) => g("", e, `
2611
+ `) + p(["input", t, p(n, " "), _(i)], " ")
2485
2612
  },
2486
2613
  DirectiveDefinition: {
2487
- leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => A("", e, `
2488
- `) + "directive @" + t + (Pe(n) ? A(`(
2489
- `, W(d(n, `
2614
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => g("", e, `
2615
+ `) + "directive @" + t + (pe(n) ? g(`(
2616
+ `, te(p(n, `
2490
2617
  `)), `
2491
- )`) : A("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
2618
+ )`) : g("(", p(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + p(r, " | ")
2492
2619
  },
2493
2620
  SchemaExtension: {
2494
- leave: ({ directives: e, operationTypes: t }) => d(
2495
- ["extend schema", d(e, " "), k(t)],
2621
+ leave: ({ directives: e, operationTypes: t }) => p(
2622
+ ["extend schema", p(e, " "), _(t)],
2496
2623
  " "
2497
2624
  )
2498
2625
  },
2499
2626
  ScalarTypeExtension: {
2500
- leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
2627
+ leave: ({ name: e, directives: t }) => p(["extend scalar", e, p(t, " ")], " ")
2501
2628
  },
2502
2629
  ObjectTypeExtension: {
2503
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2630
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => p(
2504
2631
  [
2505
2632
  "extend type",
2506
2633
  e,
2507
- A("implements ", d(t, " & ")),
2508
- d(n, " "),
2509
- k(r)
2634
+ g("implements ", p(t, " & ")),
2635
+ p(n, " "),
2636
+ _(i)
2510
2637
  ],
2511
2638
  " "
2512
2639
  )
2513
2640
  },
2514
2641
  InterfaceTypeExtension: {
2515
- leave: ({ name: e, interfaces: t, directives: n, fields: r }) => d(
2642
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => p(
2516
2643
  [
2517
2644
  "extend interface",
2518
2645
  e,
2519
- A("implements ", d(t, " & ")),
2520
- d(n, " "),
2521
- k(r)
2646
+ g("implements ", p(t, " & ")),
2647
+ p(n, " "),
2648
+ _(i)
2522
2649
  ],
2523
2650
  " "
2524
2651
  )
2525
2652
  },
2526
2653
  UnionTypeExtension: {
2527
- leave: ({ name: e, directives: t, types: n }) => d(
2654
+ leave: ({ name: e, directives: t, types: n }) => p(
2528
2655
  [
2529
2656
  "extend union",
2530
2657
  e,
2531
- d(t, " "),
2532
- A("= ", d(n, " | "))
2658
+ p(t, " "),
2659
+ g("= ", p(n, " | "))
2533
2660
  ],
2534
2661
  " "
2535
2662
  )
2536
2663
  },
2537
2664
  EnumTypeExtension: {
2538
- leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), k(n)], " ")
2665
+ leave: ({ name: e, directives: t, values: n }) => p(["extend enum", e, p(t, " "), _(n)], " ")
2539
2666
  },
2540
2667
  InputObjectTypeExtension: {
2541
- leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), k(n)], " ")
2668
+ leave: ({ name: e, directives: t, fields: n }) => p(["extend input", e, p(t, " "), _(n)], " ")
2669
+ },
2670
+ // Schema Coordinates
2671
+ TypeCoordinate: {
2672
+ leave: ({ name: e }) => e
2673
+ },
2674
+ MemberCoordinate: {
2675
+ leave: ({ name: e, memberName: t }) => p([e, g(".", t)])
2676
+ },
2677
+ ArgumentCoordinate: {
2678
+ leave: ({ name: e, fieldName: t, argumentName: n }) => p([e, g(".", t), g("(", n, ":)")])
2679
+ },
2680
+ DirectiveCoordinate: {
2681
+ leave: ({ name: e }) => p(["@", e])
2682
+ },
2683
+ DirectiveArgumentCoordinate: {
2684
+ leave: ({ name: e, argumentName: t }) => p(["@", e, g("(", t, ":)")])
2542
2685
  }
2543
2686
  };
2544
- function d(e, t = "") {
2687
+ function p(e, t = "") {
2545
2688
  var n;
2546
- return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
2689
+ return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2547
2690
  }
2548
- function k(e) {
2549
- return A(`{
2550
- `, W(d(e, `
2691
+ function _(e) {
2692
+ return g(`{
2693
+ `, te(p(e, `
2551
2694
  `)), `
2552
2695
  }`);
2553
2696
  }
2554
- function A(e, t, n = "") {
2697
+ function g(e, t, n = "") {
2555
2698
  return t != null && t !== "" ? e + t + n : "";
2556
2699
  }
2557
- function W(e) {
2558
- return A(" ", e.replace(/\n/g, `
2700
+ function te(e) {
2701
+ return g(" ", e.replace(/\n/g, `
2559
2702
  `));
2560
2703
  }
2561
- function Pe(e) {
2704
+ function pe(e) {
2562
2705
  var t;
2563
2706
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2564
2707
  `))) !== null && t !== void 0 ? t : !1;
2565
2708
  }
2566
- var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), Ve = !0, ie = !1;
2567
- function Ge(e) {
2568
- return e.replace(/[\s,]+/g, " ").trim();
2709
+ const De = (e) => {
2710
+ var i, r;
2711
+ let t;
2712
+ const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
2713
+ return n.length === 1 && (t = (r = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), t;
2714
+ }, he = (e) => {
2715
+ if (typeof e == "string") {
2716
+ let n;
2717
+ try {
2718
+ const i = Ve(e);
2719
+ n = De(i);
2720
+ } catch {
2721
+ }
2722
+ return { query: e, operationName: n };
2723
+ }
2724
+ const t = De(e);
2725
+ return { query: Gt(e), operationName: t };
2726
+ };
2727
+ class Y extends Error {
2728
+ constructor(t, n) {
2729
+ const i = `${Y.extractMessage(t)}: ${JSON.stringify({
2730
+ response: t,
2731
+ request: n
2732
+ })}`;
2733
+ super(i), Object.setPrototypeOf(this, Y.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Y);
2734
+ }
2735
+ static extractMessage(t) {
2736
+ var n, i;
2737
+ return ((i = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${t.status})`;
2738
+ }
2569
2739
  }
2570
- function wt(e) {
2571
- return Ge(e.source.body.substring(e.start, e.end));
2740
+ var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2741
+ function Ht(e) {
2742
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2572
2743
  }
2573
- function Mt(e) {
2574
- var t = /* @__PURE__ */ new Set(), n = [];
2575
- return e.definitions.forEach(function(r) {
2576
- if (r.kind === "FragmentDefinition") {
2577
- var i = r.name.value, s = wt(r.loc), a = ge.get(i);
2578
- a && !a.has(s) ? Ve && console.warn("Warning: fragment with name " + i + ` already exists.
2579
- graphql-tag enforces all fragment names across your application to be unique; read more about
2580
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || ge.set(i, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(r));
2581
- } else
2582
- n.push(r);
2583
- }), ne(ne({}, e), { definitions: n });
2744
+ var W = { exports: {} }, Ne;
2745
+ function Yt() {
2746
+ return Ne || (Ne = 1, (function(e, t) {
2747
+ var n = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof Z < "u" && Z, i = (function() {
2748
+ function s() {
2749
+ this.fetch = !1, this.DOMException = n.DOMException;
2750
+ }
2751
+ return s.prototype = n, new s();
2752
+ })();
2753
+ (function(s) {
2754
+ (function(a) {
2755
+ var c = typeof s < "u" && s || typeof self < "u" && self || // eslint-disable-next-line no-undef
2756
+ typeof Z < "u" && Z || {}, l = {
2757
+ searchParams: "URLSearchParams" in c,
2758
+ iterable: "Symbol" in c && "iterator" in Symbol,
2759
+ blob: "FileReader" in c && "Blob" in c && (function() {
2760
+ try {
2761
+ return new Blob(), !0;
2762
+ } catch {
2763
+ return !1;
2764
+ }
2765
+ })(),
2766
+ formData: "FormData" in c,
2767
+ arrayBuffer: "ArrayBuffer" in c
2768
+ };
2769
+ function m(o) {
2770
+ return o && DataView.prototype.isPrototypeOf(o);
2771
+ }
2772
+ if (l.arrayBuffer)
2773
+ var f = [
2774
+ "[object Int8Array]",
2775
+ "[object Uint8Array]",
2776
+ "[object Uint8ClampedArray]",
2777
+ "[object Int16Array]",
2778
+ "[object Uint16Array]",
2779
+ "[object Int32Array]",
2780
+ "[object Uint32Array]",
2781
+ "[object Float32Array]",
2782
+ "[object Float64Array]"
2783
+ ], A = ArrayBuffer.isView || function(o) {
2784
+ return o && f.indexOf(Object.prototype.toString.call(o)) > -1;
2785
+ };
2786
+ function C(o) {
2787
+ if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(o) || o === "")
2788
+ throw new TypeError('Invalid character in header field name: "' + o + '"');
2789
+ return o.toLowerCase();
2790
+ }
2791
+ function S(o) {
2792
+ return typeof o != "string" && (o = String(o)), o;
2793
+ }
2794
+ function I(o) {
2795
+ var d = {
2796
+ next: function() {
2797
+ var E = o.shift();
2798
+ return { done: E === void 0, value: E };
2799
+ }
2800
+ };
2801
+ return l.iterable && (d[Symbol.iterator] = function() {
2802
+ return d;
2803
+ }), d;
2804
+ }
2805
+ function y(o) {
2806
+ this.map = {}, o instanceof y ? o.forEach(function(d, E) {
2807
+ this.append(E, d);
2808
+ }, this) : Array.isArray(o) ? o.forEach(function(d) {
2809
+ if (d.length != 2)
2810
+ throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + d.length);
2811
+ this.append(d[0], d[1]);
2812
+ }, this) : o && Object.getOwnPropertyNames(o).forEach(function(d) {
2813
+ this.append(d, o[d]);
2814
+ }, this);
2815
+ }
2816
+ y.prototype.append = function(o, d) {
2817
+ o = C(o), d = S(d);
2818
+ var E = this.map[o];
2819
+ this.map[o] = E ? E + ", " + d : d;
2820
+ }, y.prototype.delete = function(o) {
2821
+ delete this.map[C(o)];
2822
+ }, y.prototype.get = function(o) {
2823
+ return o = C(o), this.has(o) ? this.map[o] : null;
2824
+ }, y.prototype.has = function(o) {
2825
+ return this.map.hasOwnProperty(C(o));
2826
+ }, y.prototype.set = function(o, d) {
2827
+ this.map[C(o)] = S(d);
2828
+ }, y.prototype.forEach = function(o, d) {
2829
+ for (var E in this.map)
2830
+ this.map.hasOwnProperty(E) && o.call(d, this.map[E], E, this);
2831
+ }, y.prototype.keys = function() {
2832
+ var o = [];
2833
+ return this.forEach(function(d, E) {
2834
+ o.push(E);
2835
+ }), I(o);
2836
+ }, y.prototype.values = function() {
2837
+ var o = [];
2838
+ return this.forEach(function(d) {
2839
+ o.push(d);
2840
+ }), I(o);
2841
+ }, y.prototype.entries = function() {
2842
+ var o = [];
2843
+ return this.forEach(function(d, E) {
2844
+ o.push([E, d]);
2845
+ }), I(o);
2846
+ }, l.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
2847
+ function N(o) {
2848
+ if (!o._noBody) {
2849
+ if (o.bodyUsed)
2850
+ return Promise.reject(new TypeError("Already read"));
2851
+ o.bodyUsed = !0;
2852
+ }
2853
+ }
2854
+ function b(o) {
2855
+ return new Promise(function(d, E) {
2856
+ o.onload = function() {
2857
+ d(o.result);
2858
+ }, o.onerror = function() {
2859
+ E(o.error);
2860
+ };
2861
+ });
2862
+ }
2863
+ function z(o) {
2864
+ var d = new FileReader(), E = b(d);
2865
+ return d.readAsArrayBuffer(o), E;
2866
+ }
2867
+ function L(o) {
2868
+ var d = new FileReader(), E = b(d), P = /charset=([A-Za-z0-9_-]+)/.exec(o.type), O = P ? P[1] : "utf-8";
2869
+ return d.readAsText(o, O), E;
2870
+ }
2871
+ function w(o) {
2872
+ for (var d = new Uint8Array(o), E = new Array(d.length), P = 0; P < d.length; P++)
2873
+ E[P] = String.fromCharCode(d[P]);
2874
+ return E.join("");
2875
+ }
2876
+ function B(o) {
2877
+ if (o.slice)
2878
+ return o.slice(0);
2879
+ var d = new Uint8Array(o.byteLength);
2880
+ return d.set(new Uint8Array(o)), d.buffer;
2881
+ }
2882
+ function $() {
2883
+ return this.bodyUsed = !1, this._initBody = function(o) {
2884
+ this.bodyUsed = this.bodyUsed, this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : l.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : l.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : l.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : l.arrayBuffer && l.blob && m(o) ? (this._bodyArrayBuffer = B(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : l.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || A(o)) ? this._bodyArrayBuffer = B(o) : this._bodyText = o = Object.prototype.toString.call(o) : (this._noBody = !0, this._bodyText = ""), this.headers.get("content-type") || (typeof o == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : l.searchParams && URLSearchParams.prototype.isPrototypeOf(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2885
+ }, l.blob && (this.blob = function() {
2886
+ var o = N(this);
2887
+ if (o)
2888
+ return o;
2889
+ if (this._bodyBlob)
2890
+ return Promise.resolve(this._bodyBlob);
2891
+ if (this._bodyArrayBuffer)
2892
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2893
+ if (this._bodyFormData)
2894
+ throw new Error("could not read FormData body as blob");
2895
+ return Promise.resolve(new Blob([this._bodyText]));
2896
+ }), this.arrayBuffer = function() {
2897
+ if (this._bodyArrayBuffer) {
2898
+ var o = N(this);
2899
+ return o || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
2900
+ this._bodyArrayBuffer.buffer.slice(
2901
+ this._bodyArrayBuffer.byteOffset,
2902
+ this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
2903
+ )
2904
+ ) : Promise.resolve(this._bodyArrayBuffer));
2905
+ } else {
2906
+ if (l.blob)
2907
+ return this.blob().then(z);
2908
+ throw new Error("could not read as ArrayBuffer");
2909
+ }
2910
+ }, this.text = function() {
2911
+ var o = N(this);
2912
+ if (o)
2913
+ return o;
2914
+ if (this._bodyBlob)
2915
+ return L(this._bodyBlob);
2916
+ if (this._bodyArrayBuffer)
2917
+ return Promise.resolve(w(this._bodyArrayBuffer));
2918
+ if (this._bodyFormData)
2919
+ throw new Error("could not read FormData body as text");
2920
+ return Promise.resolve(this._bodyText);
2921
+ }, l.formData && (this.formData = function() {
2922
+ return this.text().then(Ye);
2923
+ }), this.json = function() {
2924
+ return this.text().then(JSON.parse);
2925
+ }, this;
2926
+ }
2927
+ var J = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
2928
+ function He(o) {
2929
+ var d = o.toUpperCase();
2930
+ return J.indexOf(d) > -1 ? d : o;
2931
+ }
2932
+ function M(o, d) {
2933
+ if (!(this instanceof M))
2934
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2935
+ d = d || {};
2936
+ var E = d.body;
2937
+ if (o instanceof M) {
2938
+ if (o.bodyUsed)
2939
+ throw new TypeError("Already read");
2940
+ this.url = o.url, this.credentials = o.credentials, d.headers || (this.headers = new y(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
2941
+ } else
2942
+ this.url = String(o);
2943
+ if (this.credentials = d.credentials || this.credentials || "same-origin", (d.headers || !this.headers) && (this.headers = new y(d.headers)), this.method = He(d.method || this.method || "GET"), this.mode = d.mode || this.mode || null, this.signal = d.signal || this.signal || (function() {
2944
+ if ("AbortController" in c) {
2945
+ var v = new AbortController();
2946
+ return v.signal;
2947
+ }
2948
+ })(), this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
2949
+ throw new TypeError("Body not allowed for GET or HEAD requests");
2950
+ if (this._initBody(E), (this.method === "GET" || this.method === "HEAD") && (d.cache === "no-store" || d.cache === "no-cache")) {
2951
+ var P = /([?&])_=[^&]*/;
2952
+ if (P.test(this.url))
2953
+ this.url = this.url.replace(P, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
2954
+ else {
2955
+ var O = /\?/;
2956
+ this.url += (O.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
2957
+ }
2958
+ }
2959
+ }
2960
+ M.prototype.clone = function() {
2961
+ return new M(this, { body: this._bodyInit });
2962
+ };
2963
+ function Ye(o) {
2964
+ var d = new FormData();
2965
+ return o.trim().split("&").forEach(function(E) {
2966
+ if (E) {
2967
+ var P = E.split("="), O = P.shift().replace(/\+/g, " "), v = P.join("=").replace(/\+/g, " ");
2968
+ d.append(decodeURIComponent(O), decodeURIComponent(v));
2969
+ }
2970
+ }), d;
2971
+ }
2972
+ function Qe(o) {
2973
+ var d = new y(), E = o.replace(/\r?\n[\t ]+/g, " ");
2974
+ return E.split("\r").map(function(P) {
2975
+ return P.indexOf(`
2976
+ `) === 0 ? P.substr(1, P.length) : P;
2977
+ }).forEach(function(P) {
2978
+ var O = P.split(":"), v = O.shift().trim();
2979
+ if (v) {
2980
+ var X = O.join(":").trim();
2981
+ try {
2982
+ d.append(v, X);
2983
+ } catch (de) {
2984
+ console.warn("Response " + de.message);
2985
+ }
2986
+ }
2987
+ }), d;
2988
+ }
2989
+ $.call(M.prototype);
2990
+ function k(o, d) {
2991
+ if (!(this instanceof k))
2992
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
2993
+ if (d || (d = {}), this.type = "default", this.status = d.status === void 0 ? 200 : d.status, this.status < 200 || this.status > 599)
2994
+ throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
2995
+ this.ok = this.status >= 200 && this.status < 300, this.statusText = d.statusText === void 0 ? "" : "" + d.statusText, this.headers = new y(d.headers), this.url = d.url || "", this._initBody(o);
2996
+ }
2997
+ $.call(k.prototype), k.prototype.clone = function() {
2998
+ return new k(this._bodyInit, {
2999
+ status: this.status,
3000
+ statusText: this.statusText,
3001
+ headers: new y(this.headers),
3002
+ url: this.url
3003
+ });
3004
+ }, k.error = function() {
3005
+ var o = new k(null, { status: 200, statusText: "" });
3006
+ return o.ok = !1, o.status = 0, o.type = "error", o;
3007
+ };
3008
+ var ze = [301, 302, 303, 307, 308];
3009
+ k.redirect = function(o, d) {
3010
+ if (ze.indexOf(d) === -1)
3011
+ throw new RangeError("Invalid status code");
3012
+ return new k(null, { status: d, headers: { location: o } });
3013
+ }, a.DOMException = c.DOMException;
3014
+ try {
3015
+ new a.DOMException();
3016
+ } catch {
3017
+ a.DOMException = function(d, E) {
3018
+ this.message = d, this.name = E;
3019
+ var P = Error(d);
3020
+ this.stack = P.stack;
3021
+ }, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
3022
+ }
3023
+ function ce(o, d) {
3024
+ return new Promise(function(E, P) {
3025
+ var O = new M(o, d);
3026
+ if (O.signal && O.signal.aborted)
3027
+ return P(new a.DOMException("Aborted", "AbortError"));
3028
+ var v = new XMLHttpRequest();
3029
+ function X() {
3030
+ v.abort();
3031
+ }
3032
+ v.onload = function() {
3033
+ var D = {
3034
+ statusText: v.statusText,
3035
+ headers: Qe(v.getAllResponseHeaders() || "")
3036
+ };
3037
+ O.url.indexOf("file://") === 0 && (v.status < 200 || v.status > 599) ? D.status = 200 : D.status = v.status, D.url = "responseURL" in v ? v.responseURL : D.headers.get("X-Request-URL");
3038
+ var q = "response" in v ? v.response : v.responseText;
3039
+ setTimeout(function() {
3040
+ E(new k(q, D));
3041
+ }, 0);
3042
+ }, v.onerror = function() {
3043
+ setTimeout(function() {
3044
+ P(new TypeError("Network request failed"));
3045
+ }, 0);
3046
+ }, v.ontimeout = function() {
3047
+ setTimeout(function() {
3048
+ P(new TypeError("Network request timed out"));
3049
+ }, 0);
3050
+ }, v.onabort = function() {
3051
+ setTimeout(function() {
3052
+ P(new a.DOMException("Aborted", "AbortError"));
3053
+ }, 0);
3054
+ };
3055
+ function de(D) {
3056
+ try {
3057
+ return D === "" && c.location.href ? c.location.href : D;
3058
+ } catch {
3059
+ return D;
3060
+ }
3061
+ }
3062
+ if (v.open(O.method, de(O.url), !0), O.credentials === "include" ? v.withCredentials = !0 : O.credentials === "omit" && (v.withCredentials = !1), "responseType" in v && (l.blob ? v.responseType = "blob" : l.arrayBuffer && (v.responseType = "arraybuffer")), d && typeof d.headers == "object" && !(d.headers instanceof y || c.Headers && d.headers instanceof c.Headers)) {
3063
+ var Ie = [];
3064
+ Object.getOwnPropertyNames(d.headers).forEach(function(D) {
3065
+ Ie.push(C(D)), v.setRequestHeader(D, S(d.headers[D]));
3066
+ }), O.headers.forEach(function(D, q) {
3067
+ Ie.indexOf(q) === -1 && v.setRequestHeader(q, D);
3068
+ });
3069
+ } else
3070
+ O.headers.forEach(function(D, q) {
3071
+ v.setRequestHeader(q, D);
3072
+ });
3073
+ O.signal && (O.signal.addEventListener("abort", X), v.onreadystatechange = function() {
3074
+ v.readyState === 4 && O.signal.removeEventListener("abort", X);
3075
+ }), v.send(typeof O._bodyInit > "u" ? null : O._bodyInit);
3076
+ });
3077
+ }
3078
+ return ce.polyfill = !0, c.fetch || (c.fetch = ce, c.Headers = y, c.Request = M, c.Response = k), a.Headers = y, a.Request = M, a.Response = k, a.fetch = ce, Object.defineProperty(a, "__esModule", { value: !0 }), a;
3079
+ })({});
3080
+ })(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
3081
+ var r = n.fetch ? n : i;
3082
+ 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;
3083
+ })(W, W.exports)), W.exports;
2584
3084
  }
2585
- function Ft(e) {
2586
- var t = new Set(e.definitions);
2587
- t.forEach(function(r) {
2588
- r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
2589
- var s = r[i];
2590
- s && typeof s == "object" && t.add(s);
2591
- });
3085
+ var ie = Yt();
3086
+ const ne = /* @__PURE__ */ Ht(ie), Qt = /* @__PURE__ */ Ke({
3087
+ __proto__: null,
3088
+ default: ne
3089
+ }, [ie]), U = (e) => {
3090
+ let t = {};
3091
+ return e && (typeof Headers < "u" && e instanceof Headers || Qt && ie.Headers && e instanceof ie.Headers ? t = We(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
3092
+ n && i !== void 0 && (t[n] = i);
3093
+ }) : t = e), t;
3094
+ }, be = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), zt = (e) => {
3095
+ if (!Array.isArray(e.query)) {
3096
+ const i = e, r = [`query=${encodeURIComponent(be(i.query))}`];
3097
+ return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
3098
+ }
3099
+ if (typeof e.variables < "u" && !Array.isArray(e.variables))
3100
+ throw new Error("Cannot create query with given variable type, array expected");
3101
+ const t = e, n = e.query.reduce((i, r, s) => (i.push({
3102
+ query: be(r),
3103
+ variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3104
+ }), i), []);
3105
+ return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3106
+ }, Jt = (e) => async (t) => {
3107
+ const { url: n, query: i, variables: r, operationName: s, fetch: a, fetchOptions: c, middleware: l } = t, m = { ...t.headers };
3108
+ let f = "", A;
3109
+ e === "POST" ? (A = Kt(i, r, s, c.jsonSerializer), typeof A == "string" && (m["Content-Type"] = "application/json")) : f = zt({
3110
+ query: i,
3111
+ variables: r,
3112
+ operationName: s,
3113
+ jsonSerializer: c.jsonSerializer ?? Ae
2592
3114
  });
2593
- var n = e.loc;
2594
- return n && (delete n.startToken, delete n.endToken), e;
2595
- }
2596
- function Bt(e) {
2597
- var t = Ge(e);
2598
- if (!ee.has(t)) {
2599
- var n = Be(e, {
2600
- experimentalFragmentVariables: ie,
2601
- allowLegacyFragmentVariables: ie
2602
- });
2603
- if (!n || n.kind !== "Document")
2604
- throw new Error("Not a valid GraphQL document.");
2605
- ee.set(t, Ft(Mt(n)));
3115
+ const C = {
3116
+ method: e,
3117
+ headers: m,
3118
+ body: A,
3119
+ ...c
3120
+ };
3121
+ let S = n, I = C;
3122
+ if (l) {
3123
+ const y = await Promise.resolve(l({ ...C, url: n, operationName: s, variables: r })), { url: N, ...b } = y;
3124
+ S = N, I = b;
2606
3125
  }
2607
- return ee.get(t);
2608
- }
2609
- function V(e) {
2610
- for (var t = [], n = 1; n < arguments.length; n++)
2611
- t[n - 1] = arguments[n];
2612
- typeof e == "string" && (e = [e]);
2613
- var r = e[0];
2614
- return t.forEach(function(i, s) {
2615
- i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2616
- }), Bt(r);
2617
- }
2618
- function qt() {
2619
- ee.clear(), ge.clear();
2620
- }
2621
- function Vt() {
2622
- Ve = !1;
2623
- }
2624
- function Gt() {
2625
- ie = !0;
2626
- }
2627
- function Ut() {
2628
- ie = !1;
3126
+ return f && (S = `${S}?${f}`), await a(S, I);
3127
+ };
3128
+ class Xt {
3129
+ constructor(t, n = {}) {
3130
+ this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
3131
+ const [r, s, a] = i, c = tt(r, s, a), { headers: l, fetch: m = ne, method: f = "POST", requestMiddleware: A, responseMiddleware: C, ...S } = this.requestConfig, { url: I } = this;
3132
+ c.signal !== void 0 && (S.signal = c.signal);
3133
+ const { operationName: y } = he(c.query);
3134
+ return me({
3135
+ url: I,
3136
+ query: c.query,
3137
+ variables: c.variables,
3138
+ headers: {
3139
+ ...U(fe(l)),
3140
+ ...U(c.requestHeaders)
3141
+ },
3142
+ operationName: y,
3143
+ fetch: m,
3144
+ method: f,
3145
+ fetchOptions: S,
3146
+ middleware: A
3147
+ }).then((N) => (C && C(N), N)).catch((N) => {
3148
+ throw C && C(N), N;
3149
+ });
3150
+ };
3151
+ }
3152
+ async request(t, ...n) {
3153
+ const [i, r] = n, s = et(t, i, r), { headers: a, fetch: c = ne, method: l = "POST", requestMiddleware: m, responseMiddleware: f, ...A } = this.requestConfig, { url: C } = this;
3154
+ s.signal !== void 0 && (A.signal = s.signal);
3155
+ const { query: S, operationName: I } = he(s.document);
3156
+ return me({
3157
+ url: C,
3158
+ query: S,
3159
+ variables: s.variables,
3160
+ headers: {
3161
+ ...U(fe(a)),
3162
+ ...U(s.requestHeaders)
3163
+ },
3164
+ operationName: I,
3165
+ fetch: c,
3166
+ method: l,
3167
+ fetchOptions: A,
3168
+ middleware: m
3169
+ }).then((y) => (f && f(y), y.data)).catch((y) => {
3170
+ throw f && f(y), y;
3171
+ });
3172
+ }
3173
+ // prettier-ignore
3174
+ batchRequests(t, n) {
3175
+ const i = nt(t, n), { headers: r, ...s } = this.requestConfig;
3176
+ i.signal !== void 0 && (s.signal = i.signal);
3177
+ const a = i.documents.map(({ document: l }) => he(l).query), c = i.documents.map(({ variables: l }) => l);
3178
+ return me({
3179
+ url: this.url,
3180
+ query: a,
3181
+ // @ts-expect-error TODO reconcile batch variables into system.
3182
+ variables: c,
3183
+ headers: {
3184
+ ...U(fe(r)),
3185
+ ...U(i.requestHeaders)
3186
+ },
3187
+ operationName: void 0,
3188
+ fetch: this.requestConfig.fetch ?? ne,
3189
+ method: this.requestConfig.method || "POST",
3190
+ fetchOptions: s,
3191
+ middleware: this.requestConfig.requestMiddleware
3192
+ }).then((l) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(l), l.data)).catch((l) => {
3193
+ throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(l), l;
3194
+ });
3195
+ }
3196
+ setHeaders(t) {
3197
+ return this.requestConfig.headers = t, this;
3198
+ }
3199
+ /**
3200
+ * Attach a header to the client. All subsequent requests will have this header.
3201
+ */
3202
+ setHeader(t, n) {
3203
+ const { headers: i } = this.requestConfig;
3204
+ return i ? i[t] = n : this.requestConfig.headers = { [t]: n }, this;
3205
+ }
3206
+ /**
3207
+ * Change the client endpoint. All subsequent requests will send to this endpoint.
3208
+ */
3209
+ setEndpoint(t) {
3210
+ return this.url = t, this;
3211
+ }
3212
+ }
3213
+ const me = async (e) => {
3214
+ const { query: t, variables: n, fetchOptions: i } = e, r = Jt(Ze(e.method ?? "post")), s = Array.isArray(e.query), a = await r(e), c = await Zt(a, i.jsonSerializer ?? Ae), l = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, m = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
3215
+ if (a.ok && m && l) {
3216
+ const { errors: f, ...A } = (Array.isArray(c), c), C = i.errorPolicy === "ignore" ? A : c;
3217
+ return {
3218
+ ...s ? { data: C } : C,
3219
+ headers: a.headers,
3220
+ status: a.status
3221
+ };
3222
+ } else {
3223
+ const f = typeof c == "string" ? {
3224
+ error: c
3225
+ } : c;
3226
+ throw new Y(
3227
+ // @ts-expect-error TODO
3228
+ { ...f, status: a.status, headers: a.headers },
3229
+ { query: t, variables: n }
3230
+ );
3231
+ }
3232
+ }, Kt = (e, t, n, i) => {
3233
+ const r = i ?? Ae;
3234
+ if (!Array.isArray(e))
3235
+ return r.stringify({ query: e, variables: t, operationName: n });
3236
+ if (typeof t < "u" && !Array.isArray(t))
3237
+ throw new Error("Cannot create request body with given variable type, array expected");
3238
+ const s = e.reduce((a, c, l) => (a.push({ query: c, variables: t ? t[l] : void 0 }), a), []);
3239
+ return r.stringify(s);
3240
+ }, Zt = async (e, t) => {
3241
+ let n;
3242
+ return e.headers.forEach((i, r) => {
3243
+ r.toLowerCase() === "content-type" && (n = i);
3244
+ }), 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();
3245
+ }, fe = (e) => typeof e == "function" ? e() : e;
3246
+ var se = function() {
3247
+ return se = Object.assign || function(t) {
3248
+ for (var n, i = 1, r = arguments.length; i < r; i++) {
3249
+ n = arguments[i];
3250
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
3251
+ }
3252
+ return t;
3253
+ }, se.apply(this, arguments);
3254
+ };
3255
+ var re = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map(), $e = !0, ae = !1;
3256
+ function je(e) {
3257
+ return e.replace(/[\s,]+/g, " ").trim();
3258
+ }
3259
+ function Wt(e) {
3260
+ return je(e.source.body.substring(e.start, e.end));
3261
+ }
3262
+ function en(e) {
3263
+ var t = /* @__PURE__ */ new Set(), n = [];
3264
+ return e.definitions.forEach(function(i) {
3265
+ if (i.kind === "FragmentDefinition") {
3266
+ var r = i.name.value, s = Wt(i.loc), a = Ee.get(r);
3267
+ a && !a.has(s) ? $e && console.warn("Warning: fragment with name " + r + ` already exists.
3268
+ graphql-tag enforces all fragment names across your application to be unique; read more about
3269
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || Ee.set(r, a = /* @__PURE__ */ new Set()), a.add(s), t.has(s) || (t.add(s), n.push(i));
3270
+ } else
3271
+ n.push(i);
3272
+ }), se(se({}, e), { definitions: n });
3273
+ }
3274
+ function tn(e) {
3275
+ var t = new Set(e.definitions);
3276
+ t.forEach(function(i) {
3277
+ i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
3278
+ var s = i[r];
3279
+ s && typeof s == "object" && t.add(s);
3280
+ });
3281
+ });
3282
+ var n = e.loc;
3283
+ return n && (delete n.startToken, delete n.endToken), e;
3284
+ }
3285
+ function nn(e) {
3286
+ var t = je(e);
3287
+ if (!re.has(t)) {
3288
+ var n = Ve(e, {
3289
+ experimentalFragmentVariables: ae,
3290
+ allowLegacyFragmentVariables: ae
3291
+ });
3292
+ if (!n || n.kind !== "Document")
3293
+ throw new Error("Not a valid GraphQL document.");
3294
+ re.set(t, tn(en(n)));
3295
+ }
3296
+ return re.get(t);
3297
+ }
3298
+ function T(e) {
3299
+ for (var t = [], n = 1; n < arguments.length; n++)
3300
+ t[n - 1] = arguments[n];
3301
+ typeof e == "string" && (e = [e]);
3302
+ var i = e[0];
3303
+ return t.forEach(function(r, s) {
3304
+ r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
3305
+ }), nn(i);
3306
+ }
3307
+ function rn() {
3308
+ re.clear(), Ee.clear();
2629
3309
  }
2630
- var $ = {
2631
- gql: V,
2632
- resetCaches: qt,
2633
- disableFragmentWarnings: Vt,
2634
- enableExperimentalFragmentVariables: Gt,
2635
- disableExperimentalFragmentVariables: Ut
3310
+ function sn() {
3311
+ $e = !1;
3312
+ }
3313
+ function an() {
3314
+ ae = !0;
3315
+ }
3316
+ function on() {
3317
+ ae = !1;
3318
+ }
3319
+ var j = {
3320
+ gql: T,
3321
+ resetCaches: rn,
3322
+ disableFragmentWarnings: sn,
3323
+ enableExperimentalFragmentVariables: an,
3324
+ disableExperimentalFragmentVariables: on
2636
3325
  };
2637
3326
  (function(e) {
2638
- e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
2639
- })(V || (V = {}));
2640
- V.default = V;
2641
- const S = V, $t = S`
3327
+ e.gql = j.gql, e.resetCaches = j.resetCaches, e.disableFragmentWarnings = j.disableFragmentWarnings, e.enableExperimentalFragmentVariables = j.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = j.disableExperimentalFragmentVariables;
3328
+ })(T || (T = {}));
3329
+ T.default = T;
3330
+ const un = T`
2642
3331
  query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
2643
3332
  locationAvailabilities(
2644
3333
  sku: $sku
@@ -2677,7 +3366,7 @@ const S = V, $t = S`
2677
3366
  }
2678
3367
  }
2679
3368
  }
2680
- `, jt = S`
3369
+ `, cn = T`
2681
3370
  query GetLocationAvailability($sku: String!, $locationID: ID!) {
2682
3371
  locationAvailability(sku: $sku, locationID: $locationID) {
2683
3372
  location {
@@ -2703,7 +3392,7 @@ const S = V, $t = S`
2703
3392
  inventoryQuantity
2704
3393
  }
2705
3394
  }
2706
- `, Ht = S`
3395
+ `, dn = T`
2707
3396
  query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
2708
3397
  purchasingCustomerMetafield(namespace: $namespace, key: $key) {
2709
3398
  id
@@ -2712,7 +3401,7 @@ const S = V, $t = S`
2712
3401
  value
2713
3402
  }
2714
3403
  }
2715
- `, Yt = S`
3404
+ `, ln = T`
2716
3405
  query GetPoints {
2717
3406
  purchasingCustomer {
2718
3407
  pointsApproved
@@ -2724,7 +3413,7 @@ const S = V, $t = S`
2724
3413
  }
2725
3414
  }
2726
3415
  }
2727
- `, zt = S`
3416
+ `, pn = T`
2728
3417
  query GetLocations($first: Int, $after: String, $filter: LocationFilter, $isReverse: Boolean! = false) {
2729
3418
  locations(first: $first, after: $after, filter: $filter, isReverse: $isReverse) {
2730
3419
  nodes {
@@ -2755,7 +3444,7 @@ const S = V, $t = S`
2755
3444
  }
2756
3445
  }
2757
3446
  }
2758
- `, Jt = S`
3447
+ `, hn = T`
2759
3448
  query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
2760
3449
  purchasingCustomer {
2761
3450
  id
@@ -2784,14 +3473,14 @@ const S = V, $t = S`
2784
3473
  }
2785
3474
  }
2786
3475
  }
2787
- `, Qt = S`
3476
+ `, mn = T`
2788
3477
  query GetPurchasingCustomerDiscountCodeCount {
2789
3478
  purchasingCustomer {
2790
3479
  id
2791
3480
  orderPriceAdjustmentRuleCount
2792
3481
  }
2793
3482
  }
2794
- `, Xt = S`
3483
+ `, fn = T`
2795
3484
  query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
2796
3485
  purchasingCustomer {
2797
3486
  id
@@ -2851,7 +3540,7 @@ const S = V, $t = S`
2851
3540
  }
2852
3541
  }
2853
3542
  }
2854
- `, Kt = S`
3543
+ `, gn = T`
2855
3544
  query GetPurchasingCustomerRank {
2856
3545
  purchasingCustomer {
2857
3546
  currentCustomerRank {
@@ -2892,14 +3581,14 @@ const S = V, $t = S`
2892
3581
  }
2893
3582
  }
2894
3583
  }
2895
- `, Zt = S`
3584
+ `, Cn = T`
2896
3585
  query GetSharingPurchasingCustomerCount {
2897
3586
  purchasingCustomer {
2898
3587
  id
2899
3588
  sharingPurchasingCustomerCount
2900
3589
  }
2901
3590
  }
2902
- `, Wt = S`
3591
+ `, yn = T`
2903
3592
  query GetPurchasingCustomerSharing {
2904
3593
  purchasingCustomer {
2905
3594
  id
@@ -2916,7 +3605,7 @@ const S = V, $t = S`
2916
3605
  }
2917
3606
  }
2918
3607
  }
2919
- `, en = S`
3608
+ `, En = T`
2920
3609
  query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
2921
3610
  productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2922
3611
  id
@@ -2948,14 +3637,14 @@ const S = V, $t = S`
2948
3637
  }
2949
3638
  }
2950
3639
  }
2951
- `, tn = S`
3640
+ `, An = T`
2952
3641
  query GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID($id: String!) {
2953
3642
  productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2954
3643
  id
2955
3644
  hasBackOrderProductVariants
2956
3645
  }
2957
3646
  }
2958
- `, nn = S`
3647
+ `, vn = T`
2959
3648
  query GetPointCampaignOrderRuleTargetCustomerRank {
2960
3649
  pointCampaignOrderRuleTargetCustomerRank {
2961
3650
  pointCampaignOrderRule {
@@ -2968,7 +3657,7 @@ const S = V, $t = S`
2968
3657
  fixedPoint
2969
3658
  }
2970
3659
  }
2971
- `, rn = S`
3660
+ `, Tn = T`
2972
3661
  query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
2973
3662
  estimatedShopifyCartPoint(input: $input) {
2974
3663
  pointsEarning
@@ -2984,7 +3673,7 @@ const S = V, $t = S`
2984
3673
  }
2985
3674
  }
2986
3675
  }
2987
- `, sn = S`
3676
+ `, In = T`
2988
3677
  query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
2989
3678
  estimatedShopifyCartLineItemPoint(input: $input) {
2990
3679
  pointsEarning
@@ -3000,7 +3689,7 @@ const S = V, $t = S`
3000
3689
  }
3001
3690
  }
3002
3691
  }
3003
- `, an = S`
3692
+ `, Pn = T`
3004
3693
  query GetPurchasingCustomerSMS {
3005
3694
  purchasingCustomer {
3006
3695
  id
@@ -3008,7 +3697,7 @@ const S = V, $t = S`
3008
3697
  smsVerifiedPhone
3009
3698
  }
3010
3699
  }
3011
- `, on = S`
3700
+ `, Sn = T`
3012
3701
  mutation PurchasingCustomerSendCustomerSharingActivationCode {
3013
3702
  purchasingCustomerSendCustomerSharingActivationCode {
3014
3703
  purchasingCustomer {
@@ -3024,7 +3713,7 @@ const S = V, $t = S`
3024
3713
  }
3025
3714
  }
3026
3715
  }
3027
- `, un = S`
3716
+ `, On = T`
3028
3717
  mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
3029
3718
  purchasingCustomerActivateCustomerSharing(
3030
3719
  input: {email: $email, activationCode: $activationCode}
@@ -3039,13 +3728,13 @@ const S = V, $t = S`
3039
3728
  }
3040
3729
  }
3041
3730
  }
3042
- `, cn = S`
3731
+ `, Rn = T`
3043
3732
  query GetMiles {
3044
3733
  purchasingCustomer {
3045
3734
  miles
3046
3735
  }
3047
3736
  }
3048
- `, ln = S`
3737
+ `, xn = T`
3049
3738
  query GetPurchasingCustomerMileChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileChangeActivitySortKey! = CREATED_AT) {
3050
3739
  purchasingCustomer {
3051
3740
  id
@@ -3074,7 +3763,7 @@ const S = V, $t = S`
3074
3763
  }
3075
3764
  }
3076
3765
  }
3077
- `, dn = S`
3766
+ `, Dn = T`
3078
3767
  query GetMileItems($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ShopifyMileItemSortKey! = CREATED_AT) {
3079
3768
  mileItems(
3080
3769
  first: $first
@@ -3102,7 +3791,7 @@ const S = V, $t = S`
3102
3791
  }
3103
3792
  }
3104
3793
  }
3105
- `, pn = S`
3794
+ `, Nn = T`
3106
3795
  query GetMileOrders($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: MileOrderSortKey! = CREATED_AT) {
3107
3796
  purchasingCustomer {
3108
3797
  id
@@ -3139,7 +3828,77 @@ const S = V, $t = S`
3139
3828
  }
3140
3829
  }
3141
3830
  }
3142
- `, hn = S`
3831
+ `, bn = T`
3832
+ query GetPurchasingCustomerRetailOrders($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: RetailOrderSortKey! = CREATED_AT) {
3833
+ purchasingCustomer {
3834
+ retailOrders(
3835
+ first: $first
3836
+ after: $after
3837
+ isReverse: $isReverse
3838
+ sortKeys: $sortKeys
3839
+ ) {
3840
+ nodes {
3841
+ id
3842
+ managementCode
3843
+ source
3844
+ purchasedAt
3845
+ fulfilledAt
3846
+ isCancelled
3847
+ cancelledAt
3848
+ tags
3849
+ paymentStatus
3850
+ retailLocation {
3851
+ id
3852
+ name
3853
+ displayName
3854
+ }
3855
+ totalQuantity
3856
+ currentTotalQuantity
3857
+ pointApplicationPrice {
3858
+ amount
3859
+ currencyCode
3860
+ }
3861
+ currentPointApplicationPrice {
3862
+ amount
3863
+ currencyCode
3864
+ }
3865
+ totalOrderDiscountPrice {
3866
+ amount
3867
+ currencyCode
3868
+ }
3869
+ subtotalPrice {
3870
+ amount
3871
+ currencyCode
3872
+ }
3873
+ totalTaxPrice {
3874
+ amount
3875
+ currencyCode
3876
+ }
3877
+ currentTotalTaxPrice {
3878
+ amount
3879
+ currencyCode
3880
+ }
3881
+ currentSubtotalPrice {
3882
+ amount
3883
+ currencyCode
3884
+ }
3885
+ totalPrice {
3886
+ amount
3887
+ currencyCode
3888
+ }
3889
+ createdAt
3890
+ updatedAt
3891
+ }
3892
+ pageInfo {
3893
+ startCursor
3894
+ endCursor
3895
+ hasNextPage
3896
+ hasPreviousPage
3897
+ }
3898
+ }
3899
+ }
3900
+ }
3901
+ `, kn = T`
3143
3902
  mutation MileItemExchange($mileItemID: ID!) {
3144
3903
  mileItemExchange(input: {mileItemID: $mileItemID}) {
3145
3904
  mileOrder {
@@ -3162,7 +3921,7 @@ const S = V, $t = S`
3162
3921
  }
3163
3922
  }
3164
3923
  }
3165
- `, mn = S`
3924
+ `, _n = T`
3166
3925
  mutation PurchasingCustomerSendSMSVerificationCode($phone: String!) {
3167
3926
  purchasingCustomerSendSMSVerificationCode(input: {phone: $phone}) {
3168
3927
  purchasingCustomer {
@@ -3172,7 +3931,7 @@ const S = V, $t = S`
3172
3931
  }
3173
3932
  }
3174
3933
  }
3175
- `, fn = S`
3934
+ `, Ln = T`
3176
3935
  mutation PurchasingCustomerVerifySMS($phone: String!, $verificationCode: String!) {
3177
3936
  purchasingCustomerVerifySMS(
3178
3937
  input: {phone: $phone, verificationCode: $verificationCode}
@@ -3184,582 +3943,111 @@ const S = V, $t = S`
3184
3943
  }
3185
3944
  }
3186
3945
  }
3187
- `, gn = (e, t, n, r) => e();
3188
- function Cn(e, t = gn) {
3946
+ `, wn = T`
3947
+ mutation DiscountUsageCreate($orderPriceAdjustmentRuleID: ID!) {
3948
+ shopifyOrderPriceAdjustmentUsageCreate(
3949
+ input: {orderPriceAdjustmentRuleID: $orderPriceAdjustmentRuleID}
3950
+ ) {
3951
+ orderPriceAdjustmentRule {
3952
+ id
3953
+ }
3954
+ }
3955
+ }
3956
+ `, Mn = (e, t, n, i) => e();
3957
+ function qn(e, t = Mn) {
3189
3958
  return {
3190
- GetLocationAvailabilities(n, r) {
3191
- return t((i) => e.request($t, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3959
+ GetLocationAvailabilities(n, i, r) {
3960
+ return t((s) => e.request({ document: un, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetLocationAvailabilities", "query", n);
3961
+ },
3962
+ GetLocationAvailability(n, i, r) {
3963
+ return t((s) => e.request({ document: cn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetLocationAvailability", "query", n);
3964
+ },
3965
+ GetPurchasingCustomerMetafield(n, i, r) {
3966
+ return t((s) => e.request({ document: dn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerMetafield", "query", n);
3192
3967
  },
3193
- GetLocationAvailability(n, r) {
3194
- return t((i) => e.request(jt, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3968
+ GetPoints(n, i, r) {
3969
+ return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPoints", "query", n);
3195
3970
  },
3196
- GetPurchasingCustomerMetafield(n, r) {
3197
- return t((i) => e.request(Ht, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3971
+ GetLocations(n, i, r) {
3972
+ return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetLocations", "query", n);
3198
3973
  },
3199
- GetPoints(n, r) {
3200
- return t((i) => e.request(Yt, n, { ...r, ...i }), "GetPoints", "query", n);
3974
+ GetPurchasingCustomerDiscounts(n, i, r) {
3975
+ return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerDiscounts", "query", n);
3201
3976
  },
3202
- GetLocations(n, r) {
3203
- return t((i) => e.request(zt, n, { ...r, ...i }), "GetLocations", "query", n);
3977
+ GetPurchasingCustomerDiscountCodeCount(n, i, r) {
3978
+ return t((s) => e.request({ document: mn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3204
3979
  },
3205
- GetPurchasingCustomerDiscounts(n, r) {
3206
- return t((i) => e.request(Jt, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3980
+ GetPurchasingCustomerPointChangeActivities(n, i, r) {
3981
+ return t((s) => e.request({ document: fn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3207
3982
  },
3208
- GetPurchasingCustomerDiscountCodeCount(n, r) {
3209
- return t((i) => e.request(Qt, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3983
+ GetPurchasingCustomerRank(n, i, r) {
3984
+ return t((s) => e.request({ document: gn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerRank", "query", n);
3210
3985
  },
3211
- GetPurchasingCustomerPointChangeActivities(n, r) {
3212
- return t((i) => e.request(Xt, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3986
+ GetSharingPurchasingCustomerCount(n, i, r) {
3987
+ return t((s) => e.request({ document: Cn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetSharingPurchasingCustomerCount", "query", n);
3213
3988
  },
3214
- GetPurchasingCustomerRank(n, r) {
3215
- return t((i) => e.request(Kt, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3989
+ GetPurchasingCustomerSharing(n, i, r) {
3990
+ return t((s) => e.request({ document: yn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerSharing", "query", n);
3216
3991
  },
3217
- GetSharingPurchasingCustomerCount(n, r) {
3218
- return t((i) => e.request(Zt, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3992
+ GetProduct(n, i, r) {
3993
+ return t((s) => e.request({ document: En, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetProduct", "query", n);
3219
3994
  },
3220
- GetPurchasingCustomerSharing(n, r) {
3221
- return t((i) => e.request(Wt, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3995
+ GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, i, r) {
3996
+ return t((s) => e.request({ document: An, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
3222
3997
  },
3223
- GetProduct(n, r) {
3224
- return t((i) => e.request(en, n, { ...r, ...i }), "GetProduct", "query", n);
3998
+ GetPointCampaignOrderRuleTargetCustomerRank(n, i, r) {
3999
+ return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3225
4000
  },
3226
- GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n, r) {
3227
- return t((i) => e.request(tn, n, { ...r, ...i }), "GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID", "query", n);
4001
+ GetEstimatedShopifyCartPoint(n, i, r) {
4002
+ return t((s) => e.request({ document: Tn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetEstimatedShopifyCartPoint", "query", n);
3228
4003
  },
3229
- GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
3230
- return t((i) => e.request(nn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
4004
+ GetEstimatedShopifyCartLineItemPoint(n, i, r) {
4005
+ return t((s) => e.request({ document: In, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
3231
4006
  },
3232
- GetEstimatedShopifyCartPoint(n, r) {
3233
- return t((i) => e.request(rn, n, { ...r, ...i }), "GetEstimatedShopifyCartPoint", "query", n);
4007
+ GetPurchasingCustomerSMS(n, i, r) {
4008
+ return t((s) => e.request({ document: Pn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerSMS", "query", n);
3234
4009
  },
3235
- GetEstimatedShopifyCartLineItemPoint(n, r) {
3236
- return t((i) => e.request(sn, n, { ...r, ...i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
4010
+ PurchasingCustomerSendCustomerSharingActivationCode(n, i, r) {
4011
+ return t((s) => e.request({ document: Sn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3237
4012
  },
3238
- GetPurchasingCustomerSMS(n, r) {
3239
- return t((i) => e.request(an, n, { ...r, ...i }), "GetPurchasingCustomerSMS", "query", n);
4013
+ PurchasingCustomerActivateCustomerSharing(n, i, r) {
4014
+ return t((s) => e.request({ document: On, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3240
4015
  },
3241
- PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3242
- return t((i) => e.request(on, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
4016
+ GetMiles(n, i, r) {
4017
+ return t((s) => e.request({ document: Rn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetMiles", "query", n);
3243
4018
  },
3244
- PurchasingCustomerActivateCustomerSharing(n, r) {
3245
- return t((i) => e.request(un, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
4019
+ GetPurchasingCustomerMileChangeActivities(n, i, r) {
4020
+ return t((s) => e.request({ document: xn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerMileChangeActivities", "query", n);
3246
4021
  },
3247
- GetMiles(n, r) {
3248
- return t((i) => e.request(cn, n, { ...r, ...i }), "GetMiles", "query", n);
4022
+ GetMileItems(n, i, r) {
4023
+ return t((s) => e.request({ document: Dn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetMileItems", "query", n);
3249
4024
  },
3250
- GetPurchasingCustomerMileChangeActivities(n, r) {
3251
- return t((i) => e.request(ln, n, { ...r, ...i }), "GetPurchasingCustomerMileChangeActivities", "query", n);
4025
+ GetMileOrders(n, i, r) {
4026
+ return t((s) => e.request({ document: Nn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetMileOrders", "query", n);
3252
4027
  },
3253
- GetMileItems(n, r) {
3254
- return t((i) => e.request(dn, n, { ...r, ...i }), "GetMileItems", "query", n);
4028
+ GetPurchasingCustomerRetailOrders(n, i, r) {
4029
+ return t((s) => e.request({ document: bn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "GetPurchasingCustomerRetailOrders", "query", n);
3255
4030
  },
3256
- GetMileOrders(n, r) {
3257
- return t((i) => e.request(pn, n, { ...r, ...i }), "GetMileOrders", "query", n);
4031
+ MileItemExchange(n, i, r) {
4032
+ return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "MileItemExchange", "mutation", n);
3258
4033
  },
3259
- MileItemExchange(n, r) {
3260
- return t((i) => e.request(hn, n, { ...r, ...i }), "MileItemExchange", "mutation", n);
4034
+ PurchasingCustomerSendSMSVerificationCode(n, i, r) {
4035
+ return t((s) => e.request({ document: _n, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "PurchasingCustomerSendSMSVerificationCode", "mutation", n);
3261
4036
  },
3262
- PurchasingCustomerSendSMSVerificationCode(n, r) {
3263
- return t((i) => e.request(mn, n, { ...r, ...i }), "PurchasingCustomerSendSMSVerificationCode", "mutation", n);
4037
+ PurchasingCustomerVerifySMS(n, i, r) {
4038
+ return t((s) => e.request({ document: Ln, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "PurchasingCustomerVerifySMS", "mutation", n);
3264
4039
  },
3265
- PurchasingCustomerVerifySMS(n, r) {
3266
- return t((i) => e.request(fn, n, { ...r, ...i }), "PurchasingCustomerVerifySMS", "mutation", n);
4040
+ DiscountUsageCreate(n, i, r) {
4041
+ return t((s) => e.request({ document: wn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "DiscountUsageCreate", "mutation", n);
3267
4042
  }
3268
4043
  };
3269
4044
  }
3270
- const Ae = JSON, yn = (e) => e.toUpperCase(), En = (e) => {
3271
- const t = {};
3272
- return e.forEach((n, r) => {
3273
- t[r] = n;
3274
- }), t;
3275
- }, An = (e, t, n) => e.document ? e : {
3276
- document: e,
3277
- variables: t,
3278
- requestHeaders: n,
3279
- signal: void 0
3280
- }, vn = (e, t, n) => e.query ? e : {
3281
- query: e,
3282
- variables: t,
3283
- requestHeaders: n,
3284
- signal: void 0
3285
- }, In = (e, t) => e.documents ? e : {
3286
- documents: e,
3287
- requestHeaders: t,
3288
- signal: void 0
3289
- }, Re = (e) => {
3290
- var r, i;
3291
- let t;
3292
- const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
3293
- return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
3294
- }, le = (e) => {
3295
- if (typeof e == "string") {
3296
- let n;
3297
- try {
3298
- const r = Be(e);
3299
- n = Re(r);
3300
- } catch {
3301
- }
3302
- return { query: e, operationName: n };
3303
- }
3304
- const t = Re(e);
3305
- return { query: kt(e), operationName: t };
3306
- };
3307
- class H extends Error {
3308
- constructor(t, n) {
3309
- const r = `${H.extractMessage(t)}: ${JSON.stringify({
3310
- response: t,
3311
- request: n
3312
- })}`;
3313
- super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
3314
- }
3315
- static extractMessage(t) {
3316
- var n, r;
3317
- return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
3318
- }
3319
- }
3320
- var Sn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3321
- function Tn(e) {
3322
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3323
- }
3324
- var Ce = { exports: {} };
3325
- (function(e, t) {
3326
- var n = typeof self < "u" ? self : Sn, r = function() {
3327
- function s() {
3328
- this.fetch = !1, this.DOMException = n.DOMException;
3329
- }
3330
- return s.prototype = n, new s();
3331
- }();
3332
- (function(s) {
3333
- (function(a) {
3334
- var c = {
3335
- searchParams: "URLSearchParams" in s,
3336
- iterable: "Symbol" in s && "iterator" in Symbol,
3337
- blob: "FileReader" in s && "Blob" in s && function() {
3338
- try {
3339
- return new Blob(), !0;
3340
- } catch {
3341
- return !1;
3342
- }
3343
- }(),
3344
- formData: "FormData" in s,
3345
- arrayBuffer: "ArrayBuffer" in s
3346
- };
3347
- function p(o) {
3348
- return o && DataView.prototype.isPrototypeOf(o);
3349
- }
3350
- if (c.arrayBuffer)
3351
- var h = [
3352
- "[object Int8Array]",
3353
- "[object Uint8Array]",
3354
- "[object Uint8ClampedArray]",
3355
- "[object Int16Array]",
3356
- "[object Uint16Array]",
3357
- "[object Int32Array]",
3358
- "[object Uint32Array]",
3359
- "[object Float32Array]",
3360
- "[object Float64Array]"
3361
- ], f = ArrayBuffer.isView || function(o) {
3362
- return o && h.indexOf(Object.prototype.toString.call(o)) > -1;
3363
- };
3364
- function C(o) {
3365
- if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))
3366
- throw new TypeError("Invalid character in header field name");
3367
- return o.toLowerCase();
3368
- }
3369
- function y(o) {
3370
- return typeof o != "string" && (o = String(o)), o;
3371
- }
3372
- function I(o) {
3373
- var l = {
3374
- next: function() {
3375
- var E = o.shift();
3376
- return { done: E === void 0, value: E };
3377
- }
3378
- };
3379
- return c.iterable && (l[Symbol.iterator] = function() {
3380
- return l;
3381
- }), l;
3382
- }
3383
- function g(o) {
3384
- this.map = {}, o instanceof g ? o.forEach(function(l, E) {
3385
- this.append(E, l);
3386
- }, this) : Array.isArray(o) ? o.forEach(function(l) {
3387
- this.append(l[0], l[1]);
3388
- }, this) : o && Object.getOwnPropertyNames(o).forEach(function(l) {
3389
- this.append(l, o[l]);
3390
- }, this);
3391
- }
3392
- g.prototype.append = function(o, l) {
3393
- o = C(o), l = y(l);
3394
- var E = this.map[o];
3395
- this.map[o] = E ? E + ", " + l : l;
3396
- }, g.prototype.delete = function(o) {
3397
- delete this.map[C(o)];
3398
- }, g.prototype.get = function(o) {
3399
- return o = C(o), this.has(o) ? this.map[o] : null;
3400
- }, g.prototype.has = function(o) {
3401
- return this.map.hasOwnProperty(C(o));
3402
- }, g.prototype.set = function(o, l) {
3403
- this.map[C(o)] = y(l);
3404
- }, g.prototype.forEach = function(o, l) {
3405
- for (var E in this.map)
3406
- this.map.hasOwnProperty(E) && o.call(l, this.map[E], E, this);
3407
- }, g.prototype.keys = function() {
3408
- var o = [];
3409
- return this.forEach(function(l, E) {
3410
- o.push(E);
3411
- }), I(o);
3412
- }, g.prototype.values = function() {
3413
- var o = [];
3414
- return this.forEach(function(l) {
3415
- o.push(l);
3416
- }), I(o);
3417
- }, g.prototype.entries = function() {
3418
- var o = [];
3419
- return this.forEach(function(l, E) {
3420
- o.push([E, l]);
3421
- }), I(o);
3422
- }, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
3423
- function T(o) {
3424
- if (o.bodyUsed)
3425
- return Promise.reject(new TypeError("Already read"));
3426
- o.bodyUsed = !0;
3427
- }
3428
- function N(o) {
3429
- return new Promise(function(l, E) {
3430
- o.onload = function() {
3431
- l(o.result);
3432
- }, o.onerror = function() {
3433
- E(o.error);
3434
- };
3435
- });
3436
- }
3437
- function D(o) {
3438
- var l = new FileReader(), E = N(l);
3439
- return l.readAsArrayBuffer(o), E;
3440
- }
3441
- function z(o) {
3442
- var l = new FileReader(), E = N(l);
3443
- return l.readAsText(o), E;
3444
- }
3445
- function _(o) {
3446
- for (var l = new Uint8Array(o), E = new Array(l.length), O = 0; O < l.length; O++)
3447
- E[O] = String.fromCharCode(l[O]);
3448
- return E.join("");
3449
- }
3450
- function b(o) {
3451
- if (o.slice)
3452
- return o.slice(0);
3453
- var l = new Uint8Array(o.byteLength);
3454
- return l.set(new Uint8Array(o)), l.buffer;
3455
- }
3456
- function F() {
3457
- return this.bodyUsed = !1, this._initBody = function(o) {
3458
- this._bodyInit = o, o ? typeof o == "string" ? this._bodyText = o : c.blob && Blob.prototype.isPrototypeOf(o) ? this._bodyBlob = o : c.formData && FormData.prototype.isPrototypeOf(o) ? this._bodyFormData = o : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) ? this._bodyText = o.toString() : c.arrayBuffer && c.blob && p(o) ? (this._bodyArrayBuffer = b(o.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(o) || f(o)) ? this._bodyArrayBuffer = b(o) : this._bodyText = o = Object.prototype.toString.call(o) : this._bodyText = "", this.headers.get("content-type") || (typeof o == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(o) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
3459
- }, c.blob && (this.blob = function() {
3460
- var o = T(this);
3461
- if (o)
3462
- return o;
3463
- if (this._bodyBlob)
3464
- return Promise.resolve(this._bodyBlob);
3465
- if (this._bodyArrayBuffer)
3466
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
3467
- if (this._bodyFormData)
3468
- throw new Error("could not read FormData body as blob");
3469
- return Promise.resolve(new Blob([this._bodyText]));
3470
- }, this.arrayBuffer = function() {
3471
- return this._bodyArrayBuffer ? T(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
3472
- }), this.text = function() {
3473
- var o = T(this);
3474
- if (o)
3475
- return o;
3476
- if (this._bodyBlob)
3477
- return z(this._bodyBlob);
3478
- if (this._bodyArrayBuffer)
3479
- return Promise.resolve(_(this._bodyArrayBuffer));
3480
- if (this._bodyFormData)
3481
- throw new Error("could not read FormData body as text");
3482
- return Promise.resolve(this._bodyText);
3483
- }, c.formData && (this.formData = function() {
3484
- return this.text().then(Ue);
3485
- }), this.json = function() {
3486
- return this.text().then(JSON.parse);
3487
- }, this;
3488
- }
3489
- var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
3490
- function Q(o) {
3491
- var l = o.toUpperCase();
3492
- return J.indexOf(l) > -1 ? l : o;
3493
- }
3494
- function w(o, l) {
3495
- l = l || {};
3496
- var E = l.body;
3497
- if (o instanceof w) {
3498
- if (o.bodyUsed)
3499
- throw new TypeError("Already read");
3500
- this.url = o.url, this.credentials = o.credentials, l.headers || (this.headers = new g(o.headers)), this.method = o.method, this.mode = o.mode, this.signal = o.signal, !E && o._bodyInit != null && (E = o._bodyInit, o.bodyUsed = !0);
3501
- } else
3502
- this.url = String(o);
3503
- if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = Q(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
3504
- throw new TypeError("Body not allowed for GET or HEAD requests");
3505
- this._initBody(E);
3506
- }
3507
- w.prototype.clone = function() {
3508
- return new w(this, { body: this._bodyInit });
3509
- };
3510
- function Ue(o) {
3511
- var l = new FormData();
3512
- return o.trim().split("&").forEach(function(E) {
3513
- if (E) {
3514
- var O = E.split("="), R = O.shift().replace(/\+/g, " "), v = O.join("=").replace(/\+/g, " ");
3515
- l.append(decodeURIComponent(R), decodeURIComponent(v));
3516
- }
3517
- }), l;
3518
- }
3519
- function $e(o) {
3520
- var l = new g(), E = o.replace(/\r?\n[\t ]+/g, " ");
3521
- return E.split(/\r?\n/).forEach(function(O) {
3522
- var R = O.split(":"), v = R.shift().trim();
3523
- if (v) {
3524
- var X = R.join(":").trim();
3525
- l.append(v, X);
3526
- }
3527
- }), l;
3528
- }
3529
- F.call(w.prototype);
3530
- function L(o, l) {
3531
- l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new g(l.headers), this.url = l.url || "", this._initBody(o);
3532
- }
3533
- F.call(L.prototype), L.prototype.clone = function() {
3534
- return new L(this._bodyInit, {
3535
- status: this.status,
3536
- statusText: this.statusText,
3537
- headers: new g(this.headers),
3538
- url: this.url
3539
- });
3540
- }, L.error = function() {
3541
- var o = new L(null, { status: 0, statusText: "" });
3542
- return o.type = "error", o;
3543
- };
3544
- var je = [301, 302, 303, 307, 308];
3545
- L.redirect = function(o, l) {
3546
- if (je.indexOf(l) === -1)
3547
- throw new RangeError("Invalid status code");
3548
- return new L(null, { status: l, headers: { location: o } });
3549
- }, a.DOMException = s.DOMException;
3550
- try {
3551
- new a.DOMException();
3552
- } catch {
3553
- a.DOMException = function(l, E) {
3554
- this.message = l, this.name = E;
3555
- var O = Error(l);
3556
- this.stack = O.stack;
3557
- }, a.DOMException.prototype = Object.create(Error.prototype), a.DOMException.prototype.constructor = a.DOMException;
3558
- }
3559
- function oe(o, l) {
3560
- return new Promise(function(E, O) {
3561
- var R = new w(o, l);
3562
- if (R.signal && R.signal.aborted)
3563
- return O(new a.DOMException("Aborted", "AbortError"));
3564
- var v = new XMLHttpRequest();
3565
- function X() {
3566
- v.abort();
3567
- }
3568
- v.onload = function() {
3569
- var U = {
3570
- status: v.status,
3571
- statusText: v.statusText,
3572
- headers: $e(v.getAllResponseHeaders() || "")
3573
- };
3574
- U.url = "responseURL" in v ? v.responseURL : U.headers.get("X-Request-URL");
3575
- var ue = "response" in v ? v.response : v.responseText;
3576
- E(new L(ue, U));
3577
- }, v.onerror = function() {
3578
- O(new TypeError("Network request failed"));
3579
- }, v.ontimeout = function() {
3580
- O(new TypeError("Network request failed"));
3581
- }, v.onabort = function() {
3582
- O(new a.DOMException("Aborted", "AbortError"));
3583
- }, v.open(R.method, R.url, !0), R.credentials === "include" ? v.withCredentials = !0 : R.credentials === "omit" && (v.withCredentials = !1), "responseType" in v && c.blob && (v.responseType = "blob"), R.headers.forEach(function(U, ue) {
3584
- v.setRequestHeader(ue, U);
3585
- }), R.signal && (R.signal.addEventListener("abort", X), v.onreadystatechange = function() {
3586
- v.readyState === 4 && R.signal.removeEventListener("abort", X);
3587
- }), v.send(typeof R._bodyInit > "u" ? null : R._bodyInit);
3588
- });
3589
- }
3590
- return oe.polyfill = !0, s.fetch || (s.fetch = oe, s.Headers = g, s.Request = w, s.Response = L), a.Headers = g, a.Request = w, a.Response = L, a.fetch = oe, Object.defineProperty(a, "__esModule", { value: !0 }), a;
3591
- })({});
3592
- })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
3593
- var i = r;
3594
- t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
3595
- })(Ce, Ce.exports);
3596
- var re = Ce.exports;
3597
- const te = /* @__PURE__ */ Tn(re), xn = /* @__PURE__ */ ze({
3598
- __proto__: null,
3599
- default: te
3600
- }, [re]), B = (e) => {
3601
- let t = {};
3602
- return e && (typeof Headers < "u" && e instanceof Headers || xn && re.Headers && e instanceof re.Headers ? t = En(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
3603
- n && r !== void 0 && (t[n] = r);
3604
- }) : t = e), t;
3605
- }, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Pn = (e) => {
3606
- if (!Array.isArray(e.query)) {
3607
- const r = e, i = [`query=${encodeURIComponent(Oe(r.query))}`];
3608
- return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
3609
- }
3610
- if (typeof e.variables < "u" && !Array.isArray(e.variables))
3611
- throw new Error("Cannot create query with given variable type, array expected");
3612
- const t = e, n = e.query.reduce((r, i, s) => (r.push({
3613
- query: Oe(i),
3614
- variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3615
- }), r), []);
3616
- return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3617
- }, Rn = (e) => async (t) => {
3618
- const { url: n, query: r, variables: i, operationName: s, fetch: a, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
3619
- let f = "", C;
3620
- e === "POST" ? (C = Nn(r, i, s, c.jsonSerializer), typeof C == "string" && (h["Content-Type"] = "application/json")) : f = Pn({
3621
- query: r,
3622
- variables: i,
3623
- operationName: s,
3624
- jsonSerializer: c.jsonSerializer ?? Ae
3625
- });
3626
- const y = {
3627
- method: e,
3628
- headers: h,
3629
- body: C,
3630
- ...c
3631
- };
3632
- let I = n, g = y;
3633
- if (p) {
3634
- const T = await Promise.resolve(p({ ...y, url: n, operationName: s, variables: i })), { url: N, ...D } = T;
3635
- I = N, g = D;
3636
- }
3637
- return f && (I = `${I}?${f}`), await a(I, g);
3638
- };
3639
- class On {
3640
- constructor(t, n = {}) {
3641
- this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
3642
- const [i, s, a] = r, c = vn(i, s, a), { headers: p, fetch: h = te, method: f = "POST", requestMiddleware: C, responseMiddleware: y, ...I } = this.requestConfig, { url: g } = this;
3643
- c.signal !== void 0 && (I.signal = c.signal);
3644
- const { operationName: T } = le(c.query);
3645
- return de({
3646
- url: g,
3647
- query: c.query,
3648
- variables: c.variables,
3649
- headers: {
3650
- ...B(pe(p)),
3651
- ...B(c.requestHeaders)
3652
- },
3653
- operationName: T,
3654
- fetch: h,
3655
- method: f,
3656
- fetchOptions: I,
3657
- middleware: C
3658
- }).then((N) => (y && y(N), N)).catch((N) => {
3659
- throw y && y(N), N;
3660
- });
3661
- };
3662
- }
3663
- async request(t, ...n) {
3664
- const [r, i] = n, s = An(t, r, i), { headers: a, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: f, ...C } = this.requestConfig, { url: y } = this;
3665
- s.signal !== void 0 && (C.signal = s.signal);
3666
- const { query: I, operationName: g } = le(s.document);
3667
- return de({
3668
- url: y,
3669
- query: I,
3670
- variables: s.variables,
3671
- headers: {
3672
- ...B(pe(a)),
3673
- ...B(s.requestHeaders)
3674
- },
3675
- operationName: g,
3676
- fetch: c,
3677
- method: p,
3678
- fetchOptions: C,
3679
- middleware: h
3680
- }).then((T) => (f && f(T), T.data)).catch((T) => {
3681
- throw f && f(T), T;
3682
- });
3683
- }
3684
- // prettier-ignore
3685
- batchRequests(t, n) {
3686
- const r = In(t, n), { headers: i, ...s } = this.requestConfig;
3687
- r.signal !== void 0 && (s.signal = r.signal);
3688
- const a = r.documents.map(({ document: p }) => le(p).query), c = r.documents.map(({ variables: p }) => p);
3689
- return de({
3690
- url: this.url,
3691
- query: a,
3692
- // @ts-expect-error TODO reconcile batch variables into system.
3693
- variables: c,
3694
- headers: {
3695
- ...B(pe(i)),
3696
- ...B(r.requestHeaders)
3697
- },
3698
- operationName: void 0,
3699
- fetch: this.requestConfig.fetch ?? te,
3700
- method: this.requestConfig.method || "POST",
3701
- fetchOptions: s,
3702
- middleware: this.requestConfig.requestMiddleware
3703
- }).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => {
3704
- throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p;
3705
- });
3706
- }
3707
- setHeaders(t) {
3708
- return this.requestConfig.headers = t, this;
3709
- }
3710
- /**
3711
- * Attach a header to the client. All subsequent requests will have this header.
3712
- */
3713
- setHeader(t, n) {
3714
- const { headers: r } = this.requestConfig;
3715
- return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3716
- }
3717
- /**
3718
- * Change the client endpoint. All subsequent requests will send to this endpoint.
3719
- */
3720
- setEndpoint(t) {
3721
- return this.url = t, this;
3722
- }
3723
- }
3724
- const de = async (e) => {
3725
- const { query: t, variables: n, fetchOptions: r } = e, i = Rn(yn(e.method ?? "post")), s = Array.isArray(e.query), a = await i(e), c = await Dn(a, r.jsonSerializer ?? Ae), p = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3726
- if (a.ok && h && p) {
3727
- const { errors: f, ...C } = (Array.isArray(c), c), y = r.errorPolicy === "ignore" ? C : c;
3728
- return {
3729
- ...s ? { data: y } : y,
3730
- headers: a.headers,
3731
- status: a.status
3732
- };
3733
- } else {
3734
- const f = typeof c == "string" ? {
3735
- error: c
3736
- } : c;
3737
- throw new H(
3738
- // @ts-expect-error TODO
3739
- { ...f, status: a.status, headers: a.headers },
3740
- { query: t, variables: n }
3741
- );
3742
- }
3743
- }, Nn = (e, t, n, r) => {
3744
- const i = r ?? Ae;
3745
- if (!Array.isArray(e))
3746
- return i.stringify({ query: e, variables: t, operationName: n });
3747
- if (typeof t < "u" && !Array.isArray(t))
3748
- throw new Error("Cannot create request body with given variable type, array expected");
3749
- const s = e.reduce((a, c, p) => (a.push({ query: c, variables: t ? t[p] : void 0 }), a), []);
3750
- return i.stringify(s);
3751
- }, Dn = async (e, t) => {
3752
- let n;
3753
- return e.headers.forEach((r, i) => {
3754
- i.toLowerCase() === "content-type" && (n = r);
3755
- }), 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();
3756
- }, pe = (e) => typeof e == "function" ? e() : e;
3757
- var bn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(bn || {}), kn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(kn || {});
3758
- class Ln {
4045
+ var Fn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Fn || {}), Bn = /* @__PURE__ */ ((e) => (e.Retail = "RETAIL", e.Warehouse = "WAREHOUSE", e))(Bn || {});
4046
+ class Vn {
3759
4047
  constructor(t) {
3760
- ve(this, "api");
3761
- this.api = Cn(
3762
- new On(`${t}/apps/sq-api`, {
4048
+ Pe(this, "api");
4049
+ this.api = qn(
4050
+ new Xt(`${t}/apps/sq-api`, {
3763
4051
  headers: {
3764
4052
  "X-SQ-CLIENT": "ShopifyAppProxy"
3765
4053
  }
@@ -3774,12 +4062,12 @@ class Ln {
3774
4062
  * @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
3775
4063
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
3776
4064
  */
3777
- async getLocationAvailabilities(t, n, r, i) {
4065
+ async getLocationAvailabilities(t, n, i, r) {
3778
4066
  const s = await this.api.GetLocationAvailabilities({
3779
4067
  sku: t,
3780
4068
  first: n,
3781
- after: r,
3782
- isReverse: i
4069
+ after: i,
4070
+ isReverse: r
3783
4071
  });
3784
4072
  return {
3785
4073
  nodes: s.locationAvailabilities.nodes.map(
@@ -3814,27 +4102,27 @@ class Ln {
3814
4102
  * @param {string} locationID 在庫情報を取得したいLocationのID。
3815
4103
  */
3816
4104
  async getLocationAvailability(t, n) {
3817
- const r = await this.api.GetLocationAvailability({ sku: t, locationID: n });
4105
+ const i = await this.api.GetLocationAvailability({ sku: t, locationID: n });
3818
4106
  return {
3819
4107
  location: {
3820
- id: r.locationAvailability.location.id,
3821
- name: r.locationAvailability.location.name,
3822
- phone: r.locationAvailability.location.phone,
3823
- mapURL: r.locationAvailability.location.mapURL,
3824
- tags: r.locationAvailability.location.tags,
3825
- address: r.locationAvailability.location.address ? {
3826
- id: r.locationAvailability.location.address.id,
3827
- countryCode: r.locationAvailability.location.address.countryCode,
3828
- country: r.locationAvailability.location.address.country,
3829
- postalCode: r.locationAvailability.location.address.postalCode,
3830
- provinceCode: r.locationAvailability.location.address.provinceCode,
3831
- province: r.locationAvailability.location.address.province,
3832
- city: r.locationAvailability.location.address.city,
3833
- address1: r.locationAvailability.location.address.address1,
3834
- address2: r.locationAvailability.location.address.address2
4108
+ id: i.locationAvailability.location.id,
4109
+ name: i.locationAvailability.location.name,
4110
+ phone: i.locationAvailability.location.phone,
4111
+ mapURL: i.locationAvailability.location.mapURL,
4112
+ tags: i.locationAvailability.location.tags,
4113
+ address: i.locationAvailability.location.address ? {
4114
+ id: i.locationAvailability.location.address.id,
4115
+ countryCode: i.locationAvailability.location.address.countryCode,
4116
+ country: i.locationAvailability.location.address.country,
4117
+ postalCode: i.locationAvailability.location.address.postalCode,
4118
+ provinceCode: i.locationAvailability.location.address.provinceCode,
4119
+ province: i.locationAvailability.location.address.province,
4120
+ city: i.locationAvailability.location.address.city,
4121
+ address1: i.locationAvailability.location.address.address1,
4122
+ address2: i.locationAvailability.location.address.address2
3835
4123
  } : void 0
3836
4124
  },
3837
- inventoryQuantity: r.locationAvailability.inventoryQuantity
4125
+ inventoryQuantity: i.locationAvailability.inventoryQuantity
3838
4126
  };
3839
4127
  }
3840
4128
  /**
@@ -3877,12 +4165,12 @@ class Ln {
3877
4165
  * @param {LocationFilter} [locationFilter] ロケーションのロケーションのフィルタリング条件。
3878
4166
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
3879
4167
  */
3880
- async getLocations(t, n, r, i) {
4168
+ async getLocations(t, n, i, r) {
3881
4169
  const s = await this.api.GetLocations({
3882
4170
  first: t,
3883
4171
  after: n,
3884
- filter: r,
3885
- isReverse: i
4172
+ filter: i,
4173
+ isReverse: r
3886
4174
  });
3887
4175
  return {
3888
4176
  nodes: s.locations.nodes.map((a) => ({
@@ -3914,15 +4202,15 @@ class Ln {
3914
4202
  * @param {string} [after] ページングの値。指定しない場合先頭から取得してくる。
3915
4203
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
3916
4204
  */
3917
- async getPurchasingCustomerDiscounts(t, n, r) {
3918
- const i = await this.api.GetPurchasingCustomerDiscounts({
4205
+ async getPurchasingCustomerDiscounts(t, n, i) {
4206
+ const r = await this.api.GetPurchasingCustomerDiscounts({
3919
4207
  first: t,
3920
4208
  after: n,
3921
- isReverse: r
4209
+ isReverse: i
3922
4210
  });
3923
- return i.purchasingCustomer ? {
3924
- id: i.purchasingCustomer.id,
3925
- nodes: i.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
4211
+ return r.purchasingCustomer ? {
4212
+ id: r.purchasingCustomer.id,
4213
+ nodes: r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
3926
4214
  (s) => ({
3927
4215
  id: s.id,
3928
4216
  title: s.title,
@@ -3939,7 +4227,7 @@ class Ln {
3939
4227
  updatedAt: new Date(s.updatedAt)
3940
4228
  })
3941
4229
  ) ?? [],
3942
- pageInfo: i.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
4230
+ pageInfo: r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
3943
4231
  } : null;
3944
4232
  }
3945
4233
  /**
@@ -3950,12 +4238,12 @@ class Ln {
3950
4238
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
3951
4239
  * @param {PointChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかPOINT_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
3952
4240
  */
3953
- async getPointChangeActivities(t, n, r, i) {
4241
+ async getPointChangeActivities(t, n, i, r) {
3954
4242
  const s = await this.api.GetPurchasingCustomerPointChangeActivities({
3955
4243
  first: t,
3956
4244
  after: n,
3957
- isReverse: r,
3958
- sortKeys: i
4245
+ isReverse: i,
4246
+ sortKeys: r
3959
4247
  });
3960
4248
  return s.purchasingCustomer ? {
3961
4249
  nodes: s.purchasingCustomer.pointChangeActivities.nodes.map(
@@ -4074,23 +4362,23 @@ class Ln {
4074
4362
  return (n = t.purchasingCustomer) != null && n.customerSharing ? {
4075
4363
  id: t.purchasingCustomer.customerSharing.id,
4076
4364
  purchasingCustomers: t.purchasingCustomer.customerSharing.purchasingCustomers.map(
4077
- (r) => ({
4078
- id: r.id,
4079
- sharingPurchasingCustomerCount: r.sharingPurchasingCustomerCount,
4365
+ (i) => ({
4366
+ id: i.id,
4367
+ sharingPurchasingCustomerCount: i.sharingPurchasingCustomerCount,
4080
4368
  tenant: {
4081
- id: r.tenant.id,
4082
- name: r.tenant.name
4369
+ id: i.tenant.id,
4370
+ name: i.tenant.name
4083
4371
  }
4084
4372
  })
4085
4373
  )
4086
4374
  } : null;
4087
4375
  }
4088
- async getProduct(t, n, r, i, s) {
4376
+ async getProduct(t, n, i, r, s) {
4089
4377
  const a = await this.api.GetProduct({
4090
4378
  id: t,
4091
4379
  first: n,
4092
- after: r,
4093
- isReverse: i,
4380
+ after: i,
4381
+ isReverse: r,
4094
4382
  sortKeys: s
4095
4383
  });
4096
4384
  return a.productByProductShopifyLegacyResourceID ? {
@@ -4121,9 +4409,11 @@ class Ln {
4121
4409
  * @param {string} [productShopifyLegacyResourceID] 商品のShopifyLegacyResourceID(gid://shopify/Product/xxxのxxxの部分)
4122
4410
  */
4123
4411
  async getHasBackOrderProductVariants(t) {
4124
- const n = await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID({
4125
- id: t
4126
- });
4412
+ const n = await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(
4413
+ {
4414
+ id: t
4415
+ }
4416
+ );
4127
4417
  return n.productByProductShopifyLegacyResourceID ? n.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants : null;
4128
4418
  }
4129
4419
  async getPointCampaignOrderRuleTargetCustomerRank() {
@@ -4139,35 +4429,35 @@ class Ln {
4139
4429
  fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
4140
4430
  } : null;
4141
4431
  }
4142
- async getEstimatedShopifyCartPoint(t, n, r) {
4143
- const i = await this.api.GetEstimatedShopifyCartPoint({
4432
+ async getEstimatedShopifyCartPoint(t, n, i) {
4433
+ const r = await this.api.GetEstimatedShopifyCartPoint({
4144
4434
  input: {
4145
4435
  currencyCode: t,
4146
4436
  taxesIncluded: n,
4147
- lineItems: r
4437
+ lineItems: i
4148
4438
  }
4149
4439
  });
4150
- return i.estimatedShopifyCartPoint ? {
4151
- pointsEarning: i.estimatedShopifyCartPoint.pointsEarning,
4152
- totalPointsEarning: i.estimatedShopifyCartPoint.totalPointsEarning,
4153
- pointCampaign: i.estimatedShopifyCartPoint.pointCampaign ? {
4154
- pointsEarning: i.estimatedShopifyCartPoint.pointCampaign.pointsEarning,
4440
+ return r.estimatedShopifyCartPoint ? {
4441
+ pointsEarning: r.estimatedShopifyCartPoint.pointsEarning,
4442
+ totalPointsEarning: r.estimatedShopifyCartPoint.totalPointsEarning,
4443
+ pointCampaign: r.estimatedShopifyCartPoint.pointCampaign ? {
4444
+ pointsEarning: r.estimatedShopifyCartPoint.pointCampaign.pointsEarning,
4155
4445
  pointCampaignOrderRule: {
4156
- id: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,
4157
- title: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,
4158
- pointMethod: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
4159
- targetType: i.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType
4446
+ id: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,
4447
+ title: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,
4448
+ pointMethod: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,
4449
+ targetType: r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType
4160
4450
  }
4161
4451
  } : void 0
4162
4452
  } : null;
4163
4453
  }
4164
- async getEstimatedShopifyCartLineItemPoint(t, n, r, i, s) {
4454
+ async getEstimatedShopifyCartLineItemPoint(t, n, i, r, s) {
4165
4455
  const a = await this.api.GetEstimatedShopifyCartLineItemPoint({
4166
4456
  input: {
4167
4457
  currencyCode: t,
4168
4458
  taxesIncluded: n,
4169
- sku: r,
4170
- quantity: i,
4459
+ sku: i,
4460
+ quantity: r,
4171
4461
  unitPrice: s
4172
4462
  }
4173
4463
  });
@@ -4210,16 +4500,16 @@ class Ln {
4210
4500
  throw new Error(
4211
4501
  `Invalid activation code: ${n} is not 6 characters.`
4212
4502
  );
4213
- const r = await this.api.PurchasingCustomerActivateCustomerSharing({
4503
+ const i = await this.api.PurchasingCustomerActivateCustomerSharing({
4214
4504
  email: t,
4215
4505
  activationCode: n
4216
4506
  });
4217
- return r.purchasingCustomerActivateCustomerSharing ? {
4218
- id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
4219
- sharingPurchasingCustomerCount: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
4507
+ return i.purchasingCustomerActivateCustomerSharing ? {
4508
+ id: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,
4509
+ sharingPurchasingCustomerCount: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,
4220
4510
  tenant: {
4221
- id: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,
4222
- name: r.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name
4511
+ id: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,
4512
+ name: i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name
4223
4513
  }
4224
4514
  } : null;
4225
4515
  }
@@ -4240,12 +4530,12 @@ class Ln {
4240
4530
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
4241
4531
  * @param {MileChangeActivitySortKey} [sortKeys] ソートキー。CREATED_ATかMILE_CHANGE_CREATED_ATを渡す。デフォルトはCREATED_AT。
4242
4532
  */
4243
- async getMileChangeActivities(t, n, r, i) {
4533
+ async getMileChangeActivities(t, n, i, r) {
4244
4534
  const s = await this.api.GetPurchasingCustomerMileChangeActivities({
4245
4535
  first: t,
4246
4536
  after: n,
4247
- isReverse: r,
4248
- sortKeys: i
4537
+ isReverse: i,
4538
+ sortKeys: r
4249
4539
  });
4250
4540
  return s.purchasingCustomer ? {
4251
4541
  nodes: s.purchasingCustomer.mileChangeActivities.nodes.map(
@@ -4273,12 +4563,12 @@ class Ln {
4273
4563
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
4274
4564
  * @param {ShopifyMileItemSortKey} [sortKeys] ソートキー。デフォルトはCREATED_AT。
4275
4565
  */
4276
- async getMileItems(t, n, r, i) {
4566
+ async getMileItems(t, n, i, r) {
4277
4567
  const s = await this.api.GetMileItems({
4278
4568
  first: t,
4279
4569
  after: n,
4280
- isReverse: r,
4281
- sortKeys: i
4570
+ isReverse: i,
4571
+ sortKeys: r
4282
4572
  });
4283
4573
  return s.mileItems ? {
4284
4574
  nodes: s.mileItems.nodes.map((a) => ({
@@ -4304,32 +4594,34 @@ class Ln {
4304
4594
  * @param {boolean} [isReverse] 並び順。デフォルトはfalse。
4305
4595
  * @param {MileOrderSortKey} [sortKeys] ソートキー。デフォルトはCREATED_AT。
4306
4596
  */
4307
- async getMileOrders(t, n, r, i) {
4597
+ async getMileOrders(t, n, i, r) {
4308
4598
  const s = await this.api.GetMileOrders({
4309
4599
  first: t,
4310
4600
  after: n,
4311
- isReverse: r,
4312
- sortKeys: i
4601
+ isReverse: i,
4602
+ sortKeys: r
4313
4603
  });
4314
4604
  return s.purchasingCustomer ? {
4315
- nodes: s.purchasingCustomer.mileOrders.nodes.map((a) => ({
4316
- id: a.id,
4317
- mileItem: {
4318
- id: a.mileItem.id,
4319
- title: a.mileItem.title,
4320
- description: a.mileItem.description,
4321
- miles: a.mileItem.miles,
4322
- sku: a.mileItem.sku,
4323
- isActive: a.mileItem.isActive,
4324
- isScheduled: a.mileItem.isScheduled,
4325
- customerExchangeable: a.mileItem.customerExchangeable,
4326
- startsAt: new Date(a.mileItem.startsAt),
4327
- endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
4328
- },
4329
- miles: a.miles,
4330
- exchangedAt: new Date(a.exchangedAt),
4331
- isCancelled: a.isCancelled
4332
- })),
4605
+ nodes: s.purchasingCustomer.mileOrders.nodes.map(
4606
+ (a) => ({
4607
+ id: a.id,
4608
+ mileItem: {
4609
+ id: a.mileItem.id,
4610
+ title: a.mileItem.title,
4611
+ description: a.mileItem.description,
4612
+ miles: a.mileItem.miles,
4613
+ sku: a.mileItem.sku,
4614
+ isActive: a.mileItem.isActive,
4615
+ isScheduled: a.mileItem.isScheduled,
4616
+ customerExchangeable: a.mileItem.customerExchangeable,
4617
+ startsAt: new Date(a.mileItem.startsAt),
4618
+ endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
4619
+ },
4620
+ miles: a.miles,
4621
+ exchangedAt: new Date(a.exchangedAt),
4622
+ isCancelled: a.isCancelled
4623
+ })
4624
+ ),
4333
4625
  pageInfo: s.purchasingCustomer.mileOrders.pageInfo
4334
4626
  } : null;
4335
4627
  }
@@ -4344,6 +4636,79 @@ class Ln {
4344
4636
  smsVerified: t.purchasingCustomer.smsVerified
4345
4637
  } : null;
4346
4638
  }
4639
+ /**
4640
+ * getPurchasingCustomerRetailOrders は顧客の店舗受取注文一覧を取得します。
4641
+ * @param first 取得する注文数の上限
4642
+ * @param after ページネーション用のカーソル
4643
+ * @param isReverse 並び順を逆にするかどうか
4644
+ * @param sortKeys ソートキー
4645
+ * @returns 顧客の店舗受取注文一覧、または顧客が存在しない場合はnull
4646
+ */
4647
+ async getPurchasingCustomerRetailOrders(t, n, i, r) {
4648
+ const s = await this.api.GetPurchasingCustomerRetailOrders({
4649
+ first: t,
4650
+ after: n,
4651
+ isReverse: i,
4652
+ sortKeys: r
4653
+ });
4654
+ return s.purchasingCustomer ? {
4655
+ nodes: s.purchasingCustomer.retailOrders.nodes.map(
4656
+ (a) => ({
4657
+ id: a.id,
4658
+ managementCode: a.managementCode,
4659
+ source: a.source,
4660
+ purchasedAt: new Date(a.purchasedAt),
4661
+ fulfilledAt: a.fulfilledAt ? new Date(a.fulfilledAt) : null,
4662
+ isCancelled: a.isCancelled,
4663
+ cancelledAt: a.cancelledAt ? new Date(a.cancelledAt) : null,
4664
+ tags: a.tags,
4665
+ paymentStatus: a.paymentStatus,
4666
+ retailLocation: {
4667
+ id: a.retailLocation.id,
4668
+ name: a.retailLocation.name,
4669
+ displayName: a.retailLocation.displayName
4670
+ },
4671
+ totalQuantity: a.totalQuantity,
4672
+ currentTotalQuantity: a.currentTotalQuantity,
4673
+ pointApplicationPrice: {
4674
+ amount: parseFloat(a.pointApplicationPrice.amount),
4675
+ currencyCode: a.pointApplicationPrice.currencyCode
4676
+ },
4677
+ currentPointApplicationPrice: {
4678
+ amount: parseFloat(a.currentPointApplicationPrice.amount),
4679
+ currencyCode: a.currentPointApplicationPrice.currencyCode
4680
+ },
4681
+ totalOrderDiscountPrice: {
4682
+ amount: parseFloat(a.totalOrderDiscountPrice.amount),
4683
+ currencyCode: a.totalOrderDiscountPrice.currencyCode
4684
+ },
4685
+ subtotalPrice: {
4686
+ amount: parseFloat(a.subtotalPrice.amount),
4687
+ currencyCode: a.subtotalPrice.currencyCode
4688
+ },
4689
+ totalTaxPrice: {
4690
+ amount: parseFloat(a.totalTaxPrice.amount),
4691
+ currencyCode: a.totalTaxPrice.currencyCode
4692
+ },
4693
+ currentTotalTaxPrice: {
4694
+ amount: parseFloat(a.currentTotalTaxPrice.amount),
4695
+ currencyCode: a.currentTotalTaxPrice.currencyCode
4696
+ },
4697
+ currentSubtotalPrice: {
4698
+ amount: parseFloat(a.currentSubtotalPrice.amount),
4699
+ currencyCode: a.currentSubtotalPrice.currencyCode
4700
+ },
4701
+ totalPrice: {
4702
+ amount: parseFloat(a.totalPrice.amount),
4703
+ currencyCode: a.totalPrice.currencyCode
4704
+ },
4705
+ createdAt: new Date(a.createdAt),
4706
+ updatedAt: new Date(a.updatedAt)
4707
+ })
4708
+ ),
4709
+ pageInfo: s.purchasingCustomer.retailOrders.pageInfo
4710
+ } : null;
4711
+ }
4347
4712
  /**
4348
4713
  * mileItemExchange は指定したマイル商品を交換します。
4349
4714
  *
@@ -4364,7 +4729,9 @@ class Ln {
4364
4729
  isActive: n.mileItemExchange.mileOrder.mileItem.isActive,
4365
4730
  isScheduled: n.mileItemExchange.mileOrder.mileItem.isScheduled,
4366
4731
  customerExchangeable: n.mileItemExchange.mileOrder.mileItem.customerExchangeable,
4367
- startsAt: new Date(n.mileItemExchange.mileOrder.mileItem.startsAt),
4732
+ startsAt: new Date(
4733
+ n.mileItemExchange.mileOrder.mileItem.startsAt
4734
+ ),
4368
4735
  endsAt: n.mileItemExchange.mileOrder.mileItem.endsAt ? new Date(n.mileItemExchange.mileOrder.mileItem.endsAt) : void 0
4369
4736
  },
4370
4737
  miles: n.mileItemExchange.mileOrder.miles,
@@ -4378,14 +4745,14 @@ class Ln {
4378
4745
  * @param {string} phone SMS認証コードを送信する電話番号
4379
4746
  */
4380
4747
  async purchasingCustomerSendSMSVerificationCode(t) {
4381
- var i;
4382
- const r = (i = (await this.api.PurchasingCustomerSendSMSVerificationCode({
4748
+ var r;
4749
+ const i = (r = (await this.api.PurchasingCustomerSendSMSVerificationCode({
4383
4750
  phone: t
4384
- })).purchasingCustomerSendSMSVerificationCode) == null ? void 0 : i.purchasingCustomer;
4385
- return r ? {
4386
- id: r.id,
4387
- smsVerifiedPhone: r.smsVerifiedPhone,
4388
- smsVerified: r.smsVerified
4751
+ })).purchasingCustomerSendSMSVerificationCode) == null ? void 0 : r.purchasingCustomer;
4752
+ return i ? {
4753
+ id: i.id,
4754
+ smsVerifiedPhone: i.smsVerifiedPhone,
4755
+ smsVerified: i.smsVerified
4389
4756
  } : null;
4390
4757
  }
4391
4758
  /**
@@ -4396,19 +4763,31 @@ class Ln {
4396
4763
  */
4397
4764
  async purchasingCustomerVerifySMS(t, n) {
4398
4765
  var s;
4399
- const i = (s = (await this.api.PurchasingCustomerVerifySMS({
4766
+ const r = (s = (await this.api.PurchasingCustomerVerifySMS({
4400
4767
  phone: t,
4401
4768
  verificationCode: n
4402
4769
  })).purchasingCustomerVerifySMS) == null ? void 0 : s.purchasingCustomer;
4403
- return i ? {
4404
- id: i.id,
4405
- smsVerifiedPhone: i.smsVerifiedPhone,
4406
- smsVerified: i.smsVerified
4770
+ return r ? {
4771
+ id: r.id,
4772
+ smsVerifiedPhone: r.smsVerifiedPhone,
4773
+ smsVerified: r.smsVerified
4407
4774
  } : null;
4408
4775
  }
4776
+ /**
4777
+ * DiscountUsageCreate は指定した注文価格調整の利用履歴を作成します。
4778
+ *
4779
+ * @param {string} orderPriceAdjustmentRuleID 利用する注文価格調整ルールのID
4780
+ */
4781
+ async DiscountUsageCreate(t) {
4782
+ var i;
4783
+ const n = await this.api.DiscountUsageCreate({
4784
+ orderPriceAdjustmentRuleID: t
4785
+ });
4786
+ return (i = n == null ? void 0 : n.shopifyOrderPriceAdjustmentUsageCreate) != null && i.orderPriceAdjustmentRule ? n.shopifyOrderPriceAdjustmentUsageCreate.orderPriceAdjustmentRule : null;
4787
+ }
4409
4788
  }
4410
4789
  export {
4411
- bn as CurrencyCode,
4412
- kn as LocationType,
4413
- Ln as SDK
4790
+ Fn as CurrencyCode,
4791
+ Bn as LocationType,
4792
+ Vn as SDK
4414
4793
  };