PageSourceSearch

https://estaie.com/build/assets/Complete-OIa_suSU.js

js estaie.com collected 2026-09-24 13:15:46 UTC 11,685 bytes, 1 lines download raw bytes

1import{S as R,W as j,U as D,M as V,d as K,P as W,N as F}from"./url-B08cuRnd.js";import{u as H}from"./useAnalytics-C27pRcT6.js";import{E as w}from"./events-F68Qreji.js";import{Q as z,x as P,e as O,D as L,C as G,y as Y,K as Q,c as q,o as u,w as U,d,a as t,n as l,g as y,t as i,f as B,u as e,b as x,E as J,k as M}from"./app-BvX0wXJU.js";import{f as X}from"./utilities-glpkDN0b.js";import{_ as Z}from"./NewAppLayout-B7E4WUfU.js";import{_ as b}from"./GuestDetailAttribute-DxTdsvcc.js";import"./Footer-mv2YaO3Q.js";import"./Navbar-D2ycALSB.js";import"./main-Co-HTiyG.js";import"./country_phone_codes-C3Q5OVnP.js";import"./getUTM-BiPv4UPP.js";import"./useLocale-BkHdFk5i.js";import"./AuthModal-DmB3EU27.js";import"./Modal-BiPtAQ-m.js";/* empty css                                              */import"./store-6rA-1QnX.js";import"./EmailPhone-DZnR4ci2.js";import"./AuthTypeButton-Dnw9_2_V.js";import"./OtpVerify-hQyYATT9.js";import"./moment-C5S46NFB.js";import"./GoBackButton-B3YcsBUv.js";import"./SetPassword-CQu5YqVM.js";import"./SetSuccess-DlGWnSqZ.js";import"./LoginEmailPhone-BX0x54tk.js";import"./PasswordLogin-CZvKomcW.js";import"./ForgotPassword-XwXa6nU8.js";import"./secretKeys-Ddq43D7o.js";import"./BackgroundWorldMap-CJQmKlKM.js";const tt={key:0,class:"max-w-xl mx-auto py-20 px-4 text-center"},et={key:1,class:"max-w-xl mx-auto py-20 px-4 text-center"},ot={key:2,class:"max-w-xl mx-auto py-20 px-4 text-center"},at={class:"text-gray-600 text-sm mb-6"},st={class:"font-mono"},nt={key:3,class:"max-w-5xl mx-auto py-12 px-4"},lt={class:"text-center mb-8"},it={class:"w-16 h-16 mx-auto mb-4 bg-white rounded-full flex items-center justify-center"},rt=["src"],ct={key:0},mt={key:1},ut=["src"],dt={class:"flex justify-between items-start mt-3 font-light text-sm"},pt=["href"],ft=["src"],_t={key:0},yt=["href"],xt={class:"flex flex-col space-y-2"},ht={class:"flex justify-between items-start mt-2 mb-2 font-light text-sm"},vt=["href"],gt={class:"font-normal !mt-0"},kt={class:"font-normal !mt-0"},wt={class:"font-normal !mt-0"},bt={class:"text-sm space-y-1 text-[#333232]"},Ct=["dir"],It={class:"text-gray-600"},$t={class:"font-medium text-[#8c2ee0]"},Tt="failed",Nt=3e3,Ot=12e4,le={__name:"Complete",setup(St){const{trackEvent:h}=H(),S=()=>{const o=s.bookingId||"",a=`booking_confirmed_sent_${o}`;o&&sessionStorage.getItem(a)||o&&sessionStorage.setItem(a,"1")},C=z(),{bookingData:s,propertyData:c}=C.props,n=P(()=>C.props.locale==="ar"),p=O(!!C.props.isConfirmedInit);p.value&&L(S);const I=O(!1),N=O(!1),v=P(()=>C.props.bookingId??(s==null?void 0:s.bookingId)??"");let $=null,T=null;const f=()=>{$&&(clearInterval($),$=null),T&&(clearTimeout(T),T=null)},E=async()=>{var o,a,g,k;if(v.value)try{const{data:r}=await M.get(`/api/booking/${v.value}/status`);if(r!=null&&r.is_confirmed){p.value=!0,f();return}if(r!=null&&r.is_failed||(r==null?void 0:r.status)===Tt){I.value=!0,f();return}if((r==null?void 0:r.payment_type)==="spare"){const m=await M.get(`/api/spare/status/${v.value}`),_=((a=(o=m==null?void 0:m.data)==null?void 0:o.data)==null?void 0:a.state)??((g=m==null?void 0:m.data)==null?void 0:g.state);_==="confirmed"?(p.value=!0,f()):_==="failed"&&(I.value=!0,f())}}catch(r){console.warn("[Complete] booking-status poll failed:",((k=r==null?void 0:r.response)==null?void 0:k.data)??r)}},A=o=>({stripe_pay_once:"credit_debit_card_full_payment",stripe_partial:"partial_payment_installments",tamara:"tamara_buy_now_pay_later",rently:"rently_monthly_installments",pay_at_hotel:"pay_at_hotel",pay_at_crypto:"Pay at Crypto",ccavenue:"CCAvenue",bank_transfer:"Bank Transfer"})[o]||"card_payment";return G(p,o=>{o&&S()}),Y(()=>{if(typeof window<"u"){sessionStorage.removeItem("checkout_idempotency_key");try{for(let o=0;o<sessionStorage.length;o++){const a=sessionStorage.key(o);a&&a.startsWith("checkout_idempotency_key")&&(sessionStorage.removeItem(a),o--)}}catch(o){console.warn("[Complete] failed to clear unit-specific idempotency keys:",o)}}L(()=>{h(w.PURCHASE,{transaction_id:s.bookingId||"",property_id:c.property.id||"",unit_id:c.id||"",property_name:c.property.official_name||c.property.name_to_display||"",unit_type:c.name||"",checkin_date:s.checkInDate||"",checkout_date:s.checkOutDate||"",duration:s.totalNights||30,amount_to_pay:s.totalPrice||0,currency:s.currency||"AED",discount_amount:s.discountAmount||0,coupon_code:s.promoCode||"",coupon_code_id:s.coupon_code_id||"",discount_value:s.discountAmount||0,payment_method:A(s.paymentType)})}),!p.value&&v.value&&(E(),$=setInterval(E,Nt),T=setTimeout(()=>{N.value=!0,f()},Ot))}),Q(f),(o,a)=>(u(),q(Z,{title:"Checkout"},{default:U(()=>{var g,k,r,m;return[!p.value&&!I.value&&!N.value?(u(),d("div",tt,[a[4]||(a[4]=t("div",{class:"w-16 h-16 mx-auto mb-6"}
1,[t("svg",{class:"animate-spin w-full h-full text-[#8c2ee0]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})])],-1)),t("h1",{class:l(["text-2xl font-medium mb-2",[n.value?"font-somar":"font-alexandria"]])}," Finalizing your payment… ",2),a[5]||(a[5]=t("p",{class:"text-gray-600 text-sm"}," Please keep this tab open. This usually takes a few seconds. ",-1))])):I.value?(u(),d("div",et,[...a[6]||(a[6]=[t("h1",{class:"text-2xl font-medium mb-2 text-red-700"}," Payment could not be completed ",-1),t("p",{class:"text-gray-600 text-sm mb-6"}," Your card was not charged. Please try again or contact support if you believe this is a mistake. ",-1),t("a",{href:"/",class:"inline-block bg-[#8c2ee0] text-white font-semibold px-6 py-3 rounded-md"},"Back to home",-1)])])):N.value&&!p.value?(u(),d("div",ot,[t("h1",{class:l(["text-2xl font-medium mb-2",[n.value?"font-somar":"font-alexandria"]])}," Still working on it… ",2),t("p",at,[a[7]||(a[7]=y(" We're verifying your payment with the provider. You'll receive a confirmation email shortly. If you don't hear back within 10 minutes, please contact support with booking reference ",-1)),t("span",st,i(v.value),1),a[8]||(a[8]=y(". ",-1))]),a[9]||(a[9]=t("a",{href:"/",class:"inline-block bg-[#8c2ee0] text-white font-semibold px-6 py-3 rounded-md"},"Back to home",-1))])):(u(),d("div",nt,[t("div",lt,[t("div",it,[t("img",{src:e(R),alt:"Success icon"},null,8,rt)]),t("h1",{id:"booking-confirmed-message",class:l(["text-4xl font-light animate-fade-in",[n.value?"font-somar":"font-alexandria"]])},[e(s).paymentType==="rently"?(u(),d("span",ct,i(o.$t("rently_booking_received")),1)):(u(),d("span",mt,i(o.$t("checkout.congratulations_booking_confirmed")),1))],2),e(s).paymentType==="rently"?(u(),d("p",{key:0,class:l(["text-gray-500 mt-3 text-sm max-w-lg mx-auto leading-relaxed",[n.value?"font-somar":"font-alexandria"]])},i(o.$t("rently_booking_received_note")),3)):B("",!0)]),t("div",{class:l(["w-full flex flex-col md:flex-row gap-6",[n.value?"md:flex-row-reverse":""]])},[t("div",{class:l(["w-full md:w-2/5 space-y-4 bg-white p-6 rounded-xl shadow",[n.value?"text-right":"text-left"]])},[t("img",{src:((k=(g=e(c).property.images)==null?void 0:g[0])==null?void 0:k.url)||((m=(r=e(c).images)==null?void 0:r[0])==null?void 0:m.url),alt:"Apartment",class:"rounded-xl w-full h-64 object-cover"},null,8,ut),t("div",null,[t("h2",{class:l(["text-xl font-semibold",[n.value?"font-somar":"font-alexandria"]])},i(e(c).property.official_name),3),t("h3",{class:l(["text-lg font-medium text-gray-700",[n.value?"font-somar":"font-alexandria"]])},i(e(c).property.subarea)+", "+i(e(c).property.city),3),t("div",dt,[t("div",null,[t("a",{href:"tel:"+e(c).property.phone,onClick:a[0]||(a[0]=_=>e(h)(e(w).CONTACT_AFTER_BOOKING)),class:l(["text-[#8c2ee0] underline flex items-center gap-1",[n.value?"flex-row-reverse":""]])},[t("span",null,[t("img",{src:e(j),alt:"WhatsApp icon"},null,8,ft)]),y(i(e(c).property.phone),1)],10,pt)]),e(c).property.email?(u(),d("div",_t,[t("a",{href:"mailto:"+e(c).property.email,onClick:a[1]||(a[1]=_=>e(h)(e(w).CONTACT_AFTER_BOOKING)),class:l(["text-[#8c2ee0] underline flex items-center gap-1",[n.value?"flex-row-reverse":""]])},[a[10]||(a[10]=t("span",null,[t("img",{src:"/assets/icons/email.png",alt:"Email"})],-1)),y(" "+i(e(c).property.email),1)],10,yt)])):B("",!0)]),t("div",xt,[t("div",ht,[t("div",{class:l(["flex items-center text-sm text-gray-600 mt-1",[n.value?"flex-row-reverse":""]])},[t("span",{class:l([n.value?"ml-1":"mr-1"])},"📍",2),y(" "+i(e(c).property.area),1)],2),t("a",{href:e(c).property.location_link,target:"_blank",onClick:a[2]||(a[2]=_=>e(h)(e(w).VIEW_ON_MAP)),class:l(["text-[#8c2ee0] underline",[n.value?"font-somar":"font-alexandria"]])},i(o.$t("checkout.view_on_map")),11,vt)]),t("div",{class:l(["flex justify-between items-start font-light text-sm text-gray-800 space-y-1",[n.value?"flex-row-reverse font-somar":"font-alexandria"]
1])},[t("span",null,i(o.$t("checkout.check_in_date")),1),t("span",gt,i(e(s).checkInDate),1)],2),t("div",{class:l(["flex justify-between items-start font-light text-sm text-gray-800 space-y-1",[n.value?"flex-row-reverse font-somar":"font-alexandria"]])},[t("span",null,i(o.$t("checkout.check_out_date")),1),t("span",kt,i(e(s).checkOutDate),1)],2),t("div",{class:l(["flex justify-between items-start font-light text-sm text-gray-800 space-y-1",[n.value?"flex-row-reverse font-somar":"font-alexandria"]])},[t("span",null,i(o.$t("checkout.accommodation_type")),1),t("span",wt,i(e(c).name),1)],2)])])],2),t("div",{class:l(["w-full h-2/3 md:w-3/5 space-y-6 bg-white p-6 rounded-xl shadow",[n.value?"text-right":"text-left"]])},[t("div",null,[t("h3",{class:l(["font-normal mb-2",[n.value?"font-somar":"font-alexandria"]])},i(o.$t("checkout.guest_details")),3),t("div",bt,[x(b,{icon:e(D),title:o.$t("checkout.name"),data:e(s).guestName},null,8,["icon","title","data"]),x(b,{icon:e(V),title:o.$t("checkout.e_mail"),data:e(s).guestEmail},null,8,["icon","title","data"]),x(b,{icon:e(K),title:o.$t("checkout.maximum_guests_allowed"),data:`${e(s).guestCount} ${o.$t("checkout.guests")}`},null,8,["icon","title","data"]),x(b,{icon:e(W),title:o.$t("checkout.contact_number"),data:e(s).guestContactNumber},null,8,["icon","title","data"]),x(b,{icon:e(F),title:o.$t("checkout.total_nights"),data:`${e(s).totalNights} ${o.$t("checkout.nights")}`},null,8,["icon","title","data"])])]),t("div",null,[t("div",{class:l(["flex items-center justify-between mt-3 py-3 border-t border-gray-100",[n.value?"flex-row-reverse font-somar":"font-alexandria"]]),dir:n.value?"rtl":"ltr"},[t("span",It,i(o.$t("checkout.payment_mode"))+":",1),t("span",$t,i(o.$t(A(e(s).paymentType))),1)],10,Ct),t("div",{class:l(["flex items-center justify-between",[n.value?"flex-row-reverse":""]])},[t("h3",{class:l(["font-normal text-2xl",[n.value?"font-somar":"font-alexandria"]])},i(o.$t("checkout.payment_details")),3),t("div",{class:l(["flex justify-between items-center text-lg space-x-4",[n.value?"flex-row-reverse space-x-reverse":""]])},[t("div",{class:l(["font-semibold text-gray-900",[n.value?"font-somar":"font-alexandria"]])},i(e(s).currency)+" "+i(e(X)(e(s).discountAmount?e(s).totalPrice-e(s).discountAmount:e(s).totalPrice)),3)],2)],2),x(e(J),{href:"/",as:"button",onClick:a[3]||(a[3]=_=>e(h)(e(w).BACK_TO_HOME)),class:l(["my-4 w-full rounded-lg text-white font-medium py-3 bg-gradient-to-b from-fuchsia-500 to-purple-600 text-sm shadow-md hover:opacity-90 transition",[n.value?"font-somar":"font-alexandria"]])},{default:U(()=>[y(i(o.$t("checkout.back_to_home")),1)]),_:1},8,["class"]),t("p",{class:l(["text-xs text-gray-500 italic",[n.value?"font-somar text-right":"font-alexandria text-left"]])},i(o.$t("checkout.confirmation_sent_to_email")),3)])],2)],2)]))]}),_:1}))}};export{le 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.