1import{c as j,r as i,E as w,a0 as y,aD as v,j as e,B as n,C as N,a1 as x,aE as L,R as S,z as l}from"./index-BFYamPZN.js";import{E}from"./eye-off-BwYhqjum.js";import{E as k}from"./eye-DyXw6fE4.js";/** 2 * @license lucide-react v0.344.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const C=j("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),I="/assets/login-DJ-PiDDK.svg",F=()=>e.jsxs("div",{className:"flex items-center gap-3 text-2xl font-bold text-slate-800",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-600 rounded-lg flex items-center justify-center",children:e.jsx(C,{className:"w-6 h-6 text-white"})}),e.jsx("span",{children:"Freight Compare"})]}),A=()=>{const[r,u]=i.useState(""),[d,g]=i.useState(""),[s,c]=i.useState(!1),[o,p]=i.useState(!1),m=w(),{login:h}=y(),{prewarm:f}=v(),b=async t=>{t.preventDefault(),c(!0);try{const a=await h(r,d);a.success?(l.success("Login Successful!"),m("/compare")):l.error(a.error??"Something went wrong during login.")}catch(a){l.error(a?.response?.data?.message||"An unexpected error occurred.")}finally{c(!1)}};return e.jsxs("div",{className:"w-full lg:grid lg:grid-cols-2 font-sans",children:[e.jsx("div",{className:"relative hidden lg:flex flex-col items-center justify-center bg-indigo-50 p-12",children:e.jsxs(n.div,{initial:{opacity:0}
6,animate:{opacity:1},transition:{duration:1},children:[e.jsx("img",{src:I,alt:"Login branding illustration",className:"w-full max-w-lg object-contain"}),e.jsxs("div",{className:"text-center mt-8",children:[e.jsx("h2",{className:"text-3xl font-bold text-slate-800",children:"Welcome to Your Logistics Hub"}),e.jsx("p",{className:"mt-2 text-slate-600",children:"Streamline your shipments, track your progress, and manage your ratesâall in one place."})]})]})}),e.jsx("div",{className:"flex items-center justify-center p-6 sm:p-12 bg-slate-100",children:e.jsxs(n.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},className:"w-full max-w-md",children:[e.jsx("div",{className:"lg:hidden mb-8 flex justify-center",children:e.jsx(F,{})}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Shipper Login"}),e.jsxs("div",{className:"inline-flex rounded-lg border border-slate-200 bg-slate-100/70 p-0.5 opacity-70 hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",className:"px-3 py-1 text-xs font-semibold rounded-md bg-white text-indigo-600 shadow-sm",children:"Shipper"}),e.jsx("button",{type:"button",onClick:()=>m("/transporter/login"),onMouseEnter:f,className:"px-3 py-1 text-xs font-semibold rounded-md text-slate-500 hover:text-slate-700 transition-colors",children:"Transporter"})]})]}),e.jsxs("form",{className:"space-y-5",onSubmit:b,children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-address",className:"block text-sm font-medium text-slate-700 mb-1",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),e.jsx("input",{id:"email-address",name:"email",type:"email",autoComplete:"email",required:!0,disabled:s,className:"w-full pl-10 pr-3 py-2.5 border border-slate-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition disabled:bg-slate-200",placeholder:"[email protected]",value:r,onChange:t=>u(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-slate-700 mb-1",children:"Password"}),e.jsx(x,{to:"/forgot-password",tabIndex:-1,className:"text-sm font-medium text-indigo-600 hover:text-indigo-500 transition-colors",children:"Forgot?"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(L,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),e.jsx("input",{id:"password",name:"password",type:o?"text":"password",autoComplete:"current-password",required:!0,disabled:s,className:"w-full pl-10 pr-12 py-2.5 border border-slate-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition disabled:bg-slate-200",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:d,onChange:t=>g(t.target.value)}),e.jsx("button",{type:"button",tabIndex:-1,onClick:()=>p(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",disabled:s,children:o?e.jsx(E,{className:"w-5 h-5"}):e.jsx(k,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"pt-2",children:e.jsx(n.button,{type:"submit",disabled:s,whileHover:{scale:s?1:1.02},whileTap:{scale:s?1:.98},className:"w-full inline-flex items-center justify-center gap-2 py-3 px-4 border border-transparent text-base font-semibold rounded-lg text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:bg-indigo-400 disabled:cursor-not-allowed shadow-lg shadow-indigo-500/50",children:s?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-5 h-5 animate-spin"})," Logging In..."]}):"Login"})}),e.jsxs("p",{className:"text-center text-sm text-slate-600",children:["Don't have an account?"," ",e.jsx(x,{to:"/userselect",className:"font-semibold text-indigo-600 hover:text-indigo-500 transition-colors",children:"Create one now"})]})]})]})})]})};export{A 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.