@infrab4a/connect-angular 3.8.0-beta.9 → 3.8.1-beta.0

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.
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('ts-custom-error'), require('@angular/fire/firestore'), require('@angular/common/http'), require('@angular/fire')) :
3
3
  typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', 'ts-custom-error', '@angular/fire/firestore', '@angular/common/http', '@angular/fire'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global["ts-custom-error"], global.ng.fire.firestore, global.ng.common.http, global.ng.fire));
5
- })(this, (function (exports, i0, rxjs, operators, i1, i1$1, cookie, tsCustomError, i1$2, i1$3, fire) { 'use strict';
5
+ })(this, (function (exports, i0, rxjs, operators, i1, i3, cookie, tsCustomError, i1$1, i1$2, fire) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -26,10 +26,10 @@
26
26
 
27
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
28
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
29
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
30
30
  var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
31
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
31
32
  var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
32
- var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
33
33
 
34
34
  /*! *****************************************************************************
35
35
  Copyright (c) Microsoft Corporation.
@@ -369,7 +369,7 @@
369
369
  };
370
370
  AuthService.prototype.getUser = function () {
371
371
  var _this = this;
372
- return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? _this.userRepository.get({ id: id }) : rxjs.of(null)); }));
372
+ return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? rxjs.from(_this.userRepository.get({ id: id })).pipe(operators.catchError(function () { return rxjs.of(null); })) : rxjs.of(null)); }));
373
373
  };
374
374
  AuthService.prototype.getTokenId = function () {
375
375
  return this.angularFireAuth.idToken;
@@ -429,7 +429,7 @@
429
429
  this.separateValidCoupons = function (coupons, userEmail) { return coupons
430
430
  .map(function (coupon) {
431
431
  try {
432
- if (!(coupon instanceof i1$1.Coupon))
432
+ if (!(coupon instanceof i3.Coupon))
433
433
  throw new InvalidCouponError('Cupom inválido.');
434
434
  if (_this.isValidCoupon(coupon, userEmail))
435
435
  return coupon;
@@ -438,7 +438,7 @@
438
438
  return error;
439
439
  }
440
440
  })
441
- .reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof i1$1.Coupon
441
+ .reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof i3.Coupon
442
442
  ? { valids: __spreadArray(__spreadArray([], __read(current.valids)), [coupon]) }
443
443
  : { invalids: __spreadArray(__spreadArray([], __read(current.invalids)), [coupon]) }))); }, {
444
444
  valids: [],
@@ -449,8 +449,8 @@
449
449
  var _this = this;
450
450
  return rxjs.from(this.couponRepository.find({
451
451
  filters: {
452
- nickname: { operator: i1$1.Where.EQUALS, value: nickname },
453
- active: { operator: i1$1.Where.EQUALS, value: true },
452
+ nickname: { operator: i3.Where.EQUALS, value: nickname },
453
+ active: { operator: i3.Where.EQUALS, value: true },
454
454
  },
455
455
  })).pipe(operators.concatMap(function (coupons) { return _this.checkCouponRules(coupons, checkoutType, plan, checkout, isSubscription); }), operators.concatMap(function (coupon) { return _this.checkCouponUseAndLimit(coupon, userEmail, checkout); }), operators.map(function (coupon) { return _this.isValidCoupon(coupon, userEmail); }), operators.map(function (coupon) { return coupon; }));
456
456
  };
@@ -462,17 +462,17 @@
462
462
  // Get Primeiro Cupom (o find do repository retorna um array)
463
463
  var coupon = coupons.data.shift();
464
464
  // Verifica se o cupom é aplicavel na loja
465
- var isInShop = coupon.shopAvailability === i1$1.Shops.ALL || coupon.shopAvailability === this.defaultShop;
465
+ var isInShop = coupon.shopAvailability === i3.Shops.ALL || coupon.shopAvailability === this.defaultShop;
466
466
  // Cupon não aplicavel a loja retorna erro
467
467
  if (!isInShop)
468
468
  return rxjs.throwError('Cupom inválido para loja.');
469
469
  // Verifica se o coupon é aplicado no checkout que está sendo realizado
470
- var isCheckoutType = coupon.checkoutType === i1$1.CheckoutTypes.ALL || coupon.checkoutType === checkoutType;
470
+ var isCheckoutType = coupon.checkoutType === i3.CheckoutTypes.ALL || coupon.checkoutType === checkoutType;
471
471
  // Cupon não aplicavel ao checkout retorna erro
472
472
  if (!isCheckoutType)
473
473
  return rxjs.throwError('Cupom inválido. Erro de checkout.');
474
474
  // Verifica se o cupom é ou pode ser aplicado para subscription
475
- if (checkoutType === i1$1.CheckoutTypes.ALL || checkoutType === i1$1.CheckoutTypes.SUBSCRIPTION) {
475
+ if (checkoutType === i3.CheckoutTypes.ALL || checkoutType === i3.CheckoutTypes.SUBSCRIPTION) {
476
476
  // Se o cupom tiver um plano associado, verifica se é o mesmo plano do checkout da assinatura
477
477
  if (coupon.plan && coupon.plan.toUpperCase() !== plan.toUpperCase())
478
478
  return rxjs.throwError('Cupom inválido para sua assinatura.');
@@ -531,9 +531,9 @@
531
531
  CouponService.prototype.calcDiscountSubscription = function (coupon, checkout) {
532
532
  //
533
533
  var discount = 0;
534
- if (coupon.type === i1$1.CouponTypes.ABSOLUTE)
534
+ if (coupon.type === i3.CouponTypes.ABSOLUTE)
535
535
  discount = coupon.discount;
536
- else if (coupon.type === i1$1.CouponTypes.PERCENTAGE)
536
+ else if (coupon.type === i3.CouponTypes.PERCENTAGE)
537
537
  discount = checkout.subscriptionPlan.recurrencePrice * (coupon.discount / 100);
538
538
  return rxjs.of(discount);
539
539
  };
@@ -546,8 +546,8 @@
546
546
  discount = 0;
547
547
  _d = coupon.type;
548
548
  switch (_d) {
549
- case i1$1.CouponTypes.ABSOLUTE: return [3 /*break*/, 1];
550
- case i1$1.CouponTypes.PERCENTAGE: return [3 /*break*/, 2];
549
+ case i3.CouponTypes.ABSOLUTE: return [3 /*break*/, 1];
550
+ case i3.CouponTypes.PERCENTAGE: return [3 /*break*/, 2];
551
551
  }
552
552
  return [3 /*break*/, 4];
553
553
  case 1:
@@ -642,22 +642,22 @@
642
642
  });
643
643
  };
644
644
  CouponService.prototype.userValidationAndSubscriptionStatus = function (coupon, user) {
645
- if (coupon.exclusivityType === i1$1.Exclusivities.ALL_USERS)
645
+ if (coupon.exclusivityType === i3.Exclusivities.ALL_USERS)
646
646
  return true;
647
647
  if (!user)
648
648
  return true;
649
649
  // Verifica se o email do usuário é coorporativo
650
- if (!this.emailIsFromCollaborator(user.email) && coupon.exclusivityType === i1$1.Exclusivities.COLLABORATORS)
650
+ if (!this.emailIsFromCollaborator(user.email) && coupon.exclusivityType === i3.Exclusivities.COLLABORATORS)
651
651
  throw new InvalidCouponError('Você não é colaborador.');
652
652
  // Verifica se o email do usuário é associado ao cupom de uso por usuario
653
- if (coupon.exclusivityType === i1$1.Exclusivities.SPECIFIC_USER && coupon.userExclusiveEmail !== user.email)
653
+ if (coupon.exclusivityType === i3.Exclusivities.SPECIFIC_USER && coupon.userExclusiveEmail !== user.email)
654
654
  throw new InvalidCouponError('Cupom não é válido para este usuário.');
655
655
  switch (coupon.exclusivityType) {
656
- case i1$1.Exclusivities.ACTIVE_SUBSCRIBER:
656
+ case i3.Exclusivities.ACTIVE_SUBSCRIBER:
657
657
  return user.isSubscriber ? true : false;
658
- case i1$1.Exclusivities.INACTIVE_SUBSCRIBER:
658
+ case i3.Exclusivities.INACTIVE_SUBSCRIBER:
659
659
  return user.isSubscriber ? false : true;
660
- case i1$1.Exclusivities.NON_SUBSCRIBER:
660
+ case i3.Exclusivities.NON_SUBSCRIBER:
661
661
  return user.isSubscriber ? false : true;
662
662
  }
663
663
  return true;
@@ -701,7 +701,7 @@
701
701
  return [{ type: undefined, decorators: [{
702
702
  type: i0.Inject,
703
703
  args: ['CouponRepository']
704
- }] }, { type: i1__namespace$1.Shops, decorators: [{
704
+ }] }, { type: i3__namespace.Shops, decorators: [{
705
705
  type: i0.Inject,
706
706
  args: [DEFAULT_SHOP]
707
707
  }] }, { type: undefined, decorators: [{
@@ -723,19 +723,19 @@
723
723
  }
724
724
  CheckoutService.prototype.getCheckout = function (checkoutData) {
725
725
  var checkoutId = cookie__default["default"].get('checkoutId');
726
- if (!i1$1.isNil(checkoutId))
726
+ if (!i3.isNil(checkoutId))
727
727
  return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
728
728
  return rxjs.from(this.createCheckout(checkoutData));
729
729
  };
730
730
  CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
731
731
  var _this = this;
732
- return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i1$1.NotFoundError('User is not found'); }); }));
732
+ return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i3.NotFoundError('User is not found'); }); }));
733
733
  };
