mealz-components 2.0.0-beta.7 → 2.0.0-beta.9
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/add-to-cart-cta/add-to-cart-cta.min.js +1 -1
- package/dist/assets/OperatorSubscriber-z_a6lCKk.js +1 -0
- package/dist/assets/async-H-Co76Oa.js +1 -0
- package/dist/assets/{combineLatest-P4GAEtOW.js → combineLatest-DNi66MsF.js} +1 -1
- package/dist/assets/{debounceTime-Bo5F3ux-.js → debounceTime-CIA2MWDj.js} +1 -1
- package/dist/assets/delay-0L99jHsb.js +1 -0
- package/dist/assets/distinctUntilChanged-Ckq1Syk_.js +1 -0
- package/dist/assets/empty-DGYYDWIm.js +1 -0
- package/dist/assets/executeSchedule-CTqB8mra.js +1 -0
- package/dist/assets/{filter-CEeE8t7I.js → filter-DuHsB8oM.js} +1 -1
- package/dist/assets/{from-jBe2xW5a.js → from-Btz8AgkO.js} +1 -1
- package/dist/assets/http-BGziD2u2.js +1 -0
- package/dist/assets/{innerFrom-CfKCbnvr.js → innerFrom-CVMPVEmB.js} +1 -1
- package/dist/assets/{map-C4rf5Jbc.js → map-oxUcVNGT.js} +1 -1
- package/dist/assets/mapOneOrManyArgs-Do0PsDok.js +1 -0
- package/dist/assets/mealz-sdk-DWLzEfKz.js +1 -0
- package/dist/assets/merge-BlKu2J03.js +1 -0
- package/dist/assets/mergeAll-DQItozZ-.js +1 -0
- package/dist/assets/mergeMap-CMaM5Agw.js +1 -0
- package/dist/assets/no-shadow-element-DlGA0h9b.js +21 -0
- package/dist/assets/{of-BTA69Qgj.js → of-CH-D5SN9.js} +1 -1
- package/dist/assets/price-DcNF55ef.js +1 -0
- package/dist/assets/{product-card-DqcKyf1c.js → product-card-Be_9YL6f.js} +1 -1
- package/dist/assets/{promotion-badge-BwN2GpDz.js → promotion-badge-2uUuiRau.js} +1 -1
- package/dist/assets/{property-leIVgCvV.js → property-Bg80vXcm.js} +1 -1
- package/dist/assets/session-handler-BiuedJFx.js +1 -0
- package/dist/assets/{skipWhile-DuMEda_n.js → skipWhile-BAgfjfH2.js} +1 -1
- package/dist/assets/{state-CccUMzBZ.js → state-bsKs-Mb2.js} +1 -1
- package/dist/assets/{store-locator-Crx8huGH.js → store-locator-CKwiyckb.js} +1 -1
- package/dist/assets/{switchMap-D8q0hRYH.js → switchMap-vA0vSKy4.js} +1 -1
- package/dist/assets/{take-DO4w5a1Y.js → take-BmqRVy-3.js} +1 -1
- package/dist/assets/tap-C4xC1M3N.js +1 -0
- package/dist/assets/{timer-BOl4bYNY.js → timer-DmQ_oP6s.js} +1 -1
- package/dist/assets/{unsafe-html-CmALAWuN.js → unsafe-html-MRC87lfr.js} +1 -1
- package/dist/assets/{viewport-listener-RTCBatPv.js → viewport-listener-BuonFDBs.js} +1 -1
- package/dist/basket-transfer-modal/basket-transfer-modal.min.js +1 -1
- package/dist/catalog/basket-preview/basket-preview.min.js +3 -3
- 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-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 +2 -2
- package/dist/drawer-view-swapper/drawer-view-swapper.min.js +1 -1
- 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 +6 -6
- package/dist/onboarding/analytics/onboarding-analytics.min.js +1 -0
- package/dist/onboarding/events.min.js +1 -0
- package/dist/onboarding/onboarding.css +1 -1
- package/dist/onboarding/onboarding.min.js +2 -2
- package/dist/order-again/order-again.min.js +1 -1
- package/dist/planner/helpers/open-onboarding-modal.min.js +1 -0
- package/dist/planner/planner-abandon-modal/planner-abandon-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 +2 -2
- package/dist/planner/planner-current-menu/planner-current-menu.css +1 -1
- package/dist/planner/planner-current-menu/planner-current-menu.min.js +1 -1
- package/dist/planner/planner-current-menu-modal/planner-current-menu-modal.min.js +2 -2
- package/dist/planner/planner-dashboard/planner-dashboard.css +1 -1
- package/dist/planner/planner-dashboard/planner-dashboard.min.js +1 -1
- package/dist/planner/planner-form/planner-form.min.js +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.css +1 -1
- package/dist/planner/planner-onboarding-modal/planner-onboarding-modal.min.js +8 -8
- package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +2 -2
- package/dist/planner/planner-recipe-card/planner-recipe-card.min.js +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.min.js +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.min.js +1 -1
- package/dist/planner/planner-welcome-modal/planner-welcome-modal.min.js +2 -2
- package/dist/planner/to-basket-loader/to-basket-loader.min.js +1 -1
- package/dist/preferences/preferences.min.js +1 -1
- package/dist/price/price.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 +112 -112
- package/dist/recipe-pricing/recipe-pricing.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 +4 -4
- package/dist/replace-item-planner/replace-item-planner.min.js +2 -2
- package/dist/slider-tabs/slider-tabs.min.js +1 -1
- package/dist/store-indicator/store-indicator.min.js +2 -2
- package/dist/store-locator-drawer/store-locator-drawer.min.js +1 -1
- package/package.json +1 -1
- package/dist/assets/OperatorSubscriber-EGuECN6g.js +0 -1
- package/dist/assets/async-D3oCs_PQ.js +0 -1
- package/dist/assets/delay-ILvLVH1b.js +0 -1
- package/dist/assets/distinctUntilChanged-BkBiB4M3.js +0 -1
- package/dist/assets/empty-Cv-4tfKR.js +0 -1
- package/dist/assets/executeSchedule-DfyZaGAH.js +0 -1
- package/dist/assets/http-aOzufNsj.js +0 -1
- package/dist/assets/mapOneOrManyArgs-DNd_tswl.js +0 -1
- package/dist/assets/merge-C-u9uFzU.js +0 -1
- package/dist/assets/mergeMap-buGewtOo.js +0 -1
- package/dist/assets/no-shadow-element-l9trQfcI.js +0 -21
- package/dist/assets/price-BoM226Kw.js +0 -1
- package/dist/assets/recipe-BwGs-blm.js +0 -1
- package/dist/assets/session-handler-BnuvphmJ.js +0 -1
- package/dist/assets/tap-BCGrRktL.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as o}from"../assets/custom-element-BhZVzxrc.js";import{N as d}from"../assets/no-shadow-element-
|
|
1
|
+
import{t as o}from"../assets/custom-element-BhZVzxrc.js";import{N as d}from"../assets/no-shadow-element-DlGA0h9b.js";import"../assets/mealz-sdk-DWLzEfKz.js";var h=Object.getOwnPropertyDescriptor,l=(t,s,a,e)=>{for(var i=e>1?void 0:e?h(s,a):s,n=t.length-1,c;n>=0;n--)(c=t[n])&&(i=c(i)||i);return i};let r=class extends d{constructor(){super(...arguments),this.inBasket=!1,this.showFixedButton=!1,this.recipeId="",this.inBasketContent=`
|
|
2
2
|
<img alt="see ingredients in icon" src="https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg"/>
|
|
3
3
|
<span>Voir les ingrédients</span>
|
|
4
4
|
`,this.addToBasketContent=`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as b,_ as h,p as f}from"./no-shadow-element-DlGA0h9b.js";function p(r){return b(r==null?void 0:r.lift)}function d(r){return function(i){if(p(i))return i.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function _(r,i,t,n,c){return new y(r,i,t,n,c)}var y=function(r){h(i,r);function i(t,n,c,u,a,l){var e=r.call(this,t)||this;return e.onFinalize=a,e.shouldUnsubscribe=l,e._next=n?function(o){try{n(o)}catch(s){t.error(s)}}:r.prototype._next,e._error=u?function(o){try{u(o)}catch(s){t.error(s)}finally{this.unsubscribe()}}:r.prototype._error,e._complete=c?function(){try{c()}catch(o){t.error(o)}finally{this.unsubscribe()}}:r.prototype._complete,e}return i.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},i}(f);export{_ as c,d as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as u,S as l,a as d,b as f,c as v}from"./no-shadow-element-DlGA0h9b.js";var a={now:function(){return(a.delegate||Date).now()},delegate:void 0},p=function(n){u(i,n);function i(e,t){return n.call(this)||this}return i.prototype.schedule=function(e,t){return this},i}(l),h={setInterval:function(n,i){for(var e=[],t=2;t<arguments.length;t++)e[t-2]=arguments[t];return setInterval.apply(void 0,d([n,i],f(e)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},y=function(n){u(i,n);function i(e,t){var r=n.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}return i.prototype.schedule=function(e,t){var r;if(t===void 0&&(t=0),this.closed)return this;this.state=e;var s=this.id,c=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(c,s,t)),this.pending=!0,this.delay=t,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(c,this.id,t),this},i.prototype.requestAsyncId=function(e,t,r){return r===void 0&&(r=0),h.setInterval(e.flush.bind(e,this),r)},i.prototype.recycleAsyncId=function(e,t,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return t;t!=null&&h.clearInterval(t)},i.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},i.prototype._execute=function(e,t){var r=!1,s;try{this.work(e)}catch(c){r=!0,s=c||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),s},i.prototype.unsubscribe=function(){if(!this.closed){var e=this,t=e.id,r=e.scheduler,s=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,v(s,this),t!=null&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},i}(p),o=function(){function n(i,e){e===void 0&&(e=n.now),this.schedulerActionCtor=i,this.now=e}return n.prototype.schedule=function(i,e,t){return e===void 0&&(e=0),new this.schedulerActionCtor(this,i).schedule(t,e)},n.now=a.now,n}(),A=function(n){u(i,n);function i(e,t){t===void 0&&(t=o.now);var r=n.call(this,e,t)||this;return r.actions=[],r._active=!1,r}return i.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}},i}(o),g=new A(y),b=g;export{g as a,b,a as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O,
|
|
1
|
+
import{O,w as v}from"./no-shadow-element-DlGA0h9b.js";import{p as b,b as h,f as m}from"./from-Btz8AgkO.js";import{m as A}from"./mapOneOrManyArgs-Do0PsDok.js";import{c as S}from"./OperatorSubscriber-z_a6lCKk.js";import{e as j}from"./executeSchedule-CTqB8mra.js";var k=Array.isArray,d=Object.getPrototypeOf,P=Object.prototype,w=Object.keys;function x(r){if(r.length===1){var e=r[0];if(k(e))return{args:e,keys:null};if(F(e)){var t=w(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}function F(r){return r&&typeof r=="object"&&d(r)===P}function L(r,e){return r.reduce(function(t,n,a){return t[n]=e[a],t},{})}function q(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=b(r),n=h(r),a=x(r),o=a.args,c=a.keys;if(o.length===0)return m([],t);var u=new O(V(o,t,c?function(i){return L(c,i)}:v));return n?u.pipe(A(n)):u}function V(r,e,t){return t===void 0&&(t=v),function(n){l(e,function(){for(var a=r.length,o=new Array(a),c=a,u=a,i=function(s){l(e,function(){var y=m(r[s],e),p=!1;y.subscribe(S(n,function(g){o[s]=g,p||(p=!0,u--),u||n.next(t(o.slice()))},function(){--c||n.complete()}))},n)},f=0;f<a;f++)i(f)},n)}}function l(r,e,t){r?j(t,r,e):e()}export{x as a,L as b,q as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./async-
|
|
1
|
+
import{a as d}from"./async-H-Co76Oa.js";import{o as m,c as v}from"./OperatorSubscriber-z_a6lCKk.js";function w(o,a){return a===void 0&&(a=d),m(function(r,e){var n=null,i=null,u=null,l=function(){if(n){n.unsubscribe(),n=null;var t=i;i=null,e.next(t)}};function c(){var t=u+o,f=a.now();if(f<t){n=this.schedule(void 0,t-f),e.add(n);return}l()}r.subscribe(v(e,function(t){i=t,u=a.now(),n||(n=a.schedule(c,o),e.add(n))},function(){l(),e.complete()},void 0,function(){i=n=null}))})}export{w as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./async-H-Co76Oa.js";import{t as m}from"./take-BmqRVy-3.js";import{m as a}from"./map-oxUcVNGT.js";import{m as e}from"./mergeMap-CMaM5Agw.js";import{i as f}from"./innerFrom-CVMPVEmB.js";import{t as p}from"./timer-DmQ_oP6s.js";function u(r){return a(function(){return r})}function s(r,t){return e(function(n,o){return f(r(n,o)).pipe(m(1),u(n))})}function l(r,t){t===void 0&&(t=i);var n=p(r,t);return s(function(){return n})}export{l as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as d}from"./no-shadow-element-DlGA0h9b.js";import{o,c as a}from"./OperatorSubscriber-z_a6lCKk.js";function b(i,n){return n===void 0&&(n=d),i=i??v,o(function(s,t){var e,r=!0;s.subscribe(a(t,function(f){var u=n(f);(r||!i(e,u))&&(r=!1,e=u,t.next(f))}))})}function v(i,n){return i===n}export{b as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as r}from"./no-shadow-element-DlGA0h9b.js";var t=new r(function(e){return e.complete()});export{t as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d}from"./no-shadow-element-DlGA0h9b.js";function o(i){return i&&d(i.schedule)}function h(i,e,n,s,u){s===void 0&&(s=0),u===void 0&&(u=!1);var c=e.schedule(function(){n(),u?i.add(this.schedule(null,s)):this.unsubscribe()},s);if(i.add(c),!u)return c}export{h as e,o as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as c,c as i}from"./OperatorSubscriber-
|
|
1
|
+
import{o as c,c as i}from"./OperatorSubscriber-z_a6lCKk.js";function u(e,n){return c(function(o,r){var a=0;o.subscribe(i(r,function(t){return e.call(n,t,a++)&&r.next(t)}))})}export{u as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as m,O as f}from"./no-shadow-element-DlGA0h9b.js";import{i as S,e as a}from"./executeSchedule-CTqB8mra.js";import{i,b as x,r as I,c as O,a as w,d as A,e as k,f as y,g as L,h as R}from"./innerFrom-CVMPVEmB.js";import{o as v,c as E}from"./OperatorSubscriber-z_a6lCKk.js";function u(e){return e[e.length-1]}function z(e){return m(u(e))?e.pop():void 0}function B(e){return S(u(e))?e.pop():void 0}function C(e,n){return typeof u(e)=="number"?e.pop():n}function d(e,n){return n===void 0&&(n=0),v(function(r,t){r.subscribe(E(t,function(o){return a(t,e,function(){return t.next(o)},n)},function(){return a(t,e,function(){return t.complete()},n)},function(o){return a(t,e,function(){return t.error(o)},n)}))})}function p(e,n){return n===void 0&&(n=0),v(function(r,t){t.add(e.schedule(function(){return r.subscribe(t)},n))})}function F(e,n){return i(e).pipe(p(n),d(n))}function P(e,n){return i(e).pipe(p(n),d(n))}function T(e,n){return new f(function(r){var t=0;return n.schedule(function(){t===e.length?r.complete():(r.next(e[t++]),r.closed||this.schedule())})})}function G(e,n){return new f(function(r){var t;return a(r,n,function(){t=e[x](),a(r,n,function(){var o,c,l;try{o=t.next(),c=o.value,l=o.done}catch(h){r.error(h);return}l?r.complete():r.next(c)},0,!0)}),function(){return m(t==null?void 0:t.return)&&t.return()}})}function s(e,n){if(!e)throw new Error("Iterable cannot be null");return new f(function(r){a(r,n,function(){var t=e[Symbol.asyncIterator]();a(r,n,function(){t.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}function N(e,n){return s(I(e),n)}function _(e,n){if(e!=null){if(O(e))return F(e,n);if(w(e))return T(e,n);if(A(e))return P(e,n);if(k(e))return s(e,n);if(y(e))return G(e,n);if(L(e))return N(e,n)}throw R(e)}function D(e,n){return n?_(e,n):i(e)}export{C as a,z as b,D as f,B as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as s}from"./mealz-sdk-DWLzEfKz.js";function i(t){const e={"language-id":s.user.getLanguage(),"supplier-token":s.supplier.getToken(),"session-id":t},a=localStorage.getItem("_miam/userId");return a?e.authorization=`user_id ${a}`:e["authless-id"]=localStorage.getItem("_miam/authlessId"),e}export{i as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as l,o as d,e as m,g as v,j as i,O as u,r as h,l as w,m as I,n as S}from"./no-shadow-element-DlGA0h9b.js";var g=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function A(e){return l(e==null?void 0:e.then)}function k(e){return l(e[d])}function x(e){return Symbol.asyncIterator&&l(e==null?void 0:e[Symbol.asyncIterator])}function L(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function O(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var b=O();function p(e){return l(e==null?void 0:e[b])}function R(e){return m(this,arguments,function(){var r,a,o,s;return v(this,function(t){switch(t.label){case 0:r=e.getReader(),t.label=1;case 1:t.trys.push([1,,9,10]),t.label=2;case 2:return[4,i(r.read())];case 3:return a=t.sent(),o=a.value,s=a.done,s?[4,i(void 0)]:[3,5];case 4:return[2,t.sent()];case 5:return[4,i(o)];case 6:return[4,t.sent()];case 7:return t.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function T(e){return l(e==null?void 0:e.getReader)}function j(e){if(e instanceof u)return e;if(e!=null){if(k(e))return E(e);if(g(e))return P(e);if(A(e))return G(e);if(x(e))return y(e);if(p(e))return F(e);if(T(e))return Y(e)}throw L(e)}function E(e){return new u(function(n){var r=e[d]();if(l(r.subscribe))return r.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function P(e){return new u(function(n){for(var r=0;r<e.length&&!n.closed;r++)n.next(e[r]);n.complete()})}function G(e){return new u(function(n){e.then(function(r){n.closed||(n.next(r),n.complete())},function(r){return n.error(r)}).then(null,h)})}function F(e){return new u(function(n){var r,a;try{for(var o=w(e),s=o.next();!s.done;s=o.next()){var t=s.value;if(n.next(t),n.closed)return}}catch(f){r={error:f}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}n.complete()})}function y(e){return new u(function(n){U(e,n).catch(function(r){return n.error(r)})})}function Y(e){return y(R(e))}function U(e,n){var r,a,o,s;return I(this,void 0,void 0,function(){var t,f;return v(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=S(e),c.label=1;case 1:return[4,r.next()];case 2:if(a=c.sent(),!!a.done)return[3,4];if(t=a.value,n.next(t),n.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=c.sent(),o={error:f},[3,11];case 6:return c.trys.push([6,,9,10]),a&&!a.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}export{g as a,b,k as c,A as d,x as e,p as f,T as g,L as h,j as i,R as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as c,c as i}from"./OperatorSubscriber-
|
|
1
|
+
import{o as c,c as i}from"./OperatorSubscriber-z_a6lCKk.js";function u(e,t){return c(function(a,r){var n=0;a.subscribe(i(r,function(o){r.next(e.call(t,o,n++))}))})}export{u as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as p}from"./no-shadow-element-DlGA0h9b.js";import{m as o}from"./map-oxUcVNGT.js";var t=Array.isArray;function i(a,r){return t(r)?a.apply(void 0,n([],p(r))):a(r)}function y(a){return o(function(r){return i(a,r)})}export{y as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>typeof window<"u"?window.mealzV10?window.mealzV10:window.mealz?window.mealz:null:null,l=()=>typeof window<"u"?window.mealzInternalV10?window.mealzInternalV10:window.mealzInternal?window.mealzInternal:null:null,u=new Proxy({},{get(e,n){const t=o();return t?t[n]:void 0},set(e,n,t){const r=o();return r?(r[n]=t,!0):!1}}),w=new Proxy({},{get(e,n){const t=l();return t?t[n]:void 0},set(e,n,t){const r=l();return r?(r[n]=t,!0):!1}}),i=()=>{const e=l();return!!(e!=null&&e.pos&&e.supplier&&e.recipes&&e.replaceItem&&e.basket&&e.planner)},d=()=>new Promise((e,n)=>{let t=0;const r=200,a=50,s=()=>{t++,i()?e():t>=r?n(new Error(`MealzInternal SDK not available after ${r} attempts (${r*a}ms)`)):setTimeout(s,a)};s()});export{u as a,w as m,d as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as n}from"./mergeAll-DQItozZ-.js";import{i as t}from"./innerFrom-CVMPVEmB.js";import{E as s}from"./empty-DGYYDWIm.js";import{p,a as f,f as u}from"./from-Btz8AgkO.js";function h(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=p(r),a=f(r,1/0),m=r;return m.length?m.length===1?t(m[0]):n(a)(u(m,o)):s}export{h as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m}from"./mergeMap-CMaM5Agw.js";import{w as t}from"./no-shadow-element-DlGA0h9b.js";function o(i){return i===void 0&&(i=1/0),m(t,i)}export{o as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as C}from"./map-oxUcVNGT.js";import{i as x}from"./innerFrom-CVMPVEmB.js";import{c as h,o as F}from"./OperatorSubscriber-z_a6lCKk.js";import"./executeSchedule-CTqB8mra.js";import{d as I}from"./no-shadow-element-DlGA0h9b.js";function b(f,e,n,i,t,d,u,k){var o=[],r=0,g=0,v=!1,c=function(){v&&!o.length&&!r&&e.complete()},y=function(a){return r<i?s(a):o.push(a)},s=function(a){r++;var l=!1;x(n(a,g++)).subscribe(h(e,function(m){e.next(m)},function(){l=!0},void 0,function(){if(l)try{r--;for(var m=function(){var p=o.shift();u||s(p)};o.length&&r<i;)m();c()}catch(p){e.error(p)}}))};return f.subscribe(h(e,y,function(){v=!0,c()})),function(){}}function N(f,e,n){return n===void 0&&(n=1/0),I(e)?N(function(i,t){return C(function(d,u){return e(i,d,t,u)})(x(f(i,t)))},n):(typeof e=="number"&&(n=e),F(function(i,t){return b(i,t,f,n)}))}export{N as m};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{m as nt}from"./mealz-sdk-DWLzEfKz.js";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const H=globalThis,tt=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol(),st=new WeakMap;let $t=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==et)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(tt&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=st.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&st.set(e,t))}return t}toString(){return this.cssText}};const It=n=>new $t(typeof n=="string"?n:n+"",void 0,et),pe=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((r,s,i)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[i+1],n[0]);return new $t(e,n,et)},jt=(n,t)=>{if(tt)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const r=document.createElement("style"),s=H.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,n.appendChild(r)}},it=tt?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return It(e)})(n):n;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:kt,defineProperty:Mt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Lt,getOwnPropertySymbols:Nt,getPrototypeOf:zt}=Object,m=globalThis,ot=m.trustedTypes,Bt=ot?ot.emptyScript:"",q=m.reactiveElementPolyfillSupport,O=(n,t)=>n,Y={toAttribute(n,t){switch(t){case Boolean:n=n?Bt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},gt=(n,t)=>!kt(n,t),at={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:gt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=at){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Mt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){const{get:s,set:i}=Ht(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const c=s==null?void 0:s.call(this);i.call(this,o),this.requestUpdate(t,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??at}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=zt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(O("properties"))){const e=this.properties,r=[...Lt(e),...Nt(e)];for(const s of r)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const s of r)e.unshift(it(s))}else t!==void 0&&e.push(it(t));return e}static _$Eu(t,e){const r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostConnected)==null?void 0:r.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){var i;const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){const o=(((i=r.converter)==null?void 0:i.toAttribute)!==void 0?r.converter:Y).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var i;const r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=r.getPropertyOptions(s),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:Y;this._$Em=s,this[s]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){if(r??(r=this.constructor.getPropertyOptions(t)),!(r.hasChanged??gt)(this[t],e))return;this.P(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,r){this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostUpdate)==null?void 0:i.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[O("elementProperties")]=new Map,A[O("finalized")]=new Map,q==null||q({ReactiveElement:A}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");var G=function(n,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])},G(n,t)};function k(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");G(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function de(n,t,e,r){function s(i){return i instanceof e?i:new e(function(o){o(i)})}return new(e||(e=Promise))(function(i,o){function c(f){try{l(r.next(f))}catch(u){o(u)}}function a(f){try{l(r.throw(f))}catch(u){o(u)}}function l(f){f.done?i(f.value):s(f.value).then(c,a)}l((r=r.apply(n,t||[])).next())})}function ye(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(l){return function(f){return a([l,f])}}function a(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(r=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,s=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){e.label=l[1];break}if(l[0]===6&&e.label<i[1]){e.label=i[1],i=l;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(l);break}i[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(f){l=[6,f],s=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function T(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function K(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var r=e.call(n),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(c){o={error:c}}finally{try{s&&!s.done&&(e=r.return)&&e.call(r)}finally{if(o)throw o.error}}return i}function Z(n,t,e){if(e||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return n.concat(i||Array.prototype.slice.call(t))}function J(n){return this instanceof J?(this.v=n,this):new J(n)}function ve(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(n,t||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(v){return Promise.resolve(v).then(h,u)}}function c(h,v){r[h]&&(s[h]=function(y){return new Promise(function(Tt,Rt){i.push([h,y,Tt,Rt])>1||a(h,y)})},v&&(s[h]=v(s[h])))}function a(h,v){try{l(r[h](v))}catch(y){d(i[0][3],y)}}function l(h){h.value instanceof J?Promise.resolve(h.value.v).then(f,u):d(i[0][2],h)}function f(h){a("next",h)}function u(h){a("throw",h)}function d(h,v){h(v),i.shift(),i.length&&a(i[0][0],i[0][1])}}function be(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof T=="function"?T(n):n[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(i){e[i]=n[i]&&function(o){return new Promise(function(c,a){o=n[i](o),s(c,a,o.done,o.value)})}}function s(i,o,c,a){Promise.resolve(a).then(function(l){i({value:l,done:c})},o)}}function b(n){return typeof n=="function"}function St(n){var t=function(r){Error.call(r),r.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var V=St(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
10
|
+
`+e.map(function(r,s){return s+1+") "+r.toString()}).join(`
|
|
11
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function Q(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var z=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var c=T(o),a=c.next();!a.done;a=c.next()){var l=a.value;l.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(b(f))try{f()}catch(y){i=y instanceof V?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=T(u),h=d.next();!h.done;h=d.next()){var v=h.value;try{lt(v)}catch(y){i=i??[],y instanceof V?i=Z(Z([],K(i)),K(y.errors)):i.push(y)}}}catch(y){r={error:y}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new V(i)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)lt(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Q(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&Q(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),At=z.EMPTY;function Et(n){return n instanceof z||n&&"closed"in n&&b(n.remove)&&b(n.add)&&b(n.unsubscribe)}function lt(n){b(n)?n():n.unsubscribe()}var qt={Promise:void 0},Vt={setTimeout:function(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setTimeout.apply(void 0,Z([n,t],K(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Dt(n){Vt.setTimeout(function(){throw n})}function ct(){}function L(n){n()}var wt=function(n){k(t,n);function t(e){var r=n.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Et(e)&&e.add(r)):r.destination=Yt,r}return t.create=function(e,r,s){return new X(e,r,s)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(z),Wt=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){M(r)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){M(r)}else M(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){M(e)}},n}(),X=function(n){k(t,n);function t(e,r,s){var i=n.call(this)||this,o;return b(e)||!e?o={next:e??void 0,error:r??void 0,complete:s??void 0}:o=e,i.destination=new Wt(o),i}return t}(wt);function M(n){Dt(n)}function Ft(n){throw n}var Yt={closed:!0,next:ct,error:Ft,complete:ct},Gt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Kt(n){return n}function Zt(n){return n.length===0?Kt:n.length===1?n[0]:function(e){return n.reduce(function(r,s){return s(r)},e)}}var ht=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,r){var s=this,i=Qt(t)?t:new X(t,e,r);return L(function(){var o=s,c=o.operator,a=o.source;i.add(c?c.call(i,a):a?s._subscribe(i):s._trySubscribe(i))}),i},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var r=this;return e=ut(e),new e(function(s,i){var o=new X({next:function(c){try{t(c)}catch(a){i(a),o.unsubscribe()}},error:i,complete:s});r.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[Gt]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zt(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=ut(t),new t(function(r,s){var i;e.subscribe(function(o){return i=o},function(o){return s(o)},function(){return r(i)})})},n.create=function(t){return new n(t)},n}();function ut(n){var t;return(t=n??qt.Promise)!==null&&t!==void 0?t:Promise}function Jt(n){return n&&b(n.next)&&b(n.error)&&b(n.complete)}function Qt(n){return n&&n instanceof wt||Jt(n)&&Et(n)}var Xt=St(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),xt=function(n){k(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var r=new ft(this,this);return r.operator=e,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new Xt},t.prototype.next=function(e){var r=this;L(function(){var s,i;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=T(r.currentObservers),c=o.next();!c.done;c=o.next()){var a=c.value;a.next(e)}}catch(l){s={error:l}}finally{try{c&&!c.done&&(i=o.return)&&i.call(o)}finally{if(s)throw s.error}}}})},t.prototype.error=function(e){var r=this;L(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=e;for(var s=r.observers;s.length;)s.shift().error(e)}})},t.prototype.complete=function(){var e=this;L(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var r=e.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var r=this,s=this,i=s.hasError,o=s.isStopped,c=s.observers;return i||o?At:(this.currentObservers=null,c.push(e),new z(function(){r.currentObservers=null,Q(c,e)}))},t.prototype._checkFinalizedStatuses=function(e){var r=this,s=r.hasError,i=r.thrownError,o=r.isStopped;s?e.error(i):o&&e.complete()},t.prototype.asObservable=function(){var e=new ht;return e.source=this,e},t.create=function(e,r){return new ft(e,r)},t}(ht),ft=function(n){k(t,n);function t(e,r){var s=n.call(this)||this;return s.destination=e,s.source=r,s}return t.prototype.next=function(e){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,e)},t.prototype.error=function(e){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,e)},t.prototype.complete=function(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)},t.prototype._subscribe=function(e){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&s!==void 0?s:At},t}(xt),te=function(n){k(t,n);function t(e){var r=n.call(this)||this;return r._value=e,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var r=n.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},t.prototype.getValue=function(){var e=this,r=e.hasError,s=e.thrownError,i=e._value;if(r)throw s;return this._throwIfClosed(),i},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t}(xt);/**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright 2017 Google LLC
|
|
14
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
+
*/const U=globalThis,N=U.trustedTypes,pt=N?N.createPolicy("lit-html",{createHTML:n=>n}):void 0,Pt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,Ot="?"+_,ee=`<${Ot}>`,S=document,R=()=>S.createComment(""),I=n=>n===null||typeof n!="object"&&typeof n!="function",rt=Array.isArray,re=n=>rt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",D=`[
|
|
16
|
+
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,yt=/>/g,$=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),vt=/'/g,bt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,ne=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),_e=ne(1),E=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),_t=new WeakMap,g=S.createTreeWalker(S,129);function Ct(n,t){if(!rt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return pt!==void 0?pt.createHTML(t):t}const se=(n,t)=>{const e=n.length-1,r=[];let s,i=t===2?"<svg>":t===3?"<math>":"",o=P;for(let c=0;c<e;c++){const a=n[c];let l,f,u=-1,d=0;for(;d<a.length&&(o.lastIndex=d,f=o.exec(a),f!==null);)d=o.lastIndex,o===P?f[1]==="!--"?o=dt:f[1]!==void 0?o=yt:f[2]!==void 0?(Ut.test(f[2])&&(s=RegExp("</"+f[2],"g")),o=$):f[3]!==void 0&&(o=$):o===$?f[0]===">"?(o=s??P,u=-1):f[1]===void 0?u=-2:(u=o.lastIndex-f[2].length,l=f[1],o=f[3]===void 0?$:f[3]==='"'?bt:vt):o===bt||o===vt?o=$:o===dt||o===yt?o=P:(o=$,s=void 0);const h=o===$&&n[c+1].startsWith("/>")?" ":"";i+=o===P?a+ee:u>=0?(r.push(l),a.slice(0,u)+Pt+a.slice(u)+_+h):a+_+(u===-2?c:h)}return[Ct(n,i+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class j{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let i=0,o=0;const c=t.length-1,a=this.parts,[l,f]=se(t,e);if(this.el=j.createElement(l,r),g.currentNode=this.el.content,e===2||e===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=g.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const u of s.getAttributeNames())if(u.endsWith(Pt)){const d=f[o++],h=s.getAttribute(u).split(_),v=/([.?@])?(.*)/.exec(d);a.push({type:1,index:i,name:v[2],strings:h,ctor:v[1]==="."?oe:v[1]==="?"?ae:v[1]==="@"?le:B}),s.removeAttribute(u)}else u.startsWith(_)&&(a.push({type:6,index:i}),s.removeAttribute(u));if(Ut.test(s.tagName)){const u=s.textContent.split(_),d=u.length-1;if(d>0){s.textContent=N?N.emptyScript:"";for(let h=0;h<d;h++)s.append(u[h],R()),g.nextNode(),a.push({type:2,index:++i});s.append(u[d],R())}}}else if(s.nodeType===8)if(s.data===Ot)a.push({type:2,index:i});else{let u=-1;for(;(u=s.data.indexOf(_,u+1))!==-1;)a.push({type:7,index:i}),u+=_.length-1}i++}}static createElement(t,e){const r=S.createElement("template");return r.innerHTML=t,r}}function w(n,t,e=n,r){var o,c;if(t===E)return t;let s=r!==void 0?(o=e.o)==null?void 0:o[r]:e.l;const i=I(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==i&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),i===void 0?s=void 0:(s=new i(n),s._$AT(n,e,r)),r!==void 0?(e.o??(e.o=[]))[r]=s:e.l=s),s!==void 0&&(t=w(n,s._$AS(n,t.values),s,r)),t}class ie{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=((t==null?void 0:t.creationScope)??S).importNode(e,!0);g.currentNode=s;let i=g.nextNode(),o=0,c=0,a=r[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new x(i,i.nextSibling,this,t):a.type===1?l=new a.ctor(i,a.name,a.strings,this,t):a.type===6&&(l=new ce(i,this,t)),this._$AV.push(l),a=r[++c]}o!==(a==null?void 0:a.index)&&(i=g.nextNode(),o++)}return g.currentNode=S,s}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,e,r,s){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this.v=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=w(this,t,e),I(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):re(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=j.createElement(Ct(r.h,r.h[0]),this.options)),r);if(((i=this._$AH)==null?void 0:i._$AD)===s)this._$AH.p(e);else{const o=new ie(s,this),c=o.u(this.options);o.p(e),this.T(c),this._$AH=o}}_$AC(t){let e=_t.get(t.strings);return e===void 0&&_t.set(t.strings,e=new j(t)),e}k(t){rt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,s=0;for(const i of t)s===e.length?e.push(r=new x(this.O(R()),this.O(R()),this,this.options)):r=e[s],r._$AI(i),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}}class B{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,i){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=p}_$AI(t,e=this,r,s){const i=this.strings;let o=!1;if(i===void 0)t=w(this,t,e,0),o=!I(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const c=t;let a,l;for(t=i[0],a=0;a<i.length-1;a++)l=w(this,c[r+a],e,a),l===E&&(l=this._$AH[a]),o||(o=!I(l)||l!==this._$AH[a]),l===p?t=p:t!==p&&(t+=(l??"")+i[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class oe extends B{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class ae extends B{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class le extends B{constructor(t,e,r,s,i){super(t,e,r,s,i),this.type=5}_$AI(t,e=this){if((t=w(this,t,e,0)??p)===E)return;const r=this._$AH,s=t===p&&r!==p||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==p&&(r===p||s);s&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ce{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){w(this,t)}}const me={I:x},W=U.litHtmlPolyfillSupport;W==null||W(j,x),(U.litHtmlVersions??(U.litHtmlVersions=[])).push("3.2.0");const he=(n,t,e)=>{const r=(e==null?void 0:e.renderBefore)??t;let s=r._$litPart$;if(s===void 0){const i=(e==null?void 0:e.renderBefore)??null;r._$litPart$=s=new x(t.insertBefore(R(),i),i,void 0,e??{})}return s._$AI(n),s};/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2017 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/class C extends A{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=he(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return E}}var mt;C._$litElement$=!0,C.finalized=!0,(mt=globalThis.litElementHydrateSupport)==null||mt.call(globalThis,{LitElement:C});const F=globalThis.litElementPolyfillSupport;F==null||F({LitElement:C});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");class $e extends C{constructor(){super(...arguments),this.isMealzInternalReady$=new te(!1),this.elements={}}get selectors(){return{}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.checkMealzInternalStatus(),this.styleURL&&(this.styleURLs=Array.isArray(this.styleURL)?this.styleURL:[this.styleURL]),this.addStyles()}disconnectedCallback(){super.disconnectedCallback(),this.removeStyles()}addStyles(){!this.styleURLs||this.styleURLs.length===0||this.styleURLs.forEach((t,e)=>{const r=`${this.tagName.toLowerCase()}-style-${e}`;if(!document.head.querySelector(`#${r}`)){const i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",t.toString()),i.setAttribute("id",r),document.head.appendChild(i)}})}removeStyles(){!this.styleURLs||this.styleURLs.length===0||setTimeout(()=>{this.styleURLs.forEach((t,e)=>{const r=`${this.tagName.toLowerCase()}-style-${e}`,s=document.head.querySelector(`#${r}`);s&&document.getElementsByTagName(this.tagName).length===0&&document.head.removeChild(s)})},100)}initSelectors(...t){t.length>0?t.forEach(e=>{this.selectors[e]&&(this.elements[e]=Array.isArray(this.selectors[e])?this.querySelectorAll(this.selectors[e][0]):this.querySelector(this.selectors[e]))}):Object.entries(this.selectors).forEach(([e,r])=>{this.elements[e]=Array.isArray(r)?this.querySelectorAll(r[0]):this.querySelector(r)})}addClickListener(t,e){const r=this.elements[t];r&&r.addEventListener("click",()=>{r.classList.contains("disabled")||r.hasAttribute("disabled")||e()})}checkMealzInternalStatus(t=0){var e,r,s,i;if((r=(e=nt)==null?void 0:e.supplier)!=null&&r.getToken()&&((i=(s=nt)==null?void 0:s.user)!=null&&i.getLanguage())){this.isMealzInternalReady$.next(!0);return}else t>50&&console.warn("Unable to find the supplier token or user language. Please verify the configuration."),setTimeout(()=>this.checkMealzInternalStatus(t+1),100)}getBaseURL(){return new URL("..",import.meta.url).toString()}}export{te as B,p as D,$e as N,ht as O,he as Q,E as R,z as S,k as _,Z as a,K as b,Q as c,b as d,ve as e,gt as f,ye as g,C as h,pe as i,J as j,_e as k,T as l,de as m,be as n,Gt as o,wt as p,xt as q,Dt as r,me as s,X as t,Y as u,ct as v,Kt as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as o,f as s}from"./from-
|
|
1
|
+
import{p as o,f as s}from"./from-Btz8AgkO.js";function f(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];var e=o(a);return s(a,e)}export{f as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as s}from"./no-shadow-element-DlGA0h9b.js";import{m as i}from"./mealz-sdk-DWLzEfKz.js";const e=class e{static getInstance(){return e.instances.has(this)||e.instances.set(this,new this),e.instances.get(this)}};e.instances=new Map;let c=e;const u={en:"USD","en-US":"USD","en-GB":"GBP",fr:"EUR","fr-FR":"EUR","fr-CA":"CAD"};class h extends c{initFormatter(){const t=i.user.getLanguage()||"fr",r=u[t]||"EUR";this.formatter=new Intl.NumberFormat(t,{style:"currency",currency:r})}currencySymbol(){const t=i.user.getLanguage()||"fr",r=u[t]||"EUR";return new Intl.NumberFormat(t,{style:"currency",currency:r}).format(0).replace(/[\d.,\s]/g,"")}formatPrice(t){return this.formatter||this.initFormatter(),this.formatter.format(t)}priceTemplate(t,r="price"){let n="",a=s``,o=0;return this.formatter.formatToParts(t).forEach(({type:f,value:m},l)=>{f==="currency"?(o=l,a=s`<span class="mealz-${r}__currency">${m}</span>`):n+=m}),o>0?s`<span class="mealz-${r}__amount">${n}</span>${a}`:s`${a}<span class="mealz-${r}__amount">${n}</span>`}}export{h as P,c as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../price/price.min.js";import"../counter/counter.min.js";import"./promotion-badge-
|
|
1
|
+
import"../price/price.min.js";import"../counter/counter.min.js";import"./promotion-badge-2uUuiRau.js";import{N as h,k as a,q as E,D as z}from"./no-shadow-element-DlGA0h9b.js";import{t as m}from"./custom-element-BhZVzxrc.js";import{n as l}from"./property-Bg80vXcm.js";import{P as k,S as P}from"./price-DcNF55ef.js";import{c as x}from"./capitalize-DUAqYmp4.js";import{m as c}from"./mealz-sdk-DWLzEfKz.js";import{d as I}from"./delay-0L99jHsb.js";var O=Object.defineProperty,C=Object.getOwnPropertyDescriptor,b=(t,s,r,i)=>{for(var e=i>1?void 0:i?C(s,r):s,n=t.length-1,d;n>=0;n--)(d=t[n])&&(e=(i?d(s,r,e):d(e))||e);return i&&e&&O(s,r,e),e};let u=class extends h{constructor(){super(),this.isSponsored=!1,this.priceService=k.getInstance(),this.styleURL=new URL("./product-badges/product-badges.css",this.getBaseURL())}formatNumber(t){const s=c.user.getLanguage()||"fr";return new Intl.NumberFormat(s,{minimumFractionDigits:1,maximumFractionDigits:2}).format(t)}render(){return a`
|
|
2
2
|
<div class="mealz-product-badges">
|
|
3
3
|
<!-- SPONSORED BADGE -->
|
|
4
4
|
${this.isSponsored?a`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as c,k as m}from"./no-shadow-element-
|
|
1
|
+
import{N as c,k as m}from"./no-shadow-element-DlGA0h9b.js";import{t as d}from"./custom-element-BhZVzxrc.js";import{n as l}from"./property-Bg80vXcm.js";import{P as u}from"./price-DcNF55ef.js";var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,o,i,r)=>{for(var t=r>1?void 0:r?f(o,i):o,s=e.length-1,a;s>=0;s--)(a=e[s])&&(t=(r?a(o,i,t):a(t))||t);return r&&t&&g(o,i,t),t};let n=class extends c{constructor(){super(),this.priceService=u.getInstance(),this.styleURL=new URL("./promotion-badge/promotion-badge.css",this.getBaseURL())}getPriceAmountSuffix(){var e;return(e=this.priceData.discountType)!=null&&e.endsWith("_perc")?"%":this.priceService.currencySymbol()}render(){var e;return m`
|
|
2
2
|
<div class="mealz-promotion-badge">
|
|
3
3
|
${((e=this.priceData)==null?void 0:e.discountAmount)>0?m`
|
|
4
4
|
<div class="mealz-ds-badge mealz-promotion-badge__promotion">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as n}from"./mealz-sdk-DWLzEfKz.js";function t(e){e&&n.user.setSessionId(e)}export{t as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o,c as s}from"./OperatorSubscriber-
|
|
1
|
+
import{o,c as s}from"./OperatorSubscriber-z_a6lCKk.js";function f(n){return o(function(a,r){var e=!1,i=0;a.subscribe(s(r,function(t){return(e||(e=!n(t,i++)))&&r.next(t)}))})}export{f as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as h,h as u,
|
|
1
|
+
import{i as h,h as u,k as a}from"./no-shadow-element-DlGA0h9b.js";import{t as m}from"./custom-element-BhZVzxrc.js";import{n as p}from"./property-Bg80vXcm.js";import{r as g}from"./state-bsKs-Mb2.js";import{e as b}from"./query-BApjzB0v.js";import{a as c}from"./mealz-sdk-DWLzEfKz.js";class f{get extId(){return this.attributes["ext-id"]}}var _=Object.defineProperty,x=Object.getOwnPropertyDescriptor,r=(t,e,s,i)=>{for(var o=i>1?void 0:i?x(e,s):e,n=t.length-1,d;n>=0;n--)(d=t[n])&&(o=(i?d(e,s,o):d(o))||o);return i&&o&&_(e,s,o),o};let l=class extends u{constructor(){var t,e,s,i,o,n;super(...arguments),this.selectedRadius=50,this.getByAddress=(e=(t=c)==null?void 0:t.pos)==null?void 0:e.getByAddress,this.getByCoordinates=(i=(s=c)==null?void 0:s.pos)==null?void 0:i.getByCoordinates,this.getAffiliateSuppliers=(n=(o=c)==null?void 0:o.supplier)==null?void 0:n.getAffiliateSuppliers,this._posList=[],this._markers=[],this._searchingPos=!1,this._searchSubmitted=!1,this._previousSearchMethod=()=>{},this._suppliers=[],this._selectedSuppliers=[],this._showPosList=!1,this._posSelected=!1,this.subscriptions=[]}set geolocationCoordinates(t){var e,s;this._geolocationCoordinates=t,(e=t==null?void 0:t.coords)!=null&&e.latitude&&((s=t==null?void 0:t.coords)!=null&&s.longitude)&&this.setGeolocation()}get geolocationCoordinates(){return this._geolocationCoordinates}_nameOfStore(t){return`${t.supplier.attributes.name} - ${t.attributes.name}`}connectedCallback(){super.connectedCallback(),this.initLeaflet(),this.fetchSuppliers(),this.initEvents()}disconnectedCallback(){this.subscriptions.forEach(t=>t.unsubscribe()),super.disconnectedCallback(),this._leafletCss.remove(),this._miamDs.remove(),this._leafletJs.remove()}render(){if(this.show)return this.posSelectionTemplate()}firstUpdated(){this._posSelected=!1,this.loadMap(),this.geolocationTimeout(),this.listenFormSubmit()}posSelectionTemplate(){return a`
|
|
2
2
|
<div class="wrapper mealz-ds-body">
|
|
3
3
|
<div class="pos-selection">
|
|
4
4
|
<div class="title">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as v}from"./innerFrom-
|
|
1
|
+
import{i as v}from"./innerFrom-CVMPVEmB.js";import{o as l,c as a}from"./OperatorSubscriber-z_a6lCKk.js";function b(f,e){return l(function(p,r){var n=null,s=0,o=!1,t=function(){return o&&!n&&r.complete()};p.subscribe(a(r,function(i){n==null||n.unsubscribe();var m=0,u=s++;v(f(i,u)).subscribe(n=a(r,function(c){return r.next(e?e(i,c,u,m++):c)},function(){n=null,t()}))},function(){o=!0,t()}))})}export{b as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as a}from"./empty-
|
|
1
|
+
import{E as a}from"./empty-DGYYDWIm.js";import{o as f,c as i}from"./OperatorSubscriber-z_a6lCKk.js";function m(e){return e<=0?function(){return a}:f(function(o,t){var r=0;o.subscribe(i(t,function(n){++r<=e&&(t.next(n),e<=r&&t.complete())}))})}export{m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e,d}from"./no-shadow-element-DlGA0h9b.js";import{o as f,c as s}from"./OperatorSubscriber-z_a6lCKk.js";function _(n,r,u){var a=d(n)||r||u?{next:n,error:r,complete:u}:n;return a?f(function(v,l){var t;(t=a.subscribe)===null||t===void 0||t.call(a);var c=!0;v.subscribe(s(l,function(i){var o;(o=a.next)===null||o===void 0||o.call(a,i),l.next(i)},function(){var i;c=!1,(i=a.complete)===null||i===void 0||i.call(a),l.complete()},function(i){var o;c=!1,(o=a.error)===null||o===void 0||o.call(a,i),l.error(i)},function(){var i,o;c&&((i=a.unsubscribe)===null||i===void 0||i.call(a)),(o=a.finalize)===null||o===void 0||o.call(a)}))}):e}export{_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as p}from"./no-shadow-element-
|
|
1
|
+
import{O as p}from"./no-shadow-element-DlGA0h9b.js";import{b as m}from"./async-H-Co76Oa.js";import{i as r}from"./executeSchedule-CTqB8mra.js";function v(n){return n instanceof Date&&!isNaN(n)}function x(n,o,i){n===void 0&&(n=0),i===void 0&&(i=m);var t=-1;return o!=null&&(r(o)?i=o:t=o),new p(function(f){var a=v(n)?+n-i.now():n;a<0&&(a=0);var s=0;return i.schedule(function(){f.closed||(f.next(s++),0<=t?this.schedule(void 0,t):f.complete())},a)})}export{x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q as c}from"./no-shadow-element-DlGA0h9b.js";import{d as h}from"./debounceTime-CIA2MWDj.js";class a{constructor(){this.condition=!0,this.threshold=0,this.debounce=0}}class p{constructor(t,i,s={}){this.element=t,this.callback=i,this.params=s,this.intersectionSubject=new c,this.subscriptions=[],this.params={...new a,...s};const n={root:null,rootMargin:"0px",threshold:this.params.threshold};this.observer=new IntersectionObserver(r=>{r.forEach(o=>this.intersectionSubject.next(o))},n),this.connect()}connect(){this.subscriptions.push(this.intersectionSubject.pipe(h(this.params.debounce)).subscribe(t=>this.handleIntersection(t))),this.observer.observe(this.element)}disconnect(){this.observer&&this.observer.disconnect(),this.intersectionSubject.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}handleIntersection(t){this.params.condition&&t.isIntersecting&&this.callback()}}export{p as V};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as m,
|
|
1
|
+
import{N as m,k as a}from"../assets/no-shadow-element-DlGA0h9b.js";import{t as u}from"../assets/custom-element-BhZVzxrc.js";import{m as o}from"../assets/mealz-sdk-DWLzEfKz.js";var c=Object.getOwnPropertyDescriptor,p=(s,n,d,l)=>{for(var e=l>1?void 0:l?c(n,d):n,t=s.length-1,i;t>=0;t--)(i=s[t])&&(e=i(e)||e);return e};let r=class extends m{constructor(){super(),this.supplierName=null,this.showTransferConfirmModal=!1,this.subscriptions=[],this.styleURL=new URL("./basket-transfer-modal/basket-transfer-modal.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.subscriptions.push(o.pos.currentPos().subscribe(s=>{this.supplierName=(s==null?void 0:s.relationships.supplier.data.attributes.name)??null}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(s=>s.unsubscribe())}render(){return a`
|
|
2
2
|
<mealz-modal @modalClosed=${this.hide}>
|
|
3
3
|
<span slot="title">Transfert du panier</span>
|
|
4
4
|
<span slot="content">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/slider-tabs.min.js";import"../../assets/store-locator-
|
|
1
|
+
import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/slider-tabs.min.js";import"../../assets/store-locator-CKwiyckb.js";import{N as R,k as l,D as k,s as O,R as D}from"../../assets/no-shadow-element-DlGA0h9b.js";import{t as x}from"../../assets/custom-element-BhZVzxrc.js";import{n as E}from"../../assets/property-Bg80vXcm.js";import{m as d,a as U}from"../../assets/mealz-sdk-DWLzEfKz.js";import"../../counter/counter.min.js";import"../../price/price.min.js";import"../../modal/modal.min.js";import{P as N}from"../../assets/price-DcNF55ef.js";import{c as M}from"../../assets/capitalize-DUAqYmp4.js";import{e as q,i as L,t as V}from"../../assets/unsafe-html-MRC87lfr.js";import{d as F}from"../../assets/delay-0L99jHsb.js";import"../../assets/state-bsKs-Mb2.js";import"../../assets/query-BApjzB0v.js";import"../../assets/debounceTime-CIA2MWDj.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";import"../../onboarding/events.min.js";import"../../assets/take-BmqRVy-3.js";import"../../assets/empty-DGYYDWIm.js";import"../../assets/map-oxUcVNGT.js";import"../../assets/mergeMap-CMaM5Agw.js";import"../../assets/innerFrom-CVMPVEmB.js";import"../../assets/executeSchedule-CTqB8mra.js";import"../../assets/timer-DmQ_oP6s.js";var j=Object.defineProperty,H=Object.getOwnPropertyDescriptor,B=(e,t,i,a)=>{for(var s=a>1?void 0:a?H(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(s=(a?r(t,i,s):r(s))||s);return a&&s&&j(t,i,s),s};let g=class extends R{constructor(){super(),this.analyticsPath="",this.styleURL=new URL("./product-addition/product-addition.css",this.getBaseURL())}render(){return l`
|
|
2
2
|
<div class="mealz-product-addition">
|
|
3
3
|
<span class="mealz-product-addition__title mealz-ds-text">Besoin de quelque chose en particulier ?</span>
|
|
4
4
|
<button @click=${()=>this.openProductAdditionModal()}
|
|
@@ -111,7 +111,7 @@ import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/sl
|
|
|
111
111
|
* @license
|
|
112
112
|
* Copyright 2017 Google LLC
|
|
113
113
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
-
*/const T=(e,t,i)=>{const a=new Map;for(let s=t;s<=i;s++)a.set(e[s],s);return a},Z=q(class extends L{constructor(e){if(super(e),e.type!==V.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,i){let a;i===void 0?i=t:t!==void 0&&(a=t);const s=[],n=[];let r=0;for(const p of e)s[r]=a?a(p,r):r,n[r]=i(p,r),r++;return{values:n,keys:s}}render(e,t,i){return this.dt(e,t,i).values}update(e,[t,i,a]){const s=Y(e),{values:n,keys:r}=this.dt(t,i,a);if(!Array.isArray(s))return this.ut=r,n;const p=this.ut??(this.ut=[]),m=[];let b,y,c=0,u=s.length-1,o=0,h=n.length-1;for(;c<=u&&o<=h;)if(s[c]===null)c++;else if(s[u]===null)u--;else if(p[c]===r[o])m[o]=_(s[c],n[o]),c++,o++;else if(p[u]===r[h])m[h]=_(s[u],n[h]),u--,h--;else if(p[c]===r[h])m[h]=_(s[c],n[h]),w(e,m[h+1],s[c]),c++,h--;else if(p[u]===r[o])m[o]=_(s[u],n[o]),w(e,s[c],s[u]),u--,o++;else if(b===void 0&&(b=T(r,o,h),y=T(p,c,u)),b.has(p[c]))if(b.has(p[u])){const v=y.get(r[o]),$=v!==void 0?s[v]:null;if($===null){const C=w(e,s[c]);_(C,n[o]),m[o]=C}else m[o]=_($,n[o]),w(e,s[c],$),s[v]=null;o++}else P(s[u]),u--;else P(s[c]),c++;for(;o<=h;){const v=w(e,m[h+1]);_(v,n[o]),m[o++]=v}for(;c<=u;){const v=s[c++];v!==null&&P(v)}return this.ut=r,J(e,m),D}}),A={isRecipeDetailsVisible:{paramName:"displayRecipe",getValue:()=>{var t;const e=d.recipes.displayedRecipe$.value;return((t=e==null?void 0:e.recipe)==null?void 0:t.id)||null},openDrawer:e=>{d.recipes.openDetails(e)}},isBasketPreviewVisible:{paramName:"myMeals",getValue:()=>{const{activeTabIndex:e}=d.basket.basketPreviewState$.getValue();return e===1?"products":"recipes"},openDrawer:e=>{d.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:e==="products"?1:0})}}};function X(){return Object.values(A).map(e=>e.paramName)}function
|
|
114
|
+
*/const T=(e,t,i)=>{const a=new Map;for(let s=t;s<=i;s++)a.set(e[s],s);return a},Z=q(class extends L{constructor(e){if(super(e),e.type!==V.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,i){let a;i===void 0?i=t:t!==void 0&&(a=t);const s=[],n=[];let r=0;for(const p of e)s[r]=a?a(p,r):r,n[r]=i(p,r),r++;return{values:n,keys:s}}render(e,t,i){return this.dt(e,t,i).values}update(e,[t,i,a]){const s=Y(e),{values:n,keys:r}=this.dt(t,i,a);if(!Array.isArray(s))return this.ut=r,n;const p=this.ut??(this.ut=[]),m=[];let b,y,c=0,u=s.length-1,o=0,h=n.length-1;for(;c<=u&&o<=h;)if(s[c]===null)c++;else if(s[u]===null)u--;else if(p[c]===r[o])m[o]=_(s[c],n[o]),c++,o++;else if(p[u]===r[h])m[h]=_(s[u],n[h]),u--,h--;else if(p[c]===r[h])m[h]=_(s[c],n[h]),w(e,m[h+1],s[c]),c++,h--;else if(p[u]===r[o])m[o]=_(s[u],n[o]),w(e,s[c],s[u]),u--,o++;else if(b===void 0&&(b=T(r,o,h),y=T(p,c,u)),b.has(p[c]))if(b.has(p[u])){const v=y.get(r[o]),$=v!==void 0?s[v]:null;if($===null){const C=w(e,s[c]);_(C,n[o]),m[o]=C}else m[o]=_($,n[o]),w(e,s[c],$),s[v]=null;o++}else P(s[u]),u--;else P(s[c]),c++;for(;o<=h;){const v=w(e,m[h+1]);_(v,n[o]),m[o++]=v}for(;c<=u;){const v=s[c++];v!==null&&P(v)}return this.ut=r,J(e,m),D}}),A={isRecipeDetailsVisible:{paramName:"displayRecipe",getValue:()=>{var t;const e=d.recipes.displayedRecipe$.value;return((t=e==null?void 0:e.recipe)==null?void 0:t.id)||null},openDrawer:e=>{d.recipes.openDetails(e)}},isBasketPreviewVisible:{paramName:"myMeals",getValue:()=>{const{activeTabIndex:e}=d.basket.basketPreviewState$.getValue();return e===1?"products":"recipes"},openDrawer:e=>{d.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:e==="products"?1:0})}}};function X(){return Object.values(A).map(e=>e.paramName)}function Ae(){const e=new URL(window.location.href);for(const t of Object.values(A)){const i=e.searchParams.get(t.paramName);if(i&&t.openDrawer){t.openDrawer(i);return}}}function Ce(e){e.subscribe(t=>{const i=new URL(window.location.href);X().forEach(s=>{i.searchParams.delete(s)});const a=A[t];if(a){const s=a.getValue();s&&i.searchParams.set(a.paramName,s)}window.history.replaceState({},"",i.toString())})}function ee(e){const t=new URL(window.location.href);t.searchParams.delete("myMeals"),e===0?t.searchParams.append("myMeals","recipes"):e===1&&t.searchParams.append("myMeals","products"),window.history.replaceState({},"",t.toString())}var te=Object.getOwnPropertyDescriptor,se=(e,t,i,a)=>{for(var s=a>1?void 0:a?te(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(s=r(s)||s);return s};let I=class extends R{constructor(){super(),this.priceService=N.getInstance(),this.subscriptions=[],this.recipePrices=[],this.recipePreviews=[],this.products=[],this.tabs=["Recettes","Produits"],this.selectedTabIndex=0,this.analyticsPath="/basket/recipes",this.drawerStoreIndicator=null,this.styleURL=new URL("./catalog/basket-preview/basket-preview.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),this.pageview(),this.listenToActiveTab(),this.listenToCloseEvent(),this.priceService.initFormatter(),this.noSupplier=d.supplier.isNoSupplier(),this.noSupplier&&this.appendStoreIndicatorToDrawerHeader(),this.updateRecipeView(),this.subscriptions.push(U.basket.recipeCount().subscribe(e=>{this.recipesCount=e,this.requestUpdate()}),d.basket.entries$().subscribe(e=>{this.products=e.filter(t=>t.attributes.status==="active"),this.requestUpdate()}),d.productAddition.productAdded$.pipe(F(200)).subscribe(e=>{this.selectedTabIndex=1,setTimeout(()=>this.scrollToAddedProduct(e),0),this.requestUpdate()}),d.basket.recipePricesInBasket$().subscribe(e=>{this.recipePrices=e,this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}updated(){this.drawerStoreIndicator&&this.drawerStoreIndicator.setAttribute("analyticsPath",this.analyticsPath)}render(){return l`
|
|
115
115
|
<div class="mealz-basket-preview">
|
|
116
116
|
${this.renderNbrMealsInBasket()}
|
|
117
117
|
${this.noSupplier||d.basket.displayProductsInBasket()?l`
|
|
@@ -225,4 +225,4 @@ import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/sl
|
|
|
225
225
|
panier
|
|
226
226
|
</h2>
|
|
227
227
|
</div>
|
|
228
|
-
`}appendStoreIndicatorToDrawerHeader(){const e=document.querySelector("mealz-drawer"),t=document.querySelector("mealz-store-indicator");!e||t||(this.drawerStoreIndicator=document.createElement("mealz-store-indicator"),this.drawerStoreIndicator.setAttribute("analyticsPath",this.analyticsPath),e.appendToHeaderComponent(this.drawerStoreIndicator))}placeOrder(){d.basket.transfer()}recipeCardClick(e){d.recipes.openDetails(e.id,e.guests,this.analyticsPath)}removeRecipeClick(e){e.isGettingRemoved=!0,this.requestUpdate(),d.basket.removeRecipe(e.id,this.analyticsPath).subscribe(()=>{e.isGettingRemoved=!1,this.recipePreviews=this.recipePreviews.filter(t=>t.id!==e.id),this.requestUpdate()})}updateTabIndex(e){this.selectedTabIndex=e,ee(e),this.selectedTabIndex===0?(this.analyticsPath="/basket/recipes",this.updateRecipeView(),this.pageview()):(this.analyticsPath="/basket/products",this.pageview()),this.requestUpdate()}updateRecipeView(){this.subscriptions.push(d.basket.buildPreview().subscribe(e=>{e.map(t=>t.isGettingRemoved=!1),this.recipePreviews=e,this.requestUpdate()}))}scrollToAddedProduct(e){var i;const t=document.querySelector(`#mealz-basket-preview-product-${e}`);if(t)t.scrollIntoView({block:"center",behavior:"smooth"});else{const a=this.getElementsByTagName("MEALZ-BASKET-PREVIEW-PRODUCT");(i=a.item(a.length-1))==null||i.scrollIntoView({block:"center",behavior:"smooth"})}}listenToActiveTab(){this.subscriptions.push(d.basket.basketPreviewState$.subscribe(({activeTabIndex:e})=>{e!==void 0&&(this.selectedTabIndex=e)}))}listenToCloseEvent(){const e=document.querySelector("mealz-drawer");e&&e.addEventListener("drawerClosed",this.sendCloseEvent.bind(this))}isHidden(){return this.classList.contains("hidden")}pageview(){this.isHidden()||d.analytics.sendEvent("pageview",this.analyticsPath,{})}sendCloseEvent(){this.isHidden()||d.analytics.sendEvent("basket.close",this.analyticsPath,{})}};I=se([x("mealz-basket-preview")],I);customElements.get("mealz-basket-preview")||customElements.define("mealz-basket-preview",I);export{
|
|
228
|
+
`}appendStoreIndicatorToDrawerHeader(){const e=document.querySelector("mealz-drawer"),t=document.querySelector("mealz-store-indicator");!e||t||(this.drawerStoreIndicator=document.createElement("mealz-store-indicator"),this.drawerStoreIndicator.setAttribute("analyticsPath",this.analyticsPath),e.appendToHeaderComponent(this.drawerStoreIndicator))}placeOrder(){d.basket.transfer()}recipeCardClick(e){d.recipes.openDetails(e.id,e.guests,this.analyticsPath)}removeRecipeClick(e){e.isGettingRemoved=!0,this.requestUpdate(),d.basket.removeRecipe(e.id,this.analyticsPath).subscribe(()=>{e.isGettingRemoved=!1,this.recipePreviews=this.recipePreviews.filter(t=>t.id!==e.id),this.requestUpdate()})}updateTabIndex(e){this.selectedTabIndex=e,ee(e),this.selectedTabIndex===0?(this.analyticsPath="/basket/recipes",this.updateRecipeView(),this.pageview()):(this.analyticsPath="/basket/products",this.pageview()),this.requestUpdate()}updateRecipeView(){this.subscriptions.push(d.basket.buildPreview().subscribe(e=>{e.map(t=>t.isGettingRemoved=!1),this.recipePreviews=e,this.requestUpdate()}))}scrollToAddedProduct(e){var i;const t=document.querySelector(`#mealz-basket-preview-product-${e}`);if(t)t.scrollIntoView({block:"center",behavior:"smooth"});else{const a=this.getElementsByTagName("MEALZ-BASKET-PREVIEW-PRODUCT");(i=a.item(a.length-1))==null||i.scrollIntoView({block:"center",behavior:"smooth"})}}listenToActiveTab(){this.subscriptions.push(d.basket.basketPreviewState$.subscribe(({activeTabIndex:e})=>{e!==void 0&&(this.selectedTabIndex=e)}))}listenToCloseEvent(){const e=document.querySelector("mealz-drawer");e&&e.addEventListener("drawerClosed",this.sendCloseEvent.bind(this))}isHidden(){return this.classList.contains("hidden")}pageview(){this.isHidden()||d.analytics.sendEvent("pageview",this.analyticsPath,{})}sendCloseEvent(){this.isHidden()||d.analytics.sendEvent("basket.close",this.analyticsPath,{})}};I=se([x("mealz-basket-preview")],I);customElements.get("mealz-basket-preview")||customElements.define("mealz-basket-preview",I);export{Ce as l,Ae as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import
|
|
1
|
+
import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-DlGA0h9b.js";import{C as m}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BiuedJFx.js";import{m as n}from"../../assets/mealz-sdk-DWLzEfKz.js";import"../../assets/http-BGziD2u2.js";import"../../assets/innerFrom-CVMPVEmB.js";import"../../assets/mergeMap-CMaM5Agw.js";import"../../assets/map-oxUcVNGT.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";import"../../assets/executeSchedule-CTqB8mra.js";import"../../assets/mapOneOrManyArgs-Do0PsDok.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/timer-DmQ_oP6s.js";var u=Object.getOwnPropertyDescriptor,C=(t,a,o,s)=>{for(var e=s>1?void 0:s?u(a,o):a,r=t.length-1,i;r>=0;r--)(i=t[r])&&(e=i(e)||e);return e};let p=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(n.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var l;const t=(l=this.attributes["starting-data"])==null?void 0:l.value;if(!t||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:a,packageId:o,posId:s,loadMoreURL:e,displayRecipeVariant:r,search:i,sessionId:c,path:d}=JSON.parse(t);g(c),this.analyticsPath=d,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:r,loadMoreURL:e,sessionId:c,pageSize:a,storeId:s,packageId:o,search:i,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){n?(n.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};p=C([h("mealz-catalog-category")],p);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g}from"../../assets/custom-element-BhZVzxrc.js";import
|
|
1
|
+
import{t as g}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-DlGA0h9b.js";import{C as h}from"../catalog-load-more.min.js";import{h as u}from"../../assets/session-handler-BiuedJFx.js";import{m as n}from"../../assets/mealz-sdk-DWLzEfKz.js";import{f as m}from"../../assets/filter-DuHsB8oM.js";import"../../assets/http-BGziD2u2.js";import"../../assets/innerFrom-CVMPVEmB.js";import"../../assets/mergeMap-CMaM5Agw.js";import"../../assets/map-oxUcVNGT.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";import"../../assets/executeSchedule-CTqB8mra.js";import"../../assets/mapOneOrManyArgs-Do0PsDok.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/timer-DmQ_oP6s.js";function f(e){return m(function(t,i){return e<=i})}var v=Object.getOwnPropertyDescriptor,_=(e,t,i,o)=>{for(var s=o>1?void 0:o?v(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=a(s)||s);return s};let d=class extends h{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(n.user.isAuthenticated().pipe(f(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const e=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!e)return;const{pageSize:t,storeId:i,loadMoreURL:o,displayRecipeVariant:s,search:r,sessionId:a,path:p}=JSON.parse(e);if(this.analyticsPath=p,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const l=this.querySelector(".mealz-catalog__list");l&&(u(a),this.loadMoreRecipesOnScroll({displayRecipeVariant:s,loadMoreURL:o,sessionId:a,pageSize:t,storeId:i,packageId:null,search:r,listHTML:l}),this.removeAttribute("starting-data"))}updateDOM(){const e=this.querySelector(".mealz-catalog-favorites__list__not-logged"),t=this.querySelector(".mealz-catalog-favorites__list__logged");!e||!t||(e.classList.toggle("hidden",this.isLogged),t.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){var e;n?((e=n.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return n.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const i=document.getElementById("mealz-recipe-card-"+e);i&&i.classList.toggle("hidden",t),this.requestUpdate()})}};d=_([g("mealz-catalog-favorites")],d);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as p}from"../catalog-load-more.min.js";import{t as y}from"../../assets/custom-element-BhZVzxrc.js";import
|
|
1
|
+
import{C as p}from"../catalog-load-more.min.js";import{t as y}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-DlGA0h9b.js";import{h as m}from"../../assets/session-handler-BiuedJFx.js";import{m as l}from"../../assets/mealz-sdk-DWLzEfKz.js";import"../../assets/http-BGziD2u2.js";import"../../assets/innerFrom-CVMPVEmB.js";import"../../assets/mergeMap-CMaM5Agw.js";import"../../assets/map-oxUcVNGT.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";import"../../assets/executeSchedule-CTqB8mra.js";import"../../assets/mapOneOrManyArgs-Do0PsDok.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/timer-DmQ_oP6s.js";var w=Object.getOwnPropertyDescriptor,g=(t,e,r,i)=>{for(var s=i>1?void 0:i?w(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(s=o(s)||s);return s};let n=class extends p{constructor(){super(),this.retryCount=0,this.maxRetries=30,this.styleURL=new URL("./catalog/catalog-history/catalog-history.css",this.getBaseURL()),this.handleHistoryDrawer=this.handleHistoryDrawer.bind(this)}connectedCallback(){var h;super.connectedCallback();const t=(h=this.attributes["starting-data"])==null?void 0:h.value;if(!t)return;const{loadMoreURL:e,drawerDataURL:r,sessionId:i,pageSize:s,storeId:a,orders:o,path:d,historyStyle:c}=JSON.parse(t);this.historyDrawerData=JSON.stringify({storeId:a,sessionId:i,drawerDataURL:r}),this.loadMoreURL=e,this.sessionId=i,this.pageSize=s,this.storeId=a,this.orders=o,this.analyticsPath=d,this.historyStyle=c,m(this.sessionId),this.removeAttribute("starting-data"),this.sendPageViewEvent(),this.initURLListener(),this.handleHistoryDrawer()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this.handleHistoryDrawer)}render(){this.historyOrderListHTML=this.querySelector(".mealz-catalog__list"),this.historyOrderListHTML&&this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:this.loadMoreURL,sessionId:this.sessionId,pageSize:+this.pageSize,storeId:this.storeId,packageId:null,search:"",listHTML:this.historyOrderListHTML,historyStyle:this.historyStyle})}handleHistoryDrawer(){const t=new URL(window.location.href),e=t.searchParams.get("order"),r=t.searchParams.get("displayRecipe");if(!e||!this.orders||r)return;const i=document.querySelector("mealz-drawer-view-swapper"),s=this.orders.find(o=>o.id===e),a=(s==null?void 0:s.updatedAt)||"";i&&i.displayHistoryDrawer$.next({historyDrawerData:this.historyDrawerData,orderId:e,orderDate:a})}initURLListener(){window.addEventListener("popstate",this.handleHistoryDrawer);const t=history.pushState,e=history.replaceState;history.pushState=(...r)=>{t.apply(history,r),this.handleHistoryDrawer()},history.replaceState=(...r)=>{e.apply(history,r),this.handleHistoryDrawer()}}sendPageViewEvent(){l?(l.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=g([y("mealz-catalog-history")],n);customElements.get("mealz-catalog-history")||customElements.define("mealz-catalog-history",n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import{N as l
|
|
1
|
+
import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import{N as l}from"../../assets/no-shadow-element-DlGA0h9b.js";import{h as d}from"../../assets/session-handler-BiuedJFx.js";import{V as g}from"../../assets/viewport-listener-BuonFDBs.js";import{m as r}from"../../assets/mealz-sdk-DWLzEfKz.js";import"../../assets/debounceTime-CIA2MWDj.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";var m=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var a=i>1?void 0:i?m(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(a=o(a)||a);return a};let c=class extends l{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(r.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.viewportListeners.forEach(t=>t.disconnect()),this.viewportListeners=[]}render(){var a;const t=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!t)return;const{categories:e,path:s,sessionId:i}=JSON.parse(t);d(i),this.analyticsPath=s,this.categories=e,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((e,s)=>{e==null||e.addEventListener("click",()=>this.sendCategoryDisplay(s))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((e,s)=>{const i=new g(e,()=>this.sendCategoryShow(s),{threshold:.8,debounce:1e3});this.viewportListeners.push(i)})}reloadPage(){location.reload()}sendPageViewEvent(){r?(r.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}sendCategoryDisplay(t){var e;r.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(e=this.categories[Math.floor(t/2)])==null?void 0:e.id})}sendCategoryShow(t){var e;r.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(e=this.categories[t])==null?void 0:e.id})}};c=p([h("mealz-catalog-home")],c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as m}from"../../assets/custom-element-BhZVzxrc.js";import
|
|
1
|
+
import{t as m}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-DlGA0h9b.js";import{C as h}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BiuedJFx.js";import{m as u}from"../../assets/mealz-sdk-DWLzEfKz.js";import"../../assets/http-BGziD2u2.js";import"../../assets/innerFrom-CVMPVEmB.js";import"../../assets/mergeMap-CMaM5Agw.js";import"../../assets/map-oxUcVNGT.js";import"../../assets/OperatorSubscriber-z_a6lCKk.js";import"../../assets/executeSchedule-CTqB8mra.js";import"../../assets/mapOneOrManyArgs-Do0PsDok.js";import"../../assets/async-H-Co76Oa.js";import"../../assets/timer-DmQ_oP6s.js";var C=Object.getOwnPropertyDescriptor,b=(t,a,o,i)=>{for(var e=i>1?void 0:i?C(a,o):a,r=t.length-1,s;r>=0;r--)(s=t[r])&&(e=s(e)||e);return e};let n=class extends h{connectedCallback(){super.connectedCallback(),this.subscriptions.push(u.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var p;const t=(p=this.attributes["starting-data"])==null?void 0:p.value;if(!t||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:a,storeId:o,loadMoreURL:i,displayRecipeVariant:e,search:r,promotions:s,planner:c,sessionId:l,recipeTypeId:d}=JSON.parse(t);g(l),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:i,sessionId:l,pageSize:a,storeId:o,packageId:null,search:r,listHTML:this.recipeCardListHTML,promotions:s,planner:c,recipeTypeId:d}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}};n=b([m("mealz-catalog-list")],n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as w,O as R,d as f,N as T}from"../assets/no-shadow-element-DlGA0h9b.js";import{b as _}from"../assets/http-BGziD2u2.js";import{a as S,i as b}from"../assets/innerFrom-CVMPVEmB.js";import{m as C}from"../assets/mergeMap-CMaM5Agw.js";import{m as H}from"../assets/mapOneOrManyArgs-Do0PsDok.js";import{a as k}from"../assets/async-H-Co76Oa.js";import{o as O,c as y}from"../assets/OperatorSubscriber-z_a6lCKk.js";import{t as z}from"../assets/timer-DmQ_oP6s.js";import"../assets/mealz-sdk-DWLzEfKz.js";import"../assets/map-oxUcVNGT.js";import"../assets/executeSchedule-CTqB8mra.js";var I=["addListener","removeListener"],x=["addEventListener","removeEventListener"],V=["on","off"];function E(n,e,t,r){if(f(t)&&(r=t,t=void 0),r)return E(n,e,t).pipe(H(r));var u=w(A(n)?x.map(function(s){return function(d){return n[s](e,d,t)}}):D(n)?I.map(M(n,e)):q(n)?V.map(M(n,e)):[],2),c=u[0],m=u[1];if(!c&&S(n))return C(function(s){return E(s,e,t)})(b(n));if(!c)throw new TypeError("Invalid event target");return new R(function(s){var d=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return s.next(1<a.length?a:a[0])};return c(d),function(){return m(d)}})}function M(n,e){return function(t){return function(r){return n[t](e,r)}}}function D(n){return f(n.addListener)&&f(n.removeListener)}function q(n){return f(n.on)&&f(n.off)}function A(n){return f(n.addEventListener)&&f(n.removeEventListener)}function G(n,e){return O(function(t,r){var u=e??{},c=u.leading,m=c===void 0?!0:c,s=u.trailing,d=s===void 0?!1:s,a=!1,l=null,o=null,h=!1,L=function(){o==null||o.unsubscribe(),o=null,d&&(g(),h&&r.complete())},i=function(){o=null,h&&r.complete()},v=function(p){return o=b(n(p)).subscribe(y(r,L,i))},g=function(){if(a){a=!1;var p=l;l=null,r.next(p),!h&&v(p)}};t.subscribe(y(r,function(p){a=!0,l=p,!(o&&!o.closed)&&(m?g():v(p))},function(){h=!0,!(d&&a&&o&&!o.closed)&&r.complete()}))})}function $(n,e,t){e===void 0&&(e=k);var r=z(n,e);return G(function(){return r},t)}const j=300;class Z extends T{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(e){this.addScrollListener(window,()=>{this.isListVisible(e.listHTML)&&this.shouldGetMoreRecipes(window.scrollY,window.innerHeight,document.body.offsetHeight)&&this.getMoreRecipes(e)});const t=document.querySelector(".mealz-drawer__content-container");t&&this.addScrollListener(t,()=>{this.isListVisible(e.listHTML)&&this.shouldGetMoreRecipes(t.scrollTop,t.clientHeight,t.scrollHeight)&&this.getMoreRecipes(e)})}addScrollListener(e,t){const r=E(e,"scroll").pipe($(100));this.subscriptions.push(r.subscribe(t))}isListVisible(e){return!!(e.offsetParent||e.getClientRects().length)}shouldGetMoreRecipes(e,t,r){return!this.noMoreData&&!this.isLoading&&e+t+j>=r}async getMoreRecipes(e){const{displayRecipeVariant:t,loadMoreURL:r,sessionId:u,pageSize:c,storeId:m,packageId:s,search:d,listHTML:a,promotions:l,planner:o,historyStyle:h,recipeTypeId:L}=e;this.isLoading=!0,this.toggleLoader(!0);const i=new URLSearchParams;i.append("size",c.toString()),i.append("page",this.page.toString()),t&&i.append("display_recipe_variant",t),s&&i.append("category_id",s),m&&i.append("store_id",m),d&&i.append("search",d),l&&i.append("promotions",l.toString()),o&&i.append("planner","true"),h&&i.append("history_style",h),L&&i.append("recipe_type_id",L);try{const v=r.includes("?")?"&":"?",g=await fetch(r+v+i.toString(),{method:"GET",headers:_(u)});if(!g.ok)throw new Error(`Load more request failed with status: ${g.status}`);const p=await g.text();this.appendRecipesToList(p,a,c)}catch(v){console.error(v),this.isLoading=!1}}appendRecipesToList(e,t,r){this.checkIfMoreRecipes(e,r),t.insertAdjacentHTML("beforeend",e),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(e,t){const r=e.match(/<mealz-recipe-card(?=\s|>)/gi)||e.match(/<mealz-history-order(?=\s|>)/gi)||e.match(/<mealz-history-order-expanded(?=\s|>)/gi);(r?r.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="mealz-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 s}from"../../assets/custom-element-BhZVzxrc.js";import{N as d}from"../../assets/no-shadow-element-
|
|
1
|
+
import{t as s}from"../../assets/custom-element-BhZVzxrc.js";import{N as d}from"../../assets/no-shadow-element-DlGA0h9b.js";import"../../assets/mealz-sdk-DWLzEfKz.js";var p=Object.getOwnPropertyDescriptor,b=(t,l,n,r)=>{for(var e=r>1?void 0:r?p(l,n):l,a=t.length-1,c;a>=0;a--)(c=t[a])&&(e=c(e)||e);return e};let o=class extends d{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){}};o=b([s("mealz-catalog-tabs")],o);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as c
|
|
1
|
+
import{N as c}from"../../assets/no-shadow-element-DlGA0h9b.js";import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import{m as i}from"../../assets/mealz-sdk-DWLzEfKz.js";var u=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var a=r>1?void 0:r?u(e,s):e,o=t.length-1,n;o>=0;o--)(n=t[o])&&(a=n(a)||a);return a};let l=class extends c{constructor(){super(...arguments),this.subscriptions=[],this.supplierHeaderHeight=0,this.searchUrl="",this.path="",this.planner=!1}get selectors(){return{preferencesButton:".mealz-catalog-toolbar__controls__preferences",favoritesButton:".mealz-catalog-toolbar__controls__favorites",searchInput:".mealz-catalog-toolbar__searchbar-input",clearButton:".mealz-catalog-toolbar__clear-button",backButton:".mealz-recipe-toolbar__return-button"}}connectedCallback(){super.connectedCallback(),this.subscriptions.push(i.getStickyHeaderHeight().subscribe(t=>{this.supplierHeaderHeight=t,this.setStickyObserver()}),i.preferences.preferencesChanged$().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 a;const t=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!t)return;const{searchUrl:e,path:s,planner:r}=JSON.parse(t);this.searchUrl=e,this.path=s,r&&(this.planner=r),this.findElementsInDocument(),this.addEveryEventListeners(),this.updateClearButtonVisibility(),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.initSelectors(),this.preferencesButton=this.elements.preferencesButton,this.favoritesButton=this.elements.favoritesButton,this.searchInput=this.elements.searchInput,this.clearButton=this.elements.clearButton,this.backButton=this.elements.backButton}addEveryEventListeners(){var t,e;this.addClickListener("preferencesButton",this.openPreferences.bind(this)),this.addClickListener("favoritesButton",this.sendFavoritesDisplay.bind(this)),this.addClickListener("clearButton",this.clearSearch.bind(this)),(t=this.searchInput)==null||t.addEventListener("keypress",s=>{s.key==="Enter"&&this.performSearch()}),(e=this.searchInput)==null||e.addEventListener("input",()=>{this.updateClearButtonVisibility()})}updateClearButtonVisibility(){if(this.clearButton){const t=this.searchInput.value.trim().length>0;this.clearButton.classList.toggle("hidden",!t)}}clearSearch(){this.searchInput&&(this.searchInput.value="",this.updateClearButtonVisibility(),this.performSearch())}performSearch(){const t=this.searchInput.value.trim();if(i.analytics.sendEvent("search",this.path,{search_term:t}),this.planner){const e=new CustomEvent("searchEvent",{detail:{searchQuery:t},bubbles:!0,composed:!0});this.dispatchEvent(e)}else{const e=this.searchUrl.includes("?")?"&":"?",s=t?`search=${encodeURIComponent(t)}`:"";window.location.href=t?`${this.searchUrl}${e}${s}`:this.searchUrl}}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)}async openPreferences(){i.analytics.sendEvent("preferences.display",this.path,{});const t=document.querySelector("mealz-drawer-view-swapper");t.displayPreferences$.next(!0),await t.updateComplete}sendFavoritesDisplay(){i.analytics.sendEvent("liked.display",this.path,{})}};l=p([h("mealz-catalog-toolbar")],l);
|