"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class CarFilter{constructor(el){_defineProperty(this,"$el",void 0);this.$el=el;this.modelManufacturerAssociations=this.$el.querySelector("#filter-model-manufacturer-associations");this.manufacturerSelect=this.$el.querySelector("#filter-manufacturer-select");this.filterModelSelect=this.$el.querySelector("#filter-model-select");this.associations=this.getModelManufacturerAssociations();this.updateModelOptionsVisibility();this.addEventListeners()}provideModelsByManufacturer(manufacturer){if(manufacturer in this.associations){return this.associations[manufacturer]}return[]}updateModelOptionsVisibility(){const manufacturer=this.manufacturerSelect.value;const models=this.provideModelsByManufacturer(manufacturer);for(const option of this.filterModelSelect.options){if(models.includes(option.value)||manufacturer===""){option.style.removeProperty("display")}else{if(option.value!==""){option.style.display="none"}}}}getModelManufacturerAssociations(){const associationsJson=this.modelManufacturerAssociations.dataset.associations;return JSON.parse(associationsJson)}addEventListeners(){this.manufacturerSelect.addEventListener("change",()=>{this.updateModelOptionsVisibility()})}}
//# sourceMappingURL=CarFilter.min.js.map

;"use strict";class ScrollToFormNotification{constructor(formSelector){this.formNotification=document.querySelector(formSelector+" [data-notification]");this.formInvalidItem=document.querySelector(formSelector+" .is-invalid");this.scrollToElement()}getItem(){if(this.formNotification){return this.formNotification}if(this.formInvalidItem){return this.formInvalidItem}return null}scrollToElement(){const el=this.getItem();el&&el.scrollIntoView({behavior:"smooth",block:"center"})}}
//# sourceMappingURL=scroll-to-form-notification.min.js.map

;"use strict";class Util{static elIndex(el){return[...el.parentElement.children].indexOf(el)}static ucFirst(s){return s.charAt(0).toUpperCase()+s.slice(1)}static hasProperty(object,key){return Object.prototype.hasOwnProperty.call(object,key)}static parseStringToElements(string){const nodes=[];const templateElement=document.createElement("template");templateElement.innerHTML=string;for(let i of templateElement.content.children){if(i.tagName.toLowerCase()==="script"){const newTag=document.createElement("script");newTag.text=i.text;for(let attr of i.attributes){newTag.setAttribute(attr.nodeName,attr.nodeValue)}nodes.push(newTag)}else{nodes.push(i)}}return nodes}static appendToBody(string){Util.parseStringToElements(string).forEach(el=>document.body.appendChild(el))}}
//# sourceMappingURL=utilities.min.js.map

;"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class Templating{}_defineProperty(Templating,"baseColor",getComputedStyle(document.documentElement).getPropertyValue("--colorBrand"));
//# sourceMappingURL=templating.min.js.map

;"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class EventBus{constructor(){if(!!EventBus.instance){return EventBus.instance}this.bus=document;EventBus.instance=this;return this}addEventListener(event,callback){this.bus.addEventListener(event,callback)}removeEventListener(event,callback){this.bus.removeEventListener(event,callback)}dispatchEvent(event,detail={}){this.bus.dispatchEvent(new CustomEvent(event,{detail}))}static getInstance(){return this.instance}}_defineProperty(EventBus,"instance",new EventBus);window.EventBusInstance=EventBus.getInstance();
//# sourceMappingURL=event-bus.min.js.map

;"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class Component{constructor(el){_defineProperty(this,"$el",void 0);this.$el=el;this.$parentEl=this.$el.parentNode;this._$initGlobalSettings()}$find(query){return this.$el.querySelector(query)}$findAll(query){return this.$el.querySelectorAll(query)}_$setInitState(){this.$el.setAttribute("data-initialized","")}_$initGlobalSettings(){this._$setInitState()}static _initComponentsLibraries(){if(typeof MatchHeight==="function"){new MatchHeight(document.querySelectorAll("[data-match-height]"))}if(typeof lightGallery==="function"){const lightGalleryItems=document.querySelectorAll("[data-lightgallery]");lightGalleryItems.forEach(item=>{const closestGallery=item.closest("[data-gallery-group]");lightGallery(closestGallery?closestGallery:item.parentNode,{selector:"a",thumbnail:false,share:false,iframeMaxWidth:"80%"})})}}static initComponents(){document.querySelectorAll("[data-component]:not([data-initialized])").forEach(component=>{const componentClass=Function("return "+component.dataset.component);try{new(componentClass())(component)}catch(e){console.error(e)}});Component._initComponentsLibraries();EventBus.getInstance().dispatchEvent("initialized")}}
//# sourceMappingURL=component.min.js.map

