1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4159],{1628:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(2806).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},2806:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(2115);let r=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),l=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:o="",children:i,iconNode:c,...d},m)=>(0,a.createElement)("svg",{ref:m,...n,width:t,height:t,stroke:e,strokeWidth:l?24*Number(s)/Number(t):s,className:r("lucide",o),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(i)?i:[i]])),i=(e,t)=>{let s=(0,a.forwardRef)(({className:s,...n},i)=>(0,a.createElement)(o,{ref:i,iconNode:t,className:r(`lucide-${l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...n}));return s.displayName=l(e),s}},2874:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>w});var a=s(5155),r=s(2115),l=s(8500),n=s.n(l),o=s(3321),i=s(6296),c=s(4961),d=s(2806);let m=(0,d.A)("receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);var x=s(4514);let u=(0,d.A)("copy",[["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"}]]);var h=s(1628),f=s(5772),p=s(6256),b=s(8713);function j(){let e=(0,o.useSearchParams)().get("session_id"),t=(0,o.useParams)(),s=t?.locale||"en",l=(0,o.useRouter)(),[d,p]=(0,r.useState)(!1),[j,w]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!0),[N,y]=(0,r.useState)(null);return((0,r.useEffect)(()=>{w(!0),(async()=>{if(!e)return l.push(`/${s}/dashboard`);let t=(0,b.U)();try{let{data:s,error:a}=await t.from("payments").select("*").eq("stripe_session_id",e).single();if(a||!s){console.error("Could not find payment record:",a),v(!1);return}let{data:r,error:l}
1=await t.from("profiles").select("credits").eq("id",s.user_id).single();l&&console.error("Could not find profile record:",l),y({reference:`#INV-${s.id.slice(0,8).toUpperCase()}`,date:new Date(s.created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}),amountPaid:`$${(s.amount_paid/100).toFixed(2)}`,creditsPurchased:`+${s.credits_awarded} Credits`,totalBalance:`${r?.credits||0} Credits Available`,packName:"Credit Pack"})}catch(e){console.error("Error fetching success details:",e)}finally{v(!1)}})()},[e,s,l]),g)?(0,a.jsxs)("div",{className:"max-w-2xl mx-auto px-6 pt-32 pb-24 relative z-10 flex flex-col items-center justify-center",children:[(0,a.jsx)(i.A,{className:"w-12 h-12 text-emerald-500 animate-spin mb-4"}),(0,a.jsx)("h2",{className:"text-xl font-bold text-stone-900",children:"Validating your purchase..."}),(0,a.jsx)("p",{className:"text-stone-500 font-medium",children:"This should only take a moment."})]}):N||g?(0,a.jsx)("div",{className:"max-w-2xl mx-auto px-6 pt-12 pb-24 relative z-10",children:(0,a.jsxs)("div",{className:`transition-all duration-700 ease-out transform ${j?"translate-y-0 opacity-100":"translate-y-12 opacity-0"}`,children:[(0,a.jsxs)("div",{className:"flex flex-col items-center text-center mb-10",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center mb-6 relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-emerald-400/20 rounded-full animate-ping opacity-50 blur-2xl"}),(0,a.jsx)(f.default,{src:"/assets/characters/salty-thankyou.png",alt:"Thank you for your purchase!",width:220,height:220,className:"object-contain relative z-10 drop-shadow-2xl animate-float transition-transform hover:scale-105"})]}),(0,a.jsx)("h1",{className:"text-4xl md:text-5xl font-black text-stone-900 mb-4 tracking-tight",children:"Payment Successful!"}),(0,a.jsx)("p",{className:"text-lg text-stone-500 font-medium max-w-md mx-auto",children:"Thank you for your purchase. Your credits have been added to your account and are ready to use."})]}),(0,a.jsxs)("div",{className:"bg-white rounded-[2rem] p-8 md:p-10 border-2 border-stone-100 shadow-xl shadow-stone-200/50 mb-10 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute top-0 left-0 w-full h-1.5 bg-gradient-to-r from-emerald-400 to-teal-400"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-8 pb-6 border-b border-stone-100",children:[(0,a.jsx)("div",{className:"p-2 bg-stone-50 rounded-xl",children:(0,a.jsx)(m,{className:"w-5 h-5 text-stone-400"})}),(0,a.jsx)("h2",{className:"text-xl font-bold text-stone-900",children:"Order Summary"})]}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-2",children:[(0,a.jsx)("span",{className:"text-stone-400 font-bold text-sm uppercase tracking-wider",children:"Order Reference"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 group cursor-pointer",onClick:()=>{N&&(navigator.clipboard.writeText(N.reference),p(!0),setTimeout(()=>p(!1),2e3))},children:[(0,a.jsx)("span",{className:"text-stone-900 font-bold font-mono",children:N?.reference}),d?(0,a.jsx)(x.A,{className:"w-4 h-4 text-emerald-500"}):(0,a.jsx)(u,{className:"w-4 h-4 text-stone-300 group-hover:text-stone-500 transition-colors"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-2",children:[(0,a.jsx)("span",{className:"text-stone-400 font-bold text-sm uppercase tracking-wider",children:"Date"}),(0,a.jsx)("span",{className:"text-stone-700 font-medium",children:N?.date})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-2",children:[(0,a.jsx)("span",{className:"text-stone-400 font-bold text-sm uppercase tracking-wider",children:"Amount Paid"}),(0,a.jsx)("span",{className:"text-stone-900 font-black text-lg",children:N?.amountPaid})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-2",children:[(0,a.jsx)("span",{className:"text-stone-400 font-bold text-sm uppercase tracking-wider",children:"Pack Type"}),(0,a.jsxs)("span",{className:"inline-flex items-center px-3 py-1 bg-emerald-50 text-emerald-700 font-black text-sm rounded-full border border-emerald-100",children:[N?.packName," (",N?.creditsPurchased,")"]})]}),(0,a.jsx)("div",{className:"pt-6 border-t border-stone-100 mt-2",children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center gap-2 bg-stone-50 p-4 rounded-2xl",children:[(0,a.jsx)("span",{className:"text-stone-500 font-bold text-sm",children:"Total Credit Balance"}),(0,a.jsx)("span",{className:"text-stone-900 font-black text-xl",children:N?.totalBalance})]})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4 mb-12",children:[(0,a.jsxs)(n(),{href:`/${s}/dashboard`,className:"w-full sm:w-auto flex-1 h-14 text-base font-bold rounded-2xl bg-stone-900 hover:bg-black text-white shadow-lg hover:shadow-xl transition-all hover:-translate-y-0.5 group flex items-center justify-center",children:["Go to Dashboard",(0,a.jsx)(h.A,{className:"w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform"})]}),(0,a.jsx)(n(),{href:`/${s}/dashboard`,className:"w-full sm:w-auto flex-1 h-14 text-base font-bold rounded-2xl border-2 border-stone-200 text-stone-600 hover:bg-stone-50 hover:text-stone-900 transition-all flex items-center justify-center",children:"View Billing History"})]}),(0,a.jsxs)("div",{className:"text-center flex items-center justify-center gap-2 text-stone-400 text-sm font-medium",children:[(0,a.jsx)(c.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Didn't receive your credits or have a question?"}),(0,a.jsx)("a",{href:"mailto:[email protected]",className:"text-emerald-600 hover:text-emerald-700 font-bold underline underline-offset-4 decoration-emerald-200 hover:decoration-emerald-500 transition-colors",children:"Contact Support"})]})]})}):(0,a.jsxs)("div",{className:"max-w-2xl mx-auto px-6 pt-32 pb-24 relative z-10 flex flex-col items-center justify-center text-center",children:[(0,a.jsx)(c.A,{className:"w-16 h-16 text-stone-300 mb-6"}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-stone-900 mb
1-2",children:"Order Not Found"}),(0,a.jsx)("p",{className:"text-stone-500 font-medium mb-8",children:"We couldn't find the details for this transaction. It may still be processing."}),(0,a.jsx)(n(),{href:`/${s}/dashboard`,className:"px-8 py-3 bg-stone-900 text-white font-bold rounded-full hover:bg-stone-800 transition-colors",children:"Go to Dashboard"})]})}function w(){return(0,a.jsxs)("main",{className:"min-h-screen bg-[#FDFBF7] font-sans selection:bg-emerald-100 selection:text-emerald-900 overflow-hidden relative",children:[(0,a.jsxs)("div",{className:"absolute inset-0 pointer-events-none isolate -z-10",children:[(0,a.jsx)("div",{className:"absolute top-[-10%] left-[20%] bg-emerald-100/40 w-[600px] h-[600px] rounded-full blur-[120px] animate-float"}),(0,a.jsx)("div",{className:"absolute bottom-[10%] right-[10%] bg-stone-100/50 w-[500px] h-[500px] rounded-full blur-[100px] animate-float animation-delay-2000"}),(0,a.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full h-full opacity-[0.02] pointer-events-none bg-[url('https://www.transparenttextures.com/patterns/carbon-fibre.png')]"})]}),(0,a.jsx)("header",{className:"max-w-7xl mx-auto px-6 py-8 relative z-10 flex",children:(0,a.jsx)(p.default,{})}),(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-[50vh] flex items-center justify-center",children:"Loading..."}),children:(0,a.jsx)(j,{})})]})}},3321:(e,t,s)=>{"use strict";var a=s(4645);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},4305:(e,t,s)=>{Promise.resolve().then(s.bind(s,2874))},4514:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(2806).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4961:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(2806).A)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},6256:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var a=s(5155),r=s(910),l=s(5772),n=s(8599);function o({className:e,size:t="md",dark:s=!0}){return(0,a.jsx)("div",{className:(0,n.cn)("rounded-full flex items-center justify-center shadow-xl transition-transform hover:rotate-12 duration-300",s?"bg-stone-900 text-white shadow-stone-200":"bg-white text-stone-900 border border-stone-100",{sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10",xl:"w-12 h-12"}[t],e),children:(0,a.jsx)("div",{className:"relative w-3/4 h-3/4",children:(0,a.jsx)(l.default,{src:"/favicon.png",alt:"Salty Logo",fill:!0,className:"object-contain"})})})}function i({className:e,logoSize:t="md",textClassName:s,showText:l=!0}){let i=(0,r.c)("Page");return(0,a.jsxs)("div",{className:(0,n.cn)("inline-flex items-center gap-3",e),children:[(0,a.jsx)(o,{size:t}),l&&(0,a.jsx)("h1",{className:(0,n.cn)("font-serif italic font-bold text-3xl tracking-tight text-stone-900",s),children:i("brandName")})]})}},6296:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(2806).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},8599:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var a=s(9722),r=s(622);function l(...e){return(0,r.QP)((0,a.$)(e))}},8713:(e,t,s)=>{"use strict";s.d(t,{U:()=>r});var a=s(6622);function r(){return(0,a.createBrowserClient)("https://kbeccokbdooquqasetqk.supabase.co","sb_publishable_Gh2OMx9opPjKaFnw5s7Tqg_gkKv8xY6")}}},e=>{e.O(0,[3418,1396,8500,8933,6622,8441,8928,7358],()=>e(e.s=4305)),_N_E=e.O()}]);
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.