@plasmicpkgs/commerce-shopify 0.0.251 → 0.0.252

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.
@@ -84,306 +84,113 @@ function _objectWithoutPropertiesLoose(r, e) {
84
84
  }
85
85
  return t;
86
86
  }
87
- function _regeneratorRuntime() {
88
- _regeneratorRuntime = function () {
89
- return e;
90
- };
91
- var t,
92
- e = {},
93
- r = Object.prototype,
94
- n = r.hasOwnProperty,
95
- o = Object.defineProperty || function (t, e, r) {
96
- t[e] = r.value;
97
- },
98
- i = "function" == typeof Symbol ? Symbol : {},
99
- a = i.iterator || "@@iterator",
100
- c = i.asyncIterator || "@@asyncIterator",
101
- u = i.toStringTag || "@@toStringTag";
102
- function define(t, e, r) {
103
- return Object.defineProperty(t, e, {
104
- value: r,
105
- enumerable: !0,
106
- configurable: !0,
107
- writable: !0
108
- }), t[e];
109
- }
110
- try {
111
- define({}, "");
112
- } catch (t) {
113
- define = function (t, e, r) {
114
- return t[e] = r;
115
- };
116
- }
117
- function wrap(t, e, r, n) {
118
- var i = e && e.prototype instanceof Generator ? e : Generator,
119
- a = Object.create(i.prototype),
120
- c = new Context(n || []);
121
- return o(a, "_invoke", {
122
- value: makeInvokeMethod(t, r, c)
123
- }), a;
124
- }
125
- function tryCatch(t, e, r) {
126
- try {
127
- return {
128
- type: "normal",
129
- arg: t.call(e, r)
130
- };
131
- } catch (t) {
132
- return {
133
- type: "throw",
134
- arg: t
135
- };
136
- }
137
- }
138
- e.wrap = wrap;
139
- var h = "suspendedStart",
140
- l = "suspendedYield",
141
- f = "executing",
142
- s = "completed",
143
- y = {};
144
- function Generator() {}
145
- function GeneratorFunction() {}
146
- function GeneratorFunctionPrototype() {}
147
- var p = {};
148
- define(p, a, function () {
149
- return this;
150
- });
151
- var d = Object.getPrototypeOf,
152
- v = d && d(d(values([])));
153
- v && v !== r && n.call(v, a) && (p = v);
154
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
155
- function defineIteratorMethods(t) {
156
- ["next", "throw", "return"].forEach(function (e) {
157
- define(t, e, function (t) {
158
- return this._invoke(e, t);
159
- });
160
- });
161
- }
162
- function AsyncIterator(t, e) {
163
- function invoke(r, o, i, a) {
164
- var c = tryCatch(t[r], t, o);
165
- if ("throw" !== c.type) {
166
- var u = c.arg,
167
- h = u.value;
168
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
169
- invoke("next", t, i, a);
170
- }, function (t) {
171
- invoke("throw", t, i, a);
172
- }) : e.resolve(h).then(function (t) {
173
- u.value = t, i(u);
174
- }, function (t) {
175
- return invoke("throw", t, i, a);
176
- });
177
- }
178
- a(c.arg);
179
- }
180
- var r;
181
- o(this, "_invoke", {
182
- value: function (t, n) {
183
- function callInvokeWithMethodAndArg() {
184
- return new e(function (e, r) {
185
- invoke(t, n, e, r);
186
- });
87
+ function _regenerator() {
88
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
89
+ var e,
90
+ t,
91
+ r = "function" == typeof Symbol ? Symbol : {},
92
+ n = r.iterator || "@@iterator",
93
+ o = r.toStringTag || "@@toStringTag";
94
+ function i(r, n, o, i) {
95
+ var c = n && n.prototype instanceof Generator ? n : Generator,
96
+ u = Object.create(c.prototype);
97
+ return _regeneratorDefine(u, "_invoke", function (r, n, o) {
98
+ var i,
99
+ c,
100
+ u,
101
+ f = 0,
102
+ p = o || [],
103
+ y = !1,
104
+ G = {
105
+ p: 0,
106
+ n: 0,
107
+ v: e,
108
+ a: d,
109
+ f: d.bind(e, 4),
110
+ d: function (t, r) {
111
+ return i = t, c = 0, u = e, G.n = r, a;
112
+ }
113
+ };
114
+ function d(r, n) {
115
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
116
+ var o,
117
+ i = p[t],
118
+ d = G.p,
119
+ l = i[2];
120
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
187
121
  }
188
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
122
+ if (o || r > 1) return a;
123
+ throw y = !0, n;
189
124
  }
190
- });
191
- }
192
- function makeInvokeMethod(e, r, n) {
193
- var o = h;
194
- return function (i, a) {
195
- if (o === f) throw Error("Generator is already running");
196
- if (o === s) {
197
- if ("throw" === i) throw a;
125
+ return function (o, p, l) {
126
+ if (f > 1) throw TypeError("Generator is already running");
127
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
128
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
129
+ try {
130
+ if (f = 2, i) {
131
+ if (c || (o = "next"), t = i[o]) {
132
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
133
+ if (!t.done) return t;
134
+ u = t.value, c < 2 && (c = 0);
135
+ } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
136
+ i = e;
137
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
138
+ } catch (t) {
139
+ i = e, c = 1, u = t;
140
+ } finally {
141
+ f = 1;
142
+ }
143
+ }
198
144
  return {
199
145
  value: t,
200
- done: !0
146
+ done: y
201
147
  };
202
- }
203
- for (n.method = i, n.arg = a;;) {
204
- var c = n.delegate;
205
- if (c) {
206
- var u = maybeInvokeDelegate(c, n);
207
- if (u) {
208
- if (u === y) continue;
209
- return u;
210
- }
211
- }
212
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
213
- if (o === h) throw o = s, n.arg;
214
- n.dispatchException(n.arg);
215
- } else "return" === n.method && n.abrupt("return", n.arg);
216
- o = f;
217
- var p = tryCatch(e, r, n);
218
- if ("normal" === p.type) {
219
- if (o = n.done ? s : l, p.arg === y) continue;
220
- return {
221
- value: p.arg,
222
- done: n.done
223
- };
224
- }
225
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
226
- }
227
- };
228
- }
229
- function maybeInvokeDelegate(e, r) {
230
- var n = r.method,
231
- o = e.iterator[n];
232
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
233
- var i = tryCatch(o, e.iterator, r.arg);
234
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
235
- var a = i.arg;
236
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
237
- }
238
- function pushTryEntry(t) {
239
- var e = {
240
- tryLoc: t[0]
241
- };
242
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
243
- }
244
- function resetTryEntry(t) {
245
- var e = t.completion || {};
246
- e.type = "normal", delete e.arg, t.completion = e;
247
- }
248
- function Context(t) {
249
- this.tryEntries = [{
250
- tryLoc: "root"
251
- }], t.forEach(pushTryEntry, this), this.reset(!0);
148
+ };
149
+ }(r, o, i), !0), u;
252
150
  }
253
- function values(e) {
254
- if (e || "" === e) {
255
- var r = e[a];
256
- if (r) return r.call(e);
257
- if ("function" == typeof e.next) return e;
258
- if (!isNaN(e.length)) {
259
- var o = -1,
260
- i = function next() {
261
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
262
- return next.value = t, next.done = !0, next;
263
- };
264
- return i.next = i;
265
- }
266
- }
267
- throw new TypeError(typeof e + " is not iterable");
151
+ var a = {};
152
+ function Generator() {}
153
+ function GeneratorFunction() {}
154
+ function GeneratorFunctionPrototype() {}
155
+ t = Object.getPrototypeOf;
156
+ var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
157
+ return this;
158
+ }), t),
159
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
160
+ function f(e) {
161
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
268
162
  }
