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pack://webstaurantstore/./common/LoginModalContainer/CaptchaContainer.tsx","webpack://webstaurantstore/./common/LoginModalContainer/LoginModal.tsx","webpack://webstaurantstore/./common/LoginModalContainer/index.tsx"],"sourcesContent":["import React, { useRef, useState } from \"react\";\nimport ct from \"class-types.macro\";\nimport { ThunkDispatch } from \"StoreTypes\";\nimport Cookie from \"js-cookie\";\nimport { useReCaptcha } from \"@wss/re-captcha\";\nimport { logException } from \"@wss/error-tracking\";\nimport ModalReact from \"../ModalReact\";\nimport Icon from \"../Icons/Standard\";\nimport { updateUserAndChatFromOrigin } from \"../Store/actions/updateUserAndChatFromOrigin\";\nimport Store from \"../Store\";\nimport LoginModal from \"./LoginModal\";\n\nconst loginUrl = \"/myaccount:login/login/\";\nconst requestEmailLoginLinkUrl = \"/myaccount:login/requestemailloginlink/\";\nconst mergeCartUrl = \"/myaccount/mergecart?sessionGuidFromSessionCart=\";\n\nconst getDefaultErrorStates = () => ({\n hasLoginError: false,\n hasCaptchaError: false,\n hasLoginEmailLinkError: false,\n hasServerError: false,\n});\n\ntype CaptchaContainerProps = {\n csrfToken: string;\n targetURL?: string;\n modalOpen: boolean;\n onClose(): void;\n loginSuccessCallback?: () => void;\n queryParams?: string;\n};\n\nconst CaptchaContainer = ({\n csrfToken,\n targetURL = \"\",\n modalOpen,\n onClose,\n loginSuccessCallback,\n queryParams,\n}: CaptchaContainerProps) => {\n const [email, setEmail] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [errors, setErrors] = useState(getDefaultErrorStates());\n const [isAttemptingLogin, setIsAttemptingLogin] = useState(false);\n const [isRedirecting, setIsRedirecting] = useState(false);\n const [isEmailLoginLinkSent, setIsEmailLoginLinkSent] = useState(false);\n const [isRequestingEmailLoginLink, setIsRequestingEmailLoginLink] = useState(\n false\n );\n\n const loginButtonClicked = useRef(false);\n const emailLinkButtonClicked = useRef(false);\n const reCaptcha = useReCaptcha();\n\n const onLoginButtonClick = async (\n e: React.MouseEvent\n ) => {\n e.preventDefault();\n\n loginButtonClicked.current = true;\n\n setIsAttemptingLogin(true);\n setErrors(getDefaultErrorStates());\n setIsRedirecting(false);\n\n return login();\n };\n\n const login = async () => {\n loginButtonClicked.current = false;\n\n const fetchParameters = await buildLoginParameters();\n\n const results = await sendRequest(loginUrl, fetchParameters);\n if (results.success) {\n handleLoginSucceeded(results.warnings.cartsNeedMerged);\n }\n\n setIsAttemptingLogin(false);\n setErrors(results.errors);\n setIsRedirecting(results.success);\n };\n\n const buildLoginParameters = async () => {\n const captchaToken = await reCaptcha.execute();\n if (captchaToken.isError) throw captchaToken.error;\n const requestBody = JSON.stringify({\n email,\n password,\n csrfToken,\n captchaToken: captchaToken.value,\n });\n\n const fetchParameters: {\n method: string;\n headers: {\n Accept: string;\n \"Content-Type\": string;\n };\n body: string;\n credentials: \"include\" | \"omit\" | \"same-origin\" | undefined;\n } = {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: requestBody,\n credentials: \"include\",\n };\n\n return fetchParameters;\n };\n\n const sendRequest = async (url: string, parameters: RequestInit) => {\n const results = {\n success: false,\n errors: getDefaultErrorStates(),\n warnings: {\n cartsNeedMerged: false,\n },\n };\n\n try {\n const response = await fetch(url, parameters);\n\n if (response.ok) {\n const data: {\n success: boolean;\n warnings: string[];\n errors: string[];\n } = await response.json();\n if (data.success) {\n results.success = true;\n results.warnings.cartsNeedMerged = data.warnings.includes(\n \"CartsNeedMerged\"\n );\n } else {\n results.errors.hasLoginError =\n data.errors.includes(\"InvalidEmail\") ||\n data.errors.includes(\"InvalidPassword\") ||\n data.errors.includes(\"InvalidCsrf\") ||\n data.errors.includes(\"InvalidCredentials\");\n results.errors.hasCaptchaError = data.errors.includes(\n \"InvalidCaptcha\"\n );\n results.errors.hasLoginEmailLinkError =\n data.errors.includes(\"InvalidLoginEmailLinkCaptcha\") ||\n data.errors.includes(\"InvalidLoginEmailLink\");\n }\n } else {\n results.errors.hasServerError = true;\n }\n } catch (error) {\n results.errors.hasServerError = true;\n }\n\n return results;\n };\n\n const handleLoginSucceeded = (cartsNeedMerged: boolean) => {\n const sessionGuid = Cookie.get(\"SESSION_ID\");\n if (cartsNeedMerged && sessionGuid) {\n window.location.href = `${mergeCartUrl + sessionGuid}${\n targetURL !== \"\" ? `&redirect=${targetURL}` : \"\"\n }${queryParams?.replace(\"?\", \"&\")}`;\n } else if (targetURL !== \"\") {\n window.location.href = targetURL + queryParams;\n } else if (loginSuccessCallback) {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n (Store.dispatch as ThunkDispatch)(updateUserAndChatFromOrigin());\n loginSuccessCallback();\n } else if (queryParams) {\n window.location.href = window.location?.href.split(\"?\")[0] + queryParams;\n } else {\n window.location.reload();\n }\n };\n\n const buildRequestEmailLoginLinkParameters = async () => {\n const captchaToken = await reCaptcha.execute();\n if (captchaToken.isError) {\n logException(captchaToken.error);\n setErrors({ ...errors, hasCaptchaError: true });\n throw captchaToken.error;\n }\n const requestBody = JSON.stringify({\n email,\n csrfToken,\n captchaToken: captchaToken.value,\n });\n\n const fetchParameters: {\n method: string;\n headers: {\n Accept: string;\n \"Content-Type\": string;\n };\n body: string;\n credentials: \"include\" | \"omit\" | \"same-origin\" | undefined;\n } = {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: requestBody,\n credentials: \"include\",\n };\n\n return fetchParameters;\n };\n\n const requestEmailLoginLink = async () => {\n emailLinkButtonClicked.current = false;\n\n const fetchParameters = await buildRequestEmailLoginLinkParameters();\n\n const results = await sendRequest(\n requestEmailLoginLinkUrl,\n fetchParameters\n );\n\n setErrors(results.errors);\n setIsRequestingEmailLoginLink(false);\n setIsEmailLoginLinkSent(results.success);\n };\n\n const onRequestEmailLoginLinkButtonClick = async (\n e: React.MouseEvent\n ) => {\n e.preventDefault();\n\n emailLinkButtonClicked.current = true;\n\n setErrors(getDefaultErrorStates());\n setIsRequestingEmailLoginLink(true);\n setIsEmailLoginLinkSent(false);\n\n return requestEmailLoginLink();\n };\n\n const onInputChanged = (e: React.ChangeEvent) => {\n switch (e.target.name) {\n case \"email\":\n setEmail(e.target.value);\n break;\n case \"password\":\n setPassword(e.target.value);\n break;\n default:\n break;\n }\n };\n\n return (\n \n
\n

