@infrab4a/connect-angular 0.14.3 → 0.15.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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
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('@angular/fire/firestore'), require('@angular/fire')) :
3
- typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire/firestore', '@angular/fire'], factory) :
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.ng.fire.firestore, global.ng.fire));
5
- })(this, (function (exports, i0, rxjs, operators, i1, i2, cookie, i1$1, fire) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/fire/auth'), require('rxjs'), require('rxjs/operators'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire/firestore'), require('@angular/fire/app')) :
3
+ typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', '@angular/fire/auth', 'rxjs', 'rxjs/operators', '@infrab4a/connect', 'js-cookie', '@angular/fire/firestore', '@angular/fire/app'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.ng.fire.auth, global.rxjs, global.rxjs.operators, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire.firestore, global.ng.fire.app));
5
+ })(this, (function (exports, i0, i1, rxjs, operators, i2, cookie, i1$1, i1$2) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -29,6 +29,7 @@
29
29
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
30
  var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
31
31
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
32
+ var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
32
33
 
33
34
  /*! *****************************************************************************
34
35
  Copyright (c) Microsoft Corporation.
@@ -355,7 +356,7 @@
355
356
  }
356
357
  AuthService.prototype.getAuthstate = function () {
357
358
  var observables = [
358
- this.angularFireAuth.authState.pipe(operators.catchError(function () { return rxjs.of(null); })),
359
+ i1.authState(this.angularFireAuth).pipe(operators.catchError(function () { return rxjs.of(null); })),
359
360
  this.getUser().pipe(operators.catchError(function () { return rxjs.of(null); })),
360
361
  ];
361
362
  return rxjs.combineLatest(observables).pipe(operators.map(function (_a) {
@@ -371,19 +372,19 @@
371
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
373
  };
373
374
  AuthService.prototype.getTokenId = function () {
374
- return this.angularFireAuth.idToken;
375
+ return rxjs.from(i1.getIdToken(this.angularFireAuth.currentUser));
375
376
  };
376
377
  AuthService.prototype.getFireUser = function () {
377
- return this.angularFireAuth.user.pipe(operators.catchError(function () { return rxjs.of(null); }));
378
+ return rxjs.of(this.angularFireAuth.currentUser).pipe(operators.catchError(function () { return rxjs.of(null); }));
378
379
  };
379
380
  return AuthService;
380
381
  }());
381
- AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
382
+ AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.Auth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
382
383
  AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
383
384
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
384
385
  type: i0.Injectable
385
386
  }], ctorParameters: function () {
386
- return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
387
+ return [{ type: i1__namespace.Auth }, { type: undefined, decorators: [{
387
388
  type: i0.Inject,
388
389
  args: ['UserRepository']
389
390
  }] }];
@@ -393,6 +394,9 @@
393
394
 
394
395
  var ES_CONFIG = 'ES_CONFIG';
395
396
 
397
+ var FIREBASE_APP_NAME = new i0.InjectionToken('firebaseAppName');
398
+ var FIREBASE_OPTIONS = new i0.InjectionToken('firebaseOptions');
399
+
396
400
  var InvalidCouponError = /** @class */ (function (_super) {
397
401
  __extends(InvalidCouponError, _super);
398
402
  function InvalidCouponError(message) {
@@ -597,7 +601,7 @@
597
601
  if (_this.checkMaxStock(item, quantity || 0))
598
602
  throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
599
603
  var image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
600
- var 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;
604
+ var id = item.id, name = item.name, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku;
601
605
  var isGift = item.isGift || null;
602
606
  var pricePaid = _this.getProductPrice({
603
607
  product: item,
@@ -607,7 +611,6 @@
607
611
  return i2.LineItem.toInstance({
608
612
  id: id,
609
613
  name: name,
610
- EAN: EAN,
611
614
  brand: brand,
612
615
  slug: slug,
613
616
  sku: sku,
@@ -816,21 +819,19 @@
816
819
  }
817
820
  OrderService.prototype.getOrder = function (id) {
818
821
  var _this = this;
819
- this.angularFirestore
820
- .doc(this.orderRepository.collectionName + "/" + id)
821
- .valueChanges()
822
- .pipe(operators.map(function (doc) { return i2.Order.toInstance(doc); }))
822
+ i1$1.docSnapshots(i1$1.doc(this.angularFirestore, this.orderRepository.collectionName + "/" + id))
823
+ .pipe(operators.map(function (doc) { return i2.Order.toInstance(doc.data()); }))
823
824
  .subscribe(function (doc) { return _this.orderSubject.next(doc); });
824
825
  return this.orderSubject;
825
826
  };
826
827
  return OrderService;
827
828
  }());
828
- 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 });
829
+ OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.Firestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
829
830
  OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
830
831
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
831
832
  type: i0.Injectable
832
833
  }], ctorParameters: function () {
833
- return [{ type: i1__namespace$1.AngularFirestore }, { type: i2__namespace.OrderFirestoreRepository, decorators: [{
834
+ return [{ type: i1__namespace$1.Firestore }, { type: i2__namespace.OrderFirestoreRepository, decorators: [{
834
835
  type: i0.Inject,
835
836
  args: ['OrderRepository']
836
837
  }] }];
@@ -847,7 +848,6 @@
847
848
  products: group.products.map(function (product) { return i2.Product.toInstance(i2.pick(product.toPlain(), [
848
849
  'id',
849
850
  'price',
850
- 'EAN',
851
851
  'reviews',
852
852
  'hasVariants',
853
853
  'slug',
@@ -964,15 +964,15 @@
964
964
  return {
965
965
  ngModule: AngularFirebaseAuthModule,
966
966
  providers: [
967
- { provide: fire.FIREBASE_OPTIONS, useValue: options },
968
- { provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
967
+ { provide: FIREBASE_OPTIONS, useValue: options },
968
+ { provide: FIREBASE_APP_NAME, useValue: nameOrConfig },
969
969
  ],
970
970
  };
971
971
  };
972
972
  return AngularFirebaseAuthModule;
973
973
  }());
974
974
  AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
975
- AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
975
+ AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [i1__namespace$2.FirebaseAppModule, i1__namespace.AuthModule] });
976
976
  AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
977
977
  {
978
978
  provide: 'Authentication',
@@ -986,7 +986,7 @@
986
986
  useFactory: function (angularFireAuth) {
987
987
  return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
988
988
  },
989
- deps: [i1.AngularFireAuth],
989
+ deps: [i1.Auth],
990
990
  },
991
991
  {
992
992
  provide: 'Register',
@@ -1000,7 +1000,7 @@
1000
1000
  useFactory: function (angularFireAuth) {
1001
1001
  return new i2.RegisterFirebaseAuthService(angularFireAuth);
1002
1002
  },
1003
- deps: [i1.AngularFireAuth],
1003
+ deps: [i1.Auth],
1004
1004
  },
1005
1005
  {
1006
1006
  provide: 'SignOut',
@@ -1016,11 +1016,17 @@
1016
1016
  },
1017
1017
  deps: ['AuthenticationService'],
1018
1018
  },
1019
- ], imports: [[fire.AngularFireModule]] });
1019
+ ], imports: [[
1020
+ i1$2.provideFirebaseApp(function (injector) { return i1$2.initializeApp(injector.get(FIREBASE_OPTIONS), injector.get(FIREBASE_APP_NAME)); }),
1021
+ i1.provideAuth(function () { return i1.getAuth(); }),
1022
+ ]] });
1020
1023
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
1021
1024
  type: i0.NgModule,
1022
1025
  args: [{
1023
- imports: [fire.AngularFireModule],
1026
+ imports: [
1027
+ i1$2.provideFirebaseApp(function (injector) { return i1$2.initializeApp(injector.get(FIREBASE_OPTIONS), injector.get(FIREBASE_APP_NAME)); }),
1028
+ i1.provideAuth(function () { return i1.getAuth(); }),
1029
+ ],
1024
1030
  providers: [
1025
1031
  {
1026
1032
  provide: 'Authentication',
@@ -1034,7 +1040,7 @@
1034
1040
  useFactory: function (angularFireAuth) {
1035
1041
  return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
1036
1042
  },
1037
- deps: [i1.AngularFireAuth],
1043
+ deps: [i1.Auth],
1038
1044
  },
1039
1045
  {
1040
1046
  provide: 'Register',
@@ -1048,7 +1054,7 @@
1048
1054
  useFactory: function (angularFireAuth) {
1049
1055
  return new i2.RegisterFirebaseAuthService(angularFireAuth);
1050
1056
  },
1051
- deps: [i1.AngularFireAuth],
1057
+ deps: [i1.Auth],
1052
1058
  },
1053
1059
  {
1054
1060
  provide: 'SignOut',
@@ -1112,8 +1118,8 @@
1112
1118
  return {
1113
1119
  ngModule: AngularFirestoreModule,
1114
1120
  providers: [
1115
- { provide: fire.FIREBASE_OPTIONS, useValue: options.firebase },
1116
- { provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
1121
+ { provide: FIREBASE_OPTIONS, useValue: options.firebase },
1122
+ { provide: FIREBASE_APP_NAME, useValue: nameOrConfig },
1117
1123
  { provide: ES_CONFIG, useValue: options.elasticSearch },
1118
1124
  ],
1119
1125
  };
@@ -1121,321 +1127,329 @@
1121
1127
  return AngularFirestoreModule;
1122
1128
  }());
1123
1129
  AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1124
- AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule, AngularElasticSeachModule] });
1130
+ AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [AngularElasticSeachModule, i1__namespace$2.FirebaseAppModule, i1__namespace$1.FirestoreModule] });
1125
1131
  AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
