PageSourceSearch

https://www.mltours.nl/assets/entries/pages_flightresults.CprxXsjl.js

js mltours.nl collected 2026-10-02 21:42:36 UTC 92,433 bytes, 1 lines download raw bytes

1import{a as tt,l as Fe,D as _t,g as Dt,j as Lt,w as Ft,T as It,U as Pt,V as kt,f as st,B as jt,d as rt,a2 as wt,a3 as ss,A as as,y as rs,C as ns,E as is,F as ls,G as os,J as cs,n as ds,i as us,L as ms,b as xs,c as hs,o as fs}from"../chunks/chunk-BFgw_KlF.js";import{j as e,b as a}from"../chunks/chunk-ngaCJxcV.js";import{m as at,U as ps,C as gs,w as bs,P as et,x as ft,y as ys,a as Nt,b as vs,o as pt,z as js,D as ws,M as At,G as Ts,X as gt,S as Ns,T as Ss,J as qt,c as Jt,l as Zt,I as lt,e as Et,N as Cs,O as _s,Q as Ds,L as St,V as Ct,Y as Gt}from"../chunks/chunk-YE5B4yIH.js";import{n as Ls,f as Fs,e as As,u as bt,t as Ee,c as Mt,g as Ht,A as Ot,C as ut,P as it}from"../chunks/chunk-BUOeq26N.js";import{a as Es}from"../chunks/chunk-fpvi1mtc.js";import{g as Rs,F as Is,a as Ps,b as ks}from"../chunks/chunk-C0xIn-CG.js";import{b as mt,e as yt}from"../chunks/chunk-KO1ABRC5.js";import{B as Gs}from"../chunks/chunk-Dya47OrH.js";import{s as Ut,p as Ms}from"../chunks/chunk-CYA-92Qv.js";import{t as nt}from"../chunks/chunk-C9I_7GLe.js";import{i as Qt}from"../chunks/chunk-B24eoqi3.js";import"../chunks/chunk-C-IMmuvR.js";/* empty css                      *//* empty css                      */import"../chunks/chunk-Cl85btZu.js";import"../chunks/chunk-CCVQhKvN.js";import"../chunks/chunk-DAgG4ogk.js";import"../chunks/chunk-BQ-S670s.js";import"../chunks/chunk-CMgq7Lth.js";function Hs({from:s,to:r,departDate:c,returnDate:o,passengers:l,onEditClick:h,isSearchOpen:u}){const{t:_}=tt();return e.jsx("div",{className:`bg-white rounded-2xl border-2 border-gray-200 p-4 md:p-6 shadow-sm ${u?"mb-3":""}`,children:e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("h3",{className:"text-[#555] mb-3",children:[s," - ",r]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-2 md:gap-6 text-[#555] text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"w-4 h-4"}),e.jsxs("span",{children:[c," - ",o]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ps,{className:"w-4 h-4"}),e.jsx("span",{children:l})]})]})]}),e.jsx("button",{onClick:h,className:"flex items-center gap-2 text-[#0ab0d8] hover:underline",children:u?e.jsxs(e.Fragment,{children:[e.jsx(gs,{className:"w-4 h-4"}),e.jsx("span",{children:_("FLIGHT_RESULTS_HideSearch")})]}):e.jsxs(e.Fragment,{children:[e.jsx(bs,{className:"w-4 h-4"}),e.jsx("span",{children:_("FLIGHT_RESULTS_EditSearch")})]})})]})})}function xt({activeDateField:s,tripType:r,departDate:c,returnDate:o,onDepartureClick:l,onReturnClick:h}){const{t:u}=tt(),_=r==="roundTrip",g=R=>{if(!R)return u("COMMON_NotAvailable");const x=String(R.getDate()).padStart(2,"0"),T=String(R.getMonth()+1).padStart(2,"0"),p=String(R.getFullYear());return`${x}-${T}-${p}`},M=st("flex-1 flex flex-col items-center py-2 px-3 rounded-lg transition-all",s==="departure"?"bg-[#0ab0d8] text-white shadow-md":"bg-gray-100 text-gray-600 hover:bg-gray-200"),E=st("flex-1 flex flex-col items-center py-2 px-3 rounded-lg transition-all",s==="return"?"bg-[#0ab0d8] text-white shadow-md":"bg-gray-100 text-gray-600 hover:bg-gray-200"),w=st("text-base md:text-lg font-dins mt-0.5",s==="departure"?"text-white":"text-gray-800"),pe=st("text-base md:text-lg font-dins mt-0.5",s==="return"?"text-white":"text-gray-800");return e.jsxs("div",{className:"flex items-center gap-2 px-4 pt-4 pb-2 border-b border-gray-100",children:[e.jsxs("button",{type:"button",onClick:l,className:M,children:[e.jsx("span",{className:"text-sm md:text-base font-dinm uppercase tracking-wide",children:u("FLIGHT_SEARCH_Departure")}),e.jsx("span",{className:w,children:g(c)})]}),_&&e.jsxs("button",{type:"button",onClick:h,className:E,children:[e.jsx("span",{className:"text-sm md:text-base font-dinm uppercase tracking-wide",children:u("FLIGHT_SEARCH_Return")}),e.jsx("span",{className:pe,children:g(o)})]})]})}const $t={en:"EN",nl:"NL",fr:"FR",ar:"AR"},Xt=[{value:"roundTrip",labelKey:"FLIGHT_TRIP_TYPE_RoundTrip",apiValue:2},{value:"oneWay",labelKey:"FLIGHT_TRIP_TYPE_OneWay",apiValue:1}],Kt=s=>{switch(s){case 2:return"roundTrip";case 3:return"multiCity";default:return"oneWay"}},Os=s=>Xt.find(c=>c.value===s)?.apiValue??1;function Us({isOpen:s,searchData:r,onSearch:c}){const{t:o,language:l}=tt(),h=o("FLIGHT_RESULTS_BaseFareLegend"),u=o("FLIGHT_RESULTS_LowestFareLegend"),_=()=>
1r?Kt(r.tripType):"oneWay",[g,M]=a.useState(_),[E,w]=a.useState(""),[pe,R]=a.useState(""),[x,T]=a.useState(null),[p,O]=a.useState(null),[U,L]=a.useState([]),[f,V]=a.useState(null),[v,Y]=a.useState(null),[ue,X]=a.useState(void 0),[Se,k]=a.useState(void 0),ge=a.useRef(null),[z,N]=a.useState(r?.passengerCounts?.adultCount||1),[se,le]=a.useState(r?.passengerCounts?.childCount||0),[ae,ye]=a.useState(r?.passengerCounts?.infantCount||0),[re,Ce]=a.useState(!1),[he,C]=a.useState(!1),[S,oe]=a.useState(!1),[F,Z]=a.useState(null),Ke=a.useRef(null),Ie=a.useRef(null),_e=a.useRef(null),Ae=a.useRef(null),Oe=a.useRef(""),[W,Ue]=a.useState(!1),$e=Xt,me=z+se+ae,je=a.useMemo(()=>{const t=o(z===1?"FLIGHT_TRAVELER_Infant":"FLIGHT_TRAVELER_Infants"),m=o(z===1?"FLIGHT_TRAVELER_Adult":"FLIGHT_TRAVELER_Adults");return o("FLIGHT_SEARCH_MaxInfantsPerAdults",{maxInfants:z,infantLabel:t,adultsCount:z,adultLabel:m})},[z,o]),ee=a.useMemo(()=>new Date(new Date().setHours(0,0,0,0)),[]),Re=l||Fe.getCurrentLocale(),be=Re.startsWith("nl")?"nl":Re.startsWith("fr")?"fr":Re.startsWith("ar")?"ar":"en",I=r?.language||$t[be]||"EN",P=r?.currency||"EUR",q=a.useMemo(()=>be==="nl"?Ls:be==="fr"?Fs:be==="ar"?Es:As,[be]),De=a.useCallback(t=>{const m=String(t.getDate()).padStart(2,"0"),D=String(t.getMonth()+1).padStart(2,"0"),H=String(t.getFullYear());return`${m}-${D}-${H}`},[]),[ne,xe]=a.useState(ee),[Pe,J]=a.useState(ee);a.useEffect(()=>{if(typeof window>"u")return;const t=()=>Ue(window.innerWidth<768);return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),a.useEffect(()=>{if(!r)return;if(M(Kt(r.tripType)),N(r.passengerCounts?.adultCount||1),le(r.passengerCounts?.childCount||0),ye(r.passengerCounts?.infantCount||0),r.flights[0]?.flightDate){const m=new Date(r.flights[0].flightDate);Number.isNaN(m.getTime())||(V(m),X(m))}if(r.tripType===2&&r.flights[1]?.flightDate){const m=new Date(r.flights[1].flightDate);Number.isNaN(m.getTime())||(Y(m),k(m))}else Y(null),k(void 0);(async()=>{try{const m=r.flights[0]?.departurePointCode,D=r.flights[0]?.arrivalPointCode;if(m){const G=await fetch("/api/flight/airports",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:null,code:m,isActiveForCms:!0,language:be})});if(G.ok){const ve=await G.json(),Q=Array.isArray(ve)?ve.find(He=>He.id===m||He.raw?.code===m):null;Q?(T(Q),w(Q.label||m)):w(m)}}if(D){const G=await fetch("/api/flight/airports",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:null,code:D,isActiveForCms:!0,language:be})});if(G.ok){const ve=await G.json(),Q=Array.isArray(ve)?ve.find(He=>He.id===D||He.raw?.code===D):null;Q?(O(Q),R(Q.label||D)):R(D)}}}catch(m){console.error("Failed to load airport info:",m)}})()},[be,r]);const B=(t,m,D)=>o(t===1?m:D),ke=()=>{const t=[];return z>0&&t.push(`${z} ${B(z,"FLIGHT_TRAVELER_Adult","FLIGHT_TRAVELER_Adults")}`),se>0&&t.push(`${se} ${B(se,"FLIGHT_TRAVELER_Child","FLIGHT_TRAVELER_Children")}`),ae>0&&t.push(`${ae} ${B(ae,"FLIGHT_TRAVELER_Infant","FLIGHT_TRAVELER_Infants")}`),t.join(", ")};a.useEffect(()=>{const t=m=>{_e.current&&!_e.current.contains(m.target)&&Ce(!1),Ae.current&&!Ae.current.contains(m.target)&&C(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]);const Qe=()=>{const t=E,m=x;w(pe),R(t),T(p),O(m),L([])};a.useEffect(()=>{f&&v&&v<f&&Y(f)},[f,v]),a.useEffect(()=>{f&&X(f)},[f]),a.useEffect(()=>{v&&k(v)},[v]);const Ye=t=>t?.raw?.code||t?.id||"",Ge=Ye(x),d=Ye(p);a.useEffect(()=>{const t=Ge&&d?`${Ge}|${d}`:"";if(!t){Oe.current="",xe(ee),J(ee);return}Oe.current!==t&&(Oe.current=t,xe(f??ee),J(v??f??ee))},[Ge,d,f,v,ee]);const{dates:$,fetchMonth:ie}=bt({departureAirportCode:Ge||void 0,arriveAirportCode:d||void 0,initialDate:ne.toISOString(),locale:I}),{dates:fe,fetchMonth:ce}=bt({departureAirportCode:d||void 0,arriveAirportCode:Ge||void 0,initialDate:Pe.toISOString(),locale:I}),de=a.useMemo(()=>$.filter(t=>t.price>0).map(t=>new Date(t.iso)).filter(t=>!Number.isNaN(t.getTime())),[$]),A=a.useMemo(()=>fe.filter(t=>t.price>0).map(t=>new Date(t.iso)).filter(t=>!Number.isNaN(t.getTime())),[fe]),we=a.useMemo(()=>{const t=new Map;return $.forEach(m=>{if(m.price<=0)return;const D=new Date(m.iso);if(Number.isNaN(D.getTime()))return;const H=Ee(D),G=t.get(H);(G===void 0||m.price<G)&&t.set(H,m.price)}),t},[$]),We=a.useMemo(()=>{const t=new Map;return fe.forEach(m=>{if(m.price<=0)return;const D=new Date(m.iso);if(Number.isNaN(D.getTime()))return;const H=Ee(D),G=t.get(H);(G===void 0||m.price<G)&&t.set(H,m.price)}),t},[fe]),Be=a.useMemo(()=>new Set(de.map(t=>Ee(t))),[de]),Le=a.useMemo(()=>new Set(A.map(t=>Ee(t))),[A]),ot=a.useMemo(()=>Mt({priceByKey:we}),[we,P]),ct=a.useMemo(()=>Mt({priceByKey:We}),[We,P]),Te=a.useCallback(()=>{oe(!1),Z(null)},[]),Ve=a.useCallback(async t=>{try{await Promise.all(Ht(t).map(m=>ie(m.getFullYear(),m.getMonth()+1)))}catch{}},[ie]),Me=a.useCallback(async t=>{try{await Promise.all(Ht(t).map(m=>ce(m.getFullYear(),m.getMonth()+1)))}catch{}},[ce]),qe=a.useCallback(()=>{Z("departure"),oe(!0);const t=f||de[0]||ee;X(t),Ve(t)},[f,de,ee,Ve]),n=a.useCallback(()=>v&&(!f||v>=f)?v:f||A[0]||ee,[v,f,A,ee]),i=a.useCallback(()=>
1{if(!f){qe();return}Z("return"),oe(!0);const t=n();k(t),Me(t)},[f,n,qe,Me]),y=(t,m)=>!t||!m?!1:Ee(t)===Ee(m),j=a.useCallback(t=>{if(!t){f&&Te();return}if(y(t,f)){Te();return}if(V(t),g==="roundTrip"){v&&t>v&&Y(null),Z("return");const m=v&&v>=t?v:t;k(m),Me(m)}else Te()},[v,g,Me,Te,f]),b=a.useCallback(t=>{if(!t){v&&Te();return}if(y(t,v)){Te();return}Y(t),Te()},[Te,v]),K=a.useCallback(()=>{M("roundTrip"),setTimeout(()=>{i()},50)},[i]);a.useEffect(()=>{const t=m=>{m.key==="Escape"&&S&&Te()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[S,Te]),a.useEffect(()=>{if(g!=="roundTrip"||!f||!v)return;const t=Ee(f),m=Ee(v),D=m.slice(0,7),H=Array.from(Le).some(He=>He.startsWith(D)),G=Le.size>0,ve=m<t,Q=G&&H&&!Le.has(m);(ve||Q)&&Y(null)},[f,v,g,Le]),a.useEffect(()=>{if(!f&&de.length>0&&V(de[0]),g==="roundTrip"&&f&&!v&&A.length>0){const t=Ee(f),m=A.find(D=>Ee(D)>=t);m&&Y(m)}},[de,A,f,v,g]),a.useEffect(()=>{let t=!1;return(async()=>{try{if(!x||!(x?.raw?.code||x?.id)){L([]);return}const D={id:null,code:String(x?.raw?.code||x?.id),isActiveForCms:!0,language:be},H=await fetch("/api/flight/airportmaps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)}),G=H.ok?await H.json():[];if(t)return;L(Array.isArray(G)?G:[])}catch{t||L([])}})(),()=>{t=!0}},[be,x]);const te=async()=>{if(!x||!p||!f){alert(o("FLIGHT_SEARCH_RequiredFields"));return}const t=x.raw?.code||x.id,m=p.raw?.code||p.id;if(!t||!m){alert(o("FLIGHT_SEARCH_ValidAirports"));return}if(g==="roundTrip"&&!v){alert(o("FLIGHT_SEARCH_ReturnRequired"));return}const D=Os(g),H=dt=>{const Tt=dt.getFullYear(),Rt=String(dt.getMonth()+1).padStart(2,"0"),ts=String(dt.getDate()).padStart(2,"0");return`${Tt}-${Rt}-${ts}`},G=Fe.getCurrentLocale(),ve=$t[G]||"EN",Q=[{flightDate:H(f),departurePointType:0,departurePointCode:String(t),arrivalPointType:0,arrivalPointCode:String(m)}];g==="roundTrip"&&v&&Q.push({flightDate:H(v),departurePointType:0,departurePointCode:String(m),arrivalPointType:0,arrivalPointCode:String(t)});const He={tripType:D,passengerCounts:{adultCount:z,childCount:se,infantCount:ae},currency:r?.currency||"EUR",language:ve,flights:Q};await c(He)};return s?e.jsxs("div",{className:"mb-10 animate-in slide-in-from-top-2 duration-300",children:[e.jsx("div",{className:"flex gap-2 mb-0",children:e.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 rounded-t-xl bg-white text-[#0ab0d8] shadow-lg",children:[e.jsx(et,{className:"w-4 h-4"}),e.jsx("span",{children:o("FLIGHT_TAB_Flight")})]})}),e.jsxs("div",{className:"bg-white rounded-2xl rounded-tl-none shadow-2xl p-5 md:p-6 border border-gray-100 relative pb-10",children:[e.jsxs("div",{className:"flex gap-3 mb-4",children:[e.jsxs("div",{className:"relative",ref:_e,children:[e.jsxs("button",{onClick:()=>Ce(!re),className:"px-4 py-2 rounded-xl bg-[#F4F4F4] text-[#555] hover:bg-gray-200 transition-all flex items-center gap-2 whitespace-nowrap",children:[g==="oneWay"?e.jsx(ft,{className:"w-4 h-4"}):e.jsx(ys,{className:"w-4 h-4"}),e.jsx("span",{className:"text-[13px] md:text-[16px]",children:o($e.find(t=>t.value===g)?.labelKey??"FLIGHT_TRIP_TYPE_OneWay")}),e.jsx(Nt,{className:`w-4 h-4 transition-transform ${re?"rotate-180":""}`})]}),re&&e.jsx("div",{className:"absolute top-full mt-2 left-0 md:left-0 w-[calc(100vw-6rem)] md:w-48 max-w-xs bg-[#475569] rounded-lg shadow-xl overflow-hidden z-[90]",children:$e.map(t=>e.jsxs("button",{onClick:()=>{M(t.value),Ce(!1),t.value==="oneWay"&&Y(null)},className:"w-full px-4 py-3 text-left text-white hover:bg-slate-600 transition-colors flex items-center justify-between",children:[e.jsx("span",{children:o(t.labelKey)}),g===t.value&&e.jsx(vs,{className:"w-4 h-4"})]},t.value))})]}),e.jsxs("div",{className:"relative",ref:Ae,children:[e.jsxs("button",{onClick:()=>C(!he),className:"px-4 py-2 rounded-xl bg-[#F4F4F4] text-[#555] hover:bg-gray-200 transition-all flex items-center gap-2 whitespace-nowrap",children:[e.jsx(pt,{className:"w-4 h-4"}),e.jsxs("span",{className:"text-[13px] md:text-[16px]",children:[me," ",o("FLIGHT_SEARCH_Person",{count:me})]}),e.jsx(Nt,{className:`w-4 h-4 transition-transform ${he?"rotate-180":""}`})]}),he&&e.jsxs("div",{className:"absolute top-full mt-2 right-0 md:left-0 md:right-auto w-[calc(100vw-6rem)] md:w-64 max-w-sm bg-[#475569] rounded-lg shadow-xl overflow-hidden z-[90]",children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-slate-600 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pt,{className:"w-4 h-4 text-white"}),e.jsx("span",{className:"text-white",children:ke()})]}),e.jsx(Nt,{className:"w-4 h-4 text-white"})]}),e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-white",children:o("FLIGHT_TRAVELER_Adults")}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>N(Math.max(1,z-1)),className:"w-8 h-8 rounded bg-slate-700 hover:bg-slate-600 text-white flex items-center justify-center transition-colors",children:"-"}),e.jsx("span",{className:"text-white w-6 text-center",children:z}),e.jsx("button",{onClick:()=>N(z+1),className:"w-8 h-8 rounded bg-slate-700 hover:bg-slate-600 text-white flex items-center justify-center transition-colors",children:"+"})]})]}),e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:o("FLIGHT_TRAVELER_Children")}),e.jsx("div",{className:"text-slate-400 text-sm",children:o("FLIGHT_SEARCH_AgeChildren")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>le(Math.max(0,se-1)),className:"w-8 h-8 rounded bg-slate-700 hover:bg-slate-600 text-white flex items-center justify-center transition-colors",children:"-"}),e.jsx("span",{className:"text-white w-6 text-center",children:se}),e.jsx("button",{onClick:()=>le(se+1),className:"w-8 h-8 rounded bg-slate-700 hover:bg-slate-600 text-white flex items-center justify-center transition-colors",children:"+"})]})]}),e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:o("FLIGHT_TRAVELER_Infants")}),e.jsx("div",{className:"text-slate-400 text-sm",children:o("FLIGHT_SEARCH_AgeInfants")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>ye(Math.max(0,ae-1)),className:"w-8 h-8 rounded bg-slate-700 hover:bg-slate-600 text-white flex items-center justify-center transition-colors",children:"-"}),e.jsx("span",{className:"text-white w-6 text-center",children:ae}),e.jsx("button",{onClick:()=>{ae<z&&ye(ae+1)},className:`w-8 h-8 rounded ${ae>=z?"bg-slate-800 cursor-not-allowed opacity-50":"bg-slate-700 hover:bg-slate-600"} text-white flex items-center justify-center transition-colors`,disabled:ae>=z,children:"+"})]})]}),ae>=z&&e.jsx("div",{className:"px-4 pb-3 text-slate-400 text-xs",children:je})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2.7fr_1.3fr_1.25fr] gap-3 mb-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("label",{className:"text-[#555] text-sm mb-1 block",children:o("FLIGHT_SEARCH_DestinationLabel")}),e.jsxs("div",{className:"relative flex flex-col gap-3 lg:flex-row lg:items-center lg:gap-0 lg:bg-[#F4F4F4] lg:rounded-xl lg:border-2 lg:border-transparent lg:hover:border-[#0ab0d8]/30 lg:transition-all lg:h-12",children:[e.jsxs("div",{className:"flex w-full items-center gap-3 bg-[#F4F4F4] rounded-xl border-2 border-transparent hover:border-[#0ab0d8]/30 transition-all px-4 h-12 lg:flex-1 lg:bg-transparent lg:border-none lg:hover:border-transparent lg:rounded-none lg:px-0 lg:py-0 lg:pl-4",children:[e.jsx(js,{className:"hidden lg:block w-4 h-4 text-[#555] mr-1.5 shrink-0"}),e.jsx("div",{className:"flex-1",children:e.jsx(Ot,{variant:"inline",value:E,onChange:w,onSelect:t=>{T(t),t?(w(t.label),R(""),O(null),setTimeout(()=>
1ge.current?.focus(),0)):(w(""),R(""),O(null))},placeholder:o("FLIGHT_SEARCH_FromPlaceholder"),inputClassName:"h-11 min-h-[44px] lg:h-10 lg:min-h-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 p-0"})})]}),e.jsx("div",{className:"flex w-full justify-center -my-1 lg:my-0 lg:w-auto lg:justify-center lg:shrink-0 lg:px-2",children:e.jsx("button",{onClick:Qe,className:"flex items-center justify-center rounded-full bg-white border border-gray-200 text-[#555] hover:border-[#0ab0d8] hover:text-[#0ab0d8] transition-all shadow-md w-11 h-11 lg:w-8 lg:h-8 lg:shadow-none","aria-label":o("FLIGHT_SEARCH_SwapLocations"),children:e.jsx(ws,{className:"w-4 h-4"})})}),e.jsxs("div",{className:"flex w-full items-center gap-3 bg-[#F4F4F4] rounded-xl border-2 border-transparent hover:border-[#0ab0d8]/30 transition-all px-4 h-12 lg:flex-1 lg:bg-transparent lg:border-none lg:hover:border-transparent lg:rounded-none lg:px-0 lg:py-0 lg:pr-1",children:[e.jsx(At,{className:"hidden lg:block w-4 h-4 text-[#555] mr-1.5 shrink-0"}),e.jsx("div",{className:"flex-1",children:e.jsx(Ot,{variant:"inline",value:pe,onChange:R,onSelect:t=>{O(t),R(t?t.label:"")},placeholder:o("FLIGHT_SEARCH_ToPlaceholder"),staticOptions:U,inputClassName:"h-11 min-h-[44px] lg:h-10 lg:min-h-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 p-0",disableAutoSearch:!1,externalInputRef:ge})})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("label",{className:"text-[#555] text-sm mb-1 block",children:o("FLIGHT_SEARCH_When")}),e.jsxs("div",{className:st("relative flex items-center gap-2 bg-[#F4F4F4] rounded-xl border-2 transition-all h-12 px-4",F==="departure"&&S?"border-[#0ab0d8] ring-2 ring-[#0ab0d8]/20":"border-transparent hover:border-[#0ab0d8]/30"),children:[e.jsx(at,{className:"hidden lg:block w-5 h-5 text-[#555] shrink-0"}),W?e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:Ke,onClick:qe,className:"flex-1 text-left bg-transparent outline-none text-[#555]",children:f?e.jsx("span",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("span",{children:De(f)})}):o("FLIGHT_SEARCH_SelectDeparture")}),e.jsx(_t,{open:S&&F==="departure",onOpenChange:t=>{t?qe():F==="departure"&&Te()},children:e.jsxs(Dt,{className:"!max-w-full !w-screen !h-screen !max-h-screen !m-0 !p-0 !rounded-none !translate-x-0 !translate-y-0 !top-0 !left-0 !right-0 !bottom-0 !grid-cols-1 flex flex-col md:hidden [&>button]:!top-16 [&>button]:!right-4",showCloseButton:!0,children:[e.jsx(Lt,{className:"sr-only",children:o("FLIGHT_SEARCH_SelectDepartureDateTitle")}),e.jsx(Ft,{className:"sr-only",children:o("FLIGHT_SEARCH_SelectDepartureDateDesc")}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(xt,{activeDateField:F,tripType:g,departDate:f,returnDate:v,onDepartureClick:()=>{Z("departure");const t=f||de[0]||ee;X(t),Ve(t)},onReturnClick:()=>{if(!f)return;Z("return");const t=n();k(t),Me(t)}}),e.jsx("div",{className:"p-4 w-full",children:e.jsxs("div",{className:"w-full",children:[e.jsx(ut,{mode:"single",locale:q,month:ue,onMonthChange:t=>{X(t??void 0),t&&Ve(t)},selected:f??void 0,onSelect:t=>j(t??null),disabled:t=>{const m=t<ee,D=Be.size>0,H=Be.has(Ee(t));return m||D&&!H},numberOfMonths:2,showOutsideDays:!1,components:{DayButton:ot},className:"w-full",classNames:{root:"!w-full"}}),e.jsx(it,{baseFareLabel:h,lowestFareLabel:u,className:"mt-3 border-t border-gray-100 pt-3"})]})})]})]})})]}):e.jsxs(It,{open:S&&F==="departure",onOpenChange:t=>{t?qe():F==="departure"&&Te()},children:[e.jsx(Pt,{asChild:!0,children:e.jsx("button",{ref:Ke,onClick:qe,className:"flex-1 text-left bg-transparent outline-none text-[#555]",children:f?e.jsx("span",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("span",{children:De(f)})}):o("FLIGHT_SEARCH_SelectDeparture")})}),e.jsxs(kt,{className:"w-auto p-0",align:"start",children:[e.jsx(xt,{activeDateField:F,tripType:g,departDate:f,returnDate:v,onDepartureClick:()=>{Z("departure");const t=f||de[0]||ee;X(t),Ve(t)},onReturnClick:()=>{if(!f)return;Z("return");const t=n();k(t),Me(t)}}),e.jsx(ut,{mode:"single",locale:q,month:ue,onMonthChange:t=>{X(t??void 0),t&&Ve(t)},selected:f??void 0,onSelect:t=>j(t??null),disabled:t=>{const m=t<ee,D=Be.size>0,H=Be.has(Ee(t));return m||D&&!H},numberOfMonths:2,showOutsideDays:!1,components:{DayButton:ot}}),e.jsx(it,{baseFareLabel:h,lowestFareLabel:u,className:"border-t border-gray-100 px-4 pb-4 pt-3"})]})]})]})]}),e.jsx("div",{className:"relative",children:g==="oneWay"?e.jsxs("button",{onClick:K,className:"h-12 w-full rounded-xl bg-[#F4F4F4] border-2 border-transparent hover:border-[#0ab0d8]/30 transition-all px-4 flex items-center justify-center gap-2 text-[#0ab0d8] cursor-pointer mt-6",children:[e.jsx(Ts,{className:"w-4 h-4"}),e.jsx("span",{children:o("FLIGHT_SEARCH_AddReturn")})]}):e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"text-[#555] text-sm mb-1 block",children:o("FLIGHT_SEARCH_Return")}),e.jsxs("div",{className:st("relative flex items-center gap-2 bg-[#F4F4F4] rounded-xl border-2 transition-all h-12 px-4",F==="return"&&S?"border-[#0ab0d8] ring-2 ring-[#0ab0d8]/20":"border-transparent hover:border-[#0ab0d8]/30"),children:[e.jsx(at,{className:"hidden lg:block w-5 h-5 text-[#555] shrink-0"}),W?e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:Ie,onClick:i,className:"flex-1 text-left bg-transparent outline-none text-[#555]",children:v?e.jsx("span",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("span",{children:De(v)})}):o("FLIGHT_SEARCH_SelectReturn")}),e.jsx(_t,{open:S&&F==="return",onOpenChange:t=>{t?i():F==="return"&&Te()},children:e.jsxs(Dt,{className:"!max-w-full !w-screen !h-screen !max-h-screen !m-0 !p-0 !rounded-none !translate-x-0 !translate-y-0 !top-0 !left-0 !right-0 !bottom-0 !grid-cols-1 flex flex-col md:hidden [&>button]:!top-16 [&>button]:!right-4",showCloseButton:!0,children:[e.jsx(Lt,{className:"sr-only",children:o("FLIGHT_SEARCH_SelectReturnDateTitle")}),e.jsx(Ft,{className:"sr-only",children:o("FLIGHT_SEARCH_SelectReturnDateDesc")}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(xt,{activeDateField:F,tripType:g,departDate:f,returnDate:v,onDepartureClick:()=>{Z("departure");const t=f||de[0]||ee;X(t),Ve(t)},onReturnClick:()=>
1{if(!f)return;Z("return");const t=n();k(t),Me(t)}}),e.jsx("div",{className:"p-4 w-full",children:e.jsxs("div",{className:"w-full",children:[e.jsx(ut,{mode:"single",locale:q,month:Se,onMonthChange:t=>{k(t??void 0),t&&Me(t)},selected:v??void 0,onSelect:t=>b(t??null),disabled:t=>{const m=t<ee,D=f?t<f:!1,H=Le.size>0,G=Le.has(Ee(t));return m||D||H&&!G},numberOfMonths:2,showOutsideDays:!1,components:{DayButton:ct},className:"w-full",classNames:{root:"!w-full"}}),e.jsx(it,{baseFareLabel:h,lowestFareLabel:u,className:"mt-3 border-t border-gray-100 pt-3"})]})})]})]})})]}):e.jsxs(It,{open:S&&F==="return",onOpenChange:t=>{t?i():F==="return"&&Te()},children:[e.jsx(Pt,{asChild:!0,children:e.jsx("button",{ref:Ie,onClick:i,className:"flex-1 text-left bg-transparent outline-none text-[#555]",children:v?e.jsx("span",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("span",{children:De(v)})}):o("FLIGHT_SEARCH_SelectReturn")})}),e.jsxs(kt,{className:"w-auto p-0",align:"start",children:[e.jsx(xt,{activeDateField:F,tripType:g,departDate:f,returnDate:v,onDepartureClick:()=>{Z("departure");const t=f||de[0]||ee;X(t),Ve(t)},onReturnClick:()=>{if(!f)return;Z("return");const t=n();k(t),Me(t)}}),e.jsx(ut,{mode:"single",locale:q,month:Se,onMonthChange:t=>{k(t??void 0),t&&Me(t)},selected:v??void 0,onSelect:t=>b(t??null),disabled:t=>{const m=t<ee,D=f?t<f:!1,H=Le.size>0,G=Le.has(Ee(t));return m||D||H&&!G},numberOfMonths:2,showOutsideDays:!1,components:{DayButton:ct}}),e.jsx(it,{baseFareLabel:h,lowestFareLabel:u,className:"border-t border-gray-100 px-4 pb-4 pt-3"})]})]}),e.jsxs("button",{onClick:()=>{M("oneWay"),Y(null),Te()},className:"flex items-center gap-1 text-[#555] hover:text-[#0ab0d8] transition-colors text-sm shrink-0",children:[e.jsx(gt,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:o("FLIGHT_SEARCH_Remove")})]})]})]})})]}),e.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 -bottom-7",children:e.jsxs(jt,{onClick:te,className:"h-14 px-8 gap-3 bg-[#22c55e] hover:bg-[#16a34a] text-white rounded-full shadow-2xl hover:shadow-2xl transition-all flex items-center justify-center",children:[e.jsx(Ns,{className:"w-6 h-6"}),e.jsx("span",{className:"text-lg",children:o("SEARCH_Button")})]})})]})]}):null}function es({title:s,message:r,onClose:c,closeLabel:o}){const{t:l}=tt(),h=a.useRef(null);return a.useEffect(()=>{h.current?.focus()},[]),e.jsxs("div",{ref:h,tabIndex:-1,role:"alert","aria-live":"assertive",className:"flex items-start gap-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-amber-900 shadow-sm",children:[e.jsx(Ss,{className:"w-5 h-5 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-dins text-sm",children:s}),e.jsx("div",{className:"text-sm leading-snug",children:r})]}),c&&e.jsx("button",{type:"button",onClick:c,className:"text-amber-800 hover:text-amber-900 p-1 rounded-full focus:outline-none focus:ring-2 focus:ring-amber-400","aria-label":o||l("COMMON_Close"),children:e.jsx(gt,{className:"w-4 h-4"})})]})}const $s=(s,r,c)=>new Intl.DateTimeFormat(c,{month:"long",year:"numeric"}).format(new Date(Date.UTC(s,r,1))),Ze=s=>{if(!s)return null;const r=s instanceof Date?s:new Date(s);if(Number.isNaN(r.getTime()))return null;const c=r.getUTCFullYear(),o=String(r.getUTCMonth()+1).padStart(2,"0"),l=String(r.getUTCDate()).padStart(2,"0");return`${c}-${o}-${l}T00:00:00.000Z`},Je=(s,r)=>{const c=s?new Date(s):new Date;return new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()+r,1))},ht=s=>{const r=s?new Date(s):new Date;return{year:r.getUTCFullYear(),month:r.getUTCMonth()}},Bt=(s,r,c)=>{const o=new Date(Date.UTC(s,r,1)),l=new Date(Date.UTC(s,r+1,0)).getUTCDate(),h=o.getUTCDay(),u=[];for(let g=0;g<h;g++)u.push({key:`p-${g}`,isPlaceholder:!0,isAvailable:!1,isDisabled:!0,isToday:!1});const _=Ze(new Date);for(let g=1;g<=l;g++){const M=Ze(new Date(Date.UTC(s,r,g))),E=c.has(M),w=c.get(M),pe=!E,R=_===M;u.push({key:M,iso:M,day:g,price:w,isPlaceholder:!1,isAvailable:E,isDisabled:pe,isToday:R})}for(;u.length%7!==0;)u.push({key:`t-${u.length}`,isPlaceholder:!0,isAvailable:!1,isDisabled:!0,isToday:!1});return u},Ks=s=>
1{const r=new Date(Date.UTC(2021,7,1));return Array.from({length:7},(c,o)=>{const l=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()+o));return new Intl.DateTimeFormat(s,{weekday:"short"}).format(l).toUpperCase()})};function Bs({open:s,onOpenChange:r,tripType:c,outboundTitle:o,inboundTitle:l,availableDatesOutbound:h,availableDatesInbound:u,selectedOutboundIso:_,selectedInboundIso:g,minInboundIso:M,maxOutboundIso:E,singleRoute:w=!1,onConfirm:pe,onInvalidSelection:R,fetchOutboundMonth:x,fetchInboundMonth:T}){const{t:p}=tt(),{formatPrice:O}=rt(),U=p("FLIGHT_RESULTS_BaseFareLegend"),L=p("FLIGHT_RESULTS_LowestFareLegend"),f=Fe.getLanguageHeader(Fe.getCurrentLocale()),V=a.useMemo(()=>Ks(f),[f]),v=o||p("FLIGHT_SEARCH_Departure"),Y=l||p("FLIGHT_SEARCH_Return"),ue=a.useMemo(()=>{const I=new Map;return h.forEach(P=>{const q=Ze(P.iso);q&&I.set(q,typeof P.price=="number"?P.price:void 0)}),I},[h]),X=a.useMemo(()=>{const I=new Map;return(u||[]).forEach(P=>{const q=Ze(P.iso);q&&I.set(q,typeof P.price=="number"?P.price:void 0)}),I},[u]),[Se,k]=a.useState(()=>Je(_||null,0)),[ge,z]=a.useState(()=>Je(g||_||null,0)),[N,se]=a.useState(_?Ze(_):null),[le,ae]=a.useState(g?Ze(g):null),[ye,re]=a.useState(null);a.useEffect(()=>{s&&(se(_?Ze(_):null),ae(g?Ze(g):null),k(Je(_||null,0)),z(Je(g||_||null,0)),re(null))},[s,_,g,c]),a.useEffect(()=>{if(!s)return;const I=ht(Se.toISOString()),P=ht(ge.toISOString());Promise.all([x?.(I.year,I.month+1),c===2&&!w?T?.(P.year,P.month+1):void 0]).catch(()=>{})},[s,Se,ge,c,w,x,T]);const Ce=a.useMemo(()=>ht(Se.toISOString()),[Se]),he=a.useMemo(()=>ht(ge.toISOString()),[ge]),C=a.useMemo(()=>Bt(Ce.year,Ce.month,ue),[Ce,ue]),S=a.useMemo(()=>c===2&&!w?Bt(he.year,he.month,X):[],[c,w,he,X]),oe=(I,P)=>!I||!P?0:new Date(I).getTime()-new Date(P).getTime(),F=(I,P)=>oe(I,P)>0,Z=(I,P)=>oe(I,P)<0,Ke=(I,P)=>{const q=new Date(P).getTime(),De=Array.from(I.keys()).sort((ne,xe)=>new Date(ne).getTime()-new Date(xe).getTime());for(const ne of De)if(new Date(ne).getTime()>=q)return ne;return null},Ie=(I,P)=>{const q=new Date(P).getTime(),De=Array.from(I.keys()).sort((xe,Pe)=>new Date(xe).getTime()-new Date(Pe).getTime());let ne=null;for(const xe of De)if(new Date(xe).getTime()<=q)ne=xe;else break;return ne},_e=I=>{if(se(I),c===2&&!w&&le&&F(I,le)){const P=Ke(X,I);
1P?(ae(P),re(null)):(re(p("FLIGHT_RESULTS_NoReturnAfterDeparture")),R?.("departAfterReturn"))}else re(null)},Ae=I=>{if(ae(I),N&&Z(I,N)){const P=Ie(ue,I);P?(se(P),re(null)):(re(p("FLIGHT_RESULTS_NoDepartureBeforeReturn")),R?.("returnBeforeDepart"))}else re(null)},Oe=c===1||w?!!N:!!(N&&le&&!F(N,le)),W=c===1||w,Ue=W?"max-w-4xl lg:max-w-[980px] xl:max-w-[980px]":"max-w-5xl lg:max-w-7xl xl:max-w-7xl",$e=W?"shrink-0 flex items-center justify-between px-4 pt-3 md:px-5 md:pt-4":"shrink-0 flex items-center justify-between px-4 pt-4 md:px-6 md:pt-5",me=W?"min-h-0 flex-1 overflow-y-auto px-4 pt-2 md:px-5 md:pt-3":"min-h-0 flex-1 overflow-y-auto px-4 pt-3 md:px-6 md:pt-4",je=W?"shrink-0 flex flex-col-reverse gap-2 border-t border-gray-100 bg-white px-4 py-2.5 md:px-5 md:py-3 sm:flex-row sm:justify-end":"shrink-0 flex flex-col-reverse gap-3 border-t border-gray-100 bg-white px-4 py-3 md:px-6 md:py-4 sm:flex-row sm:justify-end",ee=W?`grid gap-2 pb-3 md:gap-3 md:pb-4 grid-cols-1 ${ye?"pt-2 md:pt-3":"pt-0.5 md:pt-1"}`:`grid gap-3 pb-4 md:gap-4 md:pb-6 ${c===2?"grid-cols-1 md:grid-cols-2":"grid-cols-1"} ${ye?"pt-3 md:pt-4":"pt-1 md:pt-2"}`,Re=()=>{if(!N){re(p("FLIGHT_RESULTS_SelectDepartureToContinue")),R?.("missingSelection");return}if(w){pe({outboundIso:N}),r(!1);return}if(c===2&&!le){re(p("FLIGHT_RESULTS_SelectReturnToContinue")),R?.("missingSelection");return}if(c===2&&le&&F(N,le)){re(p("FLIGHT_RESULTS_DepartureAfterReturnDetailed")),R?.("departAfterReturn");return}pe({outboundIso:N,inboundIso:c===2?le:null}),r(!1)},be=(I,P,q,De,ne,xe,Pe)=>{const J=P.reduce((A,we)=>typeof we.price!="number"||we.price<=0||we.isDisabled||we.isPlaceholder?A:A===null||we.price<A?we.price:A,null),B=W?"rounded-xl p-2.5 md:rounded-2xl md:p-3 lg:p-3":"rounded-2xl p-3 md:p-4 lg:p-5",ke=W?"mb-1.5 space-y-1.5 md:mb-2 md:space-y-2":"mb-3 md:mb-4 space-y-2 md:space-y-3",Qe=W?"text-base md:text-lg min-w-[116px] md:min-w-[132px]":"text-lg md:text-2xl min-w-[140px] md:min-w-[160px]",Ye=W?"mb-0.5 grid grid-cols-7 text-center text-xs text-gray-500 md:mb-1 md:text-sm":"mb-1.5 grid grid-cols-7 text-center text-xs text-gray-500 md:mb-2 md:text-sm",Ge=W?"py-0.5 md:py-1":"py-1.5 md:py-2.5",d=W?"grid grid-cols-7 gap-0.5 md:gap-0.5":"grid grid-cols-7 gap-0.5 md:gap-1.5",$=W?"h-[50px] md:h-[68px] lg:h-[72px]":"h-[54px] md:h-[108px]",ie=W?"h-[50px] md:h-[68px] lg:h-[72px] px-1.5 py-1 md:px-2 md:py-1.5":"h-[54px] md:h-[108px] px-1.5 md:px-3 py-1.5 md:py-2.5",fe=W?"text-sm md:text-[15px]":"text-sm md:text-lg",ce=W?"text-[11px] md:text-xs":"text-xs md:text-base",de=W?"mt-1.5 border-t border-gray-100 pt-2 text-xs gap-x-4 gap-y-1.5":"mt-3 border-t border-gray-100 pt-3";return e.jsxs("div",{className:`flex h-full flex-col border border-gray-200 bg-white shadow-sm ${B}`,children:[e.jsxs("div",{className:ke,children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs md:text-sm uppercase tracking-wide text-gray-600",children:[e.jsx(at,{className:"w-4 h-4 md:w-5 md:h-5 text-[#0ab0d8]"}),e.jsx("span",{className:"min-w-0 font-dins leading-tight",children:I})]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 md:gap-4",children:[e.jsx("button",{onClick:xe,className:"w-9 h-9 md:w-10 md:h-10 flex items-center justify-center rounded-full border border-gray-200 hover:border-[#0ab0d8] hover:text-[#0ab0d8] transition-colors","aria-label":p("FLIGHT_RESULTS_PreviousMonth"),type:"button",children:e.jsx(qt,{className:"w-4 h-4"})}),e.jsx("div",{className:`text-center font-dins text-gray-900 ${Qe}`,children:$s(ne.year,ne.month,f).toUpperCase()}),e.jsx("button",{onClick:Pe,className:"w-9 h-9 md:w-10 md:h-10 flex items-center justify-center rounded-full border border-gray-200 hover:border-[#0ab0d8] hover:text-[#0ab0d8] transition-colors","aria-label":p("FLIGHT_RESULTS_NextMonth"),type:"button",children:e.jsx(Jt,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:Ye,children:V.map(A=>e.jsx("div",{className:Ge,children:A},A))}),e.jsx("div",{className:`${d} flex-1`,children:P.map(A=>{if(A.isPlaceholder)return e.jsx("div",{className:$},A.key);const we=q?q===A.iso:!1,We=typeof J=="number"&&typeof A.price=="number"&&A.price===J,Be=A.isDisabled?"bg-gray-50 text-gray-300 border-dashed cursor-not-allowed":we?"bg-[#0ab0d8] text-white border-[#0ab0d8] shadow-md":"bg-white text-gray-800 hover:border-[#0ab0d8]/60 hover:text-[#0ab0d8] cursor-pointer",Le=typeof A.price=="number"&&A.price>0?O(A.price,"EUR",{maximumFractionDigits:0}):"";return e.jsxs("button",{type:"button",onClick:()=>{A.isDisabled||!A.iso||De(A.iso)},"aria-label":p("FLIGHT_RESULTS_SelectDateAria",{date:A.iso}),disabled:A.isDisabled,className:`flex w-full flex-col justify-between rounded-xl border text-left transition-colors ${ie} ${Be}`,children:[e.jsx("div",{className:`flex items-start justify-between font-dins leading-none ${fe}`,children:e.jsx("span",{children:A.day})}),Le&&e.jsx("div",{className:`font-dins whitespace-nowrap ${ce} ${we?"text-white/90":We?"text-green-600":"text-[#0ab0d8]"}`,children:Le})]},A.key)})}),e.jsx(it,{baseFareLabel:U,lowestFareLabel:L,className:de})]})};return e.jsx(_t,{open:s,onOpenChange:r,children:e.jsxs(Dt,{className:`flex max-h-[calc(100dvh-1rem)] w-full flex-col overflow-hidden overscroll-contain bg-white p-0 sm:max-h-[90dvh] ${Ue}`,children:[e.jsx(Lt,{className:"sr-only",children:p("FLIGHT_RESULTS_MonthlyOverview")}),e.jsx(Ft,{className:"sr-only",children:p("FLIGHT_RESULTS_MonthlyOverviewDesc")}),e.jsx("div",{className:$e,children:e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-[0.2em] text-gray-500 mb-1",children:p("FLIGHT_RESULTS_MonthlyOverviewEyebrow")}),e.jsx("div",{className:"text-xl md:text-2xl font-dins text-gray-900",children:p("FLIGHT_RESULTS_MonthlyOverview")})]})}),e.jsxs("div",{className:me,children:[ye&&e.jsx(es,{title:p("FLIGHT_RESULTS_DatesDontMatch"),message:ye,onClose:()=>re(null),closeLabel:p("COMMON_Close")}),e.jsxs("div",{className:ee,children:[be(v,C,N,_e,Ce,()=>k(Je(Se.toISOString(),-1)),()=>k(Je(Se.toISOString(),1))),c===2&&!w&&be(Y,S,le,Ae,he,()=>z(Je(ge.toISOString(),-1)),()=>z(Je(ge.toISOString(),1)))]})]}),e.jsxs("div",{className:je,children:[e.jsx("button",{type:"button",onClick:()=>r(!1),className:"w-full rounded-xl border border-gray-200 px-4 py-2 text-gray-700 transition-colors hover:bg-gray-50 sm:w-auto",children:p("COMMON_Cancel")}),e.jsx("button",{type:"button",onClick:Re,disabled:!Oe,className:"w-full rounded-xl bg-[#0ab0d8] px-5 py-3 font-dins text-white transition-colors hover:bg-[#0899c0] disabled:opacity-50 sm:w-auto",children:p("FLIGHT_RESULTS_ConfirmDates")})]})]})})}const Vs=s=>{const r=s?new Date(s):new Date;return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1}},ze=s=>{if(!s)return null;const r=s instanceof Date?s:new Date(s);if(Number.isNaN(r.getTime()))return null;const c=r.getFullYear(),o=String(r.getMonth()+1).padStart(2,"0"),l=String(r.getDate()).padStart(2,"0");return`${c}-${o}-${l}T00:00:00.000Z`},zs=(s,r)=>{const c=new Date(s);return{date:c.toLocaleDateString(r,{day:"numeric",month:"short"}),dayOfWeek:c.toLocaleDateString(r,{weekday:"short"})}},vt=(s,r)=>!s||!r?!1:new Date(s).toDateString()===new Date(r).toDateString(),Ws=({availableDateIsos:s,availableDatesWithPrice:r,propDates:c,initialIso:o,selectedDateIso:l,extraDaysBeforeFirst:h=3,extraDaysAfterLast:u=5,dateLocale:_})=>{const g=new Set,M=new Map;r&&r.length>0?r.forEach(U=>{const L=ze(U.iso);if(L&&U.price>0){g.add(L);const f=M.get(L);(f===void 0||U.price<f)&&M.set(L,U.price)}}
1):(s||[]).forEach(U=>{const L=ze(U);L&&g.add(L)}),(c||[]).forEach(U=>{const L=ze(U.iso);L&&U.price&&!M.has(L)&&M.set(L,U.price)});const E=[...g];if(o&&E.push(o),l&&E.push(l),E.length===0)return[];const w=E.map(U=>new Date(U).getTime()).filter(U=>!isNaN(U)).sort((U,L)=>U-L);if(w.length===0)return[];const pe=new Date(w[0]),R=w[w.length-1],x=new Date(R);x.setDate(x.getDate()+u);const T=new Date(pe);T.setDate(T.getDate()-h);const p=[],O=new Date(T);for(;O<=x;){const U=ze(O);if(U){const L=g.has(U),f=o&&vt(U,o)||l&&vt(U,l),V=M.get(U)||0;p.push({...zs(U,_),price:V,selected:!!f,iso:U,isAvailable:L})}O.setDate(O.getDate()+1)}return p};function Vt({direction:s,title:r,from:c,to:o,selectedFlight:l,onSelectFlight:h,onSelectionInvalidated:u,flights:_,dates:g,currency:M="EUR",routeDepartureCode:E,routeArrivalCode:w,initialDate:pe,tripType:R=1,onDateChange:x,onMonthlyConfirm:T,selectedDateIso:p,pairedSelectedDateIso:O=null,minAllowedIso:U,maxAllowedIso:L,onInvalidSelection:f,availableDateIsos:V,availableDateIsosInbound:v,availableDatesWithPrice:Y,availableDatesWithPriceInbound:ue,fetchAvailableOutboundMonth:X,fetchAvailableInboundMonth:Se,availableDatesLoading:k,openMonthlyOverviewOnLoad:ge=!1,onMonthlyOverviewAutoOpened:z}){const{t:N}=tt(),{formatPrice:se}=rt(),le=Fe.getLanguageHeader(Fe.getCurrentLocale()),ae=N("FLIGHT_RESULTS_SelectFlight"),ye=N("COMMON_Select"),re=N("COMMON_Selected"),Ce=N("FLIGHT_RESULTS_NoFlightsOnDate"),he=ze(pe),C=ze(p??he),S=a.useMemo(()=>Ws({availableDateIsos:V,availableDatesWithPrice:Y,propDates:g,initialIso:he,selectedDateIso:C,dateLocale:le}),[V,Y,g,he,C,le]),oe=a.useMemo(()=>Y&&Y.length>0?Y.filter(d=>d.price>0).map(d=>({iso:ze(d.iso)||d.iso,price:d.price})):S.length>0?S.filter(d=>d.isAvailable).map(d=>({iso:d.iso,price:d.price})):V&&V.length>0?V.map(d=>({iso:ze(d)||d}
1)):[],[Y,S,V]),F=a.useMemo(()=>ue&&ue.length>0?ue.filter(d=>d.price>0).map(d=>({iso:ze(d.iso)||d.iso,price:d.price})):v&&v.length>0?v.map(d=>({iso:ze(d)||d})):[],[ue,v]),[Z,Ke]=a.useState(S),[Ie,_e]=a.useState(()=>{const d=S.findIndex($=>C?vt($.iso,C):$.selected);return d>=0?d:(S.length,0)}),[Ae,Oe]=a.useState(!1),[W,Ue]=a.useState(!1),$e=a.useRef(!1),me=a.useRef(null),je=a.useRef(null),ee=a.useRef(S.length?S:[]),Re=k??!1,be=_||[{id:"MOCK",departTime:"00:00",arriveTime:"00:00",duration:"",carrier:"",flightNumber:"",price:0,departureDateTime:"",departureAirportCode:""}],[I,P]=a.useState(null);a.useEffect(()=>{const d=()=>P(Date.now());d();const $=window.setInterval(d,6e4);return()=>window.clearInterval($)},[]);const q=a.useMemo(()=>I===null?new Map:new Map(be.map(d=>[d.id,Rs({departureDateTime:d.departureDateTime,departureAirportCode:d.departureAirportCode,now:I})])),[I,be]),De=l?q.get(l):void 0;a.useEffect(()=>{l&&De?.disabled&&u?.(l)},[u,l,De?.disabled]);const ne=Z.length>0?Z:ee.current,xe=ne[Ie],Pe=a.useMemo(()=>oe,[oe]),J=xe?.iso||he,B=a.useCallback(()=>{const d=xe?.dayOfWeek||"",$=xe?.date||"";return N("FLIGHT_RESULTS_AvailableFlightsFor",{day:d,date:$})},[xe?.dayOfWeek,xe?.date,N]);a.useEffect(()=>{if(Ke(S),S.length===0){_e(0);return}const d=C||he,$=S.findIndex(ce=>d?vt(ce.iso,d):ce.selected),ie=S.findIndex(ce=>ce.selected);_e($!==-1?$:ie!==-1?ie:0)},[S,he,C]),a.useEffect(()=>{const d=setTimeout(()=>{me.current&&je.current&&je.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},50);return()=>clearTimeout(d)},[Ie]),a.useEffect(()=>{Z.length>0&&(ee.current=Z)},[Z]),a.useEffect(()=>{ne.length>0&&Ie>=ne.length&&_e(Math.max(0,ne.length-1))},[ne,Ie]);const ke=a.useCallback(async()=>{const d=Vs(J);await X?.(d.year,d.month)},[J,X]);a.useEffect(()=>{ke().catch(()=>{})},[ke]),a.useEffect(()=>{!ge||$e.current||($e.current=!0,(async()=>{Ue(!0);try{await ke()}catch{}finally{Ue(!1),Oe(!0),z?.()}})())},[ge,z,ke]);const Qe=a.useCallback(()=>{(async()=>{Ue(!0);try{await ke()}catch{}finally{Ue(!1),Oe(!0)}})()},[ke]),Ye=d=>!d.isAvailable,Ge=async d=>{const $=ne[d];if(!$)return;if(!$.isAvailable){f?.({dateIso:$.iso,reason:"unavailable"});return}await x?.($.iso)!==!1&&_e(d)};return e.jsxs("div",{className:"bg-white rounded-2xl border-2 border-gray-200 p-4 md:p-6 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(et,{className:`w-5 h-5 ${s==="outbound"?"text-[#0ab0d8]":"text-green-600"} ${s==="outbound"?"rotate-45":"rotate-225"}`}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-[#555]",children:r}),e.jsxs("p",{className:"text-sm text-[#888]",children:[c," → ",o]})]})]}),e.jsxs("button",{onClick:Qe,disabled:W,className:"flex items-center gap-2 text-[#0ab0d8] border border-[#0ab0d8] px-3 md:px-4 py-2 rounded-xl hover:bg-[#0ab0d8]/5 transition-colors text-sm",children:[e.jsx(at,{className:"w-4 h-4"}),e.jsx("span",{children:N(W?"FLIGHT_RESULTS_LoadingDates":"FLIGHT_RESULTS_MonthlyOverview")})]})]}),e.jsxs("div",{className:"mb-6 md:mb-8 bg-gradient-to-b from-gray-50 to-white rounded-2xl p-4 md:p-6 border border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(at,{className:"w-4 h-4 text-[#0ab0d8]"}),e.jsx("h4",{className:"text-sm text-[#555]",children:N("FLIGHT_RESULTS_SelectTravelDate")}),Re&&e.jsx("span",{className:"text-xs text-[#888]",children:N("FLIGHT_RESULTS_LoadingDates")})]}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("button",{className:"absolute left-0 z-10 w-8 h-8 md:w-10 md:h-10 flex items-center justify-center bg-white rounded-full shadow-lg hover:bg-gray-50 transition-all border border-gray-200 hover:border-[#0ab0d8]",onClick:()=>{if(!me.current)return;const $=(window.innerWidth<768?88:155)*7;me.current.scrollBy({left:-$,behavior:"smooth"})},"aria-label":N("FLIGHT_RESULTS_Previous7Days"),children:e.jsx(qt,{className:"w-4 h-4 md:w-5 md:h-5 text-[#555]"})}),e.jsx("div",{ref:me,className:"flex-1 overflow-x-auto px-10 md:px-12 py-2 scrollbar-hide",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[ne.map((d,$)=>{const ie=Ye(d),fe=$===Ie;return e.jsxs("button",{ref:fe?je:null,onClick:()=>Ge($),disabled:ie,"aria-disabled":ie,title:ie?Ce:void 0,className:`flex-shrink-0 w-20 md:flex-1 md:min-w-[140px] py-2 md:py-4 px-2 md:px-3 rounded-xl transition-all text-center ${ie?"bg-gray-50/80 text-gray-300 border-2 border-dashed border-gray-200 cursor-not-allowed opacity-60":fe?"bg-[#0ab0d8] text-white shadow-xl border-2 border-[#0ab0d8]":"bg-white text-[#555] hover:bg-gray-50 border-2 border-gray-200 hover:border-[#0ab0d8]/30"}`,children:[e.jsx("div",{className:`text-xs mb-0.5 md:mb-2 ${fe?"text-white/90":ie?"text-gray-300":"text-[#888]"}`,children:d.dayOfWeek}),e.jsx("div",{className:`text-base md:text-lg mb-0.5 md:mb-2 ${fe?"font-dins":""} ${ie?"text-gray-300":""}`,children:d.date}),e.jsx("div",{className:`text-sm md:text-base ${ie?"text-gray-300":fe?"font-dins":"font-dinm text-[#0ab0d8]"}`,children:ie?"—":se(d.price,M,{maximumFractionDigits:0})})]},d.iso)}),!ne.length&&e.jsx("div",{className:"text-sm text-[#888]",children:N("FLIGHT_RESULTS_NoAvailableDates")})]})}),e.jsx("button",{className:"absolute right-0 z-10 w-8 h-8 md:w-10 md:h-10 flex items-center justify-center bg-white rounded-full shadow-lg hover:bg-gray-50 transition-all border border-gray-200 hover:border-[#0ab0d8]",onClick:()=>
1{if(!me.current)return;const $=(window.innerWidth<768?88:155)*7;me.current.scrollBy({left:$,behavior:"smooth"})},"aria-label":N("FLIGHT_RESULTS_Next7Days"),children:e.jsx(Jt,{className:"w-4 h-4 md:w-5 md:h-5 text-[#555]"})})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(et,{className:"w-4 h-4 text-[#0ab0d8]"}),e.jsx("h4",{className:"text-sm text-[#555]",children:B()})]}),e.jsx("div",{className:"space-y-4",children:be.map((d,$)=>{const ie=typeof d.freePax=="number"&&d.freePax>0&&d.freePax<=7,fe=q.get(d.id),ce=fe?.disabled??!1,de=`flight-selection-warning-${s}-${$}`;return e.jsxs("div",{onClick:ce?void 0:()=>h(d.id),"aria-disabled":ce||void 0,"aria-describedby":ce?de:void 0,className:`rounded-2xl transition-all border-2 ${ce?"cursor-not-allowed bg-gray-50 border-gray-200":l===d.id?"bg-[#0ab0d8]/5 border-[#0ab0d8] shadow-lg":"bg-white border-gray-200 hover:border-[#0ab0d8]/40 hover:shadow-md"}`,children:[e.jsx("div",{className:`p-4 md:p-6 ${ce?"opacity-60":""}`,children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-start gap-3 md:gap-6",children:[e.jsxs("div",{className:"text-center flex-shrink-0",children:[e.jsx("div",{className:"text-xl md:text-2xl text-[#555] mb-1",children:d.departTime}),e.jsx("div",{className:"text-xs text-[#888] uppercase tracking-wide",children:c.match(/\(([^)]+)\)/)?.[1]||c.split(" ")[0]})]}),e.jsx("div",{className:"flex-1 pt-2 md:pt-3 min-w-0",children:e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 border-t-2 border-dashed border-gray-300"}),e.jsx(et,{className:"w-3 h-3 md:w-4 md:h-4 text-[#0ab0d8] rotate-45 mx-1 md:mx-2 flex-shrink-0"}),e.jsx("div",{className:"flex-1 border-t-2 border-dashed border-gray-300"})]}),e.jsx("div",{className:"text-center mt-2",children:e.jsxs("span",{className:"text-xs text-[#888] bg-gray-100 px-2 md:px-3 py-1 rounded-full whitespace-nowrap",children:[d.duration," • ",d.via||N("FLIGHT_RESULTS_Direct")]})})]})}),e.jsxs("div",{className:"text-center flex-shrink-0",children:[e.jsx("div",{className:"text-xl md:text-2xl text-[#555] mb-1",children:d.arriveTime}),e.jsx("div",{className:"text-xs text-[#888] uppercase tracking-wide",children:o.match(/\(([^)]+)\)/)?.[1]||o.split(" ")[0]})]})]}),e.jsxs("div",{className:"mt-3 md:mt-4 flex items-center gap-3 pl-0 md:pl-2",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-50 rounded-lg border border-gray-200 flex items-center justify-center",children:e.jsx(et,{className:"w-4 h-4 text-[#0ab0d8]"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm text-[#555]",children:d.carrier}),e.jsx("div",{className:"text-xs text-[#888]",children:d.flightNumber}),ie&&e.jsxs("div",{className:"mt-1 text-xs font-dinm text-amber-700 whitespace-normal break-words",children:[N("FLIGHTS_OnlyFewSeats")," (",d.freePax,")"]})]})]})]}),e.jsxs("div",{className:"md:ml-8 flex flex-row md:flex-col items-center md:items-end justify-between md:justify-between md:h-full",children:[e.jsxs("div",{className:"text-left md:text-right md:mb-4",children:[e.jsx("div",{className:"text-xs text-[#888] mb-1",children:N("FLIGHT_RESULTS_PricePerPerson")}),e.jsx("div",{className:"text-2xl md:text-3xl text-[#555]",children:se(d.price,M,{maximumFractionDigits:0})})]}),e.jsx(jt,{disabled:ce,"aria-describedby":ce?de:void 0,onClick:A=>{A.stopPropagation(),!ce&&h(d.id)},className:`rounded-xl px-4 md:px-8 transition-all text-sm md:text-base ${ce?"bg-gray-300 text-gray-600 shadow-none":l===d.id?"bg-[#0ab0d8] hover:bg-[#0899c0] text-white shadow-md":"bg-[#58e631] hover:bg-[#4cd028] text-white shadow-md"}`,children:l===d.id?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"✓"}),e.jsx("span",{className:"hidden md:inline",children:re})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden md:inline",children:ae}),e.jsx("span",{className:"md:hidden",children:ye})]})})]})]})}),ce&&e.jsxs("div",{id:de,className:"mx-4 mb-4 md:mx-6 md:mb-6 flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2.5 text-sm text-amber-800",children:[e.jsx(Zt,{className:"mt-0.5 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{children:fe?.reason==="departed"?N("FLIGHT_RESULTS_FlightAlreadyDeparted"):N("FLIGHT_RESULTS_DepartureCutoffWarning",{hours:Is})})]})]},d.id)})})]}),e.jsx(Bs,{open:Ae,onOpenChange:Oe,tripType:R,singleRoute:!0,outboundTitle:`${c} - ${o}`,inboundTitle:`${o} - ${c}`,availableDatesOutbound:Pe,availableDatesInbound:R===2?F:void 0,selectedOutboundIso:xe?.iso||he,selectedInboundIso:R===2&&O||void 0,minInboundIso:R===2?xe?.iso||he:void 0,maxOutboundIso:R===2?L:void 0,fetchOutboundMonth:X,fetchInboundMonth:Se,onInvalidSelection:d=>f?.(d),onConfirm:({outboundIso:d})=>{if(T){T(s==="inbound"?{inboundIso:d}:{outboundIso:d});return}
1const $=ne.findIndex(ie=>ie.iso===d);$!==-1?Ge($):x?.(d)}})]})}const zt=(s,r)=>{try{return new Date(s).toLocaleTimeString(r,{hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return""}},Ys=(s,r)=>{try{return new Date(s).toLocaleDateString(r,{day:"numeric",month:"short"})}catch{return""}},qs=(s,r)=>{try{const c=new Date(s),l=new Date(r).getTime()-c.getTime(),h=Math.floor(l/(1e3*60*60)),u=Math.floor(l%(1e3*60*60)/(1e3*60));return{hours:h,minutes:u}}catch{return null}};function Js({flightInfo:s,fareInfo:r,isOutbound:c,currencyCode:o="EUR"}){const{t:l}=wt(),{formatPrice:h}=rt(),u=Fe.getCurrentLocale(),_=qs(s.departureDate,s.arriveDate),g=_?l("FLIGHT_RESULTS_DurationFormat",{hours:_.hours,minutes:_.minutes}):"";return e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-100",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs font-dinm px-2 py-0.5 rounded ${c?"bg-[#0ab0d8]/10 text-[#0ab0d8]":"bg-[#58e631]/10 text-[#48d621]"}`,children:l(c?"FLIGHT_RESULTS_OutboundTitle":"FLIGHT_RESULTS_InboundTitle")}),e.jsxs("span",{className:"text-sm text-[#555]",children:[s.airlineCode,s.flightNumber]})]}),e.jsx("span",{className:"text-xs text-[#888]",children:Ys(s.departureDate,u)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-dins text-[#333]",children:zt(s.departureDate,u)}),e.jsx("div",{className:"text-xs text-[#555]",children:s.departureCityName}),e.jsx("div",{className:"text-xs text-[#888]",children:s.departureAirportCode})]}),e.jsxs("div",{className:"flex-1 mx-4 flex flex-col items-center",children:[e.jsx("div",{className:"text-xs text-[#888]",children:s.via||l("FLIGHT_RESULTS_Direct")}),e.jsxs("div",{className:"w-full h-px bg-gray-300 my-1 relative",children:[e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 bg-gray-300 rounded-full"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-2 h-2 bg-gray-300 rounded-full"})]}),e.jsx("div",{className:"text-xs text-[#888]",children:g})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-lg font-dins text-[#333]",children:zt(s.arriveDate,u)}),e.jsx("div",{className:"text-xs text-[#555]",children:s.arrivalCityName}),e.jsx("div",{className:"text-xs text-[#888]",children:s.arrivalAirportCode})]})]}),r&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 flex flex-wrap items-center justify-between gap-2 text-xs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("span",{className:"text-[#555]",children:[e.jsxs("span",{className:"text-[#888]",children:[l("PRICING_Fare"),":"]})," ",r.airFareName]}),r.baggage>0&&e.jsxs("span",{className:"text-[#555]",children:[e.jsxs("span",{className:"text-[#888]",children:[l("PRICING_Baggage"),":"]})," ",r.baggage,"kg"]}),r.handLuggage>0&&e.jsxs("span",{className:"text-[#555]",children:[e.jsxs("span",{className:"text-[#888]",children:[l("PRICING_HandLuggage"),":"]})," ",r.handLuggage,"kg"]})]}),e.jsx("span",{className:"font-dinm text-[#333]",children:h(r.subTotal,o,{minimumFractionDigits:2,maximumFractionDigits:2})})]})]})}function Zs({isOpen:s,onClose:r,isLoading:c,error:o,pricingData:l,totalPassengers:h}){const{t:u}=wt(),{formatPrice:_}=rt();if(!s)return null;const g=(E,w)=>{switch(E){case 1:return u(w===1?"FLIGHT_TRAVELER_Adult":"FLIGHT_TRAVELER_Adults");case 2:return u(w===1?"FLIGHT_TRAVELER_Child":"FLIGHT_TRAVELER_Children");case 3:return u(w===1?"FLIGHT_TRAVELER_Infant":"FLIGHT_TRAVELER_Infants");default:return u(w===1?"PRICING_Passenger":"PRICING_Passenger_plural")}},M=()=>{if(c)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(Et,{className:"w-8 h-8 animate-spin text-[#0ab0d8] mb-4"}),e.jsx("span",{className:"text-[#555]",children:u("PRICING_LoadingDetails")})]});if(o)return e.jsxs("div",{className:"py-8 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mx-auto mb-4",children:e.jsx(gt,{className:"w-6 h-6 text-red-500"})}),e.jsx("p",{className:"text-red-500",children:o})]});if(!l)return null;const E=l.currencyInfo?.code||l.currency||"EUR",w=T=>_(T,E,{minimumFractionDigits:2,maximumFractionDigits:2}),pe=[...l.flights].sort((T,p)=>new Date(T.key.flightDate).getTime()-new Date(p.key.flightDate).getTime()),R=l.flights.length===2?u("FLIGHT_TRIP_TYPE_RoundTrip"):u("FLIGHT_TRIP_TYPE_OneWay"),x=u(h===1?"PRICING_Passenger":"PRICING_Passenger_plural");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[#0ab0d8] font-dinm",children:[e.jsx(et,{className:"w-4 h-4"}),e.jsx("span",{children:u("PRICING_FlightDetails")})]}),pe.map((T,p)=>{const O=T.value[0];return O?e.jsx(Js,{flightInfo:O.key,fareInfo:O.value[0],isOutbound:p===0,currencyCode:E},p):null})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[#0ab0d8] font-dinm",children:[e.jsx(pt,{className:"w-4 h-4"}),e.jsx("span",{children:u("PRICING_PassengerBreakdown")})]}),e.jsx("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-100 space-y-3",children:l.flights[0]?.value[0]?.value[0]?.fare.map((T,p)=>{const O=T.travellerType===1?l.passengerCounts.adultCount:T.travellerType===2?l.passengerCounts.childCount:l.passengerCounts.infantCount;return O===0?null:e.jsxs("div",{className:"flex justify-between items-center text-sm",children:[e.jsxs("div",{className:"text-[#555]",children:[O,"x ",g(T.travellerType,O)]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-[#333]",children:w(T.price*O)}),e.jsx("span",{className:"text-xs text-[#888] ml-1",children:u("PRICING_PriceEach",{price:w(T.price)})})]})]},p)})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[#0ab0d8] font-dinm",children:[e.jsx(Cs,{className:"w-4 h-4"}),e.jsx("span",{children:u("PRICING_PriceBreakdown")})]}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-100 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[#555]",children:u("PRICING_BaseFare")}),e.jsx("span",{className:"text-[#333]",children:w(l.totalBaseAmount)})]}),l.totalTaxAmount>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[#555]",children:u("PRICING_TaxesFees")}),e.jsx("span",{className:"text-[#333]",children:w(l.totalTaxAmount)})]}),l.totalFuelSurcharge>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[#555]",children:u("PRICING_FuelSurcharge")}
1),e.jsx("span",{className:"text-[#333]",children:w(l.totalFuelSurcharge)})]}),l.totalServiceCharge>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[#555]",children:u("PRICING_ServiceCharge")}),e.jsx("span",{className:"text-[#333]",children:w(l.totalServiceCharge)})]}),l.taxDetails&&l.taxDetails.length>0&&e.jsxs("div",{className:"pt-2 mt-2 border-t border-gray-200 space-y-1",children:[e.jsx("div",{className:"text-xs text-[#888] font-dinm mb-1",children:u("PRICING_TaxDetails")}),l.taxDetails.map((T,p)=>e.jsxs("div",{className:"flex justify-between text-xs text-[#666]",children:[e.jsxs("span",{children:[T.taxCode," - ",T.taxDetail]}),e.jsx("span",{children:w(T.amount)})]},p))]})]})]}),l.discountDetails&&l.discountDetails.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[#58e631] font-dinm",children:[e.jsx(_s,{className:"w-4 h-4"}),e.jsx("span",{children:u("PRICING_DiscountsApplied")})]}),e.jsxs("div",{className:"bg-green-50 rounded-lg p-4 border border-green-100 space-y-2",children:[l.discountDetails.map((T,p)=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-green-700",children:T.discountDetail}),e.jsxs("span",{className:"text-green-600 font-dinm",children:["-",w(T.discountAmount)]})]},p)),l.totalDiscountAmount>0&&e.jsxs("div",{className:"flex justify-between text-sm pt-2 border-t border-green-200",children:[e.jsx("span",{className:"text-green-700 font-dinm",children:u("PRICING_TotalDiscount")}),e.jsxs("span",{className:"text-green-600 font-dinm",children:["-",w(l.totalDiscountAmount)]})]})]})]}),e.jsx("div",{className:"bg-[#0ab0d8]/5 rounded-lg p-4 border border-[#0ab0d8]/20",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[#555] font-dinm",children:u("PRICING_TotalAmount")}),e.jsxs("div",{className:"text-xs text-[#888]",children:[h," ",x," - ",R]})]}),e.jsx("div",{className:"text-right",children:e.jsx("div",{className:"text-2xl font-dinb text-[#0ab0d8]",children:w(l.totalAmount)})})]})})]})};return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),e.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-full max-w-lg mx-4 max-h-[85vh] flex flex-col animate-in fade-in zoom-in-95 duration-200",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#0ab0d8]/10 flex items-center justify-center",children:e.jsx(lt,{className:"w-5 h-5 text-[#0ab0d8]"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-dins text-[#333]",children:u("PRICING_Title")}),e.jsx("p",{className:"text-xs text-[#888]",children:u("PRICING_Subtitle")})]})]}),e.jsx("button",{onClick:r,className:"w-8 h-8 rounded-full bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:e.jsx(gt,{className:"w-4 h-4 text-[#555]"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:M()}),e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 bg-gray-50 rounded-b-xl",children:e.jsx(jt,{onClick:r,className:"w-full bg-[#0ab0d8] hover:bg-[#0891b2] text-white rounded-lg h-11",children:u("COMMON_Close")})})]})]})}function Qs({from:s,to:r,departDate:c,returnDate:o,totalPrice:l,showNext:h=!0,disabled:u=!1,tripType:_,passengerCounts:g,currency:M="EUR",flightKeys:E=[],language:w="nl",onPricingSuccess:pe,onPricingError:R,onAddFlightSuccess:x,onAddFlightError:T}){const{t:p}=wt(),{formatPrice:O}=rt(),[U,L]=a.useState(!1),[f,V]=a.useState(!1),[v,Y]=a.useState(!1),[ue,X]=a.useState(null),[Se,k]=a.useState(null),ge=a.useRef(""),z=a.useRef(null),N=_===2?2:1,se=a.useCallback(C=>[...C].sort().join(","),[]);a.useEffect(()=>{const C=se(E);ge.current!==C&&(X(null),k(null),ge.current=C)},[E,se]);const le=(g?.adultCount||0)+(g?.childCount||0)+(g?.infantCount||0),ae=a.useCallback(async()=>
1{if(E.length<N)return null;const C={tripType:_,passengerCounts:{adultCount:g?.adultCount||0,childCount:g?.childCount||0,infantCount:g?.infantCount||0},currency:M,flightKeys:E,language:w};return Ps(C)},[M,E,w,g,N,_]),ye=a.useCallback(C=>{if(z.current?.flightKeysStr===C)return z.current.promise;const S=ae().finally(()=>{z.current?.flightKeysStr===C&&(z.current=null)});return z.current={flightKeysStr:C,promise:S},S},[ae]),re=a.useCallback((C,S,oe={})=>{const{notifySuccess:F=!0,notifyError:Z=!0}=oe;if(ge.current!==S)return;if(C?.isSuccess&&C.data){X(C.data),k(null),F&&pe?.(C);return}const Ke=C?.message||p("PRICING_FetchFailed");k(Ke),Z&&R?.(Ke)},[R,pe,p]);a.useEffect(()=>{if(l===0||ue||E.length<N)return;const C=se(E);let S=!1;return(async()=>{try{const F=await ye(C);if(S)return;re(F,C,{notifySuccess:!1,notifyError:!1})}catch(F){if(S||ge.current!==C)return;const Z=F instanceof Error?F.message:p("PRICING_FetchError");k(Z)}})(),()=>{S=!0}},[re,E,se,ye,ue,N,p,l]),a.useEffect(()=>{if(!(typeof document>"u"))return document.body.classList.toggle("has-mobile-booking-summary",l>0),()=>{document.body.classList.remove("has-mobile-booking-summary")}},[l]);const Ce=async()=>{if(ue){L(!0);return}if(E.length>=N){const C=se(E);V(!0),k(null),L(!0);try{const S=await ye(C);re(S,C)}catch(S){if(ge.current!==C)return;const oe=S instanceof Error?S.message:p("PRICING_FetchError");k(oe),R?.(oe)}finally{V(!1)}}},he=async()=>{if(!(u||E.length<N)){Y(!0);try{let C=ue;const S=se(E);if(!C){const F=await ye(S);if(!F?.isSuccess){const Z=F?.message||p("PRICING_VerifyFailed");R?.(Z),Y(!1);return}F.data&&(C=F.data,re(F,S))}const oe=await ks({tripType:_,passengerCounts:{adultCount:g?.adultCount||0,childCount:g?.childCount||0,infantCount:g?.infantCount||0},currency:M,flightKeys:E,language:w});if(oe?.isSuccess&&oe?.data)ss(oe.data),x?.(oe.data);else{const F=oe?.message||p("PRICING_AddToBasketFailed");T?.(F)}}catch(C){const S=C instanceof Error?C.message:p("COMMON_UnexpectedError");T?.(S)}finally{Y(!1)}}};return l===0?null:e.jsxs(e.Fragment,{children:[e.jsx(Zs,{isOpen:U,onClose:()=>L(!1),isLoading:f,error:Se,pricingData:ue,totalPassengers:le}),e.jsx("div",{className:"fixed md:sticky bottom-0 left-0 right-0 bg-white border-t-2 border-gray-200 shadow-2xl z-40",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 md:px-6 py-3 md:py-4",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-between gap-3 md:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 md:gap-8 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 min-w-0 flex-1",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[#555] text-sm md:text-base truncate",children:s.split("(")[0].trim()}),e.jsx("div",{className:"text-[#888] text-xs",children:c})]}),e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx(ft,{className:"w-3 h-3 md:w-4 md:h-4 text-[#888]"}),e.jsx(ft,{className:"w-3 h-3 md:w-4 md:h-4 text-[#888] rotate-180 -mt-1"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[#555] text-sm md:text-base truncate",children:r.split("(")[0].trim()}),e.jsx("div",{className:"text-[#888] text-xs",children:o})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 md:w-6 md:h-6 bg-gray-200 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-xs",children:"👤"})}),e.jsx("div",{className:"text-xs md:text-sm text-[#555]",children:le||1})]}),e.jsx("button",{onClick:Ce,disabled:f,className:"flex items-center gap-1 md:gap-2 text-xs md:text-sm text-[#0ab0d8] hover:text-[#0891b2] hover:underline shrink-0 disabled:opacity-50 font-dinm",children:f?e.jsx(Et,{className:"w-3 h-3 md:w-4 md:h-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(lt,{className:"w-3 h-3 md:w-4 md:h-4"}),e.jsx("span",{className:"inline",children:p("FLIGHT_RESULTS_Details")})]})})]}),e.jsxs("div",{className:"flex items-center justify-between md:justify-end gap-4 md:gap-6",children:[e.jsxs("div",{className:"text-left md:text-right",children:[e.jsx("div",{className:"text-xs text-[#888]",children:p("FLIGHT_RESULTS_TotalAmount")}),e.jsx("div",{className:"text-xl md:text-2xl text-[#555]",children:ue?O(ue.totalAmount,ue.currencyInfo?.code||M,{minimumFractionDigits:2,maximumFractionDigits:2}):e.jsxs(e.Fragment,{children:[O(l,M,{minimumFractionDigits:2,maximumFractionDigits:2})," ",e.jsx("small",{className:"text-xs",children:p("FLIGHT_RESULTS_PerPersonShort")})]})})]}),h&&e.jsx(jt,{onClick:he,disabled:u||v,className:`rounded-full px-6 md:px-10 h-10 md:h-12 shadow-lg transition-all ${u||v?"bg-gray-300 text-gray-500 cursor-not-allowed hover:bg-gray-300 hover:shadow-lg":"bg-[#58e631] hover:bg-[#48d621] text-white hover:shadow-xl"}`,children:v?e.jsxs(e.Fragment,{children:[e.jsx(Et,{className:"w-4 h-4 md:w-5 md:h-5 mr-2 animate-spin"}),p("FLIGHTS_Processing")]}):e.jsxs(e.Fragment,{children:[p("COMMON_Next"),e.jsx(ft,{className:"w-4 h-4 md:w-5 md:h-5 ml-2"})]})})]})]})})})]})}function Xs({onSelectPackage:s,onBackToFlights:r}){const{t:c}=wt(),{formatPrice:o}=rt();a.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);
1const l=[{name:"Basic",nameKey:"PACKAGES_Basic_Name",taglineKey:"PACKAGES_Basic_Tagline",price:211,color:"#7B68EE",features:[{icon:e.jsx(St,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_HandLuggage_Title",descriptionKey:"PACKAGES_Feature_HandLuggage_Desc"},{icon:e.jsx(Ct,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_FlyingBlue_Title",descriptionKey:"PACKAGES_Feature_FlyingBlue_BasicDesc"}]},{name:"Smart",nameKey:"PACKAGES_Smart_Name",taglineKey:"PACKAGES_Smart_Tagline",price:290,color:"#0ab0d8",features:[{icon:e.jsx(St,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_HandLuggage_Title",descriptionKey:"PACKAGES_Feature_HandLuggage_Desc"},{icon:e.jsx(Gt,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_CabinBag_Title",descriptionKey:"PACKAGES_Feature_CabinBag_Desc"},{icon:e.jsx(At,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_SeatSelection_Title",descriptionKey:"PACKAGES_Feature_SeatSelection_Desc"},{icon:e.jsx(pt,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_PriorityBoarding_Title",descriptionKey:"PACKAG
1ES_Feature_PriorityBoarding_Desc"},{icon:e.jsx(Ct,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_FlyingBlue_Title",descriptionKey:"PACKAGES_Feature_FlyingBlue_SmartDesc"}]},{name:"Plus",nameKey:"PACKAGES_Plus_Name",taglineKey:"PACKAGES_Plus_Tagline",price:325,color:"#FF8C42",features:[{icon:e.jsx(St,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_HandLuggage_Title",descriptionKey:"PACKAGES_Feature_HandLuggage_Desc"},{icon:e.jsx(Gt,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_CheckedBaggage_Title",descriptionKey:"PACKAGES_Feature_CheckedBaggage_Desc"},{icon:e.jsx(At,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_SeatSelection_Title",descriptionKey:"PACKAGES_Feature_SeatSelection_Desc"},{icon:e.jsx(et,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_ChangeFlight_Title",descriptionKey:"PACKAGES_Feature_ChangeFlight_Desc"},{icon:e.jsx(Ct,{className:"w-4 h-4"}),titleKey:"PACKAGES_Feature_FlyingBlue_Title",descriptionKey:"PACKAGES_Feature_FlyingBlue_SmartDesc"}]}];return e.jsxs("div",{className:"max-w-7xl mx-auto px-4 md:px-6 py-4 md:py-8 min-h-[calc(100vh-200px)] pb-32 md:pb-8",children:[e.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-sm text-[#0ab0d8] hover:underline mb-4 md:mb-6",children:[e.jsx(Ds,{className:"w-4 h-4"}),c("PACKAGES_BackToFlights")]}),e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4 mb-6 md:mb-8",children:[e.jsx("h2",{className:"text-2xl md:text-3xl text-[#555]",children:c("PACKAGES_Title")}),e.jsxs("button",{className:"flex items-center gap-2 text-sm text-[#0ab0d8] hover:underline",children:[e.jsx(lt,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden md:inline",children:c("PACKAGES_Info")}),e.jsx("span",{className:"md:hidden",children:c("PACKAGES_InfoShort")})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-6",children:l.map(h=>e.jsxs("div",{className:"bg-white rounded-2xl border-2 overflow-hidden transition-all hover:shadow-xl flex flex-col",style:{borderColor:h.color},children:[e.jsxs("div",{className:"p-4 md:p-6",style:{backgroundColor:h.color},children:[e.jsx("h3",{className:"text-xl md:text-2xl mb-1 text-white",children:c(h.nameKey)}),e.jsx("p",{className:"text-sm text-white/90",children:c(h.taglineKey)})]}),e.jsxs("div",{className:"p-4 md:p-6 flex flex-col flex-1",children:[e.jsx("div",{className:"mb-4 md:mb-6",children:e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{className:"text-3xl md:text-4xl text-[#555]",children:o(h.price,"EUR",{maximumFractionDigits:0})}),e.jsx("span",{className:"text-sm text-[#888]",children:c("PACKAGES_PricePerPassenger")})]})}),e.jsx("div",{className:"space-y-4 mb-6 flex-1",children:h.features.map((u,_)=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-5 h-5 mt-0.5",style:{color:h.color},children:u.icon}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm text-[#555] flex items-center gap-2",children:[c(u.titleKey),e.jsx(lt,{className:"w-3 h-3 text-[#888]"})]}),e.jsx("div",{className:"text-xs text-[#888] mt-0.5",children:c(u.descriptionKey)})]})]},_))}),h.name==="Basic"&&e.jsxs("div",{className:"mb-6 p-4 bg-blue-50 rounded-xl flex gap-3",children:[e.jsx(lt,{className:"w-4 h-4 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-blue-900",children:c("PACKAGES_Basic_Info")})]}),e.jsx("button",{onClick:()=>s(h.name,h.price),className:"w-full py-3 rounded-xl border-2 hover:text-white transition-all text-center mt-auto",style:{borderColor:h.color,color:h.color},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=h.color,u.currentTarget.style.color="white"},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent",u.currentTarget.style.color=h.color},children:c("PACKAGES_Select",{name:c(h.nameKey)})})]})]},h.name))})]})}async function Xe(s){const r=Fe.getLanguageHeader(Fe.getCurrentLocale()),c=await fetch("/api/flight/search",{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":r},body:JSON.stringify(s)});return c.ok?c.json():null}const Ne=s=>{if(!s)return null;const r=s instanceof Date?s:new Date(s);if(Number.isNaN(r.getTime()))return null;const c=r.getFullYear(),o=String(r.getMonth()+1).padStart(2,"0"),l=String(r.getDate()).padStart(2,"0");return`${c}-${o}-${l}T00:00:00.000Z`},ea=s=>{const r=s instanceof Date?s:s?new Date(s):new Date,c=Number.isNaN(r.getTime())?new Date:r;return{year:c.getFullYear(),month:c.getMonth()+1}},ta=(s,r)=>({year:r===12?s+1:s,month:r===12?1:r+1}),Wt=s=>{const r=Ne(s),c=Ne(new Date);return r?c&&new Date(r).getTime()<new Date(c).getTime()?c:r:c},sa=s=>{const c=(Array.isArray(s?.data)?s.data:Array.isArray(s)?s:[]).map(l
1=>{const h=Ne(l?.departureDate??l?.flightDate??l?.date),u=typeof l?.fromPrice=="number"?l.fromPrice:typeof l?.price=="number"?l.price:0;return h?{iso:h,price:u}:null}).filter(l=>l!==null&&l.price>0),o=new Map;for(const l of c){const h=o.get(l.iso);(!h||l.price<h.price)&&o.set(l.iso,l)}return Array.from(o.values()).sort((l,h)=>new Date(l.iso).getTime()-new Date(h.iso).getTime())},Yt=async(s,r,c,o=12)=>{if(!s||!s.departurePointCode||!s.arrivalPointCode||!r)return[];const l=new Date(r).getTime();let h=ea(r);const u=[];for(let _=0;_<o;_++){const g=await fetch("/api/flight/getavailabledatesforroutewithprice",{method:"POST",headers:{"Content-Type":"application/json",...c?{"Accept-Language":c}:{}},body:JSON.stringify({departureAirportCode:s.departurePointCode,arriveAirportCode:s.arrivalPointCode,year:h.year,month:h.month})});if(g.ok){const M=await g.json().catch(()=>[]);if(u.push(...sa(M).filter(E=>new Date(E.iso).getTime()>=l)),u.length>0)break}h=ta(h.year,h.month)}return u.sort((_,g)=>new Date(_.iso).getTime()-new Date(g.iso).getTime())};function aa(){const{t:s}=tt(),r=Fe.getCurrentLocale(),c=Fe.getLanguageHeader(r),[o,l]=a.useState(null),[h,u]=a.useState(null),[_,g]=a.useState(!1),[M,E]=a.useState(!1),[w,pe]=a.useState(null),R=a.useRef(null),[x,T]=a.useState(null),[p,O]=a.useState(null),[U,L]=a.useState(!0),[f,V]=a.useState(null),[v,Y]=a.useState(!1),[ue,X]=a.useState(""),[Se,k]=a.useState(null),[ge,z]=a.useState(!1),N=a.useRef(new Set),se=(n,i)=>{if(!n||!i)return 0;const y=new Date(n),j=new Date(i);return y.getTime()-j.getTime()},le=(n,i)=>se(n,i)>0,ae=(n,i)=>se(n,i)<0,ye=async n=>{if(!x)return;const i=n.outboundIso?Ne(n.outboundIso):Ne(x.flights[0]?.flightDate),y=n.inboundIso!==void 0?Ne(n.inboundIso):x.tripType===2?Ne(x.flights[1]?.flightDate):null;if(x.tripType===2&&i&&y&&le(i,y)){k({key:"departAfterReturn",message:s("FLIGHT_RESULTS_DepartAfterReturn")});return}if(x.tripType===2&&y&&i&&ae(y,i)){k({key:"returnBeforeDepart",message:s("FLIGHT_RESULTS_ReturnBeforeDepart")});return}k(null);const j=[...x.flights];i&&j[0]&&(j[0]={...j[0],flightDate:q(i)}),x.tripType===2&&y&&j[1]&&(j[1]={...j[1],flightDate:q(y)});const b={...x,flights:j};L(!0);try{const K=await Xe(b);K?.isSuccess?(O(K),T(b),l(null),u(null)):V(F(K))}catch(K){V(K instanceof Error?K.message:s("FLIGHT_RESULTS_ErrorSearching"))}finally{L(!1)}},re=()=>{const n=[];if(o){const i=W(me,o);i?.flightKey&&n.push(i.flightKey)}if(h){const i=W(je,h);i?.flightKey&&n.push(i.flightKey)}return n},Ce=()=>{if(x?.tripType===1){if(!o)return!1}else if(!o||!h||!$e(me,je,o,h).valid)return!1;return!0},he=n=>{X(n),Y(!0)},C=async n=>{const i=mt(`/travellers?basketId=${encodeURIComponent(n)}`,Fe.getCurrentLocale());await ds(i)},S=n=>{X(n),Y(!0)},oe=(n,i)=>{pe({name:n,price:i})},F=n=>{const i=n?.message;return typeof i=="string"&&(i.includes("HTTP status code")||i.includes("requested route is not available"))?s("FLIGHT_RESULTS_FailedSearch"):i||s("FLIGHT_RESULTS_FailedSearch")},Z=async n=>{const i=Wt(n.flights[0]?.flightDate),j=(await Yt(n.flights[0],i,c))[0]?.iso;if(!j)return null;const b=[...n.flights];if(b[0]={...b[0],flightDate:q(j)},n.tripType===2&&b[1]){const t=Wt(b[1].flightDate),m=t&&le(j,t)?j:t,H=(await Yt(b[1],m,c))[0]?.iso;if(!H)return null;b[1]={...b[1],flightDate:q(H)}}const K={...n,flights:b},te=await Xe(K);return te?.isSuccess?{searchData:K,response:te,adjustedDateIso:j}:null};a.useEffect(()=>{(async()=>{try{const i=new URLSearchParams(window.location.search),y=i.get("search"),j=(i.get("openMonthlyOverview")||"").toLowerCase();if(z(j==="1"||j==="true"||j==="yes"),!y){V(s("FLIGHT_RESULTS_NoSearchData")),L(!1);return}let K;try{const m=atob(decodeURIComponent(y));K=JSON.parse(m)}catch{V(s("FLIGHT_RESULTS_InvalidSearchParams")),L(!1);return}T(K);const te=await Xe(K),t=(te?.data?.flights||[]).flatMap(m=>nt(m,s));if(Ms(t,K?.passengerCounts,Re),te?.isSuccess)O(te);else{const m=await Z(K);if(m){T(m.searchData),O(m.response),l(null),u(null);const D=btoa(JSON.stringify(m.searchData)),H=mt(`/flightresults?search=${encodeURIComponent(D)}`,Fe.getCurrentLocale());window.history.replaceState({},"",H),X(s("FLIGHT_RESULTS_DateAdjustedToFirstAvailable",{date:Ae(m.adjustedDateIso)})),Y(!0)}else V(F(te))}}catch(i){V(i instanceof Error?i.message:s("FLIGHT_RESULTS_ErrorSearching"))}finally{L(!1)}})()},[]),a.useEffect(()=>{const n=x?.tripType===1;
1if(Ce())if(n){const i=W(me,o);Ut([i],x?.passengerCounts,Re)}else{const i=W(me,o),y=W(je,h);Ut([i,y],x?.passengerCounts,Re)}},[o,h]);const Ie=x?.tripType===1?o:o&&h,_e=n=>{try{return new Date(n).toLocaleDateString(c,{weekday:"short",day:"numeric",month:"short"})}catch{return n}},Ae=n=>{try{return new Date(n).toLocaleDateString(c,{year:"numeric",month:"long",day:"numeric"})}catch{return n}},Oe=()=>{if(!x)return`1 ${s("FLIGHT_TRAVELER_Adult")}`;const{adultCount:n,childCount:i,infantCount:y}=x.passengerCounts,j=[];return n>0&&j.push(`${n} ${s(n!==1?"FLIGHT_TRAVELER_Adults":"FLIGHT_TRAVELER_Adult")}`),i>0&&j.push(`${i} ${s(i!==1?"FLIGHT_TRAVELER_Children":"FLIGHT_TRAVELER_Child")}`),y>0&&j.push(`${y} ${s(y!==1?"FLIGHT_TRAVELER_Infants":"FLIGHT_TRAVELER_Infant")}`),j.join(", ")},W=(n,i)=>i&&n.find(y=>y.id===i)||null,Ue=n=>{const[i,y]=n.split(":").map(Number);return i*60+y},$e=(n,i,y,j)=>{if(!y||!j)return{valid:!0};if(!x)return{valid:!0};const b=W(n,y),K=W(i,j);if(!b||!K)return{valid:!0};const te=Ne(x.flights[0]?.flightDate),t=Ne(x.flights[1]?.flightDate);if(!te||!t)return{valid:!0};const m=b.arriveTime,D=K.departTime,H=180,G=H*60*1e3,ve=s("FLIGHT_RESULTS_ReturnAfterOutbound",{returnTime:D,outboundTime:m}),Q=new Date(b.arrivalDateTime||b.routeKey?.arriveDate),He=new Date(K.departureDateTime||K.routeKey?.departureDate);if(Number.isFinite(Q.getTime())&&Number.isFinite(He.getTime())&&He.getTime()-Q.getTime()<G)return{valid:!1,message:ve};if(te===t){const Tt=Ue(m);if(Ue(D)<Tt+H)return{valid:!1,message:ve}}return{valid:!0}},me=a.useMemo(()=>nt(p?.data?.flights?.[0],s),[p,s]),je=a.useMemo(()=>x?.tripType===2?nt(p?.data?.flights?.[1],s):[],[p,x?.tripType,s]),ee=a.useMemo(()=>{let n=0;if(o){const i=W(me,o);i?.price&&(n+=i.price)}if(h){const i=W(je,h);i?.price&&(n+=i.price)}return n},[o,h,me,je]),Re=w?ee+w.price:Ie?ee:0,be=n=>{if(h&&x?.tripType===2){const i=$e(me,je,n,h);if(!i.valid){X(i.message||s("FLIGHT_RESULTS_InvalidCombination")),Y(!0);return}}l(n),setTimeout(()=>{if(R.current){const j=R.current.getBoundingClientRect().top+window.pageYOffset-100;window.scrollTo({top:j,behavior:"smooth"})}},300)},I=n=>{if(o){const i=$e(me,je,o,n);if(!i.valid){X(i.message||s("FLIGHT_RESULTS_InvalidCombination")),Y(!0);return}}u(n)},P=n=>{if(!n?.key?.flightDate)return[];try{const i=new Date(n.key.flightDate),y=i.toLocaleDateString(c,{day:"numeric",month:"short"}),j=i.toLocaleDateString(c,{weekday:"short"});let b=1/0;return n.value?.forEach(K=>{K.value?.forEach(te=>{const m=te.fare.find(D=>D.travellerType===1)?.price||te.subTotal||0;m<b&&(b=m)})}),[{date:y,dayOfWeek:j,price:b===1/0?0:b,selected:!0,iso:i.toISOString()}]}catch{return[]}},q=n=>{const i=new Date(n);if(Number.isNaN(i.getTime()))return"";const y=i.getFullYear(),j=String(i.getMonth()+1).padStart(2,"0"),b=String(i.getDate()).padStart(2,"0");return`${y}-${j}-${b}`},De=(n,i)=>{const y=new Date(i).getTime();for(const j of n)if(new Date(j).getTime()>=y)return Ne(j);return null},ne=(n,i)=>{const y=new Date(i).getTime();let j=null;for(const b of n)if(new Date(b).getTime()<=y)j=Ne(b);else break;return j},xe=(n,i)=>{const y=new Date(i).getTime(),j=[...n].sort((b,K)=>new Date(b).getTime()-new Date(K).getTime());for(const b of j)if(new Date(b).getTime()>y)return Ne(b);return null},Pe=async(n,i,y,j)=>{if(!x)return;const b=[...x.flights],K=n==="outbound"?0:1;if(!b[K])return;const te=Ne(i);if(!te)return!1;const t=Ne(x.flights[0]?.flightDate),m=x.tripType===2?Ne(x.flights[1]?.flightDate):null;if(x.tripType===2){if(n==="outbound"&&m&&le(te,m)){const G=De(j||[],te);if(G){b[0]={...b[0],flightDate:q(te)},b[1]={...b[1],flightDate:q(G)},k(null);const ve={...x,flights:b};L(!0);try{const Q=await Xe(ve);return Q?.isSuccess?(O(Q),T(ve),l(null),u(null),!0):(V(F(Q)),!1)}catch(Q){return V(Q instanceof Error?Q.message:s("FLIGHT_RESULTS_ErrorSearching")),!1}finally{L(!1)}}else return k({key:"departAfterReturn",message:s("FLIGHT_RESULTS_No
1ReturnAfterDeparture")}),!1}if(n==="inbound"&&t&&ae(te,t)){const G=ne(y||[],te);if(G){b[0]={...b[0],flightDate:q(G)},b[1]={...b[1],flightDate:q(te)},k(null);const ve={...x,flights:b};L(!0);try{const Q=await Xe(ve);return Q?.isSuccess?(O(Q),T(ve),l(null),u(null),!0):(V(F(Q)),!1)}catch(Q){return V(Q instanceof Error?Q.message:s("FLIGHT_RESULTS_ErrorSearching")),!1}finally{L(!1)}}else return k({key:"returnBeforeDepart",message:s("FLIGHT_RESULTS_NoDepartureBeforeReturn")}),!1}}k(null);const D=q(te);if(!D)return!1;b[K]={...b[K],flightDate:D};const H={...x,flights:b};L(!0);try{const G=await Xe(H);return G?.isSuccess?(O(G),T(H),n==="inbound"||l(null),u(null),!0):(V(F(G)),!1)}catch(G){return V(G instanceof Error?G.message:s("FLIGHT_RESULTS_ErrorSearching")),!1}finally{L(!1)}},J=p?.data?.flights?.[0],B=x?.tripType===2&&p?.data?.flights?.[1]?p.data.flights[1]:null,ke=J?.key?.departurePointCode||J?.value?.[0]?.key?.departureAirportCode||x?.flights?.[0]?.departurePointCode||"",Qe=J?.key?.arrivalPointCode||J?.value?.[0]?.key?.arrivalAirportCode||x?.flights?.[0]?.arrivalPointCode||"",Ye=B?.key?.departurePointCode||B?.value?.[0]?.key?.departureAirportCode||x?.flights?.[1]?.departurePointCode||"",Ge=B?.key?.arrivalPointCode||B?.value?.[0]?.key?.arrivalAirportCode||x?.flights?.[1]?.arrivalPointCode||"",{dates:d,isLoading:$,fetchMonth:ie}=bt({departureAirportCode:ke||void 0,arriveAirportCode:Qe||void 0,initialDate:x?.flights?.[0]?.flightDate,locale:x?.language}),{dates:fe,fetchMonth:ce}=bt({departureAirportCode:Ye||void 0,arriveAirportCode:Ge||void 0,initialDate:x?.flights?.[1]?.flightDate,locale:x?.language}),de=a.useMemo(()=>d.filter(n=>n.price>0).map(n=>n.iso),[d]),A=a.useMemo(()=>fe.filter(n=>n.price>0).map(n=>n.iso),[fe]),we=Ne(x?.flights?.[0]?.flightDate),We=x?.tripType===2?Ne(x?.flights?.[1]?.flightDate):null;if(a.useEffect(()=>{if(U||!x||!p?.isSuccess)return;const n=(i,y,j)=>{if(!y)return!1;if(j.length>0)return N.current.forEach(t=>{t.startsWith(`${i}|`)&&N.current.delete(t)}),!1;const b=i==="outbound"?de:A,K=`${i}|${y}|${b.join(",")}`;if(N.current.has(K))return!1;const te=xe(b,y);return te?(N.current.add(K),Pe(i,te,de,A),!0):!1};n("outbound",we,me)||x.tripType===2&&n("inbound",We,je)},[U,x,p?.isSuccess,we,We,me,je,de,A]),U)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-[#0ab0d8] mx-auto mb-4"}),e.jsx("p",{className:"text-[#555]",children:s("FLIGHT_RESULTS_Searching")})]})});if(f)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-red-600 mb-4",children:f}),e.jsx("button",{onClick:()=>{window.location.href="/"},className:"px-6 py-2 bg-[#0ab0d8] text-white rounded-lg hover:bg-[#0891b2] transition-colors",children:s("FLIGHT_RESULTS_StartNewSearch")})]})});if(!p||!x)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-[#555] mb-4",children:s("FLIGHT_RESULTS_No
1Results")}),e.jsx("button",{onClick:()=>{window.location.href="/"},className:"px-6 py-2 bg-[#0ab0d8] text-white rounded-lg hover:bg-[#0891b2] transition-colors",children:s("FLIGHT_RESULTS_StartNewSearch")})]})});const Be=J?.value?.[0]?.key?.departureCityName?`${J.value[0].key.departureCityName} (${J.value[0].key.departureAirportCode})`:x.flights[0]?.departurePointCode||s("COMMON_NotAvailable"),Le=J?.value?.[0]?.key?.arrivalCityName?`${J.value[0].key.arrivalCityName} (${J.value[0].key.arrivalAirportCode})`:x.flights[0]?.arrivalPointCode||s("COMMON_NotAvailable"),ot=J?.key?.flightDate?_e(J.key.flightDate):_e(x.flights[0].flightDate),ct=J?.key?.flightDate?Ae(J.key.flightDate):Ae(x.flights[0].flightDate),Te=B?.value?.[0]?.key?.departureCityName?`${B.value[0].key.departureCityName} (${B.value[0].key.departureAirportCode})`:B?.key?.departurePointCode||s("COMMON_NotAvailable"),Ve=B?.value?.[0]?.key?.arrivalCityName?`${B.value[0].key.arrivalCityName} (${B.value[0].key.arrivalAirportCode})`:B?.key?.arrivalPointCode||s("COMMON_NotAvailable"),Me=B?.key?.flightDate?_e(B.key.flightDate):B?_e(x.flights[1]?.flightDate||""):"",qe=B?.key?.flightDate?Ae(B.key.flightDate):B?Ae(x.flights[1]?.flightDate||""):"";return e.jsxs("div",{children:[e.jsx(Gs,{currentStep:"flightresults"}),e.jsx("main",{className:"flex-1 w-full pb-32 md:pb-0",children:_?e.jsx(Xs,{onSelectPackage:oe,onBackToFlights:()=>g(!1)}):e.jsxs("div",{className:"max-w-7xl mx-auto px-4 md:px-6 py-4 md:py-8",children:[e.jsx(Hs,{from:Be,to:Le,departDate:ot,returnDate:Me,passengers:Oe(),onEditClick:()=>E(!M),isSearchOpen:M}),e.jsx(Us,{isOpen:M,searchData:x,onSearch:async n=>{L(!0),V(null),k(null);try{const i=await Xe(n);if(i?.isSuccess){O(i),T(n),l(null),u(null),E(!1);const y=btoa(JSON.stringify(n)),j=mt(`/flightresults?search=${encodeURIComponent(y)}`,Fe.getCurrentLocale());window.history.replaceState({},"",j)}else{const y=await Z(n);if(y){O(y.response),T(y.searchData),l(null),u(null),E(!1);const j=btoa(JSON.stringify(y.searchData)),b=mt(`/flightresults?search=${encodeURIComponent(j)}`,Fe.getCurrentLocale());window.history.replaceState({},"",b),X(s("FLIGHT_RESULTS_DateAdjustedToFirstAvailable",{date:Ae(y.adjustedDateIso)})),Y(!0)}else V(F(i))}}catch(i){V(i instanceof Error?i.message:s("FLIGHT_RESULTS_ErrorSearching"))}finally{L(!1)}}}),e.jsxs("div",{className:"mt-6 md:mt-8 space-y-6 md:space-y-8",children:[Se&&e.jsx(es,{title:s("FLIGHT_RESULTS_DatesDontMatch"),message:Se.message,onClose:()=>k(null)}),e.jsx(Vt,{direction:"outbound",title:s("FLIGHT_RESULTS_OutboundTitle"),from:Be,to:Le,selectedFlight:o,onSelectFlight:be,onSelectionInvalidated:n=>{l(i=>i===n?null:i)},flights:nt(J,s),dates:P(J),currency:p.data.currency,tripType:x.tripType===2?2:1,routeDepartureC
1ode:J?.key?.departurePointCode||J?.value?.[0]?.key?.departureAirportCode||"",routeArrivalCode:J?.key?.arrivalPointCode||J?.value?.[0]?.key?.arrivalAirportCode||"",initialDate:J?.key?.flightDate||x.flights[0]?.flightDate||"",selectedDateIso:we||void 0,pairedSelectedDateIso:We||null,openMonthlyOverviewOnLoad:ge,onMonthlyOverviewAutoOpened:()=>z(!1),onInvalidSelection:({reason:n})=>{n==="unavailable"&&k({key:"departAfterReturn",message:s("FLIGHT_RESULTS_NoFlightsOnDate")})},availableDatesWithPrice:d,availableDatesWithPriceInbound:fe,fetchAvailableOutboundMonth:ie,fetchAvailableInboundMonth:ce,onMonthlyConfirm:({outboundIso:n,inboundIso:i})=>{ye({outboundIso:n,inboundIso:i})},availableDatesLoading:$,onDateChange:n=>Pe("outbound",n,de,A)}),B&&e.jsx("div",{ref:R,children:e.jsx(Vt,{direction:"inbound",title:s("FLIGHT_RESULTS_InboundTitle"),from:Te,to:Ve,selectedFlight:h,onSelectFlight:I,onSelectionInvalidated:n=>{u(i=>i===n?null:i)},flights:nt(B,s),dates:P(B),currency:p.data.currency,tripType:x.tripType===2?2:1,routeDepartureCode:B?.key?.departurePointCode||B?.value?.[0]?.key?.departureAirportCode||"",routeArrivalCode:B?.key?.arrivalPointCode||B?.value?.[0]?.key?.arrivalAirportCode||"",initialDate:B?.key?.flightDate||x.flights[1]?.flightDate||"",selectedDateIso:We||void 0,pairedSelectedDateIso:we||null,availableDatesWithPrice:fe,availableDatesWithPriceInbound:d,fetchAvailableOutboundMonth:ce,fetchAvailableInboundMonth:ie,onMonthlyConfirm:({outboundIso:n,inboundIso:i})=>{ye({outboundIso:n,inboundIso:i})},onInvalidSelection:({reason:n})=>{n==="unavailable"&&k({key:"returnBeforeDepart",message:s("FLIGHT_RESULTS_NoFlightsOnDate")})},onDateChange:n=>Pe("inbound",n,de,A)})}),Re>0&&e.jsx("div",{role:"status","aria-live":"polite",className:"flex items-start gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 text-sm leading-snug text-gray-900 shadow-sm",children:e.jsx("p",{children:s("FLIGHT_RESULTS_PriceChangeNotice")})})]})]})}),e.jsx(Qs,{from:Be,to:Le,departDate:ct,returnDate:qe,totalPrice:Re,showNext:!_,disabled:!Ce(),tripType:x?.tripType,passengerCounts:x?.passengerCounts,currency:"EUR",flightKeys:re(),language:x?.language||"nl",onPricingError:he,onAddFlightSuccess:C,onAddFlightError:S}),e.jsx(as,{open:v,onOpenChange:Y,children:e.jsxs(rs,{children:[e.jsxs(ns,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-red-100 flex items-center justify-center",children:e.jsx(Zt,{className:"w-5 h-5 text-red-600"})}),e.jsx("div",{className:"flex-1",children:e.jsx(is,{children:s("COMMON_Error")})})]}),e.jsx(ls,{className:"pt-2",children:ue})]}),e.jsx(os,{children:e.jsx(cs,{onClick:()=>Y(!1),children:s("COMMON_Close")})})]})})]})}const ra=Object.freeze(Object.defineProperty({__proto__:null,default:aa},Symbol.toStringTag,{value:"Module"}));function na(s){const o=s.data?.resolver?.relationTypeData?.[0]?.mainData?.name;return o?`${o} | ${yt.PAGE_TITLE}`:`${Qt.t("FLIGHT_RESULT_PAGE_Title")} | ${yt.PAGE_TITLE}`}const ia=Object.freeze(Object.defineProperty({__proto__:null,default:na},Symbol.toStringTag,{value:"Module"}));function la(s){const o=s.data?.resolver?.relationTypeData?.[0]?.mainData?.name;return o?`${o} - ${yt.PAGE_TITLE}`:`${Qt.t("FLIGHT_RESULT_PAGE_Description")} - ${yt.PAGE_TITLE}`}const oa=Object.freeze(Object.defineProperty({__proto__:null,default:la},Symbol.toStringTag,{value:"Module"})),Da={hasServerOnlyHook:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!0}},isClientRuntimeLoaded:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!0}},onBeforeRenderEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:{server:!0}}},dataEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:{server:!0}}},guardEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},onRenderClient:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/__internal/integration/onRenderClient",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:fs}},onPageTransitionStart:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+onPageTransitionStart.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:hs}},onPageTransitionEnd:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+onPageTransitionEnd.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:xs}},Page:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/flightresults/+Page.tsx",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:ra}},hydrationCanBeAborted:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/config",fileExportPathToShowToUser:["default","hydrationCanBeAborted"]},valueSerialized:{type:"js-serialized",value:!0}},hooksTimeout:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+config.ts",fileExportPathToShowToUser:["default","hooksTimeout"]}
1,valueSerialized:{type:"js-serialized",value:{data:{warning:!1,error:18e4},onBeforeRender:{warning:!1,error:18e4}}}},Layout:{type:"cumulative",definedAtData:[{filePathToShowToUser:"/layouts/LayoutDefault.tsx",fileExportPathToShowToUser:[]}],valueSerialized:[{type:"pointer-import",value:ms}]},title:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/flightresults/+title.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:ia}},description:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/flightresults/+description.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:oa}},Loading:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/__internal/integration/Loading",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:us}}};export{Da as configValuesSerialized};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.