734
734
  CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
735
- return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
735
+ return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
736
736
  };
737
737
  CheckoutService.prototype.updateCheckoutUser = function (checkout) {
738
- return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
738
+ return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
739
739
  };
740
740
  CheckoutService.prototype.clearCheckoutFromSession = function () {
741
741
  cookie__default["default"].remove('checkoutId');
@@ -755,7 +755,7 @@
755
755
  return this.getCheckout().pipe(operators.concatMap(function (checkout) {
756
756
  var _a;
757
757
  return _this.couponService
758
- .checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email, i1$1.CheckoutTypes.ECOMMERCE, checkout.user.subscriptionPlan, checkout, false)
758
+ .checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email, i3.CheckoutTypes.ECOMMERCE, checkout.user.subscriptionPlan, checkout, false)
759
759
  .pipe();
760
760
  }));
761
761
  };
@@ -764,7 +764,7 @@
764
764
  var checkout;
765
765
  return __generator(this, function (_b) {
766
766
  switch (_b.label) {
767
- case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(i1$1.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
767
+ case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i3.Checkout.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
768
768
  case 1:
769
769
  checkout = _b.sent();
770
770
  cookie__default["default"].set('checkoutId', checkout.id);
@@ -789,24 +789,26 @@
789
789
  }] }, { type: undefined, decorators: [{
790
790
  type: i0.Inject,
791
791
  args: ['UserRepository']
792
- }] }, { type: i1__namespace$1.Shops, decorators: [{
792
+ }] }, { type: i3__namespace.Shops, decorators: [{
793
793
  type: i0.Inject,
794
794
  args: [DEFAULT_SHOP]
795
795
  }] }];
796
796
  } });
797
797
 
798
798
  var CartService = /** @class */ (function () {
799
- function CartService(authService, checkoutService, defaultShop, productRepository) {
799
+ function CartService(authService, checkoutService, defaultShop, productRepository, variantRepository, buy2WinRepository) {
800
800
  var _this = this;
801
801
  this.authService = authService;
802
802
  this.checkoutService = checkoutService;
803
803
  this.defaultShop = defaultShop;
804
804
  this.productRepository = productRepository;
805
+ this.variantRepository = variantRepository;
806
+ this.buy2WinRepository = buy2WinRepository;
805
807
  this.cartSubject = new rxjs.Subject();
806
- this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i1$1.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
808
+ this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i3.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
807
809
  var _a;
808
810
  var items = [];
809
- var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
811
+ var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.id; }).indexOf(lineItem.id);
810
812
  if (index > -1) {
811
813
  checkoutLoaded.lineItems[index].quantity += quantity;
812
814
  checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
@@ -817,28 +819,25 @@
817
819
  .updateCheckoutLineItems(checkoutLoaded)
818
820
  .pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
819
821
  })); };
820
- this.generateCartObject = function (items) {
821
- var cart = {};
822
- items === null || items === void 0 ? void 0 : items.forEach(function (item) {
823
- var _a;
824
- return (cart[item.sku] = i1$1.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.sku] || item)), { quantity: (((_a = cart[item.sku]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })));
825
- });
826
- return cart;
827
- };
822
+ this.generateCartObject = function (items) { return items.reduce(function (cart, item) {
823
+ var _h;
824
+ var _a;
825
+ return (Object.assign(Object.assign({}, cart), (_h = {}, _h[item.id] = i3.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.id] || item)), { quantity: (((_a = cart[item.id]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })), _h)));
826
+ }, {}); };
828
827
  this.buildLineItem = function (_h) {
829
828
  var checkout = _h.checkout, item = _h.item, quantity = _h.quantity;
830
829
  return __awaiter(_this, void 0, void 0, function () {
831
- var _a, _b, _c, _d, _e, _f, _g, product, image, id, name, EAN, brand, slug, stock, price, weight, categories, sku, type, isGift, pricePaid;
830
+ var _a, _b, _c, _d, _e, _f, _g, product, image, id, name, EAN, slug, stock, price, weight, sku, type, isGift, pricePaid;
832
831
  return __generator(this, function (_h) {
833
832
  switch (_h.label) {
834
- case 0: return [4 /*yield*/, this.productRepository.get({ id: item.id })];
833
+ case 0: return [4 /*yield*/, this.getProductData(item.id)];
835
834
  case 1:
836
835
  product = _h.sent();
837
- item.quantity = (item === null || item === void 0 ? void 0 : item.quantity) || ((_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; })) === null || _b === void 0 ? void 0 : _b.quantity) || 0;
836
+ item.quantity = (item === null || item === void 0 ? void 0 : item.quantity) || ((_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.id === item.id; })) === null || _b === void 0 ? void 0 : _b.quantity) || 0;
838
837
  if (this.checkMaxStock(item, quantity || 0))
839
838
  throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
840
839
  image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
841
- id = item.id, name = item.name, EAN = item.EAN, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku, type = item.type;
840
+ id = item.id, name = item.name, EAN = item.EAN, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, sku = item.sku, type = item.type;
842
841
  isGift = item.isGift || null;
843
842
  pricePaid = this.getProductPrice({
844
843
  product: item,
@@ -847,7 +846,7 @@
847
846
  });
848
847
  return [2 /*return*/, {
849
848
  checkout: checkout,
850
- lineItem: i1$1.LineItem.toInstance({
849
+ lineItem: i3.LineItem.toInstance({
851
850
  id: id,
852
851
  name: name !== null && name !== void 0 ? name : product.name,
853
852
  EAN: EAN !== null && EAN !== void 0 ? EAN : product.EAN,
@@ -901,8 +900,8 @@
901
900
  var _this = this;
902
901
  return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
903
902
  var _a;
904
- var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
905
- if (!i1$1.isNil(checkoutItem))
903
+ var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.id === item.id; });
904
+ if (!i3.isNil(checkoutItem))
906
905
  checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
907
906
  return checkout;
908
907
  }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
@@ -921,7 +920,7 @@
921
920
  CartService.prototype.removeItem = function (item) {
922
921
  var _this = this;
923
922
  return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
924
- var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
923
+ var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.id === item.id; });
925
924
  if (index >= 0)
926
925
  checkout.lineItems.splice(index, 1);
927
926
  return checkout;
@@ -929,14 +928,15 @@
929
928
  };
930
929
  CartService.prototype.updateUserCart = function (user) {
931
930
  var _this = this;
932
- return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
931
+ return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i3.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
933
932
  var _a, _b, _h, _j, _k, _l, _m, _o, _p, _q, _r;
934
933
  var _this = this;
935
934
  return __generator(this, function (_s) {
936
935
  switch (_s.label) {
937
936
  case 0:
938
- _j = (_h = this.checkoutService).updateCheckoutLineItems;
939
- _l = (_k = i1$1.Checkout).toInstance;
937
+ _j = (_h = this.checkoutService)
938
+ .updateCheckoutLineItems;
939
+ _l = (_k = i3.Checkout).toInstance;
940
940
  _o = (_m = Object).assign;
941
941
  _p = [Object.assign({}, checkout.toPlain())];
942
942
  _q = {};
@@ -953,7 +953,8 @@
953
953
  case 2:
954
954
  _r = [];
955
955
  _s.label = 3;
956
- case 3: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = _r, _q)]))])]).toPromise()];
956
+ case 3: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = _r, _q)]))])])
957
+ .toPromise()];
957
958
  }
