@ikas/storefront 0.0.158-alpha.24 → 0.0.158-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -17571,6 +17571,253 @@ var AnalyticsBody = function () {
17571
17571
  } }))));
17572
17572
  };
17573
17573
 
17574
+ /**
17575
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
17576
+ * support for iteratee shorthands.
17577
+ *
17578
+ * @private
17579
+ * @param {Array} array The array to inspect.
17580
+ * @param {Function} predicate The function invoked per iteration.
17581
+ * @param {number} fromIndex The index to search from.
17582
+ * @param {boolean} [fromRight] Specify iterating from right to left.
17583
+ * @returns {number} Returns the index of the matched value, else `-1`.
17584
+ */
17585
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
17586
+ var length = array.length,
17587
+ index = fromIndex + (fromRight ? 1 : -1);
17588
+
17589
+ while ((fromRight ? index-- : ++index < length)) {
17590
+ if (predicate(array[index], index, array)) {
17591
+ return index;
17592
+ }
17593
+ }
17594
+ return -1;
17595
+ }
17596
+
17597
+ var _baseFindIndex = baseFindIndex;
17598
+
17599
+ /**
17600
+ * The base implementation of `_.isNaN` without support for number objects.
17601
+ *
17602
+ * @private
17603
+ * @param {*} value The value to check.
17604
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
17605
+ */
17606
+ function baseIsNaN(value) {
17607
+ return value !== value;
17608
+ }
17609
+
17610
+ var _baseIsNaN = baseIsNaN;
17611
+
17612
+ /**
17613
+ * A specialized version of `_.indexOf` which performs strict equality
17614
+ * comparisons of values, i.e. `===`.
17615
+ *
17616
+ * @private
17617
+ * @param {Array} array The array to inspect.
17618
+ * @param {*} value The value to search for.
17619
+ * @param {number} fromIndex The index to search from.
17620
+ * @returns {number} Returns the index of the matched value, else `-1`.
17621
+ */
17622
+ function strictIndexOf(array, value, fromIndex) {
17623
+ var index = fromIndex - 1,
17624
+ length = array.length;
17625
+
17626
+ while (++index < length) {
17627
+ if (array[index] === value) {
17628
+ return index;
17629
+ }
17630
+ }
17631
+ return -1;
17632
+ }
17633
+
17634
+ var _strictIndexOf = strictIndexOf;
17635
+
17636
+ /**
17637
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
17638
+ *
17639
+ * @private
17640
+ * @param {Array} array The array to inspect.
17641
+ * @param {*} value The value to search for.
17642
+ * @param {number} fromIndex The index to search from.
17643
+ * @returns {number} Returns the index of the matched value, else `-1`.
17644
+ */
17645
+ function baseIndexOf(array, value, fromIndex) {
17646
+ return value === value
17647
+ ? _strictIndexOf(array, value, fromIndex)
17648
+ : _baseFindIndex(array, _baseIsNaN, fromIndex);
17649
+ }
17650
+
17651
+ var _baseIndexOf = baseIndexOf;
17652
+
17653
+ /**
17654
+ * A specialized version of `_.includes` for arrays without support for
17655
+ * specifying an index to search from.
17656
+ *
17657
+ * @private
17658
+ * @param {Array} [array] The array to inspect.
17659
+ * @param {*} target The value to search for.
17660
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
17661
+ */
17662
+ function arrayIncludes(array, value) {
17663
+ var length = array == null ? 0 : array.length;
17664
+ return !!length && _baseIndexOf(array, value, 0) > -1;
17665
+ }
17666
+
17667
+ var _arrayIncludes = arrayIncludes;
17668
+
17669
+ /**
17670
+ * This function is like `arrayIncludes` except that it accepts a comparator.
17671
+ *
17672
+ * @private
17673
+ * @param {Array} [array] The array to inspect.
17674
+ * @param {*} target The value to search for.
17675
+ * @param {Function} comparator The comparator invoked per element.
17676
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
17677
+ */
17678
+ function arrayIncludesWith(array, value, comparator) {
17679
+ var index = -1,
17680
+ length = array == null ? 0 : array.length;
17681
+
17682
+ while (++index < length) {
17683
+ if (comparator(value, array[index])) {
17684
+ return true;
17685
+ }
17686
+ }
17687
+ return false;
17688
+ }
17689
+
17690
+ var _arrayIncludesWith = arrayIncludesWith;
17691
+
17692
+ /**
17693
+ * This method returns `undefined`.
17694
+ *
17695
+ * @static
17696
+ * @memberOf _
17697
+ * @since 2.3.0
17698
+ * @category Util
17699
+ * @example
17700
+ *
17701
+ * _.times(2, _.noop);
17702
+ * // => [undefined, undefined]
17703
+ */
17704
+ function noop() {
17705
+ // No operation performed.
17706
+ }
17707
+
17708
+ var noop_1 = noop;
17709
+
17710
+ /** Used as references for various `Number` constants. */
17711
+ var INFINITY$2 = 1 / 0;
17712
+
17713
+ /**
17714
+ * Creates a set object of `values`.
17715
+ *
17716
+ * @private
17717
+ * @param {Array} values The values to add to the set.
17718
+ * @returns {Object} Returns the new set.
17719
+ */
17720
+ var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
17721
+ return new _Set(values);
17722
+ };
17723
+
17724
+ var _createSet = createSet;
17725
+
17726
+ /** Used as the size to enable large array optimizations. */
17727
+ var LARGE_ARRAY_SIZE$1 = 200;
17728
+
17729
+ /**
17730
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
17731
+ *
17732
+ * @private
17733
+ * @param {Array} array The array to inspect.
17734
+ * @param {Function} [iteratee] The iteratee invoked per element.
17735
+ * @param {Function} [comparator] The comparator invoked per element.
17736
+ * @returns {Array} Returns the new duplicate free array.
17737
+ */
17738
+ function baseUniq(array, iteratee, comparator) {
17739
+ var index = -1,
17740
+ includes = _arrayIncludes,
17741
+ length = array.length,
17742
+ isCommon = true,
17743
+ result = [],
17744
+ seen = result;
17745
+
17746
+ if (comparator) {
17747
+ isCommon = false;
17748
+ includes = _arrayIncludesWith;
17749
+ }
17750
+ else if (length >= LARGE_ARRAY_SIZE$1) {
17751
+ var set = iteratee ? null : _createSet(array);
17752
+ if (set) {
17753
+ return _setToArray(set);
17754
+ }
17755
+ isCommon = false;
17756
+ includes = _cacheHas;
17757
+ seen = new _SetCache;
17758
+ }
17759
+ else {
17760
+ seen = iteratee ? [] : result;
17761
+ }
17762
+ outer:
17763
+ while (++index < length) {
17764
+ var value = array[index],
17765
+ computed = iteratee ? iteratee(value) : value;
17766
+
17767
+ value = (comparator || value !== 0) ? value : 0;
17768
+ if (isCommon && computed === computed) {
17769
+ var seenIndex = seen.length;
17770
+ while (seenIndex--) {
17771
+ if (seen[seenIndex] === computed) {
17772
+ continue outer;
17773
+ }
17774
+ }
17775
+ if (iteratee) {
17776
+ seen.push(computed);
17777
+ }
17778
+ result.push(value);
17779
+ }
17780
+ else if (!includes(seen, computed, comparator)) {
17781
+ if (seen !== result) {
17782
+ seen.push(computed);
17783
+ }
17784
+ result.push(value);
17785
+ }
17786
+ }
17787
+ return result;
17788
+ }
17789
+
17790
+ var _baseUniq = baseUniq;
17791
+
17792
+ /**
17793
+ * This method is like `_.uniq` except that it accepts `iteratee` which is
17794
+ * invoked for each element in `array` to generate the criterion by which
17795
+ * uniqueness is computed. The order of result values is determined by the
17796
+ * order they occur in the array. The iteratee is invoked with one argument:
17797
+ * (value).
17798
+ *
17799
+ * @static
17800
+ * @memberOf _
17801
+ * @since 4.0.0
17802
+ * @category Array
17803
+ * @param {Array} array The array to inspect.
17804
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17805
+ * @returns {Array} Returns the new duplicate free array.
17806
+ * @example
17807
+ *
17808
+ * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
17809
+ * // => [2.1, 1.2]
17810
+ *
17811
+ * // The `_.property` iteratee shorthand.
17812
+ * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
17813
+ * // => [{ 'x': 1 }, { 'x': 2 }]
17814
+ */
17815
+ function uniqBy(array, iteratee) {
17816
+ return (array && array.length) ? _baseUniq(array, _baseIteratee(iteratee)) : [];
17817
+ }
17818
+
17819
+ var uniqBy_1 = uniqBy;
17820
+
17574
17821
  var isServer$3 = typeof localStorage === "undefined";
