((r,a)=>{r.dataLayer=r.dataLayer||[],r.fxp=r.fxp||[];const b={webc_fxp_1548:()=>{if(location.pathname!=="/search")return!1;if(r.fxp1548)return!0;const e=a.querySelectorAll('p[class*="MeansOfTransportFilter__price_"]');if(e.length<2)return!1;let t="bus-train-cheaper";return e[0].innerText===e[1].innerText&&(t="same-price"),r.fxp1548=!0,dataLayer.push({event:"ga_event",eventCategory:"ABTest",eventAction:"fxp1548_ProductHigherPrice",eventValue:void 0,eventLabel:t,eventProperty:void 0}),!0},webc_fxp_1652:()=>location.pathname==="/booking/success",webc_fxp_1722:()=>location.pathname==="/checkout"&&screen.width<500&&a.querySelector('.flix-dialog--fullscreen, [class*="hcr-panel--active"]')!==null,webc_fxp_1732:()=>location.pathname==="/booking/success"&&r.formbricks,webc_book_cart_trip_ab_test:()=>location.pathname==="/checkout"&&a.querySelector("#results-filter-panel.flix-panel--active .address")!==null,webc_fxp_1771:()=>location.pathname==="/booking/success"&&r.formbricks,webc_fxp_1772:()=>a.querySelector('#shop-seats-panel[class*="active"]')!==null,webc_fxp_1778:()=>{if(location.pathname!=="/checkout")return!1;let e=globalEventsCache.find(i=>i.name==="checkout.init");if(!e)return!1;let t=e.payload[0].payload.cart,c=0;return t.items&&Array.isArray(t.items)&&t.items.forEach(i=>{i.product&&i.product.type==="ticket"&&c++}),c===1&&a.querySelector(".flix-passenger-input_gender")!==null},webc_fxp_1782:()=>location.pathname==="/booking/success"&&r.formbricks,webc_fxp_1785:()=>location.pathname==="/search"&&a.querySelector("#id_direct_only_0")!==null,webc_fxp_1823:()=>location.pathname==="/checkout"},d={webc_fxp_1548:{0:[],1:[()=>{(e=>{if(!e.getElementById("fxp-33a3d9c6-f866-4bb8-8da8-2d36d06a8d6d")){var t=e.createElement("style");t.id="fxp-33a3d9c6-f866-4bb8-8da8-2d36d06a8d6d",e.head.appendChild(t).innerText="[class*=MeansOfTransportFilter__price_]{display:none!important}"}})(a)}]},webc_fxp_1652:{0:[],1:[()=>{(()=>{const e=a.querySelector(".flix-page-container:not(.fxp1652Added)");if(!e)return;e.classList.add("fxp1652Added");let t=[null,null,null],c=[null,null,null],i=[null,null,null],n=null;switch(a.documentElement.lang.substring(0,2)){case"fr":t=["Vous cherchez une auberge de jeunesse ?","Utilisez le code FLIXBUS5 pour une r\xE9duction de 5 % !","https://hostelworld.prf.hn/click/camref:1100l3FL5E/destination:https://www.hostelworld.com/fr/"],c=["Vous cherchez une consigne \xE0 bagages ?","Utilisez le code FLIX_BUS pour une r\xE9duction de 5 % !","https://radicalstorage.com/fr/?acc=9d2682367c3935defcb1f9e247a97c0d&couponCode=FLIX_BUS"],i=["Vous cherchez des exp\xE9riences inoubliables ?","Utilisez le code BOOKTOUR pour une r\xE9duction de 5 % !","https://wegotrip.com/?coupon=4459"],n="Publicit\xE9";break;case"it":t=["Cerchi un ostello?","Usa il codice FLIXBUS5 per uno sconto del 5%!","https://hostelworld.prf.hn/click/camref:1100l3FL5E/destination:https://www.hostelworld.com/it/"],c=["Cerchi un deposito bagagli?","Usa il codice FLIX_BUS per uno sconto del 5%!","https://radicalstorage.com/it/?acc=9d2682367c3935defcb1f9e247a97c0d&couponCode=FLIX_BUS"],i=["Cerchi esperienze indimenticabili?","Usa il codice BOOKTOUR per uno sconto del 5%!","https://wegotrip.com/?coupon=4459"],n="Pubblicit\xE0";break;case"en":t=["Looking for a hostel?","Use code FLIXBUS5 for a 5% discount!","https://hostelworld.prf.hn/click/camref:1100l3FL5E"],c=["Looking for luggage storage?","Use code FLIX_BUS for a 5% discount!","https://radicalstorage.com/?acc=9d2682367c3935defcb1f9e247a97c0d&couponCode=FLIX_BUS"],i=["Looking for unforgettable experiences?","Use code BOOKTOUR for a 5% discount!","https://wegotrip.com/?coupon=4459"],n="Advertisement";break;default:return}const l=a.createElement("div");l.classList.add("flix-space-4-top","flix-has-text-centered"),l.innerHTML=`
${n}
`;const o=s=>{for(let h=s.length-1;h>0;h--){const m=Math.floor(Math.random()*(h+1));[s[h],s[m]]=[s[m],s[h]]}return s},p=l.querySelector(".fxp1652_inner_container");let f="";o(Array.from(p.children)).forEach(s=>{f===""?f+=s.id:r.innerWidth>800&&(f+=", "+s.id),p.appendChild(s),s.addEventListener("click",()=>{dataLayer.push({event:"ga_event",eventCategory:"ABTest",eventAction:"fxp1652_click",eventValue:void 0,eventLabel:s.id,eventProperty:void 0})})}),e.prepend(l),dataLayer.push({event:"ga_event",eventCategory:"ABTest",eventAction:"fxp1652_show_ads",eventValue:void 0,eventLabel:f,eventProperty:void 0})})()}]},webc_fxp_1722:{0:[],1:[()=>{(e=>{if(!e.getElementById("fxp-1c6fbd47-6aa9-402d-9371-01fa4936136c")){var t=e.createElement("style");t.id="fxp-1c6fbd47-6aa9-402d-9371-01fa4936136c",e.head.appendChild(t).innerText=".flix-checkout-page [class*=hcr-panel--active]{box-shadow:var(--hcr-primary-box-shadow)}.flix-checkout-page [class*=hcr-panel--active]:not(#seat-categories-panel)>[class*=hcr-panel__body],body .flix-dialog--fullscreen,#results-filter-panel .flix-panel__body{max-height:calc(100vh - 60px);border-radius:var(--hcr-primary-border-radius) var(--hcr-primary-border-radius) 0 0;top:60px}"}})(a)}]},webc_fxp_1732:{0:[],1:[()=>{r.fxp1732||(r.fxp1732=!0,formbricks.track("fxp1732_DE_V4"))},()=>{(()=>{const n=a.querySelector('label[for="aw2637eohg2jpmlcqc2flsa3"]');if(!n)return;const l=n.parentElement.parentElement.parentElement.parentElement.querySelector('button[tabindex="1"]');!l||r.fxp1732Listener||(r.fxp1732Listener=!0,l.addEventListener("click",function(){r.open(e(),"_blank").focus()}))})();function e(){const n=t(),l=c(),o=i();if(!n||!l||!o)return console.log(n,l,o),"https://de.trustpilot.com/evaluate/flixbus.de";let p="https://geo.cro.flixbus.com/trustpilot/invitation-link";const f=new URLSearchParams({domain:"flixbus_de",token:"clv3r6ha8ld5Sq208la3rg21x91",name:l,email:n,network_userid:o});return p+="?"+f.toString(),console.log(p),p}function t(){const n=localStorage.getItem("persist:contact");if(n)try{const l=JSON.parse(n).email.replace(/"/g,"");return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?l:null}catch(l){return null}else return null}function c(){try{const n=localStorage.getItem("persist:passenger"),l=JSON.parse(n),o=JSON.parse(l.passengers);return o&&o.length>0?o[0].firstName:null}catch(n){return null}}function i(){const n=a.cookie.split(";").map(o=>o.trim());let l="";return n.reduce((o,p)=>{const[f,s]=p.split("=");f.startsWith("_sp_id.")&&(l=s)},{}),l.substr(0,l.indexOf("."))}}]},webc_book_cart_trip_ab_test:{0:[],9:[]},webc_fxp_1771:{0:[],1:[()=>{(()=>{if(r.fxp1618)return;let e;switch(r.location.hostname){case"shop.flixbus.com":case"shop.global.flixbus.com":e="fxp1618_us";break;case"shop.greyhound.com":e="fxp1618_gh";break;case"shop.flixbus.co.uk":e="fxp1618_uk";break;case"shop.flixbus.fr":e="fxp1618_fr";break;case"shop.flixbus.it":e="fxp1618_it";break;case"shop.flixbus.dk":e="fxp1618_dk";break;default:return!1}r.fxp1618=!0,formbricks.track(e)})()}]},webc_fxp_1772:{0:[],1:[()=>{(e=>{if(!e.getElementById("fxp-7b78cc94-486f-4553-b188-c02ac822b629")){var t=e.createElement("style");t.id="fxp-7b78cc94-486f-4553-b188-c02ac822b629",e.head.appendChild(t).innerText="[class*=row-module-itemla]{display:none}"}})(a)}]},webc_fxp_1778:{0:[],1:[]},webc_fxp_1782:{0:[],1:[()=>{(()=>{let e=["S-Bahn Berlin GmbH","metronom Eisenbahngesellschaft mbH","S-Bahn Hamburg GmbH","Regionalverkehre Start Deutschland GmbH - Start Unterelbe","NBE nordbahn Eisenbahn-Verwaltungsgesellschaft mbH","Trans Regio Deutsche Regionalbahn GmbH","Transdev Rhein-Ruhr GmbH","ODEG \u2013 Ostdeutsche Eisenbahn GmbH","VIAS GmbH","vlexx GmbH","enno","Bayerische Oberlandbahn GmbH","DB Regio AG","Abellio Rail Mitteldeutschland GmbH","Albtal-Verkehrs-Gesellschaft mbH","Erfurter Bahn GmbH","eurobahn GmbH & Co. KG","Go-Ahead Baden-W\xFCrttemberg GmbH","HLB Hessenbahn GmbH","National Express Rail GmbH","NordWestBahn GmbH","Regiobahn GmbH","SWEG Bahn Stuttgart GmbH","Transdev Hannover GmbH","WestfalenBahn GmbH"],t=[],c=[...r.globalEventsCache].reverse().find(n=>n.name==="booking.success");if(!c)return!1;let i=c.payload[0].items;if(!i)return!1;if(Object.entries(i).forEach(([n,l])=>{let o=l.tickets;if(!!o&&o){if(o.length>2)return!1;o.forEach(p=>{t.push(p.mandate_source.label)})}}),t.includes("FlixTrain GmbH")){const n=e.some(l=>t.includes(l));a.location.hostname==="shop.flixbus.de"?formbricks.track("fxp1782_de"):a.location.hostname==="shop.global.flixbus.com"&&formbricks.track("fxp1782_global")}})()}]},webc_fxp_1785:{0:[],1:[()=>{(()=>{const e=a.querySelector("#filters:not(.fxp1785C)");!e||(e.classList.add("fxp1785C"),e.innerHTML=e.firstChild.outerHTML)})()}],2:[()=>{(e=>{if(!e.getElementById("fxp-f2992a8c-9605-483e-a5ed-288488697cb7")){var t=e.createElement("style");t.id="fxp-f2992a8c-9605-483e-a5ed-288488697cb7",e.head.appendChild(t).innerText="#main-content label[for=id_direct_only_0]:before{right:auto;left:var(--flix-spacing-half)}#main-content label[for=id_direct_only_0]:after{box-sizing:border-box;right:auto;left:var(--flix-spacing-half)}#main-content label[for=id_direct_only_0]{border:1px solid var(--hcr-grayscale-50-color);border-radius:var(--hcr-spacing-5)!important;padding:calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-2);background-color:var(--hcr-bg-primary-color);gap:0;height:26px;min-height:26px;padding-left:calc(var(--flix-spacing-5) + var(--flix-spacing-2))!important}x .search-results-component [class*=Filters__filters],x .search-results-component [class*=Filters__checkbox]{min-width:fit-content!important;margin:0 var(--hcr-spacing-2) var(--hcr-spacing-2) 0}label[for=id_direct_only_0] i{display:none}#id_direct_only_0:checked+label{padding:calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-1) calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-2);background-color:var(--hcr-highlight-color);border:1px solid var(--hcr-ui-primary-color)}#id_direct_only_0:checked+label i{display:block}"}})(a)},()=>{(()=>{const e=a.querySelector('label[for="id_direct_only_0"]:not(.fxp1785X)'),t=a.querySelector("#id_direct_only_0");!e||!t||(e.parentElement.classList.add("flix-switch","flix-switch--sm"),e.classList.add("fxp1785X","flix-switch__label"),e.parentElement.classList.remove("hcr-checkbox-10-2-2","hcr-checkbox--sm-10-2-2"),e.classList.remove("hcr-checkbox__label-10-2-2"),t.classList.remove("hcr-checkbox__input-10-2-2"),t.classList.add("flix-switch__input"))})()}],3:[()=>{(()=>{const e=a.querySelector("#filters:not(.fxp1785C)");if(!e)return;e.classList.add("fxp1785C"),e.innerHTML=e.firstChild.outerHTML;const t=a.querySelector('label[for="id_direct_only_0"]:not(.fxp1785X)'),c=a.querySelector("#id_direct_only_0");!t||!c||(t.parentElement.classList.add("flix-switch","flix-switch--sm"),t.classList.add("fxp1785X","flix-switch__label"),t.parentElement.classList.remove("hcr-checkbox-10-2-2","hcr-checkbox--sm-10-2-2"),t.classList.remove("hcr-checkbox__label-10-2-2"),c.classList.remove("hcr-checkbox__input-10-2-2"),c.classList.add("flix-switch__input"))})()},()=>{(e=>{if(!e.getElementById("fxp-e68d203e-14b3-4ef5-aaf8-4995fbc22e0f")){var t=e.createElement("style");t.id="fxp-e68d203e-14b3-4ef5-aaf8-4995fbc22e0f",e.head.appendChild(t).innerText="#main-content label[for=id_direct_only_0]:before{right:auto;left:var(--flix-spacing-half)}#main-content label[for=id_direct_only_0]:after{box-sizing:border-box;right:auto;left:var(--flix-spacing-half)}#main-content label[for=id_direct_only_0]{border:1px solid var(--hcr-grayscale-50-color);border-radius:var(--hcr-spacing-5)!important;padding:calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-2);background-color:var(--hcr-bg-primary-color);gap:0;height:26px;min-height:26px;padding-left:calc(var(--flix-spacing-5) + var(--flix-spacing-2))!important}x .search-results-component [class*=Filters__filters],x .search-results-component [class*=Filters__checkbox]{min-width:fit-content!important;margin:0 var(--hcr-spacing-2) var(--hcr-spacing-2) 0}label[for=id_direct_only_0] i{display:none}#id_direct_only_0:checked+label{padding:calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-1) calc(var(--hcr-spacing-half) - 1px) var(--hcr-spacing-2);background-color:var(--hcr-highlight-color);border:1px solid var(--hcr-ui-primary-color)}#id_direct_only_0:checked+label i{display:block}"}})(a)}]},webc_fxp_1823:{0:[],1:[],2:[]}};let x={};const u={attributes:!0,childList:!0,subtree:!0},v=(e,t)=>{t.disconnect(),g(),t.observe(a.body,u)};new MutationObserver(v).observe(a.body,u);const _=e=>{Object.keys(e).forEach(t=>{const c=String(t),i=String(e[t]);x[c]=i}),g()},g=()=>{Object.keys(x).forEach(e=>{let t=e,c=x[e];y(t,c)})},y=(e,t)=>{if(!!x[e]){if(!d[e]){r.fxp[e]===void 0&&(r.fxp[e]=null);return}if(!k(e)){r.fxp[e]===void 0&&(r.fxp[e]=!1);return}E(e,t),d[e]&&(!d[e][t]||d[e][t].forEach(c=>{try{c()}catch(i){console.warn(e,i)}}))}},k=e=>{if(!b[e])return!0;try{return b[e]()}catch(t){console.warn(e,t)}},E=(e,t)=>{r.fxp[e]!==t&&(r.dataLayer.push({event:"ab_cc",ab_cc_id:e,ab_cc_v:t,ab_cc_src:"fxp"}),r.fxp[e]=t,typeof r.globalEvents=="object"&&r.globalEvents.emit("flixperiments",{[e]:t}))};if(a.location.host.slice(0,5)==="shop."&&a.location.pathname==="/")return;const L=()=>r.globalEvents.on("*.ab_test_flags",e=>_(e)),S=()=>{if(!r.globalEventsCache||!r.globalEventsCache.length)return!1;r.globalEventsCache.filter(e=>e.name.match(/ab_test_flags$/g)).forEach(e=>_(e.payload[0]))},H=setInterval(()=>{typeof r.globalEvents=="object"&&(clearInterval(H),L(),S())},200)})(window,document);