PageSourceSearch

https://abanapratica.lovable.app/assets/obrigado-BNWYoBap.js

js abanapratica.lovable.app collected 2026-10-03 03:18:22 UTC 4,399 bytes, 1 lines download raw bytes

1import{R as b,g,r as o,j as e,L as j}from"./index-BhOmmIz_.js";import{u as y}from"./useServerFn-CjRJ86Lm.js";import{f as N}from"./schemas-C4AiVMbu.js";import{L as C}from"./loader-circle-CHLNGKWV.js";import{c as m}from"./createLucideIcon-B9OsWAtB.js";import{M as w}from"./mail-BBKucEgd.js";const k=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],v=m("circle-check",k);const P=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],A=m("copy",P),I="https://wa.me/5500000000000";function M(){const{order:s}=b.useSearch(),c=y(g),[t,x]=o.useState(null),[p,i]=o.useState(!0),[u,d]=o.useState(!1);if(o.useEffect(()=>{if(!s){i(!1);return}let a=!0;const l=async()=>{const h=await c({data:{orderId:s}});a&&(x(h),i(!1))};l();const f=setInterval(l,1e4);return()=>{a=!1,clearInterval(f)}},[s,c]),o.useEffect(()=>{if(t?.status!=="paid")return;const a=window.fbq;typeof a=="function"&&a("track","Purchase",{value:t.amountCents/100,currency:"BRL",content_name:"ABA na Prática — Kit Completo",content_type:"product"},{eventID:t.id})},[t?.status,t?.id,t?.amountCents]),p)return e.jsx("main",{className:"flex min-h-screen items-center justify-center",children:e.jsx(C,{className:"h-6 w-6 animate-spin text-brand-teal"})});if(!t)return e.jsxs("main",{className:"mx-auto flex min-h-screen max-w-md flex-col items-center justify-center px-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Não encontramos esse pedido."}),e.jsx(j,{to:"/checkout",className:"mt-4 text-sm font-semibold text-primary underline",children:"Voltar ao checkout"})]});const r=t.paymentMethod==="pix",n=t.status==="paid";return e.jsxs("main",{className:"mx-auto max-w-xl px-4 py-10",children:[e.jsxs("div",{className:"rounded-2xl border bg-card p-6 text-center",children:[e.jsx(v,{className:"mx-auto h-12 w-12 text-brand-teal"}),e.jsx("h1",{className:"mt-3 text-2xl font-black",children:n?"Pagamento confirmado!":r?"Falta só o pagamento do PIX":"Pedido recebido"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n?`Enviamos o seu kit para ${t.emailMasked}. Confira também spam e promoções.`:r?"Assim que o PIX for compensado, a entrega é liberada automaticamente por email.":"Estamos processando o seu pagamento. Você receberá um email em instantes."}),e.jsx("p",{className:"mt-3 text-lg font-bold",children:N(t.amountCents)})]}),r&&!n&&e.jsxs("div",{className:"mt-5 rounded-2xl border bg-card p-6",children:[e.jsx("h2",{className:"text-base font-bold",children:"Como pagar"}),e.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Abra o app do seu banco e escolha pagar com PIX."}),e.jsx("li",{children:"Leia o QR Code abaixo ou use o código copia-e-cola."}),e.jsx("li",{children:"Confirme o valor e finalize — a liberação é automática."})]}),t.pixQrCodeUrl&&e.jsx("img",{src:t.pixQrCodeUrl,alt:"QR Code do PIX",width:220,height:220,loading:"lazy",decoding:"async",className:"mx-auto mt-4 h-[220px] w-[220px] rounded-lg border bg-white p-2"}),t.pixQrCode&&e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"break-all rounded-lg bg-secondary p-3 text-xs",children:t.pixQrCode}),e.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(t.pixQrCode??""),d(!0),setTimeout(()=>d(!1),2500)},className:"mt-2 flex w-full items-center justify-center gap-2 rounded-xl bg-brand-lime px-4 py-3 text-sm font-black uppercase text-brand-lime-foreground",children:[e.jsx(A,{className:"h-4 w-4"})," ",u?"Código copiado!":"Copiar código PIX"]})]}),e.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-3 w-full rounded-xl border-2 border-brand-teal px-4 py-3 text-sm font-bold text-brand-teal",children:"Já efetuei o pagamento"})]}),e.jsx("div",{className:"mt-5 rounded-2xl border bg-card p-4 text-sm text-muted-foreground",children:e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(w,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("span",{children:["A entrega é feita por email. Se não encontrar, procure por “ABA na Prática” na caixa de spam ou"," ",e.jsx("a",{href:I,className:"font-semibold text-primary underline",children:"fale conosco no WhatsApp"}),"."]})]})})]})}export{M as component};

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.