;"use strict";document.querySelectorAll("input[data-mash]").forEach(input=>{input.setAttribute("value",input.dataset.mash+input.dataset.mash)});
//# sourceMappingURL=cleveromash.min.js.map

;"use strict";!function(){"use strict";function o(){var o=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==o.__forceSmoothScrollPolyfill__)){var l,e=o.HTMLElement||o.Element,r=468,i={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,c=(l=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?h.call(o,t.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):i.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(f(arguments[0])?i.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,t.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==f(arguments[0])){var o=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(!0!==f(arguments[0])){var l=function(o){for(;o!==t.body&&!1===(e=p(l=o,"Y")&&a(l,"Y"),r=p(l,"X")&&a(l,"X"),e||r);)o=o.parentNode||o.host;var l,e,r;return o}(this),e=l.getBoundingClientRect(),r=this.getBoundingClientRect();l!==t.body?(h.call(this,l,l.scrollLeft+r.left-e.left,l.scrollTop+r.top-e.top),"fixed"!==o.getComputedStyle(l).position&&o.scrollBy({left:e.left,top:e.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function n(o,t){this.scrollLeft=o,this.scrollTop=t}function f(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o,t){return"Y"===t?o.clientHeight+c<o.scrollHeight:"X"===t?o.clientWidth+c<o.scrollWidth:void 0}function a(t,l){var e=o.getComputedStyle(t,null)["overflow"+l];return"auto"===e||"scroll"===e}function d(t){var l,e,i,c,n=(s()-t.startTime)/r;c=n=n>1?1:n,l=.5*(1-Math.cos(Math.PI*c)),e=t.startX+(t.x-t.startX)*l,i=t.startY+(t.y-t.startY)*l,t.method.call(t.scrollable,e,i),e===t.x&&i===t.y||o.requestAnimationFrame(d.bind(o,t))}function h(l,e,r){var c,f,p,a,h=s();l===t.body?(c=o,f=o.scrollX||o.pageXOffset,p=o.scrollY||o.pageYOffset,a=i.scroll):(c=l,f=l.scrollLeft,p=l.scrollTop,a=n),d({scrollable:c,method:a,startTime:h,startX:f,startY:p,x:e,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:o}:o()}();
//# sourceMappingURL=smoothscroll-poly.min.js.map

;"use strict";class DelayedScript extends Component{constructor(el){super(el);this.requiredCookiesConsent=Number.parseInt(this.$el.dataset.requiredConsent);this.content=this.$el.dataset.content;if(isNaN(this.requiredCookiesConsent)||!this.content){return}const callback=ev=>this.onCookiesConsentStored(ev.detail,callback);EventBus.getInstance().addEventListener("cookiesConsentStored",callback);this.onCookiesConsentStored({consent:window.cookieConsent},callback)}onCookiesConsentStored(ev,callback){if(!this.content){EventBus.getInstance().removeEventListener("cookiesConsentStored",callback);return}const consent=this.requiredCookiesConsent&ev.consent;if(consent===this.requiredCookiesConsent){const nodes=Util.parseStringToElements(this.content);this.$el.replaceWith(...nodes);this.content="";EventBus.getInstance().removeEventListener("cookiesConsentStored",callback)}}}
//# sourceMappingURL=delayed-script.min.js.map

;"use strict";class AppNavigationBase extends Component{constructor(el){super(el);this.closer=this.$find("[data-closer]");this.subNavOpeners=this.$findAll("[data-opener]");this.addEventListeners()}openNav(){this.$el.classList.add("is-opened");document.body.classList.add("is-not-overflowed")}closeNav(){this.$el.classList.remove("is-opened");document.body.classList.remove("is-not-overflowed")}toggleSubNav(opener){opener.classList.toggle("is-opened");opener.nextElementSibling.classList.toggle("is-opened")}addEventListeners(){this.closer.addEventListener("click",()=>this.closeNav());this.subNavOpeners.forEach(opener=>opener.addEventListener("click",()=>this.toggleSubNav(opener)));EventBus.getInstance().addEventListener("mainNavigationOpen",()=>this.openNav());document.addEventListener("click",e=>{if(!this.$el.contains(e.target)){this.closeNav()}})}}
//# sourceMappingURL=navigation.min.js.map

;"use strict";class QuickSearchBase extends Component{constructor(el){super(el);this.form=this.$find("form");this.closer=this.$find("[data-close]");this.resultsEl=this.$find("[data-results]");this.input=this.$find("input");this.debounceInterval=undefined;this.itemTemplate=this.$find("[data-template-item]");this.headingTemplate=this.$find("[data-template-heading]");this.noResultsTemplate=this.$find("[data-template-no-results]");this.addEventListeners()}constructNoResults(){return this.noResultsTemplate.content.cloneNode(true)}constructItem(image,name,url,subText){const item=this.itemTemplate.content.firstElementChild.cloneNode(true);item.setAttribute("href",url);if(!!image)item.querySelector("[data-image]").innerHTML=image;item.querySelector("[data-name]").innerHTML=name;if(!!subText)item.querySelector("[data-sub-text]").innerHTML=subText;return item}constructHeading(text){const heading=this.headingTemplate.content.cloneNode(true);heading.querySelector("[data-heading]").innerHTML=text;return heading}appendResults(results){this.resultsEl.innerHTML="";if(!results.length){this.resultsEl.appendChild(this.constructNoResults());return}let prevModuleName=null;results.forEach(result=>{prevModuleName!==result.moduleName&&this.resultsEl.appendChild(this.constructHeading(result.moduleName));this.resultsEl.appendChild(this.constructItem(result.image,result.title,result.url,result.subText));prevModuleName=result.moduleName})}fetchSearch(){if(this.input.value.length<2){this.resultsEl.innerHTML="";return}fetch(this.form.getAttribute("action")+"?"+new URLSearchParams({q:this.input.value,ajax:1})).then(response=>response.json()).then(data=>this.appendResults(data)).catch(error=>{console.error("Error:",error)})}showModal(){this.input.focus();this.input.value="";this.resultsEl.innerHTML="";this.$el.classList.add("is-active");document.body.classList.add("u-hiddenOverflow");setTimeout(()=>{this.input.focus()},500)}hideModal(){this.$el.classList.remove("is-active");document.body.classList.remove("u-hiddenOverflow")}addEventListeners(){this.input.addEventListener("input",()=>{this.debounceInterval&&clearTimeout(this.debounceInterval);this.debounceInterval=setTimeout(()=>this.fetchSearch(),500)});this.$el.addEventListener("click",()=>this.hideModal());this.closer.addEventListener("click",()=>this.hideModal());this.form.addEventListener("click",e=>e.stopPropagation());EventBus.getInstance().addEventListener("showQuickSearchModal",()=>this.showModal())}}
//# sourceMappingURL=quick-search.min.js.map

;"use strict";class ProductFilter extends Component{constructor(el){super(el);this.carFilter=new CarFilter(this.$el);this.carTypeButtons=this.$el.querySelectorAll("[data-carTypeButton]");this.addEventListeners();this.scrollIfFiltered()}addEventListeners(){this.carTypeButtons.forEach(clickedButton=>{clickedButton.addEventListener("click",()=>{this.carTypeButtons.forEach(button=>button.classList.remove("active"));clickedButton.classList.add("active")})})}}
//# sourceMappingURL=product-filter.min.js.map

;"use strict";class AppNavigation extends AppNavigationBase{constructor(el){super(el)}}
//# sourceMappingURL=navigation.min.js.map

;"use strict";class HeaderBox extends Component{constructor(el){super(el);this.opener=this.$find("[data-opener]");this.dropdown=this.$find("[data-dropdown]");this.addEventListeners()}toggleDropdown(){this.dropdown.classList.toggle("is-opened");this.opener.classList.toggle("is-active")}hideDropdown(){this.dropdown.classList.remove("is-opened");this.opener.classList.remove("is-active")}addEventListeners(){if(this.dropdown){this.opener.addEventListener("click",()=>this.toggleDropdown());document.addEventListener("click",e=>{if(!this.$el.contains(e.target)){this.hideDropdown()}})}}}
//# sourceMappingURL=header-box.min.js.map

;"use strict";class QuickSearch extends QuickSearchBase{constructor(el){super(el)}}
//# sourceMappingURL=quick-search.min.js.map

;"use strict";class AppHeader extends Component{constructor(el){super(el);this.searchOpener=this.$el.querySelector("[data-search-opener]");this.loginOpener=this.$el.querySelector("[data-login-opener]");this.navOpener=this.$el.querySelector("[data-nav-opener]");this.headerOffset=this.$el.offsetTop-window.scrollY;this.lastScroll=0;this.contactMenu=this.$el.querySelector("[data-header-contact-menu]");this.addEventListeners()}openSearch(){EventBus.getInstance().dispatchEvent("showQuickSearchModal")}openLogin(){EventBus.getInstance().dispatchEvent("showBasePopup","login-popup")}addEventListeners(){this.searchOpener&&this.searchOpener.addEventListener("click",()=>this.openSearch());this.loginOpener&&this.loginOpener.addEventListener("click",()=>this.openLogin());this.navOpener.addEventListener("click",e=>{e.stopPropagation();EventBus.getInstance().dispatchEvent("mainNavigationOpen")});this.contactMenu&&this.contactMenu.addEventListener("mouseover",e=>{e.currentTarget.classList.add("active")});this.contactMenu&&this.contactMenu.addEventListener("mouseleave",e=>{e.currentTarget.classList.remove("active")})}}
//# sourceMappingURL=header.min.js.map

;"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class CookiesPopup extends Component{constructor(el){super(el);_defineProperty(this,"form",void 0);setTimeout(()=>el.classList.add("is-active"),1000);this.fineControl=el.querySelector("[data-fine-control]");this.default=el.querySelector("[data-default]");el.querySelector("[data-open-fine]").addEventListener("click",e=>this.toggleFineControl(e,true));el.querySelector("[data-close-fine]").addEventListener("click",e=>this.toggleFineControl(e,false));el.querySelectorAll("[data-control]").forEach(el=>el.addEventListener("click",e=>this.cookiesSwitch(e)));this.toggles=el.querySelectorAll("input[type=checkbox]");this.form=el.querySelector("form");this.form.addEventListener("submit",e=>this.onFormSubmitted(e))}onConsentStored(response){EventBus.getInstance().dispatchEvent("hideGlobalSpinner");if(response.result){this.$el.classList.remove("is-active");EventBus.getInstance().dispatchEvent("cookiesConsentStored",{consent:response.consent});window.cookieConsent=response.consent}}onSubmitted(){EventBus.getInstance().dispatchEvent("showGlobalSpinner")}toggleFineControl(e,show){e.preventDefault();this.default.classList.toggle("u-hidden",show);this.fineControl.classList.toggle("u-hidden",!show)}cookiesSwitch(e){e.preventDefault();const toggle=Number.parseInt(e.currentTarget.dataset.toggle);this.toggles.forEach(el=>el.checked=toggle===1);this.onSubmitted();fetch(e.currentTarget.getAttribute("href")+"&redirect=0").catch(error=>console.error("error:",error)).then(r=>r.json()).then(r=>this.onConsentStored(r))}onFormSubmitted(e){const data=new FormData(this.form);const params=new URLSearchParams;data.forEach((e,i)=>params.append(i,e.toString()));params.append("redirect","0");const url=this.form.action+"?"+params.toString();this.onSubmitted();fetch(url).catch(error=>console.error("error:",error)).then(r=>r.json()).then(r=>this.onConsentStored(r));e.preventDefault()}}
//# sourceMappingURL=cookies-popup.min.js.map

;"use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}class GoogleTagManager extends Component{constructor(el){super(el);_defineProperty(this,"consentTypes",[]);this.consentTypes=JSON.parse(this.$el.dataset.consentTypes);this.registerEventListeners()}registerEventListeners(){EventBus.getInstance().addEventListener("homeSliderClicked",e=>this.sendPromotionClick(e.detail.name,e.detail.id,"HOMEPAGE"));EventBus.getInstance().addEventListener("cookiesConsentStored",e=>this.onCookiesConsentStored(e.detail))}translateBoolToConsent(bool){return bool?"granted":"denied"}onCookiesConsentStored(ev){const consents={};this.consentTypes.forEach(t=>consents[t.name]=this.translateBoolToConsent(t.id===(t.id&ev.consent)));this.sendEvent(this.toArguments("consent","update",consents));this.sendEvent({event:"consent_updated"})}toArguments(){return arguments}sendPromotionClick(name,id,location){const event={"event":"ecc_promotion_click","ecommerce":{"promoClick":{"promotions":[{"id":id,"name":name,"position":location}]}}};this.sendEvent({ecommerce:null});this.sendEvent(event)}sendEvent(event){window.dataLayer=window.dataLayer||[];window.dataLayer.push(event)}}
//# sourceMappingURL=google-tag-manager.min.js.map

;"use strict";class SpinnerGlobal extends Component{constructor(el){super(el);this.addEventListeners()}showSpinner(){this.$el.classList.add("is-active")}hideSpinner(){this.$el.classList.remove("is-active")}addEventListeners(){EventBus.getInstance().addEventListener("showGlobalSpinner",()=>this.showSpinner());EventBus.getInstance().addEventListener("hideGlobalSpinner",()=>this.hideSpinner())}}
//# sourceMappingURL=spinner-global.min.js.map

;"use strict";Component.initComponents();new ScrollToFormNotification("[data-form-anchor]");
//# sourceMappingURL=init.min.js.map