mealz-components 1.2.3 → 1.2.5
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/catalog/catalog-favorites/catalog-favorites.css +1 -1
- package/dist/catalog/catalog-favorites/catalog-favorites.min.js +1 -1
- package/dist/catalog/catalog-history/catalog-history.css +1 -1
- package/dist/catalog/catalog-load-more.min.js +1 -1
- package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
- package/dist/history-order/history-order.css +1 -1
- package/dist/recipe-card/recipe-card.css +1 -1
- package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.mealz-catalog-favorites .
|
|
1
|
+
.mealz-catalog-favorites .hidden{display:none}.mealz-catalog-favorites .mealz-catalog-toolbar:not(.sticking){flex-direction:row;gap:0px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as d}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as g}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BPS5vj92.js";import{o as p,c as f}from"../../assets/OperatorSubscriber-BPZabEAm.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/mapOneOrManyArgs-2FiDGdaS.js";import"../../assets/async-B_IhBgzg.js";function m(t,e){return p(function(i,a){var s=0;i.subscribe(f(a,function(r){return t.call(e,r,s++)&&a.next(r)}))})}function v(t){return m(function(e,i){return t<=i})}var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,w=(t,e,i,a)=>{for(var s=a>1?void 0:a?b(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=(a?o(e,i,s):o(s))||s);return a&&s&&_(e,i,s),s};let n=class extends g{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.user.isAuthenticated().pipe(v(1)).subscribe(t=>{this.isLogged=t,this.updateDOM()}))}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const t=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!t||(this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites))return;const e=this.querySelector(".mealz-catalog__list");if(!e)return;const{pageSize:i,storeId:a,loadMoreURL:s,displayRecipeVariant:r,search:o,sessionId:l,path:u}=JSON.parse(t);h(l),this.analyticsPath=u,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:r,loadMoreURL:s,sessionId:l,pageSize:i,storeId:a,packageId:null,search:o,listHTML:e}),this.removeAttribute("starting-data")}updateDOM(){const t=this.querySelector(".mealz-catalog-favorites__list__not-logged"),e=this.querySelector(".mealz-catalog-favorites__list__logged");!t||!e||(t.classList.toggle("hidden",this.isLogged),e.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=w([d("mealz-catalog-favorites")],n);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
:root{--m-history-order-width: var(--miam-history-order-width, var(--miam-catalog-card-width, 308px))}mealz-catalog-history .hidden{display:none}mealz-catalog-history .mealz-catalog__list,mealz-catalog-history .mealz-catalog__content .mealz-catalog__list{grid-template-columns:repeat(auto-fill,var(--m-history-order-width, 308px))}@media (min-width: 375px) and (max-width: 712px){mealz-catalog-history .mealz-catalog__list{grid-template-columns:repeat(auto-fill,var(--m-history-order-width, 308px))}}mealz-catalog-history .mealz-catalog-toolbar:not(.sticking){flex-direction:row;gap:0px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as
|
|
1
|
+
import{N as x}from"../assets/no-shadow-element-CaVIVF-o.js";import{c as E,i as m,o as C,_ as I,O as _}from"../assets/OperatorSubscriber-BPZabEAm.js";import{i as L,m as R,a as T,b as D,c as H}from"../assets/mapOneOrManyArgs-2FiDGdaS.js";import{a as z,b as O}from"../assets/async-B_IhBgzg.js";import"../assets/lit-element-4gw3YGga.js";function S(i){return i instanceof Date&&!isNaN(i)}function A(i,e,t,n,r,l,u,f){var d=[],o=0,a=0,s=!1,h=function(){s&&!d.length&&!o&&e.complete()},w=function(p){return o<n?g(p):d.push(p)},g=function(p){o++;var v=!1;L(t(p,a++)).subscribe(E(e,function(c){e.next(c)},function(){v=!0},void 0,function(){if(v)try{o--;for(var c=function(){var y=d.shift();u||g(y)};d.length&&o<n;)c();h()}catch(y){e.error(y)}}))};return i.subscribe(E(e,w,function(){s=!0,h()})),function(){}}function k(i,e,t){return t===void 0&&(t=1/0),m(e)?k(function(n,r){return R(function(l,u){return e(n,l,r,u)})(L(i(n,r)))},t):(typeof e=="number"&&(t=e),C(function(n,r){return A(n,r,i,t)}))}var N=["addListener","removeListener"],$=["addEventListener","removeEventListener"],q=["on","off"];function M(i,e,t,n){if(m(t)&&(n=t,t=void 0),n)return M(i,e,t).pipe(T(n));var r=I(j(i)?$.map(function(f){return function(d){return i[f](e,d,t)}}):F(i)?N.map(b(i,e)):V(i)?q.map(b(i,e)):[],2),l=r[0],u=r[1];if(!l&&D(i))return k(function(f){return M(f,e,t)})(L(i));if(!l)throw new TypeError("Invalid event target");return new _(function(f){var d=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return f.next(1<o.length?o:o[0])};return l(d),function(){return u(d)}})}function b(i,e){return function(t){return function(n){return i[t](e,n)}}}function F(i){return m(i.addListener)&&m(i.removeListener)}function V(i){return m(i.on)&&m(i.off)}function j(i){return m(i.addEventListener)&&m(i.removeEventListener)}function B(i,e,t){t===void 0&&(t=z);var n=-1;return e!=null&&(H(e)?t=e:n=e),new _(function(r){var l=S(i)?+i-t.now():i;l<0&&(l=0);var u=0;return t.schedule(function(){r.closed||(r.next(u++),0<=n?this.schedule(void 0,n):r.complete())},l)})}function G(i,e){return C(function(t,n){var r=e??{},l=r.leading,u=l===void 0?!0:l,f=r.trailing,d=f===void 0?!1:f,o=!1,a=null,s=null,h=!1,w=function(){s==null||s.unsubscribe(),s=null,d&&(v(),h&&n.complete())},g=function(){s=null,h&&n.complete()},p=function(c){return s=L(i(c)).subscribe(E(n,w,g))},v=function(){if(o){o=!1;var c=a;a=null,n.next(c),!h&&p(c)}};t.subscribe(E(n,function(c){o=!0,a=c,!(s&&!s.closed)&&(u?v():p(c))},function(){h=!0,!(d&&o&&s&&!s.closed)&&n.complete()}))})}function J(i,e,t){e===void 0&&(e=O);var n=B(i,e);return G(function(){return n},t)}const P=300;class Z extends x{constructor(){super(...arguments),this.noMoreData=!1,this.isLoading=!1,this.page=2,this.loaderElement=null,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.createLoader()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:t,sessionId:n,pageSize:r,storeId:l,packageId:u,search:f,listHTML:d,promotions:o=!1}){const a=M(window,"scroll");this.subscriptions.push(a.pipe(J(100)).subscribe(()=>{!this.noMoreData&&!this.isLoading&&window.innerHeight+Math.round(window.scrollY)+P>=document.body.offsetHeight&&this.getMoreRecipes({loadMoreURL:t,sessionId:n,pageSize:r,storeId:l,displayRecipeVariant:e,packageId:u,search:f,promotions:o,listHTML:d})}))}buildHeaders(e){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":e},n=localStorage.getItem("_miam/userId");return n?t.authorization=`user_id ${n}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:e,sessionId:t,pageSize:n,storeId:r,displayRecipeVariant:l,packageId:u,search:f,promotions:d,listHTML:o}){if(this.checkIfMoreRecipes(o.innerHTML,n),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const a=new URLSearchParams;a.append("size",n.toString()),a.append("page",this.page.toString()),l&&a.append("display_recipe_variant",l),u&&a.append("category_id",u),r&&a.append("store_id",r),f&&a.append("search",f),d&&a.append("promotions",d);try{const s=await fetch(e+"?"+a,{method:"GET",headers:this.buildHeaders(t)});if(!s.ok)throw new Error(`Load more request failed with status: ${s.status}`);const h=await s.text();this.appendRecipesToList(h,o,n)}catch(s){console.error(s),this.isLoading=!1}}appendRecipesToList(e,t,n){this.checkIfMoreRecipes(e,n),t.insertAdjacentHTML("beforeend",e),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(e,t){const n=e.match(/<mealz-recipe-card(?=\s|>)/gi)||e.match(/<mealz-history-order(?=\s|>)/gi);(n?n.length:0)<t&&(this.noMoreData=!0)}createLoader(){const e=this.querySelector(".mealz-catalog__content");!this.loaderElement&&e&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",e.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(e){this.loaderElement&&(this.loaderElement.style.display=e?"block":"none")}}export{Z as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as c}from"../../assets/no-shadow-element-CaVIVF-o.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var a=r>1?void 0:r?d(e,s):e,o=t.length-1,i;o>=0;o--)(i=t[o])&&(a=(r?i(e,s,a):i(a))||a);return r&&a&&h(e,s,a),a};let n=class extends c{constructor(){super(...arguments),this.subscriptions=[],this.supplierHeaderHeight=0,this.searchUrl="",this.path=""}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.getStickyHeaderHeight().subscribe(t=>{this.supplierHeaderHeight=t,this.setStickyObserver()}),window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>{const t=this.preferencesButton.querySelector(".mealz-catalog-toolbar__controls__filter-badge"),e=this.preferencesButton.querySelector(".mealz-catalog-toolbar__loader");t&&t.classList.add("hidden"),e&&e.classList.remove("hidden")}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.toolbarObserver.unobserve(this.anchorElement)}render(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{searchUrl:e,path:s}=JSON.parse(t);this.searchUrl=e,this.path=s,this.findElementsInDocument(),this.addEveryEventListeners(),this.removeAttribute("starting-data")}firstUpdated(){this.setStickyObserver()}setStickyObserver(){var e;if(this.toolbar=document.querySelector(".mealz-catalog-toolbar"),this.anchorElement=document.querySelector(".mealz-catalog-toolbar__anchor"),!this.anchorElement||!this.toolbar)return;const t={rootMargin:`-${this.supplierHeaderHeight}px 0px 0px 0px`,threshold:1};(e=this.toolbarObserver)==null||e.unobserve(this),setTimeout(()=>this.setStickyToolbarStyle(),50),this.toolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle()},t),this.toolbarObserver.observe(this.anchorElement)}setStickyToolbarStyle(){const e=this.anchorElement.getBoundingClientRect().top<this.supplierHeaderHeight;this.anchorElement.style.height=e?this.toolbar.clientHeight+"px":"0px",this.toolbar.classList.toggle("sticking",e),this.toolbar.style.top=(e?this.supplierHeaderHeight:0)+"px",this.updateDOM(e)}findElementsInDocument(){this.preferencesButton=this.querySelector(".mealz-catalog-toolbar__controls__preferences"),this.favoritesButton=this.querySelector(".mealz-catalog-toolbar__controls__favorites"),this.searchButton=this.querySelector(".mealz-catalog-toolbar__searchbar-button"),this.searchInput=this.querySelector(".mealz-catalog-toolbar__searchbar-input"),this.backButton=this.querySelector(".mealz-recipe-toolbar__return-button")}addEveryEventListeners(){var t;this.addClickListener(this.preferencesButton,this.openPreferences.bind(this)),this.addClickListener(this.searchButton,this.performSearch.bind(this)),this.addClickListener(this.favoritesButton,this.sendFavoritesDisplay.bind(this)),(t=this.searchInput)==null||t.addEventListener("keypress",e=>{e.key==="Enter"&&this.performSearch()})}addClickListener(t,e){t==null||t.addEventListener("click",s=>{s.stopPropagation(),e()})}performSearch(){const t=this.searchInput.value.trim();if(!t)return;window.mealzInternal.analytics.sendEvent("search",this.path,{search_term:t});const e=this.searchUrl.includes("?")?"&":"?";window.location.href=`${this.searchUrl}${e}search=${encodeURIComponent(t)}`}updateDOM(t){var r;const e=t?["ghost","square"]:["full"],s=t?["full"]:["ghost","square"];this.toggleClasses(this.favoritesButton,e,s),this.toggleClasses(this.preferencesButton,e,s),(r=this.backButton)==null||r.classList.toggle("hidden",!t)}toggleClasses(t,e,s){t==null||t.classList.remove(...s),t==null||t.classList.add(...e)}openPreferences(){window.mealzInternal.analytics.sendEvent("preferences.display",this.path,{}),window.mealzInternal.catalog.openPreferences()}sendFavoritesDisplay(){window.mealzInternal.analytics.sendEvent("liked.display",this.path,{})}};n=p([l("mealz-catalog-toolbar")],n);customElements.get("mealz-catalog-toolbar")||customElements.define("mealz-catalog-toolbar",n);
|
|
1
|
+
import{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as c}from"../../assets/no-shadow-element-CaVIVF-o.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var a=r>1?void 0:r?d(e,s):e,o=t.length-1,i;o>=0;o--)(i=t[o])&&(a=(r?i(e,s,a):i(a))||a);return r&&a&&h(e,s,a),a};let n=class extends c{constructor(){super(...arguments),this.subscriptions=[],this.supplierHeaderHeight=0,this.searchUrl="",this.path=""}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.getStickyHeaderHeight().subscribe(t=>{this.supplierHeaderHeight=t,this.setStickyObserver()}),window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>{const t=this.preferencesButton.querySelector(".mealz-catalog-toolbar__controls__filter-badge"),e=this.preferencesButton.querySelector(".mealz-catalog-toolbar__loader");t&&t.classList.add("hidden"),e&&e.classList.remove("hidden")}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.toolbarObserver.unobserve(this.anchorElement)}render(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{searchUrl:e,path:s}=JSON.parse(t);this.searchUrl=e,this.path=s,this.findElementsInDocument(),this.addEveryEventListeners(),this.removeAttribute("starting-data")}firstUpdated(){this.setStickyObserver()}setStickyObserver(){var e;if(this.toolbar=document.querySelector(".mealz-catalog-toolbar"),this.anchorElement=document.querySelector(".mealz-catalog-toolbar__anchor"),!this.anchorElement||!this.toolbar)return;const t={rootMargin:`-${this.supplierHeaderHeight}px 0px 0px 0px`,threshold:1};(e=this.toolbarObserver)==null||e.unobserve(this),setTimeout(()=>this.setStickyToolbarStyle(),50),this.toolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle()},t),this.toolbarObserver.observe(this.anchorElement)}setStickyToolbarStyle(){const e=this.anchorElement.getBoundingClientRect().top<this.supplierHeaderHeight;this.anchorElement.style.height=e?this.toolbar.clientHeight+"px":"0px",this.toolbar.classList.toggle("sticking",e),this.toolbar.style.top=(e?this.supplierHeaderHeight:0)+"px",this.updateDOM(e)}findElementsInDocument(){this.preferencesButton=this.querySelector(".mealz-catalog-toolbar__controls__preferences"),this.favoritesButton=this.querySelector(".mealz-catalog-toolbar__controls__favorites"),this.searchButton=this.querySelector(".mealz-catalog-toolbar__searchbar-button"),this.searchInput=this.querySelector(".mealz-catalog-toolbar__searchbar-input"),this.backButton=this.querySelector(".mealz-recipe-toolbar__return-button")}addEveryEventListeners(){var t;this.addClickListener(this.preferencesButton,this.openPreferences.bind(this)),this.addClickListener(this.searchButton,this.performSearch.bind(this)),this.addClickListener(this.favoritesButton,this.sendFavoritesDisplay.bind(this)),this.addClickListener(this.backButton,()=>history.back()),(t=this.searchInput)==null||t.addEventListener("keypress",e=>{e.key==="Enter"&&this.performSearch()})}addClickListener(t,e){t==null||t.addEventListener("click",s=>{s.stopPropagation(),e()})}performSearch(){const t=this.searchInput.value.trim();if(!t)return;window.mealzInternal.analytics.sendEvent("search",this.path,{search_term:t});const e=this.searchUrl.includes("?")?"&":"?";window.location.href=`${this.searchUrl}${e}search=${encodeURIComponent(t)}`}updateDOM(t){var r;const e=t?["ghost","square"]:["full"],s=t?["full"]:["ghost","square"];this.toggleClasses(this.favoritesButton,e,s),this.toggleClasses(this.preferencesButton,e,s),(r=this.backButton)==null||r.classList.toggle("hidden",!t)}toggleClasses(t,e,s){t==null||t.classList.remove(...s),t==null||t.classList.add(...e)}openPreferences(){window.mealzInternal.analytics.sendEvent("preferences.display",this.path,{}),window.mealzInternal.catalog.openPreferences()}sendFavoritesDisplay(){window.mealzInternal.analytics.sendEvent("liked.display",this.path,{})}};n=p([l("mealz-catalog-toolbar")],n);customElements.get("mealz-catalog-toolbar")||customElements.define("mealz-catalog-toolbar",n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mealz-history-order{display:flex;flex-direction:column;gap:12px;width:
|
|
1
|
+
.mealz-history-order{display:flex;flex-direction:column;gap:12px;width:var(--m-history-order-width);height:108px;border:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-radius:12px;padding:12px;cursor:pointer}.mealz-history-order .mealz-history-order__container{display:flex;flex-direction:inherit;gap:12px;width:100%;height:100%}.mealz-history-order .mealz-history-order__container .mealz-avatars-group{width:fit-content}.mealz-history-order .mealz-history-order__container .mealz-avatars-group .mealz-avatar{width:62px;height:62px;border:2px solid var(--miam-ds-color-neutral-white, #fff)}.mealz-history-order .mealz-history-order__container .mealz-avatars-group .mealz-avatar:not(:first-child){margin-left:-24px}.mealz-history-order .mealz-history-order__container .mealz-avatars-group .mealz-avatar__overflow{background-color:#f7f8f9;display:flex;justify-content:center;align-items:center}.mealz-history-order .mealz-history-order__container .mealz-avatars-group .mealz-avatar__overflow span{color:var(--miam-ds-color-neutral-black, #0F191F);opacity:.7}.mealz-history-order .mealz-history-order__container .mealz-history-order__bottom{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:12px}.mealz-history-order .mealz-history-order__container .mealz-history-order__bottom .miam-ds-button{padding:8px 16px;background-color:#eff1f3}.mealz-history-order .mealz-history-order__container .mealz-history-order__bottom span{line-height:16px}@media (max-width: 426px){.mealz-history-order{width:auto;height:auto}.mealz-history-order .mealz-history-order__bottom-date span{display:block}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mealz-recipe-card{--mealz-recipe-card-width: 308px;--mealz-recipe-card-height: 500px;--mealz-price-font-size: 20px;--mealz-price-subline-font-size: 16px;--mealz-cta-button-padding: 8px;--mealz-bottom-padding: 12px;--mealz-top-margin: 12px;--mealz-bottom-height: 64px;--mealz-recipe-card-direction: column}.mealz-recipe-card.horizontal{--mealz-recipe-card-width: 100%;--mealz-recipe-card-height: 188px;--mealz-recipe-card-direction: row;--mealz-bottom-padding: 8px;--mealz-top-margin: 8px}.mealz-recipe-card.vertical-small{--mealz-recipe-card-width: 163px;--mealz-recipe-card-height: 272px;--mealz-price-font-size: 16px;--mealz-price-subline-font-size: 14px;--mealz-bottom-padding: 8px;--mealz-bottom-height: 56px;--mealz-top-margin: 8px}.mealz-recipe-card{position:relative;display:flex;width:var(--mealz-recipe-card-width, 308px);height:var(--mealz-recipe-card-height, 500px);flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.mealz-recipe-card .mealz-recipe-card__container{display:flex;flex-direction:var(--mealz-recipe-card-direction, column);height:100%;width:100%;flex-shrink:0;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container:hover .mealz-recipe-card__top .mealz-recipe-card__picture img{transform:scale(1.1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top{position:relative;flex:1;height:calc(100% - var(--mealz-bottom-height, 64px))}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture{width:100%;height:100%;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,#0000 43.67%,#0006 91.33%)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:var(--mealz-bottom-padding, 12px);box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__title{color:var(--miam-ds-color-neutral-white, #FFF);text-shadow:0px 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;gap:4px;border-radius:100px;background:var(--miam-ds-color-neutral-white, #FFF);color:var(--miam-ds-color-neutral-black, #3F3735);height:fit-content;flex-shrink:0}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter p{line-height:100%}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter img{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:var(--mealz-top-margin, 12px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__actions__icon.hidden{display:none}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button{border-radius:48px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button.miam-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card_sponso_and_promo_badge,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__badge-container{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container .mealz-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;object-fit:contain}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom{display:flex;width:100%;height:var(--mealz-bottom-height, 64px);flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:var(--mealz-bottom-padding, 12px);border-radius:0 0 8px 8px;background-color:var(--miam-ds-color-neutral-white, #FFF);border-right:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-bottom:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-left:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions{position:relative;display:flex;justify-content:space-between;align-items:center;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion{display:inherit;position:absolute;bottom:40px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion .mealz-recipe-promotion-badge{align-items:center;padding:4px 8px;gap:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion .mealz-recipe-promotion-badge .mealz-recipe-promotion-badge__icon{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{display:flex;flex-direction:row;gap:16px;align-items:center}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card__cta-button{padding:var(--mealz-cta-button-padding, 12px 16px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card-cta{padding:8px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--miam-ds-color-text-disabled, #8C96A2);gap:12px;margin-bottom:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time{display:flex}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty img,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time img{margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price{color:var(--miam-ds-color-primary-500, #24748F);line-height:100%;margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.mealz-recipe-card.variant-4{width:100%;height:272px}@media (max-width: 480px){.mealz-recipe-card.variant-4{height:224px}}.mealz-recipe-card.horizontal{border:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card.horizontal .mealz-recipe-card__top{flex:inherit;height:inherit;width:50%}.mealz-recipe-card.horizontal .mealz-recipe-card__top .mealz-recipe-card__gradient{display:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom{height:inherit;justify-content:space-between;border:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions{flex-wrap:wrap}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{flex:1;justify-content:flex-end}.mealz-recipe-card.horizontal.variant-3 .mealz-recipe-card__content .mealz-recipe-card__top-container{flex-direction:inherit}.mealz-recipe-card.horizontal.variant-2 .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__actions__icon.hidden{display:inherit}
|
|
1
|
+
.mealz-recipe-card{--mealz-recipe-card-width: 308px;--mealz-recipe-card-height: 500px;--mealz-price-font-size: 20px;--mealz-price-subline-font-size: 16px;--mealz-cta-button-padding: 8px;--mealz-bottom-padding: 12px;--mealz-top-margin: 12px;--mealz-bottom-height: 64px;--mealz-recipe-card-direction: column}.mealz-recipe-card.horizontal{--mealz-recipe-card-width: 100%;--mealz-recipe-card-height: 188px;--mealz-recipe-card-direction: row;--mealz-bottom-padding: 8px;--mealz-top-margin: 8px}.mealz-recipe-card.vertical-small{--mealz-recipe-card-width: 163px;--mealz-recipe-card-height: 272px;--mealz-price-font-size: 16px;--mealz-price-subline-font-size: 14px;--mealz-bottom-padding: 8px;--mealz-bottom-height: 56px;--mealz-top-margin: 8px}.mealz-recipe-card{position:relative;display:flex;width:var(--mealz-recipe-card-width, 308px);height:var(--mealz-recipe-card-height, 500px);flex-direction:column;align-items:flex-start;flex-shrink:0;border-radius:8px;overflow:hidden;cursor:pointer}.mealz-recipe-card .mealz-recipe-card__container{display:flex;flex-direction:var(--mealz-recipe-card-direction, column);height:100%;width:100%;flex-shrink:0;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container:hover .mealz-recipe-card__top .mealz-recipe-card__picture img{transform:scale(1.1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top{position:relative;flex:1;height:calc(100% - var(--mealz-bottom-height, 64px))}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture{width:100%;height:100%;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__picture img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__gradient{position:absolute;width:100%;height:100%;top:0;left:0;background:linear-gradient(180deg,#0000 43.67%,#0006 91.33%)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding:var(--mealz-bottom-padding, 12px);box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__title{color:var(--miam-ds-color-neutral-white, #FFF);text-shadow:0px 2px 8px rgba(0,0,0,.15);text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter{display:flex;padding:4px 8px;align-items:center;gap:4px;border-radius:100px;background:var(--miam-ds-color-neutral-white, #FFF);color:var(--miam-ds-color-neutral-black, #3F3735);height:fit-content;flex-shrink:0}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter p{line-height:100%}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__picture__bottom .mealz-recipe-card__counter img{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container{display:flex;flex-direction:row-reverse;justify-content:space-between;margin:var(--mealz-top-margin, 12px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__actions__icon.hidden{display:none}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button{border-radius:48px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__like .miam-like-button.miam-ds-button.primary.reverse.square.small .miam-like-button__icon{height:16px;width:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card_sponso_and_promo_badge,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__badge-container{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container{display:flex;padding:8px 12px;background-color:#fff;border-radius:100px;width:auto;height:auto;box-sizing:border-box}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__top .mealz-recipe-card__content .mealz-recipe-card__sponsor-container .mealz-recipe-card__sponsor-picture{width:auto;height:auto;max-width:80px;max-height:40px;object-fit:contain}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom{display:flex;width:100%;height:var(--mealz-bottom-height, 64px);flex-direction:column;align-items:flex-start;justify-content:center;box-sizing:border-box;padding:var(--mealz-bottom-padding, 12px);border-radius:0 0 8px 8px;background-color:var(--miam-ds-color-neutral-white, #FFF);border-right:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-bottom:1px solid var(--miam-ds-color-neutral-200, #D9DDE1);border-left:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions{position:relative;display:flex;justify-content:space-between;align-items:center;align-self:stretch}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion{display:inherit;position:absolute;bottom:40px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion .mealz-recipe-promotion-badge{align-items:center;padding:4px 8px;gap:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price-and-promotion .mealz-recipe-card__bottom-promotion .mealz-recipe-promotion-badge .mealz-recipe-promotion-badge__icon{width:16px;height:16px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{display:flex;flex-direction:row;gap:16px;align-items:center}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card__cta-button{padding:var(--mealz-cta-button-padding, 12px 16px)}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta .mealz-recipe-card-cta{padding:8px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time{display:flex;flex-direction:row;color:var(--miam-ds-color-text-disabled, #8C96A2);gap:12px;margin-bottom:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time{display:flex}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__difficulty img,.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__difficulty-and-time .mealz-recipe-card__time img{margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__price{color:var(--miam-ds-color-primary-500, #24748F);line-height:100%;margin-right:4px}.mealz-recipe-card .mealz-recipe-card__container .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__actions__replace{display:flex;flex:1;justify-content:space-between;align-items:center}.mealz-recipe-card.variant-4{width:100%;height:272px}@media (max-width: 480px){.mealz-recipe-card.variant-4{height:224px}}.mealz-recipe-card.horizontal{border:1px solid var(--miam-ds-color-neutral-200, #D9DDE1)}.mealz-recipe-card.horizontal .mealz-recipe-card__top{flex:inherit;height:inherit;width:50%}.mealz-recipe-card.horizontal .mealz-recipe-card__top .mealz-recipe-card__gradient{display:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom{height:inherit;justify-content:space-between;border:none}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions{flex-wrap:wrap}.mealz-recipe-card.horizontal .mealz-recipe-card__bottom .mealz-recipe-card__actions .mealz-recipe-card__cta{flex:1;justify-content:flex-end}.mealz-recipe-card.horizontal.variant-3 .mealz-recipe-card__content .mealz-recipe-card__top-container{flex-direction:inherit}.mealz-recipe-card.horizontal.variant-2 .mealz-recipe-card__content .mealz-recipe-card__top-container .mealz-recipe-card__actions__icon.hidden{display:inherit}p.miam-ds-text,h1.miam-ds-text,h2.miam-ds-text,h3.miam-ds-text,h4.miam-ds-text{margin:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as k}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as A}from"../assets/no-shadow-element-CaVIVF-o.js";import{a as D,i as P,o as h,c as v,O as l,p as S}from"../assets/OperatorSubscriber-BPZabEAm.js";import{S as j}from"../assets/Subject-CZHNlEkK.js";import{c as z,e as u,i as d,d as C,r as E,f as F,b as
|
|
1
|
+
import{t as k}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as A}from"../assets/no-shadow-element-CaVIVF-o.js";import{a as D,i as P,o as h,c as v,O as l,p as S}from"../assets/OperatorSubscriber-BPZabEAm.js";import{S as j}from"../assets/Subject-CZHNlEkK.js";import{c as z,e as u,i as d,d as C,r as E,f as F,b as N,g as V,h as q,j as M,k as R,l as B,a as J}from"../assets/mapOneOrManyArgs-2FiDGdaS.js";var W=function(e){D(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,a=n._value;if(r)throw i;return this._throwIfClosed(),a},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(j);function b(e){return e[e.length-1]}function $(e){return P(b(e))?e.pop():void 0}function G(e){return z(b(e))?e.pop():void 0}function O(e,t){return t===void 0&&(t=0),h(function(n,r){n.subscribe(v(r,function(i){return u(r,e,function(){return r.next(i)},t)},function(){return u(r,e,function(){return r.complete()},t)},function(i){return u(r,e,function(){return r.error(i)},t)}))})}function w(e,t){return t===void 0&&(t=0),h(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function H(e,t){return d(e).pipe(w(t),O(t))}function K(e,t){return d(e).pipe(w(t),O(t))}function T(e,t){return new l(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function U(e,t){return new l(function(n){var r;return u(n,t,function(){r=e[C](),u(n,t,function(){var i,a,c;try{i=r.next(),a=i.value,c=i.done}catch(o){n.error(o);return}c?n.complete():n.next(a)},0,!0)}),function(){return P(r==null?void 0:r.return)&&r.return()}})}function _(e,t){if(!e)throw new Error("Iterable cannot be null");return new l(function(n){u(n,t,function(){var r=e[Symbol.asyncIterator]();u(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Q(e,t){return _(E(e),t)}function X(e,t){if(e!=null){if(F(e))return H(e,t);if(N(e))return T(e,t);if(V(e))return K(e,t);if(q(e))return _(e,t);if(M(e))return U(e,t);if(R(e))return Q(e,t)}throw B(e)}function I(e,t){return t?X(e,t):d(e)}var Y=Array.isArray,Z=Object.getPrototypeOf,ee=Object.prototype,te=Object.keys;function re(e){if(e.length===1){var t=e[0];if(Y(t))return{args:t,keys:null};if(ne(t)){var n=te(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function ne(e){return e&&typeof e=="object"&&Z(e)===ee}function ie(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function ae(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=G(e),r=$(e),i=re(e),a=i.args,c=i.keys;if(a.length===0)return I([],n);var o=new l(ce(a,n,c?function(s){return ie(c,s)}:S));return r?o.pipe(J(r)):o}function ce(e,t,n){return n===void 0&&(n=S),function(r){y(t,function(){for(var i=e.length,a=new Array(i),c=i,o=i,s=function(m){y(t,function(){var x=I(e[m],t),g=!1;x.subscribe(v(r,function(L){a[m]=L,g||(g=!0,o--),o||r.next(n(a.slice()))},function(){--c||r.complete()}))},r)},p=0;p<i;p++)s(p)},r)}}function y(e,t,n){e?u(n,e,t):t()}function oe(e){return h(function(t,n){var r=!1,i=0;t.subscribe(v(n,function(a){return(r||(r=!e(a,i++)))&&n.next(a)}))})}var se=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,le=(e,t,n,r)=>{for(var i=r>1?void 0:r?ue(t,n):t,a=e.length-1,c;a>=0;a--)(c=e[a])&&(i=(r?c(t,n,i):c(i))||i);return r&&i&&se(t,n,i),i};let f=class extends A{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new W(!1),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests)}),ae([this.rendered,window.mealzInternal.basket.recipePricesInBasket$()]).pipe(oe(([e,t])=>!e||!t)).subscribe(([e,t])=>{this.recipePricingValue=t.find(r=>r.id===this.recipeId);const n=this.recipePricingValue?(this.recipePricingValue.price/this.serves).toString():this.pricePerServe;this.applyCurrencyDisplay(n),this.showPrice()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}fetchPrice(e,t,n){var c,o;let r=(c=this.recipePricing)==null?void 0:c.querySelector(".mealz-recipe-pricing__wrapper");const i=(o=this.attributes["starting-data"])==null?void 0:o.value;if(!i){r==null||r.classList.replace("active","hidden");return}const a=JSON.parse(i);this.removeAttribute("starting-data"),!(a.pricePerServe!==null||a.inBasket)&&(r==null||r.classList.replace("active","hidden"),this.subscriptions.push(window.mealzInternal.recipes.fetchPricing(this.recipeId,e,t,n).subscribe(s=>{s!=null&&s.price_per_serve&&(r==null||r.classList.replace("hidden","active"),this.applyCurrencyDisplay(s.price_per_serve))})))}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.rendered.next(!0),this.getInitialStatus())}getInitialStatus(){var i;const e=(i=this.attributes["starting-data"])==null?void 0:i.value;if(!e)return;const{recipeId:t,pricePerServe:n,serves:r}=JSON.parse(e);this.recipeId=t,this.pricePerServe=(n==null?void 0:n.toString())??null,this.serves=r,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const t=parseFloat(e);isNaN(t)||(this.formattedPrice=t.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM())}showPrice(){var n,r;let e=(n=this.recipePricing)==null?void 0:n.querySelector(".mealz-recipe-pricing__loading"),t=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__wrapper");e&&e.classList.contains("active")&&(e.classList.replace("active","hidden"),t.classList.replace("hidden","active"))}updateDOM(){var t;const e=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €")}};f=le([k("mealz-recipe-pricing")],f);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",f);
|