'use strict';(function(){sys.class.Event=class Event{constructor(){}
trigger(name,params){if(name){const event=new CustomEvent(name,{detail:params});document.dispatchEvent(event);}}
listen(eventName,callback){document.addEventListener(eventName,function(e){callback(e.detail);});}}
sys.event=new sys.class.Event();})();(function(){sys.class.Tools=class Tools{constructor(){this.observers=new Object;this.attributes={'observed':'data-observed'};}
attributesToSelectors(attributes){let selectors=new Object;Object.entries(attributes).forEach(([key,value])=>{selectors[key]="["+value+"]";});return selectors;}
strConcat(stringArray,connection=' - '){let finalString=new String;stringArray.forEach((string,index,array)=>{let concat=index===array.length-1?string:string+connection;finalString+=concat;});return finalString;}
debug(classObject,method,methodArguments,details=null,detailsArguments=null){if(sys.debug.includes(classObject.scriptName)===false)return;const groupName=classObject.scriptName+' -> '+method+(details!==null?' -> '+details.split(' (')[0]:'');const methodArgumentsNames=classObject[method].toString().split('(')[1].split(')')[0].split(', ');const detailsArgumentNames=details!==null?details.split('(')[1].split(')')[0].split(', '):'';console.groupEnd(groupName);}
observe(name,selector,callback){if(sys.debug=='tools')console.log('Tools.js -> observe (name, selector, callback)',name,selector,callback);if(this.observers.hasOwnProperty(name)===false){this.observers[name]=new Object;this.observers[name].selector=selector;this.observers[name].callback=callback;}
this.observers[name].observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting&&entry.target.getAttribute(this.attributes.observed)===null){entry.target.setAttribute(this.attributes.observed,true);const element=entry.target;this.observers[name].callback(element,entry);}});});document.querySelectorAll(this.observers[name].selector).forEach((element,index)=>{this.observers[name].observer.observe(element);});}
refreshObservers(){if(sys.debug=='tools')console.log('Tools.js -> refreshObservers () -> this.observers',this.observers);Object.entries(this.observers).forEach(([observerName,observerData])=>{this.observe(observerName,observerData.selector,observerData.callback);});}
strContains(string,value){return string.indexOf(value)!==-1;}
outerHtml(node){return node.outerHTML||new XMLSerializer().serializeToString(node);}
createOverlayContainer(datasetName,appendSpinner=true){let overlay=document.createElement('x-overlay');overlay.style.width='100%';overlay.style.height='100%';overlay.style.position='absolute';overlay.style.zIndex='1015';overlay.style.background='#fff';overlay.style.opacity='0.925';overlay.style.textAlign='center';overlay.dataset[datasetName]='';if(appendSpinner){overlay.style.paddingTop='1rem';$(overlay).append(`<div class="spinner spinner--dual-ball">

    <div class="spinner--inner">

        <x-spinner></x-spinner><x-spinner></x-spinner><x-spinner></x-spinner>

    </div>

</div>`);}
return overlay;}
nullish(check,alternative){return check!==null&&check!==void 0?check:alternative;}
catObject(mainObject,catObject){let newObject=new Object;if(this.isObject(mainObject)&&this.isObject(catObject)){Object.entries(mainObject).forEach(([key,value])=>{newObject[key]=value;});Object.entries(catObject).forEach(([key,value])=>{newObject[key]=value;});}
return newObject;}
isString(property){return typeof(property)==='string';}
isDefined(property){return typeof(property)!=='undefined'&&property!==null;}
isUndefined(property){return typeof(property)==='undefined'||property===null;}
isFunction(property){return typeof(property)==='function';}
isObject(property){return typeof(property)==='object';}
isInteger(property){return typeof(property)==='integer';}}
sys.tools=new sys.class.Tools();})();(function(){sys.class.Async=class asynchronous{constructor(){this.scriptName='Asynchronous.js';this.xhr=new Object;}
abort(url){this.xhr[url].abort();}
getHtml(url,params,callback,abort=true,trackErrors=true,updateUrl=false){this.requestAjax(url,params,callback,abort,'GET','html',trackErrors,updateUrl);};postHtml(url,params,callback,abort=true,trackErrors=true,updateUrl=false){this.requestAjax(url,params,callback,abort,'POST','html',trackErrors,updateUrl);};getCss(url,params,callback,abort=true,trackErrors=true,updateUrl=false){this.requestAjax(url,params,callback,abort,'GET','html',trackErrors,updateUrl);};getJSON(url,params,callback,abort=true,trackErrors=true,updateUrl=false){this.requestAjax(url,params,callback,abort,'GET','JSON',trackErrors,updateUrl);}
postData(url,params,callback,abort=true,trackErrors=true,updateUrl=false){this.requestAjax(url,params,callback,abort,'POST','JSON',trackErrors,updateUrl);}
requestAjax(url,params,callback,abort,method,dataType,trackErrors,updateUrl){sys.tools.debug(this,'requestAjax',Array.from(arguments));try{if(this.xhr.hasOwnProperty(url)===true&&abort===true)this.xhr[url].abort();var xhr=new XMLHttpRequest();params.sh=sys.misc.sh;this.xhr[url]=$.ajax({url:url,method:method,dataType:dataType,data:params,crossDomain:false,cache:true,xhr:function(){return xhr;},success:(data,textStatus,jqXHR)=>{if(updateUrl===true&&xhr.responseURL.includes('ajax')===false){sys.url.changeVisibleUrl(xhr.responseURL);}
sys.tools.debug(this,'requestAjax',Array.from(arguments),'success (data, textStatus, jqXHR)',[data,textStatus,jqXHR]);if(sys.tools.isFunction(callback)===true){callback(data);sys.tools.refreshObservers();}},error:(jqXHR,textStatus,errorThrown)=>{sys.tools.debug(this,'requestAjax',Array.from(arguments),'error (jqXHR, textStatus, errorThrown)',[jqXHR,textStatus,errorThrown]);if(jqXHR.status!==0&&jqXHR.status!==200&&trackErrors===true){sys.tracking.onJavaScriptError('Asynchronous.js',['Header-Error',sys.tools.strConcat([jqXHR.status,url])]);}
if(textStatus!='abort'&&textStatus!='error'&&errorThrown!=''&&errorThrown!='abort'&&trackErrors===true){sys.tracking.onJavaScriptError('Asynchronous.js',['Request-Error',sys.tools.strConcat([textStatus,errorThrown,url])]);}}});}catch(event){if(trackErrors===true)
sys.tracking.onJavaScriptError('Asynchronous.js',['Catch-Error',sys.tools.strConcat([event.message,url])]);}}}
sys.async=new sys.class.Async();})();(function(){sys.class.Polyfill=class Polyfill{constructor(){this.supports=new Object;this.initChecks();}
initChecks(){$(document).on('DOMContentLoaded',()=>this.checkFlexGapSupport());}
checkFlexGapSupport(){let flex=document.createElement('div');flex.appendChild(document.createElement('div'));flex.appendChild(document.createElement('div'));flex.style.display='flex';flex.style.flexDirection='column';flex.style.gap='1px';flex.setAttribute("id","flex");flex.setAttribute("style","display: flex; gap: 100px; flex-direction: column;");document.body.appendChild(flex);this.supports.flex_gap=flex.scrollHeight===0?'no':'yes';document.body.removeChild(flex);this.completePolyfill();}
completePolyfill(){if(Object.values(this.supports).includes('no')){sys.async.getCss('/ajax/data/polyfill/',this.supports,(cssCode)=>{if(cssCode!==''){if(sys.tools.isDefined(sys.main.browserUpdate)===false)
sys.main.browserUpdate='recommended';let style=document.createElement('style'),head=document.head||document.getElementsByTagName('head')[0];head.appendChild(style);style.type='text/css';style.id='polyfillCss';style.appendChild(document.createTextNode(cssCode));}});}}}
sys.polyfill=new sys.class.Polyfill();})();(function(){sys.class.format=class Format{constructor(){};number(value){let api=new Intl.NumberFormat();return api.format(value);}
currency(value){let api=new Intl.NumberFormat('de-DE',{style:'currency',currency:'EUR',minimumFractionDigits:2});return api.format(value);}}
sys.format=new sys.class.format();})();(function(){sys.class.cookie=class Cookie{constructor(){}
set(name,value,days){const cookieData={cookie_name:name,cookie_value:value,cookie_duration:days*86400};sys.async.postData('/system/cookie/',cookieData,null,false);}
get(name){const cookieName=name+"=";const cookies=document.cookie.split(';');for(let i=0;i<cookies.length;i++){let cookie=cookies[i];while(cookie.charAt(0)===' '){cookie=cookie.substring(1,cookie.length);}
if(cookie.indexOf(cookieName)===0){return cookie.substring(cookieName.length,cookie.length);}}
return null;}}
sys.cookie=new sys.class.cookie;})();(function(){sys.class.Url=class url{constructor(){this.setUrl(window.location.href,window.location.pathname,window.location.search.substring(1),window.location.hash.replace('#',''));}
setUrl(url,path,paramsString,hash){this._url=url.includes('.de')===true?url.split('.de')[1]:url;this._path=path;this._params=new Object;this._params.string=paramsString;this._params.object=this.convertParamsToObject(this._params.string);this._hash=hash;let setCookie=true;const ignoredPaths=['/sys/','/konto/','/ajax/','/redirect/','/system/'];ignoredPaths.forEach(path=>{if(this._path.includes(path))setCookie=false;});if(setCookie&&decodeURIComponent(sys.cookie.get('last_path'))!=this._path){sys.cookie.set('last_path',this._path,1);}}
changeVisibleUrl(url){let paramsString=url.split('?')[1];paramsString=sys.tools.isDefined(paramsString)?paramsString.split('#')[0]:'';this.setUrl(url,url.split('?')[0],paramsString,url.split('#')[1]||'')
if(sys.whitelabel===false){history.replaceState({},'',this._url);}}
get href(){return this._path+(this.params.string.length?'?'+this.params.string:'');}
get hash(){return{'key':typeof(this._hash.split("=")[1])!=='undefined'?this._hash.split("=")[0]:null,'value':typeof(this._hash.split("=")[1])!=='undefined'?this._hash.split("=")[1]:null}}
get params(){return{'object':this.convertParamsToObject(this._params.string),'string':this.convertParamsToString(this._params.object),};}
getParamValue(param){return this._params.object.hasOwnProperty(param)?this._params.object[param]:null;}
hasParam(param){return this._params.object.hasOwnProperty(param);}
addParam(param,value){this.changeParams(param+'='+value,false);}
changeParams(paramsString='',replace=false){if(paramsString!=''&&replace!==true){this._params.string+=this._params.string!=''?'&'+paramsString:paramsString;}else if(replace===true){this._params.string=paramsString;}
this._params.object=this.convertParamsToObject(this._params.string);this._params.string=this.convertParamsToString(this._params.object);this.changeVisibleUrl(this._path+(this._params.string.length>0?'?'+this._params.string:'')+(this._hash.length>0?'#'+this._hash:''));}
removeParam(param){delete this._params.object[param];this._params.string=this.convertParamsToString(this._params.object);this.changeVisibleUrl(this._path+(this._params.string.length>0?'?'+this._params.string:'')+(this._hash.length>0?'#'+this._hash:''));}
removeScope(scope){Object.entries(this._params.object).forEach(([key,value])=>{if(key.includes(scope)){delete this._params.object[key];}});if(this._hash.includes(scope))
this._hash='';this._params.string=this.convertParamsToString(this._params.object);this.changeVisibleUrl(this._path+(this._params.string.length>0?'?'+this._params.string:'')+(this._hash.length>0?'#'+this._hash:''));}
convertParamsToObject(params){let paramsObject=new Object;if(sys.tools.isString(params)&&params!==''){let paramsSplit=params.split('&');paramsSplit.forEach((keyValue)=>{try{if(keyValue.includes('[]')){const arrayName=keyValue.split('=')[0].replace('[]','');if(!paramsObject.hasOwnProperty(arrayName))paramsObject[arrayName]=new Array;paramsObject[arrayName].push(decodeURI(keyValue.split('=')[1]));}else{paramsObject[keyValue.split('=')[0]]=decodeURI(keyValue.split('=')[1]);}}catch(e){sys.tracking.onJavaScriptError('URL.js',['convertParamsToObject',e.message]);}})}
return paramsObject;}
convertParamsToString(params){let paramsString=new String;Object.entries(params).forEach(([key,value])=>{if(typeof(value)==='object'){value.forEach((singleValue)=>{paramsString+=paramsString.length?'&':'';paramsString+=key+'[]='+singleValue;});}else{paramsString+=paramsString.length?'&':'';paramsString+=key+'='+value;};});return paramsString;}}
sys.url=new sys.class.Url();})();(function(){sys.class.AjaxData=class ajaxData{constructor(){this.attributes={'listenerElement':'data-ajax-listener','type':'data-ajax-type','targetElement':'data-ajax-target','url':'data-ajax-url','onlyOnce':'data-ajax-only-once','params':'data-ajax-params','refresh':'data-ajax-refresh'};this.selectors=sys.tools.attributesToSelectors(this.attributes);this.addEventListeners();this.observe();}
addEventListeners(){document.querySelectorAll(this.selectors.listenerElement).forEach((listenerElement,index)=>{let eventBinder=null;let eventListener=null;if(listenerElement.getAttribute(this.attributes.type)=='hover'){eventBinder=listenerElement;eventListener='mouseenter touchstart';}
if(listenerElement.getAttribute(this.attributes.type)=='click'){eventBinder=listenerElement;eventListener='click';}
if(listenerElement.getAttribute(this.attributes.type)=='change'){eventBinder=listenerElement;eventListener='change';}
if(listenerElement.getAttribute(this.attributes.type)=='tracking'){eventBinder=document;eventListener='tracking_initialized';}
if(eventBinder===null||eventListener===null)return;eventBinder.addEventListener(eventListener,(event)=>{if(listenerElement.getAttribute(this.attributes.onlyOnce)=="true"){listenerElement.removeAttribute(this.attributes.listener);}
this.fetch(listenerElement);})});this.addOldEventListeners();}
addOldEventListeners(){$('[data-ajax-data]').each((index,element)=>{const url=$(element).data('ajax-data');const params=sys.url.convertParamsToObject(($(element).data('ajax-data-params')));if($(element).data('ajax-data-on-load')==='no')return;this.getAjaxData(url,params);});$('[data-ajax-data]').on('change','[data-ajax-data-trigger]',(event)=>{event.preventDefault();const url=$(event.currentTarget).closest('[data-ajax-data]').data('ajax-data');const dataPageSrc=$(event.currentTarget).attr('href');const dataPageIndex=dataPageSrc.indexOf('=');const dataPage=dataPageSrc.slice(dataPageIndex+1);const params=sys.url.convertParamsToObject($(event.currentTarget).closest('[data-ajax-data]').data('ajax-data-params'));params.page=dataPage;this.getAjaxData(url,params)});$('[data-ajax-data]').on('click','.pager a',(event)=>{event.preventDefault();const url=$(event.currentTarget).closest('[data-ajax-data]').data('ajax-data');const dataPageSrc=$(event.currentTarget).attr('href');const dataPageIndex=dataPageSrc.indexOf('=');const dataPage=dataPageSrc.slice(dataPageIndex+1);const params=sys.url.convertParamsToObject($(event.currentTarget).closest('[data-ajax-data]').data('ajax-data-params'));params.page=dataPage;this.getAjaxData(url,params)});}
observe(){sys.tools.observe('ajaxObserver',this.selectors.listenerElement,(element)=>{if(element.getAttribute(this.attributes.type)=='observer'){element.setAttribute(this.attributes.type,'');this.fetch(element);}});}
fetch(listenerElement){const url=listenerElement.getAttribute(this.attributes.url);const params=sys.url.convertParamsToObject(listenerElement.getAttribute(this.attributes.params))
const refresh=listenerElement.getAttribute(this.attributes.refresh);const targetContainer=listenerElement.getAttribute(this.attributes.target)!==null?'['+listenerElement.getAttribute(this.attributes.target)+']':listenerElement;sys.async.getHtml(url,params,(responseHtml)=>{$(document).find(targetContainer).html(responseHtml);},false);if(refresh>0){setTimeout(()=>{this.fetch(listenerElement);},refresh)}}
getAjaxData(url,data){sys.async.getHtml(url,data,(html)=>{$('[data-ajax-data]').html(html);});};};sys.ajaxData=new sys.class.AjaxData();})();(function(){sys.class.Tracking=class Tracking{constructor(consentParams){this._consent=consentParams;this.dataset={'objectType':'utsObjectType','objectId':'utsObjectId','objectLabel':'utsObjectLabel','dimensions':'utsDimensions'};this.attributes={'form':'data-form','objectType':'data-uts-object-type','objectId':'data-uts-object-id','objectLabel':'data-uts-object-label','onClick':'data-uts-on-click','onIntersection':'data-uts-on-intersection','onView':'data-uts-on-view','unique':'data-uts-unique','dimensions':'data-uts-dimensions'};this.selectors=sys.tools.attributesToSelectors(this.attributes);this.selectors.formInput='input, select, checkbox';this.selectors.externalLink='a[href*="://"]';this.selectors.internalLink='a[href^="/"], a[href^="./"], a[href^="../"], a[href^="#"]';this.init();this.addEventListeners();}
addEventListeners(){$(document).on('click',this.selectors.externalLink,(event)=>this.trackLinkClick(event,'external')).on('click',this.selectors.internalLink,(event)=>this.trackLinkClick(event,'internal'))
if(sys.header.error)
this.onError('header_error',[sys.header.error,sys.main.path]);this.onView();$(document).on('change',this.selectors.formInput,(event)=>this.onInputChange(event.currentTarget)).on('click',this.selectors.onClick,(event)=>this.onClick(event.currentTarget));sys.tools.observe('v2IntersectionTracking',this.selectors.onIntersection,(element,entry)=>this.onIntersection(element));}
getDimensions(element){let dimensions=this.createAnonymousDimensions(element.dataset.hasOwnProperty(this.dataset.dimensions)?JSON.parse(element.dataset[this.dataset.dimensions]):[]);dimensions.object_type=element.getAttribute(this.attributes.objectType);dimensions.object_id=element.getAttribute(this.attributes.objectId);dimensions.object_label=element.getAttribute(this.attributes.objectLabel);return dimensions;}
createAnonymousDimensions(dimensionsInput){return{'anonymous_dimension_1':typeof(dimensionsInput[0])!=='undefined'?dimensionsInput[0]:null,'anonymous_dimension_2':typeof(dimensionsInput[1])!=='undefined'?dimensionsInput[1]:null,'anonymous_dimension_3':typeof(dimensionsInput[2])!=='undefined'?dimensionsInput[2]:null,}}
scriptIsLoaded(scriptName){sys.jsFiles=sys.jsFiles||new Array;const scriptIsLoaded=sys.jsFiles.includes(scriptName);if(scriptIsLoaded===false)sys.jsFiles.push(scriptName);return scriptIsLoaded;}
init(){if(this._consent.tech===false)return;sys.event.trigger('tracking_initialized');this.initialized={marketing:false,stats:false,tech:false};if(this.consent.tech&&!this.initialized.tech){if(this.scripts.tech)$.getScript(this.scripts.tech);this.initialized.tech=true;}else if(!this.consent.tech){}
if(this.consent.marketing&&!this.initialized.marketing){this.initPartnerprogramme();this.initFacebookAds();this.initGoogleAds();this.initGoogleMaps();if(this.scripts.marketing)$.getScript(this.scripts.marketing);this.initialized.marketing=true;}else if(!this.consent.marketing){}
if(this.consent.stats&&!this.initialized.stats){this.initGoogleAnalytics();if(this.scripts.stats)$.getScript(this.scripts.stats);this.initialized.stats=true;}else if(!this.consent.stats){}}
onView(element){let events=[];$(document).find(this.selectors.onView).each((index,element)=>{const params=this.getDimensions(element);params.event=element.getAttribute(this.attributes.onView);events.push(params);});if(events.length>1){this.triggerMultipleUtsEvents(events);}else{this.triggerUtsEvent('page_view')}}
onError(errorCategory,dimensions){this.triggerUtsEvent(errorCategory,this.createAnonymousDimensions(dimensions));}
onIntersection(element){const eventName=element.getAttribute(this.attributes.onIntersection);const dimensions=this.getDimensions(element);this.triggerUtsEvent(eventName,dimensions);}
onCustomEvent(eventName,dimensions){this.triggerUtsEvent(eventName,dimensions);}
onClick(element){const eventName=element.getAttribute(this.attributes.onClick);const dimensions=this.getDimensions(element);if(element.getAttribute(this.attributes.unique)=="yes"){element.removeAttribute(this.attributes.onClick);}
this.triggerUtsEvent(eventName,dimensions);}
onInputChange(input){if(input.getAttribute('name')===null)
return;const inputName=input.getAttribute('name');const form=$(input).closest(this.selectors.form)[0]||null;let formName='not_set';if(form){formName=form.attributes[this.attributes.form].nodeValue;}}
onJavaScriptError(javaScriptFile,rawDimensions=[]){let dimensions=[]
dimensions.push(javaScriptFile);dimensions.push(rawDimensions);this.onError('javascript_error',dimensions);}
triggerUtsEvent(eventName,dimensions={}){const commonDimensions={'page_id':sys.main.root_id,'page_path':sys.main.path,'device':sys.main.device,'splittest_name':sys.splittest.name||null,'splittest_variant_name':sys.splittest.variant_name||null,};const finalParams=sys.tools.catObject(dimensions,commonDimensions);finalParams.event=eventName;Object.keys(finalParams).forEach((key)=>finalParams[key]===null&&delete finalParams[key]);console.warn('uts is not set up yet');}
triggerMultipleUtsEvents(events){console.warn('uts is not set up yet');}
setConsent(consentParams){this._consent={marketing:consentParams['marketing'],stats:consentParams['stats'],tech:consentParams['tech']};sys.cookie.set('consent',Object.values(this.consent).join('_'),30);}
get consent(){return this._consent;}
get scripts(){this._scripts=new Object;sys.scripts=sys.scripts||new Object;this._scripts.tech=sys.tools.nullish(sys.scripts.tech,null);this._scripts.marketing=sys.tools.nullish(sys.scripts.marketing,null);this._scripts.stats=sys.tools.nullish(sys.scripts.stats,null);return this._scripts;}
triggerExternalPlugins(params){let eventParams=new Object;if(sys.tools.isDefined(params.param1))
eventParams.param1=params.param1;if(sys.tools.isDefined(params.param2))
eventParams.param2=params.param2;if(sys.tools.isDefined(params.param3))
eventParams.param3=params.param3;this.triggerGoogleAnalytics(params.event,eventParams);}
trackContentView(){this.triggerFacebookAds('ViewContent');this.triggerGoogleAnalytics('view_content');}
trackCheckout(value){this.triggerFacebookAds('InitiateCheckout');this.triggerGoogleAnalytics('begin_checkout',{'value':value||0});this.triggerUtsEvent('checkout');}
trackLinkClick(event,category){const categoryToAttribute={'external':'href','internal':'href'}
const categoryToCategory={'external':'external','internal':'internal'}
const attributeValue=$(event.currentTarget).closest(`[ ${categoryToAttribute[ category ]} ]`)[0].attributes[categoryToAttribute[category]].nodeValue;this.triggerGoogleAnalytics('clicked_link',{'param1':categoryToCategory[category],'param2':attributeValue});this.triggerUtsEvent('link_click',[categoryToCategory[category],attributeValue]);}
trackPurchase(purchaseData){this.triggerFacebookAds('Purchase',{'value':purchaseData.value||1,'voucher':purchaseData.voucher||null,'currency':purchaseData.currency||'EUR','product_id':sys.product.id||null});this.triggerGoogleAnalytics('purchase',{'transaction_id':purchaseData.id||null,'value':purchaseData.value||1,'coupon':purchaseData.voucher||null,'currency':purchaseData.currency||'EUR','product_id':sys.product.id||null});this.triggerGoogleAds('conversion',{'send_to':'AW-982015197/XML0CPeqj90YEN25odQD','transaction_id':purchaseData.id||null,'value':purchaseData.value||1,'coupon':purchaseData.voucher||null,'currency':purchaseData.currency||'EUR','conversion_linker':true});this.triggerUtsEvent('purchase');}
initGoogleMaps(){if(sys.map&&$('[data-map]').length>=1){const mapsScript=`https://maps.googleapis.com/maps/api/js?v=3.37&callback=sys.map.render&loading=async&key=${sys.map.apiKey}`;sys.misc.mapsScriptCalled=true;if(this.scriptIsLoaded('googleMaps')===false){$.getScript(mapsScript);}}}
initPartnerprogramme(){if(sys.tools.isObject(sys.trackingData)){Object.entries(sys.trackingData).forEach(([key,value])=>{if(decodeURIComponent(sys.cookie.get(key))!=value)
sys.cookie.set(key,value,60);});}}
initFacebookAds(){if(this.scriptIsLoaded('facebookAds')===false){!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');}
this.facebookParams=new Object;if(sys.tools.isObject(sys.trackingData)){Object.entries(sys.trackingData).forEach(([key,value])=>{this.facebookParams[key]=value;});}
if(sys.tools.isDefined(sys.product)&&sys.tools.isDefined(sys.product.id))
this.facebookParams.product_id=sys.product.id;window.fbq('init',3616431695080446);window.fbq('track','PageView',this.facebookParams);}
initGoogleAds(){if(this.scriptIsLoaded('googleAds')===false)
$.getScript('https://www.googletagmanager.com/gtag/js?id=AW-982015197');window.dataLayer=window.dataLayer||[];this.googleAdsTag=function(){dataLayer.push(arguments);}
this.googleAdsTag('consent','default',{'ad_storage':'granted','ad_user_data':'granted','ad_personalization':'granted','analytics_storage':'granted'});this.googleAdsTag('js',new Date());this.googleAdsParams=new Object;this.googleAdsTag('config','AW-982015197');}
initGoogleAnalytics(){if(this.scriptIsLoaded('googleAnalytics')===false)
$.getScript('https://www.googletagmanager.com/gtag/js?id=UA-44317256-1');window.dataLayer=window.dataLayer||[];this.googleAnalyticsTag=function(){dataLayer.push(arguments);}
this.googleAnalyticsTag('consent','default',{'ad_storage':'granted','ad_user_data':'granted','ad_personalization':'granted','analytics_storage':'granted'});this.googleAnalyticsTag('js',new Date());this.googleAnalyticsParams=new Object;this.googleAnalyticsParams.anonymizeip=true;if(sys.tools.isDefined(sys.trackingData)&&sys.tools.isObject(sys.trackingData)){Object.entries(sys.trackingData).forEach(([key,value])=>{this.googleAnalyticsParams[key]=value;});}
if(sys.tools.isDefined(sys.customAnalyticsParams)&&sys.tools.isObject(sys.customAnalyticsParams)){Object.entries(sys.customAnalyticsParams).forEach(([key,value])=>{this.googleAnalyticsParams[key]=value;});}
if(sys.tools.isDefined(sys.customer)&&sys.tools.isDefined(sys.customer.id)&&sys.customer.id!==null)
this.googleAnalyticsParams.is_customer=true;if(sys.tools.isDefined(sys.product)&&sys.tools.isDefined(sys.product.id))
this.googleAnalyticsParams.product_id=sys.product.id;if(sys.tools.isDefined(sys.splittest)&&sys.tools.isDefined(sys.splittest.name))
this.googleAnalyticsParams.splittest_name=sys.splittest.name;if(sys.tools.isDefined(sys.splittest)&&sys.tools.isDefined(sys.splittest.variant_name))
this.googleAnalyticsParams.splittest_variant=sys.splittest.variant_name;this.googleAnalyticsTag('config','UA-44317256-1',this.googleAnalyticsParams);}
triggerFacebookAds(eventName,eventParams){if(this.consent.marketing&&this.initialized.marketing&&sys.tools.isFunction(window.fbq)){const fbqParams=sys.tools.catObject(this.facebookParams,eventParams);window.fbq('track',eventName,fbqParams);}else if(this.consent.marketing){setTimeout(()=>{this.triggerFacebookAds(eventName,eventParams)},1000);}}
triggerGoogleAnalytics(eventName,eventParams){if(sys.debug=='tracking')console.log('tracking.js -> triggerGoogleAnalytics(eventName, params)',eventName,eventParams);if(this.consent.stats&&this.initialized.stats&&sys.tools.isFunction(this.googleAnalyticsTag)){const newEventParams=sys.tools.catObject(this.googleAnalyticsParams,eventParams);if(sys.debug=='tracking')console.log('this.googleAnalyticsTag ("event", eventName, newEventParams)',eventName,newEventParams);this.googleAnalyticsTag('event',eventName,newEventParams);}else if(this.consent.stats){setTimeout(()=>{this.triggerGoogleAnalytics(eventName,eventParams)},1000);}}
triggerGoogleAds(eventName,eventParams){if(sys.debug=='tracking')console.log('tracking.js -> triggerGoogleAds(eventName, params)',eventName,eventParams);if(this.consent.marketing&&this.initialized.marketing&&sys.tools.isFunction(this.googleAdsTag)){const googleAdsParams=sys.tools.catObject(this.googleAdsParams,eventParams);if(sys.debug=='tracking')console.log('this.googleAdsTag ("event", eventName)',eventName,googleAdsParams);this.googleAdsTag('event',eventName,googleAdsParams);}else if(this.consent.marketing){setTimeout(()=>{this.triggerGoogleAds(eventName,eventParams)},1000);}}
triggerPartnerprogramme(params){}}
sys.tracking=new sys.class.Tracking({marketing:sys.consent.marketing,stats:sys.consent.stats,tech:sys.consent.tech});})();(function(){sys.class.Autosuggest=class Autosuggest{constructor(){this.attributes={'autosuggest':'data-autosuggest','resultsContainer':'data-autosuggest-results','loadBlockContainer':'data-autosuggest-load-block','choosable':'data-autosuggest-choosable','stayVisible':'data-autosuggest-stay-visible','choice':'data-autosuggest-choice','modalTrigger':'data-modal="autosuggest"','input':'data-autosuggest-input','clear':'data-autosuggest-clear','params':'data-autosuggest-params','url':'data-autosuggest-url','focusChoice':'data-autosuggest-result-focus','majorOption':'data-autosuggest-result','recommendations':'data-autosuggest-recommendations','recommendationsParams':'data-autosuggest-recommendations-params'};this.urls={'defaultResults':'/ajax/data/autosuggest-results/','recommendations':'/ajax/data/autosuggest-recommendations'};this.selectors=sys.tools.attributesToSelectors(this.attributes);this.xhr=null;$(document).on('mouseover click',this.selectors.input,async(event)=>await this.getRecommendations(event)).on('click',this.selectors.input,(event)=>this.showRecommendations(event)).on('click',this.selectors.choice,(event)=>this.chooseResultByClick(event)).on('input touchend',this.selectors.input,async(event)=>await this.keyupOnInput(event)).on('input touchcancel',this.selectors.input,async(event)=>await this.keyupOnInput(event));};get currentChoice(){return $(document).find(this.selectors.resultsContainer).filter(':visible').first().find(this.selectors.focusChoice).filter(':visible');}
get moreThanOneOption(){return $(document).find(this.selectors.resultsContainer).filter(':visible').first().find(this.selectors.majorOption).filter(':visible').length;}
chooseResultByClick(event){let choice=$(event.currentTarget).attr(this.attributes.choice);this.chooseResult(choice);}
chooseCurrentChoice(){this.chooseResult($(this.currentChoice).attr(this.attributes.choice));$(this.selectors.input).change();if($(this.currentAutosuggest).attr(this.attributes.choosable)!=="no")$(this.selectors.input).blur();}
chooseResult(choice){if($(this.currentAutosuggest).attr(this.attributes.choosable)==="no")return;$(document).off('click','body');let target=$(this.selectors.modalTrigger);$(target).val(choice);$(target).change();$(this.selectors.input).val(choice);$(this.selectors.input).change();$(this.selectors.resultsContainer).hide(0);$(this.selectors.recommendations).hide(0);if(sys.tools.isDefined(sys.misc.currentModal)&&sys.tools.isFunction(sys.misc.currentModal.close)&&sys.misc.currentModal.closableWithEnter=='yes')
sys.misc.currentModal.close();sys.scroll.to('#autosuggest','','-5rem');}
clear(){$(this.selectors.input).val('');this.hideContainers();}
hideContainers(){$(this.selectors.resultsContainer).hide(0);$(this.selectors.loadBlockContainer).hide(0);}
async keyupOnInput(event){const keyCode=event.originalEvent?.data??'';const currentAutosuggest=event.currentTarget;if(keyCode&&keyCode.includes('Enter')&&$(currentAutosuggest).attr(this.attributes.choosable)!=="no"){this.chooseCurrentChoice();}else if((keyCode&&(keyCode.includes('ArrowDown')||keyCode.includes('ArrowUp')))&&this.moreThanOneOption>1){const newChoice=keyCode.includes('ArrowDown')?this.currentChoice.next(this.selectors.choice):this.currentChoice.prev(this.selectors.choice);if(newChoice.length<=0)return;this.currentChoice.removeClass('hover bc-primary');this.currentChoice.removeAttr(this.attributes.focusChoice);newChoice.attr(this.attributes.focusChoice,'');newChoice.addClass('hover bc-primary');}
const hasNoSpecialChar=/^[a-zäÄöÖüÜßA-Z0-9]+$/ig.test(currentAutosuggest.value.trim());if(!hasNoSpecialChar||(event.originalEvent.metaKey&&keyCode=='keyZ'))return;if(event.originalEvent.target.value==""&&$(currentAutosuggest).attr(this.attributes.choosable)!=="no"){this.clear();return;}
await this.getResults(currentAutosuggest);}
async getRecommendations(event){const{recommendations,input}=this.selectors;$(recommendations).attr(this.attributes.recommendations,'requested');const paramsObject=$(recommendations).attr(this.attributes.recommendationsParams)!=""?sys.url.convertParamsToObject($(recommendations).attr(this.attributes.recommendationsParams)):new Object;await sys.async.getHtml(this.urls.recommendations,paramsObject,(html)=>{$(recommendations).html(html);});}
showRecommendations(event){if($(this.selectors.resultsContainer).is(':visible'))return;if($(this.selectors.input).val().length>0)return;$(document).on('click','body',()=>{$(this.selectors.recommendations).hide(0);$(document).off('click','body');});$(this.selectors.recommendations).show(0);}
async getResults(currentAutosuggest){const{input,autosuggest,resultsContainer,recommendations}=this.selectors;const query=$(currentAutosuggest).val();const url=sys.tools.nullish($(currentAutosuggest).attr(this.attributes.url),this.urls.defaultResults);let paramsString=$(input).attr(this.attributes.params);let resultContainer=$(autosuggest).length>1?$(currentAutosuggest).closest(autosuggest).find(resultsContainer):$(resultsContainer);$(document).on('click','body',(currentAutosuggest)=>{if(!$(currentAutosuggest).attr(this.attributes.stayVisible)?.includes("yes")){this.chooseCurrentChoice();}
$(recommendations).hide(0);});this.toggleResultContainer(false);let paramsObject=sys.url.convertParamsToObject(paramsString);paramsString=sys.url.convertParamsToString(paramsObject);const data={query:query,params:{'string':paramsString,'object':paramsObject}};await sys.async.getHtml(url,data,(html)=>{this.toggleResultContainer(true,resultContainer);$(resultContainer).html(html);sys.tracking.onCustomEvent('autosuggest',[query,paramsString]);});}
toggleResultContainer(show=true,resultContainer){$(resultContainer).toggle(show);$(this.selectors.loadBlockContainer).toggle(!show);$(this.selectors.recommendations).hide(0);}};sys.autosuggest=new sys.class.Autosuggest();})();(function(){sys.class.Map=class Map{constructor(){if(sys.debug=='map')console.log('Map.js -> constructor ()');this.circle=new String;this.attributes={'countSoFar':'data-map-count-so-far','countTotal':'data-map-count-total','routeInfos':'data-map-route-infos','routeOk':'data-map-route-ok','routeError':'data-map-route-error','routeErrorCode':'data-map-route-error-code','routeTime':'data-map-route-time','routeDistance':'data-map-route-distance','routeListener':'data-map-route-listener','routeConfirm':'data-map-route-confirm','routeButtonText':'data-map-route-text','routeButtonLoader':'data-map-route-loader','radius':'data-map-radius','radiusActive':'data-map-radius="active"','radiusVal':'data-map-radius-value','filterMapMarker':'data-filter-map-marker'};this.selectors=sys.tools.attributesToSelectors(this.attributes);$(document).on("input change",this.selectors.routeListener,(event)=>{if($(event.currentTarget).val().length===5&$.isNumeric($(event.currentTarget).val())){$(this.selectors.routeConfirm).show('fast');}});$(document).on("click",this.selectors.routeConfirm,()=>{this.calculateRoute($(this.selectors.routeListener).val());$(this).hide('fast');});$(document).on('change',this.selectors.filterMapMarker,(event)=>{this.filterMarkers($(event.currentTarget).val());});}
set options(options){if(sys.debug=='map')console.log('Map.js -> set options (options)',options);this._options=options||[];}
get options(){if(sys.debug=='map')console.log('Map.js -> get options ()');return this._options||{zoomControl:true,streetViewControl:false,mapTypeControl:true,fullscreenControl:false,mapTypeId:'roadmap',clickableIcons:true,gestureHandling:'cooperative',zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},mapTypeControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM,style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,mapTypeIds:['roadmap','satellite','hybrid'],},styles:[{featureType:"poi.business",elementType:"labels",stylers:[{visibility:"off"}]},]};}
get rawMarkers(){if(sys.debug=='map')console.log('Map.js -> get rawMarkers ()');return this._rawMarkers;}
set rawMarkers(rawMarkers){if(sys.debug=='map')console.log('Map.js -> set rawMarkers (rawMarkers)',rawMarkers);this._rawMarkers=rawMarkers;}
set markers(markers){if(sys.debug=='map')console.log('Map.js -> set markers (markers)',markers);this._markers=markers;}
get markers(){if(sys.debug=='map')console.log('Map.js -> get markers ()');return this._markers;}
get infoWindowContent(){return this._infoWindowContent;}
set infoWindowContent(infoWindowContent){this._infoWindowContent=infoWindowContent;}
set apiKey(apiKey){this._apiKey=apiKey;}
get apiKey(){return this._apiKey||'AIzaSyDynqcUpcr9p8reZ1QxK_1EeeXzI3Mf6Xw';}
get handler(){return this._handler;}
setData(data){if(sys.debug=='map')console.log('Map.js -> setData (data)',data);this._apiKey=data.apiKey||'AIzaSyDynqcUpcr9p8reZ1QxK_1EeeXzI3Mf6Xw';this._container=data.container||'map';this._markers=data.markers||[];this._circle=data.circle||null;this._options=data.options||null;this._rawMarkers=data.rawMarkers||new Array;this._infoWindowContent=data.infoWindowContent||new Array;this._handler=data.handler||null;this.init();};init(){if(sys.debug=='map')console.log('Map.js -> init ()');if(!sys.misc.mapsScriptCalled&&((sys.whitelabel==false&&sys.consent.marketing==true)||sys.whitelabel==true)){const mapsScript=`https://maps.googleapis.com/maps/api/js?v=3.37&callback=sys.map.render&loading=async&key=${this.apiKey}`;sys.misc.mapsScriptCalled=true;$.getScript(mapsScript);return;}
this.reset();}
checkData(){if(sys.debug=='map')console.log('Map.js -> checkData ()');if(sys.tools.isDefined(sys.misc.mapData)===true){this.setData(sys.misc.mapData);}}
addRawMarkers(rawMarkers,expectedMarkers=false){if(sys.debug=='map')console.log('Map.js -> addRawMarkers (rawMarkers, expectedMarkers)',rawMarkers,expectedMarkers);this._rawMarkers=this._rawMarkers.concat(rawMarkers);const soFarText=this._rawMarkers.length>parseInt(expectedMarkers)?expectedMarkers:this._rawMarkers.length;$(this.selectors.countSoFar).text(sys.format.number(soFarText));$(this.selectors.countTotal).text(sys.format.number(expectedMarkers));if(expectedMarkers&&expectedMarkers<=this._rawMarkers.length)
this.init();}
render(){if(sys.debug=='map')console.log('Map.js -> render ()');if(sys.tracking.consent.marketing){if(typeof google=='undefined'){sys.tracking.initGoogleMaps();}else{if(!this._map)
this._map=new google.maps.Map(document.getElementById(this._container),this.options);if(!this._bounds)
this._bounds=new google.maps.LatLngBounds();this.placeMultipleMarkers();if(this.initCircle){$(this.selectors.radius).removeClass('d-none');$(this.selectors.radiusVal).hide();this.createCircle();}}
this._map.data.addGeoJson({"type":"Feature","geometry":{"type":"Point","coordinates":[-84.69729,43.24808]}});this._map.data.setStyle({icon:"https://maps.google.com/mapfiles/ms/micons/blue.png"});}}
reset(){if(sys.debug=='map')console.log('Map.js -> reset ()');this._map=null;this._bounds=null;this.render();}
placeMultipleMarkers(){if(sys.debug=='map')console.log('Map.js -> placeMultipleMarkers ()');let i,markerLat=[],markerLng=[];for(i=0;i<this.rawMarkers.length;i++){if(sys.tools.isDefined(this.rawMarkers[i].lat)&&markerLat.includes(this.rawMarkers[i].lat)){this.rawMarkers[i].lat=this.rawMarkers[i].lat+0.000005;}
if(sys.tools.isDefined(this.rawMarkers[i].lng)&&markerLng.includes(this.rawMarkers[i].lng)){this.rawMarkers[i].lng=this.rawMarkers[i].lng+0.000005;}
markerLat.push(this.rawMarkers[i].lat);markerLng.push(this.rawMarkers[i].lng);this.placeSingleMarker(this.rawMarkers[i]);}
if(this.markers.length>1){this._markerClusterer=new sys.google.MarkerClusterer(this._map,this.markers,{maxZoom:18,styles:[{url:'',minimumClusterSize:2,gridSize:52,height:52,width:52,fontFamily:'arial',textSize:16,textColor:'#fff'}]});}else{this.markers[0]?.setMap(this._map);}
this.fit();}
placeSingleMarker(marker){if(sys.debug=='map')console.log('Map.js -> placeSingleMarker (marker)',marker);if(marker.lat&&marker.lng){let latLng=new google.maps.LatLng(marker.lat,marker.lng);let i,infoWindowTitle;let infoWindow=new google.maps.InfoWindow();if(marker.title){infoWindowTitle=marker.title}else{infoWindowTitle='Ferienhaus Schnellansicht anzeigen'}
var infoWindowContent='';if(marker.opening_hours&&$(marker.opening_hours).length>=1){var iwcOpeningHours='<h4 class="inset--top-md">Öffnungszeiten</h4><ul class="inset--top-sm stack--gap-sm">';$.each(marker.opening_hours,function(key,value){iwcOpeningHours+='<li><strong>'+key+':</strong> '+value+'</li>';});iwcOpeningHours+='</ul>';infoWindowContent=iwcOpeningHours;}
if(marker.price&&$(marker.price).length>=1){var iwcPrice='<h4 class="inset--top-md">Preise</h4><ul class="inset--top-sm  stack--gap-sm">';$.each(marker.price,function(key,value){iwcPrice+='<li><strong>'+key+'</strong> '+value+'</li>';});iwcPrice+='</ul>';infoWindowContent+=iwcPrice;}
marker=new google.maps.Marker({position:latLng,offerId:marker.offerId,identifier:marker.identifier||null,title:infoWindowTitle,desc:marker.desc|| null,list:marker.list||null,price:marker.price||null,opening_hours:marker.opening_hours||null,icon:marker.icon||null,place_type:marker.place_type||null,sight_type:marker.sight_type||null,clickable:true,cursor:'pointer',optimized:true});if(marker.title!='Ferienhaus Schnellansicht anzeigen'){google.maps.event.addListener(marker,'click',function(){infoWindow.close();if(window.location.pathname.match("/flughafen/")!=null){infoWindow.setContent('<h3>'+infoWindowTitle+'</h3>'+infoWindowContent);}
else if(window.location.pathname.match("/europa/straende/")!=null){infoWindow.setContent('<a href="'+'#'+marker.identifier+'" class="h3">'+infoWindowTitle+'</a>'+infoWindowContent);}else{infoWindow.setContent('<a href="'+marker.identifier+'/" class="h3">'+infoWindowTitle+'</a>'+infoWindowContent);}
infoWindow.open(this._map,marker);});}
this._bounds.extend(marker.position);this.markers.push(marker);if(this.handler)
this.addHandler(marker,'click');}}
filterMarkers(category){if(sys.debug=='map')console.log('Map.js -> filterMarkers (category)',category);var i,marker;for(i=0;i<this.rawMarkers.length;i++){marker=this.markers[i];this.hideMarker(marker);if(marker&&category=='show_all'){this.showMarker(marker);}else if(marker&&((marker.sight_type&&marker.sight_type==category)||(marker.place_type&&marker.place_type==category))){this.showMarker(marker);}}}
showMarker(marker){if(sys.debug=='map')console.log('Map.js -> showMarker (marker)',marker);this._markerClusterer.addMarker(marker);}
hideMarker(marker){if(sys.debug=='map')console.log('Map.js -> hideMarker (marker)',marker);this._markerClusterer.removeMarker(marker);}
addHandler(marker,event){if(sys.debug=='map')console.log('Map.js -> addHandler (marker, event)',marker,event);marker.addListener(event,()=>{this.handler(marker);});}
fit(){if(sys.debug=='map')console.log('Map.js -> fit ()');if(this.markers.length<=0){$('#karte').remove();return;}
if(this.markers.length===1){let marker=this.markers[0];marker=new google.maps.LatLng(marker.position.lat(),marker.position.lng());this._map.setCenter(marker);this._map.setZoom(7);return;}
this._map.fitBounds(this._bounds);}
createCircle(circle){if(sys.debug=='map')console.log('Map.js -> createCircle (circle)',circle);var currentLat=this._map.getCenter().lat();var currentLng=this._map.getCenter().lng();if(this.circleRadius){var circleRadius=Math.round(this.circleRadius)}else{var circleRadius=sys.tools.isDefined(sys.misc.mapDst)&&sys.misc.mapDst>0?sys.misc.mapDst:50;}
if(typeof circle=='undefined'){circle=new google.maps.Circle({strokeColor:this.circleBorder,strokeOpacity:0.8,strokeWeight:2,fillColor:this.circleFill,fillOpacity:0.35,draggable:false,suppressUndo:true,editable:true,map:this._map,center:{lat:currentLat,lng:currentLng},radius:1000*circleRadius});this._map.fitBounds(circle.getBounds());$('p'+this.selectors.radiusVal).text('Aktueller Radius: '+Math.round(circle.radius / 1000)+' km').show();$('input[data-dst-range]').val(Math.round(circle.radius / 1000)).trigger('change');}
google.maps.event.addListener(circle,'center_changed',function(){});google.maps.event.addListener(circle,'radius_changed',()=>{$('p'+this.selectors.radiusVal).text('Aktueller Radius: '+Math.round(circle.getRadius()/ 1000)+' km');$('input[data-dst-range]').val(Math.round(circle.radius / 1000)).trigger('change');});this.circle=circle;return this;}
removeCircle(){if(sys.debug=='map')console.log('Map.js -> removeCircle ()');this.circle.setMap(null);this.circle=null;$(this.selectors.radiusVal).hide();}
toggleButtonContent(){const buttonTextEl=$(this.selectors.routeButtonText);const buttonLoaderEl=$(this.selectors.routeButtonLoader);const isButtonTextVisible=buttonTextEl.is(':visible');if(!isButtonTextVisible){buttonTextEl.css('display','inline-block');buttonLoaderEl.css('display','none');return;}
buttonTextEl.css('display','none');buttonLoaderEl.css('display','flex');}
calculateRoute(startZip){if(sys.debug=='map')console.log('Map.js -> calculateRoute (startZip)',startZip);this.toggleButtonContent();if(!this._directionsService)
this._directionsService=new google.maps.DirectionsService();if(!this._directionsRenderer)
this._directionsRenderer=new google.maps.DirectionsRenderer();this._directionsRenderer.setMap(null);let start=startZip+" Deutschland";let destination=this.markers[0].position;this._directionsRenderer.setMap(this._map);this._directionsService.route({origin:{query:start},destination:destination,travelMode:'DRIVING',drivingOptions:{departureTime:new Date(Date.now()),trafficModel:'bestguess'},},(response,status)=>{$(this.selectors.routeInfos).show('fast');if(status==='OK'){this._directionsRenderer.setDirections(response);var time=response.routes[0].legs[0].duration_in_traffic.text;var distance=response.routes[0].legs[0].distance.text;$(this.selectors.routeOk).show('fast');$(this.selectors.routeError).hide('fast');$(this.selectors.routeTime).text(time);$(this.selectors.routeDistance).text(distance);}else{if(status==='NOT_FOUND'){var errorCode="Diese PLZ konnte leider nicht gefunden werden.";}else{var errorCode=status;}
$(this.selectors.routeOk).hide('fast');$(this.selectors.routeError).show('fast');$(this.selectors.routeErrorCode).text(errorCode);}
this.toggleButtonContent();});}}
sys.map=new sys.class.Map();sys.map.checkData();})();(function(){sys.class.ModalStack=class ModalStack{constructor(){this._next={};this._stack=[];}
push(name,changeUrl=true,paramsString=''){let modal=new sys.class.Modal(name,changeUrl,paramsString);this._stack.push(modal);}
pop(){this._stack.pop();}
queue(){this._next=this._stack[this._stack.length-1];if(this._next)this._next.show();}}
sys.modalStack=new sys.class.ModalStack();sys.class.Modal=class Modal{constructor(name,changeUrl=true,paramsString='',keepModalParams=false){this.attributes={'backdrop':'data-modal-backdrop','content':'data-modal-content','close':'data-dismiss="modal"','closable':'data-modal-closable','closeIcon':'data-modal-close-icon','closableWithEnter':'data-modal-close-enter'};this.selectors=sys.tools.attributesToSelectors(this.attributes);this.classes={'body':'of-hidden','backdrop':'modal-backdrop'};sys.url.removeParam('modal');const concat=sys.url.params.string&&paramsString==''?'':'&';paramsString+=(concat+sys.url.params.string);let finalParamsString='';if(paramsString.length){let urlParamsArray=paramsString.split('&');urlParamsArray.forEach((param,index)=>{let keyValue=param.split('=');if(param=='')return;if(paramsString.includes('raw_params')){finalParamsString+=(index===0?'':'&')+keyValue[0]+'='+keyValue[1];}else{finalParamsString+=(index===0?'':'&')+(keyValue[0].includes('modal')===true?'':'modal_')+keyValue[0]+'='+keyValue[1];}});}
this.changeUrl=changeUrl;this.name=name;this.params=finalParamsString;}
get url(){return'/ajax/modal/'+this.name+'/';}
onerror(event){console.error(event);}
setClosable(closable){if(closable===true){$(document).find('#modal').attr(this.attributes.closable,'no');$(document).find('#modal').find(this.selectors.closeIcon).hide(0);}else{$(document).find('#modal').removeAttr(this.attributes.closable);$(document).find('#modal').find(this.selectors.closeIcon).hide(0);}}
close(){sys.url.removeScope('modal');sys.modalStack.queue();$(document).find(this.selectors.content).children().remove();$(document).trigger('modal-closed');$(document).find('body').removeClass(this.classes.body);}
show(){sys.tracking.onCustomEvent('opened_modal',[this.name]);if(this.changeUrl===true){sys.url.changeParams(this.params);sys.url.addParam('modal',this.name);}
sys.misc.currentModal=this;let data;if(sys.url.params.string.includes('raw_params')){data=Object.assign({'modal_view':'true','system_message':sys.main.system_message??null},sys.url.rawParams);}else{data={'modal_view':'true','params':sys.url.params,'system_message':sys.main.system_message??null};}
sys.async.getHtml(this.url,data,(html)=>{sys.modalStack.pop();this.placeContent(html);$(document).trigger('modal-shown');$(document).on("click",this.selectors.close,()=>{this.close();})
$(document).on("click",this.selectors.content,(event)=>{if(event.target.id=='modal'&&sys.tools.isDefined($(event.target).attr(this.attributes.closable))===false){this.close();};});});}
placeContent(html){if($(document).find(this.selectors.backdrop).length)$(this.selectors.backdrop).remove();$(document).find('body').addClass(this.classes.body);document.activeElement.blur();$(this.selectors.content).html(html);this.closableWithEnter=$(html).attr(this.attributes.closableWithEnter);let backdrop=document.createElement('div');backdrop.classList.add(this.classes.backdrop);backdrop.dataset.modalBackdrop='yes';$(this.selectors.content).append(backdrop);}}
if(sys.main.browserUpdate=='recommended'){sys.modalStack.push('browser-update',false);}
if(sys.main.system_message!=''&&sys.main.system_message!='redirect'){let name='';let updateUrl=false;if(sys.main.system_message.includes('modal=')){name=sys.main.system_message.split("=")[1];updateUrl=true;}else{name="system-message";}
sys.modalStack.push(name,updateUrl);}
if(sys.url.hash.key=='modal'&&sys.url.hash.value!==null){sys.modalStack.push(sys.url.hash.value,true);}
if(sys.url.params.object.hasOwnProperty('modal')){sys.modalStack.push(sys.url.params.object.modal,true);}
const cookiewallIgnoredPaths=['/datenschutz/','/cookie-richtlinie/'];var cookiewallIgnoreCookie=sys.cookie.get('ignore_consent');if(!sys.consent.tech&&!sys.whitelabel&&cookiewallIgnoredPaths.includes(sys.main.path)===false&&!cookiewallIgnoreCookie){sys.modalStack.push('cookie-wall',false);}
const splashCookie=sys.cookie.get('splashLayer');if(sys.splashLayer&&splashCookie!='shown'&&sys.whitelabel===false){sys.cookie.set('splashLayer','shown',1);if(sys.main.device=='mobile'){sys.modalStack.push('splash-mobile',false);}else{sys.modalStack.push('splash-desktop',false);}}
sys.modalStack.queue();})();$(document).on("click","[data-modal]",function(){let modal=new sys.class.Modal($(this).attr('data-modal'),true,$(this).attr('data-modal-params')||'');modal.show();});$(document).keyup((event)=>{if(event.key==="Escape"&&sys.misc.currentModal&&sys.misc.currentModal.name!='cookie-wall')
sys.misc.currentModal.close();if(event.key==="Enter"&&sys.misc.currentModal&&sys.misc.currentModal.closableWithEnter=='yes')
sys.misc.currentModal.close();});window.addEventListener('popstate',(event)=>{if(window.location.href.includes('modal')===false&&sys.misc.currentModal&&sys.misc.currentModal.name!='cookie-wall')
sys.misc.currentModal.close();});$(document).on('click','[data-dynamic-modal]',function(){const title=$(this).attr('data-dynamic-modal-title');const body=$(this).parent().find('[data-dynamic-modal-body]').html();function dynamicModal(){$('[data-modal-title]').text(title);$('[data-modal-body]').html(body);$(document).off('modal-shown',dynamicModal);}
$(document).on('modal-shown',dynamicModal);});(function(){sys.class.Toast=class Toast{constructor(){this.attributes={'toast':'data-toast','toastStack':'data-toast-stack','dismissToast':'data-toast-dismiss','toastListener':'data-toast-listener','toastParams':'data-toast-params',}
this.selectors=sys.tools.attributesToSelectors(this.attributes);this.urls={'toastPrefix':'/system/toast/'};$(document).on('click',this.selectors.dismissToast,()=>{this.hide();});$(document).on('click',this.selectors.toastListener,(event)=>{this.show({'name':$(event.currentTarget).attr(this.attributes.toastListener),'paramsString':$(event.currentTarget).attr(this.attributes.toastParams)||null});});$(document).on('mouseenter',this.selectors.toast,()=>{this.freezeBody(true);});$(document).on('mouseleave',this.selectors.toast,()=>{this.freezeBody(false);});if(window.location.hash.includes('toast=')){this.show({name:window.location.hash.split("=")[1]});}}
get toastList(){return JSON.parse(localStorage.getItem('toast-list')||'[]');}
show(toast){toast.delay=toast.delay||0;toast.only_once=toast.only_once||null;toast.index=this.toastList.indexOf(toast.name);const paramsString=toast.params;toast.params=new Object;toast.params.string=toast.paramsString||null;toast.params.object=new Object;if(toast.params.string!==null){let urlParams=new URLSearchParams(toast.params.string);for(var pair of urlParams.entries()){if(pair[0].includes('[]')){const paramName=pair[0].replace('[]','')
if(!toast.params.object[paramName])toast.params.object[paramName]=new Array;toast.params.object[paramName].push(pair[1])}else{toast.params.object[pair[0]]=pair[1];}}}
sys.tracking.onCustomEvent('opened_toast',[toast.name]);if(localStorage.getItem('chat_session')!==null&&$(document).find(this.selectors.toast).length!==0){$(document).find(this.selectors.toast).show(0);}else if(this.toastList.includes(toast.name)===false){setTimeout(()=>{sys.async.getHtml(this.urls.toastPrefix+toast.name+'/',{'page':sys.main,'params':toast.params},(html)=>{$(this.selectors.toastStack).append(html);$('[data-toast="'+toast.name+'"]').show();if(toast.index==-1){this.toastList.push(toast.name);}else{this.toastList.splice(toast.index,1);}
if(toast.onlyOncetoastOnlyShowOnce){localStorage.setItem('toast-list',JSON.stringify(this.toastList));}});},toast.delay*1000);}}
apply(){}
hide(){$(document).find(this.selectors.toast).hide(0);this.freezeBody(false);}
freezeBody(freeze){if(freeze){}else{}}}
sys.toast=new sys.class.Toast();})();(function(){sys.class.Form=class Form{constructor(){this.scriptName='Form.js';this.attributes={'form':'data-form','formPage':'data-form-page','formAction':'data-form-action','formFocus':'data-form-focus','togglePseudo':'data-toggle-switch-pseudo','toggleReal':'data-toggle-switch-real','checkbox':'data-form-checkbox','formWrapper':'data-form-wrapper','errorKey':'data-form-error-key','errorMessage':'data-form-error-message','submit':'data-form-submit','submitName':'data-form-submit-name',"submitButtonLoader":"data-submit-button-loader",'resettableInput':'data-form-input-resettable','inputResetIcon':'data-form-input-reset-icon','resetDomino':'data-form-input-reset-domino','errorInput':'data-form-input-bad','modal':'data-modal-content','submitOnLoad':'data-form-submit-on-load','errorContainer':'data-form-error-container','errorHeadlinePositive':'data-form-error-headline-okay','errorHeadlineNegative':'data-form-error-headline-bad','erorrMessageOutput':'data-form-error-message-output','errorMessageStillWrong':'data-form-error-still-wrong',"bonusValue":"data-bonus-value","duplicateRemove":"data-duplicate-remove","duplicateListener":"data-duplicate-listener","validationListener":"data-validation-listener","minLength":"data-validation-min-length","maxLength":"data-validation-max-length","validationParams":"data-validation-params","mandatory":"data-validation-mandatory","hintContainer":"data-validation-hint","hintInner":"data-validation-hint-inner",}
this.selectors=sys.tools.attributesToSelectors(this.attributes);this.selectors.firstFormPage='[data-form-page="1"]';this.selectors.voucherInput='[data-validation-listener="voucher-code"]';this.selectors.formNext='[data-form-submit-name="form_next"]'
this.classes={'negativeAlert':'alert--negative','positiveAlert':'alert--positive','formValidationGood':'form__validation--good','formValidationBad':'form__validation--bad','formInputGood':'form__input--okay','formInputBad':'form__input--bad'};this.syncedTimer=1000;sys.tools.debug(this,'constructor',Array.from(arguments));this.addEventListeners();this.initExistantDataCheck();this.focusInput();this.observe();}
addEventListeners(){$(document).on('click',this.selectors.duplicateRemove,(event)=>this.removeNode($(event.currentTarget))).on('click',this.selectors.duplicateListener,(event)=>this.duplicateNode($(event.currentTarget))).on('change',this.selectors.togglePseudo,(event)=>this.toggleSwitch(event.currentTarget)).on('change keypress keyup',this.selectors.validationListener,(event)=>this.validate(event.currentTarget)).on('click',this.selectors.checkbox,(event)=>this.changeCheckbox(event)).on('submit',this.selectors.form,(event)=>this.prepareSubmit($(event.currentTarget),event)).on('click',this.selectors.submit,(event)=>this.goToPrevNextOrSkippage(event)).on('keyup change',this.selectors.resettableInput,(event)=>this.changeResettableInput(event)).on('click',this.selectors.inputResetIcon,(event)=>this.clearInputByIconClick(event.currentTarget)).ready(()=>this.setResetIcons());$(this.selectors.formWrapper).on('keypress','input, select',(event)=>this.submitOnEnterKeypress(event))}
toggleSwitch(input){$(input).parent().find(this.selectors.toggleReal).val($(input).val());}
focusInput(){if($(this.selectors.formFocus).length>=1&&$(this.selectors.formFocus).attr('data-form-focus')=='yes'){$(this.selectors.formFocus).find('input').not(':input[type=hidden]').first().focus();}}
initExistantDataCheck(){sys.tools.debug(this,'initExistantDataCheck',Array.from(arguments));if($(this.selectors.submitOnLoad)[0]){const form=$(this.selectors.submitOnLoad)[0];const url=$(form).attr('data-form-action');const identifier=$(form).attr('data-form');const method=$(form).attr('method');const target=$('[data-form-target="'+identifier+'"]');const container=target.length>0?target:$(this).parent();const scrollTarget=$(form).attr('data-scroll-target');const scrollDifference=$(form).attr('data-form-scroll-difference')??'-1rem';const getData=sys.url.params.object;let formData=new FormData(form);for(const key in getData){formData.set(key,getData[key]);}
this.submit(url,formData,identifier,container,method,scrollTarget,scrollDifference,form);};document.querySelectorAll(this.selectors.validationListener).forEach(input=>{if(input.value!=""){this.validate(input);}});}
observe(){sys.tools.debug(this,'observe',Array.from(arguments));sys.tools.observe('firstFormPageObserver',this.selectors.firstFormPage,(element,entry)=>{sys.tracking.onCustomEvent('form_funnel',[element.getAttribute(this.attributes.form),element.getAttribute(this.attributes.formPage)]);});sys.tools.observe('everyFormPageObserver',this.selectors.form,(element,entry)=>{this.focusInput();});}
goToPrevNextOrSkippage(event){sys.tools.debug(this,'goToPrevNextOrSkippage',Array.from(arguments));const node=event.currentTarget;$('[data-form-submit-input="'+$(node).attr(this.attributes.submit)+'"]').attr('name',$(node).attr(this.attributes.submitName));$('[data-form-submit-input="'+$(node).attr('data-form-submit')+'"]').val($(node).val());}
changeCheckbox(event){sys.tools.debug(this,'changeCheckbox',Array.from(arguments));const currentVal=$(event.currentTarget).val();const trueVal=$(event.currentTarget).data('form-checkbox')[0];const falseVal=$(event.currentTarget).data('form-checkbox')[1];const newVal=falseVal===currentVal?trueVal:falseVal;$(event.currentTarget).val(newVal);}
submitOnEnterKeypress(event){sys.tools.debug(this,'submitOnEnterKeypress',Array.from(arguments));if((event.which&&event.which==13)||(event.keyCode&&event.keyCode==13)){if($(event.target).parents('form').find(this.selectors.formNext).length){event.preventDefault();$(event.target).parents('form').find(this.selectors.formNext).click();}}}
setResetIcons(){$(document).find(this.selectors.resettableInput).each((index,input)=>{$(`<div class="form__reset-icon" data-form-input-reset-icon data-stop-propagation>





    







<svg class="icon" >

    <use href="#times-regular"></use>

</svg>





</div>`).insertAfter(input);this.toggleInputResetIcon(input);});}
clearInputByIconClick(icon){sys.tools.debug(this,'clearInputByIconClick',Array.from(arguments));const input=$(icon).prev(this.selectors.resettableInput);input.val('');input.change();$(icon).hide(0);if(input.data('formInputResetDomino')) {input.data('formInputResetDomino').forEach((inputName)=>{$(document).find('input[ name="'+inputName+'"]').val('');$(document).find('input[ name="'+inputName+'"]').change();})}}
toggleInputResetIcon(input){sys.tools.debug(this,'toggleInputResetIcon',Array.from(arguments));let display=$(input).val().length>0;$(input).next(this.inputResetIcon).toggle(display);}
changeResettableInput(event){sys.tools.debug(this,'changeResettableInput',Array.from(arguments));let input=event.currentTarget;this.toggleInputResetIcon(input);}
async prepareSubmit(form,event){sys.tools.debug(this,'prepareSubmit',Array.from(arguments));event.preventDefault();$(form).trigger('load-response');const url=form.attr(this.attributes.formAction);const identifier=form.attr(this.attributes.form);const method=form.attr('method');const target=$('[data-form-target="'+identifier+'"]');const container=target.length>0?target:form.parent();const scrollTarget=form.attr('data-scroll-target');const scrollDifference=form.attr('data-form-scroll-difference')??'-2rem';let formData=new FormData(event.currentTarget);if(formData.has('form_next')===false&&formData.has('form_skip')===false&&formData.has('form_prev')===false&&method!='GET')
formData.append('form_next',1);if(method!='GET')
formData.append('modal_view',true);await this.submit(url,formData,identifier,container,method,scrollTarget,scrollDifference,form).catch((e)=>console.error(e)).finally(()=>$(form).trigger('load-response'));}
async submit(url,formData,identifier,container,method,scrollTarget,scrollDifference,form){var xhr=new XMLHttpRequest();let ajaxParams;if(url.indexOf('?')>-1){url=url+'&'+sys.url.params.string}else{url=url+'?'+sys.url.params.string}
if(method=='GET'){ajaxParams=$(form).serialize();}else{ajaxParams=formData}
await $.ajax({'url':url,'method':method,'async':true,'crossDomain':false,'xhr':function(){return xhr;},'processData':false,'contentType':false,'mimeType':'multipart/form-data','data':ajaxParams,'success':(html,textStatus,jqXHR)=>{const formIsAjaxData=sys.tools.strContains(url,'/ajax/data/');const isProductForm=$('#short-form').length>0;const decodedFormURI=decodeURI($(html).find(this.selectors.form).attr(this.attributes.formAction));const decodedURL=decodeURI(url);const formHasRedirect=(decodedFormURI!=decodedURL)&&!formIsAjaxData;if(formHasRedirect&&!isProductForm){if(formData.get('form_name')=='logout'){if(sys.tools.isDefined(sys.customer))sys.customer=new Object;if(sys.tools.isDefined(sys.event))sys.event.trigger('logout');localStorage.clear();}
if(sys.tools.isFunction(loadBar))loadBar(true,'doc');sys.url.changeVisibleUrl(xhr.responseURL);sys.url.removeParam('redirect');const newDoc=document.open();newDoc.write(html);newDoc.close();if(scrollTarget&&$(`#${scrollTarget}`).length>=1){sys.scroll.to('#'+scrollTarget);}else{sys.scroll.to('body');}
if(sys.tools.isFunction(loadBar))loadBar(false,'doc');}else{let htmlContent=null;if(formIsAjaxData){htmlContent=$(html);}else{htmlContent=$(html).find('[data-form="'+identifier+'"]')[0];}
if($(html).find(this.selectors.errorContainer).length>0&&sys.tools.isObject(sys.event))
sys.event.trigger('formError');const formErrors=$(html).find(this.selectors.errorKey);const animationDuration=formErrors.length?0:175;if(formErrors.length){formErrors.each((index,error)=>{sys.tracking.onCustomEvent('form_error',{'anonymous_dimension_1':identifier,'anonymous_dimension_2':$(error).attr(this.attributes.errorKey),'anonymous_dimension_3':$(error).attr(this.attributes.errorMessage)});});}
const formPage=$(htmlContent).attr('data-form-page')||null;if(isProductForm&&form.trigger)form.trigger('form-page-change',{formPage:formPage});if(parseInt(formPage)!=1){sys.tracking.onCustomEvent('form_funnel',[identifier,formPage]);}
if(method==='GET'){let newUrl=new URL(sys.main.host+sys.main.url);for(const pair of formData.entries()){sys.url.changeParams(pair[0]+'='+pair[1]);}}
$(container).animate({'opacity':0},animationDuration,function(){$(container).html(htmlContent).animate({'opacity':1},animationDuration);sys.tools.refreshObservers();});$(document).find('x-overlay').remove();if(scrollTarget&&$(`#${scrollTarget}`).length>=1)
sys.scroll.to(`#${scrollTarget}`);if(!url.includes('/ajax/modal/')&&identifier!='')
sys.scroll.to('#'+identifier,null,'-1rem');if(identifier!='')
sys.tracking.onCustomEvent('form_submit',[identifier]);}
sys.tools.refreshObservers();}});}
completeValidation(){sys.tools.debug(this,'completeValidation',Array.from(arguments));clearTimeout(this.timer);if(this.input.isValid===false&&this.proceed!==true){this.timer=setTimeout(()=>{this.proceed=true;this.completeValidation()},this.syncedTimer);return;}
this.proceed=false;this.completeValidationOnInput();if($(this.input.xInput).find(this.selectors.hintContainer).length)
this.completeValidationOnHint();if($(this.selectors.errorContainer).length)
this.completeValidationOnErrorMessages();}
completeValidationOnInput(){if(this.input.isValid){$(this.input.xInput).addClass(this.classes.formInputGood);$(this.input.xInput).removeClass(this.classes.formInputBad);}else if(this.input.isMandatory===false&&this.input.element.value==""){$(this.input.xInput).removeClass(this.classes.formInputBad);$(this.input.xInput).removeClass(this.classes.formInputGood);}else{$(this.input.xInput).addClass(this.classes.formInputBad);$(this.input.xInput).removeClass(this.classes.formInputGood);};}
completeValidationOnErrorMessages(){sys.tools.debug(this,'completeValidationOnErrorMessages',Array.from(arguments));const errorContainerInsideModal=$(this.input.xInput).parents(this.selectors.modal).find(this.selectors.errorContainer).length>0;const formErrorSelector=$('[data-form-error-key="'+$(this.input.element).attr('name')+'"]');const $bubbling=errorContainerInsideModal?$(this.input.xInput).parents(this.selectors.modal):$(document);const $inputErrorMessage=$bubbling.find(formErrorSelector).first();if($inputErrorMessage.length===0)return;let icon=new String();if(this.input.isValid){icon=`





    







<svg class="icon c-positive" >

    <use href="#check-regular"></use>

</svg>





`;$inputErrorMessage.removeAttr(this.attributes.errorMessageStillWrong);$inputErrorMessage.find(this.selectors.erorrMessageOutput).text('Korrigiert');}else{icon=`





    







<svg class="icon c-link" >

    <use href="#times-regular"></use>

</svg>





`;$inputErrorMessage.attr(this.attributes.errorMessageStillWrong,'');$inputErrorMessage.find(this.selectors.erorrMessageOutput).text('Bitte Hinweise am Feld beachten');}
$inputErrorMessage.find('svg').remove();$inputErrorMessage.append(icon);if($bubbling.find(this.selectors.errorMessageStillWrong).length===0){$bubbling.find(this.selectors.errorContainer).removeClass(this.classes.negativeAlert).addClass(this.classes.positiveAlert);$bubbling.find(this.selectors.errorContainer).find(this.selectors.errorHeadlinePositive).text($(this.selectors.errorHeadlinePositive).attr(this.attributes.errorHeadlinePositive));}else if($bubbling.find(this.selectors.errorContainer).hasClass(this.classes.positiveAlert)){$bubbling.find(this.selectors.errorContainer).removeClass(this.classes.positiveAlert).addClass(this.classes.negativeAlert);$bubbling.find(this.selectors.errorContainer).find(this.selectors.errorHeadlineNegative).text($(this.selectors.errorHeadlineNegative).attr(this.attributes.errorHeadlineNegative));}}
completeValidationOnHint(){if(sys.debug.includes('form'))console.log("Form.js -> completeValidationOnHint ()",);const hintContainer=$(this.input.xInput).find(this.selectors.hintContainer).first()||null;const hintInner=hintContainer!==null?$(hintContainer).find(this.selectors.hintInner):null;if(this.input.isMandatory)
this.input.hintText=this.input.element.value==""?"Bitte angeben.":this.input.hintText;if(this.input.hintText!=null)
hintInner.html(this.input.hintText);if(this.input.isValid&&this.input.showValidInfo===true){$(hintContainer).show(0);hintInner.addClass(this.classes.formValidationGood)
hintInner.removeClass(this.classes.formValidationBad);}else if(this.input.isValid) {$(hintContainer).hide(0);}else if(this.input.element.value==""&&this.input.isMandatory===false){$(hintContainer).hide(0);}else{$(hintContainer).show(0);hintInner.removeClass(this.classes.formValidationGood);hintInner.addClass(this.classes.formValidationBad);}}
validate(input){if(sys.debug.includes('form'))console.log("Form.js -> validate (input)",input);this.event=event||window.event||null;if(this.event!==null&&this.event.code=="Tab")return;this.input=new Object;this.input.element=input;this.input.xInput=input.parentNode;this.input.validationType=$(this.input.element).attr(this.attributes.validationListener);this.input.minLength=$(this.input.element).attr(this.attributes.minLength)||null;this.input.maxLength=$(this.input.element).attr(this.attributes.maxLength)||null;this.input.params=$(this.input.element).attr(this.attributes.validationParams)||null;this.input.isMandatory=$(this.input.element).attr(this.attributes.mandatory)!='no';if(this.input.validationType==='email'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validateEmail();}else if(this.input.validationType==='password'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validatePassword();}else if(this.input.validationType==='password-repeat'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validatePasswordRepeat();}else if(this.input.validationType==='zip'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validateZip();}else if(this.input.validationType==='date'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change'||this.event.type=='keypress')){let inputVal=$(input).val()
let inputData=$(input).data('validation-params')
this.validateDate(inputVal,inputData,event);}else if(this.input.validationType==='iban'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validateIban();}else if(this.input.validationType==='voucher-code'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validateVoucher();}else if(this.input.validationType==='text'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validateText();}else if(this.input.validationType==='phone'&&(this.event==null||this.event.type=='keyup'||this.event.type=='change')){this.validatePhonenumber();}}
validateDate(date,params,event){if(sys.debug.includes('form'))console.log("Form.js -> validateDate (date, params, event)",date,params,event);let isNum=false;let val;let inputPattern=new RegExp(/^[0-9.]{2}\.[0-9]{2}\.[0-9]{4}$/);let jsDate=new Date();let year=jsDate.getFullYear();let futureYear=year+100;let pastYear=year-100;if(event&&$.isNumeric(event.key)){isNum=true;}else if(event){event.preventDefault();return;}
$(this.input.element).on('keyup',function(event){let element=$(this);val=$(element).val();if(isNum==true||event.key=='.'){if(val.length<=2){if(val.substr(0,2)>31){val='0'+val.substr(0,1)+'.0'+event.key+'.';}else if(event.which!=8&&val.length==2){val=val+'.';}else if(val.substr(0,2)<=9&&event.key=='.'){val=val.replace(val.substr(0,2),'0'+val+'.');}}else if(val.length>=4&&val.length<=5){if(val.substr(3,2)>12){let pos=val.lastIndexOf(val.substr(3,2));val=val.substring(0,pos)+'12.';}else if(val.substr(3,1)>1||val.substr(3,1)==1&&event.key=='.'){let pos=val.lastIndexOf(val.substr(3,1));val=val.substring(0,pos)+'0'+val.substr(3,1)+'.';}else if(event.which!=8&&val.length==5){val=val+'.';}}
if(val.length==10&&(val.substr(6,4)>futureYear||val.substr(6,4)<pastYear)){val=val.replace(val.substr(6,4),year);}
clearTimeout(this.timer);this.timer=setTimeout(()=>{sys.form.dateService(val);},3000);if(val.length===10)
sys.form.dateService(val);if(this.dateWasValid==$(element).attr('name'))
sys.form.dateService(val);$(element).val(val);}});$(this.input.element).focusout(function(){let element=$(this);let yearType;if(params&&params.includes('time=past')){yearType='past';}else{yearType='future';}
val=$(element).val();if(val.substr(6,4).length<=2){let inputYear=val.substr(6,4);let pos=val.lastIndexOf(inputYear);if(inputYear.length>0&&inputYear>year.toString().substr(-2)&&yearType=='past'){val=val.substring(0,pos)+'19'+val.substr(6,4);}else if(inputYear.length>0&&(yearType=='future'||(inputYear<year.toString().substr(-2)&&yearType=='past'))){val=val.substring(0,pos)+'20'+val.substr(6,4);}}
$(element).val(val);clearTimeout(this.timer);this.timer=setTimeout(()=>{sys.form.dateService(val);},3000);if(val.length===10)
sys.form.dateService(val);if(sys.form.dateWasValid==$(element).attr('name'))
sys.form.dateService(val);});}
validateEmail(){if(sys.debug.includes('form'))console.log("Form.js -> validateEmail ()");const pattern=/^([a-zA-Z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/;this.input.isValid=pattern.test(this.input.element.value);if(this.input.isValid===false)
this.input.hintText='E-Mail scheint noch nicht korrekt zu sein.';this.completeValidation();}
validateIban(){if(sys.debug.includes('form'))console.log("Form.js -> validateIban ()");}
checkCondition(validationTarget,condition){if(sys.debug.includes('form'))console.log("Form.js -> checkCondition (validationTarget, condition)",validationTarget,condition);let target=$(this.input.xInput).find('[data-validation-conditional-hint="'+validationTarget+'"]')[0];if(condition===true){$(target).addClass(this.classes.formValidationGood);$(target).removeClass(this.classes.formValidationBad);}else{$(this.input.xInput).addClass(this.classes.formInputGood);$(this.input.xInput).removeClass(this.classes.formInputBad);$(target).addClass(this.classes.formValidationBad);$(target).removeClass(this.classes.formValidationGood);}
return condition;}
validatePassword(){if(sys.debug.includes('form'))console.log("Form.js -> validatePassword ()");this.password=this.input;let isValid=true;this.input.isValid=isValid&&this.checkCondition('password-length',this.password.element.value.length>=8);this.input.isValid=isValid&&this.checkCondition('password-letter',this.password.element.value.match(/[a-zA-Z]+/)!==null);this.input.isValid=isValid&&this.checkCondition('password-number',this.password.element.value.match(/[0-9]+/)!==null);this.input.showValidInfo=true;this.completeValidation();if(typeof(this.passwordRepeat)!='undefined'){this.validate(this.passwordRepeat.element);}}
validatePasswordRepeat(){if(sys.debug.includes('form'))console.log("Form.js -> validatePasswordRepeat ()");this.passwordRepeat=this.input;this.input.isValid=this.passwordRepeat.element.value!=""&&this.passwordRepeat.element.value===this.password.element.value;this.input.hintText=this.input.isValid?'Passwörter stimmen überein.':'Passwörter stimmen noch nicht überein.';this.input.showValidInfo=true;this.proceed=true;this.completeValidation();}
validatePhonenumber(){if(sys.debug.includes('form'))console.log("Form.js -> validatePhonenumber ()");const minLength=sys.tools.nullish(this.input.minLength,1);this.input.isValid=this.input.element.value.match(/[0-9]+/)!==null&&this.input.element.value.match(/[a-z]+/)===null;if(this.input.isValid===false)
this.input.hintText='Bitte nur Zahlen verwenden.';this.completeValidation();}
validateText(){if(sys.debug.includes('form'))console.log("Form.js -> validateText ()");const minLength=sys.tools.nullish(this.input.minLength,1);this.input.isValid=this.input.element.value.length>=minLength;this.input.hintText='Bitte angeben.';if(this.input.element.value.length<minLength){this.input.hintText='Mindestens '+minLength+' Zeichen.';}
if(this.input.maxLength!==null&&this.input.element.value.length>this.input.maxLength){this.input.isValid=this.input.isValid&&this.input.element.value.length<sys.tools.nullish(this.input.maxLength,100);this.input.hintText='Maximal '+this.input.maxLength+' Zeichen.';}
this.completeValidation();}
validateVoucher(){if(sys.debug.includes('form'))console.log("Form.js -> validateVoucher ()");const voucherParams={voucher_code:this.input.element.value,booking_price:sys.misc.voucherPrice||this.input.params[0].split("=")};sys.async.getJSON('/ajax/data/voucher/',voucherParams,(response)=>{sys.misc.voucher=response;$(document).trigger('voucher_updated',response);this.input.isValid=typeof(response.valid)==='number';this.input.hintText=`Die Einlösung Deines Gutscheins war erfolgreich! Du erhältst <span data-bonus-value><x-spin class="spinner--inline-container">

    <x-spin class="spinner__inline spinner__inline--positive">

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

        <x-spin></x-spin>

    </x-spin>

</x-spin></span> nach Deiner Reise zurück.`;if(response.valid=='over_limit'){this.input.hintText="Es wurde leider die Maximalanzahl an möglichen Einlösungen für diesen Gutschein erreicht.";}else if(response.valid=='invalid'){this.input.hintText="Dieser Gutschein ist nicht oder nicht mehr gültig.";}
if(response.valid===0){this.input.isValid=false;this.input.hintText="Schade, Du hast den Mindestbuchungswert für den Gutschein "+response.code+" leider noch nicht erreicht."}
this.input.showValidInfo=true;this.completeValidation();setTimeout(()=>{if(this.input.isValid){$(this.selectors.bonusValue).text(sys.format.currency(response.valid));}else if(response.voucher_code==""){$(this.selectors.bonusValue).text(sys.format.currency(sys.misc.voucherPrice*0.01));}else if(!this.input.isValid){$(this.selectors.bonusValue).text(sys.format.currency(sys.misc.voucherPrice*0.01));}},this.syncedTimer);});}
validateZip(){if(sys.debug.includes('form'))console.log("Form.js -> validateZip ()");const pattern=/^(?!01000|99999)(0[1-9]\d{3}|[1-9]\d{4})$/;this.input.isValid=pattern.test(this.input.element.value);if(this.input.isValid===false)
this.input.hintText='PLZ scheint noch nicht korrekt zu sein.';this.completeValidation();}
dateService(){if(sys.debug.includes('form'))console.log("Form.js -> dateService ()");const todayDate=new Date();const pattern=/(\d{2})\.(\d{2})\.(\d{4})/;this.date=new Date(this.input.element.value.replace(pattern,'$3-$2-$1'));this.input.hintText="Bitte folgendes Format verwenden: tt.mm.jjjj";this.input.isValid=true;const onlyPast=this.input.params!==null?this.input.params.includes('time=past'):false;const onlyFuture=this.input.params!==null?this.input.params.includes('time=future'):false;if(onlyPast){this.input.hintText+=" und ein Datum in der Vergangenheit auswählen.";}
if(onlyFuture){this.input.hintText+=" und ein Datum in der Zukunft auswählen.";}
if(onlyPast&&this.date>=todayDate){this.input.isValid=false;}
if(onlyFuture&&this.date<=todayDate){this.input.isValid=false;}
const dateYear=this.date.getFullYear();let dateMonth=this.date.getMonth()+1;dateMonth=dateMonth<10?"0"+dateMonth:dateMonth;const dateDay=this.date.getDate();this.date=dateYear+"-"+dateMonth+"-"+dateDay;if($(this.input.element).val().length<=6)
this.input.isValid=false;if(dateYear.length<4)
this.input.isValid=false;if(isNaN(dateYear)||isNaN(dateMonth)||isNaN(dateDay))
this.input.isValid=false;if(this.input.isValid)
this.dateWasValid=$(this.input.element).attr('name');if(this.input.isValid==false){$(this.selectors.submit).attr('disabled',true)}else{$(this.selectors.submit).attr('disabled',false)}
this.completeValidation();}
duplicateNode(node){if(sys.debug.includes('form'))console.log("Form.js -> duplicateNode (node)",node);let trigger=node;let target=trigger.data('duplicate-listener');let container='[data-duplicate-container="'+target+'"]';let html=sys.tools.outerHtml($(container).find('[data-duplicate-item]')[0]);let parentNode=node.parents('[data-validation-mandatory-container]');let $html=$('<div />',{html:html});if($html.find('input').length>=1){$html.find('input').each(function(){let name=$(this).attr('name')
let count=name.substring(name.lastIndexOf("[")+1,name.lastIndexOf("]"));let counter=parseInt($(container).find('[data-duplicate-item]').length)+1;name=name.replace(count,counter);$(this).attr('name',name);});}
$(container).append($html.html());}
removeNode(node){if(sys.debug.includes('form'))console.log("Form.js -> removeNode (node)",node);let onlyOneItemLeft=node.parents('[data-duplicate-container]').find('[data-duplicate-item]').length===1;let parentNode=node.parents('[data-validation-mandatory-container]');let target=node.parents('[data-duplicate-item]');target.find('input').val('').change();if(onlyOneItemLeft===false)
target.remove();}}
sys.form=new sys.class.Form();})();(function(){sys.class.LazyImage=class LazyImage{constructor(){this.selectors=new Object;this.selectors.lazyImages='img[data-lazy], iframe[data-lazy]';this.observe();}
observe(){sys.tools.observe('imageObserver',this.selectors.lazyImages,(element,entry)=>{if(element.getAttribute('data-lazy-blur')&&element.getAttribute('data-lazy')){const data={src:$(entry.target).attr('data-lazy-blur')}
sys.async.getJSON('/ajax/data/blured-image/',data,(json)=>{let oldImg=$(entry.target);let newImg=oldImg.clone();newImg.attr('src',json.src);newImg.css({display:'none'})
newImg.insertAfter(oldImg);newImg.fadeIn(600,()=>{oldImg.remove()});});}else if(element.getAttribute('data-lazy')){element.setAttribute('src',element.getAttribute('data-lazy'));}
element.removeAttribute('data-lazy');element.removeAttribute('data-lazy-blur');})}}
sys.lazyImage=new sys.class.LazyImage();})();function ajaxLink(href,scrollTo){if(scrollTo!==null)sys.scroll.to(scrollTo);if(typeof loadBar=='function')loadBar(true,'doc');sys.async.postHtml(href,null,(html)=>{let currentLocation=new URL(window.location);let newDoc=document.open("text/html","replace");newDoc.write(html);newDoc.close();history.pushState({},'',href+currentLocation.search);if(typeof loadBar=='function')loadBar(false,'doc');})};$(document).on('click','[data-ajax-link]',function(e){e.preventDefault();let href=$(this).attr('href');let scrollTo=$(this).data('ajax-link')||null;ajaxLink(href,scrollTo);});sys.classes='loaded';(function(){if($('[data-toggle-first]')){var firstTarget=$('[data-toggle-first]').attr('data-toggle-listener');$('[data-toggle-first]').toggleClass('active');$('[data-toggle-target="'+firstTarget+'"]').show();}
function sysToggler(element,type){let toggleTypes=$(element).data('toggle-type')??$(element).data('toggle-types');let toggleListeners=typeof($(element).data('toggle-listener'))!='undefined'?$(element).data('toggle-listener'):$(element).data('toggle-hover');let toggleClass=$(element).data('toggle-class');const callback=$(element).data('toggle-callback');toggleListeners=typeof(toggleListeners)==='string'?[$(element).data('toggle-listener')]:toggleListeners;toggleTypes=typeof(toggleTypes)==='string'?[$(element).data('toggle-type')]:toggleTypes;toggleClass=typeof(toggleClass)==='string'?[$(element).data('toggle-class')]:toggleClass;toggleListeners.forEach((toggleListener,index)=>{if(toggleListener!=""&&type=='click'){sys.tracking.onCustomEvent('toggled_element',[toggleListener]);}
const toggleMainTarget=toggleListener?'[data-toggle-target="'+toggleListener+'"]':$(element).next('[data-toggle-target]');const toggleWrapper=$(element).parents('[data-toggle-wrapper]');const toggleRotate=$(element).find('[data-toggle-rotate]');const toggleTextTarget=$(element).find('[data-toggle-text]');const toggleTextOld=toggleTextTarget.text();const toggleTextNew=toggleTextTarget.attr('data-toggle-text');if(toggleTypes[index]==='hide'){$(toggleMainTarget).hide(0);}else if(toggleTypes[index]==='remove'){$(toggleMainTarget).remove();}else if(toggleTypes[index]==='show'){$(toggleMainTarget).show(0);}else if(toggleTypes[index]==='slideUp'){$(toggleMainTarget).slideUp('fast');}else if(toggleTypes[index]==='slideDown'){$(toggleMainTarget).slideDown('fast');}else if(toggleTypes[index]==='toggleClass'){$(toggleMainTarget).toggleClass($(element).attr('data-toggle-class'));if(typeof toggleRotate!=='undefined')$(toggleRotate).toggleClass('rotate');if(typeof toggleTextNew!=='undefined'){toggleTextTarget.attr('data-toggle-text',toggleTextOld);toggleTextTarget.text(toggleTextNew);}}else if(toggleTypes[index].includes('addClass')){$(toggleMainTarget).addClass(toggleTypes[index].split('=')[1]);}else if(toggleTypes[index].includes('removeClass')){$(toggleMainTarget).removeClass(toggleTypes[index].split('=')[1]);}else if(toggleTypes[index]=='toggle'){$(toggleMainTarget).toggle(0);if(typeof toggleRotate!=='undefined')$(toggleRotate).toggleClass('rotate');if(typeof toggleTextNew!=='undefined'){toggleTextTarget.attr('data-toggle-text',toggleTextOld);toggleTextTarget.text(toggleTextNew);}
if(toggleWrapper){toggleWrapper.find('.active').removeClass('active');}
$(element).toggleClass('active');}else if(toggleTypes[index]=='slideToggle'){$(toggleMainTarget).slideToggle('fast');$(element).toggleClass('toggle--active');if(typeof toggleRotate!=='undefined')$(toggleRotate).toggleClass('rotate');if(typeof toggleTextNew!=='undefined'){toggleTextTarget.text(toggleTextNew);$(element).attr('data-toggle-text',toggleTextOld);}}});if(typeof(callback)==='string')sys.misc[callback](element);}
$(document).ready(function(){$(document).on('mouseenter','[data-toggle-hover]',(e)=>{if(!$(e.currentTarget).hasClass('active')){sysToggler(e.currentTarget,e.type);}}).on('mouseleave','[data-toggle-hover]',(e)=>{sysToggler(e.currentTarget,e.type);});});$(document).on('click','[data-toggle-listener]',(e)=>{const isInsideToggleWrapper=$(e.currentTarget).parents('[data-toggle-wrapper]').length>0;const hasActiveClass=$(e.currentTarget).hasClass('active');if(hasActiveClass&&isInsideToggleWrapper)return;sysToggler(e.currentTarget,e.type);});})();$(function(){if(navigator.share){$('[data-share]').show(0);$('[data-share-trigger]').show(0);$('[data-share-fallback]').hide(0);}});$(document).on('click','[data-share]',function(){sys.tracking.onCustomEvent('share',[`${$(this).attr('data-share-title')} ${$(this).attr('data-share-text')}`]);navigator.share({title:$(this).attr('data-share-title'),text:$(this).attr('data-share-text'),url:window.location.href});});$(document).on('click','[data-share-trigger]',function(){const params=$(this).data('share-trigger');sys.tracking.onCustomEvent('share',[`${params[0]} ${params[1]}`]);navigator.share({title:params[0],text:params[1],url:sys.tools.nullish(params[2],window.location.href)});});function loadBar(show,target){let loadBar="[data-load-bar='"+target+"']";if(show){$(loadBar).stop(true,false);$(loadBar).animate({opacity:'100'},0);$(loadBar).animate({width:'95%'},400);}else{$(loadBar).animate({width:'100%'},200);$(loadBar).animate({opacity:'0'},100);$(loadBar).animate({width:'0%'},0);}}
$(document).on("click","[data-copy-trigger]",function(){const target=$(this).attr('data-copy-trigger');sys.tracking.onCustomEvent('copied',[target]);$(this).removeAttr('data-copy-trigger');$("[data-copy-content='"+target+"']").select();document.execCommand('copy');if($("[data-copy-success-show='"+target+"']").length){$("[data-copy-success-show='"+target+"']").show(0);$("[data-copy-success-hide='"+target+"']").hide(0);$("[data-copy-success-show='"+target+"']").fadeOut(1500,()=>{$("[data-copy-success-hide='"+target+"']").show(0)
$(this).attr('data-copy-trigger',target);});}
if($("[data-copy-success='"+target+"']").length){$("[data-copy-success='"+target+"']").removeClass('d-none');$("[data-copy-success='"+target+"']").css('display','inline');$("[data-copy-success='"+target+"']").fadeOut(1500,()=>{$(this).attr('data-copy-trigger',target);});}});(function(){$(document).on('change','[data-user-to-listener]',function(){$('[data-user-to-target]').val($(this).val());sys.cookie.set('email_test_user_to',$(this).val(),180);});$(document).on('click','[data-test-listener]',function(){$(document).find('[data-test-container="'+$(this).data('test-listener')+'"]').find('[data-test-target]').click();});$(function(){$('[data-user-to-target]').val($('[data-user-to-listener]').val());});})();$(document).on("click",'[data-cookies-show-info]',function(){var trigger="[data-cookies-show-info="+$(this).attr('data-cookies-show-info')+"]";var target="[data-cookies-info="+$(this).attr('data-cookies-show-info')+"]";$(target).toggleClass("d-none");if($(trigger).text()==="Mehr erfahren"){$(trigger).text("Info ausblenden");}else{$(trigger).text("Mehr erfahren");}});$(document).on('click','[data-cookie-accept-all]',function(){const consent={marketing:true,stats:true,tech:true}
sys.tracking.setConsent(consent);sys.tracking.init();checkIframes(consent);});$(document).on('click','[data-cookie-accept-marketing]',function(){const consent={marketing:true,stats:sys.tracking.consent.stats,tech:true}
sys.tracking.setConsent(consent);sys.tracking.init();checkIframes(consent);});$(document).on('click','[data-cookie-dismiss-all]',function(){sys.tracking.setConsent({marketing:false,stats:false,tech:true,});sys.tracking.init();});$(document).on('change','[data-cookie-selection]',function(){$(document).find('[data-cookie-save-settings]').attr('data-cookie-'+$(this).attr('data-cookie-selection'),$(this).prop('checked'));});$(document).on('click','[data-cookie-save-settings]',function(){const consent={marketing:$(this).attr('data-cookie-marketing')=="true",stats:$(this).attr('data-cookie-stats')=="true",tech:true}
sys.tracking.setConsent(consent);sys.tracking.init();checkIframes(consent);});function checkIframes(consent){if(consent.marketing==true){$('[data-cookie-marketing-wrapper]').hide();$('[data-cookie-button-wrapper]').removeClass("d-none");if($(document).find('iframe').length>=1){$('iframe').each(function(){let iframe=$(this);let iframeUrl=iframe.attr('data-url')
if(iframeUrl){iframe.removeClass('d-none');iframe.attr('src',iframeUrl);}});}}}
$(document).on('click','[data-dynamic-modal]',function(){const modalTitleSource=$(this).data('dynamic-modal-title');const modalBodySource=$(this).parent().find('[data-dynamic-modal-body]').html();$(document).on('modalLoaded',function(){$('[data-ajax-modal-title]').html(modalTitleSource);$('[data-ajax-modal-body]').html(modalBodySource);});});$(document).on('click','[data-input-listener]',function(event){if(stopPropagation())return;let input='[data-input-target="'+$(this).attr('data-input-listener')+'"]';let pseudoInput='[data-input-listener="'+$(this).attr('data-input-listener')+'"]';let form=$(this).closest('[data-form]');let inputVal=$(input).val();let inputRadioVal=$(this).attr('data-form-radio-value');let inputIsRadio=typeof($(this).attr('data-form-radio-value'))==="string";let formValueTrue=$(this).attr('data-form-true');let formValueFalse=$(this).attr('data-form-false');let inputNewVal=formValueFalse===inputVal?formValueTrue:formValueFalse;let inputIsActive=typeof($(this).attr('data-form-input-active'))!=='undefined';let inputIsSelect=$(this).attr('data-input-type')==="select";let formSkip=$(this).attr('data-form-skip');if(inputIsRadio&&inputIsActive===false){$(form).find(pseudoInput).removeAttr('data-form-input-active');$(form).find(pseudoInput).removeClass('tile--active');$(this).addClass('tile--active');$(this).attr('data-form-input-active','true');$(input).val(inputRadioVal).trigger('change');}else if(inputIsSelect){$(input).val($(this).attr('data-input-value'));if(formSkip!==0){$('[data-form-submit]').last().attr('data-form-submit-name','form_skip');$('[data-form-submit]').last().val(formSkip);}
$(this).addClass('tile--active');$('[data-form-submit]').last().click();$('[data-input-listener]').removeAttr('data-input-listener')
$('[data-form-spinner]').show();}else if(inputIsRadio){$(input).val(inputRadioVal);}else{$(this).toggleClass('tile--active');$(this).attr('data-input-active')=="true"?$(this).attr('data-input-active','false'):$(this).attr('data-input-active','true');$(this).attr('data-input-active')=="true"?$(input).val(formValueTrue):$(input).val(formValueFalse);}});function delay(fn,ms){let timer=0
return function(...args){clearTimeout(timer)
timer=setTimeout(fn.bind(this,...args),ms||0)}}
(function(){$(document).on('mousewheel','[data-table-wrapper]',function(e){let html=null;if(Math.round($(this).scrollLeft())+Math.round($(this).width())>=Math.round($(this).find('table').width())){}else if(Math.round($(this).scrollLeft())<=0){$(this).addClass('fade-out--right');}else{$(this).removeClass('fade-out--right');}
$(this).find('[data-table-remove]').hide('slow');});})();$(document).ready(()=>{const offset=300;const trigger=$('[data-back-to-top]');$(window).scroll(function(){($(this).scrollTop()>offset)?trigger.addClass('back-to-top--is-visible'):trigger.removeClass('back-to-top--is-visible back-to-top--fade-out');if($(this).scrollTop()>offset){trigger.addClass('back-to-top--fade-out');}});if(typeof $(trigger).attr('href')=='undefined'){$(trigger).on('click',function(){$("html, body").animate({scrollTop:0},600);return false;});}});(function(){function tabScrollListener(element,event){let scrollPos=0;const scrollVal=element.attr('data-tab-bar-trigger')=='left'?'-=400':'+=400';const tabBar=element.parents('[data-tab-bar]');const tabBarTabs=tabBar.find('[data-tab-bar-tabs]');const arrowLeft=tabBar.find('[data-tab-bar-trigger="left"]');const arrowRight=tabBar.find('[data-tab-bar-trigger="right"]');function tabScrolling(){scrollPos=tabBarTabs.scrollLeft();if(scrollPos>0){arrowLeft.show();tabBar.addClass('tab-bar--scrolled');tabBarTabs.removeClass('tab-bar__tabs--scrollable')}else{arrowLeft.hide();tabBarTabs.addClass('tab-bar__tabs--scrollable')
tabBar.removeClass('tab-bar--scrolled');}
if(scrollPos.toFixed()>=parseInt(tabBarTabs[0].scrollWidth.toFixed()-tabBarTabs.width().toFixed())){arrowRight.hide();tabBar.addClass('tab-bar--end');tabBar.removeClass('tab-bar--scrolled');}else{arrowRight.show();tabBar.removeClass('tab-bar--end');}}
if(event=='click'){tabBarTabs.animate({scrollLeft:scrollVal},{duration:300,complete:function(){tabScrolling();}});}else if(event=='touch'){tabScrolling();}};$('[data-tab-bar-tabs]').each(function(){const element=$(this);const scrollWidth=parseInt(element[0].scrollWidth.toFixed());const width=parseInt(element.width().toFixed());if(scrollWidth<=width){element.parent().find('[data-tab-bar-trigger="right"]').hide();}else{element.addClass('tab-bar__tabs--scrollable');}});$('[data-tab-bar-trigger]').on('click',function(){tabScrollListener($(this),'click');});$('[data-tab-bar-tabs]').on('scroll',function(){let element=$(this).parent().find('[data-tab-bar-trigger]');tabScrollListener(element,'touch');});})();function stopPropagation(e){};$(document).on('click','[data-stop-propagation]',(event)=>{event.stopPropagation();});$(document).on('click','[data-prevent-default]',(event)=>{event.preventDefault();});sys.anonymous='loaded';$('.dsl-box').on('click',function(){var element=$(this);var elementData=element.attr('data-input');if(element.hasClass('active')&&element.hasClass('dsl-internetflatrate')==false){element.removeClass('active');$('[data-hidden-input="'+elementData+'"]').val('no');}else{element.addClass('active');$('[data-hidden-input="'+elementData+'"]').val('yes');}});$(document).ready(function(){var $hamburger=$(".hamburger--spin");$hamburger.on("click",function(){$hamburger.toggleClass("is-active");});$('header .nav-item').on('mouseenter',function(){if($(this).hasClass('active')){$(this).removeClass('active').find('.dropdown-menu').removeClass('active');}else{$('.nav-item.active').removeClass('active');$(this).addClass('active').find('.dropdown-menu').addClass('active');}}).on('mouseleave',function(){$(this).removeClass('active').find('.dropdown-menu').removeClass('active');});});jQuery(document).ready(function($){var offset=300,scroll_top_duration=700,$back_to_top=$('.cd-top');$(window).scroll(function(){($(this).scrollTop()>offset)?$back_to_top.addClass('cd-is-visible'):$back_to_top.removeClass('cd-is-visible cd-fade-out');if($(this).scrollTop()>offset){$back_to_top.addClass('cd-fade-out');}});$back_to_top.on('click',function(event){event.preventDefault();$('body,html').animate({scrollTop:0,},scroll_top_duration);});$(window).scroll(function(){if($(window).height()>880){if($(document).scrollTop()+$(window).height()<$(document).height()-500){$('div.info-slide').show('slow');}else{$('div.info-slide').hide('slow');}}});});jQuery(document).ready(function($){$('nav li').on('mouseenter',function(){if($(this).find('.toggle')){$(this).find('.toggle').addClass('show');}}).on('mouseleave',function(){if($(this).find('.toggle')){$(this).find('.toggle').removeClass('show');}});});