@ticketapp-dev/shop-sdk 1.0.14 → 1.0.15

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,86 +1,86 @@
1
- import { GraphQLClient as C } from "graphql-request";
2
- import { createSlice as Ce, configureStore as _e } from "@reduxjs/toolkit";
3
- import { DateTime as y } from "luxon";
4
- var F = function() {
5
- return F = Object.assign || function(e) {
6
- for (var t, i = 1, n = arguments.length; i < n; i++) {
7
- t = arguments[i];
8
- for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
1
+ import { GraphQLClient as ae } from "graphql-request";
2
+ import { createSlice as Xe, configureStore as Ke } from "@reduxjs/toolkit";
3
+ import { DateTime as x } from "luxon";
4
+ var Q = function() {
5
+ return Q = Object.assign || function(t) {
6
+ for (var n, i = 1, r = arguments.length; i < r; i++) {
7
+ n = arguments[i];
8
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
9
9
  }
10
- return e;
11
- }, F.apply(this, arguments);
10
+ return t;
11
+ }, Q.apply(this, arguments);
12
12
  };
13
- function M(r, e) {
14
- if (!!!r)
15
- throw new Error(e);
13
+ function G(e, t) {
14
+ if (!!!e)
15
+ throw new Error(t);
16
16
  }
17
- function Le(r) {
18
- return typeof r == "object" && r !== null;
17
+ function We(e) {
18
+ return typeof e == "object" && e !== null;
19
19
  }
20
- function Re(r, e) {
21
- if (!!!r)
20
+ function Ze(e, t) {
21
+ if (!!!e)
22
22
  throw new Error(
23
23
  "Unexpected invariant triggered."
24
24
  );
25
25
  }
26
- const Fe = /\r\n|[\n\r]/g;
27
- function z(r, e) {
28
- let t = 0, i = 1;
29
- for (const n of r.body.matchAll(Fe)) {
30
- if (typeof n.index == "number" || Re(!1), n.index >= e)
26
+ const et = /\r\n|[\n\r]/g;
27
+ function re(e, t) {
28
+ let n = 0, i = 1;
29
+ for (const r of e.body.matchAll(et)) {
30
+ if (typeof r.index == "number" || Ze(!1), r.index >= t)
31
31
  break;
32
- t = n.index + n[0].length, i += 1;
32
+ n = r.index + r[0].length, i += 1;
33
33
  }
34
34
  return {
35
35
  line: i,
36
- column: e + 1 - t
36
+ column: t + 1 - n
37
37
  };
38
38
  }
39
- function we(r) {
40
- return ie(
41
- r.source,
42
- z(r.source, r.start)
39
+ function tt(e) {
40
+ return ke(
41
+ e.source,
42
+ re(e.source, e.start)
43
43
  );
44
44
  }
45
- function ie(r, e) {
46
- const t = r.locationOffset.column - 1, i = "".padStart(t) + r.body, n = e.line - 1, s = r.locationOffset.line - 1, o = e.line + s, u = e.line === 1 ? t : 0, l = e.column + u, f = `${r.name}:${o}:${l}
47
- `, c = i.split(/\r\n|[\n\r]/g), E = c[n];
48
- if (E.length > 120) {
49
- const m = Math.floor(l / 80), O = l % 80, I = [];
50
- for (let A = 0; A < E.length; A += 80)
51
- I.push(E.slice(A, A + 80));
52
- return f + J([
45
+ function ke(e, t) {
46
+ const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, h = t.column + u, p = `${e.name}:${o}:${h}
47
+ `, c = i.split(/\r\n|[\n\r]/g), m = c[r];
48
+ if (m.length > 120) {
49
+ const g = Math.floor(h / 80), y = h % 80, I = [];
50
+ for (let O = 0; O < m.length; O += 80)
51
+ I.push(m.slice(O, O + 80));
52
+ return p + pe([
53
53
  [`${o} |`, I[0]],
54
- ...I.slice(1, m + 1).map((A) => ["|", A]),
55
- ["|", "^".padStart(O)],
56
- ["|", I[m + 1]]
54
+ ...I.slice(1, g + 1).map((O) => ["|", O]),
55
+ ["|", "^".padStart(y)],
56
+ ["|", I[g + 1]]
57
57
  ]);
58
58
  }
59
- return f + J([
59
+ return p + pe([
60
60
  // Lines specified like this: ["prefix", "string"],
61
- [`${o - 1} |`, c[n - 1]],
62
- [`${o} |`, E],
63
- ["|", "^".padStart(l)],
64
- [`${o + 1} |`, c[n + 1]]
61
+ [`${o - 1} |`, c[r - 1]],
62
+ [`${o} |`, m],
63
+ ["|", "^".padStart(h)],
64
+ [`${o + 1} |`, c[r + 1]]
65
65
  ]);
66
66
  }
67
- function J(r) {
68
- const e = r.filter(([i, n]) => n !== void 0), t = Math.max(...e.map(([i]) => i.length));
69
- return e.map(([i, n]) => i.padStart(t) + (n ? " " + n : "")).join(`
67
+ function pe(e) {
68
+ const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
69
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
70
70
  `);
71
71
  }
72
- function Be(r) {
73
- const e = r[0];
74
- return e == null || "kind" in e || "length" in e ? {
75
- nodes: e,
76
- source: r[1],
77
- positions: r[2],
78
- path: r[3],
79
- originalError: r[4],
80
- extensions: r[5]
81
- } : e;
72
+ function nt(e) {
73
+ const t = e[0];
74
+ return t == null || "kind" in t || "length" in t ? {
75
+ nodes: t,
76
+ source: e[1],
77
+ positions: e[2],
78
+ path: e[3],
79
+ originalError: e[4],
80
+ extensions: e[5]
81
+ } : t;
82
82
  }
83
- class j extends Error {
83
+ class ce extends Error {
84
84
  /**
85
85
  * An array of `{ line, column }` locations within the source GraphQL document
86
86
  * which correspond to this error.
@@ -119,20 +119,20 @@ class j extends Error {
119
119
  /**
120
120
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
121
121
  */
122
- constructor(e, ...t) {
123
- var i, n, s;
124
- const { nodes: o, source: u, positions: l, path: f, originalError: c, extensions: E } = Be(t);
125
- super(e), this.name = "GraphQLError", this.path = f ?? void 0, this.originalError = c ?? void 0, this.nodes = X(
122
+ constructor(t, ...n) {
123
+ var i, r, s;
124
+ const { nodes: o, source: u, positions: h, path: p, originalError: c, extensions: m } = nt(n);
125
+ super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = c ?? void 0, this.nodes = he(
126
126
  Array.isArray(o) ? o : o ? [o] : void 0
127
127
  );
128
- const m = X(
128
+ const g = he(
129
129
  (i = this.nodes) === null || i === void 0 ? void 0 : i.map((I) => I.loc).filter((I) => I != null)
130
130
  );
131
- this.source = u ?? (m == null || (n = m[0]) === null || n === void 0 ? void 0 : n.source), this.positions = l ?? m?.map((I) => I.start), this.locations = l && u ? l.map((I) => z(u, I)) : m?.map((I) => z(I.source, I.start));
132
- const O = Le(
131
+ this.source = u ?? (g == null || (r = g[0]) === null || r === void 0 ? void 0 : r.source), this.positions = h ?? g?.map((I) => I.start), this.locations = h && u ? h.map((I) => re(u, I)) : g?.map((I) => re(I.source, I.start));
132
+ const y = We(
133
133
  c?.extensions
134
134
  ) ? c?.extensions : void 0;
135
- this.extensions = (s = E ?? O) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
135
+ this.extensions = (s = m ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
136
136
  message: {
137
137
  writable: !0,
138
138
  enumerable: !0
@@ -156,7 +156,7 @@ class j extends Error {
156
156
  value: c.stack,
157
157
  writable: !0,
158
158
  configurable: !0
159
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, j) : Object.defineProperty(this, "stack", {
159
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, ce) : Object.defineProperty(this, "stack", {
160
160
  value: Error().stack,
161
161
  writable: !0,
162
162
  configurable: !0
@@ -166,36 +166,36 @@ class j extends Error {
166
166
  return "GraphQLError";
167
167
  }
168
168
  toString() {
169
- let e = this.message;
169
+ let t = this.message;
170
170
  if (this.nodes)
171
- for (const t of this.nodes)
172
- t.loc && (e += `
171
+ for (const n of this.nodes)
172
+ n.loc && (t += `
173
173
 
174
- ` + we(t.loc));
174
+ ` + tt(n.loc));
175
175
  else if (this.source && this.locations)
176
- for (const t of this.locations)
177
- e += `
176
+ for (const n of this.locations)
177
+ t += `
178
178
 
179
- ` + ie(this.source, t);
180
- return e;
179
+ ` + ke(this.source, n);
180
+ return t;
181
181
  }
182
182
  toJSON() {
183
- const e = {
183
+ const t = {
184
184
  message: this.message
185
185
  };
186
- 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;
186
+ 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;
187
187
  }
188
188
  }
189
- function X(r) {
190
- return r === void 0 || r.length === 0 ? void 0 : r;
189
+ function he(e) {
190
+ return e === void 0 || e.length === 0 ? void 0 : e;
191
191
  }
192
- function g(r, e, t) {
193
- return new j(`Syntax Error: ${t}`, {
194
- source: r,
195
- positions: [e]
192
+ function A(e, t, n) {
193
+ return new ce(`Syntax Error: ${n}`, {
194
+ source: e,
195
+ positions: [t]
196
196
  });
197
197
  }
198
- class $e {
198
+ class rt {
199
199
  /**
200
200
  * The character offset at which this Node begins.
201
201
  */
@@ -211,8 +211,8 @@ class $e {
211
211
  /**
212
212
  * The Source document the AST represents.
213
213
  */
214
- constructor(e, t, i) {
215
- this.start = e.start, this.end = t.end, this.startToken = e, this.endToken = t, this.source = i;
214
+ constructor(t, n, i) {
215
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
216
216
  }
217
217
  get [Symbol.toStringTag]() {
218
218
  return "Location";
@@ -224,7 +224,7 @@ class $e {
224
224
  };
225
225
  }
226
226
  }
227
- class se {
227
+ class De {
228
228
  /**
229
229
  * The kind of Token.
230
230
  */
@@ -251,8 +251,8 @@ class se {
251
251
  * including ignored tokens. <SOF> is always the first node and <EOF>
252
252
  * the last.
253
253
  */
254
- constructor(e, t, i, n, s, o) {
255
- this.kind = e, this.start = t, this.end = i, this.line = n, this.column = s, this.value = o, this.prev = null, this.next = null;
254
+ constructor(t, n, i, r, s, o) {
255
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
256
256
  }
257
257
  get [Symbol.toStringTag]() {
258
258
  return "Token";
@@ -266,7 +266,7 @@ class se {
266
266
  };
267
267
  }
268
268
  }
269
- const Ue = {
269
+ const xe = {
270
270
  Name: [],
271
271
  Document: ["definitions"],
272
272
  OperationDefinition: [
@@ -353,60 +353,74 @@ const Ue = {
353
353
  ArgumentCoordinate: ["name", "fieldName", "argumentName"],
354
354
  DirectiveCoordinate: ["name"],
355
355
  DirectiveArgumentCoordinate: ["name", "argumentName"]
356
- };
357
- new Set(Object.keys(Ue));
358
- var x;
359
- (function(r) {
360
- r.QUERY = "query", r.MUTATION = "mutation", r.SUBSCRIPTION = "subscription";
361
- })(x || (x = {}));
362
- var q;
363
- (function(r) {
364
- r.QUERY = "QUERY", r.MUTATION = "MUTATION", r.SUBSCRIPTION = "SUBSCRIPTION", r.FIELD = "FIELD", r.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", r.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", r.INLINE_FRAGMENT = "INLINE_FRAGMENT", r.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", r.SCHEMA = "SCHEMA", r.SCALAR = "SCALAR", r.OBJECT = "OBJECT", r.FIELD_DEFINITION = "FIELD_DEFINITION", r.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", r.INTERFACE = "INTERFACE", r.UNION = "UNION", r.ENUM = "ENUM", r.ENUM_VALUE = "ENUM_VALUE", r.INPUT_OBJECT = "INPUT_OBJECT", r.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
365
- })(q || (q = {}));
366
- var d;
367
- (function(r) {
368
- r.NAME = "Name", r.DOCUMENT = "Document", r.OPERATION_DEFINITION = "OperationDefinition", r.VARIABLE_DEFINITION = "VariableDefinition", r.SELECTION_SET = "SelectionSet", r.FIELD = "Field", r.ARGUMENT = "Argument", r.FRAGMENT_SPREAD = "FragmentSpread", r.INLINE_FRAGMENT = "InlineFragment", r.FRAGMENT_DEFINITION = "FragmentDefinition", r.VARIABLE = "Variable", r.INT = "IntValue", r.FLOAT = "FloatValue", r.STRING = "StringValue", r.BOOLEAN = "BooleanValue", r.NULL = "NullValue", r.ENUM = "EnumValue", r.LIST = "ListValue", r.OBJECT = "ObjectValue", r.OBJECT_FIELD = "ObjectField", r.DIRECTIVE = "Directive", r.NAMED_TYPE = "NamedType", r.LIST_TYPE = "ListType", r.NON_NULL_TYPE = "NonNullType", r.SCHEMA_DEFINITION = "SchemaDefinition", r.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", r.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", r.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", r.FIELD_DEFINITION = "FieldDefinition", r.INPUT_VALUE_DEFINITION = "InputValueDefinition", r.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", r.UNION_TYPE_DEFINITION = "UnionTypeDefinition", r.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", r.ENUM_VALUE_DEFINITION = "EnumValueDefinition", r.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", r.DIRECTIVE_DEFINITION = "DirectiveDefinition", r.SCHEMA_EXTENSION = "SchemaExtension", r.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", r.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", r.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", r.UNION_TYPE_EXTENSION = "UnionTypeExtension", r.ENUM_TYPE_EXTENSION = "EnumTypeExtension", r.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", r.TYPE_COORDINATE = "TypeCoordinate", r.MEMBER_COORDINATE = "MemberCoordinate", r.ARGUMENT_COORDINATE = "ArgumentCoordinate", r.DIRECTIVE_COORDINATE = "DirectiveCoordinate", r.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
369
- })(d || (d = {}));
370
- function Me(r) {
371
- return r === 9 || r === 32;
372
- }
373
- function S(r) {
374
- return r >= 48 && r <= 57;
375
- }
376
- function oe(r) {
377
- return r >= 97 && r <= 122 || // A-Z
378
- r >= 65 && r <= 90;
379
- }
380
- function ae(r) {
381
- return oe(r) || r === 95;
382
- }
383
- function Ve(r) {
384
- return oe(r) || S(r) || r === 95;
385
- }
386
- function ze(r) {
387
- var e;
388
- let t = Number.MAX_SAFE_INTEGER, i = null, n = -1;
389
- for (let o = 0; o < r.length; ++o) {
356
+ }, it = new Set(Object.keys(xe));
357
+ function fe(e) {
358
+ const t = e?.kind;
359
+ return typeof t == "string" && it.has(t);
360
+ }
361
+ var w;
362
+ (function(e) {
363
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
364
+ })(w || (w = {}));
365
+ var ie;
366
+ (function(e) {
367
+ 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";
368
+ })(ie || (ie = {}));
369
+ var l;
370
+ (function(e) {
371
+ 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";
372
+ })(l || (l = {}));
373
+ function se(e) {
374
+ return e === 9 || e === 32;
375
+ }
376
+ function M(e) {
377
+ return e >= 48 && e <= 57;
378
+ }
379
+ function Ne(e) {
380
+ return e >= 97 && e <= 122 || // A-Z
381
+ e >= 65 && e <= 90;
382
+ }
383
+ function be(e) {
384
+ return Ne(e) || e === 95;
385
+ }
386
+ function st(e) {
387
+ return Ne(e) || M(e) || e === 95;
388
+ }
389
+ function ot(e) {
390
+ var t;
391
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
392
+ for (let o = 0; o < e.length; ++o) {
390
393
  var s;
391
- const u = r[o], l = qe(u);
392
- l !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, n = o, o !== 0 && l < t && (t = l));
394
+ const u = e[o], h = at(u);
395
+ h !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && h < n && (n = h));
393
396
  }
394
- return r.map((o, u) => u === 0 ? o : o.slice(t)).slice(
395
- (e = i) !== null && e !== void 0 ? e : 0,
396
- n + 1
397
+ return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
398
+ (t = i) !== null && t !== void 0 ? t : 0,
399
+ r + 1
397
400
  );
398
401
  }
399
- function qe(r) {
400
- let e = 0;
401
- for (; e < r.length && Me(r.charCodeAt(e)); )
402
- ++e;
403
- return e;
402
+ function at(e) {
403
+ let t = 0;
404
+ for (; t < e.length && se(e.charCodeAt(t)); )
405
+ ++t;
406
+ return t;
407
+ }
408
+ function ct(e, t) {
409
+ const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((y) => y.length === 0 || se(y.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, h = e.endsWith("\\"), p = u || h, c = (
410
+ // add leading and trailing new lines only if it improves readability
411
+ !r || e.length > 70 || p || s || o
412
+ );
413
+ let m = "";
414
+ const g = r && se(e.charCodeAt(0));
415
+ return (c && !g || s) && (m += `
416
+ `), m += n, (c || p) && (m += `
417
+ `), '"""' + m + '"""';
404
418
  }
405
419
  var a;
406
- (function(r) {
407
- r.SOF = "<SOF>", r.EOF = "<EOF>", r.BANG = "!", r.DOLLAR = "$", r.AMP = "&", r.PAREN_L = "(", r.PAREN_R = ")", r.DOT = ".", r.SPREAD = "...", r.COLON = ":", r.EQUALS = "=", r.AT = "@", r.BRACKET_L = "[", r.BRACKET_R = "]", r.BRACE_L = "{", r.PIPE = "|", r.BRACE_R = "}", r.NAME = "Name", r.INT = "Int", r.FLOAT = "Float", r.STRING = "String", r.BLOCK_STRING = "BlockString", r.COMMENT = "Comment";
420
+ (function(e) {
421
+ 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";
408
422
  })(a || (a = {}));
409
- class Ge {
423
+ class dt {
410
424
  /**
411
425
  * The previously focused non-ignored token.
412
426
  */
@@ -419,9 +433,9 @@ class Ge {
419
433
  /**
420
434
  * The character offset at which the current line begins.
421
435
  */
422
- constructor(e) {
423
- const t = new se(a.SOF, 0, 0, 0, 0);
424
- this.source = e, this.lastToken = t, this.token = t, this.line = 1, this.lineStart = 0;
436
+ constructor(t) {
437
+ const n = new De(a.SOF, 0, 0, 0, 0);
438
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
425
439
  }
426
440
  get [Symbol.toStringTag]() {
427
441
  return "Lexer";
@@ -437,53 +451,53 @@ class Ge {
437
451
  * the state of Lexer.
438
452
  */
439
453
  lookahead() {
440
- let e = this.token;
441
- if (e.kind !== a.EOF)
454
+ let t = this.token;
455
+ if (t.kind !== a.EOF)
442
456
  do
443
- if (e.next)
444
- e = e.next;
457
+ if (t.next)
458
+ t = t.next;
445
459
  else {
446
- const t = Ye(this, e.end);
447
- e.next = t, t.prev = e, e = t;
460
+ const n = lt(this, t.end);
461
+ t.next = n, n.prev = t, t = n;
448
462
  }
449
- while (e.kind === a.COMMENT);
450
- return e;
463
+ while (t.kind === a.COMMENT);
464
+ return t;
451
465
  }
452
466
  }
453
- function je(r) {
454
- return r === a.BANG || r === a.DOLLAR || r === a.AMP || r === a.PAREN_L || r === a.PAREN_R || r === a.DOT || r === a.SPREAD || r === a.COLON || r === a.EQUALS || r === a.AT || r === a.BRACKET_L || r === a.BRACKET_R || r === a.BRACE_L || r === a.PIPE || r === a.BRACE_R;
467
+ function ut(e) {
468
+ 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;
455
469
  }
456
- function D(r) {
457
- return r >= 0 && r <= 55295 || r >= 57344 && r <= 1114111;
470
+ function $(e) {
471
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
458
472
  }
459
- function $(r, e) {
460
- return ce(r.charCodeAt(e)) && de(r.charCodeAt(e + 1));
473
+ function K(e, t) {
474
+ return Pe(e.charCodeAt(t)) && Se(e.charCodeAt(t + 1));
461
475
  }
462
- function ce(r) {
463
- return r >= 55296 && r <= 56319;
476
+ function Pe(e) {
477
+ return e >= 55296 && e <= 56319;
464
478
  }
465
- function de(r) {
466
- return r >= 56320 && r <= 57343;
479
+ function Se(e) {
480
+ return e >= 56320 && e <= 57343;
467
481
  }
468
- function N(r, e) {
469
- const t = r.source.body.codePointAt(e);
470
- if (t === void 0)
482
+ function F(e, t) {
483
+ const n = e.source.body.codePointAt(t);
484
+ if (n === void 0)
471
485
  return a.EOF;
472
- if (t >= 32 && t <= 126) {
473
- const i = String.fromCodePoint(t);
486
+ if (n >= 32 && n <= 126) {
487
+ const i = String.fromCodePoint(n);
474
488
  return i === '"' ? `'"'` : `"${i}"`;
475
489
  }
476
- return "U+" + t.toString(16).toUpperCase().padStart(4, "0");
490
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
477
491
  }
478
- function h(r, e, t, i, n) {
479
- const s = r.line, o = 1 + t - r.lineStart;
480
- return new se(e, t, i, s, o, n);
492
+ function v(e, t, n, i, r) {
493
+ const s = e.line, o = 1 + n - e.lineStart;
494
+ return new De(t, n, i, s, o, r);
481
495
  }
482
- function Ye(r, e) {
483
- const t = r.source.body, i = t.length;
484
- let n = e;
485
- for (; n < i; ) {
486
- const s = t.charCodeAt(n);
496
+ function lt(e, t) {
497
+ const n = e.source.body, i = n.length;
498
+ let r = t;
499
+ for (; r < i; ) {
500
+ const s = n.charCodeAt(r);
487
501
  switch (s) {
488
502
  // Ignored ::
489
503
  // - UnicodeBOM
@@ -506,21 +520,21 @@ function Ye(r, e) {
506
520
  case 32:
507
521
  // <space>
508
522
  case 44:
509
- ++n;
523
+ ++r;
510
524
  continue;
511
525
  // LineTerminator ::
512
526
  // - "New Line (U+000A)"
513
527
  // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
514
528
  // - "Carriage Return (U+000D)" "New Line (U+000A)"
515
529
  case 10:
516
- ++n, ++r.line, r.lineStart = n;
530
+ ++r, ++e.line, e.lineStart = r;
517
531
  continue;
518
532
  case 13:
519
- t.charCodeAt(n + 1) === 10 ? n += 2 : ++n, ++r.line, r.lineStart = n;
533
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
520
534
  continue;
521
535
  // Comment
522
536
  case 35:
523
- return He(r, n);
537
+ return pt(e, r);
524
538
  // Token ::
525
539
  // - Punctuator
526
540
  // - Name
@@ -530,207 +544,207 @@ function Ye(r, e) {
530
544
  //
531
545
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
532
546
  case 33:
533
- return h(r, a.BANG, n, n + 1);
547
+ return v(e, a.BANG, r, r + 1);
534
548
  case 36:
535
- return h(r, a.DOLLAR, n, n + 1);
549
+ return v(e, a.DOLLAR, r, r + 1);
536
550
  case 38:
537
- return h(r, a.AMP, n, n + 1);
551
+ return v(e, a.AMP, r, r + 1);
538
552
  case 40:
539
- return h(r, a.PAREN_L, n, n + 1);
553
+ return v(e, a.PAREN_L, r, r + 1);
540
554
  case 41:
541
- return h(r, a.PAREN_R, n, n + 1);
555
+ return v(e, a.PAREN_R, r, r + 1);
542
556
  case 46:
543
- if (t.charCodeAt(n + 1) === 46 && t.charCodeAt(n + 2) === 46)
544
- return h(r, a.SPREAD, n, n + 3);
557
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
558
+ return v(e, a.SPREAD, r, r + 3);
545
559
  break;
546
560
  case 58:
547
- return h(r, a.COLON, n, n + 1);
561
+ return v(e, a.COLON, r, r + 1);
548
562
  case 61:
549
- return h(r, a.EQUALS, n, n + 1);
563
+ return v(e, a.EQUALS, r, r + 1);
550
564
  case 64:
551
- return h(r, a.AT, n, n + 1);
565
+ return v(e, a.AT, r, r + 1);
552
566
  case 91:
553
- return h(r, a.BRACKET_L, n, n + 1);
567
+ return v(e, a.BRACKET_L, r, r + 1);
554
568
  case 93:
555
- return h(r, a.BRACKET_R, n, n + 1);
569
+ return v(e, a.BRACKET_R, r, r + 1);
556
570
  case 123:
557
- return h(r, a.BRACE_L, n, n + 1);
571
+ return v(e, a.BRACE_L, r, r + 1);
558
572
  case 124:
559
- return h(r, a.PIPE, n, n + 1);
573
+ return v(e, a.PIPE, r, r + 1);
560
574
  case 125:
561
- return h(r, a.BRACE_R, n, n + 1);
575
+ return v(e, a.BRACE_R, r, r + 1);
562
576
  // StringValue
563
577
  case 34:
564
- return t.charCodeAt(n + 1) === 34 && t.charCodeAt(n + 2) === 34 ? Ze(r, n) : Je(r, n);
578
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Et(e, r) : ft(e, r);
565
579
  }
566
- if (S(s) || s === 45)
567
- return Qe(r, n, s);
568
- if (ae(s))
569
- return et(r, n);
570
- throw g(
571
- r.source,
572
- n,
573
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : D(s) || $(t, n) ? `Unexpected character: ${N(r, n)}.` : `Invalid character: ${N(r, n)}.`
580
+ if (M(s) || s === 45)
581
+ return ht(e, r, s);
582
+ if (be(s))
583
+ return yt(e, r);
584
+ throw A(
585
+ e.source,
586
+ r,
587
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : $(s) || K(n, r) ? `Unexpected character: ${F(e, r)}.` : `Invalid character: ${F(e, r)}.`
574
588
  );
575
589
  }
576
- return h(r, a.EOF, i, i);
590
+ return v(e, a.EOF, i, i);
577
591
  }
578
- function He(r, e) {
579
- const t = r.source.body, i = t.length;
580
- let n = e + 1;
581
- for (; n < i; ) {
582
- const s = t.charCodeAt(n);
592
+ function pt(e, t) {
593
+ const n = e.source.body, i = n.length;
594
+ let r = t + 1;
595
+ for (; r < i; ) {
596
+ const s = n.charCodeAt(r);
583
597
  if (s === 10 || s === 13)
584
598
  break;
585
- if (D(s))
586
- ++n;
587
- else if ($(t, n))
588
- n += 2;
599
+ if ($(s))
600
+ ++r;
601
+ else if (K(n, r))
602
+ r += 2;
589
603
  else
590
604
  break;
591
605
  }
592
- return h(
593
- r,
594
- a.COMMENT,
606
+ return v(
595
607
  e,
596
- n,
597
- t.slice(e + 1, n)
608
+ a.COMMENT,
609
+ t,
610
+ r,
611
+ n.slice(t + 1, r)
598
612
  );
599
613
  }
600
- function Qe(r, e, t) {
601
- const i = r.source.body;
602
- let n = e, s = t, o = !1;
603
- if (s === 45 && (s = i.charCodeAt(++n)), s === 48) {
604
- if (s = i.charCodeAt(++n), S(s))
605
- throw g(
606
- r.source,
607
- n,
608
- `Invalid number, unexpected digit after 0: ${N(
609
- r,
610
- n
614
+ function ht(e, t, n) {
615
+ const i = e.source.body;
616
+ let r = t, s = n, o = !1;
617
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
618
+ if (s = i.charCodeAt(++r), M(s))
619
+ throw A(
620
+ e.source,
621
+ r,
622
+ `Invalid number, unexpected digit after 0: ${F(
623
+ e,
624
+ r
611
625
  )}.`
612
626
  );
613
627
  } else
614
- n = V(r, n, s), s = i.charCodeAt(n);
615
- if (s === 46 && (o = !0, s = i.charCodeAt(++n), n = V(r, n, s), s = i.charCodeAt(n)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++n), (s === 43 || s === 45) && (s = i.charCodeAt(++n)), n = V(r, n, s), s = i.charCodeAt(n)), s === 46 || ae(s))
616
- throw g(
617
- r.source,
618
- n,
619
- `Invalid number, expected digit but got: ${N(
620
- r,
621
- n
628
+ r = ee(e, r, s), s = i.charCodeAt(r);
629
+ if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = ee(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = ee(e, r, s), s = i.charCodeAt(r)), s === 46 || be(s))
630
+ throw A(
631
+ e.source,
632
+ r,
633
+ `Invalid number, expected digit but got: ${F(
634
+ e,
635
+ r
622
636
  )}.`
623
637
  );
624
- return h(
625
- r,
626
- o ? a.FLOAT : a.INT,
638
+ return v(
627
639
  e,
628
- n,
629
- i.slice(e, n)
640
+ o ? a.FLOAT : a.INT,
641
+ t,
642
+ r,
643
+ i.slice(t, r)
630
644
  );
631
645
  }
632
- function V(r, e, t) {
633
- if (!S(t))
634
- throw g(
635
- r.source,
636
- e,
637
- `Invalid number, expected digit but got: ${N(
638
- r,
639
- e
646
+ function ee(e, t, n) {
647
+ if (!M(n))
648
+ throw A(
649
+ e.source,
650
+ t,
651
+ `Invalid number, expected digit but got: ${F(
652
+ e,
653
+ t
640
654
  )}.`
641
655
  );
642
- const i = r.source.body;
643
- let n = e + 1;
644
- for (; S(i.charCodeAt(n)); )
645
- ++n;
646
- return n;
647
- }
648
- function Je(r, e) {
649
- const t = r.source.body, i = t.length;
650
- let n = e + 1, s = n, o = "";
651
- for (; n < i; ) {
652
- const u = t.charCodeAt(n);
656
+ const i = e.source.body;
657
+ let r = t + 1;
658
+ for (; M(i.charCodeAt(r)); )
659
+ ++r;
660
+ return r;
661
+ }
662
+ function ft(e, t) {
663
+ const n = e.source.body, i = n.length;
664
+ let r = t + 1, s = r, o = "";
665
+ for (; r < i; ) {
666
+ const u = n.charCodeAt(r);
653
667
  if (u === 34)
654
- return o += t.slice(s, n), h(r, a.STRING, e, n + 1, o);
668
+ return o += n.slice(s, r), v(e, a.STRING, t, r + 1, o);
655
669
  if (u === 92) {
656
- o += t.slice(s, n);
657
- const l = t.charCodeAt(n + 1) === 117 ? t.charCodeAt(n + 2) === 123 ? Xe(r, n) : Ke(r, n) : We(r, n);
658
- o += l.value, n += l.size, s = n;
670
+ o += n.slice(s, r);
671
+ const h = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? mt(e, r) : gt(e, r) : It(e, r);
672
+ o += h.value, r += h.size, s = r;
659
673
  continue;
660
674
  }
661
675
  if (u === 10 || u === 13)
662
676
  break;
663
- if (D(u))
664
- ++n;
665
- else if ($(t, n))
666
- n += 2;
677
+ if ($(u))
678
+ ++r;
679
+ else if (K(n, r))
680
+ r += 2;
667
681
  else
668
- throw g(
669
- r.source,
670
- n,
671
- `Invalid character within String: ${N(
672
- r,
673
- n
682
+ throw A(
683
+ e.source,
684
+ r,
685
+ `Invalid character within String: ${F(
686
+ e,
687
+ r
674
688
  )}.`
675
689
  );
676
690
  }
677
- throw g(r.source, n, "Unterminated string.");
691
+ throw A(e.source, r, "Unterminated string.");
678
692
  }
679
- function Xe(r, e) {
680
- const t = r.source.body;
681
- let i = 0, n = 3;
682
- for (; n < 12; ) {
683
- const s = t.charCodeAt(e + n++);
693
+ function mt(e, t) {
694
+ const n = e.source.body;
695
+ let i = 0, r = 3;
696
+ for (; r < 12; ) {
697
+ const s = n.charCodeAt(t + r++);
684
698
  if (s === 125) {
685
- if (n < 5 || !D(i))
699
+ if (r < 5 || !$(i))
686
700
  break;
687
701
  return {
688
702
  value: String.fromCodePoint(i),
689
- size: n
703
+ size: r
690
704
  };
691
705
  }
692
- if (i = i << 4 | P(s), i < 0)
706
+ if (i = i << 4 | V(s), i < 0)
693
707
  break;
694
708
  }
695
- throw g(
696
- r.source,
697
- e,
698
- `Invalid Unicode escape sequence: "${t.slice(
699
- e,
700
- e + n
709
+ throw A(
710
+ e.source,
711
+ t,
712
+ `Invalid Unicode escape sequence: "${n.slice(
713
+ t,
714
+ t + r
701
715
  )}".`
702
716
  );
703
717
  }
704
- function Ke(r, e) {
705
- const t = r.source.body, i = K(t, e + 2);
706
- if (D(i))
718
+ function gt(e, t) {
719
+ const n = e.source.body, i = me(n, t + 2);
720
+ if ($(i))
707
721
  return {
708
722
  value: String.fromCodePoint(i),
709
723
  size: 6
710
724
  };
711
- if (ce(i) && t.charCodeAt(e + 6) === 92 && t.charCodeAt(e + 7) === 117) {
712
- const n = K(t, e + 8);
713
- if (de(n))
725
+ if (Pe(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
726
+ const r = me(n, t + 8);
727
+ if (Se(r))
714
728
  return {
715
- value: String.fromCodePoint(i, n),
729
+ value: String.fromCodePoint(i, r),
716
730
  size: 12
717
731
  };
718
732
  }
719
- throw g(
720
- r.source,
721
- e,
722
- `Invalid Unicode escape sequence: "${t.slice(e, e + 6)}".`
733
+ throw A(
734
+ e.source,
735
+ t,
736
+ `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
723
737
  );
724
738
  }
725
- function K(r, e) {
726
- return P(r.charCodeAt(e)) << 12 | P(r.charCodeAt(e + 1)) << 8 | P(r.charCodeAt(e + 2)) << 4 | P(r.charCodeAt(e + 3));
739
+ function me(e, t) {
740
+ return V(e.charCodeAt(t)) << 12 | V(e.charCodeAt(t + 1)) << 8 | V(e.charCodeAt(t + 2)) << 4 | V(e.charCodeAt(t + 3));
727
741
  }
728
- function P(r) {
729
- return r >= 48 && r <= 57 ? r - 48 : r >= 65 && r <= 70 ? r - 55 : r >= 97 && r <= 102 ? r - 87 : -1;
742
+ function V(e) {
743
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
730
744
  }
731
- function We(r, e) {
732
- const t = r.source.body;
733
- switch (t.charCodeAt(e + 1)) {
745
+ function It(e, t) {
746
+ const n = e.source.body;
747
+ switch (n.charCodeAt(t + 1)) {
734
748
  case 34:
735
749
  return {
736
750
  value: '"',
@@ -773,152 +787,152 @@ function We(r, e) {
773
787
  size: 2
774
788
  };
775
789
  }
776
- throw g(
777
- r.source,
778
- e,
779
- `Invalid character escape sequence: "${t.slice(
780
- e,
781
- e + 2
790
+ throw A(
791
+ e.source,
792
+ t,
793
+ `Invalid character escape sequence: "${n.slice(
794
+ t,
795
+ t + 2
782
796
  )}".`
783
797
  );
784
798
  }
785
- function Ze(r, e) {
786
- const t = r.source.body, i = t.length;
787
- let n = r.lineStart, s = e + 3, o = s, u = "";
788
- const l = [];
799
+ function Et(e, t) {
800
+ const n = e.source.body, i = n.length;
801
+ let r = e.lineStart, s = t + 3, o = s, u = "";
802
+ const h = [];
789
803
  for (; s < i; ) {
790
- const f = t.charCodeAt(s);
791
- if (f === 34 && t.charCodeAt(s + 1) === 34 && t.charCodeAt(s + 2) === 34) {
792
- u += t.slice(o, s), l.push(u);
793
- const c = h(
794
- r,
795
- a.BLOCK_STRING,
804
+ const p = n.charCodeAt(s);
805
+ if (p === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
806
+ u += n.slice(o, s), h.push(u);
807
+ const c = v(
796
808
  e,
809
+ a.BLOCK_STRING,
810
+ t,
797
811
  s + 3,
798
812
  // Return a string of the lines joined with U+000A.
799
- ze(l).join(`
813
+ ot(h).join(`
800
814
  `)
801
815
  );
802
- return r.line += l.length - 1, r.lineStart = n, c;
816
+ return e.line += h.length - 1, e.lineStart = r, c;
803
817
  }
804
- if (f === 92 && t.charCodeAt(s + 1) === 34 && t.charCodeAt(s + 2) === 34 && t.charCodeAt(s + 3) === 34) {
805
- u += t.slice(o, s), o = s + 1, s += 4;
818
+ if (p === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
819
+ u += n.slice(o, s), o = s + 1, s += 4;
806
820
  continue;
807
821
  }
808
- if (f === 10 || f === 13) {
809
- u += t.slice(o, s), l.push(u), f === 13 && t.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, n = s;
822
+ if (p === 10 || p === 13) {
823
+ u += n.slice(o, s), h.push(u), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, r = s;
810
824
  continue;
811
825
  }
812
- if (D(f))
826
+ if ($(p))
813
827
  ++s;
814
- else if ($(t, s))
828
+ else if (K(n, s))
815
829
  s += 2;
816
830
  else
817
- throw g(
818
- r.source,
831
+ throw A(
832
+ e.source,
819
833
  s,
820
- `Invalid character within String: ${N(
821
- r,
834
+ `Invalid character within String: ${F(
835
+ e,
822
836
  s
823
837
  )}.`
824
838
  );
825
839
  }
826
- throw g(r.source, s, "Unterminated string.");
840
+ throw A(e.source, s, "Unterminated string.");
827
841
  }
828
- function et(r, e) {
829
- const t = r.source.body, i = t.length;
830
- let n = e + 1;
831
- for (; n < i; ) {
832
- const s = t.charCodeAt(n);
833
- if (Ve(s))
834
- ++n;
842
+ function yt(e, t) {
843
+ const n = e.source.body, i = n.length;
844
+ let r = t + 1;
845
+ for (; r < i; ) {
846
+ const s = n.charCodeAt(r);
847
+ if (st(s))
848
+ ++r;
835
849
  else
836
850
  break;
837
851
  }
838
- return h(
839
- r,
840
- a.NAME,
852
+ return v(
841
853
  e,
842
- n,
843
- t.slice(e, n)
854
+ a.NAME,
855
+ t,
856
+ r,
857
+ n.slice(t, r)
844
858
  );
845
859
  }
846
- const tt = 10, ue = 2;
847
- function le(r) {
848
- return U(r, []);
860
+ const vt = 10, Ce = 2;
861
+ function de(e) {
862
+ return W(e, []);
849
863
  }
850
- function U(r, e) {
851
- switch (typeof r) {
864
+ function W(e, t) {
865
+ switch (typeof e) {
852
866
  case "string":
853
- return JSON.stringify(r);
867
+ return JSON.stringify(e);
854
868
  case "function":
855
- return r.name ? `[function ${r.name}]` : "[function]";
869
+ return e.name ? `[function ${e.name}]` : "[function]";
856
870
  case "object":
857
- return rt(r, e);
871
+ return At(e, t);
858
872
  default:
859
- return String(r);
873
+ return String(e);
860
874
  }
861
875
  }
862
- function rt(r, e) {
863
- if (r === null)
876
+ function At(e, t) {
877
+ if (e === null)
864
878
  return "null";
865
- if (e.includes(r))
879
+ if (t.includes(e))
866
880
  return "[Circular]";
867
- const t = [...e, r];
868
- if (nt(r)) {
869
- const i = r.toJSON();
870
- if (i !== r)
871
- return typeof i == "string" ? i : U(i, t);
872
- } else if (Array.isArray(r))
873
- return st(r, t);
874
- return it(r, t);
875
- }
876
- function nt(r) {
877
- return typeof r.toJSON == "function";
878
- }
879
- function it(r, e) {
880
- const t = Object.entries(r);
881
- return t.length === 0 ? "{}" : e.length > ue ? "[" + ot(r) + "]" : "{ " + t.map(
882
- ([n, s]) => n + ": " + U(s, e)
881
+ const n = [...t, e];
882
+ if (Tt(e)) {
883
+ const i = e.toJSON();
884
+ if (i !== e)
885
+ return typeof i == "string" ? i : W(i, n);
886
+ } else if (Array.isArray(e))
887
+ return kt(e, n);
888
+ return Ot(e, n);
889
+ }
890
+ function Tt(e) {
891
+ return typeof e.toJSON == "function";
892
+ }
893
+ function Ot(e, t) {
894
+ const n = Object.entries(e);
895
+ return n.length === 0 ? "{}" : t.length > Ce ? "[" + Dt(e) + "]" : "{ " + n.map(
896
+ ([r, s]) => r + ": " + W(s, t)
883
897
  ).join(", ") + " }";
884
898
  }
885
- function st(r, e) {
886
- if (r.length === 0)
899
+ function kt(e, t) {
900
+ if (e.length === 0)
887
901
  return "[]";
888
- if (e.length > ue)
902
+ if (t.length > Ce)
889
903
  return "[Array]";
890
- const t = Math.min(tt, r.length), i = r.length - t, n = [];
891
- for (let s = 0; s < t; ++s)
892
- n.push(U(r[s], e));
893
- return i === 1 ? n.push("... 1 more item") : i > 1 && n.push(`... ${i} more items`), "[" + n.join(", ") + "]";
894
- }
895
- function ot(r) {
896
- const e = Object.prototype.toString.call(r).replace(/^\[object /, "").replace(/]$/, "");
897
- if (e === "Object" && typeof r.constructor == "function") {
898
- const t = r.constructor.name;
899
- if (typeof t == "string" && t !== "")
900
- return t;
901
- }
902
- return e;
903
- }
904
- const at = globalThis.process && // eslint-disable-next-line no-undef
905
- process.env.NODE_ENV === "production", ct = (
904
+ const n = Math.min(vt, e.length), i = e.length - n, r = [];
905
+ for (let s = 0; s < n; ++s)
906
+ r.push(W(e[s], t));
907
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
908
+ }
909
+ function Dt(e) {
910
+ const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
911
+ if (t === "Object" && typeof e.constructor == "function") {
912
+ const n = e.constructor.name;
913
+ if (typeof n == "string" && n !== "")
914
+ return n;
915
+ }
916
+ return t;
917
+ }
918
+ const xt = globalThis.process && // eslint-disable-next-line no-undef
919
+ process.env.NODE_ENV === "production", Nt = (
906
920
  /* c8 ignore next 6 */
907
921
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
908
- at ? function(e, t) {
909
- return e instanceof t;
910
- } : function(e, t) {
911
- if (e instanceof t)
922
+ xt ? function(t, n) {
923
+ return t instanceof n;
924
+ } : function(t, n) {
925
+ if (t instanceof n)
912
926
  return !0;
913
- if (typeof e == "object" && e !== null) {
927
+ if (typeof t == "object" && t !== null) {
914
928
  var i;
915
- const n = t.prototype[Symbol.toStringTag], s = (
929
+ const r = n.prototype[Symbol.toStringTag], s = (
916
930
  // We still need to support constructor's name to detect conflicts with older versions of this library.
917
- Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name
931
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
918
932
  );
919
- if (n === s) {
920
- const o = le(e);
921
- throw new Error(`Cannot use ${n} "${o}" from another module or realm.
933
+ if (r === s) {
934
+ const o = de(t);
935
+ throw new Error(`Cannot use ${r} "${o}" from another module or realm.
922
936
 
923
937
  Ensure that there is only one instance of "graphql" in the node_modules
924
938
  directory. If different versions of "graphql" are the dependencies of other
@@ -935,15 +949,15 @@ spurious results.`);
935
949
  return !1;
936
950
  }
937
951
  );
938
- class pe {
939
- constructor(e, t = "GraphQL request", i = {
952
+ class _e {
953
+ constructor(t, n = "GraphQL request", i = {
940
954
  line: 1,
941
955
  column: 1
942
956
  }) {
943
- typeof e == "string" || M(!1, `Body must be a string. Received: ${le(e)}.`), this.body = e, this.name = t, this.locationOffset = i, this.locationOffset.line > 0 || M(
957
+ typeof t == "string" || G(!1, `Body must be a string. Received: ${de(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || G(
944
958
  !1,
945
959
  "line in locationOffset is 1-indexed and must be positive."
946
- ), this.locationOffset.column > 0 || M(
960
+ ), this.locationOffset.column > 0 || G(
947
961
  !1,
948
962
  "column in locationOffset is 1-indexed and must be positive."
949
963
  );
@@ -952,26 +966,26 @@ class pe {
952
966
  return "Source";
953
967
  }
954
968
  }
955
- function dt(r) {
956
- return ct(r, pe);
969
+ function bt(e) {
970
+ return Nt(e, _e);
957
971
  }
958
- function ut(r, e) {
959
- const t = new lt(r, e), i = t.parseDocument();
972
+ function Pt(e, t) {
973
+ const n = new St(e, t), i = n.parseDocument();
960
974
  return Object.defineProperty(i, "tokenCount", {
961
975
  enumerable: !1,
962
- value: t.tokenCount
976
+ value: n.tokenCount
963
977
  }), i;
964
978
  }
965
- class lt {
966
- constructor(e, t = {}) {
967
- const { lexer: i, ...n } = t;
979
+ class St {
980
+ constructor(t, n = {}) {
981
+ const { lexer: i, ...r } = n;
968
982
  if (i)
969
983
  this._lexer = i;
970
984
  else {
971
- const s = dt(e) ? e : new pe(e);
972
- this._lexer = new Ge(s);
985
+ const s = bt(t) ? t : new _e(t);
986
+ this._lexer = new dt(s);
973
987
  }
974
- this._options = n, this._tokenCounter = 0;
988
+ this._options = r, this._tokenCounter = 0;
975
989
  }
976
990
  get tokenCount() {
977
991
  return this._tokenCounter;
@@ -980,10 +994,10 @@ class lt {
980
994
  * Converts a name lex token into a name parse node.
981
995
  */
982
996
  parseName() {
983
- const e = this.expectToken(a.NAME);
984
- return this.node(e, {
985
- kind: d.NAME,
986
- value: e.value
997
+ const t = this.expectToken(a.NAME);
998
+ return this.node(t, {
999
+ kind: l.NAME,
1000
+ value: t.value
987
1001
  });
988
1002
  }
989
1003
  // Implements the parsing rules in the Document section.
@@ -992,7 +1006,7 @@ class lt {
992
1006
  */
993
1007
  parseDocument() {
994
1008
  return this.node(this._lexer.token, {
995
- kind: d.DOCUMENT,
1009
+ kind: l.DOCUMENT,
996
1010
  definitions: this.many(
997
1011
  a.SOF,
998
1012
  this.parseDefinition,
@@ -1026,15 +1040,15 @@ class lt {
1026
1040
  parseDefinition() {
1027
1041
  if (this.peek(a.BRACE_L))
1028
1042
  return this.parseOperationDefinition();
1029
- const e = this.peekDescription(), t = e ? this._lexer.lookahead() : this._lexer.token;
1030
- if (e && t.kind === a.BRACE_L)
1031
- throw g(
1043
+ const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1044
+ if (t && n.kind === a.BRACE_L)
1045
+ throw A(
1032
1046
  this._lexer.source,
1033
1047
  this._lexer.token.start,
1034
1048
  "Unexpected description, descriptions are not supported on shorthand queries."
1035
1049
  );
1036
- if (t.kind === a.NAME) {
1037
- switch (t.value) {
1050
+ if (n.kind === a.NAME) {
1051
+ switch (n.value) {
1038
1052
  case "schema":
1039
1053
  return this.parseSchemaDefinition();
1040
1054
  case "scalar":
@@ -1052,7 +1066,7 @@ class lt {
1052
1066
  case "directive":
1053
1067
  return this.parseDirectiveDefinition();
1054
1068
  }
1055
- switch (t.value) {
1069
+ switch (n.value) {
1056
1070
  case "query":
1057
1071
  case "mutation":
1058
1072
  case "subscription":
@@ -1060,16 +1074,16 @@ class lt {
1060
1074
  case "fragment":
1061
1075
  return this.parseFragmentDefinition();
1062
1076
  }
1063
- if (e)
1064
- throw g(
1077
+ if (t)
1078
+ throw A(
1065
1079
  this._lexer.source,
1066
1080
  this._lexer.token.start,
1067
1081
  "Unexpected description, only GraphQL definitions support descriptions."
1068
1082
  );
1069
- if (t.value === "extend")
1083
+ if (n.value === "extend")
1070
1084
  return this.parseTypeSystemExtension();
1071
1085
  }
1072
- throw this.unexpected(t);
1086
+ throw this.unexpected(n);
1073
1087
  }
1074
1088
  // Implements the parsing rules in the Operations section.
1075
1089
  /**
@@ -1078,24 +1092,24 @@ class lt {
1078
1092
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1079
1093
  */
1080
1094
  parseOperationDefinition() {
1081
- const e = this._lexer.token;
1095
+ const t = this._lexer.token;
1082
1096
  if (this.peek(a.BRACE_L))
1083
- return this.node(e, {
1084
- kind: d.OPERATION_DEFINITION,
1085
- operation: x.QUERY,
1097
+ return this.node(t, {
1098
+ kind: l.OPERATION_DEFINITION,
1099
+ operation: w.QUERY,
1086
1100
  description: void 0,
1087
1101
  name: void 0,
1088
1102
  variableDefinitions: [],
1089
1103
  directives: [],
1090
1104
  selectionSet: this.parseSelectionSet()
1091
1105
  });
1092
- const t = this.parseDescription(), i = this.parseOperationType();
1093
- let n;
1094
- return this.peek(a.NAME) && (n = this.parseName()), this.node(e, {
1095
- kind: d.OPERATION_DEFINITION,
1106
+ const n = this.parseDescription(), i = this.parseOperationType();
1107
+ let r;
1108
+ return this.peek(a.NAME) && (r = this.parseName()), this.node(t, {
1109
+ kind: l.OPERATION_DEFINITION,
1096
1110
  operation: i,
1097
- description: t,
1098
- name: n,
1111
+ description: n,
1112
+ name: r,
1099
1113
  variableDefinitions: this.parseVariableDefinitions(),
1100
1114
  directives: this.parseDirectives(!1),
1101
1115
  selectionSet: this.parseSelectionSet()
@@ -1105,16 +1119,16 @@ class lt {
1105
1119
  * OperationType : one of query mutation subscription
1106
1120
  */
1107
1121
  parseOperationType() {
1108
- const e = this.expectToken(a.NAME);
1109
- switch (e.value) {
1122
+ const t = this.expectToken(a.NAME);
1123
+ switch (t.value) {
1110
1124
  case "query":
1111
- return x.QUERY;
1125
+ return w.QUERY;
1112
1126
  case "mutation":
1113
- return x.MUTATION;
1127
+ return w.MUTATION;
1114
1128
  case "subscription":
1115
- return x.SUBSCRIPTION;
1129
+ return w.SUBSCRIPTION;
1116
1130
  }
1117
- throw this.unexpected(e);
1131
+ throw this.unexpected(t);
1118
1132
  }
1119
1133
  /**
1120
1134
  * VariableDefinitions : ( VariableDefinition+ )
@@ -1131,7 +1145,7 @@ class lt {
1131
1145
  */
1132
1146
  parseVariableDefinition() {
1133
1147
  return this.node(this._lexer.token, {
1134
- kind: d.VARIABLE_DEFINITION,
1148
+ kind: l.VARIABLE_DEFINITION,
1135
1149
  description: this.parseDescription(),
1136
1150
  variable: this.parseVariable(),
1137
1151
  type: (this.expectToken(a.COLON), this.parseTypeReference()),
@@ -1143,9 +1157,9 @@ class lt {
1143
1157
  * Variable : $ Name
1144
1158
  */
1145
1159
  parseVariable() {
1146
- const e = this._lexer.token;
1147
- return this.expectToken(a.DOLLAR), this.node(e, {
1148
- kind: d.VARIABLE,
1160
+ const t = this._lexer.token;
1161
+ return this.expectToken(a.DOLLAR), this.node(t, {
1162
+ kind: l.VARIABLE,
1149
1163
  name: this.parseName()
1150
1164
  });
1151
1165
  }
@@ -1156,7 +1170,7 @@ class lt {
1156
1170
  */
1157
1171
  parseSelectionSet() {
1158
1172
  return this.node(this._lexer.token, {
1159
- kind: d.SELECTION_SET,
1173
+ kind: l.SELECTION_SET,
1160
1174
  selections: this.many(
1161
1175
  a.BRACE_L,
1162
1176
  this.parseSelection,
@@ -1179,12 +1193,12 @@ class lt {
1179
1193
  * Alias : Name :
1180
1194
  */
1181
1195
  parseField() {
1182
- const e = this._lexer.token, t = this.parseName();
1183
- let i, n;
1184
- return this.expectOptionalToken(a.COLON) ? (i = t, n = this.parseName()) : n = t, this.node(e, {
1185
- kind: d.FIELD,
1196
+ const t = this._lexer.token, n = this.parseName();
1197
+ let i, r;
1198
+ return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1199
+ kind: l.FIELD,
1186
1200
  alias: i,
1187
- name: n,
1201
+ name: r,
1188
1202
  arguments: this.parseArguments(!1),
1189
1203
  directives: this.parseDirectives(!1),
1190
1204
  selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
@@ -1193,19 +1207,19 @@ class lt {
1193
1207
  /**
1194
1208
  * Arguments[Const] : ( Argument[?Const]+ )
1195
1209
  */
1196
- parseArguments(e) {
1197
- const t = e ? this.parseConstArgument : this.parseArgument;
1198
- return this.optionalMany(a.PAREN_L, t, a.PAREN_R);
1210
+ parseArguments(t) {
1211
+ const n = t ? this.parseConstArgument : this.parseArgument;
1212
+ return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
1199
1213
  }
1200
1214
  /**
1201
1215
  * Argument[Const] : Name : Value[?Const]
1202
1216
  */
1203
- parseArgument(e = !1) {
1204
- const t = this._lexer.token, i = this.parseName();
1205
- return this.expectToken(a.COLON), this.node(t, {
1206
- kind: d.ARGUMENT,
1217
+ parseArgument(t = !1) {
1218
+ const n = this._lexer.token, i = this.parseName();
1219
+ return this.expectToken(a.COLON), this.node(n, {
1220
+ kind: l.ARGUMENT,
1207
1221
  name: i,
1208
- value: this.parseValueLiteral(e)
1222
+ value: this.parseValueLiteral(t)
1209
1223
  });
1210
1224
  }
1211
1225
  parseConstArgument() {
@@ -1220,16 +1234,16 @@ class lt {
1220
1234
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
1221
1235
  */
1222
1236
  parseFragment() {
1223
- const e = this._lexer.token;
1237
+ const t = this._lexer.token;
1224
1238
  this.expectToken(a.SPREAD);
1225
- const t = this.expectOptionalKeyword("on");
1226
- return !t && this.peek(a.NAME) ? this.node(e, {
1227
- kind: d.FRAGMENT_SPREAD,
1239
+ const n = this.expectOptionalKeyword("on");
1240
+ return !n && this.peek(a.NAME) ? this.node(t, {
1241
+ kind: l.FRAGMENT_SPREAD,
1228
1242
  name: this.parseFragmentName(),
1229
1243
  directives: this.parseDirectives(!1)
1230
- }) : this.node(e, {
1231
- kind: d.INLINE_FRAGMENT,
1232
- typeCondition: t ? this.parseNamedType() : void 0,
1244
+ }) : this.node(t, {
1245
+ kind: l.INLINE_FRAGMENT,
1246
+ typeCondition: n ? this.parseNamedType() : void 0,
1233
1247
  directives: this.parseDirectives(!1),
1234
1248
  selectionSet: this.parseSelectionSet()
1235
1249
  });
@@ -1241,18 +1255,18 @@ class lt {
1241
1255
  * TypeCondition : NamedType
1242
1256
  */
1243
1257
  parseFragmentDefinition() {
1244
- const e = this._lexer.token, t = this.parseDescription();
1245
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
1246
- kind: d.FRAGMENT_DEFINITION,
1247
- description: t,
1258
+ const t = this._lexer.token, n = this.parseDescription();
1259
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1260
+ kind: l.FRAGMENT_DEFINITION,
1261
+ description: n,
1248
1262
  name: this.parseFragmentName(),
1249
1263
  variableDefinitions: this.parseVariableDefinitions(),
1250
1264
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1251
1265
  directives: this.parseDirectives(!1),
1252
1266
  selectionSet: this.parseSelectionSet()
1253
- }) : this.node(e, {
1254
- kind: d.FRAGMENT_DEFINITION,
1255
- description: t,
1267
+ }) : this.node(t, {
1268
+ kind: l.FRAGMENT_DEFINITION,
1269
+ description: n,
1256
1270
  name: this.parseFragmentName(),
1257
1271
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1258
1272
  directives: this.parseDirectives(!1),
@@ -1286,59 +1300,59 @@ class lt {
1286
1300
  *
1287
1301
  * EnumValue : Name but not `true`, `false` or `null`
1288
1302
  */
1289
- parseValueLiteral(e) {
1290
- const t = this._lexer.token;
1291
- switch (t.kind) {
1303
+ parseValueLiteral(t) {
1304
+ const n = this._lexer.token;
1305
+ switch (n.kind) {
1292
1306
  case a.BRACKET_L:
1293
- return this.parseList(e);
1307
+ return this.parseList(t);
1294
1308
  case a.BRACE_L:
1295
- return this.parseObject(e);
1309
+ return this.parseObject(t);
1296
1310
  case a.INT:
1297
- return this.advanceLexer(), this.node(t, {
1298
- kind: d.INT,
1299
- value: t.value
1311
+ return this.advanceLexer(), this.node(n, {
1312
+ kind: l.INT,
1313
+ value: n.value
1300
1314
  });
1301
1315
  case a.FLOAT:
1302
- return this.advanceLexer(), this.node(t, {
1303
- kind: d.FLOAT,
1304
- value: t.value
1316
+ return this.advanceLexer(), this.node(n, {
1317
+ kind: l.FLOAT,
1318
+ value: n.value
1305
1319
  });
1306
1320
  case a.STRING:
1307
1321
  case a.BLOCK_STRING:
1308
1322
  return this.parseStringLiteral();
1309
1323
  case a.NAME:
1310
- switch (this.advanceLexer(), t.value) {
1324
+ switch (this.advanceLexer(), n.value) {
1311
1325
  case "true":
1312
- return this.node(t, {
1313
- kind: d.BOOLEAN,
1326
+ return this.node(n, {
1327
+ kind: l.BOOLEAN,
1314
1328
  value: !0
1315
1329
  });
1316
1330
  case "false":
1317
- return this.node(t, {
1318
- kind: d.BOOLEAN,
1331
+ return this.node(n, {
1332
+ kind: l.BOOLEAN,
1319
1333
  value: !1
1320
1334
  });
1321
1335
  case "null":
1322
- return this.node(t, {
1323
- kind: d.NULL
1336
+ return this.node(n, {
1337
+ kind: l.NULL
1324
1338
  });
1325
1339
  default:
1326
- return this.node(t, {
1327
- kind: d.ENUM,
1328
- value: t.value
1340
+ return this.node(n, {
1341
+ kind: l.ENUM,
1342
+ value: n.value
1329
1343
  });
1330
1344
  }
1331
1345
  case a.DOLLAR:
1332
- if (e)
1346
+ if (t)
1333
1347
  if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1334
1348
  const i = this._lexer.token.value;
1335
- throw g(
1349
+ throw A(
1336
1350
  this._lexer.source,
1337
- t.start,
1351
+ n.start,
1338
1352
  `Unexpected variable "$${i}" in constant value.`
1339
1353
  );
1340
1354
  } else
1341
- throw this.unexpected(t);
1355
+ throw this.unexpected(n);
1342
1356
  return this.parseVariable();
1343
1357
  default:
1344
1358
  throw this.unexpected();
@@ -1348,11 +1362,11 @@ class lt {
1348
1362
  return this.parseValueLiteral(!0);
1349
1363
  }
1350
1364
  parseStringLiteral() {
1351
- const e = this._lexer.token;
1352
- return this.advanceLexer(), this.node(e, {
1353
- kind: d.STRING,
1354
- value: e.value,
1355
- block: e.kind === a.BLOCK_STRING
1365
+ const t = this._lexer.token;
1366
+ return this.advanceLexer(), this.node(t, {
1367
+ kind: l.STRING,
1368
+ value: t.value,
1369
+ block: t.kind === a.BLOCK_STRING
1356
1370
  });
1357
1371
  }
1358
1372
  /**
@@ -1360,11 +1374,11 @@ class lt {
1360
1374
  * - [ ]
1361
1375
  * - [ Value[?Const]+ ]
1362
1376
  */
1363
- parseList(e) {
1364
- const t = () => this.parseValueLiteral(e);
1377
+ parseList(t) {
1378
+ const n = () => this.parseValueLiteral(t);
1365
1379
  return this.node(this._lexer.token, {
1366
- kind: d.LIST,
1367
- values: this.any(a.BRACKET_L, t, a.BRACKET_R)
1380
+ kind: l.LIST,
1381
+ values: this.any(a.BRACKET_L, n, a.BRACKET_R)
1368
1382
  });
1369
1383
  }
1370
1384
  /**
@@ -1374,33 +1388,33 @@ class lt {
1374
1388
  * - { ObjectField[?Const]+ }
1375
1389
  * ```
1376
1390
  */
1377
- parseObject(e) {
1378
- const t = () => this.parseObjectField(e);
1391
+ parseObject(t) {
1392
+ const n = () => this.parseObjectField(t);
1379
1393
  return this.node(this._lexer.token, {
1380
- kind: d.OBJECT,
1381
- fields: this.any(a.BRACE_L, t, a.BRACE_R)
1394
+ kind: l.OBJECT,
1395
+ fields: this.any(a.BRACE_L, n, a.BRACE_R)
1382
1396
  });
1383
1397
  }
1384
1398
  /**
1385
1399
  * ObjectField[Const] : Name : Value[?Const]
1386
1400
  */
1387
- parseObjectField(e) {
1388
- const t = this._lexer.token, i = this.parseName();
1389
- return this.expectToken(a.COLON), this.node(t, {
1390
- kind: d.OBJECT_FIELD,
1401
+ parseObjectField(t) {
1402
+ const n = this._lexer.token, i = this.parseName();
1403
+ return this.expectToken(a.COLON), this.node(n, {
1404
+ kind: l.OBJECT_FIELD,
1391
1405
  name: i,
1392
- value: this.parseValueLiteral(e)
1406
+ value: this.parseValueLiteral(t)
1393
1407
  });
1394
1408
  }
1395
1409
  // Implements the parsing rules in the Directives section.
1396
1410
  /**
1397
1411
  * Directives[Const] : Directive[?Const]+
1398
1412
  */
1399
- parseDirectives(e) {
1400
- const t = [];
1413
+ parseDirectives(t) {
1414
+ const n = [];
1401
1415
  for (; this.peek(a.AT); )
1402
- t.push(this.parseDirective(e));
1403
- return t;
1416
+ n.push(this.parseDirective(t));
1417
+ return n;
1404
1418
  }
1405
1419
  parseConstDirectives() {
1406
1420
  return this.parseDirectives(!0);
@@ -1410,12 +1424,12 @@ class lt {
1410
1424
  * Directive[Const] : @ Name Arguments[?Const]?
1411
1425
  * ```
1412
1426
  */
1413
- parseDirective(e) {
1414
- const t = this._lexer.token;
1415
- return this.expectToken(a.AT), this.node(t, {
1416
- kind: d.DIRECTIVE,
1427
+ parseDirective(t) {
1428
+ const n = this._lexer.token;
1429
+ return this.expectToken(a.AT), this.node(n, {
1430
+ kind: l.DIRECTIVE,
1417
1431
  name: this.parseName(),
1418
- arguments: this.parseArguments(e)
1432
+ arguments: this.parseArguments(t)
1419
1433
  });
1420
1434
  }
1421
1435
  // Implements the parsing rules in the Types section.
@@ -1426,27 +1440,27 @@ class lt {
1426
1440
  * - NonNullType
1427
1441
  */
1428
1442
  parseTypeReference() {
1429
- const e = this._lexer.token;
1430
- let t;
1443
+ const t = this._lexer.token;
1444
+ let n;
1431
1445
  if (this.expectOptionalToken(a.BRACKET_L)) {
1432
1446
  const i = this.parseTypeReference();
1433
- this.expectToken(a.BRACKET_R), t = this.node(e, {
1434
- kind: d.LIST_TYPE,
1447
+ this.expectToken(a.BRACKET_R), n = this.node(t, {
1448
+ kind: l.LIST_TYPE,
1435
1449
  type: i
1436
1450
  });
1437
1451
  } else
1438
- t = this.parseNamedType();
1439
- return this.expectOptionalToken(a.BANG) ? this.node(e, {
1440
- kind: d.NON_NULL_TYPE,
1441
- type: t
1442
- }) : t;
1452
+ n = this.parseNamedType();
1453
+ return this.expectOptionalToken(a.BANG) ? this.node(t, {
1454
+ kind: l.NON_NULL_TYPE,
1455
+ type: n
1456
+ }) : n;
1443
1457
  }
1444
1458
  /**
1445
1459
  * NamedType : Name
1446
1460
  */
1447
1461
  parseNamedType() {
1448
1462
  return this.node(this._lexer.token, {
1449
- kind: d.NAMED_TYPE,
1463
+ kind: l.NAMED_TYPE,
1450
1464
  name: this.parseName()
1451
1465
  });
1452
1466
  }
@@ -1467,30 +1481,30 @@ class lt {
1467
1481
  * ```
1468
1482
  */
1469
1483
  parseSchemaDefinition() {
1470
- const e = this._lexer.token, t = this.parseDescription();
1484
+ const t = this._lexer.token, n = this.parseDescription();
1471
1485
  this.expectKeyword("schema");
1472
- const i = this.parseConstDirectives(), n = this.many(
1486
+ const i = this.parseConstDirectives(), r = this.many(
1473
1487
  a.BRACE_L,
1474
1488
  this.parseOperationTypeDefinition,
1475
1489
  a.BRACE_R
1476
1490
  );
1477
- return this.node(e, {
1478
- kind: d.SCHEMA_DEFINITION,
1479
- description: t,
1491
+ return this.node(t, {
1492
+ kind: l.SCHEMA_DEFINITION,
1493
+ description: n,
1480
1494
  directives: i,
1481
- operationTypes: n
1495
+ operationTypes: r
1482
1496
  });
1483
1497
  }
1484
1498
  /**
1485
1499
  * OperationTypeDefinition : OperationType : NamedType
1486
1500
  */
1487
1501
  parseOperationTypeDefinition() {
1488
- const e = this._lexer.token, t = this.parseOperationType();
1502
+ const t = this._lexer.token, n = this.parseOperationType();
1489
1503
  this.expectToken(a.COLON);
1490
1504
  const i = this.parseNamedType();
1491
- return this.node(e, {
1492
- kind: d.OPERATION_TYPE_DEFINITION,
1493
- operation: t,
1505
+ return this.node(t, {
1506
+ kind: l.OPERATION_TYPE_DEFINITION,
1507
+ operation: n,
1494
1508
  type: i
1495
1509
  });
1496
1510
  }
@@ -1498,14 +1512,14 @@ class lt {
1498
1512
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1499
1513
  */
1500
1514
  parseScalarTypeDefinition() {
1501
- const e = this._lexer.token, t = this.parseDescription();
1515
+ const t = this._lexer.token, n = this.parseDescription();
1502
1516
  this.expectKeyword("scalar");
1503
- const i = this.parseName(), n = this.parseConstDirectives();
1504
- return this.node(e, {
1505
- kind: d.SCALAR_TYPE_DEFINITION,
1506
- description: t,
1517
+ const i = this.parseName(), r = this.parseConstDirectives();
1518
+ return this.node(t, {
1519
+ kind: l.SCALAR_TYPE_DEFINITION,
1520
+ description: n,
1507
1521
  name: i,
1508
- directives: n
1522
+ directives: r
1509
1523
  });
1510
1524
  }
1511
1525
  /**
@@ -1514,14 +1528,14 @@ class lt {
1514
1528
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1515
1529
  */
1516
1530
  parseObjectTypeDefinition() {
1517
- const e = this._lexer.token, t = this.parseDescription();
1531
+ const t = this._lexer.token, n = this.parseDescription();
1518
1532
  this.expectKeyword("type");
1519
- const i = this.parseName(), n = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1520
- return this.node(e, {
1521
- kind: d.OBJECT_TYPE_DEFINITION,
1522
- description: t,
1533
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1534
+ return this.node(t, {
1535
+ kind: l.OBJECT_TYPE_DEFINITION,
1536
+ description: n,
1523
1537
  name: i,
1524
- interfaces: n,
1538
+ interfaces: r,
1525
1539
  directives: s,
1526
1540
  fields: o
1527
1541
  });
@@ -1551,14 +1565,14 @@ class lt {
1551
1565
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1552
1566
  */
1553
1567
  parseFieldDefinition() {
1554
- const e = this._lexer.token, t = this.parseDescription(), i = this.parseName(), n = this.parseArgumentDefs();
1568
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1555
1569
  this.expectToken(a.COLON);
1556
1570
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1557
- return this.node(e, {
1558
- kind: d.FIELD_DEFINITION,
1559
- description: t,
1571
+ return this.node(t, {
1572
+ kind: l.FIELD_DEFINITION,
1573
+ description: n,
1560
1574
  name: i,
1561
- arguments: n,
1575
+ arguments: r,
1562
1576
  type: s,
1563
1577
  directives: o
1564
1578
  });
@@ -1578,17 +1592,17 @@ class lt {
1578
1592
  * - Description? Name : Type DefaultValue? Directives[Const]?
1579
1593
  */
1580
1594
  parseInputValueDef() {
1581
- const e = this._lexer.token, t = this.parseDescription(), i = this.parseName();
1595
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1582
1596
  this.expectToken(a.COLON);
1583
- const n = this.parseTypeReference();
1597
+ const r = this.parseTypeReference();
1584
1598
  let s;
1585
1599
  this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1586
1600
  const o = this.parseConstDirectives();
1587
- return this.node(e, {
1588
- kind: d.INPUT_VALUE_DEFINITION,
1589
- description: t,
1601
+ return this.node(t, {
1602
+ kind: l.INPUT_VALUE_DEFINITION,
1603
+ description: n,
1590
1604
  name: i,
1591
- type: n,
1605
+ type: r,
1592
1606
  defaultValue: s,
1593
1607
  directives: o
1594
1608
  });
@@ -1598,14 +1612,14 @@ class lt {
1598
1612
  * - Description? interface Name Directives[Const]? FieldsDefinition?
1599
1613
  */
1600
1614
  parseInterfaceTypeDefinition() {
1601
- const e = this._lexer.token, t = this.parseDescription();
1615
+ const t = this._lexer.token, n = this.parseDescription();
1602
1616
  this.expectKeyword("interface");
1603
- const i = this.parseName(), n = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1604
- return this.node(e, {
1605
- kind: d.INTERFACE_TYPE_DEFINITION,
1606
- description: t,
1617
+ const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1618
+ return this.node(t, {
1619
+ kind: l.INTERFACE_TYPE_DEFINITION,
1620
+ description: n,
1607
1621
  name: i,
1608
- interfaces: n,
1622
+ interfaces: r,
1609
1623
  directives: s,
1610
1624
  fields: o
1611
1625
  });
@@ -1615,14 +1629,14 @@ class lt {
1615
1629
  * - Description? union Name Directives[Const]? UnionMemberTypes?
1616
1630
  */
1617
1631
  parseUnionTypeDefinition() {
1618
- const e = this._lexer.token, t = this.parseDescription();
1632
+ const t = this._lexer.token, n = this.parseDescription();
1619
1633
  this.expectKeyword("union");
1620
- const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1621
- return this.node(e, {
1622
- kind: d.UNION_TYPE_DEFINITION,
1623
- description: t,
1634
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1635
+ return this.node(t, {
1636
+ kind: l.UNION_TYPE_DEFINITION,
1637
+ description: n,
1624
1638
  name: i,
1625
- directives: n,
1639
+ directives: r,
1626
1640
  types: s
1627
1641
  });
1628
1642
  }
@@ -1639,14 +1653,14 @@ class lt {
1639
1653
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1640
1654
  */
1641
1655
  parseEnumTypeDefinition() {
1642
- const e = this._lexer.token, t = this.parseDescription();
1656
+ const t = this._lexer.token, n = this.parseDescription();
1643
1657
  this.expectKeyword("enum");
1644
- const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1645
- return this.node(e, {
1646
- kind: d.ENUM_TYPE_DEFINITION,
1647
- description: t,
1658
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1659
+ return this.node(t, {
1660
+ kind: l.ENUM_TYPE_DEFINITION,
1661
+ description: n,
1648
1662
  name: i,
1649
- directives: n,
1663
+ directives: r,
1650
1664
  values: s
1651
1665
  });
1652
1666
  }
@@ -1666,12 +1680,12 @@ class lt {
1666
1680
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1667
1681
  */
1668
1682
  parseEnumValueDefinition() {
1669
- const e = this._lexer.token, t = this.parseDescription(), i = this.parseEnumValueName(), n = this.parseConstDirectives();
1670
- return this.node(e, {
1671
- kind: d.ENUM_VALUE_DEFINITION,
1672
- description: t,
1683
+ const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1684
+ return this.node(t, {
1685
+ kind: l.ENUM_VALUE_DEFINITION,
1686
+ description: n,
1673
1687
  name: i,
1674
- directives: n
1688
+ directives: r
1675
1689
  });
1676
1690
  }
1677
1691
  /**
@@ -1679,10 +1693,10 @@ class lt {
1679
1693
  */
1680
1694
  parseEnumValueName() {
1681
1695
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1682
- throw g(
1696
+ throw A(
1683
1697
  this._lexer.source,
1684
1698
  this._lexer.token.start,
1685
- `${_(
1699
+ `${z(
1686
1700
  this._lexer.token
1687
1701
  )} is reserved and cannot be used for an enum value.`
1688
1702
  );
@@ -1693,14 +1707,14 @@ class lt {
1693
1707
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
1694
1708
  */
1695
1709
  parseInputObjectTypeDefinition() {
1696
- const e = this._lexer.token, t = this.parseDescription();
1710
+ const t = this._lexer.token, n = this.parseDescription();
1697
1711
  this.expectKeyword("input");
1698
- const i = this.parseName(), n = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1699
- return this.node(e, {
1700
- kind: d.INPUT_OBJECT_TYPE_DEFINITION,
1701
- description: t,
1712
+ const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1713
+ return this.node(t, {
1714
+ kind: l.INPUT_OBJECT_TYPE_DEFINITION,
1715
+ description: n,
1702
1716
  name: i,
1703
- directives: n,
1717
+ directives: r,
1704
1718
  fields: s
1705
1719
  });
1706
1720
  }
@@ -1730,9 +1744,9 @@ class lt {
1730
1744
  * - InputObjectTypeDefinition
1731
1745
  */
1732
1746
  parseTypeSystemExtension() {
1733
- const e = this._lexer.lookahead();
1734
- if (e.kind === a.NAME)
1735
- switch (e.value) {
1747
+ const t = this._lexer.lookahead();
1748
+ if (t.kind === a.NAME)
1749
+ switch (t.value) {
1736
1750
  case "schema":
1737
1751
  return this.parseSchemaExtension();
1738
1752
  case "scalar":
@@ -1748,7 +1762,7 @@ class lt {
1748
1762
  case "input":
1749
1763
  return this.parseInputObjectTypeExtension();
1750
1764
  }
1751
- throw this.unexpected(e);
1765
+ throw this.unexpected(t);
1752
1766
  }
1753
1767
  /**
1754
1768
  * ```
@@ -1758,18 +1772,18 @@ class lt {
1758
1772
  * ```
1759
1773
  */
1760
1774
  parseSchemaExtension() {
1761
- const e = this._lexer.token;
1775
+ const t = this._lexer.token;
1762
1776
  this.expectKeyword("extend"), this.expectKeyword("schema");
1763
- const t = this.parseConstDirectives(), i = this.optionalMany(
1777
+ const n = this.parseConstDirectives(), i = this.optionalMany(
1764
1778
  a.BRACE_L,
1765
1779
  this.parseOperationTypeDefinition,
1766
1780
  a.BRACE_R
1767
1781
  );
1768
- if (t.length === 0 && i.length === 0)
1782
+ if (n.length === 0 && i.length === 0)
1769
1783
  throw this.unexpected();
1770
- return this.node(e, {
1771
- kind: d.SCHEMA_EXTENSION,
1772
- directives: t,
1784
+ return this.node(t, {
1785
+ kind: l.SCHEMA_EXTENSION,
1786
+ directives: n,
1773
1787
  operationTypes: i
1774
1788
  });
1775
1789
  }
@@ -1778,14 +1792,14 @@ class lt {
1778
1792
  * - extend scalar Name Directives[Const]
1779
1793
  */
1780
1794
  parseScalarTypeExtension() {
1781
- const e = this._lexer.token;
1795
+ const t = this._lexer.token;
1782
1796
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1783
- const t = this.parseName(), i = this.parseConstDirectives();
1797
+ const n = this.parseName(), i = this.parseConstDirectives();
1784
1798
  if (i.length === 0)
1785
1799
  throw this.unexpected();
1786
- return this.node(e, {
1787
- kind: d.SCALAR_TYPE_EXTENSION,
1788
- name: t,
1800
+ return this.node(t, {
1801
+ kind: l.SCALAR_TYPE_EXTENSION,
1802
+ name: n,
1789
1803
  directives: i
1790
1804
  });
1791
1805
  }
@@ -1796,16 +1810,16 @@ class lt {
1796
1810
  * - extend type Name ImplementsInterfaces
1797
1811
  */
1798
1812
  parseObjectTypeExtension() {
1799
- const e = this._lexer.token;
1813
+ const t = this._lexer.token;
1800
1814
  this.expectKeyword("extend"), this.expectKeyword("type");
1801
- const t = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1802
- if (i.length === 0 && n.length === 0 && s.length === 0)
1815
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1816
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1803
1817
  throw this.unexpected();
1804
- return this.node(e, {
1805
- kind: d.OBJECT_TYPE_EXTENSION,
1806
- name: t,
1818
+ return this.node(t, {
1819
+ kind: l.OBJECT_TYPE_EXTENSION,
1820
+ name: n,
1807
1821
  interfaces: i,
1808
- directives: n,
1822
+ directives: r,
1809
1823
  fields: s
1810
1824
  });
1811
1825
  }
@@ -1816,16 +1830,16 @@ class lt {
1816
1830
  * - extend interface Name ImplementsInterfaces
1817
1831
  */
1818
1832
  parseInterfaceTypeExtension() {
1819
- const e = this._lexer.token;
1833
+ const t = this._lexer.token;
1820
1834
  this.expectKeyword("extend"), this.expectKeyword("interface");
1821
- const t = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1822
- if (i.length === 0 && n.length === 0 && s.length === 0)
1835
+ const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1836
+ if (i.length === 0 && r.length === 0 && s.length === 0)
1823
1837
  throw this.unexpected();
1824
- return this.node(e, {
1825
- kind: d.INTERFACE_TYPE_EXTENSION,
1826
- name: t,
1838
+ return this.node(t, {
1839
+ kind: l.INTERFACE_TYPE_EXTENSION,
1840
+ name: n,
1827
1841
  interfaces: i,
1828
- directives: n,
1842
+ directives: r,
1829
1843
  fields: s
1830
1844
  });
1831
1845
  }
@@ -1835,16 +1849,16 @@ class lt {
1835
1849
  * - extend union Name Directives[Const]
1836
1850
  */
1837
1851
  parseUnionTypeExtension() {
1838
- const e = this._lexer.token;
1852
+ const t = this._lexer.token;
1839
1853
  this.expectKeyword("extend"), this.expectKeyword("union");
1840
- const t = this.parseName(), i = this.parseConstDirectives(), n = this.parseUnionMemberTypes();
1841
- if (i.length === 0 && n.length === 0)
1854
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1855
+ if (i.length === 0 && r.length === 0)
1842
1856
  throw this.unexpected();
1843
- return this.node(e, {
1844
- kind: d.UNION_TYPE_EXTENSION,
1845
- name: t,
1857
+ return this.node(t, {
1858
+ kind: l.UNION_TYPE_EXTENSION,
1859
+ name: n,
1846
1860
  directives: i,
1847
- types: n
1861
+ types: r
1848
1862
  });
1849
1863
  }
1850
1864
  /**
@@ -1853,16 +1867,16 @@ class lt {
1853
1867
  * - extend enum Name Directives[Const]
1854
1868
  */
1855
1869
  parseEnumTypeExtension() {
1856
- const e = this._lexer.token;
1870
+ const t = this._lexer.token;
1857
1871
  this.expectKeyword("extend"), this.expectKeyword("enum");
1858
- const t = this.parseName(), i = this.parseConstDirectives(), n = this.parseEnumValuesDefinition();
1859
- if (i.length === 0 && n.length === 0)
1872
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1873
+ if (i.length === 0 && r.length === 0)
1860
1874
  throw this.unexpected();
1861
- return this.node(e, {
1862
- kind: d.ENUM_TYPE_EXTENSION,
1863
- name: t,
1875
+ return this.node(t, {
1876
+ kind: l.ENUM_TYPE_EXTENSION,
1877
+ name: n,
1864
1878
  directives: i,
1865
- values: n
1879
+ values: r
1866
1880
  });
1867
1881
  }
1868
1882
  /**
@@ -1871,16 +1885,16 @@ class lt {
1871
1885
  * - extend input Name Directives[Const]
1872
1886
  */
1873
1887
  parseInputObjectTypeExtension() {
1874
- const e = this._lexer.token;
1888
+ const t = this._lexer.token;
1875
1889
  this.expectKeyword("extend"), this.expectKeyword("input");
1876
- const t = this.parseName(), i = this.parseConstDirectives(), n = this.parseInputFieldsDefinition();
1877
- if (i.length === 0 && n.length === 0)
1890
+ const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1891
+ if (i.length === 0 && r.length === 0)
1878
1892
  throw this.unexpected();
1879
- return this.node(e, {
1880
- kind: d.INPUT_OBJECT_TYPE_EXTENSION,
1881
- name: t,
1893
+ return this.node(t, {
1894
+ kind: l.INPUT_OBJECT_TYPE_EXTENSION,
1895
+ name: n,
1882
1896
  directives: i,
1883
- fields: n
1897
+ fields: r
1884
1898
  });
1885
1899
  }
1886
1900
  /**
@@ -1890,16 +1904,16 @@ class lt {
1890
1904
  * ```
1891
1905
  */
1892
1906
  parseDirectiveDefinition() {
1893
- const e = this._lexer.token, t = this.parseDescription();
1907
+ const t = this._lexer.token, n = this.parseDescription();
1894
1908
  this.expectKeyword("directive"), this.expectToken(a.AT);
1895
- const i = this.parseName(), n = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1909
+ const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1896
1910
  this.expectKeyword("on");
1897
1911
  const o = this.parseDirectiveLocations();
1898
- return this.node(e, {
1899
- kind: d.DIRECTIVE_DEFINITION,
1900
- description: t,
1912
+ return this.node(t, {
1913
+ kind: l.DIRECTIVE_DEFINITION,
1914
+ description: n,
1901
1915
  name: i,
1902
- arguments: n,
1916
+ arguments: r,
1903
1917
  repeatable: s,
1904
1918
  locations: o
1905
1919
  });
@@ -1940,10 +1954,10 @@ class lt {
1940
1954
  * `INPUT_FIELD_DEFINITION`
1941
1955
  */
1942
1956
  parseDirectiveLocation() {
1943
- const e = this._lexer.token, t = this.parseName();
1944
- if (Object.prototype.hasOwnProperty.call(q, t.value))
1945
- return t;
1946
- throw this.unexpected(e);
1957
+ const t = this._lexer.token, n = this.parseName();
1958
+ if (Object.prototype.hasOwnProperty.call(ie, n.value))
1959
+ return n;
1960
+ throw this.unexpected(t);
1947
1961
  }
1948
1962
  // Schema Coordinates
1949
1963
  /**
@@ -1955,28 +1969,28 @@ class lt {
1955
1969
  * - \@ Name ( Name : )
1956
1970
  */
1957
1971
  parseSchemaCoordinate() {
1958
- const e = this._lexer.token, t = this.expectOptionalToken(a.AT), i = this.parseName();
1959
- let n;
1960
- !t && this.expectOptionalToken(a.DOT) && (n = this.parseName());
1972
+ const t = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
1973
+ let r;
1974
+ !n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1961
1975
  let s;
1962
- return (t || n) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), t ? s ? this.node(e, {
1963
- kind: d.DIRECTIVE_ARGUMENT_COORDINATE,
1976
+ return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
1977
+ kind: l.DIRECTIVE_ARGUMENT_COORDINATE,
1964
1978
  name: i,
1965
1979
  argumentName: s
1966
- }) : this.node(e, {
1967
- kind: d.DIRECTIVE_COORDINATE,
1980
+ }) : this.node(t, {
1981
+ kind: l.DIRECTIVE_COORDINATE,
1968
1982
  name: i
1969
- }) : n ? s ? this.node(e, {
1970
- kind: d.ARGUMENT_COORDINATE,
1983
+ }) : r ? s ? this.node(t, {
1984
+ kind: l.ARGUMENT_COORDINATE,
1971
1985
  name: i,
1972
- fieldName: n,
1986
+ fieldName: r,
1973
1987
  argumentName: s
1974
- }) : this.node(e, {
1975
- kind: d.MEMBER_COORDINATE,
1988
+ }) : this.node(t, {
1989
+ kind: l.MEMBER_COORDINATE,
1976
1990
  name: i,
1977
- memberName: n
1978
- }) : this.node(e, {
1979
- kind: d.TYPE_COORDINATE,
1991
+ memberName: r
1992
+ }) : this.node(t, {
1993
+ kind: l.TYPE_COORDINATE,
1980
1994
  name: i
1981
1995
  });
1982
1996
  }
@@ -1986,72 +2000,72 @@ class lt {
1986
2000
  * location object, used to identify the place in the source that created a
1987
2001
  * given parsed object.
1988
2002
  */
1989
- node(e, t) {
1990
- return this._options.noLocation !== !0 && (t.loc = new $e(
1991
- e,
2003
+ node(t, n) {
2004
+ return this._options.noLocation !== !0 && (n.loc = new rt(
2005
+ t,
1992
2006
  this._lexer.lastToken,
1993
2007
  this._lexer.source
1994
- )), t;
2008
+ )), n;
1995
2009
  }
1996
2010
  /**
1997
2011
  * Determines if the next token is of a given kind
1998
2012
  */
1999
- peek(e) {
2000
- return this._lexer.token.kind === e;
2013
+ peek(t) {
2014
+ return this._lexer.token.kind === t;
2001
2015
  }
2002
2016
  /**
2003
2017
  * If the next token is of the given kind, return that token after advancing the lexer.
2004
2018
  * Otherwise, do not change the parser state and throw an error.
2005
2019
  */
2006
- expectToken(e) {
2007
- const t = this._lexer.token;
2008
- if (t.kind === e)
2009
- return this.advanceLexer(), t;
2010
- throw g(
2020
+ expectToken(t) {
2021
+ const n = this._lexer.token;
2022
+ if (n.kind === t)
2023
+ return this.advanceLexer(), n;
2024
+ throw A(
2011
2025
  this._lexer.source,
2012
- t.start,
2013
- `Expected ${he(e)}, found ${_(t)}.`
2026
+ n.start,
2027
+ `Expected ${Le(t)}, found ${z(n)}.`
2014
2028
  );
2015
2029
  }
2016
2030
  /**
2017
2031
  * If the next token is of the given kind, return "true" after advancing the lexer.
2018
2032
  * Otherwise, do not change the parser state and return "false".
2019
2033
  */
2020
- expectOptionalToken(e) {
2021
- return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
2034
+ expectOptionalToken(t) {
2035
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
2022
2036
  }
2023
2037
  /**
2024
2038
  * If the next token is a given keyword, advance the lexer.
2025
2039
  * Otherwise, do not change the parser state and throw an error.
2026
2040
  */
2027
- expectKeyword(e) {
2028
- const t = this._lexer.token;
2029
- if (t.kind === a.NAME && t.value === e)
2041
+ expectKeyword(t) {
2042
+ const n = this._lexer.token;
2043
+ if (n.kind === a.NAME && n.value === t)
2030
2044
  this.advanceLexer();
2031
2045
  else
2032
- throw g(
2046
+ throw A(
2033
2047
  this._lexer.source,
2034
- t.start,
2035
- `Expected "${e}", found ${_(t)}.`
2048
+ n.start,
2049
+ `Expected "${t}", found ${z(n)}.`
2036
2050
  );
2037
2051
  }
2038
2052
  /**
2039
2053
  * If the next token is a given keyword, return "true" after advancing the lexer.
2040
2054
  * Otherwise, do not change the parser state and return "false".
2041
2055
  */
2042
- expectOptionalKeyword(e) {
2043
- const t = this._lexer.token;
2044
- return t.kind === a.NAME && t.value === e ? (this.advanceLexer(), !0) : !1;
2056
+ expectOptionalKeyword(t) {
2057
+ const n = this._lexer.token;
2058
+ return n.kind === a.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
2045
2059
  }
2046
2060
  /**
2047
2061
  * Helper function for creating an error when an unexpected lexed token is encountered.
2048
2062
  */
2049
- unexpected(e) {
2050
- const t = e ?? this._lexer.token;
2051
- return g(
2063
+ unexpected(t) {
2064
+ const n = t ?? this._lexer.token;
2065
+ return A(
2052
2066
  this._lexer.source,
2053
- t.start,
2054
- `Unexpected ${_(t)}.`
2067
+ n.start,
2068
+ `Unexpected ${z(n)}.`
2055
2069
  );
2056
2070
  }
2057
2071
  /**
@@ -2059,12 +2073,12 @@ class lt {
2059
2073
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2060
2074
  * Advances the parser to the next lex token after the closing token.
2061
2075
  */
2062
- any(e, t, i) {
2063
- this.expectToken(e);
2064
- const n = [];
2076
+ any(t, n, i) {
2077
+ this.expectToken(t);
2078
+ const r = [];
2065
2079
  for (; !this.expectOptionalToken(i); )
2066
- n.push(t.call(this));
2067
- return n;
2080
+ r.push(n.call(this));
2081
+ return r;
2068
2082
  }
2069
2083
  /**
2070
2084
  * Returns a list of parse nodes, determined by the parseFn.
@@ -2072,13 +2086,13 @@ class lt {
2072
2086
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2073
2087
  * Advances the parser to the next lex token after the closing token.
2074
2088
  */
2075
- optionalMany(e, t, i) {
2076
- if (this.expectOptionalToken(e)) {
2077
- const n = [];
2089
+ optionalMany(t, n, i) {
2090
+ if (this.expectOptionalToken(t)) {
2091
+ const r = [];
2078
2092
  do
2079
- n.push(t.call(this));
2093
+ r.push(n.call(this));
2080
2094
  while (!this.expectOptionalToken(i));
2081
- return n;
2095
+ return r;
2082
2096
  }
2083
2097
  return [];
2084
2098
  }
@@ -2087,121 +2101,659 @@ class lt {
2087
2101
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2088
2102
  * Advances the parser to the next lex token after the closing token.
2089
2103
  */
2090
- many(e, t, i) {
2091
- this.expectToken(e);
2092
- const n = [];
2104
+ many(t, n, i) {
2105
+ this.expectToken(t);
2106
+ const r = [];
2093
2107
  do
2094
- n.push(t.call(this));
2108
+ r.push(n.call(this));
2095
2109
  while (!this.expectOptionalToken(i));
2096
- return n;
2110
+ return r;
2097
2111
  }
2098
2112
  /**
2099
2113
  * Returns a non-empty list of parse nodes, determined by the parseFn.
2100
2114
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2101
2115
  * Advances the parser to the next lex token after last item in the list.
2102
2116
  */
2103
- delimitedMany(e, t) {
2104
- this.expectOptionalToken(e);
2117
+ delimitedMany(t, n) {
2118
+ this.expectOptionalToken(t);
2105
2119
  const i = [];
2106
2120
  do
2107
- i.push(t.call(this));
2108
- while (this.expectOptionalToken(e));
2121
+ i.push(n.call(this));
2122
+ while (this.expectOptionalToken(t));
2109
2123
  return i;
2110
2124
  }
2111
2125
  advanceLexer() {
2112
- const { maxTokens: e } = this._options, t = this._lexer.advance();
2113
- if (t.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
2114
- throw g(
2126
+ const { maxTokens: t } = this._options, n = this._lexer.advance();
2127
+ if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2128
+ throw A(
2115
2129
  this._lexer.source,
2116
- t.start,
2117
- `Document contains more that ${e} tokens. Parsing aborted.`
2130
+ n.start,
2131
+ `Document contains more that ${t} tokens. Parsing aborted.`
2118
2132
  );
2119
2133
  }
2120
2134
  }
2121
- function _(r) {
2122
- const e = r.value;
2123
- return he(r.kind) + (e != null ? ` "${e}"` : "");
2135
+ function z(e) {
2136
+ const t = e.value;
2137
+ return Le(e.kind) + (t != null ? ` "${t}"` : "");
2124
2138
  }
2125
- function he(r) {
2126
- return je(r) ? `"${r}"` : r;
2139
+ function Le(e) {
2140
+ return ut(e) ? `"${e}"` : e;
2127
2141
  }
2128
- var R = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), me = !0, w = !1;
2129
- function ge(r) {
2130
- return r.replace(/[\s,]+/g, " ").trim();
2142
+ function Ct(e) {
2143
+ return `"${e.replace(_t, Lt)}"`;
2131
2144
  }
2132
- function pt(r) {
2133
- return ge(r.source.body.substring(r.start, r.end));
2145
+ const _t = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2146
+ function Lt(e) {
2147
+ return Rt[e.charCodeAt(0)];
2134
2148
  }
2135
- function ht(r) {
2136
- var e = /* @__PURE__ */ new Set(), t = [];
2137
- return r.definitions.forEach(function(i) {
2149
+ const Rt = [
2150
+ "\\u0000",
2151
+ "\\u0001",
2152
+ "\\u0002",
2153
+ "\\u0003",
2154
+ "\\u0004",
2155
+ "\\u0005",
2156
+ "\\u0006",
2157
+ "\\u0007",
2158
+ "\\b",
2159
+ "\\t",
2160
+ "\\n",
2161
+ "\\u000B",
2162
+ "\\f",
2163
+ "\\r",
2164
+ "\\u000E",
2165
+ "\\u000F",
2166
+ "\\u0010",
2167
+ "\\u0011",
2168
+ "\\u0012",
2169
+ "\\u0013",
2170
+ "\\u0014",
2171
+ "\\u0015",
2172
+ "\\u0016",
2173
+ "\\u0017",
2174
+ "\\u0018",
2175
+ "\\u0019",
2176
+ "\\u001A",
2177
+ "\\u001B",
2178
+ "\\u001C",
2179
+ "\\u001D",
2180
+ "\\u001E",
2181
+ "\\u001F",
2182
+ "",
2183
+ "",
2184
+ '\\"',
2185
+ "",
2186
+ "",
2187
+ "",
2188
+ "",
2189
+ "",
2190
+ "",
2191
+ "",
2192
+ "",
2193
+ "",
2194
+ "",
2195
+ "",
2196
+ "",
2197
+ "",
2198
+ // 2F
2199
+ "",
2200
+ "",
2201
+ "",
2202
+ "",
2203
+ "",
2204
+ "",
2205
+ "",
2206
+ "",
2207
+ "",
2208
+ "",
2209
+ "",
2210
+ "",
2211
+ "",
2212
+ "",
2213
+ "",
2214
+ "",
2215
+ // 3F
2216
+ "",
2217
+ "",
2218
+ "",
2219
+ "",
2220
+ "",
2221
+ "",
2222
+ "",
2223
+ "",
2224
+ "",
2225
+ "",
2226
+ "",
2227
+ "",
2228
+ "",
2229
+ "",
2230
+ "",
2231
+ "",
2232
+ // 4F
2233
+ "",
2234
+ "",
2235
+ "",
2236
+ "",
2237
+ "",
2238
+ "",
2239
+ "",
2240
+ "",
2241
+ "",
2242
+ "",
2243
+ "",
2244
+ "",
2245
+ "\\\\",
2246
+ "",
2247
+ "",
2248
+ "",
2249
+ // 5F
2250
+ "",
2251
+ "",
2252
+ "",
2253
+ "",
2254
+ "",
2255
+ "",
2256
+ "",
2257
+ "",
2258
+ "",
2259
+ "",
2260
+ "",
2261
+ "",
2262
+ "",
2263
+ "",
2264
+ "",
2265
+ "",
2266
+ // 6F
2267
+ "",
2268
+ "",
2269
+ "",
2270
+ "",
2271
+ "",
2272
+ "",
2273
+ "",
2274
+ "",
2275
+ "",
2276
+ "",
2277
+ "",
2278
+ "",
2279
+ "",
2280
+ "",
2281
+ "",
2282
+ "\\u007F",
2283
+ "\\u0080",
2284
+ "\\u0081",
2285
+ "\\u0082",
2286
+ "\\u0083",
2287
+ "\\u0084",
2288
+ "\\u0085",
2289
+ "\\u0086",
2290
+ "\\u0087",
2291
+ "\\u0088",
2292
+ "\\u0089",
2293
+ "\\u008A",
2294
+ "\\u008B",
2295
+ "\\u008C",
2296
+ "\\u008D",
2297
+ "\\u008E",
2298
+ "\\u008F",
2299
+ "\\u0090",
2300
+ "\\u0091",
2301
+ "\\u0092",
2302
+ "\\u0093",
2303
+ "\\u0094",
2304
+ "\\u0095",
2305
+ "\\u0096",
2306
+ "\\u0097",
2307
+ "\\u0098",
2308
+ "\\u0099",
2309
+ "\\u009A",
2310
+ "\\u009B",
2311
+ "\\u009C",
2312
+ "\\u009D",
2313
+ "\\u009E",
2314
+ "\\u009F"
2315
+ ], Ft = Object.freeze({});
2316
+ function wt(e, t, n = xe) {
2317
+ const i = /* @__PURE__ */ new Map();
2318
+ for (const k of Object.values(l))
2319
+ i.set(k, $t(t, k));
2320
+ let r, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, c, m;
2321
+ const g = [], y = [];
2322
+ do {
2323
+ u++;
2324
+ const k = u === o.length, R = k && h.length !== 0;
2325
+ if (k) {
2326
+ if (c = y.length === 0 ? void 0 : g[g.length - 1], p = m, m = y.pop(), R)
2327
+ if (s) {
2328
+ p = p.slice();
2329
+ let b = 0;
2330
+ for (const [D, P] of h) {
2331
+ const S = D - b;
2332
+ P === null ? (p.splice(S, 1), b++) : p[S] = P;
2333
+ }
2334
+ } else {
2335
+ p = { ...p };
2336
+ for (const [b, D] of h)
2337
+ p[b] = D;
2338
+ }
2339
+ u = r.index, o = r.keys, h = r.edits, s = r.inArray, r = r.prev;
2340
+ } else if (m) {
2341
+ if (c = s ? u : o[u], p = m[c], p == null)
2342
+ continue;
2343
+ g.push(c);
2344
+ }
2345
+ let T;
2346
+ if (!Array.isArray(p)) {
2347
+ var I, O;
2348
+ fe(p) || G(!1, `Invalid AST Node: ${de(p)}.`);
2349
+ const b = k ? (I = i.get(p.kind)) === null || I === void 0 ? void 0 : I.leave : (O = i.get(p.kind)) === null || O === void 0 ? void 0 : O.enter;
2350
+ if (T = b?.call(t, p, c, m, g, y), T === Ft)
2351
+ break;
2352
+ if (T === !1) {
2353
+ if (!k) {
2354
+ g.pop();
2355
+ continue;
2356
+ }
2357
+ } else if (T !== void 0 && (h.push([c, T]), !k))
2358
+ if (fe(T))
2359
+ p = T;
2360
+ else {
2361
+ g.pop();
2362
+ continue;
2363
+ }
2364
+ }
2365
+ if (T === void 0 && R && h.push([c, p]), k)
2366
+ g.pop();
2367
+ else {
2368
+ var N;
2369
+ r = {
2370
+ inArray: s,
2371
+ index: u,
2372
+ keys: o,
2373
+ edits: h,
2374
+ prev: r
2375
+ }, s = Array.isArray(p), o = s ? p : (N = n[p.kind]) !== null && N !== void 0 ? N : [], u = -1, h = [], m && y.push(m), m = p;
2376
+ }
2377
+ } while (r !== void 0);
2378
+ return h.length !== 0 ? h[h.length - 1][1] : e;
2379
+ }
2380
+ function $t(e, t) {
2381
+ const n = e[t];
2382
+ return typeof n == "object" ? n : typeof n == "function" ? {
2383
+ enter: n,
2384
+ leave: void 0
2385
+ } : {
2386
+ enter: e.enter,
2387
+ leave: e.leave
2388
+ };
2389
+ }
2390
+ function Bt(e) {
2391
+ return wt(e, Vt);
2392
+ }
2393
+ const Ut = 80, Vt = {
2394
+ Name: {
2395
+ leave: (e) => e.value
2396
+ },
2397
+ Variable: {
2398
+ leave: (e) => "$" + e.name
2399
+ },
2400
+ // Document
2401
+ Document: {
2402
+ leave: (e) => d(e.definitions, `
2403
+
2404
+ `)
2405
+ },
2406
+ OperationDefinition: {
2407
+ leave(e) {
2408
+ const t = te(e.variableDefinitions) ? f(`(
2409
+ `, d(e.variableDefinitions, `
2410
+ `), `
2411
+ )`) : f("(", d(e.variableDefinitions, ", "), ")"), n = f("", e.description, `
2412
+ `) + d(
2413
+ [
2414
+ e.operation,
2415
+ d([e.name, t]),
2416
+ d(e.directives, " ")
2417
+ ],
2418
+ " "
2419
+ );
2420
+ return (n === "query" ? "" : n + " ") + e.selectionSet;
2421
+ }
2422
+ },
2423
+ VariableDefinition: {
2424
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i, description: r }) => f("", r, `
2425
+ `) + e + ": " + t + f(" = ", n) + f(" ", d(i, " "))
2426
+ },
2427
+ SelectionSet: {
2428
+ leave: ({ selections: e }) => C(e)
2429
+ },
2430
+ Field: {
2431
+ leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2432
+ const s = f("", e, ": ") + t;
2433
+ let o = s + f("(", d(n, ", "), ")");
2434
+ return o.length > Ut && (o = s + f(`(
2435
+ `, Y(d(n, `
2436
+ `)), `
2437
+ )`)), d([o, d(i, " "), r], " ");
2438
+ }
2439
+ },
2440
+ Argument: {
2441
+ leave: ({ name: e, value: t }) => e + ": " + t
2442
+ },
2443
+ // Fragments
2444
+ FragmentSpread: {
2445
+ leave: ({ name: e, directives: t }) => "..." + e + f(" ", d(t, " "))
2446
+ },
2447
+ InlineFragment: {
2448
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2449
+ [
2450
+ "...",
2451
+ f("on ", e),
2452
+ d(t, " "),
2453
+ n
2454
+ ],
2455
+ " "
2456
+ )
2457
+ },
2458
+ FragmentDefinition: {
2459
+ leave: ({
2460
+ name: e,
2461
+ typeCondition: t,
2462
+ variableDefinitions: n,
2463
+ directives: i,
2464
+ selectionSet: r,
2465
+ description: s
2466
+ }) => f("", s, `
2467
+ `) + // Note: fragment variable definitions are experimental and may be changed
2468
+ // or removed in the future.
2469
+ `fragment ${e}${f("(", d(n, ", "), ")")} on ${t} ${f("", d(i, " "), " ")}` + r
2470
+ },
2471
+ // Value
2472
+ IntValue: {
2473
+ leave: ({ value: e }) => e
2474
+ },
2475
+ FloatValue: {
2476
+ leave: ({ value: e }) => e
2477
+ },
2478
+ StringValue: {
2479
+ leave: ({ value: e, block: t }) => t ? ct(e) : Ct(e)
2480
+ },
2481
+ BooleanValue: {
2482
+ leave: ({ value: e }) => e ? "true" : "false"
2483
+ },
2484
+ NullValue: {
2485
+ leave: () => "null"
2486
+ },
2487
+ EnumValue: {
2488
+ leave: ({ value: e }) => e
2489
+ },
2490
+ ListValue: {
2491
+ leave: ({ values: e }) => "[" + d(e, ", ") + "]"
2492
+ },
2493
+ ObjectValue: {
2494
+ leave: ({ fields: e }) => "{" + d(e, ", ") + "}"
2495
+ },
2496
+ ObjectField: {
2497
+ leave: ({ name: e, value: t }) => e + ": " + t
2498
+ },
2499
+ // Directive
2500
+ Directive: {
2501
+ leave: ({ name: e, arguments: t }) => "@" + e + f("(", d(t, ", "), ")")
2502
+ },
2503
+ // Type
2504
+ NamedType: {
2505
+ leave: ({ name: e }) => e
2506
+ },
2507
+ ListType: {
2508
+ leave: ({ type: e }) => "[" + e + "]"
2509
+ },
2510
+ NonNullType: {
2511
+ leave: ({ type: e }) => e + "!"
2512
+ },
2513
+ // Type System Definitions
2514
+ SchemaDefinition: {
2515
+ leave: ({ description: e, directives: t, operationTypes: n }) => f("", e, `
2516
+ `) + d(["schema", d(t, " "), C(n)], " ")
2517
+ },
2518
+ OperationTypeDefinition: {
2519
+ leave: ({ operation: e, type: t }) => e + ": " + t
2520
+ },
2521
+ ScalarTypeDefinition: {
2522
+ leave: ({ description: e, name: t, directives: n }) => f("", e, `
2523
+ `) + d(["scalar", t, d(n, " ")], " ")
2524
+ },
2525
+ ObjectTypeDefinition: {
2526
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => f("", e, `
2527
+ `) + d(
2528
+ [
2529
+ "type",
2530
+ t,
2531
+ f("implements ", d(n, " & ")),
2532
+ d(i, " "),
2533
+ C(r)
2534
+ ],
2535
+ " "
2536
+ )
2537
+ },
2538
+ FieldDefinition: {
2539
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => f("", e, `
2540
+ `) + t + (te(n) ? f(`(
2541
+ `, Y(d(n, `
2542
+ `)), `
2543
+ )`) : f("(", d(n, ", "), ")")) + ": " + i + f(" ", d(r, " "))
2544
+ },
2545
+ InputValueDefinition: {
2546
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => f("", e, `
2547
+ `) + d(
2548
+ [t + ": " + n, f("= ", i), d(r, " ")],
2549
+ " "
2550
+ )
2551
+ },
2552
+ InterfaceTypeDefinition: {
2553
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => f("", e, `
2554
+ `) + d(
2555
+ [
2556
+ "interface",
2557
+ t,
2558
+ f("implements ", d(n, " & ")),
2559
+ d(i, " "),
2560
+ C(r)
2561
+ ],
2562
+ " "
2563
+ )
2564
+ },
2565
+ UnionTypeDefinition: {
2566
+ leave: ({ description: e, name: t, directives: n, types: i }) => f("", e, `
2567
+ `) + d(
2568
+ ["union", t, d(n, " "), f("= ", d(i, " | "))],
2569
+ " "
2570
+ )
2571
+ },
2572
+ EnumTypeDefinition: {
2573
+ leave: ({ description: e, name: t, directives: n, values: i }) => f("", e, `
2574
+ `) + d(["enum", t, d(n, " "), C(i)], " ")
2575
+ },
2576
+ EnumValueDefinition: {
2577
+ leave: ({ description: e, name: t, directives: n }) => f("", e, `
2578
+ `) + d([t, d(n, " ")], " ")
2579
+ },
2580
+ InputObjectTypeDefinition: {
2581
+ leave: ({ description: e, name: t, directives: n, fields: i }) => f("", e, `
2582
+ `) + d(["input", t, d(n, " "), C(i)], " ")
2583
+ },
2584
+ DirectiveDefinition: {
2585
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => f("", e, `
2586
+ `) + "directive @" + t + (te(n) ? f(`(
2587
+ `, Y(d(n, `
2588
+ `)), `
2589
+ )`) : f("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
2590
+ },
2591
+ SchemaExtension: {
2592
+ leave: ({ directives: e, operationTypes: t }) => d(
2593
+ ["extend schema", d(e, " "), C(t)],
2594
+ " "
2595
+ )
2596
+ },
2597
+ ScalarTypeExtension: {
2598
+ leave: ({ name: e, directives: t }) => d(["extend scalar", e, d(t, " ")], " ")
2599
+ },
2600
+ ObjectTypeExtension: {
2601
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => d(
2602
+ [
2603
+ "extend type",
2604
+ e,
2605
+ f("implements ", d(t, " & ")),
2606
+ d(n, " "),
2607
+ C(i)
2608
+ ],
2609
+ " "
2610
+ )
2611
+ },
2612
+ InterfaceTypeExtension: {
2613
+ leave: ({ name: e, interfaces: t, directives: n, fields: i }) => d(
2614
+ [
2615
+ "extend interface",
2616
+ e,
2617
+ f("implements ", d(t, " & ")),
2618
+ d(n, " "),
2619
+ C(i)
2620
+ ],
2621
+ " "
2622
+ )
2623
+ },
2624
+ UnionTypeExtension: {
2625
+ leave: ({ name: e, directives: t, types: n }) => d(
2626
+ [
2627
+ "extend union",
2628
+ e,
2629
+ d(t, " "),
2630
+ f("= ", d(n, " | "))
2631
+ ],
2632
+ " "
2633
+ )
2634
+ },
2635
+ EnumTypeExtension: {
2636
+ leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), C(n)], " ")
2637
+ },
2638
+ InputObjectTypeExtension: {
2639
+ leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), C(n)], " ")
2640
+ },
2641
+ // Schema Coordinates
2642
+ TypeCoordinate: {
2643
+ leave: ({ name: e }) => e
2644
+ },
2645
+ MemberCoordinate: {
2646
+ leave: ({ name: e, memberName: t }) => d([e, f(".", t)])
2647
+ },
2648
+ ArgumentCoordinate: {
2649
+ leave: ({ name: e, fieldName: t, argumentName: n }) => d([e, f(".", t), f("(", n, ":)")])
2650
+ },
2651
+ DirectiveCoordinate: {
2652
+ leave: ({ name: e }) => d(["@", e])
2653
+ },
2654
+ DirectiveArgumentCoordinate: {
2655
+ leave: ({ name: e, argumentName: t }) => d(["@", e, f("(", t, ":)")])
2656
+ }
2657
+ };
2658
+ function d(e, t = "") {
2659
+ var n;
2660
+ return (n = e?.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2661
+ }
2662
+ function C(e) {
2663
+ return f(`{
2664
+ `, Y(d(e, `
2665
+ `)), `
2666
+ }`);
2667
+ }
2668
+ function f(e, t, n = "") {
2669
+ return t != null && t !== "" ? e + t + n : "";
2670
+ }
2671
+ function Y(e) {
2672
+ return f(" ", e.replace(/\n/g, `
2673
+ `));
2674
+ }
2675
+ function te(e) {
2676
+ var t;
2677
+ return (t = e?.some((n) => n.includes(`
2678
+ `))) !== null && t !== void 0 ? t : !1;
2679
+ }
2680
+ var H = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map(), Re = !0, J = !1;
2681
+ function Fe(e) {
2682
+ return e.replace(/[\s,]+/g, " ").trim();
2683
+ }
2684
+ function Mt(e) {
2685
+ return Fe(e.source.body.substring(e.start, e.end));
2686
+ }
2687
+ function qt(e) {
2688
+ var t = /* @__PURE__ */ new Set(), n = [];
2689
+ return e.definitions.forEach(function(i) {
2138
2690
  if (i.kind === "FragmentDefinition") {
2139
- var n = i.name.value, s = pt(i.loc), o = G.get(n);
2140
- o && !o.has(s) ? me && console.warn("Warning: fragment with name " + n + ` already exists.
2691
+ var r = i.name.value, s = Mt(i.loc), o = oe.get(r);
2692
+ o && !o.has(s) ? Re && console.warn("Warning: fragment with name " + r + ` already exists.
2141
2693
  graphql-tag enforces all fragment names across your application to be unique; read more about
2142
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(n, o = /* @__PURE__ */ new Set()), o.add(s), e.has(s) || (e.add(s), t.push(i));
2694
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || oe.set(r, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(i));
2143
2695
  } else
2144
- t.push(i);
2145
- }), F(F({}, r), { definitions: t });
2146
- }
2147
- function mt(r) {
2148
- var e = new Set(r.definitions);
2149
- e.forEach(function(i) {
2150
- i.loc && delete i.loc, Object.keys(i).forEach(function(n) {
2151
- var s = i[n];
2152
- s && typeof s == "object" && e.add(s);
2696
+ n.push(i);
2697
+ }), Q(Q({}, e), { definitions: n });
2698
+ }
2699
+ function zt(e) {
2700
+ var t = new Set(e.definitions);
2701
+ t.forEach(function(i) {
2702
+ i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
2703
+ var s = i[r];
2704
+ s && typeof s == "object" && t.add(s);
2153
2705
  });
2154
2706
  });
2155
- var t = r.loc;
2156
- return t && (delete t.startToken, delete t.endToken), r;
2157
- }
2158
- function gt(r) {
2159
- var e = ge(r);
2160
- if (!R.has(e)) {
2161
- var t = ut(r, {
2162
- experimentalFragmentVariables: w,
2163
- allowLegacyFragmentVariables: w
2707
+ var n = e.loc;
2708
+ return n && (delete n.startToken, delete n.endToken), e;
2709
+ }
2710
+ function jt(e) {
2711
+ var t = Fe(e);
2712
+ if (!H.has(t)) {
2713
+ var n = Pt(e, {
2714
+ experimentalFragmentVariables: J,
2715
+ allowLegacyFragmentVariables: J
2164
2716
  });
2165
- if (!t || t.kind !== "Document")
2717
+ if (!n || n.kind !== "Document")
2166
2718
  throw new Error("Not a valid GraphQL document.");
2167
- R.set(e, mt(ht(t)));
2719
+ H.set(t, zt(qt(n)));
2168
2720
  }
2169
- return R.get(e);
2721
+ return H.get(t);
2170
2722
  }
2171
- function p(r) {
2172
- for (var e = [], t = 1; t < arguments.length; t++)
2173
- e[t - 1] = arguments[t];
2174
- typeof r == "string" && (r = [r]);
2175
- var i = r[0];
2176
- return e.forEach(function(n, s) {
2177
- n && n.kind === "Document" ? i += n.loc.source.body : i += n, i += r[s + 1];
2178
- }), gt(i);
2723
+ function E(e) {
2724
+ for (var t = [], n = 1; n < arguments.length; n++)
2725
+ t[n - 1] = arguments[n];
2726
+ typeof e == "string" && (e = [e]);
2727
+ var i = e[0];
2728
+ return t.forEach(function(r, s) {
2729
+ r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
2730
+ }), jt(i);
2179
2731
  }
2180
- function ft() {
2181
- R.clear(), G.clear();
2732
+ function Gt() {
2733
+ H.clear(), oe.clear();
2182
2734
  }
2183
- function It() {
2184
- me = !1;
2735
+ function Yt() {
2736
+ Re = !1;
2185
2737
  }
2186
- function Et() {
2187
- w = !0;
2738
+ function Ht() {
2739
+ J = !0;
2188
2740
  }
2189
- function yt() {
2190
- w = !1;
2741
+ function Qt() {
2742
+ J = !1;
2191
2743
  }
2192
- var b = {
2193
- gql: p,
2194
- resetCaches: ft,
2195
- disableFragmentWarnings: It,
2196
- enableExperimentalFragmentVariables: Et,
2197
- disableExperimentalFragmentVariables: yt
2744
+ var U = {
2745
+ gql: E,
2746
+ resetCaches: Gt,
2747
+ disableFragmentWarnings: Yt,
2748
+ enableExperimentalFragmentVariables: Ht,
2749
+ disableExperimentalFragmentVariables: Qt
2198
2750
  };
2199
- (function(r) {
2200
- r.gql = b.gql, r.resetCaches = b.resetCaches, r.disableFragmentWarnings = b.disableFragmentWarnings, r.enableExperimentalFragmentVariables = b.enableExperimentalFragmentVariables, r.disableExperimentalFragmentVariables = b.disableExperimentalFragmentVariables;
2201
- })(p || (p = {}));
2202
- p.default = p;
2203
- const At = p`
2204
- query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!]) {
2751
+ (function(e) {
2752
+ e.gql = U.gql, e.resetCaches = U.resetCaches, e.disableFragmentWarnings = U.disableFragmentWarnings, e.enableExperimentalFragmentVariables = U.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = U.disableExperimentalFragmentVariables;
2753
+ })(E || (E = {}));
2754
+ E.default = E;
2755
+ const Jt = E`
2756
+ query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
2205
2757
  findAllPublicEventByOrganizationId(
2206
2758
  id: $organizationId
2207
2759
  hostingIds: $hostingIds
@@ -2210,6 +2762,8 @@ const At = p`
2210
2762
  date: $dateRange
2211
2763
  page: $page
2212
2764
  sorts: $sorts
2765
+ searchTerm: $searchTerm
2766
+ priceRange: $priceRange
2213
2767
  ) {
2214
2768
  data {
2215
2769
  id
@@ -2231,11 +2785,12 @@ const At = p`
2231
2785
  address
2232
2786
  }
2233
2787
  infoDescription
2788
+ startingPrice
2234
2789
  }
2235
2790
  count
2236
2791
  }
2237
2792
  }
2238
- `, Ot = p`
2793
+ `, Xt = E`
2239
2794
  query EventDetailPage($eventId: ID!) {
2240
2795
  findPublicEventById(id: $eventId) {
2241
2796
  id
@@ -2261,7 +2816,7 @@ const At = p`
2261
2816
  maxAmountOfTicketsPerOrder
2262
2817
  }
2263
2818
  }
2264
- `, Tt = p`
2819
+ `, Kt = E`
2265
2820
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
2266
2821
  findPublicProductsByEventId(
2267
2822
  eventId: $eventId
@@ -2295,96 +2850,186 @@ const At = p`
2295
2850
  showEndSalesAtTag
2296
2851
  }
2297
2852
  }
2298
- `, kt = (r, e, t, i) => r();
2299
- function vt(r, e = kt) {
2853
+ `, Wt = (e, t, n, i) => e();
2854
+ function Zt(e, t = Wt) {
2300
2855
  return {
2301
- EventOverviewPage(t, i, n) {
2302
- return e((s) => r.request({ document: At, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "EventOverviewPage", "query", t);
2856
+ EventOverviewPage(n, i, r) {
2857
+ return t((s) => e.request({ document: Jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
2303
2858
  },
2304
- EventDetailPage(t, i, n) {
2305
- return e((s) => r.request({ document: Ot, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "EventDetailPage", "query", t);
2859
+ EventDetailPage(n, i, r) {
2860
+ return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
2306
2861
  },
2307
- findProductsByEventId(t, i, n) {
2308
- return e((s) => r.request({ document: Tt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findProductsByEventId", "query", t);
2862
+ findProductsByEventId(n, i, r) {
2863
+ return t((s) => e.request({ document: Kt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
2309
2864
  }
2310
2865
  };
2311
2866
  }
2312
- class fe {
2867
+ function en(e) {
2868
+ const t = /(query|mutation|subscription)\s+(\w+)/.exec(e);
2869
+ if (!t) return { type: "unknown" };
2870
+ const n = t[1], i = t[2];
2871
+ return { type: n, name: i };
2872
+ }
2873
+ async function tn(e) {
2874
+ if (typeof globalThis < "u" && globalThis.crypto?.subtle) {
2875
+ const n = new TextEncoder().encode(e), i = await globalThis.crypto.subtle.digest("SHA-256", n);
2876
+ return Array.from(new Uint8Array(i)).map((r) => r.toString(16).padStart(2, "0")).join("");
2877
+ }
2878
+ try {
2879
+ const { createHash: t } = await import("./__vite-browser-external-l0sNRNKZ.js");
2880
+ return t("sha256").update(e).digest("hex");
2881
+ } catch {
2882
+ throw new Error("SHA-256 is not available in this environment");
2883
+ }
2884
+ }
2885
+ function nn(e) {
2886
+ const t = { "content-type": "application/json" };
2887
+ if (e)
2888
+ for (const [n, i] of Object.entries(e))
2889
+ typeof i < "u" && (t[n] = String(i));
2890
+ return t;
2891
+ }
2892
+ function ge(e, t) {
2893
+ return e?.length ? e.some((n) => t.includes(n?.extensions?.code) || t.includes(n?.message)) : !1;
2894
+ }
2895
+ function Ie(e, t, n, i, r) {
2896
+ const s = new Error(e);
2897
+ return s.response = { data: r.json?.data, errors: r.json?.errors, status: r.status }, s.request = { query: t, variables: n, operationName: i }, s.graphQLErrors = r.json?.errors, s;
2898
+ }
2899
+ function ne(e, t, n, i, r) {
2900
+ if (r.json?.errors?.length)
2901
+ throw Ie(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, i, r);
2902
+ if (typeof r.json?.data > "u")
2903
+ throw Ie("GraphQL request failed: no data received", t, n, i, r);
2904
+ return r.json.data;
2905
+ }
2906
+ class ue extends ae {
2907
+ async request(t, ...n) {
2908
+ let i = t, r, s, o;
2909
+ t && typeof t == "object" && "document" in t ? (i = t.document, r = t.variables, s = t.requestHeaders, o = t.signal) : (r = n[0], s = n[1]);
2910
+ const u = typeof i == "string" ? i : Bt(i), { type: h, name: p } = en(u), c = await tn(u), m = r ?? {}, g = this.url ?? this.endpoint ?? "", y = nn(s), I = async (D) => {
2911
+ const P = await fetch(g, { method: "POST", headers: y, body: JSON.stringify(D), signal: o });
2912
+ let S = null;
2913
+ try {
2914
+ S = await P.json();
2915
+ } catch {
2916
+ S = null;
2917
+ }
2918
+ return { status: P.status, json: S };
2919
+ }, O = async (D) => {
2920
+ const P = new URLSearchParams();
2921
+ for (const [Je, q] of Object.entries(D))
2922
+ typeof q > "u" || P.set(Je, typeof q == "string" ? q : JSON.stringify(q));
2923
+ const S = g.includes("?") ? "&" : "?", B = `${g}${S}${P.toString()}`, le = await fetch(B, { method: "GET", headers: y, signal: o });
2924
+ let Z = null;
2925
+ try {
2926
+ Z = await le.json();
2927
+ } catch {
2928
+ Z = null;
2929
+ }
2930
+ return { status: le.status, json: Z };
2931
+ }, N = {
2932
+ operationName: p,
2933
+ variables: m,
2934
+ extensions: { persistedQuery: { version: 1, sha256Hash: c } }
2935
+ }, k = async (D, P, S) => {
2936
+ if (ge(D.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
2937
+ const B = await P();
2938
+ return ne("APQ register", u, m, p, B);
2939
+ }
2940
+ if (ge(D.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
2941
+ const B = await S();
2942
+ return ne("no APQ support", u, m, p, B);
2943
+ }
2944
+ return ne("", u, m, p, D);
2945
+ };
2946
+ if (h === "query") {
2947
+ const D = await O(N);
2948
+ return k(D, () => I({ ...N, query: u }), () => I({ operationName: p, variables: m, query: u }));
2949
+ }
2950
+ const R = await I(N);
2951
+ return k(R, () => I({ ...N, query: u }), () => I({ operationName: p, variables: m, query: u }));
2952
+ }
2953
+ }
2954
+ class we {
2313
2955
  config;
2314
2956
  sdk;
2315
- constructor(e) {
2316
- this.config = e, this.sdk = vt(new C(e.apiUrl));
2957
+ constructor(t) {
2958
+ this.config = t, this.sdk = Zt(new ue(t.apiUrl));
2317
2959
  }
2318
- async fetchEvents(e = {}) {
2960
+ async fetchEvents(t = {}) {
2319
2961
  try {
2320
- e.page && (e.page = {
2321
- index: e.page.index ?? 0,
2322
- size: e.page.size ?? 20
2962
+ t.page && (t.page = {
2963
+ index: t.page.index ?? 0,
2964
+ size: t.page.size ?? 20
2323
2965
  }), this.debugLog("Fetching events with parameters", {
2324
2966
  organizationId: this.config.organizationId,
2325
- hostingIds: e.hostingIds,
2326
- filterEventStatuses: e.statuses,
2327
- dateRange: e.dateRange,
2328
- page: e.page,
2329
- sorts: e.sorts,
2967
+ hostingIds: t.hostingIds,
2968
+ filterEventStatuses: t.statuses,
2969
+ dateRange: t.dateRange,
2970
+ page: t.page,
2971
+ sorts: t.sorts,
2330
2972
  trackerId: this.config.trackerId
2331
2973
  });
2332
- const t = await this.sdk.EventOverviewPage({
2974
+ const n = await this.sdk.EventOverviewPage({
2333
2975
  organizationId: this.config.organizationId,
2334
- hostingIds: e.hostingIds,
2335
- filterEventStatuses: e.statuses,
2336
- dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
2337
- from: e.dateRange.from.toISO(),
2338
- till: e.dateRange.till.toISO()
2976
+ hostingIds: t.hostingIds,
2977
+ filterEventStatuses: t.statuses,
2978
+ dateRange: t.dateRange && t.dateRange.from && t.dateRange.till ? {
2979
+ from: t.dateRange.from.toISO(),
2980
+ till: t.dateRange.till.toISO()
2339
2981
  } : void 0,
2340
- page: e.page,
2341
- sorts: e.sorts,
2342
- trackerId: this.config.trackerId
2982
+ page: t.page,
2983
+ sorts: t.sorts,
2984
+ trackerId: this.config.trackerId,
2985
+ searchTerm: t.searchTerm,
2986
+ priceRange: t.priceRange
2343
2987
  });
2344
- if (this.debugLog("Raw GraphQL response", t), t?.findAllPublicEventByOrganizationId?.data) {
2345
- const i = t.findAllPublicEventByOrganizationId.data.map((n) => ({
2346
- id: n.id,
2347
- name: n.name,
2348
- icon: n.icon,
2349
- banner: n.banner,
2350
- description: n.description,
2351
- addonDescription: n.addonDescription,
2352
- startAt: y.fromISO(n.startAt, { zone: n.timezone }),
2353
- endAt: y.fromISO(n.endAt, { zone: n.timezone }),
2354
- timezone: n.timezone,
2988
+ if (this.debugLog("Raw GraphQL response", n), n?.findAllPublicEventByOrganizationId?.data) {
2989
+ const i = n.findAllPublicEventByOrganizationId.data.map((r) => ({
2990
+ id: r.id,
2991
+ name: r.name,
2992
+ icon: r.icon,
2993
+ banner: r.banner,
2994
+ description: r.description,
2995
+ addonDescription: r.addonDescription,
2996
+ startAt: x.fromISO(r.startAt, { zone: r.timezone }),
2997
+ endAt: x.fromISO(r.endAt, { zone: r.timezone }),
2998
+ timezone: r.timezone,
2355
2999
  startSalesAt: null,
2356
3000
  endSalesAt: null,
2357
- slug: n.slug ?? "ERROR",
3001
+ slug: r.slug ?? "ERROR",
2358
3002
  facebookPixelId: null,
2359
- status: n.status,
2360
- location: n.location ? {
2361
- id: n.location.id,
2362
- name: n.location.name,
2363
- address: n.location.address
3003
+ status: r.status,
3004
+ location: r.location ? {
3005
+ id: r.location.id,
3006
+ name: r.location.name,
3007
+ address: r.location.address
2364
3008
  } : void 0,
2365
- infoDescription: n.infoDescription
3009
+ infoDescription: r.infoDescription,
3010
+ startingPrice: r.startingPrice
2366
3011
  }));
2367
- return this.debugLog("Processed events", { events: i, count: i.length }), [i, t.findAllPublicEventByOrganizationId.count ?? 0];
3012
+ return this.debugLog("Processed events", { events: i, count: i.length }), [i, n.findAllPublicEventByOrganizationId.count ?? 0];
2368
3013
  } else
2369
3014
  return this.debugLog("No events found in response"), [[], 0];
2370
- } catch (t) {
2371
- throw this.debugLog("Error fetching events", t), t;
3015
+ } catch (n) {
3016
+ throw this.debugLog("Error fetching events", n), n;
2372
3017
  }
2373
3018
  }
2374
- async fetchEvent(e) {
3019
+ async fetchEvent(t) {
2375
3020
  try {
2376
- this.debugLog("Fetching single event", { eventId: e });
2377
- const t = await this.sdk.EventDetailPage({ eventId: e });
2378
- if (this.debugLog("Raw GraphQL response", t), t?.findPublicEventById) {
2379
- const i = t.findPublicEventById, n = {
3021
+ this.debugLog("Fetching single event", { eventId: t });
3022
+ const n = await this.sdk.EventDetailPage({ eventId: t });
3023
+ if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
3024
+ const i = n.findPublicEventById, r = {
2380
3025
  id: i.id,
2381
3026
  name: i.name,
2382
3027
  icon: i.icon,
2383
3028
  banner: i.banner,
2384
3029
  description: i.description,
2385
3030
  addonDescription: i.addonDescription,
2386
- startAt: y.fromISO(i.startAt, { zone: i.timezone }),
2387
- endAt: y.fromISO(i.endAt, { zone: i.timezone }),
3031
+ startAt: x.fromISO(i.startAt, { zone: i.timezone }),
3032
+ endAt: x.fromISO(i.endAt, { zone: i.timezone }),
2388
3033
  timezone: i.timezone,
2389
3034
  startSalesAt: i.startSalesAt,
2390
3035
  endSalesAt: i.endSalesAt,
@@ -2398,31 +3043,31 @@ class fe {
2398
3043
  } : void 0,
2399
3044
  infoDescription: i.infoDescription
2400
3045
  };
2401
- return this.debugLog("Processed single event", n), n;
3046
+ return this.debugLog("Processed single event", r), r;
2402
3047
  } else {
2403
- this.debugLog("No event found for id", e);
3048
+ this.debugLog("No event found for id", t);
2404
3049
  return;
2405
3050
  }
2406
- } catch (t) {
2407
- throw this.debugLog("Error fetching single event", t), t;
3051
+ } catch (n) {
3052
+ throw this.debugLog("Error fetching single event", n), n;
2408
3053
  }
2409
3054
  }
2410
- async fetchProducts(e, t, i) {
3055
+ async fetchProducts(t, n, i) {
2411
3056
  try {
2412
3057
  this.debugLog("Fetching products for event", {
2413
- eventId: e,
3058
+ eventId: t,
2414
3059
  promoCode: i,
2415
3060
  trackerId: this.config.trackerId,
2416
- productTypes: t
3061
+ productTypes: n
2417
3062
  });
2418
- const n = await this.sdk.findProductsByEventId({
2419
- eventId: e,
3063
+ const r = await this.sdk.findProductsByEventId({
3064
+ eventId: t,
2420
3065
  promoCode: i,
2421
3066
  trackerId: this.config.trackerId,
2422
- productTypes: t
3067
+ productTypes: n
2423
3068
  });
2424
- if (n?.findPublicProductsByEventId) {
2425
- const s = n.findPublicProductsByEventId.map((o) => ({
3069
+ if (r?.findPublicProductsByEventId) {
3070
+ const s = r.findPublicProductsByEventId.map((o) => ({
2426
3071
  id: o.id,
2427
3072
  name: o.name,
2428
3073
  category: o.category ? {
@@ -2447,21 +3092,21 @@ class fe {
2447
3092
  type: o.type
2448
3093
  }));
2449
3094
  return this.debugLog("Products fetched", {
2450
- eventId: e,
3095
+ eventId: t,
2451
3096
  count: s.length,
2452
3097
  types: s.map((o) => o.type)
2453
3098
  }), s;
2454
3099
  }
2455
3100
  return;
2456
- } catch (n) {
2457
- throw this.debugLog("Error fetching products", { eventId: e, error: n }), n;
3101
+ } catch (r) {
3102
+ throw this.debugLog("Error fetching products", { eventId: t, error: r }), r;
2458
3103
  }
2459
3104
  }
2460
- debugLog(e, t) {
2461
- this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, t || "");
3105
+ debugLog(t, n) {
3106
+ this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
2462
3107
  }
2463
3108
  }
2464
- const Nt = p`
3109
+ const rn = E`
2465
3110
  query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String) {
2466
3111
  findPaymentDetails(
2467
3112
  orderId: $orderId
@@ -2489,39 +3134,39 @@ const Nt = p`
2489
3134
  paymentSpesificTransactionFee
2490
3135
  }
2491
3136
  }
2492
- `, xt = p`
3137
+ `, sn = E`
2493
3138
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
2494
3139
  createDigitalOrderPayment(input: $input)
2495
3140
  }
2496
- `, Dt = (r, e, t, i) => r();
2497
- function bt(r, e = Dt) {
3141
+ `, on = (e, t, n, i) => e();
3142
+ function an(e, t = on) {
2498
3143
  return {
2499
- findPaymentMethods(t, i, n) {
2500
- return e((s) => r.request({ document: Nt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findPaymentMethods", "query", t);
3144
+ findPaymentMethods(n, i, r) {
3145
+ return t((s) => e.request({ document: rn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
2501
3146
  },
2502
- createDigitalPayment(t, i, n) {
2503
- return e((s) => r.request({ document: xt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "createDigitalPayment", "mutation", t);
3147
+ createDigitalPayment(n, i, r) {
3148
+ return t((s) => e.request({ document: sn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
2504
3149
  }
2505
3150
  };
2506
3151
  }
2507
- class Ie {
3152
+ class $e {
2508
3153
  config;
2509
3154
  sdk;
2510
- constructor(e) {
2511
- this.config = e, this.sdk = bt(new C(e.apiUrl));
3155
+ constructor(t) {
3156
+ this.config = t, this.sdk = an(new ae(t.apiUrl));
2512
3157
  }
2513
- async getPaymentDetails(e) {
2514
- this.debugLog("Fetching payment methods", e);
3158
+ async getPaymentDetails(t) {
3159
+ this.debugLog("Fetching payment methods", t);
2515
3160
  try {
2516
- const t = await this.sdk.findPaymentMethods({
2517
- orderId: e.orderId,
2518
- orderItemId: e.orderItemId,
2519
- amountOfTickets: e.amountOfTickets,
2520
- paymentMethodId: e.paymentMethodId
3161
+ const n = await this.sdk.findPaymentMethods({
3162
+ orderId: t.orderId,
3163
+ orderItemId: t.orderItemId,
3164
+ amountOfTickets: t.amountOfTickets,
3165
+ paymentMethodId: t.paymentMethodId
2521
3166
  });
2522
- if (!t?.findPaymentDetails)
3167
+ if (!n?.findPaymentDetails)
2523
3168
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
2524
- const i = t.findPaymentDetails;
3169
+ const i = n.findPaymentDetails;
2525
3170
  return this.debugLog("Payment methods fetched successfully", {
2526
3171
  methodCount: i.methods?.length ?? 0,
2527
3172
  transactionPrice: i.transactionPrice,
@@ -2533,56 +3178,56 @@ class Ie {
2533
3178
  transactionDiscount: i.transactionPrice,
2534
3179
  transactionFee: i.transactionFee ?? null,
2535
3180
  paymentSpesificTransactionFee: i.paymentSpesificTransactionFee ?? null,
2536
- methods: i.methods?.map((n) => ({
2537
- id: n.id,
2538
- name: n.name,
2539
- image: n.image,
2540
- fee: n.fee ? {
2541
- type: n.fee.type,
2542
- value: n.fee.value
3181
+ methods: i.methods?.map((r) => ({
3182
+ id: r.id,
3183
+ name: r.name,
3184
+ image: r.image,
3185
+ fee: r.fee ? {
3186
+ type: r.fee.type,
3187
+ value: r.fee.value
2543
3188
  } : null,
2544
- issuers: n.issuers?.map((s) => ({
3189
+ issuers: r.issuers?.map((s) => ({
2545
3190
  id: s.id,
2546
3191
  name: s.name,
2547
3192
  image: s.image
2548
3193
  })) ?? null
2549
3194
  })) ?? null
2550
3195
  };
2551
- } catch (t) {
2552
- throw this.debugLog("Error fetching payment methods", t), t;
3196
+ } catch (n) {
3197
+ throw this.debugLog("Error fetching payment methods", n), n;
2553
3198
  }
2554
3199
  }
2555
- async createPayment(e) {
2556
- this.debugLog("Creating payment", e);
3200
+ async createPayment(t) {
3201
+ this.debugLog("Creating payment", t);
2557
3202
  try {
2558
- const t = {
2559
- orderId: e.orderId,
2560
- paymentMethodId: e.paymentMethodId,
2561
- issuerId: e.issuerId,
2562
- redirectUrl: e.redirectUrl,
3203
+ const n = {
3204
+ orderId: t.orderId,
3205
+ paymentMethodId: t.paymentMethodId,
3206
+ issuerId: t.issuerId,
3207
+ redirectUrl: t.redirectUrl,
2563
3208
  // For payment links this input in used
2564
- initiatedByUserId: e.initiatedByUserId,
2565
- initiatedByTeamId: e.initiatedByTeamId,
2566
- amountOfTickets: e.amountOfTickets,
2567
- orderItemId: e.orderItemId
3209
+ initiatedByUserId: t.initiatedByUserId,
3210
+ initiatedByTeamId: t.initiatedByTeamId,
3211
+ amountOfTickets: t.amountOfTickets,
3212
+ orderItemId: t.orderItemId
2568
3213
  };
2569
- e.customer && (t.customer = e.customer), e.products && (t.products = e.products), e.description && (t.description = e.description), e.reference && (t.reference = e.reference), e.ipAddress && (t.ipAddress = e.ipAddress);
3214
+ 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);
2570
3215
  const i = await this.sdk.createDigitalPayment({
2571
- input: t
3216
+ input: n
2572
3217
  });
2573
3218
  if (!i?.createDigitalOrderPayment)
2574
3219
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
2575
- const n = i.createDigitalOrderPayment;
2576
- return this.debugLog("Payment created successfully", { paymentUrl: n }), { paymentUrl: n };
2577
- } catch (t) {
2578
- throw this.debugLog("Error creating payment", t), t;
3220
+ const r = i.createDigitalOrderPayment;
3221
+ return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
3222
+ } catch (n) {
3223
+ throw this.debugLog("Error creating payment", n), n;
2579
3224
  }
2580
3225
  }
2581
- debugLog(e, t) {
2582
- this.config.debug && console.log(`[PaymentService] ${e}`, t || "");
3226
+ debugLog(t, n) {
3227
+ this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
2583
3228
  }
2584
3229
  }
2585
- const Pt = p`
3230
+ const cn = E`
2586
3231
  query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
2587
3232
  findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
2588
3233
  data {
@@ -2607,7 +3252,7 @@ const Pt = p`
2607
3252
  count
2608
3253
  }
2609
3254
  }
2610
- `, St = p`
3255
+ `, dn = E`
2611
3256
  query findPublicPackageById($packageId: ID!) {
2612
3257
  findPublicPackageById(id: $packageId) {
2613
3258
  id
@@ -2633,7 +3278,7 @@ const Pt = p`
2633
3278
  }
2634
3279
  }
2635
3280
  }
2636
- `, Ct = p`
3281
+ `, un = E`
2637
3282
  query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
2638
3283
  findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
2639
3284
  data {
@@ -2668,87 +3313,85 @@ const Pt = p`
2668
3313
  count
2669
3314
  }
2670
3315
  }
2671
- `, _t = (r, e, t, i) => r();
2672
- function Lt(r, e = _t) {
3316
+ `, ln = (e, t, n, i) => e();
3317
+ function pn(e, t = ln) {
2673
3318
  return {
2674
- findAllPublicPackagesByOrganizationId(t, i, n) {
2675
- return e((s) => r.request({ document: Pt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findAllPublicPackagesByOrganizationId", "query", t);
3319
+ findAllPublicPackagesByOrganizationId(n, i, r) {
3320
+ return t((s) => e.request({ document: cn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
2676
3321
  },
2677
- findPublicPackageById(t, i, n) {
2678
- return e((s) => r.request({ document: St, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findPublicPackageById", "query", t);
3322
+ findPublicPackageById(n, i, r) {
3323
+ return t((s) => e.request({ document: dn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
2679
3324
  },
2680
- findPublicItemsByPackageId(t, i, n) {
2681
- return e((s) => r.request({ document: Ct, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findPublicItemsByPackageId", "query", t);
3325
+ findPublicItemsByPackageId(n, i, r) {
3326
+ return t((s) => e.request({ document: un, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
2682
3327
  }
2683
3328
  };
2684
3329
  }
2685
- class Ee {
3330
+ class Be {
2686
3331
  config;
2687
3332
  sdk;
2688
- constructor(e) {
2689
- if (!e.organizationId)
2690
- throw new Error("organizationId is required for public package queries");
2691
- this.config = e, this.sdk = Lt(new C(e.apiUrl));
3333
+ constructor(t) {
3334
+ this.config = t, this.sdk = pn(new ue(t.apiUrl));
2692
3335
  }
2693
- debugLog(e, t) {
2694
- this.config.debug && console.log(`[PackageService] ${e}`, t || "");
3336
+ debugLog(t, n) {
3337
+ this.config.debug && console.log(`[PackageService] ${t}`, n || "");
2695
3338
  }
2696
- async getPackages(e = {}) {
3339
+ async getPackages(t = {}) {
2697
3340
  try {
2698
- let t;
2699
- e.page && (t = {
2700
- index: e.page.index ?? 0,
2701
- size: e.page.size ?? 20
3341
+ let n;
3342
+ t.page && (n = {
3343
+ index: t.page.index ?? 0,
3344
+ size: t.page.size ?? 20
2702
3345
  }), this.debugLog("Fetching public packages", {
2703
3346
  organizationId: this.config.organizationId,
2704
- page: t,
2705
- tab: e.tab,
2706
- statuses: e.statuses
3347
+ page: n,
3348
+ tab: t.tab,
3349
+ statuses: t.statuses
2707
3350
  });
2708
3351
  const i = await this.sdk.findAllPublicPackagesByOrganizationId({
2709
3352
  organizationId: this.config.organizationId
2710
3353
  });
2711
3354
  if (i?.findAllPublicPackagesByOrganizationId) {
2712
- const n = i.findAllPublicPackagesByOrganizationId;
3355
+ const r = i.findAllPublicPackagesByOrganizationId;
2713
3356
  return this.debugLog("Public packages fetched", {
2714
- count: n.count,
2715
- dataLength: n.data.length
2716
- }), n;
3357
+ count: r.count,
3358
+ dataLength: r.data.length
3359
+ }), r;
2717
3360
  }
2718
3361
  return null;
2719
- } catch (t) {
2720
- throw this.debugLog("Error fetching public packages", t), t;
3362
+ } catch (n) {
3363
+ throw this.debugLog("Error fetching public packages", n), n;
2721
3364
  }
2722
3365
  }
2723
- async getPackage(e) {
3366
+ async getPackage(t) {
2724
3367
  try {
2725
3368
  this.debugLog("Fetching public packages", {
2726
- packageId: e
3369
+ packageId: t
2727
3370
  });
2728
- const t = await this.sdk.findPublicPackageById({ packageId: e });
2729
- if (t?.findPublicPackageById) {
2730
- const i = t.findPublicPackageById;
3371
+ const n = await this.sdk.findPublicPackageById({ packageId: t });
3372
+ if (n?.findPublicPackageById) {
3373
+ const i = n.findPublicPackageById;
2731
3374
  return this.debugLog("Public package fetched"), i;
2732
3375
  }
2733
3376
  return null;
2734
- } catch (t) {
2735
- throw this.debugLog("Error fetching public packages", t), t;
3377
+ } catch (n) {
3378
+ throw this.debugLog("Error fetching public packages", n), n;
2736
3379
  }
2737
3380
  }
2738
- async getPackageItems(e, t = [B.Regular, B.AdditionalEvent]) {
3381
+ async getPackageItems(t, n = [X.Regular, X.AdditionalEvent]) {
2739
3382
  try {
2740
- this.debugLog("Fetching public package items", { packageId: e, types: t });
3383
+ this.debugLog("Fetching public package items", { packageId: t, types: n });
2741
3384
  const i = await this.sdk.findPublicItemsByPackageId({
2742
- packageId: e,
2743
- types: t,
3385
+ packageId: t,
3386
+ types: n,
2744
3387
  page: { index: 0, size: 100 }
2745
3388
  });
2746
3389
  if (i?.findPublicItemsByPackageId) {
2747
- const n = i.findPublicItemsByPackageId;
3390
+ const r = i.findPublicItemsByPackageId;
2748
3391
  return this.debugLog("Public package items fetched", {
2749
- count: n.count,
2750
- dataLength: n.data.length
2751
- }), n;
3392
+ count: r.count,
3393
+ dataLength: r.data.length
3394
+ }), r;
2752
3395
  }
2753
3396
  return null;
2754
3397
  } catch (i) {
@@ -2756,92 +3399,92 @@ class Ee {
2756
3399
  }
2757
3400
  }
2758
3401
  }
2759
- const Rt = p`
2760
- query findAllPublicCategoriesByOrganizationId($organizationId: ID!) {
3402
+ const hn = E`
3403
+ query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
2761
3404
  findAllPublicHostingsByOrganizationId(id: $organizationId) {
2762
3405
  data {
2763
3406
  id
2764
3407
  name
2765
3408
  icon
3409
+ amountOfActiveEvents(input: $dateRange)
2766
3410
  }
2767
3411
  count
2768
3412
  }
2769
3413
  }
2770
- `, Ft = p`
2771
- query findPublicCategoryById($hostingId: ID!) {
3414
+ `, fn = E`
3415
+ query findPublicCategoryById($hostingId: ID!, $dateRange: DateRangeInput) {
2772
3416
  findPublicHostingById(id: $hostingId) {
2773
3417
  id
2774
3418
  name
2775
3419
  icon
3420
+ amountOfActiveEvents(input: $dateRange)
2776
3421
  }
2777
3422
  }
2778
- `, wt = (r, e, t, i) => r();
2779
- function Bt(r, e = wt) {
3423
+ `, mn = (e, t, n, i) => e();
3424
+ function gn(e, t = mn) {
2780
3425
  return {
2781
- findAllPublicCategoriesByOrganizationId(t, i, n) {
2782
- return e((s) => r.request({ document: Rt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findAllPublicCategoriesByOrganizationId", "query", t);
3426
+ findAllPublicCategoriesByOrganizationId(n, i, r) {
3427
+ return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
2783
3428
  },
2784
- findPublicCategoryById(t, i, n) {
2785
- return e((s) => r.request({ document: Ft, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findPublicCategoryById", "query", t);
3429
+ findPublicCategoryById(n, i, r) {
3430
+ return t((s) => e.request({ document: fn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicCategoryById", "query", n);
2786
3431
  }
2787
3432
  };
2788
3433
  }
2789
- class ye {
3434
+ class Ue {
2790
3435
  config;
2791
3436
  sdk;
2792
- constructor(e) {
2793
- if (!e.organizationId)
2794
- throw new Error("organizationId is required for category queries");
2795
- this.config = e, this.sdk = Bt(new C(e.apiUrl));
3437
+ constructor(t) {
3438
+ this.config = t, this.sdk = gn(new ue(t.apiUrl));
2796
3439
  }
2797
- debugLog(e, t) {
2798
- this.config.debug && console.log(`[CategoryService] ${e}`, t || "");
3440
+ debugLog(t, n) {
3441
+ this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
2799
3442
  }
2800
- async getCategories() {
3443
+ async getCategories(t) {
2801
3444
  try {
2802
3445
  this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
2803
- const e = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId });
2804
- if (e?.findAllPublicHostingsByOrganizationId) {
2805
- const t = e.findAllPublicHostingsByOrganizationId;
2806
- return this.debugLog("Categories fetched", { count: t.count, dataLength: t.data.length }), t.data.map((i) => ({ id: i.id, name: i.name, icon: i.icon }));
3446
+ const n = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId, dateRange: t });
3447
+ if (n?.findAllPublicHostingsByOrganizationId) {
3448
+ const i = n.findAllPublicHostingsByOrganizationId;
3449
+ return this.debugLog("Categories fetched", { count: i.count, dataLength: i.data.length }), i.data.map((r) => ({ id: r.id, name: r.name, icon: r.icon, activeEvents: r.amountOfActiveEvents }));
2807
3450
  }
2808
3451
  return [];
2809
- } catch (e) {
2810
- throw this.debugLog("Error fetching categories", e), e;
3452
+ } catch (n) {
3453
+ throw this.debugLog("Error fetching categories", n), n;
2811
3454
  }
2812
3455
  }
2813
- async getCategory(e) {
3456
+ async getCategory(t) {
2814
3457
  try {
2815
- this.debugLog("Fetching category", { categoryId: e });
2816
- const t = await this.sdk.findPublicCategoryById({ hostingId: e });
2817
- if (t?.findPublicHostingById) {
2818
- const i = t.findPublicHostingById;
2819
- return this.debugLog("Category fetched", i), { id: i.id, name: i.name, icon: i.icon };
3458
+ this.debugLog("Fetching category", { categoryId: t });
3459
+ const n = await this.sdk.findPublicCategoryById({ hostingId: t });
3460
+ if (n?.findPublicHostingById) {
3461
+ const i = n.findPublicHostingById;
3462
+ return this.debugLog("Category fetched", i), { id: i.id, name: i.name, icon: i.icon, activeEvents: i.amountOfActiveEvents };
2820
3463
  }
2821
3464
  return null;
2822
- } catch (t) {
2823
- throw this.debugLog("Error fetching category", t), t;
3465
+ } catch (n) {
3466
+ throw this.debugLog("Error fetching category", n), n;
2824
3467
  }
2825
3468
  }
2826
3469
  }
2827
- var k = /* @__PURE__ */ ((r) => (r.PACKAGE = "PACKAGE", r.PRODUCT = "PRODUCT", r.ADD_ONS = "ADD_ONS", r.DELIVERY = "DELIVERY", r.PICKUP = "PICKUP", r))(k || {}), B = /* @__PURE__ */ ((r) => (r.AdditionalEvent = "ADDITIONAL_EVENT", r.Addon = "ADDON", r.Regular = "REGULAR", r))(B || {}), Ae = /* @__PURE__ */ ((r) => (r.Active = "ACTIVE", r.Concept = "CONCEPT", r.Paused = "PAUSED", r.SoldOut = "SOLD_OUT", r))(Ae || {}), Oe = /* @__PURE__ */ ((r) => (r.Active = "ACTIVE", r.Inactive = "INACTIVE", r))(Oe || {}), Te = /* @__PURE__ */ ((r) => (r.Active = "ACTIVE", r.Inactive = "INACTIVE", r.Paused = "PAUSED", r.SoldOut = "SOLD_OUT", r))(Te || {}), ke = /* @__PURE__ */ ((r) => (r.Asc = "ASC", r.Desc = "DESC", r))(ke || {}), ve = /* @__PURE__ */ ((r) => (r.AllReserved = "ALL_RESERVED", r.Available = "AVAILABLE", r.SoldOut = "SOLD_OUT", r))(ve || {}), Ne = /* @__PURE__ */ ((r) => (r.Addon = "ADDON", r.Delivery = "DELIVERY", r.Door = "DOOR", r.Friend = "FRIEND", r.Guest = "GUEST", r.Pickup = "PICKUP", r.Promoter = "PROMOTER", r.Ticket = "TICKET", r))(Ne || {}), xe = /* @__PURE__ */ ((r) => (r.FIXED = "FIXED", r.PERCENTAGE = "PERCENTAGE", r))(xe || {});
2828
- const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3470
+ var L = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(L || {}), X = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(X || {}), Ve = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ve || {}), Me = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Me || {}), qe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(qe || {}), ze = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(ze || {}), je = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(je || {}), Ge = /* @__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))(Ge || {}), Ye = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Ye || {});
3471
+ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2829
3472
  __proto__: null,
2830
- BasketOrderType: k,
2831
- BasketService: be,
2832
- CategoryService: ye,
2833
- EventService: fe,
2834
- EventStatus: Te,
2835
- PackageItemType: B,
2836
- PackageService: Ee,
2837
- PackageStatus: Ae,
2838
- PackageTabType: Oe,
2839
- PaymentMethodFeeType: xe,
2840
- PaymentService: Ie,
2841
- ProductStatus: ve,
2842
- ProductType: Ne,
2843
- SortOrder: ke
2844
- }, Symbol.toStringTag, { value: "Module" })), Ut = p`
3473
+ BasketOrderType: L,
3474
+ BasketService: Qe,
3475
+ CategoryService: Ue,
3476
+ EventService: we,
3477
+ EventStatus: qe,
3478
+ PackageItemType: X,
3479
+ PackageService: Be,
3480
+ PackageStatus: Ve,
3481
+ PackageTabType: Me,
3482
+ PaymentMethodFeeType: Ye,
3483
+ PaymentService: $e,
3484
+ ProductStatus: je,
3485
+ ProductType: Ge,
3486
+ SortOrder: ze
3487
+ }, Symbol.toStringTag, { value: "Module" })), En = E`
2845
3488
  query findActiveOrderById($id: String) {
2846
3489
  findOrder(id: $id) {
2847
3490
  id
@@ -2915,7 +3558,7 @@ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2915
3558
  }
2916
3559
  }
2917
3560
  }
2918
- `, Mt = p`
3561
+ `, yn = E`
2919
3562
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2920
3563
  reserveProduct(
2921
3564
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2925,7 +3568,7 @@ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2925
3568
  amountReserved
2926
3569
  }
2927
3570
  }
2928
- `, Vt = p`
3571
+ `, vn = E`
2929
3572
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2930
3573
  releaseProduct(
2931
3574
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2934,7 +3577,7 @@ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2934
3577
  amountReleased
2935
3578
  }
2936
3579
  }
2937
- `, zt = p`
3580
+ `, An = E`
2938
3581
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
2939
3582
  configurePackage(
2940
3583
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2944,7 +3587,7 @@ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2944
3587
  amountReserved
2945
3588
  }
2946
3589
  }
2947
- `, qt = p`
3590
+ `, Tn = E`
2948
3591
  mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
2949
3592
  reserveAdditionalPackageItem(
2950
3593
  input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
@@ -2954,476 +3597,476 @@ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2954
3597
  amountReserved
2955
3598
  }
2956
3599
  }
2957
- `, Gt = p`
3600
+ `, On = E`
2958
3601
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2959
3602
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2960
3603
  }
2961
- `, jt = p`
3604
+ `, kn = E`
2962
3605
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2963
3606
  createOrderCustomer(
2964
3607
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2965
3608
  )
2966
3609
  }
2967
- `, Yt = p`
3610
+ `, Dn = E`
2968
3611
  mutation deleteOrder($orderId: ID!) {
2969
3612
  cancelOrder(id: $orderId)
2970
3613
  }
2971
- `, Ht = (r, e, t, i) => r();
2972
- function Qt(r, e = Ht) {
3614
+ `, xn = (e, t, n, i) => e();
3615
+ function Nn(e, t = xn) {
2973
3616
  return {
2974
- findActiveOrderById(t, i, n) {
2975
- return e((s) => r.request({ document: Ut, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "findActiveOrderById", "query", t);
3617
+ findActiveOrderById(n, i, r) {
3618
+ return t((s) => e.request({ document: En, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
2976
3619
  },
2977
- addToOrder(t, i, n) {
2978
- return e((s) => r.request({ document: Mt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "addToOrder", "mutation", t);
3620
+ addToOrder(n, i, r) {
3621
+ return t((s) => e.request({ document: yn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
2979
3622
  },
2980
- removeFromOrder(t, i, n) {
2981
- return e((s) => r.request({ document: Vt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "removeFromOrder", "mutation", t);
3623
+ removeFromOrder(n, i, r) {
3624
+ return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
2982
3625
  },
2983
- configurePackage(t, i, n) {
2984
- return e((s) => r.request({ document: zt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "configurePackage", "mutation", t);
3626
+ configurePackage(n, i, r) {
3627
+ return t((s) => e.request({ document: An, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
2985
3628
  },
2986
- reserveAdditionalPackageItem(t, i, n) {
2987
- return e((s) => r.request({ document: qt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "reserveAdditionalPackageItem", "mutation", t);
3629
+ reserveAdditionalPackageItem(n, i, r) {
3630
+ return t((s) => e.request({ document: Tn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
2988
3631
  },
2989
- configureOrderDeliveryOption(t, i, n) {
2990
- return e((s) => r.request({ document: Gt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "configureOrderDeliveryOption", "mutation", t);
3632
+ configureOrderDeliveryOption(n, i, r) {
3633
+ return t((s) => e.request({ document: On, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
2991
3634
  },
2992
- createOrderCustomer(t, i, n) {
2993
- return e((s) => r.request({ document: jt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "createOrderCustomer", "mutation", t);
3635
+ createOrderCustomer(n, i, r) {
3636
+ return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
2994
3637
  },
2995
- deleteOrder(t, i, n) {
2996
- return e((s) => r.request({ document: Yt, variables: t, requestHeaders: { ...i, ...s }, signal: n }), "deleteOrder", "mutation", t);
3638
+ deleteOrder(n, i, r) {
3639
+ return t((s) => e.request({ document: Dn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
2997
3640
  }
2998
3641
  };
2999
3642
  }
3000
- const W = {
3643
+ const Ee = {
3001
3644
  order: null,
3002
3645
  processing: !1,
3003
3646
  error: null
3004
- }, De = Ce({
3647
+ }, He = Xe({
3005
3648
  name: "basket",
3006
- initialState: W,
3649
+ initialState: Ee,
3007
3650
  reducers: {
3008
- setProcessing: (r, e) => {
3009
- r.processing = e.payload;
3651
+ setProcessing: (e, t) => {
3652
+ e.processing = t.payload;
3010
3653
  },
3011
- setError: (r, e) => {
3012
- r.error = e.payload;
3654
+ setError: (e, t) => {
3655
+ e.error = t.payload;
3013
3656
  },
3014
- setOrder: (r, e) => {
3015
- r.order = e.payload;
3657
+ setOrder: (e, t) => {
3658
+ e.order = t.payload;
3016
3659
  },
3017
- initializeOrder: (r, e) => {
3018
- r.order || (r.order = {
3019
- id: e.payload.id,
3020
- currency: e.payload.currency,
3660
+ initializeOrder: (e, t) => {
3661
+ e.order || (e.order = {
3662
+ id: t.payload.id,
3663
+ currency: t.payload.currency,
3021
3664
  items: [],
3022
- expiredAt: e.payload.expiredAt
3665
+ expiredAt: t.payload.expiredAt
3023
3666
  });
3024
3667
  },
3025
- addProduct: (r, e) => {
3026
- const { input: t, amountReserved: i, expiredAt: n } = e.payload;
3027
- if (!r.order)
3668
+ addProduct: (e, t) => {
3669
+ const { input: n, amountReserved: i, expiredAt: r } = t.payload;
3670
+ if (!e.order)
3028
3671
  return;
3029
- const s = r.order.items.findIndex((o) => t.seat ? o.id === t.id && o.seats?.some((u) => u.id === t.seat?.id) : o.id === t.id);
3672
+ const s = e.order.items.findIndex((o) => n.seat ? o.id === n.id && o.seats?.some((u) => u.id === n.seat?.id) : o.id === n.id);
3030
3673
  if (s >= 0)
3031
- r.order.items[s].amount += i;
3674
+ e.order.items[s].amount += i;
3032
3675
  else {
3033
3676
  const o = {
3034
- id: t.id,
3677
+ id: n.id,
3035
3678
  type: "PRODUCT",
3036
- name: t.name,
3679
+ name: n.name,
3037
3680
  amount: i,
3038
- price: t.price,
3039
- depositPrice: t.depositPrice,
3040
- serviceFee: t.serviceFee,
3041
- originalPrice: t.price,
3042
- seats: t.seat ? [{ id: t.seat.id, label: t.seat.label }] : void 0
3681
+ price: n.price,
3682
+ depositPrice: n.depositPrice,
3683
+ serviceFee: n.serviceFee,
3684
+ originalPrice: n.price,
3685
+ seats: n.seat ? [{ id: n.seat.id, label: n.seat.label }] : void 0
3043
3686
  };
3044
- r.order.items.push(o);
3687
+ e.order.items.push(o);
3045
3688
  }
3046
- r.order.expiredAt = n;
3689
+ e.order.expiredAt = r;
3047
3690
  },
3048
- removeProduct: (r, e) => {
3049
- if (!r.order) return;
3050
- const { id: t, amountReleased: i, seatId: n } = e.payload, s = r.order.items.findIndex(
3051
- (o) => o.type === "PRODUCT" && o.id === t
3691
+ removeProduct: (e, t) => {
3692
+ if (!e.order) return;
3693
+ const { id: n, amountReleased: i, seatId: r } = t.payload, s = e.order.items.findIndex(
3694
+ (o) => o.type === "PRODUCT" && o.id === n
3052
3695
  );
3053
3696
  if (s !== -1) {
3054
- const o = r.order.items[s];
3697
+ const o = e.order.items[s];
3055
3698
  if (o.amount -= i, o.amount <= 0)
3056
- r.order.items.splice(s, 1);
3057
- else if (o.seats && n) {
3058
- const u = o.seats.findIndex((l) => l.id === n);
3699
+ e.order.items.splice(s, 1);
3700
+ else if (o.seats && r) {
3701
+ const u = o.seats.findIndex((h) => h.id === r);
3059
3702
  u !== -1 && o.seats.splice(u, 1);
3060
3703
  }
3061
3704
  }
3062
- r.order.items.length === 0 && (r.order = null);
3705
+ e.order.items.length === 0 && (e.order = null);
3063
3706
  },
3064
- configurePackage: (r, e) => {
3065
- const { input: t, amountReserved: i, expiredAt: n } = e.payload;
3066
- r.order || (r.order = {
3707
+ configurePackage: (e, t) => {
3708
+ const { input: n, amountReserved: i, expiredAt: r } = t.payload;
3709
+ e.order || (e.order = {
3067
3710
  id: "",
3068
- currency: t.currency,
3711
+ currency: n.currency,
3069
3712
  items: [],
3070
- expiredAt: n
3713
+ expiredAt: r
3071
3714
  });
3072
- const s = r.order.items.find(
3073
- (o) => o.type === "PACKAGE" && o.id === t.id
3715
+ const s = e.order.items.find(
3716
+ (o) => o.type === "PACKAGE" && o.id === n.id
3074
3717
  );
3075
- s ? (s.amount = i, s.packageItems = t.items) : r.order.items.push({
3076
- id: t.id,
3718
+ s ? (s.amount = i, s.packageItems = n.items) : e.order.items.push({
3719
+ id: n.id,
3077
3720
  type: "PACKAGE",
3078
- name: t.name,
3721
+ name: n.name,
3079
3722
  amount: i,
3080
- price: t.discountPrice ?? t.price,
3081
- depositPrice: t.depositPrice,
3082
- originalPrice: t.price,
3083
- serviceFee: t.serviceFee,
3084
- packageItems: t.items
3723
+ price: n.discountPrice ?? n.price,
3724
+ depositPrice: n.depositPrice,
3725
+ originalPrice: n.price,
3726
+ serviceFee: n.serviceFee,
3727
+ packageItems: n.items
3085
3728
  });
3086
3729
  },
3087
- reserveAdditionalPackageItem: (r, e) => {
3088
- const { input: t, amountReserved: i, expiredAt: n } = e.payload;
3089
- r.order || (r.order = {
3730
+ reserveAdditionalPackageItem: (e, t) => {
3731
+ const { input: n, amountReserved: i, expiredAt: r } = t.payload;
3732
+ e.order || (e.order = {
3090
3733
  id: "",
3091
- currency: t.currency,
3734
+ currency: n.currency,
3092
3735
  items: [],
3093
- expiredAt: n
3736
+ expiredAt: r
3094
3737
  });
3095
- const s = r.order.items.findIndex(
3096
- (u) => u.id === t.packageItemId
3097
- ), o = r.order.items[s];
3738
+ const s = e.order.items.findIndex(
3739
+ (u) => u.id === n.packageItemId
3740
+ ), o = e.order.items[s];
3098
3741
  o ? (o.amount = i, o.packageItems = [
3099
3742
  {
3100
- packageItemId: t.packageItemId,
3101
- eventId: t.eventId,
3102
- name: t.name,
3103
- startAt: t.startAt,
3104
- endAt: t.endAt
3743
+ packageItemId: n.packageItemId,
3744
+ eventId: n.eventId,
3745
+ name: n.name,
3746
+ startAt: n.startAt,
3747
+ endAt: n.endAt
3105
3748
  }
3106
- ], o.amount === 0 && r.order.items.splice(s, 1)) : r.order.items.push({
3107
- id: t.packageItemId,
3108
- type: k.ADD_ONS,
3109
- name: t.name,
3749
+ ], o.amount === 0 && e.order.items.splice(s, 1)) : e.order.items.push({
3750
+ id: n.packageItemId,
3751
+ type: L.ADD_ONS,
3752
+ name: n.name,
3110
3753
  amount: i,
3111
- price: t.discountPrice ?? t.price,
3112
- depositPrice: t.depositPrice,
3113
- originalPrice: t.price,
3114
- serviceFee: t.serviceFee,
3754
+ price: n.discountPrice ?? n.price,
3755
+ depositPrice: n.depositPrice,
3756
+ originalPrice: n.price,
3757
+ serviceFee: n.serviceFee,
3115
3758
  packageItems: [
3116
3759
  {
3117
- packageItemId: t.packageItemId,
3118
- eventId: t.eventId,
3119
- name: t.name,
3120
- startAt: t.startAt,
3121
- endAt: t.endAt
3760
+ packageItemId: n.packageItemId,
3761
+ eventId: n.eventId,
3762
+ name: n.name,
3763
+ startAt: n.startAt,
3764
+ endAt: n.endAt
3122
3765
  }
3123
3766
  ]
3124
3767
  });
3125
3768
  },
3126
- configureDelivery: (r, e) => {
3127
- if (!r.order) return;
3128
- const t = e.payload, i = r.order.items.findIndex(
3129
- (n) => n.type === "DELIVERY"
3769
+ configureDelivery: (e, t) => {
3770
+ if (!e.order) return;
3771
+ const n = t.payload, i = e.order.items.findIndex(
3772
+ (r) => r.type === "DELIVERY"
3130
3773
  );
3131
- if (t)
3774
+ if (n)
3132
3775
  if (i !== -1) {
3133
- const n = r.order.items[i];
3134
- n.id = t.id, n.name = t.name, n.price = t.price, n.serviceFee = t.serviceFee;
3776
+ const r = e.order.items[i];
3777
+ r.id = n.id, r.name = n.name, r.price = n.price, r.serviceFee = n.serviceFee;
3135
3778
  } else
3136
- r.order.items.push({
3137
- id: t.id,
3779
+ e.order.items.push({
3780
+ id: n.id,
3138
3781
  type: "PRODUCT",
3139
- name: t.name,
3782
+ name: n.name,
3140
3783
  amount: 1,
3141
- price: t.price,
3142
- originalPrice: t.price,
3143
- serviceFee: t.serviceFee
3784
+ price: n.price,
3785
+ originalPrice: n.price,
3786
+ serviceFee: n.serviceFee
3144
3787
  });
3145
- else i !== -1 && r.order.items.splice(i, 1);
3788
+ else i !== -1 && e.order.items.splice(i, 1);
3146
3789
  },
3147
- configureCustomer: (r, e) => {
3148
- r.order && (r.order.customer = e.payload);
3790
+ configureCustomer: (e, t) => {
3791
+ e.order && (e.order.customer = t.payload);
3149
3792
  },
3150
- clearBasket: () => W
3793
+ clearBasket: () => Ee
3151
3794
  }
3152
3795
  }), {
3153
- setProcessing: T,
3154
- initializeOrder: L,
3155
- addProduct: Z,
3156
- removeProduct: Jt,
3157
- configurePackage: ee,
3158
- configureDelivery: Xt,
3159
- configureCustomer: te,
3160
- reserveAdditionalPackageItem: Kt,
3161
- clearBasket: re
3162
- } = De.actions;
3163
- class be {
3796
+ setProcessing: _,
3797
+ initializeOrder: j,
3798
+ addProduct: ye,
3799
+ removeProduct: bn,
3800
+ configurePackage: ve,
3801
+ configureDelivery: Pn,
3802
+ configureCustomer: Ae,
3803
+ reserveAdditionalPackageItem: Sn,
3804
+ clearBasket: Te
3805
+ } = He.actions;
3806
+ class Qe {
3164
3807
  orderIdKey = "ORDER_ID";
3165
3808
  config;
3166
3809
  sdk;
3167
3810
  store;
3168
- constructor(e) {
3169
- this.config = e, this.store = _e({
3811
+ constructor(t) {
3812
+ this.config = t, this.store = Ke({
3170
3813
  reducer: {
3171
- basket: De.reducer
3814
+ basket: He.reducer
3172
3815
  }
3173
- }), this.sdk = Qt(new C(e.apiUrl)), this.restoreOrderFromSession().then(() => {
3816
+ }), this.sdk = Nn(new ae(t.apiUrl)), this.restoreOrderFromSession().then(() => {
3174
3817
  this.debugLog("Restore order from session");
3175
3818
  });
3176
3819
  }
3177
3820
  // Store functions
3178
- subscribe(e) {
3179
- return this.store.subscribe(e);
3821
+ subscribe(t) {
3822
+ return this.store.subscribe(t);
3180
3823
  }
3181
3824
  getCurrentOrder() {
3182
- const e = this.getState();
3183
- if (!e.order)
3825
+ const t = this.getState();
3826
+ if (!t.order)
3184
3827
  return null;
3185
- const t = e.order.items.reduce((i, n) => i + (n.amount || 0), 0);
3828
+ const n = t.order.items.reduce((i, r) => i + (r.amount || 0), 0);
3186
3829
  return {
3187
- ...e.order,
3188
- count: t
3830
+ ...t.order,
3831
+ count: n
3189
3832
  };
3190
3833
  }
3191
3834
  getSelectedPackageEvent() {
3192
- return this.getState().order?.items.flatMap((t) => t.packageItems?.map((i) => i.eventId) ?? []) ?? [];
3835
+ return this.getState().order?.items.flatMap((n) => n.packageItems?.map((i) => i.eventId) ?? []) ?? [];
3193
3836
  }
3194
3837
  // Basket update functions
3195
- async addProduct(e) {
3196
- this.store.dispatch(T(!0));
3838
+ async addProduct(t) {
3839
+ this.store.dispatch(_(!0));
3197
3840
  try {
3198
3841
  const i = this.getState().order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
3199
3842
  this.debugLog("Adding product", {
3200
- productId: e.id,
3843
+ productId: t.id,
3201
3844
  orderId: i,
3202
- amount: e.amount,
3203
- seat: e.seat
3845
+ amount: t.amount,
3846
+ seat: t.seat
3204
3847
  });
3205
- const n = await this.sdk.addToOrder({
3206
- productId: e.id,
3848
+ const r = await this.sdk.addToOrder({
3849
+ productId: t.id,
3207
3850
  orderId: i,
3208
- additionalData: e.seat ? {
3851
+ additionalData: t.seat ? {
3209
3852
  seat: {
3210
- seatId: e.seat.id,
3211
- seatLabel: e.seat.label,
3212
- holdToken: e.seat.holdToken
3853
+ seatId: t.seat.id,
3854
+ seatLabel: t.seat.label,
3855
+ holdToken: t.seat.holdToken
3213
3856
  }
3214
3857
  } : null,
3215
3858
  trackerId: this.config.trackerId,
3216
3859
  shopId: this.config.shopId,
3217
- amount: e.amount
3860
+ amount: t.amount
3218
3861
  });
3219
- if (n?.reserveProduct) {
3220
- const { orderId: s, expiredAt: o, amountReserved: u } = n.reserveProduct;
3221
- this.debugLog("Product added successfully", n.reserveProduct), sessionStorage.setItem(this.orderIdKey, i), this.store.dispatch(
3222
- L({
3862
+ if (r?.reserveProduct) {
3863
+ const { orderId: s, expiredAt: o, amountReserved: u } = r.reserveProduct;
3864
+ this.debugLog("Product added successfully", r.reserveProduct), sessionStorage.setItem(this.orderIdKey, i), this.store.dispatch(
3865
+ j({
3223
3866
  id: s,
3224
- currency: e.currency,
3225
- expiredAt: o ? y.fromISO(o) : void 0
3867
+ currency: t.currency,
3868
+ expiredAt: o ? x.fromISO(o) : void 0
3226
3869
  })
3227
3870
  ), this.store.dispatch(
3228
- Z({
3229
- input: e,
3871
+ ye({
3872
+ input: t,
3230
3873
  amountReserved: u,
3231
- expiredAt: o ? y.fromISO(o) : void 0
3874
+ expiredAt: o ? x.fromISO(o) : void 0
3232
3875
  })
3233
3876
  );
3234
3877
  }
3235
- } catch (t) {
3236
- throw this.debugLog("Error adding product", t), this.handleError(t), t;
3878
+ } catch (n) {
3879
+ throw this.debugLog("Error adding product", n), this.handleError(n), n;
3237
3880
  } finally {
3238
- this.store.dispatch(T(!1));
3881
+ this.store.dispatch(_(!1));
3239
3882
  }
3240
3883
  }
3241
- async removeProduct(e) {
3884
+ async removeProduct(t) {
3242
3885
  const i = this.getState().order;
3243
3886
  if (i) {
3244
- this.store.dispatch(T(!0));
3887
+ this.store.dispatch(_(!0));
3245
3888
  try {
3246
3889
  this.debugLog("Removing product", {
3247
- productId: e.id,
3890
+ productId: t.id,
3248
3891
  orderId: i.id,
3249
- amount: e.amount
3892
+ amount: t.amount
3250
3893
  });
3251
- const n = await this.sdk.removeFromOrder({
3252
- productId: e.id,
3894
+ const r = await this.sdk.removeFromOrder({
3895
+ productId: t.id,
3253
3896
  orderId: i.id,
3254
- additionalData: e.seat ? {
3897
+ additionalData: t.seat ? {
3255
3898
  seat: {
3256
- seatId: e.seat.id,
3257
- seatLabel: e.seat.label
3899
+ seatId: t.seat.id,
3900
+ seatLabel: t.seat.label
3258
3901
  }
3259
3902
  } : null,
3260
- amount: e.amount
3903
+ amount: t.amount
3261
3904
  });
3262
- if (n?.releaseProduct) {
3263
- const { amountReleased: s } = n.releaseProduct;
3264
- this.debugLog("Product removed successfully", n.releaseProduct), this.store.dispatch(
3265
- Jt({
3266
- id: e.id,
3905
+ if (r?.releaseProduct) {
3906
+ const { amountReleased: s } = r.releaseProduct;
3907
+ this.debugLog("Product removed successfully", r.releaseProduct), this.store.dispatch(
3908
+ bn({
3909
+ id: t.id,
3267
3910
  amountReleased: s,
3268
- seatId: e.seat?.id
3911
+ seatId: t.seat?.id
3269
3912
  })
3270
3913
  );
3271
3914
  const o = this.getState();
3272
3915
  (!o.order || o.order.items.length === 0) && (this.debugLog("Basket is now empty, cancelling order and clearing session"), await this.cancelOrder());
3273
3916
  }
3274
- } catch (n) {
3275
- throw this.debugLog("Error removing product", n), this.handleError(n), n;
3917
+ } catch (r) {
3918
+ throw this.debugLog("Error removing product", r), this.handleError(r), r;
3276
3919
  } finally {
3277
- this.store.dispatch(T(!1));
3920
+ this.store.dispatch(_(!1));
3278
3921
  }
3279
3922
  }
3280
3923
  }
3281
- async configurePackage(e) {
3282
- this.store.dispatch(T(!0));
3924
+ async configurePackage(t) {
3925
+ this.store.dispatch(_(!0));
3283
3926
  try {
3284
- const i = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId(), n = e.items.map((o) => ({
3927
+ const i = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId(), r = t.items.map((o) => ({
3285
3928
  packageItemId: o.packageItemId,
3286
3929
  eventId: o.eventId
3287
3930
  }));
3288
3931
  this.debugLog("Configuring package", {
3289
- packageId: e.id,
3932
+ packageId: t.id,
3290
3933
  orderId: i,
3291
- amount: e.amount,
3292
- items: n,
3934
+ amount: t.amount,
3935
+ items: r,
3293
3936
  shopId: this.config.shopId
3294
3937
  });
3295
3938
  const s = await this.sdk.configurePackage({
3296
3939
  trackerId: this.config.trackerId,
3297
3940
  shopId: this.config.shopId,
3298
- packageId: e.id,
3941
+ packageId: t.id,
3299
3942
  orderId: i,
3300
- amount: e.amount,
3301
- items: n
3943
+ amount: t.amount,
3944
+ items: r
3302
3945
  });
3303
3946
  if (this.debugLog("Configure package response", s), s?.configurePackage && s.configurePackage.amountReserved > 0) {
3304
- const { orderId: o, expiredAt: u, amountReserved: l } = s.configurePackage;
3947
+ const { orderId: o, expiredAt: u, amountReserved: h } = s.configurePackage;
3305
3948
  return this.debugLog("Package configured successfully"), sessionStorage.setItem(this.orderIdKey, i), this.store.dispatch(
3306
- L({
3949
+ j({
3307
3950
  id: o,
3308
- currency: e.currency,
3309
- expiredAt: u ? y.fromISO(u) : void 0
3951
+ currency: t.currency,
3952
+ expiredAt: u ? x.fromISO(u) : void 0
3310
3953
  })
3311
3954
  ), this.store.dispatch(
3312
- ee({
3313
- input: e,
3314
- amountReserved: l,
3315
- expiredAt: u ? y.fromISO(u) : void 0
3955
+ ve({
3956
+ input: t,
3957
+ amountReserved: h,
3958
+ expiredAt: u ? x.fromISO(u) : void 0
3316
3959
  })
3317
3960
  ), null;
3318
3961
  } else
3319
3962
  return this.debugLog("Package configuration failed - no amount reserved"), { error: "Failed to configure package - no items reserved" };
3320
- } catch (t) {
3321
- return this.debugLog("Error configuring package", t), this.handleError(t), { error: t };
3963
+ } catch (n) {
3964
+ return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
3322
3965
  } finally {
3323
- this.store.dispatch(T(!1));
3966
+ this.store.dispatch(_(!1));
3324
3967
  }
3325
3968
  }
3326
- async configureDelivery(e) {
3327
- this.store.dispatch(T(!0));
3969
+ async configureDelivery(t) {
3970
+ this.store.dispatch(_(!0));
3328
3971
  try {
3329
- this.store.dispatch(Xt(e));
3330
- } catch (t) {
3331
- throw this.debugLog("Error setting delivery", t), this.handleError(t), t;
3972
+ this.store.dispatch(Pn(t));
3973
+ } catch (n) {
3974
+ throw this.debugLog("Error setting delivery", n), this.handleError(n), n;
3332
3975
  } finally {
3333
- this.store.dispatch(T(!1));
3976
+ this.store.dispatch(_(!1));
3334
3977
  }
3335
3978
  }
3336
- async configureCustomer(e) {
3979
+ async configureCustomer(t) {
3337
3980
  const i = this.getState().order;
3338
3981
  if (!i)
3339
3982
  throw new Error("No active order. Add items to basket first.");
3340
- this.debugLog("Creating/replacing customer", { orderId: i.id, email: e.email });
3983
+ this.debugLog("Creating/replacing customer", { orderId: i.id, email: t.email });
3341
3984
  try {
3342
- const n = await this.sdk.createOrderCustomer({
3985
+ const r = await this.sdk.createOrderCustomer({
3343
3986
  orderId: i.id,
3344
- customer: e
3987
+ customer: t
3345
3988
  });
3346
- this.debugLog("Customer set successfully", n), this.store.dispatch(te(e));
3347
- } catch (n) {
3348
- throw this.debugLog("Failed to set customer", n), new Error(`Failed to set customer: ${n.message}`);
3989
+ this.debugLog("Customer set successfully", r), this.store.dispatch(Ae(t));
3990
+ } catch (r) {
3991
+ throw this.debugLog("Failed to set customer", r), new Error(`Failed to set customer: ${r.message}`);
3349
3992
  }
3350
3993
  }
3351
- async reserveAdditionalPackageItem(e) {
3352
- this.store.dispatch(T(!0));
3994
+ async reserveAdditionalPackageItem(t) {
3995
+ this.store.dispatch(_(!0));
3353
3996
  try {
3354
3997
  const i = this.store.getState().basket.order?.id ?? sessionStorage.getItem(this.orderIdKey) ?? this.generateOrderId();
3355
3998
  this.debugLog("reserve additional packageItem", {
3356
3999
  orderId: i,
3357
- eventId: e.eventId,
3358
- amount: e.amount,
3359
- packageId: e.packageId,
3360
- packageItemId: e.packageItemId
4000
+ eventId: t.eventId,
4001
+ amount: t.amount,
4002
+ packageId: t.packageId,
4003
+ packageItemId: t.packageItemId
3361
4004
  });
3362
- const n = await this.sdk.reserveAdditionalPackageItem({
4005
+ const r = await this.sdk.reserveAdditionalPackageItem({
3363
4006
  orderId: i,
3364
- eventId: e.eventId,
3365
- amount: e.amount,
3366
- packageId: e.packageId,
3367
- packageItemId: e.packageItemId
4007
+ eventId: t.eventId,
4008
+ amount: t.amount,
4009
+ packageId: t.packageId,
4010
+ packageItemId: t.packageItemId
3368
4011
  });
3369
- if (this.debugLog("reserve additional packageItem", n), n?.reserveAdditionalPackageItem && n.reserveAdditionalPackageItem.amountReserved > 0) {
3370
- const { orderId: s, expiredAt: o, amountReserved: u } = n.reserveAdditionalPackageItem;
4012
+ if (this.debugLog("reserve additional packageItem", r), r?.reserveAdditionalPackageItem && r.reserveAdditionalPackageItem.amountReserved > 0) {
4013
+ const { orderId: s, expiredAt: o, amountReserved: u } = r.reserveAdditionalPackageItem;
3371
4014
  return this.debugLog("Reserve configured successfully"), sessionStorage.setItem(this.orderIdKey, i), this.store.dispatch(
3372
- L({
4015
+ j({
3373
4016
  id: s,
3374
- currency: e.currency,
3375
- expiredAt: o ? y.fromISO(o) : void 0
4017
+ currency: t.currency,
4018
+ expiredAt: o ? x.fromISO(o) : void 0
3376
4019
  })
3377
4020
  ), this.store.dispatch(
3378
- Kt({
3379
- input: e,
4021
+ Sn({
4022
+ input: t,
3380
4023
  amountReserved: u,
3381
- expiredAt: o ? y.fromISO(o) : void 0
4024
+ expiredAt: o ? x.fromISO(o) : void 0
3382
4025
  })
3383
4026
  ), null;
3384
4027
  } else
3385
4028
  return this.debugLog("Package configuration failed - no amount reserved"), { error: "Failed to configure package - no items reserved" };
3386
- } catch (t) {
3387
- return this.debugLog("Error configuring package", t), this.handleError(t), { error: t };
4029
+ } catch (n) {
4030
+ return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
3388
4031
  } finally {
3389
- this.store.dispatch(T(!1));
4032
+ this.store.dispatch(_(!1));
3390
4033
  }
3391
4034
  }
3392
4035
  // Cancel and clear order functions
3393
4036
  async cancelOrder() {
3394
- const e = sessionStorage.getItem(this.orderIdKey);
3395
- e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
4037
+ const t = sessionStorage.getItem(this.orderIdKey);
4038
+ t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.clearOrderFromSession(), this.debugLog("Order cancelled successfully"));
3396
4039
  }
3397
4040
  clearOrderFromSession() {
3398
- this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(re());
4041
+ this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(Te());
3399
4042
  }
3400
4043
  // Private functions for fetching the current order from a session
3401
4044
  async restoreOrderFromSession() {
3402
- const e = sessionStorage.getItem(this.orderIdKey);
3403
- if (e) {
3404
- this.debugLog("Found existing order ID in session, restoring...", { orderId: e });
4045
+ const t = sessionStorage.getItem(this.orderIdKey);
4046
+ if (t) {
4047
+ this.debugLog("Found existing order ID in session, restoring...", { orderId: t });
3405
4048
  try {
3406
- await this.fetchOrder(e), this.debugLog("Order restored successfully");
3407
- } catch (t) {
3408
- this.debugLog("Failed to restore order, clearing session", t), this.clearOrderFromSession();
4049
+ await this.fetchOrder(t), this.debugLog("Order restored successfully");
4050
+ } catch (n) {
4051
+ this.debugLog("Failed to restore order, clearing session", n), this.clearOrderFromSession();
3409
4052
  }
3410
4053
  }
3411
4054
  }
3412
- async fetchOrder(e) {
3413
- this.debugLog("Fetching order from server", { orderId: e });
4055
+ async fetchOrder(t) {
4056
+ this.debugLog("Fetching order from server", { orderId: t });
3414
4057
  try {
3415
- const t = await this.sdk.findActiveOrderById({ id: e });
3416
- if (!t?.findOrder) {
4058
+ const n = await this.sdk.findActiveOrderById({ id: t });
4059
+ if (!n?.findOrder) {
3417
4060
  this.debugLog("Order not found"), this.clearOrderFromSession();
3418
4061
  return;
3419
4062
  }
3420
- const i = t.findOrder;
4063
+ const i = n.findOrder;
3421
4064
  this.debugLog("Order fetched successfully", i);
3422
- const n = i.items, s = n.filter((c) => c.product != null && c.amount > 0).map((c) => {
3423
- let E = k.PRODUCT;
3424
- return c.product.type === "PROMOTER" ? E = k.ADD_ONS : c.product.type === "PICKUP" ? E = k.PICKUP : c.product.type === "DELIVERY" && (E = k.DELIVERY), {
4065
+ const r = i.items, s = r.filter((c) => c.product != null && c.amount > 0).map((c) => {
4066
+ let m = L.PRODUCT;
4067
+ return c.product.type === "PROMOTER" ? m = L.ADD_ONS : c.product.type === "PICKUP" ? m = L.PICKUP : c.product.type === "DELIVERY" && (m = L.DELIVERY), {
3425
4068
  id: c.product.id,
3426
- type: E,
4069
+ type: m,
3427
4070
  name: c.product.name,
3428
4071
  icon: c.product.icon,
3429
4072
  description: c.product.description,
@@ -3432,43 +4075,43 @@ class be {
3432
4075
  depositPrice: c.depositPrice ?? 0,
3433
4076
  originalPrice: c.originalPrice ?? 0,
3434
4077
  serviceFee: c.serviceFee ?? 0,
3435
- seats: c.seats?.map((m) => ({
3436
- id: m.id,
3437
- label: m.label
4078
+ seats: c.seats?.map((g) => ({
4079
+ id: g.id,
4080
+ label: g.label
3438
4081
  }))
3439
4082
  };
3440
- }), o = n.filter((c) => c.packageItem != null && c.amount > 0).reduce((c, E) => {
4083
+ }), o = r.filter((c) => c.packageItem != null && c.amount > 0).reduce((c, m) => {
3441
4084
  const {
3442
- packageItem: m,
3443
- event: O,
4085
+ packageItem: g,
4086
+ event: y,
3444
4087
  amount: I,
3445
- price: A,
3446
- serviceFee: Y,
3447
- depositPrice: H,
3448
- originalPrice: Q
3449
- } = E, v = m.package.id;
3450
- c[v] ? (c[v].price += A ?? 0, c[v].serviceFee += Y ?? 0, c[v].originalPrice += Q ?? 0, c[v].depositPrice += H ?? A ?? 0) : c[v] = {
3451
- id: v,
3452
- type: k.PACKAGE,
3453
- name: m.package.name,
4088
+ price: O,
4089
+ serviceFee: N,
4090
+ depositPrice: k,
4091
+ originalPrice: R
4092
+ } = m, T = g.package.id;
4093
+ c[T] ? (c[T].price += O ?? 0, c[T].serviceFee += N ?? 0, c[T].originalPrice += R ?? 0, c[T].depositPrice += k ?? O ?? 0) : c[T] = {
4094
+ id: T,
4095
+ type: L.PACKAGE,
4096
+ name: g.package.name,
3454
4097
  amount: I,
3455
- price: A ?? 0,
3456
- serviceFee: Y ?? 0,
3457
- depositPrice: H ?? A ?? 0,
3458
- originalPrice: Q ?? 0,
4098
+ price: O ?? 0,
4099
+ serviceFee: N ?? 0,
4100
+ depositPrice: k ?? O ?? 0,
4101
+ originalPrice: R ?? 0,
3459
4102
  packageItems: []
3460
4103
  };
3461
- const Pe = y.fromISO(O.startAt, {
3462
- zone: O.timezone
3463
- }), Se = y.fromISO(O.endAt, {
3464
- zone: O.timezone
4104
+ const b = x.fromISO(y.startAt, {
4105
+ zone: y.timezone
4106
+ }), D = x.fromISO(y.endAt, {
4107
+ zone: y.timezone
3465
4108
  });
3466
- return c[v].packageItems.push({
3467
- packageItemId: m.id,
3468
- eventId: O.id,
3469
- name: O.name,
3470
- startAt: Pe,
3471
- endAt: Se
4109
+ return c[T].packageItems.push({
4110
+ packageItemId: g.id,
4111
+ eventId: y.id,
4112
+ name: y.name,
4113
+ startAt: b,
4114
+ endAt: D
3472
4115
  }), c;
3473
4116
  }, {}), u = [
3474
4117
  ...s,
@@ -3478,21 +4121,21 @@ class be {
3478
4121
  this.debugLog("All order items have zero or negative amounts, clearing session"), this.clearOrderFromSession();
3479
4122
  return;
3480
4123
  }
3481
- const l = n.filter((c) => c.amount > 0).map((c) => new Date(c.expiredAt).getTime());
3482
- if (l.length === 0) {
4124
+ const h = r.filter((c) => c.amount > 0).map((c) => new Date(c.expiredAt).getTime());
4125
+ if (h.length === 0) {
3483
4126
  this.debugLog("No valid items with expiration times, clearing session"), this.clearOrderFromSession();
3484
4127
  return;
3485
4128
  }
3486
- const f = y.fromMillis(Math.min(...l));
3487
- this.store.dispatch(re()), this.store.dispatch(
3488
- L({
4129
+ const p = x.fromMillis(Math.min(...h));
4130
+ this.store.dispatch(Te()), this.store.dispatch(
4131
+ j({
3489
4132
  id: i.id,
3490
4133
  currency: i.currency,
3491
- expiredAt: f
4134
+ expiredAt: p
3492
4135
  })
3493
4136
  ), u.forEach((c) => {
3494
- c.type === k.PACKAGE ? this.store.dispatch(
3495
- ee({
4137
+ c.type === L.PACKAGE ? this.store.dispatch(
4138
+ ve({
3496
4139
  input: {
3497
4140
  id: c.id,
3498
4141
  name: c.name,
@@ -3504,10 +4147,10 @@ class be {
3504
4147
  items: c.packageItems || []
3505
4148
  },
3506
4149
  amountReserved: c.amount,
3507
- expiredAt: f
4150
+ expiredAt: p
3508
4151
  })
3509
4152
  ) : this.store.dispatch(
3510
- Z({
4153
+ ye({
3511
4154
  input: {
3512
4155
  id: c.id,
3513
4156
  name: c.name,
@@ -3518,39 +4161,39 @@ class be {
3518
4161
  amount: c.amount
3519
4162
  },
3520
4163
  amountReserved: c.amount,
3521
- expiredAt: f
4164
+ expiredAt: p
3522
4165
  })
3523
4166
  );
3524
4167
  }), i.mainBooker && (this.debugLog("Order has customer (mainBooker)", i.mainBooker), this.store.dispatch(
3525
- te({
4168
+ Ae({
3526
4169
  firstName: i.mainBooker.firstName ?? void 0,
3527
4170
  lastName: i.mainBooker.lastName ?? void 0,
3528
4171
  email: i.mainBooker.email ?? void 0,
3529
4172
  age: i.mainBooker.age ?? void 0
3530
4173
  })
3531
4174
  )), this.debugLog("Order state fully synced", this.getState());
3532
- } catch (t) {
3533
- throw this.debugLog("Error fetching order", t), t;
4175
+ } catch (n) {
4176
+ throw this.debugLog("Error fetching order", n), n;
3534
4177
  }
3535
4178
  }
3536
4179
  // Private helper functions
3537
4180
  generateOrderId() {
3538
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
3539
- const t = Math.random() * 16 | 0;
3540
- return (e === "x" ? t : t & 3 | 8).toString(16);
4181
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
4182
+ const n = Math.random() * 16 | 0;
4183
+ return (t === "x" ? n : n & 3 | 8).toString(16);
3541
4184
  });
3542
4185
  }
3543
- debugLog(e, t) {
3544
- this.config.debug && console.log(`[BasketService] ${e}`, t || "");
4186
+ debugLog(t, n) {
4187
+ this.config.debug && console.log(`[BasketService] ${t}`, n || "");
3545
4188
  }
3546
- handleError(e) {
3547
- const t = e;
3548
- if (t.graphQLErrors && t.graphQLErrors.length > 0) {
3549
- const i = t.graphQLErrors[0];
4189
+ handleError(t) {
4190
+ const n = t;
4191
+ if (n.graphQLErrors && n.graphQLErrors.length > 0) {
4192
+ const i = n.graphQLErrors[0];
3550
4193
  i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3551
4194
  }
3552
- if (t.response?.errors && t.response.errors.length > 0) {
3553
- const i = t.response.errors[0];
4195
+ if (n.response?.errors && n.response.errors.length > 0) {
4196
+ const i = n.response.errors[0];
3554
4197
  console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
3555
4198
  }
3556
4199
  }
@@ -3558,61 +4201,61 @@ class be {
3558
4201
  return this.store.getState().basket;
3559
4202
  }
3560
4203
  }
3561
- const Wt = "https://api.ticketapp.com/graphql", ne = "TIC_TRACKER_ID";
3562
- class rr {
4204
+ const Cn = "https://api.ticketapp.com/graphql", Oe = "TIC_TRACKER_ID";
4205
+ class Fn {
3563
4206
  basket;
3564
4207
  event;
3565
4208
  payment;
3566
4209
  package;
3567
4210
  category;
3568
4211
  // Attach selected public types to the SDK class
3569
- static Types = $t;
3570
- constructor(e) {
3571
- const { organizationId: t, debug: i = !1, apiUrl: n = Wt } = e, s = this.getOrInitTrackerId();
3572
- this.basket = new be({ debug: i, apiUrl: n, shopId: e.shopId, trackerId: s }), this.event = new fe({ organizationId: t, debug: i, apiUrl: n, trackerId: s }), this.payment = new Ie({ debug: i, apiUrl: n }), this.package = new Ee({ organizationId: t, debug: i, apiUrl: n }), this.category = new ye({ organizationId: t, debug: i, apiUrl: n });
4212
+ static Types = In;
4213
+ constructor(t) {
4214
+ const { organizationId: n, debug: i = !1, apiUrl: r = Cn } = t, s = this.getOrInitTrackerId();
4215
+ this.basket = new Qe({ debug: i, apiUrl: r, shopId: t.shopId, trackerId: s }), this.event = new we({ organizationId: n, debug: i, apiUrl: r, trackerId: s }), this.payment = new $e({ debug: i, apiUrl: r }), this.package = new Be({ organizationId: n, debug: i, apiUrl: r }), this.category = new Ue({ organizationId: n, debug: i, apiUrl: r });
3573
4216
  }
3574
4217
  // Resolve tracker id from (in order): explicit config, URL query, or session storage
3575
4218
  // Persist to session when found via config or URL for subsequent page loads
3576
4219
  getOrInitTrackerId() {
3577
4220
  try {
3578
- let e = null, t = null;
4221
+ let t = null, n = null;
3579
4222
  if (typeof window < "u") {
3580
4223
  try {
3581
- t = new URL(window.location.href).searchParams.get("trackerId");
4224
+ n = new URL(window.location.href).searchParams.get("trackerId");
3582
4225
  } catch {
3583
4226
  }
3584
4227
  try {
3585
- e = window.sessionStorage?.getItem(ne) ?? null;
4228
+ t = window.sessionStorage?.getItem(Oe) ?? null;
3586
4229
  } catch {
3587
4230
  }
3588
4231
  }
3589
- if (t && t.trim().length > 0) {
4232
+ if (n && n.trim().length > 0) {
3590
4233
  try {
3591
- typeof window < "u" && window.sessionStorage && sessionStorage.setItem(ne, t);
4234
+ typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Oe, n);
3592
4235
  } catch {
3593
4236
  }
3594
- return t;
4237
+ return n;
3595
4238
  }
3596
- return e && e.trim().length > 0 ? e : void 0;
4239
+ return t && t.trim().length > 0 ? t : void 0;
3597
4240
  } catch {
3598
4241
  return;
3599
4242
  }
3600
4243
  }
3601
4244
  }
3602
4245
  export {
3603
- k as BasketOrderType,
3604
- be as BasketService,
3605
- ye as CategoryService,
3606
- fe as EventService,
3607
- Te as EventStatus,
3608
- B as PackageItemType,
3609
- Ee as PackageService,
3610
- Ae as PackageStatus,
3611
- Oe as PackageTabType,
3612
- xe as PaymentMethodFeeType,
3613
- Ie as PaymentService,
3614
- ve as ProductStatus,
3615
- Ne as ProductType,
3616
- ke as SortOrder,
3617
- rr as TicketappSDK
4246
+ L as BasketOrderType,
4247
+ Qe as BasketService,
4248
+ Ue as CategoryService,
4249
+ we as EventService,
4250
+ qe as EventStatus,
4251
+ X as PackageItemType,
4252
+ Be as PackageService,
4253
+ Ve as PackageStatus,
4254
+ Me as PackageTabType,
4255
+ Ye as PaymentMethodFeeType,
4256
+ $e as PaymentService,
4257
+ je as ProductStatus,
4258
+ Ge as ProductType,
4259
+ ze as SortOrder,
4260
+ Fn as TicketappSDK
3618
4261
  };