mealz-components 2.3.2 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{OperatorSubscriber-DF1TYu__.js → OperatorSubscriber-BaYaQC1O.js} +1 -1
- package/dist/assets/{accordion-la5mVBfL.js → accordion-DJLqKUJq.js} +1 -1
- package/dist/assets/args-BozZ6oU-.js +1 -0
- package/dist/assets/{async-D5WN8Wfc.js → async-CFBGA-Dz.js} +1 -1
- package/dist/assets/combineLatest-BmqPE0OB.js +1 -0
- package/dist/assets/{debounceTime-D7R6Z3Am.js → debounceTime-B4DpnstH.js} +1 -1
- package/dist/assets/delay-BNnJ-6LE.js +1 -0
- package/dist/assets/{distinctUntilChanged-VvZTmHoN.js → distinctUntilChanged-91AVuO2B.js} +1 -1
- package/dist/assets/empty-0eVnsLmk.js +1 -0
- package/dist/assets/executeSchedule-CEDvgTzM.js +1 -0
- package/dist/assets/{filter-DQ4vwAGj.js → filter-BZ75lS5D.js} +1 -1
- package/dist/assets/from-CAidt5N1.js +1 -0
- package/dist/assets/{innerFrom-FMZwm2mb.js → innerFrom-BgPDnAsH.js} +1 -1
- package/dist/assets/isScheduler-C5PGPVU1.js +1 -0
- package/dist/assets/{map-DHslluWD.js → map-BVOhpQm0.js} +1 -1
- package/dist/assets/mapOneOrManyArgs-COA1aRZM.js +1 -0
- package/dist/assets/merge-Cm-mm3_Q.js +1 -0
- package/dist/assets/mergeAll-BdUAXyrs.js +1 -0
- package/dist/assets/{mergeMap-g-JGW99j.js → mergeMap-Dw_YYHwH.js} +1 -1
- package/dist/assets/{no-shadow-element-Dz9jgDtr.js → no-shadow-element-YPHUv5PR.js} +1 -1
- package/dist/assets/of-DiALp3BZ.js +1 -0
- package/dist/assets/{price-CHipCs2z.js → price-DAxY_7sk.js} +1 -1
- package/dist/assets/{product-card-c_0I2Lp_.js → product-card-HetVhdJ3.js} +1 -1
- package/dist/assets/{promotion-badge-CzwsPJJq.js → promotion-badge-8Arhhb-p.js} +1 -1
- package/dist/assets/{property-Bx8Yvr4_.js → property-_7ObQ3dl.js} +1 -1
- package/dist/assets/responsive-C7Qf71r3.js +1 -0
- package/dist/assets/skip-zbH-ayby.js +1 -0
- package/dist/assets/{skipWhile-BzDgmir5.js → skipWhile-BZVFq1Cg.js} +1 -1
- package/dist/assets/{state-C5zM4-Pq.js → state-W5mtSPAs.js} +1 -1
- package/dist/assets/{switchMap-6Z80ObHE.js → switchMap-Dk_0Nhlo.js} +1 -1
- package/dist/assets/{take-ByPtGQky.js → take-CozE9iSG.js} +1 -1
- package/dist/assets/{tap-K_D6lo97.js → tap-C8CJ3R2H.js} +1 -1
- package/dist/assets/timer-D82-ik89.js +1 -0
- package/dist/assets/{unsafe-html-Bv_ydUHb.js → unsafe-html-CY0Np4--.js} +2 -2
- package/dist/assets/{viewport-listener-DrFhSZNW.js → viewport-listener-CDsKFDz1.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.css +1 -0
- package/dist/catalog/catalog-list/catalog-list.min.js +1 -1
- package/dist/catalog/catalog-load-more.min.js +1 -1
- package/dist/catalog/catalog-tabs/catalog-tabs.min.js +1 -1
- package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
- package/dist/catalog/my-meals-button/my-meals-button.min.js +1 -1
- package/dist/counter/counter.min.js +1 -1
- package/dist/drawer/drawer.css +1 -1
- package/dist/drawer/drawer.min.js +1 -1
- package/dist/drawer-view-swapper/drawer-view-swapper.min.js +24 -24
- package/dist/history-drawer/history-drawer.min.js +1 -1
- package/dist/history-order/history-order.min.js +1 -1
- package/dist/history-order-expanded/history-order-expanded.min.js +1 -1
- package/dist/last-order-badge/last-order-badge.min.js +2 -2
- package/dist/last-order-modal/last-order-modal.min.js +1 -1
- package/dist/like-button/like-button.min.js +1 -1
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.min.js +7 -3
- package/dist/no-supplier-add-to-cart-cta/no-supplier-add-to-cart-cta.min.js +1 -1
- package/dist/onboarding/onboarding.css +1 -1
- package/dist/onboarding/onboarding.min.js +5 -5
- package/dist/order-again/order-again.min.js +1 -1
- package/dist/planner/helpers/menu-title.min.js +1 -0
- package/dist/planner/helpers/open-onboarding-modal.min.js +1 -1
- package/dist/planner/planner-abandon-modal/planner-abandon-modal.min.js +1 -1
- package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.css +1 -1
- package/dist/planner/planner-budget-edit-modal/planner-budget-edit-modal.min.js +1 -1
- package/dist/planner/planner-budget-gauge/planner-budget-gauge.css +1 -1
- package/dist/planner/planner-budget-gauge/planner-budget-gauge.min.js +1 -1
- package/dist/planner/planner-catalog/planner-catalog.css +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 +1 -1
- package/dist/planner/planner-dashboard/planner-dashboard.min.js +1 -1
- package/dist/planner/planner-form/planner-form.min.js +9 -9
- package/dist/planner/planner-menu-option/planner-menu-option.min.js +1 -1
- package/dist/planner/planner-onboarding/planner-onboarding.min.js +1 -1
- package/dist/planner/planner-onboarding-modal/planner-onboarding-modal.min.js +12 -15
- package/dist/planner/planner-open-catalog-modal/planner-open-catalog-modal.min.js +1 -1
- package/dist/planner/planner-quick-menu/planner-quick-menu.css +1 -0
- package/dist/planner/planner-quick-menu/planner-quick-menu.min.js +1 -0
- package/dist/planner/planner-recipe-card/planner-recipe-card.css +1 -1
- package/dist/planner/planner-recipe-card/planner-recipe-card.min.js +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.css +1 -1
- package/dist/planner/planner-recipe-list/planner-recipe-list.min.js +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.css +1 -1
- package/dist/planner/planner-recipe-suggestion/planner-recipe-suggestion.min.js +1 -1
- package/dist/planner/planner-welcome-modal/planner-welcome-modal.css +1 -1
- package/dist/planner/planner-welcome-modal/planner-welcome-modal.min.js +1 -1
- package/dist/planner/to-basket-loader/to-basket-loader.min.js +2 -2
- package/dist/planner-entry/planner-entry.min.js +1 -1
- package/dist/preferences/preferences.min.js +21 -21
- 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.css +1 -1
- package/dist/recipe-card-cta/recipe-card-cta.min.js +1 -1
- package/dist/recipe-details/details-footer/details-footer.css +1 -1
- package/dist/recipe-details/recipe-details.css +1 -1
- package/dist/recipe-details/recipe-details.min.js +102 -102
- 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 +1 -1
- package/dist/replace-item-planner/replace-item-planner.min.js +1 -1
- package/dist/select/select.min.js +1 -1
- package/dist/slider-tabs/slider-tabs.min.js +1 -1
- package/dist/store-indicator/store-indicator.min.js +1 -1
- package/dist/store-locator/store-locator.min.js +4 -4
- package/dist/store-locator-drawer/store-locator-drawer.min.js +1 -1
- package/dist/supplier-selector/supplier-selector.min.js +1 -1
- package/package.json +1 -1
- package/dist/assets/combineLatest-BN0_WcEG.js +0 -1
- package/dist/assets/delay-wUm-cx7a.js +0 -1
- package/dist/assets/empty-Bs9kqCuA.js +0 -1
- package/dist/assets/executeSchedule-C0acKsif.js +0 -1
- package/dist/assets/from-BTlWkhKh.js +0 -1
- package/dist/assets/mapOneOrManyArgs-Bdu6mo6S.js +0 -1
- package/dist/assets/merge-tdU3EgEI.js +0 -1
- package/dist/assets/mergeAll-DTkL1sF8.js +0 -1
- package/dist/assets/of-hd4MpK5g.js +0 -1
- package/dist/assets/skip-BuAl4dWz.js +0 -1
- package/dist/assets/timer-C3uKg-qK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as b,_ as h,S as f}from"./no-shadow-element-
|
|
1
|
+
import{i as b,_ as h,S as f}from"./no-shadow-element-YPHUv5PR.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as d,k as h}from"./no-shadow-element-
|
|
1
|
+
import{N as d,k as h}from"./no-shadow-element-YPHUv5PR.js";import{t as m}from"./custom-element-BhZVzxrc.js";import{n as l}from"./property-_7ObQ3dl.js";import{a as p}from"./unsafe-html-CY0Np4--.js";var g=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(s,t,c,n)=>{for(var o=n>1?void 0:n?y(t,c):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(o=(n?r(t,c,o):r(o))||o);return n&&o&&g(t,c,o),o};let e=class extends d{constructor(){super(),this.noStyling=!1,this.isCollapsed=!0,this.isCollapsedChangeEvent=new CustomEvent("isCollapsedChange",{detail:{isCollapsed:this.isCollapsed},bubbles:!0,composed:!0}),this.styleURL=new URL("./accordion/accordion.css",this.getBaseURL())}connectedCallback(){super.connectedCallback();const s=this.querySelector('[slot="title"]');s&&(this.titleSlot=s.innerHTML,s.remove());const t=this.querySelector('[slot="content"]');t&&(this.contentSlot=t.innerHTML,t.remove()),this.innerHTML=""}disconnectedCallback(){super.disconnectedCallback()}toggleAccordion(){this.isCollapsed=!this.isCollapsed,this.dispatchEvent(this.isCollapsedChangeEvent),this.requestUpdate()}updated(){this.classList.toggle("opened",!this.isCollapsed)}render(){return h`
|
|
2
2
|
<button
|
|
3
3
|
class="mealz-accordion__header${this.noStyling?"-no-styling":""}"
|
|
4
4
|
@click=${()=>this.toggleAccordion()}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as p}from"./no-shadow-element-YPHUv5PR.js";import{i as t}from"./isScheduler-C5PGPVU1.js";function n(e){return e[e.length-1]}function r(e){return p(n(e))?e.pop():void 0}function f(e){return t(n(e))?e.pop():void 0}function c(e,o){return typeof n(e)=="number"?e.pop():o}export{c as a,r as b,f as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as u,a as l,b as d,c as f,d as v}from"./no-shadow-element-
|
|
1
|
+
import{_ as u,a as l,b as d,c as f,d as v}from"./no-shadow-element-YPHUv5PR.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O,t as m}from"./no-shadow-element-YPHUv5PR.js";import{f as v}from"./from-CAidt5N1.js";import{m as b}from"./mapOneOrManyArgs-COA1aRZM.js";import{p as h,b as A}from"./args-BozZ6oU-.js";import{c as S}from"./OperatorSubscriber-BaYaQC1O.js";import{e as j}from"./executeSchedule-CEDvgTzM.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 z(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=h(r),n=A(r),a=x(r),o=a.args,c=a.keys;if(o.length===0)return v([],t);var u=new O(V(o,t,c?function(i){return L(c,i)}:m));return n?u.pipe(b(n)):u}function V(r,e,t){return t===void 0&&(t=m),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=v(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{z as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./async-
|
|
1
|
+
import{a as d}from"./async-CFBGA-Dz.js";import{o as m,c as v}from"./OperatorSubscriber-BaYaQC1O.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-CFBGA-Dz.js";import{t as m}from"./take-CozE9iSG.js";import{m as a}from"./map-BVOhpQm0.js";import{m as e}from"./mergeMap-Dw_YYHwH.js";import{i as f}from"./innerFrom-BgPDnAsH.js";import{t as p}from"./timer-D82-ik89.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d}from"./no-shadow-element-
|
|
1
|
+
import{t as d}from"./no-shadow-element-YPHUv5PR.js";import{o,c as a}from"./OperatorSubscriber-BaYaQC1O.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-YPHUv5PR.js";var t=new r(function(e){return e.complete()});export{t as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function f(s,e,d,i,u){i===void 0&&(i=0),u===void 0&&(u=!1);var c=e.schedule(function(){d(),u?s.add(this.schedule(null,i)):this.unsubscribe()},i);if(s.add(c),!u)return c}export{f as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as c,c as i}from"./OperatorSubscriber-
|
|
1
|
+
import{o as c,c as i}from"./OperatorSubscriber-BaYaQC1O.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as f,b as x,r as I,c as O,a as h,d as w,e as S,f as A,g as k,h as L}from"./innerFrom-BgPDnAsH.js";import{e as a}from"./executeSchedule-CEDvgTzM.js";import{o as l,c as y}from"./OperatorSubscriber-BaYaQC1O.js";import{O as i,i as g}from"./no-shadow-element-YPHUv5PR.js";function m(e,n){return n===void 0&&(n=0),l(function(t,r){t.subscribe(y(r,function(o){return a(r,e,function(){return r.next(o)},n)},function(){return a(r,e,function(){return r.complete()},n)},function(o){return a(r,e,function(){return r.error(o)},n)}))})}function v(e,n){return n===void 0&&(n=0),l(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}function E(e,n){return f(e).pipe(v(n),m(n))}function F(e,n){return f(e).pipe(v(n),m(n))}function P(e,n){return new i(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}function R(e,n){return new i(function(t){var r;return a(t,n,function(){r=e[x](),a(t,n,function(){var o,u,c;try{o=r.next(),u=o.value,c=o.done}catch(d){t.error(d);return}c?t.complete():t.next(u)},0,!0)}),function(){return g(r==null?void 0:r.return)&&r.return()}})}function s(e,n){if(!e)throw new Error("Iterable cannot be null");return new i(function(t){a(t,n,function(){var r=e[Symbol.asyncIterator]();a(t,n,function(){r.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}function T(e,n){return s(I(e),n)}function p(e,n){if(e!=null){if(O(e))return E(e,n);if(h(e))return P(e,n);if(w(e))return F(e,n);if(S(e))return s(e,n);if(A(e))return R(e,n);if(k(e))return T(e,n)}throw L(e)}function q(e,n){return n?p(e,n):f(e)}export{q as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as l,o as d,e as m,g as v,h as f,O as u,r as h,j as w,l as I,m as S}from"./no-shadow-element-
|
|
1
|
+
import{i as l,o as d,e as m,g as v,h as f,O as u,r as h,j as w,l as I,m as S}from"./no-shadow-element-YPHUv5PR.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,f(r.read())];case 3:return a=t.sent(),o=a.value,s=a.done,s?[4,f(void 0)]:[3,5];case 4:return[2,t.sent()];case 5:return[4,f(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(i){r={error:i}}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,i;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 i=c.sent(),o={error:i},[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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./no-shadow-element-YPHUv5PR.js";function n(i){return i&&r(i.schedule)}export{n as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as c,c as i}from"./OperatorSubscriber-
|
|
1
|
+
import{o as c,c as i}from"./OperatorSubscriber-BaYaQC1O.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{b as n,c as p}from"./no-shadow-element-YPHUv5PR.js";import{m as o}from"./map-BVOhpQm0.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
|
+
import{m as t}from"./mergeAll-BdUAXyrs.js";import{i as n}from"./innerFrom-BgPDnAsH.js";import{E as s}from"./empty-0eVnsLmk.js";import{p,a as f}from"./args-BozZ6oU-.js";import{f as u}from"./from-CAidt5N1.js";function v(){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?n(m[0]):t(a)(u(m,o)):s}export{v as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m}from"./mergeMap-Dw_YYHwH.js";import{t}from"./no-shadow-element-YPHUv5PR.js";function o(i){return i===void 0&&(i=1/0),m(t,i)}export{o as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as C}from"./map-
|
|
1
|
+
import{m as C}from"./map-BVOhpQm0.js";import{i as x}from"./innerFrom-BgPDnAsH.js";import{c as h,o as F}from"./OperatorSubscriber-BaYaQC1O.js";import"./executeSchedule-CEDvgTzM.js";import{i as I}from"./no-shadow-element-YPHUv5PR.js";function b(f,e,n,i,t,v,u,k){var o=[],r=0,g=0,c=!1,d=function(){c&&!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();d()}catch(p){e.error(p)}}))};return f.subscribe(h(e,y,function(){c=!0,d()})),function(){}}function N(f,e,n){return n===void 0&&(n=1/0),I(e)?N(function(i,t){return C(function(v,u){return e(i,v,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};
|
|
@@ -18,4 +18,4 @@ import{m as rt}from"./mealz-sdk-E_fNZM-c.js";/**
|
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
19
|
*/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=Jt(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 _t;C._$litElement$=!0,C.finalized=!0,(_t=globalThis.litElementHydrateSupport)==null||_t.call(globalThis,{LitElement:C});const W=globalThis.litElementPolyfillSupport;W==null||W({LitElement:C});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");var G=function(i,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])},G(i,t)};function k(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");G(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ye(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,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?s(f.value):n(f.value).then(c,a)}l((r=r.apply(i,t||[])).next())})}function ve(i,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,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,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,n=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(i,e)}catch(f){l=[6,f],n=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function M(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],r=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function K(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var r=e.call(i),n,s=[],o;try{for(;(t===void 0||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(o)throw o.error}}return s}function Z(i,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,s;r<n;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return i.concat(s||Array.prototype.slice.call(t))}function J(i){return this instanceof J?(this.v=i,this):new J(i)}function be(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(i,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(h){return function(v){return Promise.resolve(v).then(h,u)}}function c(h,v){r[h]&&(n[h]=function(y){return new Promise(function(Ct,Tt){s.push([h,y,Ct,Tt])>1||a(h,y)})},v&&(n[h]=v(n[h])))}function a(h,v){try{l(r[h](v))}catch(y){d(s[0][3],y)}}function l(h){h.value instanceof J?Promise.resolve(h.value.v).then(f,u):d(s[0][2],h)}function f(h){a("next",h)}function u(h){a("throw",h)}function d(h,v){h(v),s.shift(),s.length&&a(s[0][0],s[0][1])}}function _e(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],e;return t?t.call(i):(i=typeof M=="function"?M(i):i[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(s){e[s]=i[s]&&function(o){return new Promise(function(c,a){o=i[s](o),n(c,a,o.done,o.value)})}}function n(s,o,c,a){Promise.resolve(a).then(function(l){s({value:l,done:c})},o)}}function b(i){return typeof i=="function"}function wt(i){var t=function(r){Error.call(r),r.stack=new Error().stack},e=i(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var F=wt(function(i){return function(e){i(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
20
20
|
`+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
|
|
21
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function Q(i,t){if(i){var e=i.indexOf(t);0<=e&&i.splice(e,1)}}var B=function(){function i(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var t,e,r,n,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var c=M(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){s=y instanceof F?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=M(u),h=d.next();!h.done;h=d.next()){var v=h.value;try{pt(v)}catch(y){s=s??[],y instanceof F?s=Z(Z([],K(s)),K(y.errors)):s.push(y)}}}catch(y){r={error:y}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}if(s)throw new F(s)}},i.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)pt(t);else{if(t instanceof i){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},i.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},i.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},i.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Q(e,t)},i.prototype.remove=function(t){var e=this._finalizers;e&&Q(e,t),t instanceof i&&t._removeParent(this)},i.EMPTY=function(){var t=new i;return t.closed=!0,t}(),i}(),xt=B.EMPTY;function Pt(i){return i instanceof B||i&&"closed"in i&&b(i.remove)&&b(i.add)&&b(i.unsubscribe)}function pt(i){b(i)?i():i.unsubscribe()}var Qt={Promise:void 0},Xt={setTimeout:function(i,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setTimeout.apply(void 0,Z([i,t],K(e)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function te(i){Xt.setTimeout(function(){throw i})}function dt(){}function L(i){i()}var Ot=function(i){k(t,i);function t(e){var r=i.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Pt(e)&&e.add(r)):r.destination=ie,r}return t.create=function(e,r,n){return new X(e,r,n)},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,i.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}(B),ee=function(){function i(t){this.partialObserver=t}return i.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){j(r)}},i.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){j(r)}else j(t)},i.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){j(e)}},i}(),X=function(i){k(t,i);function t(e,r,n){var s=i.call(this)||this,o;return b(e)||!e?o={next:e??void 0,error:r??void 0,complete:n??void 0}:o=e,s.destination=new ee(o),s}return t}(Ot);function j(i){te(i)}function re(i){throw i}var ie={closed:!0,next:dt,error:re,complete:dt},ne=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function se(i){return i}function oe(i){return i.length===0?se:i.length===1?i[0]:function(e){return i.reduce(function(r,n){return n(r)},e)}}var yt=function(){function i(t){t&&(this._subscribe=t)}return i.prototype.lift=function(t){var e=new i;return e.source=this,e.operator=t,e},i.prototype.subscribe=function(t,e,r){var n=this,s=le(t)?t:new X(t,e,r);return L(function(){var o=n,c=o.operator,a=o.source;s.add(c?c.call(s,a):a?n._subscribe(s):n._trySubscribe(s))}),s},i.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},i.prototype.forEach=function(t,e){var r=this;return e=vt(e),new e(function(n,s){var o=new X({next:function(c){try{t(c)}catch(a){s(a),o.unsubscribe()}},error:s,complete:n});r.subscribe(o)})},i.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},i.prototype[ne]=function(){return this},i.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return oe(t)(this)},i.prototype.toPromise=function(t){var e=this;return t=vt(t),new t(function(r,n){var s;e.subscribe(function(o){return s=o},function(o){return n(o)},function(){return r(s)})})},i.create=function(t){return new i(t)},i}();function vt(i){var t;return(t=i??Qt.Promise)!==null&&t!==void 0?t:Promise}function ae(i){return i&&b(i.next)&&b(i.error)&&b(i.complete)}function le(i){return i&&i instanceof Ot||ae(i)&&Pt(i)}var ce=wt(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ut=function(i){k(t,i);function t(){var e=i.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 bt(this,this);return r.operator=e,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new ce},t.prototype.next=function(e){var r=this;L(function(){var n,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=M(r.currentObservers),c=o.next();!c.done;c=o.next()){var a=c.value;a.next(e)}}catch(l){n={error:l}}finally{try{c&&!c.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.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 n=r.observers;n.length;)n.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(),i.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,n=this,s=n.hasError,o=n.isStopped,c=n.observers;return s||o?xt:(this.currentObservers=null,c.push(e),new B(function(){r.currentObservers=null,Q(c,e)}))},t.prototype._checkFinalizedStatuses=function(e){var r=this,n=r.hasError,s=r.thrownError,o=r.isStopped;n?e.error(s):o&&e.complete()},t.prototype.asObservable=function(){var e=new yt;return e.source=this,e},t.create=function(e,r){return new bt(e,r)},t}(yt),bt=function(i){k(t,i);function t(e,r){var n=i.call(this)||this;return n.destination=e,n.source=r,n}return t.prototype.next=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)},t.prototype.error=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.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,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:xt},t}(Ut),he=function(i){k(t,i);function t(e){var r=i.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=i.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},t.prototype.getValue=function(){var e=this,r=e.hasError,n=e.thrownError,s=e._value;if(r)throw n;return this._throwIfClosed(),s},t.prototype.next=function(e){i.prototype.next.call(this,this._value=e)},t}(Ut);class me extends C{constructor(){super(...arguments),this.isMealzInternalReady$=new he(!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 s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("href",t.toString()),s.setAttribute("id",r),document.head.appendChild(s)}})}removeStyles(){!this.styleURLs||this.styleURLs.length===0||setTimeout(()=>{this.styleURLs.forEach((t,e)=>{const r=`${this.tagName.toLowerCase()}-style-${e}`,n=document.head.querySelector(`#${r}`);n&&document.getElementsByTagName(this.tagName).length===0&&document.head.removeChild(n)})},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,n,s;if((r=(e=rt)==null?void 0:e.supplier)!=null&&r.getToken()&&((s=(n=rt)==null?void 0:n.user)!=null&&s.getLanguage())){this.isMealzInternalReady$.next(!0);return}else{if(t>50){console.warn("[MealzInternal] Unable to find the supplier token or user language. Please verify the configuration.");return}setTimeout(()=>this.checkMealzInternalStatus(t+1),100)}if(t>=50){console.warn("Unable to find the supplier token or user language. Please verify the configuration.");return}setTimeout(()=>this.checkMealzInternalStatus(t+1),100)}getBaseURL(){return new URL("..",import.meta.url).toString()}}export{he as B,p as D,me as N,yt as O,Jt as Q,E as R,Ot as S,k as _,B as a,Z as b,K as c,Q as d,be as e,$t as f,ve as g,J as h,b as i,M as j,pe as k,ye as l,_e as m,Ut as n,ne as o,X as p,dt as q,te as r,de as s,se as t,Y as u};
|
|
21
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function Q(i,t){if(i){var e=i.indexOf(t);0<=e&&i.splice(e,1)}}var B=function(){function i(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var t,e,r,n,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var c=M(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){s=y instanceof F?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=M(u),h=d.next();!h.done;h=d.next()){var v=h.value;try{pt(v)}catch(y){s=s??[],y instanceof F?s=Z(Z([],K(s)),K(y.errors)):s.push(y)}}}catch(y){r={error:y}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}if(s)throw new F(s)}},i.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)pt(t);else{if(t instanceof i){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},i.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},i.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},i.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Q(e,t)},i.prototype.remove=function(t){var e=this._finalizers;e&&Q(e,t),t instanceof i&&t._removeParent(this)},i.EMPTY=function(){var t=new i;return t.closed=!0,t}(),i}(),xt=B.EMPTY;function Pt(i){return i instanceof B||i&&"closed"in i&&b(i.remove)&&b(i.add)&&b(i.unsubscribe)}function pt(i){b(i)?i():i.unsubscribe()}var Qt={Promise:void 0},Xt={setTimeout:function(i,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setTimeout.apply(void 0,Z([i,t],K(e)))},clearTimeout:function(i){return clearTimeout(i)},delegate:void 0};function te(i){Xt.setTimeout(function(){throw i})}function dt(){}function L(i){i()}var Ot=function(i){k(t,i);function t(e){var r=i.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Pt(e)&&e.add(r)):r.destination=ie,r}return t.create=function(e,r,n){return new X(e,r,n)},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,i.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}(B),ee=function(){function i(t){this.partialObserver=t}return i.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){j(r)}},i.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){j(r)}else j(t)},i.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){j(e)}},i}(),X=function(i){k(t,i);function t(e,r,n){var s=i.call(this)||this,o;return b(e)||!e?o={next:e??void 0,error:r??void 0,complete:n??void 0}:o=e,s.destination=new ee(o),s}return t}(Ot);function j(i){te(i)}function re(i){throw i}var ie={closed:!0,next:dt,error:re,complete:dt},ne=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function se(i){return i}function oe(i){return i.length===0?se:i.length===1?i[0]:function(e){return i.reduce(function(r,n){return n(r)},e)}}var yt=function(){function i(t){t&&(this._subscribe=t)}return i.prototype.lift=function(t){var e=new i;return e.source=this,e.operator=t,e},i.prototype.subscribe=function(t,e,r){var n=this,s=le(t)?t:new X(t,e,r);return L(function(){var o=n,c=o.operator,a=o.source;s.add(c?c.call(s,a):a?n._subscribe(s):n._trySubscribe(s))}),s},i.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},i.prototype.forEach=function(t,e){var r=this;return e=vt(e),new e(function(n,s){var o=new X({next:function(c){try{t(c)}catch(a){s(a),o.unsubscribe()}},error:s,complete:n});r.subscribe(o)})},i.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},i.prototype[ne]=function(){return this},i.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return oe(t)(this)},i.prototype.toPromise=function(t){var e=this;return t=vt(t),new t(function(r,n){var s;e.subscribe(function(o){return s=o},function(o){return n(o)},function(){return r(s)})})},i.create=function(t){return new i(t)},i}();function vt(i){var t;return(t=i??Qt.Promise)!==null&&t!==void 0?t:Promise}function ae(i){return i&&b(i.next)&&b(i.error)&&b(i.complete)}function le(i){return i&&i instanceof Ot||ae(i)&&Pt(i)}var ce=wt(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ut=function(i){k(t,i);function t(){var e=i.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 bt(this,this);return r.operator=e,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new ce},t.prototype.next=function(e){var r=this;L(function(){var n,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=M(r.currentObservers),c=o.next();!c.done;c=o.next()){var a=c.value;a.next(e)}}catch(l){n={error:l}}finally{try{c&&!c.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.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 n=r.observers;n.length;)n.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(),i.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,n=this,s=n.hasError,o=n.isStopped,c=n.observers;return s||o?xt:(this.currentObservers=null,c.push(e),new B(function(){r.currentObservers=null,Q(c,e)}))},t.prototype._checkFinalizedStatuses=function(e){var r=this,n=r.hasError,s=r.thrownError,o=r.isStopped;n?e.error(s):o&&e.complete()},t.prototype.asObservable=function(){var e=new yt;return e.source=this,e},t.create=function(e,r){return new bt(e,r)},t}(yt),bt=function(i){k(t,i);function t(e,r){var n=i.call(this)||this;return n.destination=e,n.source=r,n}return t.prototype.next=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)},t.prototype.error=function(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.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,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:xt},t}(Ut),he=function(i){k(t,i);function t(e){var r=i.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=i.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},t.prototype.getValue=function(){var e=this,r=e.hasError,n=e.thrownError,s=e._value;if(r)throw n;return this._throwIfClosed(),s},t.prototype.next=function(e){i.prototype.next.call(this,this._value=e)},t}(Ut);class me extends C{constructor(){super(...arguments),this.isMealzInternalReady$=new he(!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 s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("href",t.toString()),s.setAttribute("id",r),document.head.appendChild(s)}})}removeStyles(){!this.styleURLs||this.styleURLs.length===0||setTimeout(()=>{this.styleURLs.forEach((t,e)=>{const r=`${this.tagName.toLowerCase()}-style-${e}`,n=document.head.querySelector(`#${r}`);n&&document.getElementsByTagName(this.tagName).length===0&&document.head.removeChild(n)})},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,n,s;if((r=(e=rt)==null?void 0:e.supplier)!=null&&r.getToken()&&((s=(n=rt)==null?void 0:n.user)!=null&&s.getLanguage())){this.isMealzInternalReady$.next(!0);return}else{if(t>50){console.warn("[MealzInternal] Unable to find the supplier token or user language. Please verify the configuration.");return}setTimeout(()=>this.checkMealzInternalStatus(t+1),100)}if(t>=50){console.warn("Unable to find the supplier token or user language. Please verify the configuration.");return}setTimeout(()=>this.checkMealzInternalStatus(t+1),100)}getBaseURL(){return new URL("..",import.meta.url).toString()}}export{he as B,p as D,me as N,yt as O,Jt as Q,E as R,Ot as S,k as _,B as a,Z as b,K as c,Q as d,be as e,$t as f,ve as g,J as h,b as i,M as j,pe as k,ye as l,_e as m,Ut as n,ne as o,X as p,dt as q,te as r,de as s,se as t,Y as u,wt as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e}from"./args-BozZ6oU-.js";import{f as t}from"./from-CAidt5N1.js";function s(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var a=e(o);return t(o,a)}export{s as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as s}from"./no-shadow-element-
|
|
1
|
+
import{k as s}from"./no-shadow-element-YPHUv5PR.js";import{m as i}from"./mealz-sdk-E_fNZM-c.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-8Arhhb-p.js";import{N as b,k as a,n as E,D as z}from"./no-shadow-element-YPHUv5PR.js";import{t as v}from"./custom-element-BhZVzxrc.js";import{n as l}from"./property-_7ObQ3dl.js";import{P as k,S as P}from"./price-DAxY_7sk.js";import{c as x}from"./capitalize-DUAqYmp4.js";import{m as c}from"./mealz-sdk-E_fNZM-c.js";import{d as I}from"./delay-BNnJ-6LE.js";var O=Object.defineProperty,C=Object.getOwnPropertyDescriptor,g=(e,s,r,i)=>{for(var t=i>1?void 0:i?C(s,r):s,n=e.length-1,d;n>=0;n--)(d=e[n])&&(t=(i?d(s,r,t):d(t))||t);return i&&t&&O(s,r,t),t};let u=class extends b{constructor(){super(),this.isSponsored=!1,this.priceService=k.getInstance(),this.styleURL=new URL("./product-badges/product-badges.css",this.getBaseURL())}formatNumber(e){const s=c.user.getLanguage()||"fr";return new Intl.NumberFormat(s,{minimumFractionDigits:1,maximumFractionDigits:2}).format(e)}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 n}from"./no-shadow-element-
|
|
1
|
+
import{N as c,k as n}from"./no-shadow-element-YPHUv5PR.js";import{t as l}from"./custom-element-BhZVzxrc.js";import{n as d}from"./property-_7ObQ3dl.js";import{P as u}from"./price-DAxY_7sk.js";var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,o,s,r)=>{for(var t=r>1?void 0:r?f(o,s):o,a=e.length-1,m;a>=0;a--)(m=e[a])&&(t=(r?m(o,s,t):m(t))||t);return r&&t&&g(o,s,t),t};let i=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 n`
|
|
2
2
|
<div class="mealz-promotion-badge">
|
|
3
3
|
${((e=this.priceData)==null?void 0:e.discountAmount)>0?n`
|
|
4
4
|
<div class="mealz-ds-badge mealz-promotion-badge__promotion">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(t,e=".mealz-planner-current-menu__mobile-header",i="(max-width: 768px)"){const n=e?t.querySelector(e):null;return n?window.getComputedStyle(n).display!=="none":window.matchMedia(i).matches}function o(t,e,i=".mealz-planner-current-menu__mobile-header",n="(max-width: 768px)"){const r=()=>{const s=a(t,i,n);e(s)};return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)}export{o as a,a as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as n}from"./filter-BZ75lS5D.js";function o(r){return n(function(f,t){return r<=t})}export{o as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o,c as s}from"./OperatorSubscriber-
|
|
1
|
+
import{o,c as s}from"./OperatorSubscriber-BaYaQC1O.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 +1 @@
|
|
|
1
|
-
import{i as v}from"./innerFrom-
|
|
1
|
+
import{i as v}from"./innerFrom-BgPDnAsH.js";import{o as l,c as a}from"./OperatorSubscriber-BaYaQC1O.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-0eVnsLmk.js";import{o as f,c as i}from"./OperatorSubscriber-BaYaQC1O.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,i as d}from"./no-shadow-element-
|
|
1
|
+
import{t as e,i as d}from"./no-shadow-element-YPHUv5PR.js";import{o as f,c as s}from"./OperatorSubscriber-BaYaQC1O.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as p}from"./no-shadow-element-YPHUv5PR.js";import{b as m}from"./async-CFBGA-Dz.js";import{i as r}from"./isScheduler-C5PGPVU1.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,8 +1,8 @@
|
|
|
1
|
-
import{D as s,R as o}from"./no-shadow-element-
|
|
1
|
+
import{D as s,R as o}from"./no-shadow-element-YPHUv5PR.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const u={CHILD:2},c=i=>(...t)=>({_$litDirective$:i,values:t});class h{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this.t=t,this._$AM=r,this.i=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}}/**
|
|
5
|
+
*/const u={ATTRIBUTE:1,CHILD:2},c=i=>(...t)=>({_$litDirective$:i,values:t});class h{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this.t=t,this._$AM=r,this.i=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}}/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as c}from"./no-shadow-element-
|
|
1
|
+
import{n as c}from"./no-shadow-element-YPHUv5PR.js";import{d as h}from"./debounceTime-B4DpnstH.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{i as d,O as f,N as h,k as o}from"../assets/no-shadow-element-
|
|
1
|
+
import{i as d,O as f,N as h,k as o}from"../assets/no-shadow-element-YPHUv5PR.js";import{t as m}from"../assets/custom-element-BhZVzxrc.js";import{m as i,w as b}from"../assets/mealz-sdk-E_fNZM-c.js";import{s as S}from"../assets/skip-zbH-ayby.js";import{t as T}from"../assets/take-CozE9iSG.js";import"../assets/filter-BZ75lS5D.js";import"../assets/OperatorSubscriber-BaYaQC1O.js";import"../assets/empty-0eVnsLmk.js";function u(s){return!!s&&(s instanceof f||d(s.lift)&&d(s.subscribe))}var k=Object.getOwnPropertyDescriptor,z=(s,e,t,a)=>{for(var r=a>1?void 0:a?k(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(r=l(r)||r);return r};let p=class extends h{constructor(){super(),this.supplierName=null,this.displayFirstStep=!1,this.displaySecondStep=!1,this.subscriptions=[],this.close=()=>{this.displayFirstStep=!1,this.displaySecondStep=!1,this.requestUpdate()},this.openFirstStep=()=>{this.displayFirstStep=!0,this.displaySecondStep=!1,this.requestUpdate()},this.goToSecondStep=()=>{var s,e;this.subscriptions.push((e=(s=i)==null?void 0:s.basket)==null?void 0:e.refreshCurrentBasket().pipe(S(1),T(1)).subscribe(t=>{var r;((r=t==null?void 0:t.attributes)==null?void 0:r.status)==="transferring"&&(this.displayFirstStep=!1,this.displaySecondStep=!0,this.requestUpdate())}))},this.cancelTransfer=()=>{var e;const s=(e=i)==null?void 0:e.basketTransfer.abortTransfer();if(u(s)){this.subscriptions.push(s.subscribe(()=>this.close()));return}this.close()},this.continueTransfer=()=>{var s,e,t,a;this.displayFirstStep=!0,this.displaySecondStep=!1,this.requestUpdate(),typeof((e=(s=i)==null?void 0:s.basket)==null?void 0:e.transfer)=="function"&&i.basketTransfer.transfer(),typeof((a=(t=i)==null?void 0:t.basketTransfer)==null?void 0:a.navigateToTransferUrl)=="function"&&i.basketTransfer.navigateToTransferUrl()},this.styleURL=new URL("./basket-transfer-modal/basket-transfer-modal.css",this.getBaseURL())}connectedCallback(){super.connectedCallback(),b().then(()=>{this.listenToPos(),this.listenToTransferState()}).catch(s=>console.error("[basket-transfer-modal] Mealz SDK unavailable",s))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(s=>s.unsubscribe())}render(){return!this.displayFirstStep&&!this.displaySecondStep?o``:o`
|
|
2
2
|
<mealz-modal
|
|
3
3
|
.titleSlot=${o`<span class="mealz-ds-text weight-xxl">Transfert du panier</span>`}
|
|
4
4
|
.contentSlot=${this.displaySecondStep?this.renderTransferModalConfirm():this.renderTransferModalInitial()}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/slider-tabs.min.js";import"../../store-locator/store-locator.min.js";import{N as R,k as l,D as _,s as M,R as O}from"../../assets/no-shadow-element-
|
|
1
|
+
import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/slider-tabs.min.js";import"../../store-locator/store-locator.min.js";import{N as R,k as l,D as _,s as M,R as O}from"../../assets/no-shadow-element-YPHUv5PR.js";import{t as x}from"../../assets/custom-element-BhZVzxrc.js";import{n as f}from"../../assets/property-_7ObQ3dl.js";import{m as c,a as B}from"../../assets/mealz-sdk-E_fNZM-c.js";import"../../counter/counter.min.js";import"../../price/price.min.js";import"../../modal/modal.min.js";import{P as N}from"../../assets/price-DAxY_7sk.js";import{c as D}from"../../assets/capitalize-DUAqYmp4.js";import{e as q,i as L,t as V}from"../../assets/unsafe-html-CY0Np4--.js";import{d as F}from"../../assets/debounceTime-B4DpnstH.js";import{d as j}from"../../assets/delay-BNnJ-6LE.js";import{s as H}from"../../assets/switchMap-Dk_0Nhlo.js";import"../../assets/state-W5mtSPAs.js";import"../../assets/query-BApjzB0v.js";import"../../onboarding/events.min.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";import"../../assets/take-CozE9iSG.js";import"../../assets/empty-0eVnsLmk.js";import"../../assets/map-BVOhpQm0.js";import"../../assets/mergeMap-Dw_YYHwH.js";import"../../assets/innerFrom-BgPDnAsH.js";import"../../assets/executeSchedule-CEDvgTzM.js";import"../../assets/timer-D82-ik89.js";import"../../assets/isScheduler-C5PGPVU1.js";var G=Object.defineProperty,K=Object.getOwnPropertyDescriptor,U=(e,s,i,a)=>{for(var t=a>1?void 0:a?K(s,i):s,n=e.length-1,r;n>=0;n--)(r=e[n])&&(t=(a?r(s,i,t):r(t))||t);return a&&t&&G(s,i,t),t};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 weight-l">Besoin de compléter votre panier ?</span>
|
|
4
4
|
<button @click=${()=>this.openProductAdditionModal()}
|
|
@@ -113,7 +113,7 @@ import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/sl
|
|
|
113
113
|
* @license
|
|
114
114
|
* Copyright 2017 Google LLC
|
|
115
115
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
116
|
-
*/const A=(e,s,i)=>{const a=new Map;for(let t=s;t<=i;t++)a.set(e[t],t);return a},ee=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,s,i){let a;i===void 0?i=s:s!==void 0&&(a=s);const t=[],n=[];let r=0;for(const o of e)t[r]=a?a(o,r):r,n[r]=i(o,r),r++;return{values:n,keys:t}}render(e,s,i){return this.dt(e,s,i).values}update(e,[s,i,a]){const t=X(e),{values:n,keys:r}=this.dt(s,i,a);if(!Array.isArray(t))return this.ut=r,n;const o=this.ut??(this.ut=[]),p=[];let m,v,d=0,h=t.length-1,u=0,b=n.length-1;for(;d<=h&&u<=b;)if(t[d]===null)d++;else if(t[h]===null)h--;else if(o[d]===r[u])p[u]=z(t[d],n[u]),d++,u++;else if(o[h]===r[b])p[b]=z(t[h],n[b]),h--,b--;else if(o[d]===r[b])p[b]=z(t[d],n[b]),y(e,p[b+1],t[d]),d++,b--;else if(o[h]===r[u])p[u]=z(t[h],n[u]),y(e,t[d],t[h]),h--,u++;else if(m===void 0&&(m=A(r,u,b),v=A(o,d,h)),m.has(o[d]))if(m.has(o[h])){const k=v.get(r[u]),$=k!==void 0?t[k]:null;if($===null){const S=y(e,t[d]);z(S,n[u]),p[u]=S}else p[u]=z($,n[u]),y(e,t[d],$),t[k]=null;u++}else P(t[h]),h--;else P(t[d]),d++;for(;u<=b;){const k=y(e,p[b+1]);z(k,n[u]),p[u++]=k}for(;d<=h;){const k=t[d++];k!==null&&P(k)}return this.ut=r,Z(e,p),O}}),C={isRecipeDetailsVisible:{paramName:"displayRecipe",getValue:()=>{var s;const e=c.recipes.displayedRecipe$.value;return((s=e==null?void 0:e.recipe)==null?void 0:s.id)||null},openDrawer:e=>{c.recipes.openDetails(e)}},isBasketPreviewVisible:{paramName:"myMeals",getValue:()=>{const{activeTabIndex:e}=c.basket.basketPreviewState$.getValue();return e===1?"products":"recipes"},openDrawer:e=>{c.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:e==="products"?1:0})}}};function te(){return Object.values(C).map(e=>e.paramName)}function
|
|
116
|
+
*/const A=(e,s,i)=>{const a=new Map;for(let t=s;t<=i;t++)a.set(e[t],t);return a},ee=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,s,i){let a;i===void 0?i=s:s!==void 0&&(a=s);const t=[],n=[];let r=0;for(const o of e)t[r]=a?a(o,r):r,n[r]=i(o,r),r++;return{values:n,keys:t}}render(e,s,i){return this.dt(e,s,i).values}update(e,[s,i,a]){const t=X(e),{values:n,keys:r}=this.dt(s,i,a);if(!Array.isArray(t))return this.ut=r,n;const o=this.ut??(this.ut=[]),p=[];let m,v,d=0,h=t.length-1,u=0,b=n.length-1;for(;d<=h&&u<=b;)if(t[d]===null)d++;else if(t[h]===null)h--;else if(o[d]===r[u])p[u]=z(t[d],n[u]),d++,u++;else if(o[h]===r[b])p[b]=z(t[h],n[b]),h--,b--;else if(o[d]===r[b])p[b]=z(t[d],n[b]),y(e,p[b+1],t[d]),d++,b--;else if(o[h]===r[u])p[u]=z(t[h],n[u]),y(e,t[d],t[h]),h--,u++;else if(m===void 0&&(m=A(r,u,b),v=A(o,d,h)),m.has(o[d]))if(m.has(o[h])){const k=v.get(r[u]),$=k!==void 0?t[k]:null;if($===null){const S=y(e,t[d]);z(S,n[u]),p[u]=S}else p[u]=z($,n[u]),y(e,t[d],$),t[k]=null;u++}else P(t[h]),h--;else P(t[d]),d++;for(;u<=b;){const k=y(e,p[b+1]);z(k,n[u]),p[u++]=k}for(;d<=h;){const k=t[d++];k!==null&&P(k)}return this.ut=r,Z(e,p),O}}),C={isRecipeDetailsVisible:{paramName:"displayRecipe",getValue:()=>{var s;const e=c.recipes.displayedRecipe$.value;return((s=e==null?void 0:e.recipe)==null?void 0:s.id)||null},openDrawer:e=>{c.recipes.openDetails(e)}},isBasketPreviewVisible:{paramName:"myMeals",getValue:()=>{const{activeTabIndex:e}=c.basket.basketPreviewState$.getValue();return e===1?"products":"recipes"},openDrawer:e=>{c.basket.basketPreviewState$.next({isOpen:!0,activeTabIndex:e==="products"?1:0})}}};function te(){return Object.values(C).map(e=>e.paramName)}function Be(){const e=new URL(window.location.href);for(const s of Object.values(C)){const i=e.searchParams.get(s.paramName);if(i&&s.openDrawer){s.openDrawer(i);return}}}function Ne(e){e.subscribe(s=>{const i=new URL(window.location.href);te().forEach(t=>{i.searchParams.delete(t)});const a=C[s];if(a){const t=a.getValue();t&&i.searchParams.set(a.paramName,t)}window.history.replaceState({},"",i.toString())})}function se(e){const s=new URL(window.location.href);s.searchParams.delete("myMeals"),e===0?s.searchParams.append("myMeals","recipes"):e===1&&s.searchParams.append("myMeals","products"),window.history.replaceState({},"",s.toString())}var ie=Object.getOwnPropertyDescriptor,ae=(e,s,i,a)=>{for(var t=a>1?void 0:a?ie(s,i):s,n=e.length-1,r;n>=0;n--)(r=e[n])&&(t=r(t)||t);return t};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=c.supplier.isNoSupplier(),this.noSupplier&&this.appendStoreIndicatorToDrawerHeader(),this.subscriptions.push(B.basket.recipeCount().subscribe(e=>{this.recipesCount=e,this.requestUpdate()}),c.basket.entries$().pipe(F(200)).subscribe(e=>{this.products=e.filter(s=>s.attributes.status==="active"),this.updateRecipeView()}),c.productAddition.productAdded$.pipe(j(200)).subscribe(e=>{this.selectedTabIndex=1,setTimeout(()=>this.scrollToAddedProduct(e),0),this.requestUpdate()}),c.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`
|
|
117
117
|
<div class="mealz-basket-preview">
|
|
118
118
|
${this.noSupplier?l`
|
|
119
119
|
<mealz-store-indicator .analyticsPath=${this.analyticsPath}></mealz-store-indicator>`:_}
|
|
@@ -230,4 +230,4 @@ import"../../store-indicator/store-indicator.min.js";import"../../slider-tabs/sl
|
|
|
230
230
|
panier
|
|
231
231
|
</h2>
|
|
232
232
|
</div>
|
|
233
|
-
`}appendStoreIndicatorToDrawerHeader(){const e=document.querySelector("mealz-drawer"),s=document.querySelector("mealz-store-indicator");if(!e||s)return;const i=e.getElementsByClassName("mealz-drawer__content-container")[0];i!=null&&i.querySelector("mealz-supplier-selector")||(this.drawerStoreIndicator=document.createElement("mealz-store-indicator"),this.drawerStoreIndicator.setAttribute("analyticsPath",this.analyticsPath),e.appendToHeaderComponent(this.drawerStoreIndicator))}placeOrder(){this.openBasketTransferModal(),c.basketTransfer.transfer()}openBasketTransferModal(){let e=document.querySelector("mealz-basket-transfer-modal");e||(e=document.createElement("mealz-basket-transfer-modal"),document.body.appendChild(e))}recipeCardClick(e){c.recipes.openDetails(e.id,e.guests,this.analyticsPath)}removeRecipeClick(e){e.isGettingRemoved=!0,this.requestUpdate(),c.basket.removeRecipe(e.id,this.analyticsPath).subscribe(()=>{e.isGettingRemoved=!1,this.recipePreviews=this.recipePreviews.filter(s=>s.id!==e.id),this.requestUpdate()})}updateTabIndex(e){this.selectedTabIndex=e,se(e),this.selectedTabIndex===0?(this.analyticsPath="/basket/recipes",this.pageview()):(this.analyticsPath="/basket/products",this.pageview()),this.requestUpdate()}updateRecipeView(){const e=c.basket,s=e.buildPreview(),i=typeof e.waitForBasketEntries=="function"?e.waitForBasketEntries().pipe(H(()=>s)):s;this.subscriptions.push(i.subscribe(a=>{a.map(t=>t.isGettingRemoved=!1),this.recipePreviews=a,console.log("this.recipePreviews",this.recipePreviews),this.requestUpdate()}))}scrollToAddedProduct(e){var i;const s=document.querySelector(`#mealz-basket-preview-product-${e}`);if(s)s.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(c.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()||c.analytics.sendEvent("pageview",this.analyticsPath,{})}sendCloseEvent(){this.isHidden()||c.analytics.sendEvent("basket.close",this.analyticsPath,{})}};I=ae([x("mealz-basket-preview")],I);customElements.get("mealz-basket-preview")||customElements.define("mealz-basket-preview",I);export{
|
|
233
|
+
`}appendStoreIndicatorToDrawerHeader(){const e=document.querySelector("mealz-drawer"),s=document.querySelector("mealz-store-indicator");if(!e||s)return;const i=e.getElementsByClassName("mealz-drawer__content-container")[0];i!=null&&i.querySelector("mealz-supplier-selector")||(this.drawerStoreIndicator=document.createElement("mealz-store-indicator"),this.drawerStoreIndicator.setAttribute("analyticsPath",this.analyticsPath),e.appendToHeaderComponent(this.drawerStoreIndicator))}placeOrder(){this.openBasketTransferModal(),c.basketTransfer.transfer()}openBasketTransferModal(){let e=document.querySelector("mealz-basket-transfer-modal");e||(e=document.createElement("mealz-basket-transfer-modal"),document.body.appendChild(e))}recipeCardClick(e){c.recipes.openDetails(e.id,e.guests,this.analyticsPath)}removeRecipeClick(e){e.isGettingRemoved=!0,this.requestUpdate(),c.basket.removeRecipe(e.id,this.analyticsPath).subscribe(()=>{e.isGettingRemoved=!1,this.recipePreviews=this.recipePreviews.filter(s=>s.id!==e.id),this.requestUpdate()})}updateTabIndex(e){this.selectedTabIndex=e,se(e),this.selectedTabIndex===0?(this.analyticsPath="/basket/recipes",this.pageview()):(this.analyticsPath="/basket/products",this.pageview()),this.requestUpdate()}updateRecipeView(){const e=c.basket,s=e.buildPreview(),i=typeof e.waitForBasketEntries=="function"?e.waitForBasketEntries().pipe(H(()=>s)):s;this.subscriptions.push(i.subscribe(a=>{a.map(t=>t.isGettingRemoved=!1),this.recipePreviews=a,console.log("this.recipePreviews",this.recipePreviews),this.requestUpdate()}))}scrollToAddedProduct(e){var i;const s=document.querySelector(`#mealz-basket-preview-product-${e}`);if(s)s.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(c.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()||c.analytics.sendEvent("pageview",this.analyticsPath,{})}sendCloseEvent(){this.isHidden()||c.analytics.sendEvent("basket.close",this.analyticsPath,{})}};I=ae([x("mealz-basket-preview")],I);customElements.get("mealz-basket-preview")||customElements.define("mealz-basket-preview",I);export{Ne as l,Be as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as d}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-YPHUv5PR.js";import{C as h}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BZFnRy_K.js";import{w as u,m as o}from"../../assets/mealz-sdk-E_fNZM-c.js";import"../../assets/http-Bepz6wA4.js";import"../../assets/innerFrom-BgPDnAsH.js";import"../../assets/mergeMap-Dw_YYHwH.js";import"../../assets/map-BVOhpQm0.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";import"../../assets/executeSchedule-CEDvgTzM.js";import"../../assets/mapOneOrManyArgs-COA1aRZM.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/timer-D82-ik89.js";import"../../assets/isScheduler-C5PGPVU1.js";var C=Object.getOwnPropertyDescriptor,f=(e,t,n,s)=>{for(var a=s>1?void 0:s?C(t,n):t,r=e.length-1,i;r>=0;r--)(i=e[r])&&(a=i(a)||a);return a};let c=class extends h{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),u().then(()=>{var e,t;(t=(e=o)==null?void 0:e.preferences)!=null&&t.preferencesChanged$&&this.subscriptions.push(o.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}).catch(e=>{console.warn("Failed to initialize preferences subscription:",e)})}disconnectedCallback(){super.disconnectedCallback()}render(){var p;const e=(p=this.attributes["starting-data"])==null?void 0:p.value;if(!e||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:t,packageId:n,posId:s,loadMoreURL:a,displayRecipeVariant:r,search:i,sessionId:l,path:m}=JSON.parse(e);g(l),this.analyticsPath=m,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:r,loadMoreURL:a,sessionId:l,pageSize:t,storeId:s,packageId:n,search:i,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){o?(o.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};c=f([d("mealz-catalog-category")],c);customElements.get("mealz-catalog-category")||customElements.define("mealz-catalog-category",c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-
|
|
1
|
+
import{t as g}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-YPHUv5PR.js";import{C as m}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BZFnRy_K.js";import{m as l}from"../../assets/mealz-sdk-E_fNZM-c.js";import{s as u}from"../../assets/skip-zbH-ayby.js";import"../../assets/http-Bepz6wA4.js";import"../../assets/innerFrom-BgPDnAsH.js";import"../../assets/mergeMap-Dw_YYHwH.js";import"../../assets/map-BVOhpQm0.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";import"../../assets/executeSchedule-CEDvgTzM.js";import"../../assets/mapOneOrManyArgs-COA1aRZM.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/timer-D82-ik89.js";import"../../assets/isScheduler-C5PGPVU1.js";import"../../assets/filter-BZ75lS5D.js";var f=Object.getOwnPropertyDescriptor,v=(e,t,s,o)=>{for(var i=o>1?void 0:o?f(t,s):t,a=e.length-1,r;a>=0;a--)(r=e[a])&&(i=r(i)||i);return i};let n=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(l.user.isAuthenticated().pipe(u(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var d;const e=(d=this.attributes["starting-data"])==null?void 0:d.value;if(!e)return;const{pageSize:t,storeId:s,loadMoreURL:o,displayRecipeVariant:i,search:a,sessionId:r,path:p}=JSON.parse(e);if(this.analyticsPath=p,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const c=this.querySelector(".mealz-catalog__list");c&&(h(r),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:o,sessionId:r,pageSize:t,storeId:s,packageId:null,search:a,listHTML:c}),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;l?((e=l.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return l.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const s=document.getElementById("mealz-recipe-card-"+e);s&&s.classList.toggle("hidden",t),this.requestUpdate()})}};n=v([g("mealz-catalog-favorites")],n);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as y}from"../catalog-load-more.min.js";import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-
|
|
1
|
+
import{C as y}from"../catalog-load-more.min.js";import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-YPHUv5PR.js";import{h as p}from"../../assets/session-handler-BZFnRy_K.js";import{m as h}from"../../assets/mealz-sdk-E_fNZM-c.js";import"../../assets/http-Bepz6wA4.js";import"../../assets/innerFrom-BgPDnAsH.js";import"../../assets/mergeMap-Dw_YYHwH.js";import"../../assets/map-BVOhpQm0.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";import"../../assets/executeSchedule-CEDvgTzM.js";import"../../assets/mapOneOrManyArgs-COA1aRZM.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/timer-D82-ik89.js";import"../../assets/isScheduler-C5PGPVU1.js";var m=Object.getOwnPropertyDescriptor,g=(t,e,r,i)=>{for(var s=i>1?void 0:i?m(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(s=o(s)||s);return s};let n=class extends y{constructor(){super(),this.retryCount=0,this.maxRetries=30,this.isHandlingHistory=!1,this.styleURL=new URL("./catalog/catalog-history/catalog-history.css",this.getBaseURL()),this.handleHistoryDrawer=this.handleHistoryDrawer.bind(this)}connectedCallback(){super.connectedCallback();const t=this.getAttribute("starting-data");if(!t)return;const{loadMoreURL:e,drawerDataURL:r,sessionId:i,pageSize:s,storeId:a,orders:o,path:l,historyStyle:d}=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=l,this.historyStyle=d,p(this.sessionId),this.removeAttribute("starting-data"),this.sendPageViewEvent(),this.initURLListener(),this.handleHistoryDrawer()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this.handleHistoryDrawer)}render(){const t=this.querySelector(".mealz-catalog__list");t&&(this.historyOrderListHTML=t,this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:this.loadMoreURL,sessionId:this.sessionId,pageSize:+this.pageSize,storeId:this.storeId,packageId:void 0,search:"",listHTML:this.historyOrderListHTML,historyStyle:this.historyStyle}))}handleHistoryDrawer(){if(!this.isHandlingHistory){this.isHandlingHistory=!0;try{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})}finally{setTimeout(()=>{this.isHandlingHistory=!1},0)}}}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(){h?(h.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=g([c("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}from"../../assets/no-shadow-element-
|
|
1
|
+
import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import{N as l}from"../../assets/no-shadow-element-YPHUv5PR.js";import{h as d}from"../../assets/session-handler-BZFnRy_K.js";import{V as m}from"../../assets/viewport-listener-CDsKFDz1.js";import{w as g,m as r}from"../../assets/mealz-sdk-E_fNZM-c.js";import"../../assets/debounceTime-B4DpnstH.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";var p=Object.getOwnPropertyDescriptor,y=(e,t,s,i)=>{for(var a=i>1?void 0:i?p(t,s):t,n=e.length-1,c;n>=0;n--)(c=e[n])&&(a=c(a)||a);return a};let o=class extends l{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),g().then(()=>{var e,t;(t=(e=r)==null?void 0:e.preferences)!=null&&t.preferencesChanged$&&this.subscriptions.push(r.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}).catch(e=>{console.warn("Failed to initialize preferences subscription:",e)})}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.viewportListeners.forEach(e=>e.disconnect()),this.viewportListeners=[]}render(){var a;const e=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!e)return;const{categories:t,path:s,sessionId:i}=JSON.parse(e);d(i),this.analyticsPath=s,this.categories=t,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((t,s)=>{t==null||t.addEventListener("click",()=>this.sendCategoryDisplay(s))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((t,s)=>{const i=new m(t,()=>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(e){var t;r.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(t=this.categories[Math.floor(e/2)])==null?void 0:t.id})}sendCategoryShow(e){var t;r.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(t=this.categories[e])==null?void 0:t.id})}};o=y([h("mealz-catalog-home")],o);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mealz-catalog-list__dish-type-filter{display:flex;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:24px 24px 6px}.mealz-catalog-list__dish-type-filter__chip+.mealz-catalog-list__dish-type-filter__chip{margin-left:8px}.mealz-catalog-list__dish-type-filter__chip.mealz-ds-badge.outline{border:none;padding:12px 16px}.mealz-catalog-list__dish-type-filter__chip.mealz-ds-badge.outline.active{background:var(--mealz-ds-color-primary, #24748F);border-color:var(--mealz-ds-color-primary, #24748F);color:var(--mealz-ds-color-neutral-white, #FFF)}@media (max-width: 700px){.mealz-catalog-list__dish-type-filter{padding:16px 16px 6px}}.mealz-drawer-view-swapper .mealz-catalog-list__dish-type-filter{padding-left:24px;padding-right:24px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as o}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/no-shadow-element-YPHUv5PR.js";import{C as c}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BZFnRy_K.js";import{w as d,m as p}from"../../assets/mealz-sdk-E_fNZM-c.js";import"../../assets/http-Bepz6wA4.js";import"../../assets/innerFrom-BgPDnAsH.js";import"../../assets/mergeMap-Dw_YYHwH.js";import"../../assets/map-BVOhpQm0.js";import"../../assets/OperatorSubscriber-BaYaQC1O.js";import"../../assets/executeSchedule-CEDvgTzM.js";import"../../assets/mapOneOrManyArgs-COA1aRZM.js";import"../../assets/async-CFBGA-Dz.js";import"../../assets/timer-D82-ik89.js";import"../../assets/isScheduler-C5PGPVU1.js";var u=Object.getOwnPropertyDescriptor,y=(e,t,i,s)=>{for(var r=s>1?void 0:s?u(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(r=n(r)||r);return r};let l=class extends c{constructor(){super(...arguments),this.planner=!1,this.recipeTypeFilter=!1}connectedCallback(){super.connectedCallback(),d().then(()=>{var e,t;(t=(e=p)==null?void 0:e.preferences)!=null&&t.preferencesChanged$&&this.subscriptions.push(p.preferences.preferencesChanged$().subscribe(()=>this.reloadPage()))}).catch(e=>{console.warn("Failed to initialize preferences subscription:",e)})}disconnectedCallback(){super.disconnectedCallback()}render(){const e=this.getStartingData();if(!e||!this.initializeRecipeCardListElement())return;const t=this.parseStartingData(e);t&&this.validateAndHandleSession(t.sessionId)&&(this.setFilterFlags(t.planner,t.recipeTypeFilter,t.recipeTypeId),this.initDishTypeFilter(),this.initializeCatalog(t),this.removeAttribute("starting-data"))}getStartingData(){return this.getAttribute("starting-data")}initializeRecipeCardListElement(){const e=this.querySelector(".mealz-catalog__list");return e?(this.recipeCardListHTML=e,!0):!1}parseStartingData(e){try{return JSON.parse(e)}catch(t){return console.warn("Invalid catalog list starting-data:",t),null}}validateAndHandleSession(e){return e?(h(e),!0):!1}setFilterFlags(e,t,i){this.planner=e===!0||e==="true",this.recipeTypeFilter=t===!0||t==="true",this.recipeTypeId=i||void 0}initializeCatalog(e){this.loadMoreRecipesOnScroll({displayRecipeVariant:e.displayRecipeVariant,loadMoreURL:e.loadMoreURL,sessionId:e.sessionId,pageSize:e.pageSize,storeId:e.storeId,search:e.search,listHTML:this.recipeCardListHTML,promotions:e.promotions,planner:this.planner,recipeTypeFilter:this.recipeTypeFilter,recipeTypeId:e.recipeTypeId})}initDishTypeFilter(){const e=this.getDishTypeFilterChips();!e||e.length===0||(this.applyActiveStateToChips(e,this.recipeTypeId),this.attachChipClickHandlers(e))}getDishTypeFilterChips(){const e=this.querySelector(".mealz-catalog-list__dish-type-filter");return!e||!this.recipeTypeFilter?null:Array.from(e.querySelectorAll(".mealz-catalog-list__dish-type-filter__chip"))}applyActiveStateToChips(e,t){e.forEach(i=>{const r=(i.getAttribute("data-recipe-type-id")||"")===(t||"");i.classList.toggle("active",r),i.setAttribute("aria-selected",r?"true":"false")})}attachChipClickHandlers(e){e.forEach(t=>{t.addEventListener("click",()=>this.handleDishTypeChipClick(t,e),{passive:!0})})}handleDishTypeChipClick(e,t){const i=e.getAttribute("data-recipe-type-id")||"";i!==(this.recipeTypeId||"")&&(this.recipeTypeId=i||void 0,this.applyActiveStateToChips(t,this.recipeTypeId),this.showLoader(),this.planner?this.handlePlannerDishTypeChange(i):this.handleNonPlannerDishTypeChange())}showLoader(){const e=this.querySelector(".mealz-ds-loader");e&&(e.style.display="block")}handlePlannerDishTypeChange(e){const t=new CustomEvent("dishTypeEvent",{detail:{mealType:e},bubbles:!0,composed:!0});this.dispatchEvent(t)}handleNonPlannerDishTypeChange(){const e=new URL(window.location.href);this.recipeTypeId?e.searchParams.set("recipe_type_id",this.recipeTypeId):e.searchParams.delete("recipe_type_id"),window.location.href=e.toString()}reloadPage(){location.reload()}};l=y([o("mealz-catalog-list")],l);customElements.get("mealz-catalog-list")||customElements.define("mealz-catalog-list",l);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as R,O as T,i as h,N as _}from"../assets/no-shadow-element-YPHUv5PR.js";import{b as S}from"../assets/http-Bepz6wA4.js";import{a as C,i as b}from"../assets/innerFrom-BgPDnAsH.js";import{m as H}from"../assets/mergeMap-Dw_YYHwH.js";import{m as k}from"../assets/mapOneOrManyArgs-COA1aRZM.js";import{a as O}from"../assets/async-CFBGA-Dz.js";import{o as z,c as y}from"../assets/OperatorSubscriber-BaYaQC1O.js";import{t as I}from"../assets/timer-D82-ik89.js";import"../assets/mealz-sdk-E_fNZM-c.js";import"../assets/map-BVOhpQm0.js";import"../assets/executeSchedule-CEDvgTzM.js";import"../assets/isScheduler-C5PGPVU1.js";var x=["addListener","removeListener"],V=["addEventListener","removeEventListener"],D=["on","off"];function E(i,e,t,r){if(h(t)&&(r=t,t=void 0),r)return E(i,e,t).pipe(k(r));var u=R(G(i)?V.map(function(s){return function(c){return i[s](e,c,t)}}):q(i)?x.map(M(i,e)):A(i)?D.map(M(i,e)):[],2),p=u[0],f=u[1];if(!p&&C(i))return H(function(s){return E(s,e,t)})(b(i));if(!p)throw new TypeError("Invalid event target");return new T(function(s){var c=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return s.next(1<a.length?a:a[0])};return p(c),function(){return f(c)}})}function M(i,e){return function(t){return function(r){return i[t](e,r)}}}function q(i){return h(i.addListener)&&h(i.removeListener)}function A(i){return h(i.on)&&h(i.off)}function G(i){return h(i.addEventListener)&&h(i.removeEventListener)}function F(i,e){return z(function(t,r){var u=e??{},p=u.leading,f=p===void 0?!0:p,s=u.trailing,c=s===void 0?!1:s,a=!1,l=null,o=null,m=!1,g=function(){o==null||o.unsubscribe(),o=null,c&&(v(),m&&r.complete())},L=function(){o=null,m&&r.complete()},n=function(d){return o=b(i(d)).subscribe(y(r,g,L))},v=function(){if(a){a=!1;var d=l;l=null,r.next(d),!m&&n(d)}};t.subscribe(y(r,function(d){a=!0,l=d,!(o&&!o.closed)&&(f?v():n(d))},function(){m=!0,!(c&&a&&o&&!o.closed)&&r.complete()}))})}function $(i,e,t){e===void 0&&(e=O);var r=I(i,e);return F(function(){return r},t)}const j=300;class te extends _{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:p,storeId:f,packageId:s,search:c,listHTML:a,promotions:l,planner:o,recipeTypeFilter:m,historyStyle:g,recipeTypeId:L}=e;this.isLoading=!0,this.toggleLoader(!0);const n=new URLSearchParams;n.append("size",p.toString()),n.append("page",this.page.toString()),t&&n.append("display_recipe_variant",t),s&&n.append("category_id",s),f&&n.append("store_id",f),c&&n.append("search",c),l&&n.append("promotions",l.toString()),o&&n.append("planner","true"),m&&n.append("recipe_type_filter","true"),g&&n.append("history_style",g),L&&n.append("recipe_type_id",L);try{const v=r.includes("?")?"&":"?",d=await fetch(r+v+n.toString(),{method:"GET",headers:S(u)});if(!d.ok)throw new Error(`Load more request failed with status: ${d.status}`);const w=await d.text();this.appendRecipesToList(w,a,p)}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{te as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as n}from"../../assets/custom-element-BhZVzxrc.js";import{N as m}from"../../assets/no-shadow-element-
|
|
1
|
+
import{t as n}from"../../assets/custom-element-BhZVzxrc.js";import{N as m}from"../../assets/no-shadow-element-YPHUv5PR.js";import"../../assets/mealz-sdk-E_fNZM-c.js";var b=Object.getOwnPropertyDescriptor,d=(l,c,r,s)=>{for(var e=s>1?void 0:s?b(c,r):c,a=l.length-1,o;a>=0;a--)(o=l[a])&&(e=o(e)||e);return e};let t=class extends m{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){}};t=d([n("mealz-catalog-tabs")],t);customElements.get("mealz-catalog-tabs")||customElements.define("mealz-catalog-tabs",t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as c}from"../../assets/no-shadow-element-
|
|
1
|
+
import{N as c}from"../../assets/no-shadow-element-YPHUv5PR.js";import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import{w as u,m as i}from"../../assets/mealz-sdk-E_fNZM-c.js";var p=Object.getOwnPropertyDescriptor,d=(e,t,s,r)=>{for(var a=r>1?void 0:r?p(t,s):t,o=e.length-1,n;o>=0;o--)(n=e[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(),u().then(()=>{var e,t,s;(e=i)!=null&&e.getStickyHeaderHeight&&this.subscriptions.push(i.getStickyHeaderHeight().subscribe(r=>{this.supplierHeaderHeight=r,this.setStickyObserver()})),(s=(t=i)==null?void 0:t.preferences)!=null&&s.preferencesChanged$&&this.subscriptions.push(i.preferences.preferencesChanged$().subscribe(()=>{var o,n;const r=(o=this.preferencesButton)==null?void 0:o.querySelector(".mealz-catalog-toolbar__controls__filter-badge"),a=(n=this.preferencesButton)==null?void 0:n.querySelector(".mealz-catalog-toolbar__loader");r&&r.classList.add("hidden"),a&&a.classList.remove("hidden")}))}).catch(e=>{console.warn("Failed to initialize SDK subscriptions:",e)})}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.toolbarObserver.unobserve(this.anchorElement)}render(){var a;const e=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!e)return;const{searchUrl:t,path:s,planner:r}=JSON.parse(e);this.searchUrl=t,this.path=s,r&&(this.planner=r),this.findElementsInDocument(),this.addEveryEventListeners(),this.updateClearButtonVisibility(),this.removeAttribute("starting-data")}firstUpdated(){this.setStickyObserver()}setStickyObserver(){var t;if(this.toolbar=document.querySelector(".mealz-catalog-toolbar"),this.anchorElement=document.querySelector(".mealz-catalog-toolbar__anchor"),!this.anchorElement||!this.toolbar)return;const e={rootMargin:`-${this.supplierHeaderHeight}px 0px 0px 0px`,threshold:1};(t=this.toolbarObserver)==null||t.unobserve(this),setTimeout(()=>this.setStickyToolbarStyle(),50),this.toolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle()},e),this.toolbarObserver.observe(this.anchorElement)}setStickyToolbarStyle(){const t=this.anchorElement.getBoundingClientRect().top<this.supplierHeaderHeight;this.anchorElement.style.height=t?this.toolbar.clientHeight+"px":"0px",this.toolbar.classList.toggle("sticking",t),this.toolbar.style.top=(t?this.supplierHeaderHeight:0)+"px",this.updateDOM(t)}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 e,t;this.addClickListener("preferencesButton",this.openPreferences.bind(this)),this.addClickListener("favoritesButton",this.sendFavoritesDisplay.bind(this)),this.addClickListener("clearButton",this.clearSearch.bind(this)),(e=this.searchInput)==null||e.addEventListener("keypress",s=>{s.key==="Enter"&&this.performSearch()}),(t=this.searchInput)==null||t.addEventListener("input",()=>{this.updateClearButtonVisibility()})}updateClearButtonVisibility(){if(this.clearButton){const e=this.searchInput.value.trim().length>0;this.clearButton.classList.toggle("hidden",!e)}}clearSearch(){this.searchInput&&(this.searchInput.value="",this.updateClearButtonVisibility(),this.performSearch())}performSearch(){const e=this.searchInput.value.trim();if(i.analytics.sendEvent("search",this.path,{search_term:e}),this.planner){const t=new CustomEvent("searchEvent",{detail:{searchQuery:e},bubbles:!0,composed:!0});this.dispatchEvent(t)}else{const t=this.searchUrl.includes("?")?"&":"?",s=e?`search=${encodeURIComponent(e)}`:"";window.location.href=e?`${this.searchUrl}${t}${s}`:this.searchUrl}}updateDOM(e){var r;const t=e?["ghost","square"]:["full"],s=e?["full"]:["ghost","square"];this.toggleClasses(this.favoritesButton,t,s),this.toggleClasses(this.preferencesButton,t,s),(r=this.backButton)==null||r.classList.toggle("hidden",!e)}toggleClasses(e,t,s){e==null||e.classList.remove(...s),e==null||e.classList.add(...t)}async openPreferences(){i.analytics.sendEvent("preferences.display",this.path,{});const e=document.querySelector("mealz-drawer-view-swapper");e.displayPreferences$.next(!0),await e.updateComplete}sendFavoritesDisplay(){i.analytics.sendEvent("liked.display",this.path,{})}};l=d([h("mealz-catalog-toolbar")],l);customElements.get("mealz-catalog-toolbar")||customElements.define("mealz-catalog-toolbar",l);
|