17575
17822
  var LS_TOKEN_KEY = "customerToken";
17576
17823
  var LS_TOKEN_EXPIRY = "customerTokenExpiry";
@@ -17985,6 +18232,7 @@ var IkasCustomerStore = /** @class */ (function () {
17985
18232
  if (lvpStr) {
17986
18233
  this._lastViewedProducts = JSON.parse(lvpStr);
17987
18234
  this._lastViewedProducts = this._lastViewedProducts.reverse();
18235
+ this._lastViewedProducts = uniqBy_1(this._lastViewedProducts, "variantId");
17988
18236
  }
17989
18237
  }
17990
18238
  catch (err) { }
@@ -18018,6 +18266,7 @@ var IkasCustomerStore = /** @class */ (function () {
18018
18266
  case 2:
18019
18267
  this._lastViewedProducts.push({ productId: productId, variantId: variantId });
18020
18268
  this._lastViewedProducts = this._lastViewedProducts.slice(0, 20);
18269
+ this._lastViewedProducts = uniqBy_1(this._lastViewedProducts, "variantId");
18021
18270
  this.saveLastViewedProducts();
18022
18271
  _a.label = 3;
18023
18272
  case 3: return [2 /*return*/];
@@ -24490,61 +24739,61 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
24490
24739
  return __generator(this, function (_d) {
24491
24740
  switch (_d.label) {
24492
24741
  case 0:
24493
- if (!(linkPropValue.linkType === IkasLinkType.PAGE)) return [3 /*break*/, 16];
24742
+ if (!(linkPropValue.linkType === IkasLinkType.PAGE)) return [3 /*break*/, 18];
24494
24743
  if (!(linkPropValue.pageType === IkasThemePageType.INDEX)) return [3 /*break*/, 1];
24495
24744
  navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
24496
- return [3 /*break*/, 15];
24745
+ return [3 /*break*/, 17];
24497
24746
  case 1:
24498
24747
  if (!(linkPropValue.pageType === IkasThemePageType.ACCOUNT)) return [3 /*break*/, 2];
24499
24748
  navigationLink = new IkasNavigationLink("/account/info", linkPropValue.label || "", []);
24500
- return [3 /*break*/, 15];
24749
+ return [3 /*break*/, 17];
24501
24750
  case 2:
24502
24751
  if (!(linkPropValue.pageType === IkasThemePageType.ADDRESSES)) return [3 /*break*/, 3];
24503
24752
  navigationLink = new IkasNavigationLink("/account/addresses", linkPropValue.label || "", []);
24504
- return [3 /*break*/, 15];
24753
+ return [3 /*break*/, 17];
24505
24754
  case 3:
24506
24755
  if (!(linkPropValue.pageType === IkasThemePageType.ORDERS)) return [3 /*break*/, 4];
24507
24756
  navigationLink = new IkasNavigationLink("/account/orders", linkPropValue.label || "", []);
24508
- return [3 /*break*/, 15];
24757
+ return [3 /*break*/, 17];
24509
24758
  case 4:
24510
24759
  if (!(linkPropValue.pageType === IkasThemePageType.FAVORITE_PRODUCTS)) return [3 /*break*/, 5];
24511
24760
  navigationLink = new IkasNavigationLink("/account/favorite-products", linkPropValue.label || "", []);
24512
- return [3 /*break*/, 15];
24761
+ return [3 /*break*/, 17];
24513
24762
  case 5:
24514
24763
  if (!(linkPropValue.pageType === IkasThemePageType.LOGIN)) return [3 /*break*/, 6];
24515
24764
  navigationLink = new IkasNavigationLink("/account/login", linkPropValue.label || "", []);
24516
- return [3 /*break*/, 15];
24765
+ return [3 /*break*/, 17];
24517
24766
  case 6:
24518
24767
  if (!(linkPropValue.pageType === IkasThemePageType.REGISTER)) return [3 /*break*/, 7];
24519
24768
  navigationLink = new IkasNavigationLink("/account/register", linkPropValue.label || "", []);
24520
- return [3 /*break*/, 15];
24769
+ return [3 /*break*/, 17];
24521
24770
  case 7:
24522
24771
  if (!(linkPropValue.pageType === IkasThemePageType.FORGOT_PASSWORD)) return [3 /*break*/, 8];
24523
24772
  navigationLink = new IkasNavigationLink("/account/forgot-password", linkPropValue.label || "", []);
24524
- return [3 /*break*/, 15];
24773
+ return [3 /*break*/, 17];
24525
24774
  case 8:
24526
24775
  if (!(linkPropValue.pageType === IkasThemePageType.RECOVER_PASSWORD)) return [3 /*break*/, 9];
24527
24776
  navigationLink = new IkasNavigationLink("/account/recover-password", linkPropValue.label || "", []);
24528
- return [3 /*break*/, 15];
24777
+ return [3 /*break*/, 17];
24529
24778
  case 9:
24530
24779
  if (!(linkPropValue.pageType === IkasThemePageType.BLOG_INDEX)) return [3 /*break*/, 10];
24531
24780
  navigationLink = new IkasNavigationLink("/blog", linkPropValue.label || "", []);
24532
- return [3 /*break*/, 15];
24781
+ return [3 /*break*/, 17];
24533
24782
  case 10:
24534
24783
  if (!(linkPropValue.pageType === IkasThemePageType.CART)) return [3 /*break*/, 11];
24535
24784
  navigationLink = new IkasNavigationLink("/cart", linkPropValue.label || "", []);
24536
- return [3 /*break*/, 15];
24785
+ return [3 /*break*/, 17];
24537
24786
  case 11:
24538
24787
  if (!(linkPropValue.pageType === IkasThemePageType.SEARCH)) return [3 /*break*/, 12];
24539
24788
  navigationLink = new IkasNavigationLink("/search", linkPropValue.label || "", []);
24540
- return [3 /*break*/, 15];
24789
+ return [3 /*break*/, 17];
24541
24790
  case 12:
24542
24791
  if (!(linkPropValue.pageType === IkasThemePageType.CUSTOM)) return [3 /*break*/, 13];
24543
24792
  themePage = this.theme.pages.find(function (p) { return p.id === linkPropValue.pageId; });
24544
24793
  if (themePage) {
24545
24794
  navigationLink = new IkasNavigationLink("/pages/" + themePage.slug, linkPropValue.label || "", []);
24546
24795
  }
24547
- return [3 /*break*/, 15];
24796
+ return [3 /*break*/, 17];
24548
24797
  case 13:
24549
24798
  if (![
24550
24799
  IkasThemePageType.PRODUCT,
@@ -24557,17 +24806,17 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
24557
24806
  if (metaDataList.length) {
24558
24807
  navigationLink = new IkasNavigationLink("/" + metaDataList[0].slug, linkPropValue.label || "", []);
24559
24808
  }
24560
- _d.label = 15;
24561
- case 15: return [3 /*break*/, 19];
24562
- case 16:
24563
- if (![IkasThemePageType.BLOG, IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) return [3 /*break*/, 18];
24809
+ return [3 /*break*/, 17];
24810
+ case 15:
24811
+ if (![IkasThemePageType.BLOG, IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) return [3 /*break*/, 17];
24564
24812
  return [4 /*yield*/, IkasBlogAPI.listBlogMetaData(undefined, linkPropValue.itemId || undefined)];
24565
- case 17:
24813
+ case 16:
24566
24814
  metaDataList = _d.sent();
24567
24815
  if (metaDataList.length) {
24568
24816
  navigationLink = new IkasNavigationLink("/blog/" + metaDataList[0].slug, linkPropValue.label || "", []);
24569
24817
  }
24570
- return [3 /*break*/, 19];
24818
+ _d.label = 17;
24819
+ case 17: return [3 /*break*/, 19];
24571
24820
  case 18:
24572
24821
  if (linkPropValue.linkType === IkasLinkType.EXTERNAL) {
24573
24822
  navigationLink = new IkasNavigationLink(linkPropValue.externalLink || "", linkPropValue.label || "", [], true);
package/build/index.js CHANGED
@@ -17577,6 +17577,253 @@ var AnalyticsBody = function () {
17577
17577
  } }))));
17578
17578
  };
17579
17579
 
17580
+ /**
17581
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
17582
+ * support for iteratee shorthands.
17583
+ *
17584
+ * @private
17585
+ * @param {Array} array The array to inspect.
17586
+ * @param {Function} predicate The function invoked per iteration.
17587
+ * @param {number} fromIndex The index to search from.
17588
+ * @param {boolean} [fromRight] Specify iterating from right to left.
17589
+ * @returns {number} Returns the index of the matched value, else `-1`.
17590
+ */
17591
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
17592
+ var length = array.length,
17593
+ index = fromIndex + (fromRight ? 1 : -1);
17594
+
17595
+ while ((fromRight ? index-- : ++index < length)) {
17596
+ if (predicate(array[index], index, array)) {
17597
+ return index;
17598
+ }
17599
+ }
17600
+ return -1;
17601
+ }
17602
+
17603
+ var _baseFindIndex = baseFindIndex;
17604
+
17605
+ /**
17606
+ * The base implementation of `_.isNaN` without support for number objects.
17607
+ *
17608
+ * @private
17609
+ * @param {*} value The value to check.
17610
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
17611
+ */
17612
+ function baseIsNaN(value) {
17613
+ return value !== value;
17614
+ }
17615
+
17616
+ var _baseIsNaN = baseIsNaN;
17617
+
17618
+ /**
17619
+ * A specialized version of `_.indexOf` which performs strict equality
17620
+ * comparisons of values, i.e. `===`.
17621
+ *
17622
+ * @private
17623
+ * @param {Array} array The array to inspect.
17624
+ * @param {*} value The value to search for.
17625
+ * @param {number} fromIndex The index to search from.
17626
+ * @returns {number} Returns the index of the matched value, else `-1`.
17627
+ */
17628
+ function strictIndexOf(array, value, fromIndex) {
17629
+ var index = fromIndex - 1,
17630
+ length = array.length;
17631
+
17632
+ while (++index < length) {
17633
+ if (array[index] === value) {
17634
+ return index;
17635
+ }
17636
+ }
17637
+ return -1;
17638
+ }
17639
+
17640
+ var _strictIndexOf = strictIndexOf;
17641
+
17642
+ /**
17643
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
17644
+ *
17645
+ * @private
17646
+ * @param {Array} array The array to inspect.
17647
+ * @param {*} value The value to search for.
17648
+ * @param {number} fromIndex The index to search from.
17649
+ * @returns {number} Returns the index of the matched value, else `-1`.
17650
+ */
17651
+ function baseIndexOf(array, value, fromIndex) {
17652
+ return value === value
17653
+ ? _strictIndexOf(array, value, fromIndex)
17654
+ : _baseFindIndex(array, _baseIsNaN, fromIndex);
17655
+ }
17656
+
17657
+ var _baseIndexOf = baseIndexOf;
17658
+
17659
+ /**
17660
+ * A specialized version of `_.includes` for arrays without support for
17661
+ * specifying an index to search from.
17662
+ *
17663
+ * @private
17664
+ * @param {Array} [array] The array to inspect.
17665
+ * @param {*} target The value to search for.
17666
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
17667
+ */
17668
+ function arrayIncludes(array, value) {
17669
+ var length = array == null ? 0 : array.length;
17670
+ return !!length && _baseIndexOf(array, value, 0) > -1;
17671
+ }
17672
+
17673
+ var _arrayIncludes = arrayIncludes;
17674
+
17675
+ /**
17676
+ * This function is like `arrayIncludes` except that it accepts a comparator.
17677
+ *
17678
+ * @private
17679
+ * @param {Array} [array] The array to inspect.
17680
+ * @param {*} target The value to search for.
17681
+ * @param {Function} comparator The comparator invoked per element.
17682
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
17683
+ */
17684
+ function arrayIncludesWith(array, value, comparator) {
17685
+ var index = -1,
17686
+ length = array == null ? 0 : array.length;
17687
+
17688
+ while (++index < length) {
17689
+ if (comparator(value, array[index])) {
17690
+ return true;
17691
+ }
17692
+ }
17693
+ return false;
17694
+ }
17695
+
17696
+ var _arrayIncludesWith = arrayIncludesWith;
17697
+
17698
+ /**
17699
+ * This method returns `undefined`.
17700
+ *
17701
+ * @static
17702
+ * @memberOf _
17703
+ * @since 2.3.0
17704
+ * @category Util
17705
+ * @example
17706
+ *
17707
+ * _.times(2, _.noop);
17708
+ * // => [undefined, undefined]
17709
+ */
17710
+ function noop() {
17711
+ // No operation performed.
17712
+ }
17713
+
17714
+ var noop_1 = noop;
17715
+
17716
+ /** Used as references for various `Number` constants. */
17717
+ var INFINITY$2 = 1 / 0;
17718
+
17719
+ /**
17720
+ * Creates a set object of `values`.
17721
+ *
17722
+ * @private
17723
+ * @param {Array} values The values to add to the set.
17724
+ * @returns {Object} Returns the new set.
17725
+ */
17726
+ var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY$2) ? noop_1 : function(values) {
17727
+ return new _Set(values);
17728
+ };
17729
+
17730
+ var _createSet = createSet;
17731
+
17732
+ /** Used as the size to enable large array optimizations. */
17733
+ var LARGE_ARRAY_SIZE$1 = 200;
17734
+
17735
+ /**
17736
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
17737
+ *
17738
+ * @private
17739
+ * @param {Array} array The array to inspect.
17740
+ * @param {Function} [iteratee] The iteratee invoked per element.
17741
+ * @param {Function} [comparator] The comparator invoked per element.
17742
+ * @returns {Array} Returns the new duplicate free array.
17743
+ */
17744
+ function baseUniq(array, iteratee, comparator) {
17745
+ var index = -1,
17746
+ includes = _arrayIncludes,
17747
+ length = array.length,
17748
+ isCommon = true,
17749
+ result = [],
17750
+ seen = result;
17751
+
17752
+ if (comparator) {
17753
+ isCommon = false;
17754
+ includes = _arrayIncludesWith;
17755
+ }
17756
+ else if (length >= LARGE_ARRAY_SIZE$1) {
17757
+ var set = iteratee ? null : _createSet(array);
17758
+ if (set) {
17759
+ return _setToArray(set);
17760
+ }
17761
+ isCommon = false;
17762
+ includes = _cacheHas;
17763
+ seen = new _SetCache;
17764
+ }
17765
+ else {
17766
+ seen = iteratee ? [] : result;
17767
+ }
17768
+ outer:
17769
+ while (++index < length) {
17770
+ var value = array[index],
17771
+ computed = iteratee ? iteratee(value) : value;
17772
+
17773
+ value = (comparator || value !== 0) ? value : 0;
17774
+ if (isCommon && computed === computed) {
17775
+ var seenIndex = seen.length;
17776
+ while (seenIndex--) {
17777
+ if (seen[seenIndex] === computed) {
17778
+ continue outer;
17779
+ }
17780
+ }
17781
+ if (iteratee) {
17782
+ seen.push(computed);
17783
+ }
17784
+ result.push(value);
17785
+ }
17786
+ else if (!includes(seen, computed, comparator)) {
17787
+ if (seen !== result) {
17788
+ seen.push(computed);
17789
+ }
17790
+ result.push(value);
17791
+ }
17792
+ }
17793
+ return result;
17794
+ }
17795
+
17796
+ var _baseUniq = baseUniq;
17797
+
17798
+ /**
17799
+ * This method is like `_.uniq` except that it accepts `iteratee` which is
17800
+ * invoked for each element in `array` to generate the criterion by which
17801
+ * uniqueness is computed. The order of result values is determined by the
17802
+ * order they occur in the array. The iteratee is invoked with one argument:
17803
+ * (value).
17804
+ *
17805
+ * @static
17806
+ * @memberOf _
17807
+ * @since 4.0.0
17808
+ * @category Array
17809
+ * @param {Array} array The array to inspect.
17810
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17811
+ * @returns {Array} Returns the new duplicate free array.
17812
+ * @example
17813
+ *
17814
+ * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
17815
+ * // => [2.1, 1.2]
17816
+ *
17817
+ * // The `_.property` iteratee shorthand.
17818
+ * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
17819
+ * // => [{ 'x': 1 }, { 'x': 2 }]
17820
+ */
17821
+ function uniqBy(array, iteratee) {
17822
+ return (array && array.length) ? _baseUniq(array, _baseIteratee(iteratee)) : [];
17823
+ }
17824
+
17825
+ var uniqBy_1 = uniqBy;
17826
+
17580
17827
  var isServer$3 = typeof localStorage === "undefined";
17581
17828
  var LS_TOKEN_KEY = "customerToken";
17582
17829
  var LS_TOKEN_EXPIRY = "customerTokenExpiry";
@@ -17991,6 +18238,7 @@ var IkasCustomerStore = /** @class */ (function () {
17991
18238
  if (lvpStr) {
17992
18239
  this._lastViewedProducts = JSON.parse(lvpStr);
17993
18240
  this._lastViewedProducts = this._lastViewedProducts.reverse();
18241
+ this._lastViewedProducts = uniqBy_1(this._lastViewedProducts, "variantId");
17994
18242
  }
17995
18243
  }
17996
18244
  catch (err) { }
@@ -18024,6 +18272,7 @@ var IkasCustomerStore = /** @class */ (function () {
18024
18272
  case 2:
18025
18273
  this._lastViewedProducts.push({ productId: productId, variantId: variantId });
18026
18274
  this._lastViewedProducts = this._lastViewedProducts.slice(0, 20);
18275
+ this._lastViewedProducts = uniqBy_1(this._lastViewedProducts, "variantId");
18027
18276
  this.saveLastViewedProducts();
18028
18277
  _a.label = 3;
18029
18278
  case 3: return [2 /*return*/];
@@ -24470,61 +24719,61 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
24470
24719
  return __generator(this, function (_d) {
24471
24720
  switch (_d.label) {
24472
24721
  case 0:
24473
- if (!(linkPropValue.linkType === exports.IkasLinkType.PAGE)) return [3 /*break*/, 16];
24722
+ if (!(linkPropValue.linkType === exports.IkasLinkType.PAGE)) return [3 /*break*/, 18];
24474
24723
  if (!(linkPropValue.pageType === exports.IkasThemePageType.INDEX)) return [3 /*break*/, 1];
24475
24724
  navigationLink = new IkasNavigationLink("/", linkPropValue.label || "", []);
24476
- return [3 /*break*/, 15];
24725
+ return [3 /*break*/, 17];
24477
24726
  case 1:
24478
24727
  if (!(linkPropValue.pageType === exports.IkasThemePageType.ACCOUNT)) return [3 /*break*/, 2];
24479
24728
  navigationLink = new IkasNavigationLink("/account/info", linkPropValue.label || "", []);
24480
- return [3 /*break*/, 15];
24729
+ return [3 /*break*/, 17];
24481
24730
  case 2:
24482
24731
  if (!(linkPropValue.pageType === exports.IkasThemePageType.ADDRESSES)) return [3 /*break*/, 3];
24483
24732
  navigationLink = new IkasNavigationLink("/account/addresses", linkPropValue.label || "", []);
24484
- return [3 /*break*/, 15];
24733
+ return [3 /*break*/, 17];
24485
24734
  case 3:
24486
24735
  if (!(linkPropValue.pageType === exports.IkasThemePageType.ORDERS)) return [3 /*break*/, 4];
24487
24736
  navigationLink = new IkasNavigationLink("/account/orders", linkPropValue.label || "", []);
24488
- return [3 /*break*/, 15];
24737
+ return [3 /*break*/, 17];
24489
24738
  case 4:
24490
24739
  if (!(linkPropValue.pageType === exports.IkasThemePageType.FAVORITE_PRODUCTS)) return [3 /*break*/, 5];
24491
24740
  navigationLink = new IkasNavigationLink("/account/favorite-products", linkPropValue.label || "", []);
24492
- return [3 /*break*/, 15];
24741
+ return [3 /*break*/, 17];
24493
24742
  case 5:
24494
24743
  if (!(linkPropValue.pageType === exports.IkasThemePageType.LOGIN)) return [3 /*break*/, 6];
24495
24744
  navigationLink = new IkasNavigationLink("/account/login", linkPropValue.label || "", []);
24496
- return [3 /*break*/, 15];
24745
+ return [3 /*break*/, 17];
24497
24746
  case 6:
24498
24747
  if (!(linkPropValue.pageType === exports.IkasThemePageType.REGISTER)) return [3 /*break*/, 7];
24499
24748
  navigationLink = new IkasNavigationLink("/account/register", linkPropValue.label || "", []);
24500
- return [3 /*break*/, 15];
24749
+ return [3 /*break*/, 17];
24501
24750
  case 7:
24502
24751
  if (!(linkPropValue.pageType === exports.IkasThemePageType.FORGOT_PASSWORD)) return [3 /*break*/, 8];
24503
24752
  navigationLink = new IkasNavigationLink("/account/forgot-password", linkPropValue.label || "", []);
24504
- return [3 /*break*/, 15];
24753
+ return [3 /*break*/, 17];
24505
24754
  case 8:
24506
24755
  if (!(linkPropValue.pageType === exports.IkasThemePageType.RECOVER_PASSWORD)) return [3 /*break*/, 9];
24507
24756
  navigationLink = new IkasNavigationLink("/account/recover-password", linkPropValue.label || "", []);
24508
- return [3 /*break*/, 15];
24757
+ return [3 /*break*/, 17];
24509
24758
  case 9:
24510
24759
  if (!(linkPropValue.pageType === exports.IkasThemePageType.BLOG_INDEX)) return [3 /*break*/, 10];
24511
24760
  navigationLink = new IkasNavigationLink("/blog", linkPropValue.label || "", []);
24512
- return [3 /*break*/, 15];
24761
+ return [3 /*break*/, 17];
24513
24762
  case 10:
24514
24763
  if (!(linkPropValue.pageType === exports.IkasThemePageType.CART)) return [3 /*break*/, 11];
24515
24764
  navigationLink = new IkasNavigationLink("/cart", linkPropValue.label || "", []);
24516
- return [3 /*break*/, 15];
24765
+ return [3 /*break*/, 17];
24517
24766
  case 11:
24518
24767
  if (!(linkPropValue.pageType === exports.IkasThemePageType.SEARCH)) return [3 /*break*/, 12];
24519
24768
  navigationLink = new IkasNavigationLink("/search", linkPropValue.label || "", []);
24520
- return [3 /*break*/, 15];
24769
+ return [3 /*break*/, 17];
24521
24770
  case 12:
24522
24771
  if (!(linkPropValue.pageType === exports.IkasThemePageType.CUSTOM)) return [3 /*break*/, 13];
24523
24772
  themePage = this.theme.pages.find(function (p) { return p.id === linkPropValue.pageId; });
24524
24773
  if (themePage) {
24525
24774
  navigationLink = new IkasNavigationLink("/pages/" + themePage.slug, linkPropValue.label || "", []);
24526
24775
  }
24527
- return [3 /*break*/, 15];
24776
+ return [3 /*break*/, 17];
24528
24777
  case 13:
24529
24778
  if (![
24530
24779
  exports.IkasThemePageType.PRODUCT,
@@ -24537,17 +24786,17 @@ var IkasLinkPropValueProvider = /** @class */ (function () {
24537
24786
  if (metaDataList.length) {
24538
24787
  navigationLink = new IkasNavigationLink("/" + metaDataList[0].slug, linkPropValue.label || "", []);
24539
24788
  }
24540
- _d.label = 15;
24541
- case 15: return [3 /*break*/, 19];
24542
- case 16:
24543
- if (![exports.IkasThemePageType.BLOG, exports.IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) return [3 /*break*/, 18];
24789
+ return [3 /*break*/, 17];
24790
+ case 15:
24791
+ if (![exports.IkasThemePageType.BLOG, exports.IkasThemePageType.BLOG_CATEGORY].includes(linkPropValue.pageType)) return [3 /*break*/, 17];
24544
24792
  return [4 /*yield*/, IkasBlogAPI.listBlogMetaData(undefined, linkPropValue.itemId || undefined)];
24545
- case 17:
24793
+ case 16:
24546
24794
  metaDataList = _d.sent();
24547
24795
  if (metaDataList.length) {
24548
24796
  navigationLink = new IkasNavigationLink("/blog/" + metaDataList[0].slug, linkPropValue.label || "", []);
24549
24797
  }
24550
- return [3 /*break*/, 19];
24798
+ _d.label = 17;
24799
+ case 17: return [3 /*break*/, 19];
24551
24800
  case 18:
24552
24801
  if (linkPropValue.linkType === exports.IkasLinkType.EXTERNAL) {
24553
24802
  navigationLink = new IkasNavigationLink(linkPropValue.externalLink || "", linkPropValue.label || "", [], true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.158-alpha.24",
3
+ "version": "0.0.158-alpha.25",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",