"use strict";(globalThis.webpackChunkwheelsmart_admin_react||=[]).push([[3912],{3912(e,a,s){s.r(a);var l=s(65043),r=s(62582),i=s(44394),o=s(89421),n=s(11645),t=s(68493),d=s(5835),m=s(47419),c=s(51238),h=s(8738),p=s(91688),u=s(97508),g=s(96709),x=s(71494),v=s(32806),w=s(70579);const j=(0,u.Ng)(function(e){let{login:a}=e;return{loginError:a.loginError,loginData:a.loginData,loading:a.loading}},{checkLogin:v.wD,InputChangeValue:v.O2,cleardata:v.oe})(function(e){var a,s,u,v,j,y,A;const b=(0,p.useHistory)(),N=(0,c.A)(),[f]=t.A.useForm();function D(a){e.InputChangeValue({key:a.target.name,value:a.target.value})}return(0,l.useEffect)(()=>{e.cleardata(),localStorage.getItem("access_token")&&b.push("/")},[]),(0,l.useEffect)(()=>{f.setFieldsValue({password:e.loginData.password,username:e.loginData.username})},[e.loginData]),(0,w.jsxs)(m.A,{gutter:[32,0],className:"hp-authentication-page",children:[(0,w.jsx)(x.A,{}),(0,w.jsx)(n.A,{lg:12,span:24,className:"hp-py-sm-0 hp-py-md-64",children:(0,w.jsx)(m.A,{className:"hp-h-100",align:"middle",justify:"center",children:(0,w.jsxs)(n.A,{children:[(0,w.jsx)("div",{className:"hp-m-0 hp-p-0",children:(0,w.jsx)("img",{src:g.A,style:{height:150,width:500},alt:"Logo"})}),(0,w.jsxs)("div",{xxl:11,xl:15,lg:20,md:20,sm:24,className:"hp-px-sm-8 hp-pt-24 hp-pb-48",children:[(0,w.jsx)("h1",{className:"hp-mb-sm-0",children:"Login"}),(0,w.jsx)("p",{className:"hp-mt-sm-0 hp-mt-8 hp-text-color-black-60",children:"Welcome back, please login to your account."}),(0,w.jsxs)(t.A,{layout:"vertical",name:"loginWithUsername",className:"hp-mt-sm-16 hp-mt-32",initialValues:{remember:!0},form:f,onFinish:()=>{var a={password:e.loginData.password,username:e.loginData.username,device_uuid:N,device_name:h.C0,device_type:3};e.checkLogin({loginData:a,history:b})},onFinishFailed:e=>{console.log("Failed:",e)},children:[(0,w.jsx)(t.A.Item,{label:"User Name :",name:"username",rules:[{required:!0,message:"Please input your User Name!"},{pattern:new RegExp("^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){0,18}$"),message:"field does not accept Special Characters"}],hasFeedback:!0,children:(0,w.jsx)(d.A,{id:"username",name:"username",style:{width:"100%"},placeholder:"User Name",value:null==e.loginData.username?"":null===(a=e.loginData)||void 0===a?void 0:a.username,onChange:D})}),(0,w.jsx)(t.A.Item,{label:"Password :",name:"password",rules:[{required:!0,message:"Please input your password!"}],hasFeedback:!0,children:(0,w.jsx)(d.A.Password,{id:"password",name:"password",style:{width:"100%"},placeholder:"Password",value:null==(null===(s=e.loginData)||void 0===s?void 0:s.password)?"":null===(u=e.loginData)||void 0===u?void 0:u.password,onChange:D})}),(null===(v=e.loginError)||void 0===v?void 0:v.password)&&(0,w.jsx)(i.A,{message:null===(j=e.loginError)||void 0===j?void 0:j.password,type:"error"}),(null===(y=e.loginError)||void 0===y?void 0:y.detail)&&(0,w.jsx)(i.A,{message:null===(A=e.loginError)||void 0===A?void 0:A.detail,type:"error"}),(0,w.jsx)(t.A.Item,{className:"hp-mt-16 hp-mb-8",children:(0,w.jsx)(o.A,{block:!0,type:"primary",htmlType:"submit",disabled:e.loading,children:"Sign in"})})]}),(0,w.jsx)("div",{className:"hp-form-info hp-mt-16",children:(0,w.jsx)(r.N_,{className:"hp-text-color-primary-1 hp-text-color-dark-primary-2 hp-caption",to:"/mobilelogin",children:"Login with Mobile"})})]})]})})})]})});s.d(a,["default",0,j])}}]);
//# sourceMappingURL=3912.84730053.chunk.js.map