"use strict";exports.id=4301,exports.ids=[4301],exports.modules={34301:(e,t,s)=>{s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{default:()=>LoginUserForm});var l=s(20997),r=s(29613),i=s(84488),n=s(45009),x=s(60802),d=s(30184),o=s(66644),c=s(16974),m=s(11358),g=s(54574),p=s(54858),h=s(11377),u=s(86201),b=s(61175),k=s(75609),j=e([i,d,o,c,g,p,u]);[i,d,o,c,g,p,u]=j.then?(await j)():j;let f=k.object().shape({email:k.string().email().required(),password:k.string().required()});function LoginUserForm(){let{t:e}=(0,h.useTranslation)("common"),{openModal:t,closeModal:s}=(0,n.SO)(),{authorize:a}=(0,i.Z)(),{mutate:k,isLoading:j}=(0,b.useMutation)(g.Z.users.login,{onSuccess:t=>{if(!t.token){u.default.error(l.jsx("b",{children:e("text-wrong-user-name-and-pass")}),{className:"-mt-10 xs:mt-0"});return}a(t.token),(0,p.j9)(t.token,t.permissions),s()}});return(0,l.jsxs)("div",{className:"bg-light px-6 pt-10 pb-8 dark:bg-dark-300 sm:px-8 lg:p-12",children:[l.jsx(r.i,{className:"absolute bottom-0 left-0 text-light dark:text-dark-300 dark:opacity-60"}),l.jsx("div",{className:"relative z-10 flex items-center",children:(0,l.jsxs)("div",{className:"w-full shrink-0 text-left md:w-[380px]",children:[(0,l.jsxs)("div",{className:"flex flex-col pb-5 text-center xl:pb-6 xl:pt-2",children:[l.jsx("h2",{className:"text-lg font-medium tracking-[-0.3px] text-dark dark:text-light lg:text-xl",children:e("text-welcome-back")}),(0,l.jsxs)("div",{className:"mt-1.5 text-13px leading-6 tracking-[0.2px] dark:text-light-900 lg:mt-2.5 xl:mt-3",children:[e("text-join-now")," ",l.jsx("button",{onClick:()=>t("REGISTER"),className:"inline-flex font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",children:e("text-create-account")})]})]}),l.jsx(o.l,{onSubmit:e=>{k(e)},validationSchema:f,className:"space-y-4 pt-4 lg:space-y-5",children:({register:s,formState:{errors:a}})=>(0,l.jsxs)(l.Fragment,{children:[l.jsx(c.Z,{label:"contact-us-email-field",inputClassName:"bg-light dark:bg-dark-300",type:"email",...s("email"),error:a.email?.message}),l.jsx(m.Z,{label:"text-auth-password",inputClassName:"bg-light dark:bg-dark-300",...s("password"),error:a.password?.message}),(0,l.jsxs)("div",{className:"flex items-center justify-between space-x-5 rtl:space-x-reverse",children:[l.jsx(d.Z,{label:"text-remember-me"}),l.jsx("button",{type:"button",className:"text-13px font-semibold text-brand hover:text-dark-400 hover:dark:text-light-500",onClick:()=>t("FORGOT_PASSWORD_VIEW"),children:e("text-forgot-password")})]}),l.jsx(x.Z,{type:"submit",className:"!mt-5 w-full text-sm tracking-[0.2px] lg:!mt-7",isLoading:j,disabled:j,children:e("text-get-login")})]})})]})})]})}a()}catch(e){a(e)}})}};