@infrab4a/connect-angular 4.2.11-beta.9 → 4.3.0-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.
Files changed (51) hide show
  1. package/esm2022/angular-connect.module.mjs +5 -5
  2. package/esm2022/angular-elastic-search.module.mjs +5 -5
  3. package/esm2022/angular-firebase-auth.module.mjs +5 -5
  4. package/esm2022/angular-firestore.module.mjs +5 -5
  5. package/esm2022/angular-hasura-graphql.module.mjs +5 -5
  6. package/esm2022/consts/category-structure.mjs +1 -1
  7. package/esm2022/consts/default-shop.const.mjs +1 -1
  8. package/esm2022/consts/es-config.const.mjs +1 -1
  9. package/esm2022/consts/firebase-const.mjs +1 -1
  10. package/esm2022/consts/hasura-options.const.mjs +1 -1
  11. package/esm2022/consts/index.mjs +1 -1
  12. package/esm2022/helpers/index.mjs +1 -1
  13. package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
  14. package/esm2022/index.mjs +1 -1
  15. package/esm2022/services/auth.service.mjs +6 -6
  16. package/esm2022/services/cart.service.mjs +8 -8
  17. package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
  18. package/esm2022/services/catalog/adapters/index.mjs +1 -1
  19. package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +6 -6
  20. package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +6 -6
  21. package/esm2022/services/catalog/catalog.service.mjs +11 -29
  22. package/esm2022/services/catalog/category.service.mjs +6 -6
  23. package/esm2022/services/catalog/enums/index.mjs +1 -1
  24. package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
  25. package/esm2022/services/catalog/index.mjs +1 -2
  26. package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
  27. package/esm2022/services/catalog/models/index.mjs +1 -1
  28. package/esm2022/services/catalog/types/index.mjs +1 -1
  29. package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
  30. package/esm2022/services/catalog/wishlist.service.mjs +12 -21
  31. package/esm2022/services/checkout-subscription.service.mjs +6 -6
  32. package/esm2022/services/checkout.service.mjs +6 -6
  33. package/esm2022/services/coupon.service.mjs +6 -6
  34. package/esm2022/services/helpers/index.mjs +1 -1
  35. package/esm2022/services/helpers/util.helper.mjs +1 -1
  36. package/esm2022/services/home-shop.service.mjs +14 -25
  37. package/esm2022/services/index.mjs +1 -1
  38. package/esm2022/services/order.service.mjs +6 -6
  39. package/esm2022/services/shipping.service.mjs +6 -6
  40. package/esm2022/services/types/index.mjs +1 -1
  41. package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
  42. package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
  43. package/esm2022/services/types/shipping-methods.type.mjs +1 -1
  44. package/esm2022/types/firebase-app-config.type.mjs +1 -1
  45. package/esm2022/types/index.mjs +1 -1
  46. package/fesm2022/infrab4a-connect-angular.mjs +159 -197
  47. package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
  48. package/package.json +5 -6
  49. package/services/catalog/index.d.ts +0 -1
  50. package/services/catalog/wishlist.service.d.ts +4 -21
  51. package/services/home-shop.service.d.ts +0 -1
@@ -1,18 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgModule, InjectionToken, PLATFORM_ID, Injectable, Inject } from '@angular/core';
3
3
  import * as i1$4 from '@angular/fire/app';
4
- import { FirebaseApp, getApp, initializeApp, provideFirebaseApp } from '@angular/fire/app';
4
+ import { FirebaseApp, provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
5
5
  import * as i1$2 from '@infrab4a/connect';
6
- import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, Wishlist, CheckoutSubscription, Product, RequiredArgumentError, add, Order } from '@infrab4a/connect';
6
+ import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, isNil, NotFoundError, Checkout, pick, LineItem, RoundProductPricesHelper, set, InvalidArgumentError, Category, CheckoutSubscription, Product, RequiredArgumentError, add, Order } from '@infrab4a/connect';
7
7
  import * as i1 from '@angular/fire/auth';
8
- import { Auth, getAuth, provideAuth, getIdToken, authState } from '@angular/fire/auth';
8
+ import { Auth, provideAuth, getAuth, getIdToken, authState } from '@angular/fire/auth';
9
9
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
10
10
  import * as i1$1 from '@angular/fire/firestore';
