import{j as e,_ as t,r as ls,s as u,d as q}from"./wp-i18n-shim-DUX0OV_V.js";import{C as Ke}from"./Calender-GA8AQSPY.js";import{C,b as A,a as S,c as E}from"./card-CNcjg1NV.js";import{B as J}from"./Button-BveKhP38.js";import{B as f}from"./badge-DBj5X-b5.js";import{c as X,a as g,X as is}from"./utils-Bl0WAcve.js";import{E as bs}from"./Eye-3n4RqNN4.js";import{S as ds,a as ns,b as cs,c as os,f as T}from"./select-BFNitOb0.js";import{C as gs}from"./checkbox-CQ-dG0Dh.js";import{c as U,d as js,u as fs,o as xs,L as Ns,M as ps}from"./index-D01LF5Le.js";import{A as ys,a as vs,b as ks}from"./avatar-kVfFVfuh.js";import{f as j,a as L}from"./dateTimeFormat-yH4yHSCh.js";import{T as ws}from"./ticket-Cc7QZFVF.js";import{C as _s}from"./withIconDefaults-BJCqj2oX.js";import{c as Fs,b as W,C as Ds,V as es}from"./CalenderCheck-2TB2QVYq.js";import{S as l}from"./skeleton-DfFmlQ5i.js";import{L as o}from"./label-CwRAQd0m.js";import{S as R}from"./separator-BQS_7xs6.js";import{u as ss,s as G,a as Cs}from"./store-rDqSxbzb.js";import{C as Z}from"./calendar-Cz3-D5io.js";import{P as Ss}from"./PaymentSection-Ds2_2QsE.js";import{f as k}from"./priceFormatter-Dg4GlACg.js";import{F as $s}from"./file-text-D1bHRDDM.js";import{C as Ps}from"./circle-check-big-Bxgqw2u9.js";import{D as ts}from"./dollar-sign-Bnksw8VW.js";/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const As=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ts=X("badge-check",As);/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bs=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Y=X("server",Bs);/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ms=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],ms=X("user-round",Ms),O={confirmed:"bg-green-100 text-green-700 border-green-200",pending:"bg-yellow-100 text-yellow-700 border-yellow-200",cancelled:"bg-red-100 text-red-700 border-red-200",completed:"bg-blue-100 text-primary border-blue-200"},Es={confirmed:t("Confirmed","radius-booking"),pending:t("Pending","radius-booking"),cancelled:t("Cancelled","radius-booking"),completed:t("Completed","radius-booking")};function as({appointment:a,onStatusChange:s,isSelected:$,onSelectToggle:B}){var P,I,z;const F=c=>j(c),p=c=>L(c),M=(c,h)=>{const m=new Date(`2000-01-01T${c}`),d=(new Date(`2000-01-01T${h}`).getTime()-m.getTime())/(1e3*60),n=Math.floor(d/60),x=d%60;return n>0&&x>0?`${n}h ${x}m`:n>0?`${n}h`:`${x}m`},y=(P=a==null?void 0:a.customer)==null?void 0:P.customer_info;return e.jsxs("div",{className:g("bg-white border border-border rounded-[10px] hover:shadow-lg transition-all duration-200 border-l-4 border-l-primary overflow-hidden",$&&"ring-2 ring-primary/30 bg-primary/[0.02]"),children:[e.jsx("div",{className:"p-[19px_15px]",children:e.jsxs("div",{className:"flex items-left justify-between gap-8 flex-col xl:flex-row",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0 flex-wrap",children:[B&&e.jsx("div",{className:"flex items-center",onClick:c=>c.stopPropagation(),children:e.jsx(gs,{checked:$,onCheckedChange:()=>B(a.id)})}),e.jsxs("div",{className:"lg:flex-1 min-w-[80px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:t("Appointment ID","radius-booking")}),e.jsxs("div",{className:"font-bold text-sm text-primary",children:["#",a.id]})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:t("Customer Name","radius-booking")}),e.jsx("div",{className:"font-medium text-sm text-title2",children:y==null?void 0:y.name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[80px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:(a==null?void 0:a.booking_type)==="meeting"?t("Meeting","radius-booking"):(a==null?void 0:a.booking_type)==="event"?t("Event","radius-booking"):t("Service","radius-booking")}),e.jsx("div",{className:"font-medium text-sm text-title2",children:(a==null?void 0:a.booking_type)==="meeting"?(a==null?void 0:a.meeting_type_name)||t("Meeting","radius-booking"):(a==null?void 0:a.booking_type)==="event"?(a==null?void 0:a.event_name)||`Event #${a==null?void 0:a.event_id}`:a==null?void 0:a.service_name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:t("Staff","radius-booking")}),e.jsx("div",{className:"text-sm font-medium text-title",children:a==null?void 0:a.employee_name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[100px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:t("Date","radius-booking")}),e.jsx("div",{className:"font-medium text-sm text-title2",children:F(a==null?void 0:a.appointment_date)})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:t("Time","radius-booking")}),e.jsxs("div",{className:"font-medium text-sm text-title2",children:[p(a.start_time)," - ",p(a.end_time)," (",M(a.start_time,a.end_time),")"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 flex-shrink-0",children:[e.jsxs(ds,{value:a.status,onValueChange:c=>s(a.id,c),children:[e.jsx(ns,{className:"min-h-[31px] w-[120px] relative shadow-none border-none focus:border-none focus:outline-none focus:shadow-none",children:e.jsx(cs,{children:e.jsx("span",{className:g("status-label-abs",`font-medium py-1 px-3 rounded-md text-xs  border ${O[a.status]}`),children:Es[a.status]||a.status})})}),e.jsxs(os,{children:[e.jsx(T,{value:"confirmed",children:e.jsx(f,{className:g("font-semibold capitalize text-xs border",O.confirmed),children:t("Confirmed","radius-booking")})}),e.jsx(T,{value:"pending",children:e.jsx(f,{className:g("font-semibold capitalize text-xs border",O.pending),children:t("Pending","radius-booking")})}),e.jsx(T,{value:"cancelled",children:e.jsx(f,{className:g("font-semibold capitalize text-xs border",O.cancelled),children:t("Cancelled","radius-booking")})}),e.jsx(T,{value:"completed",children:e.jsx(f,{className:g("font-semibold capitalize text-xs border",O.completed),children:t("Completed","radius-booking")})})]})]}),e.jsx(U,{to:`/appointment/${a.id}/details`,children:e.jsxs(J,{variant:"outline",size:"sm",className:"gap-1 text-title2 border-border hover:bg-blue-50 hover:border-blue-400 hover:text-primary transition-colors",children:[e.jsx(bs,{}),e.jsx("span",{className:"text-[13px]",children:t("Details","radius-booking")})]})})]})]})}),(a==null?void 0:a.booking_type)==="event"&&((I=a==null?void 0:a.event_tickets)==null?void 0:I.length)>0&&e.jsx("div",{className:"px-[15px] py-2 bg-[#FAFBFC] border-t border-border/60",children:e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ws,{className:"w-3.5 h-3.5 text-slate-400"}),a.event_tickets.map((c,h)=>e.jsxs("span",{className:"text-[12px] bg-slate-100 text-slate-600 px-2 py-0.5 rounded font-medium",children:[c.quantity,"x ",c.ticket_name,c.price>0&&` (${a.currency_symbol||"$"}${(c.price*c.quantity).toFixed(2)})`]},h))]}),((z=a.payment)==null?void 0:z.status)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("span",{className:g("text-[11px] font-medium px-2 py-0.5 rounded border",a.payment.status==="paid"?"bg-green-50 text-green-700 border-green-200":a.payment.status==="pending"?"bg-amber-50 text-amber-700 border-amber-200":"bg-red-50 text-red-700 border-red-200"),children:a.payment.status==="paid"?t("Paid","radius-booking"):a.payment.status==="pending"?t("Payment Pending","radius-booking"):a.payment.status.charAt(0).toUpperCase()+a.payment.status.slice(1)})]}),a.event_tickets.some(c=>c.checked_in_at)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("span",{className:"text-[11px] font-medium px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",children:t("Checked In","radius-booking")})]})]})})]})}function ot({date:a,appointments:s,onStatusChange:$,defaultExpanded:B=!0,groupingType:F="date",selectedIds:p,onSelectToggle:M,renderRow:y}){const[P,I]=ls.useState(B),z=m=>{const i=new Date(m),d=new Date;switch(F){case"week":{const n=new Date(i);n.setDate(i.getDate()+6);const x=new Date(d);return x.setDate(d.getDate()-d.getDay()),i.toDateString()===x.toDateString()?t("This Week","radius-booking"):u(t("Week of %1$s - %2$s","radius-booking"),j(i),j(n))}case"month":{const n=d.getMonth(),x=d.getFullYear();return i.getMonth()===n&&i.getFullYear()===x?t("This Month","radius-booking"):j(i,"F Y")}default:{const n=new Date(d);n.setDate(n.getDate()+1);const x=new Date(d);return x.setDate(x.getDate()-1),i.toDateString()===d.toDateString()?t("Today","radius-booking"):i.toDateString()===n.toDateString()?t("Tomorrow","radius-booking"):i.toDateString()===x.toDateString()?t("Yesterday","radius-booking"):j(i)}}},h=(()=>{const m=s.reduce((i,d)=>(i[d.status]=(i[d.status]||0)+1,i),{});return{total:s.length,confirmed:m.confirmed||0,pending:m.pending||0,cancelled:m.cancelled||0,completed:m.completed||0}})();return e.jsxs(C,{className:"rtrb-card overflow-hidden rounded-[15px]",children:[e.jsx(A,{className:"pb-3",children:e.jsxs(J,{variant:"ghost",onClick:()=>I(!P),className:"w-full justify-between p-0 h-auto hover:bg-transparent",children:[e.jsxs("div",{className:"flex gap-3 flex-1 flex-wrap",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"bg-primary/10 rounded-lg flex pt-[7px]",children:e.jsx(Ke,{size:"20px",className:"text-primary"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-lg font-semibold text-title whitespace-pre-wrap",children:z(a)}),e.jsxs("p",{className:"text-sm text-title2 font-normal",children:[F==="date"?a:F==="week"?u(q("%d appointment this week","%d appointments this week",s.length,"radius-booking"),s.length):u(q("%d appointment this month","%d appointments this month",s.length,"radius-booking"),s.length)," • ",u(t("%d total","radius-booking"),h.total)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:ml-auto",children:[h.confirmed>0&&e.jsx(f,{className:"bg-green-100 text-green-800 text-xs",children:u(t("%d confirmed","radius-booking"),h.confirmed)}),h.pending>0&&e.jsx(f,{className:"bg-yellow-100 text-yellow-800 text-xs",children:u(t("%d pending","radius-booking"),h.pending)}),h.cancelled>0&&e.jsx(f,{className:"bg-red-100 text-red-800 text-xs",children:u(t("%d cancelled","radius-booking"),h.cancelled)}),h.completed>0&&e.jsx(f,{className:"bg-blue-100 text-primary text-xs",children:u(t("%d completed","radius-booking"),h.completed)})]})]}),e.jsx("div",{className:"flex items-center gap-4",children:P?e.jsx(_s,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Fs,{className:"w-5 h-5 text-muted-foreground"})})]})}),P&&e.jsx(S,{className:"pt-0",children:e.jsx("div",{className:"space-y-3",children:F==="week"||F==="month"?(()=>{const m=s.reduce((i,d)=>{const n=d.appointment_date;return i[n]||(i[n]=[]),i[n].push(d),i},{});return Object.entries(m).sort(([i],[d])=>i.localeCompare(d)).map(([i,d])=>e.jsxs("div",{className:"space-y-2 ",children:[e.jsxs("div",{className:"flex items-center gap-2 py-2 border-b border-border/50",children:[e.jsx(Ke,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("h4",{className:"font-medium text-sm",children:j(i)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",u(q("%d appointment","%d appointments",d.length,"radius-booking"),d.length),")"]})]}),e.jsx("div",{className:"space-y-2",children:d.sort((n,x)=>n.start_time.localeCompare(x.start_time)).map(n=>{const x=y||as;return e.jsx(x,{appointment:n,onStatusChange:$,isSelected:p==null?void 0:p.has(n.id),onSelectToggle:M},n.id)})})]},i))})():s.map(m=>{const i=y||as;return e.jsx(i,{appointment:m,onStatusChange:$,isSelected:p==null?void 0:p.has(m.id),onSelectToggle:M},m.id)})})})]})}function xt({defaultExpanded:a=!0,appointmentCount:s=3,showSubGroups:$=!1}){return e.jsx("div",{className:"bg-white border border-border rounded-[10px] border-l-4 border-l-primary/20 overflow-hidden",children:e.jsx("div",{className:"p-[19px_15px]",children:e.jsxs("div",{className:"flex items-center justify-between gap-8 flex-col lg:flex-row",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 flex-wrap",children:[e.jsxs("div",{className:"flex-1 min-w-[80px]",children:[e.jsx(l,{className:"h-3 w-16 mb-2"}),e.jsx(l,{className:"h-4 w-12"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(l,{className:"h-3 w-20 mb-2"}),e.jsx(l,{className:"h-4 w-28"})]}),e.jsxs("div",{className:"flex-1 min-w-[80px]",children:[e.jsx(l,{className:"h-3 w-14 mb-2"}),e.jsx(l,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(l,{className:"h-3 w-12 mb-2"}),e.jsx(l,{className:"h-4 w-24"})]}),e.jsxs("div",{className:"flex-1 min-w-[100px]",children:[e.jsx(l,{className:"h-3 w-10 mb-2"}),e.jsx(l,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(l,{className:"h-3 w-10 mb-2"}),e.jsx(l,{className:"h-4 w-32"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx(l,{className:"h-[31px] w-[120px] rounded-md"}),e.jsx(l,{className:"h-[36px] w-[90px] rounded-md"})]})]})})})}function rs(){return e.jsx("main",{className:"min-h-screen",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{className:"h-8 w-48 mb-2"}),e.jsx(l,{className:"h-4 w-64"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"h-[48px] w-40 rounded-md"}),e.jsx(l,{className:"h-[48px] w-32 rounded-md"})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(Z,{className:"w-5 h-5 text-primary/40"}),e.jsx(l,{className:"h-6 w-56"})]})}),e.jsxs(S,{className:"pt-6 space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[1,2,3,4].map(a=>e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-4",children:[e.jsx(l,{className:"h-4 w-4 rounded-full"}),e.jsx(l,{className:"h-4 w-32"})]}),e.jsx(l,{className:"h-5 w-40 mb-3"}),e.jsx(l,{className:"h-[29px] w-full max-w-[200px] rounded-[5px]"})]},a))}),e.jsx(R,{}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(l,{className:"h-4 w-24"}),e.jsx(l,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"text-right flex-1 space-y-2",children:[e.jsx(l,{className:"h-4 w-24 ml-auto"}),e.jsx(l,{className:"h-5 w-32 ml-auto"})]})]})]})]}),e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(ms,{className:"w-5 h-5 text-primary/40"}),e.jsx(l,{className:"h-6 w-48"})]})}),e.jsx(S,{className:"pt-6 space-y-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[1,2,3,4].map(a=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{className:"h-4 w-28"}),e.jsx(l,{className:"h-6 w-48"})]},a))})})]})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(W,{className:"w-5 h-5 text-primary/40"}),e.jsx(l,{className:"h-6 w-48"})]})}),e.jsxs(S,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx(l,{className:"h-4 w-24"}),e.jsx(l,{className:"h-4 w-16"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(l,{className:"h-4 w-32"}),e.jsx(l,{className:"h-4 w-20"})]}),e.jsx(R,{}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(l,{className:"h-5 w-20"}),e.jsx(l,{className:"h-5 w-24"})]})]}),e.jsx(l,{className:"h-12 w-full rounded-md mt-4"})]})]})})]})]})})}const H={confirmed:"bg-green-100 text-green-800 border-green-200",completed:"bg-green-600 text-white border-green-600",pending:"bg-yellow-100 text-yellow-800 border-yellow-200",cancelled:"bg-red-100 text-red-800 border-red-200"},Is={confirmed:e.jsx(Ps,{className:"w-4 h-4"}),completed:e.jsx(Ts,{className:"w-4 h-4"}),pending:e.jsx(xs,{className:"w-4 h-4"}),cancelled:e.jsx(is,{className:"w-4 h-4"})},zs={paid:"bg-green-100 text-green-800",pending:"bg-yellow-100 text-yellow-800",failed:"bg-red-100 text-red-800",refunded:"bg-purple-100 text-purple-800",partially_paid:"bg-blue-100 text-primary"};function mt(){var c,h,m,i,d,n,x,Q,K,ee,se,te,ae,re,le,ie,de,ne,ce,oe,xe,me,ue,he,be,ge,je,fe,Ne,pe,ye,ve,ke,we,_e,Fe,De,Ce,Se,$e,Pe,Ae,Te,Be,Me,Ee,Ie,ze,Le,Oe,Re,Ue;const{id:a}=js();fs();const s=ss(r=>r(G).getAppointment(),[]),$=ss(r=>r(G).getAppointmentLoading(),[]),{getAppointment:B,setAppointmentData:F,updateAppointmentStatus:p}=Cs(G);ls.useEffect(()=>{let r=!1;async function b(){r||(r=!0,await B(a))}a&&b()},[a,B]);const M=r=>j(r),y=r=>L(r),P=(r,b)=>{const w=new Date(`2000-01-01T${r}`),D=(new Date(`2000-01-01T${b}`).getTime()-w.getTime())/(1e3*60),_=Math.floor(D/60),v=D%60;return _>0&&v>0?`${_}h ${v}m`:_>0?`${_} hour${_>1?"s":""}`:`${v} minutes`},I=r=>{s&&(F({...s,status:r,updated_at:new Date().toISOString()}),p(s.id,r))},z=r=>{switch(r){case"credit_card":return e.jsx(W,{className:"w-4 h-4"});case"offline":return e.jsx(ts,{className:"w-4 h-4"});default:return e.jsx(ts,{className:"w-4 h-4"})}};return $?e.jsx(rs,{}):s?e.jsx(e.Fragment,{children:Object.keys(s).length===0?e.jsx(rs,{}):e.jsx("main",{className:"min-h-screen ",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-[24px] font-semibold text-title mb-1",children:u(t("Appointment #%s","radius-booking"),s.id)}),e.jsx("p",{className:"text-small-font",children:t("View and manage appointment details","radius-booking")})]}),e.jsxs("div",{className:"flex flx-wrap items-center gap-3",children:[s.notify_customer==="1"&&e.jsxs(f,{variant:"secondary",className:"bg-[#F5FAFF] text-primary text-sm border-[#BDCFFF] h-[40px] lg:h-[48px] px-4 items-center justify-center",children:[e.jsx(xs,{className:"w-4 h-4 mr-1 text-primary mt-[2px]"}),e.jsx("span",{className:"whitespace-nowrap",children:t("Notifications On","radius-booking")})]}),e.jsxs(f,{className:g("text-sm py-2 font-medium h-[40px] lg:h-[48px] px-4 gap-1",H[s.status]),children:[Is[s.status],{confirmed:t("Confirmed","radius-booking"),completed:t("Completed","radius-booking"),pending:t("Pending","radius-booking"),cancelled:t("Cancelled","radius-booking")}[s.status]||s.status]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"xl:col-span-1 2xl:col-span-2 space-y-6",children:[e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(Z,{className:"w-5 h-5 text-primary"}),t("Appointment Information","radius-booking")]})}),e.jsxs(S,{className:"pt-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(Ds,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:t("Date & Time","radius-booking")})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:M(s.appointment_date)}),e.jsxs("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:[y(s.start_time)," - ",y(s.end_time),"(",P(s.start_time,s.end_time),")"]})]}),e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(Ns,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:(s==null?void 0:s.booking_type)==="meeting"?t("Host","radius-booking"):(s==null?void 0:s.booking_type)==="event"?t("Organizer","radius-booking"):t("Service Provider","radius-booking")})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsxs(ys,{className:"w-12 h-12",children:[e.jsx(vs,{src:s.employee_image,alt:s.employee_name}),e.jsx(ks,{className:"bg-gray-100 text-title font-medium",children:(c=s.employee_name)==null?void 0:c.split(" ").map(r=>r[0]).join("")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-title ",children:s.employee_name}),e.jsx("p",{className:"text-sm text-title2",children:u(t("%1$s ID: #%2$s","radius-booking"),(s==null?void 0:s.booking_type)==="meeting"||(s==null?void 0:s.booking_type)==="event"?t("Host","radius-booking"):t("Staff","radius-booking"),s.employee_id)})]})]})]}),(s==null?void 0:s.booking_type)==="meeting"?e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(Y,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:t("Meeting Type","radius-booking")})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.meeting_type_name||t("N/A","radius-booking")}),e.jsx("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:u(t("Meeting Type ID: #%s","radius-booking"),s.meeting_type_id)})]}):(s==null?void 0:s.booking_type)==="event"?e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(Y,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:t("Event","radius-booking")})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.event_name||u(t("Event #%s","radius-booking"),s.event_id)}),e.jsx("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:u(t("Event ID: #%s","radius-booking"),s.event_id)})]}):e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(Y,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:t("Service","radius-booking")})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.service_name}),e.jsx("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:u(t("Service ID: #%s","radius-booking"),s.service_id)})]}),s.location_info&&e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(ps,{className:"w-4 h-4 text-primary"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:t("Location","radius-booking")})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2",children:((m=(h=s.location_info)==null?void 0:h.name)==null?void 0:m.trim())||u(t("Location #%s","radius-booking"),s.location_id)}),e.jsx("p",{className:"text-sm text-title2 mt-1 ",children:(i=s.location_info)==null?void 0:i.address}),e.jsx("p",{className:"text-sm text-title2 mt-1 break-all",children:(d=s.location_info)==null?void 0:d.phone})]}),((n=s.meeting_link)==null?void 0:n.join_url)&&e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-2",children:[e.jsx(es,{className:"w-4 h-4 text-[#2D8CFF]"}),e.jsx(o,{className:"text-[16px] font-medium text-title2",children:s.meeting_link.provider==="google_calendar"?t("Google Meet","radius-booking"):t("Zoom Meeting","radius-booking")})]}),e.jsxs("a",{href:s.meeting_link.join_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-[#2D8CFF] text-white text-sm font-medium rounded-md hover:bg-[#1a73e8] transition-colors",children:[e.jsx(es,{className:"w-4 h-4"}),t("Join Meeting","radius-booking")]}),s.meeting_link.start_url&&e.jsx("a",{href:s.meeting_link.start_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 ml-2 bg-white text-[#2D8CFF] text-sm font-medium rounded-md border border-[#2D8CFF] hover:bg-[#EBF5FF] transition-colors",children:t("Start as Host","radius-booking")})]})]}),s.notes&&e.jsxs("div",{className:"p-4 bg-gray-50 border border-border rounded-lg",children:[e.jsxs(o,{className:"text-sm font-medium text-title2 flex items-center gap-2",children:[e.jsx($s,{className:"w-4 h-4"}),t("Notes","radius-booking")]}),e.jsx("p",{className:"mt-2 text-title",children:s.notes})]}),e.jsx(R,{}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(o,{className:"text-sm font-medium text-title2",children:t("Update Status","radius-booking")}),e.jsxs(ds,{value:s.status,onValueChange:I,children:[e.jsx(ns,{children:e.jsx(cs,{})}),e.jsxs(os,{children:[e.jsx(T,{value:"pending",children:t("Pending","radius-booking")}),e.jsx(T,{value:"confirmed",children:t("Confirmed","radius-booking")}),e.jsx(T,{value:"completed",children:t("Completed","radius-booking")}),e.jsx(T,{value:"cancelled",children:t("Cancelled","radius-booking")})]})]})]}),e.jsxs("div",{className:"text-right flex-1",children:[e.jsx(o,{className:"text-sm font-medium text-title2",children:t("Last Updated","radius-booking")}),e.jsx("p",{className:"text-sm font-medium text-title",children:s!=null&&s.updated_at?`${j(s.updated_at)} ${L(new Date(s.updated_at))}`:""})]})]}),(s==null?void 0:s.parent_appointment)&&e.jsxs("div",{children:["Parent Appointment ID: ",e.jsxs(U,{to:`/appointment/${s.parent_appointment}/details`,className:"underline text-primary",children:["#",s.parent_appointment]})]})]})]}),e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(ms,{className:"w-5 h-5 text-primary"}),t("Customer Information","radius-booking")]})}),e.jsxs(S,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("Customer Name","radius-booking")}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:(Q=(x=s.customer)==null?void 0:x.customer_info)!=null&&Q.first_name&&((ee=(K=s==null?void 0:s.customer)==null?void 0:K.customer_info)!=null&&ee.last_name)?`${(se=s==null?void 0:s.customer.customer_info)==null?void 0:se.first_name} ${(ae=(te=s==null?void 0:s.customer)==null?void 0:te.customer_info)==null?void 0:ae.last_name}`:t("Not provided","radius-booking")})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font flex items-center gap-1",children:t("Email","radius-booking")}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:((le=(re=s==null?void 0:s.customer)==null?void 0:re.customer_info)==null?void 0:le.email)||t("Not provided","radius-booking")})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("Customer ID","radius-booking")}),e.jsxs("p",{className:"text-lg font-semibold text-title mt-1",children:["#",(ie=s.customer)==null?void 0:ie.customer_id]})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font flex items-center gap-1",children:t("Number of Persons","radius-booking")}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:((de=s==null?void 0:s.customer)==null?void 0:de.persons)>1?parseInt((ne=s==null?void 0:s.customer)==null?void 0:ne.persons)+1:1})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("Booking Token","radius-booking")}),e.jsx("p",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded mt-1",children:(ce=s.customer)==null?void 0:ce.token})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("UTC Offset","radius-booking")}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:(oe=s.customer)==null?void 0:oe.utc_offset})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("Customer Status","radius-booking")}),e.jsx("div",{children:e.jsx(f,{className:g("mt-1",H[(xe=s==null?void 0:s.customer)==null?void 0:xe.status]),children:{confirmed:t("Confirmed","radius-booking"),completed:t("Completed","radius-booking"),pending:t("Pending","radius-booking"),cancelled:t("Cancelled","radius-booking")}[(me=s.customer)==null?void 0:me.status]||((ue=s.customer)==null?void 0:ue.status)})})]}),e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:t("Duration (min)","radius-booking")}),e.jsxs("p",{className:"text-lg font-semibold text-title mt-1",children:[((he=s==null?void 0:s.customer)==null?void 0:he.duration)/60,"m"]})]})]}),((be=s==null?void 0:s.payment)==null?void 0:be.coupon_code)&&e.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-lg",children:[e.jsx(o,{className:"text-sm font-medium text-green-800",children:t("Coupon Applied","radius-booking")}),e.jsxs("p",{className:"text-green-700 font-mono mt-1",children:[s.payment.coupon_code,parseFloat(((ge=s==null?void 0:s.payment)==null?void 0:ge.discount_amount)||0)>0&&e.jsxs("span",{className:"ml-2 text-green-600 text-sm",children:["(-",k(parseFloat(s.payment.discount_amount).toFixed(2),s.currency),")"]})]})]}),(()=>{var w;const r=(w=s.customer)==null?void 0:w.custom_info,b=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];return b.length?e.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[e.jsx("h4",{className:"text-sm font-semibold text-title mb-3",children:t("Custom Fields","radius-booking")}),e.jsx("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-4",children:b.map((N,D)=>e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium text-small-font",children:N.label}),e.jsx("p",{className:"text-base font-semibold text-title mt-1",children:N.type==="checkbox"?(N.value||"").split("||").join(", "):N.value})]},N.field_id||D))})]}):null})()]})]}),(s==null?void 0:s.child_appointments)&&s.child_appointments.length>0&&e.jsxs(C,{className:"shadow-sm border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border",children:e.jsxs(E,{className:"flex items-center gap-2 text-xl text-title",children:[e.jsx(Z,{className:"w-5 h-5 text-title2"}),t("Recurring Appointments","radius-booking")]})}),e.jsx(S,{className:"pt-3",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2",children:t("ID","radius-booking")}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[150px]",children:t("Date","radius-booking")}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[100px]",children:t("Start Time","radius-booking")}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[100px]",children:t("End Time","radius-booking")}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2",children:t("Status","radius-booking")})]})}),e.jsx("tbody",{children:s.child_appointments.map(r=>e.jsxs("tr",{className:"border-b border-border hover:bg-gray-50",children:[e.jsx("td",{className:"py-3 px-4 text-sm underline text-blue-500",children:e.jsxs(U,{to:`/appointment/${r.id}/details`,children:["#",r.id]})}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:M(r.appointment_date)}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:y(r.start_time)}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:y(r.end_time)}),e.jsx("td",{className:"py-3 px-4",children:e.jsx(f,{className:g("text-xs font-medium px-2 py-1",H[r.status]),children:{confirmed:t("Confirmed","radius-booking"),completed:t("Completed","radius-booking"),pending:t("Pending","radius-booking"),cancelled:t("Cancelled","radius-booking")}[r.status]||r.status})})]},r.id))})]})})})]})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs(C,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(A,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(E,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(W,{className:"text-primary w-5 h-5"}),t("Payment Details","radius-booking"),(s==null?void 0:s.dynamic_pricing)&&e.jsx("span",{className:"ml-2 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-semibold bg-blue-100 text-blue-700 border border-blue-200",children:t("Dynamic Pricing Applied","radius-booking")})]})}),e.jsxs(S,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 rtrb-card  rounded-[13px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:((je=s==null?void 0:s.customer)==null?void 0:je.persons)>1?t("Price per Person","radius-booking"):(s==null?void 0:s.booking_type)==="meeting"?t("Meeting Price","radius-booking"):(s==null?void 0:s.booking_type)==="event"?t("Event Price","radius-booking"):t("Service Price","radius-booking")}),e.jsx("span",{className:g("font-bold break-all",s!=null&&s.dynamic_pricing?"text-sm line-through text-title2":"text-xl text-title"),children:(()=>{var D,_,v;const r=parseFloat((D=s==null?void 0:s.customer)==null?void 0:D.price)||0,b=parseFloat((_=s==null?void 0:s.payment)==null?void 0:_.total_amount)||0,w=parseFloat((v=s==null?void 0:s.payment)==null?void 0:v.discount_amount)||0,N=r>0?r:b+w;return k(N.toFixed(2),s.currency)})()})]}),(s==null?void 0:s.dynamic_pricing)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsxs("span",{className:"text-sm font-medium text-blue-700 inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-blue-500"}),t("Dynamic Adjusted Price","radius-booking")]}),e.jsx("span",{className:"text-xl font-bold text-blue-700 break-all",children:k(parseFloat(s.dynamic_pricing.final_price).toFixed(2),s.currency)})]}),e.jsx("div",{className:"mb-3 p-2.5 bg-blue-50 border border-blue-200 rounded-lg",children:s.dynamic_pricing.applied_rules.map((r,b)=>e.jsxs("div",{className:"flex justify-between items-center text-xs",children:[e.jsxs("span",{className:"text-blue-700 font-medium",children:[r.name,e.jsxs("span",{className:"text-blue-500 ml-1",children:["(",r.adjustment_type==="percentage"?`${r.adjustment_value}%`:"fixed",")"]})]}),e.jsxs("span",{className:g("font-semibold",r.calculated>=0?"text-red-600":"text-emerald-600"),children:[r.calculated>=0?"+":"",k(parseFloat(Math.abs(r.calculated)).toFixed(2),s.currency)]})]},b))})]}),((fe=s==null?void 0:s.customer)==null?void 0:fe.persons)>1&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:t("Number of Persons","radius-booking")}),e.jsxs("span",{className:"text-lg font-semibold text-title",children:["× ",parseInt(s.customer.persons)+1]})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:t("Subtotal","radius-booking")}),e.jsx("span",{className:"text-lg font-semibold text-title break-all",children:k((parseFloat((Ne=s==null?void 0:s.customer)==null?void 0:Ne.price)*(parseInt(s.customer.persons)+1)).toFixed(2),s.currency)})]})]}),((pe=s==null?void 0:s.payment)==null?void 0:pe.coupon_code)&&parseFloat(((ye=s==null?void 0:s.payment)==null?void 0:ye.discount_amount)||0)>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:t("Coupon Applied","radius-booking")}),e.jsx("span",{className:"text-sm font-semibold text-emerald-600 font-mono",children:s.payment.coupon_code})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:t("Discount","radius-booking")}),e.jsxs("span",{className:"text-lg font-semibold text-emerald-600 break-all",children:["-",k(parseFloat(s.payment.discount_amount).toFixed(2),s.currency)]})]})]}),(()=>{var Ve,qe,Ge,Ye,He,We,Ze,Je,Xe,Qe;const r=parseFloat(((Ve=s==null?void 0:s.payment)==null?void 0:Ve.tax_amount)||0),b=parseFloat(((qe=s==null?void 0:s.payment)==null?void 0:qe.total_amount)||0),w=parseFloat(((Ge=s==null?void 0:s.payment)==null?void 0:Ge.amount)||0),N=parseFloat(((Ye=s==null?void 0:s.payment)==null?void 0:Ye.due_amount)||0),D=parseFloat(((He=s==null?void 0:s.payment)==null?void 0:He.discount_amount)||0),_=(We=s==null?void 0:s.payment)==null?void 0:We.tax_rate,v=!!((Je=(Ze=window.radius_booking_param)==null?void 0:Ze.tax_settings)!=null&&Je.inclusive),us=((Qe=(Xe=window.radius_booking_param)==null?void 0:Xe.tax_settings)==null?void 0:Qe.label)||"Tax",V=r>0,hs=V&&!v?b-r:b;return e.jsxs(e.Fragment,{children:[(D>0||V&&!v)&&e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:t("Subtotal","radius-booking")}),e.jsx("span",{className:"text-lg font-semibold text-title break-all",children:k(hs.toFixed(2),s.currency)})]}),V&&e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:u(t("%1$s (%2$d%%)%3$s","radius-booking"),us,_,v?" "+t("(incl.)","radius-booking"):"")}),e.jsxs("span",{className:"text-sm font-semibold text-title2 break-all",children:[v?"":"+",k(r.toFixed(2),s.currency)]})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-title",children:t("Total","radius-booking")}),e.jsx("span",{className:"text-xl font-bold text-title break-all",children:k(b.toFixed(2),s.currency)})]}),w>0&&(s.payment.payment_method!=="offline"||N>0)&&e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:w>=b?t("Paid","radius-booking"):s.payment.payment_method==="offline"?t("Deposit Required","radius-booking"):t("Deposit Paid","radius-booking")}),e.jsx("span",{className:"text-lg font-semibold text-green-600 break-all",children:k(w.toFixed(2),s.currency)})]}),N>0&&e.jsxs("div",{className:"flex justify-between items-center pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-red-600",children:t("Due Amount","radius-booking")}),e.jsx("span",{className:"text-lg font-semibold text-red-600 break-all",children:k(N.toFixed(2),s.currency)})]})]})})()]}),e.jsx(R,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Payment Status","radius-booking")}),e.jsx(f,{className:g("text-xs font-medium px-2 py-1",zs[((ve=s==null?void 0:s.payment)==null?void 0:ve.status)==="partial_payment"?"partially_paid":(ke=s==null?void 0:s.payment)==null?void 0:ke.status]),children:{partial_payment:t("Partially Paid","radius-booking"),paid:t("Paid","radius-booking"),pending:t("Pending","radius-booking"),failed:t("Failed","radius-booking"),refunded:t("Refunded","radius-booking")}[(we=s==null?void 0:s.payment)==null?void 0:we.status]||((_e=s==null?void 0:s.payment)==null?void 0:_e.status)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Payment Method","radius-booking")}),e.jsxs("div",{className:"flex items-center gap-2",children:[z((Fe=s==null?void 0:s.payment)==null?void 0:Fe.payment_method),e.jsx("span",{className:"text-sm font-medium capitalize",children:(Ce=(De=s==null?void 0:s.payment)==null?void 0:De.payment_method)==null?void 0:Ce.replace("_"," ")})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Payment ID","radius-booking")}),e.jsxs("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:["#",(Se=s==null?void 0:s.payment)==null?void 0:Se.id]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Booking ID","radius-booking")}),e.jsxs("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:["#",($e=s==null?void 0:s.payment)==null?void 0:$e.booking_id]})]}),((Pe=s==null?void 0:s.payment)==null?void 0:Pe.transaction_id)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Transaction ID","radius-booking")}),e.jsx("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:(Ae=s==null?void 0:s.payment)==null?void 0:Ae.transaction_id})]}),((Te=s==null?void 0:s.payment)==null?void 0:Te.invoice_id)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Invoice ID","radius-booking")}),e.jsx("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:(Be=s==null?void 0:s.payment)==null?void 0:Be.invoice_id})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Booking Type","radius-booking")}),e.jsx("span",{className:"text-sm capitalize text-title",children:(Me=s==null?void 0:s.payment)==null?void 0:Me.booking_type})]}),((Ee=s==null?void 0:s.payment)==null?void 0:Ee.paid_at)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Payment Date","radius-booking")}),e.jsx("span",{className:"text-xs text-title",children:j((Ie=s==null?void 0:s.payment)==null?void 0:Ie.paid_at)})]}),((ze=s==null?void 0:s.payment)==null?void 0:ze.cancelled_at)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Cancelled Date","radius-booking")}),e.jsx("span",{className:"text-xs text-title",children:j((Le=s==null?void 0:s.payment)==null?void 0:Le.cancelled_at)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:t("Booking Date & Time","radius-booking")}),e.jsx("span",{className:"text-xs text-title",children:(Oe=s==null?void 0:s.payment)!=null&&Oe.booking_date_time?`${j(s.payment.booking_date_time)} ${L(new Date(s.payment.booking_date_time))}`:""})]})]}),e.jsx(R,{}),e.jsx(Ss,{appointment:s}),e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("div",{className:"text-xs text-title2 space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:t("Created:","radius-booking")}),e.jsx("span",{children:(Re=s==null?void 0:s.payment)!=null&&Re.created_at?`${j(s.payment.created_at)} ${L(new Date(s.payment.created_at))}`:""})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:t("Updated:","radius-booking")}),e.jsx("span",{children:(Ue=s==null?void 0:s.payment)!=null&&Ue.updated_at?`${j(s.payment.updated_at)} ${L(new Date(s.payment.updated_at))}`:""})]})]})})]})]})})]})]})})}):e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx(C,{className:"p-6 text-center shadow-lg",children:e.jsxs(S,{className:"pt-6",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center",children:e.jsx(is,{className:"w-8 h-8 text-red-600"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:t("Appointment Not Found","radius-booking")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:t("The appointment you're looking for doesn't exist.","radius-booking")}),e.jsx(U,{to:"/appointments",children:e.jsx(J,{children:t("Back to Appointments","radius-booking")})})]})})})}export{xt as A,as as a,ot as b,mt as c};
//# sourceMappingURL=AppointmentDetails-Bsk5sW_z.js.map
