@plasmicpkgs/commerce-local 0.0.243 → 0.0.244

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.
@@ -2282,306 +2282,113 @@ function _extends() {
2282
2282
  return n;
2283
2283
  }, _extends.apply(null, arguments);
2284
2284
  }
2285
- function _regeneratorRuntime() {
2286
- _regeneratorRuntime = function () {
2287
- return e;
2288
- };
2289
- var t,
2290
- e = {},
2291
- r = Object.prototype,
2292
- n = r.hasOwnProperty,
2293
- o = Object.defineProperty || function (t, e, r) {
2294
- t[e] = r.value;
2295
- },
2296
- i = "function" == typeof Symbol ? Symbol : {},
2297
- a = i.iterator || "@@iterator",
2298
- c = i.asyncIterator || "@@asyncIterator",
2299
- u = i.toStringTag || "@@toStringTag";
2300
- function define(t, e, r) {
2301
- return Object.defineProperty(t, e, {
2302
- value: r,
2303
- enumerable: !0,
2304
- configurable: !0,
2305
- writable: !0
2306
- }), t[e];
2307
- }
2308
- try {
2309
- define({}, "");
2310
- } catch (t) {
2311
- define = function (t, e, r) {
2312
- return t[e] = r;
2313
- };
2314
- }
2315
- function wrap(t, e, r, n) {
2316
- var i = e && e.prototype instanceof Generator ? e : Generator,
2317
- a = Object.create(i.prototype),
2318
- c = new Context(n || []);
2319
- return o(a, "_invoke", {
2320
- value: makeInvokeMethod(t, r, c)
2321
- }), a;
2322
- }
2323
- function tryCatch(t, e, r) {
2324
- try {
2325
- return {
2326
- type: "normal",
2327
- arg: t.call(e, r)
2328
- };
2329
- } catch (t) {
2330
- return {
2331
- type: "throw",
2332
- arg: t
2333
- };
2334
- }
2335
- }
2336
- e.wrap = wrap;
2337
- var h = "suspendedStart",
2338
- l = "suspendedYield",
2339
- f = "executing",
2340
- s = "completed",
2341
- y = {};
2342
- function Generator() {}
2343
- function GeneratorFunction() {}
2344
- function GeneratorFunctionPrototype() {}
2345
- var p = {};
2346
- define(p, a, function () {
2347
- return this;
2348
- });
2349
- var d = Object.getPrototypeOf,
2350
- v = d && d(d(values([])));
2351
- v && v !== r && n.call(v, a) && (p = v);
2352
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
2353
- function defineIteratorMethods(t) {
2354
- ["next", "throw", "return"].forEach(function (e) {
2355
- define(t, e, function (t) {
2356
- return this._invoke(e, t);
2357
- });
2358
- });
2359
- }
2360
- function AsyncIterator(t, e) {
2361
- function invoke(r, o, i, a) {
2362
- var c = tryCatch(t[r], t, o);
2363
- if ("throw" !== c.type) {
2364
- var u = c.arg,
2365
- h = u.value;
2366
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
2367
- invoke("next", t, i, a);
2368
- }, function (t) {
2369
- invoke("throw", t, i, a);
2370
- }) : e.resolve(h).then(function (t) {
2371
- u.value = t, i(u);
2372
- }, function (t) {
2373
- return invoke("throw", t, i, a);
2374
- });
2375
- }
2376
- a(c.arg);
2377
- }
2378
- var r;
2379
- o(this, "_invoke", {
2380
- value: function (t, n) {
2381
- function callInvokeWithMethodAndArg() {
2382
- return new e(function (e, r) {
2383
- invoke(t, n, e, r);
2384
- });
2285
+ function _regenerator() {
2286
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2287
+ var e,
2288
+ t,
2289
+ r = "function" == typeof Symbol ? Symbol : {},
2290
+ n = r.iterator || "@@iterator",
2291
+ o = r.toStringTag || "@@toStringTag";
2292
+ function i(r, n, o, i) {
2293
+ var c = n && n.prototype instanceof Generator ? n : Generator,
2294
+ u = Object.create(c.prototype);
2295
+ return _regeneratorDefine(u, "_invoke", function (r, n, o) {
2296
+ var i,
2297
+ c,
2298
+ u,
2299
+ f = 0,
2300
+ p = o || [],
2301
+ y = !1,
2302
+ G = {
2303
+ p: 0,
2304
+ n: 0,
2305
+ v: e,
2306
+ a: d,
2307
+ f: d.bind(e, 4),
2308
+ d: function (t, r) {
2309
+ return i = t, c = 0, u = e, G.n = r, a;
2310
+ }
2311
+ };
2312
+ function d(r, n) {
2313
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2314
+ var o,
2315
+ i = p[t],
2316
+ d = G.p,
2317
+ l = i[2];
2318
+ 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));
2385
2319
  }
2386
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
2320
+ if (o || r > 1) return a;
2321
+ throw y = !0, n;
2387
2322
  }
2388
- });
2389
- }
2390
- function makeInvokeMethod(e, r, n) {
2391
- var o = h;
2392
- return function (i, a) {
2393
- if (o === f) throw Error("Generator is already running");
2394
- if (o === s) {
2395
- if ("throw" === i) throw a;
2323
+ return function (o, p, l) {
2324
+ if (f > 1) throw TypeError("Generator is already running");
2325
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2326
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2327
+ try {
2328
+ if (f = 2, i) {
2329
+ if (c || (o = "next"), t = i[o]) {
2330
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2331
+ if (!t.done) return t;
2332
+ u = t.value, c < 2 && (c = 0);
2333
+ } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2334
+ i = e;
2335
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2336
+ } catch (t) {
2337
+ i = e, c = 1, u = t;
2338
+ } finally {
2339
+ f = 1;
2340
+ }
2341
+ }
2396
2342
  return {
2397
2343
  value: t,
2398
- done: !0
2344
+ done: y
2399
2345
  };
2400
- }
2401
- for (n.method = i, n.arg = a;;) {
2402
- var c = n.delegate;
2403
- if (c) {
2404
- var u = maybeInvokeDelegate(c, n);
2405
- if (u) {
2406
- if (u === y) continue;
2407
- return u;
2408
- }
2409
- }
2410
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
2411
- if (o === h) throw o = s, n.arg;
2412
- n.dispatchException(n.arg);
2413
- } else "return" === n.method && n.abrupt("return", n.arg);
2414
- o = f;
2415
- var p = tryCatch(e, r, n);
2416
- if ("normal" === p.type) {
2417
- if (o = n.done ? s : l, p.arg === y) continue;
2418
- return {
2419
- value: p.arg,
2420
- done: n.done
2421
- };
2422
- }
2423
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
2424
- }
2425
- };
2426
- }
2427
- function maybeInvokeDelegate(e, r) {
2428
- var n = r.method,
2429
- o = e.iterator[n];
2430
- 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;
2431
- var i = tryCatch(o, e.iterator, r.arg);
2432
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
2433
- var a = i.arg;
2434
- 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);
2435
- }
2436
- function pushTryEntry(t) {
2437
- var e = {
2438
- tryLoc: t[0]
2439
- };
2440
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
2441
- }
2442
- function resetTryEntry(t) {
2443
- var e = t.completion || {};
2444
- e.type = "normal", delete e.arg, t.completion = e;
2445
- }
2446
- function Context(t) {
2447
- this.tryEntries = [{
2448
- tryLoc: "root"
2449
- }], t.forEach(pushTryEntry, this), this.reset(!0);
2346
+ };
2347
+ }(r, o, i), !0), u;
2450
2348
  }