11
- import { Firestore, getFirestore, memoryLocalCache, initializeFirestore, provideFirestore, doc, docSnapshots } from '@angular/fire/firestore';
12
- import { combineLatest, of, from, throwError, Subject, iif, forkJoin } from 'rxjs';
13
- import { map, catchError, mergeMap, concatMap, tap } from 'rxjs/operators';
11
+ import { Firestore, provideFirestore, getFirestore, initializeFirestore, memoryLocalCache, docSnapshots, doc } from '@angular/fire/firestore';
12
+ import { combineLatest, from, of, throwError, Subject, iif, forkJoin } from 'rxjs';
13
+ import { map, mergeMap, catchError, concatMap, tap } from 'rxjs/operators';
14
14
  import cookie from 'js-cookie';
15
- import { __metadata, __decorate } from 'tslib';
15
+ import { __decorate, __metadata } from 'tslib';
16
16
  import { Type } from 'class-transformer';
17
17
  import * as i1$3 from '@angular/common/http';
18
18
 
@@ -25,9 +25,9 @@ class AngularElasticSeachModule {
25
25
  providers: [{ provide: ES_CONFIG, useValue: options }],
26
26
  };
27
27
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
29
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule }); }
30
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule, providers: [
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularElasticSeachModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
29
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.6", ngImport: i0, type: AngularElasticSeachModule }); }
30
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularElasticSeachModule, providers: [
31
31
  {
32
32
  provide: ProductsIndex,
33
33
  useFactory: (configuration) => new ProductsIndex(new AxiosAdapter(configuration)),
@@ -35,7 +35,7 @@ class AngularElasticSeachModule {
35
35
  },
36
36
  ] }); }
37
37
  }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularElasticSeachModule, decorators: [{
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularElasticSeachModule, decorators: [{
39
39
  type: NgModule,
40
40
  args: [{
41
41
  providers: [
@@ -69,9 +69,9 @@ class AngularFirebaseAuthModule {
69
69
  ],
70
70
  };
71
71
  }
72
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
73
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, imports: [i1.AuthModule] }); }
74
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, providers: [
72
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirebaseAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
73
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.6", ngImport: i0, type: AngularFirebaseAuthModule, imports: [i1.AuthModule] }); }
74
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirebaseAuthModule, providers: [
75
75
  {
76
76
  provide: 'Authentication',
77
77
  useFactory: (authenticationService, userRepository) => {
@@ -116,7 +116,7 @@ class AngularFirebaseAuthModule {
116
116
  },
117
117
  ], imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))] }); }
118
118
  }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirebaseAuthModule, decorators: [{
120
120
  type: NgModule,
121
121
  args: [{
122
122
  imports: [provideAuth((injector) => getAuth(injector.get(FirebaseApp)))],
@@ -185,9 +185,9 @@ class AngularFirestoreModule {
185
185
  ],
186
186
  };
187
187
  }
188
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirestoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
189
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1$1.FirestoreModule] }); }
190
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirestoreModule, providers: [
188
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirestoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
189
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.6", ngImport: i0, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1$1.FirestoreModule] }); }
190
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirestoreModule, providers: [
191
191
  {
192
192
  provide: 'FirestoreOptions',
193
193
  useFactory: (firestore, platformId) => ({
@@ -413,7 +413,7 @@ class AngularFirestoreModule {
413
413
  return firestore;
414
414
  })] }); }
415
415
  }
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularFirestoreModule, decorators: [{
416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularFirestoreModule, decorators: [{
417
417
  type: NgModule,
418
418
  args: [{
419
419
  imports: [
@@ -654,9 +654,9 @@ class AngularHasuraGraphQLModule {
654
654
  providers: [{ provide: HASURA_OPTIONS, useValue: options }],
655
655
  };
656
656
  }
657
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
658
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule }); }
659
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule, providers: [
657
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularHasuraGraphQLModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
658
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.6", ngImport: i0, type: AngularHasuraGraphQLModule }); }
659
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularHasuraGraphQLModule, providers: [
660
660
  {
661
661
  provide: 'HasuraConfig',
662
662
  useFactory: (options, platformId) => ({
@@ -779,7 +779,7 @@ class AngularHasuraGraphQLModule {
779
779
  },
780
780
  ] }); }
781
781
  }
782
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
782
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
783
783
  type: NgModule,
784
784
  args: [{
785
785
  providers: [
@@ -928,15 +928,15 @@ class AuthService {
928
928
  getFireUser() {
929
929
  return authState(this.angularFireAuth).pipe(catchError(() => of(null)));
930
930
  }
931
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AuthService, deps: [{ token: i1.Auth }, { token: 'UserRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
932
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AuthService }); }
931
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AuthService, deps: [{ token: i1.Auth }, { token: 'UserRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
932
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AuthService }); }
933
933
  }
934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AuthService, decorators: [{
934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AuthService, decorators: [{
935
935
  type: Injectable
936
- }], ctorParameters: () => [{ type: i1.Auth }, { type: undefined, decorators: [{
936
+ }], ctorParameters: function () { return [{ type: i1.Auth }, { type: undefined, decorators: [{
937
937
  type: Inject,
938
938
  args: ['UserRepository']
939
- }] }] });
939
+ }] }]; } });
940
940
 
