(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3882],{73067:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},23157:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},6141:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},63715:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4631:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},11961:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,a.Z)("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]])},59536:function(e,t,r){Promise.resolve().then(r.bind(r,54429))},54429:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return O}});var a=r(57437),n=r(2265),s=r(24033),l=r(61396),i=r.n(l),c=r(16691),o=r.n(c),d=r(68329),m=r(6141),u=r(4322),x=r(11961),h=r(23157),b=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let p=(0,b.Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var f=r(73067),y=r(63715),g=r(4631),j=r(86712),v=r(96142),N=r(12741),k=r(1295),w=r(46339),Z=r(81517),C=r(29155),E=r(93023),z=r(12284);let F={new:{icon:m.Z,color:"text-blue-600",bgColor:"bg-blue-50 border-blue-200",label:"Order Received",labelFr:"Commande Re\xe7ue"},processing:{icon:u.Z,color:"text-amber-600",bgColor:"bg-amber-50 border-amber-200",label:"Processing",labelFr:"En Traitement"},in_transit:{icon:x.Z,color:"text-purple-600",bgColor:"bg-purple-50 border-purple-200",label:"In Transit",labelFr:"En Transit"},delivered:{icon:h.Z,color:"text-green-600",bgColor:"bg-green-50 border-green-200",label:"Delivered",labelFr:"Livr\xe9"},cancelled:{icon:p,color:"text-red-600",bgColor:"bg-red-50 border-red-200",label:"Cancelled",labelFr:"Annul\xe9"}},A=["new","processing","in_transit","delivered"];function O(){let e=(0,s.useParams)(),{language:t}=(0,z.Z)(),[r,l]=(0,n.useState)(null),[c,m]=(0,n.useState)(!0),[x,h]=(0,n.useState)(null);(0,n.useEffect)(()=>{let r=async()=>{try{let r=await fetch("/api/orders/track/".concat(e.orderNumber));if(r.ok){let e=await r.json();l(e)}else 404===r.status?h("en"===t?"Order not found":"Commande introuvable"):h("en"===t?"Failed to load order":"Impossible de charger la commande")}catch(e){h("en"===t?"Something went wrong":"Une erreur est survenue")}finally{m(!1)}};e.orderNumber&&r()},[e.orderNumber,t]);let b=e=>A.indexOf(e);return(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(w.Navbar,{}),(0,a.jsx)("main",{className:"pt-20 lg:pt-16 pb-16",children:(0,a.jsxs)("div",{className:"container mx-auto px-4 max-w-3xl",children:[(0,a.jsx)(d.E.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-8 pt-8",children:(0,a.jsxs)(i(),{href:"/",className:"inline-flex items-center text-muted-foreground hover:text-foreground transition-colors",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 mr-2"}),"en"===t?"Back to Home":"Retour \xe0 l'Accueil"]})}),c&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-20",children:[(0,a.jsx)(y.Z,{className:"w-8 h-8 animate-spin text-primary mb-4"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"en"===t?"Loading order details...":"Chargement de la commande..."})]}),x&&!c&&(0,a.jsxs)(d.E.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center py-20",children:[(0,a.jsx)(g.Z,{className:"w-16 h-16 mx-auto mb-4 text-muted-foreground/50"}),(0,a.jsx)("h2",{className:"text-xl font-semibold mb-2",children:x}),(0,a.jsx)("p",{className:"text-muted-foreground mb-6",children:"en"===t?"Please check your order number and try again.":"Veuillez v\xe9rifier votre num\xe9ro de commande et r\xe9essayer."}),(0,a.jsx)(i(),{href:"/",children:(0,a.jsx)(E.z,{children:"en"===t?"Go Home":"Retour \xe0 l'Accueil"})})]}),r&&!c&&(0,a.jsxs)(d.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold mb-2",children:"en"===t?"Order Tracking":"Suivi de Commande"}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:["en"===t?"Order":"Commande"," #",r.orderNumber]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["en"===t?"Placed on":"Pass\xe9e le"," ",new Date(r.createdAt).toLocaleDateString("en"===t?"en-US":"fr-FR",{month:"long",day:"numeric",year:"numeric"})]})]}),(()=>{let e=F[r.status]||F.new,n=e.icon;return(0,a.jsxs)(d.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},className:"".concat(e.bgColor," border rounded-xl p-6 mb-8 text-center"),children:[(0,a.jsx)(n,{className:"w-10 h-10 mx-auto mb-3 ".concat(e.color)}),(0,a.jsx)("h2",{className:"text-xl font-bold ".concat(e.color),children:"en"===t?e.label:e.labelFr})]})})(),"cancelled"!==r.status&&(0,a.jsx)(d.E.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"bg-card border border-border rounded-xl p-6 mb-8",children:(0,a.jsxs)("div",{className:"flex items-center justify-between relative",children:[(0,a.jsx)("div",{className:"absolute top-5 left-0 right-0 h-0.5 bg-muted mx-8"}),(0,a.jsx)("div",{className:"absolute top-5 left-0 h-0.5 bg-primary mx-8 transition-all duration-500",style:{width:"".concat(b(r.status)/(A.length-1)*100,"%"),maxWidth:"calc(100% - 4rem)"}}),A.map((e,n)=>{let s=F[e],l=s.icon,i=n<=b(r.status),c=e===r.status;return(0,a.jsxs)("div",{className:"flex flex-col items-center relative z-10",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full flex items-center justify-center transition-all duration-300 ".concat(i?"bg-primary text-primary-foreground shadow-md":"bg-muted text-muted-foreground"," ").concat(c?"ring-4 ring-primary/20":""),children:(0,a.jsx)(l,{className:"w-5 h-5"})}),(0,a.jsx)("span",{className:"text-xs mt-2 font-medium text-center ".concat(i?"text-foreground":"text-muted-foreground"),children:"en"===t?s.label:s.labelFr})]},e)})]})}),(0,a.jsxs)(d.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},className:"bg-card border border-border rounded-xl p-6 mb-8",children:[(0,a.jsxs)("h3",{className:"font-semibold text-lg mb-4 flex items-center gap-2",children:[(0,a.jsx)(j.Z,{className:"w-5 h-5"}),"en"===t?"Order Items":"Articles de la Commande"]}),(0,a.jsx)("div",{className:"space-y-4",children:r.items.map((e,r)=>(0,a.jsxs)("div",{className:"flex gap-4 pb-4 border-b border-border last:border-0 last:pb-0",children:[(0,a.jsx)("div",{className:"relative w-16 h-16 bg-muted rounded-md overflow-hidden flex-shrink-0",children:e.product.image?(0,a.jsx)(o(),{src:e.product.image,alt:"en"===t?e.product.nameEn:e.product.nameFr,fill:!0,className:"object-cover",sizes:"64px"}):(0,a.jsx)("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:(0,a.jsx)(u.Z,{className:"w-6 h-6 text-muted-foreground"})})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(i(),{href:"/product/".concat(e.product.slug),className:"font-medium text-sm hover:text-primary transition-colors",children:"en"===t?e.product.nameEn:e.product.nameFr}),e.variant&&(0,a.jsx)(C.C,{variant:"secondary",className:"text-xs mt-1",children:e.variant.size}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["en"===t?"Qty":"Qt\xe9",": ",e.quantity]})]})]},r))})]}),(0,a.jsxs)(d.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-card border border-border rounded-xl p-6 mb-8",children:[(0,a.jsx)("h3",{className:"font-semibold text-lg mb-4",children:"en"===t?"Shipping Information":"Informations de Livraison"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[r.customerName&&(0,a.jsx)("p",{className:"font-medium text-base",children:r.customerName}),r.address&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-muted-foreground",children:[(0,a.jsx)(v.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("span",{children:[r.address,r.country?", ".concat(r.country):""]})]}),r.phone&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,a.jsx)(N.Z,{className:"w-4 h-4 flex-shrink-0"}),(0,a.jsx)("span",{children:r.phone})]}),r.email&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,a.jsx)(k.Z,{className:"w-4 h-4 flex-shrink-0"}),(0,a.jsx)("span",{children:r.email})]})]})]}),(0,a.jsx)(d.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"text-center text-sm text-muted-foreground",children:(0,a.jsxs)("p",{children:["en"===t?"Questions about your order? Contact us at ":"Questions sur votre commande ? Contactez-nous \xe0 ",(0,a.jsx)("a",{href:"mailto:info@musafoods.ca",className:"text-primary font-medium hover:underline",children:"info@musafoods.ca"})]})})]})]})}),(0,a.jsx)(Z.Footer,{})]})}}},function(e){e.O(0,[6207,415,9906,1396,389,2774,9213,4636,2587,6053,2971,7864,1744],function(){return e(e.s=59536)}),_N_E=e.O()}]);