mealz-components 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{OperatorSubscriber-DfCnFunn.js → OperatorSubscriber-CvNNPrIM.js} +1 -1
- package/dist/assets/accordion-tsgdqQeQ.js +19 -0
- package/dist/assets/{args-DAL2bHut.js → args-upHwW4Wh.js} +1 -1
- package/dist/assets/{async-C5Kj_SqM.js → async-M7ziFu3t.js} +1 -1
- package/dist/assets/{combineLatest-Capvy1jI.js → combineLatest-BB01Px-W.js} +1 -1
- package/dist/assets/{debounceTime-Cf_7YmIn.js → debounceTime-BeLayHXh.js} +1 -1
- package/dist/assets/delay-DJoNbXpK.js +1 -0
- package/dist/assets/{distinctUntilChanged-kXqVrZ5h.js → distinctUntilChanged-6bjT4iYO.js} +1 -1
- package/dist/assets/empty-Dy0Wgz_B.js +1 -0
- package/dist/assets/{filter-q99GWcpD.js → filter-aZV_N5pj.js} +1 -1
- package/dist/assets/{firstValueFrom-Bcbk1SUg.js → firstValueFrom-CyoZXDwo.js} +1 -1
- package/dist/assets/{from-D8c5akO7.js → from-uSPfq2sN.js} +1 -1
- package/dist/assets/{guestObserver-C5qvv1Ll.js → guestObserver-PPbBwlOO.js} +1 -1
- package/dist/assets/{http-Bepz6wA4.js → http-Cm33xl_Z.js} +1 -1
- package/dist/assets/{innerFrom-DePszgj9.js → innerFrom-BldbX_fT.js} +1 -1
- package/dist/assets/isScheduler-fbUJB_yC.js +1 -0
- package/dist/assets/{map-DT-7dkaR.js → map-ND1NsJPC.js} +1 -1
- package/dist/assets/mapOneOrManyArgs-BPsgfFRx.js +1 -0
- package/dist/assets/{mealz-sdk-E_fNZM-c.js → mealz-sdk-CnvUgy3V.js} +1 -1
- package/dist/assets/merge-B0ddcNYl.js +1 -0
- package/dist/assets/mergeAll-BvxRfNLo.js +1 -0
- package/dist/assets/{mergeMap-D2yctTHQ.js → mergeMap-C1wxIFhz.js} +1 -1
- package/dist/assets/{no-shadow-element-D62BBu0I.js → no-shadow-element-CXVMZH9n.js} +1 -1
- package/dist/assets/of-D0UErknW.js +1 -0
- package/dist/assets/{price-D6RVRYHJ.js → price-CTfOOyf1.js} +1 -1
- package/dist/assets/{product-card-wIoU7Z_5.js → product-card-ryOzsvSF.js} +2 -2
- package/dist/assets/{promotion-badge-CDaL7Tqv.js → promotion-badge-D63kIgUZ.js} +1 -1
- package/dist/assets/{property-CoRN-Ln2.js → property-BXpY_hgs.js} +1 -1
- package/dist/assets/session-handler-D-8RsM2Q.js +1 -0
- package/dist/assets/skip-4iqvFhkz.js +1 -0
- package/dist/assets/{skipWhile-Beza3ws3.js → skipWhile-DK5WsIpo.js} +1 -1
- package/dist/assets/{state-DDIoBQp5.js → state-BjFDUoQX.js} +1 -1
- package/dist/assets/{switchMap-BAdE9Uzw.js → switchMap-DC1sJvd8.js} +1 -1
- package/dist/assets/{take-CpvJwza7.js → take-BgFJXP4B.js} +1 -1
- package/dist/assets/{tap-BN_fPb40.js → tap-DT80gG87.js} +1 -1
- package/dist/assets/{timer-3Kpx74mt.js → timer-W1DT7NsX.js} +1 -1
- package/dist/assets/{unsafe-html-DWUMaK1p.js → unsafe-html-LLTnDXid.js} +1 -1
- package/dist/assets/{viewport-listener-DsRHfwo4.js → viewport-listener-khw7cTjd.js} +1 -1
- package/dist/basket-transfer-modal/basket-transfer-modal.min.js +2 -2
- package/dist/catalog/_helpers/init-basket-preview-drawer.min.js +1 -0
- package/dist/catalog/basket-preview/basket-preview.min.js +9 -9
- 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 -1
- 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 +1 -1
- package/dist/drawer/drawer.min.js +1 -1
- package/dist/drawer-view-swapper/drawer-view-swapper.min.js +13 -12
- 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 +1 -1
- package/dist/last-order-modal/last-order-modal.min.js +1 -1
- package/dist/like-button/like-button.min.js +1 -1
- package/dist/modal/modal.min.js +1 -1
- package/dist/no-supplier-add-to-cart-cta/no-supplier-add-to-cart-cta.min.js +1 -1
- package/dist/onboarding/analytics/onboarding-analytics.min.js +1 -1
- package/dist/onboarding/onboarding.min.js +4 -4
- package/dist/order-again/order-again.min.js +1 -1
- package/dist/planner/helpers/get-planner-onboarding-modal-config.min.js +1 -1
- package/dist/planner/helpers/init-planner-onboarding-modal.min.js +1 -1
- package/dist/planner/helpers/menu-title.min.js +1 -1
- package/dist/planner/helpers/open-onboarding-modal.min.js +1 -1
- package/dist/planner/helpers/planner-onboarding-storage.min.js +1 -0
- package/dist/planner/planner-abandon-modal/planner-abandon-modal.min.js +1 -1
- package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.min.js +1 -1
- package/dist/planner/planner-budget-gauge/planner-budget-gauge.min.js +1 -1
- package/dist/planner/planner-catalog/planner-catalog.min.js +1 -1
- 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 +1 -1
- package/dist/planner/planner-form/planner-form.min.js +2 -2
- package/dist/planner/planner-menu-option/planner-menu-option.css +1 -1
- 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 +1 -1
- package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +1 -1
- 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 +3 -3
- package/dist/planner/to-basket-loader/to-basket-loader.min.js +1 -1
- package/dist/planner-entry/planner-entry.min.js +1 -1
- package/dist/preferences/preferences.min.js +1 -1
- package/dist/price/price.min.js +1 -1
- package/dist/products-to-basket-cta/products-to-basket-cta.min.js +1 -1
- 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.min.js +41 -41
- package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
- package/dist/recipe-to-basket/recipe-to-basket.min.js +1 -1
- package/dist/replace-item/replace-item-card/replace-item-card.min.js +1 -1
- package/dist/replace-item/replace-item.min.js +1 -1
- package/dist/replace-item-planner/replace-item-card-planner/replace-item-card-planner.min.js +1 -1
- package/dist/replace-item-planner/replace-item-planner.min.js +1 -1
- package/dist/select/select.min.js +1 -1
- package/dist/slider-tabs/slider-tabs.min.js +1 -1
- package/dist/store-indicator/store-indicator.min.js +1 -1
- package/dist/store-locator/store-locator.min.js +1 -1
- package/dist/store-locator-drawer/store-locator-drawer.min.js +1 -1
- package/dist/supplier-selector/supplier-selector.min.js +1 -1
- package/package.json +1 -1
- package/dist/assets/accordion-Unx2E22K.js +0 -19
- package/dist/assets/delay-DHNms76g.js +0 -1
- package/dist/assets/empty-qrpgDBbc.js +0 -1
- package/dist/assets/isScheduler-CqHuyMwD.js +0 -1
- package/dist/assets/mapOneOrManyArgs-CHGhEDCk.js +0 -1
- package/dist/assets/merge-DzIA6T0M.js +0 -1
- package/dist/assets/mergeAll-DpEYIxY3.js +0 -1
- package/dist/assets/of-DtJFltSl.js +0 -1
- package/dist/assets/session-handler-BZFnRy_K.js +0 -1
- package/dist/assets/skip-Bup0JB81.js +0 -1
- package/dist/planner/planner-dashboard/planner-dashboard.css +0 -1
- package/dist/planner/planner-dashboard/planner-dashboard.min.js +0 -1
- package/dist/planner-banner/planner-banner.css +0 -1
- package/dist/planner-card-link/planner-card-link.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
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 d,k as i}from"../assets/no-shadow-element-CXVMZH9n.js";import{n as h}from"../assets/property-BXpY_hgs.js";import{P as te}from"../assets/price-CTfOOyf1.js";import{m as r}from"../assets/mealz-sdk-CnvUgy3V.js";import{m as V}from"../assets/merge-B0ddcNYl.js";import{m as y}from"../assets/map-ND1NsJPC.js";import{t as B}from"../assets/take-BgFJXP4B.js";import{c as H}from"../assets/capitalize-DUAqYmp4.js";import"../counter/counter.min.js";import"../assets/product-card-ryOzsvSF.js";import"../price/price.min.js";import"../assets/promotion-badge-D63kIgUZ.js";import{G as j}from"../assets/guestObserver-PPbBwlOO.js";import"../assets/accordion-tsgdqQeQ.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-LLTnDXid.js";import{M as ae}from"../planner/planner-onboarding/planner-onboarding.min.js";import{o as W,c as re}from"../assets/OperatorSubscriber-CvNNPrIM.js";import{i as L}from"../assets/innerFrom-BldbX_fT.js";import{f as N}from"../assets/filter-aZV_N5pj.js";import{t as I}from"../assets/tap-DT80gG87.js";import{s as q}from"../assets/switchMap-DC1sJvd8.js";import{c as G}from"../assets/combineLatest-BB01Px-W.js";import{d as ne}from"../assets/async-M7ziFu3t.js";import"../assets/viewport-listener-khw7cTjd.js";import"../assets/debounceTime-BeLayHXh.js";import"../assets/skipWhile-DK5WsIpo.js";import"../assets/singleton-COF3iBbF.js";import"../assets/mergeAll-BvxRfNLo.js";import"../assets/mergeMap-C1wxIFhz.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/empty-Dy0Wgz_B.js";import"../assets/args-upHwW4Wh.js";import"../assets/isScheduler-fbUJB_yC.js";import"../assets/from-uSPfq2sN.js";import"../assets/delay-DJoNbXpK.js";import"../assets/timer-W1DT7NsX.js";import"../assets/isDate-BwHtzZM4.js";import"../store-locator/store-locator.min.js";import"../assets/state-BjFDUoQX.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"../planner/helpers/planner-onboarding-storage.min.js";import"../assets/mapOneOrManyArgs-BPsgfFRx.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,c=s._timestampProvider,p=s._windowTime;a||(n.push(t),!l&&n.push(c.now()+p)),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,c=l.slice(),p=0;p<c.length&&!t.closed;p+=n?1:2)t.next(c[p]);return this._checkFinalizedStatuses(t),s},e.prototype._trimBuffer=function(){var t=this,s=t._bufferSize,a=t._timestampProvider,n=t._buffer,l=t._infiniteTimeWindow,c=(l?1:2)*s;if(s<1/0&&c<n.length&&n.splice(0,n.length-c),!l){for(var p=a.now(),g=0,u=1;u<n.length&&n[u]<=p;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,c=o.resetOnRefCountZero,p=c===void 0?!0:c;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 C=v=v??t();M.add(function(){b--,b===0&&!_&&!f&&(m=A(Y,p))}),C.subscribe(M),!u&&b>0&&(u=new F({next:function(x){return C.next(x)},error:function(x){_=!0,z(),m=A($,a,x),C.error(x)},complete:function(){f=!0,z(),m=A($,l),C.complete()}}),L(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 L(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){L(o).subscribe(re(t,function(){return t.complete()},ee)),!t.closed&&e.subscribe(t)})}var de=Object.defineProperty,P=(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,c=(l==null?void 0:l.toPickProducts)||[];r.planner.addRecipeToMenu(this.recipeId,this.guests,!!r.pos.currentPos().value,c).pipe(B(1)).subscribe(()=>{this.inMenu=!0;const p=document.querySelector("mealz-planner-recipe-list");p==null||p.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 d;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?
|
|
3
|
+
${this.productsLoading&&!this.plannerMode?d:i`
|
|
4
4
|
<!-- ADD TO BASKET CTA -->
|
|
5
5
|
${e||t||s?this.renderAddToBasketButton():i`
|
|
6
6
|
<div class="mealz-recipe-details__recipe-is-in-basket-cta-container">
|
|
@@ -8,7 +8,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
8
8
|
</div>
|
|
9
9
|
`}
|
|
10
10
|
`}
|
|
11
|
-
${this.noPosDisplay?
|
|
11
|
+
${this.noPosDisplay?d:this.renderPrice()}
|
|
12
12
|
</div>`}renderAddToBasketButton(){const e=this.remainingBasketEntries.length;return this.allIngredientsToBasketLoading||this.menuUpdateLoading?i`
|
|
13
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>
|
|
@@ -77,8 +77,8 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
77
77
|
alt="basket icon"
|
|
78
78
|
src="https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"/>
|
|
79
79
|
</button>
|
|
80
|
-
`:
|
|
81
|
-
`}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return
|
|
80
|
+
`:d}
|
|
81
|
+
`}renderPrice(){if(this.recipePrice.inBasket<=0&&!this.plannerMode)return d;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(){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})}}
|
|
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})}}P([h({type:Boolean})],T.prototype,"noPosDisplay");P([h({type:Boolean})],T.prototype,"noSupplier");P([h({type:String})],T.prototype,"recipeId");P([h({type:Boolean})],T.prototype,"plannerMode");P([h({type:Number})],T.prototype,"guests");P([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 d}}renderPreparationTime(){return i`
|
|
95
95
|
<!-- PREPARATION TIME -->
|
|
96
96
|
<div
|
|
97
97
|
class="
|
|
@@ -130,7 +130,7 @@ 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
|
-
`:
|
|
133
|
+
`:d}`}renderMoreTags(){return i`
|
|
134
134
|
<!-- MORE INFO -->
|
|
135
135
|
${this.displayTags?this.renderTags():i`
|
|
136
136
|
<div
|
|
@@ -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"}}customElements.get("mealz-details-ingredients")||customElements.define("mealz-details-ingredients",he);var me=Object.defineProperty,
|
|
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,R=(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 U=["unavailable"],ge=["ticked","unselected"];class E 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(){var t;if(!((t=this.product)!=null&&t.ingredient)||!this.initialGuests)return;const e=this.product.ingredient.attributes.quantity/this.initialGuests;this.modifiedIngQty=Number((e*(this.currentGuests??this.initialGuests)).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(){var e;if((e=this.product)!=null&&e.ingredient)return i`
|
|
213
213
|
<div class="mealz-product-card-planner
|
|
214
214
|
${this.status==="ticked"?"added":""}
|
|
215
|
-
${
|
|
215
|
+
${U.includes(this.status)||this.oftenIgnored?"disabled":""}
|
|
216
216
|
${this.status==="unavailable"?"unavailable":""}"
|
|
217
217
|
>
|
|
218
218
|
${this.renderHeader()}
|
|
@@ -267,7 +267,7 @@ 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
|
+
${U.includes(this.status)||this.oftenIgnored?"mealz-product-card-planner__disabled-text":""}"
|
|
271
271
|
>
|
|
272
272
|
${H(this.product.ingredient.attributes.name)}
|
|
273
273
|
</span>
|
|
@@ -275,7 +275,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
275
275
|
class="
|
|
276
276
|
mealz-product-card-planner__header-quantity
|
|
277
277
|
mealz-ds-text size-s weight-l
|
|
278
|
-
${
|
|
278
|
+
${U.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>
|
|
@@ -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(){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})}}
|
|
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})}}R([h({type:Object})],E.prototype,"product");R([h({type:String})],E.prototype,"recipeId");R([h({type:Number})],E.prototype,"initialGuests");R([h({type:Number})],E.prototype,"currentGuests");R([h({type:Boolean})],E.prototype,"oftenIgnored");customElements.get("mealz-product-card-planner")||customElements.define("mealz-product-card-planner",E);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
|
-
`:
|
|
333
|
+
`:d}}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,7 +373,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
373
373
|
</div>
|
|
374
374
|
</div>
|
|
375
375
|
</div>
|
|
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`
|
|
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==null?void 0:s.ingredient)&&s.status==="unavailable").length:this.numberUnavailableProducts=[...t.oftenIgnoredProducts,...t.toPickProducts].filter(s=>{var a;return((a=s==null?void 0:s.basketEntry)==null?void 0:a.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
378
|
${this.inBasket&&this.plannerMode?i`
|
|
379
379
|
<div class="mealz-products-picker__overlay">
|
|
@@ -383,22 +383,22 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
383
383
|
</span>
|
|
384
384
|
</div>
|
|
385
385
|
</div>
|
|
386
|
-
`:
|
|
386
|
+
`:d}
|
|
387
387
|
<!-- HEADER -->
|
|
388
388
|
${this.renderHeader()}
|
|
389
389
|
<div class="mealz-products-picker__list">
|
|
390
390
|
<!-- TO PICK PRODUCTS -->
|
|
391
|
-
${e&&t.length>0?t.map(
|
|
391
|
+
${e&&t.length>0?t.filter(c=>c==null?void 0:c.ingredient).map(c=>{var p,g,u,m,v,b,f,_,z,$;return this.plannerMode?i`
|
|
392
392
|
<mealz-product-card-planner
|
|
393
|
-
.product="${
|
|
393
|
+
.product="${c}"
|
|
394
394
|
.recipeId="${this.recipe.id}"
|
|
395
395
|
.oftenIgnored="${!1}"
|
|
396
|
-
.initialGuests="${((g=(
|
|
396
|
+
.initialGuests="${((g=(p=this.recipe)==null?void 0:p.attributes)==null?void 0:g["number-of-guests"])||4}"
|
|
397
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="${c}"
|
|
402
402
|
.recipeId="${this.recipe.id}"
|
|
403
403
|
.initialGuests="${((f=(b=this.recipe)==null?void 0:b.attributes)==null?void 0:f["number-of-guests"])||4}"
|
|
404
404
|
.currentGuests="${((_=this.recipe)==null?void 0:_.modifiedGuests)||(($=(z=this.recipe)==null?void 0:z.attributes)==null?void 0:$["number-of-guests"])||4}"
|
|
@@ -418,17 +418,17 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
418
418
|
</div>
|
|
419
419
|
<div slot="content">
|
|
420
420
|
<div class="mealz-products-picker__list">
|
|
421
|
-
${s.map(
|
|
421
|
+
${s.filter(c=>c==null?void 0:c.ingredient).map(c=>{var p,g,u,m,v,b,f,_,z,$;return this.plannerMode?i`
|
|
422
422
|
<mealz-product-card-planner
|
|
423
|
-
.product="${
|
|
423
|
+
.product="${c}"
|
|
424
424
|
.recipeId="${this.recipe.id}"
|
|
425
425
|
.oftenIgnored="${!0}"
|
|
426
|
-
.initialGuests="${((g=(
|
|
426
|
+
.initialGuests="${((g=(p=this.recipe)==null?void 0:p.attributes)==null?void 0:g["number-of-guests"])||4}"
|
|
427
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}"
|
|
428
428
|
></mealz-product-card-planner>
|
|
429
429
|
`:i`
|
|
430
430
|
<mealz-product-card
|
|
431
|
-
.product="${
|
|
431
|
+
.product="${c}"
|
|
432
432
|
.recipeId="${this.recipe.id}"
|
|
433
433
|
.initialGuests="${((f=(b=this.recipe)==null?void 0:b.attributes)==null?void 0:f["number-of-guests"])||4}"
|
|
434
434
|
.currentGuests="${((_=this.recipe)==null?void 0:_.modifiedGuests)||(($=(z=this.recipe)==null?void 0:z.attributes)==null?void 0:$["number-of-guests"])||4}"
|
|
@@ -437,9 +437,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
437
437
|
</div>
|
|
438
438
|
</div>
|
|
439
439
|
</mealz-accordion>
|
|
440
|
-
`:
|
|
440
|
+
`:d}
|
|
441
441
|
</div>
|
|
442
|
-
${this.noSupplier?
|
|
442
|
+
${this.noSupplier?d:this.renderLowerContent()}
|
|
443
443
|
</div>
|
|
444
444
|
`}renderHeader(){var e;return i`
|
|
445
445
|
<div class="mealz-products-picker__header">
|
|
@@ -454,9 +454,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
454
454
|
.numberUnavailable="${this.numberUnavailableProducts}"
|
|
455
455
|
@clicked="${()=>this.scrollToFirstUnavailable()}">
|
|
456
456
|
</mealz-unavailable-badge>
|
|
457
|
-
`:
|
|
457
|
+
`:d}
|
|
458
458
|
</div>
|
|
459
|
-
`:
|
|
459
|
+
`:d}
|
|
460
460
|
<!-- GUEST COUNTER FOR NO SUPPLIER MODE-->
|
|
461
461
|
${this.noSupplier?i`
|
|
462
462
|
<mealz-counter
|
|
@@ -467,7 +467,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
467
467
|
class="mealz-products-picker__guest-counter"
|
|
468
468
|
@valueChange="${t=>this.guestsChange(t)}"
|
|
469
469
|
></mealz-counter>
|
|
470
|
-
`:
|
|
470
|
+
`:d}
|
|
471
471
|
<!-- <div class="mealz-ds-dropdown">
|
|
472
472
|
<select>
|
|
473
473
|
<option *ngFor="let option of productsTypeOption">
|
|
@@ -494,7 +494,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
494
494
|
`}
|
|
495
495
|
</div>
|
|
496
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()}))}
|
|
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()}))}openStoreSelector(){sessionStorage.setItem("_miam/cachedRecipeUrl",window.location.href),this.subscriptions.push(r.hook.hookCallback(!1,!0).subscribe())}render(){return i`
|
|
498
498
|
<div class="mealz-no-pos-selected">
|
|
499
499
|
${this.invalidPos?i`
|
|
500
500
|
<!-- INVALID POS -->
|
|
@@ -529,7 +529,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
529
529
|
`}
|
|
530
530
|
<button
|
|
531
531
|
class="mealz-ds-button mealz-ds-text size-m weight-xl mealz-no-pos-selected__select-pos-button secondary"
|
|
532
|
-
@click=${()=>this.
|
|
532
|
+
@click=${()=>this.openStoreSelector()}
|
|
533
533
|
>
|
|
534
534
|
Sélectionner un magasin
|
|
535
535
|
</button>
|
|
@@ -537,7 +537,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
537
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`
|
|
538
538
|
<div class="mealz-recipe-details">
|
|
539
539
|
<!-- IF IS LOADING -->
|
|
540
|
-
${this.recipe?
|
|
540
|
+
${this.recipe?d:i`
|
|
541
541
|
<div class="mealz-ds-loader mealz-recipe-details__loader"></div>`}
|
|
542
542
|
<!-- IF IS NOT LOADING AND RECIPE EXISTS -->
|
|
543
543
|
${this.recipe?i`
|
|
@@ -576,11 +576,11 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
576
576
|
${this.recipe.attributes["filigrane-logo-url"]?i`
|
|
577
577
|
<div class="mealz-recipe-details__picture__filigrane">
|
|
578
578
|
<img alt="filigrane logo" src=${this.recipe.filigraneLogoUrl}>
|
|
579
|
-
</div>`:
|
|
579
|
+
</div>`:d}
|
|
580
580
|
</div>
|
|
581
581
|
<!-- SPONSOR -->
|
|
582
582
|
<div class="mealz-recipe-details__sponsor">
|
|
583
|
-
${this.recipe.attributes["informational-page-html"]&&this.hasSponsorStorytelling?this.renderAddonLink():
|
|
583
|
+
${this.recipe.attributes["informational-page-html"]&&this.hasSponsorStorytelling?this.renderAddonLink():d}
|
|
584
584
|
<hr class="mealz-recipe-details__sponsor-separator">
|
|
585
585
|
</div>
|
|
586
586
|
<!-- LAST ORDER BADGE -->
|
|
@@ -591,7 +591,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
591
591
|
.disabled=${this.plannerMode}
|
|
592
592
|
@openLastOrderModal=${()=>this.openLastOrderModal()}>
|
|
593
593
|
</mealz-last-order-badge>
|
|
594
|
-
</div>`:
|
|
594
|
+
</div>`:d}
|
|
595
595
|
<div class="mealz-recipe-details__sticky-anchor"></div>
|
|
596
596
|
<!-- STICKY HEADER -->
|
|
597
597
|
<div class="mealz-recipe-details__sticky-header">
|
|
@@ -621,10 +621,10 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
621
621
|
</div>
|
|
622
622
|
<!-- STORE INDICATOR -->
|
|
623
623
|
${this.noSupplier?i`
|
|
624
|
-
<mealz-store-indicator .analyticsPath=${this.analyticsPath}></mealz-store-indicator>`:
|
|
624
|
+
<mealz-store-indicator .analyticsPath=${this.analyticsPath}></mealz-store-indicator>`:d}
|
|
625
625
|
</div>
|
|
626
626
|
<!-- RECIPE BASIC INFORMATIONS + TABS -->
|
|
627
|
-
${this.noSupplier?
|
|
627
|
+
${this.noSupplier?d:i`
|
|
628
628
|
<!-- RECIPE BASIC INFORMATIONS -->
|
|
629
629
|
<mealz-details-infos class="mealz-recipe-details__infos"></mealz-details-infos>
|
|
630
630
|
<!-- TABS TO SWITCH BETWEEN BASKET AND INSTRUCTIONS -->
|
|
@@ -650,9 +650,9 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
650
650
|
.plannerMode=${this.plannerMode}
|
|
651
651
|
.guests=${this.recipe.modifiedGuests}
|
|
652
652
|
.recipe=${this.recipe}
|
|
653
|
-
></mealz-details-footer>`:
|
|
653
|
+
></mealz-details-footer>`:d}
|
|
654
654
|
</div>
|
|
655
|
-
`:
|
|
655
|
+
`:d}
|
|
656
656
|
</div>
|
|
657
657
|
`}renderTabContent(){return i`
|
|
658
658
|
<div class="mealz-recipe-details__products-tab ${this.activeTabIndex===0?"":"hidden"}">
|
|
@@ -677,7 +677,7 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
677
677
|
<!-- ORDER AGAIN -->
|
|
678
678
|
${this.orderHistoryDate&&this.remainingBasketEntries.length>0&&!this.plannerMode?i`
|
|
679
679
|
<mealz-order-again .recipeId=${this.recipe.id} @orderAgain=${()=>this.orderAgain()}></mealz-order-again>
|
|
680
|
-
`:
|
|
680
|
+
`:d}
|
|
681
681
|
</div>
|
|
682
682
|
`}renderAddonLink(){var e;return i`
|
|
683
683
|
<div class="mealz-addon-link">
|
|
@@ -694,12 +694,12 @@ import"../drawer/drawer.min.js";import"../recipe-pricing/recipe-pricing.min.js";
|
|
|
694
694
|
<span class="mealz-addon-link__link mealz-ds-text size-s weight-xl" @click=${()=>this.showRecipeAddon()}>
|
|
695
695
|
En savoir plus
|
|
696
696
|
</span>
|
|
697
|
-
`:
|
|
697
|
+
`:d}
|
|
698
698
|
</div>
|
|
699
699
|
${this.sponsor.attributes["logo-url"]?i`
|
|
700
700
|
<div class="mealz-addon-link__logo">
|
|
701
701
|
<img src="${this.sponsor.attributes["logo-url"]}" alt="${this.sponsor.attributes.name} logo" />
|
|
702
702
|
</div>
|
|
703
|
-
`:
|
|
703
|
+
`:d}
|
|
704
704
|
</div>
|
|
705
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as u,B as P}from"../assets/no-shadow-element-
|
|
1
|
+
import{N as u,B as P}from"../assets/no-shadow-element-CXVMZH9n.js";import{V as m}from"../assets/viewport-listener-khw7cTjd.js";import{w as b,m as c}from"../assets/mealz-sdk-CnvUgy3V.js";import{s as f}from"../assets/skipWhile-DK5WsIpo.js";import{t as l}from"../assets/take-BgFJXP4B.js";import{f as h}from"../assets/filter-aZV_N5pj.js";import"../assets/debounceTime-BeLayHXh.js";import"../assets/async-M7ziFu3t.js";import"../assets/OperatorSubscriber-CvNNPrIM.js";import"../assets/empty-Dy0Wgz_B.js";class n{constructor(){this.priceMemorized=new Map,this.displayedPrices=new Set,this.cleanupInterval=null,this.MAX_MEMO_SIZE=500,this.CLEANUP_INTERVAL=600*1e3,this.handlePageUnload=()=>{this.destroy()},this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return n.instance||(n.instance=new n),n.instance}getMemorizedPrice(i,e){const s=`${i}-${e}`;return this.priceMemorized.get(s)}memorizedPrice(i,e,s){const r=`${i}-${e}`;this.priceMemorized.size>=this.MAX_MEMO_SIZE&&this.cleanOldPrices(),this.priceMemorized.set(r,{price:s,guests:e})}isPriceDisplayed(i,e){const s=`${i}-${e}`;return this.displayedPrices.has(s)}markPriceAsDisplayed(i,e){const s=`${i}-${e}`;this.displayedPrices.add(s)}cleanOldPrices(){this.priceMemorized.size>this.MAX_MEMO_SIZE*.8&&Array.from(this.priceMemorized.entries()).slice(0,Math.floor(this.priceMemorized.size*.3)).forEach(([s])=>{this.priceMemorized.delete(s),this.displayedPrices.delete(s)})}clearAllPrices(){this.priceMemorized.clear(),this.displayedPrices.clear()}destroy(){window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.priceMemorized.clear(),this.displayedPrices.clear(),n.instance=null}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldPrices()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}class I extends u{constructor(){super(...arguments),this.recipePricing=null,this.formattedPrice="",this.recipeId="",this.pricePerServe="",this.recipePricingValue=null,this.serves=0,this.posId="",this.extStoreId="",this.rendered=new P(!1),this.priceViewportObserver=null,this.priceFetched=!1,this.planner=!1,this.lastDisplayedRecipeId="",this.lastPlannerPrice=0,this.plannerPriceSubscription=null,this.lastAppliedPrice="",this.priceDisplayed=!1,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.classList.add("re-rendering"),this.getInitialStatus(),this.listenInView(),b().then(()=>{this.setupSubscriptions()}).catch(i=>{console.warn("Failed to initialize SDK subscriptions:",i)}),requestAnimationFrame(()=>{this.classList.remove("re-rendering")})}disconnectedCallback(){var i;super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.plannerPriceSubscription&&(this.plannerPriceSubscription.unsubscribe(),this.plannerPriceSubscription=null),(i=this.priceViewportObserver)==null||i.disconnect()}setupSubscriptions(){const i=c;this.subscriptions.push(this.rendered.pipe(f(e=>!e),l(1)).subscribe(()=>{const e=i.basket.recipePricesInBasket$().subscribe(s=>{if(!s)return;const r=s.find(p=>p.id===this.recipeId);s.length>0&&r&&parseFloat(r.price)>0&&(this.serves=i.basket.guestsForRecipe(r.id),this.recipePricingValue={id:r.id,price:parseFloat(r.price),guests:this.serves},this.recalculatePrice(parseFloat(r.price),this.serves))});this.subscriptions.push(e)}),i.recipes.recipePriceUpdated().subscribe(e=>{e.recipeId===this.recipeId&&!e.inBasket&&this.recipePricingValue&&(this.recipePricingValue.price=e.remaining,this.recalculatePrice(e.remaining,this.serves))}),this.setupDisplayedRecipeSubscription(),this.setupGuestUpdatesSubscription(),this.setupMenuPriceSubscription())}setupDisplayedRecipeSubscription(){return c.recipes.displayedRecipe$.pipe(h(()=>this.planner&&!!this.recipeId)).subscribe(e=>{var s;((s=e==null?void 0:e.recipe)==null?void 0:s.id)===this.recipeId?(this.lastDisplayedRecipeId=this.recipeId,this.trackPlannerRecipePrice(),this.updateGuestCountFromMenu()):!(e!=null&&e.recipe)&&this.lastDisplayedRecipeId===this.recipeId&&(this.updatePriceFromCapturedPlannerPrice(),this.lastDisplayedRecipeId="",this.plannerPriceSubscription&&(this.plannerPriceSubscription.unsubscribe(),this.plannerPriceSubscription=null))})}setupGuestUpdatesSubscription(){return c.recipes.guestsUpdated().pipe(h(()=>!!this.recipeId)).subscribe(({guests:e,recipeId:s})=>{s===this.recipeId&&(this.serves=e,this.recipePricingValue&&this.recipePricingValue.price!==null&&this.recalculatePrice(this.recipePricingValue.price,this.serves))})}setupMenuPriceSubscription(){return c.planner.menuPrice$.pipe(h(()=>this.planner&&!!this.recipeId)).subscribe(()=>{if(this.lastPlannerPrice>0&&this.serves>0){const e=this.lastPlannerPrice/this.serves;this.applyCurrencyDisplay(e.toFixed(2))}})}fetchPrice(){const i=n.getInstance(),e=i.getMemorizedPrice(this.recipeId,this.serves);if(e){requestAnimationFrame(()=>{this.applyCurrencyDisplay(e.price),i.markPriceAsDisplayed(this.recipeId,this.serves)});return}this.fetchAndUpdatePrice()}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.recipeId&&this.pricePerServe&&n.getInstance().isPriceDisplayed(this.recipeId,this.serves)&&requestAnimationFrame(()=>{this.applyCurrencyDisplay(this.pricePerServe)}),this.rendered.next(!0),this.getInitialStatus())}getInitialStatus(){const i=this.attributes.getNamedItem("starting-data"),e=i==null?void 0:i.value;if(!e)return;const s=JSON.parse(e),{recipeId:r,extStoreId:p,posId:t,pricePerServe:a,serves:o,planner:d}=s;this.extStoreId=p||"",this.posId=t||"",this.recipeId=r,this.pricePerServe=(a==null?void 0:a.toString())??"",this.serves=o,this.planner=d||!1,this.recipePricingValue={id:this.recipeId,price:null,guests:this.serves},this.pricePerServe&&this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(i){if(this.lastAppliedPrice===i)return;const e=parseFloat(i);isNaN(e)||(this.lastAppliedPrice=i,this.formattedPrice=e.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.recipePricing||(this.recipePricing=this.querySelector(".mealz-recipe-pricing")),this.updateDOM())}showPrice(){var s,r;if(this.priceDisplayed)return;const i=(s=this.recipePricing)==null?void 0:s.querySelector(".mealz-recipe-pricing__loading"),e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__wrapper");i==null||i.classList.replace("active","hidden"),e==null||e.classList.replace("hidden","active"),this.priceDisplayed=!0}updateDOM(){var e;const i=(e=this.recipePricing)==null?void 0:e.querySelector(".mealz-recipe-pricing__wrapper__price");i&&(i.innerHTML=this.formattedPrice+" €",this.showPrice())}recalculatePrice(i,e){const s=(i/e).toString();this.applyCurrencyDisplay(s)}trackPlannerRecipePrice(){const i=c;this.plannerPriceSubscription&&(this.plannerPriceSubscription.unsubscribe(),this.plannerPriceSubscription=null),this.plannerPriceSubscription=i.planner.plannerRecipePrice$.subscribe(e=>{e>0&&(this.lastPlannerPrice=e)})}updateGuestCountFromMenu(){if(!this.planner||!this.recipeId)return;c.planner.getGuestsForRecipe(this.recipeId).pipe(l(1)).subscribe(e=>{e&&e>0&&(this.serves=e)})}updatePriceFromCapturedPlannerPrice(){if(!this.planner||!this.recipeId)return;c.planner.isRecipeInMenu$(this.recipeId).pipe(l(1)).subscribe(e=>{if(e&&this.lastPlannerPrice>0){if(this.serves>0){const s=this.lastPlannerPrice/this.serves;this.applyCurrencyDisplay(s.toFixed(2))}}else this.pricePerServe&&this.applyCurrencyDisplay(this.pricePerServe)})}listenInView(){this.priceViewportObserver=new m(this,()=>{var i;!this.priceFetched&&((i=this.recipePricingValue)==null?void 0:i.price)===null&&this.fetchPrice()})}fetchAndUpdatePrice(){const i=this.posId||this.extStoreId,e=!!this.extStoreId;if(!i||!this.recipeId||!this.serves)return;const p=c.recipes.fetchPricing(this.recipeId,i,this.serves,e).subscribe({next:t=>{t&&t["price-per-serve"]&&(this.pricePerServe=t["price-per-serve"].toString(),this.recipePricingValue={id:this.recipeId,price:t.price,guests:this.serves},this.recalculatePrice(t.price,this.serves),this.priceFetched=!0)},error:t=>{console.error("Failed to fetch recipe pricing:",t)}});this.subscriptions.push(p)}}customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",I);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as l}from"../assets/no-shadow-element-
|
|
1
|
+
import{N as l}from"../assets/no-shadow-element-CXVMZH9n.js";import{w as p,m as n}from"../assets/mealz-sdk-CnvUgy3V.js";import{G as h}from"../assets/guestObserver-PPbBwlOO.js";import"../assets/singleton-COF3iBbF.js";class d extends l{constructor(){super(),this.plannerMode=!1,this.analyticsPath="",this.counterListener=t=>this.onCounterValueChange(t),this.guestObserverService=h.getInstance(),this.styleURL=new URL("./recipe-to-basket/recipe-to-basket.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.initializeFromStartingData(),this.addEventListener("valueChange",this.counterListener)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("valueChange",this.counterListener)}initializeFromStartingData(){const t=this.getAttribute("starting-data");if(t){try{const e=JSON.parse(t),s=typeof e.recipeId=="string"?e.recipeId:void 0,a=typeof e.guests=="number"?e.guests:void 0;this.plannerMode=!!e.planner,this.guests=a,s&&(this.analyticsPath=`/recipes/${s}/shopping`,p().then(()=>{var i,r;(r=(i=n)==null?void 0:i.recipes)==null||r.loadAndSetupRecipe(s,a).subscribe()}))}catch(e){console.warn("[mealz-recipe-to-basket] invalid starting-data attribute",e),this.removeAttribute("starting-data");return}this.removeAttribute("starting-data")}}onCounterValueChange(t){var i,r,o,c,u;const e=t.target;if(!(e!=null&&e.closest("mealz-counter")))return;const s=(i=t.detail)==null?void 0:i.value;if(typeof s!="number"||this.guests===s)return;this.guests=s,this.guestObserverService.updateGuests(this.guests);const a={originPath:this.analyticsPath,props:{}};this.plannerMode&&((o=(r=n)==null?void 0:r.planner)!=null&&o.updateGuests)?n.planner.updateGuests(this.guests,a):(u=(c=n)==null?void 0:c.recipes)==null||u.updateGuests(a,this.guests)}}customElements.get("mealz-recipe-to-basket")||customElements.define("mealz-recipe-to-basket",d);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../assets/promotion-badge-
|
|
1
|
+
import"../../assets/promotion-badge-D63kIgUZ.js";import{N as o,k as i}from"../../assets/no-shadow-element-CXVMZH9n.js";import{n as m}from"../../assets/property-BXpY_hgs.js";import{g as h,a as u}from"../../assets/price-utils-BRFZa-3D.js";import{m as n}from"../../assets/mealz-sdk-CnvUgy3V.js";import"../../assets/price-CTfOOyf1.js";import"../../assets/singleton-COF3iBbF.js";var z=Object.defineProperty,l=(d,e,s,p)=>{for(var t=void 0,a=d.length-1,r;a>=0;a--)(r=d[a])&&(t=r(e,s,t)||t);return t&&z(e,s,t),t};class c extends o{constructor(){super(),this.noSupplier=n.supplier.isNoSupplier(),this.subscriptions=[],this.styleURL=new URL("./replace-item/replace-item-card/replace-item-card.css",this.getBaseURL()),this.subscriptions.push(n.replaceItem.replaceItemLoading$.subscribe(e=>{this.replaceItemLoading=e,this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}onSelectItem(e){const s={detail:{item:e},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("selectItem",s))}render(){var e,s,p,t,a,r;return i`
|
|
2
2
|
<div
|
|
3
3
|
class="
|
|
4
4
|
mealz-replace-item-card
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./replace-item-card/replace-item-card.min.js";import{N as h,n as g,D as d,k as c}from"../assets/no-shadow-element-
|
|
1
|
+
import"./replace-item-card/replace-item-card.min.js";import{N as h,n as g,D as d,k as c}from"../assets/no-shadow-element-CXVMZH9n.js";import{c as b}from"../assets/capitalize-DUAqYmp4.js";import{m as r}from"../assets/mealz-sdk-CnvUgy3V.js";import{G as _}from"../assets/guestObserver-PPbBwlOO.js";import{m as z}from"../assets/merge-B0ddcNYl.js";import{m}from"../assets/map-ND1NsJPC.js";import{d as v}from"../assets/debounceTime-BeLayHXh.js";import{f}from"../assets/filter-aZV_N5pj.js";import{d as I}from"../assets/distinctUntilChanged-6bjT4iYO.js";import{s as S}from"../assets/switchMap-DC1sJvd8.js";import"../assets/promotion-badge-D63kIgUZ.js";import"../assets/property-BXpY_hgs.js";import"../assets/price-CTfOOyf1.js";import"../assets/singleton-COF3iBbF.js";import"../assets/price-utils-BRFZa-3D.js";import"../assets/mergeAll-BvxRfNLo.js";import"../assets/mergeMap-C1wxIFhz.js";import"../assets/innerFrom-BldbX_fT.js";import"../assets/OperatorSubscriber-CvNNPrIM.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/empty-Dy0Wgz_B.js";import"../assets/args-upHwW4Wh.js";import"../assets/isScheduler-fbUJB_yC.js";import"../assets/from-uSPfq2sN.js";import"../assets/async-M7ziFu3t.js";class $ extends h{constructor(){super(),this.addProductMode=!1,this.fromRecipeDetails=!1,this.isLoading=!1,this.subscriptions=[],this.searchString="",this.itemsWithPricesList=[],this.searchSubject=new g,this.guestObserverService=_.getInstance(),this.initialGuests=1,this.currentGuests=1,this.styleURL=new URL("./replace-item/replace-item.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(this.setupSearchObservable(),r.replaceItem.basketEntryToReplace$.subscribe(e=>{this.handleToReplace(e)}),z(r.recipes.displayedRecipe$.pipe(m(e=>{var i,s,a,n;const t=(i=e==null?void 0:e.recipe)==null?void 0:i.id;if(t){this.currentRecipeId=t,this.fromRecipeDetails=!0;const l=((a=(s=e==null?void 0:e.recipe)==null?void 0:s.attributes)==null?void 0:a["number-of-guests"])||1,o=(n=e==null?void 0:e.recipe)==null?void 0:n.modifiedGuests;this.initialGuests=Number(l)||1,this.currentGuests=Number(o||l)||1,this.calculateQty()}})),r.replaceItem.replaceProductFromPreviewOpen$.pipe(m(e=>{e&&(this.basketEntry=e)})),r.replaceItem.additionModalOpen$.pipe(m(e=>{this.addProductMode=e})),r.replaceItem.itemsWithPricesList$.pipe(m(e=>{this.itemsWithPricesList=e})),r.replaceItem.fetchingItemLoading$.pipe(m(e=>{this.isLoading=e}))).subscribe(()=>this.requestUpdate()),this.guestObserverService.guests$.subscribe(e=>{this.currentGuests=Number(e)||this.currentGuests||1,this.calculateQty()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}handleToReplace(e){var i;if(this.searchString="",!e){this.basketEntry=void 0,this.ingredient=void 0,this.ignoreSelected=!1;return}this.basketEntry=e.basketEntry,this.ingredient=e.ingredient,this.ignoreSelected=e.ignoreSelected||!1,e.initialGuests&&(this.initialGuests=Number(e.initialGuests)||this.initialGuests),e.currentGuests&&(this.currentGuests=Number(e.currentGuests)||this.currentGuests);const t=this.basketEntry;if(t&&t.name&&!(t.attributes&&t.attributes.name)&&(t.attributes={...t.attributes||{},name:t.name}),this.ingredient&&(this.fromRecipeDetails=!0,!this.currentRecipeId)){const s=this.basketEntry,a=(s==null?void 0:s.recipesIds)&&s.recipesIds[0]||((i=s==null?void 0:s.attributes)==null?void 0:i["recipe-ids"])&&s.attributes["recipe-ids"][0];a&&(this.currentRecipeId=String(a))}this.calculateQty(),this.requestUpdate()}calculateQty(){var a,n,l;if(!this.ingredient)return;const e=((a=this.ingredient)==null?void 0:a.quantity)??((l=(n=this.ingredient)==null?void 0:n.attributes)==null?void 0:l.quantity),t=Number(e);if(!Number.isFinite(t))return;const i=this.initialGuests||1,s=t/i;this.modifiedIngQty=Number((s*(this.currentGuests||i)).toFixed(2))}onClose(){r.replaceItem.replaceItemLoading$.next(void 0),r.replaceItem.basketEntryToReplace$.next(void 0),r.productAddition.close()}onSearchInputChange(e){this.searchString=e.target.value,this.searchSubject.next(this.searchString)}setupSearchObservable(){return this.searchSubject.pipe(v(200),f(e=>e.length>=3),I(),S(e=>r.replaceItem.searchItem(e))).subscribe()}onSelectItem(e){var s;const t=(s=this.basketEntry)==null?void 0:s.id,i=this.fromRecipeDetails?`/recipes/${this.currentRecipeId}/shopping`:"/basket/products";r.replaceItem.onSelectItem(e.detail.item,this.searchString,()=>{this.onClose(),r.productAddition.productAdded$.next(t)},{originPath:`${i}/item-selector`,props:{}})}renderIssues(){var e,t;return c`
|
|
2
2
|
<!-- NO SUBSTITUTION PRODUCT -->
|
|
3
3
|
${!this.isLoading&&this.itemsWithPricesList.length===1&&!this.searchString?c`
|
|
4
4
|
<div class="mealz-replace-item__error">
|
package/dist/replace-item-planner/replace-item-card-planner/replace-item-card-planner.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../assets/promotion-badge-
|
|
1
|
+
import"../../assets/promotion-badge-D63kIgUZ.js";import{N as n,k as t}from"../../assets/no-shadow-element-CXVMZH9n.js";import{n as m}from"../../assets/property-BXpY_hgs.js";import{g as d,a as o}from"../../assets/price-utils-BRFZa-3D.js";import{m as h}from"../../assets/mealz-sdk-CnvUgy3V.js";import"../../assets/price-CTfOOyf1.js";import"../../assets/singleton-COF3iBbF.js";var u=Object.defineProperty,p=(a,i,l,z)=>{for(var e=void 0,r=a.length-1,c;r>=0;r--)(c=a[r])&&(e=c(i,l,e)||e);return e&&u(i,l,e),e};class s extends n{constructor(){super(),this.noSupplier=h.supplier.isNoSupplier(),this.styleURL=new URL("./replace-item-planner/replace-item-card-planner/replace-item-card-planner.css",this.getBaseURL())}onSelectItem(){this.itemWithPrice.status="ticked";const i={detail:{itemWithPrice:this.itemWithPrice},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("selectItem",i)),this.requestUpdate()}render(){return t`
|
|
2
2
|
<div class=" mealz-replace-item-card-planner
|
|
3
3
|
${this.itemWithPrice.status==="ticked"?"selected":""}"
|
|
4
4
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./replace-item-card-planner/replace-item-card-planner.min.js";import{N as c,n as o,D as l,k as s}from"../assets/no-shadow-element-
|
|
1
|
+
import"./replace-item-card-planner/replace-item-card-planner.min.js";import{N as c,n as o,D as l,k as s}from"../assets/no-shadow-element-CXVMZH9n.js";import{c as h}from"../assets/capitalize-DUAqYmp4.js";import{m as i}from"../assets/mealz-sdk-CnvUgy3V.js";import{m as d}from"../assets/merge-B0ddcNYl.js";import{m as r}from"../assets/map-ND1NsJPC.js";import{d as u}from"../assets/debounceTime-BeLayHXh.js";import{f as g}from"../assets/filter-aZV_N5pj.js";import{d as _}from"../assets/distinctUntilChanged-6bjT4iYO.js";import{s as b}from"../assets/switchMap-DC1sJvd8.js";import"../assets/promotion-badge-D63kIgUZ.js";import"../assets/property-BXpY_hgs.js";import"../assets/price-CTfOOyf1.js";import"../assets/singleton-COF3iBbF.js";import"../assets/price-utils-BRFZa-3D.js";import"../assets/mergeAll-BvxRfNLo.js";import"../assets/mergeMap-C1wxIFhz.js";import"../assets/innerFrom-BldbX_fT.js";import"../assets/OperatorSubscriber-CvNNPrIM.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/empty-Dy0Wgz_B.js";import"../assets/args-upHwW4Wh.js";import"../assets/isScheduler-fbUJB_yC.js";import"../assets/from-uSPfq2sN.js";import"../assets/async-M7ziFu3t.js";class z extends c{constructor(){super(),this.isLoading=!1,this.subscriptions=[],this.searchString="",this.itemsWithPricesList=[],this.analyticsPath="/meals-planner/current",this.searchSubject=new o,this.styleURL=new URL("./replace-item-planner/replace-item-planner.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(this.setupSearchObservable(),i.planner.itemToReplace$.subscribe(e=>{this.handleToReplace(e)}),d(i.recipes.displayedRecipe$.pipe(r(e=>{var t;this.currentRecipeId=(t=e==null?void 0:e.recipe)==null?void 0:t.id})),i.planner.itemsWithPricesList$.pipe(r(e=>{this.itemsWithPricesList=e})),i.planner.fetchingItemLoading$.pipe(r(e=>{this.isLoading=e}))).subscribe(()=>{this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}handleToReplace(e){if(this.searchString="",!e){this.item=void 0,this.ingredient=void 0;return}this.item=e.item,this.ingredient=e.ingredient,this.requestUpdate()}onClose(){i.planner.itemToReplace$.next(void 0)}onSearchInputChange(e){this.searchString=e.target.value,this.searchSubject.next(this.searchString)}setupSearchObservable(){return this.searchSubject.pipe(u(200),g(e=>e.length>=3),_(),b(e=>i.planner.searchItem(e,this.ingredient,this.item))).subscribe()}onSelectItem(e){this.replacedItemEvent(e.detail.itemWithPrice),i.planner.replaceProduct(e.detail.itemWithPrice),this.item=e.detail.itemWithPrice.item,this.onClose()}formatNumber(e){const t=i.user.getLanguage()||"fr";return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:2}).format(e)}renderIssues(){var e,t;return s`
|
|
2
2
|
<!-- NO SUBSTITUTION PRODUCT -->
|
|
3
3
|
${!this.isLoading&&this.itemsWithPricesList.length===1&&!this.searchString?s`
|
|
4
4
|
<div class="mealz-replace-item-planner__error">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as r,k as o}from"../assets/no-shadow-element-
|
|
1
|
+
import{N as r,k as o}from"../assets/no-shadow-element-CXVMZH9n.js";import{n}from"../assets/property-BXpY_hgs.js";import{r as h}from"../assets/state-BjFDUoQX.js";import"../assets/mealz-sdk-CnvUgy3V.js";var u=Object.defineProperty,a=(c,e,l,t)=>{for(var s=void 0,p=c.length-1,d;p>=0;p--)(d=c[p])&&(s=d(e,l,s)||s);return s&&u(e,l,s),s};class i extends r{constructor(){super(),this.options=[],this.value="",this.placeholder="",this.disabled=!1,this._open=!1,this._onWindowClick=e=>{e.composedPath().includes(this)||this._open&&(this._open=!1,this.requestUpdate())},this.styleURL=new URL("./select/select.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this._attachOutsideClick()}disconnectedCallback(){this._detachOutsideClick(),super.disconnectedCallback()}render(){const e=this.options.find(t=>t.id===this.value),l=(e==null?void 0:e.label)||this.placeholder||"";return o`
|
|
2
2
|
<div class="mealz-select">
|
|
3
3
|
<button
|
|
4
4
|
type="button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../store-locator/store-locator.min.js";import{N as h,k as n}from"../assets/no-shadow-element-
|
|
1
|
+
import"../store-locator/store-locator.min.js";import{N as h,k as n}from"../assets/no-shadow-element-CXVMZH9n.js";import{n as c}from"../assets/property-BXpY_hgs.js";import"../assets/state-BjFDUoQX.js";import"../assets/query-BApjzB0v.js";import"../assets/mealz-sdk-CnvUgy3V.js";var o=Object.defineProperty,p=Object.getOwnPropertyDescriptor,b=(a,e,t,l)=>{for(var s=l>1?void 0:l?p(e,t):e,i=a.length-1,d;i>=0;i--)(d=a[i])&&(s=(l?d(e,t,s):d(s))||s);return l&&s&&o(e,t,s),s};class r extends h{constructor(){super(),this._selectedTabIndex=0,this.styleURL=new URL("./slider-tabs/slider-tabs.css",this.getBaseURL())}get selectedTabIndex(){return this._selectedTabIndex}set selectedTabIndex(e){this._selectedTabIndex!==e&&(this._selectedTabIndex=e,this.sliderElement&&this.updateSlider())}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}firstUpdated(){this.sliderElement=this.querySelector(".mealz-slider-tab__background"),this.updateSlider()}render(){return n`
|
|
2
2
|
<div class="mealz-slider-tabs">
|
|
3
3
|
${this.tabs.map((e,t)=>n`
|
|
4
4
|
<button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../store-locator/store-locator.min.js";import{N as l,D as c,k as p}from"../assets/no-shadow-element-
|
|
1
|
+
import"../store-locator/store-locator.min.js";import{N as l,D as c,k as p}from"../assets/no-shadow-element-CXVMZH9n.js";import{n as d}from"../assets/property-BXpY_hgs.js";import{m as o}from"../assets/mealz-sdk-CnvUgy3V.js";import"../assets/state-BjFDUoQX.js";import"../assets/query-BApjzB0v.js";var m=Object.defineProperty,u=(s,e,r,h)=>{for(var t=void 0,a=s.length-1,i;a>=0;a--)(i=s[a])&&(t=i(e,r,t)||t);return t&&m(e,r,t),t};class n extends l{constructor(){super(),this.analyticsPath="",this.subscriptions=[],this.styleURL=new URL("./store-indicator/store-indicator.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.setCurrentPosLabel()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){return this.currentPosLabel?p`
|
|
2
2
|
<div class="mealz-store-indicator">
|
|
3
3
|
<span class="mealz-store-indicator__pos-label mealz-ds-text weight-xl">
|
|
4
4
|
${this.currentPosLabel}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as m,k as a}from"../assets/no-shadow-element-
|
|
1
|
+
import{N as m,k as a}from"../assets/no-shadow-element-CXVMZH9n.js";import{n as d}from"../assets/property-BXpY_hgs.js";import{r as _}from"../assets/state-BjFDUoQX.js";import{e as u}from"../assets/query-BApjzB0v.js";import{a as h}from"../assets/mealz-sdk-CnvUgy3V.js";class f{get extId(){return this.attributes["ext-id"]}}var g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,n=(c,t,e,s)=>{for(var i=s>1?void 0:s?b(t,e):t,o=c.length-1,l;o>=0;o--)(l=c[o])&&(i=(s?l(t,e,i):l(i))||i);return s&&i&&g(t,e,i),i};class r extends m{constructor(){var t,e,s,i,o,l;super(),this.selectedRadius=50,this.getByAddress=(e=(t=h)==null?void 0:t.pos)==null?void 0:e.getByAddress,this.getByCoordinates=(i=(s=h)==null?void 0:s.pos)==null?void 0:i.getByCoordinates,this.getAffiliateSuppliers=(l=(o=h)==null?void 0:o.supplier)==null?void 0:l.getAffiliateSuppliers,this._show=!1,this._posList=[],this._suppliers=[],this._markers=[],this._searchingPos=!1,this._searchSubmitted=!1,this._prevAddress="",this._selectedSuppliers=[],this._showPosList=!1,this._posSelected=!1,this.subscriptions=[],this.styleURL=new URL("/store-locator.css",import.meta.url)}get show(){return this._show}set show(t){this._show=t,this._show&&(this._posSelected=!1,this.initialSearch(),this._map&&this.ensureMapSize())}set geolocationCoordinates(t){var e,s;this._geolocationCoordinates=t,typeof((e=t==null?void 0:t.coords)==null?void 0:e.latitude)=="number"&&typeof((s=t==null?void 0:t.coords)==null?void 0:s.longitude)=="number"&&this.setGeolocation()}get geolocationCoordinates(){return this._geolocationCoordinates}getMapContainer(){var e;const t=this._mapElement??((e=this.querySelector)==null?void 0:e.call(this,"#mealz-store-locator__map"));return t instanceof HTMLElement?t:null}_nameOfStore(t){return`${t.supplier.attributes.name} - ${t.attributes.name}`}connectedCallback(){super.connectedCallback(),this.initLeaflet(),this.initEvents(),this.initResizeObserver()}disconnectedCallback(){var t,e,s;this.subscriptions.forEach(i=>i.unsubscribe()),this._resizeObserver&&this._resizeObserver.disconnect(),super.disconnectedCallback(),this._map&&(this._map.off(),this._map.remove(),this._map=void 0),(t=this._leafletCss)==null||t.remove(),(e=this._miamDs)==null||e.remove(),(s=this._leafletJs)==null||s.remove()}firstUpdated(){this._posSelected=!1,this.loadMap(),this.geolocationTimeout(),this.listenFormSubmit(),this._map&&this.ensureMapSize()}render(){return this.show?this.posSelectionTemplate():a``}posSelectionTemplate(){return a`
|
|
2
2
|
<div class="mealz-store-locator mealz-ds-body">
|
|
3
3
|
<div class="mealz-store-locator__pos-selection">
|
|
4
4
|
<button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as a,k as r}from"../assets/no-shadow-element-
|
|
1
|
+
import{N as a,k as r}from"../assets/no-shadow-element-CXVMZH9n.js";import{m as t}from"../assets/mealz-sdk-CnvUgy3V.js";import{s as i}from"../assets/skipWhile-DK5WsIpo.js";import{s as n}from"../assets/switchMap-DC1sJvd8.js";import{m as l}from"../assets/map-ND1NsJPC.js";import{f as d}from"../assets/filter-aZV_N5pj.js";import"../assets/OperatorSubscriber-CvNNPrIM.js";import"../assets/innerFrom-BldbX_fT.js";class c extends a{constructor(){super(...arguments),this.analyticsPath="/locator",this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.listenToDrawerViewSwapper(),this.listenToCloseEvent(),this.listenToUserCoordinates()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){return r`
|
|
2
2
|
<!-- NEED TO SET REAL VALUE TO .SHOW CONTINUE HERE -->
|
|
3
3
|
<mealz-store-locator
|
|
4
4
|
.show="${!0}"
|