import{j as o,r as i}from"./react-B_SyE9nW.js";import{o as n,s as e,q as t,a2 as s,a5 as r,X as a,t as c,L as l,A as d,E as p,K as m}from"./index-CGGskqVP.js";import{F as x,L as u,G as g,b as h,B as f}from"./GoogleIdentityStoreContext-yxtpiymQ.js";import{F as j}from"./Password-OR4Any1P.js";import{I as C,a as k,R as v}from"./index-CdMAEzxT.js";import{F as y}from"./FacebookIco-pxPgN_pQ.js";import{F as S}from"./FldText-TXpC7O87.js";import{S as I}from"./Stack-jwZlgLcD.js";const w=n((function({children:i,onKeyPress:n,dataTest:e}){return o.jsx("form",{noValidate:!0,autoComplete:"off",onKeyPress:n,"data-test":e,children:i})})),b=e(C)` &.MuiIconButton-root { background: ${t.red}; padding: 8px; margin: 0 11px; &:not(:hover) .MuiSvgIcon-root { fill: ${t.white}; } &:hover { background: ${t.yellowLight}; .MuiSvgIcon-root { fill: ${t.white}cc; } } } @media (hover: none) { &.MuiIconButton-root:hover { background: ${t.red}; & .MuiSvgIcon-root { fill: ${t.white}; } } &.MuiIconButton-root .MuiTouchRipple { &-rippleVisible { opacity: 1; border-radius: 50%; background-color: ${t.gray}; } } } `;const M=n((function({onClick:i,icon:n}){return o.jsx(b,{onClick:i,children:n})}));const L=n((function(){const n=i.useContext(x),{onFacebookResponse:e,onSocialAuthError:t}=i.useContext(u),r=i.useCallback((()=>{s.eventFacebookSignIn(navigator.userAgent),n.onClickLogin(e,t)}),[]);return i.useEffect((()=>{n.apiLoaded||n.init()}),[n.apiLoaded]),o.jsx(M,{onClick:r,loading:n.loading,icon:o.jsx(y,{})})}));const R=n((function(){const n=i.useContext(g),{onGoogleIdentityResponse:e,onSocialAuthError:t}=i.useContext(u),r=i.useCallback((()=>{s.eventGoogleSignIn(navigator.userAgent),n.onClickLogin()}),[]);return i.useEffect((()=>{n.apiLoaded||n.init()}),[n.apiLoaded]),i.useEffect((()=>{n.isResponseReceived&&n.onTokenReceived(e,t)}),[n.isResponseReceived]),o.jsx(M,{onClick:r,loading:n.loading,icon:o.jsx(h,{})})})),F=e(r)` max-width: 280px; margin: auto; padding: 26px 0; @media (min-width: 1366px) { & .MuiFormControl-root:first-of-type { margin-bottom: 15px; } } `,$=e(a)` &.MuiButton-root { min-width: 120px; min-height: 40px; margin-top: 19px; font-size: 16px; } `,z=e(S)` &.MuiFormControl-root input.MuiInputBase-input { padding: 0.5px 25px; height: 42px; &::placeholder { font-weight: 500; color: #949494; font-size: 14px; } } `,B={"&.MuiFormControl-root":{m:"12px 0 8px","@media(min-width:1366px)":{m:0},"input.MuiInputBase-input":{p:"0.5px 25px",height:"42px","&::placeholder":{fontWeight:500,color:"#949494",fontSize:"14px"}}}};const E=n((function({isModal:n,withoutStop:e}){const{onClickRecover:t,onClickLogin:s,onClickLoginWithoutStop:r,onKeyPress:a,fromController:{username:d,password:p}}=i.useContext(u);return o.jsxs(F,{"data-test":"enj-form-signin",justify:"center",className:"enj-login-form",children:[o.jsx(w,{onKeyPress:a,dataTest:"enj-form-login",children:o.jsxs(o.Fragment,{children:[o.jsx(z,{id:`${d.id||""}${n?"-modal":""}`,fieldState:d,autoComplete:"username",InputProps:{placeholder:c("userOrEmail")}}),o.jsx(j,{id:`${p.id||""}${n?"-modal":""}`,fieldState:p,placeholder:c("password"),sx:B})]})}),o.jsx(f,{fontWeight:400,fontSize:"micro",onClick:t,colortext:"red",margin:l.isDesktop?"10px 0":"-5px 0 0",children:c("recover")}),o.jsx($,{onClick:()=>e?r():s(),children:c("login")}),o.jsx(k,{weight:"bold",margin:"31px 0 7px 0",color:n?"red":"brownRed",text:`${c("accessUsing")}:`}),o.jsxs(v,{"data-test":"enj-form-signin-socialauth",justify:"center",children:[o.jsx(R,{}),o.jsx(L,{})]})]})}));const P=n((function({textId:i="signUpComment"}){const{onClickRegister:n}=m;return o.jsxs(I,{alignItems:"center",sx:{"@media(min-width:1366px)":{mt:"10px"}},children:[o.jsx(f,{fontWeight:600,onClick:()=>n(),children:c("signUp")}),o.jsx(k,{size:"mini",color:"lightGray",margin:"1em auto",maxWidth:"262px",text:c(i),align:"center"}),o.jsx(k,{size:"minis",color:"lightGray",margin:"1em auto",maxWidth:"262px",text:c("acceptTermsAndConditionsLogin",{terms:o.jsx(f,{fontSize:"minis",padding:"0 5px",onClick:()=>{"signUpComment"==i&&d(),p.push(c("route.terms"))},children:c("termsConditions")}),policy:o.jsx(f,{fontSize:"minis",padding:"0 5px",onClick:()=>{"signUpComment"==i&&d(),p.push(c("route.privacy"))},children:c("privacyPolicy")})}),align:"center"})]})}));export{E as L,P as R};