@builtbystack/sq-shopify-theme-sdk 0.0.31 → 0.0.32
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/README.md
CHANGED
|
@@ -1386,6 +1386,12 @@ MileItems はマイル商品の一覧を取得するための情報を表す。
|
|
|
1386
1386
|
|
|
1387
1387
|
オブジェクトのID
|
|
1388
1388
|
|
|
1389
|
+
#### isCancelled
|
|
1390
|
+
|
|
1391
|
+
> **isCancelled**: `boolean`
|
|
1392
|
+
|
|
1393
|
+
Shopifyマイル交換履歴をキャンセルしたかどうか
|
|
1394
|
+
|
|
1389
1395
|
#### mileItem
|
|
1390
1396
|
|
|
1391
1397
|
> **mileItem**: [`MileItem`](#type-aliasesmileitemmd)
|
|
@@ -1552,7 +1558,7 @@ PointCampaignOrderRuleTargetCustomerRank は会員ランク種別のポイント
|
|
|
1552
1558
|
|
|
1553
1559
|
> `optional` **fixedPoint**: `string`
|
|
1554
1560
|
|
|
1555
|
-
|
|
1561
|
+
顧客に適用されるキャンペーン固定ポイント
|
|
1556
1562
|
以下の場合はnullを返す
|
|
1557
1563
|
- 該当キャンペーンが存在しない場合
|
|
1558
1564
|
- 未ログイン状態の場合
|
|
@@ -356,6 +356,10 @@ export declare type MileOrder = {
|
|
|
356
356
|
* 交換日時
|
|
357
357
|
*/
|
|
358
358
|
exchangedAt: Date;
|
|
359
|
+
/**
|
|
360
|
+
* Shopifyマイル交換履歴をキャンセルしたかどうか
|
|
361
|
+
*/
|
|
362
|
+
isCancelled: boolean;
|
|
359
363
|
};
|
|
360
364
|
|
|
361
365
|
/**
|
|
@@ -440,7 +444,7 @@ export declare type PointCampaignOrderRuleTargetCustomerRank = {
|
|
|
440
444
|
*/
|
|
441
445
|
multiplier?: string;
|
|
442
446
|
/**
|
|
443
|
-
*
|
|
447
|
+
* 顧客に適用されるキャンペーン固定ポイント
|
|
444
448
|
* 以下の場合はnullを返す
|
|
445
449
|
* - 該当キャンペーンが存在しない場合
|
|
446
450
|
* - 未ログイン状態の場合
|
|
@@ -61,22 +61,22 @@ function Ke(e) {
|
|
|
61
61
|
}
|
|
62
62
|
function Pe(e, t) {
|
|
63
63
|
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${a}:${p}
|
|
64
|
-
`, f = r.split(/\r\n|[\n\r]/g),
|
|
65
|
-
if (
|
|
66
|
-
const
|
|
67
|
-
for (let T = 0; T <
|
|
68
|
-
g.push(
|
|
64
|
+
`, f = r.split(/\r\n|[\n\r]/g), C = f[i];
|
|
65
|
+
if (C.length > 120) {
|
|
66
|
+
const y = Math.floor(p / 80), I = p % 80, g = [];
|
|
67
|
+
for (let T = 0; T < C.length; T += 80)
|
|
68
|
+
g.push(C.slice(T, T + 80));
|
|
69
69
|
return h + Ie([
|
|
70
70
|
[`${a} |`, g[0]],
|
|
71
|
-
...g.slice(1,
|
|
71
|
+
...g.slice(1, y + 1).map((T) => ["|", T]),
|
|
72
72
|
["|", "^".padStart(I)],
|
|
73
|
-
["|", g[
|
|
73
|
+
["|", g[y + 1]]
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
76
|
return h + Ie([
|
|
77
77
|
// Lines specified like this: ["prefix", "string"],
|
|
78
78
|
[`${a - 1} |`, f[i - 1]],
|
|
79
|
-
[`${a} |`,
|
|
79
|
+
[`${a} |`, C],
|
|
80
80
|
["|", "^".padStart(p)],
|
|
81
81
|
[`${a + 1} |`, f[i + 1]]
|
|
82
82
|
]);
|
|
@@ -97,7 +97,7 @@ function Ze(e) {
|
|
|
97
97
|
extensions: e[5]
|
|
98
98
|
} : t;
|
|
99
99
|
}
|
|
100
|
-
class
|
|
100
|
+
class ye extends Error {
|
|
101
101
|
/**
|
|
102
102
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
103
103
|
* which correspond to this error.
|
|
@@ -138,18 +138,18 @@ class Ce extends Error {
|
|
|
138
138
|
*/
|
|
139
139
|
constructor(t, ...n) {
|
|
140
140
|
var r, i, s;
|
|
141
|
-
const { nodes: a, source: c, positions: p, path: h, originalError: f, extensions:
|
|
141
|
+
const { nodes: a, source: c, positions: p, path: h, originalError: f, extensions: C } = Ze(n);
|
|
142
142
|
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = f ?? void 0, this.nodes = Te(
|
|
143
143
|
Array.isArray(a) ? a : a ? [a] : void 0
|
|
144
144
|
);
|
|
145
|
-
const
|
|
145
|
+
const y = Te(
|
|
146
146
|
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
|
|
147
147
|
);
|
|
148
|
-
this.source = c ?? (
|
|
148
|
+
this.source = c ?? (y == null || (i = y[0]) === null || i === void 0 ? void 0 : i.source), this.positions = p ?? (y == null ? void 0 : y.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : y == null ? void 0 : y.map((g) => he(g.source, g.start));
|
|
149
149
|
const I = Je(
|
|
150
150
|
f == null ? void 0 : f.extensions
|
|
151
151
|
) ? f == null ? void 0 : f.extensions : void 0;
|
|
152
|
-
this.extensions = (s =
|
|
152
|
+
this.extensions = (s = C ?? I) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
153
153
|
message: {
|
|
154
154
|
writable: !0,
|
|
155
155
|
enumerable: !0
|
|
@@ -173,7 +173,7 @@ class Ce extends Error {
|
|
|
173
173
|
value: f.stack,
|
|
174
174
|
writable: !0,
|
|
175
175
|
configurable: !0
|
|
176
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
176
|
+
}) : Error.captureStackTrace ? Error.captureStackTrace(this, ye) : Object.defineProperty(this, "stack", {
|
|
177
177
|
value: Error().stack,
|
|
178
178
|
writable: !0,
|
|
179
179
|
configurable: !0
|
|
@@ -207,7 +207,7 @@ function Te(e) {
|
|
|
207
207
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
208
208
|
}
|
|
209
209
|
function R(e, t, n) {
|
|
210
|
-
return new
|
|
210
|
+
return new ye(`Syntax Error: ${n}`, {
|
|
211
211
|
source: e,
|
|
212
212
|
positions: [t]
|
|
213
213
|
});
|
|
@@ -412,11 +412,11 @@ function it(e) {
|
|
|
412
412
|
function rt(e, t) {
|
|
413
413
|
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((I) => I.length === 0 || fe(I.charCodeAt(0))), a = n.endsWith('\\"""'), c = e.endsWith('"') && !a, p = e.endsWith("\\"), h = c || p, f = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
414
414
|
(!i || e.length > 70 || h || s || a);
|
|
415
|
-
let
|
|
416
|
-
const
|
|
417
|
-
return (f && !
|
|
418
|
-
`),
|
|
419
|
-
`), '"""' +
|
|
415
|
+
let C = "";
|
|
416
|
+
const y = i && fe(e.charCodeAt(0));
|
|
417
|
+
return (f && !y || s) && (C += `
|
|
418
|
+
`), C += n, (f || h) && (C += `
|
|
419
|
+
`), '"""' + C + '"""';
|
|
420
420
|
}
|
|
421
421
|
var u;
|
|
422
422
|
(function(e) {
|
|
@@ -839,18 +839,18 @@ function ae(e, t) {
|
|
|
839
839
|
case "function":
|
|
840
840
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
841
841
|
case "object":
|
|
842
|
-
return
|
|
842
|
+
return Ct(e, t);
|
|
843
843
|
default:
|
|
844
844
|
return String(e);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function Ct(e, t) {
|
|
848
848
|
if (e === null)
|
|
849
849
|
return "null";
|
|
850
850
|
if (t.includes(e))
|
|
851
851
|
return "[Circular]";
|
|
852
852
|
const n = [...t, e];
|
|
853
|
-
if (
|
|
853
|
+
if (yt(e)) {
|
|
854
854
|
const r = e.toJSON();
|
|
855
855
|
if (r !== e)
|
|
856
856
|
return typeof r == "string" ? r : ae(r, n);
|
|
@@ -858,7 +858,7 @@ function yt(e, t) {
|
|
|
858
858
|
return At(e, n);
|
|
859
859
|
return Et(e, n);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function yt(e) {
|
|
862
862
|
return typeof e.toJSON == "function";
|
|
863
863
|
}
|
|
864
864
|
function Et(e, t) {
|
|
@@ -2228,13 +2228,13 @@ function Dt(e, t, n = be) {
|
|
|
2228
2228
|
const r = /* @__PURE__ */ new Map();
|
|
2229
2229
|
for (const D of Object.values(m))
|
|
2230
2230
|
r.set(D, bt(t, D));
|
|
2231
|
-
let i, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, f,
|
|
2232
|
-
const
|
|
2231
|
+
let i, s = Array.isArray(e), a = [e], c = -1, p = [], h = e, f, C;
|
|
2232
|
+
const y = [], I = [];
|
|
2233
2233
|
do {
|
|
2234
2234
|
c++;
|
|
2235
2235
|
const D = c === a.length, z = D && p.length !== 0;
|
|
2236
2236
|
if (D) {
|
|
2237
|
-
if (f = I.length === 0 ? void 0 :
|
|
2237
|
+
if (f = I.length === 0 ? void 0 : y[y.length - 1], h = C, C = I.pop(), z)
|
|
2238
2238
|
if (s) {
|
|
2239
2239
|
h = h.slice();
|
|
2240
2240
|
let b = 0;
|
|
@@ -2251,33 +2251,33 @@ function Dt(e, t, n = be) {
|
|
|
2251
2251
|
h[b] = M;
|
|
2252
2252
|
}
|
|
2253
2253
|
c = i.index, a = i.keys, p = i.edits, s = i.inArray, i = i.prev;
|
|
2254
|
-
} else if (
|
|
2255
|
-
if (f = s ? c : a[c], h =
|
|
2254
|
+
} else if (C) {
|
|
2255
|
+
if (f = s ? c : a[c], h = C[f], h == null)
|
|
2256
2256
|
continue;
|
|
2257
|
-
|
|
2257
|
+
y.push(f);
|
|
2258
2258
|
}
|
|
2259
2259
|
let _;
|
|
2260
2260
|
if (!Array.isArray(h)) {
|
|
2261
2261
|
var g, T;
|
|
2262
2262
|
xe(h) || Z(!1, `Invalid AST Node: ${Ee(h)}.`);
|
|
2263
2263
|
const b = D ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (T = r.get(h.kind)) === null || T === void 0 ? void 0 : T.enter;
|
|
2264
|
-
if (_ = b == null ? void 0 : b.call(t, h, f,
|
|
2264
|
+
if (_ = b == null ? void 0 : b.call(t, h, f, C, y, I), _ === Pt)
|
|
2265
2265
|
break;
|
|
2266
2266
|
if (_ === !1) {
|
|
2267
2267
|
if (!D) {
|
|
2268
|
-
|
|
2268
|
+
y.pop();
|
|
2269
2269
|
continue;
|
|
2270
2270
|
}
|
|
2271
2271
|
} else if (_ !== void 0 && (p.push([f, _]), !D))
|
|
2272
2272
|
if (xe(_))
|
|
2273
2273
|
h = _;
|
|
2274
2274
|
else {
|
|
2275
|
-
|
|
2275
|
+
y.pop();
|
|
2276
2276
|
continue;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
2279
|
if (_ === void 0 && z && p.push([f, h]), D)
|
|
2280
|
-
|
|
2280
|
+
y.pop();
|
|
2281
2281
|
else {
|
|
2282
2282
|
var P;
|
|
2283
2283
|
i = {
|
|
@@ -2286,7 +2286,7 @@ function Dt(e, t, n = be) {
|
|
|
2286
2286
|
keys: a,
|
|
2287
2287
|
edits: p,
|
|
2288
2288
|
prev: i
|
|
2289
|
-
}, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [],
|
|
2289
|
+
}, s = Array.isArray(h), a = s ? h : (P = n[h.kind]) !== null && P !== void 0 ? P : [], c = -1, p = [], C && I.push(C), C = h;
|
|
2290
2290
|
}
|
|
2291
2291
|
} while (i !== void 0);
|
|
2292
2292
|
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
@@ -3120,6 +3120,7 @@ const x = U, Vt = x`
|
|
|
3120
3120
|
}
|
|
3121
3121
|
miles
|
|
3122
3122
|
exchangedAt
|
|
3123
|
+
isCancelled
|
|
3123
3124
|
}
|
|
3124
3125
|
pageInfo {
|
|
3125
3126
|
startCursor
|
|
@@ -3149,6 +3150,7 @@ const x = U, Vt = x`
|
|
|
3149
3150
|
}
|
|
3150
3151
|
miles
|
|
3151
3152
|
exchangedAt
|
|
3153
|
+
isCancelled
|
|
3152
3154
|
}
|
|
3153
3155
|
}
|
|
3154
3156
|
}
|
|
@@ -3231,12 +3233,12 @@ const Ae = JSON, fn = (e) => e.toUpperCase(), gn = (e) => {
|
|
|
3231
3233
|
return e.forEach((n, r) => {
|
|
3232
3234
|
t[r] = n;
|
|
3233
3235
|
}), t;
|
|
3234
|
-
},
|
|
3236
|
+
}, Cn = (e, t, n) => e.document ? e : {
|
|
3235
3237
|
document: e,
|
|
3236
3238
|
variables: t,
|
|
3237
3239
|
requestHeaders: n,
|
|
3238
3240
|
signal: void 0
|
|
3239
|
-
},
|
|
3241
|
+
}, yn = (e, t, n) => e.query ? e : {
|
|
3240
3242
|
query: e,
|
|
3241
3243
|
variables: t,
|
|
3242
3244
|
requestHeaders: n,
|
|
@@ -3280,7 +3282,7 @@ var An = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
3280
3282
|
function vn(e) {
|
|
3281
3283
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3282
3284
|
}
|
|
3283
|
-
var
|
|
3285
|
+
var Ce = { exports: {} };
|
|
3284
3286
|
(function(e, t) {
|
|
3285
3287
|
var n = typeof self < "u" ? self : An, r = function() {
|
|
3286
3288
|
function s() {
|
|
@@ -3320,12 +3322,12 @@ var ye = { exports: {} };
|
|
|
3320
3322
|
], f = ArrayBuffer.isView || function(o) {
|
|
3321
3323
|
return o && h.indexOf(Object.prototype.toString.call(o)) > -1;
|
|
3322
3324
|
};
|
|
3323
|
-
function
|
|
3325
|
+
function C(o) {
|
|
3324
3326
|
if (typeof o != "string" && (o = String(o)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))
|
|
3325
3327
|
throw new TypeError("Invalid character in header field name");
|
|
3326
3328
|
return o.toLowerCase();
|
|
3327
3329
|
}
|
|
3328
|
-
function
|
|
3330
|
+
function y(o) {
|
|
3329
3331
|
return typeof o != "string" && (o = String(o)), o;
|
|
3330
3332
|
}
|
|
3331
3333
|
function I(o) {
|
|
@@ -3349,17 +3351,17 @@ var ye = { exports: {} };
|
|
|
3349
3351
|
}, this);
|
|
3350
3352
|
}
|
|
3351
3353
|
g.prototype.append = function(o, l) {
|
|
3352
|
-
o =
|
|
3354
|
+
o = C(o), l = y(l);
|
|
3353
3355
|
var E = this.map[o];
|
|
3354
3356
|
this.map[o] = E ? E + ", " + l : l;
|
|
3355
3357
|
}, g.prototype.delete = function(o) {
|
|
3356
|
-
delete this.map[
|
|
3358
|
+
delete this.map[C(o)];
|
|
3357
3359
|
}, g.prototype.get = function(o) {
|
|
3358
|
-
return o =
|
|
3360
|
+
return o = C(o), this.has(o) ? this.map[o] : null;
|
|
3359
3361
|
}, g.prototype.has = function(o) {
|
|
3360
|
-
return this.map.hasOwnProperty(
|
|
3362
|
+
return this.map.hasOwnProperty(C(o));
|
|
3361
3363
|
}, g.prototype.set = function(o, l) {
|
|
3362
|
-
this.map[
|
|
3364
|
+
this.map[C(o)] = y(l);
|
|
3363
3365
|
}, g.prototype.forEach = function(o, l) {
|
|
3364
3366
|
for (var E in this.map)
|
|
3365
3367
|
this.map.hasOwnProperty(E) && o.call(l, this.map[E], E, this);
|
|
@@ -3551,8 +3553,8 @@ var ye = { exports: {} };
|
|
|
3551
3553
|
})(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
|
|
3552
3554
|
var i = r;
|
|
3553
3555
|
t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
|
|
3554
|
-
})(
|
|
3555
|
-
var re =
|
|
3556
|
+
})(Ce, Ce.exports);
|
|
3557
|
+
var re = Ce.exports;
|
|
3556
3558
|
const te = /* @__PURE__ */ vn(re), In = /* @__PURE__ */ ze({
|
|
3557
3559
|
__proto__: null,
|
|
3558
3560
|
default: te
|
|
@@ -3575,22 +3577,22 @@ const te = /* @__PURE__ */ vn(re), In = /* @__PURE__ */ ze({
|
|
|
3575
3577
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3576
3578
|
}, xn = (e) => async (t) => {
|
|
3577
3579
|
const { url: n, query: r, variables: i, operationName: s, fetch: a, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
|
|
3578
|
-
let f = "",
|
|
3579
|
-
e === "POST" ? (
|
|
3580
|
+
let f = "", C;
|
|
3581
|
+
e === "POST" ? (C = Rn(r, i, s, c.jsonSerializer), typeof C == "string" && (h["Content-Type"] = "application/json")) : f = Tn({
|
|
3580
3582
|
query: r,
|
|
3581
3583
|
variables: i,
|
|
3582
3584
|
operationName: s,
|
|
3583
3585
|
jsonSerializer: c.jsonSerializer ?? Ae
|
|
3584
3586
|
});
|
|
3585
|
-
const
|
|
3587
|
+
const y = {
|
|
3586
3588
|
method: e,
|
|
3587
3589
|
headers: h,
|
|
3588
|
-
body:
|
|
3590
|
+
body: C,
|
|
3589
3591
|
...c
|
|
3590
3592
|
};
|
|
3591
|
-
let I = n, g =
|
|
3593
|
+
let I = n, g = y;
|
|
3592
3594
|
if (p) {
|
|
3593
|
-
const T = await Promise.resolve(p({ ...
|
|
3595
|
+
const T = await Promise.resolve(p({ ...y, url: n, operationName: s, variables: i })), { url: P, ...D } = T;
|
|
3594
3596
|
I = P, g = D;
|
|
3595
3597
|
}
|
|
3596
3598
|
return f && (I = `${I}?${f}`), await a(I, g);
|
|
@@ -3598,7 +3600,7 @@ const te = /* @__PURE__ */ vn(re), In = /* @__PURE__ */ ze({
|
|
|
3598
3600
|
class Sn {
|
|
3599
3601
|
constructor(t, n = {}) {
|
|
3600
3602
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
|
|
3601
|
-
const [i, s, a] = r, c =
|
|
3603
|
+
const [i, s, a] = r, c = yn(i, s, a), { headers: p, fetch: h = te, method: f = "POST", requestMiddleware: C, responseMiddleware: y, ...I } = this.requestConfig, { url: g } = this;
|
|
3602
3604
|
c.signal !== void 0 && (I.signal = c.signal);
|
|
3603
3605
|
const { operationName: T } = le(c.query);
|
|
3604
3606
|
return de({
|
|
@@ -3613,18 +3615,18 @@ class Sn {
|
|
|
3613
3615
|
fetch: h,
|
|
3614
3616
|
method: f,
|
|
3615
3617
|
fetchOptions: I,
|
|
3616
|
-
middleware:
|
|
3617
|
-
}).then((P) => (
|
|
3618
|
-
throw
|
|
3618
|
+
middleware: C
|
|
3619
|
+
}).then((P) => (y && y(P), P)).catch((P) => {
|
|
3620
|
+
throw y && y(P), P;
|
|
3619
3621
|
});
|
|
3620
3622
|
};
|
|
3621
3623
|
}
|
|
3622
3624
|
async request(t, ...n) {
|
|
3623
|
-
const [r, i] = n, s =
|
|
3624
|
-
s.signal !== void 0 && (
|
|
3625
|
+
const [r, i] = n, s = Cn(t, r, i), { headers: a, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: f, ...C } = this.requestConfig, { url: y } = this;
|
|
3626
|
+
s.signal !== void 0 && (C.signal = s.signal);
|
|
3625
3627
|
const { query: I, operationName: g } = le(s.document);
|
|
3626
3628
|
return de({
|
|
3627
|
-
url:
|
|
3629
|
+
url: y,
|
|
3628
3630
|
query: I,
|
|
3629
3631
|
variables: s.variables,
|
|
3630
3632
|
headers: {
|
|
@@ -3634,7 +3636,7 @@ class Sn {
|
|
|
3634
3636
|
operationName: g,
|
|
3635
3637
|
fetch: c,
|
|
3636
3638
|
method: p,
|
|
3637
|
-
fetchOptions:
|
|
3639
|
+
fetchOptions: C,
|
|
3638
3640
|
middleware: h
|
|
3639
3641
|
}).then((T) => (f && f(T), T.data)).catch((T) => {
|
|
3640
3642
|
throw f && f(T), T;
|
|
@@ -3683,9 +3685,9 @@ class Sn {
|
|
|
3683
3685
|
const de = async (e) => {
|
|
3684
3686
|
const { query: t, variables: n, fetchOptions: r } = e, i = xn(fn(e.method ?? "post")), s = Array.isArray(e.query), a = await i(e), c = await On(a, r.jsonSerializer ?? Ae), p = Array.isArray(c) ? !c.some(({ data: f }) => !f) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
|
|
3685
3687
|
if (a.ok && h && p) {
|
|
3686
|
-
const { errors: f, ...
|
|
3688
|
+
const { errors: f, ...C } = (Array.isArray(c), c), y = r.errorPolicy === "ignore" ? C : c;
|
|
3687
3689
|
return {
|
|
3688
|
-
...s ? { data:
|
|
3690
|
+
...s ? { data: y } : y,
|
|
3689
3691
|
headers: a.headers,
|
|
3690
3692
|
status: a.status
|
|
3691
3693
|
};
|
|
@@ -4286,7 +4288,8 @@ class bn {
|
|
|
4286
4288
|
endsAt: a.mileItem.endsAt ? new Date(a.mileItem.endsAt) : void 0
|
|
4287
4289
|
},
|
|
4288
4290
|
miles: a.miles,
|
|
4289
|
-
exchangedAt: new Date(a.exchangedAt)
|
|
4291
|
+
exchangedAt: new Date(a.exchangedAt),
|
|
4292
|
+
isCancelled: a.isCancelled
|
|
4290
4293
|
})),
|
|
4291
4294
|
pageInfo: s.purchasingCustomer.mileOrders.pageInfo
|
|
4292
4295
|
} : null;
|
|
@@ -4315,7 +4318,8 @@ class bn {
|
|
|
4315
4318
|
endsAt: n.mileItemExchange.mileOrder.mileItem.endsAt ? new Date(n.mileItemExchange.mileOrder.mileItem.endsAt) : void 0
|
|
4316
4319
|
},
|
|
4317
4320
|
miles: n.mileItemExchange.mileOrder.miles,
|
|
4318
|
-
exchangedAt: new Date(n.mileItemExchange.mileOrder.exchangedAt)
|
|
4321
|
+
exchangedAt: new Date(n.mileItemExchange.mileOrder.exchangedAt),
|
|
4322
|
+
isCancelled: n.mileItemExchange.mileOrder.isCancelled
|
|
4319
4323
|
} : null;
|
|
4320
4324
|
}
|
|
4321
4325
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function(P,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(P=typeof globalThis<"u"?globalThis:P||self,b(P.SQ={}))})(this,function(P){"use strict";var Dn=Object.defineProperty;var bn=(P,b,w)=>b in P?Dn(P,b,{enumerable:!0,configurable:!0,writable:!0,value:w}):P[b]=w;var He=(P,b,w)=>(bn(P,typeof b!="symbol"?b+"":b,w),w);function b(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var w=function(){return w=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},w.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function X(e,t){if(!!!e)throw new Error(t)}function Ye(e){return typeof e=="object"&&e!==null}function ze(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const Qe=/\r\n|[\n\r]/g;function ce(e,t){let n=0,i=1;for(const r of e.body.matchAll(Qe)){if(typeof r.index=="number"||ze(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Je(e){return Te(e.source,ce(e.source,e.start))}function Te(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,c=t.line===1?n:0,p=t.column+c,h=`${e.name}:${a}:${p}
|
|
2
|
-
`,f=i.split(/\r\n|[\n\r]/g),
|
|
3
|
-
`)}function Xe(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class le extends Error{constructor(t,...n){var i,r,s;const{nodes:a,source:c,positions:p,path:h,originalError:f,extensions:
|
|
2
|
+
`,f=i.split(/\r\n|[\n\r]/g),C=f[r];if(C.length>120){const y=Math.floor(p/80),I=p%80,g=[];for(let T=0;T<C.length;T+=80)g.push(C.slice(T,T+80));return h+Se([[`${a} |`,g[0]],...g.slice(1,y+1).map(T=>["|",T]),["|","^".padStart(I)],["|",g[y+1]]])}return h+Se([[`${a-1} |`,f[r-1]],[`${a} |`,C],["|","^".padStart(p)],[`${a+1} |`,f[r+1]]])}function Se(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
3
|
+
`)}function Xe(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class le extends Error{constructor(t,...n){var i,r,s;const{nodes:a,source:c,positions:p,path:h,originalError:f,extensions:C}=Xe(n);super(t),this.name="GraphQLError",this.path=h??void 0,this.originalError=f??void 0,this.nodes=xe(Array.isArray(a)?a:a?[a]:void 0);const y=xe((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=c??(y==null||(r=y[0])===null||r===void 0?void 0:r.source),this.positions=p??(y==null?void 0:y.map(g=>g.start)),this.locations=p&&c?p.map(g=>ce(c,g)):y==null?void 0:y.map(g=>ce(g.source,g.start));const I=Ye(f==null?void 0:f.extensions)?f==null?void 0:f.extensions:void 0;this.extensions=(s=C??I)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),f!=null&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,le):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
|
|
4
4
|
|
|
5
5
|
`+Je(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
|
|
6
6
|
|
|
7
|
-
`+Te(this.source,n);return t}toJSON(){const t={message:this.message};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}}function xe(e){return e===void 0||e.length===0?void 0:e}function R(e,t,n){return new le(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Ke{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Re{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Oe={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ze=new Set(Object.keys(Oe));function Ne(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Ze.has(t)}var U;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(U||(U={}));var de;(function(e){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"})(de||(de={}));var m;(function(e){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"})(m||(m={}));function pe(e){return e===9||e===32}function H(e){return e>=48&&e<=57}function Pe(e){return e>=97&&e<=122||e>=65&&e<=90}function De(e){return Pe(e)||e===95}function We(e){return Pe(e)||H(e)||e===95}function et(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var s;const c=e[a],p=tt(c);p!==c.length&&(i=(s=i)!==null&&s!==void 0?s:a,r=a,a!==0&&p<n&&(n=p))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function tt(e){let t=0;for(;t<e.length&&pe(e.charCodeAt(t));)++t;return t}function nt(e,t){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(I=>I.length===0||pe(I.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,p=e.endsWith("\\"),h=c||p,f=!(t!=null&&t.minimize)&&(!r||e.length>70||h||s||a);let
|
|
8
|
-
`),
|
|
9
|
-
`),'"""'+
|
|
7
|
+
`+Te(this.source,n);return t}toJSON(){const t={message:this.message};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}}function xe(e){return e===void 0||e.length===0?void 0:e}function R(e,t,n){return new le(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Ke{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Re{constructor(t,n,i,r,s,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Oe={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ze=new Set(Object.keys(Oe));function Ne(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Ze.has(t)}var U;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(U||(U={}));var de;(function(e){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"})(de||(de={}));var m;(function(e){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"})(m||(m={}));function pe(e){return e===9||e===32}function H(e){return e>=48&&e<=57}function Pe(e){return e>=97&&e<=122||e>=65&&e<=90}function De(e){return Pe(e)||e===95}function We(e){return Pe(e)||H(e)||e===95}function et(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var s;const c=e[a],p=tt(c);p!==c.length&&(i=(s=i)!==null&&s!==void 0?s:a,r=a,a!==0&&p<n&&(n=p))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function tt(e){let t=0;for(;t<e.length&&pe(e.charCodeAt(t));)++t;return t}function nt(e,t){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(I=>I.length===0||pe(I.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,p=e.endsWith("\\"),h=c||p,f=!(t!=null&&t.minimize)&&(!r||e.length>70||h||s||a);let C="";const y=r&&pe(e.charCodeAt(0));return(f&&!y||s)&&(C+=`
|
|
8
|
+
`),C+=n,(f||h)&&(C+=`
|
|
9
|
+
`),'"""'+C+'"""'}var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(u||(u={}));class it{constructor(t){const n=new Re(u.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==u.EOF)do if(t.next)t=t.next;else{const n=st(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}}function rt(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}function G(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function K(e,t){return be(e.charCodeAt(t))&&ke(e.charCodeAt(t+1))}function be(e){return e>=55296&&e<=56319}function ke(e){return e>=56320&&e<=57343}function B(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function x(e,t,n,i,r){const s=e.line,a=1+n-e.lineStart;return new Re(t,n,i,s,a,r)}function st(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return at(e,r);case 33:return x(e,u.BANG,r,r+1);case 36:return x(e,u.DOLLAR,r,r+1);case 38:return x(e,u.AMP,r,r+1);case 40:return x(e,u.PAREN_L,r,r+1);case 41:return x(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return x(e,u.SPREAD,r,r+3);break;case 58:return x(e,u.COLON,r,r+1);case 61:return x(e,u.EQUALS,r,r+1);case 64:return x(e,u.AT,r,r+1);case 91:return x(e,u.BRACKET_L,r,r+1);case 93:return x(e,u.BRACKET_R,r,r+1);case 123:return x(e,u.BRACE_L,r,r+1);case 124:return x(e,u.PIPE,r,r+1);case 125:return x(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?pt(e,r):ut(e,r)}if(H(s)||s===45)return ot(e,r,s);if(De(s))return ht(e,r);throw R(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:G(s)||K(n,r)?`Unexpected character: ${B(e,r)}.`:`Invalid character: ${B(e,r)}.`)}return x(e,u.EOF,i,i)}function at(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(s===10||s===13)break;if(G(s))++r;else if(K(n,r))r+=2;else break}return x(e,u.COMMENT,t,r,n.slice(t+1,r))}function ot(e,t,n){const i=e.source.body;let r=t,s=n,a=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),H(s))throw R(e.source,r,`Invalid number, unexpected digit after 0: ${B(e,r)}.`)}else r=he(e,r,s),s=i.charCodeAt(r);if(s===46&&(a=!0,s=i.charCodeAt(++r),r=he(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(a=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=he(e,r,s),s=i.charCodeAt(r)),s===46||De(s))throw R(e.source,r,`Invalid number, expected digit but got: ${B(e,r)}.`);return x(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}function he(e,t,n){if(!H(n))throw R(e.source,t,`Invalid number, expected digit but got: ${B(e,t)}.`);const i=e.source.body;let r=t+1;for(;H(i.charCodeAt(r));)++r;return r}function ut(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,a="";for(;r<i;){const c=n.charCodeAt(r);if(c===34)return a+=n.slice(s,r),x(e,u.STRING,t,r+1,a);if(c===92){a+=n.slice(s,r);const p=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?ct(e,r):lt(e,r):dt(e,r);a+=p.value,r+=p.size,s=r;continue}if(c===10||c===13)break;if(G(c))++r;else if(K(n,r))r+=2;else throw R(e.source,r,`Invalid character within String: ${B(e,r)}.`)}throw R(e.source,r,"Unterminated string.")}function ct(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const s=n.charCodeAt(t+r++);if(s===125){if(r<5||!G(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Y(s),i<0)break}throw R(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function lt(e,t){const n=e.source.body,i=_e(n,t+2);if(G(i))return{value:String.fromCodePoint(i),size:6};if(be(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=_e(n,t+8);if(ke(r))return{value:String.fromCodePoint(i,r),size:12}}throw R(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function _e(e,t){return Y(e.charCodeAt(t))<<12|Y(e.charCodeAt(t+1))<<8|Y(e.charCodeAt(t+2))<<4|Y(e.charCodeAt(t+3))}function Y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function dt(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
10
10
|
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw R(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function pt(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,a=s,c="";const p=[];for(;s<i;){const h=n.charCodeAt(s);if(h===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){c+=n.slice(a,s),p.push(c);const f=x(e,u.BLOCK_STRING,t,s+3,et(p).join(`
|
|
11
|
-
`));return e.line+=p.length-1,e.lineStart=r,f}if(h===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){c+=n.slice(a,s),a=s+1,s+=4;continue}if(h===10||h===13){c+=n.slice(a,s),p.push(c),h===13&&n.charCodeAt(s+1)===10?s+=2:++s,c="",a=s,r=s;continue}if(G(h))++s;else if(K(n,s))s+=2;else throw R(e.source,s,`Invalid character within String: ${B(e,s)}.`)}throw R(e.source,s,"Unterminated string.")}function ht(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(We(s))++r;else break}return x(e,u.NAME,t,r,n.slice(t,r))}const mt=10,Le=2;function me(e){return Z(e,[])}function Z(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ft(e,t);default:return String(e)}}function ft(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(gt(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Z(i,n)}else if(Array.isArray(e))return
|
|
11
|
+
`));return e.line+=p.length-1,e.lineStart=r,f}if(h===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){c+=n.slice(a,s),a=s+1,s+=4;continue}if(h===10||h===13){c+=n.slice(a,s),p.push(c),h===13&&n.charCodeAt(s+1)===10?s+=2:++s,c="",a=s,r=s;continue}if(G(h))++s;else if(K(n,s))s+=2;else throw R(e.source,s,`Invalid character within String: ${B(e,s)}.`)}throw R(e.source,s,"Unterminated string.")}function ht(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(We(s))++r;else break}return x(e,u.NAME,t,r,n.slice(t,r))}const mt=10,Le=2;function me(e){return Z(e,[])}function Z(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ft(e,t);default:return String(e)}}function ft(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(gt(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Z(i,n)}else if(Array.isArray(e))return yt(e,n);return Ct(e,n)}function gt(e){return typeof e.toJSON=="function"}function Ct(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Le?"["+Et(e)+"]":"{ "+n.map(([r,s])=>r+": "+Z(s,t)).join(", ")+" }"}function yt(e,t){if(e.length===0)return"[]";if(t.length>Le)return"[Array]";const n=Math.min(mt,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Z(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function Et(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const At=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const a=me(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
|
|
12
12
|
|
|
13
13
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
14
14
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -19,7 +19,7 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
19
19
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
20
20
|
versions may have different capabilities and behavior. The data from one
|
|
21
21
|
version used in the function from another could produce confusing and
|
|
22
|
-
spurious results.`)}}return!1};class we{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||X(!1,`Body must be a string. Received: ${me(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||X(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||X(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function vt(e){return At(e,we)}function Fe(e,t){return new It(e,t).parseDocument()}class It{constructor(t,n={}){const i=vt(t)?t:new we(t);this._lexer=new it(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(u.NAME);return this.node(t,{kind:m.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:m.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw R(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:m.OPERATION_DEFINITION,operation:U.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:m.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(u.NAME);switch(t.value){case"query":return U.QUERY;case"mutation":return U.MUTATION;case"subscription":return U.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:m.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:m.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:m.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:m.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:m.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(u.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:m.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:m.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:m.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:m.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:m.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:m.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:m.BOOLEAN,value:!0});case"false":return this.node(n,{kind:m.BOOLEAN,value:!1});case"null":return this.node(n,{kind:m.NULL});default:return this.node(n,{kind:m.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){const i=this._lexer.token.value;throw R(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:m.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:m.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:m.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:m.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:m.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(u.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:m.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:m.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:m.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:m.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);const i=this.parseNamedType();return this.node(t,{kind:m.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:m.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:m.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);const s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:m.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(u.EQUALS)&&(s=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(t,{kind:m.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:m.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:m.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:m.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:m.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw R(this._lexer.source,this._lexer.token.start,`${W(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:m.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===u.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:m.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:m.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:m.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:m.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(t,{kind:m.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(de,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ke(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw R(this._lexer.source,n.start,`Expected ${Me(t)}, found ${W(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw R(this._lexer.source,n.start,`Expected "${t}", found ${W(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return R(this._lexer.source,n.start,`Unexpected ${W(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==u.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw R(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function W(e){const t=e.value;return Me(e.kind)+(t!=null?` "${t}"`:"")}function Me(e){return rt(e)?`"${e}"`:e}function Tt(e){return`"${e.replace(St,xt)}"`}const St=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xt(e){return Rt[e.charCodeAt(0)]}const Rt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ot=Object.freeze({});function Nt(e,t,n=Oe){const i=new Map;for(const k of Object.values(m))i.set(k,Pt(t,k));let r,s=Array.isArray(e),a=[e],c=-1,p=[],h=e,f,y;const C=[],I=[];do{c++;const k=c===a.length,se=k&&p.length!==0;if(k){if(f=I.length===0?void 0:C[C.length-1],h=y,y=I.pop(),se)if(s){h=h.slice();let L=0;for(const[j,ae]of p){const oe=j-L;ae===null?(h.splice(oe,1),L++):h[oe]=ae}}else{h=Object.defineProperties({},Object.getOwnPropertyDescriptors(h));for(const[L,j]of p)h[L]=j}c=r.index,a=r.keys,p=r.edits,s=r.inArray,r=r.prev}else if(y){if(f=s?c:a[c],h=y[f],h==null)continue;C.push(f)}let F;if(!Array.isArray(h)){var g,T;Ne(h)||X(!1,`Invalid AST Node: ${me(h)}.`);const L=k?(g=i.get(h.kind))===null||g===void 0?void 0:g.leave:(T=i.get(h.kind))===null||T===void 0?void 0:T.enter;if(F=L==null?void 0:L.call(t,h,f,y,C,I),F===Ot)break;if(F===!1){if(!k){C.pop();continue}}else if(F!==void 0&&(p.push([f,F]),!k))if(Ne(F))h=F;else{C.pop();continue}}if(F===void 0&&se&&p.push([f,h]),k)C.pop();else{var D;r={inArray:s,index:c,keys:a,edits:p,prev:r},s=Array.isArray(h),a=s?h:(D=n[h.kind])!==null&&D!==void 0?D:[],c=-1,p=[],y&&I.push(y),y=h}}while(r!==void 0);return p.length!==0?p[p.length-1][1]:e}function Pt(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Dt(e){return Nt(e,kt)}const bt=80,kt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>d(e.definitions,`
|
|
22
|
+
spurious results.`)}}return!1};class we{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||X(!1,`Body must be a string. Received: ${me(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||X(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||X(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function vt(e){return At(e,we)}function Fe(e,t){return new It(e,t).parseDocument()}class It{constructor(t,n={}){const i=vt(t)?t:new we(t);this._lexer=new it(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(u.NAME);return this.node(t,{kind:m.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:m.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw R(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:m.OPERATION_DEFINITION,operation:U.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:m.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(u.NAME);switch(t.value){case"query":return U.QUERY;case"mutation":return U.MUTATION;case"subscription":return U.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:m.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:m.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:m.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:m.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:m.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(u.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:m.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:m.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:m.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:m.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:m.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:m.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:m.BOOLEAN,value:!0});case"false":return this.node(n,{kind:m.BOOLEAN,value:!1});case"null":return this.node(n,{kind:m.NULL});default:return this.node(n,{kind:m.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){const i=this._lexer.token.value;throw R(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:m.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:m.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:m.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:m.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:m.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(u.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:m.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:m.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:m.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:m.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);const i=this.parseNamedType();return this.node(t,{kind:m.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:m.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:m.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);const s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:m.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(u.EQUALS)&&(s=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(t,{kind:m.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:m.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:a})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:m.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:m.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:m.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw R(this._lexer.source,this._lexer.token.start,`${W(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:m.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===u.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:m.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:m.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:m.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:m.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:m.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(t,{kind:m.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(de,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Ke(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw R(this._lexer.source,n.start,`Expected ${Me(t)}, found ${W(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw R(this._lexer.source,n.start,`Expected "${t}", found ${W(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return R(this._lexer.source,n.start,`Unexpected ${W(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==u.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw R(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function W(e){const t=e.value;return Me(e.kind)+(t!=null?` "${t}"`:"")}function Me(e){return rt(e)?`"${e}"`:e}function Tt(e){return`"${e.replace(St,xt)}"`}const St=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xt(e){return Rt[e.charCodeAt(0)]}const Rt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ot=Object.freeze({});function Nt(e,t,n=Oe){const i=new Map;for(const k of Object.values(m))i.set(k,Pt(t,k));let r,s=Array.isArray(e),a=[e],c=-1,p=[],h=e,f,C;const y=[],I=[];do{c++;const k=c===a.length,se=k&&p.length!==0;if(k){if(f=I.length===0?void 0:y[y.length-1],h=C,C=I.pop(),se)if(s){h=h.slice();let L=0;for(const[j,ae]of p){const oe=j-L;ae===null?(h.splice(oe,1),L++):h[oe]=ae}}else{h=Object.defineProperties({},Object.getOwnPropertyDescriptors(h));for(const[L,j]of p)h[L]=j}c=r.index,a=r.keys,p=r.edits,s=r.inArray,r=r.prev}else if(C){if(f=s?c:a[c],h=C[f],h==null)continue;y.push(f)}let F;if(!Array.isArray(h)){var g,T;Ne(h)||X(!1,`Invalid AST Node: ${me(h)}.`);const L=k?(g=i.get(h.kind))===null||g===void 0?void 0:g.leave:(T=i.get(h.kind))===null||T===void 0?void 0:T.enter;if(F=L==null?void 0:L.call(t,h,f,C,y,I),F===Ot)break;if(F===!1){if(!k){y.pop();continue}}else if(F!==void 0&&(p.push([f,F]),!k))if(Ne(F))h=F;else{y.pop();continue}}if(F===void 0&&se&&p.push([f,h]),k)y.pop();else{var D;r={inArray:s,index:c,keys:a,edits:p,prev:r},s=Array.isArray(h),a=s?h:(D=n[h.kind])!==null&&D!==void 0?D:[],c=-1,p=[],C&&I.push(C),C=h}}while(r!==void 0);return p.length!==0?p[p.length-1][1]:e}function Pt(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Dt(e){return Nt(e,kt)}const bt=80,kt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>d(e.definitions,`
|
|
23
23
|
|
|
24
24
|
`)},OperationDefinition:{leave(e){const t=A("(",d(e.variableDefinitions,", "),")"),n=d([e.operation,d([e.name,t]),d(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+A(" = ",n)+A(" ",d(i," "))},SelectionSet:{leave:({selections:e})=>_(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=A("",e,": ")+t;let a=s+A("(",d(n,", "),")");return a.length>bt&&(a=s+A(`(
|
|
25
25
|
`,ee(d(n,`
|
|
@@ -530,6 +530,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
|
|
|
530
530
|
}
|
|
531
531
|
miles
|
|
532
532
|
exchangedAt
|
|
533
|
+
isCancelled
|
|
533
534
|
}
|
|
534
535
|
pageInfo {
|
|
535
536
|
startCursor
|
|
@@ -559,7 +560,8 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
|
|
|
559
560
|
}
|
|
560
561
|
miles
|
|
561
562
|
exchangedAt
|
|
563
|
+
isCancelled
|
|
562
564
|
}
|
|
563
565
|
}
|
|
564
566
|
}
|
|
565
|
-
`,dn=(e,t,n,i)=>e();function pn(e,t=dn){return{GetLocationAvailabilities(n,i){return t(r=>e.request(Gt,n,{...i,...r}),"GetLocationAvailabilities","query",n)},GetLocationAvailability(n,i){return t(r=>e.request($t,n,{...i,...r}),"GetLocationAvailability","query",n)},GetPurchasingCustomerMetafield(n,i){return t(r=>e.request(Vt,n,{...i,...r}),"GetPurchasingCustomerMetafield","query",n)},GetPoints(n,i){return t(r=>e.request(jt,n,{...i,...r}),"GetPoints","query",n)},GetLocations(n,i){return t(r=>e.request(Ht,n,{...i,...r}),"GetLocations","query",n)},GetPurchasingCustomerDiscounts(n,i){return t(r=>e.request(Yt,n,{...i,...r}),"GetPurchasingCustomerDiscounts","query",n)},GetPurchasingCustomerDiscountCodeCount(n,i){return t(r=>e.request(zt,n,{...i,...r}),"GetPurchasingCustomerDiscountCodeCount","query",n)},GetPurchasingCustomerPointChangeActivities(n,i){return t(r=>e.request(Qt,n,{...i,...r}),"GetPurchasingCustomerPointChangeActivities","query",n)},GetPurchasingCustomerRank(n,i){return t(r=>e.request(Jt,n,{...i,...r}),"GetPurchasingCustomerRank","query",n)},GetSharingPurchasingCustomerCount(n,i){return t(r=>e.request(Xt,n,{...i,...r}),"GetSharingPurchasingCustomerCount","query",n)},GetPurchasingCustomerSharing(n,i){return t(r=>e.request(Kt,n,{...i,...r}),"GetPurchasingCustomerSharing","query",n)},GetProduct(n,i){return t(r=>e.request(Zt,n,{...i,...r}),"GetProduct","query",n)},GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n,i){return t(r=>e.request(Wt,n,{...i,...r}),"GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID","query",n)},GetPointCampaignOrderRuleTargetCustomerRank(n,i){return t(r=>e.request(en,n,{...i,...r}),"GetPointCampaignOrderRuleTargetCustomerRank","query",n)},GetEstimatedShopifyCartPoint(n,i){return t(r=>e.request(tn,n,{...i,...r}),"GetEstimatedShopifyCartPoint","query",n)},GetEstimatedShopifyCartLineItemPoint(n,i){return t(r=>e.request(nn,n,{...i,...r}),"GetEstimatedShopifyCartLineItemPoint","query",n)},PurchasingCustomerSendCustomerSharingActivationCode(n,i){return t(r=>e.request(rn,n,{...i,...r}),"PurchasingCustomerSendCustomerSharingActivationCode","mutation",n)},PurchasingCustomerActivateCustomerSharing(n,i){return t(r=>e.request(sn,n,{...i,...r}),"PurchasingCustomerActivateCustomerSharing","mutation",n)},GetMiles(n,i){return t(r=>e.request(an,n,{...i,...r}),"GetMiles","query",n)},GetPurchasingCustomerMileChangeActivities(n,i){return t(r=>e.request(on,n,{...i,...r}),"GetPurchasingCustomerMileChangeActivities","query",n)},GetMileItems(n,i){return t(r=>e.request(un,n,{...i,...r}),"GetMileItems","query",n)},GetMileOrders(n,i){return t(r=>e.request(cn,n,{...i,...r}),"GetMileOrders","query",n)},MileItemExchange(n,i){return t(r=>e.request(ln,n,{...i,...r}),"MileItemExchange","mutation",n)}}}const ge=JSON,hn=e=>e.toUpperCase(),mn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},fn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},gn=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},yn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},Ge=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},ye=e=>{if(typeof e=="string"){let n;try{const i=Fe(e);n=Ge(i)}catch{}return{query:e,operationName:n}}const t=Ge(e);return{query:Dt(e),operationName:t}};class Q extends Error{constructor(t,n){const i=`${Q.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Q.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Q)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var Cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce={exports:{}};(function(e,t){var n=typeof self<"u"?self:Cn,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(a){var c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function p(o){return o&&DataView.prototype.isPrototypeOf(o)}if(c.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(o){return o&&h.indexOf(Object.prototype.toString.call(o))>-1};function y(o){if(typeof o!="string"&&(o=String(o)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))throw new TypeError("Invalid character in header field name");return o.toLowerCase()}function C(o){return typeof o!="string"&&(o=String(o)),o}function I(o){var l={next:function(){var E=o.shift();return{done:E===void 0,value:E}}};return c.iterable&&(l[Symbol.iterator]=function(){return l}),l}function g(o){this.map={},o instanceof g?o.forEach(function(l,E){this.append(E,l)},this):Array.isArray(o)?o.forEach(function(l){this.append(l[0],l[1])},this):o&&Object.getOwnPropertyNames(o).forEach(function(l){this.append(l,o[l])},this)}g.prototype.append=function(o,l){o=y(o),l=C(l);var E=this.map[o];this.map[o]=E?E+", "+l:l},g.prototype.delete=function(o){delete this.map[y(o)]},g.prototype.get=function(o){return o=y(o),this.has(o)?this.map[o]:null},g.prototype.has=function(o){return this.map.hasOwnProperty(y(o))},g.prototype.set=function(o,l){this.map[y(o)]=C(l)},g.prototype.forEach=function(o,l){for(var E in this.map)this.map.hasOwnProperty(E)&&o.call(l,this.map[E],E,this)},g.prototype.keys=function(){var o=[];return this.forEach(function(l,E){o.push(E)}),I(o)},g.prototype.values=function(){var o=[];return this.forEach(function(l){o.push(l)}),I(o)},g.prototype.entries=function(){var o=[];return this.forEach(function(l,E){o.push([E,l])}),I(o)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function T(o){if(o.bodyUsed)return Promise.reject(new TypeError("Already read"));o.bodyUsed=!0}function D(o){return new Promise(function(l,E){o.onload=function(){l(o.result)},o.onerror=function(){E(o.error)}})}function k(o){var l=new FileReader,E=D(l);return l.readAsArrayBuffer(o),E}function se(o){var l=new FileReader,E=D(l);return l.readAsText(o),E}function F(o){for(var l=new Uint8Array(o),E=new Array(l.length),N=0;N<l.length;N++)E[N]=String.fromCharCode(l[N]);return E.join("")}function L(o){if(o.slice)return o.slice(0);var l=new Uint8Array(o.byteLength);return l.set(new Uint8Array(o)),l.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(o){this._bodyInit=o,o?typeof o=="string"?this._bodyText=o:c.blob&&Blob.prototype.isPrototypeOf(o)?this._bodyBlob=o:c.formData&&FormData.prototype.isPrototypeOf(o)?this._bodyFormData=o:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)?this._bodyText=o.toString():c.arrayBuffer&&c.blob&&p(o)?(this._bodyArrayBuffer=L(o.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(o)||f(o))?this._bodyArrayBuffer=L(o):this._bodyText=o=Object.prototype.toString.call(o):this._bodyText="",this.headers.get("content-type")||(typeof o=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var o=T(this);if(o)return o;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?T(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(k)}),this.text=function(){var o=T(this);if(o)return o;if(this._bodyBlob)return se(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(F(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(On)}),this.json=function(){return this.text().then(JSON.parse)},this}var ae=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function oe(o){var l=o.toUpperCase();return ae.indexOf(l)>-1?l:o}function q(o,l){l=l||{};var E=l.body;if(o instanceof q){if(o.bodyUsed)throw new TypeError("Already read");this.url=o.url,this.credentials=o.credentials,l.headers||(this.headers=new g(o.headers)),this.method=o.method,this.mode=o.mode,this.signal=o.signal,!E&&o._bodyInit!=null&&(E=o._bodyInit,o.bodyUsed=!0)}else this.url=String(o);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new g(l.headers)),this.method=oe(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}q.prototype.clone=function(){return new q(this,{body:this._bodyInit})};function On(o){var l=new FormData;return o.trim().split("&").forEach(function(E){if(E){var N=E.split("="),O=N.shift().replace(/\+/g," "),v=N.join("=").replace(/\+/g," ");l.append(decodeURIComponent(O),decodeURIComponent(v))}}),l}function Nn(o){var l=new g,E=o.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(N){var O=N.split(":"),v=O.shift().trim();if(v){var ue=O.join(":").trim();l.append(v,ue)}}),l}j.call(q.prototype);function M(o,l){l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in l?l.statusText:"OK",this.headers=new g(l.headers),this.url=l.url||"",this._initBody(o)}j.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},M.error=function(){var o=new M(null,{status:0,statusText:""});return o.type="error",o};var Pn=[301,302,303,307,308];M.redirect=function(o,l){if(Pn.indexOf(l)===-1)throw new RangeError("Invalid status code");return new M(null,{status:l,headers:{location:o}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(l,E){this.message=l,this.name=E;var N=Error(l);this.stack=N.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ve(o,l){return new Promise(function(E,N){var O=new q(o,l);if(O.signal&&O.signal.aborted)return N(new a.DOMException("Aborted","AbortError"));var v=new XMLHttpRequest;function ue(){v.abort()}v.onload=function(){var J={status:v.status,statusText:v.statusText,headers:Nn(v.getAllResponseHeaders()||"")};J.url="responseURL"in v?v.responseURL:J.headers.get("X-Request-URL");var Ie="response"in v?v.response:v.responseText;E(new M(Ie,J))},v.onerror=function(){N(new TypeError("Network request failed"))},v.ontimeout=function(){N(new TypeError("Network request failed"))},v.onabort=function(){N(new a.DOMException("Aborted","AbortError"))},v.open(O.method,O.url,!0),O.credentials==="include"?v.withCredentials=!0:O.credentials==="omit"&&(v.withCredentials=!1),"responseType"in v&&c.blob&&(v.responseType="blob"),O.headers.forEach(function(J,Ie){v.setRequestHeader(Ie,J)}),O.signal&&(O.signal.addEventListener("abort",ue),v.onreadystatechange=function(){v.readyState===4&&O.signal.removeEventListener("abort",ue)}),v.send(typeof O._bodyInit>"u"?null:O._bodyInit)})}return ve.polyfill=!0,s.fetch||(s.fetch=ve,s.Headers=g,s.Request=q,s.Response=M),a.Headers=g,a.Request=q,a.Response=M,a.fetch=ve,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(Ce,Ce.exports);var ie=Ce.exports;const re=En(ie),An=b({__proto__:null,default:re},[ie]),V=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||An&&ie.Headers&&e instanceof ie.Headers?t=mn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},$e=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),vn=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent($e(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:$e(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},In=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:a,fetchOptions:c,middleware:p}=t,h={...t.headers};let f="",y;e==="POST"?(y=Sn(i,r,s,c.jsonSerializer),typeof y=="string"&&(h["Content-Type"]="application/json")):f=vn({query:i,variables:r,operationName:s,jsonSerializer:c.jsonSerializer??ge});const C={method:e,headers:h,body:y,...c};let I=n,g=C;if(p){const T=await Promise.resolve(p({...C,url:n,operationName:s,variables:r})),{url:D,...k}=T;I=D,g=k}return f&&(I=`${I}?${f}`),await a(I,g)};class Tn{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,a]=i,c=gn(r,s,a),{headers:p,fetch:h=re,method:f="POST",requestMiddleware:y,responseMiddleware:C,...I}=this.requestConfig,{url:g}=this;c.signal!==void 0&&(I.signal=c.signal);const{operationName:T}=ye(c.query);return Ee({url:g,query:c.query,variables:c.variables,headers:{...V(Ae(p)),...V(c.requestHeaders)},operationName:T,fetch:h,method:f,fetchOptions:I,middleware:y}).then(D=>(C&&C(D),D)).catch(D=>{throw C&&C(D),D})}}async request(t,...n){const[i,r]=n,s=fn(t,i,r),{headers:a,fetch:c=re,method:p="POST",requestMiddleware:h,responseMiddleware:f,...y}=this.requestConfig,{url:C}=this;s.signal!==void 0&&(y.signal=s.signal);const{query:I,operationName:g}=ye(s.document);return Ee({url:C,query:I,variables:s.variables,headers:{...V(Ae(a)),...V(s.requestHeaders)},operationName:g,fetch:c,method:p,fetchOptions:y,middleware:h}).then(T=>(f&&f(T),T.data)).catch(T=>{throw f&&f(T),T})}batchRequests(t,n){const i=yn(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const a=i.documents.map(({document:p})=>ye(p).query),c=i.documents.map(({variables:p})=>p);return Ee({url:this.url,query:a,variables:c,headers:{...V(Ae(r)),...V(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??re,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(p=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(p),p.data)).catch(p=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(p),p})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const Ee=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=In(hn(e.method??"post")),s=Array.isArray(e.query),a=await r(e),c=await xn(a,i.jsonSerializer??ge),p=Array.isArray(c)?!c.some(({data:f})=>!f):!!c.data,h=Array.isArray(c)||!c.errors||Array.isArray(c.errors)&&!c.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(a.ok&&h&&p){const{errors:f,...y}=(Array.isArray(c),c),C=i.errorPolicy==="ignore"?y:c;return{...s?{data:C}:C,headers:a.headers,status:a.status}}else{const f=typeof c=="string"?{error:c}:c;throw new Q({...f,status:a.status,headers:a.headers},{query:t,variables:n})}},Sn=(e,t,n,i)=>{const r=i??ge;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((a,c,p)=>(a.push({query:c,variables:t?t[p]:void 0}),a),[]);return r.stringify(s)},xn=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},Ae=e=>typeof e=="function"?e():e;var Ve=(e=>(e.Eur="EUR",e.Jpy="JPY",e.Usd="USD",e))(Ve||{}),je=(e=>(e.Retail="RETAIL",e.Warehouse="WAREHOUSE",e))(je||{});class Rn{constructor(t){He(this,"api");this.api=pn(new Tn(`${t}/apps/sq-api`,{headers:{"X-SQ-CLIENT":"ShopifyAppProxy"}}))}async getLocationAvailabilities(t,n,i,r){const s=await this.api.GetLocationAvailabilities({sku:t,first:n,after:i,isReverse:r});return{nodes:s.locationAvailabilities.nodes.map(a=>({location:{id:a.location.id,name:a.location.name,phone:a.location.phone,mapURL:a.location.mapURL,tags:a.location.tags,address:a.location.address?{id:a.location.address.id,countryCode:a.location.address.countryCode,country:a.location.address.country,postalCode:a.location.address.postalCode,provinceCode:a.location.address.provinceCode,province:a.location.address.province,city:a.location.address.city,address1:a.location.address.address1,address2:a.location.address.address2}:void 0},inventoryQuantity:a.inventoryQuantity}))??[],pageInfo:s.locationAvailabilities.pageInfo??null}}async getLocationAvailability(t,n){const i=await this.api.GetLocationAvailability({sku:t,locationID:n});return{location:{id:i.locationAvailability.location.id,name:i.locationAvailability.location.name,phone:i.locationAvailability.location.phone,mapURL:i.locationAvailability.location.mapURL,tags:i.locationAvailability.location.tags,address:i.locationAvailability.location.address?{id:i.locationAvailability.location.address.id,countryCode:i.locationAvailability.location.address.countryCode,country:i.locationAvailability.location.address.country,postalCode:i.locationAvailability.location.address.postalCode,provinceCode:i.locationAvailability.location.address.provinceCode,province:i.locationAvailability.location.address.province,city:i.locationAvailability.location.address.city,address1:i.locationAvailability.location.address.address1,address2:i.locationAvailability.location.address.address2}:void 0},inventoryQuantity:i.locationAvailability.inventoryQuantity}}async getPurchasingCustomerMetafield(t,n){return(await this.api.GetPurchasingCustomerMetafield({namespace:t,key:n})).purchasingCustomerMetafield??null}async getPoints(){const t=await this.api.GetPoints();return t.purchasingCustomer?{pointsApproved:t.purchasingCustomer.pointsApproved,pointsPending:t.purchasingCustomer.pointsPending,pointsExpiringSoon:t.purchasingCustomer.pointsExpiringSoon?{points:t.purchasingCustomer.pointsExpiringSoon.points,expiresDate:new Date(t.purchasingCustomer.pointsExpiringSoon.expiresDate),availableUntil:new Date(t.purchasingCustomer.pointsExpiringSoon.availableUntil)}:void 0}:null}async getLocations(t,n,i,r){const s=await this.api.GetLocations({first:t,after:n,filter:i,isReverse:r});return{nodes:s.locations.nodes.map(a=>({id:a.id,name:a.name,phone:a.phone,mapURL:a.mapURL,tags:a.tags,address:a.address?{id:a.address.id,countryCode:a.address.countryCode,country:a.address.country,postalCode:a.address.postalCode,provinceCode:a.address.provinceCode,province:a.address.province,city:a.address.city,address1:a.address.address1,address2:a.address.address2}:void 0}))??[],pageInfo:s.locations.pageInfo??null}}async getPurchasingCustomerDiscounts(t,n,i){const r=await this.api.GetPurchasingCustomerDiscounts({first:t,after:n,isReverse:i});return r.purchasingCustomer?{id:r.purchasingCustomer.id,nodes:r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(s=>({id:s.id,title:s.title,status:s.status,description:s.description,code:s.code,customerApplicable:s.customerApplicable,shopifyStoreApplicable:s.shopifyStoreApplicable,applicableLocationCount:s.applicableLocationCount,hasApplicableLocations:s.hasApplicableLocations,startsAt:new Date(s.startsAt),endsAt:new Date(s.endsAt),createdAt:new Date(s.createdAt),updatedAt:new Date(s.updatedAt)}))??[],pageInfo:r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo??null}:null}async getPointChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerPointChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.pointChangeActivities.nodes.map(a=>({id:a.id,title:a.title,tenant:{id:a.tenant.id,name:a.tenant.name},pointChange:{id:a.pointChange.id,delta:a.pointChange.delta,availableAt:a.pointChange.availableAt?new Date(a.pointChange.availableAt):void 0,expiresDate:a.pointChange.expiresDate?new Date(a.pointChange.expiresDate):void 0,availableUntil:a.pointChange.availableUntil?new Date(a.pointChange.availableUntil):void 0,pointChangeCreatedAt:new Date(a.pointChange.pointChangeCreatedAt),tenant:{id:a.pointChange.tenant.id,name:a.pointChange.tenant.name},createdAt:new Date(a.pointChange.createdAt)},retailLocation:a.retailLocation?{id:a.retailLocation.id,name:a.retailLocation.name,phone:a.retailLocation.phone,mapURL:a.retailLocation.mapURL,tags:a.retailLocation.tags,address:a.retailLocation.address?{id:a.retailLocation.address.id,countryCode:a.retailLocation.address.countryCode,country:a.retailLocation.address.country,postalCode:a.retailLocation.address.postalCode,provinceCode:a.retailLocation.address.provinceCode,province:a.retailLocation.address.province,city:a.retailLocation.address.city,address1:a.retailLocation.address.address1,address2:a.retailLocation.address.address2}:void 0}:void 0})),pageInfo:s.purchasingCustomer.pointChangeActivities.pageInfo}:null}async getPurchasingCustomerCurrentRank(){var n;const t=await this.api.GetPurchasingCustomerRank();return(n=t.purchasingCustomer)!=null&&n.currentCustomerRank?{id:t.purchasingCustomer.currentCustomerRank.id,name:t.purchasingCustomer.currentCustomerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.threshold,higherRank:t.purchasingCustomer.currentCustomerRank.higherRank?{id:t.purchasingCustomer.currentCustomerRank.higherRank.id,name:t.purchasingCustomer.currentCustomerRank.higherRank.name,threshold:t.purchasingCustomer.currentCustomerRank.higherRank.threshold}:void 0,lowerRank:t.purchasingCustomer.currentCustomerRank.lowerRank?{id:t.purchasingCustomer.currentCustomerRank.lowerRank.id,name:t.purchasingCustomer.currentCustomerRank.lowerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.lowerRank.threshold}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.purchasePrice,earnedPointToRankUp:t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,purchasePriceToRankUp:t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,calculationCondition:{customerRankCalculationPeriod:t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod?{start:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.start),end:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.end)}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice},pointMultiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier?{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.id,customerRankRule:{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.id,name:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.name,threshold:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.threshold},multiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier.multiplier}:void 0}:null}async getPurchasingCustomerDiscountCodeCount(){var n;return((n=(await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer)==null?void 0:n.orderPriceAdjustmentRuleCount)??0}async getSharingPurchasingCustomerCount(){var n;return((n=(await this.api.GetSharingPurchasingCustomerCount()).purchasingCustomer)==null?void 0:n.sharingPurchasingCustomerCount)??0}async getPurchasingCustomerSharing(){var n;const t=await this.api.GetPurchasingCustomerSharing();return(n=t.purchasingCustomer)!=null&&n.customerSharing?{id:t.purchasingCustomer.customerSharing.id,purchasingCustomers:t.purchasingCustomer.customerSharing.purchasingCustomers.map(i=>({id:i.id,sharingPurchasingCustomerCount:i.sharingPurchasingCustomerCount,tenant:{id:i.tenant.id,name:i.tenant.name}}))}:null}async getProduct(t,n,i,r,s){const a=await this.api.GetProduct({id:t,first:n,after:i,isReverse:r,sortKeys:s});return a.productByProductShopifyLegacyResourceID?{id:a.productByProductShopifyLegacyResourceID.id,title:a.productByProductShopifyLegacyResourceID.title,hasBackOrderProductVariants:a.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants,isLocalPickupAvailable:a.productByProductShopifyLegacyResourceID.isLocalPickupAvailable,variants:{nodes:a.productByProductShopifyLegacyResourceID.productVariants.nodes.map(c=>({id:c.id,title:c.title,inventoryItem:{id:c.inventoryItem.id,sku:c.inventoryItem.sku},isBackOrderEnable:c.isBackOrderEnable,isLocalPickupAvailable:c.isLocalPickupAvailable})),pageInfo:a.productByProductShopifyLegacyResourceID.productVariants.pageInfo}}:null}async getHasBackOrderProductVariants(t){const n=await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID({id:t});return n.productByProductShopifyLegacyResourceID?n.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants:null}async getPointCampaignOrderRuleTargetCustomerRank(){const t=await this.api.GetPointCampaignOrderRuleTargetCustomerRank();return t.pointCampaignOrderRuleTargetCustomerRank?{pointCampaignOrderRule:{id:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.id,title:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title,pointMethod:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.pointMethod,targetType:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.targetType},multiplier:t.pointCampaignOrderRuleTargetCustomerRank.multiplier?t.pointCampaignOrderRuleTargetCustomerRank.multiplier:void 0,fixedPoint:t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint?t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint:void 0}:null}async getEstimatedShopifyCartPoint(t,n,i){const r=await this.api.GetEstimatedShopifyCartPoint({input:{currencyCode:t,taxesIncluded:n,lineItems:i}});return r.estimatedShopifyCartPoint?{pointsEarning:r.estimatedShopifyCartPoint.pointsEarning,totalPointsEarning:r.estimatedShopifyCartPoint.totalPointsEarning,pointCampaign:r.estimatedShopifyCartPoint.pointCampaign?{pointsEarning:r.estimatedShopifyCartPoint.pointCampaign.pointsEarning,pointCampaignOrderRule:{id:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,title:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,pointMethod:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,targetType:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType}}:void 0}:null}async getEstimatedShopifyCartLineItemPoint(t,n,i,r,s){const a=await this.api.GetEstimatedShopifyCartLineItemPoint({input:{currencyCode:t,taxesIncluded:n,sku:i,quantity:r,unitPrice:s}});return a.estimatedShopifyCartLineItemPoint?{pointsEarning:a.estimatedShopifyCartLineItemPoint.pointsEarning,totalPointsEarning:a.estimatedShopifyCartLineItemPoint.totalPointsEarning,pointCampaign:a.estimatedShopifyCartLineItemPoint.pointCampaign?{pointsEarning:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointsEarning,pointCampaignOrderRule:{id:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.id,title:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.title,pointMethod:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.pointMethod,targetType:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.targetType}}:void 0}:null}async purchasingCustomerSendCustomerSharingActivationCode(){const t=await this.api.PurchasingCustomerSendCustomerSharingActivationCode();return t.purchasingCustomerSendCustomerSharingActivationCode?{purchasingCustomer:{id:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.id,sharingPurchasingCustomerCount:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.sharingPurchasingCustomerCount,tenant:{id:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.id,name:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.name}},customerSharingActivationCodeID:t.purchasingCustomerSendCustomerSharingActivationCode.customerSharingActivationCode.id}:null}async purchasingCustomerActivateCustomerSharing(t,n){if(n.length!==6)throw new Error(`Invalid activation code: ${n} is not 6 characters.`);const i=await this.api.PurchasingCustomerActivateCustomerSharing({email:t,activationCode:n});return i.purchasingCustomerActivateCustomerSharing?{id:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,sharingPurchasingCustomerCount:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,tenant:{id:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,name:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name}}:null}async getMiles(){const t=await this.api.GetMiles();return t.purchasingCustomer?{miles:t.purchasingCustomer.miles}:null}async getMileChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerMileChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.mileChangeActivities.nodes.map(a=>({id:a.id,title:a.title,mileChange:{id:a.mileChange.id,delta:a.mileChange.delta,mileChangeCreatedAt:new Date(a.mileChange.mileChangeCreatedAt),createdAt:new Date(a.mileChange.createdAt)}})),pageInfo:s.purchasingCustomer.mileChangeActivities.pageInfo}:null}async getMileItems(t,n,i,r){const s=await this.api.GetMileItems({first:t,after:n,isReverse:i,sortKeys:r});return s.mileItems?{nodes:s.mileItems.nodes.map(a=>({id:a.id,title:a.title,description:a.description,miles:a.miles,sku:a.sku,isActive:a.isActive,isScheduled:a.isScheduled,customerExchangeable:a.customerExchangeable,startsAt:new Date(a.startsAt),endsAt:a.endsAt?new Date(a.endsAt):void 0})),pageInfo:s.mileItems.pageInfo}:null}async getMileOrders(t,n,i,r){const s=await this.api.GetMileOrders({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.mileOrders.nodes.map(a=>({id:a.id,mileItem:{id:a.mileItem.id,title:a.mileItem.title,description:a.mileItem.description,miles:a.mileItem.miles,sku:a.mileItem.sku,isActive:a.mileItem.isActive,isScheduled:a.mileItem.isScheduled,customerExchangeable:a.mileItem.customerExchangeable,startsAt:new Date(a.mileItem.startsAt),endsAt:a.mileItem.endsAt?new Date(a.mileItem.endsAt):void 0},miles:a.miles,exchangedAt:new Date(a.exchangedAt)})),pageInfo:s.purchasingCustomer.mileOrders.pageInfo}:null}async mileItemExchange(t){const n=await this.api.MileItemExchange({mileItemID:t});return n.mileItemExchange?{id:n.mileItemExchange.mileOrder.id,mileItem:{id:n.mileItemExchange.mileOrder.mileItem.id,title:n.mileItemExchange.mileOrder.mileItem.title,description:n.mileItemExchange.mileOrder.mileItem.description,miles:n.mileItemExchange.mileOrder.mileItem.miles,sku:n.mileItemExchange.mileOrder.mileItem.sku,isActive:n.mileItemExchange.mileOrder.mileItem.isActive,isScheduled:n.mileItemExchange.mileOrder.mileItem.isScheduled,customerExchangeable:n.mileItemExchange.mileOrder.mileItem.customerExchangeable,startsAt:new Date(n.mileItemExchange.mileOrder.mileItem.startsAt),endsAt:n.mileItemExchange.mileOrder.mileItem.endsAt?new Date(n.mileItemExchange.mileOrder.mileItem.endsAt):void 0},miles:n.mileItemExchange.mileOrder.miles,exchangedAt:new Date(n.mileItemExchange.mileOrder.exchangedAt)}:null}}P.CurrencyCode=Ve,P.LocationType=je,P.SDK=Rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
|
567
|
+
`,dn=(e,t,n,i)=>e();function pn(e,t=dn){return{GetLocationAvailabilities(n,i){return t(r=>e.request(Gt,n,{...i,...r}),"GetLocationAvailabilities","query",n)},GetLocationAvailability(n,i){return t(r=>e.request($t,n,{...i,...r}),"GetLocationAvailability","query",n)},GetPurchasingCustomerMetafield(n,i){return t(r=>e.request(Vt,n,{...i,...r}),"GetPurchasingCustomerMetafield","query",n)},GetPoints(n,i){return t(r=>e.request(jt,n,{...i,...r}),"GetPoints","query",n)},GetLocations(n,i){return t(r=>e.request(Ht,n,{...i,...r}),"GetLocations","query",n)},GetPurchasingCustomerDiscounts(n,i){return t(r=>e.request(Yt,n,{...i,...r}),"GetPurchasingCustomerDiscounts","query",n)},GetPurchasingCustomerDiscountCodeCount(n,i){return t(r=>e.request(zt,n,{...i,...r}),"GetPurchasingCustomerDiscountCodeCount","query",n)},GetPurchasingCustomerPointChangeActivities(n,i){return t(r=>e.request(Qt,n,{...i,...r}),"GetPurchasingCustomerPointChangeActivities","query",n)},GetPurchasingCustomerRank(n,i){return t(r=>e.request(Jt,n,{...i,...r}),"GetPurchasingCustomerRank","query",n)},GetSharingPurchasingCustomerCount(n,i){return t(r=>e.request(Xt,n,{...i,...r}),"GetSharingPurchasingCustomerCount","query",n)},GetPurchasingCustomerSharing(n,i){return t(r=>e.request(Kt,n,{...i,...r}),"GetPurchasingCustomerSharing","query",n)},GetProduct(n,i){return t(r=>e.request(Zt,n,{...i,...r}),"GetProduct","query",n)},GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID(n,i){return t(r=>e.request(Wt,n,{...i,...r}),"GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID","query",n)},GetPointCampaignOrderRuleTargetCustomerRank(n,i){return t(r=>e.request(en,n,{...i,...r}),"GetPointCampaignOrderRuleTargetCustomerRank","query",n)},GetEstimatedShopifyCartPoint(n,i){return t(r=>e.request(tn,n,{...i,...r}),"GetEstimatedShopifyCartPoint","query",n)},GetEstimatedShopifyCartLineItemPoint(n,i){return t(r=>e.request(nn,n,{...i,...r}),"GetEstimatedShopifyCartLineItemPoint","query",n)},PurchasingCustomerSendCustomerSharingActivationCode(n,i){return t(r=>e.request(rn,n,{...i,...r}),"PurchasingCustomerSendCustomerSharingActivationCode","mutation",n)},PurchasingCustomerActivateCustomerSharing(n,i){return t(r=>e.request(sn,n,{...i,...r}),"PurchasingCustomerActivateCustomerSharing","mutation",n)},GetMiles(n,i){return t(r=>e.request(an,n,{...i,...r}),"GetMiles","query",n)},GetPurchasingCustomerMileChangeActivities(n,i){return t(r=>e.request(on,n,{...i,...r}),"GetPurchasingCustomerMileChangeActivities","query",n)},GetMileItems(n,i){return t(r=>e.request(un,n,{...i,...r}),"GetMileItems","query",n)},GetMileOrders(n,i){return t(r=>e.request(cn,n,{...i,...r}),"GetMileOrders","query",n)},MileItemExchange(n,i){return t(r=>e.request(ln,n,{...i,...r}),"MileItemExchange","mutation",n)}}}const ge=JSON,hn=e=>e.toUpperCase(),mn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},fn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},gn=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},Cn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},Ge=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},Ce=e=>{if(typeof e=="string"){let n;try{const i=Fe(e);n=Ge(i)}catch{}return{query:e,operationName:n}}const t=Ge(e);return{query:Dt(e),operationName:t}};class Q extends Error{constructor(t,n){const i=`${Q.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Q.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Q)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ye={exports:{}};(function(e,t){var n=typeof self<"u"?self:yn,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(a){var c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function p(o){return o&&DataView.prototype.isPrototypeOf(o)}if(c.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(o){return o&&h.indexOf(Object.prototype.toString.call(o))>-1};function C(o){if(typeof o!="string"&&(o=String(o)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(o))throw new TypeError("Invalid character in header field name");return o.toLowerCase()}function y(o){return typeof o!="string"&&(o=String(o)),o}function I(o){var l={next:function(){var E=o.shift();return{done:E===void 0,value:E}}};return c.iterable&&(l[Symbol.iterator]=function(){return l}),l}function g(o){this.map={},o instanceof g?o.forEach(function(l,E){this.append(E,l)},this):Array.isArray(o)?o.forEach(function(l){this.append(l[0],l[1])},this):o&&Object.getOwnPropertyNames(o).forEach(function(l){this.append(l,o[l])},this)}g.prototype.append=function(o,l){o=C(o),l=y(l);var E=this.map[o];this.map[o]=E?E+", "+l:l},g.prototype.delete=function(o){delete this.map[C(o)]},g.prototype.get=function(o){return o=C(o),this.has(o)?this.map[o]:null},g.prototype.has=function(o){return this.map.hasOwnProperty(C(o))},g.prototype.set=function(o,l){this.map[C(o)]=y(l)},g.prototype.forEach=function(o,l){for(var E in this.map)this.map.hasOwnProperty(E)&&o.call(l,this.map[E],E,this)},g.prototype.keys=function(){var o=[];return this.forEach(function(l,E){o.push(E)}),I(o)},g.prototype.values=function(){var o=[];return this.forEach(function(l){o.push(l)}),I(o)},g.prototype.entries=function(){var o=[];return this.forEach(function(l,E){o.push([E,l])}),I(o)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function T(o){if(o.bodyUsed)return Promise.reject(new TypeError("Already read"));o.bodyUsed=!0}function D(o){return new Promise(function(l,E){o.onload=function(){l(o.result)},o.onerror=function(){E(o.error)}})}function k(o){var l=new FileReader,E=D(l);return l.readAsArrayBuffer(o),E}function se(o){var l=new FileReader,E=D(l);return l.readAsText(o),E}function F(o){for(var l=new Uint8Array(o),E=new Array(l.length),N=0;N<l.length;N++)E[N]=String.fromCharCode(l[N]);return E.join("")}function L(o){if(o.slice)return o.slice(0);var l=new Uint8Array(o.byteLength);return l.set(new Uint8Array(o)),l.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(o){this._bodyInit=o,o?typeof o=="string"?this._bodyText=o:c.blob&&Blob.prototype.isPrototypeOf(o)?this._bodyBlob=o:c.formData&&FormData.prototype.isPrototypeOf(o)?this._bodyFormData=o:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)?this._bodyText=o.toString():c.arrayBuffer&&c.blob&&p(o)?(this._bodyArrayBuffer=L(o.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(o)||f(o))?this._bodyArrayBuffer=L(o):this._bodyText=o=Object.prototype.toString.call(o):this._bodyText="",this.headers.get("content-type")||(typeof o=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(o)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var o=T(this);if(o)return o;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?T(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(k)}),this.text=function(){var o=T(this);if(o)return o;if(this._bodyBlob)return se(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(F(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(On)}),this.json=function(){return this.text().then(JSON.parse)},this}var ae=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function oe(o){var l=o.toUpperCase();return ae.indexOf(l)>-1?l:o}function q(o,l){l=l||{};var E=l.body;if(o instanceof q){if(o.bodyUsed)throw new TypeError("Already read");this.url=o.url,this.credentials=o.credentials,l.headers||(this.headers=new g(o.headers)),this.method=o.method,this.mode=o.mode,this.signal=o.signal,!E&&o._bodyInit!=null&&(E=o._bodyInit,o.bodyUsed=!0)}else this.url=String(o);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new g(l.headers)),this.method=oe(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}q.prototype.clone=function(){return new q(this,{body:this._bodyInit})};function On(o){var l=new FormData;return o.trim().split("&").forEach(function(E){if(E){var N=E.split("="),O=N.shift().replace(/\+/g," "),v=N.join("=").replace(/\+/g," ");l.append(decodeURIComponent(O),decodeURIComponent(v))}}),l}function Nn(o){var l=new g,E=o.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(N){var O=N.split(":"),v=O.shift().trim();if(v){var ue=O.join(":").trim();l.append(v,ue)}}),l}j.call(q.prototype);function M(o,l){l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in l?l.statusText:"OK",this.headers=new g(l.headers),this.url=l.url||"",this._initBody(o)}j.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},M.error=function(){var o=new M(null,{status:0,statusText:""});return o.type="error",o};var Pn=[301,302,303,307,308];M.redirect=function(o,l){if(Pn.indexOf(l)===-1)throw new RangeError("Invalid status code");return new M(null,{status:l,headers:{location:o}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(l,E){this.message=l,this.name=E;var N=Error(l);this.stack=N.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ve(o,l){return new Promise(function(E,N){var O=new q(o,l);if(O.signal&&O.signal.aborted)return N(new a.DOMException("Aborted","AbortError"));var v=new XMLHttpRequest;function ue(){v.abort()}v.onload=function(){var J={status:v.status,statusText:v.statusText,headers:Nn(v.getAllResponseHeaders()||"")};J.url="responseURL"in v?v.responseURL:J.headers.get("X-Request-URL");var Ie="response"in v?v.response:v.responseText;E(new M(Ie,J))},v.onerror=function(){N(new TypeError("Network request failed"))},v.ontimeout=function(){N(new TypeError("Network request failed"))},v.onabort=function(){N(new a.DOMException("Aborted","AbortError"))},v.open(O.method,O.url,!0),O.credentials==="include"?v.withCredentials=!0:O.credentials==="omit"&&(v.withCredentials=!1),"responseType"in v&&c.blob&&(v.responseType="blob"),O.headers.forEach(function(J,Ie){v.setRequestHeader(Ie,J)}),O.signal&&(O.signal.addEventListener("abort",ue),v.onreadystatechange=function(){v.readyState===4&&O.signal.removeEventListener("abort",ue)}),v.send(typeof O._bodyInit>"u"?null:O._bodyInit)})}return ve.polyfill=!0,s.fetch||(s.fetch=ve,s.Headers=g,s.Request=q,s.Response=M),a.Headers=g,a.Request=q,a.Response=M,a.fetch=ve,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(ye,ye.exports);var ie=ye.exports;const re=En(ie),An=b({__proto__:null,default:re},[ie]),V=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||An&&ie.Headers&&e instanceof ie.Headers?t=mn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},$e=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),vn=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent($e(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:$e(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},In=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:a,fetchOptions:c,middleware:p}=t,h={...t.headers};let f="",C;e==="POST"?(C=Sn(i,r,s,c.jsonSerializer),typeof C=="string"&&(h["Content-Type"]="application/json")):f=vn({query:i,variables:r,operationName:s,jsonSerializer:c.jsonSerializer??ge});const y={method:e,headers:h,body:C,...c};let I=n,g=y;if(p){const T=await Promise.resolve(p({...y,url:n,operationName:s,variables:r})),{url:D,...k}=T;I=D,g=k}return f&&(I=`${I}?${f}`),await a(I,g)};class Tn{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,a]=i,c=gn(r,s,a),{headers:p,fetch:h=re,method:f="POST",requestMiddleware:C,responseMiddleware:y,...I}=this.requestConfig,{url:g}=this;c.signal!==void 0&&(I.signal=c.signal);const{operationName:T}=Ce(c.query);return Ee({url:g,query:c.query,variables:c.variables,headers:{...V(Ae(p)),...V(c.requestHeaders)},operationName:T,fetch:h,method:f,fetchOptions:I,middleware:C}).then(D=>(y&&y(D),D)).catch(D=>{throw y&&y(D),D})}}async request(t,...n){const[i,r]=n,s=fn(t,i,r),{headers:a,fetch:c=re,method:p="POST",requestMiddleware:h,responseMiddleware:f,...C}=this.requestConfig,{url:y}=this;s.signal!==void 0&&(C.signal=s.signal);const{query:I,operationName:g}=Ce(s.document);return Ee({url:y,query:I,variables:s.variables,headers:{...V(Ae(a)),...V(s.requestHeaders)},operationName:g,fetch:c,method:p,fetchOptions:C,middleware:h}).then(T=>(f&&f(T),T.data)).catch(T=>{throw f&&f(T),T})}batchRequests(t,n){const i=Cn(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const a=i.documents.map(({document:p})=>Ce(p).query),c=i.documents.map(({variables:p})=>p);return Ee({url:this.url,query:a,variables:c,headers:{...V(Ae(r)),...V(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??re,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(p=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(p),p.data)).catch(p=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(p),p})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const Ee=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=In(hn(e.method??"post")),s=Array.isArray(e.query),a=await r(e),c=await xn(a,i.jsonSerializer??ge),p=Array.isArray(c)?!c.some(({data:f})=>!f):!!c.data,h=Array.isArray(c)||!c.errors||Array.isArray(c.errors)&&!c.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(a.ok&&h&&p){const{errors:f,...C}=(Array.isArray(c),c),y=i.errorPolicy==="ignore"?C:c;return{...s?{data:y}:y,headers:a.headers,status:a.status}}else{const f=typeof c=="string"?{error:c}:c;throw new Q({...f,status:a.status,headers:a.headers},{query:t,variables:n})}},Sn=(e,t,n,i)=>{const r=i??ge;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((a,c,p)=>(a.push({query:c,variables:t?t[p]:void 0}),a),[]);return r.stringify(s)},xn=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},Ae=e=>typeof e=="function"?e():e;var Ve=(e=>(e.Eur="EUR",e.Jpy="JPY",e.Usd="USD",e))(Ve||{}),je=(e=>(e.Retail="RETAIL",e.Warehouse="WAREHOUSE",e))(je||{});class Rn{constructor(t){He(this,"api");this.api=pn(new Tn(`${t}/apps/sq-api`,{headers:{"X-SQ-CLIENT":"ShopifyAppProxy"}}))}async getLocationAvailabilities(t,n,i,r){const s=await this.api.GetLocationAvailabilities({sku:t,first:n,after:i,isReverse:r});return{nodes:s.locationAvailabilities.nodes.map(a=>({location:{id:a.location.id,name:a.location.name,phone:a.location.phone,mapURL:a.location.mapURL,tags:a.location.tags,address:a.location.address?{id:a.location.address.id,countryCode:a.location.address.countryCode,country:a.location.address.country,postalCode:a.location.address.postalCode,provinceCode:a.location.address.provinceCode,province:a.location.address.province,city:a.location.address.city,address1:a.location.address.address1,address2:a.location.address.address2}:void 0},inventoryQuantity:a.inventoryQuantity}))??[],pageInfo:s.locationAvailabilities.pageInfo??null}}async getLocationAvailability(t,n){const i=await this.api.GetLocationAvailability({sku:t,locationID:n});return{location:{id:i.locationAvailability.location.id,name:i.locationAvailability.location.name,phone:i.locationAvailability.location.phone,mapURL:i.locationAvailability.location.mapURL,tags:i.locationAvailability.location.tags,address:i.locationAvailability.location.address?{id:i.locationAvailability.location.address.id,countryCode:i.locationAvailability.location.address.countryCode,country:i.locationAvailability.location.address.country,postalCode:i.locationAvailability.location.address.postalCode,provinceCode:i.locationAvailability.location.address.provinceCode,province:i.locationAvailability.location.address.province,city:i.locationAvailability.location.address.city,address1:i.locationAvailability.location.address.address1,address2:i.locationAvailability.location.address.address2}:void 0},inventoryQuantity:i.locationAvailability.inventoryQuantity}}async getPurchasingCustomerMetafield(t,n){return(await this.api.GetPurchasingCustomerMetafield({namespace:t,key:n})).purchasingCustomerMetafield??null}async getPoints(){const t=await this.api.GetPoints();return t.purchasingCustomer?{pointsApproved:t.purchasingCustomer.pointsApproved,pointsPending:t.purchasingCustomer.pointsPending,pointsExpiringSoon:t.purchasingCustomer.pointsExpiringSoon?{points:t.purchasingCustomer.pointsExpiringSoon.points,expiresDate:new Date(t.purchasingCustomer.pointsExpiringSoon.expiresDate),availableUntil:new Date(t.purchasingCustomer.pointsExpiringSoon.availableUntil)}:void 0}:null}async getLocations(t,n,i,r){const s=await this.api.GetLocations({first:t,after:n,filter:i,isReverse:r});return{nodes:s.locations.nodes.map(a=>({id:a.id,name:a.name,phone:a.phone,mapURL:a.mapURL,tags:a.tags,address:a.address?{id:a.address.id,countryCode:a.address.countryCode,country:a.address.country,postalCode:a.address.postalCode,provinceCode:a.address.provinceCode,province:a.address.province,city:a.address.city,address1:a.address.address1,address2:a.address.address2}:void 0}))??[],pageInfo:s.locations.pageInfo??null}}async getPurchasingCustomerDiscounts(t,n,i){const r=await this.api.GetPurchasingCustomerDiscounts({first:t,after:n,isReverse:i});return r.purchasingCustomer?{id:r.purchasingCustomer.id,nodes:r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(s=>({id:s.id,title:s.title,status:s.status,description:s.description,code:s.code,customerApplicable:s.customerApplicable,shopifyStoreApplicable:s.shopifyStoreApplicable,applicableLocationCount:s.applicableLocationCount,hasApplicableLocations:s.hasApplicableLocations,startsAt:new Date(s.startsAt),endsAt:new Date(s.endsAt),createdAt:new Date(s.createdAt),updatedAt:new Date(s.updatedAt)}))??[],pageInfo:r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo??null}:null}async getPointChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerPointChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.pointChangeActivities.nodes.map(a=>({id:a.id,title:a.title,tenant:{id:a.tenant.id,name:a.tenant.name},pointChange:{id:a.pointChange.id,delta:a.pointChange.delta,availableAt:a.pointChange.availableAt?new Date(a.pointChange.availableAt):void 0,expiresDate:a.pointChange.expiresDate?new Date(a.pointChange.expiresDate):void 0,availableUntil:a.pointChange.availableUntil?new Date(a.pointChange.availableUntil):void 0,pointChangeCreatedAt:new Date(a.pointChange.pointChangeCreatedAt),tenant:{id:a.pointChange.tenant.id,name:a.pointChange.tenant.name},createdAt:new Date(a.pointChange.createdAt)},retailLocation:a.retailLocation?{id:a.retailLocation.id,name:a.retailLocation.name,phone:a.retailLocation.phone,mapURL:a.retailLocation.mapURL,tags:a.retailLocation.tags,address:a.retailLocation.address?{id:a.retailLocation.address.id,countryCode:a.retailLocation.address.countryCode,country:a.retailLocation.address.country,postalCode:a.retailLocation.address.postalCode,provinceCode:a.retailLocation.address.provinceCode,province:a.retailLocation.address.province,city:a.retailLocation.address.city,address1:a.retailLocation.address.address1,address2:a.retailLocation.address.address2}:void 0}:void 0})),pageInfo:s.purchasingCustomer.pointChangeActivities.pageInfo}:null}async getPurchasingCustomerCurrentRank(){var n;const t=await this.api.GetPurchasingCustomerRank();return(n=t.purchasingCustomer)!=null&&n.currentCustomerRank?{id:t.purchasingCustomer.currentCustomerRank.id,name:t.purchasingCustomer.currentCustomerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.threshold,higherRank:t.purchasingCustomer.currentCustomerRank.higherRank?{id:t.purchasingCustomer.currentCustomerRank.higherRank.id,name:t.purchasingCustomer.currentCustomerRank.higherRank.name,threshold:t.purchasingCustomer.currentCustomerRank.higherRank.threshold}:void 0,lowerRank:t.purchasingCustomer.currentCustomerRank.lowerRank?{id:t.purchasingCustomer.currentCustomerRank.lowerRank.id,name:t.purchasingCustomer.currentCustomerRank.lowerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.lowerRank.threshold}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.purchasePrice,earnedPointToRankUp:t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,purchasePriceToRankUp:t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,calculationCondition:{customerRankCalculationPeriod:t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod?{start:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.start),end:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.end)}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice},pointMultiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier?{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.id,customerRankRule:{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.id,name:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.name,threshold:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.threshold},multiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier.multiplier}:void 0}:null}async getPurchasingCustomerDiscountCodeCount(){var n;return((n=(await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer)==null?void 0:n.orderPriceAdjustmentRuleCount)??0}async getSharingPurchasingCustomerCount(){var n;return((n=(await this.api.GetSharingPurchasingCustomerCount()).purchasingCustomer)==null?void 0:n.sharingPurchasingCustomerCount)??0}async getPurchasingCustomerSharing(){var n;const t=await this.api.GetPurchasingCustomerSharing();return(n=t.purchasingCustomer)!=null&&n.customerSharing?{id:t.purchasingCustomer.customerSharing.id,purchasingCustomers:t.purchasingCustomer.customerSharing.purchasingCustomers.map(i=>({id:i.id,sharingPurchasingCustomerCount:i.sharingPurchasingCustomerCount,tenant:{id:i.tenant.id,name:i.tenant.name}}))}:null}async getProduct(t,n,i,r,s){const a=await this.api.GetProduct({id:t,first:n,after:i,isReverse:r,sortKeys:s});return a.productByProductShopifyLegacyResourceID?{id:a.productByProductShopifyLegacyResourceID.id,title:a.productByProductShopifyLegacyResourceID.title,hasBackOrderProductVariants:a.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants,isLocalPickupAvailable:a.productByProductShopifyLegacyResourceID.isLocalPickupAvailable,variants:{nodes:a.productByProductShopifyLegacyResourceID.productVariants.nodes.map(c=>({id:c.id,title:c.title,inventoryItem:{id:c.inventoryItem.id,sku:c.inventoryItem.sku},isBackOrderEnable:c.isBackOrderEnable,isLocalPickupAvailable:c.isLocalPickupAvailable})),pageInfo:a.productByProductShopifyLegacyResourceID.productVariants.pageInfo}}:null}async getHasBackOrderProductVariants(t){const n=await this.api.GetHasBackOrderProductVariantsByProductShopifyLegacyResourceID({id:t});return n.productByProductShopifyLegacyResourceID?n.productByProductShopifyLegacyResourceID.hasBackOrderProductVariants:null}async getPointCampaignOrderRuleTargetCustomerRank(){const t=await this.api.GetPointCampaignOrderRuleTargetCustomerRank();return t.pointCampaignOrderRuleTargetCustomerRank?{pointCampaignOrderRule:{id:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.id,title:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title,pointMethod:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.pointMethod,targetType:t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.targetType},multiplier:t.pointCampaignOrderRuleTargetCustomerRank.multiplier?t.pointCampaignOrderRuleTargetCustomerRank.multiplier:void 0,fixedPoint:t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint?t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint:void 0}:null}async getEstimatedShopifyCartPoint(t,n,i){const r=await this.api.GetEstimatedShopifyCartPoint({input:{currencyCode:t,taxesIncluded:n,lineItems:i}});return r.estimatedShopifyCartPoint?{pointsEarning:r.estimatedShopifyCartPoint.pointsEarning,totalPointsEarning:r.estimatedShopifyCartPoint.totalPointsEarning,pointCampaign:r.estimatedShopifyCartPoint.pointCampaign?{pointsEarning:r.estimatedShopifyCartPoint.pointCampaign.pointsEarning,pointCampaignOrderRule:{id:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.id,title:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.title,pointMethod:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.pointMethod,targetType:r.estimatedShopifyCartPoint.pointCampaign.pointCampaignOrderRule.targetType}}:void 0}:null}async getEstimatedShopifyCartLineItemPoint(t,n,i,r,s){const a=await this.api.GetEstimatedShopifyCartLineItemPoint({input:{currencyCode:t,taxesIncluded:n,sku:i,quantity:r,unitPrice:s}});return a.estimatedShopifyCartLineItemPoint?{pointsEarning:a.estimatedShopifyCartLineItemPoint.pointsEarning,totalPointsEarning:a.estimatedShopifyCartLineItemPoint.totalPointsEarning,pointCampaign:a.estimatedShopifyCartLineItemPoint.pointCampaign?{pointsEarning:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointsEarning,pointCampaignOrderRule:{id:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.id,title:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.title,pointMethod:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.pointMethod,targetType:a.estimatedShopifyCartLineItemPoint.pointCampaign.pointCampaignOrderRule.targetType}}:void 0}:null}async purchasingCustomerSendCustomerSharingActivationCode(){const t=await this.api.PurchasingCustomerSendCustomerSharingActivationCode();return t.purchasingCustomerSendCustomerSharingActivationCode?{purchasingCustomer:{id:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.id,sharingPurchasingCustomerCount:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.sharingPurchasingCustomerCount,tenant:{id:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.id,name:t.purchasingCustomerSendCustomerSharingActivationCode.purchasingCustomer.tenant.name}},customerSharingActivationCodeID:t.purchasingCustomerSendCustomerSharingActivationCode.customerSharingActivationCode.id}:null}async purchasingCustomerActivateCustomerSharing(t,n){if(n.length!==6)throw new Error(`Invalid activation code: ${n} is not 6 characters.`);const i=await this.api.PurchasingCustomerActivateCustomerSharing({email:t,activationCode:n});return i.purchasingCustomerActivateCustomerSharing?{id:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.id,sharingPurchasingCustomerCount:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.sharingPurchasingCustomerCount,tenant:{id:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.id,name:i.purchasingCustomerActivateCustomerSharing.purchasingCustomer.tenant.name}}:null}async getMiles(){const t=await this.api.GetMiles();return t.purchasingCustomer?{miles:t.purchasingCustomer.miles}:null}async getMileChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerMileChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.mileChangeActivities.nodes.map(a=>({id:a.id,title:a.title,mileChange:{id:a.mileChange.id,delta:a.mileChange.delta,mileChangeCreatedAt:new Date(a.mileChange.mileChangeCreatedAt),createdAt:new Date(a.mileChange.createdAt)}})),pageInfo:s.purchasingCustomer.mileChangeActivities.pageInfo}:null}async getMileItems(t,n,i,r){const s=await this.api.GetMileItems({first:t,after:n,isReverse:i,sortKeys:r});return s.mileItems?{nodes:s.mileItems.nodes.map(a=>({id:a.id,title:a.title,description:a.description,miles:a.miles,sku:a.sku,isActive:a.isActive,isScheduled:a.isScheduled,customerExchangeable:a.customerExchangeable,startsAt:new Date(a.startsAt),endsAt:a.endsAt?new Date(a.endsAt):void 0})),pageInfo:s.mileItems.pageInfo}:null}async getMileOrders(t,n,i,r){const s=await this.api.GetMileOrders({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.mileOrders.nodes.map(a=>({id:a.id,mileItem:{id:a.mileItem.id,title:a.mileItem.title,description:a.mileItem.description,miles:a.mileItem.miles,sku:a.mileItem.sku,isActive:a.mileItem.isActive,isScheduled:a.mileItem.isScheduled,customerExchangeable:a.mileItem.customerExchangeable,startsAt:new Date(a.mileItem.startsAt),endsAt:a.mileItem.endsAt?new Date(a.mileItem.endsAt):void 0},miles:a.miles,exchangedAt:new Date(a.exchangedAt),isCancelled:a.isCancelled})),pageInfo:s.purchasingCustomer.mileOrders.pageInfo}:null}async mileItemExchange(t){const n=await this.api.MileItemExchange({mileItemID:t});return n.mileItemExchange?{id:n.mileItemExchange.mileOrder.id,mileItem:{id:n.mileItemExchange.mileOrder.mileItem.id,title:n.mileItemExchange.mileOrder.mileItem.title,description:n.mileItemExchange.mileOrder.mileItem.description,miles:n.mileItemExchange.mileOrder.mileItem.miles,sku:n.mileItemExchange.mileOrder.mileItem.sku,isActive:n.mileItemExchange.mileOrder.mileItem.isActive,isScheduled:n.mileItemExchange.mileOrder.mileItem.isScheduled,customerExchangeable:n.mileItemExchange.mileOrder.mileItem.customerExchangeable,startsAt:new Date(n.mileItemExchange.mileOrder.mileItem.startsAt),endsAt:n.mileItemExchange.mileOrder.mileItem.endsAt?new Date(n.mileItemExchange.mileOrder.mileItem.endsAt):void 0},miles:n.mileItemExchange.mileOrder.miles,exchangedAt:new Date(n.mileItemExchange.mileOrder.exchangedAt),isCancelled:n.mileItemExchange.mileOrder.isCancelled}:null}}P.CurrencyCode=Ve,P.LocationType=je,P.SDK=Rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|