1import{ax as le,e3 as re,j as t,e4 as me,ay as ue,e as fe,g as a,aG as pe,e5 as ge,ba as r,O as ye,d as _e,e2 as he,e6 as xe,U as Se}from"./index-CblQD1wt.js";import{A as be,F as Ae}from"./index.esm-Cy4qiN7E.js";const je=()=>{const n=Ie(),i=fe(),[s,m]=a.useState(""),[u,ee]=a.useState(""),[te]=pe();function ae(){try{return JSON.parse(localStorage.getItem(r.BOOKING_DATA))}catch{return null}}const o=ae(),[f,d]=a.useState(!1),[oe,ne]=a.useState(""),[c,l]=a.useState(2),[p,g]=a.useState(!1),{confirmReservation:ie}=ge(),y=te.get("reference"),ce=async()=>{f===!1&&(d(!0),_e.get("payments/verify_payment",{timeout:6e4,params:{payment_intent_id:y}}).then(e=>{var _,h,x,S,b,A,j,I,v,E,O,C,N,T,R,k,P,z,D,W,L,U,$,w,B,M,F,G,K,J,Y,H,Q,V,X,q;if(d(!1),((_=e==null?void 0:e.data)==null?void 0:_.success)===!1)ne(!0),m((x=(h=e==null?void 0:e.data)==null?void 0:h.data)==null?void 0:x.booking_code);else{if(((A=(b=(S=e==null?void 0:e.data)==null?void 0:S.data)==null?void 0:b.sub_source)==null?void 0:A.name)===he&&((I=(j=e==null?void 0:e.data)==null?void 0:j.data)!=null&&I.booking_code)){const se=(O=(E=(v=e==null?void 0:e.data)==null?void 0:v.data)==null?void 0:E.sub_source)==null?void 0:O.id,de=`https://www.tagserve.com/saleServlet?MID=1003&PID=1694&ORDERID=${(N=(C=e==null?void 0:e.data)==null?void 0:C.data)==null?void 0:N.booking_code}&ORDERAMNT=${(R=(T=e==null?void 0:e.data)==null?void 0:T.data)==null?void 0:R.pre_tax_amount}&NUMOFITEMS=1&CUR=${(P=(k=e==null?void 0:e.data)==null?void 0:k.data)==null?void 0:P.currency}&RID=${se}`,Z=new Image(1,1);Z.src=de,document.body.appendChild(Z)}((W=(D=(z=e==null?void 0:e.data)==null?void 0:z.data)==null?void 0:D.sub_source)==null?void 0:W.id)===xe&&localStorage.removeItem(r.POINT_OF_SALE),Se({event:"Purchase",type:"RESERVATION",booking_code:(U=(L=e==null?void 0:e.data)==null?void 0:L.data)==null?void 0:U.booking_code,amount:(w=($=e==null?void 0:e.data)==null?void 0:$.data)==null?void 0:w.total_amount,currency:(M=(B=e==null?void 0:e.data)==null?void 0:B.data)==null?void 0:M.currency,sub_source_id:(K=(G=(F=e==null?void 0:e.data)==null?void 0:F.data)==null?void 0:G.sub_source)==null?void 0:K.id,sub_source_name:(H=(Y=(J=e==null?void 0:e.data)==null?void 0:J.data)==null?void 0:Y.sub_source)==null?void 0:H.name}),g(!0),l(2),m((V=(Q=e==null?void 0:e.data)==null?void 0:Q.data)==null?void 0:V.booking_code),ee((q=(X=e==null?void 0:e.data)==null?void 0:X.data)==null?void 0:q.last_name),ie()}}).catch(()=>{d(!1)}))};return a.useEffect(()=>{ce()},[y]),a.useEffect(()=>{if(p){if(c===0&&(i(`/manage-booking?booking_code=${s}&name=${u}`),localStorage.removeItem(r.BOOKING_DATA),l(null),g(!1)),!c)return;const e=setInterval(()=>{l(c-1)},1e3);return()=>clearInterval(e)}},[c,p,s,u]),f?t.jsx("div",{className:n.root,children:t.jsx("section",{className:"container success_body",children:t.jsxs("div",{style:{paddingTop:43,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[t.jsx(ye,{className:"spin-icon",size:45}),t.jsx("p",{style:{fontSize:"1.3rem",marginTop:"1rem",fontWeight:"bolder"},children:"Payment in process..."}),t.jsx("p",{style:{fontSize:"0.7rem",color:"#7A7A7A",fontWeight:"bolder"},children:"Please donât refresh this page."})]})})}):oe?t.jsx("div",{className:n.root,children:t.jsx("section",{className:"container success_body",children:t.jsxs("div",{style:{paddingTop:43,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[t.jsx(be,{style:{color:"BA4F54"},size:45}),t.jsx("p",{style:{fontSize:"1.3rem",marginTop:"1rem",fontWeight:"bolder"},children:"Payment Failed"}),t.jsx("p",{style:{fontSize:"0.7rem",color:"#7A7A7A",fontWeight:"bolder"},children:"Redirecting you to previous page..."}),t.jsx("div",{style:{fontSize:"0.7rem",color:"#7A7A7A",fontWeight:"bolder"},children:"If you are not being forwarded"}),t.jsx("div",{style:{fontSize:"0.7rem",color:"var(--accent-primary-100)",fontWeight:"bolder",cursor:"pointer"},onClick:()=>i(`/property/payment-deprecated?booking_code=${s}`),children:"CLICK HERE"})]})})}):t.jsx("div",{className:n.root,children:t.jsx("section",{className:"container success_body",children:t.jsxs("div",{style:{paddingTop:43,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[t.jsx(Ae,{style:{color:"#56A02E"},size:45}),t.jsx("p",{style:{fontSize:"1.3rem",marginTop:"1rem",fontWeight:"bolder"},children:"Payment Successful"}),t.jsxs("p",{style:{fontSize:"0.7rem",color:"#7A7A7A",fontWeight:"bolder"},children:["Forwarding in ",c,".."]}),t.jsx("div",{style:{fontSize:"0.7rem",color:"#7A7A7A",fontWeight:"bolder"},children:"If you are not being forwarded"}),t.jsx("div",{style:{fontSize:"0.7rem",color:"var(--accent-primary-100)",fontWeight:"bolder",cursor:"pointer"},onClick:()=>i(`/manage-booking?booking_code=${o==null?void 0:o.booking_code}&name=${o==null?void 0:o.booking_guest_name}`),children:"CLICK HERE"})]})})})}
1,Ie=ue({root:{marginTop:40,"@media (min-width:900px)":{marginTop:100}}}),Oe=()=>{const n={appearance:{theme:"stripe"}},i=le.useRef(re("pk_live_51JM95YDCtGXYhBg7OxM2brlJvIOzBUqtTANUALlONnGAGkW4KPItxphpQDmxaJ4QuovgK5XxwIPa31ejToezGZ9P00Of8vkKtC"));return t.jsx(me,{options:n,stripe:i.current,children:t.jsx(je,{})})};export{Oe 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.