ng-miam 9.0.9 → 9.0.11

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 (64) hide show
  1. package/bundles/ng-miam.umd.js +221 -137
  2. package/bundles/ng-miam.umd.js.map +1 -1
  3. package/bundles/ng-miam.umd.min.js +1 -1
  4. package/bundles/ng-miam.umd.min.js.map +1 -1
  5. package/esm2015/lib/_components/counter-input/counter-input.component.js +11 -5
  6. package/esm2015/lib/_services/basket-transfer.service.js +3 -6
  7. package/esm2015/lib/_services/baskets.service.js +18 -1
  8. package/esm2015/lib/_services/context.service.js +2 -1
  9. package/esm2015/lib/_services/interceptor.service.js +10 -3
  10. package/esm2015/lib/_services/recipe-details.service.js +2 -2
  11. package/esm2015/lib/_services/recipes.service.js +17 -5
  12. package/esm2015/lib/_services/store-locator.service.js +15 -3
  13. package/esm2015/lib/_services/user.service.js +3 -3
  14. package/esm2015/lib/_types/builded/mealz-interface.js +1 -1
  15. package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +3 -2
  16. package/esm2015/lib/_web-components/no-supplier-onboarding/no-supplier-onboarding.component.js +4 -4
  17. package/esm2015/lib/_web-components/preferences/preferences-search/preferences-search.component.js +5 -4
  18. package/esm2015/lib/_web-components/preferences/preferences.component.js +17 -9
  19. package/esm2015/lib/_web-components/recipe-cards/recipe-card/recipe-card.component.js +68 -70
  20. package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +7 -8
  21. package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +4 -4
  22. package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +8 -11
  23. package/esm2015/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.js +28 -8
  24. package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +7 -2
  25. package/esm2015/lib/_web-components/recipe-pricing/recipe-pricing.component.js +3 -4
  26. package/esm2015/lib/_web-components/warning-store-locator/warning-store-locator.component.js +4 -2
  27. package/esm2015/lib/environments/version.js +2 -2
  28. package/fesm2015/ng-miam.js +421 -340
  29. package/fesm2015/ng-miam.js.map +1 -1
  30. package/lib/_components/counter-input/counter-input.component.d.ts +4 -4
  31. package/lib/_components/counter-input/counter-input.component.d.ts.map +1 -1
  32. package/lib/_services/basket-transfer.service.d.ts.map +1 -1
  33. package/lib/_services/baskets.service.d.ts +1 -0
  34. package/lib/_services/baskets.service.d.ts.map +1 -1
  35. package/lib/_services/context.service.d.ts.map +1 -1
  36. package/lib/_services/interceptor.service.d.ts +1 -0
  37. package/lib/_services/interceptor.service.d.ts.map +1 -1
  38. package/lib/_services/recipe-details.service.d.ts +1 -1
  39. package/lib/_services/recipe-details.service.d.ts.map +1 -1
  40. package/lib/_services/recipes.service.d.ts +4 -3
  41. package/lib/_services/recipes.service.d.ts.map +1 -1
  42. package/lib/_services/store-locator.service.d.ts +3 -0
  43. package/lib/_services/store-locator.service.d.ts.map +1 -1
  44. package/lib/_services/user.service.d.ts +2 -2
  45. package/lib/_services/user.service.d.ts.map +1 -1
  46. package/lib/_types/builded/mealz-interface.d.ts +4 -0
  47. package/lib/_types/builded/mealz-interface.d.ts.map +1 -1
  48. package/lib/_web-components/preferences/preferences-search/preferences-search.component.d.ts.map +1 -1
  49. package/lib/_web-components/preferences/preferences.component.d.ts.map +1 -1
  50. package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts +1 -2
  51. package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts.map +1 -1
  52. package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts +1 -1
  53. package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts.map +1 -1
  54. package/lib/_web-components/recipe-details/recipe-details.component.d.ts +1 -1
  55. package/lib/_web-components/recipe-details/recipe-details.component.d.ts.map +1 -1
  56. package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts +3 -0
  57. package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts.map +1 -1
  58. package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts.map +1 -1
  59. package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts +1 -2
  60. package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts.map +1 -1
  61. package/lib/_web-components/warning-store-locator/warning-store-locator.component.d.ts.map +1 -1
  62. package/lib/environments/version.d.ts +1 -1
  63. package/lib/environments/version.d.ts.map +1 -1
  64. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('rxjs/operators'), require('mealz-shared-analytics'), require('duration-fns'), require('lodash-es'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('uuid'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
3
- typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'rxjs/operators', 'mealz-shared-analytics', 'duration-fns', 'lodash-es', 'lodash-es/pullAt', '@angular/cdk/layout', 'uuid', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$1, global.rxjs, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.rxjs.operators, global.mealzSharedAnalytics, global.duration, global.lodashEs, global.pullAt, global.ng.cdk.layout, global.uuid, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
5
- })(this, (function (exports, i1, i1$1, localeFr, i0, animations$1, i2$1, rxjs, i2, endOfWeek, isWithinInterval, startOfWeek, subDays, operators, mealzSharedAnalytics, duration, lodashEs, pullAt, i7, uuid, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('mealz-shared-analytics'), require('duration-fns'), require('lodash-es'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('uuid'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
3
+ typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', 'rxjs/operators', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'mealz-shared-analytics', 'duration-fns', 'lodash-es', 'lodash-es/pullAt', '@angular/cdk/layout', 'uuid', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$1, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.mealzSharedAnalytics, global.duration, global.lodashEs, global.pullAt, global.ng.cdk.layout, global.uuid, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
5
+ })(this, (function (exports, i1, i1$1, localeFr, i0, animations$1, i2$1, rxjs, operators, i2, endOfWeek, isWithinInterval, startOfWeek, subDays, mealzSharedAnalytics, duration, lodashEs, pullAt, i7, uuid, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -1225,7 +1225,7 @@
1225
1225
  if (this.valueSubject) {
1226
1226
  return;
1227
1227
  }
1228
- this.valueSubject = new rxjs.Subject();
1228
+ this.valueSubject = new rxjs.BehaviorSubject(this.value);
1229
1229
  this.lastValue = this.value;
1230
1230
  this.subscriptions.push(this.valueSubject
1231
1231
  .pipe(operators.debounceTime(this.debounceTime))
@@ -1237,7 +1237,13 @@
1237
1237
  _this.lastValue = _this.value;
1238
1238
  }));
1239
1239
  };
1240
- CounterInputComponent.prototype.ngOnChanges = function () {
1240
+ CounterInputComponent.prototype.ngOnChanges = function (changes) {
1241
+ var _a;
1242
+ if (!((_a = changes.value) === null || _a === void 0 ? void 0 : _a.isFirstChange())) {
1243
+ if (this.value !== this.valueSubject.value) {
1244
+ this.valueSubject.next(this.value);
1245
+ }
1246
+ }
1241
1247
  this.cdr.detectChanges();
1242
1248
  };
1243
1249
  CounterInputComponent.prototype.ngOnDestroy = function () {
@@ -3724,7 +3730,7 @@
3724
3730
  _this.ignoredBasketsService.resetIgnoredIngredients();
3725
3731
  }
3726
3732
  _this.initRoles();
3727
- return rxjs.combineLatest([_this.initProvider(), _this.initSupplier()]); // forkJoin does not work with BehaviorSubject as it never completes
3733
+ return rxjs.combineLatest([_this.initProvider(), _this.initSupplier()]);
3728
3734
  }), operators.skipWhile(function (res) { return res[0] === undefined || res[1] === undefined; }), operators.take(1));
3729
3735
  };
3730
3736
  UserService.prototype.resetUserInfo = function () {
@@ -4171,7 +4177,7 @@
4171
4177
  }], function () { return [{ type: i1__namespace$1.HttpClient }]; }, null);
4172
4178
  })();
4173
4179
 
4174
- var VERSION = '9.0.8'; // TODO: replace by ##VERSION## and update it in the CI/CD
4180
+ var VERSION = '9.0.11'; // TODO: replace by ##VERSION## and update it in the CI/CD
4175
4181
 