Login

\n \n \n \n
\n \n \n \n Create an Account\n \n \n \n );\n};\n\nexport default CaptchaContainer;\n","import React from \"react\";\nimport ct from \"class-types.macro\";\n\nimport { RecaptchaDisclaimer } from \"@wss/re-captcha\";\nimport {\n inputBase,\n inputLabel,\n inputErrorMessage,\n inputBaseOptionalClasses,\n} from \"../Form/inputStyles\";\nimport Button from \"../Buttons\";\n\nimport(/* webpackChunkName: \"formsStyles\" */ \"../Form/styles.css\");\n\ntype LoginModalProps = {\n isAttemptingLogin: boolean;\n isRedirecting: boolean;\n isEmailBlank: boolean;\n isPasswordBlank: boolean;\n isRequestingEmailLoginLink: boolean;\n isEmailLoginLinkSent: boolean;\n onLoginButtonClick(e: React.MouseEvent): void;\n onRequestEmailLoginLinkButtonClick(\n e: React.MouseEvent\n ): void;\n onInputChanged(e: React.ChangeEvent): void;\n errors: {\n hasLoginError: boolean;\n hasCaptchaError: boolean;\n hasLoginEmailLinkError: boolean;\n hasServerError: boolean;\n };\n email: string;\n};\n\nconst LoginModal = ({\n isAttemptingLogin,\n isRedirecting,\n isEmailBlank,\n isPasswordBlank,\n isRequestingEmailLoginLink,\n isEmailLoginLinkSent,\n onLoginButtonClick,\n onRequestEmailLoginLinkButtonClick,\n errors,\n onInputChanged,\n email,\n}: LoginModalProps) => {\n const loginButtonDisabled =\n isAttemptingLogin || isRedirecting || isEmailBlank || isPasswordBlank;\n const emailLinkButtonDisabled =\n isRedirecting || isRequestingEmailLoginLink || isEmailBlank;\n\n return (\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n \n Forgot password?\n
\n
\n
\n
\n {errors.hasLoginError && (\n
\n You entered incorrect login information, try again or \n reset your password.\n
\n )}\n {errors.hasCaptchaError && (\n
\n You've entered the Captcha incorrectly. Please try again.\n
\n )}\n {errors.hasLoginEmailLinkError && (\n
\n An error occurred during the request. Please try again.\n
\n )}\n {errors.hasServerError && (\n
\n We were unable to validate your information. Please try again.\n
\n )}\n
\n\n
\n \n Login\n \n\n \n \n
\n \n Email Me a Link to Login\n \n \n {isEmailLoginLinkSent && (\n
\n We've sent a login link to \n {email}\n
\n If you don't receive an email momentarily, please check your\n spam folder.\n
\n )}\n \n \n );\n};\n\nexport default LoginModal;\n","import React from \"react\";\nimport CaptchaContainer from \"./CaptchaContainer\";\n\ntype LoginModalContainerProps = {\n csrfToken: string;\n targetURL?: string;\n modalOpen: boolean;\n onClose(): void;\n loginSuccessCallback?: () => void;\n queryParams?: string;\n};\n\nconst LoginModalContainer = ({\n csrfToken,\n targetURL = \"\",\n modalOpen,\n onClose,\n loginSuccessCallback,\n queryParams,\n}: LoginModalContainerProps) => (\n \n);\n\nexport default LoginModalContainer;\n"],"names":["csrfToken","targetURL","modalOpen","onClose","loginSuccessCallback","queryParams","useState","email","setEmail","password","setPassword","hasLoginError","hasCaptchaError","hasLoginEmailLinkError","hasServerError","getDefaultErrorStates","errors","setErrors","isAttemptingLogin","setIsAttemptingLogin","isRedirecting","setIsRedirecting","isEmailLoginLinkSent","setIsEmailLoginLinkSent","isRequestingEmailLoginLink","setIsRequestingEmailLoginLink","loginButtonClicked","useRef","emailLinkButtonClicked","reCaptcha","useReCaptcha","onLoginButtonClick","e","preventDefault","current","login","fetchParameters","results","buildLoginParameters","sendRequest","success","handleLoginSucceeded","warnings","cartsNeedMerged","captchaToken","requestBody","execute","isError","error","JSON","stringify","value","method","headers","Accept","body","credentials","url","parameters","response","data","fetch","ok","json","includes","sessionGuid","Cookie","get","window","location","href","replace","Store","dispatch","updateUserAndChatFromOrigin","split","reload","buildRequestEmailLoginLinkParameters","logException","requestEmailLoginLink","onRequestEmailLoginLinkButtonClick","ModalReact","isOpen","onRequestClose","className","ct","header","h3","button","type","aria-label","onClick","style","transform","Icon","name","width","height","LoginModal","isEmailBlank","length","isPasswordBlank","onInputChanged","target","span","a","loginButtonDisabled","emailLinkButtonDisabled","div","form","action","label","inputLabel","htmlFor","input","maxLength","required","id","inputBaseOptionalClasses","inputBase","onChange","inputErrorMessage","Button","color","size","disabled","RecaptchaDisclaimer","strong","br","CaptchaContainer"],"sourceRoot":""}