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AACC,KAAMC,EAAAA,CAAMA,CAACG,cAAc,UAAGxG,EAAU,kCAKlE,EClJAyG,EATa,IAGL,GAAA5C,EAAAC,GAAA,EAAC4C,EAAAA,CAASA,CAAAA,UACN,GAAA7C,EAAAC,GAAA,EAAC6C,EAASA,CAAAA,2BCPtBC,EAAAC,OAAA,CAAAvH,EAAA","sources":["webpack://_N_E/","webpack://_N_E/./components/forms/hooks/UseLoginHook.tsx","webpack://_N_E/./components/forms/login.tsx","webpack://_N_E/./pages/index.tsx","webpack://_N_E/./node_modules/.pnpm/next@14.2.23_@babel+core@7.26.10_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.86.0/node_modules/next/router.js"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/\",\n function () {\n return require(\"private-next-pages/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/\"])\n });\n }\n ","import { useState } from 'react'\nimport { post } from '../../../services/api/axiosClient'\nimport useTranslations from '../../../helpers/useTranslations'\n\nconst sendLoginGTMEvent = (data: {\n event: 'login'\n tm_status: 'success' | 'fail'\n /**the text that is shown to the user when te login attempt fails */\n tm_value: string\n /**Number of login attempts in a session */\n tm_count: string\n}) => window.dataLayer.push(data)\n\nconst UseLoginHook = () => {\n const [loginError, setLoginError] = useState(false)\n const [isLoading, setIsLoading] = useState(false)\n const translate = useTranslations()\n\n const loginHandler = async (data: any) => {\n if (!data) {\n return\n }\n setIsLoading(true)\n return post(`api/account/login`, data)\n .then(({ data: response }) => {\n if (response.isSuccess) {\n sendLoginGTMEvent({\n event: 'login',\n tm_status: 'success',\n tm_value: '',\n tm_count: '',\n })\n setLoginError(false)\n location.replace(response.data)\n } else {\n sendLoginGTMEvent({\n event: 'login',\n tm_status: 'fail',\n tm_value: translate('PASSWORD_DOES_NOT_MATCH'),\n tm_count: '',\n })\n setLoginError(true)\n }\n })\n .catch(() => {\n setLoginError(true)\n })\n .finally(() => {\n setIsLoading(false)\n })\n }\n\n return {\n isLoading,\n loginHandler,\n loginError,\n }\n}\n\nexport default UseLoginHook\n","import { yupResolver } from '@hookform/resolvers/yup'\nimport {\n Button,\n ButtonTypes,\n ButtonVariants,\n FormField,\n FormInput,\n InlineNotification,\n NotificationVariant,\n Text,\n TextTypes,\n} from '@stopen-components/stopen-components'\nimport Link from 'next/link'\nimport { useRouter } from 'next/router'\nimport { ParsedUrlQuery } from 'querystring'\nimport { useEffect, useState } from 'react'\nimport { Controller, useForm } from 'react-hook-form'\nimport * as yup from 'yup'\nimport { Routes } from '../../constants/routeConstants'\nimport useTranslations from '../../helpers/useTranslations'\nimport UseLoginHook from './hooks/UseLoginHook'\n\nconst LoginForm = (): JSX.Element => {\n const router = useRouter()\n const [showPassword, setShowPassword] = useState(false)\n const [queryStringParams, setQueryStringParams] = useState({})\n const translate = useTranslations()\n const { isLoading, loginHandler, loginError } = UseLoginHook()\n\n const ERROR_MSG: { [key: string]: string } = {\n REQUIRED: translate('ERROR_REQUIRED'),\n E_MAIL: translate('ERROR_E_MAIL'),\n }\n\n const validationSchema = yup.object().shape({\n email: yup.string().email(ERROR_MSG.E_MAIL).required(ERROR_MSG.REQUIRED),\n password: yup.string().required(ERROR_MSG.REQUIRED),\n })\n\n const {\n control,\n handleSubmit,\n formState: { errors },\n } = useForm({\n resolver: yupResolver(validationSchema),\n defaultValues: {\n email: '',\n password: '',\n },\n })\n\n useEffect(() => {\n setQueryStringParams(getParams(router.asPath))\n }, [router.query])\n\n const getParams = (url: string): ParsedUrlQuery => {\n const paramsObject: ParsedUrlQuery = {}\n const splitUrl: string[] = url.split('?')\n splitUrl.shift()\n const decoded: string = decodeURIComponent(splitUrl.join(''))\n const searchParams = new URLSearchParams(decoded)\n searchParams.forEach((value: string, key: string) => (paramsObject[key] = value))\n\n return paramsObject\n }\n\n const onSubmit = async (data: any) => {\n const newDataObj = {\n ...data,\n ...queryStringParams,\n }\n await loginHandler(newDataObj)\n }\n\n const showPasswordHandler = (): void => setShowPassword((current: boolean) => !current)\n\n return (\n
\n
\n \n {translate('TITLE')}\n \n\n \n (\n onChange({ target: { value } })}\n error={!!errors?.email?.message}\n />\n )}\n />\n \n\n \n (\n onChange({ target: { value: value } })}\n onClickSuffix={showPasswordHandler}\n error={!!errors?.password?.message}\n />\n )}\n />\n \n\n {loginError && (\n \n )}\n\n \n {translate('LOGIN_BUTTON')}\n \n\n \n {translate('FOOTER_NO_ACCOUNT')}{' '}\n {translate('FOOTER_REGISTRATION')}\n \n\n \n {translate('FOOTER_FORGOT_PASSWORD')}\n \n
\n
\n )\n}\n\nexport default LoginForm\n","import AppLayout from \"../components/layouts/app-layout/app-layout\";\nimport LoginForm from \"../components/forms/login\";\n\nconst Home = (): JSX.Element => {\n\n return (\n \n \n \n )\n}\n\nexport default Home\n","module.exports = require('./dist/client/router')\n"],"names":["window","__NEXT_P","push","__webpack_require__","sendLoginGTMEvent","dataLayer","data","hooks_UseLoginHook","loginError","setLoginError","useState","isLoading","setIsLoading","translate","useTranslations","loginHandler","post","then","response","param","isSuccess","event","tm_status","tm_value","tm_count","location","replace","catch","finally","login","errors","router","useRouter","showPassword","setShowPassword","queryStringParams","setQueryStringParams","UseLoginHook","ERROR_MSG","REQUIRED","E_MAIL","validationSchema","yup","shape","email","required","password","control","handleSubmit","formState","useForm","resolver","yupResolver","defaultValues","useEffect","getParams","asPath","query","paramsObject","splitUrl","url","split","shift","searchParams","URLSearchParams","decodeURIComponent","join","forEach","value","key","onSubmit","newDataObj","showPasswordHandler","current","jsx_runtime","jsx","form","jsxs","div","className","Text","type","TextTypes","HEADING_1","FormField","name","label","error","message","undefined","Controller","render","field","onChange","FormInput","target","suffix","onClickSuffix","InlineNotification","id","variant","NotificationVariant","ERROR","dismissable","Button","loading","ButtonTypes","SUBMIT","ButtonVariants","PRIMARY","onClick","disabled","Link","href","Routes","REGISTRATION_APP","LINK","RESET_PASSWORD","pages","AppLayout","LoginForm","module","exports"],"sourceRoot":""}