2451
- function values(e) {
2452
- if (e || "" === e) {
2453
- var r = e[a];
2454
- if (r) return r.call(e);
2455
- if ("function" == typeof e.next) return e;
2456
- if (!isNaN(e.length)) {
2457
- var o = -1,
2458
- i = function next() {
2459
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
2460
- return next.value = t, next.done = !0, next;
2461
- };
2462
- return i.next = i;
2463
- }
2464
- }
2465
- throw new TypeError(typeof e + " is not iterable");
2349
+ var a = {};
2350
+ function Generator() {}
2351
+ function GeneratorFunction() {}
2352
+ function GeneratorFunctionPrototype() {}
2353
+ t = Object.getPrototypeOf;
2354
+ var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
2355
+ return this;
2356
+ }), t),
2357
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2358
+ function f(e) {
2359
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2466
2360
  }
2467
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
2468
- value: GeneratorFunctionPrototype,
2469
- configurable: !0
2470
- }), o(GeneratorFunctionPrototype, "constructor", {
2471
- value: GeneratorFunction,
2472
- configurable: !0
2473
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
2474
- var e = "function" == typeof t && t.constructor;
2475
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
2476
- }, e.mark = function (t) {
2477
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
2478
- }, e.awrap = function (t) {
2479
- return {
2480
- __await: t
2481
- };
2482
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
2483
- return this;
2484
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
2485
- void 0 === i && (i = Promise);
2486
- var a = new AsyncIterator(wrap(t, r, n, o), i);
2487
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
2488
- return t.done ? t.value : a.next();
2489
- });
2490
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
2361
+ 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 () {
2491
2362
  return this;
2492
- }), define(g, "toString", function () {
2363
+ }), _regeneratorDefine(u, "toString", function () {
2493
2364
  return "[object Generator]";
2494
- }), e.keys = function (t) {
2495
- var e = Object(t),
2496
- r = [];
2497
- for (var n in e) r.push(n);
2498
- return r.reverse(), function next() {
2499
- for (; r.length;) {
2500
- var t = r.pop();
2501
- if (t in e) return next.value = t, next.done = !1, next;
2502
- }
2503
- return next.done = !0, next;
2365
+ }), (_regenerator = function () {
2366
+ return {
2367
+ w: i,
2368
+ m: f
2504
2369
  };
2505
- }, e.values = values, Context.prototype = {
2506
- constructor: Context,
2507
- reset: function (e) {
2508
- 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);
2509
- },
2510
- stop: function () {
2511
- this.done = !0;
2512
- var t = this.tryEntries[0].completion;
2513
- if ("throw" === t.type) throw t.arg;
2514
- return this.rval;
2515
- },
2516
- dispatchException: function (e) {
2517
- if (this.done) throw e;
2518
- var r = this;
2519
- function handle(n, o) {
2520
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
2521
- }
2522
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
2523
- var i = this.tryEntries[o],
2524
- a = i.completion;
2525
- if ("root" === i.tryLoc) return handle("end");
2526
- if (i.tryLoc <= this.prev) {
2527
- var c = n.call(i, "catchLoc"),
2528
- u = n.call(i, "finallyLoc");
2529
- if (c && u) {
2530
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
2531
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
2532
- } else if (c) {
2533
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
2534
- } else {
2535
- if (!u) throw Error("try statement without catch or finally");
2536
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
2537
- }
2538
- }
2539
- }
2540
- },
2541
- abrupt: function (t, e) {
2542
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
2543
- var o = this.tryEntries[r];
2544
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
2545
- var i = o;
2546
- break;
2547
- }
2548
- }
2549
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
2550
- var a = i ? i.completion : {};
2551
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
2552
- },
2553
- complete: function (t, e) {
2554
- if ("throw" === t.type) throw t.arg;
2555
- 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;
2556
- },
2557
- finish: function (t) {
2558
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2559
- var r = this.tryEntries[e];
2560
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
2561
- }
2562
- },
2563
- catch: function (t) {
2564
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
2565
- var r = this.tryEntries[e];
2566
- if (r.tryLoc === t) {
2567
- var n = r.completion;
2568
- if ("throw" === n.type) {
2569
- var o = n.arg;
2570
- resetTryEntry(r);
2571
- }
2572
- return o;
2573
- }
2574
- }
2575
- throw Error("illegal catch attempt");
2576
- },
2577
- delegateYield: function (e, r, n) {
2578
- return this.delegate = {
2579
- iterator: values(e),
2580
- resultName: r,
2581
- nextLoc: n
2582
- }, "next" === this.method && (this.arg = t), y;
2370
+ })();
2371
+ }
2372
+ function _regeneratorDefine(e, r, n, t) {
2373
+ var i = Object.defineProperty;
2374
+ try {
2375
+ i({}, "", {});
2376
+ } catch (e) {
2377
+ i = 0;
2378
+ }
2379
+ _regeneratorDefine = function (e, r, n, t) {
2380
+ function o(r, n) {
2381
+ _regeneratorDefine(e, r, function (e) {
2382
+ return this._invoke(r, n, e);
2383
+ });
2583
2384
  }
2584
- }, e;
2385
+ r ? i ? i(e, r, {
2386
+ value: n,
2387
+ enumerable: !t,
2388
+ configurable: !t,
2389
+ writable: !t
2390
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2391
+ }, _regeneratorDefine(e, r, n, t);
2585
2392
  }
2586
2393
  function _unsupportedIterableToArray(r, a) {
2587
2394
  if (r) {
@@ -2592,31 +2399,30 @@ function _unsupportedIterableToArray(r, a) {
2592
2399
  }
2593
2400
 
2594
2401
  var fetcher = /*#__PURE__*/function () {
2595
- var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2402
+ var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2596
2403
  var res, _yield$res$json, data;
2597
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2598
- while (1) switch (_context.prev = _context.next) {
2404
+ return _regenerator().w(function (_context) {
2405
+ while (1) switch (_context.n) {
2599
2406
  case 0:
2600
2407
  console.log('FETCHER');
2601
- _context.next = 3;
2408
+ _context.n = 1;
2602
2409
  return fetch('./data.json');
2603
- case 3:
2604
- res = _context.sent;
2410
+ case 1:
2411
+ res = _context.v;
2605
2412
  if (!res.ok) {
2606
- _context.next = 10;
2413
+ _context.n = 3;
2607
2414
  break;
2608
2415
  }
2609
- _context.next = 7;
2416
+ _context.n = 2;
2610
2417
  return res.json();
2611
- case 7:
2612
- _yield$res$json = _context.sent;
2418
+ case 2:
2419
+ _yield$res$json = _context.v;
2613
2420
  data = _yield$res$json.data;
2614
- return _context.abrupt("return", data);
2615
- case 10:
2421
+ return _context.a(2, data);
2422
+ case 3:
2616
2423
  throw res;
2617
- case 11:
2618
- case "end":
2619
- return _context.stop();
2424
+ case 4:
2425
+ return _context.a(2);
2620
2426
  }
2621
2427
  }, _callee);
2622
2428
  }));
@@ -2650,8 +2456,7 @@ var createCart = function createCart() {
2650
2456
  return cart;
2651
2457
  };
2652
2458
  var getCart = function getCart(cartId) {
2653
- var _cartId;
2654
- cartId = (_cartId = cartId) != null ? _cartId : Cookies.get(LOCAL_CART_ID);
2459
+ cartId = cartId != null ? cartId : Cookies.get(LOCAL_CART_ID);
2655
2460
  var cartStr = Cookies.get(LOCAL_CART_OBJ);
2656
2461
  var cart = cartStr ? JSON.parse(cartStr) : undefined;
2657
2462
  if (!cart || cart.id !== cartId) {
@@ -2673,16 +2478,13 @@ var handler = {
2673
2478
  query: "use-cart"
2674
2479
  },
2675
2480
  fetcher: function fetcher(_ref) {
2676
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2481
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2677
2482
  var input, fetch;
2678
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2679
- while (1) switch (_context.prev = _context.next) {
2483
+ return _regenerator().w(function (_context) {
2484
+ while (1) switch (_context.n) {
2680
2485
  case 0:
2681
2486
  input = _ref.input, fetch = _ref.fetch;
2682
- return _context.abrupt("return", getCart(input.cartId));
2683
- case 2:
2684
- case "end":
2685
- return _context.stop();
2487
+ return _context.a(2, getCart(input.cartId));
2686
2488
  }
2687
2489
  }, _callee);
2688
2490
  }))();
@@ -2715,21 +2517,21 @@ var handler$1 = {
2715
2517
  query: "use-add-item"
2716
2518
  },
2717
2519
  fetcher: function fetcher(_ref) {
2718
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2520
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2719
2521
  var _item$quantity;
2720
2522
  var item, fetch, lineItem, cart, _iterator, _step, product, variant, _item$quantity2, currentLineItem;
2721
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2722
- while (1) switch (_context.prev = _context.next) {
2523
+ return _regenerator().w(function (_context) {
2524
+ while (1) switch (_context.n) {
2723
2525
  case 0:
2724
2526
  item = _ref.input, fetch = _ref.fetch;
2725
2527
  if (!(item.quantity && (!Number.isInteger(item.quantity) || item.quantity < 1))) {
2726
- _context.next = 3;
2528
+ _context.n = 1;
2727
2529
  break;
2728
2530
  }
2729
2531
  throw new CommerceError({
2730
2532
  message: "The item quantity has to be a valid integer greater than 0"
2731
2533
  });
2732
- case 3:
2534
+ case 1:
2733
2535
  lineItem = {
2734
2536
  variantId: item.variantId,
2735
2537
  quantity: (_item$quantity = item.quantity) != null ? _item$quantity : 1
@@ -2753,10 +2555,7 @@ var handler$1 = {
2753
2555
  }
2754
2556
  }
2755
2557
  }
2756
- return _context.abrupt("return", cartUpdate(cart));
2757
- case 7:
2758
- case "end":
2759
- return _context.stop();
2558
+ return _context.a(2, cartUpdate(cart));
2760
2559
  }
2761
2560
  }, _callee);
2762
2561
  }))();
@@ -2767,24 +2566,21 @@ var handler$1 = {
2767
2566
  var _useCart = useCart(),
2768
2567
  mutate = _useCart.mutate;
2769
2568
  return useCallback(/*#__PURE__*/function () {
2770
- var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
2569
+ var _addItem = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
2771
2570
  var data;
2772
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2773
- while (1) switch (_context2.prev = _context2.next) {
2571
+ return _regenerator().w(function (_context2) {
2572
+ while (1) switch (_context2.n) {
2774
2573
  case 0:
2775
- _context2.next = 2;
2574
+ _context2.n = 1;
2776
2575
  return fetch({
2777
2576
  input: input
2778
2577
  });
2779
- case 2:
2780
- data = _context2.sent;
2781
- _context2.next = 5;
2578
+ case 1:
2579
+ data = _context2.v;
2580
+ _context2.n = 2;
2782
2581
  return mutate(data, false);
2783
- case 5:
2784
- return _context2.abrupt("return", data);
2785
- case 6:
2786
- case "end":
2787
- return _context2.stop();
2582
+ case 2:
2583
+ return _context2.a(2, data);
2788
2584
  }
2789
2585
  }, _callee2);
2790
2586
  }));
@@ -2802,13 +2598,12 @@ var handler$2 = {
2802
2598
  query: ''
2803
2599
  },
2804
2600
  fetcher: function fetcher(_ref) {
2805
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2806
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2807
- while (1) switch (_context.prev = _context.next) {
2601
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2602
+ return _regenerator().w(function (_context) {
2603
+ while (1) switch (_context.n) {
2808
2604
  case 0:
2809
2605
  case 1:
2810
- case "end":
2811
- return _context.stop();
2606
+ return _context.a(2);
2812
2607
  }
2813
2608
  }, _callee);
2814
2609
  }))();
@@ -2816,14 +2611,11 @@ var handler$2 = {
2816
2611
  useHook: function useHook(_ref2) {
2817
2612
  return function () {
2818
2613
  return /*#__PURE__*/function () {
2819
- var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2820
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2821
- while (1) switch (_context2.prev = _context2.next) {
2614
+ var _addItem = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
2615
+ return _regenerator().w(function (_context2) {
2616
+ while (1) switch (_context2.n) {
2822
2617
  case 0:
2823
- return _context2.abrupt("return", {});
2824
- case 1:
2825
- case "end":
2826
- return _context2.stop();
2618
+ return _context2.a(2, {});
2827
2619
  }
2828
2620
  }, _callee2);
2829
2621
  }));
@@ -2841,13 +2633,12 @@ var handler$3 = {
2841
2633
  query: ''
2842
2634
  },
2843
2635
  fetcher: function fetcher(_ref) {
2844
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2845
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2846
- while (1) switch (_context.prev = _context.next) {
2636
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2637
+ return _regenerator().w(function (_context) {
2638
+ while (1) switch (_context.n) {
2847
2639
  case 0:
2848
2640
  case 1:
2849
- case "end":
2850
- return _context.stop();
2641
+ return _context.a(2);
2851
2642
  }
2852
2643
  }, _callee);
2853
2644
  }))();
@@ -2855,14 +2646,11 @@ var handler$3 = {
2855
2646
  useHook: function useHook(_ref2) {
2856
2647
  return function () {
2857
2648
  return /*#__PURE__*/function () {
2858
- var _removeItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
2859
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2860
- while (1) switch (_context2.prev = _context2.next) {
2649
+ var _removeItem = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(input) {
2650
+ return _regenerator().w(function (_context2) {
2651
+ while (1) switch (_context2.n) {
2861
2652
  case 0:
2862
- return _context2.abrupt("return", {});
2863
- case 1:
2864
- case "end":
2865
- return _context2.stop();
2653
+ return _context2.a(2, {});
2866
2654
  }
2867
2655
  }, _callee2);
2868
2656
  }));
@@ -2895,10 +2683,10 @@ var handler$4 = {
2895
2683
  query: "use-search"
2896
2684
  },
2897
2685
  fetcher: function fetcher(_ref) {
2898
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2686
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2899
2687
  var input, fetch, search, categoryId, brandId, sort, count, products, category;
2900
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2901
- while (1) switch (_context.prev = _context.next) {
2688
+ return _regenerator().w(function (_context) {
2689
+ while (1) switch (_context.n) {
2902
2690
  case 0:
2903
2691
  input = _ref.input, fetch = _ref.fetch;
2904
2692
  search = input.search, categoryId = input.categoryId, brandId = input.brandId, sort = input.sort, count = input.count;
@@ -2927,13 +2715,10 @@ var handler$4 = {
2927
2715
  return sortProduct(a, b, sort);
2928
2716
  });
2929
2717
  }
2930
- return _context.abrupt("return", {
2718
+ return _context.a(2, {
2931
2719
  products: products.slice(0, count),
2932
2720
  found: products.length > 0
2933
2721
  });
2934
- case 8:
2935
- case "end":
2936
- return _context.stop();
2937
2722
  }
2938
2723
  }, _callee);
2939
2724
  }))();
@@ -2959,20 +2744,17 @@ var handler$5 = {
2959
2744
  query: "use-product"
2960
2745
  },
2961
2746
  fetcher: function fetcher(_ref) {
2962
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2747
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
2963
2748
  var _data$products$find;
2964
2749
  var input, fetch, id;
2965
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2966
- while (1) switch (_context.prev = _context.next) {
2750
+ return _regenerator().w(function (_context) {
2751
+ while (1) switch (_context.n) {
2967
2752
  case 0:
2968
2753
  input = _ref.input, fetch = _ref.fetch;
2969
2754
  id = input.id;
2970
- return _context.abrupt("return", (_data$products$find = data.products.find(function (product) {
2755
+ return _context.a(2, (_data$products$find = data.products.find(function (product) {
2971
2756
  return [product.id, product.slug].includes(id);
2972
2757
  })) != null ? _data$products$find : null);
2973
- case 3:
2974
- case "end":
2975
- return _context.stop();
2976
2758
  }
2977
2759
  }, _callee);
2978
2760
  }))();
@@ -2998,26 +2780,23 @@ var handler$6 = {
2998
2780
  query: "use-categories"
2999
2781
  },
3000
2782
  fetcher: function fetcher(_ref) {
3001
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2783
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3002
2784
  var input, fetch, categoryId, category;
3003
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3004
- while (1) switch (_context.prev = _context.next) {
2785
+ return _regenerator().w(function (_context) {
2786
+ while (1) switch (_context.n) {
3005
2787
  case 0:
3006
2788
  input = _ref.input, fetch = _ref.fetch;
3007
2789
  categoryId = input.categoryId;
3008
2790
  if (categoryId) {
3009
- _context.next = 4;
2791
+ _context.n = 1;
3010
2792
  break;
3011
2793
  }
3012
- return _context.abrupt("return", data.categories);
3013
- case 4:
2794
+ return _context.a(2, data.categories);
2795
+ case 1:
3014
2796
  category = data.categories.find(function (category) {
3015
2797
  return category.id === categoryId;
3016
2798
  });
3017
- return _context.abrupt("return", category ? [category] : []);
3018
- case 6:
3019
- case "end":
3020
- return _context.stop();
2799
+ return _context.a(2, category ? [category] : []);
3021
2800
  }
3022
2801
  }, _callee);
3023
2802
  }))();
@@ -3051,15 +2830,15 @@ var handler$7 = {
3051
2830
  query: "use-brands"
3052
2831
  },
3053
2832
  fetcher: function fetcher(_ref) {
3054
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2833
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
3055
2834
  var vendorsStrings;
3056
- return _regeneratorRuntime().wrap(function _callee$(_context) {
3057
- while (1) switch (_context.prev = _context.next) {
2835
+ return _regenerator().w(function (_context) {
2836
+ while (1) switch (_context.n) {
3058
2837
  case 0:
3059
2838
  vendorsStrings = data.products.map(function (product) {
3060
2839
  return product.vendor;
3061
2840
  });
3062
- return _context.abrupt("return", Array.from(new Set(vendorsStrings).values()).map(function (v) {
2841
+ return _context.a(2, Array.from(new Set(vendorsStrings).values()).map(function (v) {
3063
2842
  var id = v.replace(/\s+/g, "-").toLowerCase();
3064
2843
  return {
3065
2844
  entityId: id,
@@ -3067,9 +2846,6 @@ var handler$7 = {
3067
2846
  path: "brands/" + id
3068
2847
  };
3069
2848
  }));
3070
- case 3:
3071
- case "end":
3072
- return _context.stop();
3073
2849
  }
3074
2850
  }, _callee);
3075
2851
  }))();