import{c as e,n as t,r as n,t as r}from"./Seo-DIwHowcX.js";import{B as i,C as a,G as o,J as s,V as c,j as l,l as u}from"./index-BaX9Wv38.js";var d=e(n(),1),f=t();function p(){let[e]=s(),t=i(l),n=e.get(`ref`)??``,p=e.get(`status`)===`success`,[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(!n){_(!0);return}a(n).then(h).finally(()=>_(!0))},[n]);let v=m?m.status===`paid`:p;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r,{title:`Payment result — Touch Therapies Antigua`,description:`Your booking deposit payment result.`}),(0,f.jsx)(`section`,{className:`grid min-h-[70vh] place-items-center bg-sand px-4 py-24`,children:(0,f.jsx)(`div`,{className:`w-full max-w-lg rounded-[28px] bg-white p-10 text-center shadow-soft`,children:g?v?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{className:`mx-auto mb-5 text-palm-500`,width:56,height:56}),(0,f.jsx)(`h1`,{className:`mb-3 text-[1.8rem] text-forest-700`,children:`Deposit received — thank you!`}),(0,f.jsx)(`p`,{className:`mb-2 text-muted`,children:m?(0,f.jsxs)(f.Fragment,{children:[`Your US$`,m.amount,` deposit for `,(0,f.jsx)(`strong`,{className:`text-ink`,children:m.item_name}),` is confirmed.`]}):`Your booking deposit is confirmed.`}),n&&(0,f.jsxs)(`p`,{className:`mb-6 text-[0.9rem] text-muted`,children:[`Booking reference: `,n]}),(0,f.jsx)(`p`,{className:`mb-6 text-[0.9rem] text-muted`,children:`We'll contact you shortly to confirm your appointment time.`}),(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-3`,children:[(0,f.jsx)(`a`,{href:c(t),className:`btn-primary`,children:`Confirm on WhatsApp`}),(0,f.jsx)(o,{to:`/`,className:`btn-outline`,children:`Back to home`})]})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`mx-auto mb-5 grid h-14 w-14 place-items-center rounded-full bg-terra-400/15 text-[1.6rem] text-terra-500`,children:`!`}),(0,f.jsx)(`h1`,{className:`mb-3 text-[1.8rem] text-forest-700`,children:`The payment didn't go through`}),(0,f.jsxs)(`p`,{className:`mb-6 text-muted`,children:[`No charge was completed`,n?(0,f.jsxs)(f.Fragment,{children:[` for booking `,n]}):null,`. You can try again, or message us and we'll arrange your booking another way.`]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-3`,children:[(0,f.jsx)(o,{to:`/treatments`,className:`btn-primary`,children:`Try again`}),(0,f.jsx)(`a`,{href:c(t),className:`btn-outline`,children:`WhatsApp us`})]})]}):(0,f.jsx)(`p`,{className:`text-muted`,children:`Checking your payment…`})})})]})}export{p as default};