ng-miam 8.7.0 → 8.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ng-miam.umd.js +238 -205
- package/bundles/ng-miam.umd.js.map +1 -1
- package/bundles/ng-miam.umd.min.js +1 -1
- package/bundles/ng-miam.umd.min.js.map +1 -1
- package/esm2015/lib/_components/product-card/product-card.component.js +2 -2
- package/esm2015/lib/_components/products-picker/products-picker.component.js +49 -40
- package/esm2015/lib/_models/basket-entry.js +2 -16
- package/esm2015/lib/_services/analytics.service.js +6 -1
- package/esm2015/lib/_services/basket-transfer.service.js +2 -2
- package/esm2015/lib/_services/baskets.service.js +14 -21
- package/esm2015/lib/_services/context.service.js +2 -2
- package/esm2015/lib/_services/interceptor.service.js +2 -2
- package/esm2015/lib/_services/package.service.js +2 -3
- package/esm2015/lib/_services/point-of-sales.service.js +4 -2
- package/esm2015/lib/_services/store-locator.service.js +13 -3
- package/esm2015/lib/_types/event-trace.js +1 -1
- package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +7 -2
- package/esm2015/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.js +14 -9
- package/esm2015/lib/_web-components/meals-planner/meals-planner-basket-preview/meals-planner-basket-preview.component.js +7 -4
- package/esm2015/lib/_web-components/meals-planner/meals-planner.component.js +46 -65
- package/esm2015/lib/_web-components/no-supplier-onboarding/no-supplier-onboarding.component.js +34 -11
- package/esm2015/lib/_web-components/recipe-cards/add-recipe-card/add-recipe-card.component.js +1 -1
- package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +11 -6
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +17 -8
- package/fesm2015/ng-miam.js +206 -173
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_models/basket-entry.d.ts +1 -4
- package/lib/_models/basket-entry.d.ts.map +1 -1
- package/lib/_services/analytics.service.d.ts +5 -0
- package/lib/_services/analytics.service.d.ts.map +1 -1
- package/lib/_services/basket-transfer.service.d.ts.map +1 -1
- package/lib/_services/baskets.service.d.ts.map +1 -1
- package/lib/_services/package.service.d.ts.map +1 -1
- package/lib/_services/point-of-sales.service.d.ts.map +1 -1
- package/lib/_services/store-locator.service.d.ts +2 -0
- package/lib/_services/store-locator.service.d.ts.map +1 -1
- package/lib/_types/event-trace.d.ts +2 -0
- package/lib/_types/event-trace.d.ts.map +1 -1
- package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts +2 -1
- package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts.map +1 -1
- package/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.d.ts +3 -3
- package/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.d.ts.map +1 -1
- package/lib/_web-components/meals-planner/meals-planner-basket-preview/meals-planner-basket-preview.component.d.ts +2 -1
- package/lib/_web-components/meals-planner/meals-planner-basket-preview/meals-planner-basket-preview.component.d.ts.map +1 -1
- package/lib/_web-components/meals-planner/meals-planner.component.d.ts +8 -8
- package/lib/_web-components/meals-planner/meals-planner.component.d.ts.map +1 -1
- package/lib/_web-components/no-supplier-onboarding/no-supplier-onboarding.component.d.ts +10 -2
- package/lib/_web-components/no-supplier-onboarding/no-supplier-onboarding.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts +1 -0
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-details/recipe-details.component.d.ts +3 -0
- package/lib/_web-components/recipe-details/recipe-details.component.d.ts.map +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -1435,7 +1435,6 @@
|
|
|
1435
1435
|
status: 'active'
|
|
1436
1436
|
};
|
|
1437
1437
|
_this.relationships = {
|
|
1438
|
-
items: new i2.DocumentCollection(),
|
|
1439
1438
|
'selected-item': new i2.DocumentResource()
|
|
1440
1439
|
};
|
|
1441
1440
|
return _this;
|
|
@@ -1495,21 +1494,6 @@
|
|
|
1495
1494
|
enumerable: false,
|
|
1496
1495
|
configurable: true
|
|
1497
1496
|
});
|
|
1498
|
-
Object.defineProperty(BasketEntry.prototype, "items", {
|
|
1499
|
-
get: function () {
|
|
1500
|
-
var _this = this;
|
|
1501
|
-
return this.relationships.items.data.map(function (item) {
|
|
1502
|
-
var _a;
|
|
1503
|
-
var beItem = _this.attributes['basket-entries-items'].find(function (i) { return i.item_id.toString() === item.id; });
|
|
1504
|
-
item.attributes['unit-price'] = beItem['unit-price'];
|
|
1505
|
-
item.attributes.currency = beItem.currency;
|
|
1506
|
-
item.variableCapacity = beItem.pft_plages && ((_a = beItem.pft_plages[0]) === null || _a === void 0 ? void 0 : _a.toString());
|
|
1507
|
-
return item;
|
|
1508
|
-
});
|
|
1509
|
-
},
|
|
1510
|
-
enumerable: false,
|
|
1511
|
-
configurable: true
|
|
1512
|
-
});
|
|
1513
1497
|
Object.defineProperty(BasketEntry.prototype, "selectedItem", {
|
|
1514
1498
|
get: function () {
|
|
1515
1499
|
return this.relationships['selected-item'].data;
|
|
@@ -1517,14 +1501,6 @@
|
|
|
1517
1501
|
enumerable: false,
|
|
1518
1502
|
configurable: true
|
|
1519
1503
|
});
|
|
1520
|
-
Object.defineProperty(BasketEntry.prototype, "candidateItems", {
|
|
1521
|
-
get: function () {
|
|
1522
|
-
var _this = this;
|
|
1523
|
-
return this.items.filter(function (i) { var _a; return i.id !== ((_a = _this.selectedItem) === null || _a === void 0 ? void 0 : _a.id); });
|
|
1524
|
-
},
|
|
1525
|
-
enumerable: false,
|
|
1526
|
-
configurable: true
|
|
1527
|
-
});
|
|
1528
1504
|
Object.defineProperty(BasketEntry.prototype, "totalprice", {
|
|
1529
1505
|
get: function () {
|
|
1530
1506
|
if (!this.selectedItem) {
|
|
@@ -2102,7 +2078,9 @@
|
|
|
2102
2078
|
return;
|
|
2103
2079
|
}
|
|
2104
2080
|
sessionStorage.removeItem('_miam/cachedRecipeUrl');
|
|
2105
|
-
window.location.href
|
|
2081
|
+
if (!window.location.href.includes(url)) {
|
|
2082
|
+
window.location.href = url;
|
|
2083
|
+
}
|
|
2106
2084
|
}, function (error) {
|
|
2107
2085
|
console.error(error);
|
|
2108
2086
|
});
|
|
@@ -2884,8 +2862,7 @@
|
|
|
2884
2862
|
page: { size: pageSize, number: pageNumber },
|
|
2885
2863
|
remotefilter: {
|
|
2886
2864
|
category_for: suppliersIds.join(','),
|
|
2887
|
-
status: 'validated'
|
|
2888
|
-
user_preferences: true
|
|
2865
|
+
status: 'validated'
|
|
2889
2866
|
},
|
|
2890
2867
|
sort: ['catalog_position']
|
|
2891
2868
|
});
|
|
@@ -3001,6 +2978,8 @@
|
|
|
3001
2978
|
this.EVENT_RECIPE_LIKE = 'recipe.like';
|
|
3002
2979
|
this.EVENT_RECIPE_UNLIKE = 'recipe.unlike';
|
|
3003
2980
|
this.EVENT_RECIPE_PRINT = 'recipe.print';
|
|
2981
|
+
this.EVENT_RECIPE_CONTINUE = 'recipe.continue';
|
|
2982
|
+
this.EVENT_RECIPE_CLOSE = 'recipe.close';
|
|
3004
2983
|
this.EVENT_PERSONAL_RECIPE_CREATE = 'recipe.personal.create';
|
|
3005
2984
|
this.EVENT_PERSONAL_RECIPE_DELETE = 'recipe.personal.delete';
|
|
3006
2985
|
this.EVENT_CATEGORY_SHOW = 'category.show';
|
|
@@ -3015,6 +2994,9 @@
|
|
|
3015
2994
|
this.EVENT_MEALS_PLANNER_CONFIRMED = 'planner.confirmed';
|
|
3016
2995
|
this.EVENT_POS_SELECTED = 'pos.selected';
|
|
3017
2996
|
this.EVENT_SEARCH_STORE = 'search.store';
|
|
2997
|
+
this.EVENT_LOCATOR_CLOSE = 'locator.close';
|
|
2998
|
+
this.EVENT_ONBOARDING_CLOSE = 'onboarding.close';
|
|
2999
|
+
this.EVENT_ONBOARDING_ACTION = 'onboarding.action';
|
|
3018
3000
|
this.ready$ = new rxjs.BehaviorSubject(false);
|
|
3019
3001
|
this.eventEmitter = new i0.EventEmitter();
|
|
3020
3002
|
}
|
|
@@ -3655,6 +3637,7 @@
|
|
|
3655
3637
|
|
|
3656
3638
|
var StoreLocatorService = /** @class */ (function () {
|
|
3657
3639
|
function StoreLocatorService(posService, analyticsService) {
|
|
3640
|
+
var _this = this;
|
|
3658
3641
|
this.posService = posService;
|
|
3659
3642
|
this.analyticsService = analyticsService;
|
|
3660
3643
|
this.subscriptions = [];
|
|
@@ -3663,6 +3646,11 @@
|
|
|
3663
3646
|
this.closeModalOnSelected = false;
|
|
3664
3647
|
this.showStoreLocatorWarning = new rxjs.BehaviorSubject(false);
|
|
3665
3648
|
this.showNoSupplierOnboarding = new rxjs.BehaviorSubject(false);
|
|
3649
|
+
this.storeLocatorOpened$.subscribe(function (opened) {
|
|
3650
|
+
if (opened && _this.storeLocatorOpenedTimestamp !== 0) {
|
|
3651
|
+
_this.storeLocatorOpenedTimestamp = Date.now();
|
|
3652
|
+
}
|
|
3653
|
+
});
|
|
3666
3654
|
}
|
|
3667
3655
|
StoreLocatorService.prototype.changePosAndSupplier = function (e, eventTrace) {
|
|
3668
3656
|
var _a, _b;
|
|
@@ -3672,6 +3660,7 @@
|
|
|
3672
3660
|
return;
|
|
3673
3661
|
}
|
|
3674
3662
|
this.selectedPosId = e.detail.posId;
|
|
3663
|
+
this.selectedSupplierName = e.detail.supplierName;
|
|
3675
3664
|
this.storeLocatorEventTrace = eventTrace;
|
|
3676
3665
|
// The following check is supposed to be temporary TODO remove
|
|
3677
3666
|
if (/Mobi|Android|iPhone/i.test(navigator.userAgent) && e.detail.supplierId === '7') {
|
|
@@ -3685,7 +3674,7 @@
|
|
|
3685
3674
|
StoreLocatorService.prototype.changePos = function () {
|
|
3686
3675
|
var _this = this;
|
|
3687
3676
|
this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(operators.skipWhile(function (pos) { return !pos || pos.id !== _this.selectedPosId; }), operators.switchMap(function (pos) {
|
|
3688
|
-
_this.analyticsService.sendEventWhenReady(_this.analyticsService.EVENT_POS_SELECTED, _this.storeLocatorEventTrace.originPath, { pos_name: pos.attributes.name, pos_id: pos.id });
|
|
3677
|
+
_this.analyticsService.sendEventWhenReady(_this.analyticsService.EVENT_POS_SELECTED, _this.storeLocatorEventTrace.originPath, { pos_name: pos.attributes.name, pos_id: pos.id, supplier_name: _this.selectedSupplierName });
|
|
3689
3678
|
localStorage.setItem('_miam/noSupplier/posId', pos.id);
|
|
3690
3679
|
return _this.posService.basketLoadedForNewPos();
|
|
3691
3680
|
}), operators.map(function () {
|
|
@@ -3695,12 +3684,16 @@
|
|
|
3695
3684
|
};
|
|
3696
3685
|
StoreLocatorService.prototype.openStoreLocator = function (skipOnboarding) {
|
|
3697
3686
|
if (skipOnboarding === void 0) { skipOnboarding = false; }
|
|
3698
|
-
if (!localStorage.getItem('_miam/noSupplier/posId') && !skipOnboarding) {
|
|
3687
|
+
if (!localStorage.getItem('_miam/noSupplier/posId') && !sessionStorage.getItem('_miam/noSupplier/onboarding') && !skipOnboarding) {
|
|
3699
3688
|
this.showNoSupplierOnboarding.next(true);
|
|
3700
3689
|
}
|
|
3701
3690
|
this.storeLocatorOpened$.next(true);
|
|
3702
3691
|
};
|
|
3703
3692
|
StoreLocatorService.prototype.closeStoreLocator = function () {
|
|
3693
|
+
if (this.storeLocatorOpened$.value) {
|
|
3694
|
+
this.analyticsService.sendEventWhenReady(this.analyticsService.EVENT_LOCATOR_CLOSE, '/locator', { time_passed: (Date.now() - this.storeLocatorOpenedTimestamp) / 1000 });
|
|
3695
|
+
this.storeLocatorOpenedTimestamp = 0;
|
|
3696
|
+
}
|
|
3704
3697
|
this.storeLocatorOpened$.next(false);
|
|
3705
3698
|
};
|
|
3706
3699
|
StoreLocatorService.prototype.showChange = function (e) {
|
|
@@ -4322,13 +4315,12 @@
|
|
|
4322
4315
|
console.debug('[Miam] refreshing basket');
|
|
4323
4316
|
var authlessId = localStorage.getItem('_miam/authlessId');
|
|
4324
4317
|
var userId = localStorage.getItem('_miam/userId');
|
|
4325
|
-
var cachedBasketId = localStorage.getItem('_miam/basketId');
|
|
4326
4318
|
if (_this.currentSubscription) {
|
|
4327
4319
|
_this.currentSubscription.unsubscribe();
|
|
4328
4320
|
}
|
|
4329
|
-
var basketObservable = (authlessId && userId
|
|
4321
|
+
var basketObservable = (authlessId && userId)
|
|
4330
4322
|
? _this.transferAuthlessBasket(pos.id, authlessId)
|
|
4331
|
-
: _this.fetchCurrentBasket(pos.id
|
|
4323
|
+
: _this.fetchCurrentBasket(pos.id);
|
|
4332
4324
|
if (authlessId && userId) {
|
|
4333
4325
|
localStorage.removeItem('_miam/authlessId');
|
|
4334
4326
|
}
|
|
@@ -4345,18 +4337,13 @@
|
|
|
4345
4337
|
return _this.updateLocalBasket(confirmedBasket);
|
|
4346
4338
|
}), operators.catchError(function () {
|
|
4347
4339
|
// If authless transfer returned an error, there might be something wrong with the basketId in localStorage, thus we fetchCurrent
|
|
4348
|
-
return _this.fetchCurrentBasket(posId
|
|
4340
|
+
return _this.fetchCurrentBasket(posId);
|
|
4349
4341
|
}));
|
|
4350
4342
|
};
|
|
4351
|
-
BasketsService.prototype.fetchCurrentBasket = function (posId
|
|
4343
|
+
BasketsService.prototype.fetchCurrentBasket = function (posId) {
|
|
4352
4344
|
var _this = this;
|
|
4353
|
-
var
|
|
4354
|
-
|
|
4355
|
-
if ((cachedBasketId === null || cachedBasketId === void 0 ? void 0 : cachedBasketId.toString().match(/^[0-9]+$/)) && this.usersService.isLogged$.getValue()) {
|
|
4356
|
-
endpoint += '&merge_with=' + cachedBasketId;
|
|
4357
|
-
}
|
|
4358
|
-
endpoint += "&fields[baskets]=" + BASKET_SPARSE_FIELDS.baskets.join(',');
|
|
4359
|
-
return this.get(endpoint).pipe(operators.skipWhile(function (basket) { return basket.is_loading; }), operators.switchMap(function (basket) { return _this.updateLocalBasket(basket); }), operators.tap(function () { return _this.posService.emitBasketLoadedForNewPos(); }));
|
|
4345
|
+
var url = "current?point_of_sale_id=" + posId + "&fields[baskets]=" + BASKET_SPARSE_FIELDS.baskets.join(',');
|
|
4346
|
+
return this.get(url).pipe(operators.skipWhile(function (basket) { return basket.is_loading; }), operators.switchMap(function (basket) { return _this.updateLocalBasket(basket); }), operators.tap(function () { return _this.posService.emitBasketLoadedForNewPos(); }));
|
|
4360
4347
|
};
|
|
4361
4348
|
BasketsService.prototype.resetBasket = function (eventTrace) {
|
|
4362
4349
|
var _this = this;
|
|
@@ -4485,14 +4472,19 @@
|
|
|
4485
4472
|
// fall case to a default pricebook
|
|
4486
4473
|
BasketsService.prototype.updatePricebook = function (pricebookName) {
|
|
4487
4474
|
var _this = this;
|
|
4475
|
+
if (!pricebookName) {
|
|
4476
|
+
console.debug('[Miam] empty pricebook name');
|
|
4477
|
+
return rxjs.of(null);
|
|
4478
|
+
}
|
|
4488
4479
|
return this.waitForBasket.pipe(operators.switchMap(function (basket) {
|
|
4489
4480
|
if (basket.pricebookKey === pricebookName) {
|
|
4490
4481
|
console.debug("[Miam] same pricebook " + JSON.stringify(pricebookName));
|
|
4491
4482
|
return rxjs.of(null);
|
|
4492
4483
|
}
|
|
4493
4484
|
console.debug("[Miam] update pricebook to " + JSON.stringify(pricebookName));
|
|
4494
|
-
basket.
|
|
4495
|
-
|
|
4485
|
+
var url = environment$1.miamAPI + "/api/v1/baskets/" + basket.id + "/update_pricebook?" +
|
|
4486
|
+
("point_of_sale_id=" + _this.posService.pos$.value.id + "&pricebook_key=" + pricebookName);
|
|
4487
|
+
return _this.http.patch(url, {}).pipe(operators.switchMap(function (resp) { return _this.fillBasket(resp); }));
|
|
4496
4488
|
}));
|
|
4497
4489
|
};
|
|
4498
4490
|
/** ******************************************************** ADD FROM PICTURE ******************************************************** **/
|
|
@@ -4863,12 +4855,6 @@
|
|
|
4863
4855
|
*/
|
|
4864
4856
|
BasketsService.prototype.updateLocalBasket = function (basket) {
|
|
4865
4857
|
var _this = this;
|
|
4866
|
-
if (this.usersService.isLogged$.value) {
|
|
4867
|
-
localStorage.removeItem('_miam/basketId');
|
|
4868
|
-
}
|
|
4869
|
-
else {
|
|
4870
|
-
localStorage.setItem('_miam/basketId', basket.id);
|
|
4871
|
-
}
|
|
4872
4858
|
this.basketPreviewIsCalculating = true;
|
|
4873
4859
|
this._basket$.next(basket);
|
|
4874
4860
|
return this.loadPreview().pipe(operators.tap(function () {
|
|
@@ -5930,7 +5916,7 @@
|
|
|
5930
5916
|
this.basketsService.initBasket();
|
|
5931
5917
|
}
|
|
5932
5918
|
return this.userService.generatingAuthlessId$.pipe(operators.skipWhile(function (generating) { return generating; }), operators.take(1), operators.switchMap(function () {
|
|
5933
|
-
if (!!localStorage.getItem('_miam/authlessId')
|
|
5919
|
+
if (!!localStorage.getItem('_miam/authlessId')) {
|
|
5934
5920
|
return _this.basketsService.reloadBasket();
|
|
5935
5921
|
}
|
|
5936
5922
|
return rxjs.of(null);
|
|
@@ -8580,7 +8566,7 @@
|
|
|
8580
8566
|
};
|
|
8581
8567
|
BasketTransferService.prototype.forcePosIfUnset = function (transferPosExtId) {
|
|
8582
8568
|
var _this = this;
|
|
8583
|
-
return this.posService.
|
|
8569
|
+
return this.posService.posWasInitialized().pipe(operators.takeUntil(this.transferComplete$), operators.switchMap(function () { return _this.posService.pos$.pipe(operators.take(1)); }), operators.switchMap(function (pos) {
|
|
8584
8570
|
var posSet = pos && pos.extId === transferPosExtId;
|
|
8585
8571
|
if (!posSet) {
|
|
8586
8572
|
_this.contextService.forcePosCallback(transferPosExtId);
|
|
@@ -8825,7 +8811,7 @@
|
|
|
8825
8811
|
MiamInterceptor.prototype.setMiamHeaders = function (request) {
|
|
8826
8812
|
var headersToAdd = {
|
|
8827
8813
|
'miam-origin': this.context.origin.value,
|
|
8828
|
-
'miam-front-version': '8.7.
|
|
8814
|
+
'miam-front-version': '8.7.1',
|
|
8829
8815
|
'miam-front-type': 'web',
|
|
8830
8816
|
'miam-api-version': '4.7.0'
|
|
8831
8817
|
};
|
|
@@ -14221,7 +14207,7 @@
|
|
|
14221
14207
|
i0__namespace.ɵɵtemplate(0, ProductCardComponent_div_0_Template, 15, 25, "div", 0);
|
|
14222
14208
|
}
|
|
14223
14209
|
if (rf & 2) {
|
|
14224
|
-
i0__namespace.ɵɵproperty("ngIf", ctx.product.basketEntry
|
|
14210
|
+
i0__namespace.ɵɵproperty("ngIf", ctx.product.basketEntry);
|
|
14225
14211
|
}
|
|
14226
14212
|
}, directives: [i2__namespace$2.NgIf, i2__namespace$2.NgClass, PriceComponent, CounterInputComponent], pipes: [CapitalizeFirstLetterPipe, i2__namespace$2.DecimalPipe, i2__namespace$2.CurrencyPipe, i2__namespace$2.AsyncPipe], styles: [".miam-product-card__container{display:flex;flex-direction:column;box-sizing:border-box;height:100%;border-radius:8px;overflow:hidden;border:1px solid var(--miam-ds-color-primary-100,#e4eaec);background:var(--miam-ds-color-primary-text,#fff);transition:all .3s}.miam-product-card__container.added{border:1px solid var(--miam-ds-color-primary,#24748f);background:var(--miam-ds-color-primary-text,#fff)}.miam-product-card__container .miam-product-card__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;padding:8px;color:var(--miam-ds-color-neutral-black,#1f3543);background:var(--miam-ds-color-primary-100,#e4eaec);transition:all .3s}.miam-product-card__container .miam-product-card__header.added{background:var(--miam-ds-color-primary,#24748f);color:var(--core-background-background-primary,#fff)}.miam-product-card__container .miam-product-card__header.disabled{background:var(--miam-ds-color-neutral-200,#d9dde1)}.miam-product-card__container .miam-product-card__header .miam-product-card__header-quantity{text-align:right}.miam-product-card__container .miam-product-card__content{padding:8px 12px;height:100%;display:flex;flex-direction:column;gap:12px;background-color:var(--miam-ds-color-neutral-white,#fff);transition:background-color .3s}.miam-product-card__container .miam-product-card__content.disabled{justify-content:center;align-items:center;gap:12px;padding:12px;text-align:center;background-color:var(--miam-ds-color-neutral-200,#d9dde1)}@media (max-width:1023px){.miam-product-card__container .miam-product-card__content{padding:12px}}@media (min-width:1023px) and (max-height:800px){.miam-product-card__container .miam-product-card__content{padding:12px}}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product{display:flex;align-items:center;justify-content:center;flex-direction:column;height:100%}@media (max-width:1023px){.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product{flex-direction:row;justify-content:flex-start;align-items:flex-start;gap:16px}}@media (min-width:1023px) and (max-height:800px){.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product{flex-direction:row;justify-content:flex-start;align-items:flex-start;gap:16px}}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__picture{height:72px;width:72px}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column{display:flex;flex-direction:column;align-items:center;justify-content:center}@media (max-width:1023px){.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column{align-items:flex-start}}@media (min-width:1023px) and (max-height:800px){.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column{align-items:flex-start}}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column .miam-product-card__details{font-size:12px!important;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--miam-ds-color-neutral-black,#1f3543)}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column .miam-product-card__details.product-brand{text-transform:uppercase}@media screen{.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column .miam-product-card__details.product-fullname{height:36px}}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__info-column .miam-product-card__link{font-size:14px}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__badges{display:flex;gap:8px;margin:8px 0}.miam-product-card__container .miam-product-card__content .miam-product-card__selected-product .miam-product-card__badges .miam-product-card__badge-text{color:var(--miam-ds-color-neutral-black,#1f3543);font-size:12px}.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action{display:flex;align-items:center;justify-content:space-between;gap:8px}.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action .miam-product-card__cta{display:flex;align-items:center;gap:12px}.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action .miam-product-card__cta .miam-ds-button.square{padding:8px;height:40px;width:40px}.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action .miam-product-card__cta .miam-product-card__loading-button{padding:14px}@media (max-width:1024px){.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action .miam-product-card__cta .miam-ds-button.primary:hover{background-color:var(--miam-ds-color-primary)}}.miam-product-card__container .miam-product-card__content .miam-product-card__lower-action .miam-product-card__price{color:var(--miam-ds-color-primary,#24748f)}.miam-product-card__container .miam-product-card__disabled-text{color:var(--miam-ds-color-neutral-black,#1f3543);opacity:.65}.miam-product-card__container .miam-product-card__footer{display:flex;flex-direction:column;align-items:center;background:var(--miam-ds-color-primary-50,#f0f3f4);padding:8px}.miam-product-card__container .miam-product-card__footer .light-text{color:var(--miam-ds-color-neutral-black,#1f3543);opacity:.5}"], encapsulation: 2, changeDetection: 0 });
|
|
14227
14213
|
(function () {
|
|
@@ -14291,20 +14277,32 @@
|
|
|
14291
14277
|
i0__namespace.ɵɵelement(0, "div", 15);
|
|
14292
14278
|
}
|
|
14293
14279
|
}
|
|
14294
|
-
function
|
|
14280
|
+
function ProductsPickerComponent_div_7_ng_container_1_ng_miam_product_card_1_Template(rf, ctx) {
|
|
14295
14281
|
if (rf & 1) {
|
|
14296
|
-
i0__namespace.ɵɵelement(0, "ng-miam-product-card",
|
|
14282
|
+
i0__namespace.ɵɵelement(0, "ng-miam-product-card", 19);
|
|
14283
|
+
}
|
|
14284
|
+
if (rf & 2) {
|
|
14285
|
+
var product_r15 = i0__namespace.ɵɵnextContext().$implicit;
|
|
14286
|
+
var ctx_r16 = i0__namespace.ɵɵnextContext(2);
|
|
14287
|
+
i0__namespace.ɵɵproperty("id", "miam_" + product_r15.basketEntry.nameId + "_product_card")("product", product_r15)("originTrace", ctx_r16.eventTrace());
|
|
14288
|
+
}
|
|
14289
|
+
}
|
|
14290
|
+
function ProductsPickerComponent_div_7_ng_container_1_Template(rf, ctx) {
|
|
14291
|
+
if (rf & 1) {
|
|
14292
|
+
i0__namespace.ɵɵelementContainerStart(0);
|
|
14293
|
+
i0__namespace.ɵɵtemplate(1, ProductsPickerComponent_div_7_ng_container_1_ng_miam_product_card_1_Template, 1, 3, "ng-miam-product-card", 18);
|
|
14294
|
+
i0__namespace.ɵɵelementContainerEnd();
|
|
14297
14295
|
}
|
|
14298
14296
|
if (rf & 2) {
|
|
14299
14297
|
var product_r15 = ctx.$implicit;
|
|
14300
|
-
|
|
14301
|
-
i0__namespace.ɵɵproperty("
|
|
14298
|
+
i0__namespace.ɵɵadvance(1);
|
|
14299
|
+
i0__namespace.ɵɵproperty("ngIf", product_r15.basketEntry == null ? null : product_r15.basketEntry.selectedItem);
|
|
14302
14300
|
}
|
|
14303
14301
|
}
|
|
14304
14302
|
function ProductsPickerComponent_div_7_Template(rf, ctx) {
|
|
14305
14303
|
if (rf & 1) {
|
|
14306
14304
|
i0__namespace.ɵɵelementStart(0, "div", 16);
|
|
14307
|
-
i0__namespace.ɵɵtemplate(1,
|
|
14305
|
+
i0__namespace.ɵɵtemplate(1, ProductsPickerComponent_div_7_ng_container_1_Template, 2, 1, "ng-container", 17);
|
|
14308
14306
|
i0__namespace.ɵɵelementEnd();
|
|
14309
14307
|
}
|
|
14310
14308
|
if (rf & 2) {
|
|
@@ -14315,28 +14313,28 @@
|
|
|
14315
14313
|
}
|
|
14316
14314
|
function ProductsPickerComponent_ng_container_10_ng_miam_product_card_7_Template(rf, ctx) {
|
|
14317
14315
|
if (rf & 1) {
|
|
14318
|
-
i0__namespace.ɵɵelement(0, "ng-miam-product-card",
|
|
14316
|
+
i0__namespace.ɵɵelement(0, "ng-miam-product-card", 19);
|
|
14319
14317
|
}
|
|
14320
14318
|
if (rf & 2) {
|
|
14321
|
-
var
|
|
14322
|
-
var
|
|
14323
|
-
i0__namespace.ɵɵproperty("id", "miam_" +
|
|
14319
|
+
var product_r19 = ctx.$implicit;
|
|
14320
|
+
var ctx_r18 = i0__namespace.ɵɵnextContext(2);
|
|
14321
|
+
i0__namespace.ɵɵproperty("id", "miam_" + product_r19.basketEntry.nameId + "_product_card")("product", product_r19)("originTrace", ctx_r18.eventTrace());
|
|
14324
14322
|
}
|
|
14325
14323
|
}
|
|
14326
14324
|
function ProductsPickerComponent_ng_container_10_Template(rf, ctx) {
|
|
14327
14325
|
if (rf & 1) {
|
|
14328
|
-
var
|
|
14326
|
+
var _r21_1 = i0__namespace.ɵɵgetCurrentView();
|
|
14329
14327
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
14330
|
-
i0__namespace.ɵɵelementStart(1, "ng-miam-accordion",
|
|
14331
|
-
i0__namespace.ɵɵlistener("isCollapsedChange", function ProductsPickerComponent_ng_container_10_Template_ng_miam_accordion_isCollapsedChange_1_listener() { i0__namespace.ɵɵrestoreView(
|
|
14328
|
+
i0__namespace.ɵɵelementStart(1, "ng-miam-accordion", 20);
|
|
14329
|
+
i0__namespace.ɵɵlistener("isCollapsedChange", function ProductsPickerComponent_ng_container_10_Template_ng_miam_accordion_isCollapsedChange_1_listener() { i0__namespace.ɵɵrestoreView(_r21_1); var ctx_r20 = i0__namespace.ɵɵnextContext(); return ctx_r20.cdr.detectChanges(); });
|
|
14332
14330
|
i0__namespace.ɵɵelementStart(2, "ng-miam-accordion-title");
|
|
14333
|
-
i0__namespace.ɵɵelementStart(3, "span",
|
|
14334
|
-
i0__namespace.ɵɵi18n(4,
|
|
14331
|
+
i0__namespace.ɵɵelementStart(3, "span", 21);
|
|
14332
|
+
i0__namespace.ɵɵi18n(4, 22);
|
|
14335
14333
|
i0__namespace.ɵɵelementEnd();
|
|
14336
14334
|
i0__namespace.ɵɵelementEnd();
|
|
14337
14335
|
i0__namespace.ɵɵelementStart(5, "ng-miam-accordion-content");
|
|
14338
14336
|
i0__namespace.ɵɵelementStart(6, "div", 16);
|
|
14339
|
-
i0__namespace.ɵɵtemplate(7, ProductsPickerComponent_ng_container_10_ng_miam_product_card_7_Template, 1, 3, "ng-miam-product-card",
|
|
14337
|
+
i0__namespace.ɵɵtemplate(7, ProductsPickerComponent_ng_container_10_ng_miam_product_card_7_Template, 1, 3, "ng-miam-product-card", 23);
|
|
14340
14338
|
i0__namespace.ɵɵelementEnd();
|
|
14341
14339
|
i0__namespace.ɵɵelementEnd();
|
|
14342
14340
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -14352,28 +14350,28 @@
|
|
|
14352
14350
|
}
|
|
14353
14351
|
function ProductsPickerComponent_ng_container_11_ng_miam_product_card_7_Template(rf, ctx) {
|
|
14354
14352
|
if (rf & 1) {
|
|
14355
|
-
i0__namespace.ɵɵelement(0, "ng-miam-product-card",
|
|
14353
|
+
i0__namespace.ɵɵelement(0, "ng-miam-product-card", 19);
|
|
14356
14354
|
}
|
|
14357
14355
|
if (rf & 2) {
|
|
14358
|
-
var
|
|
14359
|
-
var
|
|
14360
|
-
i0__namespace.ɵɵproperty("id", "miam_" +
|
|
14356
|
+
var product_r23 = ctx.$implicit;
|
|
14357
|
+
var ctx_r22 = i0__namespace.ɵɵnextContext(2);
|
|
14358
|
+
i0__namespace.ɵɵproperty("id", "miam_" + product_r23.basketEntry.nameId + "_product_card")("product", product_r23)("originTrace", ctx_r22.eventTrace());
|
|
14361
14359
|
}
|
|
14362
14360
|
}
|
|
14363
14361
|
function ProductsPickerComponent_ng_container_11_Template(rf, ctx) {
|
|
14364
14362
|
if (rf & 1) {
|
|
14365
|
-
var
|
|
14363
|
+
var _r25_1 = i0__namespace.ɵɵgetCurrentView();
|
|
14366
14364
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
14367
|
-
i0__namespace.ɵɵelementStart(1, "ng-miam-accordion",
|
|
14368
|
-
i0__namespace.ɵɵlistener("isCollapsedChange", function ProductsPickerComponent_ng_container_11_Template_ng_miam_accordion_isCollapsedChange_1_listener() { i0__namespace.ɵɵrestoreView(
|
|
14365
|
+
i0__namespace.ɵɵelementStart(1, "ng-miam-accordion", 24);
|
|
14366
|
+
i0__namespace.ɵɵlistener("isCollapsedChange", function ProductsPickerComponent_ng_container_11_Template_ng_miam_accordion_isCollapsedChange_1_listener() { i0__namespace.ɵɵrestoreView(_r25_1); var ctx_r24 = i0__namespace.ɵɵnextContext(); return ctx_r24.cdr.detectChanges(); });
|
|
14369
14367
|
i0__namespace.ɵɵelementStart(2, "ng-miam-accordion-title");
|
|
14370
|
-
i0__namespace.ɵɵelementStart(3, "span",
|
|
14371
|
-
i0__namespace.ɵɵi18n(4,
|
|
14368
|
+
i0__namespace.ɵɵelementStart(3, "span", 21);
|
|
14369
|
+
i0__namespace.ɵɵi18n(4, 25);
|
|
14372
14370
|
i0__namespace.ɵɵelementEnd();
|
|
14373
14371
|
i0__namespace.ɵɵelementEnd();
|
|
14374
14372
|
i0__namespace.ɵɵelementStart(5, "ng-miam-accordion-content");
|
|
14375
14373
|
i0__namespace.ɵɵelementStart(6, "div", 16);
|
|
14376
|
-
i0__namespace.ɵɵtemplate(7, ProductsPickerComponent_ng_container_11_ng_miam_product_card_7_Template, 1, 3, "ng-miam-product-card",
|
|
14374
|
+
i0__namespace.ɵɵtemplate(7, ProductsPickerComponent_ng_container_11_ng_miam_product_card_7_Template, 1, 3, "ng-miam-product-card", 23);
|
|
14377
14375
|
i0__namespace.ɵɵelementEnd();
|
|
14378
14376
|
i0__namespace.ɵɵelementEnd();
|
|
14379
14377
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -14389,10 +14387,10 @@
|
|
|
14389
14387
|
}
|
|
14390
14388
|
function ProductsPickerComponent_a_13_Template(rf, ctx) {
|
|
14391
14389
|
if (rf & 1) {
|
|
14392
|
-
i0__namespace.ɵɵelementStart(0, "a",
|
|
14393
|
-
i0__namespace.ɵɵelementStart(1, "button",
|
|
14390
|
+
i0__namespace.ɵɵelementStart(0, "a", 26);
|
|
14391
|
+
i0__namespace.ɵɵelementStart(1, "button", 27);
|
|
14394
14392
|
i0__namespace.ɵɵelementStart(2, "span");
|
|
14395
|
-
i0__namespace.ɵɵi18n(3,
|
|
14393
|
+
i0__namespace.ɵɵi18n(3, 28);
|
|
14396
14394
|
i0__namespace.ɵɵelementEnd();
|
|
14397
14395
|
i0__namespace.ɵɵelementEnd();
|
|
14398
14396
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -14404,25 +14402,25 @@
|
|
|
14404
14402
|
}
|
|
14405
14403
|
function ProductsPickerComponent_ng_template_14_Template(rf, ctx) {
|
|
14406
14404
|
if (rf & 1) {
|
|
14407
|
-
var
|
|
14408
|
-
i0__namespace.ɵɵelementStart(0, "button",
|
|
14409
|
-
i0__namespace.ɵɵlistener("click", function ProductsPickerComponent_ng_template_14_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(
|
|
14405
|
+
var _r27_1 = i0__namespace.ɵɵgetCurrentView();
|
|
14406
|
+
i0__namespace.ɵɵelementStart(0, "button", 29);
|
|
14407
|
+
i0__namespace.ɵɵlistener("click", function ProductsPickerComponent_ng_template_14_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r27_1); var ctx_r26 = i0__namespace.ɵɵnextContext(); return ctx_r26.closeRecipeModal(); });
|
|
14410
14408
|
i0__namespace.ɵɵelementStart(1, "span");
|
|
14411
|
-
i0__namespace.ɵɵi18n(2,
|
|
14409
|
+
i0__namespace.ɵɵi18n(2, 30);
|
|
14412
14410
|
i0__namespace.ɵɵelementEnd();
|
|
14413
14411
|
i0__namespace.ɵɵelementEnd();
|
|
14414
14412
|
}
|
|
14415
14413
|
}
|
|
14416
14414
|
function ProductsPickerComponent_div_16_Template(rf, ctx) {
|
|
14417
14415
|
if (rf & 1) {
|
|
14418
|
-
i0__namespace.ɵɵelementStart(0, "div",
|
|
14419
|
-
i0__namespace.ɵɵelementStart(1, "span",
|
|
14420
|
-
i0__namespace.ɵɵi18n(2,
|
|
14416
|
+
i0__namespace.ɵɵelementStart(0, "div", 31);
|
|
14417
|
+
i0__namespace.ɵɵelementStart(1, "span", 32);
|
|
14418
|
+
i0__namespace.ɵɵi18n(2, 33);
|
|
14421
14419
|
i0__namespace.ɵɵelementEnd();
|
|
14422
|
-
i0__namespace.ɵɵelementStart(3, "div",
|
|
14423
|
-
i0__namespace.ɵɵelement(4, "img",
|
|
14420
|
+
i0__namespace.ɵɵelementStart(3, "div", 34);
|
|
14421
|
+
i0__namespace.ɵɵelement(4, "img", 35);
|
|
14424
14422
|
i0__namespace.ɵɵelementStart(5, "span");
|
|
14425
|
-
i0__namespace.ɵɵi18n(6,
|
|
14423
|
+
i0__namespace.ɵɵi18n(6, 36);
|
|
14426
14424
|
i0__namespace.ɵɵelementEnd();
|
|
14427
14425
|
i0__namespace.ɵɵelementEnd();
|
|
14428
14426
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -14547,7 +14545,7 @@
|
|
|
14547
14545
|
else {
|
|
14548
14546
|
i18n_14 = $localize(templateObject_8$9 || (templateObject_8$9 = __makeTemplateObject([":\u241Ff363139a8ec757d4ac80573845002c3e462c4bca\u241F2791054456946858131:L'abus d'alcool est dangereux pour la sant\u00E9. A consommer avec mod\u00E9ration. Vente interdite aux mineurs."], [":\u241Ff363139a8ec757d4ac80573845002c3e462c4bca\u241F2791054456946858131:L'abus d'alcool est dangereux pour la sant\u00E9. A consommer avec mod\u00E9ration. Vente interdite aux mineurs."])));
|
|
14549
14547
|
}
|
|
14550
|
-
return [[1, "miam-products-picker__container"], [1, "miam-products-picker__header"], [1, "miam-products-picker__header-text", "miam-ds-text", "weight-xxl"], [4, "ngIf"], ["class", "miam-recipe-details__guest-counter", 3, "floating", "value", "minRange", "valueChange", 4, "ngIf"], ["class", " miam-ds-loader miam-products-picker__loader", 4, "ngIf"], ["class", "miam-products-picker__list", 4, "ngIf"], [1, "miam-products-picker__secondary-list"], [1, "miam-products-picker__more"], ["class", "miam-products-picker__more-anchor", 3, "href", 4, "ngIf", "ngIfElse"], ["noAnchor", ""], ["class", "miam-products-picker__legal-notices", 4, "ngIf"], i18n_0, i18n_2, [1, "miam-recipe-details__guest-counter", 3, "floating", "value", "minRange", "valueChange"], [1, "miam-ds-loader", "miam-products-picker__loader"], [1, "miam-products-picker__list"], ["class", "miam-products-picker__items", 3, "id", "product", "originTrace", 4, "
|
|
14548
|
+
return [[1, "miam-products-picker__container"], [1, "miam-products-picker__header"], [1, "miam-products-picker__header-text", "miam-ds-text", "weight-xxl"], [4, "ngIf"], ["class", "miam-recipe-details__guest-counter", 3, "floating", "value", "minRange", "valueChange", 4, "ngIf"], ["class", " miam-ds-loader miam-products-picker__loader", 4, "ngIf"], ["class", "miam-products-picker__list", 4, "ngIf"], [1, "miam-products-picker__secondary-list"], [1, "miam-products-picker__more"], ["class", "miam-products-picker__more-anchor", 3, "href", 4, "ngIf", "ngIfElse"], ["noAnchor", ""], ["class", "miam-products-picker__legal-notices", 4, "ngIf"], i18n_0, i18n_2, [1, "miam-recipe-details__guest-counter", 3, "floating", "value", "minRange", "valueChange"], [1, "miam-ds-loader", "miam-products-picker__loader"], [1, "miam-products-picker__list"], [4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "miam-products-picker__items", 3, "id", "product", "originTrace", 4, "ngIf"], [1, "miam-products-picker__items", 3, "id", "product", "originTrace"], [1, "miam-products-picker__often-ignored-list", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xxl"], i18n_4, ["class", "miam-products-picker__items", 3, "id", "product", "originTrace", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "miam-products-picker__unavailable-list", 3, "isCollapsed", "isCollapsedChange"], i18n_6, [1, "miam-products-picker__more-anchor", 3, "href"], [1, "miam-products-picker__go-to-catalog-button", "miam-ds-button", "secondary"], i18n_8, [1, "miam-products-picker__close-modal-button", "miam-ds-button", "secondary", 3, "click"], i18n_10, [1, "miam-products-picker__legal-notices"], [1, "miam-ds-text", "weight-xxl", "miam-products-picker__legal-notices-header"], i18n_12, [1, "miam-products-picker__legal-notices-content"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-legal-notices.svg"], i18n_14];
|
|
14551
14549
|
}, template: function ProductsPickerComponent_Template(rf, ctx) {
|
|
14552
14550
|
if (rf & 1) {
|
|
14553
14551
|
i0__namespace.ɵɵelementStart(0, "div", 0);
|
|
@@ -15961,7 +15959,7 @@
|
|
|
15961
15959
|
i0__namespace.ɵɵadvance(1);
|
|
15962
15960
|
i0__namespace.ɵɵproperty("ngIf", ctx_r2.line.displayMode);
|
|
15963
15961
|
i0__namespace.ɵɵadvance(1);
|
|
15964
|
-
i0__namespace.ɵɵproperty("ngIf", !ctx_r2.line.isRecipe
|
|
15962
|
+
i0__namespace.ɵɵproperty("ngIf", !ctx_r2.line.isRecipe);
|
|
15965
15963
|
i0__namespace.ɵɵadvance(1);
|
|
15966
15964
|
i0__namespace.ɵɵproperty("ngIf", ctx_r2.line.inlineTag);
|
|
15967
15965
|
i0__namespace.ɵɵadvance(2);
|
|
@@ -16037,10 +16035,14 @@
|
|
|
16037
16035
|
BasketPreviewLineComponent.prototype.currentPath = function () {
|
|
16038
16036
|
return '';
|
|
16039
16037
|
};
|
|
16040
|
-
BasketPreviewLineComponent.prototype.
|
|
16038
|
+
BasketPreviewLineComponent.prototype.initRecipesAndIngredients = function (countChanged) {
|
|
16041
16039
|
var _this = this;
|
|
16042
|
-
if (
|
|
16043
|
-
|
|
16040
|
+
if (countChanged === void 0) { countChanged = false; }
|
|
16041
|
+
if (this.legacyRecipe &&
|
|
16042
|
+
this.legacyIngredientsEntries &&
|
|
16043
|
+
this.legacyIngredientsEntries.length === this.legacyRecipe.relationships.ingredients.data.length &&
|
|
16044
|
+
!countChanged) {
|
|
16045
|
+
return rxjs.of([]);
|
|
16044
16046
|
}
|
|
16045
16047
|
return this.recipesService.get(this.line.id, {
|
|
16046
16048
|
include: ['ingredients'],
|
|
@@ -16070,6 +16072,8 @@
|
|
|
16070
16072
|
this.line.count = count;
|
|
16071
16073
|
if (this.line.hasEntries() || this.line.displayMode) {
|
|
16072
16074
|
this.countChanged.emit(this.line);
|
|
16075
|
+
// Force refresh recipe entries
|
|
16076
|
+
this.buildEntriesLines(true);
|
|
16073
16077
|
}
|
|
16074
16078
|
else {
|
|
16075
16079
|
this.handleSublineCountChange(count);
|
|
@@ -16083,7 +16087,7 @@
|
|
|
16083
16087
|
}
|
|
16084
16088
|
this.line.record.attributes.quantity = count;
|
|
16085
16089
|
this.sendEvent(this.analyticsService.EVENT_ENTRY_CHANGE_QUANTITY);
|
|
16086
|
-
this.subscriptions.push(this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
|
|
16090
|
+
this.subscriptions.push(this.line.record.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe(function () { return _this.cdr.detectChanges(); }));
|
|
16087
16091
|
};
|
|
16088
16092
|
BasketPreviewLineComponent.prototype.toggleExpanded = function (event) {
|
|
16089
16093
|
if (!this.line.hasEntries() ||
|
|
@@ -16109,7 +16113,7 @@
|
|
|
16109
16113
|
this.buildEntriesLines();
|
|
16110
16114
|
// Update be status to "deleted" and reload basket
|
|
16111
16115
|
entry.status = 'deleted';
|
|
16112
|
-
this.subscriptions.push(entry.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe());
|
|
16116
|
+
this.subscriptions.push(entry.save().pipe(operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe(function () { return _this.cdr.detectChanges(); }));
|
|
16113
16117
|
};
|
|
16114
16118
|
BasketPreviewLineComponent.prototype.changeProduct = function (line) {
|
|
16115
16119
|
var _a;
|
|
@@ -16129,11 +16133,12 @@
|
|
|
16129
16133
|
this.cdr.detectChanges();
|
|
16130
16134
|
this.elementRef.nativeElement.scrollIntoView(false);
|
|
16131
16135
|
};
|
|
16132
|
-
BasketPreviewLineComponent.prototype.buildEntriesLines = function () {
|
|
16136
|
+
BasketPreviewLineComponent.prototype.buildEntriesLines = function (countChanged) {
|
|
16133
16137
|
var _this = this;
|
|
16138
|
+
if (countChanged === void 0) { countChanged = false; }
|
|
16134
16139
|
if (this.legacyMode) {
|
|
16135
16140
|
var entries_1 = __spread(this.line.entries.found, this.line.entries.notFound, this.line.entries.oftenDeleted, this.line.entries.removed);
|
|
16136
|
-
this.
|
|
16141
|
+
this.initRecipesAndIngredients(countChanged).pipe(operators.tap(function () {
|
|
16137
16142
|
_this.entriesLines$.next(entries_1
|
|
16138
16143
|
.filter(function (entry) { return _this.line.entries.found.map(function (e) { return e.id; }).includes(entry.id); })
|
|
16139
16144
|
.map(function (entry) { return BasketPreviewLine.fromBasketEntry(entry, _this.legacyRecipe, _this.legacyIngredientsEntries.find(function (ie) { return ie.entry.id === entry.id; }).ing); }));
|
|
@@ -17604,6 +17609,7 @@
|
|
|
17604
17609
|
_this.statsUpdated = new i0.EventEmitter();
|
|
17605
17610
|
_this.guestCountChanged = new i0.EventEmitter();
|
|
17606
17611
|
_this.loading = new rxjs.BehaviorSubject(true);
|
|
17612
|
+
_this.totalPriceChanged = new i0.EventEmitter();
|
|
17607
17613
|
_this.corsIssues = false;
|
|
17608
17614
|
_this.icon = exports.Icon;
|
|
17609
17615
|
_this.isMobile = false;
|
|
@@ -17667,6 +17673,8 @@
|
|
|
17667
17673
|
var _this = this;
|
|
17668
17674
|
return this.basketsService.basketPreview$.pipe(operators.skipWhile(function (preview) { return !preview || preview.length !== basket.recipeInfos.length; }), operators.switchMap(function (preview) {
|
|
17669
17675
|
_this.lines = _this.recipesIds.length === 0 ? preview : preview.filter(function (line) { return _this.recipesIds.includes(line.id); });
|
|
17676
|
+
var totalPrice = _this.lines.reduce(function (total, line) { return total + +line.price; }, 0);
|
|
17677
|
+
_this.totalPriceChanged.emit(totalPrice);
|
|
17670
17678
|
_this.loading.next(false);
|
|
17671
17679
|
_this.cdr.detectChanges();
|
|
17672
17680
|
return rxjs.of(preview);
|
|
@@ -17799,7 +17807,7 @@
|
|
|
17799
17807
|
i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.basketPreviewRecipeRows = _t);
|
|
17800
17808
|
i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.productsElements = _t);
|
|
17801
17809
|
}
|
|
17802
|
-
}, inputs: { recipeId: "recipeId", showNotice: "showNotice", isStoreLocatorDisplayed: "isStoreLocatorDisplayed", recipesAlwaysExpanded: "recipesAlwaysExpanded", itemsAlwaysExpanded: "itemsAlwaysExpanded", displayItemsUnitaryPrice: "displayItemsUnitaryPrice", recipesIds: "recipesIds", legacyMode: "legacyMode" }, outputs: { statsUpdated: "statsUpdated", guestCountChanged: "guestCountChanged", loading: "loading" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 7, vars: 2, consts: function () {
|
|
17810
|
+
}, inputs: { recipeId: "recipeId", showNotice: "showNotice", isStoreLocatorDisplayed: "isStoreLocatorDisplayed", recipesAlwaysExpanded: "recipesAlwaysExpanded", itemsAlwaysExpanded: "itemsAlwaysExpanded", displayItemsUnitaryPrice: "displayItemsUnitaryPrice", recipesIds: "recipesIds", legacyMode: "legacyMode" }, outputs: { statsUpdated: "statsUpdated", guestCountChanged: "guestCountChanged", loading: "loading", totalPriceChanged: "totalPriceChanged" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 7, vars: 2, consts: function () {
|
|
17803
17811
|
var i18n_0;
|
|
17804
17812
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
17805
17813
|
var MSG_EXTERNAL_8629591622298910251$$LIB__WEB_COMPONENTS_BASKET_PREVIEW_BASKET_PREVIEW_BLOCK_BASKET_PREVIEW_BLOCK_COMPONENT_TS___1 = goog.getMsg("Recettes, Produits");
|
|
@@ -17910,6 +17918,8 @@
|
|
|
17910
17918
|
type: i0.Output
|
|
17911
17919
|
}], loading: [{
|
|
17912
17920
|
type: i0.Output
|
|
17921
|
+
}], totalPriceChanged: [{
|
|
17922
|
+
type: i0.Output
|
|
17913
17923
|
}], lineComponents: [{
|
|
17914
17924
|
type: i0.ViewChildren,
|
|
17915
17925
|
args: [BasketPreviewLineComponent]
|
|
@@ -19293,20 +19303,18 @@
|
|
|
19293
19303
|
if (!this.recipe && ((_a = this.recipeName) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
19294
19304
|
this.subscriptions.push(this.searchRecipeByName().subscribe(function (result) {
|
|
19295
19305
|
_this.recipe = result;
|
|
19296
|
-
_this.
|
|
19297
|
-
_this.checkRecipeInBasket();
|
|
19306
|
+
_this.checkGuestsAndBasket();
|
|
19298
19307
|
_this.cdr.detectChanges();
|
|
19299
19308
|
}));
|
|
19300
19309
|
}
|
|
19301
19310
|
else if (!this.recipe && this.recipeExtId) {
|
|
19302
19311
|
this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
|
|
19303
19312
|
_this.recipe = result;
|
|
19304
|
-
_this.recipe.modifiedGuests = _this.serves || +_this.recipe.guests;
|
|
19305
19313
|
if (_this.contextService.noSupplier) {
|
|
19306
|
-
// When noSupplier, we don't have a basket so we can't have the
|
|
19314
|
+
// When noSupplier, we don't have a basket so we can't have the detectChanges in the basket subscription
|
|
19307
19315
|
_this.cdr.detectChanges();
|
|
19308
19316
|
}
|
|
19309
|
-
_this.
|
|
19317
|
+
_this.checkGuestsAndBasket();
|
|
19310
19318
|
}));
|
|
19311
19319
|
}
|
|
19312
19320
|
else {
|
|
@@ -19316,6 +19324,13 @@
|
|
|
19316
19324
|
RecipeCardCtaComponent.prototype.ngOnDestroy = function () {
|
|
19317
19325
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
19318
19326
|
};
|
|
19327
|
+
RecipeCardCtaComponent.prototype.checkGuestsAndBasket = function () {
|
|
19328
|
+
var _a;
|
|
19329
|
+
if (this.recipe) {
|
|
19330
|
+
this.recipe.modifiedGuests = this.serves || +((_a = this.recipe) === null || _a === void 0 ? void 0 : _a.guests);
|
|
19331
|
+
this.checkRecipeInBasket();
|
|
19332
|
+
}
|
|
19333
|
+
};
|
|
19319
19334
|
RecipeCardCtaComponent.prototype.checkRecipeInBasket = function () {
|
|
19320
19335
|
var _this = this;
|
|
19321
19336
|
if (!this.basketSubscription && this.recipe) {
|
|
@@ -20052,7 +20067,7 @@
|
|
|
20052
20067
|
i0__namespace.ɵɵadvance(2);
|
|
20053
20068
|
i0__namespace.ɵɵproperty("iconName", ctx.icon.Plus);
|
|
20054
20069
|
}
|
|
20055
|
-
}, directives: [IconComponent], styles: ["ng-miam-add-recipe-card{flex-grow:1}.miam-add-recipe-card{border-radius:8px;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);border:1px dashed var(--m-color-primary);display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.miam-add-recipe-card:hover{background-color:var(--m-color-grey)}.miam-add-recipe-card .m-button-primary{border-radius:6px;height:48px;width:48px}.miam-add-recipe-card .m-button-primary:hover{background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}.miam-add-recipe-card .m-button-primary img{filter:brightness(0) invert(100%)}.miam-add-recipe-card .miam-add-recipe-card__label{font-size:14px;line-height:22px;color:var(--m-color-primary);font-weight:700;margin-top:16px}"], encapsulation: 2, changeDetection: 0 });
|
|
20070
|
+
}, directives: [IconComponent], styles: ["ng-miam-add-recipe-card{flex-grow:1}.miam-add-recipe-card{border-radius:8px;height:var(--m-catalog-card-height);width:var(--m-catalog-card-width);border:1px dashed var(--m-color-primary);box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.miam-add-recipe-card:hover{background-color:var(--m-color-grey)}.miam-add-recipe-card .m-button-primary{border-radius:6px;height:48px;width:48px}.miam-add-recipe-card .m-button-primary:hover{background-color:var(--m-color-primary);border:1px solid var(--m-color-white)}.miam-add-recipe-card .m-button-primary img{filter:brightness(0) invert(100%)}.miam-add-recipe-card .miam-add-recipe-card__label{font-size:14px;line-height:22px;color:var(--m-color-primary);font-weight:700;margin-top:16px}"], encapsulation: 2, changeDetection: 0 });
|
|
20056
20071
|
(function () {
|
|
20057
20072
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AddRecipeCardComponent, [{
|
|
20058
20073
|
type: i0.Component,
|
|
@@ -20362,7 +20377,7 @@
|
|
|
20362
20377
|
i0__namespace.ɵɵelementEnd();
|
|
20363
20378
|
i0__namespace.ɵɵtemplate(7, MealsPlannerBasketPreviewComponent_div_0_div_7_Template, 4, 0, "div", 5);
|
|
20364
20379
|
i0__namespace.ɵɵelementStart(8, "ng-miam-basket-preview-block", 6);
|
|
20365
|
-
i0__namespace.ɵɵlistener("loading", function MealsPlannerBasketPreviewComponent_div_0_Template_ng_miam_basket_preview_block_loading_8_listener($event) { i0__namespace.ɵɵrestoreView(_r10_1); var ctx_r9 = i0__namespace.ɵɵnextContext(); return ctx_r9.setCtasDisabled($event); });
|
|
20380
|
+
i0__namespace.ɵɵlistener("loading", function MealsPlannerBasketPreviewComponent_div_0_Template_ng_miam_basket_preview_block_loading_8_listener($event) { i0__namespace.ɵɵrestoreView(_r10_1); var ctx_r9 = i0__namespace.ɵɵnextContext(); return ctx_r9.setCtasDisabled($event); })("totalPriceChanged", function MealsPlannerBasketPreviewComponent_div_0_Template_ng_miam_basket_preview_block_totalPriceChanged_8_listener($event) { i0__namespace.ɵɵrestoreView(_r10_1); var ctx_r11 = i0__namespace.ɵɵnextContext(); return ctx_r11.usedBudgetChanged.emit($event); });
|
|
20366
20381
|
i0__namespace.ɵɵelementEnd();
|
|
20367
20382
|
i0__namespace.ɵɵelementEnd();
|
|
20368
20383
|
i0__namespace.ɵɵelementStart(9, "div", 7);
|
|
@@ -20406,6 +20421,7 @@
|
|
|
20406
20421
|
_this.maxBudget = 0;
|
|
20407
20422
|
_this.ingredientsRegrouped = false;
|
|
20408
20423
|
_this.closed = new i0.EventEmitter();
|
|
20424
|
+
_this.usedBudgetChanged = new i0.EventEmitter();
|
|
20409
20425
|
_this.icon = exports.Icon;
|
|
20410
20426
|
_this.ctasDisabled = true;
|
|
20411
20427
|
_this.subscriptions = [];
|
|
@@ -20431,7 +20447,7 @@
|
|
|
20431
20447
|
return MealsPlannerBasketPreviewComponent;
|
|
20432
20448
|
}(EventTracerComponent));
|
|
20433
20449
|
MealsPlannerBasketPreviewComponent.ɵfac = function MealsPlannerBasketPreviewComponent_Factory(t) { return new (t || MealsPlannerBasketPreviewComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(AnalyticsService)); };
|
|
20434
|
-
MealsPlannerBasketPreviewComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: MealsPlannerBasketPreviewComponent, selectors: [["ng-miam-meals-planner-basket-preview"]], inputs: { recipesIds: "recipesIds", usedBudget: "usedBudget", maxBudget: "maxBudget", ingredientsRegrouped: "ingredientsRegrouped" }, outputs: { closed: "closed" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: function () {
|
|
20450
|
+
MealsPlannerBasketPreviewComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: MealsPlannerBasketPreviewComponent, selectors: [["ng-miam-meals-planner-basket-preview"]], inputs: { recipesIds: "recipesIds", usedBudget: "usedBudget", maxBudget: "maxBudget", ingredientsRegrouped: "ingredientsRegrouped" }, outputs: { closed: "closed", usedBudgetChanged: "usedBudgetChanged" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: function () {
|
|
20435
20451
|
var i18n_0;
|
|
20436
20452
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
20437
20453
|
var MSG_EXTERNAL_2700281655709788634$$LIB__WEB_COMPONENTS_MEALS_PLANNER_MEALS_PLANNER_BASKET_PREVIEW_MEALS_PLANNER_BASKET_PREVIEW_COMPONENT_TS__1 = goog.getMsg("repas ajout\u00E9s \u00E0 votre panier");
|
|
@@ -20472,7 +20488,7 @@
|
|
|
20472
20488
|
else {
|
|
20473
20489
|
i18n_8 = $localize(templateObject_5$b || (templateObject_5$b = __makeTemplateObject([":\u241F4f168d78d73759138d43c58ec329dc9a1cfcd316\u241F3503734824800029552:Finaliser"], [":\u241F4f168d78d73759138d43c58ec329dc9a1cfcd316\u241F3503734824800029552:Finaliser"])));
|
|
20474
20490
|
}
|
|
20475
|
-
return [["class", "miam-meals-planner-basket-preview", 4, "ngIf"], [1, "miam-meals-planner-basket-preview"], [1, "miam-meals-planner-basket-preview__content"], [1, "miam-meals-planner-basket-preview__title"], i18n_0, ["class", "miam-meals-planner-basket-preview__ingredients-regrouped", 4, "ngIf"], [3, "originTrace", "recipesIds", "displayItemsUnitaryPrice", "legacyMode", "loading"], [1, "miam-meals-planner-basket-preview__actions"], ["class", "miam-meals-planner-basket-preview__progress-bar", 3, "unit", "value", "max", 4, "ngIf"], ["class", "m-button-primary reverse", 3, "disabled", 4, "ngIf"], [1, "m-button-primary", 3, "disabled"], ["href", "/", 4, "ngIf", "ngIfElse"], ["antiInflation", ""], [1, "miam-meals-planner-basket-preview__ingredients-regrouped"], [1, "miam-meals-planner-basket-preview__ingredients-regrouped__title"], i18n_2, [1, "miam-meals-planner-basket-preview__progress-bar", 3, "unit", "value", "max"], [1, "m-button-primary", "reverse", 3, "disabled"], [3, "href"], [1, "miam-meals-planner-basket-preview__button-text"], i18n_4, ["href", "/"], i18n_6, [3, "click"], i18n_8];
|
|
20491
|
+
return [["class", "miam-meals-planner-basket-preview", 4, "ngIf"], [1, "miam-meals-planner-basket-preview"], [1, "miam-meals-planner-basket-preview__content"], [1, "miam-meals-planner-basket-preview__title"], i18n_0, ["class", "miam-meals-planner-basket-preview__ingredients-regrouped", 4, "ngIf"], [3, "originTrace", "recipesIds", "displayItemsUnitaryPrice", "legacyMode", "loading", "totalPriceChanged"], [1, "miam-meals-planner-basket-preview__actions"], ["class", "miam-meals-planner-basket-preview__progress-bar", 3, "unit", "value", "max", 4, "ngIf"], ["class", "m-button-primary reverse", 3, "disabled", 4, "ngIf"], [1, "m-button-primary", 3, "disabled"], ["href", "/", 4, "ngIf", "ngIfElse"], ["antiInflation", ""], [1, "miam-meals-planner-basket-preview__ingredients-regrouped"], [1, "miam-meals-planner-basket-preview__ingredients-regrouped__title"], i18n_2, [1, "miam-meals-planner-basket-preview__progress-bar", 3, "unit", "value", "max"], [1, "m-button-primary", "reverse", 3, "disabled"], [3, "href"], [1, "miam-meals-planner-basket-preview__button-text"], i18n_4, ["href", "/"], i18n_6, [3, "click"], i18n_8];
|
|
20476
20492
|
}, template: function MealsPlannerBasketPreviewComponent_Template(rf, ctx) {
|
|
20477
20493
|
if (rf & 1) {
|
|
20478
20494
|
i0__namespace.ɵɵtemplate(0, MealsPlannerBasketPreviewComponent_div_0_Template, 16, 11, "div", 0);
|
|
@@ -20501,6 +20517,8 @@
|
|
|
20501
20517
|
type: i0.Input
|
|
20502
20518
|
}], closed: [{
|
|
20503
20519
|
type: i0.Output
|
|
20520
|
+
}], usedBudgetChanged: [{
|
|
20521
|
+
type: i0.Output
|
|
20504
20522
|
}] });
|
|
20505
20523
|
})();
|
|
20506
20524
|
var templateObject_1$r, templateObject_2$l, templateObject_3$g, templateObject_4$d, templateObject_5$b;
|
|
@@ -21627,7 +21645,7 @@
|
|
|
21627
21645
|
if (rf & 1) {
|
|
21628
21646
|
var _r17_1 = i0__namespace.ɵɵgetCurrentView();
|
|
21629
21647
|
i0__namespace.ɵɵelementStart(0, "ng-miam-meals-planner-basket-preview", 26);
|
|
21630
|
-
i0__namespace.ɵɵlistener("closed", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_basket_preview_3_Template_ng_miam_meals_planner_basket_preview_closed_0_listener() { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r16 = i0__namespace.ɵɵnextContext(3); return ctx_r16.openBasketConfirmation(); });
|
|
21648
|
+
i0__namespace.ɵɵlistener("closed", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_basket_preview_3_Template_ng_miam_meals_planner_basket_preview_closed_0_listener() { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r16 = i0__namespace.ɵɵnextContext(3); return ctx_r16.openBasketConfirmation(); })("usedBudgetChanged", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_basket_preview_3_Template_ng_miam_meals_planner_basket_preview_usedBudgetChanged_0_listener($event) { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r18 = i0__namespace.ɵɵnextContext(3); return ctx_r18.updateUsedBudget($event); });
|
|
21631
21649
|
i0__namespace.ɵɵelementEnd();
|
|
21632
21650
|
}
|
|
21633
21651
|
if (rf & 2) {
|
|
@@ -21637,9 +21655,9 @@
|
|
|
21637
21655
|
}
|
|
21638
21656
|
function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_catalog_4_Template(rf, ctx) {
|
|
21639
21657
|
if (rf & 1) {
|
|
21640
|
-
var
|
|
21658
|
+
var _r20_1 = i0__namespace.ɵɵgetCurrentView();
|
|
21641
21659
|
i0__namespace.ɵɵelementStart(0, "ng-miam-meals-planner-catalog", 27);
|
|
21642
|
-
i0__namespace.ɵɵlistener("editRecipe", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_catalog_4_Template_ng_miam_meals_planner_catalog_editRecipe_0_listener($event) { i0__namespace.ɵɵrestoreView(
|
|
21660
|
+
i0__namespace.ɵɵlistener("editRecipe", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_catalog_4_Template_ng_miam_meals_planner_catalog_editRecipe_0_listener($event) { i0__namespace.ɵɵrestoreView(_r20_1); var ctx_r19 = i0__namespace.ɵɵnextContext(3); return ctx_r19.editRecipe($event); })("canceled", function MealsPlannerComponent_div_2_div_15_ng_miam_meals_planner_catalog_4_Template_ng_miam_meals_planner_catalog_canceled_0_listener() { i0__namespace.ɵɵrestoreView(_r20_1); var ctx_r21 = i0__namespace.ɵɵnextContext(3); return ctx_r21.closeCatalog(); });
|
|
21643
21661
|
i0__namespace.ɵɵelementEnd();
|
|
21644
21662
|
}
|
|
21645
21663
|
if (rf & 2) {
|
|
@@ -21764,6 +21782,40 @@
|
|
|
21764
21782
|
_this.subscriptions = [];
|
|
21765
21783
|
return _this;
|
|
21766
21784
|
}
|
|
21785
|
+
Object.defineProperty(MealsPlannerComponent.prototype, "remainingBudget", {
|
|
21786
|
+
get: function () {
|
|
21787
|
+
var _a;
|
|
21788
|
+
var recipeToChangeId = (_a = this.budgettedRecipes[this.recipeToChangeIndex]) === null || _a === void 0 ? void 0 : _a.id;
|
|
21789
|
+
var remainingBudget = this.maxBudget - this.usedBudget;
|
|
21790
|
+
if (recipeToChangeId) {
|
|
21791
|
+
remainingBudget += this.budgettedRecipesPrices[recipeToChangeId];
|
|
21792
|
+
}
|
|
21793
|
+
if (remainingBudget > 0) {
|
|
21794
|
+
return remainingBudget;
|
|
21795
|
+
}
|
|
21796
|
+
return 0;
|
|
21797
|
+
},
|
|
21798
|
+
enumerable: false,
|
|
21799
|
+
configurable: true
|
|
21800
|
+
});
|
|
21801
|
+
Object.defineProperty(MealsPlannerComponent.prototype, "remainingRecipesNumber", {
|
|
21802
|
+
get: function () {
|
|
21803
|
+
var _this = this;
|
|
21804
|
+
return this.budgettedRecipes.reduce(function (acc, recipe, i) {
|
|
21805
|
+
// Don't count null recipes and currently replacing recipe
|
|
21806
|
+
return recipe && i !== _this.recipeToChangeIndex ? acc : acc + 1;
|
|
21807
|
+
}, 0);
|
|
21808
|
+
},
|
|
21809
|
+
enumerable: false,
|
|
21810
|
+
configurable: true
|
|
21811
|
+
});
|
|
21812
|
+
Object.defineProperty(MealsPlannerComponent.prototype, "excludedRecipesIds", {
|
|
21813
|
+
get: function () {
|
|
21814
|
+
return this.budgettedRecipes.filter(function (recipe) { return recipe; }).map(function (recipe) { return recipe.id; });
|
|
21815
|
+
},
|
|
21816
|
+
enumerable: false,
|
|
21817
|
+
configurable: true
|
|
21818
|
+
});
|
|
21767
21819
|
MealsPlannerComponent.prototype.ngOnInit = function () {
|
|
21768
21820
|
var _this = this;
|
|
21769
21821
|
this.subscriptions.push(this.contextService.enableMealsPlanner$.pipe(operators.skipWhile(function (enabled) { return !enabled; }), operators.take(1)).subscribe(function () {
|
|
@@ -21817,60 +21869,39 @@
|
|
|
21817
21869
|
MealsPlannerComponent.prototype.currentPath = function () {
|
|
21818
21870
|
return 'miam/recipes/meals-planner';
|
|
21819
21871
|
};
|
|
21820
|
-
// TODO: cut into more methods
|
|
21821
21872
|
MealsPlannerComponent.prototype.addRecipes = function () {
|
|
21822
21873
|
var _this = this;
|
|
21823
21874
|
this.loading = true;
|
|
21824
21875
|
this.scrollToTop();
|
|
21825
21876
|
this.cdr.detectChanges();
|
|
21826
|
-
var previousUsedBudget = this.usedBudget;
|
|
21827
|
-
var basketInitialized = false;
|
|
21828
21877
|
var recipesToAdd = this.budgettedRecipes.filter(function (r) { return r === null || r === void 0 ? void 0 : r.id; }); // remove empty recipes
|
|
21829
21878
|
this.basketsService.addRecipesToBasket(recipesToAdd.map(function (r) { return (r.id); }), recipesToAdd[0].modifiedGuests, this.eventTrace());
|
|
21830
21879
|
this.subscriptions.push(this.basketsService.recipesWillBeAdded().pipe(operators.skipWhile(function (recipesWillBeAdded) { return recipesWillBeAdded; }), operators.take(1), operators.switchMap(function () {
|
|
21831
21880
|
_this.addedRecipesIds = recipesToAdd.map(function (r) { return r.id; });
|
|
21832
|
-
return _this.basketsService.basketPreview$.pipe(operators.take(
|
|
21833
|
-
}), operators.
|
|
21834
|
-
if (basketInitialized) {
|
|
21835
|
-
_this.fetchBasketPreviewPricing(basketPreviewLines);
|
|
21836
|
-
_this.ingredientsRegrouped = previousUsedBudget !== _this.usedBudget;
|
|
21837
|
-
return _this.basketsService.basketPreview$;
|
|
21838
|
-
}
|
|
21839
|
-
basketInitialized = true;
|
|
21840
|
-
return rxjs.of(null);
|
|
21841
|
-
}), operators.switchMap(function (basketPreviewLines) {
|
|
21881
|
+
return _this.basketsService.basketPreview$.pipe(operators.take(1));
|
|
21882
|
+
}), operators.tap(function (basketPreviewLines) {
|
|
21842
21883
|
if (basketPreviewLines !== null) {
|
|
21843
|
-
|
|
21844
|
-
return _this.fetchBudgetValues();
|
|
21845
|
-
}
|
|
21846
|
-
return rxjs.of(_this.fetchBasketPreviewPricing(basketPreviewLines));
|
|
21884
|
+
_this.ingredientsRegrouped = _this.hasMutualizedEntry(basketPreviewLines);
|
|
21847
21885
|
}
|
|
21848
|
-
return rxjs.of(null);
|
|
21849
21886
|
})).subscribe(function () {
|
|
21850
21887
|
_this.loading = false;
|
|
21851
21888
|
_this.cdr.detectChanges();
|
|
21852
21889
|
}));
|
|
21853
21890
|
};
|
|
21854
|
-
MealsPlannerComponent.prototype.
|
|
21855
|
-
var containsSomeAddedRecipeId = false;
|
|
21856
|
-
this.addedRecipesIds.forEach(function (recipeId) {
|
|
21857
|
-
if (basketPreviewLines.some(function (line) { return line.id === recipeId; })) {
|
|
21858
|
-
containsSomeAddedRecipeId = true;
|
|
21859
|
-
}
|
|
21860
|
-
});
|
|
21861
|
-
return containsSomeAddedRecipeId;
|
|
21862
|
-
};
|
|
21863
|
-
MealsPlannerComponent.prototype.fetchBasketPreviewPricing = function (basketPreviewLines) {
|
|
21891
|
+
MealsPlannerComponent.prototype.hasMutualizedEntry = function (basketPreviewLines) {
|
|
21864
21892
|
var _this = this;
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
if (basketPreviewLine) {
|
|
21869
|
-
_this.usedBudget += +basketPreviewLine.price;
|
|
21893
|
+
return basketPreviewLines.some(function (line) {
|
|
21894
|
+
if (line.isRecipe) {
|
|
21895
|
+
return line.entries.found.some(function (entry) { return _this.isEntryMutualized(entry); });
|
|
21870
21896
|
}
|
|
21897
|
+
return false;
|
|
21871
21898
|
});
|
|
21872
|
-
|
|
21873
|
-
|
|
21899
|
+
};
|
|
21900
|
+
MealsPlannerComponent.prototype.isEntryMutualized = function (entry) {
|
|
21901
|
+
if (entry.status !== 'active') {
|
|
21902
|
+
return false;
|
|
21903
|
+
}
|
|
21904
|
+
return entry.recipesIds.length > 1;
|
|
21874
21905
|
};
|
|
21875
21906
|
MealsPlannerComponent.prototype.initRecipesPricing = function () {
|
|
21876
21907
|
var _this = this;
|
|
@@ -21940,7 +21971,7 @@
|
|
|
21940
21971
|
});
|
|
21941
21972
|
};
|
|
21942
21973
|
MealsPlannerComponent.prototype.updateUsesCount = function () {
|
|
21943
|
-
var oldCount = parseInt(localStorage.getItem('miam-meals-planner-uses-count'));
|
|
21974
|
+
var oldCount = parseInt(localStorage.getItem('miam-meals-planner-uses-count'), 10);
|
|
21944
21975
|
var newCount = Number.isNaN(oldCount) ? 1 : oldCount + 1;
|
|
21945
21976
|
localStorage.setItem('miam-meals-planner-uses-count', newCount.toString());
|
|
21946
21977
|
return newCount;
|
|
@@ -21950,40 +21981,10 @@
|
|
|
21950
21981
|
this.topAnchor.nativeElement.scrollIntoView();
|
|
21951
21982
|
}
|
|
21952
21983
|
};
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
21957
|
-
var remainingBudget = this.maxBudget - this.usedBudget;
|
|
21958
|
-
if (recipeToChangeId) {
|
|
21959
|
-
remainingBudget += this.budgettedRecipesPrices[recipeToChangeId];
|
|
21960
|
-
}
|
|
21961
|
-
if (remainingBudget > 0) {
|
|
21962
|
-
return remainingBudget;
|
|
21963
|
-
}
|
|
21964
|
-
return 0;
|
|
21965
|
-
},
|
|
21966
|
-
enumerable: false,
|
|
21967
|
-
configurable: true
|
|
21968
|
-
});
|
|
21969
|
-
Object.defineProperty(MealsPlannerComponent.prototype, "remainingRecipesNumber", {
|
|
21970
|
-
get: function () {
|
|
21971
|
-
var _this = this;
|
|
21972
|
-
return this.budgettedRecipes.reduce(function (acc, recipe, i) {
|
|
21973
|
-
// Don't count null recipes and currently replacing recipe
|
|
21974
|
-
return recipe && i !== _this.recipeToChangeIndex ? acc : acc + 1;
|
|
21975
|
-
}, 0);
|
|
21976
|
-
},
|
|
21977
|
-
enumerable: false,
|
|
21978
|
-
configurable: true
|
|
21979
|
-
});
|
|
21980
|
-
Object.defineProperty(MealsPlannerComponent.prototype, "excludedRecipesIds", {
|
|
21981
|
-
get: function () {
|
|
21982
|
-
return this.budgettedRecipes.filter(function (recipe) { return recipe; }).map(function (recipe) { return recipe.id; });
|
|
21983
|
-
},
|
|
21984
|
-
enumerable: false,
|
|
21985
|
-
configurable: true
|
|
21986
|
-
});
|
|
21984
|
+
MealsPlannerComponent.prototype.updateUsedBudget = function (usedBudget) {
|
|
21985
|
+
this.usedBudget = usedBudget;
|
|
21986
|
+
this.cdr.detectChanges();
|
|
21987
|
+
};
|
|
21987
21988
|
return MealsPlannerComponent;
|
|
21988
21989
|
}(EventTracerComponent));
|
|
21989
21990
|
MealsPlannerComponent.ɵfac = function MealsPlannerComponent_Factory(t) { return new (t || MealsPlannerComponent)(i0__namespace.ɵɵdirectiveInject(i3__namespace.FormBuilder), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService)); };
|
|
@@ -22020,7 +22021,7 @@
|
|
|
22020
22021
|
else {
|
|
22021
22022
|
i18n_5 = $localize(templateObject_3$c || (templateObject_3$c = __makeTemplateObject([":\u241F3b0b12b85604af610c07cfbd5d4f74662b9a881a\u241F1931799427977453728:Ajouter une id\u00E9e repas"], [":\u241F3b0b12b85604af610c07cfbd5d4f74662b9a881a\u241F1931799427977453728:Ajouter une id\u00E9e repas"])));
|
|
22022
22023
|
}
|
|
22023
|
-
return [[1, "miam-meals-planner-anchor"], ["miamMealsPlannerTopAnchor", ""], ["class", "miam-meals-planner", 4, "ngIf"], [1, "miam-meals-planner"], [1, "miam-meals-planner__header"], [1, "miam-meals-planner__header__breadcrumb", 3, "ngClass"], ["href", "/"], ["width", "18", "height", "18", "primaryColor", "#1F3543", 3, "iconName"], ["width", "24", "height", "24", 1, "chevron-right", 3, "iconName"], [1, "inactive", 3, "href"], i18n_1, ["href", "javascript:void(0)", 1, "active"], i18n_3, ["class", "chevron-right", "width", "24", "height", "24", 3, "iconName", 4, "ngIf"], ["href", "javascript:void(0)", "class", "subCategory", 4, "ngIf"], ["class", "miam-meals-planner__content", 4, "ngIf"], ["href", "javascript:void(0)", 1, "subCategory"], i18n_5, [1, "miam-meals-planner__content"], [3, "originTrace", "reduced", "form", "loading", "ngClass", "submitted", 4, "ngIf"], [3, "originTrace", "recipes", "usedBudget", "maxBudget", "loading", "recipeRemoval", "confirmed", "openCatalog", 4, "ngIf"], [3, "recipesIds", "usedBudget", "maxBudget", "ingredientsRegrouped", "originTrace", "ngClass", "closed", 4, "ngIf"], [3, "modifiedGuests", "originTrace", "remainingBudget", "remainingRecipesNumber", "excludedRecipesIds", "editRecipe", "canceled", 4, "ngIf"], [3, "recipesIds", "originTrace", "budget", 4, "ngIf"], [3, "originTrace", "reduced", "form", "loading", "ngClass", "submitted"], [3, "originTrace", "recipes", "usedBudget", "maxBudget", "loading", "recipeRemoval", "confirmed", "openCatalog"], [3, "recipesIds", "usedBudget", "maxBudget", "ingredientsRegrouped", "originTrace", "ngClass", "closed"], [3, "modifiedGuests", "originTrace", "remainingBudget", "remainingRecipesNumber", "excludedRecipesIds", "editRecipe", "canceled"], [3, "recipesIds", "originTrace", "budget"]];
|
|
22024
|
+
return [[1, "miam-meals-planner-anchor"], ["miamMealsPlannerTopAnchor", ""], ["class", "miam-meals-planner", 4, "ngIf"], [1, "miam-meals-planner"], [1, "miam-meals-planner__header"], [1, "miam-meals-planner__header__breadcrumb", 3, "ngClass"], ["href", "/"], ["width", "18", "height", "18", "primaryColor", "#1F3543", 3, "iconName"], ["width", "24", "height", "24", 1, "chevron-right", 3, "iconName"], [1, "inactive", 3, "href"], i18n_1, ["href", "javascript:void(0)", 1, "active"], i18n_3, ["class", "chevron-right", "width", "24", "height", "24", 3, "iconName", 4, "ngIf"], ["href", "javascript:void(0)", "class", "subCategory", 4, "ngIf"], ["class", "miam-meals-planner__content", 4, "ngIf"], ["href", "javascript:void(0)", 1, "subCategory"], i18n_5, [1, "miam-meals-planner__content"], [3, "originTrace", "reduced", "form", "loading", "ngClass", "submitted", 4, "ngIf"], [3, "originTrace", "recipes", "usedBudget", "maxBudget", "loading", "recipeRemoval", "confirmed", "openCatalog", 4, "ngIf"], [3, "recipesIds", "usedBudget", "maxBudget", "ingredientsRegrouped", "originTrace", "ngClass", "closed", "usedBudgetChanged", 4, "ngIf"], [3, "modifiedGuests", "originTrace", "remainingBudget", "remainingRecipesNumber", "excludedRecipesIds", "editRecipe", "canceled", 4, "ngIf"], [3, "recipesIds", "originTrace", "budget", 4, "ngIf"], [3, "originTrace", "reduced", "form", "loading", "ngClass", "submitted"], [3, "originTrace", "recipes", "usedBudget", "maxBudget", "loading", "recipeRemoval", "confirmed", "openCatalog"], [3, "recipesIds", "usedBudget", "maxBudget", "ingredientsRegrouped", "originTrace", "ngClass", "closed", "usedBudgetChanged"], [3, "modifiedGuests", "originTrace", "remainingBudget", "remainingRecipesNumber", "excludedRecipesIds", "editRecipe", "canceled"], [3, "recipesIds", "originTrace", "budget"]];
|
|
22024
22025
|
}, template: function MealsPlannerComponent_Template(rf, ctx) {
|
|
22025
22026
|
if (rf & 1) {
|
|
22026
22027
|
i0__namespace.ɵɵelement(0, "div", 0, 1);
|
|
@@ -27292,7 +27293,7 @@
|
|
|
27292
27293
|
if (rf & 1) {
|
|
27293
27294
|
var _r27_1 = i0__namespace.ɵɵgetCurrentView();
|
|
27294
27295
|
i0__namespace.ɵɵelementStart(0, "ng-miam-products-picker", 49);
|
|
27295
|
-
i0__namespace.ɵɵlistener("closeModal", function RecipeDetailsComponent_div_0_div_3_ng_container_35_ng_miam_products_picker_1_Template_ng_miam_products_picker_closeModal_0_listener() { i0__namespace.ɵɵrestoreView(_r27_1); var ctx_r26 = i0__namespace.ɵɵnextContext(4); return ctx_r26.
|
|
27296
|
+
i0__namespace.ɵɵlistener("closeModal", function RecipeDetailsComponent_div_0_div_3_ng_container_35_ng_miam_products_picker_1_Template_ng_miam_products_picker_closeModal_0_listener() { i0__namespace.ɵɵrestoreView(_r27_1); var ctx_r26 = i0__namespace.ɵɵnextContext(4); return ctx_r26.close(); })("guestsChange", function RecipeDetailsComponent_div_0_div_3_ng_container_35_ng_miam_products_picker_1_Template_ng_miam_products_picker_guestsChange_0_listener($event) { i0__namespace.ɵɵrestoreView(_r27_1); var ctx_r28 = i0__namespace.ɵɵnextContext(4); return ctx_r28.updateGuests($event); });
|
|
27296
27297
|
i0__namespace.ɵɵelementEnd();
|
|
27297
27298
|
}
|
|
27298
27299
|
if (rf & 2) {
|
|
@@ -27412,7 +27413,7 @@
|
|
|
27412
27413
|
if (rf & 1) {
|
|
27413
27414
|
var _r43_1 = i0__namespace.ɵɵgetCurrentView();
|
|
27414
27415
|
i0__namespace.ɵɵelementStart(0, "button", 72);
|
|
27415
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_div_37_ng_container_1_div_5_button_4_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r43_1); var ctx_r42 = i0__namespace.ɵɵnextContext(6); return ctx_r42.
|
|
27416
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_div_37_ng_container_1_div_5_button_4_Template_button_click_0_listener() { i0__namespace.ɵɵrestoreView(_r43_1); var ctx_r42 = i0__namespace.ɵɵnextContext(6); return ctx_r42.close(true); });
|
|
27416
27417
|
i0__namespace.ɵɵelementStart(1, "span", 73);
|
|
27417
27418
|
i0__namespace.ɵɵi18n(2, 74);
|
|
27418
27419
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -27425,7 +27426,7 @@
|
|
|
27425
27426
|
var _r45_1 = i0__namespace.ɵɵgetCurrentView();
|
|
27426
27427
|
i0__namespace.ɵɵelementStart(0, "div", 68);
|
|
27427
27428
|
i0__namespace.ɵɵelementStart(1, "button", 69);
|
|
27428
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_div_37_ng_container_1_div_5_Template_button_click_1_listener() { i0__namespace.ɵɵrestoreView(_r45_1); var ctx_r44 = i0__namespace.ɵɵnextContext(5); return ctx_r44.
|
|
27429
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_div_37_ng_container_1_div_5_Template_button_click_1_listener() { i0__namespace.ɵɵrestoreView(_r45_1); var ctx_r44 = i0__namespace.ɵɵnextContext(5); return ctx_r44.confirm(); });
|
|
27429
27430
|
i0__namespace.ɵɵelementStart(2, "span", 61);
|
|
27430
27431
|
i0__namespace.ɵɵi18n(3, 70);
|
|
27431
27432
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -27527,12 +27528,12 @@
|
|
|
27527
27528
|
i0__namespace.ɵɵelementStart(3, "div", 10);
|
|
27528
27529
|
i0__namespace.ɵɵelementStart(4, "div", 11);
|
|
27529
27530
|
i0__namespace.ɵɵelementStart(5, "button", 12);
|
|
27530
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_5_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r46 = i0__namespace.ɵɵnextContext(2); return ctx_r46.
|
|
27531
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_5_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r46 = i0__namespace.ɵɵnextContext(2); return ctx_r46.close(); });
|
|
27531
27532
|
i0__namespace.ɵɵelement(6, "img", 13);
|
|
27532
27533
|
i0__namespace.ɵɵelementEnd();
|
|
27533
27534
|
i0__namespace.ɵɵelementStart(7, "div", 14);
|
|
27534
27535
|
i0__namespace.ɵɵelementStart(8, "button", 15);
|
|
27535
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r48 = i0__namespace.ɵɵnextContext(2); return ctx_r48.
|
|
27536
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r48 = i0__namespace.ɵɵnextContext(2); return ctx_r48.close(); });
|
|
27536
27537
|
i0__namespace.ɵɵelement(9, "img", 16);
|
|
27537
27538
|
i0__namespace.ɵɵelementEnd();
|
|
27538
27539
|
i0__namespace.ɵɵtemplate(10, RecipeDetailsComponent_div_0_div_3_ng_miam_like_button_10_Template, 1, 2, "ng-miam-like-button", 17);
|
|
@@ -27556,7 +27557,7 @@
|
|
|
27556
27557
|
i0__namespace.ɵɵelementStart(21, "div", 26);
|
|
27557
27558
|
i0__namespace.ɵɵelementStart(22, "div", 27);
|
|
27558
27559
|
i0__namespace.ɵɵelementStart(23, "button", 28);
|
|
27559
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_23_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r50 = i0__namespace.ɵɵnextContext(2); return ctx_r50.
|
|
27560
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_23_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r50 = i0__namespace.ɵɵnextContext(2); return ctx_r50.close(); });
|
|
27560
27561
|
i0__namespace.ɵɵelement(24, "img", 29);
|
|
27561
27562
|
i0__namespace.ɵɵelementEnd();
|
|
27562
27563
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -27568,7 +27569,7 @@
|
|
|
27568
27569
|
i0__namespace.ɵɵpipe(29, "async");
|
|
27569
27570
|
i0__namespace.ɵɵelementStart(30, "div", 32);
|
|
27570
27571
|
i0__namespace.ɵɵelementStart(31, "button", 33);
|
|
27571
|
-
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_31_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(2); return ctx_r51.
|
|
27572
|
+
i0__namespace.ɵɵlistener("click", function RecipeDetailsComponent_div_0_div_3_Template_button_click_31_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(2); return ctx_r51.close(); });
|
|
27572
27573
|
i0__namespace.ɵɵelement(32, "img", 34);
|
|
27573
27574
|
i0__namespace.ɵɵelementEnd();
|
|
27574
27575
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -27753,6 +27754,7 @@
|
|
|
27753
27754
|
RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
|
|
27754
27755
|
var _a;
|
|
27755
27756
|
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
27757
|
+
this.recipeDetailsOpenTimestamp = Date.now();
|
|
27756
27758
|
this.fetchRecipe(this.recipeId);
|
|
27757
27759
|
this.cdr.detectChanges();
|
|
27758
27760
|
}
|
|
@@ -27880,6 +27882,15 @@
|
|
|
27880
27882
|
this.addButtonLoading = value;
|
|
27881
27883
|
this.cdr.detectChanges();
|
|
27882
27884
|
};
|
|
27885
|
+
RecipeDetailsComponent.prototype.confirm = function () {
|
|
27886
|
+
this.analyticsService.sendEventWhenReady(this.analyticsService.EVENT_RECIPE_CONTINUE, this.path(), Object.assign(Object.assign({}, this.props()), { time_passed: (Date.now() - this.recipeDetailsOpenTimestamp) / 1000 }));
|
|
27887
|
+
this.onClose();
|
|
27888
|
+
};
|
|
27889
|
+
RecipeDetailsComponent.prototype.close = function (openBasket) {
|
|
27890
|
+
if (openBasket === void 0) { openBasket = false; }
|
|
27891
|
+
this.analyticsService.sendEventWhenReady(this.analyticsService.EVENT_RECIPE_CLOSE, this.path(), Object.assign(Object.assign({}, this.props()), { time_passed: (Date.now() - this.recipeDetailsOpenTimestamp) / 1000 }));
|
|
27892
|
+
this.onClose(openBasket);
|
|
27893
|
+
};
|
|
27883
27894
|
RecipeDetailsComponent.prototype.onClose = function (openBasket) {
|
|
27884
27895
|
if (openBasket === void 0) { openBasket = false; }
|
|
27885
27896
|
this.recipeDetailsService.displayEventWasSent = false;
|
|
@@ -29479,32 +29490,48 @@
|
|
|
29479
29490
|
i0__namespace.ɵɵelementEnd();
|
|
29480
29491
|
}
|
|
29481
29492
|
}
|
|
29482
|
-
var NoSupplierOnboardingComponent = /** @class */ (function () {
|
|
29483
|
-
|
|
29484
|
-
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
|
|
29488
|
-
|
|
29493
|
+
var NoSupplierOnboardingComponent = /** @class */ (function (_super) {
|
|
29494
|
+
__extends(NoSupplierOnboardingComponent, _super);
|
|
29495
|
+
function NoSupplierOnboardingComponent(storeLocatoreService, cdr, analyticsService) {
|
|
29496
|
+
var _this = _super.call(this, analyticsService) || this;
|
|
29497
|
+
_this.storeLocatoreService = storeLocatoreService;
|
|
29498
|
+
_this.cdr = cdr;
|
|
29499
|
+
_this.analyticsService = analyticsService;
|
|
29500
|
+
_this.display = false;
|
|
29501
|
+
_this.step = 1;
|
|
29502
|
+
_this.pictures = [
|
|
29489
29503
|
'https://storage.googleapis.com/assets.miam.tech/generic/images/8.7/noSupplierOnboardingStep1.png',
|
|
29490
29504
|
'https://storage.googleapis.com/assets.miam.tech/generic/images/8.7/noSupplierOnboardingStep2.png',
|
|
29491
29505
|
'https://storage.googleapis.com/assets.miam.tech/generic/images/8.7/noSupplierOnboardingStep3.png',
|
|
29492
29506
|
'https://storage.googleapis.com/assets.miam.tech/generic/images/8.7/noSupplierOnboardingStep4.png'
|
|
29493
29507
|
];
|
|
29494
|
-
|
|
29508
|
+
_this.subscriptions = [];
|
|
29509
|
+
return _this;
|
|
29495
29510
|
}
|
|
29496
29511
|
NoSupplierOnboardingComponent.prototype.ngOnInit = function () {
|
|
29497
29512
|
var _this = this;
|
|
29498
29513
|
this.subscriptions.push(this.storeLocatoreService.showNoSupplierOnboarding.subscribe(function (show) {
|
|
29499
29514
|
_this.display = show;
|
|
29515
|
+
if (show) {
|
|
29516
|
+
_this.pageview();
|
|
29517
|
+
}
|
|
29500
29518
|
_this.cdr.detectChanges();
|
|
29501
29519
|
}));
|
|
29502
29520
|
};
|
|
29503
29521
|
NoSupplierOnboardingComponent.prototype.ngOnDestroy = function () {
|
|
29504
29522
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
29505
29523
|
};
|
|
29506
|
-
NoSupplierOnboardingComponent.prototype.
|
|
29524
|
+
NoSupplierOnboardingComponent.prototype.confirm = function () {
|
|
29507
29525
|
this.storeLocatoreService.showNoSupplierOnboarding.next(false);
|
|
29526
|
+
sessionStorage.setItem('_miam/noSupplier/onboarding', 'was-closed');
|
|
29527
|
+
};
|
|
29528
|
+
NoSupplierOnboardingComponent.prototype.onConfirm = function () {
|
|
29529
|
+
this.sendEvent(this.analyticsService.EVENT_ONBOARDING_ACTION);
|
|
29530
|
+
this.confirm();
|
|
29531
|
+
};
|
|
29532
|
+
NoSupplierOnboardingComponent.prototype.onClose = function () {
|
|
29533
|
+
this.sendEvent(this.analyticsService.EVENT_ONBOARDING_CLOSE);
|
|
29534
|
+
this.onConfirm();
|
|
29508
29535
|
};
|
|
29509
29536
|
NoSupplierOnboardingComponent.prototype.previousStep = function () {
|
|
29510
29537
|
this.step = Math.max(this.step - 1, 1);
|
|
@@ -29514,10 +29541,16 @@
|
|
|
29514
29541
|
this.step = Math.min(this.step + 1, 4);
|
|
29515
29542
|
this.cdr.detectChanges();
|
|
29516
29543
|
};
|
|
29544
|
+
NoSupplierOnboardingComponent.prototype.currentPath = function () {
|
|
29545
|
+
return 'onboarding';
|
|
29546
|
+
};
|
|
29547
|
+
NoSupplierOnboardingComponent.prototype.currentProps = function () {
|
|
29548
|
+
return { steps_completed: this.step + 1 };
|
|
29549
|
+
};
|
|
29517
29550
|
return NoSupplierOnboardingComponent;
|
|
29518
|
-
}());
|
|
29519
|
-
NoSupplierOnboardingComponent.ɵfac = function NoSupplierOnboardingComponent_Factory(t) { return new (t || NoSupplierOnboardingComponent)(i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef)); };
|
|
29520
|
-
NoSupplierOnboardingComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: NoSupplierOnboardingComponent, selectors: [["ng-miam-no-supplier-onboarding"]], decls: 26, vars: 28, consts: function () {
|
|
29551
|
+
}(EventTracerComponent));
|
|
29552
|
+
NoSupplierOnboardingComponent.ɵfac = function NoSupplierOnboardingComponent_Factory(t) { return new (t || NoSupplierOnboardingComponent)(i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(AnalyticsService)); };
|
|
29553
|
+
NoSupplierOnboardingComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: NoSupplierOnboardingComponent, selectors: [["ng-miam-no-supplier-onboarding"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 26, vars: 28, consts: function () {
|
|
29521
29554
|
var i18n_0;
|
|
29522
29555
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
29523
29556
|
var MSG_EXTERNAL_2816692981606991860$$LIB__WEB_COMPONENTS_NO_SUPPLIER_ONBOARDING_NO_SUPPLIER_ONBOARDING_COMPONENT_TS_1 = goog.getMsg("J'ai compris, je choisis un magasin !");
|
|
@@ -29618,7 +29651,7 @@
|
|
|
29618
29651
|
}, template: function NoSupplierOnboardingComponent_Template(rf, ctx) {
|
|
29619
29652
|
if (rf & 1) {
|
|
29620
29653
|
i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 0);
|
|
29621
|
-
i0__namespace.ɵɵlistener("confirm", function NoSupplierOnboardingComponent_Template_ng_miam_modal_confirm_0_listener() { return ctx.onConfirm(); })("close", function NoSupplierOnboardingComponent_Template_ng_miam_modal_close_0_listener() { return ctx.
|
|
29654
|
+
i0__namespace.ɵɵlistener("confirm", function NoSupplierOnboardingComponent_Template_ng_miam_modal_confirm_0_listener() { return ctx.onConfirm(); })("close", function NoSupplierOnboardingComponent_Template_ng_miam_modal_close_0_listener() { return ctx.onClose(); });
|
|
29622
29655
|
i0__namespace.ɵɵelementStart(1, "div", 1);
|
|
29623
29656
|
i0__namespace.ɵɵelementStart(2, "div", 2);
|
|
29624
29657
|
i0__namespace.ɵɵelementStart(3, "span", 3);
|
|
@@ -29706,7 +29739,7 @@
|
|
|
29706
29739
|
encapsulation: i0.ViewEncapsulation.None,
|
|
29707
29740
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
29708
29741
|
}]
|
|
29709
|
-
}], function () { return [{ type: StoreLocatorService }, { type: i0__namespace.ChangeDetectorRef }]; }, null);
|
|
29742
|
+
}], function () { return [{ type: StoreLocatorService }, { type: i0__namespace.ChangeDetectorRef }, { type: AnalyticsService }]; }, null);
|
|
29710
29743
|
})();
|
|
29711
29744
|
var templateObject_1$1, templateObject_2$1, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
|
|
29712
29745
|
|