269
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
270
- value: GeneratorFunctionPrototype,
271
- configurable: !0
272
- }), o(GeneratorFunctionPrototype, "constructor", {
273
- value: GeneratorFunction,
274
- configurable: !0
275
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
276
- var e = "function" == typeof t && t.constructor;
277
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
278
- }, e.mark = function (t) {
279
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
280
- }, e.awrap = function (t) {
281
- return {
282
- __await: t
283
- };
284
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
163
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
285
164
  return this;
286
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
287
- void 0 === i && (i = Promise);
288
- var a = new AsyncIterator(wrap(t, r, n, o), i);
289
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
290
- return t.done ? t.value : a.next();
291
- });
292
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
293
- return this;
294
- }), define(g, "toString", function () {
165
+ }), _regeneratorDefine(u, "toString", function () {
295
166
  return "[object Generator]";
296
- }), e.keys = function (t) {
297
- var e = Object(t),
298
- r = [];
299
- for (var n in e) r.push(n);
300
- return r.reverse(), function next() {
301
- for (; r.length;) {
302
- var t = r.pop();
303
- if (t in e) return next.value = t, next.done = !1, next;
304
- }
305
- return next.done = !0, next;
167
+ }), (_regenerator = function () {
168
+ return {
169
+ w: i,
170
+ m: f
306
171
  };
307
- }, e.values = values, Context.prototype = {
308
- constructor: Context,
309
- reset: function (e) {
310
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
311
- },
312
- stop: function () {
313
- this.done = !0;
314
- var t = this.tryEntries[0].completion;
315
- if ("throw" === t.type) throw t.arg;
316
- return this.rval;
317
- },
318
- dispatchException: function (e) {
319
- if (this.done) throw e;
320
- var r = this;
321
- function handle(n, o) {
322
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
323
- }
324
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
325
- var i = this.tryEntries[o],
326
- a = i.completion;
327
- if ("root" === i.tryLoc) return handle("end");
328
- if (i.tryLoc <= this.prev) {
329
- var c = n.call(i, "catchLoc"),
330
- u = n.call(i, "finallyLoc");
331
- if (c && u) {
332
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
333
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
334
- } else if (c) {
335
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
336
- } else {
337
- if (!u) throw Error("try statement without catch or finally");
338
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
339
- }
340
- }
341
- }
342
- },
343
- abrupt: function (t, e) {
344
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
345
- var o = this.tryEntries[r];
346
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
347
- var i = o;
348
- break;
349
- }
350
- }
351
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
352
- var a = i ? i.completion : {};
353
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
354
- },
355
- complete: function (t, e) {
356
- if ("throw" === t.type) throw t.arg;
357
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
358
- },
359
- finish: function (t) {
360
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
361
- var r = this.tryEntries[e];
362
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
363
- }
364
- },
365
- catch: function (t) {
366
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
367
- var r = this.tryEntries[e];
368
- if (r.tryLoc === t) {
369
- var n = r.completion;
370
- if ("throw" === n.type) {
371
- var o = n.arg;
372
- resetTryEntry(r);
373
- }
374
- return o;
375
- }
376
- }
377
- throw Error("illegal catch attempt");
378
- },
379
- delegateYield: function (e, r, n) {
380
- return this.delegate = {
381
- iterator: values(e),
382
- resultName: r,
383
- nextLoc: n
384
- }, "next" === this.method && (this.arg = t), y;
172
+ })();
173
+ }
174
+ function _regeneratorDefine(e, r, n, t) {
175
+ var i = Object.defineProperty;
176
+ try {
177
+ i({}, "", {});
178
+ } catch (e) {
179
+ i = 0;
180
+ }
181
+ _regeneratorDefine = function (e, r, n, t) {
182
+ function o(r, n) {
183
+ _regeneratorDefine(e, r, function (e) {
184
+ return this._invoke(r, n, e);
185
+ });
385
186
  }
386
- }, e;
187
+ r ? i ? i(e, r, {
188
+ value: n,
189
+ enumerable: !t,
190
+ configurable: !t,
191
+ writable: !t
192
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
193
+ }, _regeneratorDefine(e, r, n, t);
387
194
  }
388
195
  function _setPrototypeOf(t, e) {
389
196
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
@@ -2567,7 +2374,6 @@ var WeightUnit;
2567
2374
  WeightUnit["Pounds"] = "POUNDS";
2568
2375
  })(WeightUnit || (WeightUnit = {}));
