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KA,EAAAA,GAAAA,OACL,KAAKA,EAAAA,GAAAA,SACJF,EAAM,aACN,MACD,KAAKE,EAAAA,GAAAA,OACJF,EAAM,UACN,MACD,KAAKE,EAAAA,GAAAA,KACJF,EAAM,qBAKR,OAAO,gBAAC,EAAA/B,SAAD,CAAUC,GAAI8B,GACrB,IAcC,gBAACG,EAAA,EAAD,MAGF,C","sources":["webpack://NorthernTuna/./common/react/components/Pages/Login/SendCodeButton.tsx","webpack://NorthernTuna/./common/react/components/Pages/Login/Login.tsx","webpack://NorthernTuna/./ClientApp/components/Pages/Login/AuthTwilioCode.tsx","webpack://NorthernTuna/./ClientApp/components/Pages/Login/Login.tsx"],"sourcesContent":["import React from 'react';\n\nimport * as Yup from 'yup';\nimport Alert from 'antd/lib/alert';\nimport Modal from 'antd/lib/modal';\n\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\nimport FormikField from '@common/react/components/Forms/FormikField/FormikField';\nimport { ConfirmationCodeInput } from '@common/react/components/Forms/ConfirmationCodeInput/ConfirmationCodeInput';\nimport { RequestButton } from '@common/react/components/UI/LoadingButton/LoadingButton';\nimport { phoneRegexp, simpleStringValidator } from '@common/react/utils/validationHelpers';\nimport { BaseUser } from '@common/typescript/objects/BaseUser';\nimport { BaseInit } from '@common/react/objects/BaseInit';\nimport { AuthResult } from '@common/react/components/Core/Application/Application';\nimport Button from '@common/react/components/Forms/Button';\n\ninterface Props> {\n\tphone: string;\n\tafterSubmit?: ({ phone: string }, res: AuthResult) => void;\n\tauthRequest: string;\n\tsendCodeRequest: string;\n\tresendCodeRequest?: string;\n\topenModal?: boolean;\n}\n\nconst validationSchemaConfirm = Yup.object().shape({\n\tloginCode: simpleStringValidator,\n});\n\nconst SendCodeButton: = BaseInit>(p: Props) =>\nReact.ReactElement = = BaseInit>(props: Props) => {\n\tconst {\n\t\tphone,\n\t\tafterSubmit,\n\t\tauthRequest = 'authByCode',\n\t\tsendCodeRequest = 'sendLoginCode',\n\t\topenModal = false,\n\t\tresendCodeRequest = sendCodeRequest,\n\t} = props;\n\tconst [open, setOpen] = React.useState(openModal);\n\tconst isPhoneValid = React.useMemo(() => {\n\t\treturn phoneRegexp.test(phone || '');\n\t}, [phone]);\n\n\tconst [time, setTime] = React.useState(30);\n\tconst ref = React.useRef(null);\n\n\tconst startTimer = () => {\n\t\tref.current = null;\n\t\tsetTime(60);\n\t\tref.current = setInterval(() => {\n\t\t\tsetTime((prev) => {\n\t\t\t\tconst newTime = prev - 1;\n\t\t\t\tif (!newTime && ref.current) {\n\t\t\t\t\tclearInterval(ref.current);\n\t\t\t\t\tref.current = null;\n\t\t\t\t}\n\t\t\t\treturn newTime;\n\t\t\t});\n\t\t}, 1000);\n\t\treturn () => {\n\t\t\tif (ref.current) {\n\t\t\t\tclearInterval(ref.current);\n\t\t\t}\n\t\t};\n\t};\n\n\tReact.useEffect(() => {\n\t\tstartTimer();\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tif (openModal && !open) {\n\t\t\tsetOpen(openModal);\n\t\t}\n\t}, [openModal]);\n\n\tif (!isPhoneValid) return <>;\n\n\treturn <>\n\t\t {\n\t\t\t\tsetOpen(true);\n\t\t\t}}\n\t\t>\n\t\t\tSend Code\n\t\t\n\t\t {\n\t\t\t\tsetOpen(false);\n\t\t\t}}\n\t\t\tdestroyOnClose\n\t\t\twidth={500}\n\t\t\tfooter={null}\n\t\t>\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\tSecurity code has been sent to your phone number.\n\t\t\t\t\t
}\n\t\t\t\t/>\n\t\t\t\n\t\t\t
\n\t\t\t\tDidn't receive a code?\n\t\t\t\t{' '}\n\t\t\t\t{time ? `Resend code in ${time} seconds.`\n\t\t\t\t\t: (\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tstartTimer();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonError={(e) => {\n\t\t\t\t\t\t\t\tModal.error({\n\t\t\t\t\t\t\t\t\ttitle: 'Error',\n\t\t\t\t\t\t\t\t\tcontent: e,\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (ref.current) {\n\t\t\t\t\t\t\t\t\tclearInterval(ref.current);\n\t\t\t\t\t\t\t\t\tref.current = null;\n\t\t\t\t\t\t\t\t\tsetTime(0);\n\t\t\t\t\t\t\t\t\tstartTimer();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\trequestType={resendCodeRequest}\n\t\t\t\t\t\t\trequestProps={{ phoneNumber: phone }}\n\t\t\t\t\t\t\tsuccessMessage=\"Security code has been successfully sent.\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tResend code\n\t\t\t\t\t\t)}\n\t\t\t
\n\t\t\t\n\t\t\t\tid={-1}\n\t\t\t\tadd={{\n\t\t\t\t\tloginCode: '',\n\t\t\t\t\tlogin: phone,\n\t\t\t\t\tpath: '/',\n\t\t\t\t}}\n\t\t\t\ttype=\"\"\n\t\t\t\tsaveRequest={authRequest}\n\t\t\t\tvalidationSchema={validationSchemaConfirm}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\tformikProps={{ enableReinitialize: true }}\n\t\t\t\t\tsuccessMessage=\"\"\n\t\t\t\t\tafterSubmit={(values, res) => {\n\t\t\t\t\t\tsetOpen(false);\n\t\t\t\t\t\tafterSubmit && afterSubmit({ phone }, res);\n\t\t\t\t\t}}\n\t\t\t\t\tsaveText=\"Send\"\n\t\t\t\t\tedit={(formikBag, deleteItem, { loading }) =>
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst value = e.currentTarget.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfieldProps.field.onChange(e);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (value.length === 4 && !loading) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tformikBag.submitForm();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t;\n};\n\nexport default SendCodeButton;\n","import * as React from 'react';\nimport { Link, Navigate, useLocation } from 'react-router-dom';\n\nimport * as Yup from 'yup';\n\nimport { AuthResult, useApplicationContext } from '@common/react/components/Core/Application/Application';\nimport { BaseInit } from '@common/react/objects/BaseInit';\nimport { simpleStringValidator } from '@common/react/utils/validationHelpers';\nimport FormikField from '@common/react/components/Forms/FormikField/FormikField';\nimport { BaseUser } from '@common/typescript/objects/BaseUser';\nimport PhoneOrEmailInput, { emailOrPhoneValidator } from '@common/react/components/Forms/PhoneOrEmailInput/PhoneOrEmailInput';\nimport ServerPageProvider from '@common/react/components/Core/ServerPageProvider/ServerPageProvider';\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\nimport { callWithConnectionOnce } from '@common/react/utils/configureSignarR';\nimport { WithId } from '@common/typescript/objects/WithId';\nimport SendCodeButton from '@common/react/components/Pages/Login/SendCodeButton';\n\nimport '@common/react/scss/components/login.scss';\n\nexport interface LoginFormValues extends WithId {\n\tlogin: string;\n\tpassword: string;\n\tcode: string;\n\tpath: string;\n}\n\nconst validationSchema = Yup.object().shape({\n\tlogin: emailOrPhoneValidator,\n\tpassword: simpleStringValidator,\n});\n\nexport interface AuthCodeComponentProps = BaseInit> {\n\tformValues: LoginFormValues;\n\tafterSubmit: (item: LoginFormValues, res: AuthResult) => void;\n\tcancelAuthWithCode: () => void;\n}\n\ninterface LoginProps> {\n\tcontainerClassName?: string;\n\tafterBaseRedirectUser?: (user: User) => React.ReactNode;\n\trenderAuthWithCode?: (props: AuthCodeComponentProps) => React.ReactNode;\n\tlogo?: React.ReactNode;\n\twithFieldTitle?: boolean;\n\ttitle?: string;\n\twithoutServerPage?: boolean;\n\trequest?: string;\n\tafterSubmit?: (item: LoginFormValues, res: AuthResult) => void;\n\tonSaveRequestError?: ((error: string) => void);\n\tbuttons?: React.ReactNode;\n\tafterLogin?: () => void;\n\trecoverPath?: string;\n\tauthByCodeRequest?: string;\n\tsendCodeRequest?: string;\n}\n\nconst Login: = BaseInit>(p: LoginProps) =>\nReact.ReactElement = = BaseInit>(props) => {\n\tconst search = useLocation().search;\n\n\tconst [isVisible, setIsVisible] = React.useState(false);\n\tconst [openLoginCode, setOpenLoginCode] = React.useState(false);\n\tconst [formValues, setFormValues] = React.useState(null);\n\n\tconst { getUser, getHostOptions, handleLogin } = useApplicationContext();\n\tconst user = getUser();\n\tconst hostOptions = getHostOptions();\n\n\tconst {\n\t\tafterBaseRedirectUser,\n\t\trenderAuthWithCode,\n\t\twithFieldTitle,\n\t\tcontainerClassName = '',\n\t\tlogo,\n\t\tbuttons,\n\t\ttitle = 'Login',\n\t\twithoutServerPage,\n\t\trequest = 'auth',\n\t\trecoverPath = '/recover',\n\t\tafterSubmit = (item, res) => {\n\t\t\thandleLogin(res?.initObject as TInit);\n\n\t\t\tsetFormValues(null);\n\t\t},\n\t\tonSaveRequestError = (error) => {\n\t\t\tif (error === '2FA enabled' && renderAuthWithCode) {\n\t\t\t\tsetIsVisible(true);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (error === 'The confirmation code has been sent.') {\n\t\t\t\tsetOpenLoginCode(true);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\t\tafterLogin,\n\t\tauthByCodeRequest = 'authByCode',\n\t\tsendCodeRequest,\n\t} = props;\n\n\tconst [afterLoginTrigger, setLoginTrigger] = React.useState(false);\n\n\tReact.useEffect(() => {\n\t\tif (user && !afterLoginTrigger) {\n\t\t\tafterLogin && afterLogin();\n\t\t\tsetLoginTrigger(true);\n\t\t}\n\t}, [!!user]);\n\n\tconst redirectUser = React.useCallback((user: User) => {\n\t\tif (hostOptions?.redirectUrlName) {\n\t\t\tconst redirectUrl = new URLSearchParams(search).get(hostOptions.redirectUrlName);\n\t\t\tif (redirectUrl) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\n\t\tif (afterBaseRedirectUser) {\n\t\t\treturn afterBaseRedirectUser(user);\n\t\t}\n\n\t\treturn ;\n\t}, [afterBaseRedirectUser]);\n\n\tconst beforeSubmit = (values, actions, submit) => {\n\t\tsetFormValues(values);\n\n\t\tcallWithConnectionOnce(() => { submit(); });\n\t};\n\n\tconst cancelAuthWithCode = () => {\n\t\tsetIsVisible(false);\n\t};\n\n\treturn (<>\n\t\t{!withoutServerPage\n\t\t\t\t&& }\n\t\t\t\t\tinner={(serverPage) => <>}\n\t\t\t\t/>\n\t\t}\n\t\t
\n\t\t\t{logo}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tid={-1}\n\t\t\t\t\ttype={request}\n\t\t\t\t\tadd={{\n\t\t\t\t\t\tlogin: '',\n\t\t\t\t\t\tpassword: '',\n\t\t\t\t\t\tcode: '',\n\t\t\t\t\t\tpath: '/',\n\t\t\t\t\t}}\n\t\t\t\t\tvalidationSchema={validationSchema}\n\t\t\t\t\tonSaveRequestError={onSaveRequestError}\n\t\t\t\t>\n\t\t\t\t\t{renderAuthWithCode && isVisible && !user\n\t\t\t\t\t\t? renderAuthWithCode({ formValues, afterSubmit, cancelAuthWithCode })\n\t\t\t\t\t\t:
\n\t\t\t\t\t\t\t{user && redirectUser(user)}\n\t\t\t\t\t\t\t{title &&
\n\t\t\t\t\t\t\t\t

{title}

\n\t\t\t\t\t\t\t
}\n\t\t\t\t\t\t\t <>\n\t\t\t\t\t\t\t\t\t <>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{authByCodeRequest && fieldProps.field.value\n\t\t\t\t\t\t\t\t\t\t\t\t&& \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{recoverPath &&
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\tForget Password?\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\n\t);\n};\n\nexport default Login;\n","import * as React from 'react';\n\nimport * as Yup from 'yup';\n\nimport Button from '@common/react/components/Forms/Button';\nimport FormikField from '@common/react/components/Forms/FormikField/FormikField';\nimport { simpleStringValidator } from '@common/react/utils/validationHelpers';\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\nimport { LoginFormValues } from '@common/react/components/Pages/Login/Login';\nimport { ConfirmationCodeInput } from '@common/react/components/Forms/ConfirmationCodeInput/ConfirmationCodeInput';\n\nconst validationSchema = Yup.object().shape({\n\tcode: simpleStringValidator,\n});\n\nexport interface AuthCodeComponentProps {\n\tformValues: LoginFormValues;\n\tafterSubmit: (item: LoginFormValues, res: any) => void;\n\tcancelAuthWithCode: () => void;\n\tcodeSize?: number;\n\tautoSubmit?: boolean;\n}\n\nconst AuthTwilioCode: React.FC = ({\n\tformValues,\n\tafterSubmit,\n\tcancelAuthWithCode,\n\tcodeSize = 7,\n\tautoSubmit = true,\n}) => {\n\tconst mask = [...Array(codeSize)].map(() => /\\d/);\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tid={-1}\n\t\t\t\t\ttype=\"auth\"\n\t\t\t\t\tadd={{ ...formValues, code: '' }}\n\t\t\t\t\tvalidationSchema={validationSchema}\n\t\t\t\t\ttransformAfterSave={() => ({ ...formValues, code: '' })}\n\t\t\t\t>\n\t\t\t\t\t <>\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\tPlease enter your Authy code\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst value = e.currentTarget.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfieldProps.field.onChange(e);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (value.length === codeSize && !loading) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tformikBag.submitForm();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t: fieldProps\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmask={mask}\n\t\t\t\t\t\t\t\t/>}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tSubmit\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\tCan't access your authy app?\n\t\t\t\t\t{' '}\n\t\t\t\t\tTry other ways\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default AuthTwilioCode;\n","import * as React from 'react';\nimport { Navigate } from 'react-router-dom';\n\nimport LoginPage, { AuthCodeComponentProps } from '@common/react/components/Pages/Login/Login';\n\nimport { User, UserRole } from '@app/objects/User';\nimport { Init } from '@app/objects/Init';\nimport AuthTwilioCode from '@app/components/Pages/Login/AuthTwilioCode';\nimport Footer from '@app/components/UI/Footer/Footer';\n\nimport '@app/scss/pages/openPage.scss';\n\nconst Login: React.FC = () => {\n\tconst renderAuthTwilioCode = (props: AuthCodeComponentProps) => ;\n\n\tconst afterBaseRedirectUser = (user: User) => {\n\t\tlet url = '/';\n\t\tswitch (user.role) {\n\t\t\tcase UserRole.Admin:\n\t\t\tcase UserRole.ContentManager:\n\t\t\tcase UserRole.Staff:\n\t\t\tcase UserRole.Doctor:\n\t\t\tcase UserRole.Provider:\n\t\t\t\turl = '/dashboard';\n\t\t\t\tbreak;\n\t\t\tcase UserRole.Intern:\n\t\t\t\turl = '/wizard';\n\t\t\t\tbreak;\n\t\t\tcase UserRole.User:\n\t\t\t\turl = '/patient-dashboard';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn ;\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\tcontainerClassName=\"enter-page form-center login-page open-page page-with-footer\"\n\t\t\t\tlogo={(\n\t\t\t\t\t
\n\t\t\t\t\t\t\"Northern\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\trenderAuthWithCode={renderAuthTwilioCode}\n\t\t\t\tafterBaseRedirectUser={afterBaseRedirectUser}\n\t\t\t/>\n\t\t\t