1import{g as r,e as _,o as f}from"./main-kBzK4eIG.js";import"./vendor-primevue-CeEACqX_.js";import"./vendor-fontawesome-CHTXNQM2.js";import"./vendor-luxon-D-syak89.js";import"./vendor-i18n-G4dYfk6F.js";import"./vendor-pako-DwGzBETv.js";import"./vendor-posthog-B2YXpdD_.js";import"./vendor-query-B7KhvNMU.js";const u=new Set(["email","customerName","name","phone","address","holderFirstName","holderLastName","sessionToken","clientReference"]);function s(o,n){const i={};if(o.hotelName!=null&&(i.hotel_name=o.hotelName),o.hotelCity!=null&&(i.hotel_city=o.hotelCity),o.hotelId!=null&&(i.hotel_id=o.hotelId),o.checkin!=null&&(i.checkin=o.checkin),o.checkout!=null&&(i.checkout=o.checkout),o.adults!=null&&(i.adults=o.adults),o.rooms!=null&&(i.rooms=o.rooms),n)for(const l of n){const e=o[l];e!=null&&!u.has(l.toLowerCase())&&(i[l.toLowerCase()]=e)}return i}function c(o,n){if(!o||typeof o!="object")return;const i={},l=n||new Set(Object.keys(o));for(const[e,t]of Object.entries(o)){const d=e.toLowerCase();u.has(d)||!l.has(e)&&n||t!=null&&(typeof t=="object"&&!Array.isArray(t)&&typeof t.getTime!="function"||(i[d]=t))}return Object.keys(i).length?i:void 0}function h(o,n){const i=n.routeName,l=n.path||"";if(o==="landing_page_view"){const e=l==="/"||l.startsWith("/?");return i==="home"||e?{state:"HOMEPAGE",name:"DEFAULT",data:c(n,new Set(["routeName","path"]))}:null}if(o.startsWith("search_initiated_")&&["home","hotels","rooms","favourites"].some(e=>o.includes(e)))return{state:"HOMEPAGE",name:"INITIATE",data:c(n,new Set(["placeId","checkin","checkout","adults","rooms","name","mealPlans","facilities","sorting","freeCancellation","trackingId","min_price","max_price","children"]))};if(o.startsWith("hotel_selected_")){const e=s(n);n.hotelCountry!=null&&(e.hotel_country=n.hotelCountry),n.name!=null&&typeof n.name=="string"&&(e.place_name=n.name);const t=o.includes("rooms")?"HOTEL_DETAIL_PAGE":o.includes("hotels")?"HOTEL_LISTING":o.includes("favourites")?"FAVOURITES_PAGE":"HOMEPAGE";return e.page=t,{state:"CUSTOM",name:"CLICK_HOTEL",data:Object.keys(e).length?e:void 0}}if(o.startsWith("search_filter_applied_")){const e=c(n,new Set(["mealPlans","facilities","stars","ratings","freeCancellation","sorting","hotelName","hotelTypes","chains","suburbs"]));return e&&(e.page="HOTEL_LISTING"),{state:"CUSTOM",name:"SEARCH_FILTER_APPLIED",data:e}}if(o==="room_filter_applied"){const e=c(n,new Set(["needBreakfast","needHalfBoard","needAllInclusive","needFreeCancellation","needFullBoard","needDinnerIncluded","needLunchIncluded"]));return e&&(e.page="HOTEL_DETAIL_PAGE"),{state:"CUSTOM",name:"ROOM_FILTER_APPLIED",data:e}}if(o==="prebook_confirmed"){const e=s(n,["prebookId","price","currency","occupancies","cartAbandon","cartId","guestId","bookingId","lang","trackingId"]);return{state:"CHECKOUT_PAGE",name:"DEFAULT",data:Object.keys(e).length?e:void 0}}if(o==="prebook_failed"){const e=c(n,new Set(["hotelId","offerId","rateId","error"]));return e&&(e.page="HOTEL_DETAIL_PAGE"),{state:"CUSTOM",name:"PREBOOK_FAILED",data:e}}if(o==="booking_initiated"){const e=s(n,["prebookId","price","currency","occupancies","city","lang","trackingId","cartId","bookingId"]);return{state:"CHECKOUT_PAGE",name:"TRANSACT",data:Object.keys(e).length?e:void 0}}if(o==="booking_payment_failed"){const e=c(n,new Set(["prebookId","hotelId","error","checkin","checkout","adults","rooms"]));return e&&(e.page="CHECKOUT_PAGE"),{state:"CUSTOM",name:"PAYMENT_FAILED",data:e}}if(o==="booking_completed"||o==="booking_confirmed"){const e={};return n.wl_booking_id!=null&&(e.booking_id=n.wl_booking_id),n.booking_id!=null&&(e.confirmation_number=n.booking_id),n.hotel_id!=null&&(e.hotel_id=n.hotel_id),n.hotel_name!=null&&(e.hotel_name=n.hotel_name),n.checkin!=null&&(e.checkin=n.checkin),n.checkout!=null&&(e.checkout=n.checkout),n.price!=null&&(e.price=n.price),n.priceInUsd!=null&&(e.price_in_usd=n.priceInUsd),n.rooms!=null&&(e.rooms=n.rooms),{state:"BOOKING_COMPLETION",name:"DEFAULT",data:Object.keys(e).length?e:void 0}}if(o==="booking_cancelled"){const e=c(n,new Set(["bookingId"]));return e&&(e.page="MANAGE_BOOKING_PAGE"),{state:"CUSTOM",name:"BOOKING_CANCELLED",data:e}}if(o==="booking_voucher_downloaded"){const e={};n.wl_booking_id!=null&&(e.booking_id=n.wl_booking_id),n.booking_id!=null&&(e.confirmation_number=n.booking_id),n.hotel_id!=null&&(e.hotel_id=n.hotel_id),n.hotel_name!=null&&(e.hotel_name=n.hotel_name),n.checkin!=null&&(e.checkin=n.checkin),n.checkout!=null&&(e.checkout=n.checkout),n.price!=null&&(e.price=n.price),n.priceInUsd!=null&&(e.price_in_usd=n.priceInUsd);const t=n.source;return t==="confirmation_page"?e.page="CONFIRMATION_PAGE":t==="manage_booking_page"?e.page="MANAGE_BOOKING_PAGE":typeof t=="string"&&t&&(e.page=t.toUpperCase()),{state:"CUSTOM",name:"BOOKING_VOUCHER_DOWNLOADED",data:Object.keys(e).length?e:void 0}}
1if(o==="stripe_payment_confirmed")return{state:"BOOKING_COMPLETION",name:"DEFAULT",data:c(n,new Set(["wl_booking_id","status"]))};if(o==="stripe_payment_failed"){const e=c(n,new Set(["wl_booking_id","status"]));return e&&(e.page="CHECKOUT_PAGE"),{state:"CUSTOM",name:"PAYMENT_FAILED",data:e}}if(o==="map:marker_click"||o==="map:hotel_navigate"){const e={page:"MAP_PAGE"};return n.hotelId!=null&&(e.hotel_id=n.hotelId),n.hotelName!=null&&(e.hotel_name=n.hotelName),n.hotelCity!=null&&(e.hotel_city=n.hotelCity),{state:"CUSTOM",name:o.replace(/:/g,"_").toUpperCase(),data:e}}if(o==="map:search_this_area"){const e={page:"MAP_PAGE"};return n.centerLat!=null&&(e.center_lat=n.centerLat),n.centerLng!=null&&(e.center_lng=n.centerLng),{state:"CUSTOM",name:"SEARCH_THIS_AREA",data:e}}return null}function p(){const o=_?.project?.settings;return o?(o.enableGrabAnalytics??o.enableGrabAppIntegration??!1)&&f():!1}function T(o,n){try{if(!p())return;const i=h(o,n);if(!i)return;r().sendAnalyticsEvent(i).catch(l=>{console.warn("[Grab Analytics] sendAnalyticsEvent failed",i.name,l)})}catch(i){console.warn("[Grab Analytics] failed",o,i)}}export{T as sendGrabAnalyticsIfEnabled};
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.