2569
2376
  var TypedDocumentString = /*#__PURE__*/function (_String) {
2570
- _inheritsLoose(TypedDocumentString, _String);
2571
2377
  function TypedDocumentString(value, __meta__) {
2572
2378
  var _this;
2573
2379
  _this = _String.call(this, value) || this;
@@ -2575,6 +2381,7 @@ var TypedDocumentString = /*#__PURE__*/function (_String) {
2575
2381
  _this.__meta__ = __meta__;
2576
2382
  return _this;
2577
2383
  }
2384
+ _inheritsLoose(TypedDocumentString, _String);
2578
2385
  var _proto = TypedDocumentString.prototype;
2579
2386
  _proto.toString = function toString() {
2580
2387
  return this.value;
@@ -2996,24 +2803,24 @@ function normalizeImage(image) {
2996
2803
  }
2997
2804
 
2998
2805
  var cartCreate = /*#__PURE__*/function () {
2999
- var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(fetch, lines) {
2806
+ var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(fetch, lines) {
3000
2807
  var _yield$fetch, cartCreate, cart, options;
3001
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3002
- while (1) switch (_context.prev = _context.next) {
2808
+ return _regenerator().w(function (_context) {
2809
+ while (1) switch (_context.n) {
3003
2810
  case 0:
3004
- _context.next = 2;
2811
+ _context.n = 1;
3005
2812
  return fetch({
3006
2813
  query: createCartMutation.toString(),
3007
2814
  variables: {
3008
2815
  lines: lines
3009
2816
  }
3010
2817
  });
3011
- case 2:
3012
- _yield$fetch = _context.sent;
2818
+ case 1:
2819
+ _yield$fetch = _context.v;
3013
2820
  cartCreate = _yield$fetch.cartCreate;
3014
2821
  cart = cartCreate == null ? void 0 : cartCreate.cart;
3015
2822
  if (!cart) {
3016
- _context.next = 12;
2823
+ _context.n = 2;
3017
2824
  break;
3018
2825
  }
3019
2826
  options = {
@@ -3023,12 +2830,11 @@ var cartCreate = /*#__PURE__*/function () {
3023
2830
  };
3024
2831
  Cookies.set(SHOPIFY_CART_ID_COOKIE, cart.id, options);
3025
2832
  Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, cart.checkoutUrl, options);
3026
- return _context.abrupt("return", normalizeCart(cart));
3027
- case 12:
3028
- return _context.abrupt("return", undefined);
3029
- case 13:
3030
- case "end":
3031
- return _context.stop();
2833
+ return _context.a(2, normalizeCart(cart));
2834
+ case 2:
2835
+ return _context.a(2, undefined);
2836
+ case 3:
2837
+ return _context.a(2);
3032
2838
  }
3033
2839
  }, _callee);
3034
2840
  }));
@@ -3052,39 +2858,36 @@ var handler = {
3052
2858
  query: /*#__PURE__*/getCartQuery.toString()
3053
2859
  },
3054
2860
  fetcher: function fetcher(_ref) {
3055
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2861
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3056
2862
  var cartId, options, fetch, _yield$fetch, cart;
3057
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3058
- while (1) switch (_context.prev = _context.next) {
2863
+ return _regenerator().w(function (_context) {
2864
+ while (1) switch (_context.n) {
3059
2865
  case 0:
3060
2866
  cartId = _ref.input.cartId, options = _ref.options, fetch = _ref.fetch;
3061
2867
  if (!cartId) {
3062
- _context.next = 13;
2868
+ _context.n = 3;
3063
2869
  break;
3064
2870
  }
3065
- _context.next = 4;
2871
+ _context.n = 1;
3066
2872
  return fetch(_extends({}, options, {
3067
2873
  variables: {
3068
2874
  cartId: cartId
3069
2875
  }
3070
2876
  }));
3071
- case 4:
3072
- _yield$fetch = _context.sent;
2877
+ case 1:
2878
+ _yield$fetch = _context.v;
3073
2879
  cart = _yield$fetch.cart;
3074
2880
  if (cart) {
3075
- _context.next = 12;
2881
+ _context.n = 2;
3076
2882
  break;
3077
2883
  }
3078
2884
  Cookies.remove(SHOPIFY_CART_ID_COOKIE);
3079
2885
  Cookies.remove(SHOPIFY_CHECKOUT_URL_COOKIE);
3080
- return _context.abrupt("return", null);
3081
- case 12:
3082
- return _context.abrupt("return", normalizeCart(cart));
3083
- case 13:
3084
- return _context.abrupt("return", null);
3085
- case 14:
3086
- case "end":
3087
- return _context.stop();
2886
+ return _context.a(2, null);
2887
+ case 2:
2888
+ return _context.a(2, normalizeCart(cart));
2889
+ case 3:
2890
+ return _context.a(2, null);
3088
2891
  }
3089
2892
  }, _callee);
3090
2893
  }))();
@@ -3117,49 +2920,48 @@ var handler$1 = {
3117
2920
  query: /*#__PURE__*/addToCartMutation.toString()
3118
2921
  },
3119
2922
  fetcher: function fetcher(_ref) {
3120
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2923
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3121
2924
  var _item$quantity;
3122
2925
  var item, options, fetch, lines, cartId, _yield$fetch, cartLinesAdd;
3123
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3124
- while (1) switch (_context.prev = _context.next) {
2926
+ return _regenerator().w(function (_context) {
2927
+ while (1) switch (_context.n) {
3125
2928
  case 0:
3126
2929
  item = _ref.input, options = _ref.options, fetch = _ref.fetch;
3127
2930
  if (!(item.quantity && (!Number.isInteger(item.quantity) || item.quantity < 1))) {
3128
- _context.next = 3;
2931
+ _context.n = 1;
3129
2932
  break;
3130
2933
  }
3131
2934
  throw new commerce.CommerceError({
3132
2935
  message: "The item quantity has to be a valid integer greater than 0"
3133
2936
  });
3134
- case 3:
2937
+ case 1:
3135
2938
  lines = [{
3136
2939
  merchandiseId: item.variantId,
3137
2940
  quantity: (_item$quantity = item.quantity) != null ? _item$quantity : 1
3138
2941
  }];
3139
2942
  cartId = getCartId();
3140
2943
  if (cartId) {
3141
- _context.next = 11;
2944
+ _context.n = 3;
3142
2945
  break;
3143
2946
  }
3144
- _context.next = 8;
2947
+ _context.n = 2;
3145
2948
  return cartCreate(fetch, lines);
3146
- case 8:
3147
- return _context.abrupt("return", _context.sent);
3148
- case 11:
3149
- _context.next = 13;
2949
+ case 2:
2950
+ return _context.a(2, _context.v);
2951
+ case 3:
2952
+ _context.n = 4;
3150
2953
  return fetch(_extends({}, options, {
3151
2954
  variables: {
3152
2955
  cartId: cartId,
3153
2956
  lines: lines
3154
2957
  }
3155
2958
  }));
3156
- case 13:
3157
- _yield$fetch = _context.sent;
2959
+ case 4:
2960
+ _yield$fetch = _context.v;
3158
2961
  cartLinesAdd = _yield$fetch.cartLinesAdd;
3159
- return _context.abrupt("return", normalizeCart(cartLinesAdd == null ? void 0 : cartLinesAdd.cart));
3160
- case 16:
3161
- case "end":
3162
- return _context.stop();
2962
+ return _context.a(2, normalizeCart(cartLinesAdd == null ? void 0 : cartLinesAdd.cart));
2963
+ case 5:
2964
+ return _context.a(2);
3163
2965
  }
3164
2966
  }, _callee);
3165
2967
  }))();
@@ -3170,24 +2972,21 @@ var handler$1 = {
3170
2972
  var _useCart = commerce.useCart(),
3171
2973
  mutate = _useCart.mutate;
3172
2974
  return React.useCallback(/*#__PURE__*/function () {
3173
- var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
2975
+ var _addItem = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
3174
2976
  var data;
3175
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3176
- while (1) switch (_context2.prev = _context2.next) {
2977
+ return _regenerator().w(function (_context2) {
2978
+ while (1) switch (_context2.n) {
3177
2979
  case 0:
3178
- _context2.next = 2;
2980
+ _context2.n = 1;
3179
2981
  return fetch({
3180
2982
  input: input
3181
2983
  });
3182
- case 2:
3183
- data = _context2.sent;
3184
- _context2.next = 5;
2984
+ case 1:
2985
+ data = _context2.v;
2986
+ _context2.n = 2;
3185
2987
  return mutate(data, false);
3186
- case 5:
3187
- return _context2.abrupt("return", data);
3188
- case 6:
3189
- case "end":
3190
- return _context2.stop();
2988
+ case 2:
2989
+ return _context2.a(2, data);
3191
2990
  }
3192
2991
  }, _callee2);
3193
2992
  }));
@@ -3205,26 +3004,23 @@ var handler$2 = {
3205
3004
  query: /*#__PURE__*/removeFromCartMutation.toString()
3206
3005
  },
3207
3006
  fetcher: function fetcher(_ref) {
3208
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3007
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3209
3008
  var itemId, options, fetch, _yield$fetch, cartLinesRemove;
3210
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3211
- while (1) switch (_context.prev = _context.next) {
3009
+ return _regenerator().w(function (_context) {
3010
+ while (1) switch (_context.n) {
3212
3011
  case 0:
3213
3012
  itemId = _ref.input.itemId, options = _ref.options, fetch = _ref.fetch;
3214
- _context.next = 3;
3013
+ _context.n = 1;
3215
3014
  return fetch(_extends({}, options, {
3216
3015
  variables: {
3217
3016
  cartId: getCartId(),
3218
3017
  lineIds: [itemId]
3219
3018
  }
3220
3019
  }));
3221
- case 3:
3222
- _yield$fetch = _context.sent;
3020
+ case 1:
3021
+ _yield$fetch = _context.v;
3223
3022
  cartLinesRemove = _yield$fetch.cartLinesRemove;
3224
- return _context.abrupt("return", normalizeCart(cartLinesRemove == null ? void 0 : cartLinesRemove.cart));
3225
- case 6:
3226
- case "end":
3227
- return _context.stop();
3023
+ return _context.a(2, normalizeCart(cartLinesRemove == null ? void 0 : cartLinesRemove.cart));
3228
3024
  }
3229
3025
  }, _callee);
3230
3026
  }))();
@@ -3240,36 +3036,33 @@ var handler$2 = {
3240
3036
  var _useCart = commerce.useCart(),
3241
3037
  mutate = _useCart.mutate;
3242
3038
  var removeItem = /*#__PURE__*/function () {
3243
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
3039
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
3244
3040
  var _input$id;
3245
3041
  var itemId, data;
3246
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3247
- while (1) switch (_context2.prev = _context2.next) {
3042
+ return _regenerator().w(function (_context2) {
3043
+ while (1) switch (_context2.n) {
3248
3044
  case 0:
3249
3045
  itemId = (_input$id = input == null ? void 0 : input.id) != null ? _input$id : item == null ? void 0 : item.id;
3250
3046
  if (itemId) {
3251
- _context2.next = 3;
3047
+ _context2.n = 1;
3252
3048
  break;
3253
3049
  }
3254
3050
  throw new commerce.ValidationError({
3255
3051
  message: "Invalid input used for this operation"
3256
3052
  });
3257
- case 3:
3258
- _context2.next = 5;
3053
+ case 1:
3054
+ _context2.n = 2;
3259
3055
  return fetch({
3260
3056
  input: {
3261
3057
  itemId: itemId
3262
3058
  }
3263
3059
  });
3264
- case 5:
3265
- data = _context2.sent;
3266
- _context2.next = 8;
3060
+ case 2:
3061
+ data = _context2.v;
3062
+ _context2.n = 3;
3267
3063
  return mutate(data, false);
3268
- case 8:
3269
- return _context2.abrupt("return", data);
3270
- case 9:
3271
- case "end":
3272
- return _context2.stop();
3064
+ case 3:
3065
+ return _context2.a(2, data);
3273
3066
  }
3274
3067
  }, _callee2);
3275
3068
  }));
@@ -3287,40 +3080,40 @@ var handler$3 = {
3287
3080
  query: /*#__PURE__*/editCartItemsMutation.toString()
3288
3081
  },
3289
3082
  fetcher: function fetcher(_ref) {
3290
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3083
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3291
3084
  var _ref$input, itemId, item, options, fetch, _yield$fetch, cartLinesUpdate;
3292
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3293
- while (1) switch (_context.prev = _context.next) {
3085
+ return _regenerator().w(function (_context) {
3086
+ while (1) switch (_context.n) {
3294
3087
  case 0:
3295
3088
  _ref$input = _ref.input, itemId = _ref$input.itemId, item = _ref$input.item, options = _ref.options, fetch = _ref.fetch;
3296
3089
  if (!Number.isInteger(item.quantity)) {
3297
- _context.next = 6;
3090
+ _context.n = 2;
3298
3091
  break;
3299
3092
  }
3300
3093
  if (!(item.quantity < 1)) {
3301
- _context.next = 4;
3094
+ _context.n = 1;
3302
3095
  break;
3303
3096
  }
3304
- return _context.abrupt("return", handler$2.fetcher({
3097
+ return _context.a(2, handler$2.fetcher({
3305
3098
  options: handler$2.fetchOptions,
3306
3099
  input: {
3307
3100
  itemId: itemId
3308
3101
  },
3309
3102
  fetch: fetch
3310
3103
  }));
3311
- case 4:
3312
- _context.next = 8;
3104
+ case 1:
3105
+ _context.n = 3;
3313
3106
  break;
3314
- case 6:
3107
+ case 2:
3315
3108
  if (!item.quantity) {
3316
- _context.next = 8;
3109
+ _context.n = 3;
3317
3110
  break;
3318
3111
  }
3319
3112
  throw new commerce.ValidationError({
3320
3113
  message: "The item quantity has to be a valid integer"
3321
3114
  });
3322
- case 8:
3323
- _context.next = 10;
3115
+ case 3:
3116
+ _context.n = 4;
3324
3117
  return fetch(_extends({}, options, {
3325
3118
  variables: {
3326
3119
  cartId: getCartId(),
@@ -3330,13 +3123,10 @@ var handler$3 = {
3330
3123
  }]
3331
3124
  }
3332
3125
  }));
3333
- case 10:
3334
- _yield$fetch = _context.sent;
3126
+ case 4:
3127
+ _yield$fetch = _context.v;
3335
3128
  cartLinesUpdate = _yield$fetch.cartLinesUpdate;
3336
- return _context.abrupt("return", normalizeCart(cartLinesUpdate == null ? void 0 : cartLinesUpdate.cart));
3337
- case 13:
3338
- case "end":
3339
- return _context.stop();
3129
+ return _context.a(2, normalizeCart(cartLinesUpdate == null ? void 0 : cartLinesUpdate.cart));
3340
3130
  }
3341
3131
  }, _callee);
3342
3132
  }))();
@@ -3353,22 +3143,22 @@ var handler$3 = {
3353
3143
  var _useCart = commerce.useCart(),
3354
3144
  mutate = _useCart.mutate;
3355
3145
  return React.useCallback(debounce(/*#__PURE__*/function () {
3356
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
3146
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
3357
3147
  var _input$id;
3358
3148
  var itemId, data;
3359
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3360
- while (1) switch (_context2.prev = _context2.next) {
3149
+ return _regenerator().w(function (_context2) {
3150
+ while (1) switch (_context2.n) {
3361
3151
  case 0:
3362
3152
  itemId = (_input$id = input.id) != null ? _input$id : item == null ? void 0 : item.id;
3363
3153
  if (!(!itemId || input.quantity == null)) {
3364
- _context2.next = 3;
3154
+ _context2.n = 1;
3365
3155
  break;
3366
3156
  }
3367
3157
  throw new commerce.ValidationError({
3368
3158
  message: "Invalid input used for this operation"
3369
3159
  });
3370
- case 3:
3371
- _context2.next = 5;
3160
+ case 1:
3161
+ _context2.n = 2;
3372
3162
  return fetch({
3373
3163
  input: {
3374
3164
  item: {
@@ -3377,15 +3167,12 @@ var handler$3 = {
3377
3167
  itemId: itemId
3378
3168
  }
3379
3169
  });
3380
- case 5:
3381
- data = _context2.sent;
3382
- _context2.next = 8;
3170
+ case 2:
3171
+ data = _context2.v;
3172
+ _context2.n = 3;
3383
3173
  return mutate(data, false);
3384
- case 8:
3385
- return _context2.abrupt("return", data);
3386
- case 9:
3387
- case "end":
3388
- return _context2.stop();
3174
+ case 3:
3175
+ return _context2.a(2, data);
3389
3176
  }
3390
3177
  }, _callee2);
3391
3178
  }));
@@ -3400,14 +3187,14 @@ var handler$3 = {
3400
3187
  var _excluded$1 = ["locale"];
3401
3188
  var getFetcher = function getFetcher(storeDomain, accessToken) {
3402
3189
  return /*#__PURE__*/function () {
3403
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
3190
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
3404
3191
  var _ref$url, url, _ref$method, method, variables, query, _ref3, locale, vars, res, _yield$res$json, data, errors, _yield$res$json2, _errors;
3405
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3406
- while (1) switch (_context.prev = _context.next) {
3192
+ return _regenerator().w(function (_context) {
3193
+ while (1) switch (_context.n) {
3407
3194
  case 0:
3408
3195
  _ref$url = _ref.url, url = _ref$url === void 0 ? "https://" + storeDomain + "/api/" + shopifyApiVersion + "/graphql.json" : _ref$url, _ref$method = _ref.method, method = _ref$method === void 0 ? "POST" : _ref$method, variables = _ref.variables, query = _ref.query;
3409
3196
  _ref3 = variables != null ? variables : {}, locale = _ref3.locale, vars = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
3410
- _context.next = 4;
3197
+ _context.n = 1;
3411
3198
  return fetch(url, {
3412
3199
  method: method,
3413
3200
  body: JSON.stringify({
@@ -3421,35 +3208,34 @@ var getFetcher = function getFetcher(storeDomain, accessToken) {
3421
3208
  "Accept-Language": locale
3422
3209
  })
3423
3210
  });
3424
- case 4:
3425
- res = _context.sent;
3211
+ case 1:
3212
+ res = _context.v;
3426
3213
  if (!res.ok) {
3427
- _context.next = 16;
3214
+ _context.n = 4;
3428
3215
  break;
3429
3216
  }
3430
- _context.next = 8;
3217
+ _context.n = 2;
3431
3218
  return res.json();
3432
- case 8:
3433
- _yield$res$json = _context.sent;
3219
+ case 2:
3220
+ _yield$res$json = _context.v;
3434
3221
  data = _yield$res$json.data;
3435
3222
  errors = _yield$res$json.errors;
3436
3223
  if (!(errors && errors.length)) {
3437
- _context.next = 13;
3224
+ _context.n = 3;
3438
3225
  break;
3439
3226
  }
3440
3227
  throw getError(errors, res.status);
3441
- case 13:
3442
- return _context.abrupt("return", data);
3443
- case 16:
3444
- _context.next = 18;
3228
+ case 3:
3229
+ return _context.a(2, data);
3230
+ case 4:
3231
+ _context.n = 5;
3445
3232
  return res.json();
3446
- case 18:
3447
- _yield$res$json2 = _context.sent;
3233
+ case 5:
3234
+ _yield$res$json2 = _context.v;
3448
3235
  _errors = _yield$res$json2.errors;
3449
3236
  throw getError(_errors, res.status);
3450
- case 21:
3451
- case "end":
3452
- return _context.stop();
3237
+ case 6:
3238
+ return _context.a(2);
3453
3239
  }
3454
3240
  }, _callee);
3455
3241
  }));
@@ -3459,8 +3245,7 @@ var getFetcher = function getFetcher(storeDomain, accessToken) {
3459
3245
  }();
3460
3246
  };
3461
3247
  function getError(errors, status) {
3462
- var _errors2;
3463
- errors = (_errors2 = errors) != null ? _errors2 : [{
3248
+ errors = errors != null ? errors : [{
3464
3249
  message: "Failed to fetch Shopify API"
3465
3250
  }];
3466
3251
  return new commerce.FetcherError({
@@ -3477,54 +3262,51 @@ var handler$4 = {
3477
3262
  query: /*#__PURE__*/getProductQueryBySlug.toString()
3478
3263
  },
3479
3264
  fetcher: function fetcher(_ref) {
3480
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3265
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3481
3266
  var input, options, fetch, id, product, data, _data;
3482
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3483
- while (1) switch (_context.prev = _context.next) {
3267
+ return _regenerator().w(function (_context) {
3268
+ while (1) switch (_context.n) {
3484
3269
  case 0:
3485
3270
  input = _ref.input, options = _ref.options, fetch = _ref.fetch;
3486
3271
  id = input.id;
3487
3272
  if (id) {
3488
- _context.next = 4;
3273
+ _context.n = 1;
3489
3274
  break;
3490
3275
  }
3491
- return _context.abrupt("return", null);
3492
- case 4:
3276
+ return _context.a(2, null);
3277
+ case 1:
3493
3278
  product = null;
3494
3279
  if (!id.startsWith("gid://shopify")) {
3495
- _context.next = 12;
3280
+ _context.n = 3;
3496
3281
  break;
3497
3282
  }
3498
- _context.next = 8;
3283
+ _context.n = 2;
3499
3284
  return fetch({
3500
3285
  query: getProductQueryById.toString(),
3501
3286
  variables: {
3502
3287
  id: id
3503
3288
  }
3504
3289
  });
3505
- case 8:
3506
- data = _context.sent;
3290
+ case 2:
3291
+ data = _context.v;
3507
3292
  product = data.product;
3508
- _context.next = 16;
3293
+ _context.n = 5;
3509
3294
  break;
3510
- case 12:
3511
- _context.next = 14;
3295
+ case 3:
3296
+ _context.n = 4;
3512
3297
  return fetch({
3513
3298
  query: options.query,
3514
3299
  variables: {
3515
3300
  slug: id
3516
3301
  }
3517
3302
  });
3518
- case 14:
3519
- _data = _context.sent;
3303
+ case 4:
3304
+ _data = _context.v;
3520
3305
  if (_data.productByHandle) {
3521
3306
  product = _data.productByHandle;
3522
3307
  }
3523
- case 16:
3524
- return _context.abrupt("return", product ? normalizeProduct(product) : null);
3525
- case 17:
3526
- case "end":
3527
- return _context.stop();
3308
+ case 5:
3309
+ return _context.a(2, product ? normalizeProduct(product) : null);
3528
3310
  }
3529
3311
  }, _callee);
3530
3312
  }))();
@@ -3617,21 +3399,21 @@ var handler$5 = {
3617
3399
  query: /*#__PURE__*/getAllProductsQuery.toString()
3618
3400
  },
3619
3401
  fetcher: function fetcher(_ref) {
3620
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3402
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3621
3403
  var _products, _products2;
3622
3404
  var input, options, fetch, categoryId, brandId, method, variables, products, _data$node, _data$node2, data, _data$products, _data;
3623
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3624
- while (1) switch (_context.prev = _context.next) {
3405
+ return _regenerator().w(function (_context) {
3406
+ while (1) switch (_context.n) {
3625
3407
  case 0:
3626
3408
  input = _ref.input, options = _ref.options, fetch = _ref.fetch;
3627
3409
  categoryId = input.categoryId, brandId = input.brandId;
3628
3410
  method = options == null ? void 0 : options.method;
3629
3411
  variables = getSearchVariables(input);
3630
3412
  if (!categoryId) {
3631
- _context.next = 11;
3413
+ _context.n = 2;
3632
3414
  break;
3633
3415
  }
3634
- _context.next = 7;
3416
+ _context.n = 1;
3635
3417
  return fetch({
3636
3418
  query: getCollectionProductsQuery.toString(),
3637
3419
  method: method,
@@ -3639,36 +3421,33 @@ var handler$5 = {
3639
3421
  first: undefined
3640
3422
  })
3641
3423
  });
3642
- case 7:
3643
- data = _context.sent;
3424
+ case 1:
3425
+ data = _context.v;
3644
3426
  // filter on client when brandId & categoryId are set since is not available on collection product query
3645
3427
  products = brandId ? (_data$node = data.node) == null || (_data$node = _data$node.products) == null || (_data$node = _data$node.edges) == null ? void 0 : _data$node.filter(function (_ref2) {
3646
3428
  var vendor = _ref2.node.vendor;
3647
3429
  return vendor.replace(/\s+/g, "-").toLowerCase() === ("" + brandId).toLowerCase();
3648
3430
  }).slice(0, input.count) : (_data$node2 = data.node) == null || (_data$node2 = _data$node2.products) == null ? void 0 : _data$node2.edges.slice(0, input.count);
3649
- _context.next = 15;
3431
+ _context.n = 4;
3650
3432
  break;
3651
- case 11:
3652
- _context.next = 13;
3433
+ case 2:
3434
+ _context.n = 3;
3653
3435
  return fetch({
3654
3436
  query: options.query,
3655
3437
  method: method,
3656
3438
  variables: variables
3657
3439
  });
3658
- case 13:
3659
- _data = _context.sent;
3440
+ case 3:
3441
+ _data = _context.v;
3660
3442
  products = (_data$products = _data.products) == null ? void 0 : _data$products.edges;
3661
- case 15:
3662
- return _context.abrupt("return", {
3443
+ case 4:
3444
+ return _context.a(2, {
3663
3445
  products: (_products = products) == null ? void 0 : _products.map(function (_ref3) {
3664
3446
  var node = _ref3.node;
3665
3447
  return normalizeProduct(node);
3666
3448
  }),
3667
3449
  found: !!((_products2 = products) != null && _products2.length)
3668
3450
  });
3669
- case 16:
3670
- case "end":
3671
- return _context.stop();
3672
3451
  }
3673
3452
  }, _callee);
3674
3453
  }))();
@@ -3696,26 +3475,26 @@ var handler$6 = {
3696
3475
  query: /*#__PURE__*/getAllProductVendors.toString()
3697
3476
  },
3698
3477
  fetcher: function fetcher(_ref) {
3699
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3478
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3700
3479
  var fetch, data, vendorsStrings;
3701
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3702
- while (1) switch (_context.prev = _context.next) {
3480
+ return _regenerator().w(function (_context) {
3481
+ while (1) switch (_context.n) {
3703
3482
  case 0:
3704
3483
  fetch = _ref.fetch;
3705
- _context.next = 3;
3484
+ _context.n = 1;
3706
3485
  return fetch({
3707
3486
  query: getAllProductVendors.toString(),
3708
3487
  variables: {
3709
3488
  first: 250
3710
3489
  }
3711
3490
  });
3712
- case 3:
3713
- data = _context.sent;
3491
+ case 1:
3492
+ data = _context.v;
3714
3493
  vendorsStrings = data.products.edges.map(function (_ref2) {
3715
3494
  var vendor = _ref2.node.vendor;
3716
3495
  return vendor;
3717
3496
  });
3718
- return _context.abrupt("return", Array.from(new Set(vendorsStrings).values()).map(function (v) {
3497
+ return _context.a(2, Array.from(new Set(vendorsStrings).values()).map(function (v) {
3719
3498
  var id = v.replace(/\s+/g, "-").toLowerCase();
3720
3499
  return {
3721
3500
  entityId: id,
@@ -3723,9 +3502,6 @@ var handler$6 = {
3723
3502
  path: "brands/" + id
3724
3503
  };
3725
3504
  }));
3726
- case 6:
3727
- case "end":
3728
- return _context.stop();
3729
3505
  }
3730
3506
  }, _callee);
3731
3507
  }))();
@@ -3762,32 +3538,32 @@ var handler$7 = {
3762
3538
  query: /*#__PURE__*/getSiteCollectionsQuery.toString()
3763
3539
  },
3764
3540
  fetcher: function fetcher(_ref) {
3765
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3541
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3766
3542
  var input, options, fetch, categoryId, _data$collections$edg, _data$collections, data, _data;
3767
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3768
- while (1) switch (_context.prev = _context.next) {
3543
+ return _regenerator().w(function (_context) {
3544
+ while (1) switch (_context.n) {
3769
3545
  case 0:
3770
3546
  input = _ref.input, options = _ref.options, fetch = _ref.fetch;
3771
3547
  categoryId = input.categoryId;
3772
3548
  if (categoryId) {
3773
- _context.next = 9;
3549
+ _context.n = 2;
3774
3550
  break;
3775
3551
  }
3776
- _context.next = 5;
3552
+ _context.n = 1;
3777
3553
  return fetch({
3778
3554
  query: options.query,
3779
3555
  variables: {
3780
3556
  first: 250
3781
3557
  }
3782
3558
  });
3783
- case 5:
3784
- data = _context.sent;
3785
- return _context.abrupt("return", (_data$collections$edg = data == null || (_data$collections = data.collections) == null || (_data$collections = _data$collections.edges) == null ? void 0 : _data$collections.map(function (_ref2) {
3559
+ case 1:
3560
+ data = _context.v;
3561
+ return _context.a(2, (_data$collections$edg = data == null || (_data$collections = data.collections) == null || (_data$collections = _data$collections.edges) == null ? void 0 : _data$collections.map(function (_ref2) {
3786
3562
  var node = _ref2.node;
3787
3563
  return normalizeCategory(node);
3788
3564
  })) != null ? _data$collections$edg : []);
3789
- case 9:
3790
- _context.next = 11;
3565
+ case 2:
3566
+ _context.n = 3;
3791
3567
  return fetch({
3792
3568
  query: getCollectionQueryById.toString(),
3793
3569
  variables: _extends({}, categoryId.startsWith("gid://") ? {
@@ -3796,12 +3572,11 @@ var handler$7 = {
3796
3572
  handle: categoryId
3797
3573
  })
3798
3574
  });
3799
- case 11:
3800
- _data = _context.sent;
3801
- return _context.abrupt("return", !!(_data != null && _data.collection) ? [normalizeCategory(_data == null ? void 0 : _data.collection)] : []);
3802
- case 13:
3803
- case "end":
3804
- return _context.stop();
3575
+ case 3:
3576
+ _data = _context.v;
3577
+ return _context.a(2, !!(_data != null && _data.collection) ? [normalizeCategory(_data == null ? void 0 : _data.collection)] : []);
3578
+ case 4:
3579
+ return _context.a(2);
3805
3580
  }
3806
3581
  }, _callee);
3807
3582
  }))();