mealz-components 1.3.14 → 1.3.15

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.
Files changed (27) hide show
  1. package/dist/assets/async-CN53vnBN.js +3 -0
  2. package/dist/assets/lit-element-CNB4fo5J.js +19 -0
  3. package/dist/assets/no-shadow-element-BjktO6El.js +1 -0
  4. package/dist/assets/{viewport-listener-Ci9Ivhrq.js → viewport-listener-BrYUdpmX.js} +1 -1
  5. package/dist/catalog/catalog-breadcrumb/catalog-breadcrumb.min.js +1 -1
  6. package/dist/catalog/catalog-category/catalog-category.min.js +1 -1
  7. package/dist/catalog/catalog-favorites/catalog-favorites.min.js +1 -1
  8. package/dist/catalog/catalog-history/catalog-history.min.js +1 -1
  9. package/dist/catalog/catalog-home/catalog-home.min.js +1 -1
  10. package/dist/catalog/catalog-list/catalog-list.min.js +1 -1
  11. package/dist/catalog/catalog-load-more.min.js +1 -1
  12. package/dist/catalog/catalog-tabs/catalog-tabs.min.js +1 -1
  13. package/dist/catalog/catalog-toolbar/catalog-toolbar.min.js +1 -1
  14. package/dist/catalog/my-meals-button/my-meals-button.min.js +1 -1
  15. package/dist/drawer/drawer.min.js +2 -2
  16. package/dist/history-order/history-order.min.js +1 -1
  17. package/dist/history-order-expanded/history-order-expanded.min.js +1 -1
  18. package/dist/like-button/like-button.min.js +1 -1
  19. package/dist/recipe-card/recipe-card.min.js +1 -1
  20. package/dist/recipe-card-cta/recipe-card-cta.min.js +1 -1
  21. package/dist/recipe-pricing/recipe-pricing.css +1 -1
  22. package/dist/recipe-pricing/recipe-pricing.min.js +1 -1
  23. package/dist/store-locator/store-locator.min.js +3 -3
  24. package/package.json +1 -1
  25. package/dist/assets/async--NeWdP3z.js +0 -3
  26. package/dist/assets/lit-element-4gw3YGga.js +0 -19
  27. package/dist/assets/no-shadow-element-CaVIVF-o.js +0 -1
