mealz-components 2.5.1 → 2.6.1
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/dist/assets/{OperatorSubscriber-BaYaQC1O.js → OperatorSubscriber-DfCnFunn.js} +1 -1
- package/dist/assets/accordion-Unx2E22K.js +19 -0
- package/dist/assets/{args-BozZ6oU-.js → args-DAL2bHut.js} +1 -1
- package/dist/assets/{async-CFBGA-Dz.js → async-C5Kj_SqM.js} +1 -1
- package/dist/assets/{combineLatest-BmqPE0OB.js → combineLatest-Capvy1jI.js} +1 -1
- package/dist/assets/{debounceTime-B4DpnstH.js → debounceTime-Cf_7YmIn.js} +1 -1
- package/dist/assets/delay-DHNms76g.js +1 -0
- package/dist/assets/{distinctUntilChanged-91AVuO2B.js → distinctUntilChanged-kXqVrZ5h.js} +1 -1
- package/dist/assets/empty-qrpgDBbc.js +1 -0
- package/dist/assets/{filter-BZ75lS5D.js → filter-q99GWcpD.js} +1 -1
- package/dist/assets/firstValueFrom-Bcbk1SUg.js +1 -0
- package/dist/assets/{from-CAidt5N1.js → from-D8c5akO7.js} +1 -1
- package/dist/assets/guestObserver-C5qvv1Ll.js +1 -0
- package/dist/assets/{innerFrom-BgPDnAsH.js → innerFrom-DePszgj9.js} +1 -1
- package/dist/assets/isDate-BwHtzZM4.js +1 -0
- package/dist/assets/isScheduler-CqHuyMwD.js +1 -0
- package/dist/assets/{map-BVOhpQm0.js → map-DT-7dkaR.js} +1 -1
- package/dist/assets/mapOneOrManyArgs-CHGhEDCk.js +1 -0
- package/dist/assets/merge-DzIA6T0M.js +1 -0
- package/dist/assets/mergeAll-DpEYIxY3.js +1 -0
- package/dist/assets/{mergeMap-Dw_YYHwH.js → mergeMap-D2yctTHQ.js} +1 -1
- package/dist/assets/no-shadow-element-D62BBu0I.js +21 -0
- package/dist/assets/of-DtJFltSl.js +1 -0
- package/dist/assets/price-D6RVRYHJ.js +1 -0
- package/dist/assets/product-card-wIoU7Z_5.js +189 -0
- package/dist/assets/promotion-badge-CDaL7Tqv.js +12 -0
- package/dist/assets/{property-_7ObQ3dl.js → property-CoRN-Ln2.js} +1 -1
- package/dist/assets/singleton-COF3iBbF.js +1 -0
- package/dist/assets/skip-Bup0JB81.js +1 -0
- package/dist/assets/{skipWhile-BZVFq1Cg.js → skipWhile-Beza3ws3.js} +1 -1
- package/dist/assets/{state-W5mtSPAs.js → state-DDIoBQp5.js} +1 -1
- package/dist/assets/{switchMap-Dk_0Nhlo.js → switchMap-BAdE9Uzw.js} +1 -1
- package/dist/assets/{take-CozE9iSG.js → take-CpvJwza7.js} +1 -1
- package/dist/assets/{tap-C8CJ3R2H.js → tap-BN_fPb40.js} +1 -1
- package/dist/assets/timer-3Kpx74mt.js +1 -0
- package/dist/assets/{unsafe-html-CY0Np4--.js → unsafe-html-DWUMaK1p.js} +1 -1
- package/dist/assets/{viewport-listener-CDsKFDz1.js → viewport-listener-DsRHfwo4.js} +1 -1
- package/dist/basket-transfer-modal/basket-transfer-modal.min.js +5 -5
- package/dist/catalog/basket-preview/basket-preview.min.js +14 -14
- package/dist/catalog/catalog-category/catalog-category.min.js +1 -1
- package/dist/catalog/catalog-favorites/catalog-favorites.min.js +1 -1
- package/dist/catalog/catalog-history/catalog-history.min.js +1 -1
- package/dist/catalog/catalog-home/catalog-home.min.js +1 -1
- package/dist/catalog/catalog-home-header/catalog-home-header.min.js +1 -0
- package/dist/catalog/catalog-list/catalog-list.min.js +1 -1
- package/dist/catalog/catalog-load-more.min.js +1 -1
- package/dist/catalog/catalog-tabs/catalog-tabs.min.js +1 -1
- package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
- package/dist/catalog/my-meals-button/my-meals-button.min.js +1 -1
- package/dist/counter/counter.min.js +3 -3
- package/dist/drawer/drawer.css +1 -1
- package/dist/drawer/drawer.min.js +5 -5
- package/dist/drawer-view-swapper/drawer-view-swapper.min.js +23 -23
- package/dist/history-drawer/history-drawer.min.js +1 -1
- package/dist/history-order/history-order.min.js +1 -1
- package/dist/history-order-expanded/history-order-expanded.min.js +1 -1
- package/dist/last-order-badge/last-order-badge.min.js +2 -2
- package/dist/last-order-modal/last-order-modal.min.js +4 -4
- package/dist/like-button/like-button.min.js +1 -1
- package/dist/modal/modal.min.js +4 -4
- package/dist/no-supplier-add-to-cart-cta/no-supplier-add-to-cart-cta.min.js +2 -2
- package/dist/onboarding/onboarding.min.js +2 -2
- package/dist/order-again/order-again.min.js +2 -2
- package/dist/planner/helpers/get-planner-onboarding-modal-config.min.js +1 -0
- package/dist/planner/helpers/init-planner-onboarding-modal.min.js +1 -0
- package/dist/planner/helpers/open-onboarding-modal.min.js +1 -1
- package/dist/planner/planner-abandon-modal/planner-abandon-modal.min.js +2 -2
- package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.min.js +2 -2
- package/dist/planner/planner-budget-gauge/planner-budget-gauge.min.js +1 -1
- package/dist/planner/planner-catalog/planner-catalog.min.js +2 -2
- package/dist/planner/planner-current-menu/planner-current-menu.css +1 -1
- package/dist/planner/planner-current-menu/planner-current-menu.min.js +1 -1
- package/dist/planner/planner-current-menu-modal/planner-current-menu-modal.min.js +2 -2
- package/dist/planner/planner-dashboard/planner-dashboard.min.js +1 -1
- package/dist/planner/planner-form/planner-form.min.js +7 -7
- package/dist/planner/planner-menu-option/planner-menu-option.min.js +1 -1
- package/dist/planner/planner-onboarding/planner-onboarding.min.js +1 -1
- package/dist/planner/planner-onboarding-modal/planner-onboarding-modal.min.js +7 -7
- package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +2 -2
- package/dist/planner/planner-quick-menu/planner-quick-menu.min.js +1 -1
- package/dist/planner/planner-recipe-card/planner-recipe-card.min.js +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.css +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.min.js +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.css +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.min.js +1 -1
- package/dist/planner/planner-welcome-modal/planner-welcome-modal.min.js +2 -2
- package/dist/planner/to-basket-loader/to-basket-loader.min.js +5 -5
- package/dist/planner-entry/planner-entry.css +1 -1
- package/dist/planner-entry/planner-entry.min.js +1 -1
- package/dist/preferences/preferences.min.js +4 -4
- package/dist/price/price.min.js +3 -3
- package/dist/product-badges/product-badges.css +1 -1
- package/dist/product-card/product-card.css +1 -1
- package/dist/products-to-basket-cta/products-to-basket-cta.css +1 -0
- package/dist/products-to-basket-cta/products-to-basket-cta.min.js +1 -0
- package/dist/recipe-card/recipe-card.min.js +1 -1
- package/dist/recipe-card-cta/recipe-card-cta.min.js +1 -1
- package/dist/recipe-details/recipe-details.css +1 -1
- package/dist/recipe-details/recipe-details.min.js +105 -107
- package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
- package/dist/recipe-to-basket/recipe-to-basket.css +1 -0
- package/dist/recipe-to-basket/recipe-to-basket.min.js +1 -0
- package/dist/replace-item/replace-item-card/replace-item-card.min.js +11 -11
- package/dist/replace-item/replace-item.min.js +18 -18
- package/dist/replace-item-planner/replace-item-card-planner/replace-item-card-planner.min.js +4 -4
- package/dist/replace-item-planner/replace-item-planner.min.js +13 -13
- package/dist/select/select.min.js +6 -6
- package/dist/slider-tabs/slider-tabs.min.js +3 -3
- package/dist/store-indicator/store-indicator.min.js +2 -2
- package/dist/store-locator/store-locator.min.js +2 -2
- package/dist/store-locator-drawer/store-locator-drawer.min.js +2 -2
- package/dist/supplier-selector/supplier-selector.min.js +6 -6
- package/package.json +1 -1
- package/dist/assets/accordion-DJLqKUJq.js +0 -19
- package/dist/assets/custom-element-BhZVzxrc.js +0 -5
- package/dist/assets/delay-BNnJ-6LE.js +0 -1
- package/dist/assets/empty-0eVnsLmk.js +0 -1
- package/dist/assets/isScheduler-C5PGPVU1.js +0 -1
- package/dist/assets/mapOneOrManyArgs-COA1aRZM.js +0 -1
- package/dist/assets/merge-Cm-mm3_Q.js +0 -1
- package/dist/assets/mergeAll-BdUAXyrs.js +0 -1
- package/dist/assets/no-shadow-element-YPHUv5PR.js +0 -21
- package/dist/assets/of-DiALp3BZ.js +0 -1
- package/dist/assets/price-DAxY_7sk.js +0 -1
- package/dist/assets/product-card-HetVhdJ3.js +0 -189
- package/dist/assets/promotion-badge-8Arhhb-p.js +0 -12
- package/dist/assets/skip-zbH-ayby.js +0 -1
- package/dist/assets/timer-D82-ik89.js +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";import{_ as
|
|
1
|
+
import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";import{_ as J,n as O,p as F,b as X,c as Z,q as ee,N as k,D as c,k as i}from"../assets/no-shadow-element-D62BBu0I.js";import{n as h}from"../assets/property-CoRN-Ln2.js";import{P as te}from"../assets/price-D6RVRYHJ.js";import{m as r}from"../assets/mealz-sdk-E_fNZM-c.js";import{m as V}from"../assets/merge-DzIA6T0M.js";import{m as y}from"../assets/map-DT-7dkaR.js";import{t as B}from"../assets/take-CpvJwza7.js";import{c as H}from"../assets/capitalize-DUAqYmp4.js";import"../counter/counter.min.js";import"../assets/product-card-wIoU7Z_5.js";import"../price/price.min.js";import"../assets/promotion-badge-CDaL7Tqv.js";import{G as j}from"../assets/guestObserver-C5qvv1Ll.js";import"../assets/accordion-Unx2E22K.js";import"../store-indicator/store-indicator.min.js";import"../last-order-badge/last-order-badge.min.js";import"../order-again/order-again.min.js";import"../like-button/like-button.min.js";import{L as se}from"../last-order-modal/last-order-modal.min.js";import{a as ie}from"../assets/unsafe-html-DWUMaK1p.js";import{M as ae}from"../planner/planner-onboarding/planner-onboarding.min.js";import{o as W,c as re}from"../assets/OperatorSubscriber-DfCnFunn.js";import{i as U}from"../assets/innerFrom-DePszgj9.js";import{f as N}from"../assets/filter-q99GWcpD.js";import{t as I}from"../assets/tap-BN_fPb40.js";import{s as q}from"../assets/switchMap-BAdE9Uzw.js";import{c as G}from"../assets/combineLatest-Capvy1jI.js";import{d as ne}from"../assets/async-C5Kj_SqM.js";import"../assets/viewport-listener-DsRHfwo4.js";import"../assets/debounceTime-Cf_7YmIn.js";import"../assets/skipWhile-Beza3ws3.js";import"../assets/singleton-COF3iBbF.js";import"../assets/mergeAll-DpEYIxY3.js";import"../assets/mergeMap-D2yctTHQ.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/empty-qrpgDBbc.js";import"../assets/args-DAL2bHut.js";import"../assets/isScheduler-CqHuyMwD.js";import"../assets/from-D8c5akO7.js";import"../assets/delay-DHNms76g.js";import"../assets/timer-3Kpx74mt.js";import"../assets/isDate-BwHtzZM4.js";import"../store-locator/store-locator.min.js";import"../assets/state-DDIoBQp5.js";import"../assets/query-BApjzB0v.js";import"../onboarding/onboarding.min.js";import"../onboarding/events.min.js";import"../onboarding/analytics/onboarding-analytics.min.js";import"../assets/responsive-C7Qf71r3.js";import"../assets/mapOneOrManyArgs-CHGhEDCk.js";var oe=function(o){J(e,o);function e(t,s,a){t===void 0&&(t=1/0),s===void 0&&(s=1/0),a===void 0&&(a=ne);var n=o.call(this)||this;return n._bufferSize=t,n._windowTime=s,n._timestampProvider=a,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=s===1/0,n._bufferSize=Math.max(1,t),n._windowTime=Math.max(1,s),n}return e.prototype.next=function(t){var s=this,a=s.isStopped,n=s._buffer,l=s._infiniteTimeWindow,p=s._timestampProvider,d=s._windowTime;a||(n.push(t),!l&&n.push(p.now()+d)),this._trimBuffer(),o.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var s=this._innerSubscribe(t),a=this,n=a._infiniteTimeWindow,l=a._buffer,p=l.slice(),d=0;d<p.length&&!t.closed;d+=n?1:2)t.next(p[d]);return this._checkFinalizedStatuses(t),s},e.prototype._trimBuffer=function(){var t=this,s=t._bufferSize,a=t._timestampProvider,n=t._buffer,l=t._infiniteTimeWindow,p=(l?1:2)*s;if(s<1/0&&p<n.length&&n.splice(0,n.length-p),!l){for(var d=a.now(),g=0,u=1;u<n.length&&n[u]<=d;u+=2)g=u;g&&n.splice(0,g+1)}},e}(O);function le(o){o===void 0&&(o={});var e=o.connector,t=e===void 0?function(){return new O}:e,s=o.resetOnError,a=s===void 0?!0:s,n=o.resetOnComplete,l=n===void 0?!0:n,p=o.resetOnRefCountZero,d=p===void 0?!0:p;return function(g){var u,m,v,b=0,f=!1,_=!1,z=function(){m==null||m.unsubscribe(),m=void 0},$=function(){z(),u=v=void 0,f=_=!1},Y=function(){var S=u;$(),S==null||S.unsubscribe()};return W(function(S,M){b++,!_&&!f&&z();var R=v=v??t();M.add(function(){b--,b===0&&!_&&!f&&(m=A(Y,d))}),R.subscribe(M),!u&&b>0&&(u=new F({next:function(x){return R.next(x)},error:function(x){_=!0,z(),m=A($,a,x),R.error(x)},complete:function(){f=!0,z(),m=A($,l),R.complete()}}),U(S).subscribe(u))})(g)}}function A(o,e){for(var t=[],s=2;s<arguments.length;s++)t[s-2]=arguments[s];if(e===!0){o();return}if(e!==!1){var a=new F({next:function(){a.unsubscribe(),o()}});return U(e.apply(void 0,X([],Z(t)))).subscribe(a)}}function ce(o,e,t){var s,a=!1;return s=o,le({connector:function(){return new oe(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function w(o){return W(function(e,t){U(o).subscribe(re(t,function(){return t.complete()},ee)),!t.closed&&e.subscribe(t)})}var de=Object.defineProperty,E=(o,e,t,s)=>{for(var a=void 0,n=o.length-1,l;n>=0;n--)(l=o[n])&&(a=l(e,t,a)||a);return a&&de(e,t,a),a};class T extends k{constructor(){super(),this.noPosDisplay=!1,this.noSupplier=!1,this.recipeId="",this.plannerMode=!1,this.guests=0,this.recipe=null,this.analyticsPath="",this.subscriptions=[],this.remainingBasketEntries=[],this.recipePrice={remaining:0,inBasket:0,total:0,totalPerGuest:0},this.priceService=te.getInstance(),this.allIngredientsToBasketLoading=!1,this.ingredientToBasketLoading=!1,this.updateIngredientFromBasketLoading=!1,this.productsLoading=!1,this.inMenu=!1,this.menuUpdateLoading=!1,this.styleURL=new URL("./recipe-details/details-footer/details-footer.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.priceService.initFormatter(),this.analyticsPath=`/recipes/${this.recipeId}/shopping`,this.subscriptions.push(V(r.recipes.remainingBasketEntries$.pipe(y(e=>{this.remainingBasketEntries=e})),r.recipes.recipePrice$.pipe(y(e=>{const t=e.remaining+e.inBasket;this.recipePrice={...e,total:t,totalPerGuest:0}})),r.recipes.allIngredientsToBasketLoading$.pipe(y(e=>{this.allIngredientsToBasketLoading=e})),r.recipes.ingredientToBasketLoading$.pipe(y(e=>{this.ingredientToBasketLoading=e})),r.recipes.updateIngredientFromBasketLoading$.pipe(y(e=>{this.updateIngredientFromBasketLoading=e})),r.recipes.productsLoading$.pipe(y(e=>{this.productsLoading=e})),r.planner.plannerRecipePrice$.pipe(y(e=>{this.recipePrice.totalPerGuest=this.guests>0?e/this.guests:e}))).subscribe(()=>this.requestUpdate())),this.subscribeIsRecipeInMenu()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.isRecipeInMenuSub&&(this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=void 0)}updated(e){super.updated(e),e.has("recipeId")&&this.subscribeIsRecipeInMenu()}subscribeIsRecipeInMenu(){this.recipeId&&(this.isRecipeInMenuSub&&this.isRecipeInMenuSub.unsubscribe(),this.isRecipeInMenuSub=r.planner.isRecipeInMenu$(this.recipeId).pipe(y(e=>{this.inMenu=e})).subscribe(()=>this.requestUpdate()))}closeRecipeDetails(e=!1){r.recipes.displayedRecipe$.next(null),e&&r.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:r.basket.basketPreviewState$.getValue().activeTabIndex})}continueShopping(){this.closeRecipeDetails(),this.sendContinueEvent()}addToMenu(){var a,n;this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion"),t=!!e&&!!e.recipeId&&e.recipeId===this.recipeId,s=document.querySelector("mealz-planner-current-menu");if(!s){const l=(n=(a=r.recipes)==null?void 0:a.productsPlannerByCategory$)==null?void 0:n.value,p=(l==null?void 0:l.toPickProducts)||[];r.planner.addRecipeToMenu(this.recipeId,this.guests,!!r.pos.currentPos().value,p).pipe(B(1)).subscribe(()=>{this.inMenu=!0;const d=document.querySelector("mealz-planner-recipe-list");d==null||d.addRecipeCardToList(this.recipeId),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()});return}if(t){e.addRecipeFromDetails$(this.guests).subscribe({next:()=>{this.inMenu=!0,this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}});return}s.addRecipe(this.recipeId,this.guests).pipe(B(1)).subscribe({next:()=>{this.inMenu=!0,e==null||e.addAndSelectNewSuggestion(this.recipe||void 0),this.menuUpdateLoading=!1,this.requestUpdate(),this.closeRecipeDetails()},error:()=>{this.menuUpdateLoading=!1,this.requestUpdate()}})}removeFromMenu(){this.menuUpdateLoading=!0,this.requestUpdate();const e=document.querySelector("mealz-planner-recipe-suggestion");if(!e){r.planner.removeRecipeFromMenu(this.recipeId).pipe(B(1)).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()});return}e.removeRecipe(this.recipeId).subscribe(()=>{this.inMenu=!1,this.menuUpdateLoading=!1,this.requestUpdate()})}addAllIngredients(){r.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}}),this.sendAddAllEvent(),this.recipePrice.inBasket===0&&this.sendAddRecipeEvent()}render(){if(this.noPosDisplay&&!this.plannerMode)return c;const e=this.remainingBasketEntries.length>0&&!this.plannerMode,t=this.plannerMode&&this.noPosDisplay,s=this.plannerMode&&!this.inMenu;return i`
|
|
2
2
|
<div class="mealz-recipe-details__footer">
|
|
3
|
-
${this.productsLoading&&!this.plannerMode?c:
|
|
3
|
+
${this.productsLoading&&!this.plannerMode?c:i`
|
|
4
4
|
<!-- ADD TO BASKET CTA -->
|
|
5
|
-
${e||t||s?this.renderAddToBasketButton():
|
|
5
|
+
${e||t||s?this.renderAddToBasketButton():i`
|
|
6
6
|
<div class="mealz-recipe-details__recipe-is-in-basket-cta-container">
|
|
7
7
|
${this.renderBasketActions()}
|
|
8
8
|
</div>
|
|
9
9
|
`}
|
|
10
10
|
`}
|
|
11
11
|
${this.noPosDisplay?c:this.renderPrice()}
|
|
12
|
-
</div>`}renderAddToBasketButton(){const e=this.remainingBasketEntries.length;return this.allIngredientsToBasketLoading||this.menuUpdateLoading?
|
|
13
|
-
<button class="mealz-recipe-details__add-to-basket-cta mealz-ds-button primary">
|
|
12
|
+
</div>`}renderAddToBasketButton(){const e=this.remainingBasketEntries.length;return this.allIngredientsToBasketLoading||this.menuUpdateLoading?i`
|
|
13
|
+
<button class="mealz-recipe-details__add-to-basket-cta mealz-recipe-details__add-to-basket-cta--loading mealz-ds-button primary">
|
|
14
14
|
<div class="mealz-ds-loader"></div>
|
|
15
15
|
</button>
|
|
16
|
-
`:this.plannerMode?
|
|
16
|
+
`:this.plannerMode?i`
|
|
17
17
|
<button
|
|
18
|
-
class="mealz-recipe-details__add-to-basket-cta mealz-ds-button primary"
|
|
18
|
+
class="mealz-recipe-details__add-to-basket-cta mealz-recipe-details__add-to-basket-cta--to-menu mealz-ds-button primary"
|
|
19
19
|
@click=${()=>this.addToMenu()}
|
|
20
20
|
>
|
|
21
21
|
<span class="mealz-ds-text size-s weight-xl">Ajouter au menu</span>
|
|
22
22
|
<img src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Pot-add_white.svg" alt="add to menu icon" />
|
|
23
23
|
</button>
|
|
24
|
-
`:
|
|
24
|
+
`:i`
|
|
25
25
|
<button
|
|
26
|
-
class="mealz-recipe-details__add-to-basket-cta mealz-ds-text mealz-ds-button size-m weight-xl primary"
|
|
26
|
+
class="mealz-recipe-details__add-to-basket-cta mealz-recipe-details__add-to-basket-cta--to-basket mealz-ds-text mealz-ds-button size-m weight-xl primary"
|
|
27
27
|
@click=${()=>this.addAllIngredients()}
|
|
28
28
|
>
|
|
29
29
|
<img
|
|
@@ -42,11 +42,11 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</button>
|
|
45
|
-
`}renderBasketActions(){return this.menuUpdateLoading?
|
|
45
|
+
`}renderBasketActions(){return this.menuUpdateLoading?i`
|
|
46
46
|
<button class="mealz-ds-button">
|
|
47
47
|
<div class="mealz-ds-loader"></div>
|
|
48
48
|
</button>
|
|
49
|
-
`:this.plannerMode?
|
|
49
|
+
`:this.plannerMode?i`
|
|
50
50
|
<!-- REMOVE FROM MENU CTA -->
|
|
51
51
|
<button class="mealz-ds-button secondary mealz-recipe-details__remove-from-menu-cta" @click=${()=>this.removeFromMenu()}>
|
|
52
52
|
<img alt="remove icon"
|
|
@@ -55,7 +55,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
55
55
|
Retirer du menu
|
|
56
56
|
</span>
|
|
57
57
|
</button>
|
|
58
|
-
`:
|
|
58
|
+
`:i`
|
|
59
59
|
<!-- CONTINUE CTA -->
|
|
60
60
|
<button
|
|
61
61
|
class="mealz-ds-button secondary mealz-recipe-details__continue-shopping-cta ${this.noSupplier?"mobile-hidden":""}"
|
|
@@ -66,7 +66,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
66
66
|
</button>
|
|
67
67
|
|
|
68
68
|
<!-- VIEW BASKET CTA (ONLY IF NO SUPPLIER MODE) -->
|
|
69
|
-
${this.noSupplier?
|
|
69
|
+
${this.noSupplier?i`
|
|
70
70
|
<button
|
|
71
71
|
@click=${()=>this.closeRecipeDetails(!0)}
|
|
72
72
|
class="mealz-ds-button mealz-ds-text size-m weight-xl primary mealz-recipe-details__see-basket-cta">
|
|
@@ -78,7 +78,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
78
78
|
src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"/>
|
|
79
79
|
</button>
|
|
80
80
|
`:c}
|
|
81
|
-
`}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return c;const e=this.ingredientToBasketLoading||this.updateIngredientFromBasketLoading||this.productsLoading,t=this.plannerMode?this.recipePrice.totalPerGuest:this.recipePrice.inBasket;return
|
|
81
|
+
`}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return c;const e=this.ingredientToBasketLoading||this.updateIngredientFromBasketLoading||this.productsLoading,t=this.plannerMode?this.recipePrice.totalPerGuest:this.recipePrice.inBasket;return i`
|
|
82
82
|
<div class="mealz-recipe-details__price">
|
|
83
83
|
<div
|
|
84
84
|
class="mealz-recipe-details__price-label ${this.plannerMode?"":"primary"} mealz-ds-text size-l weight-xxl">
|
|
@@ -91,7 +91,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
91
91
|
${this.plannerMode?"par personne":"dans votre panier"}
|
|
92
92
|
</span>
|
|
93
93
|
</div>
|
|
94
|
-
`}sendAddAllEvent(){
|
|
94
|
+
`}sendAddAllEvent(){r.analytics.sendEvent("entry.add-all",this.analyticsPath,{recipe_id:this.recipeId,entry_count:this.remainingBasketEntries.length})}sendAddRecipeEvent(){r.analytics.sendEvent("recipe.add",this.analyticsPath,{recipe_id:this.recipeId})}sendContinueEvent(){r.analytics.sendEvent("recipe.continue",this.analyticsPath,{recipe_id:this.recipeId})}}E([h({type:Boolean})],T.prototype,"noPosDisplay");E([h({type:Boolean})],T.prototype,"noSupplier");E([h({type:String})],T.prototype,"recipeId");E([h({type:Boolean})],T.prototype,"plannerMode");E([h({type:Number})],T.prototype,"guests");E([h({attribute:!1})],T.prototype,"recipe");customElements.get("mealz-details-footer")||customElements.define("mealz-details-footer",T);class pe extends k{constructor(){super(),this.tags=[],this.displayTags=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-infos/details-infos.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(r.recipes.displayedRecipe$.subscribe(e=>{e&&(this.recipe=e.recipe,this.tags=e.recipe.relationships.tags.data.map(t=>t.attributes.name),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}toggleTags(){this.displayTags=!this.displayTags,this.requestUpdate()}noTimePlaceholder(){return i`<span class="mealz-recipe-details-infos__no-time-placeholder">0 min</span>`}noDataPlaceholder(){return i`<span class="mealz-recipe-details-infos__no-data-placeholder">-</span>`}getRecipeDifficultyIntoClassName(){switch(this.recipe.attributes.difficulty){case 1:return"easy";case 2:return"medium";case 3:return"hard";default:return"no-difficulty-defined"}}getRecipeDifficultyIntoText(){switch(this.recipe.attributes.difficulty){case 1:return i`<span class="mealz-ds-text">Facile</span>`;case 2:return i`<span class="mealz-ds-text">Moyen</span>`;case 3:return i`<span class="mealz-ds-text">Difficile</span>`;default:return c}}renderPreparationTime(){return i`
|
|
95
95
|
<!-- PREPARATION TIME -->
|
|
96
96
|
<div
|
|
97
97
|
class="
|
|
@@ -103,9 +103,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
103
103
|
>
|
|
104
104
|
<img alt="preparation time icon"
|
|
105
105
|
src="https://storage.googleapis.com/assets.miam.tech/generic/icons/knife-primary.svg"/>
|
|
106
|
-
${this.recipe.preparationTime?
|
|
106
|
+
${this.recipe.preparationTime?i`<span class="mealz-ds-text">${this.recipe.preparationTime}</span>`:this.noTimePlaceholder()}
|
|
107
107
|
</div>
|
|
108
|
-
`}renderCookingTime(){return
|
|
108
|
+
`}renderCookingTime(){return i`
|
|
109
109
|
<!-- COOKING TIME -->
|
|
110
110
|
<div class="
|
|
111
111
|
mealz-ds-badge
|
|
@@ -115,11 +115,11 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
115
115
|
${this.recipe.cookingTime==="-"?"no-cooking-time-defined":""}"
|
|
116
116
|
>
|
|
117
117
|
<img alt="cooking time icon" src="https://storage.googleapis.com/assets.miam.tech/generic/icons/pan-primary.svg"/>
|
|
118
|
-
${this.recipe.cookingTime?
|
|
118
|
+
${this.recipe.cookingTime?i`<span class="mealz-ds-text">${this.recipe.cookingTime}</span>`:this.noTimePlaceholder()}
|
|
119
119
|
</div>
|
|
120
|
-
`}renderRecipeDifficulty(){return
|
|
120
|
+
`}renderRecipeDifficulty(){return i`
|
|
121
121
|
<!-- RECIPE DIFFICULTY -->
|
|
122
|
-
${this.recipe.difficulty?
|
|
122
|
+
${this.recipe.difficulty?i`
|
|
123
123
|
<div class="
|
|
124
124
|
mealz-ds-badge
|
|
125
125
|
size-l
|
|
@@ -130,9 +130,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
130
130
|
src="https://storage.googleapis.com/assets.miam.tech/generic/icons/chef-hat-primary.svg"/>
|
|
131
131
|
${this.getRecipeDifficultyIntoText()}
|
|
132
132
|
</div>
|
|
133
|
-
`:c}`}renderMoreTags(){return
|
|
133
|
+
`:c}`}renderMoreTags(){return i`
|
|
134
134
|
<!-- MORE INFO -->
|
|
135
|
-
${this.displayTags?this.renderTags():
|
|
135
|
+
${this.displayTags?this.renderTags():i`
|
|
136
136
|
<div
|
|
137
137
|
class="mealz-ds-badge size-l mealz-recipe-details-infos__badge more-info"
|
|
138
138
|
@click=${()=>this.toggleTags()}
|
|
@@ -143,21 +143,21 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
143
143
|
/>
|
|
144
144
|
</div>
|
|
145
145
|
`}
|
|
146
|
-
`}renderTags(){return
|
|
146
|
+
`}renderTags(){return i`
|
|
147
147
|
<!-- TAGS -->
|
|
148
|
-
${this.tags.map(e=>
|
|
148
|
+
${this.tags.map(e=>i`
|
|
149
149
|
<div class="mealz-ds-badge size-l mealz-recipe-details-infos__badge tag">
|
|
150
150
|
<span class="mealz-ds-text">${e}</span>
|
|
151
151
|
</div>
|
|
152
152
|
`)}
|
|
153
|
-
`}render(){return
|
|
153
|
+
`}render(){return i`
|
|
154
154
|
<div class="mealz-recipe-details-infos__container ${this.displayTags?"tags-displayed":""}">
|
|
155
155
|
${this.renderPreparationTime()}
|
|
156
156
|
${this.renderCookingTime()}
|
|
157
157
|
${this.renderRecipeDifficulty()}
|
|
158
158
|
${this.renderMoreTags()}
|
|
159
159
|
</div>
|
|
160
|
-
`}}
|
|
160
|
+
`}}customElements.get("mealz-details-infos")||customElements.define("mealz-details-infos",pe);class ue extends k{constructor(){super(),this.steps=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-steps/details-steps.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(r.recipes.displayedRecipe$.subscribe(e=>{e&&(this.steps=e.recipe.relationships["recipe-steps"].data.sort((t,s)=>t.attributes["step-number"]-s.attributes["step-number"]).map(t=>t.attributes.description),this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){return i`
|
|
161
161
|
<div class="mealz-details-steps">
|
|
162
162
|
<!-- HEADER -->
|
|
163
163
|
<div class="mealz-ds-text weight-xxl mealz-details-steps__header">
|
|
@@ -166,7 +166,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
166
166
|
</div>
|
|
167
167
|
<!-- LIST -->
|
|
168
168
|
<div class="mealz-details-steps__list">
|
|
169
|
-
${this.steps.map((e,t)=>
|
|
169
|
+
${this.steps.map((e,t)=>i`
|
|
170
170
|
<div class="mealz-details-steps__step">
|
|
171
171
|
<!-- INDEX -->
|
|
172
172
|
<div class="mealz-details-steps__step__idx">
|
|
@@ -180,16 +180,16 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
180
180
|
`)}
|
|
181
181
|
</div>
|
|
182
182
|
</div>
|
|
183
|
-
`}}
|
|
183
|
+
`}}customElements.get("mealz-details-steps")||customElements.define("mealz-details-steps",ue);class he extends k{constructor(){super(),this.ingredients=[],this.subscriptions=[],this.styleURL=new URL("./recipe-details/details-ingredients/details-ingredients.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(r.recipes.displayedRecipe$.subscribe(e=>{e&&(this.ingredients=e.recipe.relationships.ingredients.data,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){var e,t;return i`
|
|
184
184
|
<div class="mealz-details-ingredients">
|
|
185
185
|
<!-- HEADER -->
|
|
186
186
|
<div class="mealz-ds-text weight-xxl mealz-details-ingredients__header">
|
|
187
187
|
<span>${(e=this.ingredients)==null?void 0:e.length}</span>
|
|
188
|
-
${((t=this.ingredients)==null?void 0:t.length)>1?
|
|
188
|
+
${((t=this.ingredients)==null?void 0:t.length)>1?i`<span>ingrédients</span>`:i`<span>ingrédient</span>`}
|
|
189
189
|
</div>
|
|
190
190
|
<!-- LIST -->
|
|
191
191
|
<div class="mealz-details-ingredients__list">
|
|
192
|
-
${this.ingredients.map(s=>
|
|
192
|
+
${this.ingredients.map(s=>i`
|
|
193
193
|
<div class="mealz-details-ingredients__item">
|
|
194
194
|
<!-- PICTURE -->
|
|
195
195
|
<div class="mealz-ds-avatar mealz-details-ingredients__picture_container">
|
|
@@ -199,7 +199,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
199
199
|
</div>
|
|
200
200
|
<!-- NAME -->
|
|
201
201
|
<span class="mealz-ds-text size-s weight-xxl mealz-details-ingredients__name">
|
|
202
|
-
${
|
|
202
|
+
${H(s.attributes.name)}
|
|
203
203
|
</span>
|
|
204
204
|
<!-- QUANTITY -->
|
|
205
205
|
<div class="mealz-ds-text size-s weight-l mealz-details-ingredients__row__qty">
|
|
@@ -209,10 +209,10 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
209
209
|
`)}
|
|
210
210
|
</div>
|
|
211
211
|
</div>
|
|
212
|
-
`}ingredientPicture(e){return e.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}}
|
|
212
|
+
`}ingredientPicture(e){return e.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}}customElements.get("mealz-details-ingredients")||customElements.define("mealz-details-ingredients",he);var me=Object.defineProperty,C=(o,e,t,s)=>{for(var a=void 0,n=o.length-1,l;n>=0;n--)(l=o[n])&&(a=l(e,t,a)||a);return a&&me(e,t,a),a};const L=["unavailable"],ge=["ticked","unselected"];class P extends k{constructor(){super(),this.recipeId="",this.initialGuests=0,this.currentGuests=0,this.oftenIgnored=!1,this.subscriptions=[],this.guestObserverService=j.getInstance(),this.modifiedIngQty=0,this.analyticsPath="/meals-planner/current",this.styleURL=new URL("./product-card/product-card-planner.css",this.getBaseURL())}get status(){var e;return(e=this.product)==null?void 0:e.status}set status(e){this.product.status=e,this.requestUpdate()}get productImage(){var e;return((e=this.product.item)==null?void 0:e.attributes.image)||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get ingredientPicture(){return this.product.ingredient.picture||"https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg"}get isSponsored(){var e,t,s;return((s=(t=(e=this.product)==null?void 0:e.item)==null?void 0:t.attributes)==null?void 0:s.sponsored)===!0}connectedCallback(){super.connectedCallback(),this.listenGuestsChange(),this.calculateQty()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenGuestsChange(){this.subscriptions.push(this.guestObserverService.guests$.subscribe(e=>{this.currentGuests=e,this.calculateQty()}))}calculateQty(){const e=this.product.ingredient.attributes.quantity/this.initialGuests;this.modifiedIngQty=Number((e*this.currentGuests).toFixed(2)),this.requestUpdate()}openReplaceItemView(){r.planner.openReplaceItemView(this.product),this.replaceItemViewEvent()}onCheckboxChange(e){e.target.checked?(this.status="ticked",r.planner.selectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.addItemEvent()):(this.status="unselected",r.planner.unselectProduct(+this.product.item.id,this.product.ingredient.relationships.definition.data.id),this.deleteItemEvent()),this.requestUpdate()}render(){return i`
|
|
213
213
|
<div class="mealz-product-card-planner
|
|
214
214
|
${this.status==="ticked"?"added":""}
|
|
215
|
-
${
|
|
215
|
+
${L.includes(this.status)||this.oftenIgnored?"disabled":""}
|
|
216
216
|
${this.status==="unavailable"?"unavailable":""}"
|
|
217
217
|
>
|
|
218
218
|
${this.renderHeader()}
|
|
@@ -220,10 +220,10 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
220
220
|
${this.oftenIgnored?"disabled":""}
|
|
221
221
|
${this.status==="unavailable"?"unavailable":""}"
|
|
222
222
|
>
|
|
223
|
-
${
|
|
223
|
+
${ge.includes(this.status)&&!this.oftenIgnored?this.renderEnabledProductCard():this.renderDisabledOrUnavailableProduct()}
|
|
224
224
|
</div>
|
|
225
225
|
</div>
|
|
226
|
-
`}renderEnabledProductCard(){return
|
|
226
|
+
`}renderEnabledProductCard(){return i`
|
|
227
227
|
<mealz-promotion-badge .priceData="${this.product.price}"></mealz-promotion-badge>
|
|
228
228
|
<div class="mealz-product-card-planner__selected-product">
|
|
229
229
|
<div class="mealz-product-card-planner__picture-column">
|
|
@@ -257,7 +257,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
257
257
|
</div>
|
|
258
258
|
</div>
|
|
259
259
|
${this.renderFooterActions()}
|
|
260
|
-
`}renderHeader(){return
|
|
260
|
+
`}renderHeader(){return i`
|
|
261
261
|
<div
|
|
262
262
|
class="mealz-product-card-planner__header
|
|
263
263
|
${this.status==="ticked"?"added":""}
|
|
@@ -267,21 +267,21 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
267
267
|
class="
|
|
268
268
|
mealz-product-card-planner__header-name
|
|
269
269
|
mealz-ds-text weight-xl
|
|
270
|
-
${
|
|
270
|
+
${L.includes(this.status)||this.oftenIgnored?"mealz-product-card-planner__disabled-text":""}"
|
|
271
271
|
>
|
|
272
|
-
${
|
|
272
|
+
${H(this.product.ingredient.attributes.name)}
|
|
273
273
|
</span>
|
|
274
274
|
<span
|
|
275
275
|
class="
|
|
276
276
|
mealz-product-card-planner__header-quantity
|
|
277
277
|
mealz-ds-text size-s weight-l
|
|
278
|
-
${
|
|
278
|
+
${L.includes(this.status)||this.oftenIgnored?"mealz-product-card-planner__disabled-text":""}"
|
|
279
279
|
>
|
|
280
280
|
<span>${this.modifiedIngQty?this.modifiedIngQty:this.product.ingredient.attributes.quantity}</span>
|
|
281
281
|
<span>${this.product.ingredient.attributes.unit}</span>
|
|
282
282
|
</span>
|
|
283
283
|
</div>
|
|
284
|
-
`}renderFooterActions(){return
|
|
284
|
+
`}renderFooterActions(){return i`
|
|
285
285
|
<div class="mealz-product-card-planner__footer__actions">
|
|
286
286
|
<button
|
|
287
287
|
@click="${()=>this.openReplaceItemView()}"
|
|
@@ -290,7 +290,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
290
290
|
<span>Remplacer</span>
|
|
291
291
|
</button>
|
|
292
292
|
</div>
|
|
293
|
-
`}renderCTA(){return
|
|
293
|
+
`}renderCTA(){return i`
|
|
294
294
|
<div class="mealz-product-card-planner__checkbox mealz-ds-checkbox">
|
|
295
295
|
<input
|
|
296
296
|
type="checkbox"
|
|
@@ -298,8 +298,8 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
298
298
|
@change="${e=>this.onCheckboxChange(e)}"
|
|
299
299
|
>
|
|
300
300
|
</div>
|
|
301
|
-
`}renderDisabledOrUnavailableProduct(){return
|
|
302
|
-
${this.oftenIgnored?
|
|
301
|
+
`}renderDisabledOrUnavailableProduct(){return i`
|
|
302
|
+
${this.oftenIgnored?i`
|
|
303
303
|
<span class="mealz-ds-text mealz-product-card-planner__disabled-text">
|
|
304
304
|
Cet ingrédient ne sera pas ajouté à votre panier
|
|
305
305
|
</span>
|
|
@@ -309,7 +309,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
309
309
|
<span>Ajouter un produit</span>
|
|
310
310
|
</button>
|
|
311
311
|
`:""}
|
|
312
|
-
${this.status==="unavailable"&&!this.oftenIgnored?
|
|
312
|
+
${this.status==="unavailable"&&!this.oftenIgnored?i`
|
|
313
313
|
<img class="mealz-ds-avatar" src="${this.ingredientPicture}" alt="ingredient picture">
|
|
314
314
|
<mealz-unavailable-badge></mealz-unavailable-badge>
|
|
315
315
|
<button
|
|
@@ -318,7 +318,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
318
318
|
<span>Remplacer</span>
|
|
319
319
|
</button>
|
|
320
320
|
`:""}
|
|
321
|
-
`}addItemEvent(){
|
|
321
|
+
`}addItemEvent(){r.analytics.sendEvent("planner.item.add",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}deleteItemEvent(){r.analytics.sendEvent("planner.item.delete",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}replaceItemViewEvent(){r.analytics.sendEvent("planner.item.replace",this.analyticsPath,{recipe_id:this.recipeId,item_id:this.product.item.id})}}C([h({type:Object})],P.prototype,"product");C([h({type:String})],P.prototype,"recipeId");C([h({type:Number})],P.prototype,"initialGuests");C([h({type:Number})],P.prototype,"currentGuests");C([h({type:Boolean})],P.prototype,"oftenIgnored");customElements.get("mealz-product-card-planner")||customElements.define("mealz-product-card-planner",P);var ve=Object.defineProperty,be=(o,e,t,s)=>{for(var a=void 0,n=o.length-1,l;n>=0;n--)(l=o[n])&&(a=l(e,t,a)||a);return a&&ve(e,t,a),a};class K extends k{constructor(){super(),this.styleURL=new URL("./legal-notice/legal-notice.css",this.getBaseURL())}get containsAlcohol(){var t;return(((t=this.tags)==null?void 0:t.data)||[]).some(s=>s.id==="ingredient_category_alcool")}render(){return this.containsAlcohol?i`
|
|
322
322
|
<div class="mealz-products-picker__legal-notices">
|
|
323
323
|
<span class="mealz-ds-text weight-xxl mealz-products-picker__legal-notices-header">Mentions légales</span>
|
|
324
324
|
<div class="mealz-products-picker__legal-notices-content">
|
|
@@ -330,7 +330,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
330
330
|
</span>
|
|
331
331
|
</div>
|
|
332
332
|
</div>
|
|
333
|
-
`:c}}
|
|
333
|
+
`:c}}be([h()],K.prototype,"tags");customElements.get("mealz-legal-notice")||customElements.define("mealz-legal-notice",K);class fe extends k{constructor(){super(),this.styleURL=[new URL("./product-card/product-card-skeleton/product-card-skeleton.css",this.getBaseURL()),new URL("./product-card/product-card.css",this.getBaseURL())]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){return i`
|
|
334
334
|
<!-- PRODUCT CARD -->
|
|
335
335
|
<div class="mealz-product-card skeleton">
|
|
336
336
|
<!-- HEADER -->
|
|
@@ -373,9 +373,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
373
373
|
</div>
|
|
374
374
|
</div>
|
|
375
375
|
</div>
|
|
376
|
-
`}}
|
|
376
|
+
`}}customElements.get("mealz-products-card-skeleton")||customElements.define("mealz-products-card-skeleton",fe);var _e=Object.defineProperty,Q=(o,e,t,s)=>{for(var a=void 0,n=o.length-1,l;n>=0;n--)(l=o[n])&&(a=l(e,t,a)||a);return a&&_e(e,t,a),a};class D extends k{constructor(){super(),this.inBasket=!1,this.plannerMode=!1,this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.numberUnavailableProducts=0,this.analyticsPath="",this.subscriptions=[],this.noSupplier=r.supplier.isNoSupplier(),this.hasEmittedReady=!1,this.hydrateOnly=!1,this.ssrTemplateRemoved=!1,this.styleURL=new URL("./products-picker/products-picker.css",this.getBaseURL())}get selectors(){return{unavailableBadge:"mealz-unavailable-badge"}}get totalProducts(){var e,t,s;return Array.isArray((s=(t=(e=this.recipe)==null?void 0:e.relationships)==null?void 0:t.ingredients)==null?void 0:s.data)?this.recipe.relationships.ingredients.data.length:0}connectedCallback(){var t,s;super.connectedCallback(),this.getInitialStatus(),this.resetProducts(),this.listenToProducts();const e=(s=(t=r)==null?void 0:t.recipes)==null?void 0:s.displayedRecipe$;e&&typeof e.subscribe=="function"&&this.subscriptions.push(e.subscribe(a=>{a&&(this.recipe=a.recipe,this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.requestUpdate())}))}disconnectedCallback(){super.disconnectedCallback(),this.resetProducts(),this.subscriptions.forEach(e=>e.unsubscribe())}resetProducts(){this.productsByCategory={toPickProducts:[],oftenIgnoredProducts:[]},this.numberUnavailableProducts=0,this.requestUpdate()}getInitialStatus(){const e=this.getAttribute("starting-data");if(e)try{const t=JSON.parse(e);this.plannerMode=!!t.planner,this.hydrateOnly=!0,t.analyticsPath&&(this.analyticsPath=t.analyticsPath),t.recipeId&&(this.recipe={id:t.recipeId,attributes:{"number-of-guests":t.guests||4}})}catch(t){console.warn("[products-picker] starting-data parse error",t)}finally{this.removeAttribute("starting-data")}}removeSSRTemplate(){const e=this.querySelector(".mealz-products-picker");e&&e.parentElement===this&&e.remove()}listenToProducts(){const e=this.plannerMode?r.recipes.productsPlannerByCategory$:r.recipes.productsByCategory$;!e||typeof e.subscribe!="function"||this.subscriptions.push(e.subscribe(t=>{(t.toPickProducts.length>0||t.oftenIgnoredProducts.length>0)&&!this.ssrTemplateRemoved&&this.hydrateOnly&&(this.removeSSRTemplate(),this.ssrTemplateRemoved=!0),this.productsByCategory=t,this.plannerMode?this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.status==="unavailable").length:this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>s.basketEntry.status==="out_of_stock").length,this.requestUpdate(),this.notifyReadyIfRendered()}))}async notifyReadyIfRendered(){if(this.hasEmittedReady)return;if(await this.updateComplete,this.querySelector(".mealz-product-card-planner__checkbox")||this.querySelector(".mealz-product-card__checkbox")){this.hasEmittedReady=!0;const t=new CustomEvent("products-picker-ready",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}scrollToFirstUnavailable(){const e=document.querySelector(this.plannerMode?".mealz-products-picker":".mealz-products-picker__container");if(e){const t=e.querySelector(this.plannerMode?".mealz-product-card-planner.unavailable":".mealz-product-card__container.out_of_stock");t&&t.scrollIntoView({behavior:"smooth",block:"center"})}}isAlreadyOnCatalogPage(){return window.location.href.includes(r.router.getCatalogUrl())}closeRecipeModal(){}currentPath(){return""}guestsChange(e){const t=new CustomEvent("guestChange",{bubbles:!0,composed:!0,detail:{value:e.detail.value}});this.dispatchEvent(t)}render(){var n,l;const e=!!this.recipe&&this.recipe.id!==void 0,t=Array.isArray((n=this.productsByCategory)==null?void 0:n.toPickProducts)?this.productsByCategory.toPickProducts:[],s=Array.isArray((l=this.productsByCategory)==null?void 0:l.oftenIgnoredProducts)?this.productsByCategory.oftenIgnoredProducts:[],a=this.totalProducts||t.length||0;return i`
|
|
377
377
|
<div class="mealz-products-picker">
|
|
378
|
-
${this.inBasket&&this.plannerMode?
|
|
378
|
+
${this.inBasket&&this.plannerMode?i`
|
|
379
379
|
<div class="mealz-products-picker__overlay">
|
|
380
380
|
<div class="mealz-products-picker__overlay-text">
|
|
381
381
|
<span class="mealz-ds-text">
|
|
@@ -388,70 +388,68 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
388
388
|
${this.renderHeader()}
|
|
389
389
|
<div class="mealz-products-picker__list">
|
|
390
390
|
<!-- TO PICK PRODUCTS -->
|
|
391
|
-
${
|
|
391
|
+
${e&&t.length>0?t.map(p=>{var d,g,u,m,v,b,f,_,z,$;return this.plannerMode?i`
|
|
392
392
|
<mealz-product-card-planner
|
|
393
|
-
.product="${
|
|
393
|
+
.product="${p}"
|
|
394
394
|
.recipeId="${this.recipe.id}"
|
|
395
395
|
.oftenIgnored="${!1}"
|
|
396
|
-
.initialGuests="${((
|
|
397
|
-
.currentGuests="${this.recipe.modifiedGuests||((
|
|
396
|
+
.initialGuests="${((g=(d=this.recipe)==null?void 0:d.attributes)==null?void 0:g["number-of-guests"])||4}"
|
|
397
|
+
.currentGuests="${((u=this.recipe)==null?void 0:u.modifiedGuests)||((v=(m=this.recipe)==null?void 0:m.attributes)==null?void 0:v["number-of-guests"])||4}"
|
|
398
398
|
></mealz-product-card-planner>
|
|
399
|
-
`:
|
|
399
|
+
`:i`
|
|
400
400
|
<mealz-product-card
|
|
401
|
-
.product="${
|
|
401
|
+
.product="${p}"
|
|
402
402
|
.recipeId="${this.recipe.id}"
|
|
403
|
-
.initialGuests="${((
|
|
404
|
-
.currentGuests="${this.recipe.modifiedGuests||((
|
|
403
|
+
.initialGuests="${((f=(b=this.recipe)==null?void 0:b.attributes)==null?void 0:f["number-of-guests"])||4}"
|
|
404
|
+
.currentGuests="${((_=this.recipe)==null?void 0:_.modifiedGuests)||(($=(z=this.recipe)==null?void 0:z.attributes)==null?void 0:$["number-of-guests"])||4}"
|
|
405
405
|
></mealz-product-card>
|
|
406
|
-
`}):Array(
|
|
407
|
-
<mealz-products-card-skeleton></mealz-products-card-skeleton>
|
|
408
|
-
`)}
|
|
406
|
+
`}):new Array(a).fill(i`<mealz-products-card-skeleton></mealz-products-card-skeleton>`)}
|
|
409
407
|
</div>
|
|
410
408
|
<!-- OFTEN IGNORED PRODUCTS -->
|
|
411
409
|
<div class="mealz-products-picker__secondary-list">
|
|
412
|
-
${
|
|
410
|
+
${e&&s.length>0?i`
|
|
413
411
|
<mealz-accordion
|
|
414
412
|
.noStyling=${!0}
|
|
415
|
-
|
|
413
|
+
>
|
|
414
|
+
<div slot="title">
|
|
416
415
|
<span class="mealz-ds-text weight-xl">
|
|
417
416
|
Déjà dans le placard
|
|
418
417
|
</span>
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
</div>
|
|
419
|
+
<div slot="content">
|
|
421
420
|
<div class="mealz-products-picker__list">
|
|
422
|
-
${
|
|
421
|
+
${s.map(p=>{var d,g,u,m,v,b,f,_,z,$;return this.plannerMode?i`
|
|
423
422
|
<mealz-product-card-planner
|
|
424
|
-
.product
|
|
425
|
-
.recipeId
|
|
426
|
-
.oftenIgnored
|
|
427
|
-
.initialGuests
|
|
428
|
-
.currentGuests
|
|
423
|
+
.product="${p}"
|
|
424
|
+
.recipeId="${this.recipe.id}"
|
|
425
|
+
.oftenIgnored="${!0}"
|
|
426
|
+
.initialGuests="${((g=(d=this.recipe)==null?void 0:d.attributes)==null?void 0:g["number-of-guests"])||4}"
|
|
427
|
+
.currentGuests="${((u=this.recipe)==null?void 0:u.modifiedGuests)||((v=(m=this.recipe)==null?void 0:m.attributes)==null?void 0:v["number-of-guests"])||4}"
|
|
429
428
|
></mealz-product-card-planner>
|
|
430
|
-
`:
|
|
429
|
+
`:i`
|
|
431
430
|
<mealz-product-card
|
|
432
|
-
.product
|
|
433
|
-
.recipeId
|
|
434
|
-
.initialGuests
|
|
435
|
-
.currentGuests
|
|
431
|
+
.product="${p}"
|
|
432
|
+
.recipeId="${this.recipe.id}"
|
|
433
|
+
.initialGuests="${((f=(b=this.recipe)==null?void 0:b.attributes)==null?void 0:f["number-of-guests"])||4}"
|
|
434
|
+
.currentGuests="${((_=this.recipe)==null?void 0:_.modifiedGuests)||(($=(z=this.recipe)==null?void 0:z.attributes)==null?void 0:$["number-of-guests"])||4}"
|
|
436
435
|
></mealz-product-card>
|
|
437
436
|
`})}
|
|
438
437
|
</div>
|
|
439
|
-
|
|
440
|
-
>
|
|
438
|
+
</div>
|
|
441
439
|
</mealz-accordion>
|
|
442
440
|
`:c}
|
|
443
441
|
</div>
|
|
444
442
|
${this.noSupplier?c:this.renderLowerContent()}
|
|
445
443
|
</div>
|
|
446
|
-
`}renderHeader(){var e;return
|
|
444
|
+
`}renderHeader(){var e;return i`
|
|
447
445
|
<div class="mealz-products-picker__header">
|
|
448
|
-
${this.totalProducts>0?
|
|
446
|
+
${this.totalProducts>0?i`
|
|
449
447
|
<div class="mealz-products-picker__header-text mealz-ds-text weight-xxl">
|
|
450
448
|
<div class="mealz-products-picker__number-of-products">
|
|
451
449
|
<span>${this.totalProducts}</span>
|
|
452
|
-
${this.totalProducts>1?
|
|
450
|
+
${this.totalProducts>1?i`<span>ingrédients</span>`:i`<span>ingrédient</span>`}
|
|
453
451
|
</div>
|
|
454
|
-
${this.numberUnavailableProducts>0?
|
|
452
|
+
${this.numberUnavailableProducts>0?i`
|
|
455
453
|
<mealz-unavailable-badge
|
|
456
454
|
.numberUnavailable="${this.numberUnavailableProducts}"
|
|
457
455
|
@clicked="${()=>this.scrollToFirstUnavailable()}">
|
|
@@ -460,7 +458,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
460
458
|
</div>
|
|
461
459
|
`:c}
|
|
462
460
|
<!-- GUEST COUNTER FOR NO SUPPLIER MODE-->
|
|
463
|
-
${this.noSupplier?
|
|
461
|
+
${this.noSupplier?i`
|
|
464
462
|
<mealz-counter
|
|
465
463
|
.floating="${!0}"
|
|
466
464
|
.value="${(e=this.recipe)==null?void 0:e.modifiedGuests}"
|
|
@@ -478,27 +476,27 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
478
476
|
</select>
|
|
479
477
|
</div> -->
|
|
480
478
|
</div>
|
|
481
|
-
`}renderLowerContent(){return
|
|
479
|
+
`}renderLowerContent(){var e,t;return i`
|
|
482
480
|
<!-- MORE RECIPE IDEAS -->
|
|
483
481
|
<div class="mealz-products-picker__more">
|
|
484
|
-
${!this.isAlreadyOnCatalogPage()&&!this.plannerMode?
|
|
482
|
+
${!this.isAlreadyOnCatalogPage()&&!this.plannerMode?i`
|
|
485
483
|
<a class="mealz-products-picker__more-anchor"
|
|
486
|
-
href="${
|
|
484
|
+
href="${r.router.getCatalogUrl()}"
|
|
487
485
|
@click="${this.sendHomeDisplayEvent}">
|
|
488
486
|
<button class="mealz-products-picker__go-to-catalog-button mealz-ds-button secondary">
|
|
489
487
|
<span class="mealz-ds-text weight-l size-s">Voir plus d'idées repas</span>
|
|
490
488
|
</button>
|
|
491
489
|
</a>
|
|
492
|
-
`:
|
|
490
|
+
`:i`
|
|
493
491
|
<button class="mealz-products-picker__close-modal-button mealz-ds-button secondary" @click="${this.closeRecipeModal}">
|
|
494
492
|
<span class="mealz-ds-text weight-l size-s">Voir plus d'idées repas</span>
|
|
495
493
|
</button>
|
|
496
494
|
`}
|
|
497
495
|
</div>
|
|
498
|
-
<mealz-legal-notice .tags="${this.recipe.relationships.tags}"></mealz-legal-notice>
|
|
499
|
-
`}sendHomeDisplayEvent(){
|
|
496
|
+
<mealz-legal-notice .tags="${(t=(e=this.recipe)==null?void 0:e.relationships)==null?void 0:t.tags}"></mealz-legal-notice>
|
|
497
|
+
`}sendHomeDisplayEvent(){r.analytics.sendEvent("home.display",this.analyticsPath,{})}}Q([h({type:Boolean})],D.prototype,"inBasket");Q([h({type:Boolean})],D.prototype,"plannerMode");customElements.get("mealz-products-picker")||customElements.define("mealz-products-picker",D);class ze extends k{constructor(){super(),this.invalidPos=!1,this.subscriptions=[],this.styleURL=new URL("./recipe-details/no-pos-selected/no-pos-selected.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.listenIfPosInvalid()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}listenIfPosInvalid(){this.subscriptions.push(r.recipes.invalidPosDisplay$.subscribe(e=>{this.invalidPos=e,this.requestUpdate()}))}callPosSelector(){const e=new CustomEvent("posSelected",{bubbles:!0,composed:!0});this.dispatchEvent(e)}openStoreLocator(){window.mealzInternal.noSupplier.displaySupplierSelector$.next(!0)}render(){return i`
|
|
500
498
|
<div class="mealz-no-pos-selected">
|
|
501
|
-
${this.invalidPos?
|
|
499
|
+
${this.invalidPos?i`
|
|
502
500
|
<!-- INVALID POS -->
|
|
503
501
|
<img
|
|
504
502
|
class="mealz-no-pos-selected__picture"
|
|
@@ -513,7 +511,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
513
511
|
Vous pouvez sélectionner un autre magasin ou consulter la fiche recette
|
|
514
512
|
</span>
|
|
515
513
|
</div>
|
|
516
|
-
`:
|
|
514
|
+
`:i`
|
|
517
515
|
<!-- NO POS SELECTED -->
|
|
518
516
|
<img
|
|
519
517
|
class="mealz-no-pos-selected__picture"
|
|
@@ -536,13 +534,13 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
536
534
|
Sélectionner un magasin
|
|
537
535
|
</button>
|
|
538
536
|
</div>
|
|
539
|
-
`}}
|
|
537
|
+
`}}customElements.get("mealz-no-pos-selected")||customElements.define("mealz-no-pos-selected",ze);class ye extends k{constructor(){super(),this.activeTabIndex=0,this.destroy$=new O,this.remainingBasketEntries=[],this.guestObserverService=j.getInstance(),this.isSticky=!1,this.hasBackNavigation=!1,this.drawerViewSwapper=null,this.styleURL=new URL("./recipe-details/recipe-details.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.destroy$=new O,this.handleNoSupplierMode(),V(r.recipes.displayedRecipe$.pipe(w(this.destroy$),N(e=>!!e),I(e=>{e.recipe!==null&&(this.recipe=e.recipe,this.sponsor=e.recipe.relationships.sponsors.data[0],this.analyticsPath=`/recipes/${this.recipe.id}/shopping`,this.plannerMode=!!e.planner,this.getLikeButton(),this.checkSponsorStorytelling(),this.pageview(),this.listenToCloseEvent(),this.setStickyObserver())}),q(e=>e.recipe===null?[]:this.listenToRecipeInBasket())),this.listenPosStatus(),this.listenRemainingBasketEntries(),this.listenLastOrderDate(),this.listenToLoadingStates(),this.listenToAddAllToBasket()).pipe(w(this.destroy$)).subscribe({next:()=>this.requestUpdate(),error:e=>console.error("Recipe details error:",e)}),this.addEventListener("products-picker-ready",()=>this.startRecipeDetailsOnboardingIfNeeded()),this.setupDrawerBackNavigationIndicator()}disconnectedCallback(){super.disconnectedCallback(),this.destroy$.next(),this.destroy$.complete(),this.topObserver&&this.topObserver.disconnect(),this.stickyTimeout&&clearTimeout(this.stickyTimeout),this.drawerViewSwapper&&this.onActiveViewsChanged&&this.drawerViewSwapper.removeEventListener("mealz-active-views-changed",this.onActiveViewsChanged)}setupDrawerBackNavigationIndicator(){const e=this.closest("mealz-drawer-view-swapper");this.drawerViewSwapper=e??document.querySelector("mealz-drawer-view-swapper"),this.drawerViewSwapper&&(this.updateBackNavigationFromActiveViews(this.drawerViewSwapper.getActiveViewNames()),this.onActiveViewsChanged=t=>{const s=t==null?void 0:t.detail;s!=null&&s.activeViews&&this.updateBackNavigationFromActiveViews(s.activeViews)},this.drawerViewSwapper.addEventListener("mealz-active-views-changed",this.onActiveViewsChanged))}updateBackNavigationFromActiveViews(e){const t=Array.isArray(e)&&e.length>1;this.hasBackNavigation!==t&&(this.hasBackNavigation=t,this.requestUpdate())}getRecipeDetailsCloseIcon(){return this.hasBackNavigation?{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg",alt:"back button",className:"mealz-recipe-details__close-icon is-back"}:{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg",alt:"modal close button",className:"mealz-recipe-details__close-icon"}}getRecipeDetailsStickyCloseIcon(){return this.hasBackNavigation?{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/ArrowLeft_dark.svg",alt:"back button",className:"mealz-recipe-details__close-icon before-title is-back"}:{src:"https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_Black.svg",alt:"modal close button",className:"mealz-recipe-details__close-icon"}}setStickyObserver(){this.topObserver||this.updateComplete.then(()=>{const e=this.querySelector(".mealz-recipe-details__sticky-anchor");e&&(this.topObserver=new IntersectionObserver(([t])=>{this.stickyTimeout&&clearTimeout(this.stickyTimeout),this.stickyTimeout=window.setTimeout(()=>{const s=!t.isIntersecting;this.isSticky!==s&&(this.isSticky=s,this.requestUpdate())},150)},{threshold:0}),this.topObserver.observe(e))})}startRecipeDetailsOnboardingIfNeeded(){localStorage.getItem("_miam/recipeDetailsOnboarding")==="true"||!this.plannerMode||this.updateComplete.then(()=>{this.scrollJustAfterImage();let t=document.querySelector("mealz-planner-onboarding");t?t.type="recipe-details":(t=new ae,t.type="recipe-details",document.body.appendChild(t)),t.launchOnboardingTour()})}scrollJustAfterImage(){const e=this.querySelector(".mealz-recipe-details__tabs");if(!e)return;const t=document.querySelector(".mealz-drawer__content-container");if(t){const s=e.getBoundingClientRect(),a=t.getBoundingClientRect();t.scrollTop+=s.top-a.top;return}e.scrollIntoView({behavior:"smooth",block:"start"})}handleNoSupplierMode(){this.noSupplier=!!r.supplier.isNoSupplier(),this.requestUpdate()}close(){this.sendCloseEvent(),r.recipes.displayedRecipe$.next(null)}listenToCloseEvent(){const e=document.querySelector("mealz-drawer");e&&e.addEventListener("drawerClosed",()=>{this.sendCloseEvent()})}selectTab(e){this.activeTabIndex=e,this.activeTabIndex===1&&this.sendCookingDisplayEvent(),this.requestUpdate()}getLikeButton(){this.noSupplier||r.user.isAuthenticated().pipe(w(this.destroy$),N(e=>e),q(()=>r.html.like(this.recipe.id))).subscribe({next:e=>{this.likeButtonHTML=e,this.requestUpdate()},error:e=>console.error("Like button error:",e)})}checkSponsorStorytelling(){this.sponsor&&r.sponsor.hasStorytelling(this.sponsor.id).pipe(w(this.destroy$)).subscribe({next:e=>{this.hasSponsorStorytelling=e,this.requestUpdate()},error:e=>console.error("Sponsor storytelling error:",e)})}listenPosStatus(){return G({noPosDisplay:r.recipes.noPosDisplay$,invalidPosDisplay:r.recipes.invalidPosDisplay$}).pipe(I(({noPosDisplay:e,invalidPosDisplay:t})=>{this.noPosDisplay=e,this.invalidPosDisplay=t,this.activeTabIndex=e?1:0}),y(()=>{}))}listenLastOrderDate(){return r.recipes.orderHistoryDate$.pipe(I(e=>{this.orderHistoryDate=e}))}listenToLoadingStates(){return G([r.recipes.ingredientToBasketLoading$,r.recipes.updateIngredientFromBasketLoading$]).pipe(y(([e,t])=>e||t),I(e=>{this.basketIsUpdating=e}),ce(1))}listenRemainingBasketEntries(){return r.recipes.remainingBasketEntries$.pipe(I(e=>{this.remainingBasketEntries=e}))}listenToAddAllToBasket(){return r.recipes.allIngredientsToBasketLoading$.pipe(I(e=>{e&&(this.selectTab(0),setTimeout(()=>{this.scrollToPicker()},50))}))}listenToRecipeInBasket(){return r.recipes.isRecipeInBasket(this.recipe.id).pipe(I(e=>{this.inBasket=e}))}scrollToPicker(){const e=this.querySelector(".mealz-products-picker");if(e){const t=this.querySelector(".mealz-recipe-details__title-container"),s=(t==null?void 0:t.offsetHeight)||0;e.style.scrollMarginTop=`${s}px`,e.scrollIntoView({behavior:"instant",block:"start"})}}scrollToReplacedItem(e){var s,a;const t=this.querySelectorAll("mealz-product-card-planner");for(const n of Array.from(t)){const l=n;if(((a=(s=l.product)==null?void 0:s.item)==null?void 0:a.id)===e){l.scrollIntoView({behavior:"instant",block:"center"});break}}}openLastOrderModal(){this.sendOrderedDisplayEvent();const e=new se;e.recipeId=this.recipe.id,e.addEventListener("orderAgain",()=>this.orderAgain()),e.displayLastOrderModal(this.orderHistoryDate)}orderAgain(){r.recipes.addAllIngredientsToBasket({originPath:this.analyticsPath,props:{}})}updateGuests(e){if(this.recipe.modifiedGuests===e.detail.value)return;this.recipe.modifiedGuests=e.detail.value,this.guestObserverService.updateGuests(this.recipe.modifiedGuests);const t={originPath:this.analyticsPath,props:{}};this.plannerMode?r.planner.updateGuests(this.recipe.modifiedGuests,t):r.recipes.updateGuests(t),this.requestUpdate()}render(){const e=this.getRecipeDetailsCloseIcon(),t=this.getRecipeDetailsStickyCloseIcon();return i`
|
|
540
538
|
<div class="mealz-recipe-details">
|
|
541
539
|
<!-- IF IS LOADING -->
|
|
542
|
-
${this.recipe?c:
|
|
540
|
+
${this.recipe?c:i`
|
|
543
541
|
<div class="mealz-ds-loader mealz-recipe-details__loader"></div>`}
|
|
544
542
|
<!-- IF IS NOT LOADING AND RECIPE EXISTS -->
|
|
545
|
-
${this.recipe?
|
|
543
|
+
${this.recipe?i`
|
|
546
544
|
<div class="mealz-recipe-details__container">
|
|
547
545
|
<!-- BANNER CONTAINER -->
|
|
548
546
|
<div class="mealz-recipe-details__picture ${this.noSupplier?"no-supplier":""}">
|
|
@@ -575,7 +573,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
575
573
|
src="${this.recipe.attributes["media-url"]}"
|
|
576
574
|
class="mealz-recipe-details__picture-img">
|
|
577
575
|
<!-- Filigrane logo -->
|
|
578
|
-
${this.recipe.attributes["filigrane-logo-url"]?
|
|
576
|
+
${this.recipe.attributes["filigrane-logo-url"]?i`
|
|
579
577
|
<div class="mealz-recipe-details__picture__filigrane">
|
|
580
578
|
<img alt="filigrane logo" src=${this.recipe.filigraneLogoUrl}>
|
|
581
579
|
</div>`:c}
|
|
@@ -586,7 +584,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
586
584
|
<hr class="mealz-recipe-details__sponsor-separator">
|
|
587
585
|
</div>
|
|
588
586
|
<!-- LAST ORDER BADGE -->
|
|
589
|
-
${this.orderHistoryDate?
|
|
587
|
+
${this.orderHistoryDate?i`
|
|
590
588
|
<div class="mealz-recipe-details__last-order-badge">
|
|
591
589
|
<mealz-last-order-badge
|
|
592
590
|
.orderHistoryDate=${this.orderHistoryDate}
|
|
@@ -607,7 +605,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
607
605
|
<div class="mealz-recipe-details__actions__icon">
|
|
608
606
|
<!-- LIKE BUTTON -->
|
|
609
607
|
<div class="mealz-recipe-details__like-button">
|
|
610
|
-
${
|
|
608
|
+
${ie(this.likeButtonHTML)}
|
|
611
609
|
</div>
|
|
612
610
|
<!-- CLOSE MODAL BUTTON -->
|
|
613
611
|
<div class="mealz-recipe-details__hideable-actions ${this.isSticky?"sticky":""}">
|
|
@@ -622,11 +620,11 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
622
620
|
</div>
|
|
623
621
|
</div>
|
|
624
622
|
<!-- STORE INDICATOR -->
|
|
625
|
-
${this.noSupplier?
|
|
623
|
+
${this.noSupplier?i`
|
|
626
624
|
<mealz-store-indicator .analyticsPath=${this.analyticsPath}></mealz-store-indicator>`:c}
|
|
627
625
|
</div>
|
|
628
626
|
<!-- RECIPE BASIC INFORMATIONS + TABS -->
|
|
629
|
-
${this.noSupplier?c:
|
|
627
|
+
${this.noSupplier?c:i`
|
|
630
628
|
<!-- RECIPE BASIC INFORMATIONS -->
|
|
631
629
|
<mealz-details-infos class="mealz-recipe-details__infos"></mealz-details-infos>
|
|
632
630
|
<!-- TABS TO SWITCH BETWEEN BASKET AND INSTRUCTIONS -->
|
|
@@ -644,7 +642,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
644
642
|
${this.renderTabContent()}
|
|
645
643
|
</div>
|
|
646
644
|
<!-- FOOTER -->
|
|
647
|
-
${this.activeTabIndex===0&&!this.noPosDisplay||this.plannerMode?
|
|
645
|
+
${this.activeTabIndex===0&&!this.noPosDisplay||this.plannerMode?i`
|
|
648
646
|
<mealz-details-footer
|
|
649
647
|
.noPosDisplay=${this.noPosDisplay}
|
|
650
648
|
.noSupplier=${this.noSupplier}
|
|
@@ -656,14 +654,14 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
656
654
|
</div>
|
|
657
655
|
`:c}
|
|
658
656
|
</div>
|
|
659
|
-
`}renderTabContent(){return
|
|
657
|
+
`}renderTabContent(){return i`
|
|
660
658
|
<div class="mealz-recipe-details__products-tab ${this.activeTabIndex===0?"":"hidden"}">
|
|
661
|
-
${!this.noPosDisplay&&!this.invalidPosDisplay?
|
|
659
|
+
${!this.noPosDisplay&&!this.invalidPosDisplay?i`
|
|
662
660
|
<mealz-products-picker
|
|
663
661
|
.inBasket=${this.inBasket}
|
|
664
662
|
.plannerMode=${this.plannerMode}
|
|
665
663
|
@guestChange=${e=>this.updateGuests(e)}
|
|
666
|
-
></mealz-products-picker>`:
|
|
664
|
+
></mealz-products-picker>`:i`
|
|
667
665
|
<mealz-no-pos-selected
|
|
668
666
|
.noPos=${this.noPosDisplay}
|
|
669
667
|
.invalidPos=${this.invalidPosDisplay}
|
|
@@ -677,14 +675,14 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
677
675
|
<!-- RECIPE INSTRUCTIONS -->
|
|
678
676
|
<mealz-details-steps></mealz-details-steps>
|
|
679
677
|
<!-- ORDER AGAIN -->
|
|
680
|
-
${this.orderHistoryDate&&this.remainingBasketEntries.length>0&&!this.plannerMode?
|
|
678
|
+
${this.orderHistoryDate&&this.remainingBasketEntries.length>0&&!this.plannerMode?i`
|
|
681
679
|
<mealz-order-again .recipeId=${this.recipe.id} @orderAgain=${()=>this.orderAgain()}></mealz-order-again>
|
|
682
680
|
`:c}
|
|
683
681
|
</div>
|
|
684
|
-
`}renderAddonLink(){var e;return
|
|
682
|
+
`}renderAddonLink(){var e;return i`
|
|
685
683
|
<div class="mealz-addon-link">
|
|
686
684
|
<div class="mealz-addon-link__info">
|
|
687
|
-
${this.recipe.attributes["informational-sentence"]?
|
|
685
|
+
${this.recipe.attributes["informational-sentence"]?i`<span class="mealz-ds-text size-s weight-l">${this.recipe.attributes["informational-sentence"]}</span>`:i`
|
|
688
686
|
<span class="mealz-ds-text size-s weight-l">
|
|
689
687
|
<span>Cette recette vous est proposée par notre partenaire</span>
|
|
690
688
|
<span class="mealz-addon-link__sponsor-name">
|
|
@@ -692,16 +690,16 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
692
690
|
</span>
|
|
693
691
|
</span>
|
|
694
692
|
`}
|
|
695
|
-
${(e=this.recipe.attributes)!=null&&e["informational-page-html"]||this.hasSponsorStorytelling?
|
|
693
|
+
${(e=this.recipe.attributes)!=null&&e["informational-page-html"]||this.hasSponsorStorytelling?i`
|
|
696
694
|
<span class="mealz-addon-link__link mealz-ds-text size-s weight-xl" @click=${()=>this.showRecipeAddon()}>
|
|
697
695
|
En savoir plus
|
|
698
696
|
</span>
|
|
699
697
|
`:c}
|
|
700
698
|
</div>
|
|
701
|
-
${this.sponsor.attributes["logo-url"]?
|
|
699
|
+
${this.sponsor.attributes["logo-url"]?i`
|
|
702
700
|
<div class="mealz-addon-link__logo">
|
|
703
701
|
<img src="${this.sponsor.attributes["logo-url"]}" alt="${this.sponsor.attributes.name} logo" />
|
|
704
702
|
</div>
|
|
705
703
|
`:c}
|
|
706
704
|
</div>
|
|
707
|
-
`}showRecipeAddon(){this.sendSponsorDisplayEvent();const e=document.querySelector("mealz-drawer-view-swapper");e&&e.displayRecipeAddon$.next(!0)}pageview(){
|
|
705
|
+
`}showRecipeAddon(){this.sendSponsorDisplayEvent();const e=document.querySelector("mealz-drawer-view-swapper");e&&e.displayRecipeAddon$.next(!0)}pageview(){r.analytics.sendEvent("pageview",this.analyticsPath,{})}sendSponsorDisplayEvent(){r.analytics.sendEvent("sponsor.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendCloseEvent(){r.analytics.sendEvent("recipe.close",this.analyticsPath,{recipe_id:this.recipe.id})}sendCookingDisplayEvent(){r.analytics.sendEvent("recipe.cooking.display",this.analyticsPath,{recipe_id:this.recipe.id})}sendOrderedDisplayEvent(){r.analytics.sendEvent("recipe.ordered.display",this.analyticsPath,{recipe_id:this.recipe.id})}}customElements.get("mealz-recipe-details")||customElements.define("mealz-recipe-details",ye);
|