4176
4182
  /**
4177
4183
  * Analytics library cannot refer to "this." so we use a global variable
@@ -4762,8 +4768,10 @@
4762
4768
  this.storeLocatorOpened$ = new rxjs.BehaviorSubject(false);
4763
4769
  this.newStoreSelected$ = new rxjs.Subject();
4764
4770
  this.closeModalOnSelected = false;
4771
+ this.closeModalOnCancel = false;
4765
4772
  this.showStoreLocatorWarning = new rxjs.BehaviorSubject(false);
4766
4773
  this.showNoSupplierOnboarding = new rxjs.BehaviorSubject(false);
4774
+ this.changePosAfterWarnConfirm = true;
4767
4775
  this.storeLocatorOpened$.subscribe(function (opened) {
4768
4776
  if (opened && _this.storeLocatorOpenedTimestamp !== 0) {
4769
4777
  _this.storeLocatorOpenedTimestamp = Date.now();
@@ -4780,7 +4788,8 @@
4780
4788
  this.selectedSupplierName = e.detail.supplierName;
4781
4789
  this.storeLocatorEventTrace = eventTrace;
4782
4790
  // The following check is supposed to be temporary TODO remove
4783
- if (/Mobi|Android|iPhone/i.test(navigator.userAgent) && e.detail.supplierId === '7') {
4791
+ if (this.isStoreLocatorWarningNeeded(e.detail.supplierId)) {
4792
+ this.changePosAfterWarnConfirm = true;
4784
4793
  // Current device is a mobile device and the chosen supplier has not deactivated deep links
4785
4794
  this.showStoreLocatorWarning.next(true);
4786
4795
  }
@@ -4788,6 +4797,10 @@
4788
4797
  this.changePos();
4789
4798
  }
4790
4799
  };
4800
+ StoreLocatorService.prototype.isStoreLocatorWarningNeeded = function (supplierId) {
4801
+ // return /Mobi|Android|iPhone/i.test(navigator.userAgent) && supplierId === '7';
4802
+ return false; // deactivated for now
4803
+ };
4791
4804
  StoreLocatorService.prototype.changePos = function () {
4792
4805
  var _this = this;
4793
4806
  this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(operators.skipWhile(function (pos) { return !pos || pos.id !== _this.selectedPosId; }), operators.switchMap(function (pos) {
@@ -4808,7 +4821,12 @@
4808
4821
  };
4809
4822
  StoreLocatorService.prototype.closeStoreLocator = function () {
4810
4823
  if (this.storeLocatorOpened$.value) {
4811
- mealzSharedAnalytics.sendLocatorCloseEvent(url(this.storeLocatorEventTrace.originPath + "/locator"), ((Date.now() - this.storeLocatorOpenedTimestamp) / 1000).toString());
4824
+ if (this.storeLocatorEventTrace) {
4825
+ mealzSharedAnalytics.sendLocatorCloseEvent(url(this.storeLocatorEventTrace.originPath + "/locator"), ((Date.now() - this.storeLocatorOpenedTimestamp) / 1000).toString());
4826
+ }
4827
+ else {
4828
+ this.closeModalOnCancel = true;
4829
+ }
4812
4830
  this.storeLocatorOpenedTimestamp = 0;
4813
4831
  }
4814
4832
  this.storeLocatorOpened$.next(false);
@@ -5085,6 +5103,19 @@
5085
5103
  return recipes.data;
5086
5104
  }));
5087
5105
  };
5106
+ RecipesService.prototype.searchRecipeByExtId = function (recipeExtId) {
5107
+ var _this = this;
5108
+ var url = MIAM_API_HOST$2 + "recipes/external/" + recipeExtId;
5109
+ return this.http.get(url).pipe(operators.map(function (response) {
5110
+ var _a;
5111
+ if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === recipeExtId) {
5112
+ var recipe = _this.new();
5113
+ recipe.fill(response);
5114
+ return recipe;
5115
+ }
5116
+ return null;
5117
+ }));
5118
+ };
5088
5119
  RecipesService.prototype.getPricing = function (recipeId, posId, pricebookKey, serves) {
5089
5120
  if (serves === void 0) { serves = null; }
5090
5121
  if (!recipeId) {
@@ -5548,9 +5579,24 @@
5548
5579
  localStorage.removeItem('_miam/authlessId');
5549
5580
  }
5550
5581
  _this.currentSubscription = basketObservable.subscribe();
5582
+ _this.checkIfIsAffiliated();
5551
5583
  return _this._basket$;
5552
5584
  }));
5553
5585
  };
5586
+ BasketsService.prototype.checkIfIsAffiliated = function () {
5587
+ var getAffiliatedUrl = environment$1.miamAPI + "/api/v1/baskets/affiliated";
5588
+ this.http.get(getAffiliatedUrl).pipe(operators.take(1)).subscribe(function (response) {
5589
+ var affiliated = response === null || response === void 0 ? void 0 : response.affiliated;
5590
+ if (affiliated) {
5591
+ localStorage.setItem('_miam/affiliated', affiliated);
5592
+ mealzSharedAnalytics.setAffiliate(affiliated);
5593
+ }
5594
+ else {
5595
+ localStorage.removeItem('_miam/affiliated');
5596
+ mealzSharedAnalytics.setAffiliate(null);
5597
+ }
5598
+ });
5599
+ };
5554
5600
  BasketsService.prototype.transferAuthlessBasket = function (posId, authlessId) {
5555
5601
  var _this = this;
5556
5602
  this.statesService.callAuthlessTransfer.next();
@@ -5574,6 +5620,7 @@
5574
5620
  if (eventTrace === void 0) { eventTrace = { originPath: '', props: {} }; }
5575
5621
  mealzDebug('[Mealz] resetting basket');
5576
5622
  localStorage.removeItem('_miam/affiliate');
5623
+ mealzSharedAnalytics.setAffiliate(null);
5577
5624
  this.ignoredBasketsService.resetIgnoredIngredients();
5578
5625
  return this.posService.waitForPos.pipe(operators.take(1), operators.switchMap(function (pos) { return _this.waitForBasket.pipe(operators.tap(function (basket) { return _this.analyticsService.sendEventsOfResetBasket(basket, eventTrace); }), operators.switchMap(function () { return _this.get("reset?point_of_sale_id=" + pos.id + "&fields[baskets]=" + BASKET_SPARSE_FIELDS.baskets.join(',')).pipe(operators.switchMap(function (basket) { return _this.updateLocalBasket(basket); })); })); }));
5579
5626
  };
@@ -7481,6 +7528,7 @@
7481
7528
  },
7482
7529
  getByAddress: this.posService.getByAddress.bind(this.posService),
7483
7530
  getByCoordinates: this.posService.getByCoordinates.bind(this.posService),
7531
+ openNoSupplierOnboarding: function () { return _this.storeLocatorService.showNoSupplierOnboarding.next(true); }
7484
7532
  },
7485
7533
  recipes: {
7486
7534
  hidden: this.recipesService.hidden,
@@ -9046,12 +9094,8 @@
9046
9094
  this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
9047
9095
  };
9048
9096
  BasketTransferService.prototype.setSessionData = function (params) {
9049
- var _a;
9050
9097
  sessionStorage.setItem('_miam/transferredBasketToken', params.basketToken);
9051
9098
  sessionStorage.setItem('_miam/posOfSaleExtId', params.posExtId);
9052
- if (((_a = params.affiliate) === null || _a === void 0 ? void 0 : _a.length) > 0) {
9053
- localStorage.setItem('_miam/affiliate', params.affiliate);
9054
- }
9055
9099
  };
9056
9100
  BasketTransferService.prototype.clearTransferSessionData = function () {
9057
9101
  sessionStorage.removeItem('_miam/transferredBasketToken');
@@ -9080,7 +9124,8 @@
9080
9124
  BasketTransferService.prototype.navigateToTransferUrl = function () {
9081
9125
  var transferUrl = sessionStorage.getItem('_miam/transferUrl');
9082
9126
  if (transferUrl) {
9083
- window.open(transferUrl, '_blank');
9127
+ // Apparently Safari blocks window.open(..., "_blank") if called in an async function and setTimeout makes it run on the main thread
9128
+ setTimeout(function () { return window.open(transferUrl, '_blank'); });
9084
9129
  }
9085
9130
  };
9086
9131
  BasketTransferService.prototype.abortTransfer = function () {
@@ -9364,7 +9409,7 @@
9364
9409
  request = request.clone({ withCredentials: true });
9365
9410
  request = this.setUserProfiling(request);
9366
9411
  request = this.setSessionId(request);
9367
- return this.context.origin.pipe(operators.skipWhile(function (origin) { return !origin; }), operators.take(1), operators.switchMap(function () {
9412
+ return this.context.origin.pipe(operators.skipWhile(function (origin) { return !origin; }), operators.switchMap(function () { return rxjs.combineLatest([_this.usersService.userInfo$, _this.usersService.generatingAuthlessId$]); }), operators.skipWhile(function () { return _this.shouldWaitForAuthentication(request); }), operators.take(1), operators.switchMap(function () {
9368
9413
  request = _this.setMiamHeaders(request);
9369
9414
  return next.handle(request).pipe(operators.map(function (event) {
9370
9415
  var _a;
@@ -9446,6 +9491,13 @@
9446
9491
  this.context.setCORSIssueState(true);
9447
9492
  }
9448
9493
  };
9494
+ MiamInterceptor.prototype.shouldWaitForAuthentication = function (request) {
9495
+ // Skip all requests except the ones which sets the user / authless until we have a user / authless
9496
+ if (request.url.includes('user_info') || request.url.includes('users/authless')) {
9497
+ return false;
9498
+ }
9499
+ return !localStorage.getItem('_miam/userId') && !localStorage.getItem('_miam/authlessId');
9500
+ };
9449
9501
  return MiamInterceptor;
9450
9502
  }());
9451
9503
  MiamInterceptor.ɵfac = function MiamInterceptor_Factory(t) { return new (t || MiamInterceptor)(i0__namespace.ɵɵinject(ContextService), i0__namespace.ɵɵinject(UserService)); };
@@ -9765,7 +9817,7 @@
9765
9817
  this.recipeLoading$ = new rxjs.BehaviorSubject(false);
9766
9818
  this.basketEntryToReplace$ = new rxjs.BehaviorSubject(null);
9767
9819
  this.updateFooterDisplay$ = new rxjs.Subject();
9768
- this.displayEventWasSent = false;
9820
+ this.pageviewEventWasSent = false;
9769
9821
  this.onlyShowPreparation = false;
9770
9822
  this.noPosDisplay = false;
9771
9823
  this.invalidPosDisplay = false;
@@ -12263,9 +12315,8 @@
12263
12315
  var _this = this;
12264
12316
  var _a, _b;
12265
12317
  if (!(((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) && ((_b = this.recipeExtId) === null || _b === void 0 ? void 0 : _b.length) > 0) {
12266
- return this.recipesService.all({ remotefilter: { 'ext-id': this.recipeExtId, active: 'true,false' } }).pipe(operators.tap(function (response) {
12267
- var _a;
12268
- _this.recipeId = ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0].id : null;
12318
+ return this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(operators.tap(function (response) {
12319
+ _this.recipeId = (response === null || response === void 0 ? void 0 : response.id) || null;
12269
12320
  _this.cdr.detectChanges();
12270
12321
  }));
12271
12322
  }
@@ -17598,12 +17649,13 @@
17598
17649
  }
17599
17650
  };
17600
17651
  BasketPreviewBlockComponent.prototype.ngOnChanges = function (changes) {
17652
+ var _a;
17601
17653
  if (Object.keys(changes).includes('recipeId')) {
17602
17654
  this.loading.next(true);
17603
17655
  }
17604
17656
  if (changes.isStoreLocatorDisplayed &&
17605
17657
  changes.isStoreLocatorDisplayed.previousValue !== changes.isStoreLocatorDisplayed.currentValue &&
17606
- !this.isStoreLocatorDisplayed) {
17658
+ !this.isStoreLocatorDisplayed && ((_a = this.recipeService.displayedRecipe$.value) === null || _a === void 0 ? void 0 : _a.previewMode)) {
17607
17659
  this.pageview();
17608
17660
  }
17609
17661
  };
@@ -17657,8 +17709,8 @@
17657
17709
  recipe: recipe,
17658
17710
  basketEntries: basketEntries
17659
17711
  }); }));
17660
- })).subscribe(function (_a) {
17661
- var recipe = _a.recipe, basketEntries = _a.basketEntries;
17712
+ })).subscribe(function (_b) {
17713
+ var recipe = _b.recipe, basketEntries = _b.basketEntries;
17662
17714
  var clonedEntries = deepCloneWithClass(basketEntries);
17663
17715
  var matchedProducts = clonedEntries.map(function (basketEntry, index) { return ({
17664
17716
  basketEntry: basketEntry,
@@ -19298,7 +19350,7 @@
19298
19350
  var _r5_1 = i0__namespace.ɵɵgetCurrentView();
19299
19351
  i0__namespace.ɵɵelementStart(0, "div", 1);
19300
19352
  i0__namespace.ɵɵelementStart(1, "button", 2);
19301
- i0__namespace.ɵɵlistener("click", function RecipeCardCtaComponent_div_0_Template_button_click_1_listener() { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r4 = i0__namespace.ɵɵnextContext(); return ctx_r4.openRecipe(); });
19353
+ i0__namespace.ɵɵlistener("click", function RecipeCardCtaComponent_div_0_Template_button_click_1_listener($event) { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r4 = i0__namespace.ɵɵnextContext(); return ctx_r4.openRecipe($event); });
19302
19354
  i0__namespace.ɵɵtemplate(2, RecipeCardCtaComponent_div_0_ng_container_2_Template, 2, 0, "ng-container", 3);
19303
19355
  i0__namespace.ɵɵpipe(3, "async");
19304
19356
  i0__namespace.ɵɵtemplate(4, RecipeCardCtaComponent_div_0_ng_template_4_Template, 1, 0, "ng-template", null, 4, i0__namespace.ɵɵtemplateRefExtractor);
@@ -19362,7 +19414,7 @@
19362
19414
  }));
19363
19415
  }
19364
19416
  else if (!this.recipe && this.recipeExtId) {
19365
- this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
19417
+ this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(function (result) {
19366
19418
  _this.recipe = result;
19367
19419
  if (!result) {
19368
19420
  _this.hidden.emit();
@@ -19405,15 +19457,12 @@
19405
19457
  // Until supplier ids are the same as the provider ids we use the origin to determine the provider on which we filter
19406
19458
  return this.contextService.origin.pipe(operators.skipWhile(function (origin) { return !origin; }), operators.take(1), operators.switchMap(function (origin) { return _this.recipeService.all({ remotefilter: { recipe_provider_id: origin, search: _this.recipeName } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes.title) === _this.recipeName ? response.data[0] : null; })); }));
19407
19459
  };
19408
- RecipeCardCtaComponent.prototype.searchRecipeByExtId = function () {
19409
- var _this = this;
19410
- return this.recipeService.all({ remotefilter: { 'ext-id': this.recipeExtId } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0] : null; }));
19411
- };
19412
19460
  RecipeCardCtaComponent.prototype.currentPath = function () {
19413
19461
  return '';
19414
19462
  };
19415
- RecipeCardCtaComponent.prototype.openRecipe = function () {
19463
+ RecipeCardCtaComponent.prototype.openRecipe = function (event) {
19416
19464
  // const videoEvent = this.contextService.videoRecipesEnabled && this.recipe.videoId;
19465
+ event.stopPropagation();
19417
19466
  this.clicked.emit();
19418
19467
  this.recipeService.displayObject(this.recipe, {
19419
19468
  previewAllowed: this.previewAllowed,
@@ -19421,6 +19470,7 @@
19421
19470
  displayGuests: this.displayGuests,
19422
19471
  helpButtonAllowed: this.helpButtonAllowed
19423
19472
  }, this.eventTrace);
19473
+ mealzSharedAnalytics.sendRecipeDisplayEvent(this.path, this.recipe.id, this.eventTrace.props.category_id);
19424
19474
  this.displayed.emit();
19425
19475
  };
19426
19476
  RecipeCardCtaComponent.prototype.sendShowEvent = function () {
@@ -19473,36 +19523,32 @@
19473
19523
  }] });
19474
19524
  })();
19475
19525
 
19476
- function RecipeCardComponent_div_1_div_7_ng_template_1_ng_miam_like_button_0_Template(rf, ctx) {
19477
- if (rf & 1) {
19478
- i0__namespace.ɵɵelement(0, "ng-miam-like-button", 30);
19479
- }
19480
- if (rf & 2) {
19481
- var ctx_r13 = i0__namespace.ɵɵnextContext(4);
19482
- i0__namespace.ɵɵproperty("recipe", ctx_r13.recipe)("originTrace", ctx_r13.eventTrace);
19483
- }
19484
- }
19485
- function RecipeCardComponent_div_1_div_7_ng_template_1_Template(rf, ctx) {
19526
+ function RecipeCardComponent_div_1_div_7_ng_miam_like_button_1_Template(rf, ctx) {
19486
19527
  if (rf & 1) {
19487
- i0__namespace.ɵɵtemplate(0, RecipeCardComponent_div_1_div_7_ng_template_1_ng_miam_like_button_0_Template, 1, 2, "ng-miam-like-button", 24);
19488
- i0__namespace.ɵɵpipe(1, "async");
19528
+ i0__namespace.ɵɵelement(0, "ng-miam-like-button", 29);
19489
19529
  }
19490
19530
  if (rf & 2) {
19491
- var ctx_r12 = i0__namespace.ɵɵnextContext(3);
19492
- i0__namespace.ɵɵproperty("ngIf", !ctx_r12.displayLikesBottom && i0__namespace.ɵɵpipeBind1(1, 1, ctx_r12.userService.isLogged$));
19531
+ var ctx_r11 = i0__namespace.ɵɵnextContext(3);
19532
+ i0__namespace.ɵɵproperty("recipe", ctx_r11.recipe)("originTrace", ctx_r11.eventTrace);
19493
19533
  }
19494
19534
  }
19495
19535
  function RecipeCardComponent_div_1_div_7_Template(rf, ctx) {
19496
19536
  if (rf & 1) {
19497
19537
  i0__namespace.ɵɵelementStart(0, "div", 28);
19498
- i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_7_ng_template_1_Template, 2, 3, "ng-template", null, 29, i0__namespace.ɵɵtemplateRefExtractor);
19538
+ i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_7_ng_miam_like_button_1_Template, 1, 2, "ng-miam-like-button", 24);
19539
+ i0__namespace.ɵɵpipe(2, "async");
19499
19540
  i0__namespace.ɵɵelementEnd();
19500
19541
  }
19542
+ if (rf & 2) {
19543
+ var ctx_r1 = i0__namespace.ɵɵnextContext(2);
19544
+ i0__namespace.ɵɵadvance(1);
19545
+ i0__namespace.ɵɵproperty("ngIf", !ctx_r1.displayLikesBottom && i0__namespace.ɵɵpipeBind1(2, 1, ctx_r1.userService.isLogged$));
19546
+ }
19501
19547
  }
19502
19548
  function RecipeCardComponent_div_1_div_8_Template(rf, ctx) {
19503
19549
  if (rf & 1) {
19504
- i0__namespace.ɵɵelementStart(0, "div", 31);
19505
- i0__namespace.ɵɵelement(1, "img", 32);
19550
+ i0__namespace.ɵɵelementStart(0, "div", 30);
19551
+ i0__namespace.ɵɵelement(1, "img", 31);
19506
19552
  i0__namespace.ɵɵelementEnd();
19507
19553
  }
19508
19554
  if (rf & 2) {
@@ -19513,19 +19559,19 @@
19513
19559
  }
19514
19560
  function RecipeCardComponent_div_1_div_9_img_1_Template(rf, ctx) {
19515
19561
  if (rf & 1) {
19516
- i0__namespace.ɵɵelement(0, "img", 36);
19562
+ i0__namespace.ɵɵelement(0, "img", 35);
19517
19563
  }
19518
19564
  }
19519
19565
  function RecipeCardComponent_div_1_div_9_img_2_Template(rf, ctx) {
19520
19566
  if (rf & 1) {
19521
- i0__namespace.ɵɵelement(0, "img", 37);
19567
+ i0__namespace.ɵɵelement(0, "img", 36);
19522
19568
  }
19523
19569
  }
19524
19570
  function RecipeCardComponent_div_1_div_9_Template(rf, ctx) {
19525
19571
  if (rf & 1) {
19526
- i0__namespace.ɵɵelementStart(0, "div", 33);
19527
- i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_9_img_1_Template, 1, 0, "img", 34);
19528
- i0__namespace.ɵɵtemplate(2, RecipeCardComponent_div_1_div_9_img_2_Template, 1, 0, "img", 35);
19572
+ i0__namespace.ɵɵelementStart(0, "div", 32);
19573
+ i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_9_img_1_Template, 1, 0, "img", 33);
19574
+ i0__namespace.ɵɵtemplate(2, RecipeCardComponent_div_1_div_9_img_2_Template, 1, 0, "img", 34);
19529
19575
  i0__namespace.ɵɵelementEnd();
19530
19576
  }
19531
19577
  if (rf & 2) {
@@ -19539,31 +19585,31 @@
19539
19585
  }
19540
19586
  function RecipeCardComponent_div_1_div_19_div_5_Template(rf, ctx) {
19541
19587
  if (rf & 1) {
19542
- i0__namespace.ɵɵelementStart(0, "div", 43);
19588
+ i0__namespace.ɵɵelementStart(0, "div", 42);
19543
19589
  i0__namespace.ɵɵtext(1);
19544
19590
  i0__namespace.ɵɵelementEnd();
19545
19591
  }
19546
19592
  if (rf & 2) {
19547
- var ctx_r16 = i0__namespace.ɵɵnextContext(3);
19593
+ var ctx_r14 = i0__namespace.ɵɵnextContext(3);
19548
19594
  i0__namespace.ɵɵadvance(1);
19549
- i0__namespace.ɵɵtextInterpolate1(" + ", ctx_r16.recipe.modifiedIngredients.length - 2, " ");
19595
+ i0__namespace.ɵɵtextInterpolate1(" + ", ctx_r14.recipe.modifiedIngredients.length - 2, " ");
19550
19596
  }
19551
19597
  }
19552
19598
  function RecipeCardComponent_div_1_div_19_Template(rf, ctx) {
19553
19599
  if (rf & 1) {
19554
- var _r18_1 = i0__namespace.ɵɵgetCurrentView();
19555
- i0__namespace.ɵɵelementStart(0, "div", 38);
19556
- i0__namespace.ɵɵelementStart(1, "div", 39);
19557
- i0__namespace.ɵɵelementStart(2, "img", 40);
19558
- i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_div_19_Template_img_error_2_listener($event) { i0__namespace.ɵɵrestoreView(_r18_1); var ctx_r17 = i0__namespace.ɵɵnextContext(2); return ($event.target["src"] = ctx_r17.contextService.defaultIngredientPicture); });
19600
+ var _r16_1 = i0__namespace.ɵɵgetCurrentView();
19601
+ i0__namespace.ɵɵelementStart(0, "div", 37);
19602
+ i0__namespace.ɵɵelementStart(1, "div", 38);
19603
+ i0__namespace.ɵɵelementStart(2, "img", 39);
19604
+ i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_div_19_Template_img_error_2_listener($event) { i0__namespace.ɵɵrestoreView(_r16_1); var ctx_r15 = i0__namespace.ɵɵnextContext(2); return ($event.target["src"] = ctx_r15.contextService.defaultIngredientPicture); });
19559
19605
  i0__namespace.ɵɵelementEnd();
19560
19606
  i0__namespace.ɵɵelementEnd();
19561
- i0__namespace.ɵɵelementStart(3, "div", 39);
19562
- i0__namespace.ɵɵelementStart(4, "img", 41);
19563
- i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_div_19_Template_img_error_4_listener($event) { i0__namespace.ɵɵrestoreView(_r18_1); var ctx_r19 = i0__namespace.ɵɵnextContext(2); return ($event.target["src"] = ctx_r19.contextService.defaultIngredientPicture); });
19607
+ i0__namespace.ɵɵelementStart(3, "div", 38);
19608
+ i0__namespace.ɵɵelementStart(4, "img", 40);
19609
+ i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_div_19_Template_img_error_4_listener($event) { i0__namespace.ɵɵrestoreView(_r16_1); var ctx_r17 = i0__namespace.ɵɵnextContext(2); return ($event.target["src"] = ctx_r17.contextService.defaultIngredientPicture); });
19564
19610
  i0__namespace.ɵɵelementEnd();
19565
19611
  i0__namespace.ɵɵelementEnd();
19566
- i0__namespace.ɵɵtemplate(5, RecipeCardComponent_div_1_div_19_div_5_Template, 2, 1, "div", 42);
19612
+ i0__namespace.ɵɵtemplate(5, RecipeCardComponent_div_1_div_19_div_5_Template, 2, 1, "div", 41);
19567
19613
  i0__namespace.ɵɵelementEnd();
19568
19614
  }
19569
19615
  if (rf & 2) {
@@ -19578,39 +19624,39 @@
19578
19624
  }
19579
19625
  function RecipeCardComponent_div_1_div_22_div_1_Template(rf, ctx) {
19580
19626
  if (rf & 1) {
19581
- i0__namespace.ɵɵelementStart(0, "div", 47);
19582
- i0__namespace.ɵɵelement(1, "img", 48);
19583
- i0__namespace.ɵɵelementStart(2, "span", 49);
19627
+ i0__namespace.ɵɵelementStart(0, "div", 46);
19628
+ i0__namespace.ɵɵelement(1, "img", 47);
19629
+ i0__namespace.ɵɵelementStart(2, "span", 48);
19584
19630
  i0__namespace.ɵɵtext(3);
19585
19631
  i0__namespace.ɵɵelementEnd();
19586
19632
  i0__namespace.ɵɵelementEnd();
19587
19633
  }
19588
19634
  if (rf & 2) {
19589
- var ctx_r20 = i0__namespace.ɵɵnextContext(3);
19635
+ var ctx_r18 = i0__namespace.ɵɵnextContext(3);
19590
19636
  i0__namespace.ɵɵadvance(3);
19591
- i0__namespace.ɵɵtextInterpolate(ctx_r20.recipeService.difficultyLevels[ctx_r20.recipe.difficulty - 1].label);
19637
+ i0__namespace.ɵɵtextInterpolate(ctx_r18.recipeService.difficultyLevels[ctx_r18.recipe.difficulty - 1].label);
19592
19638
  }
19593
19639
  }
19594
19640
  function RecipeCardComponent_div_1_div_22_div_2_Template(rf, ctx) {
19595
19641
  if (rf & 1) {
19596
- i0__namespace.ɵɵelementStart(0, "div", 50);
19597
- i0__namespace.ɵɵelement(1, "img", 51);
19598
- i0__namespace.ɵɵelementStart(2, "span", 49);
19642
+ i0__namespace.ɵɵelementStart(0, "div", 49);
19643
+ i0__namespace.ɵɵelement(1, "img", 50);
19644
+ i0__namespace.ɵɵelementStart(2, "span", 48);
19599
19645
  i0__namespace.ɵɵtext(3);
19600
19646
  i0__namespace.ɵɵelementEnd();
19601
19647
  i0__namespace.ɵɵelementEnd();
19602
19648
  }
19603
19649
  if (rf & 2) {
19604
- var ctx_r21 = i0__namespace.ɵɵnextContext(3);
19650
+ var ctx_r19 = i0__namespace.ɵɵnextContext(3);
19605
19651
  i0__namespace.ɵɵadvance(3);
19606
- i0__namespace.ɵɵtextInterpolate(ctx_r21.recipe.totalTime);
19652
+ i0__namespace.ɵɵtextInterpolate(ctx_r19.recipe.totalTime);
19607
19653
  }
19608
19654
  }
19609
19655
  function RecipeCardComponent_div_1_div_22_Template(rf, ctx) {
19610
19656
  if (rf & 1) {
19611
- i0__namespace.ɵɵelementStart(0, "div", 44);
19612
- i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_22_div_1_Template, 4, 1, "div", 45);
19613
- i0__namespace.ɵɵtemplate(2, RecipeCardComponent_div_1_div_22_div_2_Template, 4, 1, "div", 46);
19657
+ i0__namespace.ɵɵelementStart(0, "div", 43);
19658
+ i0__namespace.ɵɵtemplate(1, RecipeCardComponent_div_1_div_22_div_1_Template, 4, 1, "div", 44);
19659
+ i0__namespace.ɵɵtemplate(2, RecipeCardComponent_div_1_div_22_div_2_Template, 4, 1, "div", 45);
19614
19660
  i0__namespace.ɵɵelementEnd();
19615
19661
  }
19616
19662
  if (rf & 2) {
@@ -19623,8 +19669,8 @@
19623
19669
  }
19624
19670
  function RecipeCardComponent_div_1_div_23_Template(rf, ctx) {
19625
19671
  if (rf & 1) {
19626
- i0__namespace.ɵɵelementStart(0, "div", 52);
19627
- i0__namespace.ɵɵelement(1, "ng-miam-recipe-pricing", 53);
19672
+ i0__namespace.ɵɵelementStart(0, "div", 51);
19673
+ i0__namespace.ɵɵelement(1, "ng-miam-recipe-pricing", 52);
19628
19674
  i0__namespace.ɵɵelementEnd();
19629
19675
  }
19630
19676
  if (rf & 2) {
@@ -19635,7 +19681,7 @@
19635
19681
  }
19636
19682
  function RecipeCardComponent_div_1_ng_miam_like_button_25_Template(rf, ctx) {
19637
19683
  if (rf & 1) {
19638
- i0__namespace.ɵɵelement(0, "ng-miam-like-button", 30);
19684
+ i0__namespace.ɵɵelement(0, "ng-miam-like-button", 29);
19639
19685
  }
19640
19686
  if (rf & 2) {
19641
19687
  var ctx_r7 = i0__namespace.ɵɵnextContext(2);
@@ -19644,9 +19690,9 @@
19644
19690
  }
19645
19691
  function RecipeCardComponent_div_1_ng_miam_recipe_card_cta_27_Template(rf, ctx) {
19646
19692
  if (rf & 1) {
19647
- var _r23_1 = i0__namespace.ɵɵgetCurrentView();
19648
- i0__namespace.ɵɵelementStart(0, "ng-miam-recipe-card-cta", 54);
19649
- i0__namespace.ɵɵlistener("displayed", function RecipeCardComponent_div_1_ng_miam_recipe_card_cta_27_Template_ng_miam_recipe_card_cta_displayed_0_listener() { i0__namespace.ɵɵrestoreView(_r23_1); var ctx_r22 = i0__namespace.ɵɵnextContext(2); return ctx_r22.displayed.emit(); })("clicked", function RecipeCardComponent_div_1_ng_miam_recipe_card_cta_27_Template_ng_miam_recipe_card_cta_clicked_0_listener($event) { i0__namespace.ɵɵrestoreView(_r23_1); var ctx_r24 = i0__namespace.ɵɵnextContext(2); return ctx_r24.primaryButtonClicked$.emit($event); });
19693
+ var _r21_1 = i0__namespace.ɵɵgetCurrentView();
19694
+ i0__namespace.ɵɵelementStart(0, "ng-miam-recipe-card-cta", 53);
19695
+ i0__namespace.ɵɵlistener("displayed", function RecipeCardComponent_div_1_ng_miam_recipe_card_cta_27_Template_ng_miam_recipe_card_cta_displayed_0_listener() { i0__namespace.ɵɵrestoreView(_r21_1); var ctx_r20 = i0__namespace.ɵɵnextContext(2); return ctx_r20.displayed.emit(); })("clicked", function RecipeCardComponent_div_1_ng_miam_recipe_card_cta_27_Template_ng_miam_recipe_card_cta_clicked_0_listener($event) { i0__namespace.ɵɵrestoreView(_r21_1); var ctx_r22 = i0__namespace.ɵɵnextContext(2); return ctx_r22.primaryButtonClicked$.emit($event); });
19650
19696
  i0__namespace.ɵɵelementEnd();
19651
19697
  }
19652
19698
  if (rf & 2) {
@@ -19656,17 +19702,17 @@
19656
19702
  }
19657
19703
  function RecipeCardComponent_div_1_div_28_Template(rf, ctx) {
19658
19704
  if (rf & 1) {
19659
- var _r26_1 = i0__namespace.ɵɵgetCurrentView();
19660
- i0__namespace.ɵɵelementStart(0, "div", 55);
19661
- i0__namespace.ɵɵelementStart(1, "button", 56);
19662
- i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_div_28_Template_button_click_1_listener() { i0__namespace.ɵɵrestoreView(_r26_1); var ctx_r25 = i0__namespace.ɵɵnextContext(2); return ctx_r25.openCatalog.emit(); });
19705
+ var _r24_1 = i0__namespace.ɵɵgetCurrentView();
19706
+ i0__namespace.ɵɵelementStart(0, "div", 54);
19707
+ i0__namespace.ɵɵelementStart(1, "button", 55);
19708
+ i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_div_28_Template_button_click_1_listener() { i0__namespace.ɵɵrestoreView(_r24_1); var ctx_r23 = i0__namespace.ɵɵnextContext(2); return ctx_r23.openCatalog.emit(); });
19663
19709
  i0__namespace.ɵɵelementStart(2, "span");
19664
- i0__namespace.ɵɵi18n(3, 57);
19710
+ i0__namespace.ɵɵi18n(3, 56);
19665
19711
  i0__namespace.ɵɵelementEnd();
19666
19712
  i0__namespace.ɵɵelementEnd();
19667
- i0__namespace.ɵɵelementStart(4, "button", 58);
19668
- i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_div_28_Template_button_click_4_listener() { i0__namespace.ɵɵrestoreView(_r26_1); var ctx_r27 = i0__namespace.ɵɵnextContext(2); return ctx_r27.removeFromMealsPlanner.emit(); });
19669
- i0__namespace.ɵɵelement(5, "ng-miam-icon", 59);
19713
+ i0__namespace.ɵɵelementStart(4, "button", 57);
19714
+ i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_div_28_Template_button_click_4_listener() { i0__namespace.ɵɵrestoreView(_r24_1); var ctx_r25 = i0__namespace.ɵɵnextContext(2); return ctx_r25.removeFromMealsPlanner.emit(); });
19715
+ i0__namespace.ɵɵelement(5, "ng-miam-icon", 58);
19670
19716
  i0__namespace.ɵɵelementEnd();
19671
19717
  i0__namespace.ɵɵelementEnd();
19672
19718
  }
@@ -19678,31 +19724,31 @@
19678
19724
  }
19679
19725
  function RecipeCardComponent_div_1_button_29_Template(rf, ctx) {
19680
19726
  if (rf & 1) {
19681
- var _r29_1 = i0__namespace.ɵɵgetCurrentView();
19682
- i0__namespace.ɵɵelementStart(0, "button", 56);
19683
- i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_button_29_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r29_1); var ctx_r28 = i0__namespace.ɵɵnextContext(2); return ctx_r28.addToMealsPlanner.emit(ctx_r28.recipe); });
19727
+ var _r27_1 = i0__namespace.ɵɵgetCurrentView();
19728
+ i0__namespace.ɵɵelementStart(0, "button", 55);
19729
+ i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_button_29_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r27_1); var ctx_r26 = i0__namespace.ɵɵnextContext(2); return ctx_r26.addToMealsPlanner.emit(ctx_r26.recipe); });
19684
19730
  i0__namespace.ɵɵelementStart(1, "span");
19685
- i0__namespace.ɵɵi18n(2, 60);
19731
+ i0__namespace.ɵɵi18n(2, 59);
19686
19732
  i0__namespace.ɵɵelementEnd();
19687
19733
  i0__namespace.ɵɵelementEnd();
19688
19734
  }
19689
19735
  }
19690
19736
  function RecipeCardComponent_div_1_Template(rf, ctx) {
19691
19737
  if (rf & 1) {
19692
- var _r31_1 = i0__namespace.ɵɵgetCurrentView();
19738
+ var _r29_1 = i0__namespace.ɵɵgetCurrentView();
19693
19739
  i0__namespace.ɵɵelementStart(0, "div", 2);
19694
- i0__namespace.ɵɵlistener("inViewport", function RecipeCardComponent_div_1_Template_div_inViewport_0_listener() { i0__namespace.ɵɵrestoreView(_r31_1); var ctx_r30 = i0__namespace.ɵɵnextContext(); return ctx_r30.cardInViewport(); });
19740
+ i0__namespace.ɵɵlistener("inViewport", function RecipeCardComponent_div_1_Template_div_inViewport_0_listener() { i0__namespace.ɵɵrestoreView(_r29_1); var ctx_r28 = i0__namespace.ɵɵnextContext(); return ctx_r28.cardInViewport(); });
19695
19741
  i0__namespace.ɵɵelementStart(1, "div", 3);
19696
- i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_Template_div_click_1_listener() { i0__namespace.ɵɵrestoreView(_r31_1); var ctx_r32 = i0__namespace.ɵɵnextContext(); return ctx_r32.openRecipe(); });
19742
+ i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_Template_div_click_1_listener() { i0__namespace.ɵɵrestoreView(_r29_1); var ctx_r30 = i0__namespace.ɵɵnextContext(); return ctx_r30.openRecipe(); });
19697
19743
  i0__namespace.ɵɵelementStart(2, "div", 4);
19698
19744
  i0__namespace.ɵɵelementStart(3, "img", 5);
19699
- i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_Template_img_error_3_listener($event) { i0__namespace.ɵɵrestoreView(_r31_1); var ctx_r33 = i0__namespace.ɵɵnextContext(); return ($event.target["src"] = ctx_r33.contextService.defaultRecipePicture); });
19745
+ i0__namespace.ɵɵlistener("error", function RecipeCardComponent_div_1_Template_img_error_3_listener($event) { i0__namespace.ɵɵrestoreView(_r29_1); var ctx_r31 = i0__namespace.ɵɵnextContext(); return ($event.target["src"] = ctx_r31.contextService.defaultRecipePicture); });
19700
19746
  i0__namespace.ɵɵelementEnd();
19701
19747
  i0__namespace.ɵɵelementEnd();
19702
19748
  i0__namespace.ɵɵelement(4, "div", 6);
19703
19749
  i0__namespace.ɵɵelementStart(5, "div", 7);
19704
19750
  i0__namespace.ɵɵelementStart(6, "div", 8);
19705
- i0__namespace.ɵɵtemplate(7, RecipeCardComponent_div_1_div_7_Template, 3, 0, "div", 9);
19751
+ i0__namespace.ɵɵtemplate(7, RecipeCardComponent_div_1_div_7_Template, 3, 3, "div", 9);
19706
19752
  i0__namespace.ɵɵtemplate(8, RecipeCardComponent_div_1_div_8_Template, 2, 1, "div", 10);
19707
19753
  i0__namespace.ɵɵtemplate(9, RecipeCardComponent_div_1_div_9_Template, 3, 3, "div", 11);
19708
19754
  i0__namespace.ɵɵelementEnd();
@@ -19722,7 +19768,7 @@
19722
19768
  i0__namespace.ɵɵelementEnd();
19723
19769
  i0__namespace.ɵɵelementEnd();
19724
19770
  i0__namespace.ɵɵelementStart(18, "div", 17);
19725
- i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_Template_div_click_18_listener() { i0__namespace.ɵɵrestoreView(_r31_1); var ctx_r34 = i0__namespace.ɵɵnextContext(); return ctx_r34.openRecipe(); });
19771
+ i0__namespace.ɵɵlistener("click", function RecipeCardComponent_div_1_Template_div_click_18_listener() { i0__namespace.ɵɵrestoreView(_r29_1); var ctx_r32 = i0__namespace.ɵɵnextContext(); return ctx_r32.openRecipe(); });
19726
19772
  i0__namespace.ɵɵtemplate(19, RecipeCardComponent_div_1_div_19_Template, 6, 3, "div", 18);
19727
19773
  i0__namespace.ɵɵelementStart(20, "div", 19);
19728
19774
  i0__namespace.ɵɵelementStart(21, "div", 20);
@@ -19995,7 +20041,7 @@
19995
20041
  else {
19996
20042
  i18n_2 = $localize(templateObject_2$j || (templateObject_2$j = __makeTemplateObject([":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"], [":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"])));
19997
20043
  }
19998
- return [["ngMiamInViewport", "", 1, "miam-recipe-card", 3, "condition", "ngClass", "inViewport"], ["class", "miam-recipe-card__container", "ngMiamInViewport", "", 3, "threshold", "debounceTime", "inViewport", 4, "ngIf"], ["ngMiamInViewport", "", 1, "miam-recipe-card__container", 3, "threshold", "debounceTime", "inViewport"], [1, "miam-recipe-card__top", 3, "click"], [1, "miam-recipe-card__picture"], ["loading", "lazy", 3, "src", "alt", "error"], [1, "miam-recipe-card__gradient"], [1, "miam-recipe-card__content"], [1, "miam-recipe-card__top-container"], ["class", "miam-recipe-card__like", 4, "ngIf"], ["class", "miam-recipe-card__sponsor-container", 4, "ngIf"], ["class", "miam-recipe-card__badge-container", 3, "ngClass", 4, "ngIf"], [1, "miam-recipe-card__picture__bottom"], [1, "miam-recipe-card__title", "miam-ds-text", "weight-xxl", "size-m"], [1, "miam-recipe-card__counter"], [1, "miam-ds-text", "weight-xxl", "size-m"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/recipe-counter.svg", "alt", "people"], [1, "miam-recipe-card__bottom", 3, "click"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], [1, "miam-recipe-card__actions"], [1, "miam-recipe-card__infos"], ["class", "miam-recipe-card__difficulty-and-time", 4, "ngIf"], ["class", "miam-recipe-card__price", 4, "ngIf"], [1, "miam-recipe-card__cta"], ["class", "miam-recipe-card__actions__icon", 3, "recipe", "originTrace", 4, "ngIf"], [3, "recipe", "previewAllowed", "displayGuests", "helpButtonAllowed", "originTrace", "displayed", "clicked", 4, "ngIf"], ["class", "miam-recipe-card__actions__replace", 4, "ngIf"], ["class", "miam-ds-button ghost", 3, "click", 4, "ngIf"], [1, "miam-recipe-card__like"], ["like", ""], [1, "miam-recipe-card__actions__icon", 3, "recipe", "originTrace"], [1, "miam-recipe-card__sponsor-container"], ["alt", "sponsor picture", 1, "miam-recipe-card__sponsor-picture", 3, "src"], [1, "miam-recipe-card__badge-container", 3, "ngClass"], ["class", "miam-recipe-card__badge", "src", "https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg", "alt", "recipe badge", 4, "ngIf"], ["class", "miam-recipe-card__badge", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg", "alt", "drink badge", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg", "alt", "recipe badge", 1, "miam-recipe-card__badge"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg", "alt", "drink badge", 1, "miam-recipe-card__badge"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], ["alt", "first ingredient picture", 3, "src", "error"], ["alt", "second ingredient picture", 3, "src", "error"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [1, "miam-recipe-card__difficulty-and-time"], ["class", "miam-recipe-card__difficulty", 4, "ngIf"], ["class", "miam-recipe-card__time", 4, "ngIf"], [1, "miam-recipe-card__difficulty"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/ChefHat.svg", "alt", "difficulty"], [1, "miam-ds-text", "size-s", "weight-m"], [1, "miam-recipe-card__time"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Clock.svg", "alt", "time"], [1, "miam-recipe-card__price"], [1, "miam-ds-text", "weight-xxl", 3, "recipeId", "serves", "inViewport"], [3, "recipe", "previewAllowed", "displayGuests", "helpButtonAllowed", "originTrace", "displayed", "clicked"], [1, "miam-recipe-card__actions__replace"], [1, "miam-ds-button", "ghost", 3, "click"], i18n_0, [1, "miam-ds-button", "ghost", "square", 3, "click"], ["primaryColor", "var(--m-color-primary)", 3, "iconName"], i18n_2];
20044
+ return [["ngMiamInViewport", "", 1, "miam-recipe-card", 3, "condition", "ngClass", "inViewport"], ["class", "miam-recipe-card__container", "ngMiamInViewport", "", 3, "threshold", "debounceTime", "inViewport", 4, "ngIf"], ["ngMiamInViewport", "", 1, "miam-recipe-card__container", 3, "threshold", "debounceTime", "inViewport"], [1, "miam-recipe-card__top", 3, "click"], [1, "miam-recipe-card__picture"], ["loading", "lazy", 3, "src", "alt", "error"], [1, "miam-recipe-card__gradient"], [1, "miam-recipe-card__content"], [1, "miam-recipe-card__top-container"], ["class", "miam-recipe-card__like", 4, "ngIf"], ["class", "miam-recipe-card__sponsor-container", 4, "ngIf"], ["class", "miam-recipe-card__badge-container", 3, "ngClass", 4, "ngIf"], [1, "miam-recipe-card__picture__bottom"], [1, "miam-recipe-card__title", "miam-ds-text", "weight-xxl", "size-m"], [1, "miam-recipe-card__counter"], [1, "miam-ds-text", "weight-xxl", "size-m"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/recipe-counter.svg", "alt", "people"], [1, "miam-recipe-card__bottom", 3, "click"], ["class", "miam-recipe-card__ingredients__pictures", 4, "ngIf"], [1, "miam-recipe-card__actions"], [1, "miam-recipe-card__infos"], ["class", "miam-recipe-card__difficulty-and-time", 4, "ngIf"], ["class", "miam-recipe-card__price", 4, "ngIf"], [1, "miam-recipe-card__cta"], ["class", "miam-recipe-card__actions__icon", 3, "recipe", "originTrace", 4, "ngIf"], [3, "recipe", "previewAllowed", "displayGuests", "helpButtonAllowed", "originTrace", "displayed", "clicked", 4, "ngIf"], ["class", "miam-recipe-card__actions__replace", 4, "ngIf"], ["class", "miam-ds-button ghost", 3, "click", 4, "ngIf"], [1, "miam-recipe-card__like"], [1, "miam-recipe-card__actions__icon", 3, "recipe", "originTrace"], [1, "miam-recipe-card__sponsor-container"], ["alt", "sponsor picture", 1, "miam-recipe-card__sponsor-picture", 3, "src"], [1, "miam-recipe-card__badge-container", 3, "ngClass"], ["class", "miam-recipe-card__badge", "src", "https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg", "alt", "recipe badge", 4, "ngIf"], ["class", "miam-recipe-card__badge", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg", "alt", "drink badge", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/images/recipe_card-badge.svg", "alt", "recipe badge", 1, "miam-recipe-card__badge"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/9.0/recipe-card-badge-drinks.svg", "alt", "drink badge", 1, "miam-recipe-card__badge"], [1, "miam-recipe-card__ingredients__pictures"], [1, "miam-recipe-card__ingredients__picture"], ["alt", "first ingredient picture", 3, "src", "error"], ["alt", "second ingredient picture", 3, "src", "error"], ["class", "miam-recipe-card__ingredients__more", 4, "ngIf"], [1, "miam-recipe-card__ingredients__more"], [1, "miam-recipe-card__difficulty-and-time"], ["class", "miam-recipe-card__difficulty", 4, "ngIf"], ["class", "miam-recipe-card__time", 4, "ngIf"], [1, "miam-recipe-card__difficulty"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/ChefHat.svg", "alt", "difficulty"], [1, "miam-ds-text", "size-s", "weight-m"], [1, "miam-recipe-card__time"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Clock.svg", "alt", "time"], [1, "miam-recipe-card__price"], [1, "miam-ds-text", "weight-xxl", 3, "recipeId", "serves", "inViewport"], [3, "recipe", "previewAllowed", "displayGuests", "helpButtonAllowed", "originTrace", "displayed", "clicked"], [1, "miam-recipe-card__actions__replace"], [1, "miam-ds-button", "ghost", 3, "click"], i18n_0, [1, "miam-ds-button", "ghost", "square", 3, "click"], ["primaryColor", "var(--m-color-primary)", 3, "iconName"], i18n_2];
19999
20045
  }, template: function RecipeCardComponent_Template(rf, ctx) {
20000
20046
  if (rf & 1) {
20001
20047
  i0__namespace.ɵɵelementStart(0, "div", 0);
@@ -22951,9 +22997,10 @@
22951
22997
  return rxjs.of([]);
22952
22998
  }
22953
22999
  })).subscribe(function (tags) {
22954
- var _a;
22955
- _this.suggestedTags = tags.data;
22956
- _this.notFound = ((_a = _this.suggestedTags) === null || _a === void 0 ? void 0 : _a.length) === 0;
23000
+ var _a, _b;
23001
+ _this.suggestedTags = (_a = tags === null || tags === void 0 ? void 0 : tags.data) === null || _a === void 0 ? void 0 : _a.filter(function (tag) { return tag.attributes['tag-type-id'] === 'ingredient_category' ||
23002
+ tag.attributes['tag-type-id'] === 'ingredientsdefinition'; });
23003
+ _this.notFound = ((_b = _this.suggestedTags) === null || _b === void 0 ? void 0 : _b.length) === 0;
22957
23004
  _this.cdr.detectChanges();
22958
23005
  }));
22959
23006
  };
@@ -23396,10 +23443,12 @@
23396
23443
  this.preferencesService.updatePreferences();
23397
23444
  this.preferencesChanged.emit();
23398
23445
  if (this.contextService.isPreferencesSSR) {
23399
- this.updateFiltersInCache();
23446
+ this.updateFiltersInCache(true);
23447
+ }
23448
+ else {
23449
+ this.contextService.preferencesChanged.emit();
23450
+ this.close();
23400
23451
  }
23401
- this.contextService.preferencesChanged.emit();
23402
- this.close();
23403
23452
  };
23404
23453
  PreferencesComponent.prototype.close = function () {
23405
23454
  this.isOpen = false;
@@ -23416,13 +23465,21 @@
23416
23465
  PreferencesComponent.prototype.whitelistedTags = function (tags) {
23417
23466
  return tags.filter(function (tag) { return environment$1.tagsWhitelist.includes(tag.id); });
23418
23467
  };
23419
- PreferencesComponent.prototype.updateFiltersInCache = function () {
23468
+ PreferencesComponent.prototype.updateFiltersInCache = function (closeModal) {
23469
+ var _this = this;
23470
+ if (closeModal === void 0) { closeModal = false; }
23420
23471
  var filters = new RecipeFilters();
23421
23472
  var allFilters = this.preferencesService.addPreferencesToRemoteFilters(filters, true);
23422
23473
  var filtersToAdd = Object.assign({ exclude_tags: allFilters.exclude_tags, include_tags: allFilters.include_tags }, (this.preferencesService.guests !== 4 && { guests: this.preferencesService.guests }));
23423
- if (!!filtersToAdd.exclude_tags || !!filtersToAdd.include_tags || !!filtersToAdd.guests) {
23424
- this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd).subscribe();
23425
- }
23474
+ var sendRequest = Object.keys(filtersToAdd).length > 0
23475
+ ? this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd)
23476
+ : this.preferencesService.sendCacheRequest('remove', 'preferences');
23477
+ sendRequest.subscribe(function () {
23478
+ if (closeModal) {
23479
+ _this.contextService.preferencesChanged.emit();
23480
+ _this.close();
23481
+ }
23482
+ });
23426
23483
  };
23427
23484
  return PreferencesComponent;
23428
23485
  }());
@@ -23500,7 +23557,7 @@
23500
23557
  else {
23501
23558
  i18n_16 = $localize(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject([":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"], [":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"])));
23502
23559
  }
23503
- return [["modalStyle", "right", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
23560
+ return [["modalStyle", "right", 1, "miam-preferences-modal", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
23504
23561
  }, template: function PreferencesComponent_Template(rf, ctx) {
23505
23562
  if (rf & 1) {
23506
23563
  i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 0);
@@ -23791,7 +23848,7 @@
23791
23848
  i0__namespace.ɵɵlistener("filterChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterChanged_7_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r48 = i0__namespace.ɵɵnextContext(); return ctx_r48.updateFilters($event); })("filterCollapsed", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterCollapsed_7_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r49 = i0__namespace.ɵɵnextContext(); return ctx_r49.onFilterCollapsed(); })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_preferencesChanged_7_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r50 = i0__namespace.ɵɵnextContext(); return ctx_r50.reloadPackages(); });
23792
23849
  i0__namespace.ɵɵelementEnd();
23793
23850
  i0__namespace.ɵɵelementStart(8, "ng-miam-preferences", 11);
23794
- i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_8_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(); return ctx_r51.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r52 = i0__namespace.ɵɵnextContext(); ctx_r52.updateFilters(ctx_r52.filters); return ctx_r52.reloadPackages(); });
23851
+ i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_8_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(); return ctx_r51.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r52 = i0__namespace.ɵɵnextContext(); ctx_r52.updateFilters(ctx_r52.filters, false); return ctx_r52.reloadPackages(); });
23795
23852
  i0__namespace.ɵɵelementEnd();
23796
23853
  i0__namespace.ɵɵtemplate(9, RecipeCatalogComponent_div_2_ng_template_9_Template, 1, 1, "ng-template", null, 12, i0__namespace.ɵɵtemplateRefExtractor);
23797
23854
  i0__namespace.ɵɵelementEnd();
@@ -23960,9 +24017,10 @@
23960
24017
  this.filters.search = '';
23961
24018
  this.filters.additionalFilters = null;
23962
24019
  };
23963
- RecipeCatalogComponent.prototype.updateFilters = function (filters) {
24020
+ RecipeCatalogComponent.prototype.updateFilters = function (filters, forceListView) {
24021
+ if (forceListView === void 0) { forceListView = true; }
23964
24022
  this.filters = filters.copy(); // necessary to trigger child component change
23965
- this.forceListView = true;
24023
+ this.forceListView = forceListView;
23966
24024
  this.filterToRemove = undefined;
23967
24025
  this.cdr.detectChanges();
23968
24026
  this.setStickyObserver();
@@ -25082,25 +25140,36 @@
25082
25140
  })();
25083
25141
  var templateObject_1$8, templateObject_2$5;
25084
25142
 
25143
+ function StoreLocatorLinkComponent_div_0_span_1_img_1_Template(rf, ctx) {
25144
+ if (rf & 1) {
25145
+ var _r4_1 = i0__namespace.ɵɵgetCurrentView();
25146
+ i0__namespace.ɵɵelementStart(0, "img", 8);
25147
+ i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_span_1_img_1_Template_img_click_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(3); return ctx_r3.showTooltip(); });
25148
+ i0__namespace.ɵɵelementEnd();
25149
+ }
25150
+ }
25085
25151
  function StoreLocatorLinkComponent_div_0_span_1_Template(rf, ctx) {
25086
25152
  if (rf & 1) {
25087
25153
  i0__namespace.ɵɵelementStart(0, "span", 6);
25088
- i0__namespace.ɵɵtext(1);
25154
+ i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_img_1_Template, 1, 0, "img", 7);
25155
+ i0__namespace.ɵɵtext(2);
25089
25156
  i0__namespace.ɵɵelementEnd();
25090
25157
  }
25091
25158
  if (rf & 2) {
25092
25159
  var ctx_r1 = i0__namespace.ɵɵnextContext(2);
25093
25160
  i0__namespace.ɵɵadvance(1);
25161
+ i0__namespace.ɵɵproperty("ngIf", ctx_r1.showIconTooltip);
25162
+ i0__namespace.ɵɵadvance(1);
25094
25163
  i0__namespace.ɵɵtextInterpolate2(" ", ctx_r1.currentPos.relationships.supplier.data.attributes.name, " - ", ctx_r1.currentPos.attributes.name, " ");
25095
25164
  }
25096
25165
  }
25097
25166
  function StoreLocatorLinkComponent_div_0_Template(rf, ctx) {
25098
25167
  if (rf & 1) {
25099
- var _r3_1 = i0__namespace.ɵɵgetCurrentView();
25168
+ var _r6_1 = i0__namespace.ɵɵgetCurrentView();
25100
25169
  i0__namespace.ɵɵelementStart(0, "div", 1);
25101
- i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 2, 2, "span", 2);
25170
+ i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 3, 3, "span", 2);
25102
25171
  i0__namespace.ɵɵelementStart(2, "button", 3);
25103
- i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(_r3_1); var ctx_r2 = i0__namespace.ɵɵnextContext(); return ctx_r2.storeLocatorService.openStoreLocator(); });
25172
+ i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.storeLocatorService.openStoreLocator(); });
25104
25173
  i0__namespace.ɵɵelement(3, "img", 4);
25105
25174
  i0__namespace.ɵɵelementStart(4, "span");
25106
25175
  i0__namespace.ɵɵi18n(5, 5);
@@ -25121,11 +25190,13 @@
25121
25190
  this.suppliersService = suppliersService;
25122
25191
  this.cdr = cdr;
25123
25192
  this.subscriptions = [];
25193
+ this.showIconTooltip = false;
25124
25194
  }
25125
25195
  StoreLocatorLinkComponent.prototype.ngOnInit = function () {
25126
25196
  var _this = this;
25127
25197
  this.subscriptions.push(this.posService.pos$.subscribe(function (pos) {
25128
25198
  _this.currentPos = pos;
25199
+ _this.setTooltipVisibility();
25129
25200
  _this.cdr.detectChanges();
25130
25201
  }));
25131
25202
  };
@@ -25133,6 +25204,15 @@
25133
25204
  this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
25134
25205
  this.storeLocatorService.unsubscribe();
25135
25206
  };
25207
+ StoreLocatorLinkComponent.prototype.setTooltipVisibility = function () {
25208
+ var _a;
25209
+ this.showIconTooltip = this.storeLocatorService.isStoreLocatorWarningNeeded((_a = this.currentPos) === null || _a === void 0 ? void 0 : _a.relationships.supplier.data.id);
25210
+ };
25211
+ StoreLocatorLinkComponent.prototype.showTooltip = function () {
25212
+ this.storeLocatorService.changePosAfterWarnConfirm = false;
25213
+ this.storeLocatorService.showStoreLocatorWarning.next(true);
25214
+ this.cdr.detectChanges();
25215
+ };
25136
25216
  return StoreLocatorLinkComponent;
25137
25217
  }());
25138
25218
  StoreLocatorLinkComponent.ɵfac = function StoreLocatorLinkComponent_Factory(t) { return new (t || StoreLocatorLinkComponent)(i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(SuppliersService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef)); };
@@ -25145,7 +25225,7 @@
25145
25225
  else {
25146
25226
  i18n_0 = $localize(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject([":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"], [":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"])));
25147
25227
  }
25148
- return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"]];
25228
+ return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click"]];
25149
25229
  }, template: function StoreLocatorLinkComponent_Template(rf, ctx) {
25150
25230
  if (rf & 1) {
25151
25231
  i0__namespace.ɵɵtemplate(0, StoreLocatorLinkComponent_div_0_Template, 6, 1, "div", 0);
@@ -25154,7 +25234,7 @@
25154
25234
  if (rf & 2) {
25155
25235
  i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(1, 1, ctx.posService.waitForPos));
25156
25236
  }
25157
- }, directives: [i1__namespace.NgIf], pipes: [i1__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
25237
+ }, directives: [i1__namespace.NgIf], pipes: [i1__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__store-name{display:flex}.miam-store-locator-link .miam-store-locator-link__store-name img{margin-right:8px;cursor:pointer}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
25158
25238
  (function () {
25159
25239
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(StoreLocatorLinkComponent, [{
25160
25240
  type: i0.Component,
@@ -25701,9 +25781,6 @@
25701
25781
  this.activeTabIndex = 1;
25702
25782
  }
25703
25783
  this.subscriptions.push(this.storeLocatorService.storeLocatorOpened$.subscribe(function (storeLocatorOpened) {
25704
- if (_this.showStoreSelector !== storeLocatorOpened && !storeLocatorOpened && _this.isRecipeFetched) {
25705
- _this.sendPageViewEvent();
25706
- }
25707
25784
  _this.showStoreSelector = storeLocatorOpened;
25708
25785
  _this.cdr.detectChanges();
25709
25786
  }), this.recipeDetailsService.productsLoading$.pipe(operators.map(function (productsLoading) { return !productsLoading && !_this.recipeDetailsService.onlyShowPreparation; })).subscribe(function (show) {
@@ -25741,7 +25818,7 @@
25741
25818
  };
25742
25819
  RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
25743
25820
  var _a;
25744
- if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
25821
+ if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0 && !(!this.posService.pos$.getValue() && this.contextService.noSupplier)) {
25745
25822
  this.recipeDetailsOpenTimestamp = Date.now();
25746
25823
  this.fetchRecipe(this.recipeId);
25747
25824
  this.cdr.detectChanges();
@@ -25758,7 +25835,7 @@
25758
25835
  this.recipeDetailsService.allIngredientsToBasketLoading = false;
25759
25836
  };
25760
25837
  RecipeDetailsComponent.prototype.ngOnDestroy = function () {
25761
- this.recipeDetailsService.displayEventWasSent = false;
25838
+ this.recipeDetailsService.pageviewEventWasSent = false;
25762
25839
  this.subscriptions.forEach(function (sub) { return sub === null || sub === void 0 ? void 0 : sub.unsubscribe(); });
25763
25840
  if (this.contextService.seoEnabled) {
25764
25841
  this.seoService.removeSEOData();
@@ -25779,7 +25856,7 @@
25779
25856
  }
25780
25857
  _this.recipeDetailsService.recipe.modifiedGuests = +_this.guestNumber || +result.guests;
25781
25858
  _this.recipeDetailsService.getProducts(true);
25782
- _this.sendPageViewEvent();
25859
+ _this.sendPageviewEvent();
25783
25860
  _this.setupYoutubePlayer();
25784
25861
  setTimeout(function () {
25785
25862
  _this.initScrollListenerOnTitle();
@@ -25876,7 +25953,7 @@
25876
25953
  };
25877
25954
  RecipeDetailsComponent.prototype.onClose = function (openBasket) {
25878
25955
  if (openBasket === void 0) { openBasket = false; }
25879
- this.recipeDetailsService.displayEventWasSent = false;
25956
+ this.recipeDetailsService.pageviewEventWasSent = false;
25880
25957
  this.storeLocatorService.closeStoreLocator();
25881
25958
  this.activeTabIndex = 0;
25882
25959
  if (openBasket) {
@@ -25891,9 +25968,9 @@
25891
25968
  RecipeDetailsComponent.prototype.print = function () {
25892
25969
  window.print();
25893
25970
  };
25894
- RecipeDetailsComponent.prototype.sendPageViewEvent = function () {
25895
- if (!this.recipeDetailsService.displayEventWasSent) {
25896
- this.recipeDetailsService.displayEventWasSent = true;
25971
+ RecipeDetailsComponent.prototype.sendPageviewEvent = function () {
25972
+ if (!this.recipeDetailsService.pageviewEventWasSent) {
25973
+ this.recipeDetailsService.pageviewEventWasSent = true;
25897
25974
  this.pageview();
25898
25975
  }
25899
25976
  };
@@ -27128,6 +27205,11 @@
27128
27205
  else {
27129
27206
  if (!_this.showStoreLocator) {
27130
27207
  _this.storeLocatorService.closeModalOnSelected = false; // reset variable even if storeLocator was closed early
27208
+ // If the user closes the store locator without selecting a POS, close the modal
27209
+ if (_this.storeLocatorService.closeModalOnCancel) {
27210
+ _this.storeLocatorService.closeModalOnCancel = false;
27211
+ _this.hide();
27212
+ }
27131
27213
  }
27132
27214
  _this.cdr.detectChanges(); // hide does a detectChanges so we avoid a double change
27133
27215
  }
@@ -27200,7 +27282,7 @@
27200
27282
  RecipeModalComponent.prototype.hide = function (isDetail) {
27201
27283
  if (isDetail === void 0) { isDetail = false; }
27202
27284
  if (this.canCloseModal) {
27203
- this.recipeDetailsService.displayEventWasSent = false;
27285
+ this.recipeDetailsService.pageviewEventWasSent = false;
27204
27286
  this.recipe = null; // trigger again a change on recipe if we re-open the view
27205
27287
  if (isDetail) {
27206
27288
  // Removes all occurences of /basket-preview or /my-meals from the originPath
@@ -27553,11 +27635,11 @@
27553
27635
  }
27554
27636
  var i18n_10;
27555
27637
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
27556
- var MSG_EXTERNAL_2810787844840265356$$LIB__WEB_COMPONENTS_NO_SUPPLIER_ONBOARDING_NO_SUPPLIER_ONBOARDING_COMPONENT_TS__11 = goog.getMsg("\u201CMes courses\u201D");
27557
- i18n_10 = MSG_EXTERNAL_2810787844840265356$$LIB__WEB_COMPONENTS_NO_SUPPLIER_ONBOARDING_NO_SUPPLIER_ONBOARDING_COMPONENT_TS__11;
27638
+ var MSG_EXTERNAL_4989457896049213714$$LIB__WEB_COMPONENTS_NO_SUPPLIER_ONBOARDING_NO_SUPPLIER_ONBOARDING_COMPONENT_TS__11 = goog.getMsg("\u201CAjouter au panier\u201D");
27639
+ i18n_10 = MSG_EXTERNAL_4989457896049213714$$LIB__WEB_COMPONENTS_NO_SUPPLIER_ONBOARDING_NO_SUPPLIER_ONBOARDING_COMPONENT_TS__11;
27558
27640
  }
27559
27641
  else {
27560
- i18n_10 = $localize(templateObject_6 || (templateObject_6 = __makeTemplateObject([":\u241F5439dd52739003fa2f45e44996164896666b1c44\u241F2810787844840265356:\u201CMes courses\u201D"], [":\u241F5439dd52739003fa2f45e44996164896666b1c44\u241F2810787844840265356:\u201CMes courses\u201D"])));
27642
+ i18n_10 = $localize(templateObject_6 || (templateObject_6 = __makeTemplateObject([":\u241F44ab3c897b11ad9bb47769e66a067cbe3d2439bd\u241F4989457896049213714:\u201CAjouter au panier\u201D"], [":\u241F44ab3c897b11ad9bb47769e66a067cbe3d2439bd\u241F4989457896049213714:\u201CAjouter au panier\u201D"])));
27561
27643
  }
27562
27644
  var i18n_12;
27563
27645
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
@@ -27718,7 +27800,9 @@
27718
27800
  this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
27719
27801
  };
27720
27802
  WarningStoreLocatorComponent.prototype.onConfirm = function () {
27721
- this.storeLocatoreService.changePos();
27803
+ if (this.storeLocatoreService.changePosAfterWarnConfirm) {
27804
+ this.storeLocatoreService.changePos();
27805
+ }
27722
27806
  this.storeLocatoreService.showStoreLocatorWarning.next(false);
27723
27807
  };
27724
27808
  return WarningStoreLocatorComponent;