@builtbystack/sq-shopify-theme-sdk 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  var He = Object.defineProperty;
2
2
  var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Ce = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
3
+ var Te = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  function ze(e, t) {
5
5
  for (var n = 0; n < t.length; n++) {
6
6
  const i = t[n];
@@ -107,7 +107,7 @@ function rt(e) {
107
107
  extensions: e[5]
108
108
  } : t;
109
109
  }
110
- class ve extends Error {
110
+ class Ce extends Error {
111
111
  /**
112
112
  * An array of `{ line, column }` locations within the source GraphQL document
113
113
  * which correspond to this error.
@@ -183,7 +183,7 @@ class ve extends Error {
183
183
  value: m.stack,
184
184
  writable: !0,
185
185
  configurable: !0
186
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ve) : Object.defineProperty(this, "stack", {
186
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ce) : Object.defineProperty(this, "stack", {
187
187
  value: Error().stack,
188
188
  writable: !0,
189
189
  configurable: !0
@@ -217,7 +217,7 @@ function Ne(e) {
217
217
  return e === void 0 || e.length === 0 ? void 0 : e;
218
218
  }
219
219
  function b(e, t, n) {
220
- return new ve(`Syntax Error: ${n}`, {
220
+ return new Ce(`Syntax Error: ${n}`, {
221
221
  source: e,
222
222
  positions: [t]
223
223
  });
@@ -556,12 +556,12 @@ function ht(e, t) {
556
556
  case 125:
557
557
  return x(e, c.BRACE_R, r, r + 1);
558
558
  case 34:
559
- return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? vt(e, r) : mt(e, r);
559
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ct(e, r) : mt(e, r);
560
560
  }
561
561
  if (Y(s) || s === 45)
562
562
  return ft(e, r, s);
563
563
  if (we(s))
564
- return Tt(e, r);
564
+ return vt(e, r);
565
565
  throw b(
566
566
  e.source,
567
567
  r,
@@ -684,7 +684,7 @@ function yt(e, t) {
684
684
  size: r
685
685
  };
686
686
  }
687
- if (i = i << 4 | G(s), i < 0)
687
+ if (i = i << 4 | $(s), i < 0)
688
688
  break;
689
689
  }
690
690
  throw b(
@@ -718,9 +718,9 @@ function Et(e, t) {
718
718
  );
719
719
  }
720
720
  function be(e, t) {
721
- return G(e.charCodeAt(t)) << 12 | G(e.charCodeAt(t + 1)) << 8 | G(e.charCodeAt(t + 2)) << 4 | G(e.charCodeAt(t + 3));
721
+ return $(e.charCodeAt(t)) << 12 | $(e.charCodeAt(t + 1)) << 8 | $(e.charCodeAt(t + 2)) << 4 | $(e.charCodeAt(t + 3));
722
722
  }
723
- function G(e) {
723
+ function $(e) {
724
724
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
725
725
  }
726
726
  function gt(e, t) {
@@ -777,7 +777,7 @@ function gt(e, t) {
777
777
  )}".`
778
778
  );
779
779
  }
780
- function vt(e, t) {
780
+ function Ct(e, t) {
781
781
  const n = e.source.body, i = n.length;
782
782
  let r = e.lineStart, s = t + 3, o = s, u = "";
783
783
  const h = [];
@@ -820,7 +820,7 @@ function vt(e, t) {
820
820
  }
821
821
  throw b(e.source, s, "Unterminated string.");
822
822
  }
823
- function Tt(e, t) {
823
+ function vt(e, t) {
824
824
  const n = e.source.body, i = n.length;
825
825
  let r = t + 1;
826
826
  for (; r < i; ) {
@@ -838,8 +838,8 @@ function Tt(e, t) {
838
838
  n.slice(t, r)
839
839
  );
840
840
  }
841
- const Ct = 10, Fe = 2;
842
- function Te(e) {
841
+ const Tt = 10, Fe = 2;
842
+ function ve(e) {
843
843
  return oe(e, []);
844
844
  }
845
845
  function oe(e, t) {
@@ -882,7 +882,7 @@ function bt(e, t) {
882
882
  return "[]";
883
883
  if (t.length > Fe)
884
884
  return "[Array]";
885
- const n = Math.min(Ct, e.length), i = e.length - n, r = [];
885
+ const n = Math.min(Tt, e.length), i = e.length - n, r = [];
886
886
  for (let s = 0; s < n; ++s)
887
887
  r.push(oe(e[s], t));
888
888
  return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
@@ -896,7 +896,7 @@ function It(e) {
896
896
  }
897
897
  return t;
898
898
  }
899
- const Ot = (
899
+ const Dt = (
900
900
  /* c8 ignore next 6 */
901
901
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
902
902
  globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
@@ -911,7 +911,7 @@ const Ot = (
911
911
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
912
912
  );
913
913
  if (r === s) {
914
- const o = Te(t);
914
+ const o = ve(t);
915
915
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
916
916
 
917
917
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -934,7 +934,7 @@ class Be {
934
934
  line: 1,
935
935
  column: 1
936
936
  }) {
937
- typeof t == "string" || Z(!1, `Body must be a string. Received: ${Te(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
937
+ typeof t == "string" || Z(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
938
938
  !1,
939
939
  "line in locationOffset is 1-indexed and must be positive."
940
940
  ), this.locationOffset.column > 0 || Z(
@@ -946,15 +946,15 @@ class Be {
946
946
  return "Source";
947
947
  }
948
948
  }
949
- function Dt(e) {
950
- return Ot(e, Be);
949
+ function Ot(e) {
950
+ return Dt(e, Be);
951
951
  }
952
952
  function Me(e, t) {
953
953
  return new _t(e, t).parseDocument();
954
954
  }
955
955
  class _t {
956
956
  constructor(t, n = {}) {
957
- const i = Dt(t) ? t : new Be(t);
957
+ const i = Ot(t) ? t : new Be(t);
958
958
  this._lexer = new lt(i), this._options = n, this._tokenCounter = 0;
959
959
  }
960
960
  /**
@@ -2269,7 +2269,7 @@ function Lt(e, t, n = Re) {
2269
2269
  let S;
2270
2270
  if (!Array.isArray(p)) {
2271
2271
  var y, N;
2272
- xe(p) || Z(!1, `Invalid AST Node: ${Te(p)}.`);
2272
+ xe(p) || Z(!1, `Invalid AST Node: ${ve(p)}.`);
2273
2273
  const k = _ ? (y = i.get(p.kind)) === null || y === void 0 ? void 0 : y.leave : (N = i.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
2274
2274
  if (S = k == null ? void 0 : k.call(t, p, m, E, g, A), S === Pt)
2275
2275
  break;
@@ -2289,14 +2289,14 @@ function Lt(e, t, n = Re) {
2289
2289
  if (S === void 0 && z && h.push([m, p]), _)
2290
2290
  g.pop();
2291
2291
  else {
2292
- var D;
2292
+ var O;
2293
2293
  r = {
2294
2294
  inArray: s,
2295
2295
  index: u,
2296
2296
  keys: o,
2297
2297
  edits: h,
2298
2298
  prev: r
2299
- }, s = Array.isArray(p), o = s ? p : (D = n[p.kind]) !== null && D !== void 0 ? D : [], u = -1, h = [], E && A.push(E), E = p;
2299
+ }, s = Array.isArray(p), o = s ? p : (O = n[p.kind]) !== null && O !== void 0 ? O : [], u = -1, h = [], E && A.push(E), E = p;
2300
2300
  }
2301
2301
  } while (r !== void 0);
2302
2302
  return h.length !== 0 ? h[h.length - 1][1] : e;
@@ -2329,7 +2329,7 @@ const Mt = 80, Ut = {
2329
2329
  },
2330
2330
  OperationDefinition: {
2331
2331
  leave(e) {
2332
- const t = T("(", d(e.variableDefinitions, ", "), ")"), n = d(
2332
+ const t = v("(", d(e.variableDefinitions, ", "), ")"), n = d(
2333
2333
  [
2334
2334
  e.operation,
2335
2335
  d([e.name, t]),
@@ -2341,16 +2341,16 @@ const Mt = 80, Ut = {
2341
2341
  }
2342
2342
  },
2343
2343
  VariableDefinition: {
2344
- leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + T(" = ", n) + T(" ", d(i, " "))
2344
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + v(" = ", n) + v(" ", d(i, " "))
2345
2345
  },
2346
2346
  SelectionSet: {
2347
2347
  leave: ({ selections: e }) => R(e)
2348
2348
  },
2349
2349
  Field: {
2350
2350
  leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2351
- const s = T("", e, ": ") + t;
2352
- let o = s + T("(", d(n, ", "), ")");
2353
- return o.length > Mt && (o = s + T(`(
2351
+ const s = v("", e, ": ") + t;
2352
+ let o = s + v("(", d(n, ", "), ")");
2353
+ return o.length > Mt && (o = s + v(`(
2354
2354
  `, K(d(n, `
2355
2355
  `)), `
2356
2356
  )`)), d([o, d(i, " "), r], " ");
@@ -2361,13 +2361,13 @@ const Mt = 80, Ut = {
2361
2361
  },
2362
2362
  // Fragments
2363
2363
  FragmentSpread: {
2364
- leave: ({ name: e, directives: t }) => "..." + e + T(" ", d(t, " "))
2364
+ leave: ({ name: e, directives: t }) => "..." + e + v(" ", d(t, " "))
2365
2365
  },
2366
2366
  InlineFragment: {
2367
2367
  leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2368
2368
  [
2369
2369
  "...",
2370
- T("on ", e),
2370
+ v("on ", e),
2371
2371
  d(t, " "),
2372
2372
  n
2373
2373
  ],
@@ -2377,7 +2377,7 @@ const Mt = 80, Ut = {
2377
2377
  FragmentDefinition: {
2378
2378
  leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
2379
2379
  // or removed in the future.
2380
- `fragment ${e}${T("(", d(n, ", "), ")")} on ${t} ${T("", d(i, " "), " ")}` + r
2380
+ `fragment ${e}${v("(", d(n, ", "), ")")} on ${t} ${v("", d(i, " "), " ")}` + r
2381
2381
  )
2382
2382
  },
2383
2383
  // Value
@@ -2410,7 +2410,7 @@ const Mt = 80, Ut = {
2410
2410
  },
2411
2411
  // Directive
2412
2412
  Directive: {
2413
- leave: ({ name: e, arguments: t }) => "@" + e + T("(", d(t, ", "), ")")
2413
+ leave: ({ name: e, arguments: t }) => "@" + e + v("(", d(t, ", "), ")")
2414
2414
  },
2415
2415
  // Type
2416
2416
  NamedType: {
@@ -2424,23 +2424,23 @@ const Mt = 80, Ut = {
2424
2424
  },
2425
2425
  // Type System Definitions
2426
2426
  SchemaDefinition: {
2427
- leave: ({ description: e, directives: t, operationTypes: n }) => T("", e, `
2427
+ leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
2428
2428
  `) + d(["schema", d(t, " "), R(n)], " ")
2429
2429
  },
2430
2430
  OperationTypeDefinition: {
2431
2431
  leave: ({ operation: e, type: t }) => e + ": " + t
2432
2432
  },
2433
2433
  ScalarTypeDefinition: {
2434
- leave: ({ description: e, name: t, directives: n }) => T("", e, `
2434
+ leave: ({ description: e, name: t, directives: n }) => v("", e, `
2435
2435
  `) + d(["scalar", t, d(n, " ")], " ")
2436
2436
  },
2437
2437
  ObjectTypeDefinition: {
2438
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
2438
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
2439
2439
  `) + d(
2440
2440
  [
2441
2441
  "type",
2442
2442
  t,
2443
- T("implements ", d(n, " & ")),
2443
+ v("implements ", d(n, " & ")),
2444
2444
  d(i, " "),
2445
2445
  R(r)
2446
2446
  ],
@@ -2448,26 +2448,26 @@ const Mt = 80, Ut = {
2448
2448
  )
2449
2449
  },
2450
2450
  FieldDefinition: {
2451
- leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => T("", e, `
2452
- `) + t + (Ie(n) ? T(`(
2451
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => v("", e, `
2452
+ `) + t + (Ie(n) ? v(`(
2453
2453
  `, K(d(n, `
2454
2454
  `)), `
2455
- )`) : T("(", d(n, ", "), ")")) + ": " + i + T(" ", d(r, " "))
2455
+ )`) : v("(", d(n, ", "), ")")) + ": " + i + v(" ", d(r, " "))
2456
2456
  },
2457
2457
  InputValueDefinition: {
2458
- leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => T("", e, `
2458
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => v("", e, `
2459
2459
  `) + d(
2460
- [t + ": " + n, T("= ", i), d(r, " ")],
2460
+ [t + ": " + n, v("= ", i), d(r, " ")],
2461
2461
  " "
2462
2462
  )
2463
2463
  },
2464
2464
  InterfaceTypeDefinition: {
2465
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
2465
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => v("", e, `
2466
2466
  `) + d(
2467
2467
  [
2468
2468
  "interface",
2469
2469
  t,
2470
- T("implements ", d(n, " & ")),
2470
+ v("implements ", d(n, " & ")),
2471
2471
  d(i, " "),
2472
2472
  R(r)
2473
2473
  ],
@@ -2475,30 +2475,30 @@ const Mt = 80, Ut = {
2475
2475
  )
2476
2476
  },
2477
2477
  UnionTypeDefinition: {
2478
- leave: ({ description: e, name: t, directives: n, types: i }) => T("", e, `
2478
+ leave: ({ description: e, name: t, directives: n, types: i }) => v("", e, `
2479
2479
  `) + d(
2480
- ["union", t, d(n, " "), T("= ", d(i, " | "))],
2480
+ ["union", t, d(n, " "), v("= ", d(i, " | "))],
2481
2481
  " "
2482
2482
  )
2483
2483
  },
2484
2484
  EnumTypeDefinition: {
2485
- leave: ({ description: e, name: t, directives: n, values: i }) => T("", e, `
2485
+ leave: ({ description: e, name: t, directives: n, values: i }) => v("", e, `
2486
2486
  `) + d(["enum", t, d(n, " "), R(i)], " ")
2487
2487
  },
2488
2488
  EnumValueDefinition: {
2489
- leave: ({ description: e, name: t, directives: n }) => T("", e, `
2489
+ leave: ({ description: e, name: t, directives: n }) => v("", e, `
2490
2490
  `) + d([t, d(n, " ")], " ")
2491
2491
  },
2492
2492
  InputObjectTypeDefinition: {
2493
- leave: ({ description: e, name: t, directives: n, fields: i }) => T("", e, `
2493
+ leave: ({ description: e, name: t, directives: n, fields: i }) => v("", e, `
2494
2494
  `) + d(["input", t, d(n, " "), R(i)], " ")
2495
2495
  },
2496
2496
  DirectiveDefinition: {
2497
- leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => T("", e, `
2498
- `) + "directive @" + t + (Ie(n) ? T(`(
2497
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => v("", e, `
2498
+ `) + "directive @" + t + (Ie(n) ? v(`(
2499
2499
  `, K(d(n, `
2500
2500
  `)), `
2501
- )`) : T("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
2501
+ )`) : v("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
2502
2502
  },
2503
2503
  SchemaExtension: {
2504
2504
  leave: ({ directives: e, operationTypes: t }) => d(
@@ -2514,7 +2514,7 @@ const Mt = 80, Ut = {
2514
2514
  [
2515
2515
  "extend type",
2516
2516
  e,
2517
- T("implements ", d(t, " & ")),
2517
+ v("implements ", d(t, " & ")),
2518
2518
  d(n, " "),
2519
2519
  R(i)
2520
2520
  ],
@@ -2526,7 +2526,7 @@ const Mt = 80, Ut = {
2526
2526
  [
2527
2527
  "extend interface",
2528
2528
  e,
2529
- T("implements ", d(t, " & ")),
2529
+ v("implements ", d(t, " & ")),
2530
2530
  d(n, " "),
2531
2531
  R(i)
2532
2532
  ],
@@ -2539,7 +2539,7 @@ const Mt = 80, Ut = {
2539
2539
  "extend union",
2540
2540
  e,
2541
2541
  d(t, " "),
2542
- T("= ", d(n, " | "))
2542
+ v("= ", d(n, " | "))
2543
2543
  ],
2544
2544
  " "
2545
2545
  )
@@ -2556,16 +2556,16 @@ function d(e, t = "") {
2556
2556
  return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2557
2557
  }
2558
2558
  function R(e) {
2559
- return T(`{
2559
+ return v(`{
2560
2560
  `, K(d(e, `
2561
2561
  `)), `
2562
2562
  }`);
2563
2563
  }
2564
- function T(e, t, n = "") {
2564
+ function v(e, t, n = "") {
2565
2565
  return t != null && t !== "" ? e + t + n : "";
2566
2566
  }
2567
2567
  function K(e) {
2568
- return T(" ", e.replace(/\n/g, `
2568
+ return v(" ", e.replace(/\n/g, `
2569
2569
  `));
2570
2570
  }
2571
2571
  function Ie(e) {
@@ -2573,7 +2573,7 @@ function Ie(e) {
2573
2573
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2574
2574
  `))) !== null && t !== void 0 ? t : !1;
2575
2575
  }
2576
- const Oe = (e) => {
2576
+ const De = (e) => {
2577
2577
  var i, r;
2578
2578
  let t;
2579
2579
  const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
@@ -2583,12 +2583,12 @@ const Oe = (e) => {
2583
2583
  let n;
2584
2584
  try {
2585
2585
  const i = Me(e);
2586
- n = Oe(i);
2586
+ n = De(i);
2587
2587
  } catch {
2588
2588
  }
2589
2589
  return { query: e, operationName: n };
2590
2590
  }
2591
- const t = Oe(e);
2591
+ const t = De(e);
2592
2592
  return { query: Bt(e), operationName: t };
2593
2593
  };
2594
2594
  class H extends Error {
@@ -2659,8 +2659,8 @@ var ye = { exports: {} };
2659
2659
  function A(a) {
2660
2660
  var l = {
2661
2661
  next: function() {
2662
- var v = a.shift();
2663
- return { done: v === void 0, value: v };
2662
+ var C = a.shift();
2663
+ return { done: C === void 0, value: C };
2664
2664
  }
2665
2665
  };
2666
2666
  return u.iterable && (l[Symbol.iterator] = function() {
@@ -2668,8 +2668,8 @@ var ye = { exports: {} };
2668
2668
  }), l;
2669
2669
  }
2670
2670
  function y(a) {
2671
- this.map = {}, a instanceof y ? a.forEach(function(l, v) {
2672
- this.append(v, l);
2671
+ this.map = {}, a instanceof y ? a.forEach(function(l, C) {
2672
+ this.append(C, l);
2673
2673
  }, this) : Array.isArray(a) ? a.forEach(function(l) {
2674
2674
  this.append(l[0], l[1]);
2675
2675
  }, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
@@ -2678,8 +2678,8 @@ var ye = { exports: {} };
2678
2678
  }
2679
2679
  y.prototype.append = function(a, l) {
2680
2680
  a = E(a), l = g(l);
2681
- var v = this.map[a];
2682
- this.map[a] = v ? v + ", " + l : l;
2681
+ var C = this.map[a];
2682
+ this.map[a] = C ? C + ", " + l : l;
2683
2683
  }, y.prototype.delete = function(a) {
2684
2684
  delete this.map[E(a)];
2685
2685
  }, y.prototype.get = function(a) {
@@ -2689,12 +2689,12 @@ var ye = { exports: {} };
2689
2689
  }, y.prototype.set = function(a, l) {
2690
2690
  this.map[E(a)] = g(l);
2691
2691
  }, y.prototype.forEach = function(a, l) {
2692
- for (var v in this.map)
2693
- this.map.hasOwnProperty(v) && a.call(l, this.map[v], v, this);
2692
+ for (var C in this.map)
2693
+ this.map.hasOwnProperty(C) && a.call(l, this.map[C], C, this);
2694
2694
  }, y.prototype.keys = function() {
2695
2695
  var a = [];
2696
- return this.forEach(function(l, v) {
2697
- a.push(v);
2696
+ return this.forEach(function(l, C) {
2697
+ a.push(C);
2698
2698
  }), A(a);
2699
2699
  }, y.prototype.values = function() {
2700
2700
  var a = [];
@@ -2703,8 +2703,8 @@ var ye = { exports: {} };
2703
2703
  }), A(a);
2704
2704
  }, y.prototype.entries = function() {
2705
2705
  var a = [];
2706
- return this.forEach(function(l, v) {
2707
- a.push([v, l]);
2706
+ return this.forEach(function(l, C) {
2707
+ a.push([C, l]);
2708
2708
  }), A(a);
2709
2709
  }, u.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
2710
2710
  function N(a) {
@@ -2712,27 +2712,27 @@ var ye = { exports: {} };
2712
2712
  return Promise.reject(new TypeError("Already read"));
2713
2713
  a.bodyUsed = !0;
2714
2714
  }
2715
- function D(a) {
2716
- return new Promise(function(l, v) {
2715
+ function O(a) {
2716
+ return new Promise(function(l, C) {
2717
2717
  a.onload = function() {
2718
2718
  l(a.result);
2719
2719
  }, a.onerror = function() {
2720
- v(a.error);
2720
+ C(a.error);
2721
2721
  };
2722
2722
  });
2723
2723
  }
2724
2724
  function _(a) {
2725
- var l = new FileReader(), v = D(l);
2726
- return l.readAsArrayBuffer(a), v;
2725
+ var l = new FileReader(), C = O(l);
2726
+ return l.readAsArrayBuffer(a), C;
2727
2727
  }
2728
2728
  function z(a) {
2729
- var l = new FileReader(), v = D(l);
2730
- return l.readAsText(a), v;
2729
+ var l = new FileReader(), C = O(l);
2730
+ return l.readAsText(a), C;
2731
2731
  }
2732
2732
  function S(a) {
2733
- for (var l = new Uint8Array(a), v = new Array(l.length), O = 0; O < l.length; O++)
2734
- v[O] = String.fromCharCode(l[O]);
2735
- return v.join("");
2733
+ for (var l = new Uint8Array(a), C = new Array(l.length), D = 0; D < l.length; D++)
2734
+ C[D] = String.fromCharCode(l[D]);
2735
+ return C.join("");
2736
2736
  }
2737
2737
  function k(a) {
2738
2738
  if (a.slice)
@@ -2780,36 +2780,36 @@ var ye = { exports: {} };
2780
2780
  }
2781
2781
  function L(a, l) {
2782
2782
  l = l || {};
2783
- var v = l.body;
2783
+ var C = l.body;
2784
2784
  if (a instanceof L) {
2785
2785
  if (a.bodyUsed)
2786
2786
  throw new TypeError("Already read");
2787
- this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new y(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !v && a._bodyInit != null && (v = a._bodyInit, a.bodyUsed = !0);
2787
+ this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new y(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !C && a._bodyInit != null && (C = a._bodyInit, a.bodyUsed = !0);
2788
2788
  } else
2789
2789
  this.url = String(a);
2790
- if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new y(l.headers)), this.method = J(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") && v)
2790
+ if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new y(l.headers)), this.method = J(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") && C)
2791
2791
  throw new TypeError("Body not allowed for GET or HEAD requests");
2792
- this._initBody(v);
2792
+ this._initBody(C);
2793
2793
  }
2794
2794
  L.prototype.clone = function() {
2795
2795
  return new L(this, { body: this._bodyInit });
2796
2796
  };
2797
2797
  function je(a) {
2798
2798
  var l = new FormData();
2799
- return a.trim().split("&").forEach(function(v) {
2800
- if (v) {
2801
- var O = v.split("="), I = O.shift().replace(/\+/g, " "), C = O.join("=").replace(/\+/g, " ");
2802
- l.append(decodeURIComponent(I), decodeURIComponent(C));
2799
+ return a.trim().split("&").forEach(function(C) {
2800
+ if (C) {
2801
+ var D = C.split("="), I = D.shift().replace(/\+/g, " "), T = D.join("=").replace(/\+/g, " ");
2802
+ l.append(decodeURIComponent(I), decodeURIComponent(T));
2803
2803
  }
2804
2804
  }), l;
2805
2805
  }
2806
- function $e(a) {
2807
- var l = new y(), v = a.replace(/\r?\n[\t ]+/g, " ");
2808
- return v.split(/\r?\n/).forEach(function(O) {
2809
- var I = O.split(":"), C = I.shift().trim();
2810
- if (C) {
2806
+ function Ge(a) {
2807
+ var l = new y(), C = a.replace(/\r?\n[\t ]+/g, " ");
2808
+ return C.split(/\r?\n/).forEach(function(D) {
2809
+ var I = D.split(":"), T = I.shift().trim();
2810
+ if (T) {
2811
2811
  var X = I.join(":").trim();
2812
- l.append(C, X);
2812
+ l.append(T, X);
2813
2813
  }
2814
2814
  }), l;
2815
2815
  }
@@ -2828,50 +2828,50 @@ var ye = { exports: {} };
2828
2828
  var a = new w(null, { status: 0, statusText: "" });
2829
2829
  return a.type = "error", a;
2830
2830
  };
2831
- var Ge = [301, 302, 303, 307, 308];
2831
+ var $e = [301, 302, 303, 307, 308];
2832
2832
  w.redirect = function(a, l) {
2833
- if (Ge.indexOf(l) === -1)
2833
+ if ($e.indexOf(l) === -1)
2834
2834
  throw new RangeError("Invalid status code");
2835
2835
  return new w(null, { status: l, headers: { location: a } });
2836
2836
  }, o.DOMException = s.DOMException;
2837
2837
  try {
2838
2838
  new o.DOMException();
2839
2839
  } catch {
2840
- o.DOMException = function(l, v) {
2841
- this.message = l, this.name = v;
2842
- var O = Error(l);
2843
- this.stack = O.stack;
2840
+ o.DOMException = function(l, C) {
2841
+ this.message = l, this.name = C;
2842
+ var D = Error(l);
2843
+ this.stack = D.stack;
2844
2844
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2845
2845
  }
2846
2846
  function ae(a, l) {
2847
- return new Promise(function(v, O) {
2847
+ return new Promise(function(C, D) {
2848
2848
  var I = new L(a, l);
2849
2849
  if (I.signal && I.signal.aborted)
2850
- return O(new o.DOMException("Aborted", "AbortError"));
2851
- var C = new XMLHttpRequest();
2850
+ return D(new o.DOMException("Aborted", "AbortError"));
2851
+ var T = new XMLHttpRequest();
2852
2852
  function X() {
2853
- C.abort();
2853
+ T.abort();
2854
2854
  }
2855
- C.onload = function() {
2855
+ T.onload = function() {
2856
2856
  var j = {
2857
- status: C.status,
2858
- statusText: C.statusText,
2859
- headers: $e(C.getAllResponseHeaders() || "")
2857
+ status: T.status,
2858
+ statusText: T.statusText,
2859
+ headers: Ge(T.getAllResponseHeaders() || "")
2860
2860
  };
2861
- j.url = "responseURL" in C ? C.responseURL : j.headers.get("X-Request-URL");
2862
- var ce = "response" in C ? C.response : C.responseText;
2863
- v(new w(ce, j));
2864
- }, C.onerror = function() {
2865
- O(new TypeError("Network request failed"));
2866
- }, C.ontimeout = function() {
2867
- O(new TypeError("Network request failed"));
2868
- }, C.onabort = function() {
2869
- O(new o.DOMException("Aborted", "AbortError"));
2870
- }, C.open(I.method, I.url, !0), I.credentials === "include" ? C.withCredentials = !0 : I.credentials === "omit" && (C.withCredentials = !1), "responseType" in C && u.blob && (C.responseType = "blob"), I.headers.forEach(function(j, ce) {
2871
- C.setRequestHeader(ce, j);
2872
- }), I.signal && (I.signal.addEventListener("abort", X), C.onreadystatechange = function() {
2873
- C.readyState === 4 && I.signal.removeEventListener("abort", X);
2874
- }), C.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
2861
+ j.url = "responseURL" in T ? T.responseURL : j.headers.get("X-Request-URL");
2862
+ var ce = "response" in T ? T.response : T.responseText;
2863
+ C(new w(ce, j));
2864
+ }, T.onerror = function() {
2865
+ D(new TypeError("Network request failed"));
2866
+ }, T.ontimeout = function() {
2867
+ D(new TypeError("Network request failed"));
2868
+ }, T.onabort = function() {
2869
+ D(new o.DOMException("Aborted", "AbortError"));
2870
+ }, T.open(I.method, I.url, !0), I.credentials === "include" ? T.withCredentials = !0 : I.credentials === "omit" && (T.withCredentials = !1), "responseType" in T && u.blob && (T.responseType = "blob"), I.headers.forEach(function(j, ce) {
2871
+ T.setRequestHeader(ce, j);
2872
+ }), I.signal && (I.signal.addEventListener("abort", X), T.onreadystatechange = function() {
2873
+ T.readyState === 4 && I.signal.removeEventListener("abort", X);
2874
+ }), T.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
2875
2875
  });
2876
2876
  }
2877
2877
  return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = L, s.Response = w), o.Headers = y, o.Request = L, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
@@ -2889,22 +2889,22 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
2889
2889
  return e && (typeof Headers < "u" && e instanceof Headers || jt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
2890
2890
  n && i !== void 0 && (t[n] = i);
2891
2891
  }) : t = e), t;
2892
- }, De = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), $t = (e) => {
2892
+ }, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Gt = (e) => {
2893
2893
  if (!Array.isArray(e.query)) {
2894
- const i = e, r = [`query=${encodeURIComponent(De(i.query))}`];
2894
+ const i = e, r = [`query=${encodeURIComponent(Oe(i.query))}`];
2895
2895
  return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
2896
2896
  }
2897
2897
  if (typeof e.variables < "u" && !Array.isArray(e.variables))
2898
2898
  throw new Error("Cannot create query with given variable type, array expected");
2899
2899
  const t = e, n = e.query.reduce((i, r, s) => (i.push({
2900
- query: De(r),
2900
+ query: Oe(r),
2901
2901
  variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
2902
2902
  }), i), []);
2903
2903
  return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
2904
- }, Gt = (e) => async (t) => {
2904
+ }, $t = (e) => async (t) => {
2905
2905
  const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware: h } = t, p = { ...t.headers };
2906
2906
  let m = "", E;
2907
- e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = $t({
2907
+ e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = Gt({
2908
2908
  query: i,
2909
2909
  variables: r,
2910
2910
  operationName: s,
@@ -2918,8 +2918,8 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
2918
2918
  };
2919
2919
  let A = n, y = g;
2920
2920
  if (h) {
2921
- const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: D, ..._ } = N;
2922
- A = D, y = _;
2921
+ const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: O, ..._ } = N;
2922
+ A = O, y = _;
2923
2923
  }
2924
2924
  return m && (A = `${A}?${m}`), await o(A, y);
2925
2925
  };
@@ -2942,8 +2942,8 @@ class Ht {
2942
2942
  method: m,
2943
2943
  fetchOptions: A,
2944
2944
  middleware: E
2945
- }).then((D) => (g && g(D), D)).catch((D) => {
2946
- throw g && g(D), D;
2945
+ }).then((O) => (g && g(O), O)).catch((O) => {
2946
+ throw g && g(O), O;
2947
2947
  });
2948
2948
  };
2949
2949
  }
@@ -3009,7 +3009,7 @@ class Ht {
3009
3009
  }
3010
3010
  }
3011
3011
  const de = async (e) => {
3012
- const { query: t, variables: n, fetchOptions: i } = e, r = Gt(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
3012
+ const { query: t, variables: n, fetchOptions: i } = e, r = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
3013
3013
  if (o.ok && p && h) {
3014
3014
  const { errors: m, ...E } = (Array.isArray(u), u), g = i.errorPolicy === "ignore" ? E : u;
3015
3015
  return {
@@ -3115,7 +3115,7 @@ function en() {
3115
3115
  function tn() {
3116
3116
  ie = !1;
3117
3117
  }
3118
- var $ = {
3118
+ var G = {
3119
3119
  gql: q,
3120
3120
  resetCaches: Zt,
3121
3121
  disableFragmentWarnings: Kt,
@@ -3123,7 +3123,7 @@ var $ = {
3123
3123
  disableExperimentalFragmentVariables: tn
3124
3124
  };
3125
3125
  (function(e) {
3126
- e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
3126
+ e.gql = G.gql, e.resetCaches = G.resetCaches, e.disableFragmentWarnings = G.disableFragmentWarnings, e.enableExperimentalFragmentVariables = G.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = G.disableExperimentalFragmentVariables;
3127
3127
  })(q || (q = {}));
3128
3128
  q.default = q;
3129
3129
  const P = q, nn = P`
@@ -3236,13 +3236,14 @@ const P = q, nn = P`
3236
3236
  query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
3237
3237
  purchasingCustomer {
3238
3238
  id
3239
- discounts(first: $first, after: $after, isReverse: $isReverse) {
3239
+ orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
3240
3240
  nodes {
3241
3241
  id
3242
3242
  title
3243
3243
  status
3244
3244
  description
3245
3245
  code
3246
+ customerApplicable
3246
3247
  startsAt
3247
3248
  endsAt
3248
3249
  createdAt
@@ -3258,6 +3259,13 @@ const P = q, nn = P`
3258
3259
  }
3259
3260
  }
3260
3261
  `, un = P`
3262
+ query GetPurchasingCustomerDiscountCodeCount {
3263
+ purchasingCustomer {
3264
+ id
3265
+ orderPriceAdjustmentRuleCount
3266
+ }
3267
+ }
3268
+ `, ln = P`
3261
3269
  query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
3262
3270
  purchasingCustomer {
3263
3271
  id
@@ -3279,6 +3287,24 @@ const P = q, nn = P`
3279
3287
  pointChangeCreatedAt
3280
3288
  createdAt
3281
3289
  }
3290
+ retailLocation {
3291
+ id
3292
+ name
3293
+ phone
3294
+ address {
3295
+ id
3296
+ countryCode
3297
+ country
3298
+ postalCode
3299
+ provinceCode
3300
+ province
3301
+ city
3302
+ address1
3303
+ address2
3304
+ updatedAt
3305
+ createdAt
3306
+ }
3307
+ }
3282
3308
  }
3283
3309
  pageInfo {
3284
3310
  startCursor
@@ -3289,7 +3315,7 @@ const P = q, nn = P`
3289
3315
  }
3290
3316
  }
3291
3317
  }
3292
- `, ln = P`
3318
+ `, dn = P`
3293
3319
  query GetPurchasingCustomerRank {
3294
3320
  purchasingCustomer {
3295
3321
  currentCustomerRank {
@@ -3328,8 +3354,8 @@ const P = q, nn = P`
3328
3354
  }
3329
3355
  }
3330
3356
  }
3331
- `, dn = (e, t, n, i) => e();
3332
- function hn(e, t = dn) {
3357
+ `, hn = (e, t, n, i) => e();
3358
+ function pn(e, t = hn) {
3333
3359
  return {
3334
3360
  GetLocationAvailabilities(n, i) {
3335
3361
  return t((r) => e.request(nn, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
@@ -3349,18 +3375,21 @@ function hn(e, t = dn) {
3349
3375
  GetPurchasingCustomerDiscounts(n, i) {
3350
3376
  return t((r) => e.request(cn, n, { ...i, ...r }), "GetPurchasingCustomerDiscounts", "query", n);
3351
3377
  },
3378
+ GetPurchasingCustomerDiscountCodeCount(n, i) {
3379
+ return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3380
+ },
3352
3381
  GetPurchasingCustomerPointChangeActivities(n, i) {
3353
- return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3382
+ return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3354
3383
  },
3355
3384
  GetPurchasingCustomerRank(n, i) {
3356
- return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
3385
+ return t((r) => e.request(dn, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
3357
3386
  }
3358
3387
  };
3359
3388
  }
3360
- class fn {
3389
+ class mn {
3361
3390
  constructor(t) {
3362
- Ce(this, "api");
3363
- this.api = hn(
3391
+ Te(this, "api");
3392
+ this.api = pn(
3364
3393
  new Ht(`${t}/apps/sq-api`, {
3365
3394
  headers: {
3366
3395
  "X-SQ-CLIENT": "ShopifyAppProxy"
@@ -3503,20 +3532,21 @@ class fn {
3503
3532
  });
3504
3533
  return r.purchasingCustomer ? {
3505
3534
  id: r.purchasingCustomer.id,
3506
- nodes: r.purchasingCustomer.discounts.nodes.map(
3535
+ nodes: r.purchasingCustomer.orderPriceAdjustmentRules.nodes.map(
3507
3536
  (s) => ({
3508
3537
  id: s.id,
3509
3538
  title: s.title,
3510
3539
  status: s.status,
3511
3540
  description: s.description,
3512
3541
  code: s.code,
3542
+ customerApplicable: s.customerApplicable,
3513
3543
  startsAt: new Date(s.startsAt),
3514
3544
  endsAt: new Date(s.endsAt),
3515
3545
  createdAt: new Date(s.createdAt),
3516
3546
  updatedAt: new Date(s.updatedAt)
3517
3547
  })
3518
3548
  ) ?? [],
3519
- pageInfo: r.purchasingCustomer.discounts.pageInfo ?? null
3549
+ pageInfo: r.purchasingCustomer.orderPriceAdjustmentRules.pageInfo ?? null
3520
3550
  } : null;
3521
3551
  }
3522
3552
  /**
@@ -3549,7 +3579,23 @@ class fn {
3549
3579
  o.pointChange.pointChangeCreatedAt
3550
3580
  ),
3551
3581
  createdAt: new Date(o.pointChange.createdAt)
3552
- }
3582
+ },
3583
+ retailLocation: o.retailLocation ? {
3584
+ id: o.retailLocation.id,
3585
+ name: o.retailLocation.name,
3586
+ phone: o.retailLocation.phone,
3587
+ address: o.retailLocation.address ? {
3588
+ id: o.retailLocation.address.id,
3589
+ countryCode: o.retailLocation.address.countryCode,
3590
+ country: o.retailLocation.address.country,
3591
+ postalCode: o.retailLocation.address.postalCode,
3592
+ provinceCode: o.retailLocation.address.provinceCode,
3593
+ province: o.retailLocation.address.province,
3594
+ city: o.retailLocation.address.city,
3595
+ address1: o.retailLocation.address.address1,
3596
+ address2: o.retailLocation.address.address2
3597
+ } : void 0
3598
+ } : void 0
3553
3599
  })
3554
3600
  ),
3555
3601
  pageInfo: s.purchasingCustomer.pointChangeActivities.pageInfo
@@ -3600,7 +3646,14 @@ class fn {
3600
3646
  } : void 0
3601
3647
  } : null;
3602
3648
  }
3649
+ /**
3650
+ * getPurchasingCustomerDiscountCodeCount は顧客に紐付くDiscountCodeの数を返します。
3651
+ */
3652
+ async getPurchasingCustomerDiscountCodeCount() {
3653
+ var n;
3654
+ return ((n = (await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer) == null ? void 0 : n.orderPriceAdjustmentRuleCount) ?? 0;
3655
+ }
3603
3656
  }
3604
3657
  export {
3605
- fn as SDK
3658
+ mn as SDK
3606
3659
  };