941
941
  class CouponService {
942
942
  constructor(couponRepository, defaultShop, orderRepository, categoryRepository) {
@@ -1127,15 +1127,15 @@ class CouponService {
1127
1127
  }
1128
1128
  return couponUseLimits;
1129
1129
  }
1130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }, { token: 'OrderRepository' }, { token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1131
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, providedIn: 'root' }); }
1130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }, { token: 'OrderRepository' }, { token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1131
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CouponService, providedIn: 'root' }); }
1132
1132
  }
1133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CouponService, decorators: [{
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CouponService, decorators: [{
1134
1134
  type: Injectable,
1135
1135
  args: [{
1136
1136
  providedIn: 'root',
1137
1137
  }]
1138
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1138
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1139
1139
  type: Inject,
1140
1140
  args: ['CouponRepository']
1141
1141
  }] }, { type: i1$2.Shops, decorators: [{
@@ -1147,7 +1147,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1147
1147
  }] }, { type: undefined, decorators: [{
1148
1148
  type: Inject,
1149
1149
  args: ['CategoryRepository']
1150
- }] }] });
1150
+ }] }]; } });
1151
1151
 
1152
1152
  class CheckoutService {
1153
1153
  constructor(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
@@ -1191,12 +1191,12 @@ class CheckoutService {
1191
1191
  cookie.set('checkoutId', checkout.id);
1192
1192
  return checkout;
1193
1193
  }
1194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
1195
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService }); }
1194
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
1195
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutService }); }
1196
1196
  }
1197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutService, decorators: [{
1197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutService, decorators: [{
1198
1198
  type: Injectable
1199
- }], ctorParameters: () => [{ type: CouponService }, { type: undefined, decorators: [{
1199
+ }], ctorParameters: function () { return [{ type: CouponService }, { type: undefined, decorators: [{
1200
1200
  type: Inject,
1201
1201
  args: ['CheckoutRepository']
1202
1202
  }] }, { type: undefined, decorators: [{
@@ -1208,7 +1208,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1208
1208
  }] }, { type: i1$2.Shops, decorators: [{
1209
1209
  type: Inject,
1210
1210
  args: [DEFAULT_SHOP]
1211
- }] }] });
1211
+ }] }]; } });
1212
1212
 
1213
1213
  class CartService {
1214
1214
  constructor(authService, checkoutService, defaultShop, productRepository, categoryRepository, variantRepository, buy2WinRepository) {
@@ -1385,8 +1385,8 @@ class CartService {
1385
1385
  return { ...checkout, lineItems: notGiftItems };
1386
1386
  const elegibleCampaigns = [];
1387
1387
  for (const campaign of campaigns) {
1388
- const today = new Date().getTime();
1389
- if (!(campaign.startDate.getTime() <= today) && !(campaign.endDate.getTime() >= today))
1388
+ const today = new Date().getDate();
1389
+ if (!(campaign.startDate.getDate() <= today) && !(campaign.endDate.getDate() >= today))
1390
1390
  continue;
1391
1391
  if (campaign.activeCategory) {
1392
1392
  const categoriesCampaing = campaign.categories.map((c) => c.id.toString());
@@ -1458,12 +1458,12 @@ class CartService {
1458
1458
  });
1459
1459
  });
1460
1460
  }
1461
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1462
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService }); }
1461
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1462
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CartService }); }
1463
1463
  }
