1import{d as j,u as N,C as S,j as B,c as r,a as e,b as D,w as C,f as t,t as n,r as m,F,s as L,g as V,x as u,_ as O,o as d,e as q}from"./Bo1oA5K4.js";import{u as z}from"./BnGMaeR_.js";import{u as A}from"./DMJlbxhV.js";const I={class:"min-h-screen bg-theme-secondary py-8 pb-24"},P={class:"max-w-2xl mx-auto px-4"},R={key:0,class:"bg-theme-card rounded-2xl shadow p-8 text-center text-theme-accent animate-pulse border border-theme"},T={key:1,class:"bg-theme-card rounded-2xl shadow p-8 text-center text-theme-secondary border border-theme"},E={key:2,class:"bg-theme-card rounded-2xl shadow-xl p-8 space-y-8 border border-theme"},M={class:"text-2xl font-bold text-theme-accent mb-6"},G={class:"space-y-3"},H={class:"flex justify-between"},J={class:"font-semibold capitalize text-theme-primary"},K={class:"flex justify-between"},Q={class:"text-theme-primary"},U={class:"flex justify-between"},W={class:"font-bold text-theme-accent"},X={key:0,class:"flex justify-between"},Y={class:"capitalize text-theme-primary"},Z={key:0,class:"border-t border-theme pt-6"},$={class:"divide-y divide-theme"},ee={class:"text-theme-primary"},te={class:"font-semibold text-theme-accent"},se={key:1,class:"border-t border-theme pt-6"},oe={class:"text-theme-secondary text-sm whitespace-pre-line"},ie=j({__name:"[id]",setup(ae){const y=N();z();const f=A();S();const b=V(()=>Number(y.params.id)),s=u(null),c=u(!0),l=u("");B(async()=>{c.value=!0,l.value="";try{const o=await f.getPurchase(b.value);s.value=o}catch(o){l.value="Order not found.",s.value=null}finally{c.value=!1}});function g(o){if(!o)return"â";try{return new Date(o).toLocaleDateString(void 0,{dateStyle:"medium"})}catch(a){return o}}function v(o){return o&&[o.address_line_1,o.address_line_2,[o.city,o.state,o.postal_code].filter(Boolean).join(" "),o.country,o.phone].filter(Boolean).join(", ")||"â"}return(o,a)=>{var p,h;const w=O;return d(),r("div",I,[e("div",P,[D(w,{to:"/panel",class:"inline-flex items-center gap-2 text-theme-accent hover:opacity-90 font-semibold mb-6"},{default:C(()=>[...a[0]||(a[0]=[e("i",{class:"fas fa-arrow-left"},null,-1),q(" Back to patient portal ",-1)])]),_:1}),t(c)?(d(),r("div",R," Loading order... ")):t(l)||!t(s)?(d(),r("div",T,n(t(l)||"Order not found."),1)):(d(),r("div",E,[e("h1",M,"Order #"+n(t(s).id),1),e("dl",G,[e("div",H,[a[1]||(a[1]=e("dt",{class:"text-theme-secondary"},"Status",-1)),e("dd",J,n((p=t(s).status)!=null?p:"â"),1)]),e("div",K,[a[2]||(a[2]=e("dt",{class:"text-theme-secondary"},"Date",-1)),e("dd",Q,n(g(t(s).created_at)),1)]),e("div",U,[a[3]||(a[3]=e("dt",{class:"text-theme-secondary"},"Total",-1)),e("dd",W,"£"+n(t(s).total!=null?Number(t(s).total).toFixed(2):"â"),1)]),t(s).payment_method?(d(),r("div",X,[a[4]||(a[4]=e("dt",{class:"text-theme-secondary"},"Payment",-1)),e("dd",Y,n(String(t(s).payment_method).replace(/_/g," ")),1)])):m("",!0)]),(h=t(s).items)!=null&&h.length?(d(),r("section",Z,[a[5]||(a[5]=e("h2",{class:"text-lg font-bold text-theme-primary mb-3"},"Items",-1)),e("ul",$,[(d(!0),r(F,null,L(t(s).items,(i,k)=>{var _,x;return d(),r("li",{key:k,class:"py-3 flex justify-between items-center gap-4"},[e("span",ee,n((_=i.name)!=null?_:"Item")+" à "+n((x=i.quantity)!=null?x:1),1),e("span",te," £"+n((i.total!=null?i.total:Number(i.price||0)*(i.quantity||1)).toFixed(2)),1)])}),128))])])):m("",!0),t(s).shipping_address&&(t(s).shipping_address.address_line_1||t(s).shipping_address.city)?(d(),r("section",se,[a[6]||(a[6]=e("h2",{class:"text-lg font-bold text-theme-primary mb-2"},"Shipping address",-1)),e("p",oe,n(v(t(s).shipping_address)),1)])):m("",!0)]))])])}}});export{ie 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.