@@ -0,0 +1,3 @@
1
+ var x=function(r,e){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},x(r,e)};function b(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");x(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function nt(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function a(f){try{u(n.next(f))}catch(d){s(d)}}function c(f){try{u(n.throw(f))}catch(d){s(d)}}function u(f){f.done?i(f.value):o(f.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function it(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(t=0)),t;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,o=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function w(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function _(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function E(r){return this instanceof E?(this.v=r,this):new E(r)}function ot(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(p){return Promise.resolve(p).then(l,d)}}function a(l,p){n[l]&&(o[l]=function(h){return new Promise(function(q,M){i.push([l,h,q,M])>1||c(l,h)})},p&&(o[l]=p(o[l])))}function c(l,p){try{u(n[l](p))}catch(h){v(i[0][3],h)}}function u(l){l.value instanceof E?Promise.resolve(l.value.v).then(f,d):v(i[0][2],l)}function f(l){c("next",l)}function d(l){c("throw",l)}function v(l,p){l(p),i.shift(),i.length&&c(i[0][0],i[0][1])}}function st(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof w=="function"?w(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(s){return new Promise(function(a,c){s=r[i](s),o(a,c,s.done,s.value)})}}function o(i,s,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},s)}}function y(r){return typeof r=="function"}function Y(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var A=Y(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ `+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function I(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var g=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=w(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(h){e={error:h}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else s.remove(this);var f=this.initialTeardown;if(y(f))try{f()}catch(h){i=h instanceof A?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=w(d),l=v.next();!l.done;l=v.next()){var p=l.value;try{T(p)}catch(h){i=i??[],h instanceof A?i=_(_([],S(i)),S(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{l&&!l.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new A(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&I(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&I(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),ut=g.EMPTY;function R(r){return r instanceof g||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function T(r){y(r)?r():r.unsubscribe()}var V={Promise:void 0},B={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,_([r,e],S(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function C(r){B.setTimeout(function(){throw r})}function j(){}function G(r){r()}var P=function(r){b(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,R(t)&&t.add(n)):n.destination=L,n}return e.create=function(t,n,o){return new O(t,n,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(g),D=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){m(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){m(n)}else m(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){m(t)}},r}(),O=function(r){b(e,r);function e(t,n,o){var i=r.call(this)||this,s;return y(t)||!t?s={next:t??void 0,error:n??void 0,complete:o??void 0}:s=t,i.destination=new D(s),i}return e}(P);function m(r){C(r)}function H(r){throw r}var L={closed:!0,next:j,error:H,complete:j},J=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function K(r){return r}function Q(r){return r.length===0?K:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var ct=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=X(e)?e:new O(e,t,n);return G(function(){var s=o,a=s.operator,c=s.source;i.add(a?a.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=k(t),new t(function(o,i){var s=new O({next:function(a){try{e(a)}catch(c){i(c),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[J]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Q(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=k(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r}();function k(r){var e;return(e=r??V.Promise)!==null&&e!==void 0?e:Promise}function W(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function X(r){return r&&r instanceof P||W(r)&&R(r)}function Z(r){return y(r==null?void 0:r.lift)}function at(r){return function(e){if(Z(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(r,e,t,n,o){return new $(r,e,t,n,o)}var $=function(r){b(e,r);function e(t,n,o,i,s,a){var c=r.call(this,t)||this;return c.onFinalize=s,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(f){t.error(f)}}:r.prototype._next,c._error=i?function(u){try{i(u)}catch(f){t.error(f)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=o?function(){try{o()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return e.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))}},e}(P),z={now:function(){return Date.now()}},N=function(r){b(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e}(g),U={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,_([r,e],S(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},tt=function(r){b(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),U.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&U.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,I(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(N),F=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=z.now,r}(),rt=function(r){b(e,r);function e(t,n){n===void 0&&(n=F.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e}(F),et=new rt(tt),ft=et;export{ut as E,ct as O,g as S,ot as _,J as a,it as b,lt as c,E as d,w as e,nt as f,st as g,_ as h,y as i,S as j,ft as k,et as l,Y as m,b as n,at as o,G as p,I as q,C as r};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const T=globalThis,I=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,B=Symbol(),V=new WeakMap;let tt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==B)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(I&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=V.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&V.set(e,t))}return t}toString(){return this.cssText}};const ot=r=>new tt(typeof r=="string"?r:r+"",void 0,B),Pt=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new tt(e,r,B)},ht=(r,t)=>{if(I)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},W=I?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ot(e)})(r):r;/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const{is:at,defineProperty:lt,getOwnPropertyDescriptor:ct,getOwnPropertyNames:dt,getOwnPropertySymbols:pt,getPrototypeOf:ut}=Object,f=globalThis,q=f.trustedTypes,$t=q?q.emptyScript:"",M=f.reactiveElementPolyfillSupport,b=(r,t)=>r,j={toAttribute(r,t){switch(t){case Boolean:r=r?$t:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},et=(r,t)=>!at(r,t),K={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:et};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=K){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&lt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=ct(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const l=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??K}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=ut(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,s=[...dt(e),...pt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(W(i))}else t!==void 0&&e.push(W(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ht(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),l=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:j;this._$Em=i,this[i]=l.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??et)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[b("elementProperties")]=new Map,y[b("finalized")]=new Map,M==null||M({ReactiveElement:y}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const w=globalThis,N=w.trustedTypes,Z=N?N.createPolicy("lit-html",{createHTML:r=>r}):void 0,st="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,it="?"+_,_t=`<${it}>`,g=document,P=()=>g.createComment(""),C=r=>r===null||typeof r!="object"&&typeof r!="function",D=Array.isArray,ft=r=>D(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",k=`[
14
+ \f\r]`,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,J=/>/g,A=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,Q=/"/g,rt=/^(?:script|style|textarea|title)$/i,At=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ct=At(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Y=new WeakMap,m=g.createTreeWalker(g,129);function nt(r,t){if(!D(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Z!==void 0?Z.createHTML(t):t}const mt=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=S;for(let l=0;l<e;l++){const h=r[l];let c,p,a=-1,u=0;for(;u<h.length&&(n.lastIndex=u,p=n.exec(h),p!==null);)u=n.lastIndex,n===S?p[1]==="!--"?n=F:p[1]!==void 0?n=J:p[2]!==void 0?(rt.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=A):p[3]!==void 0&&(n=A):n===A?p[0]===">"?(n=i??S,a=-1):p[1]===void 0?a=-2:(a=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?A:p[3]==='"'?Q:G):n===Q||n===G?n=A:n===F||n===J?n=S:(n=A,i=void 0);const $=n===A&&r[l+1].startsWith("/>")?" ":"";o+=n===S?h+_t:a>=0?(s.push(c),h.slice(0,a)+st+h.slice(a)+_+$):h+_+(a===-2?l:$)}return[nt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class U{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const l=t.length-1,h=this.parts,[c,p]=mt(t,e);if(this.el=U.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const a of i.getAttributeNames())if(a.endsWith(st)){const u=p[n++],$=i.getAttribute(a).split(_),O=/([.?@])?(.*)/.exec(u);h.push({type:1,index:o,name:O[2],strings:$,ctor:O[1]==="."?yt:O[1]==="?"?vt:O[1]==="@"?Et:R}),i.removeAttribute(a)}else a.startsWith(_)&&(h.push({type:6,index:o}),i.removeAttribute(a));if(rt.test(i.tagName)){const a=i.textContent.split(_),u=a.length-1;if(u>0){i.textContent=N?N.emptyScript:"";for(let $=0;$<u;$++)i.append(a[$],P()),m.nextNode(),h.push({type:2,index:++o});i.append(a[u],P())}}}else if(i.nodeType===8)if(i.data===it)h.push({type:2,index:o});else{let a=-1;for(;(a=i.data.indexOf(_,a+1))!==-1;)h.push({type:7,index:o}),a+=_.length-1}o++}}static createElement(t,e){const s=g.createElement("template");return s.innerHTML=t,s}}function E(r,t,e=r,s){var n,l;if(t===v)return t;let i=s!==void 0?(n=e.o)==null?void 0:n[s]:e.l;const o=C(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e.o??(e.o=[]))[s]=i:e.l=i),i!==void 0&&(t=E(r,i._$AS(r,t.values),i,s)),t}class gt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??g).importNode(e,!0);m.currentNode=i;let o=m.nextNode(),n=0,l=0,h=s[0];for(;h!==void 0;){if(n===h.index){let c;h.type===2?c=new x(o,o.nextSibling,this,t):h.type===1?c=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(c=new St(o,this,t)),this._$AV.push(c),h=s[++l]}n!==(h==null?void 0:h.index)&&(o=m.nextNode(),n++)}return m.currentNode=g,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this.v=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),C(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ft(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=U.createElement(nt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new gt(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=Y.get(t.strings);return e===void 0&&Y.set(t.strings,e=new U(t)),e}k(t){D(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new x(this.O(P()),this.O(P()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(o===void 0)t=E(this,t,e,0),n=!C(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{const l=t;let h,c;for(t=o[0],h=0;h<o.length-1;h++)c=E(this,l[s+h],e,h),c===v&&(c=this._$AH[h]),n||(n=!C(c)||c!==this._$AH[h]),c===d?t=d:t!==d&&(t+=(c??"")+o[h+1]),this._$AH[h]=c}n&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class yt extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class vt extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Et extends R{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class St{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}}const z=w.litHtmlPolyfillSupport;z==null||z(U,x),(w.litHtmlVersions??(w.litHtmlVersions=[])).push("3.2.0");const bt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new x(t.insertBefore(P(),o),o,void 0,e??{})}return i._$AI(r),i};/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */class H extends y{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=bt(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 v}}var X;H._$litElement$=!0,H.finalized=!0,(X=globalThis.litElementHydrateSupport)==null||X.call(globalThis,{LitElement:H});const L=globalThis.litElementPolyfillSupport;L==null||L({LitElement:H});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");export{et as f,H as h,Pt as i,Ct as k,j as u};
@@ -0,0 +1 @@
1
+ import{h as e}from"./lit-element-CNB4fo5J.js";class r extends e{createRenderRoot(){return this}}export{r as N};
@@ -1 +1 @@
1
- import{m as S,n as f,E as b,S as _,p as m,O as p,q as l,e as y,o as w,c as E,l as O}from"./async--NeWdP3z.js";var j=S(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),d=function(n){f(o,n);function o(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o.prototype.lift=function(t){var e=new v(this,this);return e.operator=t,e},o.prototype._throwIfClosed=function(){if(this.closed)throw new j},o.prototype.next=function(t){var e=this;l(function(){var r,s;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=y(e.currentObservers),c=i.next();!c.done;c=i.next()){var u=c.value;u.next(t)}}catch(a){r={error:a}}finally{try{c&&!c.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}})},o.prototype.error=function(t){var e=this;l(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}})},o.prototype.complete=function(){var t=this;l(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},o.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(o.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),o.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},o.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},o.prototype._innerSubscribe=function(t){var e=this,r=this,s=r.hasError,i=r.isStopped,c=r.observers;return s||i?b:(this.currentObservers=null,c.push(t),new _(function(){e.currentObservers=null,m(c,t)}))},o.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,s=e.thrownError,i=e.isStopped;r?t.error(s):i&&t.complete()},o.prototype.asObservable=function(){var t=new p;return t.source=this,t},o.create=function(t,e){return new v(t,e)},o}(p),v=function(n){f(o,n);function o(t,e){var r=n.call(this)||this;return r.destination=t,r.source=e,r}return o.prototype.next=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.next)===null||r===void 0||r.call(e,t)},o.prototype.error=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.error)===null||r===void 0||r.call(e,t)},o.prototype.complete=function(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0||e.call(t)},o.prototype._subscribe=function(t){var e,r;return(r=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&r!==void 0?r:b},o}(d);function I(n,o){return o===void 0&&(o=O),w(function(t,e){var r=null,s=null,i=null,c=function(){if(r){r.unsubscribe(),r=null;var a=s;s=null,e.next(a)}};function u(){var a=i+n,h=o.now();if(h<a){r=this.schedule(void 0,a-h),e.add(r);return}c()}t.subscribe(E(e,function(a){s=a,i=o.now(),r||(r=o.schedule(u,n),e.add(r))},function(){c(),e.complete()},void 0,function(){s=r=null}))})}class x{constructor(){this.condition=!0,this.threshold=0,this.debounce=0}}class C{constructor(o,t,e={}){this.element=o,this.callback=t,this.params=e,this.intersectionSubject=new d,this.subscriptions=[],this.params={...new x,...e};let r={root:null,rootMargin:"0px",threshold:this.params.threshold};this.observer=new IntersectionObserver(s=>{s.forEach(i=>this.intersectionSubject.next(i))},r),this.connect()}connect(){this.subscriptions.push(this.intersectionSubject.pipe(I(this.params.debounce)).subscribe(o=>this.handleIntersection(o))),this.observer.observe(this.element)}disconnect(){this.observer&&this.observer.disconnect(),this.intersectionSubject.complete(),this.subscriptions.forEach(o=>o.unsubscribe())}handleIntersection(o){this.params.condition&&o.isIntersecting&&this.callback()}}export{d as S,C as V};
1
+ import{m as S,n as f,p as l,E as b,S as _,q as m,O as p,e as y,o as w,c as E,l as O}from"./async-CN53vnBN.js";var j=S(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),d=function(n){f(o,n);function o(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o.prototype.lift=function(t){var e=new v(this,this);return e.operator=t,e},o.prototype._throwIfClosed=function(){if(this.closed)throw new j},o.prototype.next=function(t){var e=this;l(function(){var r,s;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=y(e.currentObservers),c=i.next();!c.done;c=i.next()){var u=c.value;u.next(t)}}catch(a){r={error:a}}finally{try{c&&!c.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}})},o.prototype.error=function(t){var e=this;l(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}})},o.prototype.complete=function(){var t=this;l(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},o.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(o.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),o.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},o.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},o.prototype._innerSubscribe=function(t){var e=this,r=this,s=r.hasError,i=r.isStopped,c=r.observers;return s||i?b:(this.currentObservers=null,c.push(t),new _(function(){e.currentObservers=null,m(c,t)}))},o.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,s=e.thrownError,i=e.isStopped;r?t.error(s):i&&t.complete()},o.prototype.asObservable=function(){var t=new p;return t.source=this,t},o.create=function(t,e){return new v(t,e)},o}(p),v=function(n){f(o,n);function o(t,e){var r=n.call(this)||this;return r.destination=t,r.source=e,r}return o.prototype.next=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.next)===null||r===void 0||r.call(e,t)},o.prototype.error=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.error)===null||r===void 0||r.call(e,t)},o.prototype.complete=function(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0||e.call(t)},o.prototype._subscribe=function(t){var e,r;return(r=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&r!==void 0?r:b},o}(d);function I(n,o){return o===void 0&&(o=O),w(function(t,e){var r=null,s=null,i=null,c=function(){if(r){r.unsubscribe(),r=null;var a=s;s=null,e.next(a)}};function u(){var a=i+n,h=o.now();if(h<a){r=this.schedule(void 0,a-h),e.add(r);return}c()}t.subscribe(E(e,function(a){s=a,i=o.now(),r||(r=o.schedule(u,n),e.add(r))},function(){c(),e.complete()},void 0,function(){s=r=null}))})}class x{constructor(){this.condition=!0,this.threshold=0,this.debounce=0}}class C{constructor(o,t,e={}){this.element=o,this.callback=t,this.params=e,this.intersectionSubject=new d,this.subscriptions=[],this.params={...new x,...e};let r={root:null,rootMargin:"0px",threshold:this.params.threshold};this.observer=new IntersectionObserver(s=>{s.forEach(i=>this.intersectionSubject.next(i))},r),this.connect()}connect(){this.subscriptions.push(this.intersectionSubject.pipe(I(this.params.debounce)).subscribe(o=>this.handleIntersection(o))),this.observer.observe(this.element)}disconnect(){this.observer&&this.observer.disconnect(),this.intersectionSubject.complete(),this.subscriptions.forEach(o=>o.unsubscribe())}handleIntersection(o){this.params.condition&&o.isIntersecting&&this.callback()}}export{d as S,C as V};
@@ -1 +1 @@
1
- import{t as s}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as n}from"../../assets/no-shadow-element-CaVIVF-o.js";var b=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(o,r,t,a)=>{for(var e=a>1?void 0:a?p(r,t):r,l=o.length-1,c;l>=0;l--)(c=o[l])&&(e=(a?c(r,t,e):c(e))||e);return a&&e&&b(r,t,e),e};let m=class extends n{connectedCallback(){super.connectedCallback()}render(){}};m=u([s("mealz-catalog-breadcrumb")],m);customElements.get("mealz-catalog-breadcrumb")||customElements.define("mealz-catalog-breadcrumb",m);
1
+ import{t as n}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{N as s}from"../../assets/no-shadow-element-BjktO6El.js";var b=Object.getOwnPropertyDescriptor,d=(t,l,o,c)=>{for(var e=c>1?void 0:c?b(l,o):l,a=t.length-1,m;a>=0;a--)(m=t[a])&&(e=m(e)||e);return e};let r=class extends s{connectedCallback(){super.connectedCallback()}render(){}};r=d([n("mealz-catalog-breadcrumb")],r);customElements.get("mealz-catalog-breadcrumb")||customElements.define("mealz-catalog-breadcrumb",r);
@@ -1 +1 @@
1
- import{t as p}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as h}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var m=Object.defineProperty,u=Object.getOwnPropertyDescriptor,C=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&m(t,r,e),e};let n=class extends h{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const s=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:t,packageId:r,posId:a,loadMoreURL:e,displayRecipeVariant:i,search:o,sessionId:l,path:d}=JSON.parse(s);g(l),this.analyticsPath=d,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:e,sessionId:l,pageSize:t,storeId:a,packageId:r,search:o,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=C([p("mealz-catalog-category")],n);customElements.get("mealz-catalog-category")||customElements.define("mealz-catalog-category",n);
1
+ import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{C as p}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-BjktO6El.js";import"../../assets/async-CN53vnBN.js";var m=Object.getOwnPropertyDescriptor,u=(t,s,o,r)=>{for(var e=r>1?void 0:r?m(s,o):s,a=t.length-1,i;a>=0;a--)(i=t[a])&&(e=i(e)||e);return e};let n=class extends p{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const t=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!t||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:s,packageId:o,posId:r,loadMoreURL:e,displayRecipeVariant:a,search:i,sessionId:l,path:d}=JSON.parse(t);g(l),this.analyticsPath=d,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:a,loadMoreURL:e,sessionId:l,pageSize:s,storeId:r,packageId:o,search:i,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=u([h("mealz-catalog-category")],n);customElements.get("mealz-catalog-category")||customElements.define("mealz-catalog-category",n);
@@ -1 +1 @@
1
- import{t as u}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as g}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BPS5vj92.js";import{o as p,c as m}from"../../assets/async--NeWdP3z.js";import"../../assets/no-shadow-element-CaVIVF-o.js";function f(e,t){return p(function(s,a){var i=0;s.subscribe(m(a,function(r){return e.call(t,r,i++)&&a.next(r)}))})}function v(e){return f(function(t,s){return e<=s})}var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,L=(e,t,s,a)=>{for(var i=a>1?void 0:a?b(t,s):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(i=(a?n(t,s,i):n(i))||i);return a&&i&&_(t,s,i),i};let o=class extends g{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.user.isAuthenticated().pipe(v(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const e=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!e)return;const{pageSize:t,storeId:s,loadMoreURL:a,displayRecipeVariant:i,search:r,sessionId:n,path:d}=JSON.parse(e);if(this.analyticsPath=d,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const l=this.querySelector(".mealz-catalog__list");l&&(h(n),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:a,sessionId:n,pageSize:t,storeId:s,packageId:null,search:r,listHTML:l}),this.removeAttribute("starting-data"))}updateDOM(){const e=this.querySelector(".mealz-catalog-favorites__list__not-logged"),t=this.querySelector(".mealz-catalog-favorites__list__logged");!e||!t||(e.classList.toggle("hidden",this.isLogged),t.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){var e;window.mealzInternal?((e=window.mealzInternal.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const s=document.getElementById("mealz-recipe-card-"+e);s&&s.classList.toggle("hidden",t),this.requestUpdate()})}};o=L([u("mealz-catalog-favorites")],o);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",o);
1
+ import{t as u}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{C as g}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BPS5vj92.js";import{o as p,c as m}from"../../assets/async-CN53vnBN.js";import"../../assets/no-shadow-element-BjktO6El.js";function f(e,t){return p(function(s,r){var i=0;s.subscribe(m(r,function(a){return e.call(t,a,i++)&&r.next(a)}))})}function v(e){return f(function(t,s){return e<=s})}var _=Object.getOwnPropertyDescriptor,L=(e,t,s,r)=>{for(var i=r>1?void 0:r?_(t,s):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(i=n(i)||i);return i};let o=class extends g{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.user.isAuthenticated().pipe(v(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const e=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!e)return;const{pageSize:t,storeId:s,loadMoreURL:r,displayRecipeVariant:i,search:a,sessionId:n,path:d}=JSON.parse(e);if(this.analyticsPath=d,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const l=this.querySelector(".mealz-catalog__list");l&&(h(n),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:r,sessionId:n,pageSize:t,storeId:s,packageId:null,search:a,listHTML:l}),this.removeAttribute("starting-data"))}updateDOM(){const e=this.querySelector(".mealz-catalog-favorites__list__not-logged"),t=this.querySelector(".mealz-catalog-favorites__list__logged");!e||!t||(e.classList.toggle("hidden",this.isLogged),t.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){var e;window.mealzInternal?((e=window.mealzInternal.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const s=document.getElementById("mealz-recipe-card-"+e);s&&s.classList.toggle("hidden",t),this.requestUpdate()})}};o=L([u("mealz-catalog-favorites")],o);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",o);
@@ -1 +1 @@
1
- import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as m}from"../catalog-load-more.min.js";import{h as u}from"../../assets/session-handler-BPS5vj92.js";import{M as p}from"../../drawer/drawer.min.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,g=(s,t,r,a)=>{for(var e=a>1?void 0:a?y(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&w(t,r,e),e};let n=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const s=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!s||(this.historyOrderListHTML=this.querySelector(".mealz-catalog__list")||this.querySelector(".mealz-catalog__list__row"),!this.historyOrderListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,sessionId:e,drawerDataURL:i,historyStyle:o,path:d}=JSON.parse(s);this.analyticsPath=d,u(e),this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:a,sessionId:e,pageSize:t,storeId:r,packageId:null,search:"",listHTML:this.historyOrderListHTML,historyStyle:o});const l=new URL(window.location.href).searchParams.get("order");l&&this.initializeDrawer(i,l,e,r),this.removeAttribute("starting-data")}initializeDrawer(s,t,r,a){let e=document.querySelector("mealz-drawer");e||(e=new p,document.body.appendChild(e)),e.openDrawer(),e.loadDrawerData(s,t,r,a)}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=g([h("mealz-catalog-history")],n);customElements.get("mealz-catalog-history")||customElements.define("mealz-catalog-history",n);
1
+ import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{C as m}from"../catalog-load-more.min.js";import{h as u}from"../../assets/session-handler-BPS5vj92.js";import{M as p}from"../../drawer/drawer.min.js";import"../../assets/no-shadow-element-BjktO6El.js";import"../../assets/async-CN53vnBN.js";var w=Object.getOwnPropertyDescriptor,y=(t,r,a,s)=>{for(var e=s>1?void 0:s?w(r,a):r,i=t.length-1,o;i>=0;i--)(o=t[i])&&(e=o(e)||e);return e};let n=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const t=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!t||(this.historyOrderListHTML=this.querySelector(".mealz-catalog__list")||this.querySelector(".mealz-catalog__list__row"),!this.historyOrderListHTML))return;const{pageSize:r,storeId:a,loadMoreURL:s,sessionId:e,drawerDataURL:i,historyStyle:o,path:d}=JSON.parse(t);this.analyticsPath=d,u(e),this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:s,sessionId:e,pageSize:r,storeId:a,packageId:null,search:"",listHTML:this.historyOrderListHTML,historyStyle:o});const l=new URL(window.location.href).searchParams.get("order");l&&this.initializeDrawer(i,l,e,a),this.removeAttribute("starting-data")}initializeDrawer(t,r,a,s){let e=document.querySelector("mealz-drawer");e||(e=new p,document.body.appendChild(e)),e.openDrawer(),e.loadDrawerData(t,r,a,s)}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=y([h("mealz-catalog-history")],n);customElements.get("mealz-catalog-history")||customElements.define("mealz-catalog-history",n);
@@ -1 +1 @@
1
- import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{h as l}from"../../assets/session-handler-BPS5vj92.js";import{N as h}from"../../assets/no-shadow-element-CaVIVF-o.js";import{V as d}from"../../assets/viewport-listener-Ci9Ivhrq.js";import"../../assets/async--NeWdP3z.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(t,e,a,i)=>{for(var s=i>1?void 0:i?g(e,a):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(s=(i?n(e,a,s):n(s))||s);return i&&s&&m(e,a,s),s};let o=class extends h{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.viewportListeners.forEach(t=>t.disconnect()),this.viewportListeners=[]}render(){var s;const t=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!t)return;const{categories:e,path:a,sessionId:i}=JSON.parse(t);l(i),this.analyticsPath=a,this.categories=e,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((e,a)=>{e==null||e.addEventListener("click",()=>this.sendCategoryDisplay(a))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((e,a)=>{const i=new d(e,()=>this.sendCategoryShow(a),{threshold:.8,debounce:1e3});this.viewportListeners.push(i)})}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}sendCategoryDisplay(t){var e;window.mealzInternal.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(e=this.categories[Math.floor(t/2)])==null?void 0:e.id})}sendCategoryShow(t){var e;window.mealzInternal.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(e=this.categories[t])==null?void 0:e.id})}};o=p([c("mealz-catalog-home")],o);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",o);
1
+ import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{h as l}from"../../assets/session-handler-BPS5vj92.js";import{N as h}from"../../assets/no-shadow-element-BjktO6El.js";import{V as d}from"../../assets/viewport-listener-BrYUdpmX.js";import"../../assets/async-CN53vnBN.js";var m=Object.getOwnPropertyDescriptor,g=(t,e,s,i)=>{for(var a=i>1?void 0:i?m(e,s):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(a=o(a)||a);return a};let n=class extends h{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.viewportListeners.forEach(t=>t.disconnect()),this.viewportListeners=[]}render(){var a;const t=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!t)return;const{categories:e,path:s,sessionId:i}=JSON.parse(t);l(i),this.analyticsPath=s,this.categories=e,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((e,s)=>{e==null||e.addEventListener("click",()=>this.sendCategoryDisplay(s))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((e,s)=>{const i=new d(e,()=>this.sendCategoryShow(s),{threshold:.8,debounce:1e3});this.viewportListeners.push(i)})}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}sendCategoryDisplay(t){var e;window.mealzInternal.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(e=this.categories[Math.floor(t/2)])==null?void 0:e.id})}sendCategoryShow(t){var e;window.mealzInternal.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(e=this.categories[t])==null?void 0:e.id})}};n=g([c("mealz-catalog-home")],n);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",n);
@@ -1 +1 @@
1
- import{t as d}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as p}from"../catalog-load-more.min.js";import{h as m}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,l;i>=0;i--)(l=s[i])&&(e=(a?l(t,r,e):l(e))||e);return a&&e&&g(t,r,e),e};let o=class extends p{connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var n;const s=(n=this.attributes["starting-data"])==null?void 0:n.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,displayRecipeVariant:e,search:i,promotions:l,sessionId:c}=JSON.parse(s);m(c),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:a,sessionId:c,pageSize:t,storeId:r,packageId:null,search:i,listHTML:this.recipeCardListHTML,promotions:l}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}};o=h([d("mealz-catalog-list")],o);customElements.get("mealz-catalog-list")||customElements.define("mealz-catalog-list",o);
1
+ import{t as d}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{C as p}from"../catalog-load-more.min.js";import{h as m}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-BjktO6El.js";import"../../assets/async-CN53vnBN.js";var g=Object.getOwnPropertyDescriptor,u=(t,s,l,r)=>{for(var e=r>1?void 0:r?g(s,l):s,a=t.length-1,i;a>=0;a--)(i=t[a])&&(e=i(e)||e);return e};let o=class extends p{connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var n;const t=(n=this.attributes["starting-data"])==null?void 0:n.value;if(!t||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:s,storeId:l,loadMoreURL:r,displayRecipeVariant:e,search:a,promotions:i,sessionId:c}=JSON.parse(t);m(c),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:r,sessionId:c,pageSize:s,storeId:l,packageId:null,search:a,listHTML:this.recipeCardListHTML,promotions:i}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}};o=u([d("mealz-catalog-list")],o);customElements.get("mealz-catalog-list")||customElements.define("mealz-catalog-list",o);
@@ -1 +1 @@
1
- import{N as D}from"../assets/no-shadow-element-CaVIVF-o.js";import{i as h,a as R,_ as H,b as A,d as x,O as v,r as z,e as P,f as G,g as N,o as k,c as w,h as V,j as C,k as $,l as q}from"../assets/async--NeWdP3z.js";import"../assets/lit-element-4gw3YGga.js";function B(e){return e&&h(e.schedule)}var T=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function F(e){return h(e==null?void 0:e.then)}function U(e){return h(e[R])}function Y(e){return Symbol.asyncIterator&&h(e==null?void 0:e[Symbol.asyncIterator])}function j(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 J(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Q=J();function K(e){return h(e==null?void 0:e[Q])}function W(e){return H(this,arguments,function(){var t,r,o,a;return A(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,x(t.read())];case 3:return r=i.sent(),o=r.value,a=r.done,a?[4,x(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,x(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function X(e){return h(e==null?void 0:e.getReader)}function L(e){if(e instanceof v)return e;if(e!=null){if(U(e))return Z(e);if(T(e))return ee(e);if(F(e))return ne(e);if(Y(e))return _(e);if(K(e))return te(e);if(X(e))return re(e)}throw j(e)}function Z(e){return new v(function(n){var t=e[R]();if(h(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ee(e){return new v(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function ne(e){return new v(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,z)})}function te(e){return new v(function(n){var t,r;try{for(var o=P(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(n.next(i),n.closed)return}}catch(c){t={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}n.complete()})}function _(e){return new v(function(n){oe(e,n).catch(function(t){return n.error(t)})})}function re(e){return _(W(e))}function oe(e,n){var t,r,o,a;return G(this,void 0,void 0,function(){var i,c;return A(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),t=N(e),s.label=1;case 1:return[4,t.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(i=r.value,n.next(i),n.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),o={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=t.return)?[4,a.call(t)]:[3,8];case 7:s.sent(),s.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]}})})}function ae(e){return e instanceof Date&&!isNaN(e)}function S(e,n){return k(function(t,r){var o=0;t.subscribe(w(r,function(a){r.next(e.call(n,a,o++))}))})}var ie=Array.isArray;function se(e,n){return ie(n)?e.apply(void 0,V([],C(n))):e(n)}function le(e){return S(function(n){return se(e,n)})}function ue(e,n,t,r,o,a,i,c){var s=[],u=0,d=0,l=!1,f=function(){l&&!s.length&&!u&&n.complete()},p=function(y){return u<r?E(y):s.push(y)},E=function(y){u++;var g=!1;L(t(y,d++)).subscribe(w(n,function(m){n.next(m)},function(){g=!0},void 0,function(){if(g)try{u--;for(var m=function(){var I=s.shift();i||E(I)};s.length&&u<r;)m();f()}catch(I){n.error(I)}}))};return e.subscribe(w(n,p,function(){l=!0,f()})),function(){}}function O(e,n,t){return t===void 0&&(t=1/0),h(n)?O(function(r,o){return S(function(a,i){return n(r,a,o,i)})(L(e(r,o)))},t):(typeof n=="number"&&(t=n),k(function(r,o){return ue(r,o,e,t)}))}var ce=["addListener","removeListener"],fe=["addEventListener","removeEventListener"],de=["on","off"];function b(e,n,t,r){if(h(t)&&(r=t,t=void 0),r)return b(e,n,t).pipe(le(r));var o=C(ve(e)?fe.map(function(c){return function(s){return e[c](n,s,t)}}):he(e)?ce.map(M(e,n)):me(e)?de.map(M(e,n)):[],2),a=o[0],i=o[1];if(!a&&T(e))return O(function(c){return b(c,n,t)})(L(e));if(!a)throw new TypeError("Invalid event target");return new v(function(c){var s=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return c.next(1<u.length?u:u[0])};return a(s),function(){return i(s)}})}function M(e,n){return function(t){return function(r){return e[t](n,r)}}}function he(e){return h(e.addListener)&&h(e.removeListener)}function me(e){return h(e.on)&&h(e.off)}function ve(e){return h(e.addEventListener)&&h(e.removeEventListener)}function pe(e,n,t){t===void 0&&(t=$);var r=-1;return n!=null&&(B(n)?t=n:r=n),new v(function(o){var a=ae(e)?+e-t.now():e;a<0&&(a=0);var i=0;return t.schedule(function(){o.closed||(o.next(i++),0<=r?this.schedule(void 0,r):o.complete())},a)})}function ye(e,n){return k(function(t,r){var o=n??{},a=o.leading,i=a===void 0?!0:a,c=o.trailing,s=c===void 0?!1:c,u=!1,d=null,l=null,f=!1,p=function(){l==null||l.unsubscribe(),l=null,s&&(g(),f&&r.complete())},E=function(){l=null,f&&r.complete()},y=function(m){return l=L(e(m)).subscribe(w(r,p,E))},g=function(){if(u){u=!1;var m=d;d=null,r.next(m),!f&&y(m)}};t.subscribe(w(r,function(m){u=!0,d=m,!(l&&!l.closed)&&(i?g():y(m))},function(){f=!0,!(s&&u&&l&&!l.closed)&&r.complete()}))})}function ge(e,n,t){n===void 0&&(n=q);var r=pe(e,n);return ye(function(){return r},t)}const we=300;class xe extends D{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(n=>n.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:n,loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,packageId:i,search:c,listHTML:s,promotions:u=!1,historyStyle:d=""}){const l=b(window,"scroll");this.subscriptions.push(l.pipe(ge(100)).subscribe(()=>{const f=this.getBoundingClientRect(),p=f.bottom>0&&f.bottom<=window.innerHeight+we;!this.noMoreData&&!this.isLoading&&p&&this.getMoreRecipes({loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,displayRecipeVariant:n,packageId:i,search:c,promotions:u,listHTML:s,historyStyle:d})}))}buildHeaders(n){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":n},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:n,sessionId:t,pageSize:r,storeId:o,displayRecipeVariant:a,packageId:i,search:c,promotions:s,listHTML:u,historyStyle:d=""}){if(this.checkIfMoreRecipes(u.innerHTML,r),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const l=new URLSearchParams;l.append("size",r.toString()),l.append("page",this.page.toString()),a&&l.append("display_recipe_variant",a),i&&l.append("category_id",i),o&&l.append("store_id",o),c&&l.append("search",c),s&&l.append("promotions",s),d&&l.append("history_style",d);try{const f=await fetch(n+"?"+l,{method:"GET",headers:this.buildHeaders(t)});if(!f.ok)throw new Error(`Load more request failed with status: ${f.status}`);const p=await f.text();this.appendRecipesToList(p,u,r)}catch(f){console.error(f),this.isLoading=!1}}appendRecipesToList(n,t,r){this.checkIfMoreRecipes(n,r),t.insertAdjacentHTML("beforeend",n),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(n,t){const r=n.match(/<mealz-recipe-card(?=\s|>)/gi)||n.match(/<mealz-history-order(?=\s|>)/gi)||n.match(/<mealz-history-order-expanded(?=\s|>)/gi);(r?r.length:0)<t&&(this.noMoreData=!0)}createLoader(){const n=this.querySelector(".mealz-catalog__content");!this.loaderElement&&n&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",n.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(n){this.loaderElement&&(this.loaderElement.style.display=n?"block":"none")}}export{xe as C};
1
+ import{N as D}from"../assets/no-shadow-element-BjktO6El.js";import{i as h,a as R,_ as H,b as A,d as x,O as v,r as z,e as P,f as G,g as N,o as k,c as w,h as V,j as C,k as $,l as q}from"../assets/async-CN53vnBN.js";import"../assets/lit-element-CNB4fo5J.js";function B(e){return e&&h(e.schedule)}var T=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function F(e){return h(e==null?void 0:e.then)}function U(e){return h(e[R])}function Y(e){return Symbol.asyncIterator&&h(e==null?void 0:e[Symbol.asyncIterator])}function j(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 J(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Q=J();function K(e){return h(e==null?void 0:e[Q])}function W(e){return H(this,arguments,function(){var t,r,o,a;return A(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,x(t.read())];case 3:return r=i.sent(),o=r.value,a=r.done,a?[4,x(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,x(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function X(e){return h(e==null?void 0:e.getReader)}function L(e){if(e instanceof v)return e;if(e!=null){if(U(e))return Z(e);if(T(e))return ee(e);if(F(e))return ne(e);if(Y(e))return _(e);if(K(e))return te(e);if(X(e))return re(e)}throw j(e)}function Z(e){return new v(function(n){var t=e[R]();if(h(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ee(e){return new v(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function ne(e){return new v(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,z)})}function te(e){return new v(function(n){var t,r;try{for(var o=P(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(n.next(i),n.closed)return}}catch(c){t={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}n.complete()})}function _(e){return new v(function(n){oe(e,n).catch(function(t){return n.error(t)})})}function re(e){return _(W(e))}function oe(e,n){var t,r,o,a;return G(this,void 0,void 0,function(){var i,c;return A(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),t=N(e),s.label=1;case 1:return[4,t.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(i=r.value,n.next(i),n.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),o={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=t.return)?[4,a.call(t)]:[3,8];case 7:s.sent(),s.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]}})})}function ae(e){return e instanceof Date&&!isNaN(e)}function S(e,n){return k(function(t,r){var o=0;t.subscribe(w(r,function(a){r.next(e.call(n,a,o++))}))})}var ie=Array.isArray;function se(e,n){return ie(n)?e.apply(void 0,V([],C(n))):e(n)}function le(e){return S(function(n){return se(e,n)})}function ue(e,n,t,r,o,a,i,c){var s=[],u=0,d=0,l=!1,f=function(){l&&!s.length&&!u&&n.complete()},p=function(y){return u<r?E(y):s.push(y)},E=function(y){u++;var g=!1;L(t(y,d++)).subscribe(w(n,function(m){n.next(m)},function(){g=!0},void 0,function(){if(g)try{u--;for(var m=function(){var I=s.shift();i||E(I)};s.length&&u<r;)m();f()}catch(I){n.error(I)}}))};return e.subscribe(w(n,p,function(){l=!0,f()})),function(){}}function O(e,n,t){return t===void 0&&(t=1/0),h(n)?O(function(r,o){return S(function(a,i){return n(r,a,o,i)})(L(e(r,o)))},t):(typeof n=="number"&&(t=n),k(function(r,o){return ue(r,o,e,t)}))}var ce=["addListener","removeListener"],fe=["addEventListener","removeEventListener"],de=["on","off"];function b(e,n,t,r){if(h(t)&&(r=t,t=void 0),r)return b(e,n,t).pipe(le(r));var o=C(ve(e)?fe.map(function(c){return function(s){return e[c](n,s,t)}}):he(e)?ce.map(M(e,n)):me(e)?de.map(M(e,n)):[],2),a=o[0],i=o[1];if(!a&&T(e))return O(function(c){return b(c,n,t)})(L(e));if(!a)throw new TypeError("Invalid event target");return new v(function(c){var s=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return c.next(1<u.length?u:u[0])};return a(s),function(){return i(s)}})}function M(e,n){return function(t){return function(r){return e[t](n,r)}}}function he(e){return h(e.addListener)&&h(e.removeListener)}function me(e){return h(e.on)&&h(e.off)}function ve(e){return h(e.addEventListener)&&h(e.removeEventListener)}function pe(e,n,t){t===void 0&&(t=$);var r=-1;return n!=null&&(B(n)?t=n:r=n),new v(function(o){var a=ae(e)?+e-t.now():e;a<0&&(a=0);var i=0;return t.schedule(function(){o.closed||(o.next(i++),0<=r?this.schedule(void 0,r):o.complete())},a)})}function ye(e,n){return k(function(t,r){var o=n??{},a=o.leading,i=a===void 0?!0:a,c=o.trailing,s=c===void 0?!1:c,u=!1,d=null,l=null,f=!1,p=function(){l==null||l.unsubscribe(),l=null,s&&(g(),f&&r.complete())},E=function(){l=null,f&&r.complete()},y=function(m){return l=L(e(m)).subscribe(w(r,p,E))},g=function(){if(u){u=!1;var m=d;d=null,r.next(m),!f&&y(m)}};t.subscribe(w(r,function(m){u=!0,d=m,!(l&&!l.closed)&&(i?g():y(m))},function(){f=!0,!(s&&u&&l&&!l.closed)&&r.complete()}))})}function ge(e,n,t){n===void 0&&(n=q);var r=pe(e,n);return ye(function(){return r},t)}const we=300;class xe extends D{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(n=>n.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:n,loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,packageId:i,search:c,listHTML:s,promotions:u=!1,historyStyle:d=""}){const l=b(window,"scroll");this.subscriptions.push(l.pipe(ge(100)).subscribe(()=>{const f=this.getBoundingClientRect(),p=f.bottom>0&&f.bottom<=window.innerHeight+we;!this.noMoreData&&!this.isLoading&&p&&this.getMoreRecipes({loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,displayRecipeVariant:n,packageId:i,search:c,promotions:u,listHTML:s,historyStyle:d})}))}buildHeaders(n){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":n},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:n,sessionId:t,pageSize:r,storeId:o,displayRecipeVariant:a,packageId:i,search:c,promotions:s,listHTML:u,historyStyle:d=""}){if(this.checkIfMoreRecipes(u.innerHTML,r),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const l=new URLSearchParams;l.append("size",r.toString()),l.append("page",this.page.toString()),a&&l.append("display_recipe_variant",a),i&&l.append("category_id",i),o&&l.append("store_id",o),c&&l.append("search",c),s&&l.append("promotions",s),d&&l.append("history_style",d);try{const f=await fetch(n+"?"+l,{method:"GET",headers:this.buildHeaders(t)});if(!f.ok)throw new Error(`Load more request failed with status: ${f.status}`);const p=await f.text();this.appendRecipesToList(p,u,r)}catch(f){console.error(f),this.isLoading=!1}}appendRecipesToList(n,t,r){this.checkIfMoreRecipes(n,r),t.insertAdjacentHTML("beforeend",n),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(n,t){const r=n.match(/<mealz-recipe-card(?=\s|>)/gi)||n.match(/<mealz-history-order(?=\s|>)/gi)||n.match(/<mealz-history-order-expanded(?=\s|>)/gi);(r?r.length:0)<t&&(this.noMoreData=!0)}createLoader(){const n=this.querySelector(".mealz-catalog__content");!this.loaderElement&&n&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",n.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(n){this.loaderElement&&(this.loaderElement.style.display=n?"block":"none")}}export{xe as C};
@@ -1 +1 @@
1
- import{t as n}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as m}from"../../assets/no-shadow-element-CaVIVF-o.js";var b=Object.defineProperty,p=Object.getOwnPropertyDescriptor,d=(r,a,l,t)=>{for(var e=t>1?void 0:t?p(a,l):a,c=r.length-1,s;c>=0;c--)(s=r[c])&&(e=(t?s(a,l,e):s(e))||e);return t&&e&&b(a,l,e),e};let o=class extends m{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){}};o=d([n("mealz-catalog-tabs")],o);customElements.get("mealz-catalog-tabs")||customElements.define("mealz-catalog-tabs",o);
1
+ import{t as n}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{N as m}from"../../assets/no-shadow-element-BjktO6El.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{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as c}from"../../assets/no-shadow-element-CaVIVF-o.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var a=r>1?void 0:r?d(e,s):e,o=t.length-1,i;o>=0;o--)(i=t[o])&&(a=(r?i(e,s,a):i(a))||a);return r&&a&&h(e,s,a),a};let n=class extends c{constructor(){super(...arguments),this.subscriptions=[],this.supplierHeaderHeight=0,this.searchUrl="",this.path=""}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.getStickyHeaderHeight().subscribe(t=>{this.supplierHeaderHeight=t,this.setStickyObserver()}),window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>{const t=this.preferencesButton.querySelector(".mealz-catalog-toolbar__controls__filter-badge"),e=this.preferencesButton.querySelector(".mealz-catalog-toolbar__loader");t&&t.classList.add("hidden"),e&&e.classList.remove("hidden")}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.toolbarObserver.unobserve(this.anchorElement)}render(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{searchUrl:e,path:s}=JSON.parse(t);this.searchUrl=e,this.path=s,this.findElementsInDocument(),this.addEveryEventListeners(),this.removeAttribute("starting-data")}firstUpdated(){this.setStickyObserver()}setStickyObserver(){var e;if(this.toolbar=document.querySelector(".mealz-catalog-toolbar"),this.anchorElement=document.querySelector(".mealz-catalog-toolbar__anchor"),!this.anchorElement||!this.toolbar)return;const t={rootMargin:`-${this.supplierHeaderHeight}px 0px 0px 0px`,threshold:1};(e=this.toolbarObserver)==null||e.unobserve(this),setTimeout(()=>this.setStickyToolbarStyle(),50),this.toolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle()},t),this.toolbarObserver.observe(this.anchorElement)}setStickyToolbarStyle(){const e=this.anchorElement.getBoundingClientRect().top<this.supplierHeaderHeight;this.anchorElement.style.height=e?this.toolbar.clientHeight+"px":"0px",this.toolbar.classList.toggle("sticking",e),this.toolbar.style.top=(e?this.supplierHeaderHeight:0)+"px",this.updateDOM(e)}findElementsInDocument(){this.preferencesButton=this.querySelector(".mealz-catalog-toolbar__controls__preferences"),this.favoritesButton=this.querySelector(".mealz-catalog-toolbar__controls__favorites"),this.searchButton=this.querySelector(".mealz-catalog-toolbar__searchbar-button"),this.searchInput=this.querySelector(".mealz-catalog-toolbar__searchbar-input"),this.backButton=this.querySelector(".mealz-recipe-toolbar__return-button")}addEveryEventListeners(){var t;this.addClickListener(this.preferencesButton,this.openPreferences.bind(this)),this.addClickListener(this.searchButton,this.performSearch.bind(this)),this.addClickListener(this.favoritesButton,this.sendFavoritesDisplay.bind(this)),(t=this.searchInput)==null||t.addEventListener("keypress",e=>{e.key==="Enter"&&this.performSearch()})}addClickListener(t,e){t==null||t.addEventListener("click",s=>{s.stopPropagation(),e()})}performSearch(){const t=this.searchInput.value.trim();if(!t)return;window.mealzInternal.analytics.sendEvent("search",this.path,{search_term:t});const e=this.searchUrl.includes("?")?"&":"?";window.location.href=`${this.searchUrl}${e}search=${encodeURIComponent(t)}`}updateDOM(t){var r;const e=t?["ghost","square"]:["full"],s=t?["full"]:["ghost","square"];this.toggleClasses(this.favoritesButton,e,s),this.toggleClasses(this.preferencesButton,e,s),(r=this.backButton)==null||r.classList.toggle("hidden",!t)}toggleClasses(t,e,s){t==null||t.classList.remove(...s),t==null||t.classList.add(...e)}openPreferences(){window.mealzInternal.analytics.sendEvent("preferences.display",this.path,{}),window.mealzInternal.catalog.openPreferences()}sendFavoritesDisplay(){window.mealzInternal.analytics.sendEvent("liked.display",this.path,{})}};n=p([l("mealz-catalog-toolbar")],n);customElements.get("mealz-catalog-toolbar")||customElements.define("mealz-catalog-toolbar",n);
1
+ import{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{N as c}from"../../assets/no-shadow-element-BjktO6El.js";var h=Object.getOwnPropertyDescriptor,d=(t,e,s,r)=>{for(var a=r>1?void 0:r?h(e,s):e,o=t.length-1,n;o>=0;o--)(n=t[o])&&(a=n(a)||a);return a};let i=class extends c{constructor(){super(...arguments),this.subscriptions=[],this.supplierHeaderHeight=0,this.searchUrl="",this.path=""}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.getStickyHeaderHeight().subscribe(t=>{this.supplierHeaderHeight=t,this.setStickyObserver()}),window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>{const t=this.preferencesButton.querySelector(".mealz-catalog-toolbar__controls__filter-badge"),e=this.preferencesButton.querySelector(".mealz-catalog-toolbar__loader");t&&t.classList.add("hidden"),e&&e.classList.remove("hidden")}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.toolbarObserver.unobserve(this.anchorElement)}render(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{searchUrl:e,path:s}=JSON.parse(t);this.searchUrl=e,this.path=s,this.findElementsInDocument(),this.addEveryEventListeners(),this.removeAttribute("starting-data")}firstUpdated(){this.setStickyObserver()}setStickyObserver(){var e;if(this.toolbar=document.querySelector(".mealz-catalog-toolbar"),this.anchorElement=document.querySelector(".mealz-catalog-toolbar__anchor"),!this.anchorElement||!this.toolbar)return;const t={rootMargin:`-${this.supplierHeaderHeight}px 0px 0px 0px`,threshold:1};(e=this.toolbarObserver)==null||e.unobserve(this),setTimeout(()=>this.setStickyToolbarStyle(),50),this.toolbarObserver=new IntersectionObserver(()=>{this.setStickyToolbarStyle()},t),this.toolbarObserver.observe(this.anchorElement)}setStickyToolbarStyle(){const e=this.anchorElement.getBoundingClientRect().top<this.supplierHeaderHeight;this.anchorElement.style.height=e?this.toolbar.clientHeight+"px":"0px",this.toolbar.classList.toggle("sticking",e),this.toolbar.style.top=(e?this.supplierHeaderHeight:0)+"px",this.updateDOM(e)}findElementsInDocument(){this.preferencesButton=this.querySelector(".mealz-catalog-toolbar__controls__preferences"),this.favoritesButton=this.querySelector(".mealz-catalog-toolbar__controls__favorites"),this.searchButton=this.querySelector(".mealz-catalog-toolbar__searchbar-button"),this.searchInput=this.querySelector(".mealz-catalog-toolbar__searchbar-input"),this.backButton=this.querySelector(".mealz-recipe-toolbar__return-button")}addEveryEventListeners(){var t;this.addClickListener(this.preferencesButton,this.openPreferences.bind(this)),this.addClickListener(this.searchButton,this.performSearch.bind(this)),this.addClickListener(this.favoritesButton,this.sendFavoritesDisplay.bind(this)),(t=this.searchInput)==null||t.addEventListener("keypress",e=>{e.key==="Enter"&&this.performSearch()})}addClickListener(t,e){t==null||t.addEventListener("click",s=>{s.stopPropagation(),e()})}performSearch(){const t=this.searchInput.value.trim();if(!t)return;window.mealzInternal.analytics.sendEvent("search",this.path,{search_term:t});const e=this.searchUrl.includes("?")?"&":"?";window.location.href=`${this.searchUrl}${e}search=${encodeURIComponent(t)}`}updateDOM(t){var r;const e=t?["ghost","square"]:["full"],s=t?["full"]:["ghost","square"];this.toggleClasses(this.favoritesButton,e,s),this.toggleClasses(this.preferencesButton,e,s),(r=this.backButton)==null||r.classList.toggle("hidden",!t)}toggleClasses(t,e,s){t==null||t.classList.remove(...s),t==null||t.classList.add(...e)}openPreferences(){window.mealzInternal.analytics.sendEvent("preferences.display",this.path,{}),window.mealzInternal.catalog.openPreferences()}sendFavoritesDisplay(){window.mealzInternal.analytics.sendEvent("liked.display",this.path,{})}};i=d([l("mealz-catalog-toolbar")],i);customElements.get("mealz-catalog-toolbar")||customElements.define("mealz-catalog-toolbar",i);
@@ -1 +1 @@
1
- import{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{N as u}from"../../assets/no-shadow-element-CaVIVF-o.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,m=(t,e,s,n)=>{for(var i=n>1?void 0:n?h(e,s):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&c(e,s,i),i};let r=class extends u{constructor(){super(...arguments),this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealz.basket.recipeCount().subscribe(t=>{this.recipesCount=t,this.updateDOM()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){var e;if(this.button=this.querySelector(".mealz-my-meals-button"),!this.button)return;const t=(e=this.attributes["starting-data"])==null?void 0:e.value;if(t){const{path:s}=JSON.parse(t);this.analyticsPath=s,this.removeAttribute("starting-data")}this.button.addEventListener("click",s=>{s.stopPropagation(),this.toggle()})}toggle(){window.mealz.basket.openPreview(this.analyticsPath)}updateDOM(){var e;if(!this.button)return;this.recipesCount?this.button.classList.remove("hidden"):this.button.classList.add("hidden");const t=(e=this.button.querySelector(".mealz-my-meals-button__text"))==null?void 0:e.firstElementChild;t&&(t.innerHTML=`${this.recipesCount||0}`)}};r=m([l("mealz-my-meals-button")],r);customElements.get("mealz-my-meals-button")||customElements.define("mealz-my-meals-button",r);
1
+ import{t as l}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-CNB4fo5J.js";import{N as u}from"../../assets/no-shadow-element-BjktO6El.js";var c=Object.getOwnPropertyDescriptor,h=(t,e,s,o)=>{for(var i=o>1?void 0:o?c(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(i=r(i)||i);return i};let a=class extends u{constructor(){super(...arguments),this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealz.basket.recipeCount().subscribe(t=>{this.recipesCount=t,this.updateDOM()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){var e;if(this.button=this.querySelector(".mealz-my-meals-button"),!this.button)return;const t=(e=this.attributes["starting-data"])==null?void 0:e.value;if(t){const{path:s}=JSON.parse(t);this.analyticsPath=s,this.removeAttribute("starting-data")}this.button.addEventListener("click",s=>{s.stopPropagation(),this.toggle()})}toggle(){window.mealz.basket.openPreview(this.analyticsPath)}updateDOM(){var e;if(!this.button)return;this.recipesCount?this.button.classList.remove("hidden"):this.button.classList.add("hidden");const t=(e=this.button.querySelector(".mealz-my-meals-button__text"))==null?void 0:e.firstElementChild;t&&(t.innerHTML=`${this.recipesCount||0}`)}};a=h([l("mealz-my-meals-button")],a);customElements.get("mealz-my-meals-button")||customElements.define("mealz-my-meals-button",a);
@@ -1,4 +1,4 @@
1
- import{t as d}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as c}from"../assets/no-shadow-element-CaVIVF-o.js";var u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,w=(e,t,r,s)=>{for(var a=s>1?void 0:s?h(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(a=(s?i(t,r,a):i(a))||a);return s&&a&&u(t,r,a),a};let l=class extends c{constructor(){super(...arguments),this.isMealzInternalReady=!1}connectedCallback(){super.connectedCallback(),this.classList.add("hidden"),this.checkMealzInternalStatus()}disconnectedCallback(){super.disconnectedCallback()}render(){this.innerHTML=this.createDrawerHTML(),this.addEventListeners()}checkMealzInternalStatus(e=0){var t,r,s,a;if((r=(t=window.mealzInternal)==null?void 0:t.supplier)!=null&&r.getToken()&&((a=(s=window.mealzInternal)==null?void 0:s.user)!=null&&a.getLanguage())){this.isMealzInternalReady=!0;return}else e>50&&console.warn("Unable to find the supplier token or user language. Please verify the configuration."),setTimeout(()=>this.checkMealzInternalStatus(e+1),100)}createDrawerHTML(){return`
1
+ import{t as d}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{N as c}from"../assets/no-shadow-element-BjktO6El.js";var u=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var a=s>1?void 0:s?u(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(a=i(a)||a);return a};let l=class extends c{constructor(){super(...arguments),this.isMealzInternalReady=!1}connectedCallback(){super.connectedCallback(),this.classList.add("hidden"),this.checkMealzInternalStatus()}disconnectedCallback(){super.disconnectedCallback()}render(){this.innerHTML=this.createDrawerHTML(),this.addEventListeners()}checkMealzInternalStatus(e=0){var t,r,s,a;if((r=(t=window.mealzInternal)==null?void 0:t.supplier)!=null&&r.getToken()&&((a=(s=window.mealzInternal)==null?void 0:s.user)!=null&&a.getLanguage())){this.isMealzInternalReady=!0;return}else e>50&&console.warn("Unable to find the supplier token or user language. Please verify the configuration."),setTimeout(()=>this.checkMealzInternalStatus(e+1),100)}createDrawerHTML(){return`
2
2
  <div class="mealz-shadow-overlay"></div>
3
3
  <div class="mealz-drawer">
4
4
  <div class="mealz-drawer__header">
@@ -8,4 +8,4 @@ import{t as d}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-el
8
8
  <div class="mealz-drawer__close-icon miam-ds-button ghost square"></div>
9
9
  </div>
10
10
  <div class="mealz-drawer__content-container"></div>
11
- </div>`}addEventListeners(){const e=this.querySelector(".mealz-drawer__close-icon"),t=this.querySelector(".mealz-shadow-overlay");e&&t&&(e.addEventListener("click",this.closeDrawer.bind(this)),t.addEventListener("click",this.closeDrawer.bind(this)))}async openDrawer(){this.classList.remove("hidden"),document.body.classList.add("mealz-no-scroll")}closeDrawer(){const e=new URL(window.location.href);e.searchParams.delete("order"),window.history.pushState({},"",e.toString()),document.body.classList.remove("mealz-no-scroll"),this.classList.add("hidden"),this.updateDrawerContent("","",!1)}updateDrawerContent(e,t,r){const s=this.querySelector(".mealz-drawer__content-container"),a=this.querySelector(".mealz-drawer__title span"),n=this.querySelector(".mealz-drawer");s&&(s.innerHTML=e),a&&(a.textContent=t||""),n&&(n.classList.toggle("without-header",r),n.classList.toggle("with-header",!r))}async fetchDrawerData(e,t,r,s){const a=new URLSearchParams;a.append("order",t.toString()),s&&a.append("store_id",s);const n=await this.buildHeaders(r);return await(await fetch(e+"?"+a,{method:"GET",headers:n})).text()}async loadDrawerData(e,t,r,s){const a=await this.fetchDrawerData(e,t,r,s),n=this.parseStartingData(a);if(n){const{title:i,noHeaderMode:o}=n;this.updateDrawerContent(a,i,o)}}parseStartingData(e){const r=new DOMParser().parseFromString(e,"text/html").querySelector("[starting-data]");if(!r)return null;const s=r.getAttribute("starting-data");if(!s)return null;const a=JSON.parse(s);return r.removeAttribute("starting-data"),a}async buildHeaders(e){if(!this.isMealzInternalReady)return await new Promise(s=>setTimeout(s,100)),this.buildHeaders(e);const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":e},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}};l=w([d("mealz-drawer")],l);customElements.get("mealz-drawer")||customElements.define("mealz-drawer",l);document.addEventListener("DOMContentLoaded",()=>{if(!document.querySelector("mealz-drawer")){const t=new l;document.body.appendChild(t)}});export{l as M};
11
+ </div>`}addEventListeners(){const e=this.querySelector(".mealz-drawer__close-icon"),t=this.querySelector(".mealz-shadow-overlay");e&&t&&(e.addEventListener("click",this.closeDrawer.bind(this)),t.addEventListener("click",this.closeDrawer.bind(this)))}async openDrawer(){this.classList.remove("hidden"),document.body.classList.add("mealz-no-scroll")}closeDrawer(){const e=new URL(window.location.href);e.searchParams.delete("order"),window.history.pushState({},"",e.toString()),document.body.classList.remove("mealz-no-scroll"),this.classList.add("hidden"),this.updateDrawerContent("","",!1)}updateDrawerContent(e,t,r){const s=this.querySelector(".mealz-drawer__content-container"),a=this.querySelector(".mealz-drawer__title span"),n=this.querySelector(".mealz-drawer");s&&(s.innerHTML=e),a&&(a.textContent=t||""),n&&(n.classList.toggle("without-header",r),n.classList.toggle("with-header",!r))}async fetchDrawerData(e,t,r,s){const a=new URLSearchParams;a.append("order",t.toString()),s&&a.append("store_id",s);const n=await this.buildHeaders(r);return await(await fetch(e+"?"+a,{method:"GET",headers:n})).text()}async loadDrawerData(e,t,r,s){const a=await this.fetchDrawerData(e,t,r,s),n=this.parseStartingData(a);if(n){const{title:i,noHeaderMode:o}=n;this.updateDrawerContent(a,i,o)}}parseStartingData(e){const r=new DOMParser().parseFromString(e,"text/html").querySelector("[starting-data]");if(!r)return null;const s=r.getAttribute("starting-data");if(!s)return null;const a=JSON.parse(s);return r.removeAttribute("starting-data"),a}async buildHeaders(e){if(!this.isMealzInternalReady)return await new Promise(s=>setTimeout(s,100)),this.buildHeaders(e);const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":e},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}};l=h([d("mealz-drawer")],l);customElements.get("mealz-drawer")||customElements.define("mealz-drawer",l);document.addEventListener("DOMContentLoaded",()=>{if(!document.querySelector("mealz-drawer")){const t=new l;document.body.appendChild(t)}});export{l as M};
@@ -1 +1 @@
1
- import{t as n}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as l}from"../assets/no-shadow-element-CaVIVF-o.js";import{M as c}from"../drawer/drawer.min.js";var h=Object.defineProperty,m=Object.getOwnPropertyDescriptor,u=(a,e,i,o)=>{for(var r=o>1?void 0:o?m(e,i):e,s=a.length-1,t;s>=0;s--)(t=a[s])&&(r=(o?t(e,i,r):t(r))||r);return o&&r&&h(e,i,r),r};let d=class extends l{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var s;if(this.historyOrderHTML=this.querySelector(".mealz-history-order"),!this.historyOrderHTML)return;const a=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!a)return;const{orderId:e,drawerDataURL:i,sessionId:o,storeId:r}=JSON.parse(a);this.historyOrderHTML.addEventListener("click",()=>{this.updateURLWithOrder(e);let t=document.querySelector("mealz-drawer");t||(t=new c,document.body.appendChild(t)),t.openDrawer(),t.loadDrawerData(i,e,o,r)}),this.removeAttribute("starting-data")}updateURLWithOrder(a){const e=new URL(window.location.href);e.searchParams.set("order",a),window.history.pushState({},"",e.toString())}};d=u([n("mealz-history-order")],d);customElements.get("mealz-history-order")||customElements.define("mealz-history-order",d);
1
+ import{t as n}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{N as l}from"../assets/no-shadow-element-BjktO6El.js";import{M as c}from"../drawer/drawer.min.js";var h=Object.getOwnPropertyDescriptor,m=(t,e,i,s)=>{for(var a=s>1?void 0:s?h(e,i):e,o=t.length-1,r;o>=0;o--)(r=t[o])&&(a=r(a)||a);return a};let d=class extends l{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var o;if(this.historyOrderHTML=this.querySelector(".mealz-history-order"),!this.historyOrderHTML)return;const t=(o=this.attributes["starting-data"])==null?void 0:o.value;if(!t)return;const{orderId:e,drawerDataURL:i,sessionId:s,storeId:a}=JSON.parse(t);this.historyOrderHTML.addEventListener("click",()=>{this.updateURLWithOrder(e);let r=document.querySelector("mealz-drawer");r||(r=new c,document.body.appendChild(r)),r.openDrawer(),r.loadDrawerData(i,e,s,a)}),this.removeAttribute("starting-data")}updateURLWithOrder(t){const e=new URL(window.location.href);e.searchParams.set("order",t),window.history.pushState({},"",e.toString())}};d=m([n("mealz-history-order")],d);customElements.get("mealz-history-order")||customElements.define("mealz-history-order",d);
@@ -1 +1 @@
1
- import{t as d}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as l}from"../assets/no-shadow-element-CaVIVF-o.js";var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(i,t,s,a)=>{for(var e=a>1?void 0:a?m(t,s):t,r=i.length-1,n;r>=0;r--)(n=i[r])&&(e=(a?n(t,s,e):n(e))||e);return a&&e&&p(t,s,e),e};let o=class extends l{render(){var s;this.recipesElements=Array.from(this.querySelectorAll(".mealz-history-order-expanded__recipe"));const i=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!i)return;const{recipesInfos:t}=JSON.parse(i);this.recipesElements.forEach((a,e)=>{a.addEventListener("click",()=>{const r=JSON.parse(t[e].startingData);window.mealzInternal.recipes.openDetails(r.id,r.guests,r.initialTabIndex)})}),this.removeAttribute("starting-data")}};o=c([d("mealz-history-order-expanded")],o);customElements.get("mealz-history-order-expanded")||customElements.define("mealz-history-order-expanded",o);
1
+ import{t as d}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{N as l}from"../assets/no-shadow-element-BjktO6El.js";var p=Object.getOwnPropertyDescriptor,m=(r,s,a,i)=>{for(var t=i>1?void 0:i?p(s,a):s,e=r.length-1,o;e>=0;e--)(o=r[e])&&(t=o(t)||t);return t};let n=class extends l{render(){var a;this.recipesElements=Array.from(this.querySelectorAll(".mealz-history-order-expanded__recipe"));const r=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!r)return;const{recipesInfos:s}=JSON.parse(r);this.recipesElements.forEach((i,t)=>{i.addEventListener("click",()=>{const e=JSON.parse(s[t].startingData);window.mealzInternal.recipes.openDetails(e.id,e.guests,e.initialTabIndex)})}),this.removeAttribute("starting-data")}};n=m([d("mealz-history-order-expanded")],n);customElements.get("mealz-history-order-expanded")||customElements.define("mealz-history-order-expanded",n);
@@ -1 +1 @@
1
- import{N as c}from"../assets/no-shadow-element-CaVIVF-o.js";import{t as h}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";var o=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=(t,e,a,s)=>{for(var i=s>1?void 0:s?d(e,a):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(i=(s?r(e,a,i):r(i))||i);return s&&i&&o(e,a,i),i};let l=class extends c{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId="",this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.icon=this.button.querySelector(".mealz-like-button__icon"),this.hearts=Array.from(this.button.querySelectorAll(".mealz-like-button__icon img")),!(!this.icon||!this.hearts)&&(this.getInitialStatus(),this.button.addEventListener("click",t=>{t.stopPropagation(),this.toggle()}),this.subscriptions.push(window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:t,isPast:e})=>{t===this.recipeId&&(this.liked=!e,this.updateDOM())}))))}getInitialStatus(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{id:e,recipeId:a,liked:s,path:i,likeHidden:n}=JSON.parse(t);this.recipeLikeId=e,this.recipeId=a,this.liked=s!==void 0?s:!1,this.analyticsPath=i,n&&this.initHiddenLike(),this.removeAttribute("starting-data")}initHiddenLike(){this.subscriptions.push(window.mealzInternal.recipes.getRecipeLike(this.recipeId).subscribe(t=>{this.recipeLikeId=t.id,this.liked=t.attributes["is-past"]===!1,this.updateDOM(),this.button.classList.remove("hidden")}))}toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked,this.analyticsPath)}updateDOM(){this.icon.classList.toggle("fill",this.liked),this.hearts[0].classList.toggle("active",!this.liked),this.hearts[1].classList.toggle("active",this.liked)}};l=u([h("mealz-like-button")],l);
1
+ import{N as c}from"../assets/no-shadow-element-BjktO6El.js";import{t as h}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";var o=Object.getOwnPropertyDescriptor,d=(t,i,n,s)=>{for(var e=s>1?void 0:s?o(i,n):i,r=t.length-1,a;r>=0;r--)(a=t[r])&&(e=a(e)||e);return e};let l=class extends c{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId="",this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.icon=this.button.querySelector(".mealz-like-button__icon"),this.hearts=Array.from(this.button.querySelectorAll(".mealz-like-button__icon img")),!(!this.icon||!this.hearts)&&(this.getInitialStatus(),this.button.addEventListener("click",t=>{t.stopPropagation(),this.toggle()}),this.subscriptions.push(window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:t,isPast:i})=>{t===this.recipeId&&(this.liked=!i,this.updateDOM())}))))}getInitialStatus(){var a;const t=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!t)return;const{id:i,recipeId:n,liked:s,path:e,likeHidden:r}=JSON.parse(t);this.recipeLikeId=i,this.recipeId=n,this.liked=s!==void 0?s:!1,this.analyticsPath=e,r&&this.initHiddenLike(),this.removeAttribute("starting-data")}initHiddenLike(){this.subscriptions.push(window.mealzInternal.recipes.getRecipeLike(this.recipeId).subscribe(t=>{this.recipeLikeId=t.id,this.liked=t.attributes["is-past"]===!1,this.updateDOM(),this.button.classList.remove("hidden")}))}toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked,this.analyticsPath)}updateDOM(){this.icon.classList.toggle("fill",this.liked),this.hearts[0].classList.toggle("active",!this.liked),this.hearts[1].classList.toggle("active",this.liked)}};l=d([h("mealz-like-button")],l);
@@ -1 +1 @@
1
- import{N as d}from"../assets/no-shadow-element-CaVIVF-o.js";import{V as p}from"../assets/viewport-listener-Ci9Ivhrq.js";import{t as u}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{h as w}from"../assets/session-handler-BPS5vj92.js";import"../assets/async--NeWdP3z.js";class a{constructor(){this.trackedRecipes=new Map,this.hasScrolled=!1,this.scrollListener=null,this.cleanupInterval=null,this.MAX_RECIPES=1e3,this.CLEANUP_INTERVAL=5*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.setupScrollListener(),this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return a.instance||(a.instance=new a),a.instance}trackRecipeShow(e,s,r){const i=Date.now(),n=!this.trackedRecipes.get(e),l=this.hasScrolled;!n&&!l||(this.trackedRecipes.size>=this.MAX_RECIPES&&this.cleanOldRecipes(),this.trackedRecipes.set(e,i),window.mealzInternal.analytics.sendEvent("recipe.show",s,{recipe_id:e,category_id:r}))}cleanOldRecipes(){const s=Date.now()-60*60*1e3;for(const[r,i]of this.trackedRecipes.entries())i<s&&this.trackedRecipes.delete(r)}clearAllRecipes(){this.trackedRecipes.clear()}destroy(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null),window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.trackedRecipes.clear(),this.hasScrolled=!1,a.instance=null}setupScrollListener(){let e;this.scrollListener=()=>{this.hasScrolled=!0,clearTimeout(e),e=window.setTimeout(()=>{this.hasScrolled=!1},2e3)},window.addEventListener("scroll",this.scrollListener)}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldRecipes()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var m=Object.defineProperty,I=Object.getOwnPropertyDescriptor,g=(t,e,s,r)=>{for(var i=r>1?void 0:r?I(e,s):e,c=t.length-1,n;c>=0;c--)(n=t[c])&&(i=(r?n(e,s,i):n(i))||i);return r&&i&&m(e,s,i),i};let o=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(t=>{const e=t.find(s=>s.id===this.recipeId);e&&(this.updatedRecipeId=e.id,this.updatedGuests=e.guests,this.updateDOM())}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(s=>s.unsubscribe()),(e=this.analyticsViewportObserver)==null||e.disconnect(),a.getInstance().cleanOldRecipes()}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),this.recipeCardTop&&(this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta&&this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}listenInView(){this.analyticsViewportObserver=new p(this,()=>{this.sendAnalyticsShow()},{threshold:.8,debounce:1e3})}getInitialStatus(){var l;const t=(l=this.attributes["starting-data"])==null?void 0:l.value;if(!t)return;const{id:e,guests:s,path:r,categoryId:i,initialTabIndex:c,sessionId:n}=JSON.parse(t);if(this.recipeId=e,this.analyticsPath=r,this.categoryId=i,this.guests=s,this.initialTabIndex=c,w(n),!s){this.guests=this.getGuests();const h=this.querySelector(".mealz-recipe-card__counter p");h&&(h.innerHTML=this.guests.toString())}this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}getGuests(){const t=localStorage.getItem("_miam/preferences/guests");if(t){const e=+t;if(!isNaN(e)&&e>0&&e<=30)return e}return 4}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const t=this.querySelector(".mealz-recipe-card__counter p");t&&(this.guests=this.updatedGuests??this.getGuests(),t.innerHTML=this.guests.toString())}sendAnalyticsShow(){a.getInstance().trackRecipeShow(this.recipeId,this.analyticsPath,this.categoryId)}};o=g([u("mealz-recipe-card")],o);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",o);
1
+ import{N as d}from"../assets/no-shadow-element-BjktO6El.js";import{V as p}from"../assets/viewport-listener-BrYUdpmX.js";import{t as u}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{h as w}from"../assets/session-handler-BPS5vj92.js";import"../assets/async-CN53vnBN.js";class a{constructor(){this.trackedRecipes=new Map,this.hasScrolled=!1,this.scrollListener=null,this.cleanupInterval=null,this.MAX_RECIPES=1e3,this.CLEANUP_INTERVAL=300*1e3,this.handlePageUnload=()=>{this.destroy()},this.setupScrollListener(),this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return a.instance||(a.instance=new a),a.instance}trackRecipeShow(e,s,r){const i=Date.now(),c=!this.trackedRecipes.get(e),l=this.hasScrolled;!c&&!l||(this.trackedRecipes.size>=this.MAX_RECIPES&&this.cleanOldRecipes(),this.trackedRecipes.set(e,i),window.mealzInternal.analytics.sendEvent("recipe.show",s,{recipe_id:e,category_id:r}))}cleanOldRecipes(){const s=Date.now()-3600*1e3;for(const[r,i]of this.trackedRecipes.entries())i<s&&this.trackedRecipes.delete(r)}clearAllRecipes(){this.trackedRecipes.clear()}destroy(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null),window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.trackedRecipes.clear(),this.hasScrolled=!1,a.instance=null}setupScrollListener(){let e;this.scrollListener=()=>{this.hasScrolled=!0,clearTimeout(e),e=window.setTimeout(()=>{this.hasScrolled=!1},2e3)},window.addEventListener("scroll",this.scrollListener)}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldRecipes()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var g=Object.getOwnPropertyDescriptor,m=(t,e,s,r)=>{for(var i=r>1?void 0:r?g(e,s):e,n=t.length-1,c;n>=0;n--)(c=t[n])&&(i=c(i)||i);return i};let o=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(t=>{const e=t.find(s=>s.id===this.recipeId);e&&(this.updatedRecipeId=e.id,this.updatedGuests=e.guests,this.updateDOM())}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(s=>s.unsubscribe()),(e=this.analyticsViewportObserver)==null||e.disconnect(),a.getInstance().cleanOldRecipes()}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),this.recipeCardTop&&(this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta&&this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}listenInView(){this.analyticsViewportObserver=new p(this,()=>{this.sendAnalyticsShow()},{threshold:.8,debounce:1e3})}getInitialStatus(){var l;const t=(l=this.attributes["starting-data"])==null?void 0:l.value;if(!t)return;const{id:e,guests:s,path:r,categoryId:i,initialTabIndex:n,sessionId:c}=JSON.parse(t);if(this.recipeId=e,this.analyticsPath=r,this.categoryId=i,this.guests=s,this.initialTabIndex=n,w(c),!s){this.guests=this.getGuests();const h=this.querySelector(".mealz-recipe-card__counter p");h&&(h.innerHTML=this.guests.toString())}this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}getGuests(){const t=localStorage.getItem("_miam/preferences/guests");if(t){const e=+t;if(!isNaN(e)&&e>0&&e<=30)return e}return 4}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const t=this.querySelector(".mealz-recipe-card__counter p");t&&(this.guests=this.updatedGuests??this.getGuests(),t.innerHTML=this.guests.toString())}sendAnalyticsShow(){a.getInstance().trackRecipeShow(this.recipeId,this.analyticsPath,this.categoryId)}};o=m([u("mealz-recipe-card")],o);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",o);
@@ -1 +1 @@
1
- import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as d}from"../assets/no-shadow-element-CaVIVF-o.js";var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,t,s,a)=>{for(var i=a>1?void 0:a?o(t,s):t,r=e.length-1,c;r>=0;r--)(c=e[r])&&(i=(a?c(t,s,i):c(i))||i);return a&&i&&p(t,s,i),i};let n=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.setupClickHandler(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{const t=e.map(s=>s.id).includes(this.recipeId);this.updateDOM(t)}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.removeClickHandler()}getInitialStatus(){var t,s;const e=JSON.parse(((t=this.attributes["starting-data"])==null?void 0:t.value)||"{}");if(e){if(e!=null&&e.recipeId)this.recipeId=e.recipeId,this.storeId=e.storeId,this.guests=e.guests,this.standalone=!0,this.inBasket=e.inBasket,this.updateDOM(this.inBasket);else{this.recipeId=(s=this.attributes["starting-data"])==null?void 0:s.value,this.standalone=!1;const a=this.classList.contains("in-basket");this.updateDOM(a)}this.removeAttribute("starting-data")}}setupClickHandler(){this.standalone&&(this.recipeCta=this.querySelector(".mealz-recipe-card-cta"),this.recipeCta&&(this.clickHandler=()=>{window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,0,"/recipes")},this.recipeCta.addEventListener("click",this.clickHandler)))}removeClickHandler(){this.recipeCta&&this.clickHandler&&this.recipeCta.removeEventListener("click",this.clickHandler)}updateDOM(e){const t=this.querySelector(".mealz-recipe-card-cta");t&&(t.classList.remove("hidden"),e?(t.classList.replace("primary","secondary"),t.classList.add("in-basket")):(t.classList.replace("secondary","primary"),t.classList.remove("in-basket")))}};n=h([l("mealz-recipe-card-cta")],n);
1
+ import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{N as d}from"../assets/no-shadow-element-BjktO6El.js";var p=Object.getOwnPropertyDescriptor,o=(e,t,s,i)=>{for(var a=i>1?void 0:i?p(t,s):t,r=e.length-1,c;r>=0;r--)(c=e[r])&&(a=c(a)||a);return a};let n=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.setupClickHandler(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{const t=e.map(s=>s.id).includes(this.recipeId);this.updateDOM(t)}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.removeClickHandler()}getInitialStatus(){var t,s;const e=JSON.parse(((t=this.attributes["starting-data"])==null?void 0:t.value)||"{}");if(e){if(e!=null&&e.recipeId)this.recipeId=e.recipeId,this.storeId=e.storeId,this.guests=e.guests,this.standalone=!0,this.inBasket=e.inBasket,this.updateDOM(this.inBasket);else{this.recipeId=(s=this.attributes["starting-data"])==null?void 0:s.value,this.standalone=!1;const i=this.classList.contains("in-basket");this.updateDOM(i)}this.removeAttribute("starting-data")}}setupClickHandler(){this.standalone&&(this.recipeCta=this.querySelector(".mealz-recipe-card-cta"),this.recipeCta&&(this.clickHandler=()=>{window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,0,"/recipes")},this.recipeCta.addEventListener("click",this.clickHandler)))}removeClickHandler(){this.recipeCta&&this.clickHandler&&this.recipeCta.removeEventListener("click",this.clickHandler)}updateDOM(e){const t=this.querySelector(".mealz-recipe-card-cta");t&&(t.classList.remove("hidden"),e?(t.classList.replace("primary","secondary"),t.classList.add("in-basket")):(t.classList.replace("secondary","primary"),t.classList.remove("in-basket")))}};n=o([l("mealz-recipe-card-cta")],n);
@@ -1 +1 @@
1
- .mealz-recipe-pricing{line-height:100%;max-width:70px;opacity:1;transition:opacity .05s ease-in-out}.mealz-recipe-pricing.re-rendering{opacity:.98}.mealz-recipe-pricing .mealz-recipe-pricing__wrapper .mealz-recipe-pricing__wrapper__subline{color:#1f354380;font-weight:500;line-height:100%}.mealz-recipe-pricing .hidden{display:none}.mealz-recipe-pricing .active{display:block}.mealz-recipe-pricing__loading{width:70px;height:24px;border-radius:.25rem;animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:#c2cfd6}to{background-color:#f0f3f5}}
1
+ .mealz-recipe-pricing{line-height:100%;max-width:70px;opacity:1;transition:opacity .05s ease-in-out}.mealz-recipe-pricing.re-rendering{opacity:.98}.mealz-recipe-pricing .mealz-recipe-pricing__wrapper .mealz-recipe-pricing__wrapper__subline{color:#1f354380;font-weight:500;line-height:100%}.mealz-recipe-pricing .hidden{display:none!important}.mealz-recipe-pricing .active{display:block}.mealz-recipe-pricing__loading{width:70px;height:24px;border-radius:.25rem;animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:#c2cfd6}to{background-color:#f0f3f5}}
@@ -1 +1 @@
1
- import{N as l}from"../assets/no-shadow-element-CaVIVF-o.js";import{S as d,V as u}from"../assets/viewport-listener-Ci9Ivhrq.js";import{t as m}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{n as f,O as P,o as p,c as h}from"../assets/async--NeWdP3z.js";var v=function(e){f(i,e);function i(r){var t=e.call(this)||this;return t._value=r,t}return Object.defineProperty(i.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),i.prototype._subscribe=function(r){var t=e.prototype._subscribe.call(this,r);return!t.closed&&r.next(this._value),t},i.prototype.getValue=function(){var r=this,t=r.hasError,s=r.thrownError,c=r._value;if(t)throw s;return this._throwIfClosed(),c},i.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},i}(d),g=new P(function(e){return e.complete()});function I(e){return e<=0?function(){return g}:p(function(i,r){var t=0;i.subscribe(h(r,function(s){++t<=e&&(r.next(s),e<=t&&r.complete())}))})}function y(e){return p(function(i,r){var t=!1,s=0;i.subscribe(h(r,function(c){return(t||(t=!e(c,s++)))&&r.next(c)}))})}class n{constructor(){this.priceMemorized=new Map,this.displayedPrices=new Set,this.cleanupInterval=null,this.MAX_MEMO_SIZE=500,this.CLEANUP_INTERVAL=10*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return n.instance||(n.instance=new n),n.instance}getMemorizedPrice(i,r){const t=`${i}-${r}`;return this.priceMemorized.get(t)}memorizedPrice(i,r,t){const s=`${i}-${r}`;this.priceMemorized.size>=this.MAX_MEMO_SIZE&&this.cleanOldPrices(),this.priceMemorized.set(s,{price:t,guests:r})}isPriceDisplayed(i,r){const t=`${i}-${r}`;return this.displayedPrices.has(t)}markPriceAsDisplayed(i,r){const t=`${i}-${r}`;this.displayedPrices.add(t)}cleanOldPrices(){this.priceMemorized.size>this.MAX_MEMO_SIZE*.8&&Array.from(this.priceMemorized.entries()).slice(0,Math.floor(this.priceMemorized.size*.3)).forEach(([t])=>{this.priceMemorized.delete(t),this.displayedPrices.delete(t)})}clearAllPrices(){this.priceMemorized.clear(),this.displayedPrices.clear()}destroy(){window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.priceMemorized.clear(),this.displayedPrices.clear(),n.instance=null}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldPrices()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var b=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=(e,i,r,t)=>{for(var s=t>1?void 0:t?w(i,r):i,c=e.length-1,a;c>=0;c--)(a=e[c])&&(s=(t?a(i,r,s):a(s))||s);return t&&s&&b(i,r,s),s};let o=class extends l{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new v(!1),this.priceFetched=!1,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.classList.add("re-rendering"),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests,this.recalculatePrice())}),this.rendered.pipe(y(e=>!e),I(1)).subscribe(()=>{this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{if(!e)return;const i=e.find(r=>r.id===this.recipeId);e.length>0&&i&&parseFloat(i.price)>0?(this.recipePricingValue=i,this.recalculatePrice()):this.recipePricingValue&&!i&&(this.recipePricingValue=void 0,(this.posId||this.extStoreId)&&this.fetchAndUpdatePrice())}))})),requestAnimationFrame(()=>{this.classList.remove("re-rendering")})}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(i=>i.unsubscribe()),(e=this.priceViewportObserver)==null||e.disconnect()}fetchPrice(){const e=n.getInstance(),i=e.getMemorizedPrice(this.recipeId,this.serves);if(i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(i.price),e.markPriceAsDisplayed(this.recipeId,this.serves)});return}this.fetchAndUpdatePrice()}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.recipeId&&this.pricePerServe&&n.getInstance().isPriceDisplayed(this.recipeId,this.serves)&&requestAnimationFrame(()=>{this.applyCurrencyDisplay(this.pricePerServe)}),this.rendered.next(!0))}getInitialStatus(){var a;const e=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!e)return;const{recipeId:i,extStoreId:r,posId:t,pricePerServe:s,serves:c}=JSON.parse(e);this.extStoreId=r,this.posId=t,this.recipeId=i,this.pricePerServe=(s==null?void 0:s.toString())??null,this.serves=c,this.pricePerServe&&this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const i=parseFloat(e);isNaN(i)||(this.formattedPrice=i.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.recipePricing||(this.recipePricing=this.querySelector(".mealz-recipe-pricing")),this.updateDOM())}showPrice(){var r,t;const e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__loading"),i=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper");e==null||e.classList.replace("active","hidden"),i==null||i.classList.replace("hidden","active")}updateDOM(){var i;const e=(i=this.recipePricing)==null?void 0:i.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €",this.showPrice())}recalculatePrice(){if(this.recipePricingValue){const e=(parseFloat(this.recipePricingValue.price)/this.recipePricingValue.guests).toString();this.updatePriceDisplay(e,this.recipePricingValue.guests)}}updatePriceDisplay(e,i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(e);const r=n.getInstance();r.memorizedPrice(this.recipeId,i,e),r.markPriceAsDisplayed(this.recipeId,i)})}listenInView(){this.priceViewportObserver=new u(this,()=>{this.priceFetched||(this.priceFetched=!0,this.fetchPrice())})}fetchAndUpdatePrice(){const e=this.posId||this.extStoreId,i=this.extStoreId;if(!e||!this.recipeId||!this.serves)return;const t=window.mealzInternal.recipes.fetchPricing(this.recipeId,e,this.serves,i).subscribe({next:s=>{s&&s["price-per-serve"]&&(this.pricePerServe=s["price-per-serve"].toString(),this.updatePriceDisplay(this.pricePerServe,this.serves))},error:s=>{console.error("Failed to fetch recipe pricing:",s)}});this.subscriptions.push(t)}};o=S([m("mealz-recipe-pricing")],o);
1
+ import{N as l}from"../assets/no-shadow-element-BjktO6El.js";import{S as d,V as u}from"../assets/viewport-listener-BrYUdpmX.js";import{t as m}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-CNB4fo5J.js";import{n as f,O as P,o as p,c as h}from"../assets/async-CN53vnBN.js";var v=function(e){f(i,e);function i(r){var t=e.call(this)||this;return t._value=r,t}return Object.defineProperty(i.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),i.prototype._subscribe=function(r){var t=e.prototype._subscribe.call(this,r);return!t.closed&&r.next(this._value),t},i.prototype.getValue=function(){var r=this,t=r.hasError,s=r.thrownError,c=r._value;if(t)throw s;return this._throwIfClosed(),c},i.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},i}(d),g=new P(function(e){return e.complete()});function I(e){return e<=0?function(){return g}:p(function(i,r){var t=0;i.subscribe(h(r,function(s){++t<=e&&(r.next(s),e<=t&&r.complete())}))})}function y(e){return p(function(i,r){var t=!1,s=0;i.subscribe(h(r,function(c){return(t||(t=!e(c,s++)))&&r.next(c)}))})}class n{constructor(){this.priceMemorized=new Map,this.displayedPrices=new Set,this.cleanupInterval=null,this.MAX_MEMO_SIZE=500,this.CLEANUP_INTERVAL=600*1e3,this.handlePageUnload=()=>{this.destroy()},this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return n.instance||(n.instance=new n),n.instance}getMemorizedPrice(i,r){const t=`${i}-${r}`;return this.priceMemorized.get(t)}memorizedPrice(i,r,t){const s=`${i}-${r}`;this.priceMemorized.size>=this.MAX_MEMO_SIZE&&this.cleanOldPrices(),this.priceMemorized.set(s,{price:t,guests:r})}isPriceDisplayed(i,r){const t=`${i}-${r}`;return this.displayedPrices.has(t)}markPriceAsDisplayed(i,r){const t=`${i}-${r}`;this.displayedPrices.add(t)}cleanOldPrices(){this.priceMemorized.size>this.MAX_MEMO_SIZE*.8&&Array.from(this.priceMemorized.entries()).slice(0,Math.floor(this.priceMemorized.size*.3)).forEach(([t])=>{this.priceMemorized.delete(t),this.displayedPrices.delete(t)})}clearAllPrices(){this.priceMemorized.clear(),this.displayedPrices.clear()}destroy(){window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.priceMemorized.clear(),this.displayedPrices.clear(),n.instance=null}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldPrices()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var b=Object.getOwnPropertyDescriptor,w=(e,i,r,t)=>{for(var s=t>1?void 0:t?b(i,r):i,c=e.length-1,a;c>=0;c--)(a=e[c])&&(s=a(s)||s);return s};let o=class extends l{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new v(!1),this.priceFetched=!1,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.classList.add("re-rendering"),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests,this.recalculatePrice())}),this.rendered.pipe(y(e=>!e),I(1)).subscribe(()=>{this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{if(!e)return;const i=e.find(r=>r.id===this.recipeId);e.length>0&&i&&parseFloat(i.price)>0?(this.recipePricingValue=i,this.recalculatePrice()):this.recipePricingValue&&!i&&(this.recipePricingValue=void 0,(this.posId||this.extStoreId)&&this.fetchAndUpdatePrice())}))})),requestAnimationFrame(()=>{this.classList.remove("re-rendering")})}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(i=>i.unsubscribe()),(e=this.priceViewportObserver)==null||e.disconnect()}fetchPrice(){const e=n.getInstance(),i=e.getMemorizedPrice(this.recipeId,this.serves);if(i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(i.price),e.markPriceAsDisplayed(this.recipeId,this.serves)});return}this.fetchAndUpdatePrice()}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.recipeId&&this.pricePerServe&&n.getInstance().isPriceDisplayed(this.recipeId,this.serves)&&requestAnimationFrame(()=>{this.applyCurrencyDisplay(this.pricePerServe)}),this.rendered.next(!0))}getInitialStatus(){var a;const e=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!e)return;const{recipeId:i,extStoreId:r,posId:t,pricePerServe:s,serves:c}=JSON.parse(e);this.extStoreId=r,this.posId=t,this.recipeId=i,this.pricePerServe=(s==null?void 0:s.toString())??null,this.serves=c,this.pricePerServe&&this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const i=parseFloat(e);isNaN(i)||(this.formattedPrice=i.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.recipePricing||(this.recipePricing=this.querySelector(".mealz-recipe-pricing")),this.updateDOM())}showPrice(){var r,t;const e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__loading"),i=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper");e==null||e.classList.replace("active","hidden"),i==null||i.classList.replace("hidden","active")}updateDOM(){var i;const e=(i=this.recipePricing)==null?void 0:i.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €",this.showPrice())}recalculatePrice(){if(this.recipePricingValue){const e=(parseFloat(this.recipePricingValue.price)/this.recipePricingValue.guests).toString();this.updatePriceDisplay(e,this.recipePricingValue.guests)}}updatePriceDisplay(e,i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(e);const r=n.getInstance();r.memorizedPrice(this.recipeId,i,e),r.markPriceAsDisplayed(this.recipeId,i)})}listenInView(){this.priceViewportObserver=new u(this,()=>{this.priceFetched||(this.priceFetched=!0,this.fetchPrice())})}fetchAndUpdatePrice(){const e=this.posId||this.extStoreId,i=this.extStoreId;if(!e||!this.recipeId||!this.serves)return;const t=window.mealzInternal.recipes.fetchPricing(this.recipeId,e,this.serves,i).subscribe({next:s=>{s&&s["price-per-serve"]&&(this.pricePerServe=s["price-per-serve"].toString(),this.updatePriceDisplay(this.pricePerServe,this.serves))},error:s=>{console.error("Failed to fetch recipe pricing:",s)}});this.subscriptions.push(t)}};o=w([m("mealz-recipe-pricing")],o);
@@ -1,8 +1,8 @@
1
- import{u,f as m,i as g,r as f,x as n}from"../assets/lit-element-4gw3YGga.js";import{t as b}from"../assets/custom-element-BhZVzxrc.js";/**
1
+ import{f as u,u as m,i as g,h as f,k as n}from"../assets/lit-element-CNB4fo5J.js";import{t as b}from"../assets/custom-element-BhZVzxrc.js";/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const _={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:m},x=(t=_,e,s)=>{const{kind:i,metadata:o}=s;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(s.name,t),i==="accessor"){const{name:r}=s;return{set(p){const h=e.get.call(this);e.set.call(this,p),this.requestUpdate(r,h,t)},init(p){return p!==void 0&&this.P(r,void 0,t),p}}}if(i==="setter"){const{name:r}=s;return function(p){const h=this[r];e.call(this,p),this.requestUpdate(r,h,t)}}throw Error("Unsupported decorator location: "+i)};function c(t){return(e,s)=>typeof s=="object"?x(t,e,s):((i,o,a)=>{const r=o.hasOwnProperty(a);return o.constructor.createProperty(a,r?{...i,wrapped:!0}:i),r?Object.getOwnPropertyDescriptor(o,a):void 0})(t,e,s)}/**
5
+ */const _={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:u},x=(t=_,e,s)=>{const{kind:i,metadata:o}=s;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(s.name,t),i==="accessor"){const{name:r}=s;return{set(p){const h=e.get.call(this);e.set.call(this,p),this.requestUpdate(r,h,t)},init(p){return p!==void 0&&this.P(r,void 0,t),p}}}if(i==="setter"){const{name:r}=s;return function(p){const h=this[r];e.call(this,p),this.requestUpdate(r,h,t)}}throw Error("Unsupported decorator location: "+i)};function c(t){return(e,s)=>typeof s=="object"?x(t,e,s):((i,o,a)=>{const r=o.hasOwnProperty(a);return o.constructor.createProperty(a,r?{...i,wrapped:!0}:i),r?Object.getOwnPropertyDescriptor(o,a):void 0})(t,e,s)}/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
@@ -93,7 +93,7 @@ import{u,f as m,i as g,r as f,x as n}from"../assets/lit-element-4gw3YGga.js";imp
93
93
  </div>
94
94
  `)}
95
95
  </div>
96
- `}getButtonLabel(){if(this._showPosList)return"Voir la carte";const t=this._posList.length;return t===1?"Voir le magasin":`Voir les ${t} magasins`}setAddress(t=!1){!this._addressInput.value||this._addressInput.value.length<3||this._searchingPos||!t&&this._prevAddress===this._addressInput.value+", France"||(this.shadowRoot.getElementById("pos-list"),this._previousSearchMethod=this.setAddress,this._prevAddress=this._addressInput.value+", France",this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByAddress(this._prevAddress,this.selectedRadius,this._selectedSuppliers).subscribe(e=>{this.setPosList(e),this.setNewLocation(),this.dispatchSearch(this._prevAddress,e.data.length),this._searchingPos=!1,this._searchSubmitted=!0,this.togglePosList(!1),this.requestUpdate()})))}setGeolocation(t=!1){this._prevAddress="",this._previousSearchMethod=this.setGeolocation,this.getPosByCoordinates()}getPosByCoordinates(){this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByCoordinates(this.geolocationCoordinates.coords.latitude,this.geolocationCoordinates.coords.longitude,this.selectedRadius,this._selectedSuppliers).subscribe(t=>{this._addressInput.value="",this.setPosList(t),this._searchingPos=!1,this.setNewLocation(),this._searchSubmitted=!0,this.togglePosList(!1),this.requestUpdate()}))}setPosList(t){this._posList=t.data.map(e=>{const s=Object.assign(new S,e);return s.supplier=t.included.find(i=>i.id===s.relationships.supplier.data.id),s}).sort((e,s)=>e.attributes.name.includes("onoprix")?-1:s.attributes.name.includes("onoprix")?1:0)}dispatchPos(t){this._posSelected=!0,this.requestUpdate();const e={detail:{posId:t.id,posExtId:t.extId,supplierId:t.supplier.id,supplierName:t.supplier.attributes.name,posName:this._nameOfStore(t)},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("posIdChange",e))}dispatchShow(t){const e={detail:{show:t},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("showChange",e))}dispatchSearch(t,e){const s={detail:{searchTerm:t,storesFoundCount:e},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent searchChange",s),this.dispatchEvent(new CustomEvent("searchChange",s))}initLeaflet(){this._leafletCss=document.createElement("link"),this._leafletCss.setAttribute("rel","stylesheet"),this._leafletCss.setAttribute("href","https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),this._leafletCss.setAttribute("integrity","sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="),this._leafletCss.setAttribute("crossorigin",""),this._leafletJs=document.createElement("script"),this._leafletJs.setAttribute("src","https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),this._leafletJs.setAttribute("integrity","sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="),this._leafletJs.setAttribute("crossorigin",""),this._miamDs=document.createElement("link"),this._miamDs.setAttribute("rel","stylesheet"),this._miamDs.setAttribute("href","https://unpkg.com/miam-ds@1.2.6/miam-ds.min.css"),this.shadowRoot.appendChild(this._miamDs),this.shadowRoot.appendChild(this._leafletCss),document.head.appendChild(this._leafletJs)}waitForLeaflet(t){let i=50;console.debug("[Map] Checking for window.L");const o=setInterval(()=>{window.L!==void 0||i===0?(clearInterval(o),window.L!==void 0?(console.debug("[Map] window.L is defined"),t(!0)):(console.error("[Map] Failed to load Leaflet after",50*100,"ms"),t(!1))):i--},100)}initMap(){this._map&&(this._map.off(),this._map.remove()),this.setNewLocation(),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{maxZoom:19,attribution:"Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL."}).addTo(this._map)}loadMap(){this.waitForLeaflet(t=>{t&&this.initMap()})}initEvents(){this._filterEvent=new CustomEvent("filterChange",{detail:{supplierName:""},bubbles:!0,composed:!0})}fetchSuppliers(){this.subscriptions.push(this.getAffiliateSuppliers().subscribe(t=>{this._suppliers=t.map(e=>({id:e.id,name:e.attributes.name})),this.requestUpdate()}))}setNewLocation(){var e;const t=this.shadowRoot.getElementById("map");t&&(this._map?(this._markers.forEach(s=>{this._map.removeLayer(s)}),this._markers=[],this._map.panTo(this.getCoordinates())):this._map=(e=window.L)==null?void 0:e.map(t).setView(this.getCoordinates(),13),this.addMarkers())}getCoordinates(){return this._posList.length<1?[48.866667,2.333333]:[this._posList[0].attributes.latitude,this._posList[0].attributes.longitude]}addMarkers(){this._posList.length>0&&this._posList.forEach((t,e)=>{this._markers.push(window.L.marker([t.attributes.latitude,t.attributes.longitude],{icon:this.buildIcon(t.supplier)}).addTo(this._map));let s=window.L.popup({content:`
96
+ `}getButtonLabel(){if(this._showPosList)return"Voir la carte";const t=this._posList.length;return t===1?"Voir le magasin":`Voir les ${t} magasins`}setAddress(t=!1){!this._addressInput.value||this._addressInput.value.length<3||this._searchingPos||!t&&this._prevAddress===this._addressInput.value+", France"||(this.shadowRoot.getElementById("pos-list"),this._previousSearchMethod=this.setAddress,this._prevAddress=this._addressInput.value+", France",this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByAddress(this._prevAddress,this.selectedRadius,this._selectedSuppliers).subscribe(e=>{this.setPosList(e),this.setNewLocation(),this.dispatchSearch(this._prevAddress,e.data.length),this._searchingPos=!1,this._searchSubmitted=!0,this.togglePosList(!1),this.requestUpdate()})))}setGeolocation(t=!1){this._prevAddress="",this._previousSearchMethod=this.setGeolocation,this.getPosByCoordinates()}getPosByCoordinates(){this._searchingPos=!0,this.requestUpdate(),this.subscriptions.push(this.getByCoordinates(this.geolocationCoordinates.coords.latitude,this.geolocationCoordinates.coords.longitude,this.selectedRadius,this._selectedSuppliers).subscribe(t=>{this._addressInput.value="",this.setPosList(t),this._searchingPos=!1,this.setNewLocation(),this._searchSubmitted=!0,this.togglePosList(!1),this.requestUpdate()}))}setPosList(t){this._posList=t.data.map(e=>{const s=Object.assign(new S,e);return s.supplier=t.included.find(i=>i.id===s.relationships.supplier.data.id),s}).sort((e,s)=>e.attributes.name.includes("onoprix")?-1:s.attributes.name.includes("onoprix")?1:0)}dispatchPos(t){this._posSelected=!0,this.requestUpdate();const e={detail:{posId:t.id,posExtId:t.extId,supplierId:t.supplier.id,supplierName:t.supplier.attributes.name,posName:this._nameOfStore(t)},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("posIdChange",e))}dispatchShow(t){const e={detail:{show:t},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("showChange",e))}dispatchSearch(t,e){const s={detail:{searchTerm:t,storesFoundCount:e},bubbles:!0,composed:!0};console.debug("[MealzComponents] dispatchEvent searchChange",s),this.dispatchEvent(new CustomEvent("searchChange",s))}initLeaflet(){this._leafletCss=document.createElement("link"),this._leafletCss.setAttribute("rel","stylesheet"),this._leafletCss.setAttribute("href","https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),this._leafletCss.setAttribute("integrity","sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="),this._leafletCss.setAttribute("crossorigin",""),this._leafletJs=document.createElement("script"),this._leafletJs.setAttribute("src","https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"),this._leafletJs.setAttribute("integrity","sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="),this._leafletJs.setAttribute("crossorigin",""),this._miamDs=document.createElement("link"),this._miamDs.setAttribute("rel","stylesheet"),this._miamDs.setAttribute("href","https://unpkg.com/miam-ds@1.2.6/miam-ds.min.css"),this.shadowRoot.appendChild(this._miamDs),this.shadowRoot.appendChild(this._leafletCss),document.head.appendChild(this._leafletJs)}waitForLeaflet(t){let i=50;console.debug("[Map] Checking for window.L");const o=setInterval(()=>{window.L!==void 0||i===0?(clearInterval(o),window.L!==void 0?(console.debug("[Map] window.L is defined"),t(!0)):(console.error("[Map] Failed to load Leaflet after",5e3,"ms"),t(!1))):i--},100)}initMap(){this._map&&(this._map.off(),this._map.remove()),this.setNewLocation(),window.L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",{maxZoom:19,attribution:"Map tiles by Carto, under CC BY 3.0. Data by OpenStreetMap, under ODbL."}).addTo(this._map)}loadMap(){this.waitForLeaflet(t=>{t&&this.initMap()})}initEvents(){this._filterEvent=new CustomEvent("filterChange",{detail:{supplierName:""},bubbles:!0,composed:!0})}fetchSuppliers(){this.subscriptions.push(this.getAffiliateSuppliers().subscribe(t=>{this._suppliers=t.map(e=>({id:e.id,name:e.attributes.name})),this.requestUpdate()}))}setNewLocation(){var e;const t=this.shadowRoot.getElementById("map");t&&(this._map?(this._markers.forEach(s=>{this._map.removeLayer(s)}),this._markers=[],this._map.panTo(this.getCoordinates())):this._map=(e=window.L)==null?void 0:e.map(t).setView(this.getCoordinates(),13),this.addMarkers())}getCoordinates(){return this._posList.length<1?[48.866667,2.333333]:[this._posList[0].attributes.latitude,this._posList[0].attributes.longitude]}addMarkers(){this._posList.length>0&&this._posList.forEach((t,e)=>{this._markers.push(window.L.marker([t.attributes.latitude,t.attributes.longitude],{icon:this.buildIcon(t.supplier)}).addTo(this._map));let s=window.L.popup({content:`
97
97
  <div class="pos-item">
98
98
  <div class="top">
99
99
  <img class="pos-img" src="${t.supplier.attributes.logo}" alt="${t.supplier.attributes.name}"/>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mealz-components",
3
3
  "type": "module",
4
- "version": "1.3.14",
4
+ "version": "1.3.15",
5
5
  "main": "./dist/mealz-components.js",
6
6
  "module": "./dist/mealz-components.js",
7
7
  "scripts": {
@@ -1,3 +0,0 @@
1
- var x=function(r,e){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},x(r,e)};function b(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");x(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ot(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function c(f){try{u(n.next(f))}catch(d){s(d)}}function a(f){try{u(n.throw(f))}catch(d){s(d)}}function u(f){f.done?i(f.value):o(f.value).then(c,a)}u((n=n.apply(r,e||[])).next())})}function st(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=c(0),s.throw=c(1),s.return=c(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return a([u,f])}}function a(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(t=0)),t;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,o=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function w(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function g(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function I(r){return this instanceof I?(this.v=r,this):new I(r)}function ut(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(p){return Promise.resolve(p).then(l,d)}}function c(l,p){n[l]&&(o[l]=function(h){return new Promise(function(M,Y){i.push([l,h,M,Y])>1||a(l,h)})},p&&(o[l]=p(o[l])))}function a(l,p){try{u(n[l](p))}catch(h){v(i[0][3],h)}}function u(l){l.value instanceof I?Promise.resolve(l.value.v).then(f,d):v(i[0][2],l)}function f(l){a("next",l)}function d(l){a("throw",l)}function v(l,p){l(p),i.shift(),i.length&&a(i[0][0],i[0][1])}}function ct(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof w=="function"?w(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(s){return new Promise(function(c,a){s=r[i](s),o(c,a,s.done,s.value)})}}function o(i,s,c,a){Promise.resolve(a).then(function(u){i({value:u,done:c})},s)}}function y(r){return typeof r=="function"}function V(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var A=V(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function P(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var _=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var c=w(s),a=c.next();!a.done;a=c.next()){var u=a.value;u.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else s.remove(this);var f=this.initialTeardown;if(y(f))try{f()}catch(h){i=h instanceof A?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=w(d),l=v.next();!l.done;l=v.next()){var p=l.value;try{j(p)}catch(h){i=i??[],h instanceof A?i=g(g([],S(i)),S(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{l&&!l.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new A(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)j(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&P(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&P(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),at=_.EMPTY;function q(r){return r instanceof _||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function j(r){y(r)?r():r.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},D={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,g([r,e],S(t)))},clearTimeout:function(r){var e=D.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function B(r){D.setTimeout(function(){throw r})}function k(){}function G(r){r()}var O=function(r){b(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,q(t)&&t.add(n)):n.destination=K,n}return e.create=function(t,n,o){return new T(t,n,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(_),H=Function.prototype.bind;function E(r,e){return H.call(r,e)}var L=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){m(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){m(n)}else m(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){m(t)}},r}(),T=function(r){b(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(y(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var c;i&&C.useDeprecatedNextContext?(c=Object.create(t),c.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&E(t.next,c),error:t.error&&E(t.error,c),complete:t.complete&&E(t.complete,c)}):s=t}return i.destination=new L(s),i}return e}(O);function m(r){B(r)}function J(r){throw r}var K={closed:!0,next:k,error:J,complete:k},Q=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function W(r){return r}function X(r){return r.length===0?W:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var lt=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=$(e)?e:new T(e,t,n);return G(function(){var s=o,c=s.operator,a=s.source;i.add(c?c.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=U(t),new t(function(o,i){var s=new T({next:function(c){try{e(c)}catch(a){i(a),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Q]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return X(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=U(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r}();function U(r){var e;return(e=r??C.Promise)!==null&&e!==void 0?e:Promise}function Z(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function $(r){return r&&r instanceof O||Z(r)&&q(r)}function z(r){return y(r==null?void 0:r.lift)}function ft(r){return function(e){if(z(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ht(r,e,t,n,o){return new N(r,e,t,n,o)}var N=function(r){b(e,r);function e(t,n,o,i,s,c){var a=r.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=c,a._next=n?function(u){try{n(u)}catch(f){t.error(f)}}:r.prototype._next,a._error=i?function(u){try{i(u)}catch(f){t.error(f)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.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))}},e}(O),tt={now:function(){return Date.now()},delegate:void 0},rt=function(r){b(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e}(_),F={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,g([r,e],S(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},et=function(r){b(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),F.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&F.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,P(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(rt),R=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=tt.now,r}(),nt=function(r){b(e,r);function e(t,n){n===void 0&&(n=R.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e}(R),it=new nt(et),pt=it;export{at as E,lt as O,_ as S,ut as _,Q as a,st as b,ht as c,I as d,w as e,ot as f,ct as g,g as h,y as i,S as j,pt as k,it as l,V as m,b as n,ft as o,P as p,G as q,B as r};
@@ -1,19 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const T=globalThis,D=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,I=Symbol(),V=new WeakMap;let tt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==I)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(D&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=V.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&V.set(e,t))}return t}toString(){return this.cssText}};const ot=n=>new tt(typeof n=="string"?n:n+"",void 0,I),wt=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((s,i,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[o+1],n[0]);return new tt(e,n,I)},ht=(n,t)=>{if(D)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},W=D?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ot(e)})(n):n;/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:at,defineProperty:lt,getOwnPropertyDescriptor:ct,getOwnPropertyNames:dt,getOwnPropertySymbols:pt,getPrototypeOf:$t}=Object,f=globalThis,q=f.trustedTypes,ut=q?q.emptyScript:"",M=f.reactiveElementPolyfillSupport,b=(n,t)=>n,B={toAttribute(n,t){switch(t){case Boolean:n=n?ut:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},et=(n,t)=>!at(n,t),J={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:et};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=J){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&lt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=ct(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i==null?void 0:i.call(this)},set(r){const l=i==null?void 0:i.call(this);o.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??J}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=$t(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,s=[...dt(e),...pt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(W(i))}else t!==void 0&&e.push(W(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ht(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:B).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:B;this._$Em=i,this[i]=l.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??et)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,r]of i)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[b("elementProperties")]=new Map,y[b("finalized")]=new Map,M==null||M({ReactiveElement:y}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");/**
10
- * @license
11
- * Copyright 2017 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */const C=globalThis,N=C.trustedTypes,K=N?N.createPolicy("lit-html",{createHTML:n=>n}):void 0,st="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,it="?"+_,_t=`<${it}>`,g=document,w=()=>g.createComment(""),P=n=>n===null||typeof n!="object"&&typeof n!="function",j=Array.isArray,ft=n=>j(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",k=`[
14
- \f\r]`,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,F=/>/g,A=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),G=/'/g,Q=/"/g,nt=/^(?:script|style|textarea|title)$/i,At=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),Pt=At(1),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),X=new WeakMap,m=g.createTreeWalker(g,129);function rt(n,t){if(!j(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return K!==void 0?K.createHTML(t):t}const mt=(n,t)=>{const e=n.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",r=S;for(let l=0;l<e;l++){const h=n[l];let c,p,a=-1,$=0;for(;$<h.length&&(r.lastIndex=$,p=r.exec(h),p!==null);)$=r.lastIndex,r===S?p[1]==="!--"?r=Z:p[1]!==void 0?r=F:p[2]!==void 0?(nt.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=A):p[3]!==void 0&&(r=A):r===A?p[0]===">"?(r=i??S,a=-1):p[1]===void 0?a=-2:(a=r.lastIndex-p[2].length,c=p[1],r=p[3]===void 0?A:p[3]==='"'?Q:G):r===Q||r===G?r=A:r===Z||r===F?r=S:(r=A,i=void 0);const u=r===A&&n[l+1].startsWith("/>")?" ":"";o+=r===S?h+_t:a>=0?(s.push(c),h.slice(0,a)+st+h.slice(a)+_+u):h+_+(a===-2?l:u)}return[rt(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class U{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,r=0;const l=t.length-1,h=this.parts,[c,p]=mt(t,e);if(this.el=U.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const a of i.getAttributeNames())if(a.endsWith(st)){const $=p[r++],u=i.getAttribute(a).split(_),H=/([.?@])?(.*)/.exec($);h.push({type:1,index:o,name:H[2],strings:u,ctor:H[1]==="."?yt:H[1]==="?"?vt:H[1]==="@"?Et:R}),i.removeAttribute(a)}else a.startsWith(_)&&(h.push({type:6,index:o}),i.removeAttribute(a));if(nt.test(i.tagName)){const a=i.textContent.split(_),$=a.length-1;if($>0){i.textContent=N?N.emptyScript:"";for(let u=0;u<$;u++)i.append(a[u],w()),m.nextNode(),h.push({type:2,index:++o});i.append(a[$],w())}}}else if(i.nodeType===8)if(i.data===it)h.push({type:2,index:o});else{let a=-1;for(;(a=i.data.indexOf(_,a+1))!==-1;)h.push({type:7,index:o}),a+=_.length-1}o++}}static createElement(t,e){const s=g.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var r,l;if(t===v)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const o=P(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class gt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??g).importNode(e,!0);m.currentNode=i;let o=m.nextNode(),r=0,l=0,h=s[0];for(;h!==void 0;){if(r===h.index){let c;h.type===2?c=new x(o,o.nextSibling,this,t):h.type===1?c=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(c=new St(o,this,t)),this._$AV.push(c),h=s[++l]}r!==(h==null?void 0:h.index)&&(o=m.nextNode(),r++)}return m.currentNode=g,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),P(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ft(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&P(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=U.createElement(rt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const r=new gt(i,this),l=r.u(this.options);r.p(e),this.T(l),this._$AH=r}}_$AC(t){let e=X.get(t.strings);return e===void 0&&X.set(t.strings,e=new U(t)),e}k(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new x(this.O(w()),this.O(w()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const o=this.strings;let r=!1;if(o===void 0)t=E(this,t,e,0),r=!P(t)||t!==this._$AH&&t!==v,r&&(this._$AH=t);else{const l=t;let h,c;for(t=o[0],h=0;h<o.length-1;h++)c=E(this,l[s+h],e,h),c===v&&(c=this._$AH[h]),r||(r=!P(c)||c!==this._$AH[h]),c===d?t=d:t!==d&&(t+=(c??"")+o[h+1]),this._$AH[h]=c}r&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class yt extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class vt extends R{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Et extends R{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??d)===v)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class St{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}}const L=C.litHtmlPolyfillSupport;L==null||L(U,x),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.2.1");const bt=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new x(t.insertBefore(w(),o),o,void 0,e??{})}return i._$AI(n),i};/**
16
- * @license
17
- * Copyright 2017 Google LLC
18
- * SPDX-License-Identifier: BSD-3-Clause
19
- */class O extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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._$Do=bt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return v}}var Y;O._$litElement$=!0,O.finalized=!0,(Y=globalThis.litElementHydrateSupport)==null||Y.call(globalThis,{LitElement:O});const z=globalThis.litElementPolyfillSupport;z==null||z({LitElement:O});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");export{et as f,wt as i,O as r,B as u,Pt as x};
@@ -1 +0,0 @@
1
- import{r as e}from"./lit-element-4gw3YGga.js";class o extends e{createRenderRoot(){return this}}export{o as N};