@ticketapp-dev/shop-sdk 1.0.47 → 1.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,11 @@
1
- import { GraphQLClient as v } from "graphql-request";
2
- import { DateTime as k } from "luxon";
3
- var T = /* @__PURE__ */ ((t) => (t.PACKAGE = "PACKAGE", t.PRODUCT = "PRODUCT", t.ADD_ONS = "ADD_ONS", t.DELIVERY = "DELIVERY", t.PICKUP = "PICKUP", t))(T || {}), R = /* @__PURE__ */ ((t) => (t.AdditionalEvent = "ADDITIONAL_EVENT", t.Addon = "ADDON", t.Regular = "REGULAR", t))(R || {}), Z = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Concept = "CONCEPT", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(Z || {}), K = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t))(K || {}), ee = /* @__PURE__ */ ((t) => (t.Active = "ACTIVE", t.Inactive = "INACTIVE", t.Paused = "PAUSED", t.SoldOut = "SOLD_OUT", t))(ee || {}), te = /* @__PURE__ */ ((t) => (t.Asc = "ASC", t.Desc = "DESC", t))(te || {}), ne = /* @__PURE__ */ ((t) => (t.AllReserved = "ALL_RESERVED", t.Available = "AVAILABLE", t.SoldOut = "SOLD_OUT", t))(ne || {}), ie = /* @__PURE__ */ ((t) => (t.Addon = "ADDON", t.Delivery = "DELIVERY", t.Door = "DOOR", t.Friend = "FRIEND", t.Guest = "GUEST", t.Pickup = "PICKUP", t.Promoter = "PROMOTER", t.Ticket = "TICKET", t))(ie || {}), re = /* @__PURE__ */ ((t) => (t.FIXED = "FIXED", t.PERCENTAGE = "PERCENTAGE", t))(re || {}), se = /* @__PURE__ */ ((t) => (t.AddOn = "ADD_ON", t.DeliveryOption = "DELIVERY_OPTION", t.EntranceTicket = "ENTRANCE_TICKET", t))(se || {}), ae = /* @__PURE__ */ ((t) => (t.Fixed = "FIXED", t.Percentage = "PERCENTAGE", t))(ae || {}), oe = /* @__PURE__ */ ((t) => (t.Default = "DEFAULT", t.Transparent = "TRANSPARENT", t))(oe || {}), ce = /* @__PURE__ */ ((t) => (t.Calendar = "CALENDAR", t.Large = "LARGE", t.Small = "SMALL", t))(ce || {}), F = /* @__PURE__ */ ((t) => (t.Event = "EVENT", t.Package = "PACKAGE", t))(F || {});
4
- const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1
+ import { GraphQLClient as T } from "graphql-request";
2
+ import { DateTime as O } from "luxon";
3
+ var N = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(N || {}), R = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(R || {}), Z = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Z || {}), K = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(K || {}), ee = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(ee || {}), te = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(te || {}), ne = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(ne || {}), re = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(re || {}), ie = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(ie || {}), se = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(se || {}), ae = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(ae || {}), oe = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(oe || {}), ce = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(ce || {}), F = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(F || {}), de = /* @__PURE__ */ ((e) => (e.RADIO_BUTTON = "RADIO_BUTTON", e.DATE = "DATE", e.EMAIL = "EMAIL", e.NUMERIC = "NUMERIC", e.DROPDOWN = "DROPDOWN", e.TEXT = "TEXT", e.TEXT_AREA = "TEXT_AREA", e.TIME = "TIME", e.CHECKBOX = "CHECKBOX", e.PHONE_NUMBER = "PHONE_NUMBER", e))(de || {}), ue = /* @__PURE__ */ ((e) => (e.GENDER = "GENDER", e.FIRST_NAME = "FIRST_NAME", e.LAST_NAME = "LAST_NAME", e.EMAIL = "EMAIL", e.AGE = "AGE", e.RESIDENCE = "RESIDENCE", e.GOOGLE_PLACE = "GOOGLE_PLACE", e))(ue || {}), le = /* @__PURE__ */ ((e) => (e.ONLINE = "ONLINE", e.OFFLINE = "OFFLINE", e))(le || {});
4
+ const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
5
  __proto__: null,
6
- BasketOrderType: T,
6
+ BasketOrderType: N,
7
+ CustomFieldMandatoryType: ue,
8
+ CustomFieldType: de,
7
9
  DiscountType: ae,
8
10
  EventStatus: ee,
9
11
  MetricsType: F,
@@ -11,91 +13,92 @@ const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11
13
  PackageItemType: R,
12
14
  PackageStatus: Z,
13
15
  PackageTabType: K,
14
- PaymentMethodFeeType: re,
16
+ PaymentMethodFeeType: ie,
15
17
  ProductStatus: ne,
16
- ProductType: ie,
18
+ ProductType: re,
19
+ SalesLocations: le,
17
20
  ShopTemplateType: oe,
18
21
  ShopVariationType: ce,
19
22
  SortOrder: te
20
23
  }, Symbol.toStringTag, { value: "Module" }));