1464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CartService, decorators: [{
1464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CartService, decorators: [{
1465
1465
  type: Injectable
1466
- }], ctorParameters: () => [{ type: AuthService }, { type: CheckoutService }, { type: i1$2.Shops, decorators: [{
1466
+ }], ctorParameters: function () { return [{ type: AuthService }, { type: CheckoutService }, { type: i1$2.Shops, decorators: [{
1467
1467
  type: Inject,
1468
1468
  args: [DEFAULT_SHOP]
1469
1469
  }] }, { type: undefined, decorators: [{
@@ -1478,65 +1478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1478
1478
  }] }, { type: i1$2.Buy2WinFirestoreRepository, decorators: [{
1479
1479
  type: Inject,
1480
1480
  args: ['Buy2WinRepository']
1481
- }] }] });
1482
-
1483
- class NewCategoryStructureAdapter {
1484
- constructor(categoryRepository) {
1485
- this.categoryRepository = categoryRepository;
1486
- }
1487
- async buildProductFilterByCategory(category) {
1488
- const loadedCategory = await this.getCategory(category);
1489
- if (loadedCategory.isCollection)
1490
- return { id: { operator: Where.IN, value: loadedCategory.products } };
1491
- const categoryIds = [...(await this.getAllCategoriesIdFromCategory(category)), category.id.toString()];
1492
- return {
1493
- category: {
1494
- id: {
1495
- operator: Where.IN,
1496
- value: categoryIds,
1497
- },
1498
- },
1499
- };
1500
- }
1501
- async getAllCategoriesIdFromCategory(category) {
1502
- return this.categoryRepository
1503
- .getChildren(+category.id)
1504
- .then((categories) => categories.map((category) => category.id.toString()));
1505
- }
1506
- async getCategory(category) {
1507
- return isNil(category.isCollection) || (category.isCollection && !category.products?.length)
1508
- ? this.categoryRepository.get({ id: category.id })
1509
- : category;
1510
- }
1511
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1512
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter }); }
1513
- }
1514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: NewCategoryStructureAdapter, decorators: [{
1515
- type: Injectable
1516
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1517
- type: Inject,
1518
- args: ['CategoryRepository']
1519
- }] }] });
1520
-
1521
- class OldCategoryStructureAdapter {
1522
- constructor(categoryRepository) {
1523
- this.categoryRepository = categoryRepository;
1524
- }
1525
- async buildProductFilterByCategory(category) {
1526
- const productsIds = category.products?.length
1527
- ? category.products
1528
- : await this.categoryRepository.get({ id: category.id }).then((categoryFound) => categoryFound.products);
1529
- return { id: { operator: Where.IN, value: productsIds } };
1530
- }
1531
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1532
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter }); }
1533
- }
1534
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OldCategoryStructureAdapter, decorators: [{
1535
- type: Injectable
1536
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1537
- type: Inject,
1538
- args: ['CategoryRepository']
1539
- }] }] });
1481
+ }] }]; } });
1540
1482
 
1541
1483
  class CatalogService {
1542
1484
  constructor(productRepository, categoryStructureAdapter, shop, productIndex) {
@@ -1646,9 +1588,8 @@ class CatalogService {
1646
1588
  }
1647
1589
  async findCatalogByTermAndSortByMostRevelant(options, limits) {
1648
1590
  const productIds = await this.findCatalogIdsByElasticSearch(options.term);
1649
- console.log('productIds', productIds);
1650
1591
  const totalResult = await this.productRepository.findCatalog({
1651
- fields: ['id', 'stock'],
1592
+ fields: ['id'],
1652
1593
  filters: {
1653
1594
  id: { operator: Where.IN, value: productIds },
1654
1595
  ...this.buildFilterQuery(options?.filters || {}),
@@ -1659,32 +1600,15 @@ class CatalogService {
1659
1600
  distinct: ['brand'],
1660
1601
  },
1661
1602
  }, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
1662
- console.log('totalResult', totalResult);
1663
- const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
1664
- const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
1665
- const productIdsStock = productIds.filter((product) => stockData.some((result) => result.id == product));
1666
- console.log('productIdsStock', productIdsStock);
1667
- const productIdsStockOut = productIds.filter((product) => stockOut.some((result) => result.id == product));
1668
- console.log('productIdsStockOut', productIdsStockOut);
1669
- const limitedProductId = productIdsStock
1670
- .concat(productIdsStockOut)
1671
- .slice(limits.offset, limits.offset + limits.limit);
1672
- // const limitedProductId = productIds
1673
- // .filter((product) => totalResult.data.some((result) => result.id == product))
1674
- // .slice(limits.offset, limits.offset + limits.limit)
1675
- console.log('limitedProductId', limitedProductId);
1676
- // const limitedProductId = totalResult.data
1677
- // .slice(limits.offset, limits.offset + limits.limit)
1678
- // .map((product) => product.id)
1603
+ const limitedProductId = totalResult.data
1604
+ .slice(limits.offset, limits.offset + limits.limit)
1605
+ .map((product) => product.id);
1679
1606
  const orderedId = productIds.filter((product) => limitedProductId.includes(product));
1680
- console.log('orderedId', orderedId);
1681
1607
  const productResult = await this.productRepository.findCatalog({
1682
1608
  filters: {
1683
1609
  id: { operator: Where.IN, value: orderedId },
1684
1610
  },
1685
1611
  });
1686
- console.log('productResult', productResult);
1687
- console.log('data result', limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean));
1688
1612
  return {
1689
1613
  data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
1690
1614
  count: totalResult.count,
@@ -1705,12 +1629,12 @@ class CatalogService {
1705
1629
  return [...new Set(sorted.map(({ _source }) => _source.id))];
1706
1630
  }));
1707
1631
  }
1708
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
1709
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService }); }
1632
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
1633
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CatalogService }); }
1710
1634
  }
