import{q as b,j as x,y as w,k as d,m as u,z as o,B as l,O as y,l as t,t as a,D,r as C,A as n,E as L,K as S,I as g,P as N,F as P,C as T,Q as E,h as V,o as c,H as A}from"./index-B8bqNNwo.js";import{U as j}from"./user-plus-CE4cyWs-.js";import{S as F}from"./shield-check-BHAJdfz_.js";/**
 * @license lucide-vue-next v0.554.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const I=b("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
 * @license lucide-vue-next v0.554.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M=b("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),U={key:0,class:"flex items-center justify-center min-h-screen bg-slate-50"},B={key:1,class:"p-6 space-y-6 bg-slate-50 min-h-screen"},O={class:"flex flex-col md:flex-row md:items-center justify-between gap-4"},R={class:"flex items-center gap-4"},z={class:"w-16 h-16 rounded-2xl bg-indigo-600 text-white flex items-center justify-center font-black text-2xl shadow-2xl ring-4 ring-white"},$={class:"flex mb-1 text-[10px] font-black text-slate-400 uppercase tracking-[0.2em]"},q={class:"text-indigo-600"},H={class:"text-3xl font-black text-slate-900 tracking-tighter uppercase leading-none"},K={class:"flex items-center gap-3"},Q={class:"px-6 py-3 bg-white border border-slate-200 text-slate-700 rounded-2xl shadow-sm font-black text-xs uppercase tracking-widest hover:bg-slate-50 transition-all flex items-center gap-2"},G={class:"px-6 py-3 bg-indigo-600 text-white rounded-2xl shadow-xl font-black text-xs uppercase tracking-widest hover:scale-105 transition-all flex items-center gap-2"},J={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},W={class:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm relative overflow-hidden"},X={class:"absolute right-[-10px] top-[-10px] opacity-[0.03]"},Y={class:"text-3xl font-black text-indigo-600"},Z={class:"w-full bg-slate-100 h-2 mt-4 rounded-full overflow-hidden"},tt={class:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm"},et={class:"text-3xl font-black text-slate-800"},st={class:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm"},at={class:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm"},ot={class:"text-xl font-black text-slate-800 uppercase"},lt={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},it={class:"lg:col-span-1 space-y-6"},rt={class:"bg-white p-8 rounded-3xl border border-slate-200 shadow-sm"},nt={class:"text-xs font-black text-slate-900 uppercase tracking-widest mb-8 flex items-center gap-2"},dt={class:"space-y-6"},ct={class:"group"},pt={class:"text-sm font-black text-slate-800 tracking-tight"},xt={class:"group"},ut={class:"text-sm font-black text-slate-800 tracking-tight"},gt={class:"grid grid-cols-2 gap-4"},bt={class:"text-sm font-black text-slate-800 uppercase"},ht={class:"text-sm font-black text-slate-800 uppercase"},vt={class:"bg-slate-900 p-8 rounded-3xl shadow-2xl relative overflow-hidden group"},_t={class:"absolute right-[-20px] bottom-[-20px] opacity-10 group-hover:scale-110 transition-transform duration-700"},ft={class:"text-2xl font-black text-white tracking-tighter"},mt={class:"text-xs font-bold text-slate-400 mt-1"},kt={class:"lg:col-span-2 space-y-6"},wt={class:"bg-white rounded-3xl border border-slate-200 shadow-sm overflow-hidden"},yt={class:"p-6 border-b border-slate-50 flex justify-between items-center"},Dt={class:"text-xs font-black text-slate-900 uppercase tracking-widest flex items-center gap-2"},Ct={class:"overflow-x-auto"},Lt={class:"w-full text-left"},St={class:"divide-y divide-slate-50"},Nt={class:"p-5"},Pt={class:"text-xs font-black text-slate-800 uppercase tracking-tighter"},Tt={class:"text-[9px] font-bold text-slate-400 mt-0.5 uppercase tracking-widest"},Et={class:"p-5"},Vt={class:"flex items-center gap-2"},At={class:"text-[10px] font-black text-slate-700 uppercase"},jt={class:"p-5"},Ft={class:"p-5 text-center"},It={class:"text-[10px] font-black text-slate-500 uppercase"},Mt={key:0},Ut={colspan:"4",class:"p-20 text-center"},Bt={class:"flex flex-col items-center gap-2"},$t={__name:"Show",props:["id"],setup(h){const v=h,s=x(null),p=x(!0),_=i=>({delivered:"bg-green-50 text-green-700 border-green-100",on_route:"bg-blue-50 text-blue-700 border-blue-100",pending:"bg-orange-50 text-orange-700 border-orange-100",cancelled:"bg-red-50 text-red-700 border-red-100"})[i]||"bg-slate-50 text-slate-700 border-slate-100",f=i=>new Date(i).toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"});async function m(){p.value=!0;try{const i=await V.get(`/portal/drivers/${v.id}`);s.value=i.data}catch(i){console.error("Fetch Error:",i)}finally{p.value=!1}}return w(m),(i,e)=>{const k=C("router-link");return p.value?(c(),d("div",U,[o(l(y),{class:"w-10 h-10 text-indigo-600 animate-spin"})])):s.value?(c(),d("div",B,[t("div",O,[t("div",R,[t("div",z,a(s.value.driver.user?.name.substring(0,2).toUpperCase()),1),t("div",null,[t("nav",$,[o(k,{to:"/drivers",class:"hover:text-indigo-600 transition-colors"},{default:D(()=>[...e[0]||(e[0]=[n("Personnel",-1)])]),_:1}),e[1]||(e[1]=t("span",{class:"mx-2"},"/",-1)),t("span",q,"Profile: "+a(s.value.driver.id),1)]),t("h1",H,a(s.value.driver.user?.name),1)])]),t("div",K,[t("button",Q,[o(l(L),{class:"w-4 h-4"}),e[2]||(e[2]=n(" Export Log ",-1))]),t("button",G,[o(l(j),{class:"w-4 h-4"}),e[3]||(e[3]=n(" Edit Driver ",-1))])])]),t("div",J,[t("div",W,[t("div",X,[o(l(M),{class:"w-24 h-24"})]),e[4]||(e[4]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2"},"Safety Performance",-1)),t("p",Y,a(s.value.stats.safety_score)+"%",1),t("div",Z,[t("div",{class:"bg-indigo-600 h-full transition-all duration-1000",style:S(`width: ${s.value.stats.safety_score}%`)},null,4)])]),t("div",tt,[e[5]||(e[5]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2"},"Total Operations",-1)),t("p",et,a(s.value.stats.total_trips),1),e[6]||(e[6]=t("p",{class:"text-[9px] font-bold text-slate-400 mt-2 uppercase"},"Lifetime Trips Completed",-1))]),t("div",st,[e[7]||(e[7]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2"},"Current Asset",-1)),t("p",{class:g([s.value.stats.assigned_vehicle?"text-orange-500":"text-slate-400","text-xl font-black uppercase"])},a(s.value.stats.assigned_vehicle||"No Vehicle"),3),e[8]||(e[8]=t("p",{class:"text-[9px] font-bold text-slate-400 mt-2 uppercase"},"Current Assignment",-1))]),t("div",at,[e[9]||(e[9]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2"},"Tenure",-1)),t("p",ot,a(s.value.stats.active_since),1),e[10]||(e[10]=t("p",{class:"text-[9px] font-bold text-indigo-600 mt-2 uppercase tracking-tighter"},"Verified Member",-1))])]),t("div",lt,[t("div",it,[t("div",rt,[t("h3",nt,[o(l(F),{class:"w-4 h-4 text-indigo-600"}),e[11]||(e[11]=n(" Documents & Identity ",-1))]),t("div",dt,[t("div",ct,[e[12]||(e[12]=t("label",{class:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1"},"Driving Licence",-1)),t("p",pt,a(s.value.driver.driving_licence),1)]),t("div",xt,[e[13]||(e[13]=t("label",{class:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1"},"Passport / ID Number",-1)),t("p",ut,a(s.value.driver.passport_number||"NOT PROVIDED"),1)]),t("div",gt,[t("div",null,[e[14]||(e[14]=t("label",{class:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1"},"Nationality",-1)),t("p",bt,a(s.value.driver.nationality),1)]),t("div",null,[e[15]||(e[15]=t("label",{class:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-1"},"Sex",-1)),t("p",ht,a(s.value.driver.sex),1)])])])]),t("div",vt,[t("div",_t,[o(l(I),{class:"w-32 h-32 text-white"})]),e[16]||(e[16]=t("h3",{class:"text-[10px] font-black text-indigo-400 uppercase tracking-widest mb-4"},"Direct Contact",-1)),t("p",ft,a(s.value.driver.phone),1),t("p",mt,a(s.value.driver.user.email),1)])]),t("div",kt,[t("div",wt,[t("div",yt,[t("h3",Dt,[o(l(N),{class:"w-4 h-4 text-indigo-600"}),e[17]||(e[17]=n(" Recent Trip Logs ",-1))]),e[18]||(e[18]=t("button",{class:"text-[10px] font-black text-indigo-600 uppercase hover:underline"},"View Ledger",-1))]),t("div",Ct,[t("table",Lt,[e[21]||(e[21]=t("thead",{class:"bg-slate-50/50 text-[10px] font-black text-slate-400 uppercase border-b"},[t("tr",null,[t("th",{class:"p-5 tracking-widest"},"Route Details"),t("th",{class:"p-5 tracking-widest"},"Assigned Asset"),t("th",{class:"p-5 tracking-widest"},"Execution"),t("th",{class:"p-5 tracking-widest text-center"},"Date")])],-1)),t("tbody",St,[(c(!0),d(P,null,T(s.value.stats.trip_history,r=>(c(),d("tr",{key:r.id,class:"hover:bg-indigo-50/30 transition-colors"},[t("td",Nt,[t("p",Pt,[n(a(r.origin)+" ",1),e[19]||(e[19]=t("span",{class:"text-indigo-400 mx-1"},"→",-1)),n(" "+a(r.destination),1)]),t("p",Tt,"REF: "+a(r.id),1)]),t("td",Et,[t("div",Vt,[o(l(A),{class:"w-3 h-3 text-slate-300"}),t("span",At,a(r.vehicle_plate_snapshot),1)])]),t("td",jt,[t("span",{class:g([_(r.status),"text-[9px] font-black uppercase px-2.5 py-1 rounded-lg tracking-wider border"])},a(r.status),3)]),t("td",Ft,[t("p",It,a(f(r.created_at)),1)])]))),128)),s.value.stats.trip_history.length?u("",!0):(c(),d("tr",Mt,[t("td",Ut,[t("div",Bt,[o(l(E),{class:"w-10 h-10 text-slate-200"}),e[20]||(e[20]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em]"},"No operations recorded for this unit",-1))])])]))])])])])])])])):u("",!0)}}};export{$t as default};
