PageSourceSearch

https://nashobahub-prod.onrender.com/assets/confirmation-Dyhtsyyt.js

js nashobahub-prod.onrender.com collected 2026-10-03 11:43:16 UTC 5,739 bytes, 1 lines download raw bytes

1import{bD as p,o as u,a as N,r as y,j as e,a9 as v,C as a,a4 as r,B as d,aV as h,at as j,a1 as n,a2 as i,a$ as g,an as b,am as w,Q as C,q as k}from"./index-CU4TP-S4.js";import{C as P}from"./clock-BHlwe1eO.js";import{P as R}from"./phone-CZ9u2qu_.js";import{f as S}from"./format-Dvax21W1.js";function E(t){const[s,c]=t.split(":").map(Number),l=s>=12?"PM":"AM";return`${s===0?12:s>12?s-12:s}:${c.toString().padStart(2,"0")} ${l}`}function Q(){const{id:t}=p(),{data:s,isLoading:c}=u({queryKey:["/api/resy/reservations",t]}),l=N({mutationFn:async o=>C("POST",`/api/confirm-payment/${t}`,{paymentIntentClientSecret:o}),onSuccess:()=>{k.invalidateQueries({queryKey:["/api/resy/reservations",t]})}});y.useEffect(()=>{const x=new URLSearchParams(window.location.search).get("payment_intent_client_secret");x&&s&&s.status==="pending"&&l.mutate(x)},[s]);const{data:m,isLoading:f}=u({queryKey:["/api/resy/experiences",s==null?void 0:s.experienceId],enabled:!!s});return c||f?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(v,{className:"w-8 h-8 animate-spin text-primary"})}):!s||!m?e.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",children:e.jsx(a,{className:"max-w-md w-full",children:e.jsxs(r,{className:"pt-6 text-center",children:[e.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"Reservation not found"}),e.jsx(d,{asChild:!0,"data-testid":"button-home",children:e.jsx(h,{href:"/reservations",children:"Return to Reservations"})})]})})}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(j,{className:"w-16 h-16 text-green-600 mx-auto mb-4"}),e.jsx("h1",{className:"font-serif text-3xl md:text-4xl font-semibold mb-2",children:"Reservation Confirmed!"}),e.jsxs("p",{className:"text-lg text-muted-foreground",children:["Thank you for your reservation. A confirmation email has been sent to"," ",e.jsx("span",{className:"font-medium text-foreground",children:s.customerEmail})]})]}),e.jsxs(a,{className:"mb-6",children:[e.jsx(n,{children:e.jsx(i,{children:"Reservation Details"})}),e.jsx(r,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(j,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Experience"}),e.jsx("p",{className:"font-semibold",children:m.name})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(g,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Date"}),e.jsx("p",{className:"font-semibold",children:S(new Date(s.reservationDate),"EEEE, MMMM d, yyyy")})]})]}),s.reservationTime&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(P,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Time"}),e.jsx("p",{className:"font-semibold",children:E(s.reservationTime)})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(b,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s.ticketQuantity?"Tickets":"Party Size"}),e.jsxs("p",{className:"font-semibold",children:[s.ticketQuantity||s.partySize,s.ticketQuantity?" tickets":" guests"]})]})]})]})})]}),e.jsxs(a,{className:"mb-6",children:[e.jsx(n,{children:e.jsx(i,{children:"Contact Information"})}),e.jsxs(r,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:s.customerEmail})]}),s.customerPhone&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(R,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:s.customerPhone})]})]})]}),s.totalAmount&&e.jsxs(a,{className:"mb-6",children:[e.jsx(n,{children:e.jsx(i,{children:"Payment Summary"})}),e.jsx(r,{children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-lg font-medium",children:"Total Paid"}),e.jsxs("span",{className:"text-2xl font-semibold text-green-600",children:["$",parseFloat(s.totalAmount).toFixed(2)]})]})})]}),s.specialRequests&&e.jsxs(a,{className:"mb-6",children:[e.jsx(n,{children:e.jsx(i,{children:"Special Requests"})}),e.jsx(r,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:s.specialRequests})})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsx(d,{className:"flex-1",asChild:!0,"data-testid":"button-home",children:e.jsx(h,{href:"/reservations",children:"Return to Reservations"})}),e.jsx(d,{variant:"outline",className:"flex-1",onClick:()=>window.print(),"data-testid":"button-print",children:"Print Confirmation"})]}),e.jsx("div",{className:"mt-8 p-4 bg-muted rounded-md",children:e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Please arrive 10 minutes before your scheduled time. If you need to make changes to your reservation, please contact us."})})]})})}export{Q 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.