1711
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CatalogService, decorators: [{
1635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CatalogService, decorators: [{
1712
1636
  type: Injectable
1713
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1637
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1714
1638
  type: Inject,
1715
1639
  args: ['ProductRepository']
1716
1640
  }] }, { type: undefined, decorators: [{
@@ -1719,7 +1643,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1719
1643
  }] }, { type: i1$2.Shops, decorators: [{
1720
1644
  type: Inject,
1721
1645
  args: [DEFAULT_SHOP]
1722
- }] }, { type: i1$2.ProductsIndex }] });
1646
+ }] }, { type: i1$2.ProductsIndex }]; } });
1723
1647
 
1724
1648
  class CategoryService {
1725
1649
  constructor(productRepository, categoryRepository, categoryFilterRepository, categoryStructureAdapter, shop) {
@@ -1745,12 +1669,12 @@ class CategoryService {
1745
1669
  .find({ filters: { categoryId: +category.id } })
1746
1670
  .then(({ data }) => data.map((categoryFilter) => categoryFilter.filter));
1747
1671
  }
1748
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'CategoryFilterRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
1749
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService }); }
1672
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CategoryService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'CategoryFilterRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
1673
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CategoryService }); }
1750
1674
  }
1751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CategoryService, decorators: [{
1675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CategoryService, decorators: [{
1752
1676
  type: Injectable
1753
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1677
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1754
1678
  type: Inject,
1755
1679
  args: ['ProductRepository']
1756
1680
  }] }, { type: undefined, decorators: [{
@@ -1765,7 +1689,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1765
1689
  }] }, { type: i1$2.Shops, decorators: [{
1766
1690
  type: Inject,
1767
1691
  args: [DEFAULT_SHOP]
1768
- }] }] });
1692
+ }] }]; } });
1769
1693
 
1770
1694
  var ProductSorts;
