1import{a as m,N as h,j as e,P as g,l as u,U as p}from"./index-DQ8IGCgk.js";import{L as f}from"./loader-circle-BGQgMIYy.js";import{C as w}from"./circle-alert-CRM_IJSR.js";import{T as b}from"./truck-Cbq5Md7P.js";import{C as j}from"./circle-check-BgnHwe2B.js";function N(t){if(!t)return{bg:"bg-muted/30",text:"text-muted-foreground",dot:"bg-muted-foreground"};const s=t.toLowerCase();return/доÑÑавл|delivered|вÑÑÑен/.test(s)?{bg:"bg-green-500/15",text:"text-green-400",dot:"bg-green-400"}:/пÑÑи|transit|движ|оÑпÑав|вÑлеÑ|пÑибÑл/.test(s)?{bg:"bg-blue-500/15",text:"text-blue-400",dot:"bg-blue-400"}:/ожидани|pending|обÑабоÑк/.test(s)?{bg:"bg-yellow-500/15",text:"text-yellow-400",dot:"bg-yellow-400"}:{bg:"bg-muted/30",text:"text-muted-foreground",dot:"bg-muted-foreground"}}function o(t,s="uk"){if(!t)return"";try{return new Date(t).toLocaleDateString(s,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return t}}function L(){const{t,i18n:s}=m(),n=s.language,c=window.location.pathname.split("/"),a=decodeURIComponent(c[c.length-1]||""),{data:r,isLoading:d,error:x}=h({number:a,country:""},{query:{enabled:a.length>2,retry:!1,staleTime:300*1e3,queryKey:p({number:a,country:""})}});if(!a||a==="track")return e.jsx("div",{className:"min-h-screen bg-[#0f1117] flex items-center justify-center p-4",children:e.jsx("div",{className:"text-muted-foreground text-sm text-center",children:t("widget.noTrackingNumber")})});const l=N(r?.status),i=r?.events?.[0];return e.jsx("div",{className:"min-h-screen bg-[#0f1117] flex items-center justify-center p-3",children:e.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 bg-[#161a23] overflow-hidden shadow-2xl",children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-3 border-b border-white/8",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary/15 border border-primary/25 flex items-center justify-center flex-shrink-0",children:e.jsx(g,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-mono text-xs text-white/50 truncate",children:a}),r?.carrier&&e.jsx("p",{className:"text-xs text-white/70 font-medium truncate",children:r.carrier})]}),e.jsx("a",{href:`${window.location.origin}/track?number=${encodeURIComponent(a)}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary/70 hover:text-primary transition-colors flex-shrink-0",children:t("widget.open")})]}),e.jsxs("div",{className:"p-4",children:[d&&e.jsxs("div",{className:"flex items-center gap-2 text-white/40 text-sm py-3",children:[e.jsx(f,{className:"w-4 h-4 animate-spin"}),t("widget.loading")]}),x&&e.jsxs("div",{className:"flex items-center gap-2 text-red-400 text-sm py-2",children:[e.jsx(w,{className:"w-4 h-4"}),t("widget.error")]}),r&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:`inline-flex items-center gap-2 self-start px-3 py-1.5 rounded-full ${l.bg}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.dot} flex-shrink-0`}),e.jsx("span",{className:`text-sm font-medium ${l.text}`,children:r.status||t("widget.processing")})]}),i&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(b,{className:"w-3.5 h-3.5 text-white/30 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-white/60 leading-relaxed",children:i.description})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5",children:[e.jsx(u,{className:"w-3 h-3 text-white/25 flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-white/35",children:o(i.date,n)}),i.location&&e.jsxs("span",{className:"text-[11px] text-white/25",children:["· ",i.location]})]})]}),r.estimatedDelivery&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-primary/70 border-t border-white/8 pt-3 mt-1",children:[e.jsx(j,{className:"w-3.5 h-3.5 flex-shrink-0"}),t("widget.estimatedDelivery")," ",o(r.estimatedDelivery,n)]})]})]}),e.jsxs("div",{className:"px-4 pb-3 flex items-center justify-between",children:[e.jsx("a",{href:`${window.location.origin}`,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-white/20 hover:text-white/40 transition-colors",children:"Trackora"}),e.jsx("span",{className:"text-[10px] text-white/15",children:r?.lastUpdate?`${t("widget.updated")} ${o(r.lastUpdate,n)}`:""})]})]})})}export{L 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.