21
24
  var w = function() {
22
- return w = Object.assign || function(e) {
23
- for (var n, i = 1, r = arguments.length; i < r; i++) {
24
- n = arguments[i];
25
- for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
25
+ return w = Object.assign || function(t) {
26
+ for (var n, r = 1, i = arguments.length; r < i; r++) {
27
+ n = arguments[r];
28
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
26
29
  }
27
- return e;
30
+ return t;
28
31
  }, w.apply(this, arguments);
29
32
  };
30
- function U(t, e) {
31
- if (!!!t)
32
- throw new Error(e);
33
+ function V(e, t) {
34
+ if (!!!e)
35
+ throw new Error(t);
33
36
  }
34
- function De(t) {
35
- return typeof t == "object" && t !== null;
37
+ function Pe(e) {
38
+ return typeof e == "object" && e !== null;
36
39
  }
37
- function ve(t, e) {
38
- if (!!!t)
40
+ function be(e, t) {
41
+ if (!!!e)
39
42
  throw new Error(
40
43
  "Unexpected invariant triggered."
41
44
  );
42
45
  }
43
- const Ne = /\r\n|[\n\r]/g;
44
- function z(t, e) {
45
- let n = 0, i = 1;
46
- for (const r of t.body.matchAll(Ne)) {
47
- if (typeof r.index == "number" || ve(!1), r.index >= e)
46
+ const Se = /\r\n|[\n\r]/g;
47
+ function z(e, t) {
48
+ let n = 0, r = 1;
49
+ for (const i of e.body.matchAll(Se)) {
50
+ if (typeof i.index == "number" || be(!1), i.index >= t)
48
51
  break;
49
- n = r.index + r[0].length, i += 1;
52
+ n = i.index + i[0].length, r += 1;
50
53
  }
51
54
  return {
52
- line: i,
53
- column: e + 1 - n
55
+ line: r,
56
+ column: t + 1 - n
54
57
  };
55
58
  }
56
- function Pe(t) {
57
- return de(
58
- t.source,
59
- z(t.source, t.start)
59
+ function xe(e) {
60
+ return he(
61
+ e.source,
62
+ z(e.source, e.start)
60
63
  );
61
64
  }
62
- function de(t, e) {
63
- const n = t.locationOffset.column - 1, i = "".padStart(n) + t.body, r = e.line - 1, s = t.locationOffset.line - 1, o = e.line + s, l = e.line === 1 ? n : 0, p = e.column + l, E = `${t.name}:${o}:${p}
64
- `, g = i.split(/\r\n|[\n\r]/g), d = g[r];
65
+ function he(e, t) {
66
+ const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, l = t.line === 1 ? n : 0, h = t.column + l, E = `${e.name}:${o}:${h}
67
+ `, g = r.split(/\r\n|[\n\r]/g), d = g[i];
65
68
  if (d.length > 120) {
66
- const m = Math.floor(p / 80), y = p % 80, h = [];
67
- for (let O = 0; O < d.length; O += 80)
68
- h.push(d.slice(O, O + 80));
69
+ const m = Math.floor(h / 80), y = h % 80, p = [];
70
+ for (let k = 0; k < d.length; k += 80)
71
+ p.push(d.slice(k, k + 80));
69
72
  return E + Q([
70
- [`${o} |`, h[0]],
71
- ...h.slice(1, m + 1).map((O) => ["|", O]),
73
+ [`${o} |`, p[0]],
74
+ ...p.slice(1, m + 1).map((k) => ["|", k]),
72
75
  ["|", "^".padStart(y)],
73
- ["|", h[m + 1]]
76
+ ["|", p[m + 1]]
74
77
  ]);
75
78
  }
76
79
  return E + Q([
77
80
  // Lines specified like this: ["prefix", "string"],
78
- [`${o - 1} |`, g[r - 1]],
81
+ [`${o - 1} |`, g[i - 1]],
79
82
  [`${o} |`, d],
80
- ["|", "^".padStart(p)],
81
- [`${o + 1} |`, g[r + 1]]
83
+ ["|", "^".padStart(h)],
84
+ [`${o + 1} |`, g[i + 1]]
82
85
  ]);
83
86
  }
84
- function Q(t) {
85
- const e = t.filter(([i, r]) => r !== void 0), n = Math.max(...e.map(([i]) => i.length));
86
- return e.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
87
+ function Q(e) {
88
+ const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
89
+ return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
87
90
  `);
88
91
  }
89
- function be(t) {
90
- const e = t[0];
91
- return e == null || "kind" in e || "length" in e ? {
92
- nodes: e,
93
- source: t[1],
94
- positions: t[2],
95
- path: t[3],
96
- originalError: t[4],
97
- extensions: t[5]
98
- } : e;
92
+ function _e(e) {
93
+ const t = e[0];
94
+ return t == null || "kind" in t || "length" in t ? {
95
+ nodes: t,
96
+ source: e[1],
97
+ positions: e[2],
98
+ path: e[3],
99
+ originalError: e[4],
100
+ extensions: e[5]
101
+ } : t;
99
102
  }
100
103
  class j extends Error {
101
104
  /**
@@ -136,17 +139,17 @@ class j extends Error {
136
139
  /**
137
140
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
138
141
  */
139
- constructor(e, ...n) {
140
- var i, r, s;
141
- const { nodes: o, source: l, positions: p, path: E, originalError: g, extensions: d } = be(n);
142
- super(e), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
142
+ constructor(t, ...n) {
143
+ var r, i, s;
144
+ const { nodes: o, source: l, positions: h, path: E, originalError: g, extensions: d } = _e(n);
145
+ super(t), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = g ?? void 0, this.nodes = X(
143
146
  Array.isArray(o) ? o : o ? [o] : void 0
144
147
  );
145
148
  const m = X(
146
- (i = this.nodes) === null || i === void 0 ? void 0 : i.map((h) => h.loc).filter((h) => h != null)
149
+ (r = this.nodes) === null || r === void 0 ? void 0 : r.map((p) => p.loc).filter((p) => p != null)
147
150
  );
148
- this.source = l ?? (m == null || (r = m[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? m?.map((h) => h.start), this.locations = p && l ? p.map((h) => z(l, h)) : m?.map((h) => z(h.source, h.start));
149
- const y = De(
151
+ this.source = l ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? m?.map((p) => p.start), this.locations = h && l ? h.map((p) => z(l, p)) : m?.map((p) => z(p.source, p.start));
152
+ const y = Pe(
150
153
  g?.extensions
151
154
  ) ? g?.extensions : void 0;
152
155
  this.extensions = (s = d ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
@@ -183,36 +186,36 @@ class j extends Error {
183
186
  return "GraphQLError";
184
187
  }
185
188
  toString() {
186
- let e = this.message;
189
+ let t = this.message;
187
190
  if (this.nodes)
188
191
  for (const n of this.nodes)
189
- n.loc && (e += `
192
+ n.loc && (t += `
190
193
 
191
- ` + Pe(n.loc));
194
+ ` + xe(n.loc));
192
195
  else if (this.source && this.locations)
193
196
  for (const n of this.locations)
194
- e += `
197
+ t += `
195
198
 
196
- ` + de(this.source, n);
197
- return e;
199
+ ` + he(this.source, n);
200
+ return t;
198
201
  }
199
202
  toJSON() {
200
- const e = {
203
+ const t = {
201
204
  message: this.message
202
205
  };
203
- return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e;
206
+ 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
207
  }
205
208
  }
206
- function X(t) {
207
- return t === void 0 || t.length === 0 ? void 0 : t;
209
+ function X(e) {
210
+ return e === void 0 || e.length === 0 ? void 0 : e;
208
211
  }
209
- function I(t, e, n) {
212
+ function I(e, t, n) {
210
213
  return new j(`Syntax Error: ${n}`, {
211
- source: t,
212
- positions: [e]
214
+ source: e,
215
+ positions: [t]
213
216
  });
214
217
  }
215
- class Se {
218
+ class Ce {
216
219
  /**
217
220
  * The character offset at which this Node begins.
218
221
  */
@@ -228,8 +231,8 @@ class Se {
228
231
  /**
229
232
  * The Source document the AST represents.
230
233
  */
231
- constructor(e, n, i) {
232
- this.start = e.start, this.end = n.end, this.startToken = e, this.endToken = n, this.source = i;
234
+ constructor(t, n, r) {
235
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
233
236
  }
234
237
  get [Symbol.toStringTag]() {
235
238
  return "Location";
@@ -241,7 +244,7 @@ class Se {
241
244
  };
242
245
  }
243
246
  }
244
- class ue {
247
+ class pe {
245
248
  /**
246
249
  * The kind of Token.
247
250
  */
@@ -268,8 +271,8 @@ class ue {
268
271
  * including ignored tokens. <SOF> is always the first node and <EOF>
269
272
  * the last.
270
273
  */
271
- constructor(e, n, i, r, s, o) {
272
- this.kind = e, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
274
+ constructor(t, n, r, i, s, o) {
275
+ this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = o, this.prev = null, this.next = null;
273
276
  }
274
277
  get [Symbol.toStringTag]() {
275
278
  return "Token";
@@ -283,7 +286,7 @@ class ue {
283
286
  };
284
287
  }
285
288
  }
286
- const xe = {
289
+ const Le = {
287
290
  Name: [],
288
291
  Document: ["definitions"],
289
292
  OperationDefinition: [
@@ -371,59 +374,59 @@ const xe = {
371
374
  DirectiveCoordinate: ["name"],
372
375
  DirectiveArgumentCoordinate: ["name", "argumentName"]
373
376
  };
374
- new Set(Object.keys(xe));
375
- var N;
376
- (function(t) {
377
- t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
378
- })(N || (N = {}));
377
+ new Set(Object.keys(Le));
378
+ var v;
379
+ (function(e) {
380
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
381
+ })(v || (v = {}));
379
382
  var q;
380
- (function(t) {
381
- t.QUERY = "QUERY", t.MUTATION = "MUTATION", t.SUBSCRIPTION = "SUBSCRIPTION", t.FIELD = "FIELD", t.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", t.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", t.INLINE_FRAGMENT = "INLINE_FRAGMENT", t.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", t.SCHEMA = "SCHEMA", t.SCALAR = "SCALAR", t.OBJECT = "OBJECT", t.FIELD_DEFINITION = "FIELD_DEFINITION", t.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", t.INTERFACE = "INTERFACE", t.UNION = "UNION", t.ENUM = "ENUM", t.ENUM_VALUE = "ENUM_VALUE", t.INPUT_OBJECT = "INPUT_OBJECT", t.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
383
+ (function(e) {
384
+ 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";
382
385
  })(q || (q = {}));
383
386
  var c;
384
- (function(t) {
385
- t.NAME = "Name", t.DOCUMENT = "Document", t.OPERATION_DEFINITION = "OperationDefinition", t.VARIABLE_DEFINITION = "VariableDefinition", t.SELECTION_SET = "SelectionSet", t.FIELD = "Field", t.ARGUMENT = "Argument", t.FRAGMENT_SPREAD = "FragmentSpread", t.INLINE_FRAGMENT = "InlineFragment", t.FRAGMENT_DEFINITION = "FragmentDefinition", t.VARIABLE = "Variable", t.INT = "IntValue", t.FLOAT = "FloatValue", t.STRING = "StringValue", t.BOOLEAN = "BooleanValue", t.NULL = "NullValue", t.ENUM = "EnumValue", t.LIST = "ListValue", t.OBJECT = "ObjectValue", t.OBJECT_FIELD = "ObjectField", t.DIRECTIVE = "Directive", t.NAMED_TYPE = "NamedType", t.LIST_TYPE = "ListType", t.NON_NULL_TYPE = "NonNullType", t.SCHEMA_DEFINITION = "SchemaDefinition", t.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", t.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", t.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", t.FIELD_DEFINITION = "FieldDefinition", t.INPUT_VALUE_DEFINITION = "InputValueDefinition", t.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", t.UNION_TYPE_DEFINITION = "UnionTypeDefinition", t.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", t.ENUM_VALUE_DEFINITION = "EnumValueDefinition", t.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", t.DIRECTIVE_DEFINITION = "DirectiveDefinition", t.SCHEMA_EXTENSION = "SchemaExtension", t.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", t.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", t.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", t.UNION_TYPE_EXTENSION = "UnionTypeExtension", t.ENUM_TYPE_EXTENSION = "EnumTypeExtension", t.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", t.TYPE_COORDINATE = "TypeCoordinate", t.MEMBER_COORDINATE = "MemberCoordinate", t.ARGUMENT_COORDINATE = "ArgumentCoordinate", t.DIRECTIVE_COORDINATE = "DirectiveCoordinate", t.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
387
+ (function(e) {
388
+ 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";
386
389
  })(c || (c = {}));
387
- function Ce(t) {
388
- return t === 9 || t === 32;
390
+ function Re(e) {
391
+ return e === 9 || e === 32;
389
392
  }
390
- function x(t) {
391
- return t >= 48 && t <= 57;
393
+ function x(e) {
394
+ return e >= 48 && e <= 57;
392
395
  }
393
- function le(t) {
394
- return t >= 97 && t <= 122 || // A-Z
395
- t >= 65 && t <= 90;
396
+ function ge(e) {
397
+ return e >= 97 && e <= 122 || // A-Z
398
+ e >= 65 && e <= 90;
396
399
  }
397
- function pe(t) {
398
- return le(t) || t === 95;
400
+ function me(e) {
401
+ return ge(e) || e === 95;
399
402
  }
400
- function _e(t) {
401
- return le(t) || x(t) || t === 95;
403
+ function Fe(e) {
404
+ return ge(e) || x(e) || e === 95;
402
405
  }
403
- function Le(t) {
404
- var e;
405
- let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
406
- for (let o = 0; o < t.length; ++o) {
406
+ function we(e) {
407
+ var t;
408
+ let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
409
+ for (let o = 0; o < e.length; ++o) {
407
410
  var s;
408
- const l = t[o], p = Re(l);
409
- p !== l.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && p < n && (n = p));
411
+ const l = e[o], h = $e(l);
412
+ h !== l.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
410
413
  }
411
- return t.map((o, l) => l === 0 ? o : o.slice(n)).slice(
412
- (e = i) !== null && e !== void 0 ? e : 0,
413
- r + 1
414
+ return e.map((o, l) => l === 0 ? o : o.slice(n)).slice(
415
+ (t = r) !== null && t !== void 0 ? t : 0,
416
+ i + 1
414
417
  );
415
418
  }
416
- function Re(t) {
417
- let e = 0;
418
- for (; e < t.length && Ce(t.charCodeAt(e)); )
419
- ++e;
420
- return e;
419
+ function $e(e) {
420
+ let t = 0;
421
+ for (; t < e.length && Re(e.charCodeAt(t)); )
422
+ ++t;
423
+ return t;
421
424
  }
422
425
  var a;
423
- (function(t) {
424
- t.SOF = "<SOF>", t.EOF = "<EOF>", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.DOT = ".", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment";
426
+ (function(e) {
427
+ 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";
425
428
  })(a || (a = {}));
426
- class Fe {
429
+ class Be {
427
430
  /**
428
431
  * The previously focused non-ignored token.
429
432
  */
@@ -436,9 +439,9 @@ class Fe {
436
439
  /**
437
440
  * The character offset at which the current line begins.
438
441
  */
439
- constructor(e) {
440
- const n = new ue(a.SOF, 0, 0, 0, 0);
441
- this.source = e, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
442
+ constructor(t) {
443
+ const n = new pe(a.SOF, 0, 0, 0, 0);
444
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
442
445
  }
443
446
  get [Symbol.toStringTag]() {
444
447
  return "Lexer";
@@ -454,53 +457,53 @@ class Fe {
454
457
  * the state of Lexer.
455
458
  */
456
459
  lookahead() {
457
- let e = this.token;
458
- if (e.kind !== a.EOF)
460
+ let t = this.token;
461
+ if (t.kind !== a.EOF)
459
462
  do
460
- if (e.next)
461
- e = e.next;
463
+ if (t.next)
464
+ t = t.next;
462
465
  else {
463
- const n = $e(this, e.end);
464
- e.next = n, n.prev = e, e = n;
466
+ const n = Ve(this, t.end);
467
+ t.next = n, n.prev = t, t = n;
465
468
  }
466
- while (e.kind === a.COMMENT);
467
- return e;
469
+ while (t.kind === a.COMMENT);
470
+ return t;
468
471
  }
469
472
  }
470
- function we(t) {
471
- return t === a.BANG || t === a.DOLLAR || t === a.AMP || t === a.PAREN_L || t === a.PAREN_R || t === a.DOT || t === a.SPREAD || t === a.COLON || t === a.EQUALS || t === a.AT || t === a.BRACKET_L || t === a.BRACKET_R || t === a.BRACE_L || t === a.PIPE || t === a.BRACE_R;
473
+ function Ue(e) {
474
+ return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
472
475
  }
473
- function P(t) {
474
- return t >= 0 && t <= 55295 || t >= 57344 && t <= 1114111;
476
+ function P(e) {
477
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
475
478
  }
476
- function B(t, e) {
477
- return he(t.charCodeAt(e)) && ge(t.charCodeAt(e + 1));
479
+ function B(e, t) {
480
+ return fe(e.charCodeAt(t)) && Ie(e.charCodeAt(t + 1));
478
481
  }
479
- function he(t) {
480
- return t >= 55296 && t <= 56319;
482
+ function fe(e) {
483
+ return e >= 55296 && e <= 56319;
481
484
  }
482
- function ge(t) {
483
- return t >= 56320 && t <= 57343;
485
+ function Ie(e) {
486
+ return e >= 56320 && e <= 57343;
484
487
  }
485
- function D(t, e) {
486
- const n = t.source.body.codePointAt(e);
488
+ function D(e, t) {
489
+ const n = e.source.body.codePointAt(t);
487
490
  if (n === void 0)
488
491
  return a.EOF;
489
492
  if (n >= 32 && n <= 126) {
490
- const i = String.fromCodePoint(n);
491
- return i === '"' ? `'"'` : `"${i}"`;
493
+ const r = String.fromCodePoint(n);
494
+ return r === '"' ? `'"'` : `"${r}"`;
492
495
  }
493
496
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
494
497
  }
495
- function f(t, e, n, i, r) {
496
- const s = t.line, o = 1 + n - t.lineStart;
497
- return new ue(e, n, i, s, o, r);
498
+ function f(e, t, n, r, i) {
499
+ const s = e.line, o = 1 + n - e.lineStart;
500
+ return new pe(t, n, r, s, o, i);
498
501
  }
499
- function $e(t, e) {
500
- const n = t.source.body, i = n.length;
501
- let r = e;
502
- for (; r < i; ) {
503
- const s = n.charCodeAt(r);
502
+ function Ve(e, t) {
503
+ const n = e.source.body, r = n.length;
504
+ let i = t;
505
+ for (; i < r; ) {
506
+ const s = n.charCodeAt(i);
504
507
  switch (s) {
505
508
  // Ignored ::
506
509
  // - UnicodeBOM
@@ -523,21 +526,21 @@ function $e(t, e) {
523
526
  case 32:
524
527
  // <space>
525
528
  case 44:
526
- ++r;
529
+ ++i;
527
530
  continue;
528
531
  // LineTerminator ::
529
532
  // - "New Line (U+000A)"
530
533
  // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
531
534
  // - "Carriage Return (U+000D)" "New Line (U+000A)"
532
535
  case 10:
533
- ++r, ++t.line, t.lineStart = r;
536
+ ++i, ++e.line, e.lineStart = i;
534
537
  continue;
535
538
  case 13:
536
- n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++t.line, t.lineStart = r;
539
+ n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
537
540
  continue;
538
541
  // Comment
539
542
  case 35:
540
- return Be(t, r);
543
+ return Me(e, i);
541
544
  // Token ::
542
545
  // - Punctuator
543
546
  // - Name
@@ -547,207 +550,207 @@ function $e(t, e) {
547
550
  //
548
551
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
549
552
  case 33:
550
- return f(t, a.BANG, r, r + 1);
553
+ return f(e, a.BANG, i, i + 1);
551
554
  case 36:
552
- return f(t, a.DOLLAR, r, r + 1);
555
+ return f(e, a.DOLLAR, i, i + 1);
553
556
  case 38:
554
- return f(t, a.AMP, r, r + 1);
557
+ return f(e, a.AMP, i, i + 1);
555
558
  case 40:
556
- return f(t, a.PAREN_L, r, r + 1);
559
+ return f(e, a.PAREN_L, i, i + 1);
557
560
  case 41:
558
- return f(t, a.PAREN_R, r, r + 1);
561
+ return f(e, a.PAREN_R, i, i + 1);
559
562
  case 46:
560
- if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
561
- return f(t, a.SPREAD, r, r + 3);
563
+ if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
564
+ return f(e, a.SPREAD, i, i + 3);
562
565
  break;
563
566
  case 58:
564
- return f(t, a.COLON, r, r + 1);
567
+ return f(e, a.COLON, i, i + 1);
565
568
  case 61:
566
- return f(t, a.EQUALS, r, r + 1);
569
+ return f(e, a.EQUALS, i, i + 1);
567
570
  case 64:
568
- return f(t, a.AT, r, r + 1);
571
+ return f(e, a.AT, i, i + 1);
569
572
  case 91:
570
- return f(t, a.BRACKET_L, r, r + 1);
573
+ return f(e, a.BRACKET_L, i, i + 1);
571
574
  case 93:
572
- return f(t, a.BRACKET_R, r, r + 1);
575
+ return f(e, a.BRACKET_R, i, i + 1);
573
576
  case 123:
574
- return f(t, a.BRACE_L, r, r + 1);
577
+ return f(e, a.BRACE_L, i, i + 1);
575
578
  case 124:
576
- return f(t, a.PIPE, r, r + 1);
579
+ return f(e, a.PIPE, i, i + 1);
577
580
  case 125:
578
- return f(t, a.BRACE_R, r, r + 1);
581
+ return f(e, a.BRACE_R, i, i + 1);
579
582
  // StringValue
580
583
  case 34:
581
- return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ge(t, r) : Ue(t, r);
584
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? He(e, i) : qe(e, i);
582
585
  }
583
586
  if (x(s) || s === 45)
584
- return Ve(t, r, s);
585
- if (pe(s))
586
- return je(t, r);
587
+ return ze(e, i, s);
588
+ if (me(s))
589
+ return Je(e, i);
587
590
  throw I(
588
- t.source,
589
- r,
590
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(n, r) ? `Unexpected character: ${D(t, r)}.` : `Invalid character: ${D(t, r)}.`
591
+ e.source,
592
+ i,
593
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || B(n, i) ? `Unexpected character: ${D(e, i)}.` : `Invalid character: ${D(e, i)}.`
591
594
  );
592
595
  }
593
- return f(t, a.EOF, i, i);
596
+ return f(e, a.EOF, r, r);
594
597
  }
595
- function Be(t, e) {
596
- const n = t.source.body, i = n.length;
597
- let r = e + 1;
598
- for (; r < i; ) {
599
- const s = n.charCodeAt(r);
598
+ function Me(e, t) {
599
+ const n = e.source.body, r = n.length;
600
+ let i = t + 1;
601
+ for (; i < r; ) {
602
+ const s = n.charCodeAt(i);
600
603
  if (s === 10 || s === 13)
601
604
  break;
602
605
  if (P(s))
603
- ++r;
604
- else if (B(n, r))
605
- r += 2;
606
+ ++i;
607
+ else if (B(n, i))
608
+ i += 2;
606
609
  else
607
610
  break;
608
611
  }
609
612
  return f(
610
- t,
611
- a.COMMENT,
612
613
  e,
613
- r,
614
- n.slice(e + 1, r)
614
+ a.COMMENT,
615
+ t,
616
+ i,
617
+ n.slice(t + 1, i)
615
618
  );
616
619
  }
617
- function Ve(t, e, n) {
618
- const i = t.source.body;
619
- let r = e, s = n, o = !1;
620
- if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
621
- if (s = i.charCodeAt(++r), x(s))
620
+ function ze(e, t, n) {
621
+ const r = e.source.body;
622
+ let i = t, s = n, o = !1;
623
+ if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
624
+ if (s = r.charCodeAt(++i), x(s))
622
625
  throw I(
623
- t.source,
624
- r,
626
+ e.source,
627
+ i,
625
628
  `Invalid number, unexpected digit after 0: ${D(
626
- t,
627
- r
629
+ e,
630
+ i
628
631
  )}.`
629
632
  );
630
633
  } else
631
- r = M(t, r, s), s = i.charCodeAt(r);
632
- if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(t, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(t, r, s), s = i.charCodeAt(r)), s === 46 || pe(s))
634
+ i = M(e, i, s), s = r.charCodeAt(i);
635
+ if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = M(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = M(e, i, s), s = r.charCodeAt(i)), s === 46 || me(s))
633
636
  throw I(
634
- t.source,
635
- r,
637
+ e.source,
638
+ i,
636
639
  `Invalid number, expected digit but got: ${D(
637
- t,
638
- r
640
+ e,
641
+ i
639
642
  )}.`
640
643
  );
641
644
  return f(
642
- t,
643
- o ? a.FLOAT : a.INT,
644
645
  e,
645
- r,
646
- i.slice(e, r)
646
+ o ? a.FLOAT : a.INT,
647
+ t,
648
+ i,
649
+ r.slice(t, i)
647
650
  );
648
651
  }
649
- function M(t, e, n) {
652
+ function M(e, t, n) {
650
653
  if (!x(n))
651
654
  throw I(
652
- t.source,
653
- e,
655
+ e.source,
656
+ t,
654
657
  `Invalid number, expected digit but got: ${D(
655
- t,
656
- e
658
+ e,
659
+ t
657
660
  )}.`
658
661
  );
659
- const i = t.source.body;
660
- let r = e + 1;
661
- for (; x(i.charCodeAt(r)); )
662
- ++r;
663
- return r;
664
- }
665
- function Ue(t, e) {
666
- const n = t.source.body, i = n.length;
667
- let r = e + 1, s = r, o = "";
668
- for (; r < i; ) {
669
- const l = n.charCodeAt(r);
662
+ const r = e.source.body;
663
+ let i = t + 1;
664
+ for (; x(r.charCodeAt(i)); )
665
+ ++i;
666
+ return i;
667
+ }
668
+ function qe(e, t) {
669
+ const n = e.source.body, r = n.length;
670
+ let i = t + 1, s = i, o = "";
671
+ for (; i < r; ) {
672
+ const l = n.charCodeAt(i);
670
673
  if (l === 34)
671
- return o += n.slice(s, r), f(t, a.STRING, e, r + 1, o);
674
+ return o += n.slice(s, i), f(e, a.STRING, t, i + 1, o);
672
675
  if (l === 92) {
673
- o += n.slice(s, r);
674
- const p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Me(t, r) : ze(t, r) : qe(t, r);
675
- o += p.value, r += p.size, s = r;
676
+ o += n.slice(s, i);
677
+ const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Ge(e, i) : je(e, i) : Ye(e, i);
678
+ o += h.value, i += h.size, s = i;
676
679
  continue;
677
680
  }
678
681
  if (l === 10 || l === 13)
679
682
  break;
680
683
  if (P(l))
681
- ++r;
682
- else if (B(n, r))
683
- r += 2;
684
+ ++i;
685
+ else if (B(n, i))
686
+ i += 2;
684
687
  else
685
688
  throw I(
686
- t.source,
687
- r,
689
+ e.source,
690
+ i,
688
691
  `Invalid character within String: ${D(
689
- t,
690
- r
692
+ e,
693
+ i
691
694
  )}.`
692
695
  );
693
696
  }
694
- throw I(t.source, r, "Unterminated string.");
697
+ throw I(e.source, i, "Unterminated string.");
695
698
  }
696
- function Me(t, e) {
697
- const n = t.source.body;
698
- let i = 0, r = 3;
699
- for (; r < 12; ) {
700
- const s = n.charCodeAt(e + r++);
699
+ function Ge(e, t) {
700
+ const n = e.source.body;
701
+ let r = 0, i = 3;
702
+ for (; i < 12; ) {
703
+ const s = n.charCodeAt(t + i++);
701
704
  if (s === 125) {
702
- if (r < 5 || !P(i))
705
+ if (i < 5 || !P(r))
703
706
  break;
704
707
  return {
705
- value: String.fromCodePoint(i),
706
- size: r
708
+ value: String.fromCodePoint(r),
709
+ size: i
707
710
  };
708
711
  }
709
- if (i = i << 4 | S(s), i < 0)
712
+ if (r = r << 4 | S(s), r < 0)
710
713
  break;
711
714
  }
712
715
  throw I(
713
- t.source,
714
- e,
716
+ e.source,
717
+ t,
715
718
  `Invalid Unicode escape sequence: "${n.slice(
716
- e,
717
- e + r
719
+ t,
720
+ t + i
718
721
  )}".`
719
722
  );
720
723
  }
721
- function ze(t, e) {
722
- const n = t.source.body, i = W(n, e + 2);
723
- if (P(i))
724
+ function je(e, t) {
725
+ const n = e.source.body, r = W(n, t + 2);
726
+ if (P(r))
724
727
  return {
725
- value: String.fromCodePoint(i),
728
+ value: String.fromCodePoint(r),
726
729
  size: 6
727
730
  };
728
- if (he(i) && n.charCodeAt(e + 6) === 92 && n.charCodeAt(e + 7) === 117) {
729
- const r = W(n, e + 8);
730
- if (ge(r))
731
+ if (fe(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
732
+ const i = W(n, t + 8);
733
+ if (Ie(i))
731
734
  return {
732
- value: String.fromCodePoint(i, r),
735
+ value: String.fromCodePoint(r, i),
733
736
  size: 12
734
737
  };
735
738
  }
736
739
  throw I(
737
- t.source,
738
- e,
739
- `Invalid Unicode escape sequence: "${n.slice(e, e + 6)}".`
740
+ e.source,
741
+ t,
742
+ `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
740
743
  );
741
744
  }
742
- function W(t, e) {
743
- return S(t.charCodeAt(e)) << 12 | S(t.charCodeAt(e + 1)) << 8 | S(t.charCodeAt(e + 2)) << 4 | S(t.charCodeAt(e + 3));
745
+ function W(e, t) {
746
+ return S(e.charCodeAt(t)) << 12 | S(e.charCodeAt(t + 1)) << 8 | S(e.charCodeAt(t + 2)) << 4 | S(e.charCodeAt(t + 3));
744
747
  }
745
- function S(t) {
746
- return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1;
748
+ function S(e) {
749
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
747
750
  }
748
- function qe(t, e) {
749
- const n = t.source.body;
750
- switch (n.charCodeAt(e + 1)) {
751
+ function Ye(e, t) {
752
+ const n = e.source.body;
753
+ switch (n.charCodeAt(t + 1)) {
751
754
  case 34:
752
755
  return {
753
756
  value: '"',
@@ -791,39 +794,39 @@ function qe(t, e) {
791
794
  };
792
795
  }
793
796
  throw I(
794
- t.source,
795
- e,
797
+ e.source,
798
+ t,
796
799
  `Invalid character escape sequence: "${n.slice(
797
- e,
798
- e + 2
800
+ t,
801
+ t + 2
799
802
  )}".`
800
803
  );
801
804
  }
802
- function Ge(t, e) {
803
- const n = t.source.body, i = n.length;
804
- let r = t.lineStart, s = e + 3, o = s, l = "";
805
- const p = [];
806
- for (; s < i; ) {
805
+ function He(e, t) {
806
+ const n = e.source.body, r = n.length;
807
+ let i = e.lineStart, s = t + 3, o = s, l = "";
808
+ const h = [];
809
+ for (; s < r; ) {
807
810
  const E = n.charCodeAt(s);
808
811
  if (E === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
809
- l += n.slice(o, s), p.push(l);
812
+ l += n.slice(o, s), h.push(l);
810
813
  const g = f(
811
- t,
812
- a.BLOCK_STRING,
813
814
  e,
815
+ a.BLOCK_STRING,
816
+ t,
814
817
  s + 3,
815
818
  // Return a string of the lines joined with U+000A.
816
- Le(p).join(`
819
+ we(h).join(`
817
820
  `)
818
821
  );
819
- return t.line += p.length - 1, t.lineStart = r, g;
822
+ return e.line += h.length - 1, e.lineStart = i, g;
820
823
  }
821
824
  if (E === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
822
825
  l += n.slice(o, s), o = s + 1, s += 4;
823
826
  continue;
824
827
  }
825
828
  if (E === 10 || E === 13) {
826
- l += n.slice(o, s), p.push(l), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, r = s;
829
+ l += n.slice(o, s), h.push(l), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, l = "", o = s, i = s;
827
830
  continue;
828
831
  }
829
832
  if (P(E))
@@ -832,110 +835,110 @@ function Ge(t, e) {
832
835
  s += 2;
833
836
  else
834
837
  throw I(
835
- t.source,
838
+ e.source,
836
839
  s,
837
840
  `Invalid character within String: ${D(
838
- t,
841
+ e,
839
842
  s
840
843
  )}.`
841
844
  );
842
845
  }
843
- throw I(t.source, s, "Unterminated string.");
846
+ throw I(e.source, s, "Unterminated string.");
844
847
  }
845
- function je(t, e) {
846
- const n = t.source.body, i = n.length;
847
- let r = e + 1;
848
- for (; r < i; ) {
849
- const s = n.charCodeAt(r);
850
- if (_e(s))
851
- ++r;
848
+ function Je(e, t) {
849
+ const n = e.source.body, r = n.length;
850
+ let i = t + 1;
851
+ for (; i < r; ) {
852
+ const s = n.charCodeAt(i);
853
+ if (Fe(s))
854
+ ++i;
852
855
  else
853
856
  break;
854
857
  }
855
858
  return f(
856
- t,
857
- a.NAME,
858
859
  e,
859
- r,
860
- n.slice(e, r)
860
+ a.NAME,
861
+ t,
862
+ i,
863
+ n.slice(t, i)
861
864
  );
862
865
  }
863
- const Ye = 10, me = 2;
864
- function fe(t) {
865
- return V(t, []);
866
+ const Qe = 10, Ee = 2;
867
+ function ye(e) {
868
+ return U(e, []);
866
869
  }
867
- function V(t, e) {
868
- switch (typeof t) {
870
+ function U(e, t) {
871
+ switch (typeof e) {
869
872
  case "string":
870
- return JSON.stringify(t);
873
+ return JSON.stringify(e);
871
874
  case "function":
872
- return t.name ? `[function ${t.name}]` : "[function]";
875
+ return e.name ? `[function ${e.name}]` : "[function]";
873
876
  case "object":
874
- return He(t, e);
877
+ return Xe(e, t);
875
878
  default:
876
- return String(t);
879
+ return String(e);
877
880
  }
878
881
  }
879
- function He(t, e) {
880
- if (t === null)
882
+ function Xe(e, t) {
883
+ if (e === null)
881
884
  return "null";
882
- if (e.includes(t))
885
+ if (t.includes(e))
883
886
  return "[Circular]";
884
- const n = [...e, t];
885
- if (Je(t)) {
886
- const i = t.toJSON();
887
- if (i !== t)
888
- return typeof i == "string" ? i : V(i, n);
889
- } else if (Array.isArray(t))
890
- return Xe(t, n);
891
- return Qe(t, n);
892
- }
893
- function Je(t) {
894
- return typeof t.toJSON == "function";
895
- }
896
- function Qe(t, e) {
897
- const n = Object.entries(t);
898
- return n.length === 0 ? "{}" : e.length > me ? "[" + We(t) + "]" : "{ " + n.map(
899
- ([r, s]) => r + ": " + V(s, e)
887
+ const n = [...t, e];
888
+ if (We(e)) {
889
+ const r = e.toJSON();
890
+ if (r !== e)
891
+ return typeof r == "string" ? r : U(r, n);
892
+ } else if (Array.isArray(e))
893
+ return Ke(e, n);
894
+ return Ze(e, n);
895
+ }
896
+ function We(e) {
897
+ return typeof e.toJSON == "function";
898
+ }
899
+ function Ze(e, t) {
900
+ const n = Object.entries(e);
901
+ return n.length === 0 ? "{}" : t.length > Ee ? "[" + et(e) + "]" : "{ " + n.map(
902
+ ([i, s]) => i + ": " + U(s, t)
900
903
  ).join(", ") + " }";
901
904
  }
902
- function Xe(t, e) {
903
- if (t.length === 0)
905
+ function Ke(e, t) {
906
+ if (e.length === 0)
904
907
  return "[]";
905
- if (e.length > me)
908
+ if (t.length > Ee)
906
909
  return "[Array]";
907
- const n = Math.min(Ye, t.length), i = t.length - n, r = [];
910
+ const n = Math.min(Qe, e.length), r = e.length - n, i = [];
908
911
  for (let s = 0; s < n; ++s)
909
- r.push(V(t[s], e));
910
- return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
912
+ i.push(U(e[s], t));
913
+ return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
911
914
  }
912
- function We(t) {
913
- const e = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
914
- if (e === "Object" && typeof t.constructor == "function") {
915
- const n = t.constructor.name;
915
+ function et(e) {
916
+ const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
917
+ if (t === "Object" && typeof e.constructor == "function") {
918
+ const n = e.constructor.name;
916
919
  if (typeof n == "string" && n !== "")
917
920
  return n;
918
921
  }
919
- return e;
922
+ return t;
920
923
  }
921
- const Ze = globalThis.process && // eslint-disable-next-line no-undef
922
- process.env.NODE_ENV === "production", Ke = (
924
+ const tt = globalThis.process && // eslint-disable-next-line no-undef
925
+ process.env.NODE_ENV === "production", nt = (
923
926
  /* c8 ignore next 6 */
924
927
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
925
- Ze ? function(e, n) {
926
- return e instanceof n;
927
- } : function(e, n) {
928
- if (e instanceof n)
928
+ tt ? function(t, n) {
929
+ return t instanceof n;
930
+ } : function(t, n) {
931
+ if (t instanceof n)
929
932
  return !0;
930
- if (typeof e == "object" && e !== null) {
931
- var i;
932
- const r = n.prototype[Symbol.toStringTag], s = (
933
+ if (typeof t == "object" && t !== null) {
934
+ var r;
935
+ const i = n.prototype[Symbol.toStringTag], s = (
933
936
  // We still need to support constructor's name to detect conflicts with older versions of this library.
934
- Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name
937
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
935
938
  );
936
- if (r === s) {
937
- const o = fe(e);
938
- throw new Error(`Cannot use ${r} "${o}" from another module or realm.
939
+ if (i === s) {
940
+ const o = ye(t);
941
+ throw new Error(`Cannot use ${i} "${o}" from another module or realm.
939
942
 
940
943
  Ensure that there is only one instance of "graphql" in the node_modules
941
944
  directory. If different versions of "graphql" are the dependencies of other
@@ -952,15 +955,15 @@ spurious results.`);
952
955
  return !1;
953
956
  }
954
957
  );
955
- class Ie {
956
- constructor(e, n = "GraphQL request", i = {
958
+ class Oe {
959
+ constructor(t, n = "GraphQL request", r = {
957
960
  line: 1,
958
961
  column: 1
959
962
  }) {
960
- typeof e == "string" || U(!1, `Body must be a string. Received: ${fe(e)}.`), this.body = e, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || U(
963
+ typeof t == "string" || V(!1, `Body must be a string. Received: ${ye(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || V(
961
964
  !1,
962
965
  "line in locationOffset is 1-indexed and must be positive."
963
- ), this.locationOffset.column > 0 || U(
966
+ ), this.locationOffset.column > 0 || V(
964
967
  !1,
965
968
  "column in locationOffset is 1-indexed and must be positive."
966
969
  );
@@ -969,26 +972,26 @@ class Ie {
969
972
  return "Source";
970
973
  }
971
974
  }
972
- function et(t) {
973
- return Ke(t, Ie);
975
+ function rt(e) {
976
+ return nt(e, Oe);
974
977
  }
975
- function tt(t, e) {
976
- const n = new nt(t, e), i = n.parseDocument();
977
- return Object.defineProperty(i, "tokenCount", {
978
+ function it(e, t) {
979
+ const n = new st(e, t), r = n.parseDocument();
980
+ return Object.defineProperty(r, "tokenCount", {
978
981
  enumerable: !1,
979
982
  value: n.tokenCount
980
- }), i;
983
+ }), r;
981
984
  }
982
- class nt {
983
- constructor(e, n = {}) {
984
- const { lexer: i, ...r } = n;
985
- if (i)
986
- this._lexer = i;
985
+ class st {
986
+ constructor(t, n = {}) {
987
+ const { lexer: r, ...i } = n;
988
+ if (r)
989
+ this._lexer = r;
987
990
  else {
988
- const s = et(e) ? e : new Ie(e);
989
- this._lexer = new Fe(s);
991
+ const s = rt(t) ? t : new Oe(t);
992
+ this._lexer = new Be(s);
990
993
  }
991
- this._options = r, this._tokenCounter = 0;
994
+ this._options = i, this._tokenCounter = 0;
992
995
  }
993
996
  get tokenCount() {
994
997
  return this._tokenCounter;
@@ -997,10 +1000,10 @@ class nt {
997
1000
  * Converts a name lex token into a name parse node.
998
1001
  */
999
1002
  parseName() {
1000
- const e = this.expectToken(a.NAME);
1001
- return this.node(e, {
1003
+ const t = this.expectToken(a.NAME);
1004
+ return this.node(t, {
1002
1005
  kind: c.NAME,
1003
- value: e.value
1006
+ value: t.value
1004
1007
  });
1005
1008
  }
1006
1009
  // Implements the parsing rules in the Document section.
@@ -1043,8 +1046,8 @@ class nt {
1043
1046
  parseDefinition() {
1044
1047
  if (this.peek(a.BRACE_L))
1045
1048
  return this.parseOperationDefinition();
1046
- const e = this.peekDescription(), n = e ? this._lexer.lookahead() : this._lexer.token;
1047
- if (e && n.kind === a.BRACE_L)
1049
+ const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1050
+ if (t && n.kind === a.BRACE_L)
1048
1051
  throw I(
1049
1052
  this._lexer.source,
1050
1053
  this._lexer.token.start,
@@ -1077,7 +1080,7 @@ class nt {
1077
1080
  case "fragment":
1078
1081
  return this.parseFragmentDefinition();
1079
1082
  }
1080
- if (e)
1083
+ if (t)
1081
1084
  throw I(
1082
1085
  this._lexer.source,
1083
1086
  this._lexer.token.start,
@@ -1095,24 +1098,24 @@ class nt {
1095
1098
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1096
1099
  */
1097
1100
  parseOperationDefinition() {
1098
- const e = this._lexer.token;
1101
+ const t = this._lexer.token;
1099
1102
  if (this.peek(a.BRACE_L))
1100
- return this.node(e, {
1103
+ return this.node(t, {
1101
1104
  kind: c.OPERATION_DEFINITION,
1102
- operation: N.QUERY,
1105
+ operation: v.QUERY,
1103
1106
  description: void 0,
1104
1107
  name: void 0,
1105
1108
  variableDefinitions: [],
1106
1109
  directives: [],
1107
1110
  selectionSet: this.parseSelectionSet()
1108
1111
  });
1109
- const n = this.parseDescription(), i = this.parseOperationType();
1110
- let r;
1111
- return this.peek(a.NAME) && (r = this.parseName()), this.node(e, {
1112
+ const n = this.parseDescription(), r = this.parseOperationType();
1113
+ let i;
1114
+ return this.peek(a.NAME) && (i = this.parseName()), this.node(t, {
1112
1115
  kind: c.OPERATION_DEFINITION,
1113
- operation: i,
1116
+ operation: r,
1114
1117
  description: n,
1115
- name: r,
1118
+ name: i,
1116
1119
  variableDefinitions: this.parseVariableDefinitions(),
1117
1120
  directives: this.parseDirectives(!1),
1118
1121
  selectionSet: this.parseSelectionSet()
@@ -1122,16 +1125,16 @@ class nt {
1122
1125
  * OperationType : one of query mutation subscription
1123
1126
  */
1124
1127
  parseOperationType() {
1125
- const e = this.expectToken(a.NAME);
1126
- switch (e.value) {
1128
+ const t = this.expectToken(a.NAME);
1129
+ switch (t.value) {
1127
1130
  case "query":
1128
- return N.QUERY;
1131
+ return v.QUERY;
1129
1132
  case "mutation":
1130
- return N.MUTATION;
1133
+ return v.MUTATION;
1131
1134
  case "subscription":
1132
- return N.SUBSCRIPTION;
1135
+ return v.SUBSCRIPTION;
1133
1136
  }
1134
- throw this.unexpected(e);
1137
+ throw this.unexpected(t);
1135
1138
  }
1136
1139
  /**
1137
1140
  * VariableDefinitions : ( VariableDefinition+ )
@@ -1160,8 +1163,8 @@ class nt {
1160
1163
  * Variable : $ Name
1161
1164
  */
1162
1165
  parseVariable() {
1163
- const e = this._lexer.token;
1164
- return this.expectToken(a.DOLLAR), this.node(e, {
1166
+ const t = this._lexer.token;
1167
+ return this.expectToken(a.DOLLAR), this.node(t, {
1165
1168
  kind: c.VARIABLE,
1166
1169
  name: this.parseName()
1167
1170
  });
@@ -1196,12 +1199,12 @@ class nt {
1196
1199
  * Alias : Name :
1197
1200
  */
1198
1201
  parseField() {
1199
- const e = this._lexer.token, n = this.parseName();
1200
- let i, r;
1201
- return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(e, {
1202
+ const t = this._lexer.token, n = this.parseName();
1203
+ let r, i;
1204
+ return this.expectOptionalToken(a.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1202
1205
  kind: c.FIELD,
1203
- alias: i,
1204
- name: r,
1206
+ alias: r,
1207
+ name: i,
1205
1208
  arguments: this.parseArguments(!1),
1206
1209
  directives: this.parseDirectives(!1),
1207
1210
  selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
@@ -1210,19 +1213,19 @@ class nt {
1210
1213
  /**
1211
1214
  * Arguments[Const] : ( Argument[?Const]+ )
1212
1215
  */
1213
- parseArguments(e) {
1214
- const n = e ? this.parseConstArgument : this.parseArgument;
1216
+ parseArguments(t) {
1217
+ const n = t ? this.parseConstArgument : this.parseArgument;
1215
1218
  return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
1216
1219
  }
1217
1220
  /**
1218
1221
  * Argument[Const] : Name : Value[?Const]
1219
1222
  */
1220
- parseArgument(e = !1) {
1221
- const n = this._lexer.token, i = this.parseName();
1223
+ parseArgument(t = !1) {
1224
+ const n = this._lexer.token, r = this.parseName();
1222
1225
  return this.expectToken(a.COLON), this.node(n, {
1223
1226
  kind: c.ARGUMENT,
1224
- name: i,
1225
- value: this.parseValueLiteral(e)
1227
+ name: r,
1228
+ value: this.parseValueLiteral(t)
1226
1229
  });
1227
1230
  }
1228
1231
  parseConstArgument() {
@@ -1237,14 +1240,14 @@ class nt {
1237
1240
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
1238
1241
  */
1239
1242
  parseFragment() {
1240
- const e = this._lexer.token;
1243
+ const t = this._lexer.token;
1241
1244
  this.expectToken(a.SPREAD);
1242
1245
  const n = this.expectOptionalKeyword("on");
1243
- return !n && this.peek(a.NAME) ? this.node(e, {
1246
+ return !n && this.peek(a.NAME) ? this.node(t, {
1244
1247
  kind: c.FRAGMENT_SPREAD,
1245
1248
  name: this.parseFragmentName(),
1246
1249
  directives: this.parseDirectives(!1)
1247
- }) : this.node(e, {
1250
+ }) : this.node(t, {
1248
1251
  kind: c.INLINE_FRAGMENT,
1249
1252
  typeCondition: n ? this.parseNamedType() : void 0,
1250
1253
  directives: this.parseDirectives(!1),
@@ -1258,8 +1261,8 @@ class nt {
1258
1261
  * TypeCondition : NamedType
1259
1262
  */
1260
1263
  parseFragmentDefinition() {
1261
- const e = this._lexer.token, n = this.parseDescription();
1262
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
1264
+ const t = this._lexer.token, n = this.parseDescription();
1265
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1263
1266
  kind: c.FRAGMENT_DEFINITION,
1264
1267
  description: n,
1265
1268
  name: this.parseFragmentName(),
@@ -1267,7 +1270,7 @@ class nt {
1267
1270
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1268
1271
  directives: this.parseDirectives(!1),
1269
1272
  selectionSet: this.parseSelectionSet()
1270
- }) : this.node(e, {
1273
+ }) : this.node(t, {
1271
1274
  kind: c.FRAGMENT_DEFINITION,
1272
1275
  description: n,
1273
1276
  name: this.parseFragmentName(),
@@ -1303,13 +1306,13 @@ class nt {
1303
1306
  *
1304
1307
  * EnumValue : Name but not `true`, `false` or `null`
1305
1308
  */
1306
- parseValueLiteral(e) {
1309
+ parseValueLiteral(t) {
1307
1310
  const n = this._lexer.token;
1308
1311
  switch (n.kind) {
1309
1312
  case a.BRACKET_L:
1310
- return this.parseList(e);
1313
+ return this.parseList(t);
1311
1314
  case a.BRACE_L:
1312
- return this.parseObject(e);
1315
+ return this.parseObject(t);
1313
1316
  case a.INT:
1314
1317
  return this.advanceLexer(), this.node(n, {
1315
1318
  kind: c.INT,
@@ -1346,13 +1349,13 @@ class nt {
1346
1349
  });
1347
1350
  }
1348
1351
  case a.DOLLAR:
1349
- if (e)
1352
+ if (t)
1350
1353
  if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1351
- const i = this._lexer.token.value;
1354
+ const r = this._lexer.token.value;
1352
1355
  throw I(
1353
1356
  this._lexer.source,
1354
1357
  n.start,
1355
- `Unexpected variable "$${i}" in constant value.`
1358
+ `Unexpected variable "$${r}" in constant value.`
1356
1359
  );
1357
1360
  } else
1358
1361
  throw this.unexpected(n);
@@ -1365,11 +1368,11 @@ class nt {
1365
1368
  return this.parseValueLiteral(!0);
1366
1369
  }
1367
1370
  parseStringLiteral() {
1368
- const e = this._lexer.token;
1369
- return this.advanceLexer(), this.node(e, {
1371
+ const t = this._lexer.token;
1372
+ return this.advanceLexer(), this.node(t, {
1370
1373
  kind: c.STRING,
1371
- value: e.value,
1372
- block: e.kind === a.BLOCK_STRING
1374
+ value: t.value,
1375
+ block: t.kind === a.BLOCK_STRING
1373
1376
  });
1374
1377
  }
1375
1378
  /**
@@ -1377,8 +1380,8 @@ class nt {
1377
1380
  * - [ ]
1378
1381
  * - [ Value[?Const]+ ]
1379
1382
  */
1380
- parseList(e) {
1381
- const n = () => this.parseValueLiteral(e);
1383
+ parseList(t) {
1384
+ const n = () => this.parseValueLiteral(t);
1382
1385
  return this.node(this._lexer.token, {
1383
1386
  kind: c.LIST,
1384
1387
  values: this.any(a.BRACKET_L, n, a.BRACKET_R)
@@ -1391,8 +1394,8 @@ class nt {
1391
1394
  * - { ObjectField[?Const]+ }
1392
1395
  * ```
1393
1396
  */
1394
- parseObject(e) {
1395
- const n = () => this.parseObjectField(e);
1397
+ parseObject(t) {
1398
+ const n = () => this.parseObjectField(t);
1396
1399
  return this.node(this._lexer.token, {
1397
1400
  kind: c.OBJECT,
1398
1401
  fields: this.any(a.BRACE_L, n, a.BRACE_R)
@@ -1401,22 +1404,22 @@ class nt {
1401
1404
  /**
1402
1405
  * ObjectField[Const] : Name : Value[?Const]
1403
1406
  */
1404
- parseObjectField(e) {
1405
- const n = this._lexer.token, i = this.parseName();
1407
+ parseObjectField(t) {
1408
+ const n = this._lexer.token, r = this.parseName();
1406
1409
  return this.expectToken(a.COLON), this.node(n, {
1407
1410
  kind: c.OBJECT_FIELD,
1408
- name: i,
1409
- value: this.parseValueLiteral(e)
1411
+ name: r,
1412
+ value: this.parseValueLiteral(t)
1410
1413
  });
1411
1414
  }
1412
1415
  // Implements the parsing rules in the Directives section.
1413
1416
  /**
1414
1417
  * Directives[Const] : Directive[?Const]+
1415
1418
  */
1416
- parseDirectives(e) {
1419
+ parseDirectives(t) {
1417
1420
  const n = [];
1418
1421
  for (; this.peek(a.AT); )
1419
- n.push(this.parseDirective(e));
1422
+ n.push(this.parseDirective(t));
1420
1423
  return n;
1421
1424
  }
1422
1425
  parseConstDirectives() {
@@ -1427,12 +1430,12 @@ class nt {
1427
1430
  * Directive[Const] : @ Name Arguments[?Const]?
1428
1431
  * ```
1429
1432
  */
1430
- parseDirective(e) {
1433
+ parseDirective(t) {
1431
1434
  const n = this._lexer.token;
1432
1435
  return this.expectToken(a.AT), this.node(n, {
1433
1436
  kind: c.DIRECTIVE,
1434
1437
  name: this.parseName(),
1435
- arguments: this.parseArguments(e)
1438
+ arguments: this.parseArguments(t)
1436
1439
  });
1437
1440
  }
1438
1441
  // Implements the parsing rules in the Types section.
@@ -1443,17 +1446,17 @@ class nt {
1443
1446
  * - NonNullType
1444
1447
  */
1445
1448
  parseTypeReference() {
1446
- const e = this._lexer.token;
1449
+ const t = this._lexer.token;
1447
1450
  let n;
1448
1451
  if (this.expectOptionalToken(a.BRACKET_L)) {
1449
- const i = this.parseTypeReference();
1450
- this.expectToken(a.BRACKET_R), n = this.node(e, {
1452
+ const r = this.parseTypeReference();
1453
+ this.expectToken(a.BRACKET_R), n = this.node(t, {
1451
1454
  kind: c.LIST_TYPE,
1452
- type: i
1455
+ type: r
1453
1456
  });
1454
1457
  } else
1455
1458
  n = this.parseNamedType();
1456
- return this.expectOptionalToken(a.BANG) ? this.node(e, {
1459
+ return this.expectOptionalToken(a.BANG) ? this.node(t, {
1457
1460
  kind: c.NON_NULL_TYPE,
1458
1461
  type: n
1459
1462
  }) : n;
@@ -1484,45 +1487,45 @@ class nt {
1484
1487
  * ```
1485
1488
  */
1486
1489
  parseSchemaDefinition() {
1487
- const e = this._lexer.token, n = this.parseDescription();
1490
+ const t = this._lexer.token, n = this.parseDescription();
1488
1491
  this.expectKeyword("schema");
1489
- const i = this.parseConstDirectives(), r = this.many(
1492
+ const r = this.parseConstDirectives(), i = this.many(
1490
1493
  a.BRACE_L,
1491
1494
  this.parseOperationTypeDefinition,
1492
1495
  a.BRACE_R
1493
1496
  );
1494
- return this.node(e, {
1497
+ return this.node(t, {
1495
1498
  kind: c.SCHEMA_DEFINITION,
1496
1499
  description: n,
1497
- directives: i,
1498
- operationTypes: r
1500
+ directives: r,
1501
+ operationTypes: i
1499
1502
  });
1500
1503
  }
1501
1504
  /**
1502
1505
  * OperationTypeDefinition : OperationType : NamedType
1503
1506
  */
1504
1507
  parseOperationTypeDefinition() {
1505
- const e = this._lexer.token, n = this.parseOperationType();
1508
+ const t = this._lexer.token, n = this.parseOperationType();
1506
1509
  this.expectToken(a.COLON);
1507
- const i = this.parseNamedType();
1508
- return this.node(e, {
1510
+ const r = this.parseNamedType();
1511
+ return this.node(t, {
1509
1512
  kind: c.OPERATION_TYPE_DEFINITION,
1510
1513
  operation: n,
1511
- type: i
1514
+ type: r
1512
1515
  });
1513
1516
  }
1514
1517
  /**
1515
1518
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1516
1519
  */
1517
1520
  parseScalarTypeDefinition() {
1518
- const e = this._lexer.token, n = this.parseDescription();
1521
+ const t = this._lexer.token, n = this.parseDescription();
1519
1522
  this.expectKeyword("scalar");
1520
- const i = this.parseName(), r = this.parseConstDirectives();
1521
- return this.node(e, {
1523
+ const r = this.parseName(), i = this.parseConstDirectives();
1524
+ return this.node(t, {
1522
1525
  kind: c.SCALAR_TYPE_DEFINITION,
1523
1526
  description: n,
1524
- name: i,
1525
- directives: r
1527
+ name: r,
1528
+ directives: i
1526
1529
  });
1527
1530
  }
1528
1531
  /**
@@ -1531,14 +1534,14 @@ class nt {
1531
1534
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1532
1535
  */
1533
1536
  parseObjectTypeDefinition() {
1534
- const e = this._lexer.token, n = this.parseDescription();
1537
+ const t = this._lexer.token, n = this.parseDescription();
1535
1538
  this.expectKeyword("type");
1536
- const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1537
- return this.node(e, {
1539
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1540
+ return this.node(t, {
1538
1541
  kind: c.OBJECT_TYPE_DEFINITION,
1539
1542
  description: n,
1540
- name: i,
1541
- interfaces: r,
1543
+ name: r,
1544
+ interfaces: i,
1542
1545
  directives: s,
1543
1546
  fields: o
1544
1547
  });
@@ -1568,14 +1571,14 @@ class nt {
1568
1571
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1569
1572
  */
1570
1573
  parseFieldDefinition() {
1571
- const e = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1574
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
1572
1575
  this.expectToken(a.COLON);
1573
1576
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1574
- return this.node(e, {
1577
+ return this.node(t, {
1575
1578
  kind: c.FIELD_DEFINITION,
1576
1579
  description: n,
1577
- name: i,
1578
- arguments: r,
1580
+ name: r,
1581
+ arguments: i,
1579
1582
  type: s,
1580
1583
  directives: o
1581
1584
  });
@@ -1595,17 +1598,17 @@ class nt {
1595
1598
  * - Description? Name : Type DefaultValue? Directives[Const]?
1596
1599
  */
1597
1600
  parseInputValueDef() {
1598
- const e = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1601
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1599
1602
  this.expectToken(a.COLON);
1600
- const r = this.parseTypeReference();
1603
+ const i = this.parseTypeReference();
1601
1604
  let s;
1602
1605
  this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1603
1606
  const o = this.parseConstDirectives();
1604
- return this.node(e, {
1607
+ return this.node(t, {
1605
1608
  kind: c.INPUT_VALUE_DEFINITION,
1606
1609
  description: n,
1607
- name: i,
1608
- type: r,
1610
+ name: r,
1611
+ type: i,
1609
1612
  defaultValue: s,
1610
1613
  directives: o
1611
1614
  });
@@ -1615,14 +1618,14 @@ class nt {
1615
1618
  * - Description? interface Name Directives[Const]? FieldsDefinition?
1616
1619
  */
1617
1620
  parseInterfaceTypeDefinition() {
1618
- const e = this._lexer.token, n = this.parseDescription();
1621
+ const t = this._lexer.token, n = this.parseDescription();
1619
1622
  this.expectKeyword("interface");
1620
- const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1621
- return this.node(e, {
1623
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1624
+ return this.node(t, {
1622
1625
  kind: c.INTERFACE_TYPE_DEFINITION,
1623
1626
  description: n,
1624
- name: i,
1625
- interfaces: r,
1627
+ name: r,
1628
+ interfaces: i,
1626
1629
  directives: s,
1627
1630
  fields: o
1628
1631
  });
@@ -1632,14 +1635,14 @@ class nt {
1632
1635
  * - Description? union Name Directives[Const]? UnionMemberTypes?
1633
1636
  */
1634
1637
  parseUnionTypeDefinition() {
1635
- const e = this._lexer.token, n = this.parseDescription();
1638
+ const t = this._lexer.token, n = this.parseDescription();
1636
1639
  this.expectKeyword("union");
1637
- const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1638
- return this.node(e, {
1640
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1641
+ return this.node(t, {
1639
1642
  kind: c.UNION_TYPE_DEFINITION,
1640
1643
  description: n,
1641
- name: i,
1642
- directives: r,
1644
+ name: r,
1645
+ directives: i,
1643
1646
  types: s
1644
1647
  });
1645
1648
  }
@@ -1656,14 +1659,14 @@ class nt {
1656
1659
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1657
1660
  */
1658
1661
  parseEnumTypeDefinition() {
1659
- const e = this._lexer.token, n = this.parseDescription();
1662
+ const t = this._lexer.token, n = this.parseDescription();
1660
1663
  this.expectKeyword("enum");
1661
- const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1662
- return this.node(e, {
1664
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1665
+ return this.node(t, {
1663
1666
  kind: c.ENUM_TYPE_DEFINITION,
1664
1667
  description: n,
1665
- name: i,
1666
- directives: r,
1668
+ name: r,
1669
+ directives: i,
1667
1670
  values: s
1668
1671
  });
1669
1672
  }
@@ -1683,12 +1686,12 @@ class nt {
1683
1686
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1684
1687
  */
1685
1688
  parseEnumValueDefinition() {
1686
- const e = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1687
- return this.node(e, {
1689
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1690
+ return this.node(t, {
1688
1691
  kind: c.ENUM_VALUE_DEFINITION,
1689
1692
  description: n,
1690
- name: i,
1691
- directives: r
1693
+ name: r,
1694
+ directives: i
1692
1695
  });
1693
1696
  }
1694
1697
  /**
@@ -1699,7 +1702,7 @@ class nt {
1699
1702
  throw I(
1700
1703
  this._lexer.source,
1701
1704
  this._lexer.token.start,
1702
- `${_(
1705
+ `${C(
1703
1706
  this._lexer.token
1704
1707
  )} is reserved and cannot be used for an enum value.`
1705
1708
  );
@@ -1710,14 +1713,14 @@ class nt {
1710
1713
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
1711
1714
  */
1712
1715
  parseInputObjectTypeDefinition() {
1713
- const e = this._lexer.token, n = this.parseDescription();
1716
+ const t = this._lexer.token, n = this.parseDescription();
1714
1717
  this.expectKeyword("input");
1715
- const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1716
- return this.node(e, {
1718
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1719
+ return this.node(t, {
1717
1720
  kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1718
1721
  description: n,
1719
- name: i,
1720
- directives: r,
1722
+ name: r,
1723
+ directives: i,
1721
1724
  fields: s
1722
1725
  });
1723
1726
  }
@@ -1747,9 +1750,9 @@ class nt {
1747
1750
  * - InputObjectTypeDefinition
1748
1751
  */
1749
1752
  parseTypeSystemExtension() {
1750
- const e = this._lexer.lookahead();
1751
- if (e.kind === a.NAME)
1752
- switch (e.value) {
1753
+ const t = this._lexer.lookahead();
1754
+ if (t.kind === a.NAME)
1755
+ switch (t.value) {
1753
1756
  case "schema":
1754
1757
  return this.parseSchemaExtension();
1755
1758
  case "scalar":
@@ -1765,7 +1768,7 @@ class nt {
1765
1768
  case "input":
1766
1769
  return this.parseInputObjectTypeExtension();
1767
1770
  }
1768
- throw this.unexpected(e);
1771
+ throw this.unexpected(t);
1769
1772
  }
1770
1773
  /**
1771
1774
  * ```
@@ -1775,19 +1778,19 @@ class nt {
1775
1778
  * ```
1776
1779
  */
1777
1780
  parseSchemaExtension() {
1778
- const e = this._lexer.token;
1781
+ const t = this._lexer.token;
1779
1782
  this.expectKeyword("extend"), this.expectKeyword("schema");
1780
- const n = this.parseConstDirectives(), i = this.optionalMany(
1783
+ const n = this.parseConstDirectives(), r = this.optionalMany(
1781
1784
  a.BRACE_L,
1782
1785
  this.parseOperationTypeDefinition,
1783
1786
  a.BRACE_R
1784
1787
  );
1785
- if (n.length === 0 && i.length === 0)
1788
+ if (n.length === 0 && r.length === 0)
1786
1789
  throw this.unexpected();
1787
- return this.node(e, {
1790
+ return this.node(t, {
1788
1791
  kind: c.SCHEMA_EXTENSION,
1789
1792
  directives: n,
1790
- operationTypes: i
1793
+ operationTypes: r
1791
1794
  });
1792
1795
  }
1793
1796
  /**
@@ -1795,15 +1798,15 @@ class nt {
1795
1798
  * - extend scalar Name Directives[Const]
1796
1799
  */
1797
1800
  parseScalarTypeExtension() {
1798
- const e = this._lexer.token;
1801
+ const t = this._lexer.token;
1799
1802
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1800
- const n = this.parseName(), i = this.parseConstDirectives();
1801
- if (i.length === 0)
1803
+ const n = this.parseName(), r = this.parseConstDirectives();
1804
+ if (r.length === 0)
1802
1805
  throw this.unexpected();
1803
- return this.node(e, {
1806
+ return this.node(t, {
1804
1807
  kind: c.SCALAR_TYPE_EXTENSION,
1805
1808
  name: n,
1806
- directives: i
1809
+ directives: r
1807
1810
  });
1808
1811
  }
1809
1812
  /**
@@ -1813,16 +1816,16 @@ class nt {
1813
1816
  * - extend type Name ImplementsInterfaces
1814
1817
  */
1815
1818
  parseObjectTypeExtension() {
1816
- const e = this._lexer.token;
1819
+ const t = this._lexer.token;
1817
1820
  this.expectKeyword("extend"), this.expectKeyword("type");
1818
- const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1819
- if (i.length === 0 && r.length === 0 && s.length === 0)
1821
+ const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1822
+ if (r.length === 0 && i.length === 0 && s.length === 0)
1820
1823
  throw this.unexpected();
1821
- return this.node(e, {
1824
+ return this.node(t, {
1822
1825
  kind: c.OBJECT_TYPE_EXTENSION,
1823
1826
  name: n,
1824
- interfaces: i,
1825
- directives: r,
1827
+ interfaces: r,
1828
+ directives: i,
1826
1829
  fields: s
1827
1830
  });
1828
1831
  }
@@ -1833,16 +1836,16 @@ class nt {
1833
1836
  * - extend interface Name ImplementsInterfaces
1834
1837
  */
1835
1838
  parseInterfaceTypeExtension() {
1836
- const e = this._lexer.token;
1839
+ const t = this._lexer.token;
1837
1840
  this.expectKeyword("extend"), this.expectKeyword("interface");
1838
- const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1839
- if (i.length === 0 && r.length === 0 && s.length === 0)
1841
+ const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1842
+ if (r.length === 0 && i.length === 0 && s.length === 0)
1840
1843
  throw this.unexpected();
1841
- return this.node(e, {
1844
+ return this.node(t, {
1842
1845
  kind: c.INTERFACE_TYPE_EXTENSION,
1843
1846
  name: n,
1844
- interfaces: i,
1845
- directives: r,
1847
+ interfaces: r,
1848
+ directives: i,
1846
1849
  fields: s
1847
1850
  });
1848
1851
  }
@@ -1852,16 +1855,16 @@ class nt {
1852
1855
  * - extend union Name Directives[Const]
1853
1856
  */
1854
1857
  parseUnionTypeExtension() {
1855
- const e = this._lexer.token;
1858
+ const t = this._lexer.token;
1856
1859
  this.expectKeyword("extend"), this.expectKeyword("union");
1857
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1858
- if (i.length === 0 && r.length === 0)
1860
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1861
+ if (r.length === 0 && i.length === 0)
1859
1862
  throw this.unexpected();
1860
- return this.node(e, {
1863
+ return this.node(t, {
1861
1864
  kind: c.UNION_TYPE_EXTENSION,
1862
1865
  name: n,
1863
- directives: i,
1864
- types: r
1866
+ directives: r,
1867
+ types: i
1865
1868
  });
1866
1869
  }
1867
1870
  /**
@@ -1870,16 +1873,16 @@ class nt {
1870
1873
  * - extend enum Name Directives[Const]
1871
1874
  */
1872
1875
  parseEnumTypeExtension() {
1873
- const e = this._lexer.token;
1876
+ const t = this._lexer.token;
1874
1877
  this.expectKeyword("extend"), this.expectKeyword("enum");
1875
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1876
- if (i.length === 0 && r.length === 0)
1878
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1879
+ if (r.length === 0 && i.length === 0)
1877
1880
  throw this.unexpected();
1878
- return this.node(e, {
1881
+ return this.node(t, {
1879
1882
  kind: c.ENUM_TYPE_EXTENSION,
1880
1883
  name: n,
1881
- directives: i,
1882
- values: r
1884
+ directives: r,
1885
+ values: i
1883
1886
  });
1884
1887
  }
1885
1888
  /**
@@ -1888,16 +1891,16 @@ class nt {
1888
1891
  * - extend input Name Directives[Const]
1889
1892
  */
1890
1893
  parseInputObjectTypeExtension() {
1891
- const e = this._lexer.token;
1894
+ const t = this._lexer.token;
1892
1895
  this.expectKeyword("extend"), this.expectKeyword("input");
1893
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1894
- if (i.length === 0 && r.length === 0)
1896
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1897
+ if (r.length === 0 && i.length === 0)
1895
1898
  throw this.unexpected();
1896
- return this.node(e, {
1899
+ return this.node(t, {
1897
1900
  kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1898
1901
  name: n,
1899
- directives: i,
1900
- fields: r
1902
+ directives: r,
1903
+ fields: i
1901
1904
  });
1902
1905
  }
1903
1906
  /**
@@ -1907,16 +1910,16 @@ class nt {
1907
1910
  * ```
1908
1911
  */
1909
1912
  parseDirectiveDefinition() {
1910
- const e = this._lexer.token, n = this.parseDescription();
1913
+ const t = this._lexer.token, n = this.parseDescription();
1911
1914
  this.expectKeyword("directive"), this.expectToken(a.AT);
1912
- const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1915
+ const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1913
1916
  this.expectKeyword("on");
1914
1917
  const o = this.parseDirectiveLocations();
1915
- return this.node(e, {
1918
+ return this.node(t, {
1916
1919
  kind: c.DIRECTIVE_DEFINITION,
1917
1920
  description: n,
1918
- name: i,
1919
- arguments: r,
1921
+ name: r,
1922
+ arguments: i,
1920
1923
  repeatable: s,
1921
1924
  locations: o
1922
1925
  });
@@ -1957,10 +1960,10 @@ class nt {
1957
1960
  * `INPUT_FIELD_DEFINITION`
1958
1961
  */
1959
1962
  parseDirectiveLocation() {
1960
- const e = this._lexer.token, n = this.parseName();
1963
+ const t = this._lexer.token, n = this.parseName();
1961
1964
  if (Object.prototype.hasOwnProperty.call(q, n.value))
1962
1965
  return n;
1963
- throw this.unexpected(e);
1966
+ throw this.unexpected(t);
1964
1967
  }
1965
1968
  // Schema Coordinates
1966
1969
  /**
@@ -1972,29 +1975,29 @@ class nt {
1972
1975
  * - \@ Name ( Name : )
1973
1976
  */
1974
1977
  parseSchemaCoordinate() {
1975
- const e = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
1976
- let r;
1977
- !n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1978
+ const t = this._lexer.token, n = this.expectOptionalToken(a.AT), r = this.parseName();
1979
+ let i;
1980
+ !n && this.expectOptionalToken(a.DOT) && (i = this.parseName());
1978
1981
  let s;
1979
- return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(e, {
1982
+ return (n || i) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
1980
1983
  kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
1981
- name: i,
1984
+ name: r,
1982
1985
  argumentName: s
1983
- }) : this.node(e, {
1986
+ }) : this.node(t, {
1984
1987
  kind: c.DIRECTIVE_COORDINATE,
1985
- name: i
1986
- }) : r ? s ? this.node(e, {
1988
+ name: r
1989
+ }) : i ? s ? this.node(t, {
1987
1990
  kind: c.ARGUMENT_COORDINATE,
1988
- name: i,
1989
- fieldName: r,
1991
+ name: r,
1992
+ fieldName: i,
1990
1993
  argumentName: s
1991
- }) : this.node(e, {
1994
+ }) : this.node(t, {
1992
1995
  kind: c.MEMBER_COORDINATE,
1993
- name: i,
1994
- memberName: r
1995
- }) : this.node(e, {
1996
+ name: r,
1997
+ memberName: i
1998
+ }) : this.node(t, {
1996
1999
  kind: c.TYPE_COORDINATE,
1997
- name: i
2000
+ name: r
1998
2001
  });
1999
2002
  }
2000
2003
  // Core parsing utility functions
@@ -2003,9 +2006,9 @@ class nt {
2003
2006
  * location object, used to identify the place in the source that created a
2004
2007
  * given parsed object.
2005
2008
  */
2006
- node(e, n) {
2007
- return this._options.noLocation !== !0 && (n.loc = new Se(
2008
- e,
2009
+ node(t, n) {
2010
+ return this._options.noLocation !== !0 && (n.loc = new Ce(
2011
+ t,
2009
2012
  this._lexer.lastToken,
2010
2013
  this._lexer.source
2011
2014
  )), n;
@@ -2013,62 +2016,62 @@ class nt {
2013
2016
  /**
2014
2017
  * Determines if the next token is of a given kind
2015
2018
  */
2016
- peek(e) {
2017
- return this._lexer.token.kind === e;
2019
+ peek(t) {
2020
+ return this._lexer.token.kind === t;
2018
2021
  }
2019
2022
  /**
2020
2023
  * If the next token is of the given kind, return that token after advancing the lexer.
2021
2024
  * Otherwise, do not change the parser state and throw an error.
2022
2025
  */
2023
- expectToken(e) {
2026
+ expectToken(t) {
2024
2027
  const n = this._lexer.token;
2025
- if (n.kind === e)
2028
+ if (n.kind === t)
2026
2029
  return this.advanceLexer(), n;
2027
2030
  throw I(
2028
2031
  this._lexer.source,
2029
2032
  n.start,
2030
- `Expected ${Ee(e)}, found ${_(n)}.`
2033
+ `Expected ${ke(t)}, found ${C(n)}.`
2031
2034
  );
2032
2035
  }
2033
2036
  /**
2034
2037
  * If the next token is of the given kind, return "true" after advancing the lexer.
2035
2038
  * Otherwise, do not change the parser state and return "false".
2036
2039
  */
2037
- expectOptionalToken(e) {
2038
- return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
2040
+ expectOptionalToken(t) {
2041
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
2039
2042
  }
2040
2043
  /**
2041
2044
  * If the next token is a given keyword, advance the lexer.
2042
2045
  * Otherwise, do not change the parser state and throw an error.
2043
2046
  */
2044
- expectKeyword(e) {
2047
+ expectKeyword(t) {
2045
2048
  const n = this._lexer.token;
2046
- if (n.kind === a.NAME && n.value === e)
2049
+ if (n.kind === a.NAME && n.value === t)
2047
2050
  this.advanceLexer();
2048
2051
  else
2049
2052
  throw I(
2050
2053
  this._lexer.source,
2051
2054
  n.start,
2052
- `Expected "${e}", found ${_(n)}.`
2055
+ `Expected "${t}", found ${C(n)}.`
2053
2056
  );
2054
2057
  }
2055
2058
  /**
2056
2059
  * If the next token is a given keyword, return "true" after advancing the lexer.
2057
2060
  * Otherwise, do not change the parser state and return "false".
2058
2061
  */
2059
- expectOptionalKeyword(e) {
2062
+ expectOptionalKeyword(t) {
2060
2063
  const n = this._lexer.token;
2061
- return n.kind === a.NAME && n.value === e ? (this.advanceLexer(), !0) : !1;
2064
+ return n.kind === a.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
2062
2065
  }
2063
2066
  /**
2064
2067
  * Helper function for creating an error when an unexpected lexed token is encountered.
2065
2068
  */
2066
- unexpected(e) {
2067
- const n = e ?? this._lexer.token;
2069
+ unexpected(t) {
2070
+ const n = t ?? this._lexer.token;
2068
2071
  return I(
2069
2072
  this._lexer.source,
2070
2073
  n.start,
2071
- `Unexpected ${_(n)}.`
2074
+ `Unexpected ${C(n)}.`
2072
2075
  );
2073
2076
  }
2074
2077
  /**
@@ -2076,12 +2079,12 @@ class nt {
2076
2079
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2077
2080
  * Advances the parser to the next lex token after the closing token.
2078
2081
  */
2079
- any(e, n, i) {
2080
- this.expectToken(e);
2081
- const r = [];
2082
- for (; !this.expectOptionalToken(i); )
2083
- r.push(n.call(this));
2084
- return r;
2082
+ any(t, n, r) {
2083
+ this.expectToken(t);
2084
+ const i = [];
2085
+ for (; !this.expectOptionalToken(r); )
2086
+ i.push(n.call(this));
2087
+ return i;
2085
2088
  }
2086
2089
  /**
2087
2090
  * Returns a list of parse nodes, determined by the parseFn.
@@ -2089,13 +2092,13 @@ class nt {
2089
2092
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2090
2093
  * Advances the parser to the next lex token after the closing token.
2091
2094
  */
2092
- optionalMany(e, n, i) {
2093
- if (this.expectOptionalToken(e)) {
2094
- const r = [];
2095
+ optionalMany(t, n, r) {
2096
+ if (this.expectOptionalToken(t)) {
2097
+ const i = [];
2095
2098
  do
2096
- r.push(n.call(this));
2097
- while (!this.expectOptionalToken(i));
2098
- return r;
2099
+ i.push(n.call(this));
2100
+ while (!this.expectOptionalToken(r));
2101
+ return i;
2099
2102
  }
2100
2103
  return [];
2101
2104
  }
@@ -2104,120 +2107,120 @@ class nt {
2104
2107
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2105
2108
  * Advances the parser to the next lex token after the closing token.
2106
2109
  */
2107
- many(e, n, i) {
2108
- this.expectToken(e);
2109
- const r = [];
2110
+ many(t, n, r) {
2111
+ this.expectToken(t);
2112
+ const i = [];
2110
2113
  do
2111
- r.push(n.call(this));
2112
- while (!this.expectOptionalToken(i));
2113
- return r;
2114
+ i.push(n.call(this));
2115
+ while (!this.expectOptionalToken(r));
2116
+ return i;
2114
2117
  }
2115
2118
  /**
2116
2119
  * Returns a non-empty list of parse nodes, determined by the parseFn.
2117
2120
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2118
2121
  * Advances the parser to the next lex token after last item in the list.
2119
2122
  */
2120
- delimitedMany(e, n) {
2121
- this.expectOptionalToken(e);
2122
- const i = [];
2123
+ delimitedMany(t, n) {
2124
+ this.expectOptionalToken(t);
2125
+ const r = [];
2123
2126
  do
2124
- i.push(n.call(this));
2125
- while (this.expectOptionalToken(e));
2126
- return i;
2127
+ r.push(n.call(this));
2128
+ while (this.expectOptionalToken(t));
2129
+ return r;
2127
2130
  }
2128
2131
  advanceLexer() {
2129
- const { maxTokens: e } = this._options, n = this._lexer.advance();
2130
- if (n.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
2132
+ const { maxTokens: t } = this._options, n = this._lexer.advance();
2133
+ if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2131
2134
  throw I(
2132
2135
  this._lexer.source,
2133
2136
  n.start,
2134
- `Document contains more that ${e} tokens. Parsing aborted.`
2137
+ `Document contains more that ${t} tokens. Parsing aborted.`
2135
2138
  );
2136
2139
  }
2137
2140
  }
2138
- function _(t) {
2139
- const e = t.value;
2140
- return Ee(t.kind) + (e != null ? ` "${e}"` : "");
2141
+ function C(e) {
2142
+ const t = e.value;
2143
+ return ke(e.kind) + (t != null ? ` "${t}"` : "");
2141
2144
  }
2142
- function Ee(t) {
2143
- return we(t) ? `"${t}"` : t;
2145
+ function ke(e) {
2146
+ return Ue(e) ? `"${e}"` : e;
2144
2147
  }
2145
- var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), ye = !0, $ = !1;
2146
- function ke(t) {
2147
- return t.replace(/[\s,]+/g, " ").trim();
2148
+ var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), Ae = !0, $ = !1;
2149
+ function Te(e) {
2150
+ return e.replace(/[\s,]+/g, " ").trim();
2148
2151
  }
2149
- function it(t) {
2150
- return ke(t.source.body.substring(t.start, t.end));
2152
+ function at(e) {
2153
+ return Te(e.source.body.substring(e.start, e.end));
2151
2154
  }
2152
- function rt(t) {
2153
- var e = /* @__PURE__ */ new Set(), n = [];
2154
- return t.definitions.forEach(function(i) {
2155
- if (i.kind === "FragmentDefinition") {
2156
- var r = i.name.value, s = it(i.loc), o = G.get(r);
2157
- o && !o.has(s) ? ye && console.warn("Warning: fragment with name " + r + ` already exists.
2155
+ function ot(e) {
2156
+ var t = /* @__PURE__ */ new Set(), n = [];
2157
+ return e.definitions.forEach(function(r) {
2158
+ if (r.kind === "FragmentDefinition") {
2159
+ var i = r.name.value, s = at(r.loc), o = G.get(i);
2160
+ o && !o.has(s) ? Ae && console.warn("Warning: fragment with name " + i + ` already exists.
2158
2161
  graphql-tag enforces all fragment names across your application to be unique; read more about
2159
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s), e.has(s) || (e.add(s), n.push(i));
2162
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
2160
2163
  } else
2161
- n.push(i);
2162
- }), w(w({}, t), { definitions: n });
2163
- }
2164
- function st(t) {
2165
- var e = new Set(t.definitions);
2166
- e.forEach(function(i) {
2167
- i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
2168
- var s = i[r];
2169
- s && typeof s == "object" && e.add(s);
2164
+ n.push(r);
2165
+ }), w(w({}, e), { definitions: n });
2166
+ }
2167
+ function ct(e) {
2168
+ var t = new Set(e.definitions);
2169
+ t.forEach(function(r) {
2170
+ r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
2171
+ var s = r[i];
2172
+ s && typeof s == "object" && t.add(s);
2170
2173
  });
2171
2174
  });
2172
- var n = t.loc;
2173
- return n && (delete n.startToken, delete n.endToken), t;
2175
+ var n = e.loc;
2176
+ return n && (delete n.startToken, delete n.endToken), e;
2174
2177
  }
2175
- function at(t) {
2176
- var e = ke(t);
2177
- if (!L.has(e)) {
2178
- var n = tt(t, {
2178
+ function dt(e) {
2179
+ var t = Te(e);
2180
+ if (!L.has(t)) {
2181
+ var n = it(e, {
2179
2182
  experimentalFragmentVariables: $,
2180
2183
  allowLegacyFragmentVariables: $
2181
2184
  });
2182
2185
  if (!n || n.kind !== "Document")
2183
2186
  throw new Error("Not a valid GraphQL document.");
2184
- L.set(e, st(rt(n)));
2187
+ L.set(t, ct(ot(n)));
2185
2188
  }
2186
- return L.get(e);
2189
+ return L.get(t);
2187
2190
  }
2188
- function u(t) {
2189
- for (var e = [], n = 1; n < arguments.length; n++)
2190
- e[n - 1] = arguments[n];
2191
- typeof t == "string" && (t = [t]);
2192
- var i = t[0];
2193
- return e.forEach(function(r, s) {
2194
- r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += t[s + 1];
2195
- }), at(i);
2191
+ function u(e) {
2192
+ for (var t = [], n = 1; n < arguments.length; n++)
2193
+ t[n - 1] = arguments[n];
2194
+ typeof e == "string" && (e = [e]);
2195
+ var r = e[0];
2196
+ return t.forEach(function(i, s) {
2197
+ i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2198
+ }), dt(r);
2196
2199
  }
2197
- function ot() {
2200
+ function ut() {
2198
2201
  L.clear(), G.clear();
2199
2202
  }
2200
- function ct() {
2201
- ye = !1;
2203
+ function lt() {
2204
+ Ae = !1;
2202
2205
  }
2203
- function dt() {
2206
+ function ht() {
2204
2207
  $ = !0;
2205
2208
  }
2206
- function ut() {
2209
+ function pt() {
2207
2210
  $ = !1;
2208
2211
  }
2209
2212
  var b = {
2210
2213
  gql: u,
2211
- resetCaches: ot,
2212
- disableFragmentWarnings: ct,
2213
- enableExperimentalFragmentVariables: dt,
2214
- disableExperimentalFragmentVariables: ut
2214
+ resetCaches: ut,
2215
+ disableFragmentWarnings: lt,
2216
+ enableExperimentalFragmentVariables: ht,
2217
+ disableExperimentalFragmentVariables: pt
2215
2218
  };
2216
- (function(t) {
2217
- t.gql = b.gql, t.resetCaches = b.resetCaches, t.disableFragmentWarnings = b.disableFragmentWarnings, t.enableExperimentalFragmentVariables = b.enableExperimentalFragmentVariables, t.disableExperimentalFragmentVariables = b.disableExperimentalFragmentVariables;
2219
+ (function(e) {
2220
+ e.gql = b.gql, e.resetCaches = b.resetCaches, e.disableFragmentWarnings = b.disableFragmentWarnings, e.enableExperimentalFragmentVariables = b.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = b.disableExperimentalFragmentVariables;
2218
2221
  })(u || (u = {}));
2219
2222
  u.default = u;
2220
- const lt = u`
2223
+ const gt = u`
2221
2224
  query findActiveOrderById($id: String) {
2222
2225
  findOrder(id: $id) {
2223
2226
  id
@@ -2304,7 +2307,7 @@ const lt = u`
2304
2307
  }
2305
2308
  }
2306
2309
  }
2307
- `, pt = u`
2310
+ `, mt = u`
2308
2311
  query findOrderById($id: String, $reference: String) {
2309
2312
  findOrder(id: $id, reference: $reference) {
2310
2313
  id
@@ -2348,7 +2351,7 @@ const lt = u`
2348
2351
  downloadCode
2349
2352
  }
2350
2353
  }
2351
- `, ht = u`
2354
+ `, ft = u`
2352
2355
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2353
2356
  reserveProduct(
2354
2357
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2358,7 +2361,7 @@ const lt = u`
2358
2361
  amountReserved
2359
2362
  }
2360
2363
  }
2361
- `, gt = u`
2364
+ `, It = u`
2362
2365
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2363
2366
  releaseProduct(
2364
2367
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2367,7 +2370,7 @@ const lt = u`
2367
2370
  amountReleased
2368
2371
  }
2369
2372
  }
2370
- `, mt = u`
2373
+ `, Et = u`
2371
2374
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
2372
2375
  configurePackage(
2373
2376
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2377,7 +2380,7 @@ const lt = u`
2377
2380
  amountReserved
2378
2381
  }
2379
2382
  }
2380
- `, ft = u`
2383
+ `, yt = u`
2381
2384
  mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
2382
2385
  reserveAdditionalPackageItem(
2383
2386
  input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
@@ -2387,69 +2390,69 @@ const lt = u`
2387
2390
  amountReserved
2388
2391
  }
2389
2392
  }
2390
- `, It = u`
2393
+ `, Ot = u`
2391
2394
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2392
2395
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2393
2396
  }
2394
- `, Et = u`
2397
+ `, kt = u`
2395
2398
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2396
2399
  createOrderCustomer(
2397
2400
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2398
2401
  )
2399
2402
  }
2400
- `, yt = u`
2403
+ `, At = u`
2401
2404
  mutation deleteOrder($orderId: ID!) {
2402
2405
  cancelOrder(id: $orderId)
2403
2406
  }
2404
- `, kt = (t, e, n, i) => t();
2405
- function Ot(t, e = kt) {
2407
+ `, Tt = (e, t, n, r) => e();
2408
+ function Nt(e, t = Tt) {
2406
2409
  return {
2407
- findActiveOrderById(n, i, r) {
2408
- return e((s) => t.request({ document: lt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
2410
+ findActiveOrderById(n, r, i) {
2411
+ return t((s) => e.request({ document: gt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findActiveOrderById", "query", n);
2409
2412
  },
2410
- findOrderById(n, i, r) {
2411
- return e((s) => t.request({ document: pt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", n);
2413
+ findOrderById(n, r, i) {
2414
+ return t((s) => e.request({ document: mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findOrderById", "query", n);
2412
2415
  },
2413
- addToOrder(n, i, r) {
2414
- return e((s) => t.request({ document: ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
2416
+ addToOrder(n, r, i) {
2417
+ return t((s) => e.request({ document: ft, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "addToOrder", "mutation", n);
2415
2418
  },
2416
- removeFromOrder(n, i, r) {
2417
- return e((s) => t.request({ document: gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
2419
+ removeFromOrder(n, r, i) {
2420
+ return t((s) => e.request({ document: It, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "removeFromOrder", "mutation", n);
2418
2421
  },
2419
- configurePackage(n, i, r) {
2420
- return e((s) => t.request({ document: mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
2422
+ configurePackage(n, r, i) {
2423
+ return t((s) => e.request({ document: Et, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configurePackage", "mutation", n);
2421
2424
  },
2422
- reserveAdditionalPackageItem(n, i, r) {
2423
- return e((s) => t.request({ document: ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
2425
+ reserveAdditionalPackageItem(n, r, i) {
2426
+ return t((s) => e.request({ document: yt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "reserveAdditionalPackageItem", "mutation", n);
2424
2427
  },
2425
- configureOrderDeliveryOption(n, i, r) {
2426
- return e((s) => t.request({ document: It, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
2428
+ configureOrderDeliveryOption(n, r, i) {
2429
+ return t((s) => e.request({ document: Ot, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "configureOrderDeliveryOption", "mutation", n);
2427
2430
  },
2428
- createOrderCustomer(n, i, r) {
2429
- return e((s) => t.request({ document: Et, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
2431
+ createOrderCustomer(n, r, i) {
2432
+ return t((s) => e.request({ document: kt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createOrderCustomer", "mutation", n);
2430
2433
  },
2431
- deleteOrder(n, i, r) {
2432
- return e((s) => t.request({ document: yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
2434
+ deleteOrder(n, r, i) {
2435
+ return t((s) => e.request({ document: At, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "deleteOrder", "mutation", n);
2433
2436
  }
2434
2437
  };
2435
2438
  }
2436
- class At {
2439
+ class Dt {
2437
2440
  config;
2438
2441
  sdk;
2439
- constructor(e) {
2440
- this.config = e, this.sdk = Ot(new v(e.apiUrl));
2442
+ constructor(t) {
2443
+ this.config = t, this.sdk = Nt(new T(t.apiUrl));
2441
2444
  }
2442
2445
  // Basket update functions
2443
- async addProduct(e, n, i) {
2446
+ async addProduct(t, n, r) {
2444
2447
  try {
2445
2448
  return this.debugLog("Adding product", {
2446
2449
  productId: n.id,
2447
- orderId: e,
2450
+ orderId: t,
2448
2451
  amount: n.amount,
2449
2452
  seat: n.seat
2450
2453
  }), (await this.sdk.addToOrder({
2451
2454
  productId: n.id,
2452
- orderId: e,
2455
+ orderId: t,
2453
2456
  additionalData: n.seat ? {
2454
2457
  seat: {
2455
2458
  seatId: n.seat.id,
@@ -2458,22 +2461,22 @@ class At {
2458
2461
  }
2459
2462
  } : null,
2460
2463
  trackerId: this.config.trackerId,
2461
- shopId: i,
2464
+ shopId: r,
2462
2465
  amount: n.amount
2463
2466
  })).reserveProduct;
2464
- } catch (r) {
2465
- throw this.debugLog("Error adding product", r), this.handleError(r), r;
2467
+ } catch (i) {
2468
+ throw this.debugLog("Error adding product", i), this.handleError(i), i;
2466
2469
  }
2467
2470
  }
2468
- async removeProduct(e, n) {
2471
+ async removeProduct(t, n) {
2469
2472
  try {
2470
2473
  return this.debugLog("Removing product", {
2471
2474
  productId: n.id,
2472
- orderId: e,
2475
+ orderId: t,
2473
2476
  amount: n.amount
2474
2477
  }), (await this.sdk.removeFromOrder({
2475
2478
  productId: n.id,
2476
- orderId: e,
2479
+ orderId: t,
2477
2480
  additionalData: n.seat ? {
2478
2481
  seat: {
2479
2482
  seatId: n.seat.id,
@@ -2482,111 +2485,111 @@ class At {
2482
2485
  } : null,
2483
2486
  amount: n.amount
2484
2487
  })).releaseProduct ?? null;
2485
- } catch (i) {
2486
- throw this.debugLog("Error removing product", i), this.handleError(i), i;
2488
+ } catch (r) {
2489
+ throw this.debugLog("Error removing product", r), this.handleError(r), r;
2487
2490
  }
2488
2491
  }
2489
- async configurePackage(e, n, i) {
2492
+ async configurePackage(t, n, r) {
2490
2493
  try {
2491
- const r = n.items.map((o) => ({
2494
+ const i = n.items.map((o) => ({
2492
2495
  packageItemId: o.packageItemId,
2493
2496
  eventId: o.eventId
2494
2497
  }));
2495
2498
  this.debugLog("Configuring package", {
2496
2499
  packageId: n.id,
2497
- orderId: e,
2500
+ orderId: t,
2498
2501
  amount: n.amount,
2499
- items: r,
2500
- shopId: i
2502
+ items: i,
2503
+ shopId: r
2501
2504
  });
2502
2505
  const s = await this.sdk.configurePackage({
2503
2506
  trackerId: this.config.trackerId,
2504
- shopId: i,
2507
+ shopId: r,
2505
2508
  packageId: n.id,
2506
- orderId: e,
2509
+ orderId: t,
2507
2510
  amount: n.amount,
2508
- items: r
2511
+ items: i
2509
2512
  });
2510
2513
  return this.debugLog("Configure package response"), s.configurePackage ?? null;
2511
- } catch (r) {
2512
- throw this.debugLog("Error configuring package", r), this.handleError(r), r;
2514
+ } catch (i) {
2515
+ throw this.debugLog("Error configuring package", i), this.handleError(i), i;
2513
2516
  }
2514
2517
  }
2515
- async configureCustomer(e, n) {
2516
- this.debugLog("Creating/replacing customer", { orderId: e, email: n.email });
2518
+ async configureCustomer(t, n) {
2519
+ this.debugLog("Creating/replacing customer", { orderId: t, email: n.email });
2517
2520
  try {
2518
- const i = await this.sdk.createOrderCustomer({
2519
- orderId: e,
2521
+ const r = await this.sdk.createOrderCustomer({
2522
+ orderId: t,
2520
2523
  customer: n
2521
2524
  });
2522
- this.debugLog("Customer set successfully", i);
2523
- } catch (i) {
2524
- throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
2525
+ this.debugLog("Customer set successfully", r);
2526
+ } catch (r) {
2527
+ throw this.debugLog("Failed to set customer", r), new Error(`Failed to set customer: ${r.message}`);
2525
2528
  }
2526
2529
  }
2527
- async reserveAdditionalPackageItem(e, n) {
2530
+ async reserveAdditionalPackageItem(t, n) {
2528
2531
  try {
2529
2532
  this.debugLog("reserve additional packageItem", {
2530
- orderId: e,
2533
+ orderId: t,
2531
2534
  eventId: n.eventId,
2532
2535
  amount: n.amount,
2533
2536
  packageId: n.packageId,
2534
2537
  packageItemId: n.packageItemId
2535
2538
  });
2536
- const i = await this.sdk.reserveAdditionalPackageItem({
2537
- orderId: e,
2539
+ const r = await this.sdk.reserveAdditionalPackageItem({
2540
+ orderId: t,
2538
2541
  eventId: n.eventId,
2539
2542
  amount: n.amount,
2540
2543
  packageId: n.packageId,
2541
2544
  packageItemId: n.packageItemId
2542
2545
  });
2543
- return this.debugLog("reserve additional packageItem"), i.reserveAdditionalPackageItem ?? null;
2544
- } catch (i) {
2545
- throw this.debugLog("Error configuring package", i), this.handleError(i), i;
2546
+ return this.debugLog("reserve additional packageItem"), r.reserveAdditionalPackageItem ?? null;
2547
+ } catch (r) {
2548
+ throw this.debugLog("Error configuring package", r), this.handleError(r), r;
2546
2549
  }
2547
2550
  }
2548
2551
  // Cancel and clear order functions
2549
- async cancelOrder(e) {
2550
- e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.debugLog("Order cancelled successfully"));
2552
+ async cancelOrder(t) {
2553
+ t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.debugLog("Order cancelled successfully"));
2551
2554
  }
2552
- async findOrder(e, n) {
2555
+ async findOrder(t, n) {
2553
2556
  try {
2554
- const i = await this.sdk.findOrderById({ id: e, reference: n });
2555
- return i.findOrder ? {
2556
- id: i.findOrder.id,
2557
- reference: i.findOrder.reference,
2558
- currency: i.findOrder.currency,
2559
- downloadCode: i.findOrder.downloadCode,
2557
+ const r = await this.sdk.findOrderById({ id: t, reference: n });
2558
+ return r.findOrder ? {
2559
+ id: r.findOrder.id,
2560
+ reference: r.findOrder.reference,
2561
+ currency: r.findOrder.currency,
2562
+ downloadCode: r.findOrder.downloadCode,
2560
2563
  organization: {
2561
- name: i.findOrder.organization.name,
2562
- paymentBanner: i.findOrder.organization.name
2564
+ name: r.findOrder.organization.name,
2565
+ paymentBanner: r.findOrder.organization.name
2563
2566
  },
2564
- customer: i.findOrder.mainBooker ? {
2565
- firstName: i.findOrder.mainBooker.firstName,
2566
- lastName: i.findOrder.mainBooker.lastName,
2567
- email: i.findOrder.mainBooker.email,
2568
- age: i.findOrder.mainBooker.age,
2569
- gender: i.findOrder.mainBooker.gender,
2570
- residence: i.findOrder.mainBooker.residence,
2571
- extraInfo: i.findOrder.mainBooker.extraInfo
2567
+ customer: r.findOrder.mainBooker ? {
2568
+ firstName: r.findOrder.mainBooker.firstName,
2569
+ lastName: r.findOrder.mainBooker.lastName,
2570
+ email: r.findOrder.mainBooker.email,
2571
+ age: r.findOrder.mainBooker.age,
2572
+ gender: r.findOrder.mainBooker.gender,
2573
+ residence: r.findOrder.mainBooker.residence,
2574
+ extraInfo: r.findOrder.mainBooker.extraInfo
2572
2575
  } : null,
2573
- items: i.findOrder.items
2576
+ items: r.findOrder.items
2574
2577
  } : null;
2575
- } catch (i) {
2576
- return this.debugLog("Error finding order", i), this.handleError(i), null;
2578
+ } catch (r) {
2579
+ return this.debugLog("Error finding order", r), this.handleError(r), null;
2577
2580
  }
2578
2581
  }
2579
- async findActiveOrder(e) {
2580
- this.debugLog("Fetching order from server", { orderId: e });
2582
+ async findActiveOrder(t) {
2583
+ this.debugLog("Fetching order from server", { orderId: t });
2581
2584
  try {
2582
- const n = await this.sdk.findActiveOrderById({ id: e });
2585
+ const n = await this.sdk.findActiveOrderById({ id: t });
2583
2586
  if (!n?.findOrder)
2584
2587
  return null;
2585
- const i = n.findOrder;
2586
- this.debugLog("Order fetched successfully", i);
2587
- const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
2588
- let m = T.PRODUCT;
2589
- return d.product.type === "PROMOTER" ? m = T.ADD_ONS : d.product.type === "PICKUP" ? m = T.PICKUP : d.product.type === "DELIVERY" && (m = T.DELIVERY), {
2588
+ const r = n.findOrder;
2589
+ this.debugLog("Order fetched successfully", r);
2590
+ const i = r.items, s = i.filter((d) => d.product != null && d.amount > 0).map((d) => {
2591
+ let m = N.PRODUCT;
2592
+ return d.product.type === "PROMOTER" ? m = N.ADD_ONS : d.product.type === "PICKUP" ? m = N.PICKUP : d.product.type === "DELIVERY" && (m = N.DELIVERY), {
2590
2593
  id: d.product.id,
2591
2594
  type: m,
2592
2595
  name: d.product.name,
@@ -2602,83 +2605,83 @@ class At {
2602
2605
  label: y.label
2603
2606
  }))
2604
2607
  };
2605
- }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
2608
+ }), o = i.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
2606
2609
  const {
2607
2610
  packageItem: y,
2608
- event: h,
2609
- amount: O,
2610
- price: C,
2611
+ event: p,
2612
+ amount: k,
2613
+ price: _,
2611
2614
  serviceFee: Y,
2612
2615
  depositPrice: H,
2613
2616
  originalPrice: J
2614
2617
  } = m, A = y.package.id;
2615
- d[A] ? (d[A].price += C ?? 0, d[A].serviceFee += Y ?? 0, d[A].originalPrice += J ?? 0, d[A].depositPrice += H ?? C ?? 0) : d[A] = {
2618
+ d[A] ? (d[A].price += _ ?? 0, d[A].serviceFee += Y ?? 0, d[A].originalPrice += J ?? 0, d[A].depositPrice += H ?? _ ?? 0) : d[A] = {
2616
2619
  id: A,
2617
- type: T.PACKAGE,
2620
+ type: N.PACKAGE,
2618
2621
  name: y.package.name,
2619
- amount: O,
2620
- price: C ?? 0,
2622
+ amount: k,
2623
+ price: _ ?? 0,
2621
2624
  serviceFee: Y ?? 0,
2622
- depositPrice: H ?? C ?? 0,
2625
+ depositPrice: H ?? _ ?? 0,
2623
2626
  originalPrice: J ?? 0,
2624
2627
  packageItems: []
2625
2628
  };
2626
- const Oe = k.fromISO(h.startAt, {
2627
- zone: h.timezone
2628
- }), Ae = k.fromISO(h.endAt, {
2629
- zone: h.timezone
2629
+ const Ne = O.fromISO(p.startAt, {
2630
+ zone: p.timezone
2631
+ }), De = O.fromISO(p.endAt, {
2632
+ zone: p.timezone
2630
2633
  });
2631
2634
  return d[A].packageItems.push({
2632
2635
  packageItemId: y.id,
2633
- eventId: h.id,
2634
- name: h.name,
2635
- startAt: Oe.toJSDate().toISOString(),
2636
- endAt: Ae.toJSDate().toISOString()
2636
+ eventId: p.id,
2637
+ name: p.name,
2638
+ startAt: Ne.toJSDate().toISOString(),
2639
+ endAt: De.toJSDate().toISOString()
2637
2640
  }), d;
2638
2641
  }, {}), l = [
2639
2642
  ...s,
2640
2643
  ...Object.values(o)
2641
- ], p = l.reduce((d, m) => d + (m.amount || 0), 0);
2642
- if (p === 0)
2644
+ ], h = l.reduce((d, m) => d + (m.amount || 0), 0);
2645
+ if (h === 0)
2643
2646
  return null;
2644
- const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = k.fromMillis(Math.min(...E));
2647
+ const E = i.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = O.fromMillis(Math.min(...E));
2645
2648
  return {
2646
- id: i.id,
2647
- currency: i.currency,
2649
+ id: r.id,
2650
+ currency: r.currency,
2648
2651
  expiredAt: g?.toJSDate().toISOString(),
2649
2652
  items: l,
2650
- customer: i.mainBooker ? {
2651
- firstName: i.mainBooker.firstName,
2652
- lastName: i.mainBooker.lastName,
2653
- email: i.mainBooker.email,
2654
- age: i.mainBooker.age,
2655
- gender: i.mainBooker.gender,
2656
- residence: i.mainBooker.residence,
2657
- extraInfo: i.mainBooker.extraInfo
2653
+ customer: r.mainBooker ? {
2654
+ firstName: r.mainBooker.firstName,
2655
+ lastName: r.mainBooker.lastName,
2656
+ email: r.mainBooker.email,
2657
+ age: r.mainBooker.age,
2658
+ gender: r.mainBooker.gender,
2659
+ residence: r.mainBooker.residence,
2660
+ extraInfo: r.mainBooker.extraInfo
2658
2661
  } : null,
2659
- count: p,
2662
+ count: h,
2660
2663
  orderProtection: !1
2661
2664
  };
2662
2665
  } catch (n) {
2663
2666
  throw this.debugLog("Error fetching order", n), n;
2664
2667
  }
2665
2668
  }
2666
- debugLog(e, n) {
2667
- this.config.debug && console.log(`[BasketService] ${e}`, n || "");
2669
+ debugLog(t, n) {
2670
+ this.config.debug && console.log(`[BasketService] ${t}`, n || "");
2668
2671
  }
2669
- handleError(e) {
2670
- const n = e;
2672
+ handleError(t) {
2673
+ const n = t;
2671
2674
  if (n.graphQLErrors && n.graphQLErrors.length > 0) {
2672
- const i = n.graphQLErrors[0];
2673
- i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
2675
+ const r = n.graphQLErrors[0];
2676
+ r.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), r.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
2674
2677
  }
2675
2678
  if (n.response?.errors && n.response.errors.length > 0) {
2676
- const i = n.response.errors[0];
2677
- console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
2679
+ const r = n.response.errors[0];
2680
+ console.error("GraphQL Error:", r.message), r.extensions?.code && console.error("Error Code:", r.extensions.code);
2678
2681
  }
2679
2682
  }
2680
2683
  }
2681
- const Tt = u`
2684
+ const vt = u`
2682
2685
  query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
2683
2686
  findAllPublicEventByOrganizationId(
2684
2687
  id: $organizationId
@@ -2724,7 +2727,7 @@ const Tt = u`
2724
2727
  count
2725
2728
  }
2726
2729
  }
2727
- `, Dt = u`
2730
+ `, Pt = u`
2728
2731
  query EventDetailPage($eventId: ID!) {
2729
2732
  findPublicEventById(id: $eventId) {
2730
2733
  id
@@ -2757,7 +2760,7 @@ const Tt = u`
2757
2760
  seatsIoEventId
2758
2761
  }
2759
2762
  }
2760
- `, vt = u`
2763
+ `, bt = u`
2761
2764
  query FindPublicEventBySlug($organizationId: ID!, $slug: String!) {
2762
2765
  findPublicEventBySlug(organizationId: $organizationId, slug: $slug) {
2763
2766
  id
@@ -2790,7 +2793,7 @@ const Tt = u`
2790
2793
  seatsIoEventId
2791
2794
  }
2792
2795
  }
2793
- `, Nt = u`
2796
+ `, St = u`
2794
2797
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
2795
2798
  findPublicProductsByEventId(
2796
2799
  eventId: $eventId
@@ -2825,69 +2828,69 @@ const Tt = u`
2825
2828
  showEndSalesAtTag
2826
2829
  }
2827
2830
  }
2828
- `, Pt = (t, e, n, i) => t();
2829
- function bt(t, e = Pt) {
2831
+ `, xt = (e, t, n, r) => e();
2832
+ function _t(e, t = xt) {
2830
2833
  return {
2831
- EventOverviewPage(n, i, r) {
2832
- return e((s) => t.request({ document: Tt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
2834
+ EventOverviewPage(n, r, i) {
2835
+ return t((s) => e.request({ document: vt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventOverviewPage", "query", n);
2833
2836
  },
2834
- EventDetailPage(n, i, r) {
2835
- return e((s) => t.request({ document: Dt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
2837
+ EventDetailPage(n, r, i) {
2838
+ return t((s) => e.request({ document: Pt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "EventDetailPage", "query", n);
2836
2839
  },
2837
- FindPublicEventBySlug(n, i, r) {
2838
- return e((s) => t.request({ document: vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "FindPublicEventBySlug", "query", n);
2840
+ FindPublicEventBySlug(n, r, i) {
2841
+ return t((s) => e.request({ document: bt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "FindPublicEventBySlug", "query", n);
2839
2842
  },
2840
- findProductsByEventId(n, i, r) {
2841
- return e((s) => t.request({ document: Nt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
2843
+ findProductsByEventId(n, r, i) {
2844
+ return t((s) => e.request({ document: St, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findProductsByEventId", "query", n);
2842
2845
  }
2843
2846
  };
2844
2847
  }
2845
- class St {
2848
+ class Ct {
2846
2849
  config;
2847
2850
  sdk;
2848
- constructor(e) {
2849
- this.config = e, this.sdk = bt(new v(e.apiUrl));
2851
+ constructor(t) {
2852
+ this.config = t, this.sdk = _t(new T(t.apiUrl));
2850
2853
  }
2851
- async getEvents(e, n) {
2854
+ async getEvents(t, n) {
2852
2855
  try {
2853
- e.page && (e.page = {
2854
- index: e.page.index ?? 0,
2855
- size: e.page.size ?? 20
2856
+ t.page && (t.page = {
2857
+ index: t.page.index ?? 0,
2858
+ size: t.page.size ?? 20
2856
2859
  }), this.debugLog("Fetching events with parameters", {
2857
2860
  organizationId: this.config.organizationId ?? n ?? "",
2858
- hostingIds: e.hostingIds,
2859
- filterEventStatuses: e.statuses,
2860
- dateRange: e.dateRange,
2861
- page: e.page,
2862
- sorts: e.sorts,
2861
+ hostingIds: t.hostingIds,
2862
+ filterEventStatuses: t.statuses,
2863
+ dateRange: t.dateRange,
2864
+ page: t.page,
2865
+ sorts: t.sorts,
2863
2866
  trackerId: this.config.trackerId
2864
2867
  });
2865
- const i = await this.sdk.EventOverviewPage({
2868
+ const r = await this.sdk.EventOverviewPage({
2866
2869
  organizationId: this.config.organizationId ?? n ?? "",
2867
- hostingIds: e.hostingIds,
2868
- locationIds: e.locationIds,
2869
- excludedEventIds: e.excludedEventIds,
2870
- filterEventStatuses: e.statuses,
2871
- dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
2872
- from: e.dateRange.from.toISO(),
2873
- till: e.dateRange.till.toISO()
2870
+ hostingIds: t.hostingIds,
2871
+ locationIds: t.locationIds,
2872
+ excludedEventIds: t.excludedEventIds,
2873
+ filterEventStatuses: t.statuses,
2874
+ dateRange: t.dateRange && t.dateRange.from && t.dateRange.till ? {
2875
+ from: t.dateRange.from.toISO(),
2876
+ till: t.dateRange.till.toISO()
2874
2877
  } : void 0,
2875
- page: e.page,
2876
- sorts: e.sorts,
2878
+ page: t.page,
2879
+ sorts: t.sorts,
2877
2880
  trackerId: this.config.trackerId,
2878
- searchTerm: e.searchTerm,
2879
- priceRange: e.priceRange
2881
+ searchTerm: t.searchTerm,
2882
+ priceRange: t.priceRange
2880
2883
  });
2881
- if (this.debugLog("Raw GraphQL response", i), i?.findAllPublicEventByOrganizationId?.data) {
2882
- const r = i.findAllPublicEventByOrganizationId.data.map((s) => ({
2884
+ if (this.debugLog("Raw GraphQL response", r), r?.findAllPublicEventByOrganizationId?.data) {
2885
+ const i = r.findAllPublicEventByOrganizationId.data.map((s) => ({
2883
2886
  id: s.id,
2884
2887
  name: s.name,
2885
2888
  icon: s.icon,
2886
2889
  banner: s.banner,
2887
2890
  description: s.description,
2888
2891
  addonDescription: s.addonDescription,
2889
- startAt: k.fromISO(s.startAt, { zone: s.timezone }).toJSDate().toISOString(),
2890
- endAt: k.fromISO(s.endAt, { zone: s.timezone }).toJSDate().toISOString(),
2892
+ startAt: O.fromISO(s.startAt, { zone: s.timezone }).toJSDate().toISOString(),
2893
+ endAt: O.fromISO(s.endAt, { zone: s.timezone }).toJSDate().toISOString(),
2891
2894
  timezone: s.timezone,
2892
2895
  startSalesAt: null,
2893
2896
  endSalesAt: null,
@@ -2905,73 +2908,29 @@ class St {
2905
2908
  } : void 0,
2906
2909
  infoDescription: s.infoDescription,
2907
2910
  startingPrice: s.startingPrice,
2908
- totalViews: s.totalViews,
2909
- seatsIoEventId: s.seatsIoEventId
2911
+ totalViews: s.totalViews
2910
2912
  }));
2911
- return this.debugLog("Processed events", { events: r, count: r.length }), [r, i.findAllPublicEventByOrganizationId.count ?? 0];
2913
+ return this.debugLog("Processed events", { events: i, count: i.length }), [i, r.findAllPublicEventByOrganizationId.count ?? 0];
2912
2914
  } else
2913
2915
  return this.debugLog("No events found in response"), [[], 0];
2914
- } catch (i) {
2915
- throw this.debugLog("Error fetching events", i), i;
2916
+ } catch (r) {
2917
+ throw this.debugLog("Error fetching events", r), r;
2916
2918
  }
2917
2919
  }
2918
- async getEvent(e) {
2920
+ async getEvent(t) {
2919
2921
  try {
2920
- this.debugLog("Fetching single event", { eventId: e });
2921
- const n = await this.sdk.EventDetailPage({ eventId: e });
2922
+ this.debugLog("Fetching single event", { eventId: t });
2923
+ const n = await this.sdk.EventDetailPage({ eventId: t });
2922
2924
  if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
2923
- const i = n.findPublicEventById, r = {
2924
- id: i.id,
2925
- name: i.name,
2926
- icon: i.icon,
2927
- banner: i.banner,
2928
- description: i.description,
2929
- addonDescription: i.addonDescription,
2930
- startAt: k.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
2931
- endAt: k.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
2932
- timezone: i.timezone,
2933
- startSalesAt: i.startSalesAt,
2934
- endSalesAt: i.endSalesAt,
2935
- slug: i.slug ?? "ERROR",
2936
- facebookPixelId: i.facebookPixelId,
2937
- status: i.status,
2938
- location: i.location ? {
2939
- id: i.location.id,
2940
- name: i.location.name,
2941
- address: i.location.address
2942
- } : void 0,
2943
- hosting: i.hosting ? {
2944
- id: i.hosting.id,
2945
- name: i.hosting.name
2946
- } : void 0,
2947
- infoDescription: i.infoDescription,
2948
- startingPrice: i.startingPrice,
2949
- totalViews: i.totalViews,
2950
- seatsIoEventId: i.seatsIoEventId
2951
- };
2952
- return this.debugLog("Processed single event", r), r;
2953
- } else {
2954
- this.debugLog("No event found for id", e);
2955
- return;
2956
- }
2957
- } catch (n) {
2958
- throw this.debugLog("Error fetching single event", n), n;
2959
- }
2960
- }
2961
- async getEventBySlug(e, n) {
2962
- try {
2963
- this.debugLog("Fetching single event by slug", { organizationId: e, slug: n });
2964
- const i = await this.sdk.FindPublicEventBySlug({ organizationId: e, slug: n });
2965
- if (this.debugLog("Raw GraphQL response", i), i?.findPublicEventBySlug) {
2966
- const r = i.findPublicEventBySlug, s = {
2925
+ const r = n.findPublicEventById, i = {
2967
2926
  id: r.id,
2968
2927
  name: r.name,
2969
2928
  icon: r.icon,
2970
2929
  banner: r.banner,
2971
2930
  description: r.description,
2972
2931
  addonDescription: r.addonDescription,
2973
- startAt: k.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
2974
- endAt: k.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
2932
+ startAt: O.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
2933
+ endAt: O.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
2975
2934
  timezone: r.timezone,
2976
2935
  startSalesAt: r.startSalesAt,
2977
2936
  endSalesAt: r.endSalesAt,
@@ -2990,33 +2949,78 @@ class St {
2990
2949
  infoDescription: r.infoDescription,
2991
2950
  startingPrice: r.startingPrice,
2992
2951
  totalViews: r.totalViews,
2993
- seatsIoEventId: r.seatsIoEventId
2952
+ seatsIoEventId: r.seatsIoEventId,
2953
+ maxAmountOfTicketsPerOrder: r.maxAmountOfTicketsPerOrder
2954
+ };
2955
+ return this.debugLog("Processed single event", i), i;
2956
+ } else {
2957
+ this.debugLog("No event found for id", t);
2958
+ return;
2959
+ }
2960
+ } catch (n) {
2961
+ throw this.debugLog("Error fetching single event", n), n;
2962
+ }
2963
+ }
2964
+ async getEventBySlug(t, n) {
2965
+ try {
2966
+ this.debugLog("Fetching single event by slug", { organizationId: t, slug: n });
2967
+ const r = await this.sdk.FindPublicEventBySlug({ organizationId: t, slug: n });
2968
+ if (this.debugLog("Raw GraphQL response", r), r?.findPublicEventBySlug) {
2969
+ const i = r.findPublicEventBySlug, s = {
2970
+ id: i.id,
2971
+ name: i.name,
2972
+ icon: i.icon,
2973
+ banner: i.banner,
2974
+ description: i.description,
2975
+ addonDescription: i.addonDescription,
2976
+ startAt: O.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
2977
+ endAt: O.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
2978
+ timezone: i.timezone,
2979
+ startSalesAt: i.startSalesAt,
2980
+ endSalesAt: i.endSalesAt,
2981
+ slug: i.slug ?? "ERROR",
2982
+ facebookPixelId: i.facebookPixelId,
2983
+ status: i.status,
2984
+ location: i.location ? {
2985
+ id: i.location.id,
2986
+ name: i.location.name,
2987
+ address: i.location.address
2988
+ } : void 0,
2989
+ hosting: i.hosting ? {
2990
+ id: i.hosting.id,
2991
+ name: i.hosting.name
2992
+ } : void 0,
2993
+ infoDescription: i.infoDescription,
2994
+ startingPrice: i.startingPrice,
2995
+ totalViews: i.totalViews,
2996
+ seatsIoEventId: i.seatsIoEventId,
2997
+ maxAmountOfTicketsPerOrder: i.maxAmountOfTicketsPerOrder
2994
2998
  };
2995
2999
  return this.debugLog("Processed single event", s), s;
2996
3000
  } else {
2997
- this.debugLog("No event found for id by slug", { organizationId: e, slug: n });
3001
+ this.debugLog("No event found for id by slug", { organizationId: t, slug: n });
2998
3002
  return;
2999
3003
  }
3000
- } catch (i) {
3001
- throw this.debugLog("Error fetching single event", i), i;
3004
+ } catch (r) {
3005
+ throw this.debugLog("Error fetching single event", r), r;
3002
3006
  }
3003
3007
  }
3004
- async getProducts(e, n, i) {
3008
+ async getProducts(t, n, r) {
3005
3009
  try {
3006
3010
  this.debugLog("Fetching products for event", {
3007
- eventId: e,
3008
- promoCode: i,
3011
+ eventId: t,
3012
+ promoCode: r,
3009
3013
  trackerId: this.config.trackerId,
3010
3014
  productTypes: n
3011
3015
  });
3012
- const r = await this.sdk.findProductsByEventId({
3013
- eventId: e,
3014
- promoCode: i,
3016
+ const i = await this.sdk.findProductsByEventId({
3017
+ eventId: t,
3018
+ promoCode: r,
3015
3019
  trackerId: this.config.trackerId,
3016
3020
  productTypes: n
3017
3021
  });
3018
- if (r?.findPublicProductsByEventId) {
3019
- const s = r.findPublicProductsByEventId.map((o) => ({
3022
+ if (i?.findPublicProductsByEventId) {
3023
+ const s = i.findPublicProductsByEventId.map((o) => ({
3020
3024
  id: o.id,
3021
3025
  name: o.name,
3022
3026
  category: o.category ? {
@@ -3043,21 +3047,21 @@ class St {
3043
3047
  seatsCategory: o.seatsCategory
3044
3048
  }));
3045
3049
  return this.debugLog("Products fetched", {
3046
- eventId: e,
3050
+ eventId: t,
3047
3051
  count: s.length,
3048
3052
  types: s.map((o) => o.type)
3049
3053
  }), s;
3050
3054
  }
3051
3055
  return;
3052
- } catch (r) {
3053
- throw this.debugLog("Error fetching products", { eventId: e, error: r }), r;
3056
+ } catch (i) {
3057
+ throw this.debugLog("Error fetching products", { eventId: t, error: i }), i;
3054
3058
  }
3055
3059
  }
3056
- debugLog(e, n) {
3057
- this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, n || "");
3060
+ debugLog(t, n) {
3061
+ this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
3058
3062
  }
3059
3063
  }
3060
- const xt = u`
3064
+ const Lt = u`
3061
3065
  query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
3062
3066
  findPaymentDetails(
3063
3067
  orderId: $orderId
@@ -3087,62 +3091,62 @@ const xt = u`
3087
3091
  protectionFee
3088
3092
  }
3089
3093
  }
3090
- `, Ct = u`
3094
+ `, Rt = u`
3091
3095
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
3092
3096
  createDigitalOrderPayment(input: $input)
3093
3097
  }
3094
- `, _t = (t, e, n, i) => t();
3095
- function Lt(t, e = _t) {
3098
+ `, Ft = (e, t, n, r) => e();
3099
+ function wt(e, t = Ft) {
3096
3100
  return {
3097
- findPaymentMethods(n, i, r) {
3098
- return e((s) => t.request({ document: xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
3101
+ findPaymentMethods(n, r, i) {
3102
+ return t((s) => e.request({ document: Lt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPaymentMethods", "query", n);
3099
3103
  },
3100
- createDigitalPayment(n, i, r) {
3101
- return e((s) => t.request({ document: Ct, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
3104
+ createDigitalPayment(n, r, i) {
3105
+ return t((s) => e.request({ document: Rt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "createDigitalPayment", "mutation", n);
3102
3106
  }
3103
3107
  };
3104
3108
  }
3105
- class Rt {
3109
+ class $t {
3106
3110
  config;
3107
3111
  sdk;
3108
- constructor(e) {
3109
- this.config = e, this.sdk = Lt(new v(e.apiUrl));
3112
+ constructor(t) {
3113
+ this.config = t, this.sdk = wt(new T(t.apiUrl));
3110
3114
  }
3111
- async getPaymentDetails(e) {
3112
- this.debugLog("Fetching payment methods", e);
3115
+ async getPaymentDetails(t) {
3116
+ this.debugLog("Fetching payment methods", t);
3113
3117
  try {
3114
3118
  const n = await this.sdk.findPaymentMethods({
3115
- orderId: e.orderId,
3116
- orderItemId: e.orderItemId,
3117
- amountOfTickets: e.amountOfTickets,
3118
- paymentMethodId: e.paymentMethodId,
3119
- withTicketProtection: e.withTicketProtection
3119
+ orderId: t.orderId,
3120
+ orderItemId: t.orderItemId,
3121
+ amountOfTickets: t.amountOfTickets,
3122
+ paymentMethodId: t.paymentMethodId,
3123
+ withTicketProtection: t.withTicketProtection
3120
3124
  });
3121
3125
  if (!n?.findPaymentDetails)
3122
3126
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
3123
- const i = n.findPaymentDetails;
3127
+ const r = n.findPaymentDetails;
3124
3128
  return this.debugLog("Payment methods fetched successfully", {
3125
- methodCount: i.methods?.length ?? 0,
3126
- transactionPrice: i.transactionPrice,
3127
- transactionDiscount: i.transactionDiscount,
3128
- transactionFee: i.transactionFee,
3129
- paymentSpesificTransactionFee: i.paymentSpesificTransactionFee,
3130
- protectionFee: i.protectionFee
3129
+ methodCount: r.methods?.length ?? 0,
3130
+ transactionPrice: r.transactionPrice,
3131
+ transactionDiscount: r.transactionDiscount,
3132
+ transactionFee: r.transactionFee,
3133
+ paymentSpesificTransactionFee: r.paymentSpesificTransactionFee,
3134
+ protectionFee: r.protectionFee
3131
3135
  }), {
3132
- transactionPrice: i.transactionPrice,
3133
- transactionDiscount: i.transactionPrice,
3134
- transactionFee: i.transactionFee,
3135
- protectionFee: i.protectionFee,
3136
- paymentSpesificTransactionFee: i.paymentSpesificTransactionFee,
3137
- methods: i.methods?.map((r) => ({
3138
- id: r.id,
3139
- name: r.name,
3140
- image: r.image,
3141
- fee: r.fee ? {
3142
- type: r.fee.type,
3143
- value: r.fee.value
3136
+ transactionPrice: r.transactionPrice,
3137
+ transactionDiscount: r.transactionPrice,
3138
+ transactionFee: r.transactionFee,
3139
+ protectionFee: r.protectionFee,
3140
+ paymentSpesificTransactionFee: r.paymentSpesificTransactionFee,
3141
+ methods: r.methods?.map((i) => ({
3142
+ id: i.id,
3143
+ name: i.name,
3144
+ image: i.image,
3145
+ fee: i.fee ? {
3146
+ type: i.fee.type,
3147
+ value: i.fee.value
3144
3148
  } : null,
3145
- issuers: r.issuers?.map((s) => ({
3149
+ issuers: i.issuers?.map((s) => ({
3146
3150
  id: s.id,
3147
3151
  name: s.name,
3148
3152
  image: s.image
@@ -3153,38 +3157,38 @@ class Rt {
3153
3157
  throw this.debugLog("Error fetching payment methods", n), n;
3154
3158
  }
3155
3159
  }
3156
- async createPayment(e) {
3157
- this.debugLog("Creating payment", e);
3160
+ async createPayment(t) {
3161
+ this.debugLog("Creating payment", t);
3158
3162
  try {
3159
3163
  const n = {
3160
- orderId: e.orderId,
3161
- paymentMethodId: e.paymentMethodId,
3162
- issuerId: e.issuerId,
3163
- redirectUrl: e.redirectUrl,
3164
+ orderId: t.orderId,
3165
+ paymentMethodId: t.paymentMethodId,
3166
+ issuerId: t.issuerId,
3167
+ redirectUrl: t.redirectUrl,
3164
3168
  // For payment links this input in used
3165
- initiatedByUserId: e.initiatedByUserId,
3166
- initiatedByTeamId: e.initiatedByTeamId,
3167
- amountOfTickets: e.amountOfTickets,
3168
- orderItemId: e.orderItemId,
3169
- withTicketProtection: e.withTicketProtection
3169
+ initiatedByUserId: t.initiatedByUserId,
3170
+ initiatedByTeamId: t.initiatedByTeamId,
3171
+ amountOfTickets: t.amountOfTickets,
3172
+ orderItemId: t.orderItemId,
3173
+ withTicketProtection: t.withTicketProtection
3170
3174
  };
3171
- e.customer && (n.customer = e.customer), e.products && (n.products = e.products), e.description && (n.description = e.description), e.reference && (n.reference = e.reference), e.ipAddress && (n.ipAddress = e.ipAddress);
3172
- const i = await this.sdk.createDigitalPayment({
3175
+ t.customer && (n.customer = t.customer), t.products && (n.products = t.products), t.description && (n.description = t.description), t.reference && (n.reference = t.reference), t.ipAddress && (n.ipAddress = t.ipAddress);
3176
+ const r = await this.sdk.createDigitalPayment({
3173
3177
  input: n
3174
3178
  });
3175
- if (!i?.createDigitalOrderPayment)
3179
+ if (!r?.createDigitalOrderPayment)
3176
3180
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
3177
- const r = i.createDigitalOrderPayment;
3178
- return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
3181
+ const i = r.createDigitalOrderPayment;
3182
+ return this.debugLog("Payment created successfully", { paymentUrl: i }), { paymentUrl: i };
3179
3183
  } catch (n) {
3180
3184
  throw this.debugLog("Error creating payment", n), n;
3181
3185
  }
3182
3186
  }
3183
- debugLog(e, n) {
3184
- this.config.debug && console.log(`[PaymentService] ${e}`, n || "");
3187
+ debugLog(t, n) {
3188
+ this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
3185
3189
  }
3186
3190
  }
3187
- const Ft = u`
3191
+ const Bt = u`
3188
3192
  query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
3189
3193
  findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
3190
3194
  data {
@@ -3209,7 +3213,7 @@ const Ft = u`
3209
3213
  count
3210
3214
  }
3211
3215
  }
3212
- `, wt = u`
3216
+ `, Ut = u`
3213
3217
  query findPublicPackageById($packageId: ID!) {
3214
3218
  findPublicPackageById(id: $packageId) {
3215
3219
  id
@@ -3235,7 +3239,7 @@ const Ft = u`
3235
3239
  }
3236
3240
  }
3237
3241
  }
3238
- `, $t = u`
3242
+ `, Vt = u`
3239
3243
  query findPublicPackageBySlug($organizationId: ID!, $slug: String!) {
3240
3244
  findPublicPackageBySlug(organizationId: $organizationId, slug: $slug) {
3241
3245
  id
@@ -3261,7 +3265,7 @@ const Ft = u`
3261
3265
  }
3262
3266
  }
3263
3267
  }
3264
- `, Bt = u`
3268
+ `, Mt = u`
3265
3269
  query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
3266
3270
  findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
3267
3271
  data {
@@ -3296,112 +3300,112 @@ const Ft = u`
3296
3300
  count
3297
3301
  }
3298
3302
  }
3299
- `, Vt = (t, e, n, i) => t();
3300
- function Ut(t, e = Vt) {
3303
+ `, zt = (e, t, n, r) => e();
3304
+ function qt(e, t = zt) {
3301
3305
  return {
3302
- findAllPublicPackagesByOrganizationId(n, i, r) {
3303
- return e((s) => t.request({ document: Ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
3306
+ findAllPublicPackagesByOrganizationId(n, r, i) {
3307
+ return t((s) => e.request({ document: Bt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicPackagesByOrganizationId", "query", n);
3304
3308
  },
3305
- findPublicPackageById(n, i, r) {
3306
- return e((s) => t.request({ document: wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
3309
+ findPublicPackageById(n, r, i) {
3310
+ return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageById", "query", n);
3307
3311
  },
3308
- findPublicPackageBySlug(n, i, r) {
3309
- return e((s) => t.request({ document: $t, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageBySlug", "query", n);
3312
+ findPublicPackageBySlug(n, r, i) {
3313
+ return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicPackageBySlug", "query", n);
3310
3314
  },
3311
- findPublicItemsByPackageId(n, i, r) {
3312
- return e((s) => t.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
3315
+ findPublicItemsByPackageId(n, r, i) {
3316
+ return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findPublicItemsByPackageId", "query", n);
3313
3317
  }
3314
3318
  };
3315
3319
  }
3316
- class Mt {
3320
+ class Gt {
3317
3321
  config;
3318
3322
  sdk;
3319
- constructor(e) {
3320
- this.config = e, this.sdk = Ut(new v(e.apiUrl));
3323
+ constructor(t) {
3324
+ this.config = t, this.sdk = qt(new T(t.apiUrl));
3321
3325
  }
3322
- debugLog(e, n) {
3323
- this.config.debug && console.log(`[PackageService] ${e}`, n || "");
3326
+ debugLog(t, n) {
3327
+ this.config.debug && console.log(`[PackageService] ${t}`, n || "");
3324
3328
  }
3325
- async getPackages(e, n) {
3329
+ async getPackages(t, n) {
3326
3330
  try {
3327
- let i;
3328
- e.page && (i = {
3329
- index: e.page.index ?? 0,
3330
- size: e.page.size ?? 20
3331
+ let r;
3332
+ t.page && (r = {
3333
+ index: t.page.index ?? 0,
3334
+ size: t.page.size ?? 20
3331
3335
  }), this.debugLog("Fetching public packages", {
3332
3336
  organizationId: this.config.organizationId ?? n ?? "",
3333
- page: i,
3334
- tab: e.tab,
3335
- statuses: e.statuses
3337
+ page: r,
3338
+ tab: t.tab,
3339
+ statuses: t.statuses
3336
3340
  });
3337
- const r = await this.sdk.findAllPublicPackagesByOrganizationId({
3341
+ const i = await this.sdk.findAllPublicPackagesByOrganizationId({
3338
3342
  organizationId: this.config.organizationId ?? n ?? ""
3339
3343
  });
3340
- if (r?.findAllPublicPackagesByOrganizationId) {
3341
- const s = r.findAllPublicPackagesByOrganizationId;
3344
+ if (i?.findAllPublicPackagesByOrganizationId) {
3345
+ const s = i.findAllPublicPackagesByOrganizationId;
3342
3346
  return this.debugLog("Public packages fetched", {
3343
3347
  count: s.count,
3344
3348
  dataLength: s.data.length
3345
3349
  }), s.data;
3346
3350
  }
3347
3351
  return null;
3348
- } catch (i) {
3349
- throw this.debugLog("Error fetching public packages", i), i;
3352
+ } catch (r) {
3353
+ throw this.debugLog("Error fetching public packages", r), r;
3350
3354
  }
3351
3355
  }
3352
- async getPackage(e) {
3356
+ async getPackage(t) {
3353
3357
  try {
3354
3358
  this.debugLog("Fetching public packages", {
3355
- packageId: e
3359
+ packageId: t
3356
3360
  });
3357
- const n = await this.sdk.findPublicPackageById({ packageId: e });
3361
+ const n = await this.sdk.findPublicPackageById({ packageId: t });
3358
3362
  if (n?.findPublicPackageById) {
3359
- const i = n.findPublicPackageById;
3360
- return this.debugLog("Public package fetched"), i;
3363
+ const r = n.findPublicPackageById;
3364
+ return this.debugLog("Public package fetched"), r;
3361
3365
  }
3362
3366
  return null;
3363
3367
  } catch (n) {
3364
3368
  throw this.debugLog("Error fetching public packages", n), n;
3365
3369
  }
3366
3370
  }
3367
- async getPackageBySlug(e, n) {
3371
+ async getPackageBySlug(t, n) {
3368
3372
  try {
3369
3373
  this.debugLog("Fetching public packages by slug", {
3370
- organizationId: e,
3374
+ organizationId: t,
3371
3375
  slug: n
3372
3376
  });
3373
- const i = await this.sdk.findPublicPackageBySlug({ organizationId: e, slug: n });
3374
- if (i?.findPublicPackageBySlug) {
3375
- const r = i.findPublicPackageBySlug;
3376
- return this.debugLog("Public package fetched"), r;
3377
+ const r = await this.sdk.findPublicPackageBySlug({ organizationId: t, slug: n });
3378
+ if (r?.findPublicPackageBySlug) {
3379
+ const i = r.findPublicPackageBySlug;
3380
+ return this.debugLog("Public package fetched"), i;
3377
3381
  }
3378
3382
  return null;
3379
- } catch (i) {
3380
- throw this.debugLog("Error fetching public packages", i), i;
3383
+ } catch (r) {
3384
+ throw this.debugLog("Error fetching public packages", r), r;
3381
3385
  }
3382
3386
  }
3383
- async getPackageItems(e, n = [R.Regular, R.AdditionalEvent]) {
3387
+ async getPackageItems(t, n = [R.Regular, R.AdditionalEvent]) {
3384
3388
  try {
3385
- this.debugLog("Fetching public package items", { packageId: e, types: n });
3386
- const i = await this.sdk.findPublicItemsByPackageId({
3387
- packageId: e,
3389
+ this.debugLog("Fetching public package items", { packageId: t, types: n });
3390
+ const r = await this.sdk.findPublicItemsByPackageId({
3391
+ packageId: t,
3388
3392
  types: n,
3389
3393
  page: { index: 0, size: 100 }
3390
3394
  });
3391
- if (i?.findPublicItemsByPackageId) {
3392
- const r = i.findPublicItemsByPackageId;
3395
+ if (r?.findPublicItemsByPackageId) {
3396
+ const i = r.findPublicItemsByPackageId;
3393
3397
  return this.debugLog("Public package items fetched", {
3394
- count: r.count,
3395
- dataLength: r.data.length
3396
- }), r.data;
3398
+ count: i.count,
3399
+ dataLength: i.data.length
3400
+ }), i.data;
3397
3401
  }
3398
3402
  return null;
3399
- } catch (i) {
3400
- throw this.debugLog("Error fetching public package items", i), i;
3403
+ } catch (r) {
3404
+ throw this.debugLog("Error fetching public package items", r), r;
3401
3405
  }
3402
3406
  }
3403
3407
  }
3404
- const zt = u`
3408
+ const jt = u`
3405
3409
  query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
3406
3410
  findAllPublicLocationsByOrganizationId(id: $organizationId) {
3407
3411
  data {
@@ -3421,80 +3425,80 @@ const zt = u`
3421
3425
  count
3422
3426
  }
3423
3427
  }
3424
- `, qt = (t, e, n, i) => t();
3425
- function Gt(t, e = qt) {
3428
+ `, Yt = (e, t, n, r) => e();
3429
+ function Ht(e, t = Yt) {
3426
3430
  return {
3427
- findAllPublicCategoriesByOrganizationId(n, i, r) {
3428
- return e((s) => t.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
3431
+ findAllPublicCategoriesByOrganizationId(n, r, i) {
3432
+ return t((s) => e.request({ document: jt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllPublicCategoriesByOrganizationId", "query", n);
3429
3433
  }
3430
3434
  };
3431
3435
  }
3432
- class jt {
3436
+ class Jt {
3433
3437
  config;
3434
3438
  sdk;
3435
- constructor(e) {
3436
- this.config = e, this.sdk = Gt(new v(e.apiUrl));
3439
+ constructor(t) {
3440
+ this.config = t, this.sdk = Ht(new T(t.apiUrl));
3437
3441
  }
3438
- debugLog(e, n) {
3439
- this.config.debug && console.log(`[CategoryService] ${e}`, n || "");
3442
+ debugLog(t, n) {
3443
+ this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
3440
3444
  }
3441
- async getCategories(e, n) {
3445
+ async getCategories(t, n) {
3442
3446
  try {
3443
3447
  this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
3444
- const i = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId ?? n ?? "", dateRange: e ?? null });
3445
- if (i?.findAllPublicHostingsByOrganizationId) {
3446
- const r = i.findAllPublicHostingsByOrganizationId, s = i.findAllPublicLocationsByOrganizationId;
3447
- return this.debugLog("Categories fetched", { count: r.count + s.count, dataLength: r.data.length + s.data.length }), [
3448
- ...r.data.map((o) => ({ id: o.id, name: o.name, icon: o.icon, activeEvents: o.amountOfActiveEvents, type: "HOSTING" })),
3448
+ const r = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId ?? n ?? "", dateRange: t ?? null });
3449
+ if (r?.findAllPublicHostingsByOrganizationId) {
3450
+ const i = r.findAllPublicHostingsByOrganizationId, s = r.findAllPublicLocationsByOrganizationId;
3451
+ return this.debugLog("Categories fetched", { count: i.count + s.count, dataLength: i.data.length + s.data.length }), [
3452
+ ...i.data.map((o) => ({ id: o.id, name: o.name, icon: o.icon, activeEvents: o.amountOfActiveEvents, type: "HOSTING" })),
3449
3453
  ...s.data.map((o) => ({ id: o.id, name: o.name, activeEvents: o.amountOfActiveEvents, type: "LOCATION" }))
3450
3454
  ];
3451
3455
  }
3452
3456
  return [];
3453
- } catch (i) {
3454
- throw this.debugLog("Error fetching categories", i), i;
3457
+ } catch (r) {
3458
+ throw this.debugLog("Error fetching categories", r), r;
3455
3459
  }
3456
3460
  }
3457
3461
  }
3458
- const Yt = u`
3462
+ const Qt = u`
3459
3463
  mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
3460
3464
  createShopView(id: $id, trackerId: $trackerLinkId)
3461
3465
  }
3462
- `, Ht = u`
3466
+ `, Xt = u`
3463
3467
  mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3464
3468
  createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3465
3469
  }
3466
- `, Jt = u`
3470
+ `, Wt = u`
3467
3471
  mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3468
3472
  createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3469
3473
  }
3470
- `, Qt = (t, e, n, i) => t();
3471
- function Xt(t, e = Qt) {
3474
+ `, Zt = (e, t, n, r) => e();
3475
+ function Kt(e, t = Zt) {
3472
3476
  return {
3473
- CreateShopView(n, i, r) {
3474
- return e((s) => t.request({ document: Yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", n);
3477
+ CreateShopView(n, r, i) {
3478
+ return t((s) => e.request({ document: Qt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateShopView", "mutation", n);
3475
3479
  },
3476
- CreateEventView(n, i, r) {
3477
- return e((s) => t.request({ document: Ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", n);
3480
+ CreateEventView(n, r, i) {
3481
+ return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreateEventView", "mutation", n);
3478
3482
  },
3479
- CreatePackageView(n, i, r) {
3480
- return e((s) => t.request({ document: Jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", n);
3483
+ CreatePackageView(n, r, i) {
3484
+ return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "CreatePackageView", "mutation", n);
3481
3485
  }
3482
3486
  };
3483
3487
  }
3484
- class Wt {
3488
+ class en {
3485
3489
  config;
3486
3490
  sdk;
3487
- constructor(e) {
3488
- this.config = e, this.sdk = Xt(new v(e.apiUrl));
3491
+ constructor(t) {
3492
+ this.config = t, this.sdk = Kt(new T(t.apiUrl));
3489
3493
  }
3490
- createMetric = async (e, n, i) => {
3491
- switch (!n && !i && await this.sdk.CreateShopView({
3492
- id: e,
3494
+ createMetric = async (t, n, r) => {
3495
+ switch (!n && !r && await this.sdk.CreateShopView({
3496
+ id: t,
3493
3497
  trackerLinkId: this.config.trackerId
3494
- }), i) {
3498
+ }), r) {
3495
3499
  case F.Event:
3496
3500
  await this.sdk.CreateEventView({
3497
- id: e,
3501
+ id: t,
3498
3502
  shopId: n,
3499
3503
  trackerLinkId: this.config.trackerId
3500
3504
  });
@@ -3502,7 +3506,7 @@ class Wt {
3502
3506
  case F.Package:
3503
3507
  await this.sdk.CreatePackageView(
3504
3508
  {
3505
- id: e,
3509
+ id: t,
3506
3510
  shopId: n,
3507
3511
  trackerLinkId: this.config.trackerId
3508
3512
  }
@@ -3511,7 +3515,7 @@ class Wt {
3511
3515
  }
3512
3516
  };
3513
3517
  }
3514
- const Zt = u`
3518
+ const tn = u`
3515
3519
  query getShopBySlug($slug: String!, $trackerLinkId: String) {
3516
3520
  findShopBySlug(slug: $slug, promoterId: $trackerLinkId) {
3517
3521
  id
@@ -3555,39 +3559,88 @@ const Zt = u`
3555
3559
  blockedLanguages
3556
3560
  }
3557
3561
  }
3558
- `, Kt = (t, e, n, i) => t();
3559
- function en(t, e = Kt) {
3562
+ `, nn = (e, t, n, r) => e();
3563
+ function rn(e, t = nn) {
3560
3564
  return {
3561
- getShopBySlug(n, i, r) {
3562
- return e((s) => t.request({ document: Zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "getShopBySlug", "query", n);
3565
+ getShopBySlug(n, r, i) {
3566
+ return t((s) => e.request({ document: tn, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "getShopBySlug", "query", n);
3563
3567
  }
3564
3568
  };
3565
3569
  }
3566
- class tn {
3570
+ class sn {
3567
3571
  config;
3568
3572
  sdk;
3569
- constructor(e) {
3570
- this.config = e, this.sdk = en(new v(e.apiUrl));
3573
+ constructor(t) {
3574
+ this.config = t, this.sdk = rn(new T(t.apiUrl));
3571
3575
  }
3572
- async getShop(e) {
3576
+ async getShop(t) {
3573
3577
  try {
3574
- this.debugLog("Fetching shop", { slug: e });
3575
- const n = await this.sdk.getShopBySlug({ slug: e, trackerLinkId: this.config.trackerId });
3578
+ this.debugLog("Fetching shop", { slug: t });
3579
+ const n = await this.sdk.getShopBySlug({ slug: t, trackerLinkId: this.config.trackerId });
3576
3580
  if (this.debugLog("Raw GraphQL response", n), n?.findShopBySlug) {
3577
- const i = n.findShopBySlug;
3578
- return this.debugLog("Public Shop fetched"), i;
3581
+ const r = n.findShopBySlug;
3582
+ return this.debugLog("Public Shop fetched"), r;
3579
3583
  }
3580
3584
  return null;
3581
3585
  } catch (n) {
3582
3586
  throw this.debugLog("Error fetching single Shop", n), n;
3583
3587
  }
3584
3588
  }
3585
- debugLog(e, n) {
3586
- this.config.debug && console.log(`[ShopService] ${e}`, n || "");
3589
+ debugLog(t, n) {
3590
+ this.config.debug && console.log(`[ShopService] ${t}`, n || "");
3591
+ }
3592
+ }
3593
+ const an = u`
3594
+ query findAllCustomFieldsByOrderId($orderId: String!, $salesLocations: [SalesLocations!]) {
3595
+ findAllCustomFieldsByOrderId(orderId: $orderId, salesLocations: $salesLocations) {
3596
+ id
3597
+ label
3598
+ name
3599
+ type
3600
+ salesLocations
3601
+ typeOptions {
3602
+ key
3603
+ value
3604
+ }
3605
+ defaultValue
3606
+ mandatoryType
3607
+ placeholder
3608
+ required
3609
+ confirm
3610
+ }
3611
+ }
3612
+ `, on = (e, t, n, r) => e();
3613
+ function cn(e, t = on) {
3614
+ return {
3615
+ findAllCustomFieldsByOrderId(n, r, i) {
3616
+ return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...r, ...s }, signal: i }), "findAllCustomFieldsByOrderId", "query", n);
3617
+ }
3618
+ };
3619
+ }
3620
+ class dn {
3621
+ config;
3622
+ sdk;
3623
+ constructor(t) {
3624
+ this.config = t, this.sdk = cn(new T(t.apiUrl));
3625
+ }
3626
+ async findByOrderId(t, n) {
3627
+ try {
3628
+ this.debugLog("Fetching custom fields for order", { orderId: t, salesLocations: n });
3629
+ const r = await this.sdk.findAllCustomFieldsByOrderId({
3630
+ orderId: t,
3631
+ salesLocations: n || null
3632
+ });
3633
+ return this.debugLog("Custom fields fetched successfully", r.findAllCustomFieldsByOrderId), r.findAllCustomFieldsByOrderId;
3634
+ } catch (r) {
3635
+ throw this.debugLog("Error fetching custom fields for order", r), r;
3636
+ }
3637
+ }
3638
+ debugLog(t, n) {
3639
+ this.config.debug && console.log(`[CustomFieldService] ${t}`, n || "");
3587
3640
  }
3588
3641
  }
3589
- const nn = "https://api.ticketapp.com/graphql";
3590
- class an {
3642
+ const un = "https://api.ticketapp.com/graphql";
3643
+ class pn {
3591
3644
  basket;
3592
3645
  event;
3593
3646
  payment;
@@ -3595,15 +3648,18 @@ class an {
3595
3648
  category;
3596
3649
  metric;
3597
3650
  shop;
3651
+ customField;
3598
3652
  // Attach selected public types to the SDK class
3599
- static Types = Te;
3600
- constructor(e) {
3601
- const { organizationId: n, debug: i = !1, apiUrl: r = nn } = e;
3602
- this.event = new St({ organizationId: n, debug: i, apiUrl: r, trackerId: e.trackerId }), this.package = new Mt({ organizationId: n, debug: i, apiUrl: r }), this.category = new jt({ organizationId: n, debug: i, apiUrl: r }), this.metric = new Wt({ apiUrl: r, trackerId: e.trackerId }), this.shop = new tn({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.basket = new At({ debug: i, apiUrl: r, trackerId: e.trackerId }), this.payment = new Rt({ debug: i, apiUrl: r });
3653
+ static Types = ve;
3654
+ constructor(t) {
3655
+ const { organizationId: n, debug: r = !1, apiUrl: i = un } = t;
3656
+ this.event = new Ct({ organizationId: n, debug: r, apiUrl: i, trackerId: t.trackerId }), this.package = new Gt({ organizationId: n, debug: r, apiUrl: i }), this.category = new Jt({ organizationId: n, debug: r, apiUrl: i }), this.metric = new en({ apiUrl: i, trackerId: t.trackerId }), this.shop = new sn({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.customField = new dn({ debug: r, apiUrl: i }), this.basket = new Dt({ debug: r, apiUrl: i, trackerId: t.trackerId }), this.payment = new $t({ debug: r, apiUrl: i });
3603
3657
  }
3604
3658
  }
3605
3659
  export {
3606
- T as BasketOrderType,
3660
+ N as BasketOrderType,
3661
+ ue as CustomFieldMandatoryType,
3662
+ de as CustomFieldType,
3607
3663
  ae as DiscountType,
3608
3664
  ee as EventStatus,
3609
3665
  F as MetricsType,
@@ -3611,11 +3667,12 @@ export {
3611
3667
  R as PackageItemType,
3612
3668
  Z as PackageStatus,
3613
3669
  K as PackageTabType,
3614
- re as PaymentMethodFeeType,
3670
+ ie as PaymentMethodFeeType,
3615
3671
  ne as ProductStatus,
3616
- ie as ProductType,
3672
+ re as ProductType,
3673
+ le as SalesLocations,
3617
3674
  oe as ShopTemplateType,
3618
3675
  ce as ShopVariationType,
3619
3676
  te as SortOrder,
3620
- an as TicketappSDK
3677
+ pn as TicketappSDK
3621
3678
  };