1771
1695
  (function (ProductSorts) {
@@ -1785,14 +1709,71 @@ __decorate([
1785
1709
  __metadata("design:type", Array)
1786
1710
  ], CategoryWithTree.prototype, "children", void 0);
1787
1711
 
1712
+ class NewCategoryStructureAdapter {
1713
+ constructor(categoryRepository) {
1714
+ this.categoryRepository = categoryRepository;
1715
+ }
1716
+ async buildProductFilterByCategory(category) {
1717
+ const loadedCategory = await this.getCategory(category);
1718
+ if (loadedCategory.isCollection)
1719
+ return { id: { operator: Where.IN, value: loadedCategory.products } };
1720
+ const categoryIds = [...(await this.getAllCategoriesIdFromCategory(category)), category.id.toString()];
1721
+ return {
1722
+ category: {
1723
+ id: {
1724
+ operator: Where.IN,
1725
+ value: categoryIds,
1726
+ },
1727
+ },
1728
+ };
1729
+ }
1730
+ async getAllCategoriesIdFromCategory(category) {
1731
+ return this.categoryRepository
1732
+ .getChildren(+category.id)
1733
+ .then((categories) => categories.map((category) => category.id.toString()));
1734
+ }
1735
+ async getCategory(category) {
1736
+ return isNil(category.isCollection) || (category.isCollection && !category.products?.length)
1737
+ ? this.categoryRepository.get({ id: category.id })
1738
+ : category;
1739
+ }
1740
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1741
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: NewCategoryStructureAdapter }); }
1742
+ }
1743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: NewCategoryStructureAdapter, decorators: [{
1744
+ type: Injectable
1745
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1746
+ type: Inject,
1747
+ args: ['CategoryRepository']
1748
+ }] }]; } });
1749
+
1750
+ class OldCategoryStructureAdapter {
1751
+ constructor(categoryRepository) {
1752
+ this.categoryRepository = categoryRepository;
1753
+ }
1754
+ async buildProductFilterByCategory(category) {
1755
+ const productsIds = category.products?.length
1756
+ ? category.products
1757
+ : await this.categoryRepository.get({ id: category.id }).then((categoryFound) => categoryFound.products);
1758
+ return { id: { operator: Where.IN, value: productsIds } };
1759
+ }
1760
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OldCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
1761
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OldCategoryStructureAdapter }); }
1762
+ }
1763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OldCategoryStructureAdapter, decorators: [{
1764
+ type: Injectable
1765
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1766
+ type: Inject,
1767
+ args: ['CategoryRepository']
1768
+ }] }]; } });
1769
+
1788
1770
  class WishlistService {
1789
- constructor(wishlistRepository, categoryRepository, shop, productRepository, categoryFilterRepository, productIndex) {
1771
+ constructor(wishlistRepository, shop, productRepository, categoryFilterRepository, productIndex) {
1790
1772
  this.wishlistRepository = wishlistRepository;
1791
- this.categoryRepository = categoryRepository;
1792
1773
  this.shop = shop;
1793
1774
  const categoryStructureAdapter = new NewCategoryStructureAdapter(wishlistRepository);
1794
1775
  this.catalogService = new CatalogService(productRepository, categoryStructureAdapter, shop, productIndex);
1795
- this.categoryService = new CategoryService(productRepository, categoryRepository, categoryFilterRepository, categoryStructureAdapter, shop);
1776
+ this.categoryService = new CategoryService(productRepository, wishlistRepository, categoryFilterRepository, categoryStructureAdapter, shop);
1796
1777
  }
1797
1778
  getCatalogService() {
1798
1779
  return this.catalogService;
@@ -1800,7 +1781,7 @@ class WishlistService {
1800
1781
  getCategoryService() {
1801
1782
  return this.categoryService;
1802
1783
  }
1803
- async create({ personId, title, description, userFullName, userPhoto, theme, bannerUrl, }) {
1784
+ async create(personId, title, description, userFullName, userPhoto) {
1804
1785
  const data = {
1805
1786
  slug: '',
1806
1787
  name: title,
@@ -1816,14 +1797,11 @@ class WishlistService {
1816
1797
  personPhoto: userPhoto,
1817
1798
  brandCategory: false,
1818
1799
  published: true,
1819
- theme,
1820
- bannerUrl,
1821
1800
  };
1822
1801
  const newWishlist = await this.wishlistRepository.create(data);
1823
- await this.wishlistRepository.update({ id: newWishlist.id, slug: newWishlist.id });
1824
- return Wishlist.toInstance({ ...newWishlist.toPlain(), slug: newWishlist.id });
1802
+ return this.wishlistRepository.update({ id: newWishlist.id, slug: newWishlist.id });
1825
1803
  }
1826
- update({ id, title, description, userFullName, userPhoto, theme, bannerUrl, }) {
1804
+ update(id, title, description, userFullName, userPhoto) {
1827
1805
  const data = {
1828
1806
  id,
1829
1807
  name: title,
@@ -1834,8 +1812,6 @@ class WishlistService {
1834
1812
  },
1835
1813
  personName: userFullName,
1836
1814
  personPhoto: userPhoto,
1837
- theme,
1838
- bannerUrl,
1839
1815
  };
1840
1816
  return this.wishlistRepository.update(data);
1841
1817
  }
@@ -1871,17 +1847,14 @@ class WishlistService {
1871
1847
  }
1872
1848
  return wishlist;
1873
1849
  }
1874
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: 'CategoryRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
1875
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService }); }
1850
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable }); }
1851
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: WishlistService }); }
1876
1852
  }
1877
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: WishlistService, decorators: [{
1853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: WishlistService, decorators: [{
1878
1854
  type: Injectable
1879
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1855
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1880
1856
  type: Inject,
1881
1857
  args: ['WishlistRepository']
1882
- }] }, { type: undefined, decorators: [{
1883
- type: Inject,
1884
- args: ['CategoryRepository']
1885
1858
  }] }, { type: i1$2.Shops, decorators: [{
1886
1859
  type: Inject,
1887
1860
  args: [DEFAULT_SHOP]
@@ -1891,7 +1864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
1891
1864
  }] }, { type: undefined, decorators: [{
1892
1865
  type: Inject,
1893
1866
  args: ['CategoryFilterRepository']
1894
- }] }, { type: i1$2.ProductsIndex }] });
1867
+ }] }, { type: i1$2.ProductsIndex }]; } });
1895
1868
 