958
959
  });
959
960
  }); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
@@ -969,19 +970,205 @@
969
970
  var _this = this;
970
971
  return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
971
972
  };
973
+ CartService.prototype.getProductData = function (productId) {
974
+ return __awaiter(this, void 0, void 0, function () {
975
+ var product, variant, error_1;
976
+ return __generator(this, function (_h) {
977
+ switch (_h.label) {
978
+ case 0:
979
+ _h.trys.push([0, 2, , 5]);
980
+ return [4 /*yield*/, this.productRepository.get({ id: productId })];
981
+ case 1:
982
+ product = _h.sent();
983
+ return [3 /*break*/, 5];
984
+ case 2:
985
+ error_1 = _h.sent();
986
+ if (!(error_1 instanceof i3.NotFoundError))
987
+ throw error_1;
988
+ return [4 /*yield*/, this.variantRepository.get({ id: productId })];
989
+ case 3:
990
+ variant = _h.sent();
991
+ return [4 /*yield*/, this.productRepository.get({ id: variant.productId })];
992
+ case 4:
993
+ product = _h.sent();
994
+ return [3 /*break*/, 5];
995
+ case 5: return [2 /*return*/, Object.assign(Object.assign({}, product.toPlain()), (variant && Object.assign({}, variant.toPlain())))];
996
+ }
997
+ });
998
+ });
999
+ };
1000
+ CartService.prototype.getGifts = function () {
1001
+ var _this = this;
1002
+ return this.checkoutService.getCheckout().pipe(operators.mergeMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
1003
+ var notGiftItems, cartTotal, campaigns, elegibleCampaigns, _loop_1, campaigns_1, campaigns_1_1, campaign, campaingnProducts, elegibleCampaigns_1, elegibleCampaigns_1_1, campaign, elegibleProducts, _h, _j, product, productData, e_1_1, e_2_1, gifts;
1004
+ var e_3, _k, e_2, _l, e_1, _m;
1005
+ return __generator(this, function (_o) {
1006
+ switch (_o.label) {
1007
+ case 0:
1008
+ notGiftItems = checkout.lineItems.filter(function (item) { return !item.isGift; });
1009
+ if (!notGiftItems.length)
1010
+ return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: [] })];
1011
+ cartTotal = notGiftItems.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
1012
+ return [4 /*yield*/, this.buy2WinRepository
1013
+ .find({
1014
+ filters: {
1015
+ active: { operator: i3.Where.EQUALS, value: true },
1016
+ shop: { operator: i3.Where.EQUALS, value: this.defaultShop },
1017
+ },
1018
+ })
1019
+ .then(function (data) { return data.data; })];
1020
+ case 1:
1021
+ campaigns = _o.sent();
1022
+ if (!campaigns.length)
1023
+ return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
1024
+ elegibleCampaigns = [];
1025
+ _loop_1 = function (campaign) {
1026
+ var today = new Date();
1027
+ if (!(campaign.startDate <= today) && !(campaign.endDate >= today))
1028
+ return "continue";
1029
+ if (campaign.activeCategory) {
1030
+ var categoriesCampaing_1 = campaign.categories.map(function (c) { return c.id; });
1031
+ var filterProductsCategories = checkout.lineItems.filter(function (l) {
1032
+ var _a;
1033
+ if (!l.categories || !((_a = l.categories) === null || _a === void 0 ? void 0 : _a.length))
1034
+ return true;
1035
+ return l.categories.some(function (c) { return categoriesCampaing_1.some(function (cat) { return cat == c; }); });
1036
+ });
1037
+ if (filterProductsCategories.length) {
1038
+ var cartTotalCategories = filterProductsCategories.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
1039
+ if (cartTotalCategories >= campaign.cartValueMin)
1040
+ elegibleCampaigns.push(campaign);
1041
+ }
1042
+ }
1043
+ else {
1044
+ if (campaign.cartValue && campaign.cartValue > 0) {
1045
+ if (campaign.cartValue <= cartTotal)
1046
+ elegibleCampaigns.push(campaign);
1047
+ }
1048
+ }
1049
+ };
1050
+ try {
1051
+ for (campaigns_1 = __values(campaigns), campaigns_1_1 = campaigns_1.next(); !campaigns_1_1.done; campaigns_1_1 = campaigns_1.next()) {
1052
+ campaign = campaigns_1_1.value;
1053
+ _loop_1(campaign);
1054
+ }
1055
+ }
1056
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1057
+ finally {
1058
+ try {
1059
+ if (campaigns_1_1 && !campaigns_1_1.done && (_k = campaigns_1.return)) _k.call(campaigns_1);
1060
+ }
1061
+ finally { if (e_3) throw e_3.error; }
1062
+ }
1063
+ if (!elegibleCampaigns.length)
1064
+ return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
1065
+ campaingnProducts = [];
1066
+ _o.label = 2;
1067
+ case 2:
1068
+ _o.trys.push([2, 14, 15, 16]);
1069
+ elegibleCampaigns_1 = __values(elegibleCampaigns), elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
1070
+ _o.label = 3;
1071
+ case 3:
1072
+ if (!!elegibleCampaigns_1_1.done) return [3 /*break*/, 13];
1073
+ campaign = elegibleCampaigns_1_1.value;
1074
+ elegibleProducts = [];
1075
+ _o.label = 4;
1076
+ case 4:
1077
+ _o.trys.push([4, 9, 10, 11]);
1078
+ _h = (e_1 = void 0, __values(campaign.products)), _j = _h.next();
1079
+ _o.label = 5;
1080
+ case 5:
1081
+ if (!!_j.done) return [3 /*break*/, 8];
1082
+ product = _j.value;
1083
+ return [4 /*yield*/, this.productRepository.find({ filters: { sku: product } })];
1084
+ case 6:
1085
+ productData = (_o.sent()).data;
1086
+ if (!productData.length)
1087
+ return [3 /*break*/, 7];
1088
+ elegibleProducts.push(productData.shift());
1089
+ _o.label = 7;
1090
+ case 7:
1091
+ _j = _h.next();
1092
+ return [3 /*break*/, 5];
1093
+ case 8: return [3 /*break*/, 11];
1094
+ case 9:
1095
+ e_1_1 = _o.sent();
1096
+ e_1 = { error: e_1_1 };
1097
+ return [3 /*break*/, 11];
1098
+ case 10:
1099
+ try {
1100
+ if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
1101
+ }
1102
+ finally { if (e_1) throw e_1.error; }
1103
+ return [7 /*endfinally*/];
1104
+ case 11:
1105
+ campaingnProducts.push(elegibleProducts);
1106
+ _o.label = 12;
1107
+ case 12:
1108
+ elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
1109
+ return [3 /*break*/, 3];
1110
+ case 13: return [3 /*break*/, 16];
1111
+ case 14:
1112
+ e_2_1 = _o.sent();
1113
+ e_2 = { error: e_2_1 };
1114
+ return [3 /*break*/, 16];
1115
+ case 15:
1116
+ try {
1117
+ if (elegibleCampaigns_1_1 && !elegibleCampaigns_1_1.done && (_l = elegibleCampaigns_1.return)) _l.call(elegibleCampaigns_1);
1118
+ }
1119
+ finally { if (e_2) throw e_2.error; }
1120
+ return [7 /*endfinally*/];
1121
+ case 16:
1122
+ if (!campaingnProducts.length)
1123
+ return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
1124
+ gifts = this.giftToLineItems([].concat.apply([], __spreadArray([], __read(campaingnProducts))));
1125
+ return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems.concat(gifts) })];
1126
+ }
1127
+ });
1128
+ }); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
1129
+ };
1130
+ CartService.prototype.giftToLineItems = function (items) {
1131
+ return items.map(function (item) {
1132
+ var _a;
1133
+ var brand = item.brand, categories = item.categories, id = item.id, name = item.name, price = item.price, sku = item.sku, slug = item.slug, stock = item.stock, weight = item.weight, EAN = item.EAN;
1134
+ var image = ((_a = item === null || item === void 0 ? void 0 : item.miniatures) === null || _a === void 0 ? void 0 : _a.length) ? item.miniatures[0] : item.images[0];
1135
+ return i3.LineItem.toInstance({
1136
+ brand: brand,
1137
+ categories: categories,
1138
+ id: id.toString(),
1139
+ name: name,
1140
+ price: price,
1141
+ sku: sku,
1142
+ slug: slug,
1143
+ stock: stock,
1144
+ weight: weight,
1145
+ EAN: EAN,
1146
+ image: image,
1147
+ pricePaid: 0,
1148
+ quantity: 1,
1149
+ isGift: true,
1150
+ });
1151
+ });
1152
+ };
972
1153
  return CartService;
