{label}
\n \n\n \n Forgot Password\n \n
\n\n\n By clicking "Let's Go" or "Sign Up with\n Facebook" you accept the\n \n Terms of Service\n \n and \n \n Privacy Policy\n \n
\n >\n );\n};\n\nconst Login = withReduxProvider(LoginBase);\nexport { Login, LoginTestIds };\n","import { setCookie, CookieKeys, getCookie } from \"../../../lib/cookies\";\nimport {\n createAccessToken,\n createUser,\n setAccessToken,\n} from \"../../visitWidgetApi\";\nimport {\n registerError,\n registerFetch,\n registerSuccess,\n} from \"../authActionTypes\";\nimport { initializeUser } from \"../helpers/initializeUser\";\nimport { buildErrorMessage } from \"../helpers/buildErrorMessage\";\n\n/*\n * Register user.\n */\nexport const registerUserAction =\n ({\n email,\n password,\n name,\n newsletters,\n captcha,\n postalCode,\n }: {\n email: string;\n password: string;\n name: string;\n newsletters: { id: number }[];\n captcha: string;\n postalCode?: string;\n }) =>\n async (dispatch) => {\n try {\n dispatch(registerFetch());\n\n const planId = await getCookie(CookieKeys.planId, undefined);\n const user = await createUser({\n email,\n password,\n name,\n newsletters,\n captcha,\n postalCode,\n planId,\n });\n\n const accessToken = await createAccessToken(email, password);\n setCookie(CookieKeys.authToken, accessToken);\n setAccessToken(accessToken);\n await initializeUser(accessToken, dispatch);\n\n dispatch(registerSuccess(user, accessToken));\n\n // BRIDGE: hybrid action\n VisitWidget.Modal.close($(\".modal\"));\n } catch (error) {\n const errorMessage = buildErrorMessage(error);\n alert(errorMessage);\n dispatch(registerError(errorMessage));\n }\n };\n","/* eslint-disable */\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport useScript from \"react-script-hook\";\n\nconst script = `https://www.google.com/recaptcha/api.js?render=explicit&hl=${I18n.locale}`;\n\nconst ReCaptcha = forwardRef<{}, any>((props, ref) => {\n const [loading, error] = useScript({ src: script });\n const captchaRef = useRef();\n const captchaInstanceRef = useRef<{\n reset: () => void;\n getValue: () => string;\n }>();\n\n useImperativeHandle(ref, () => ({\n reset() {\n if (captchaRef.current) {\n const anyWindow = window as any;\n anyWindow.grecaptcha.reset(captchaRef.current);\n }\n },\n getValue() {\n return $(captchaRef.current).find(\".g-recaptcha-response\").val();\n },\n }));\n\n useEffect(() => {\n if (!loading && !error) {\n const anyWindow = window as any;\n anyWindow.grecaptcha.ready(() => {\n const instance = anyWindow.grecaptcha.render(captchaRef.current, {\n sitekey: VisitWidget.settings.recaptchaSiteKey,\n hl: I18n.locale,\n });\n captchaInstanceRef.current = instance;\n });\n }\n }, [loading, error, captchaRef]);\n\n if (error || loading) {\n return <>>;\n }\n\n return (\n <>\n \n >\n );\n});\nexport { ReCaptcha };\n","import React, {\n FunctionComponent,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { registerUserAction } from \"../../../store/auth/actions/registerUserAction\";\nimport { ReCaptcha } from \"../../../components/reCaptcha\";\nimport { RootReducerState } from \"../../../store/rootReducer\";\nimport translate from \"../../../lib/queries/translate\";\nimport { withReduxProvider } from \"../../../store/withReduxProvider\";\n\n// eslint-disable-next-line no-shadow\nconst enum RegisterTestIds {\n submitInput = \"submit-input\",\n newsletterInput = \"newsletter-input\",\n emailInput = \"email-input\",\n passwordInput = \"password-input\",\n nameInput = \"name-input\",\n postalCodeInput = \"postal-code-input\",\n}\n\nconst RegisterBase: FunctionComponent = () => {\n const emailInput = useRef{translate(\"authentication.forgot_password.instructions\")}
\n \n >\n )}\n {resetPasswordStatus === \"success\" && (\n <>\n{translate(\"authentication.forgot_password.success_message\")}
\n >\n )}\n\n \n {translate(\"authentication.back_link\")}\n \n >\n );\n};\n\nconst ResetPassword = withReduxProvider(ResetPasswordBase);\nexport { ResetPassword, ResetPasswordTestIds };\n","export const getQueryStringValue = (key: string): string | undefined => {\n const result = new URLSearchParams(window.location.search).get(key);\n return result === null ? undefined : result;\n};\n\nexport const getQueryStringValues = (key: string): string[] => {\n return new URLSearchParams(window.location.search).getAll(key);\n};\n\nexport const getFragmentValue = (key: string): string | undefined => {\n const result = new URLSearchParams(window.location.hash.slice(1)).get(key);\n return result === null ? undefined : result;\n};\n","import { setPlan } from \"../../plan/planActionTypes\";\nimport { CookieKeys, getCookie, setCookie } from \"../../../lib/cookies\";\nimport { PlanItemDto } from \"../../../store/apiTypes\";\nimport { listPlanItems } from \"../../../store/visitWidgetApi\";\nimport { getInitialPlanData } from \"./getInitialPlanData\";\nimport { setLegacyState } from \"./setLegacyState\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst initializeAnonymousUser = async (dispatch: any) => {\n const planData = await getInitialPlanData();\n\n const planTourIds = VisitWidget.store.planTourIds;\n\n const categoryIds = await getCookie(CookieKeys.categoryIds, undefined);\n if (categoryIds === undefined) {\n await setCookie(\n CookieKeys.categoryIds,\n JSON.stringify(VisitWidget.store.categoryIds),\n );\n }\n\n let planItems = [] as Array