1896
1869
  class CheckoutSubscriptionService {
1897
1870
  constructor(checkoutSubscriptionRepository, subscriptionRepository, couponService) {
@@ -1925,18 +1898,18 @@ class CheckoutSubscriptionService {
1925
1898
  calcDiscountSubscription(coupon) {
1926
1899
  return this.getCheckoutSubscription().pipe(concatMap((checkout) => this.couponService.calcDiscountSubscription(coupon, checkout).pipe()));
1927
1900
  }
1928
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1929
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService }); }
1901
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1902
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutSubscriptionService }); }
1930
1903
  }
1931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: CheckoutSubscriptionService, decorators: [{
1904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: CheckoutSubscriptionService, decorators: [{
1932
1905
  type: Injectable
1933
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1906
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1934
1907
  type: Inject,
1935
1908
  args: ['CheckoutSubscriptionRepository']
1936
1909
  }] }, { type: undefined, decorators: [{
1937
1910
  type: Inject,
1938
1911
  args: ['SubscriptionRepository']
1939
- }] }, { type: CouponService }] });
1912
+ }] }, { type: CouponService }]; } });
1940
1913
 
1941
1914
  class UtilHelper {
1942
1915
  static createSlug(name) {
@@ -1986,18 +1959,13 @@ class HomeShopService {
1986
1959
  'weight',
1987
1960
  'rate',
1988
1961
  'type',
1989
- 'brand',
1990
1962
  ]))) || [],
1991
1963
  });
1992
1964
  }
1993
1965
  getHomeData() {
1994
1966
  return this.getHomeConfiguration().pipe(map((home) => (home?.data?.expiresAt > new Date() ? home : null)), concatMap((home) => home
1995
1967
  ? of(home)
1996
- : forkJoin([
1997
- this.getDiscoverProducts(this.gender),
1998
- this.getFeaturedProducts(this.gender),
1999
- this.getVerticalProducts(this.gender),
2000
- ]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
1968
+ : forkJoin([this.getDiscoverProducts(), this.getFeaturedProducts(), this.getVerticalProducts()]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
2001
1969
  discoverProducts,
2002
1970
  featuredProducts,
2003
1971
  verticalProducts,
@@ -2019,18 +1987,15 @@ class HomeShopService {
2019
1987
  getMinValueForFreeShipping() {
2020
1988
  return this.getHomeConfiguration().pipe(map((home) => home.minValueForFreeShipping));
2021
1989
  }
2022
- getDiscoverProducts(gender) {
2023
- return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories, undefined, gender)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
1990
+ getDiscoverProducts() {
1991
+ return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
2024
1992
  }
2025
- getFeaturedProducts(gender) {
2026
- return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories, undefined, gender)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
1993
+ getFeaturedProducts() {
1994
+ return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
2027
1995
  }
2028
- getVerticalProducts(gender) {
1996
+ getVerticalProducts() {
2029
1997
  return this.getHomeConfiguration().pipe(concatMap((home) => forkJoin(home.verticalCarousels.filter(Boolean).map((id) => from(this.categoryRepository.get({ id })).pipe(concatMap((category) => from(this.productRepository.find({
2030
- filters: {
2031
- categories: { operator: Where.IN, value: [category.id] },
2032
- ...(gender ? { tags: { operator: Where.IN, value: [gender] } } : {}),
2033
- },
1998
+ filters: { categories: { operator: Where.IN, value: [category.id] } },
2034
1999
  limits: { limit: 12 },
2035
2000
  })).pipe(map((products) => ({ category, products })))), map(({ category, products }) => ({ category, products: products.data })), map(this.buildCategoryGroupWithRequiredData))))));
2036
2001
  }
@@ -2052,15 +2017,12 @@ class HomeShopService {
2052
2017
  data,
2053
2018
  })).pipe(tap(() => (this.homeConfiguration.data = data)), map(() => this.homeConfiguration));
2054
2019
  }
2055
- get gender() {
2056
- return this.homeId === 'mens_market' ? 'masculino' : undefined;
2057
- }
2058
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
2059
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: HomeShopService }); }
2020
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable }); }
2021
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: HomeShopService }); }
2060
2022
  }