973
1154
  }());
974
- CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1155
+ CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
975
1156
  CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
976
1157
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
977
1158
  type: i0.Injectable
978
1159
  }], ctorParameters: function () {
979
- return [{ type: AuthService }, { type: CheckoutService }, { type: i1__namespace$1.Shops, decorators: [{
1160
+ return [{ type: AuthService }, { type: CheckoutService }, { type: i3__namespace.Shops, decorators: [{
980
1161
  type: i0.Inject,
981
1162
  args: [DEFAULT_SHOP]
982
1163
  }] }, { type: undefined, decorators: [{
983
1164
  type: i0.Inject,
984
1165
  args: ['ProductRepository']
1166
+ }] }, { type: undefined, decorators: [{
1167
+ type: i0.Inject,
1168
+ args: ['VariantRepository']
1169
+ }] }, { type: i3__namespace.Buy2WinFirestoreRepository, decorators: [{
1170
+ type: i0.Inject,
1171
+ args: ['Buy2WinRepository']
985
1172
  }] }];
986
1173
  } });
987
1174
 
@@ -993,7 +1180,7 @@
993
1180
  }
994
1181
  CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
995
1182
  var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
996
- if (!i1$1.isNil(checkoutId))
1183
+ if (!i3.isNil(checkoutId))
997
1184
  return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
998
1185
  return rxjs.from(this.createCheckoutSubscription(checkoutData));
999
1186
  };
@@ -1002,7 +1189,7 @@
1002
1189
  var checkout;
1003
1190
  return __generator(this, function (_a) {
1004
1191
  switch (_a.label) {
1005
- case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i1$1.CheckoutSubscription.toInstance(i1$1.pick(checkoutData, ['user', 'shop'])).toPlain()))];
1192
+ case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i3.CheckoutSubscription.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()))];
1006
1193
  case 1:
1007
1194
  checkout = _a.sent();
1008
1195
  cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
@@ -1018,7 +1205,7 @@
1018
1205
  CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
1019
1206
  var _this = this;
1020
1207
  return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService
1021
- .checkCoupon(nickname, userEmail, i1$1.CheckoutTypes.SUBSCRIPTION, checkout.subscriptionPlan.name, checkout, true)
1208
+ .checkCoupon(nickname, userEmail, i3.CheckoutTypes.SUBSCRIPTION, checkout.subscriptionPlan.name, checkout, true)
1022
1209
  .pipe(); }));
1023
1210
  };
1024
1211
  CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
@@ -1050,8 +1237,8 @@
1050
1237
  this.buildCategoryGroupWithRequiredData = function (group) {
1051
1238
  var _a, _b;
1052
1239
  return ({
1053
- category: i1$1.Category.toInstance(i1$1.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
1054
- products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i1$1.Product.toInstance(i1$1.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
1240
+ category: i3.Category.toInstance(i3.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
1241
+ products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i3.Product.toInstance(i3.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
1055
1242
  'id',
1056
1243
  'price',
1057
1244
  'reviews',
@@ -1072,9 +1259,9 @@
1072
1259
  }
1073
1260
  Object.defineProperty(HomeShopService.prototype, "homeId", {
1074
1261
  get: function () {
1075
- if (this.defaultShop === i1$1.Shops.GLAMSHOP)
1262
+ if (this.defaultShop === i3.Shops.GLAMSHOP)
1076
1263
  return 'glamshop';
1077
- if (this.defaultShop === i1$1.Shops.MENSMARKET)
1264
+ if (this.defaultShop === i3.Shops.MENSMARKET)
1078
1265
  return 'mens_market';
1079
1266
  return null;
1080
1267
  },
@@ -1120,7 +1307,7 @@
1120
1307
  HomeShopService.prototype.getVerticalProducts = function () {
1121
1308
  var _this = this;
1122
1309
  return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
1123
- filters: { categories: { operator: i1$1.Where.IN, value: [category.id] } },
1310
+ filters: { categories: { operator: i3.Where.IN, value: [category.id] } },
1124
1311
  limits: { limit: 12 },
1125
1312
  })).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
1126
1313
  var category = _c.category, products = _c.products;
@@ -1132,14 +1319,14 @@
1132
1319
  return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
1133
1320
  ? rxjs.of(home)
1134
1321
  : !_this.homeId
1135
- ? rxjs.throwError(new i1$1.RequiredArgumentError(['homeId']))
1322
+ ? rxjs.throwError(new i3.RequiredArgumentError(['homeId']))
1136
1323
  : rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
1137
1324
  };
1138
1325
  HomeShopService.prototype.saveHomeData = function (homeData) {
1139
1326
  var _this = this;
1140
1327
  var data = {
1141
1328
  createdAt: new Date(),
1142
- expiresAt: i1$1.add(new Date(), { hours: 1 }),
1329
+ expiresAt: i3.add(new Date(), { hours: 1 }),
1143
1330
  data: homeData,
1144
1331
  };
1145
1332
  return rxjs.from(this.homeRepository.update({
@@ -1163,7 +1350,7 @@
1163
1350
  }] }, { type: undefined, decorators: [{
1164
1351
  type: i0.Inject,
1165
1352
  args: ['ProductRepository']
1166
- }] }, { type: i1__namespace$1.Shops, decorators: [{
1353
+ }] }, { type: i3__namespace.Shops, decorators: [{
1167
1354
  type: i0.Inject,
1168
1355
  args: [DEFAULT_SHOP]
1169
1356
  }] }];
@@ -1180,18 +1367,18 @@
1180
1367
  this.angularFirestore
1181
1368
  .doc(this.orderRepository.collectionName + "/" + id)
1182
1369
  .valueChanges()
1183
- .pipe(operators.map(function (doc) { return i1$1.Order.toInstance(doc); }))
1370
+ .pipe(operators.map(function (doc) { return i3.Order.toInstance(doc); }))
1184
1371
  .subscribe(function (doc) { return _this.orderSubject.next(doc); });
1185
1372
  return this.orderSubject;
1186
1373
  };
1187
1374
  return OrderService;
1188
1375
  }());
1189
- OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$2.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1376
+ OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1190
1377
  OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
1191
1378
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
1192
1379
  type: i0.Injectable
1193
1380
  }], ctorParameters: function () {
1194
- return [{ type: i1__namespace$2.AngularFirestore }, { type: i1__namespace$1.OrderFirestoreRepository, decorators: [{
1381
+ return [{ type: i1__namespace$1.AngularFirestore }, { type: i3__namespace.OrderFirestoreRepository, decorators: [{
1195
1382
  type: i0.Inject,
1196
1383
  args: ['OrderRepository']
1197
1384
  }] }];
@@ -1231,7 +1418,7 @@
1231
1418
  return s;
1232
1419
  });
1233
1420
  }
1234
- if (shop == i1$1.Shops.GLAMSHOP)
1421
+ if (shop == i3.Shops.GLAMSHOP)
1235
1422
  return shippingMethods;
1236
1423
  if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
1237
1424
  shippingMethods = shippingMethods.map(function (s) {
@@ -1252,7 +1439,7 @@
1252
1439
  ShippingService.prototype.isFreeShippingBySubscription = function (shop, subscriptionPlan) {
1253
1440
  if (!subscriptionPlan)
1254
1441
  return false;
1255
- if (shop == i1$1.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
1442
+ if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
1256
1443
  return true;
1257
1444
  }
1258
1445
  return false;
@@ -1260,7 +1447,7 @@
1260
1447
  ShippingService.prototype.isHalfShippingBySubscription = function (shop, subscriptionPlan) {
1261
1448
  if (!subscriptionPlan)
1262
1449
  return false;
1263
- if (shop == i1$1.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
1450
+ if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
1264
1451
  return true;
1265
1452
  }
1266
1453
  return false;
@@ -1279,12 +1466,12 @@
1279
1466
  };
1280
1467
  return ShippingService;
1281
1468
  }());
1282
- ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1469
+ ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$2.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1283
1470
  ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
1284
1471
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
1285
1472
  type: i0.Injectable
1286
1473
  }], ctorParameters: function () {
1287
- return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
1474
+ return [{ type: i1__namespace$2.HttpClient }, { type: undefined, decorators: [{
1288
1475
  type: i0.Inject,
1289
1476
  args: [BACKEND_URL]
1290
1477
  }] }, { type: HomeShopService }];
@@ -1310,42 +1497,42 @@
1310
1497
  {
1311
1498
  provide: 'Authentication',
1312
1499
  useFactory: function (authenticationService, userRepository) {
1313
- return new i1$1.Authentication(authenticationService, userRepository);
1500
+ return new i3.Authentication(authenticationService, userRepository);
1314
1501
  },
1315
1502
  deps: ['AuthenticationService', 'UserRepository'],
1316
1503
  },
1317
1504
  {
1318
1505
  provide: 'AuthenticationService',
1319
1506
  useFactory: function (angularFireAuth) {
1320
- return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
1507
+ return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
1321
1508
  },
1322
1509
  deps: [i1.AngularFireAuth],
1323
1510
  },
1324
1511
  {
1325
1512
  provide: 'Register',
1326
1513
  useFactory: function (registerService, userRepository) {
1327
- return new i1$1.Register(registerService, userRepository);
1514
+ return new i3.Register(registerService, userRepository);
1328
1515
  },
1329
1516
  deps: ['RegisterService', 'UserRepository'],
1330
1517
  },
1331
1518
  {
1332
1519
  provide: 'RegisterService',
1333
1520
  useFactory: function (angularFireAuth) {
1334
- return new i1$1.RegisterFirebaseAuthService(angularFireAuth);
1521
+ return new i3.RegisterFirebaseAuthService(angularFireAuth);
1335
1522
  },
1336
1523
  deps: [i1.AngularFireAuth],
1337
1524
  },
1338
1525
  {
1339
1526
  provide: 'SignOut',
1340
1527
  useFactory: function (authenticationService) {
1341
- return new i1$1.SignOut(authenticationService);
1528
+ return new i3.SignOut(authenticationService);
1342
1529
  },
1343
1530
  deps: ['AuthenticationService'],
1344
1531
  },
1345
1532
  {
1346
1533
  provide: 'RecoveryPassword',
1347
1534
  useFactory: function (authenticationService) {
1348
- return new i1$1.RecoveryPassword(authenticationService);
1535
+ return new i3.RecoveryPassword(authenticationService);
1349
1536
  },
1350
1537
  deps: ['AuthenticationService'],
1351
1538
  },
@@ -1358,42 +1545,42 @@
1358
1545
  {
1359
1546
  provide: 'Authentication',
1360
1547
  useFactory: function (authenticationService, userRepository) {
1361
- return new i1$1.Authentication(authenticationService, userRepository);
1548
+ return new i3.Authentication(authenticationService, userRepository);
1362
1549
  },
1363
1550
  deps: ['AuthenticationService', 'UserRepository'],
1364
1551
  },
1365
1552
  {
1366
1553
  provide: 'AuthenticationService',
1367
1554
  useFactory: function (angularFireAuth) {
1368
- return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
1555
+ return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
1369
1556
  },
1370
1557
  deps: [i1.AngularFireAuth],
1371
1558
  },
1372
1559
  {
1373
1560
  provide: 'Register',
1374
1561
  useFactory: function (registerService, userRepository) {
1375
- return new i1$1.Register(registerService, userRepository);
1562
+ return new i3.Register(registerService, userRepository);
1376
1563
  },
1377
1564
  deps: ['RegisterService', 'UserRepository'],
1378
1565
  },
1379
1566
  {
1380
1567
  provide: 'RegisterService',
1381
1568
  useFactory: function (angularFireAuth) {
1382
- return new i1$1.RegisterFirebaseAuthService(angularFireAuth);
1569
+ return new i3.RegisterFirebaseAuthService(angularFireAuth);
1383
1570
  },
1384
1571
  deps: [i1.AngularFireAuth],
1385
1572
  },
1386
1573
  {
1387
1574
  provide: 'SignOut',
1388
1575
  useFactory: function (authenticationService) {
1389
- return new i1$1.SignOut(authenticationService);
1576
+ return new i3.SignOut(authenticationService);
1390
1577
  },
1391
1578
  deps: ['AuthenticationService'],
1392
1579
  },
1393
1580
  {
1394
1581
  provide: 'RecoveryPassword',
1395
1582
  useFactory: function (authenticationService) {
1396
- return new i1$1.RecoveryPassword(authenticationService);
1583
+ return new i3.RecoveryPassword(authenticationService);
1397
1584
  },
1398
1585
  deps: ['AuthenticationService'],
1399
1586
  },
@@ -1416,10 +1603,8 @@
1416
1603
  AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
1417
1604
  AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
1418
1605
  {
1419
- provide: i1$1.ProductsIndex,
1420
- useFactory: function (configuration) {
1421
- return new i1$1.ProductsIndex(new i1$1.AxiosAdapter(configuration));
1422
- },
1606
+ provide: i3.ProductsIndex,
1607
+ useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
1423
1608
  deps: [ES_CONFIG],
1424
1609
  },
1425
1610
  ] });
