1import{r as s,j as e}from"./vendor-react-B5jR4fe2.js";import{u as v,t as u}from"./index-Bc77KLPI.js";import{S as f}from"./SEOHead-lztdvS40.js";import{t as S}from"./vendor-sonner-DMLtmxnD.js";import{x as b,m as j,am as P,c as o,b3 as L,q as N}from"./vendor-icons-COsjkDUz.js";import"./vendor-common-BG8TW9DD.js";import"./vendor-trpc-Dkx5Aa2n.js";import"./vendor-lenis-DEgUBGZs.js";import"./vendor-superjson-C2BHV6N2.js";import"./vendor-radix-BwKqL8A1.js";import"./vendor-tw-merge-D6B6e0vX.js";import"./i18n-languages-m5Rzj1N_.js";function T(){const[,c]=v(),[n,d]=s.useState(""),[x,g]=s.useState(""),[p,r]=s.useState(!1),[a,i]=s.useState(null);s.useEffect(()=>{const t=localStorage.getItem("sp_account");if(t)try{i(JSON.parse(t)),r(!0)}catch{}},[]);const l=u.servicePortal.login.useMutation({onSuccess:t=>{localStorage.setItem("sp_account",JSON.stringify(t.account)),i(t.account),r(!0)},onError:t=>{S.error(t.message||"Login failed")}}),m=t=>{t.preventDefault(),l.mutate({email:n,password:x})},h=()=>{localStorage.removeItem("sp_account"),r(!1),i(null),fetch("/api/trpc/servicePortal.logout",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({json:{}})}).catch(()=>{})};return p&&a?e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:69",className:"min-h-screen bg-[#0a0a0a] flex flex-col",children:[e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:71",className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:60px_60px] pointer-events-none"}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:74",className:"relative bg-[#0d0d0d] border-b border-white/8 px-4 py-3 flex items-center gap-3",children:[e.jsx("a",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:75",href:"/",children:e.jsx("img",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:76",src:"https://d2xsxph8kpxj0f.cloudfront.net/310419663030776452/YHeqjBLtd5Erh7tojSzjqS/machinecraft-logo_5c43e2d8.png",alt:"Machinecraft",className:"h-7 object-contain",width:28,height:28})}),e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:83",className:"flex-1"}),e.jsxs("button",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:84",type:"button",onClick:h,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-white transition-colors",children:[e.jsx(b,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:88",size:13}),"Sign out"]})]}),e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:94",className:"relative flex-1 flex flex-col items-center justify-center px-4 py-10",children:e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:95",className:"w-full max-w-md",children:[e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:97",className:"mb-8",children:[e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:98",className:"w-12 h-12 bg-[#f5c518]/15 rounded-2xl flex items-center justify-center mb-4",children:e.jsx(j,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:99",size:22,className:"text-[#f5c518]"})}),e.jsxs("h2",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:101",className:"text-2xl font-bold text-white",children:["Welcome, ",a.contactName??a.companyName]}),e.jsxs("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:104",className:"text-gray-500 text-sm mt-1",children:[a.companyName," · ",a.email]})]}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:108",className:"space-y-3",children:[e.jsx("button",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:109",type:"button",onClick:()=>c("/service/chat"),className:"w-full bg-[#111] border border-white/8 hover:border-[#f5c518]/40 rounded-2xl p-5 text-left transition-all group",children:e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:113",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:114",className:"w-10 h-10 bg-[#f5c518]/15 rounded-xl flex items-center justify-center shrink-0",children:e.jsx(P,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:115",size:18,className:"text-[#f5c518]"})}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:117",className:"flex-1",children:[e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:118",className:"text-white font-semibold text-sm",children:"Spare Parts Assistant"}),e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:119",className:"text-gray-500 text-xs mt-0.5",children:"Chat to identify and order spare parts"})]}),e.jsx(o,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:121",size:16,className:"text-gray-600 group-hover:text-[#f5c518] transition-colors"})]})}),e.jsx("button",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:125",type:"button",onClick:()=>c("/portal/tickets"),className:"w-full bg-[#111] border border-white/8 hover:border-[#f5c518]/40 rounded-2xl p-5 text-left transition-all group",children:e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:129",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:130",className:"w-10 h-10 bg-blue-500/15 rounded-xl flex items-center justify-center shrink-0",children:e.jsx(L,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:131",size:18,className:"text-blue-400"})}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:133",className:"flex-1",children:[e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:134",className:"text-white font-semibold text-sm",children:"My Service Tickets"}),e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:135",className:"text-gray-500 text-xs mt-0.5",children:"View status, track progress, resume chats"})]}),e.jsx(o,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:137",size:16,className:"text-gray-600 group-hover:text-[#f5c518] transition-colors"})]})}),e.jsx("button",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:141",type:"button",onClick:()=>c("/service/chat"),className:"w-full bg-[#111] border border-white/8 hover:border-[#f5c518]/40 rounded-2xl p-5 text-left transition-all group",children:e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:145",className:"flex items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:146",className:"w-10 h-10 bg-orange-500/15 rounded-xl flex items-center justify-center shrink-0",children:e.jsx(N,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:147",size:18,className:"text-orange-400"})}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:149",className:"flex-1",children:[e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:150",className:"text-white font-semibold text-sm",children:"BOM Parts Catalog"}),e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:151",className:"text-gray-500 text-xs mt-0.5",children:"Browse all parts for your machine"})]}),e.jsx(o,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:153",size:16,className:"text-gray-600 group-hover:text-[#f5c518] transition-colors"})]})})]}),e.jsxs("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:158",className:"text-center text-gray-700 text-xs mt-8",children:["Need help? Contact"," ",e.jsx("a",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:160",href:"mailto:[email protected]",className:"text-[#f5c518]/70 hover:text-[#f5c518]",children:"[email protected]"})]})]})})]}):e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:172",className:"min-h-screen bg-[#0a0a0a] flex items-center justify-center px-4",children:[e.jsx(f,{"data-loc":"client/src/pages/ServicePortalLogin.tsx:173",title:"Customer Service Portal | Machinecraft",description:"Access your Machinecraft service portal to track t
1ickets, order parts, and manage your machines.",path:"/service"}),e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:175",className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:60px_60px]"}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:177",className:"relative w-full max-w-md",children:[e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:179",className:"text-center mb-10",children:[e.jsx("a",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:180",href:"/",className:"inline-flex items-center gap-3 mb-6",children:e.jsx("img",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:181",src:"https://d2xsxph8kpxj0f.cloudfront.net/310419663030776452/YHeqjBLtd5Erh7tojSzjqS/machinecraft-logo_5c43e2d8.png",alt:"Machinecraft",className:"h-8 object-contain",width:32,height:32})}),e.jsx("h1",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:188",className:"text-2xl font-bold text-white",children:"Customer Service Portal"}),e.jsx("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:189",className:"text-gray-400 mt-2 text-sm",children:"Sign in to order spare parts & raise service tickets"})]}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:193",className:"bg-[#111] border border-white/10 rounded-2xl p-8",children:[e.jsxs("form",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:194",onSubmit:m,className:"space-y-5",children:[e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:195",children:[e.jsx("label",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:196",className:"block text-sm font-medium text-gray-300 mb-2",children:"Email Address"}),e.jsx("input",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:197",type:"email",value:n,onChange:t=>d(t.target.value),placeholder:"[email protected]",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-500 focus:outline-none focus:border-[#f5c518]/50 focus:bg-white/8 transition-all text-sm"})]}),e.jsxs("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:206",children:[e.jsx("label",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:207",className:"block text-sm font-medium text-gray-300 mb-2",children:"Password"}),e.jsx("input",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:208",type:"password",value:x,onChange:t=>g(t.target.value),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-500 focus:outline-none focus:border-[#f5c518]/50 focus:bg-white/8 transition-all text-sm"})]}),e.jsx("button",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:217",type:"submit",disabled:l.isPending,className:"w-full bg-[#f5c518] hover:bg-[#f5c518]/90 text-black font-bold py-3 rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed text-sm",children:l.isPending?"Signing in...":"Sign In"})]}),e.jsx("div",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:225",className:"mt-6 pt-6 border-t border-white/10 text-center",children:e.jsxs("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:226",className:"text-gray-500 text-xs",children:["Don't have an account?"," ",e.jsx("a",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:228",href:"/contact",className:"text-[#f5c518] hover:underline",children:"Contact Machinecraft"})]})})]}),e.jsxs("p",{"data-loc":"client/src/pages/ServicePortalLogin.tsx:235",className:"text-center text-gray-600 text-xs mt-6",children:["© ",new Date().getFullYear()," Machinecraft Technologies. All rights reserved."]})]})]})}export{T 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.