2061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: HomeShopService, decorators: [{
2023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: HomeShopService, decorators: [{
2062
2024
  type: Injectable
2063
- }], ctorParameters: () => [{ type: undefined, decorators: [{
2025
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2064
2026
  type: Inject,
2065
2027
  args: ['CategoryRepository']
2066
2028
  }] }, { type: undefined, decorators: [{
@@ -2072,7 +2034,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
2072
2034
  }] }, { type: i1$2.Shops, decorators: [{
2073
2035
  type: Inject,
2074
2036
  args: [DEFAULT_SHOP]
2075
- }] }] });
2037
+ }] }]; } });
2076
2038
 
2077
2039
  class OrderService {
2078
2040
  constructor(angularFirestore, orderRepository) {
@@ -2086,15 +2048,15 @@ class OrderService {
2086
2048
  .subscribe((doc) => this.orderSubject.next(doc));
2087
2049
  return this.orderSubject;
2088
2050
  }
2089
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, deps: [{ token: i1$1.Firestore }, { token: 'OrderRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
2090
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService }); }
2051
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OrderService, deps: [{ token: i1$1.Firestore }, { token: 'OrderRepository' }], target: i0.ɵɵFactoryTarget.Injectable }); }
2052
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OrderService }); }
2091
2053
  }
2092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: OrderService, decorators: [{
2054
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: OrderService, decorators: [{
2093
2055
  type: Injectable
2094
- }], ctorParameters: () => [{ type: i1$1.Firestore }, { type: i1$2.OrderFirestoreRepository, decorators: [{
2056
+ }], ctorParameters: function () { return [{ type: i1$1.Firestore }, { type: i1$2.OrderFirestoreRepository, decorators: [{
2095
2057
  type: Inject,
2096
2058
  args: ['OrderRepository']
2097
- }] }] });
2059
+ }] }]; } });
2098
2060
 
2099
2061
  class ShippingService {
2100
2062
  constructor(http, apiUrl, homeService) {
@@ -2172,15 +2134,15 @@ class ShippingService {
2172
2134
  }
2173
2135
  return false;
2174
2136
  }
2175
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService, deps: [{ token: i1$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2176
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService }); }
2137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: ShippingService, deps: [{ token: i1$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2138
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: ShippingService }); }
2177
2139
  }
2178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ShippingService, decorators: [{
2140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: ShippingService, decorators: [{
2179
2141
  type: Injectable
2180
- }], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: undefined, decorators: [{
2142
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: undefined, decorators: [{
2181
2143
  type: Inject,
2182
2144
  args: [BACKEND_URL]
2183
- }] }, { type: HomeShopService }] });
2145
+ }] }, { type: HomeShopService }]; } });
2184
2146
 
2185
2147
  class AngularConnectModule {
2186
2148
  static initializeApp(defaultShop, options, nameOrConfig) {
@@ -2202,12 +2164,12 @@ class AngularConnectModule {
2202
2164
  ],
2203
2165
  };
2204
2166
  }
2205
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2206
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
2167
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2168
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.6", ngImport: i0, type: AngularConnectModule, imports: [i1$4.FirebaseAppModule, AngularElasticSeachModule,
2207
2169
  AngularFirebaseAuthModule,
2208
2170
  AngularFirestoreModule,
2209
2171
  AngularHasuraGraphQLModule] }); }
2210
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, providers: [
2172
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularConnectModule, providers: [
2211
2173
  AuthService,
2212
2174
  CartService,
2213
2175
  CatalogService,
@@ -2233,7 +2195,7 @@ class AngularConnectModule {
2233
2195
  AngularFirestoreModule,
2234
2196
  AngularHasuraGraphQLModule] }); }
2235
2197
  }
2236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: AngularConnectModule, decorators: [{
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.6", ngImport: i0, type: AngularConnectModule, decorators: [{
2237
2199
  type: NgModule,
2238
2200
  args: [{
2239
2201
  imports: [
@@ -2271,5 +2233,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImpor
2271
2233
  * Generated bundle index. Do not edit.
2272
2234
  */
2273
2235
 
2274
- export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CheckoutSubscriptionService, CouponService, HomeShopService, NewCategoryStructureAdapter, OldCategoryStructureAdapter, OrderService, ProductSorts, ShippingService, UtilHelper, WishlistService };
2236
+ export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CheckoutSubscriptionService, CouponService, HomeShopService, OrderService, ProductSorts, ShippingService, UtilHelper, WishlistService };
2275
2237
  //# sourceMappingURL=infrab4a-connect-angular.mjs.map