@@ -1428,10 +1613,8 @@
1428
1613
  args: [{
1429
1614
  providers: [
1430
1615
  {
1431
- provide: i1$1.ProductsIndex,
1432
- useFactory: function (configuration) {
1433
- return new i1$1.ProductsIndex(new i1$1.AxiosAdapter(configuration));
1434
- },
1616
+ provide: i3.ProductsIndex,
1617
+ useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
1435
1618
  deps: [ES_CONFIG],
1436
1619
  },
1437
1620
  ],
@@ -1459,182 +1642,182 @@
1459
1642
  {
1460
1643
  provide: 'BeautyProfileRepository',
1461
1644
  useFactory: function (firestore, userRepository) {
1462
- return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1645
+ return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1463
1646
  },
1464
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1647
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1465
1648
  },
1466
1649
  {
1467
1650
  provide: 'Buy2WinRepository',
1468
1651
  useFactory: function (firestore) {
1469
- return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
1652
+ return new i3.Buy2WinFirestoreRepository(firestore.firestore);
1470
1653
  },
1471
- deps: [i1$2.AngularFirestore],
1654
+ deps: [i1$1.AngularFirestore],
1472
1655
  },
1473
1656
  {
1474
- provide: i1$1.CategoryFirestoreRepository,
1657
+ provide: i3.CategoryFirestoreRepository,
1475
1658
  useFactory: function (firestore) {
1476
- return new i1$1.CategoryFirestoreRepository(firestore.firestore);
1659
+ return new i3.CategoryFirestoreRepository(firestore.firestore);
1477
1660
  },
1478
- deps: [i1$2.AngularFirestore],
1661
+ deps: [i1$1.AngularFirestore],
1479
1662
  },
1480
1663
  {
1481
1664
  provide: 'CheckoutRepository',
1482
1665
  useFactory: function (firestore) {
1483
- return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
1666
+ return new i3.CheckoutFirestoreRepository(firestore.firestore);
1484
1667
  },
1485
- deps: [i1$2.AngularFirestore],
1668
+ deps: [i1$1.AngularFirestore],
1486
1669
  },
1487
1670
  {
1488
1671
  provide: 'CheckoutSubscriptionRepository',
1489
1672
  useFactory: function (firestore) {
1490
- return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1673
+ return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1491
1674
  },
1492
- deps: [i1$2.AngularFirestore],
1675
+ deps: [i1$1.AngularFirestore],
1493
1676
  },
1494
1677
  {
1495
1678
  provide: 'CouponRepository',
1496
1679
  useFactory: function (firestore) {
1497
- return new i1$1.CouponFirestoreRepository(firestore.firestore);
1680
+ return new i3.CouponFirestoreRepository(firestore.firestore);
1498
1681
  },
1499
- deps: [i1$2.AngularFirestore],
1682
+ deps: [i1$1.AngularFirestore],
1500
1683
  },
1501
1684
  {
1502
1685
  provide: 'CampaignHashtagRepository',
1503
1686
  useFactory: function (firestore) {
1504
- return new i1$1.CampaignHashtagFirestoreRepository(firestore.firestore);
1687
+ return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
1505
1688
  },
1506
- deps: [i1$2.AngularFirestore],
1689
+ deps: [i1$1.AngularFirestore],
1507
1690
  },
1508
1691
  {
1509
1692
  provide: 'CampaignDashboardRepository',
1510
1693
  useFactory: function (firestore) {
1511
- return new i1$1.CampaignDashboardFirestoreRepository(firestore.firestore);
1694
+ return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
1512
1695
  },
1513
- deps: [i1$2.AngularFirestore],
1696
+ deps: [i1$1.AngularFirestore],
1514
1697
  },
1515
1698
  {
1516
1699
  provide: 'EditionRepository',
1517
1700
  useFactory: function (firestore, subscriptionRepository) {
1518
- return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1701
+ return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1519
1702
  },
1520
- deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
1703
+ deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1521
1704
  },
1522
1705
  {
1523
1706
  provide: 'HomeRepository',
1524
1707
  useFactory: function (firestore) {
1525
- return new i1$1.HomeFirestoreRepository(firestore.firestore);
1708
+ return new i3.HomeFirestoreRepository(firestore.firestore);
1526
1709
  },
1527
- deps: [i1$2.AngularFirestore],
1710
+ deps: [i1$1.AngularFirestore],
1528
1711
  },
1529
1712
  {
1530
1713
  provide: 'LeadRepository',
1531
1714
  useFactory: function (firestore) {
1532
- return new i1$1.LeadFirestoreRepository(firestore.firestore);
1715
+ return new i3.LeadFirestoreRepository(firestore.firestore);
1533
1716
  },
1534
- deps: [i1$2.AngularFirestore],
1717
+ deps: [i1$1.AngularFirestore],
1535
1718
  },
1536
1719
  {
1537
1720
  provide: 'LegacyOrderRepository',
1538
1721
  useFactory: function (firestore) {
1539
- return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
1722
+ return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
1540
1723
  },
1541
- deps: [i1$2.AngularFirestore],
1724
+ deps: [i1$1.AngularFirestore],
1542
1725
  },
1543
1726
  {
1544
1727
  provide: 'ShopMenuRepository',
1545
1728
  useFactory: function (firestore) {
1546
- return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
1729
+ return new i3.ShopMenuFirestoreRepository(firestore.firestore);
1547
1730
  },
1548
- deps: [i1$2.AngularFirestore],
1731
+ deps: [i1$1.AngularFirestore],
1549
1732
  },
1550
1733
  {
1551
1734
  provide: 'OrderRepository',
1552
1735
  useFactory: function (firestore) {
1553
- return new i1$1.OrderFirestoreRepository(firestore.firestore);
1736
+ return new i3.OrderFirestoreRepository(firestore.firestore);
1554
1737
  },
1555
- deps: [i1$2.AngularFirestore],
1738
+ deps: [i1$1.AngularFirestore],
1556
1739
  },
1557
1740
  {
1558
1741
  provide: 'PaymentRepository',
1559
1742
  useFactory: function (firestore) {
1560
- return new i1$1.PaymentFirestoreRepository(firestore.firestore);
1743
+ return new i3.PaymentFirestoreRepository(firestore.firestore);
1561
1744
  },
1562
- deps: [i1$2.AngularFirestore],
1745
+ deps: [i1$1.AngularFirestore],
1563
1746
  },
1564
1747
  {
1565
- provide: i1$1.ProductFirestoreRepository,
1748
+ provide: i3.ProductFirestoreRepository,
1566
1749
  useFactory: function (firestore) {
1567
- return new i1$1.ProductFirestoreRepository(firestore.firestore);
1750
+ return new i3.ProductFirestoreRepository(firestore.firestore);
1568
1751
  },
1569
- deps: [i1$2.AngularFirestore],
1752
+ deps: [i1$1.AngularFirestore],
1570
1753
  },
1571
1754
  {
1572
1755
  provide: 'ShopSettingsRepository',
1573
1756
  useFactory: function (firestore) {
1574
- return new i1$1.ShopSettingsFirestoreRepository(firestore.firestore);
1757
+ return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
1575
1758
  },
1576
- deps: [i1$2.AngularFirestore],
1759
+ deps: [i1$1.AngularFirestore],
1577
1760
  },
1578
1761
  {
1579
1762
  provide: 'SubscriptionPaymentRepository',
1580
1763
  useFactory: function (firestore, subscriptionRepository) {
1581
- return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1764
+ return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1582
1765
  },
1583
- deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
1766
+ deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1584
1767
  },
1585
1768
  {
1586
1769
  provide: 'SubscriptionPlanRepository',
1587
1770
  useFactory: function (firestore) {
1588
- return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
1771
+ return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
1589
1772
  },
1590
- deps: [i1$2.AngularFirestore],
1773
+ deps: [i1$1.AngularFirestore],
1591
1774
  },
1592
1775
  {
1593
1776
  provide: 'SubscriptionProductRepository',
1594
1777
  useFactory: function (firestore) {
1595
- return new i1$1.SubscriptionProductFirestoreRepository(firestore.firestore);
1778
+ return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
1596
1779
  },
1597
- deps: [i1$2.AngularFirestore],
1780
+ deps: [i1$1.AngularFirestore],
1598
1781
  },
1599
1782
  {
1600
1783
  provide: 'SubscriptionRepository',
1601
1784
  useFactory: function (firestore) {
1602
- return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
1785
+ return new i3.SubscriptionFirestoreRepository(firestore.firestore);
1603
1786
  },
1604
- deps: [i1$2.AngularFirestore],
1787
+ deps: [i1$1.AngularFirestore],
1605
1788
  },
1606
1789
  {
1607
1790
  provide: 'UserRepository',
1608
1791
  useFactory: function (firestore) {
1609
- return new i1$1.UserFirestoreRepository(firestore.firestore);
1792
+ return new i3.UserFirestoreRepository(firestore.firestore);
1610
1793
  },
1611
- deps: [i1$2.AngularFirestore],
1794
+ deps: [i1$1.AngularFirestore],
1612
1795
  },
1613
1796
  {
1614
1797
  provide: 'UserAddressRepository',
1615
1798
  useFactory: function (firestore, userRepository) {
1616
- return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1799
+ return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1617
1800
  },
1618
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1801
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1619
1802
  },
1620
1803
  {
1621
1804
  provide: 'UserPaymentMethodRepository',
1622
1805
  useFactory: function (firestore, userRepository) {
1623
- return new i1$1.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1806
+ return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1624
1807
  },
1625
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1808
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1626
1809
  },
1627
1810
  {
1628
- provide: i1$1.ProductVariantFirestoreRepository,
1811
+ provide: i3.ProductVariantFirestoreRepository,
1629
1812
  useFactory: function (firestore, productRepository) {
1630
- return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
1813
+ return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
1631
1814
  },
1632
- deps: [i1$2.AngularFirestore, i1$1.ProductFirestoreRepository],
1815
+ deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
1633
1816
  },
1634
1817
  {
1635
1818
  provide: i0.APP_INITIALIZER,
1636
1819
  useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
1637
- deps: [i1$2.AngularFirestore],
1820
+ deps: [i1$1.AngularFirestore],
1638
1821
  multi: true,
1639
1822
  },
1640
1823
  ], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
@@ -1646,182 +1829,182 @@
1646
1829
  {
1647
1830
  provide: 'BeautyProfileRepository',
1648
1831
  useFactory: function (firestore, userRepository) {
1649
- return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1832
+ return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1650
1833
  },
1651
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1834
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1652
1835
  },
1653
1836
  {
1654
1837
  provide: 'Buy2WinRepository',
1655
1838
  useFactory: function (firestore) {
1656
- return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
1839
+ return new i3.Buy2WinFirestoreRepository(firestore.firestore);
1657
1840
  },
1658
- deps: [i1$2.AngularFirestore],
1841
+ deps: [i1$1.AngularFirestore],
1659
1842
  },
1660
1843
  {
1661
- provide: i1$1.CategoryFirestoreRepository,
1844
+ provide: i3.CategoryFirestoreRepository,
1662
1845
  useFactory: function (firestore) {
1663
- return new i1$1.CategoryFirestoreRepository(firestore.firestore);
1846
+ return new i3.CategoryFirestoreRepository(firestore.firestore);
1664
1847
  },
1665
- deps: [i1$2.AngularFirestore],
1848
+ deps: [i1$1.AngularFirestore],
1666
1849
  },
1667
1850
  {
1668
1851
  provide: 'CheckoutRepository',
1669
1852
  useFactory: function (firestore) {
1670
- return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
1853
+ return new i3.CheckoutFirestoreRepository(firestore.firestore);
1671
1854
  },
1672
- deps: [i1$2.AngularFirestore],
1855
+ deps: [i1$1.AngularFirestore],
1673
1856
  },
1674
1857
  {
1675
1858
  provide: 'CheckoutSubscriptionRepository',
1676
1859
  useFactory: function (firestore) {
1677
- return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1860
+ return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1678
1861
  },
1679
- deps: [i1$2.AngularFirestore],
1862
+ deps: [i1$1.AngularFirestore],
1680
1863
  },
1681
1864
  {
1682
1865
  provide: 'CouponRepository',
1683
1866
  useFactory: function (firestore) {
1684
- return new i1$1.CouponFirestoreRepository(firestore.firestore);
1867
+ return new i3.CouponFirestoreRepository(firestore.firestore);
1685
1868
  },
1686
- deps: [i1$2.AngularFirestore],
1869
+ deps: [i1$1.AngularFirestore],
1687
1870
  },
1688
1871
  {
1689
1872
  provide: 'CampaignHashtagRepository',
1690
1873
  useFactory: function (firestore) {
1691
- return new i1$1.CampaignHashtagFirestoreRepository(firestore.firestore);
1874
+ return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
1692
1875
  },
1693
- deps: [i1$2.AngularFirestore],
1876
+ deps: [i1$1.AngularFirestore],
1694
1877
  },
1695
1878
  {
1696
1879
  provide: 'CampaignDashboardRepository',
1697
1880
  useFactory: function (firestore) {
1698
- return new i1$1.CampaignDashboardFirestoreRepository(firestore.firestore);
1881
+ return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
1699
1882
  },
1700
- deps: [i1$2.AngularFirestore],
1883
+ deps: [i1$1.AngularFirestore],
1701
1884
  },
1702
1885
  {
1703
1886
  provide: 'EditionRepository',
1704
1887
  useFactory: function (firestore, subscriptionRepository) {
1705
- return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1888
+ return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1706
1889
  },
1707
- deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
1890
+ deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1708
1891
  },
1709
1892
  {
1710
1893
  provide: 'HomeRepository',
1711
1894
  useFactory: function (firestore) {
1712
- return new i1$1.HomeFirestoreRepository(firestore.firestore);
1895
+ return new i3.HomeFirestoreRepository(firestore.firestore);
1713
1896
  },
1714
- deps: [i1$2.AngularFirestore],
1897
+ deps: [i1$1.AngularFirestore],
1715
1898
  },
1716
1899
  {
1717
1900
  provide: 'LeadRepository',
1718
1901
  useFactory: function (firestore) {
1719
- return new i1$1.LeadFirestoreRepository(firestore.firestore);
1902
+ return new i3.LeadFirestoreRepository(firestore.firestore);
1720
1903
  },
1721
- deps: [i1$2.AngularFirestore],
1904
+ deps: [i1$1.AngularFirestore],
1722
1905
  },
1723
1906
  {
1724
1907
  provide: 'LegacyOrderRepository',
1725
1908
  useFactory: function (firestore) {
1726
- return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
1909
+ return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
1727
1910
  },
1728
- deps: [i1$2.AngularFirestore],
1911
+ deps: [i1$1.AngularFirestore],
1729
1912
  },
1730
1913
  {
1731
1914
  provide: 'ShopMenuRepository',
1732
1915
  useFactory: function (firestore) {
1733
- return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
1916
+ return new i3.ShopMenuFirestoreRepository(firestore.firestore);
1734
1917
  },
1735
- deps: [i1$2.AngularFirestore],
1918
+ deps: [i1$1.AngularFirestore],
1736
1919
  },
1737
1920
  {
1738
1921
  provide: 'OrderRepository',
1739
1922
  useFactory: function (firestore) {
1740
- return new i1$1.OrderFirestoreRepository(firestore.firestore);
1923
+ return new i3.OrderFirestoreRepository(firestore.firestore);
1741
1924
  },
1742
- deps: [i1$2.AngularFirestore],
1925
+ deps: [i1$1.AngularFirestore],
1743
1926
  },
1744
1927
  {
1745
1928
  provide: 'PaymentRepository',
1746
1929
  useFactory: function (firestore) {
1747
- return new i1$1.PaymentFirestoreRepository(firestore.firestore);
1930
+ return new i3.PaymentFirestoreRepository(firestore.firestore);
1748
1931
  },
1749
- deps: [i1$2.AngularFirestore],
1932
+ deps: [i1$1.AngularFirestore],
1750
1933
  },
1751
1934
  {
1752
- provide: i1$1.ProductFirestoreRepository,
1935
+ provide: i3.ProductFirestoreRepository,
1753
1936
  useFactory: function (firestore) {
1754
- return new i1$1.ProductFirestoreRepository(firestore.firestore);
1937
+ return new i3.ProductFirestoreRepository(firestore.firestore);
1755
1938
  },
1756
- deps: [i1$2.AngularFirestore],
1939
+ deps: [i1$1.AngularFirestore],
1757
1940
  },
1758
1941
  {
1759
1942
  provide: 'ShopSettingsRepository',
1760
1943
  useFactory: function (firestore) {
1761
- return new i1$1.ShopSettingsFirestoreRepository(firestore.firestore);
1944
+ return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
1762
1945
  },
1763
- deps: [i1$2.AngularFirestore],
1946
+ deps: [i1$1.AngularFirestore],
1764
1947
  },
1765
1948
  {
1766
1949
  provide: 'SubscriptionPaymentRepository',
1767
1950
  useFactory: function (firestore, subscriptionRepository) {
1768
- return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1951
+ return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1769
1952
  },
1770
- deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
1953
+ deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1771
1954
  },
1772
1955
  {
1773
1956
  provide: 'SubscriptionPlanRepository',
1774
1957
  useFactory: function (firestore) {
1775
- return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
1958
+ return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
1776
1959
  },
1777
- deps: [i1$2.AngularFirestore],
1960
+ deps: [i1$1.AngularFirestore],
1778
1961
  },
1779
1962
  {
1780
1963
  provide: 'SubscriptionProductRepository',
1781
1964
  useFactory: function (firestore) {
1782
- return new i1$1.SubscriptionProductFirestoreRepository(firestore.firestore);
1965
+ return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
1783
1966
  },
1784
- deps: [i1$2.AngularFirestore],
1967
+ deps: [i1$1.AngularFirestore],
1785
1968
  },
1786
1969
  {
1787
1970
  provide: 'SubscriptionRepository',
1788
1971
  useFactory: function (firestore) {
1789
- return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
1972
+ return new i3.SubscriptionFirestoreRepository(firestore.firestore);
1790
1973
  },
1791
- deps: [i1$2.AngularFirestore],
1974
+ deps: [i1$1.AngularFirestore],
1792
1975
  },
1793
1976
  {
1794
1977
  provide: 'UserRepository',
1795
1978
  useFactory: function (firestore) {
1796
- return new i1$1.UserFirestoreRepository(firestore.firestore);
1979
+ return new i3.UserFirestoreRepository(firestore.firestore);
1797
1980
  },
1798
- deps: [i1$2.AngularFirestore],
1981
+ deps: [i1$1.AngularFirestore],
1799
1982
  },
1800
1983
  {
1801
1984
  provide: 'UserAddressRepository',
1802
1985
  useFactory: function (firestore, userRepository) {
1803
- return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1986
+ return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1804
1987
  },
1805
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1988
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1806
1989
  },
1807
1990
  {
1808
1991
  provide: 'UserPaymentMethodRepository',
1809
1992
  useFactory: function (firestore, userRepository) {
1810
- return new i1$1.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1993
+ return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1811
1994
  },
1812
- deps: [i1$2.AngularFirestore, 'UserRepository'],
1995
+ deps: [i1$1.AngularFirestore, 'UserRepository'],
1813
1996
  },
1814
1997
  {
1815
- provide: i1$1.ProductVariantFirestoreRepository,
1998
+ provide: i3.ProductVariantFirestoreRepository,
1816
1999
  useFactory: function (firestore, productRepository) {
1817
- return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
2000
+ return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
1818
2001
  },
1819
- deps: [i1$2.AngularFirestore, i1$1.ProductFirestoreRepository],
2002
+ deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
1820
2003
  },
1821
2004
  {
1822
2005
  provide: i0.APP_INITIALIZER,
1823
2006
  useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
1824
- deps: [i1$2.AngularFirestore],
2007
+ deps: [i1$1.AngularFirestore],
1825
2008
  multi: true,
1826
2009
  },
1827
2010
  ],
