import{j as e,aX as t,b6 as a}from"./ui-vendor-BewJQzBv.js";import{r as s}from"./react-vendor-D6Nbkvjy.js";import{L as o}from"./case-study-components-DWRUehs-.js";import{B as r}from"./home-components-zRcEiFkI.js";import{a as l,u as n}from"./router-vendor-DmQqpneu.js";import"./three-vendor-He8TdPNb.js";import"./supabase-vendor-aM9kV88h.js";const i=()=>{const i=l(),c=n(),[d,m]=s.useState(!1),[x,f]=s.useState("");return s.useEffect(()=>{const e=i.pathname;let t=!1,a="",s="";const o=e.match(/^\/news-detail\/([a-f0-9-]+)$/);if(o){const e=o[1];/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?(t=!0,a=`/news-detail/${e}`,s="Redirecting to news article..."):(t=!0,a="/news",s="Invalid article ID, redirecting to news page...")}const r=e.match(/^\/blog-detail\/([a-f0-9-]+)$|^\/blog\/([a-f0-9-]+)$/);if(r&&!o){const e=r[1]||r[2];/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?(t=!0,a=`/blog-detail/${e}`,s="Redirecting to blog post..."):(t=!0,a="/blog",s="Invalid post ID, redirecting to blog page...")}const l={"/news-details":"/news","/blog-details":"/blog","/portfolio-detail":"/portfolio","/portfolio-details":"/portfolio","/about":"/about-us","/contact":"/contact","/services":"/services"};!t&&l[e]&&(t=!0,a=l[e],s="Redirecting to the correct page..."),t&&(m(!0),f(s),setTimeout(()=>{c(a,{replace:!0})},1500))},[i.pathname,c]),d?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),e.jsx("h2",{className:"text-xl font-semibold",children:x}),e.jsx("p",{className:"text-muted-foreground",children:"Please wait while we take you to the correct page."})]})}):e.jsx(o,{children:e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center bg-background px-4 py-16",children:e.jsxs("div",{className:"text-center space-y-8 max-w-lg mx-auto",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-bold bg-blue-50 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400 tracking-wider uppercase",children:"404 Error"}),e.jsx("h1",{className:"text-4xl md:text-5xl font-black text-foreground tracking-tight",children:"Page Not Found"}),e.jsx("p",{className:"text-muted-foreground text-base md:text-lg leading-relaxed",children:"Sorry, we couldn't find the page you're looking for. The page might have been moved, deleted, or the URL might be incorrect."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsxs(r,{onClick:()=>c(-1),variant:"outline",className:"h-11 px-6 rounded-xl font-bold flex items-center gap-2 border-slate-200 dark:border-slate-800",children:[e.jsx(t,{className:"w-4 h-4"}),"Go Back"]}),e.jsxs(r,{onClick:()=>c("/"),className:"h-11 px-6 rounded-xl font-bold flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white",children:[e.jsx(a,{className:"w-4 h-4"}),"Back to Home"]})]})]})})})};export{i as default};
