1import{m as G,aP as H,h as Q,j as M,aX as k}from"./aBjaZyYQ.js";import{v as z}from"./CDehoY5L.js";import{u as L,a as W,b as X}from"./BNE2knIm.js";import{u as $}from"./DMypR4d9.js";import{a as y,R as h,O as J,I as K,Q as Z}from"./DAo4WDwj.js";import{a as b}from"./DeT3lEPd.js";import"./CQZfpJoo.js";import"./Cjwtk18B.js";import"./Ca1YijxP.js";import"./QOlYnoou.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"3db4da8d001cbae0206e235f3b625fa02198578d"}}catch{}})();try{(function(){var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new o.Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="4d380d3a-4749-48e0-956f-1a7e5c27f6a7",o._sentryDebugIdIdentifier="sentry-dbid-4d380d3a-4749-48e0-956f-1a7e5c27f6a7")})()}catch{}const ee=()=>{const o=G(),s=H(),r=(e,t,n)=>{const{originCode:a,originType:i,origin_type:d,destinCode:c,destinType:T,destin_type:w,origin:R,destin:_,numAdt:C,numadt:Y,numChd:P,numchd:S,numInf:j,numinf:B,numYth:V,numyth:q,tripType:u,sref:v,upsltab:F}=e;(a||R)&&(t.origin=a||R),(i||d)&&(t.originType=i||d),(c||_)&&(t.destin=c||_),(T||w)&&(t.destinType=T||w),v&&(t.sref=v),F&&(t.upsltab=F,t.showPrices=F!=="BUS");const p=V??q;if(typeof p=="number"){const D=p>0;n.youngAdultsAvailable=D,D&&(n.selectConfig.adults.min=0,n.selected.adults=0)}const A=C??Y,E=P??S,N=j??B;n.selected={...n.selected,...A!=null&&{adults:A},...E!=null&&{children:E},...N!=null&&{infants:N},...p!=null&&{youngAdults:p}},[y,h].includes(u)||console.warn(`Unexpected tripType "${u}", defaulting to RETURN`),u===y&&(t.currentFlightType=J),t.currentFlightMode=u===y?y:h},l=(e,t,n)=>{const i=t?(e.selectedStartDate=t,s(t).format(b)):n?s().add(n,"months").format(b):null;i&&(e.selectedMonth=i)},m=async(e,t,n,a,i)=>{try{await e.getOutboundFlights()}catch(d){console.error("Failed to fetch outbound flights:",d)}if(n===h&&i){const d=s(a).format(b);t.selectedMonth=d,t.selectedStartDate=a,t.selectedEndDate=i,t.currentFlightType=K,t.currentFlightMode=h;try{await e.getInboundFlights(a)}catch(c){console.error("Failed to fetch inbound flights:",c)}}e.hasFetchedFlights=!0},f=(e,t,n)=>{t!=null&&t.length&&(e.vouchers=t,e.forceOpen=!!n)},g=(e,t,n,a)=>{t&&(e.errorCodes=t),n&&(e.errorTexts=n),a&&(e.errorRef=a)},O=async e=>{if(!e){console.warn("No FSF data received from client or data is undefined");return}await U(e)},x=async()=>{var e;(e=o.ssrContext)==null||e.event.context.fsfDataResponse;{console.warn("No FSF data received from SSR context");return}},U=async e=>{const t=L(),n=W(),a=$(),i=X();r(e,t,n),l(t,e.departureDate,e.selectedMonth),await m(a,t,e.tripType,e.departureDate,e.returnDate),f(i,e.eVoucher,e.eVoucherError),g(t,e.errorCodes,e.errorTexts,e.errorRef)};return{applyFSFResponse:x,applyFSFGetData:O}};let I=!1;const te=o=>Z.some(s=>!!o[s]),pe=Q(async o=>{let s,r;if(I)return;const l=o.query;if(!te(l))return;I=!0;const m={...l},f=z(m),{applyFSFGetData:g}=ee();[s,r]=M(()=>g(f)),await s,r(),[s,r]=M(()=>k(o)),await s,r()});export{pe as default}; 2//# sourceMappingURL=Clo1q1aq.js.map
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.