@@ -1844,69 +2027,69 @@
1844
2027
  AngularHasuraGraphQLModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, providers: [
1845
2028
  {
1846
2029
  provide: 'CategoryRepository',
1847
- useExisting: i1$1.CategoryHasuraGraphQLRepository,
2030
+ useExisting: i3.CategoryHasuraGraphQLRepository,
1848
2031
  },
1849
2032
  {
1850
- provide: i1$1.CategoryHasuraGraphQLRepository,
2033
+ provide: i3.CategoryHasuraGraphQLRepository,
1851
2034
  useFactory: function (options, productRepository, categoryFilterRepository) {
1852
- return new i1$1.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
2035
+ return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
1853
2036
  },
1854
- deps: [HASURA_OPTIONS, i1$1.ProductHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
2037
+ deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
1855
2038
  },
1856
2039
  {
1857
2040
  provide: 'ProductRepository',
1858
- useExisting: i1$1.ProductHasuraGraphQLRepository,
2041
+ useExisting: i3.ProductHasuraGraphQLRepository,
1859
2042
  },
1860
2043
  {
1861
- provide: i1$1.ProductHasuraGraphQLRepository,
2044
+ provide: i3.ProductHasuraGraphQLRepository,
1862
2045
  useFactory: function (options) {
1863
- return new i1$1.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
2046
+ return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
1864
2047
  },
1865
2048
  deps: [HASURA_OPTIONS],
1866
2049
  },
1867
2050
  {
1868
2051
  provide: 'VariantRepository',
1869
- useExisting: i1$1.VariantHasuraGraphQLRepository,
2052
+ useExisting: i3.VariantHasuraGraphQLRepository,
1870
2053
  },
1871
2054
  {
1872
- provide: i1$1.VariantHasuraGraphQLRepository,
2055
+ provide: i3.VariantHasuraGraphQLRepository,
1873
2056
  useFactory: function (options) {
1874
- return new i1$1.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
2057
+ return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
1875
2058
  },
1876
2059
  deps: [HASURA_OPTIONS],
1877
2060
  },
1878
2061
  {
1879
2062
  provide: 'CategoryFilterRepository',
1880
- useExisting: i1$1.CategoryFilterHasuraGraphQLRepository,
2063
+ useExisting: i3.CategoryFilterHasuraGraphQLRepository,
1881
2064
  },
1882
2065
  {
1883
- provide: i1$1.CategoryFilterHasuraGraphQLRepository,
2066
+ provide: i3.CategoryFilterHasuraGraphQLRepository,
1884
2067
  useFactory: function (options) {
1885
- return new i1$1.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
2068
+ return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
1886
2069
  },
1887
2070
  deps: [HASURA_OPTIONS],
1888
2071
  },
1889
2072
  {
1890
2073
  provide: 'FilterOptionRepository',
1891
- useExisting: i1$1.FilterOptionHasuraGraphQLRepository,
2074
+ useExisting: i3.FilterOptionHasuraGraphQLRepository,
1892
2075
  },
1893
2076
  {
1894
- provide: i1$1.FilterOptionHasuraGraphQLRepository,
2077
+ provide: i3.FilterOptionHasuraGraphQLRepository,
1895
2078
  useFactory: function (options) {
1896
- return new i1$1.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
2079
+ return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
1897
2080
  },
1898
2081
  deps: [HASURA_OPTIONS],
1899
2082
  },
1900
2083
  {
1901
2084
  provide: 'FilterRepository',
1902
- useExisting: i1$1.FilterHasuraGraphQLRepository,
2085
+ useExisting: i3.FilterHasuraGraphQLRepository,
1903
2086
  },
1904
2087
  {
1905
- provide: i1$1.FilterHasuraGraphQLRepository,
2088
+ provide: i3.FilterHasuraGraphQLRepository,
1906
2089
  useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
1907
- return new i1$1.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
2090
+ return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
1908
2091
  },
1909
- deps: [HASURA_OPTIONS, i1$1.FilterOptionHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
2092
+ deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
1910
2093
  },
1911
2094
  ] });
