PageSourceSearch

https://travelscanner.ai/assets/Confirmation-DwtN_uV4.js

js travelscanner.ai collected 2026-10-05 14:06:45 UTC 17,504 bytes, 1 lines download raw bytes

1import{e as P,br as bo,p as x,v as Y,ak as vo,h as K,bs as wo,bf as M,bt as Co,bi as Io,bu as G,bo as z,T as Lo,bv as Bo,bw as Eo,bx as $o,t as Po,I as W,by as Uo,g as Do,o as So}from"./main-kBzK4eIG.js";import{d as Z,c as q,z as c,C as t,E as l,u as n,f as h,N as v,L as U,O as m,P as oo,A as r,a0 as Ro,r as R,l as J,o as Vo,U as Ao,b as No,G as j,F as E,V as N,Y as $,S as V}from"./vendor-primevue-CeEACqX_.js";import{D as X}from"./vendor-luxon-D-syak89.js";import{u as xo,L as To}from"./LoyaltyLabelBanner-b4_DrhEs.js";import{R as Oo}from"./RoomDetails-CuAR53FX.js";import{P as Fo}from"./PerksSection-C3ODrFYJ.js";import{u as Mo,D as Go,b as jo}from"./useVoucherDownload-DDc84_Da.js";import{u as eo}from"./vendor-i18n-G4dYfk6F.js";import"./vendor-fontawesome-CHTXNQM2.js";import"./vendor-pako-DwGzBETv.js";import"./vendor-posthog-B2YXpdD_.js";import"./vendor-query-B7KhvNMU.js";import"./ImageWithFallback-raoQ1sx0.js";import"./bunny-BFgfExvG.js";import"./file-download-idIKGCAR.js";const qo="https://api.grab.com/grabid/v1/oauth2/grablet/config",Ho="GrabStays_Booking_Completion";function Qo(){const I=P.project.settings?.grabEsim;if(!I?.enabled||!I.firstyClientId||!I.firstyRedirectBaseUrl)return null;const{firstyClientId:g,oauthBaseUrl:L,firstyRedirectBaseUrl:y,defaultCountry:_="SG",countries:k}=I,s=(bo()||_).toUpperCase(),p=k?.[s]?.redirectSlug??s.toLowerCase(),T=`${y.endsWith("/")?y.slice(0,-1):y}/${p}`,O=(L||qo).replace(/\/$/,""),A=new URLSearchParams({client_id:g,redirect_url:T});return`grab://open?screenType=CONSENT&webviewUrl=${`${O}?${encodeURIComponent(A.toString())}`}&miniapp=true&source=${Ho}`}const Ko="grab://open?screenType=BOOKING&homeAction=SCHEDULE_EXTERNAL",zo={class:"grab-confirmation"},Wo={class:"grab-confirmation-header"},Jo={class:"grab-confirmation-header-title"},Xo={class:"grab-confirmation-esim-section"},Yo={class:"grab-confirmation-esim-section-content"},Zo={class:"grab-confirmation-esim-section-content-icon"},oe={class:"grab-confirmation-advance-booking-section"},ee={class:"grab-confirmation-advance-booking-section-content"},te=Z({__name:"ConfirmationCrossSelling",props:{loyaltyPoints:{},estimatedFiat:{}},setup(I){const{t:g}=eo(),L=q(()=>Qo()),y=()=>{const s=navigator.userAgent;return/iphone|ipad|ipod/i.test(s)?"ios":/android/i.test(s)?"android":"other"},_=()=>{const s=L.value;if(!s)return;const p=y();x("grab_esim_deeplink_clicked",{platform:p,deeplink_url:s});try{window.location.href=s}catch(f){x("grab_esim_deeplink_error",{platform:p,error:f instanceof Error?f.message:String(f)})}},k=()=>{window.location.href=Ko};return(s,p)=>{const f=oo("font-awesome-icon");return r(),c("div",zo,[t("div",Wo,[t("h2",Jo,l(n(g)("confirmation.grab.header")),1)]),t("div",Xo,[p[0]||(p[0]=t("img",{src:"https://cdn.jsdelivr.net/gh/nuitee-white-label/grab-temporary-css@main/esim.svg",alt:"ESIM"},null,-1)),t("section",Yo,[t("h3",null,l(n(g)("confirmation.grab.esimTitle")),1),t("p",null,l(n(g)("confirmation.grab.esimDescription")),1),t("span",Zo,[h(f,{icon:["fas","tag"],style:{color:"#f76708"}}),t("p",null,l(n(g)("confirmation.grab.esimFeature")),1)]),L.value?(r(),v(n(U),{key:0,label:n(g)("confirmation.grab.getEsim"),class:"primary-linear btn radius_sm",onClick:_},null,8,["label"])):m("",!0)])]),t("div",oe,[p[1]||(p[1]=t("img",{src:"https://cdn.jsdelivr.net/gh/nuitee-white-label/grab-temporary-css@main/advance-Booking.svg",alt:"Advance Booking"},null,-1)),t("section",ee,[t("h3",null,l(n(g)("confirmation.grab.advanceBookingTitle")),1),t("p",null,l(n(g)("confirmation.grab.advanceBookingDescription")),1),h(n(U),{label:n(g)("confirmation.grab.scheduleRide"),class:"primary-linear btn radius_sm",onClick:k},null,8,["label"])])])])}}}),ne=Y(te,[["__scopeId","data-v-5c6b7a70"],["__file","ConfirmationCrossSelling.vue"]]),ie={class:"grid-container"},se={class:"confirmation"},ae={class:"confirmation-message"},re={key:1,src:"https://cdn.jsdelivr.net/gh/nuitee-white-label/grab-temporary-css@main/SplashConfirmation.svg",alt:"Grab Confirmation"},le={class:"confirmation-message__text"},ce={key:0},de={class:"confirmation-actions"},ue={key:2,class:"auto-close-message"},me={key:0,class:"loading"}
1,ge={key:1,class:"confirmation-details","data-testid":"confirmation-details-container"},he={class:"confirmation-details-content"},pe={key:0,class:"w-full"},_e={class:"confirmation-details-content__hotel-details"},fe=["src","alt"],ke={class:"confirmation-details-content__hotel-details-content"},ye={key:0,class:"hotel-stars"},be=["data-i"],ve={class:"confirmation-details-content__check-in-out"},we={class:"checkin-box"},Ce={class:"heading"},Ie={class:"item-name"},Le={class:"checkout-box"},Be={class:"heading"},Ee={class:"item-name"},$e={class:"confirmation-details-content__rates-details"},Pe={class:"confirmation-details-content__rates-details_rate__index"},Ue={class:"confirmation-details-content__rates-details_rate__name-detail"},De={key:2,class:"confirmation-details-content__vouchers"},Se={key:0},Re={key:0,class:"confirmation-details-content__vouchers__provider"},Ve={class:"confirmation-details-content__vouchers__provider-content"},Ae=["src","alt"],Ne={class:"confirmation-details-content__vouchers__provider-text"},xe={class:"confirmation-details-content__vouchers__provider-text-title"},Te={class:"confirmation-details-content__vouchers__provider-text-url"},Oe={class:"confirmation-details-content__vouchers__provider-text-date"},Fe=["src","alt"],Me={key:1,class:"confirmation-details-content__vouchers__provider__error"},Ge={class:"confirmation-details-content__vouchers__provider__error-content"},je={class:"error-message"},qe={class:"contactUs"},He={key:4,class:"perk-pills-content w-full"},Qe={class:"confirmation-details-content__BookingId"},Ke={class:"confirmation-bookingId"},ze=Z({__name:"Confirmation",setup(I){const{isGrabPreset:g}=vo(),{isQueryMode:L}=xo(),y=Ro(),_=Lo(),k=Po(),{t:s}=eo(),p=R(P.project?.settings),f=R(!1),T=e=>async i=>{const d=i.addonDetails?.esimply?.purchases[0].end_date.split("T")[0],u=`confirmation.voucherErrorMessage${e.charAt(0).toUpperCase()+e.slice(1)}`;let b=s(u);b===u&&(b=s("confirmation.voucherErrorMessage")),o.vouchers[e]={hasVoucher:!0,voucherUrl:i.status!=="FAILED"?i.addonVoucherCode:"",status:i.status,value:i.originalValue,expiryDate:i.expiryDate||String(d),currency:i.originalCurrency,message:b,qrCode:i.status!=="FAILED"?await Uo(i.addonVoucherCode):""}},O=["uber","esimply"],A={};for(const e of O)A[e]=T(e);const o=J({id:"",booking:null,hotel:null,isLoading:!1,isDownloadingVoucher:!1,occupancies:[],addons:[],roomsBooked:[],bookedRoomsV3:[],nightsDescriptionsV3:[],version:"",liteApiVersionV3:P.liteApiVersion==="v3",email:"",isPayLater:null,confirmationNumber:"",checkin:"",checkout:"",hotelImage:"",stars:0,vouchers:{},perks:[],loyaltyPoints:void 0,loyaltyEstimatedFiat:null}),{downloadVoucher:to}=Mo({setLoading:e=>{o.isDownloadingVoucher=e},externalLink:{isActive:()=>g.value&&So(),openExternalLink:e=>Do().openExternalLink(e)},onError:e=>{console.error("Unable to download/open voucher:",e),y.add({severity:"error",summary:s("confirmation.error"),detail:s("confirmation.retryDownloadVoucher"),life:3e3})}}),w=q(()=>p.value?.confirmationConfig||{}),no=()=>{k.push({path:`/manage-bookings/${o.id}`,query:{email:o.email}})},D=R(0),B=R(null),F=R(!1),C=J({isOpen:!1,selectedIndex:0}),S=q(()=>o.roomsBooked.map(e=>o.hotel?.rooms?.find(i=>i.id===e.mappedRoomId))),io=(e,i)=>P.project.settings?.showCupidRoomName&&S.value[i]?.name&&S.value[i]?.name||e,so=e=>{const i=ao(o.checkin,o.checkout),d=ro(),a=lo(e.adults),u=co(e.children);return`${d} x ${i} ${i>1?s("confirmation.nights"):s("confirmation.night")}, ${a}${u?`, ${u}`:""}`},ao=(e,i)=>X.fromISO(i).diff(X.fromISO(e),"days").days,ro=()=>`1 ${s("confirmation.room")}`,lo=e=>`${e} ${e>1?s("confirmation.adults"):s("confirmation.adult")}`,co=e=>{if(!e||e.length===0)return"";const i=e.map(a=>a===0?"<1y":`${a}y`).join(", ");return`${`${e.length} ${e.length>1?s("confirmation.children"):s("confirmation.child")}`} (${i})`},uo=async()=>{try{o.isLoading=!0;const e=await Bo({id:o.id});o.occupancies=e.occupancies,o.booking=e.booking,o.hotel=e.hotel,o.isPayLater=(e.paymentMethod??"").toLowerCase()==="pay_later",o.version=e.version,o.liteApiVersionV3=e.version==="v3",o.roomsBooked=e.prebooking.roomTypes[0].rates,o.checkin=e.booking?.checkin||"",o.checkout=e.booking?.checkout||"",o.email=e.booking?.holder?.email||"",g.value&&o.id&&o.email&&localStorage.setItem("grab_pending_manage_booking",JSON.stringify({bookingId:o.id,email:o.email})),o.confirmationNumber=e.booking?.supplierBookingId||e.booking?.hotelConfirmationCode||"",o.hotelImage=e.hotel.main_photo,o.stars=e.hotel.stars,o.loyaltyPoints=e.loyaltyPoints,o.loyaltyEstimatedFiat=e.loyaltyEstimatedFiat??null,o.liteApiVersionV3&&(o.bookedRoomsV3=e.booking?.bookedRooms||[],o.nightsDescriptionsV3=e.occupancies.map(so)),o.addons=e.booking.addons,await po();const i={wl_booking_id:o.id,booking_id:o.confirmationNumber,hotel_id:o.hotel?.id,hotel_name:o.hotel?.name,checkin:o.checkin,checkout:o.checkout,price:`${o.booking?.currency} ${o.booking?.price}`,priceInUsd:o.booking?.priceInUsd||0,occupancies:o.occupancies,rooms:o.roomsBooked.length,childrens:o.occupancies.reduce((a,u)=>[...a,...u.children||[]],[]),adults:o.occupancies.reduce((a,u)=>a+(u.adults||0),0),cartId:Eo()},d={Timestamp:new Date(o.booking?.createdAt||Date.now()).toISOString()};x("booking_completed",i,d),$o()}catch(e){console.error("Failed to fetch booking:",e)}finally{o.isLoading=!1}},H=async e=>{const i=jo(s("fileNames.confirmation"),[o.hotel?.name,o.hotel?.city,o.checkin,o.checkout]);
1await to({bookingId:o.id,version:o.version,language:e,filename:i})},mo=()=>{f.value=!0},go=()=>{if(x("booking_voucher_downloaded",{wl_booking_id:o.id,booking_id:o.confirmationNumber,hotel_id:o.hotel?.id,hotel_name:o.hotel?.name,checkin:o.checkin,checkout:o.checkout,price:`${o.booking?.currency} ${o.booking?.price}`,priceInUsd:o.booking?.priceInUsd||0,source:"confirmation_page"}),K.language==="en"){H();return}mo()},ho=e=>{f.value=!1,H(e)},po=async()=>{if(o.addons?.length)for(const e of o.addons){const i=A[e.addon];i?await i(e):console.warn(`Unknown voucher type: ${e.addon}`)}},_o=e=>{C.isOpen=!0,C.selectedIndex=e},Q=e=>{e.preventDefault(),k.push({name:"home"})},fo=()=>{const e=w.value.autoCloseSeconds;!e||e<=0||(D.value=e,F.value=!0,B.value=window.setInterval(()=>{if(D.value--,D.value<=0){const i=w.value.redirectUrl;if(i)try{const d=new URL(i,window.location.origin);d.searchParams.set("bookingId",o.id),d.searchParams.set("fromConfirmation","true"),Object.keys(_.query).forEach(a=>{_.query[a]&&d.searchParams.set(a,_.query[a])}),window.location.href=d.toString()}catch(d){console.error("Error building redirect URL:",d),window.close(),setTimeout(()=>{k.push({name:"home"})},1e3)}else window.close(),setTimeout(()=>{k.push({name:"home"})},1e3)}},1e3))},ko=()=>{B.value&&(clearInterval(B.value),B.value=null);const e=w.value.redirectUrl;if(e)try{const i=new URL(e,window.location.origin);i.searchParams.set("bookingId",o.id),i.searchParams.set("fromConfirmation","true"),Object.keys(_.query).forEach(d=>{_.query[d]&&i.searchParams.set(d,_.query[d])}),window.location.href=i.toString()}catch(i){console.error("Error building redirect URL:",i),window.close(),setTimeout(()=>{k.push({name:"home"})},1e3)}else window.close(),setTimeout(()=>{k.push({name:"home"})},1e3)};return Vo(()=>{o.id=_.params.id,uo(),w.value.autoCloseSeconds&&fo()}),Ao(()=>{window.history.pushState(null,"",window.location.href),window.addEventListener("popstate",Q)}),No(()=>{window.removeEventListener("popstate",Q),B.value&&clearInterval(B.value)}),(e,i)=>{const d=oo("i18n-t");return r(),c(E,null,[h(Go,{visible:f.value,"onUpdate:visible":i[0]||(i[0]=a=>f.value=a),"current-language":n(K).language,loading:o.isDownloadingVoucher,onConfirm:ho},null,8,["visible","current-language","loading"]),C.isOpen?(r(),v(Oo,{key:C.selectedIndex,"show-overlay":C.isOpen,"is-highlighted":n(M)(o.hotel?.id||"",o?.roomsBooked?.[0]?.perks),perks:n(wo)(o.roomsBooked,{sourceRoom:!0}),room:S.value[C.selectedIndex],onClose:i[1]||(i[1]=a=>C.isOpen=!1)},null,8,["show-overlay","is-highlighted","perks","room"])):m("",!0),t("div",ie,[t("div",se,[t("div",ae,[n(g)?(r(),c("img",re)):(r(),v(W,{key:0,name:"splash-confirmation"})),t("span",le,[o.isPayLater!==null?(r(),c("h1",ce,l(p.value?.hidePrices||o.isPayLater?n(s)("confirmation.bookingConfirmed"):n(s)("confirmation.paymentCompleted")),1)):m("",!0),t("p",null,[h(d,{keypath:"confirmation.confirmationEmail",tag:"span"},{email:j(()=>[t("strong",null,l(o.email),1)]),_:1})])]),t("div",de,[h(n(U),{label:n(s)("confirmation.downloadConfirmation"),class:"primary-linear btn radius_sm",icon:"pi pi-download",loading:o.isDownloadingVoucher,onClick:go},null,8,["label","loading"]),h(n(U),{label:n(s)("confirmation.manageMyBooking"),class:"btn radius_sm go-to-manage-booking",onClick:no},null,8,["label"]),F.value?(r(),v(n(U),{key:0,label:w.value.redirectUrl?n(s)("confirmation.continue"):n(s)("confirmation.closeNow"),class:"secondary-btn btn radius_sm",icon:w.value.redirectUrl?"pi pi-arrow-right":"pi pi-times",severity:"secondary",onClick:ko},null,8,["label","icon"])):m("",!0)]),F.value?(r(),c("div",ue,l(w.value.redirectUrl?n(s)("confirmation.redirectingInSeconds",{countdown:D.value}):n(s)("confirmation.windowWillCloseInSeconds",{countdown:D.value})),1)):m("",!0)]),o.isLoading?(r(),c("div",me,i[4]||(i[4]=[t("div",{class:"loader-circle"},null,-1)]))):m("",!0),!o.isLoading&&!n(g)?(r(),c("div",ge,[t("div",he,[n(L)&&(o.booking?.price??0)>0||o.loyaltyPoints&&o.loyaltyPoints>0&&n(Co)("appearance.label")||n(Io)()&&o.loyaltyPoints!=null&&o.loyaltyPoints>0?(r(),c("div",pe,[h(To,{"booking-total":Number(o.booking?.price)||0,Points:o.loyaltyPoints||null,"estimated-fiat":o.loyaltyEstimatedFiat||null,variant:"checkout",inline:!0,class:"w-full flex justify-content-center align-items-center"}
1,null,8,["booking-total","Points","estimated-fiat"])])):m("",!0),t("div",_e,[t("img",{src:o.hotelImage,alt:o.hotel?.name},null,8,fe),t("div",ke,[o.stars?(r(),c("span",ye,[(r(!0),c(E,null,N(Math.floor(o.stars),a=>(r(),c("i",{class:"pi pi-star-fill","data-i":a,key:a},null,8,be))),128))])):m("",!0),t("h2",null,l(o.hotel?.name),1),(r(!0),c(E,null,N(o.nightsDescriptionsV3,(a,u)=>(r(),c("span",{key:u},[i[5]||(i[5]=t("i",{class:"pi pi-users text-500"},null,-1)),V(" "+l(a)+" ",1),i[6]||(i[6]=t("br",null,null,-1))]))),128))])]),h(n($),{type:"dotted"}),t("div",ve,[t("div",we,[t("span",Ce,l(n(s)("confirmation.checkin")),1),t("div",Ie,[t("strong",null,l(n(G)(o.checkin)),1)])]),h(n($),{type:"dotted",align:"center",layout:"vertical"},{default:j(()=>i[7]||(i[7]=[t("span",{class:"divider-text"},[t("i",{class:"pi pi-arrow-right arrow"})],-1)])),_:1}),t("div",Le,[t("span",Be,l(n(s)("confirmation.checkout")),1),t("div",Ee,[t("strong",null,l(n(G)(o.checkout)),1)])])]),h(n($),{type:"dotted"}),t("div",$e,[(r(!0),c(E,null,N(o.roomsBooked,({name:a,mappedRoomId:u},b)=>(r(),c("div",{key:`room-${b}`,class:"confirmation-details-content__rates-details_rate"},[t("div",Pe,[t("span",null,l(n(s)("booking.roomNumber",{number:b+1})),1)]),t("div",Ue,[t("h4",null,l(io(a,b)),1),S.value.length&&S.value.find(yo=>yo?.id===u)?(r(),v(n(U),{key:0,link:"",onClick:()=>_o(b)},{default:j(()=>[V(l(n(s)("booking.roomDetails")),1)]),_:2},1032,["onClick"])):m("",!0)])]))),128))]),o.addons&&o.addons.length>0?(r(),v(n($),{key:1,type:"dotted"})):m("",!0),o.addons&&o.addons.length>0?(r(),c("div",De,[(r(!0),c(E,null,N(o.vouchers,(a,u)=>(r(),c(E,{key:u},[a.hasVoucher?(r(),c("div",Se,[a.status!=="FAILED"?(r(),c("div",Re,[t("div",Ve,[t("img",{src:`/${u}.png`,alt:`${u}-voucher`},null,8,Ae),t("div",Ne,[t("span",xe,[t("span",null,l(u),1),V(" voucher - "+l(a.currency)+" "+l(a.value),1)]),t("span",Te,l(a.voucherUrl),1),t("span",Oe,[V(l(n(s)("confirmation.useBefore"))+" : ",1),t("span",null,l(n(G)(a.expiryDate,"dd MMM yyyy")),1)])])]),a.qrCode?(r(),c("img",{key:0,src:a.qrCode,alt:`${u}-QRcode`,class:"voucher-qr-code",width:"50px"},null,8,Fe)):m("",!0)])):m("",!0),a.status==="FAILED"?(r(),c("div",Me,[t("div",Ge,[h(W,{name:"x-red-close"}),t("span",null,[t("p",je,l(a.message),1),t("p",qe,l(n(s)("confirmation.contactUs")),1)])])])):m("",!0)])):m("",!0)],64))),128))])):m("",!0),o.hotel?.id&&n(M)(o.hotel.id,o?.roomsBooked?.[0]?.perks)&&n(P).project.settings?.showPerksPills?(r(),v(n($),{key:3,type:"dotted"})):m("",!0),o.hotel?.id&&n(M)(o.hotel.id,o?.roomsBooked?.[0]?.perks)&&n(P).project.settings?.showPerksPills&&o?.roomsBooked?.[0]?.perks&&o?.roomsBooked?.[0]?.perks.length>0?(r(),c("div",He,[h(Fo,{title:n(s)("checkout.benefitsIncluded"),perks:o?.roomsBooked?.[0]?.perks||[]},null,8,["title","perks"])])):m("",!0),h(n($),{type:"dotted"}),t("div",Qe,[t("p",Ke,[V(l(n(s)("confirmation.bookingId"))+": ",1),t("span",{ref:"confirmationText",onClick:i[2]||(i[2]=()=>{n(z)(o.confirmationNumber),n(y).add({severity:"success",summary:n(s)("confirmation.success"),detail:n(s)("confirmation.bookingIdCopied"),life:3e3})}),"data-testid":"booking-id"},l(o.confirmationNumber),513),t("i",{class:"pi pi-copy copy-icon",onClick:i[3]||(i[3]=()=>{n(z)(o.confirmationNumber),n(y).add({severity:"success",summary:n(s)("confirmation.success"),detail:n(s)("confirmation.bookingIdCopied"),life:3e3})})})])])])])):m("",!0),n(g)?(r(),v(ne,{key:2,"loyalty-points":o.loyaltyPoints,"estimated-fiat":o.loyaltyEstimatedFiat},null,8,["loyalty-points","estimated-fiat"])):m("",!0)])])],64)}}}),dt=Y(ze,[["__scopeId","data-v-08a31023"],["__file","Confirmation.vue"]]);export{dt as default};

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.