1126
1132
  {
1127
1133
  provide: 'BeautyProfileRepository',
1128
1134
  useFactory: function (firestore, userRepository) {
1129
- return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1135
+ return new i2.UserBeautyProfileFirestoreRepository(firestore, userRepository);
1130
1136
  },
1131
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1137
+ deps: [i1$1.Firestore, 'UserRepository'],
1132
1138
  },
1133
1139
  {
1134
1140
  provide: 'Buy2WinRepository',
1135
1141
  useFactory: function (firestore) {
1136
- return new i2.Buy2WinFirestoreRepository(firestore.firestore);
1142
+ return new i2.Buy2WinFirestoreRepository(firestore);
1137
1143
  },
1138
- deps: [i1$1.AngularFirestore],
1144
+ deps: [i1$1.Firestore],
1139
1145
  },
1140
1146
  {
1141
1147
  provide: 'CategoryRepository',
1142
- useFactory: function (firestore) {
1143
- return new i2.CategoryFirestoreRepository(firestore.firestore);
1148
+ useFactory: function (firestore, productsIndex) {
1149
+ return new i2.CategoryFirestoreRepository(firestore, productsIndex);
1144
1150
  },
1145
- deps: [i1$1.AngularFirestore],
1151
+ deps: [i1$1.Firestore, i2.ProductsIndex],
1146
1152
  },
1147
1153
  {
1148
1154
  provide: 'CheckoutRepository',
1149
1155
  useFactory: function (firestore) {
1150
- return new i2.CheckoutFirestoreRepository(firestore.firestore);
1156
+ return new i2.CheckoutFirestoreRepository(firestore);
1151
1157
  },
1152
- deps: [i1$1.AngularFirestore],
1158
+ deps: [i1$1.Firestore],
1153
1159
  },
1154
1160
  {
1155
1161
  provide: 'CheckoutSubscriptionRepository',
1156
1162
  useFactory: function (firestore) {
1157
- return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1163
+ return new i2.CheckoutSubscriptionFirestoreRepository(firestore);
1158
1164
  },
1159
- deps: [i1$1.AngularFirestore],
1165
+ deps: [i1$1.Firestore],
1160
1166
  },
1161
1167
  {
1162
1168
  provide: 'CouponRepository',
1163
1169
  useFactory: function (firestore) {
1164
- return new i2.CouponFirestoreRepository(firestore.firestore);
1170
+ return new i2.CouponFirestoreRepository(firestore);
1165
1171
  },
1166
- deps: [i1$1.AngularFirestore],
1172
+ deps: [i1$1.Firestore],
1167
1173
  },
1168
1174
  {
1169
1175
  provide: 'EditionRepository',
1170
1176
  useFactory: function (firestore, subscriptionRepository) {
1171
- return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1177
+ return new i2.SubscriptionEditionFirestoreRepository(firestore, subscriptionRepository);
1172
1178
  },
1173
- deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1179
+ deps: [i1$1.Firestore, 'SubscriptionRepository'],
1174
1180
  },
1175
1181
  {
1176
1182
  provide: 'HomeRepository',
1177
1183
  useFactory: function (firestore) {
1178
- return new i2.HomeFirestoreRepository(firestore.firestore);
1184
+ return new i2.HomeFirestoreRepository(firestore);
1179
1185
  },
1180
- deps: [i1$1.AngularFirestore],
1186
+ deps: [i1$1.Firestore],
1181
1187
  },
1182
1188
  {
1183
1189
  provide: 'LeadRepository',
1184
1190
  useFactory: function (firestore) {
1185
- return new i2.LeadFirestoreRepository(firestore.firestore);
1191
+ return new i2.LeadFirestoreRepository(firestore);
1186
1192
  },
1187
- deps: [i1$1.AngularFirestore],
1193
+ deps: [i1$1.Firestore],
1188
1194
  },
1189
1195
  {
1190
1196
  provide: 'LegacyOrderRepository',
1191
1197
  useFactory: function (firestore) {
1192
- return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
1198
+ return new i2.LegacyOrderFirestoreRepository(firestore);
1193
1199
  },
1194
- deps: [i1$1.AngularFirestore],
1200
+ deps: [i1$1.Firestore],
1195
1201
  },
1196
1202
  {
1197
1203
  provide: 'ShopMenuRepository',
1198
1204
  useFactory: function (firestore) {
1199
- return new i2.ShopMenuFirestoreRepository(firestore.firestore);
1205
+ return new i2.ShopMenuFirestoreRepository(firestore);
1200
1206
  },
1201
- deps: [i1$1.AngularFirestore],
1207
+ deps: [i1$1.Firestore],
1202
1208
  },
1203
1209
  {
1204
1210
  provide: 'OrderRepository',
1205
1211
  useFactory: function (firestore) {
1206
- return new i2.OrderFirestoreRepository(firestore.firestore);
1212
+ return new i2.OrderFirestoreRepository(firestore);
1207
1213
  },
1208
- deps: [i1$1.AngularFirestore],
1214
+ deps: [i1$1.Firestore],
1209
1215
  },
1210
1216
  {
1211
1217
  provide: 'PaymentRepository',
1212
1218
  useFactory: function (firestore) {
1213
- return new i2.PaymentFirestoreRepository(firestore.firestore);
1219
+ return new i2.PaymentFirestoreRepository(firestore);
1214
1220
  },
1215
- deps: [i1$1.AngularFirestore],
1221
+ deps: [i1$1.Firestore],
1216
1222
  },
1217
1223
  {
1218
1224
  provide: 'ProductRepository',
1219
1225
  useFactory: function (firestore) {
1220
- return new i2.ProductFirestoreRepository(firestore.firestore);
1226
+ return new i2.ProductFirestoreRepository(firestore);
1221
1227
  },
1222
- deps: [i1$1.AngularFirestore],
1228
+ deps: [i1$1.Firestore],
1223
1229
  },
1224
1230
  {
1225
1231
  provide: 'SubscriptionPaymentRepository',
1226
1232
  useFactory: function (firestore, subscriptionRepository) {
1227
- return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1233
+ return new i2.SubscriptionPaymentFirestoreRepository(firestore, subscriptionRepository);
1228
1234
  },
1229
- deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1235
+ deps: [i1$1.Firestore, 'SubscriptionRepository'],
1230
1236
  },
1231
1237
  {
1232
1238
  provide: 'SubscriptionPlanRepository',
1233
1239
  useFactory: function (firestore) {
1234
- return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
1240
+ return new i2.SubscriptionPlanFirestoreRepository(firestore);
1235
1241
  },
1236
- deps: [i1$1.AngularFirestore],
1242
+ deps: [i1$1.Firestore],
1237
1243
  },
1238
1244
  {
1239
1245
  provide: 'SubscriptionProductRepository',
1240
1246
  useFactory: function (firestore) {
1241
- return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
1247
+ return new i2.SubscriptionProductFirestoreRepository(firestore);
1242
1248
  },
1243
- deps: [i1$1.AngularFirestore],
1249
+ deps: [i1$1.Firestore],
1244
1250
  },
1245
1251
  {
1246
1252
  provide: 'SubscriptionRepository',
1247
1253
  useFactory: function (firestore) {
1248
- return new i2.SubscriptionFirestoreRepository(firestore.firestore);
1254
+ return new i2.SubscriptionFirestoreRepository(firestore);
1249
1255
  },
1250
- deps: [i1$1.AngularFirestore],
1256
+ deps: [i1$1.Firestore],
1251
1257
  },
1252
1258
  {
1253
1259
  provide: 'UserRepository',
1254
1260
  useFactory: function (firestore) {
1255
- return new i2.UserFirestoreRepository(firestore.firestore);
1261
+ return new i2.UserFirestoreRepository(firestore);
1256
1262
  },
1257
- deps: [i1$1.AngularFirestore],
1263
+ deps: [i1$1.Firestore],
1258
1264
  },
1259
1265
  {
1260
1266
  provide: 'UserAddressRepository',
1261
1267
  useFactory: function (firestore, userRepository) {
1262
- return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1268
+ return new i2.UserAddressFirestoreRepository(firestore, userRepository);
1263
1269
  },
1264
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1270
+ deps: [i1$1.Firestore, 'UserRepository'],
1265
1271
  },
1266
1272
  {
1267
1273
  provide: 'UserPaymentMethodRepository',
1268
1274
  useFactory: function (firestore, userRepository) {
1269
- return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1275
+ return new i2.UserPaymentMethodFirestoreRepository(firestore, userRepository);
1270
1276
  },
1271
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1277
+ deps: [i1$1.Firestore, 'UserRepository'],
1272
1278
  },
1273
1279
  {
1274
1280
  provide: 'VariantRepository',
1275
1281
  useFactory: function (firestore, productRepository) {
1276
- return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
1282
+ return new i2.ProductVariantFirestoreRepository(firestore, productRepository);
1277
1283
  },
1278
- deps: [i1$1.AngularFirestore, 'ProductRepository'],
1284
+ deps: [i1$1.Firestore, 'ProductRepository'],
1279
1285
  },
1280
- ], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
1286
+ ], imports: [[
1287
+ AngularElasticSeachModule,
1288
+ i1$2.provideFirebaseApp(function (injector) { return i1$2.initializeApp(injector.get(FIREBASE_OPTIONS), injector.get(FIREBASE_APP_NAME)); }),
1289
+ i1$1.provideFirestore(function () { return i1$1.getFirestore(); }),
1290
+ ]] });
1281
1291
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
1282
1292
  type: i0.NgModule,