1912
2095
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, decorators: [{
@@ -1915,69 +2098,69 @@
1915
2098
  providers: [
1916
2099
  {
1917
2100
  provide: 'CategoryRepository',
1918
- useExisting: i1$1.CategoryHasuraGraphQLRepository,
2101
+ useExisting: i3.CategoryHasuraGraphQLRepository,
1919
2102
  },
1920
2103
  {
1921
- provide: i1$1.CategoryHasuraGraphQLRepository,
2104
+ provide: i3.CategoryHasuraGraphQLRepository,
1922
2105
  useFactory: function (options, productRepository, categoryFilterRepository) {
1923
- return new i1$1.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
2106
+ return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
1924
2107
  },
1925
- deps: [HASURA_OPTIONS, i1$1.ProductHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
2108
+ deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
1926
2109
  },
1927
2110
  {
1928
2111
  provide: 'ProductRepository',
1929
- useExisting: i1$1.ProductHasuraGraphQLRepository,
2112
+ useExisting: i3.ProductHasuraGraphQLRepository,
1930
2113
  },
1931
2114
  {
1932
- provide: i1$1.ProductHasuraGraphQLRepository,
2115
+ provide: i3.ProductHasuraGraphQLRepository,
1933
2116
  useFactory: function (options) {
1934
- return new i1$1.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
2117
+ return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
1935
2118
  },
1936
2119
  deps: [HASURA_OPTIONS],
1937
2120
  },
1938
2121
  {
1939
2122
  provide: 'VariantRepository',
1940
- useExisting: i1$1.VariantHasuraGraphQLRepository,
2123
+ useExisting: i3.VariantHasuraGraphQLRepository,
1941
2124
  },
1942
2125
  {
1943
- provide: i1$1.VariantHasuraGraphQLRepository,
2126
+ provide: i3.VariantHasuraGraphQLRepository,
1944
2127
  useFactory: function (options) {
1945
- return new i1$1.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
2128
+ return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
1946
2129
  },
1947
2130
  deps: [HASURA_OPTIONS],
1948
2131
  },
1949
2132
  {
1950
2133
  provide: 'CategoryFilterRepository',
1951
- useExisting: i1$1.CategoryFilterHasuraGraphQLRepository,
2134
+ useExisting: i3.CategoryFilterHasuraGraphQLRepository,
1952
2135
  },
1953
2136
  {
1954
- provide: i1$1.CategoryFilterHasuraGraphQLRepository,
2137
+ provide: i3.CategoryFilterHasuraGraphQLRepository,
1955
2138
  useFactory: function (options) {
1956
- return new i1$1.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
2139
+ return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
1957
2140
  },
1958
2141
  deps: [HASURA_OPTIONS],
1959
2142
  },
1960
2143
  {
1961
2144
  provide: 'FilterOptionRepository',
1962
- useExisting: i1$1.FilterOptionHasuraGraphQLRepository,
2145
+ useExisting: i3.FilterOptionHasuraGraphQLRepository,
1963
2146
  },
1964
2147
  {
1965
- provide: i1$1.FilterOptionHasuraGraphQLRepository,
2148
+ provide: i3.FilterOptionHasuraGraphQLRepository,
1966
2149
  useFactory: function (options) {
1967
- return new i1$1.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
2150
+ return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
1968
2151
  },
1969
2152
  deps: [HASURA_OPTIONS],
1970
2153
  },
1971
2154
  {
1972
2155
  provide: 'FilterRepository',
1973
- useExisting: i1$1.FilterHasuraGraphQLRepository,
2156
+ useExisting: i3.FilterHasuraGraphQLRepository,
1974
2157
  },
1975
2158
  {
1976
- provide: i1$1.FilterHasuraGraphQLRepository,
2159
+ provide: i3.FilterHasuraGraphQLRepository,
1977
2160
  useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
1978
- return new i1$1.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
2161
+ return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
1979
2162
  },
1980
- deps: [HASURA_OPTIONS, i1$1.FilterOptionHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
2163
+ deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
1981
2164
  },
1982
2165
  ],
1983
2166
  }]
@@ -1989,7 +2172,7 @@
1989
2172
  AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
1990
2173
  return {
1991
2174
  ngModule: AngularConnectModule,
1992
- providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i1$1.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
2175
+ providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i3.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
1993
2176
  };
1994
2177
  };
1995
2178
  return AngularConnectModule;