import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{H as n,t as r}from"./link-BEigRx5R.js";import{d as i,n as a,r as o,t as s}from"./Modals-BkPPnKoF.js";import{n as c,t as l}from"./LiveMapTracker-axnL2ibN.js";import{t as u}from"./Footer-BlH0Gspn.js";import{t as d}from"./package-DzDt_BEJ.js";import{S as f,l as p,u as m,v as h}from"./index-BFZg1haX.js";var g=h(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),_=e(n()),v=t();function y(){let[e,t]=(0,_.useState)(!1),[n,h]=(0,_.useState)(!1),[y,b]=(0,_.useState)(!1),[x,S]=(0,_.useState)(``),{orders:C}=f(),w=C.find(e=>e.id.toLowerCase()===x.trim().toLowerCase());return(0,v.jsxs)(`div`,{className:`min-h-screen bg-neutral-50 flex flex-col`,children:[(0,v.jsx)(o,{open:e,onOpenChange:t}),(0,v.jsx)(s,{open:n,onOpenChange:h,onCheckout:()=>{h(!1),b(!0)}}),(0,v.jsx)(a,{open:y,onOpenChange:b}),(0,v.jsx)(i,{onOpenCart:()=>h(!0),onOpenSignIn:()=>t(!0)}),(0,v.jsxs)(`main`,{className:`flex-1 max-w-[800px] w-full mx-auto px-4 py-12 space-y-6`,children:[(0,v.jsxs)(`div`,{className:`bg-white p-8 rounded-xl border text-center space-y-4 shadow-sm`,children:[(0,v.jsx)(`div`,{className:`w-14 h-14 rounded-full bg-orange-100 text-orange-500 flex items-center justify-center mx-auto`,children:(0,v.jsx)(c,{className:`w-7 h-7 animate-pulse`})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h1`,{className:`text-2xl font-black text-neutral-900`,children:`Live Order Milestone Tracking`}),(0,v.jsx)(`p`,{className:`text-neutral-500 text-xs mt-1`,children:`Enter your order ID (e.g. ORD-...) to track live package location on map.`})]}),(0,v.jsxs)(`div`,{className:`flex gap-2 max-w-md mx-auto`,children:[(0,v.jsx)(p,{value:x,onChange:e=>S(e.target.value),placeholder:`Enter Order ID (e.g. ORD-123)`,className:`text-sm h-11`}),x?(0,v.jsx)(r,{to:`/orders/$id`,params:{id:x.trim()},className:`shrink-0`,children:(0,v.jsxs)(m,{className:`bg-orange-500 hover:bg-orange-600 h-11 px-5 gap-1 font-semibold`,children:[`Track `,(0,v.jsx)(g,{className:`w-4 h-4`})]})}):(0,v.jsx)(m,{disabled:!0,className:`shrink-0 bg-orange-500 opacity-50 h-11 px-5`,children:`Track`})]}),C.length>0&&(0,v.jsxs)(`div`,{className:`pt-4 border-t text-left`,children:[(0,v.jsx)(`div`,{className:`text-xs font-bold text-neutral-500 uppercase tracking-wider mb-2`,children:`Recent Orders`}),(0,v.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.slice(0,4).map(e=>(0,v.jsx)(r,{to:`/orders/$id`,params:{id:e.id},children:(0,v.jsxs)(`span`,{className:`text-xs font-medium px-3 py-1.5 rounded-lg border bg-neutral-50 hover:bg-orange-50 hover:border-orange-300 text-neutral-800 flex items-center gap-1.5 transition`,children:[(0,v.jsx)(d,{className:`w-3.5 h-3.5 text-orange-500`}),` `,e.id,` (`,e.status,`)`]})},e.id))})]})]}),w&&(0,v.jsx)(l,{orderId:w.id,status:w.status,destinationAddress:w.address,driverPhone:w.driverPhone})]}),(0,v.jsx)(u,{})]})}export{y as component};