module.exports=[24361,(a,b,c)=>{b.exports=a.x("util",()=>require("util"))},14747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},2590,a=>{"use strict";var b=a.i(73631),c=a.i(34769),d=a.i(23538),e=a.i(40355),f=a.i(80530),g=a.i(45602);a.s(["default",0,function(){let[a,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),o=(0,d.useRouter)(),{setUser:p}=(0,e.useAuth)(),q=async b=>{b.preventDefault(),l(""),n(!0);try{let b=await g.default.post("/auth/login",{email:a,password:i});if(b.success&&b.data){(0,f.setToken)(b.data.token),p(b.data.user);let a=b.data.user.role;"admin"===a?o.push("/admin/dashboard"):"assistant"===a?o.push("/assistant/dashboard"):"recovery"===a&&o.push("/recovery/dashboard")}}catch(a){l(a.message||"Login failed. Please check your credentials.")}finally{n(!1)}};return(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-[var(--background)] p-4 fixed inset-0 z-50",children:(0,b.jsxs)("div",{className:"card w-full max-w-md p-8 shadow-lg relative bg-[var(--card)]",children:[(0,b.jsxs)("div",{className:"text-center mb-8",children:[(0,b.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"Credical"}),(0,b.jsx)("p",{className:"text-[var(--text-muted)]",children:"Sign in to your account"})]}),k&&(0,b.jsx)("div",{className:"bg-danger-light text-danger p-3 rounded-xl text-sm mb-6 border border-danger/20",children:k}),(0,b.jsxs)("form",{onSubmit:q,className:"space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Email Address"}),(0,b.jsx)("div",{className:"relative",children:(0,b.jsx)("input",{type:"email",className:"input-field pl-10",placeholder:"you@credical.com",value:a,onChange:a=>h(a.target.value),required:!0})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Password"}),(0,b.jsx)("div",{className:"relative",children:(0,b.jsx)("input",{type:"password",className:"input-field pl-10",placeholder:"••••••••",value:i,onChange:a=>j(a.target.value),required:!0})})]}),(0,b.jsx)("button",{type:"submit",className:"btn-primary w-full py-3",disabled:m,children:m?"Signing in...":"Sign In"})]}),(0,b.jsxs)("div",{className:"mt-8 text-center text-xs text-[var(--text-muted)]",children:[(0,b.jsx)("p",{children:"Demo Credentials:"}),(0,b.jsxs)("div",{className:"flex justify-center gap-4 mt-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"font-semibold block",children:"Admin"}),"admin@credical.com"]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"font-semibold block",children:"Password (All)"}),"Admin@123"]})]})]})]})})}])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0-p_-xw._.js.map