1283
1293
  args: [{
1284
- imports: [fire.AngularFireModule, AngularElasticSeachModule],
1294
+ imports: [
1295
+ AngularElasticSeachModule,
1296
+ i1$2.provideFirebaseApp(function (injector) { return i1$2.initializeApp(injector.get(FIREBASE_OPTIONS), injector.get(FIREBASE_APP_NAME)); }),
1297
+ i1$1.provideFirestore(function () { return i1$1.getFirestore(); }),
1298
+ ],
1285
1299
  providers: [
1286
1300
  {
1287
1301
  provide: 'BeautyProfileRepository',
1288
1302
  useFactory: function (firestore, userRepository) {
1289
- return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
1303
+ return new i2.UserBeautyProfileFirestoreRepository(firestore, userRepository);
1290
1304
  },
1291
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1305
+ deps: [i1$1.Firestore, 'UserRepository'],
1292
1306
  },
1293
1307
  {
1294
1308
  provide: 'Buy2WinRepository',
1295
1309
  useFactory: function (firestore) {
1296
- return new i2.Buy2WinFirestoreRepository(firestore.firestore);
1310
+ return new i2.Buy2WinFirestoreRepository(firestore);
1297
1311
  },
1298
- deps: [i1$1.AngularFirestore],
1312
+ deps: [i1$1.Firestore],
1299
1313
  },
1300
1314
  {
1301
1315
  provide: 'CategoryRepository',
1302
- useFactory: function (firestore) {
1303
- return new i2.CategoryFirestoreRepository(firestore.firestore);
1316
+ useFactory: function (firestore, productsIndex) {
1317
+ return new i2.CategoryFirestoreRepository(firestore, productsIndex);
1304
1318
  },
1305
- deps: [i1$1.AngularFirestore],
1319
+ deps: [i1$1.Firestore, i2.ProductsIndex],
1306
1320
  },
1307
1321
  {
1308
1322
  provide: 'CheckoutRepository',
1309
1323
  useFactory: function (firestore) {
1310
- return new i2.CheckoutFirestoreRepository(firestore.firestore);
1324
+ return new i2.CheckoutFirestoreRepository(firestore);
1311
1325
  },
1312
- deps: [i1$1.AngularFirestore],
1326
+ deps: [i1$1.Firestore],
1313
1327
  },
1314
1328
  {
1315
1329
  provide: 'CheckoutSubscriptionRepository',
1316
1330
  useFactory: function (firestore) {
1317
- return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
1331
+ return new i2.CheckoutSubscriptionFirestoreRepository(firestore);
1318
1332
  },
1319
- deps: [i1$1.AngularFirestore],
1333
+ deps: [i1$1.Firestore],
1320
1334
  },
1321
1335
  {
1322
1336
  provide: 'CouponRepository',
1323
1337
  useFactory: function (firestore) {
1324
- return new i2.CouponFirestoreRepository(firestore.firestore);
1338
+ return new i2.CouponFirestoreRepository(firestore);
1325
1339
  },
1326
- deps: [i1$1.AngularFirestore],
1340
+ deps: [i1$1.Firestore],
1327
1341
  },
1328
1342
  {
1329
1343
  provide: 'EditionRepository',
1330
1344
  useFactory: function (firestore, subscriptionRepository) {
1331
- return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
1345
+ return new i2.SubscriptionEditionFirestoreRepository(firestore, subscriptionRepository);
1332
1346
  },
1333
- deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1347
+ deps: [i1$1.Firestore, 'SubscriptionRepository'],
1334
1348
  },
1335
1349
  {
1336
1350
  provide: 'HomeRepository',
1337
1351
  useFactory: function (firestore) {
1338
- return new i2.HomeFirestoreRepository(firestore.firestore);
1352
+ return new i2.HomeFirestoreRepository(firestore);
1339
1353
  },
1340
- deps: [i1$1.AngularFirestore],
1354
+ deps: [i1$1.Firestore],
1341
1355
  },
1342
1356
  {
1343
1357
  provide: 'LeadRepository',
1344
1358
  useFactory: function (firestore) {
1345
- return new i2.LeadFirestoreRepository(firestore.firestore);
1359
+ return new i2.LeadFirestoreRepository(firestore);
1346
1360
  },
1347
- deps: [i1$1.AngularFirestore],
1361
+ deps: [i1$1.Firestore],
1348
1362
  },
1349
1363
  {
1350
1364
  provide: 'LegacyOrderRepository',
1351
1365
  useFactory: function (firestore) {
1352
- return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
1366
+ return new i2.LegacyOrderFirestoreRepository(firestore);
1353
1367
  },
1354
- deps: [i1$1.AngularFirestore],
1368
+ deps: [i1$1.Firestore],
1355
1369
  },
1356
1370
  {
1357
1371
  provide: 'ShopMenuRepository',
1358
1372
  useFactory: function (firestore) {
1359
- return new i2.ShopMenuFirestoreRepository(firestore.firestore);
1373
+ return new i2.ShopMenuFirestoreRepository(firestore);
1360
1374
  },
1361
- deps: [i1$1.AngularFirestore],
1375
+ deps: [i1$1.Firestore],
1362
1376
  },
1363
1377
  {
1364
1378
  provide: 'OrderRepository',
1365
1379
  useFactory: function (firestore) {
1366
- return new i2.OrderFirestoreRepository(firestore.firestore);
1380
+ return new i2.OrderFirestoreRepository(firestore);
1367
1381
  },
1368
- deps: [i1$1.AngularFirestore],
1382
+ deps: [i1$1.Firestore],
1369
1383
  },
1370
1384
  {
1371
1385
  provide: 'PaymentRepository',
1372
1386
  useFactory: function (firestore) {
1373
- return new i2.PaymentFirestoreRepository(firestore.firestore);
1387
+ return new i2.PaymentFirestoreRepository(firestore);
1374
1388
  },
1375
- deps: [i1$1.AngularFirestore],
1389
+ deps: [i1$1.Firestore],
1376
1390
  },
1377
1391
  {
1378
1392
  provide: 'ProductRepository',
1379
1393
  useFactory: function (firestore) {
1380
- return new i2.ProductFirestoreRepository(firestore.firestore);
1394
+ return new i2.ProductFirestoreRepository(firestore);
1381
1395
  },
1382
- deps: [i1$1.AngularFirestore],
1396
+ deps: [i1$1.Firestore],
1383
1397
  },
1384
1398
  {
1385
1399
  provide: 'SubscriptionPaymentRepository',
1386
1400
  useFactory: function (firestore, subscriptionRepository) {
1387
- return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
1401
+ return new i2.SubscriptionPaymentFirestoreRepository(firestore, subscriptionRepository);
1388
1402
  },
1389
- deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
1403
+ deps: [i1$1.Firestore, 'SubscriptionRepository'],
1390
1404
  },
1391
1405
  {
1392
1406
  provide: 'SubscriptionPlanRepository',
1393
1407
  useFactory: function (firestore) {
1394
- return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
1408
+ return new i2.SubscriptionPlanFirestoreRepository(firestore);
1395
1409
  },
1396
- deps: [i1$1.AngularFirestore],
1410
+ deps: [i1$1.Firestore],
1397
1411
  },
1398
1412
  {
1399
1413
  provide: 'SubscriptionProductRepository',
1400
1414
  useFactory: function (firestore) {
1401
- return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
1415
+ return new i2.SubscriptionProductFirestoreRepository(firestore);
1402
1416
  },
1403
- deps: [i1$1.AngularFirestore],
1417
+ deps: [i1$1.Firestore],
1404
1418
  },
1405
1419
  {
1406
1420
  provide: 'SubscriptionRepository',
1407
1421
  useFactory: function (firestore) {
1408
- return new i2.SubscriptionFirestoreRepository(firestore.firestore);
1422
+ return new i2.SubscriptionFirestoreRepository(firestore);
1409
1423
  },
1410
- deps: [i1$1.AngularFirestore],
1424
+ deps: [i1$1.Firestore],
1411
1425
  },
1412
1426
  {
1413
1427
  provide: 'UserRepository',
1414
1428
  useFactory: function (firestore) {
1415
- return new i2.UserFirestoreRepository(firestore.firestore);
1429
+ return new i2.UserFirestoreRepository(firestore);
1416
1430
  },
1417
- deps: [i1$1.AngularFirestore],
1431
+ deps: [i1$1.Firestore],
1418
1432
  },
1419
1433
  {
1420
1434
  provide: 'UserAddressRepository',
1421
1435
  useFactory: function (firestore, userRepository) {
1422
- return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
1436
+ return new i2.UserAddressFirestoreRepository(firestore, userRepository);
1423
1437
  },
1424
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1438
+ deps: [i1$1.Firestore, 'UserRepository'],
1425
1439
  },
1426
1440
  {
1427
1441
  provide: 'UserPaymentMethodRepository',
1428
1442
  useFactory: function (firestore, userRepository) {
1429
- return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
1443
+ return new i2.UserPaymentMethodFirestoreRepository(firestore, userRepository);
1430
1444
  },
1431
- deps: [i1$1.AngularFirestore, 'UserRepository'],
1445
+ deps: [i1$1.Firestore, 'UserRepository'],
1432
1446
  },
1433
1447
  {
1434
1448
  provide: 'VariantRepository',
1435
1449
  useFactory: function (firestore, productRepository) {
1436
- return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
1450
+ return new i2.ProductVariantFirestoreRepository(firestore, productRepository);
1437
1451
  },
1438
- deps: [i1$1.AngularFirestore, 'ProductRepository'],
1452
+ deps: [i1$1.Firestore, 'ProductRepository'],
1439
1453
  },
1440
1454
  ],
1441
1455
  }]
@@ -1447,13 +1461,13 @@
1447
1461
  AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
1448
1462
  return {
1449
1463
  ngModule: AngularConnectModule,
1450
- providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.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((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))),
1464
+ providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))),
1451
1465
  };
1452
1466
  };
1453
1467
  return AngularConnectModule;
1454
1468
  }());
1455
1469
  AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1456
- AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
1470
+ AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [AngularFirebaseAuthModule, AngularFirestoreModule] });
1457
1471
  AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [
1458
1472
  AuthService,
1459
1473
  CartService,
@@ -1462,11 +1476,11 @@
1462
1476
  CouponService,
1463
1477
  HomeShopService,
1464
1478
  OrderService,
1465
- ], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
1479
+ ], imports: [[AngularFirebaseAuthModule, AngularFirestoreModule]] });
1466
1480
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
1467
1481
  type: i0.NgModule,
1468
1482
  args: [{
1469
- imports: [fire.AngularFireModule, AngularFirestoreModule],
1483
+ imports: [AngularFirebaseAuthModule, AngularFirestoreModule],
1470
1484
  providers: [
1471
1485
  AuthService,
1472
1486
  CartService,