1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,818014,e=>{"use strict";var r=e.i(854838),t=e.i(586838),a=e.i(34919),n=e.i(484086),i=e.i(822315),o=e.i(942466),s=e.i(640548),c=e.i(253828),u=e.i(769826),d=e.i(36389);let m=e=>{if(!e)return null;let r=e.trim();if(!r)return null;let t=r.match(/\/Date\((\d+)\)\//);if(t){let e=new Date(Number(t[1]));return Number.isNaN(e.getTime())?null:e.toISOString()}let a=new Date(r);return Number.isNaN(a.getTime())&&(a=new Date(r.replace(/([+-]\d{2}):(\d{2})$/,"$1$2"))),Number.isNaN(a.getTime())?null:a.toISOString()},l=e=>null==e||""===e?null:"ST_"+("0000000"+e).slice(-7),p=e=>null==e||0===e?null:"OP_"+("0000000"+e).slice(-7),g=e=>null==e||0===e?null:e.toString(),v=()=>"arrival"===new URLSearchParams(window.location.search).get("type"),y=()=>new URLSearchParams(window.location.search).get("prepurchaseId"),E=e=>{let r=e?.departureDate,t=e?.returnDate,a=e=>{if(!e)return null;if("object"==typeof e&&"function"==typeof e.isSame&&"function"==typeof e.isBefore)return e;if("string"==typeof e||e instanceof Date){let r=(0,i.default)(e);return r.isValid()?r:null}return null},n=a(r),o=a(t);return!(!n||!o||n.isSame(o)||o.isBefore(n))};function h(e){try{return decodeURI(e)}catch{return e}}let I=async(e,i,p,g,I)=>{try{if(v())return;let k=(0,u.toTrexIsoCurrency)(p),f=m((0,t.formatSearchDetailsDateForBookawayEvent)(e.departureDate)),C=m((0,t.formatSearchDetailsDateForBookawayEvent)(e.returnDate)),T=l(e.destination.id),S=l(e.departure.id),D=E(e),w={ToStationId:T,FromStationId:S,DateDeparture:f,DateReturn:C,IsReturn:D,PriceMin:((e,t)=>{try{let r=0;return e.forEach(e=>{let a=(0,u.findTrexQuotation)(e.Cotizacion,t);void 0!==a&&(0===r||a<r)&&(r=a)}),r}catch(e){return(0,r.trackingUnexpectedError)(e),0}})(i,p),PriceMax:((e,t)=>{try{let r=0;return e.forEach(e=>{let a=(0,u.findTrexQuotation)(e.Cotizacion,t);void 0!==a&&a>r&&(r=a)}),r}catch(e){return(0,r.trackingUnexpectedError)(e),0}})(i,p),NumOfTrips:i.length,NumOfAvailableTrips:(e=>{try{let r=0;return e.forEach(e=>{e.Butacas>=1&&!(0,t.isServiceDeparted)(e.FechaSalida)&&(r+=1)}),r}catch(e){return(0,r.trackingUnexpectedError)(e),0}})(i),Passengers:e.passengers,SearchOperatorIds:(e=>{try{let r=new Set;return e.forEach(e=>{let t=e.IdProveedor;null!=t&&r.add(String(t))}),Array.from(r)}catch(e){return(0,r.trackingUnexpectedError)(e),null}})(i),NumTransportationTypes:1,PageUrl:h(window.location.href),PageTitle:"u">typeof document?document.title:"",PageName:"supplier_page",PageCategory:"funnel",NumLastSeatsTrips:0},R=e=>e&&Array.isArray(e)?e.reduce((e,r)=>r&&r.Servicios&&Array.isArray(r.Servicios)?e.concat(r.Servicios):e,[]):[],P=i||[];(!i||0===i.length)&&g&&(P=[...R(g.servicesWithOriginalDeparture),...R(g.servicesWithOriginalArrival),...R(g.servicesWithOthersDepartureAndArrival)]);let _=I?(0,s.getCombinationsTrexMetrics)(I.internas,k===u.BRL_ISO_CODE?d.currencyValues.RS:k):null;if(P?.length>0){let e=P.reduce((e,r)=>{let t=(0,u.findTrexQuotation)(r.Cotizacion,p);return void 0===t?e:Math.min(e,t)},1/0),r=P.reduce((e,r)=>{let t=(0,u.findTrexQuotation)(r.Cotizacion,p);return void 0===t?e:Math.max(e,t)},0),a=P.length||0,n=P.filter(e=>e.Butacas>=1&&!(0,t.isServiceDeparted)(e.FechaSalida)).length,i=P.filter(e=>e.Butacas>=1&&e.Butacas<=5).length;_&&_.numOfTrips>0&&(_.priceMin>0&&(e=Math.min(e,_.priceMin)),r=Math.max(r,_.priceMax),a+=_.numOfTrips,n+=_.numOfAvailableTrips,i+=_.numLastSeatsTrips,w.SearchOperatorIds=Array.from(new Set([...w.SearchOperatorIds??[],..._.searchOperatorIds]))),w.PriceMin=Number.isFinite(e)?e:0,w.PriceMax=r,w.NumOfTrips=a,w.NumOfAvailableTrips=n,w.NumLastSeatsTrips=i}else _&&(w.PriceMin=_.priceMin,w.PriceMax=_.priceMax,w.NumOfTrips=_.numOfTrips,w.NumOfAvailableTrips=_.numOfAvailableTrips,w.NumLastSeatsTrips=_.numLastSeatsTrips,w.SearchOperatorIds=_.searchOperatorIds);await (0,o.ensureTrackingIds)();let b=await (0,n.getSessionCookie)(),N=await (0,n.getUserVisitorCookie)(),A=await (0,n.getLoginTokenForBFF)(),x={EventName:"search_load",PrePurchaseId:y(),ReturnTrip:v(),VisitorId:N,SessionId:b,Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:w,Experiments:null,TokenSSO:A,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0,Currency:k??void 0};await a.default.sendSearchTripsEvent(x)}catch(e){(0,r.trackingUnexpectedError)(e)}},k=async(e,t,i,s)=>{try{if(v())return;let r=m(t.FechaSalida),u=m(t.FechaLlegada),d=l(s),I=l(i),k=E(e),f={ToStationId:d,FromStationId:I,IsReturn:k,SupplierId:g(t.IdProveedorTransportista),OperatorId:p(t.IdProveedor),DateDeparture:r,DateReturn:u,PageUrl:h(window.location.href),PageName:"seat_selection",PageCategory:"funnel",NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let C=await (0,n.getSessionCookie)(),T=await (0,n.getUserVisitorCookie)(),S={EventName:"purchase_flow_seat_selection",PrePurchaseId:y(),VisitorId:T,SessionId:C,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:f,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendChooseSeatsEvent(S)}catch(e){(0,r.trackingUnexpectedError)(e)}},f=async(e,t,i)=>{try{let r=m(i?.departure?.departureDate??null),s=m(i?.return?.departureDate??null),u=l(t.destino.id.toString()),d=l(t.origen.id.toString()),v={ToStationId:u,FromStationId:d,IsReturn:e,SupplierId:g(t.transportista.idProveedor),OperatorId:p(t.proveedor.idProveedor),DateDeparture:r,DateReturn:s,PageUrl:h(window.location.href),PageName:"passenger_identification",PageCategory:"funnel",NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let E=await (0,n.getSessionCookie)(),I=await (0,n.getUserVisitorCookie)(),k={EventName:"purchase_flow_passengers_identification",PrePurchaseId:y(),VisitorId:I,SessionId:E,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:v,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendPassengerIdentificationEvent(k)}catch(e){(0,r.trackingUnexpectedError)(e)}},C=async e=>{try{if(null==e)return;let r=m(e.departureDate+""),t=m(e.departureReturnDate),i=e.isRoundTrip,s=l(e.departureIdPadDestino),u=l(e.departureIdPadOrigen),d=g(e.departureSupplierId),v=p(e.departureOperatorId),E={ToStationId:s,FromStationId:u,IsReturn:i,SupplierId:d,OperatorId:v,DateDeparture:r,DateReturn:t,PageName:"checkout",PageCategory:"funnel",PageUrl:h(window.location.href),NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let I=await (0,n.getSessionCookie)(),k=await (0,n.getUserVisitorCookie)(),f={EventName:"purchase_flow_general_payment_info",PrePurchaseId:y(),VisitorId:k,SessionId:I,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:E,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendCheckoutPageEvent(f)}catch(e){(0,r.trackingUnexpectedError)(e)}},T=async e=>{try{if(null==e)return;let r=m(e.departureDate+""),t=m(e.departureReturnDate),i=e.isRoundTrip,s=l(e.departureIdPadDestino),u=l(e.departureIdPadOrigen),d=g(e.departureSupplierId),v=p(e.departureOperatorId),y={ToStationId:s,FromStationId:u,IsReturn:i,SupplierId:d,OperatorId:v,DateDeparture:r,DateReturn:t,PageName:"booking_status",PageCategory:"funnel",PageUrl:h(window.location.href),NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let E=await (0,n.getSessionCookie)(),I=await (0,n.getUserVisitorCookie)(),k={EventName:"purchase_flow_booking_status_confirmed",PrePurchaseId:e.prepurchaseId,VisitorId:I,SessionId:E,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:y,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendSuccessPurchaseEvent(k)}catch(e){(0,r.trackingUnexpectedError)(e)}},S=async e=>{try{if(null==e)return;let r=m(e.departureDate+""),t=m(e.departureReturnDate),i=e.isRoundTrip,s=l(e.departureIdPadDestino),u=l(e.departureIdPadOrigen),d=g(e.departureSupplierId),v=p(e.departureOperatorId),y={ToStationId:s,FromStationId:u,IsReturn:i,SupplierId:d,OperatorId:v,DateDeparture:r,DateReturn:t,PageName:"booking_status",PageCategory:"funnel",PageUrl:h(window.location.href),NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let E=await (0,n.getSessionCookie)(),I=await (0,n.getUserVisitorCookie)(),k={EventName:"purchase_flow_booking_status_not_confirmed",PrePurchaseId:e.prepurchaseId,VisitorId:I,SessionId:E,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:y,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendPurchaseNotConfirmedEvent(k)}catch(e){(0,r.trackingUnexpectedError)(e)}},D=async e=>{try{if(null==e)return;let r=m(e.departureDate+""),t=m(e.departureReturnDate),i=e.isRoundTrip,s=l(e.departureIdPadDestino),u=l(e.departureIdPadOrigen),d=g(e.departureSupplierId),v=p(e.departureOperatorId),y={ToStationId:s,FromStationId:u,IsReturn:i,SupplierId:d,OperatorId:v,DateDeparture:r,DateReturn:t,PageName:"booking_status",PageCategory:"funnel",PageUrl:h(window.location.href),NumTransportationTypes:1};await (0,o.ensureTrackingIds)();let E=await (0,n.getSessionCookie)(),I=await (0,n.getUserVisitorCookie)(),k={EventName:"purchase_flow_booking_status_rejected",PrePurchaseId:e.prepurchaseId,VisitorId:I,SessionId:E,Timestamp:new Date().toISOString(),Referrer:h(document.referrer),Channel:window.location.host,IsNative:!1,Ip:await (0,c.getCachedPublicIp)(),PropertyTrex:y,Domain:window.location.hostname,Attribution:await (0,n.getAttributionCookie)()??void 0};await a.default.sendPurchaseRejectedEvent(k)}catch(e){(0,r.trackingUnexpectedError)(e)}};e.s(["_trackCheckoutPageEventTrex",0,C,"_trackChooseSeatsTrex",0,k,"_trackPassengerIdentificationTrex",0,f,"_trackPurchaseNotConfirmedEventTrex",0,S,"_trackPurchaseRejectedEventTrex",0,D,"_trackSearchResultTrex",0,I,"_trackSuccessPurchaseEventTrex",0,T])},527966,e=>{"use strict";var r=e.i(629873),t=e.i(828571),a=e.i(189911),n=e.i(854838),i=e.i(484086),o=e.i(253828),s=e.i(942466);let c=(0,a.getBffBaseUrl)()+"/Bookaway",u=e=>{if(e)return e.split("&")[0]},d=async(e,r,t)=>{try{await (0,s.ensureTrackingIds)();let a=u(await (0,i.getSessionCookie)()),d=u(await (0,i.getUserVisitorCookie)()),m=await (0,o.getCachedPublicIp)(),l=!!await (0,i.getUserTestCookie)(),p={Channel:window.location.hostname,UrlSearch:window.location.search,Referrer:document.referrer,SessionId:a,VisitorId:d,Ip:m,IsE2E:l,TokenSSO:await (0,i.getLoginTokenForBFF)(),IdVenta:t??null,Properties:r},g=await fetch(`${c}/${e}`,{method:"POST",body:JSON.stringify(p),headers:{"Content-Type":"application/json"},credentials:"include",keepalive:!0});if(g.ok)try{let e=await g.json();e.p10UserSessionId&&(0,o.parseTrackingCookieAndSet)("p10_user_sessionId",e.p10UserSessionId),e.p10UserVisitor&&(0,o.parseTrackingCookieAndSet)("p10_user_visitor",e.p10UserVisitor)}catch(e){(0,n.trackingUnexpectedError)(e)}}catch(e){(0,n.trackingUnexpectedError)(e)}},m=async e=>{await d("SearchTripsEvent",e)},l=async e=>{await d("ChooseSeatEvent",e)},p=async e=>{await d("CheckoutPageEvent",e)},g=async e=>{await d("PaymentSelectionEvent",e)},v=async e=>{await d("PaymentProcessEvent",e)},y=async e=>{await d("PaymentRedirectEvent",e)},E=async(e,r)=>{await d("BookTransferEvent",{ticket_codes:e.ticket_codes,transfer_id:e.transfer_id,from_station_id:e.from_station_id,to_station_id:e.to_station_id},parseInt(r)||void 0)},h=async e=>{await d("BookRejectedEvent",e)},I=async e=>{await d("LoadEvent",e)};window.sendPageLoadEvent=I;var k=e.i(812539);e.i(558163),e.i(916167);var f=e.i(696849),C=e.i(163103),T=e.i(414891),S=e.i(398301);e.i(58701);var D=e.i(487121),w=e.i(426562),R=e.i(586838),P=e.i(36389),_=e.i(287444),b=e.i(640548),N=e.i(818014),A=e.i(289230),x=e.i(478027);let O=async(e,r,t,a,o)=>{try{let s=async()=>{let e;try{let r=await (0,i.getLocaleCookie)();e=r?r.startsWith("pt")?"portuguese":"spanish":window.location.host.endsWith(".com.br")?"portuguese":"spanish"}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"languageByCountry",labelDetails:e.message,severity:n.severityEnum.ERROR})}finally{return e}},c={to_station_id:(0,R.formatIdPadForBookaway)(e.destination.id),from_station_id:(0,R.formatIdPadForBookaway)(e.departure.id),date_depatrure:(0,R.formatSearchDetailsDateForBookawayEvent)(e.departureDate),date_return:(0,R.formatSearchDetailsDateForBookawayEvent)(e.returnDate),is_return:+!!e.returnDate,price_min:0,price_max:0,currency:t,num_of_trips:0,num_of_avail_trips:0,num_last_seats_trips:0,language:await s()},u=e=>e&&Array.isArray(e)?e.reduce((e,r)=>r&&r.Servicios&&Array.isArray(r.Servicios)?e.concat(r.Servicios):e,[]):[],d=r||[];(!r||0===r.length)&&a&&(d=[...u(a.servicesWithOriginalDeparture),...u(a.servicesWithOriginalArrival),...u(a.servicesWithOthersDepartureAndArrival)]);let l=o?(0,b.getCombinationsTrexMetrics)(o.internas):null;if(d?.length>0){let e=d.reduce((e,r)=>
1Math.min(e,r.Cotizacion[t]),1/0),r=d.reduce((e,r)=>Math.max(e,r.Cotizacion[t]),0),a=d.length||0,n=d.filter(e=>e.Butacas>=1&&!(0,R.isServiceDeparted)(e.FechaSalida)).length,i=d.filter(e=>e.Butacas>=1&&e.Butacas<=5).length;l&&l.numOfTrips>0&&(e=Math.min(e,l.priceMin),r=Math.max(r,l.priceMax),a+=l.numOfTrips,n+=l.numOfAvailableTrips,i+=l.numLastSeatsTrips),c.price_min=e,c.price_max=r,c.num_of_trips=a,c.num_of_avail_trips=n,c.num_last_seats_trips=i}else l&&(c.price_min=l.priceMin,c.price_max=l.priceMax,c.num_of_trips=l.numOfTrips,c.num_of_avail_trips=l.numOfAvailableTrips,c.num_last_seats_trips=l.numLastSeatsTrips);await m(c)}catch(e){(0,n.trackingUnexpectedError)(e)}},L=async(e,r,t)=>{try{let a={transfer_id:(0,R.formatTransferId)(e,r,t),available_seats:e.Butacas,comfort:e.Calidad,currency:e.PrecioMoneda,price:e.Precio,from_station_id:(0,R.formatIdPadForBookaway)(r),to_station_id:(0,R.formatIdPadForBookaway)(t),date_departure:(0,R.formatDateForBookawayEvent)(e.FechaSalida),date_arrival:(0,R.formatDateForBookawayEvent)(e.FechaLlegada)};await l(a)}catch(e){(0,n.trackingUnexpectedError)(e)}},U=async(e,r)=>{try{t.default.track({event:"trackDataBus",data:{destination_from_id:e.departure.nameSeo,destination_to_id:e.destination.nameSeo,date_from:(0,R.formatSearchDetailsDate)(e.departureDate),date_to:e.returnDate?(0,R.formatSearchDetailsDate)(e.returnDate):"",round_trip:e.returnDate?"idayvuelta":"ida",price:Math.min(...r.map(e=>e.Precio)),from_city:(0,R.getCityFromSearchDetailStop)(e.departure),to_city:(0,R.getCityFromSearchDetailStop)(e.destination),source:"rebranding",isUserTest:await F()}})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"_trackSearchResultToGTM",labelDetails:e.message,severity:n.severityEnum.ERROR})}},B=async(e,r,a,n=P.currencyValues.ARS,i=(0,x.routeIdsFromSearchDetails)(e))=>{let o=e.departure.nameSeo.replace(/-/g,"_").replace(/_/g," ").toLowerCase(),s=e.destination.nameSeo.replace(/-/g,"_").replace(/_/g," ").toLowerCase(),c=`Omnibus: ${o} - ${s}`,u="Omnnibus - Ida";!1===a&&(c=`Omnibus: ${s} - ${o}`,u="Omnnibus - Vuelta");let d=[];r.slice(0,40).forEach((e,r)=>{e&&d.push({name:c,id:e.ClaveSolicitud,price:`${e.Precio}`,brand:e.NombreProveedorVisualizacion.toUpperCase(),category:`omnibus/${e.Calidad}`.toLowerCase(),destino:e.PadOrigen,origen:e.PadDestino,horario:e.FechaSalidaPresentacionHorario,variant:e.Calidad.toLowerCase(),list:u,position:r+1})});let m={vertical:"Omnibus",event:"p10ProductImpression",...i,ecommerce:{currencyCode:H(n),impressions:d,destino:s,origen:o},source:"rebranding",isUserTest:await F()};t.default.trackForGA4(m,!0)},V=async e=>{try{let r={event:"trackEvent",eventCategory:"Tracking Click",eventAction:e,eventData:{source:"rebranding",isUserTest:await F()}};t.default.trackEvent(r)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"_trackClick",labelDetails:e.message,severity:n.severityEnum.ERROR})}},F=async()=>!!await (0,i.getUserTestCookie)(),Q=async(e,r,a=!0,i)=>{try{t.default.trackSearch(r,a,await F()),G(e,r),i&&setTimeout(i,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackSearchBusEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},G=async(e,r,a,i)=>{try{let n=r.departure.nameSeo.replace(/-/g,"_").replace(/_/g," ").toLowerCase(),o=r.destination.nameSeo.replace(/-/g,"_").replace(/_/g," ").toLowerCase(),s={fromPage:e,vertical:"Omnibus",event:"p10Search",ecommerce:{departureDate:(0,R.formatSearchDetailsDate)(r.departureDate),destino:o,returnDate:r.returnDate?(0,R.formatSearchDetailsDate)(r.returnDate):null,origen:n},source:"rebranding",isUserTest:await F(),idElement:i};t.default.trackForGA4(s,!0),a&&setTimeout(a,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackSearch",labelDetails:e.message,severity:n.severityEnum.ERROR}),a&&a()}},M=async(e,r,a)=>{try{let n={fromPage:e,vertical:"Omnibus",event:"p10CambioFecha",selectedDate:r,source:"rebranding",isUserTest:await F()};t.default.trackForGA4(n,!0),a&&setTimeout(a,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackChangeDate",labelDetails:e.message,severity:n.severityEnum.ERROR}),a&&a()}},$=(e,a,i=!0,o,s="ARS",c=t.fromPageEnum.SEARCH_RESULTS,u)=>{try{let n="",d="",m=u??x.EMPTY_ROUTE_IDS;if((0,r.default)(o)){let e=window.location.pathname.replace("/servicios/buscar-pasajes/","").split("/");if((0,_.areUrlParamsValid)(e)){let r=(0,_.getParamObjectV2)(e);n=r.origin,d=r.destination,u||(m=(0,x.routeIdsFromUrlParams)({originId:r.originId,destinationId:r.de
1stinationId,departureDate:r.departureDate,returnDate:e[5]}))}}else n=o.departure.nameSeo,d=o.destination.nameSeo,u||(m=(0,x.routeIdsFromSearchDetails)(o));n=n.replace(/-/gi,"_").replace(/(\_)|(\-)/g," ").toLowerCase(),d=d.replace(/-/gi,"_").replace(/(\_)|(\-)/g," ").toLowerCase();let l=`Omnibus: ${n} - ${d}`,p={event:"p10ProductClick",vertical:"Omnibus",fromPage:c,...m,ecommerce:{currencyCode:H(s),click:{actionField:{list:"Omnnibus - "+(i?"Ida":"Vuelta")},products:[{name:l,id:e.ClaveSolicitud,price:e.Precio,brand:`${e.NombreProveedorVisualizacion}`.toUpperCase(),category:`omnibus/${e.Calidad}`.toLowerCase(),variant:`${e.Calidad}`.toLowerCase(),position:a}]}},source:"rebranding"};t.default.trackForGA4(p,!0)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"_trackServiceClick",labelDetails:e.message,severity:n.severityEnum.ERROR})}},H=e=>{try{if(["RS","R$"].includes(e))return"BRL";return P.currencyValues[e]||e}catch(r){return(0,n.trackingExpectedBehaviour)({componentName:"currencyCodeToISO4217",labelDetails:r.message,severity:n.severityEnum.ERROR}),e}},W=async e=>{try{let r=e.checkoutDetailsData.currency,a=r===P.currencyDisplayText.RS?P.currencyValues.RS:r,n=H(r),i=[{name:`Omnibus - ${e.informationCardData.origin} - ${e.informationCardData.destination}`,id:e.informationCardData.requestKey,price:e.informationCardData.amountQuotation[a],brand:e.informationCardData.company,category:`omnibus/${e.informationCardData.category}`,destino:e.informationCardData.destination,origen:e.informationCardData.origin,variant:e.informationCardData.category,quantity:e.passengerNumber}];e.informationCardData.ticketReturnId&&i.push({name:`Omnibus - ${e.informationCardData.destination} - ${e.informationCardData.origin}`,id:e.informationCardData.requestKey,price:e.informationCardData.returnAmountQuotation[a],brand:e.informationCardData.returnCompany,category:`omnibus/${e.informationCardData.returnCategory}`,destino:e.informationCardData.returnOrigin,origen:e.informationCardData.returnDestination,variant:e.informationCardData.returnCategory,quantity:e.passengerNumber});let o=Number(e.checkoutDetailsData.ticketsValues.premiumSupport)>0,s={};o&&(s={cliente_premium:!0,cliente_premium_expiration_date:"",cliente_premium_monto:e.checkoutDetailsData.ticketsValues.premiumSupport});let c={id:e.sale.saleId,affiliation:"Online Store",revenue:e.checkoutDetailsData.checkoutTotal,tax:0,shipping:e.checkoutDetailsData.ticketsValues.serviceCharge,net_margin:e.informationCardData.commission+e.checkoutDetailsData.ticketsValues.serviceCharge},u={conversions:{convertToARS:e.informationCardData.amountQuotation.ARS,convertToBRL:e.informationCardData.amountQuotation.RS,convertToPEN:e.informationCardData.amountQuotation.PEN,convertToPYG:e.informationCardData.amountQuotation.PYG,convertToUSD:e.informationCardData.amountQuotation.USD},originalAmount:e.informationCardData.amountQuotation[a],originalCurrency:n},d={conversions:{convertToARS:e.informationCardData.serviceFeeQuotation.ARS,convertToBRL:e.informationCardData.serviceFeeQuotation.RS,convertToPEN:e.informationCardData.serviceFeeQuotation.PEN,convertToPYG:e.informationCardData.serviceFeeQuotation.PYG,convertToUSD:e.informationCardData.serviceFeeQuotation.USD},originalAmount:e.informationCardData.serviceFee,originalCurrency:n},m=e.paymentData.methods.findLast(e=>e.selected).label,l={...e.searchRouteIds,ecommerce:{purchase:{actionField:c,customerLTV:{conversions:{convertToARS:0,convertToBRL:0,convertToPEN:0,convertToPYG:0,convertToUSD:0},originalAmount:0,originalCurrency:n},newCustomer:!1,price:u,products:i,shipping:d}},email:e.user?.contactEmail,event:"p10PaymentConfirm",first_name:e.user?.firstName,"gateway-pago":"","home_address.city":"","home_address.country":"","home_address.postal_code":"","home_address.street":"",isUserTest:await F(),last_name:e.user?.lastName,login_Method:localStorage.getItem("loginMethod")||"","medio-pago":m,phone_number:e.user?.phoneNumber,premiumSupport:s,source:"rebranding",status:"aceptado",user_id:e.user?.userId,vertical:"omnibus"};l.ecommerce.purchase.products.length>1&&(l.ecommerce.purchase.shipping={...l.ecommerce.purchase.shipping,conversions:{convertToARS:e.informationCardData.returnServiceFeeQuotation.ARS+l.ecommerce.purchase.shipping.conversions.convertToARS,convertToBRL:e.informationCardData.returnServiceFeeQuotation.RS+l.ecommerce.purchase.shipping.conversions.convertToBRL,convertToPEN:e.informationCardData.returnServiceFeeQuotation.PEN+l.ecommerce.purchase.shipping.conversions.convertToPEN,convertToPYG:e.informationCardData.returnServiceFeeQuotation.PYG+l.ecommerce.purchase.shipping.conversions.convertToPYG,convertToUSD:e.informationCardData.returnServiceFeeQuotation.USD+l.ecommerce.purchase.shipping.conversions.convertToUSD},originalAmount:e.informationCardData.returnServiceFee+l.ecommerce.purchase.shipping.originalAmount},l.ecommerce.purchase.price.conversions={convertToARS:e.informationCardData.returnAmountQuotation.ARS+l.ecommerce.purchase.price.conversions.convertToARS,convertToBRL:e.informationCardData.returnAmountQuotation.RS+l.ecommerce.purchase.price.conversions.convertToBRL,convertToPEN:e.informationCardData.returnAmountQuotation.PEN+l.ecommerce.purchase.price.conversions.convertToPEN,convertToPYG:e.informationCardData.returnAmountQuotation.PYG+l.ecommerce.purchase.price.conversions.convertToPYG,convertToUSD:e.informationCardData.returnAmountQuotation.USD+l.ecommerce.purchase.price.conversions.convertToUSD},l.ecommerce.purchase.price.originalAmount=e.informationCardData.returnAmountQuotation[a]+l.ecommerce.purchase.price.originalAmount),t.default.trackForGA4(l,!1)}catch(e){(0,n.trackingUnexpectedError)(e)}},j=async e=>{try{t.default.track({event:"p10PaymentFail",data:{event:"p10PaymentFail",isUserTest:await F(),vertical:"omnibus",user_id:e.user.userId,status:"rechazado",motivo:"Rechazodo","gateway-pago":"","medio-pago":e.paymentData.methods.findLast(e=>e.selected).label}})}catch(e){(0,n.trackingUnexpectedError)(e)}},Y=(e,r=1)=>{let a=e.checkoutDetailsData.currency,n=[{name:`Omnibus - ${e.informationCardData.origin} - ${e.informationCardData.destination}`,id:e.informationCardData.requestKey,price:e.informationCardData.amountQuotation[a],brand:e.informationCardData.company,category:`omnibus/${e.informationCardData.category}`,destino:e.informationCardData.destination,origen:e.informationCardData.origin,variant:e.informationCardData.category,quantity:e.passengerNumber}];e.informationCardData.ticketReturnId&&n.push({name:`Omnibus - ${e.informationCardData.destination} - ${e.informationCardData.origin}`,id:e.informationCardData.requestKey,price:e.informationCardData.returnAmountQuotation[a],brand:e.informationCardData.returnCompany,category:`omnibus/${e.informationCardData.returnCategory}`,destino:e.informationCardData.returnOrigin,origen:e.informationCardData.returnDestination,variant:e.informationCardData.returnCategory,quantity:e.passengerNumber}),t.default.trackForGA4({event:"p10Checkout",vertical:"omnibus",source:"rebranding",...e.searchRouteIds,ecommerce:{currencyCode:a,checkout:{actionField:{step:r},products:n}}},!0)};e.s(["trackAddToCart",0,(e,r)=>{try{t.default.trackEcommerce("p10AddToCart",e),r&&setTimeout(r,100)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackAddToCart",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackAddToCartInsiderWithTimeout",0,(e,r)=>{try{(0,A._trackAddToCartInsider)(e),r&&setTimeout(r,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackAddToCartInsiderWithTimeout",labelDetails:e.message,severity:n.severityEnum.ERROR}),r&&r()}}
1,"trackAncillariesViewPage",0,({url:e,site:r})=>{try{return(0,T.pageViewAncillaryPage)({site:r,url:e})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackAncillariesViewPage",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackAncillaryIssuance",0,({data:e,site:r})=>{try{return(0,T.ancillaryIssuanceEvent)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),prePurchaseDetails:e.prePurchaseDetails,site:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackAncillarySelection",0,({data:e,site:r})=>{try{return(0,T.addSelectedAncillary)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),prePurchaseDetails:e,site:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackBannerSelected",0,({type_detail:e,position:r,site:t,type:a,url:n,section:i})=>(0,k.bannerSelectedEvent)({url:n,position:r,section:i,type:a,type_detail:e,site:t}),"trackChangeDate",0,M,"trackCompanyPromotions",0,(e,r)=>{try{r.forEach(r=>{t.default.trackForGA4({event:"view_promotion",promotion_name:"Rutas Populares",creative_name:`Pasajes en Micro a ${r.route.origin.label} desde ${r.route.destination.label}`,creative_slot:`Landing ${e.name}`},!1)})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackCompanyPromotions",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackCompanyTerminals",0,(e,r)=>{try{r.forEach(r=>{t.default.trackForGA4({event:"view_promotion",promotion_name:"Terminales",creative_name:`Pasajes en Micro a ${r.name}`,creative_slot:`Landing ${e.name}`},!1)})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackCompanyTerminals",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackConfirmAncillaries",0,({data:e,site:r})=>{try{return(0,T.createConfirmAncillaryDetailsEvent)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),confirmAncillariesDetails:e,site:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackContinueToPayment",0,({data:e,site:r})=>{try{return(0,T.continueToPaymentFromAncillaries)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),prePurchaseDetails:e,site:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackCoveragePlanToggle",0,({planType:e,isSelected:r,planPrice:t,site:a,experimentSource:i})=>{try{return(0,T.toggleCoveragePlanSelection)({planType:e,isSelected:r,planPrice:t,site:a,experimentSource:i})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackCreateAccountViewPage",0,({url:e,site:r})=>{try{return(0,C.pageViewCreateAccount)({site:r,url:e})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackCreateAccountViewPage",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackForgotPasswordViewPage",0,({url:e,site:r})=>{try{return(0,C.pageViewForgotPassword)({site:r,url:e})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackForgotPasswordViewPage",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackHowItWorksEvent",0,({site:e,url:r})=>{try{return(0,C.howItWorksEvent)({site:e,url:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackLoginViewPage",0,({url:e,site:r,loginVersion:t})=>{try{return(0,C.pageViewLoginPage)({site:r,url:e,loginVersion:t})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackLoginViewPage",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackMyAccountButton",0,()=>{try{V("Mi Cuenta home")}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackMyAccountButton",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackNavbarClickEvent",0,({businessUnit:e,site:r})=>{try{return(0,k.navbarClickEvent)({businessUnit:e,site:r})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackNavbarClickEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPageViewCheckout",0,e=>{try{try{let r=e.transferId,t=[e.informationCardData.ticketId];
1e.informationCardData.ticketReturnId&&t.push(e.informationCardData.ticketReturnId);let a={currency:e.checkoutDetailsData.currency,passengers:e.passengerNumber,total_price:e.checkoutDetailsData.checkoutTotal,transfer_id:r,from_station_id:e.informationCardData.originId,to_station_id:e.informationCardData.destinationId,ticket_codes:t};p(a)}catch(e){(0,n.trackingUnexpectedError)(e)}Y(e)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPageViewCheckout",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPageViewLanding",0,({detail:e,businessUnit:r,site:t})=>{try{return(0,k.pageViewLanding)({type:D.PageTypeEnum.LANDING_PAGE,typeDetail:e,businessUnit:r,site:t})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPageViewLanding",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPageViewResult",0,({businessUnit:e,searchDetails:r,site:t})=>{try{return(0,f.pageViewResult)({businessUnit:e,searchDetails:r,site:t})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPageViewResult",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPasswordlessEmailSubmitted",0,({url:e,site:r,resolvedAs:t,funnelStep:a})=>{try{return(0,C.passwordlessEmailSubmitted)({site:r,url:e,resolvedAs:t,funnelStep:a})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPasswordlessEmailSubmitted",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPaymentFailEvent",0,(e,r)=>{try{try{let t=[e.informationCardData.ticketId];
1e.informationCardData.ticketReturnId&&t.push(e.informationCardData.ticketReturnId),h({ticket_codes:t,transfer_id:e.transferId,rejected:{category:"N/A",reasons:[r]},from_station_id:e.informationCardData.originId,to_station_id:e.informationCardData.destinationId})}catch(e){(0,n.trackingUnexpectedError)(e)}j(e)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPaymentFailEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPaymentProcessEvent",0,e=>{try{try{let r=e.paymentData.methods.findLast(e=>e.selected),t=[e.informationCardData.ticketId];e.informationCardData.ticketReturnId&&t.push(e.informationCardData.ticketReturnId),v({installments:r.installments.findLast(e=>e.selected).number,payment_type:r.label,ticket_codes:t,transfer_id:e.transferId})}catch(e){(0,n.trackingUnexpectedError)(e)}((e,r=2)=>{Y(e,r)})(e)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPaymentProcessEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPaymentRedirectEvent",0,e=>{try{try{y(e)}catch(e){(0,n.trackingUnexpectedError)(e)}}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPaymentRedirectEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPaymentSelectionEvent",0,e=>{try{try{g(e)}catch(e){(0,n.trackingUnexpectedError)(e)}}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPaymentSelectionEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPaymentSuccessEvent",0,e=>{try{try{let r=[e.informationCardData.ticketId];e.informationCardData.ticketReturnId&&r.push(e.informationCardData.ticketReturnId),E({ticket_codes:r,transfer_id:e.transferId,from_station_id:e.informationCardData.originId,to_station_id:e.informationCardData.destinationId},e.sale.saleId)}catch(e){(0,n.trackingUnexpectedError)(e)}W(e)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPaymentSuccessEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPremiumSupportSelection",0,({data:e,site:r,isSelected:t})=>{try{return(0,T.addingPremiumSupportFromAncillaries)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),prePurchaseDetails:e,site:r,isSelected:t})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackPromotions",0,e=>{try{var r;let a;r=e.map((e,r)=>({id:`${e.caption}-${r+1}`,name:e.caption,creative:"omnibus-home",position:`promocionCentral-${r+1}`})),(a={}).promoView={promotions:r},t.default.trackForGA4({event:"promotionImpression",ecommerce:a,source:"rebranding"},!1)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPromotions",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPromotionsClick",0,()=>{try{V("Banner Promocion home")}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackPromotionsClick",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackPurchaseSuccessful",0,({data:e,site:r})=>{try{return(0,T.purchaseSuccessfulForAncillaries)({businessUnit:(0,D.businessUnitFromVertical)((0,w.currentVerticalFromLocation)()),prePurchaseDetails:e,site:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackSearch",0,G,"trackSearchBusEvent",0,Q,"trackSearchboxVerticalTabClickEvent",0,({businessUnit:e,site:r})=>{try{return(0,k.searchboxVerticalTabClickEvent)({businessUnit:e,site:r})}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackSearchboxVerticalTabClickEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackSeatSelected",0,e=>{try{t.default.trackEventWithoutData("p10SeatSelected"),e&&setTimeout(e,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackSeatSelected",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackServiceClickEvents",0,({service:e,position:r,isDeparture:a=!0,latestSearch:i,currencyCode:o="ARS",departureId:s,arrivalId:c,callback:u,routeIds:d})=>{try{(0,N._trackChooseSeatsTrex)(i,e,s,c),$(e,r,a,i,o,t.fromPageEnum.SEARCH_RESULTS,d),L(e,s,c)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackServiceClickEvents",labelDetails:e.message,severity:n.severityEnum.ERROR})}finally{u&&setTimeout(u,200)}},"trackServiceDepartureClick",0,({service:e,position:r,isDeparture:a=!0,latestSearch:i,currencyCode:o="ARS",fromPage:s=t.fromPageEnum.SEARCH_RESULTS,callback:c,departureId:u,arrivalId:d,routeIds:m})=>{try{(0,N._trackChooseSeatsTrex)(i,e,u,d),$(e,r,a,i,o,s,m),c&&setTimeout(c,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackServiceDepartureClick",labelDetails:e.message,severity:n.severityEnum.ERROR}),c&&c()}},"trackTerminalWeeklyOfferEvent",0,(e,r,t,a,i)=>{try{let n=(0,S.createTerminalWeeklOfferEvent)(e,r,t);a.trackEvent({name:n.name,data:n.properties}),i&&setTimeout(i,200)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackCardSelectedEvent",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackTermsAndConditionsFromAncillaries",0,({site:e,url:r})=>{try{return(0,T.termsAndConditionsFromAncillaries)({site:e,url:r})}catch(e){(0,n.trackingUnexpectedError)(e)}},"trackingEventLandingResult",0,(e,r,t=P.currencyValues.ARS,a)=>{try{B(e,r,null,t,a)}catch(e){(0,n.trackingExpectedBehaviour)({componentName:"trackingEventLandingResult",labelDetails:e.message,severity:n.severityEnum.ERROR})}},"trackingEventSearchResult",0,(e,r,t,a=P.currencyValues.ARS,i,o)=>{try{(0,N._trackSearchResultTrex)(e,r,a,void 0,i),U(e,r),B(e,r,t,a,o),O(e,r,a,void 0,i)}catch(i){console.info({search:e,services:r,isDeparture:t,currencyCode:a}),(0,n.trackingExpectedBehaviour)({componentName:"trackingEventSearchResult",labelDetails:i.message,severity:n.severityEnum.ERROR})}},"trackingEventSearchResultWithNearby",0,(e,r,t,a=P.currencyValues.ARS,i,o,s)=>{try{(0,N._trackSearchResultTrex)(e,r,a,i,o),U(e,r),B(e,r,t,a,s),O(e,r,a,i,o)}catch(o){console.info({search:e,services:r,isDeparture:t,currencyCode:a,nearbyData:i}),(0,n.trackingExpectedBehaviour)({componentName:"trackingEventSearchResultWithNearby",labelDetails:o.message,severity:n.severityEnum.ERROR})}}],527966)},289230,e=>{"use strict";var r=e.i(89636),t=e.i(875664),a=e.i(458693),n=e.i(144850);let i=new Set,o=new Set,s=new Set,c=()=>{try{if(!window.sessionStorage)return null;return window.sessionStorage}catch(e){return console.warn("[Insider] sessionStorage is not accessible.",e),null}},u=e=>`p10:insider:tracking:${e}`,d=e=>`p10:insider:pending-purchase:${e}`,m=e=>`p10:insider:tracked-purchase:${e}`,l=e=>{let r=c();r?.removeItem(e)},p=e=>{if(i.has(e))return!0;let r=c();if(!r)return!1;let t=r.getItem(m(e));if(!t)return!1;try{let r=JSON.parse(t);if(!r.expiresAt||r.expiresAt<=Date.now())return l(m(e)),!1;
1return i.add(e),!0}catch{return l(m(e)),!1}},g=({component:e,data:r,onReady:t,timeoutMessage:a})=>{let i=Date.now(),o=()=>{window.InsiderQueue?t():Date.now()-i<1e4?setTimeout(o,300):(console.warn(a,r),(0,n.sendDatadogBrowserLogOncePerSession)({key:"insider-queue-unavailable",sampleRate:.05,message:"[Insider] InsiderQueue not available after timeout",status:"error",context:{component:e,firstCaller:e,...r??{}}}))};o()},v=async({businessUnit:e,prePurchaseDetails:a,site:n})=>{let i=null,o=a?.prePurchaseId;try{if(!await (0,r.isInsiderTrackingEnabled)()||!o||p(o)||!(i=(0,r.transformToInsiderPurchase)({businessUnit:e,prePurchaseDetails:a,site:n})))return;let s=u(o),m=c();if(m?.getItem(s))return;if(m?.setItem(s,Date.now().toString()),!(({prePurchaseId:e,purchaseData:r})=>{let t=c();if(!t)return!1;let a=Date.now();return t.setItem(d(e),JSON.stringify({schemaVersion:1,prePurchaseId:e,createdAt:a,expiresAt:a+6e4,purchaseData:r})),!0})({prePurchaseId:o,purchaseData:i}))return void t.logger.sendLog({message:"[Insider] Unable to persist purchase payload before redirect.",component:"trackPurchase",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:o}})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking purchase:",component:"trackPurchase",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:i})}finally{o&&l(u(o))}},y=async({prePurchaseId:e})=>{try{if(!await (0,r.isInsiderTrackingEnabled)()||!e)return;if(p(e))return void l(d(e));let n=(e=>{let r=c();if(!r)return null;let t=r.getItem(d(e));if(!t)return null;try{let r=JSON.parse(t);if(1!==r.schemaVersion||r.prePurchaseId!==e||r.expiresAt<=Date.now())return l(d(e)),null;return r}catch{return l(d(e)),null}})(e);if(!n)return;let o=Date.now(),s=()=>
1{if(p(e))return void l(d(e));if((({prePurchaseId:e,purchaseData:r})=>{let t;return!!window.InsiderQueue&&(window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.PURCHASE,value:{order_id:r.order_id,items:r.items,total:r.total}}),window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.INIT}),i.add(e),(t=c())&&t.setItem(m(e),JSON.stringify({trackedAt:Date.now(),expiresAt:Date.now()+864e5})),l(d(e)),!0)})({prePurchaseId:e,purchaseData:n.purchaseData})){try{setTimeout(()=>{window.InsiderQueue&&(window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.CART,value:{total:0,shipping_cost:0,items:[]}}),window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.INIT}))},500)}catch(r){t.logger.sendLog({message:"[Insider] Error scheduling cart clean after purchase replay.",component:"replayStoredPaymentSuccessInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.LOW_IMPACT],data:{prePurchaseId:e}})}return}Date.now()-o<1e4?setTimeout(s,300):t.logger.sendLog({message:"[Insider] InsiderQueue not available after timeout on confirmed page replay.",component:"replayStoredPaymentSuccessInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:e}})};s()}catch(r){t.logger.sendLog({message:"[Insider] Error replaying stored purchase event.",component:"replayStoredPaymentSuccessInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:r instanceof Error?r:Error(String(r)),data:{prePurchaseId:e}})}},E=async({serviceData:e,isDeparture:n,isRoundtrip:i,passengers:o,site:s,businessUnit:c,requestKey:u})=>{let d=null;try{if(!await (0,r.isInsiderTrackingEnabled)())return;if(!(d=(0,r.transformToInsiderAddToCart)({serviceData:e,isDeparture:n,isRoundtrip:i,passengers:o,site:s,businessUnit:c,requestKey:u})))return void t.logger.sendLog({message:"[Insider] No add_to_cart data generated:",component:"trackAddToCart",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:d});if(!window.InsiderQueue)return void t.logger.sendLog({message:"[Insider] InsiderQueue is not defined. Skipping add_to_cart tracking.",component:"trackAddToCart",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:d});window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.ADD_TO_CART,value:{id:d.id.toString(),name:d.name,taxonomy:d.taxonomy,unit_price:d.unit_price,unit_sale_price:d.unit_sale_price,quantity:d.quantity,url:d.url,product_image_url:d.product_image_url,custom:d.custom}}),window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.INIT})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking add_to_cart:",component:"trackAddToCart",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:d})}},h=async({businessUnit:e,prePurchaseDetails:n,site:i})=>{try{if(!await (0,r.isInsiderTrackingEnabled)())return;let o=(0,r.transformToInsiderRetryBuy)({prePurchaseDetails:n,site:i,businessUnit:e});if(!o)return void t.logger.sendLog({message:"[Insider] No retry buy data generated.",component:"_trackRetryBuyInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:n?.prePurchaseId}});g({component:"_trackRetryBuyInsider",data:{prePurchaseId:n?.prePurchaseId,event:o},timeoutMessage:"[Insider] InsiderQueue not available after timeout. Skipping retry buy tracking.",onReady:()=>{window.InsiderQueue?.push({type:a.InsiderQueueEventTypeEnum.CUSTOM_EVENT,value:[o]}),window.InsiderQueue?.push({type:a.InsiderQueueEventTypeEnum.INIT})}})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking retry buy event.",component:"_trackRetryBuyInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:{prePurchaseId:n?.prePurchaseId}})}},I=async({businessUnit:e,prePurchaseDetails:n,site:i})=>{let s=[],c=n?.prePurchaseId;try{if(!await (0,r.isInsiderTrackingEnabled)()||!c||o.has(c))return;if(!(s=(0,r.transformToInsiderPurchaseRejected)({prePurchaseDetails:n,site:i,businessUnit:e})).length)return void t.logger.sendLog({message:"[Insider] No purchase rejected data generated.",component:"_trackPurchaseRejectedInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:c}});g({component:"_trackPurchaseRejectedInsider",data:{prePurchaseId:c,events:s},timeoutMessage:"[Insider] InsiderQueue not available after timeout. Skipping purchase rejected tracking.",onReady:()=>{!o.has(c)&&(({purchaseRejectedData:e})=>
1!!window.InsiderQueue&&(e.forEach(e=>{window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.CUSTOM_EVENT,value:[{event_name:`${e.event_name}-${e.custom.trip_direction}`,event_parameters:{url:e.url,custom:e.custom}}]})}),!0))({purchaseRejectedData:s})&&o.add(c)}})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking purchase rejected event.",component:"_trackPurchaseRejectedInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:{prePurchaseId:c,purchaseRejectedData:s}})}},k=async({businessUnit:e,prePurchaseDetails:n,site:i})=>{try{if(!window.InsiderQueue)return void t.logger.sendLog({message:"[Insider] InsiderQueue is not defined. Skipping select payment method tracking.",component:"_trackSelectPaymentMethodInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT]});if(!await (0,r.isInsiderTrackingEnabled)())return;let o=n?.prePurchaseId;if(!o)return;let u=`p10:insider:tracked-select-pm:${o}`,d=c();if(s.has(o))return;if(d?.getItem(u))return void s.add(o);s.add(o),d?.setItem(u,Date.now().toString());let m=(0,r.transformToInsiderSelectPaymentMethod)({prePurchaseDetails:n,site:i,businessUnit:e});if(!m)return void t.logger.sendLog({message:"[Insider] No select payment method data generated.",component:"_trackSelectPaymentMethodInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:n?.prePurchaseId}});window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.CUSTOM_EVENT,value:[{event_name:m.event_name,event_parameters:{custom:m.custom,url:m.url}}]}),window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.INIT})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking select payment method event.",component:"_trackSelectPaymentMethodInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:{prePurchaseId:n?.prePurchaseId}})}},f=async({businessUnit:e,prePurchaseDetails:n,site:i})=>{try{if(!window.InsiderQueue)return void t.logger.sendLog({message:"[Insider] InsiderQueue is not defined. Skipping continue to payment tracking.",component:"_trackContinueToPaymentInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT]});if(!await (0,r.isInsiderTrackingEnabled)())return;let o=(0,r.transformToInsiderContinueToPayment)({prePurchaseDetails:n,site:i,businessUnit:e});if(!o)return void t.logger.sendLog({message:"[Insider] No continue to payment data generated.",component:"_trackContinueToPaymentInsider",severity:t.GenericSeverityEnum.WARNING,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],data:{prePurchaseId:n?.prePurchaseId}});window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.CUSTOM_EVENT,value:[{event_name:a.InsiderCustomEventNameEnum.CONTINUE_TO_PAYMENT,event_parameters:{custom:o.event_parameters}}]}),window.InsiderQueue.push({type:a.InsiderQueueEventTypeEnum.INIT})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking continue to payment event.",component:"_trackContinueToPaymentInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e)),data:{prePurchaseId:n?.prePurchaseId}})}},C=async({properties:e,isFlagEnabled:n})=>{try{if(!n||!await (0,r.isInsiderTrackingEnabled)())return;let t=(0,r.transformToInsiderListingPageView)(e);if(!t)return;g({component:"_trackListingPageViewInsider",data:{route:t.event_parameters.custom.route},timeoutMessage:"[Insider] InsiderQueue not available after timeout. Skipping listing page view tracking.",onReady:()=>{window.InsiderQueue?.push({type:a.InsiderQueueEventTypeEnum.CUSTOM_EVENT,value:[{event_name:t.event_name,event_parameters:{url:t.event_parameters.url,custom:t.event_parameters.custom}}]}),window.InsiderQueue?.push({type:a.InsiderQueueEventTypeEnum.INIT})}})}catch(e){t.logger.sendLog({message:"[Insider] Error tracking listing page view event.",component:"_trackListingPageViewInsider",severity:t.GenericSeverityEnum.ERROR,context:t.EnvironmentErrorContextEnum.CLIENT,tags:[t.LogTags.HIGH_IMPACT],error:e instanceof Error?e:Error(String(e))})}};e.s(["LISTING_PAGE_VIEW_INSIDER_EXPERIMENT_KEY",0,"listing-page-view-insider","_trackAddToCartInsider",0,E,"_trackContinueToPaymentInsider",0,f,"_trackListingPageViewInsider",0,C,"_trackPaymentSuccessInsider",0,v,"_trackPurchaseRejectedInsider",0,I,"_trackRetryBuyInsider",0,h,"_trackSelectPaymentMethodInsider",0,k,"isListingPageViewInsiderVariantEnabled",0,e=>!!e&&"control"!==e&&"off"!==e,"replayStoredPaymentSuccessInsider",0,y])}]);
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.