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AAA,GAAWC,IAA4B,WAAdC,GAA0B,SAAUmB,GAAgB,iBAE1G,OAAOjC,EAAAA,EAAAA,GAAe6C,EAAOvC,EAAqBP,EAAQ,EAsH1CE,CAAkBJ,GAClC,OAAoBK,EAAAA,EAAAA,KAAKS,GAAUb,EAAAA,EAAAA,GAAS,CAC1CL,WAAWU,EAAAA,EAAAA,GAAKJ,EAAQpJ,KAAM8I,GAC9BM,QAASqC,EACT5H,MAAOA,EACPsG,UAAWA,EACXoB,OAtCiBY,IACjBR,EAAkBQ,IAEgB,IAA9BT,EAAkBtL,SACpB2L,GAAgB,GAGdR,GACFA,EAAOY,EACT,EA8BAX,QA3BkBW,IAClBP,EAAmBO,IAEe,IAA9BT,EAAkBtL,SACpB2L,GAAgB,GAGdP,GACFA,EAAQW,EACV,EAmBAvD,IAAKoD,EACL9C,WAAYA,EACZ3F,QAASA,GACRyF,GACL,G","sources":["webpack://_N_E/?1d34","webpack://_N_E/./src/guards/GuestGuard.tsx","webpack://_N_E/./src/hooks/useIsMountedRef.ts","webpack://_N_E/./src/hooks/useResponsive.ts","webpack://_N_E/./src/pages/auth/login.tsx","webpack://_N_E/./src/sections/auth/login/LoginForm.tsx","webpack://_N_E/./src/utils/getAuthErrorMessage.ts","webpack://_N_E/../node_modules/@mui/material/Card/cardClasses.js","webpack://_N_E/../node_modules/@mui/material/Card/Card.js","webpack://_N_E/../node_modules/@mui/material/Link/linkClasses.js","webpack://_N_E/../node_modules/@mui/material/Link/Link.js"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/auth/login\",\n function () {\n return require(\"private-next-pages/auth/login.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/auth/login\"])\n });\n }\n ","import { ReactNode, useEffect } from 'react';\n// next\nimport { useRouter } from 'next/router';\n// hooks\nimport useAuth from '../hooks/useAuth';\n// routes\nimport { PATH_GLOBAL } from '../routes/paths';\n\n// ----------------------------------------------------------------------\n\ntype Props = {\n children: ReactNode;\n};\n\nexport default function GuestGuard({ children }: Props) {\n const { push } = useRouter();\n\n const { isAuthenticated, isAdmin, organization } = useAuth();\n\n useEffect(() => {\n if (isAuthenticated && isAdmin === false) {\n window.location.href = '/app/' + organization + '/me';\n }\n if (isAdmin) {\n push(PATH_GLOBAL.organizations.root);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isAuthenticated, isAdmin]);\n\n return <>{children};\n}\n","import { useRef, useEffect } from 'react';\n\n// ----------------------------------------------------------------------\n\nexport default function useIsMountedRef() {\n const isMounted = useRef(true);\n\n useEffect(\n () => () => {\n isMounted.current = false;\n },\n []\n );\n\n return isMounted;\n}\n","// @mui\nimport { Breakpoint } from '@mui/material';\nimport { useTheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\n// ----------------------------------------------------------------------\n\ntype Query = 'up' | 'down' | 'between' | 'only';\ntype Key = Breakpoint | number;\ntype Start = Breakpoint | number;\ntype End = Breakpoint | number;\n\n/**\n * デスクトップ画面('lg'ブレークポイント以上)であるかどうかを判定\n * @example\n * const isDesktop = useResponsive('up', 'lg');\n * */\n\nexport default function useResponsive(query: Query, key?: Key, start?: Start, end?: End) {\n const theme = useTheme();\n\n const mediaUp = useMediaQuery(theme.breakpoints.up(key as Key));\n\n const mediaDown = useMediaQuery(theme.breakpoints.down(key as Key));\n\n const mediaBetween = useMediaQuery(theme.breakpoints.between(start as Start, end as End));\n\n const mediaOnly = useMediaQuery(theme.breakpoints.only(key as Breakpoint));\n\n if (query === 'up') {\n return mediaUp;\n }\n\n if (query === 'down') {\n return mediaDown;\n }\n\n if (query === 'between') {\n return mediaBetween;\n }\n\n if (query === 'only') {\n return mediaOnly;\n }\n}\n","// next\n// @mui\nimport { styled } from '@mui/material/styles';\nimport { Box, Card, Stack, Container, Typography, useTheme } from '@mui/material';\n// routes\n// hooks\nimport useResponsive from '../../hooks/useResponsive';\n// guards\nimport GuestGuard from '../../guards/GuestGuard';\n// components\nimport Page from '../../components/Page';\nimport Image from '../../components/Image';\n// sections\nimport { LoginForm } from '../../sections/auth/login';\n\n// ----------------------------------------------------------------------\n\nconst RootStyle = styled('div')(({ theme }) => ({\n [theme.breakpoints.up('md')]: {\n display: 'flex',\n },\n}));\n\nconst SectionStyle = styled(Card)(({ theme }) => ({\n width: '100%',\n maxWidth: 464,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n margin: theme.spacing(2, 0, 2, 2),\n}));\n\nconst ContentStyle = styled('div')(({ theme }) => ({\n maxWidth: 480,\n margin: 'auto',\n display: 'flex',\n minHeight: '100vh',\n flexDirection: 'column',\n justifyContent: 'center',\n padding: theme.spacing(12, 0),\n}));\n\n// ----------------------------------------------------------------------\n\nexport default function Login() {\n const mdUp = useResponsive('up', 'md');\n const theme = useTheme();\n\n return (\n \n \n \n {mdUp && (\n \n \n \n \n \n へようこそ\n \n \n \"login\"\n \n \n )}\n \n \n \n \n \n ログイン\n \n \n メールアドレスとパスワードを入力してください。\n \n \n \n \n \n \n \n \n \n );\n}\n","import * as Yup from 'yup';\nimport { useState } from 'react';\n// next\nimport NextLink from 'next/link';\n// form\nimport { useForm } from 'react-hook-form';\nimport { yupResolver } from '@hookform/resolvers/yup';\n// @mui\nimport { Link, Stack, Alert, IconButton, InputAdornment, Box } from '@mui/material';\nimport { LoadingButton } from '@mui/lab';\n// routes\nimport { PATH_AUTH } from '../../../routes/paths';\n// hooks\nimport useAuth from '../../../hooks/useAuth';\nimport useIsMountedRef from '../../../hooks/useIsMountedRef';\n// components\nimport Iconify from '../../../components/Iconify';\nimport { FormProvider, RHFTextField } from '../../../components/hook-form';\nimport getAuthErrorMessage from 'src/utils/getAuthErrorMessage';\nimport { useSnackbar } from 'notistack';\n\n// ----------------------------------------------------------------------\n\ntype FormValuesProps = {\n email: string;\n password: string;\n afterSubmit?: string;\n};\n\nexport default function LoginForm() {\n const { login } = useAuth();\n\n const isMountedRef = useIsMountedRef();\n const { enqueueSnackbar } = useSnackbar();\n\n const [showPassword, setShowPassword] = useState(false);\n\n const LoginSchema = Yup.object().shape({\n email: Yup.string()\n .email('有効なメールアドレスを使用してください。')\n .required('メールアドレスは必須です。'),\n password: Yup.string().required('パスワードは必須です。'),\n });\n\n const defaultValues = {\n email: '',\n password: '',\n };\n\n const methods = useForm({\n resolver: yupResolver(LoginSchema),\n defaultValues,\n });\n\n const {\n setError,\n handleSubmit,\n formState: { errors, isSubmitting },\n } = methods;\n\n const onSubmit = async (data: FormValuesProps) => {\n try {\n await login(data.email, data.password);\n } catch (error) {\n if (error.type === 'AccountDeleted') {\n enqueueSnackbar(\n 'このメールアドレスでアクティブなアカウントが存在しません。\\n再度アクティブにしたい場合は管理者の方に問い合わせてください。',\n { variant: 'error' }\n );\n } else {\n enqueueSnackbar('ログインに失敗しました。再度お試しください。', { variant: 'error' });\n }\n console.error(error.message);\n if (isMountedRef.current) {\n const errorMsg = getAuthErrorMessage(error);\n setError('afterSubmit', { ...error, message: errorMsg });\n }\n }\n };\n\n return (\n \n \n {!!errors.afterSubmit && {errors.afterSubmit.message}}\n \n \n setShowPassword(!showPassword)} edge=\"end\">\n \n \n \n ),\n }}\n />\n \n \n \n パスワードを忘れた方はこちら\n \n \n \n ログイン\n \n \n );\n}\n","export default function getAuthErrorMessage(error: any) {\n if (error.code === 'UsernameExistsException') {\n return '指定したユーザーIDは既に存在しています。';\n } else if (error.code === 'UserNotFoundException') {\n return '指定したユーザーは存在しません。';\n } else if (error.code === 'NotAuthorizedException' && error.message === 'User is disabled.') {\n return 'このメールアドレスでアクティブなアカウントが存在しません。\\n 再度アクティブにしたい場合は管理者の方に問い合わせてください。';\n } else if (error.code === 'NotAuthorizedException') {\n return 'パスワード認証に失敗しました。パスワードをご確認ください。';\n } else if (error.code === 'PasswordResetException') {\n return 'パスワードのリセットが必要です。';\n } else if (error.code === 'PasswordResetRequiredException') {\n //Cognito管理画面にて指定されたユーザーの'パスワードリセットする'をクリックされた場合\n return 'パスワードのリセットが必要です。';\n } else if (error.code === 'UserLambdaValidationException') {\n return '指定したユーザーのログインは許可されていません。';\n } else if (error.code === 'LimitExceededException') {\n return '試行回数を超えました、しばらくしてからお試しください。';\n } else if (error.code === 'AccessDeniedException') {\n return 'このアクションを実行するための十分なアクセス権がありません。';\n } else if (error.code === 'IncompleteSignature') {\n return 'リクエストの署名がAWS標準に準拠していません。';\n } else if (error.code === 'InternalFailure') {\n return '不明なエラー、例外、または失敗が原因で、要求の処理が失敗しました。';\n } else if (error.code === 'InvalidAction') {\n return '要求されたアクションまたは操作は無効です。アクションが正しく入力されていることを確認します。';\n } else if (error.code === 'InvalidClientTokenId') {\n return '提供されたX.509証明書またはAWSアクセスキーIDは、当社のレコードに存在しません。';\n } else if (error.code === 'InvalidParameterCombination') {\n return '一緒に使用してはならないパラメーターが一緒に使用されました。';\n } else if (error.code === 'InvalidParameterValue') {\n return '無効な値または範囲外の値が入力パラメーターに指定されました。';\n } else if (error.code === 'InvalidQueryParameter') {\n return 'AWSクエリ文字列の形式が正しくないか、AWS標準に準拠していません。';\n } else if (error.code === 'MalformedQueryString') {\n return 'クエリ文字列に構文エラーが含まれています。';\n } else if (error.code === 'MissingAction') {\n return 'リクエストにアクションまたは必須パラメータがありません。';\n } else if (error.code === 'MissingAuthenticationToken') {\n return 'リクエストには、有効な(登録済みの)AWSアクセスキーIDまたはX.509証明書のいずれかが含まれている必要があります。';\n } else if (error.code === 'MissingParameter') {\n return '指定されたアクションに必要なパラメーターが指定されていません。';\n } else if (error.code === 'NotAuthorized') {\n return 'このアクションを実行する権限がありません。';\n } else if (error.code === 'NotAuthorizedGroup') {\n return 'グローバルアドミンでログインする権限が不足しています。';\n } else if (error.code === 'OptInRequired') {\n return 'AWSアクセスキーIDには、サービスのサブスクリプションが必要です。';\n } else if (error.code === 'RequestExpired') {\n return 'リクエストの日付スタンプから15分以上後、またはリクエストの有効期限(事前署名されたURLなど)から15分以上後にリクエストがサービスに到達したか、リクエストの日付スタンプが15分を超えている未来。';\n } else if (error.code === 'ServiceUnavailable') {\n return 'サーバーの一時的な障害のため、要求は失敗しました。';\n } else if (error.code === 'ThrottlingException') {\n return 'リクエストの調整が原因で、リクエストは拒否されました。';\n } else if (error.code === 'ValidationError') {\n return '入力は、AWSサービスによって指定された制約を満たしていません。';\n } else if (error.code === 'CodeDeliveryFailureException') {\n return '認証コードの送信に失敗しました。再度お試しください。';\n } else if (error.code === 'InvalidEmailRoleAccessPolicyException') {\n return 'メールアドレスの形式が正しくありません。';\n } else if (error.code === 'InvalidSmsRoleAccessPolicyException') {\n return '認証コードを送信する権利がありません。';\n } else if (error.code === 'InvalidSmsRoleTrustRelationException') {\n return '権限が不足しています。';\n } else if (error.code === 'InvalidParameterException') {\n return 'パラメーターが不足しています。';\n } else if (error.code === 'InvalidPasswordException') {\n return 'パスワード要件を満たしていません。';\n } else if (error.code === 'CodeMismatchException') {\n return '認証コードが違います。';\n } else if (error.code === 'ExpiredCodeException') {\n //ここで再度認証コードを送信する?\n return '認証コードの有効期限が切れています。';\n } else if (\n error.code === 'InternalErrorException' ||\n error.code === 'InvalidLambdaResponseException' ||\n error.code === 'UnexpectedLambdaException' ||\n error.code === 'ResourceNotFoundException'\n ) {\n return `システムエラーが発生しました。${error.code}`;\n } else if (error.code === 'invitationExpiredException') {\n return '送信された招待はすでに完了している可能性があります。';\n } else if (error.code === 'invitationURLQueryException') {\n return '招待 URL が正しくありません。招待メールを再度ご確認ください。';\n } else if (error.code) {\n return `エラーが発生しました。${error.code}`;\n } else {\n return 'エラーが発生しました。';\n }\n}\n","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getCardUtilityClass(slot) {\n return generateUtilityClass('MuiCard', slot);\n}\nconst cardClasses = generateUtilityClasses('MuiCard', ['root']);\nexport default cardClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"raised\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Paper from '../Paper';\nimport { getCardUtilityClass } from './cardClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getCardUtilityClass, classes);\n};\n\nconst CardRoot = styled(Paper, {\n name: 'MuiCard',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(() => {\n return {\n overflow: 'hidden'\n };\n});\nconst Card = /*#__PURE__*/React.forwardRef(function Card(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiCard'\n });\n\n const {\n className,\n raised = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n raised\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(CardRoot, _extends({\n className: clsx(classes.root, className),\n elevation: raised ? 8 : undefined,\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Card.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * If `true`, the card will use raised styling.\n * @default false\n */\n raised: chainPropTypes(PropTypes.bool, props => {\n if (props.raised && props.variant === 'outlined') {\n return new Error('MUI: Combining `raised={true}` with `variant=\"outlined\"` has no effect.');\n }\n\n return null;\n }),\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Card;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getLinkUtilityClass(slot) {\n return generateUtilityClass('MuiLink', slot);\n}\nconst linkClasses = generateUtilityClasses('MuiLink', ['root', 'underlineNone', 'underlineHover', 'underlineAlways', 'button', 'focusVisible']);\nexport default linkClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"component\", \"onBlur\", \"onFocus\", \"TypographyClasses\", \"underline\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { alpha, getPath } from '@mui/system';\nimport capitalize from '../utils/capitalize';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport useForkRef from '../utils/useForkRef';\nimport Typography from '../Typography';\nimport linkClasses, { getLinkUtilityClass } from './linkClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst colorTransformations = {\n primary: 'primary.main',\n textPrimary: 'text.primary',\n secondary: 'secondary.main',\n textSecondary: 'text.secondary',\n error: 'error.main'\n};\n\nconst transformDeprecatedColors = color => {\n return colorTransformations[color] || color;\n};\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n component,\n focusVisible,\n underline\n } = ownerState;\n const slots = {\n root: ['root', `underline${capitalize(underline)}`, component === 'button' && 'button', focusVisible && 'focusVisible']\n };\n return composeClasses(slots, getLinkUtilityClass, classes);\n};\n\nconst LinkRoot = styled(Typography, {\n name: 'MuiLink',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`underline${capitalize(ownerState.underline)}`], ownerState.component === 'button' && styles.button];\n }\n})(({\n theme,\n ownerState\n}) => {\n const color = getPath(theme, `palette.${transformDeprecatedColors(ownerState.color)}`) || ownerState.color;\n return _extends({}, ownerState.underline === 'none' && {\n textDecoration: 'none'\n }, ownerState.underline === 'hover' && {\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'underline'\n }\n }, ownerState.underline === 'always' && {\n textDecoration: 'underline',\n textDecorationColor: color !== 'inherit' ? alpha(color, 0.4) : undefined,\n '&:hover': {\n textDecorationColor: 'inherit'\n }\n }, ownerState.component === 'button' && {\n position: 'relative',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n\n },\n [`&.${linkClasses.focusVisible}`]: {\n outline: 'auto'\n }\n });\n});\nconst Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiLink'\n });\n\n const {\n className,\n color = 'primary',\n component = 'a',\n onBlur,\n onFocus,\n TypographyClasses,\n underline = 'always',\n variant = 'inherit'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const {\n isFocusVisibleRef,\n onBlur: handleBlurVisible,\n onFocus: handleFocusVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n const handlerRef = useForkRef(ref, focusVisibleRef);\n\n const handleBlur = event => {\n handleBlurVisible(event);\n\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleFocus = event => {\n handleFocusVisible(event);\n\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n }\n\n if (onFocus) {\n onFocus(event);\n }\n };\n\n const ownerState = _extends({}, props, {\n color,\n component,\n focusVisible,\n underline,\n variant\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(LinkRoot, _extends({\n className: clsx(classes.root, className),\n classes: TypographyClasses,\n color: color,\n component: component,\n onBlur: handleBlur,\n onFocus: handleFocus,\n ref: handlerRef,\n ownerState: ownerState,\n variant: variant\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Link.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the link.\n * @default 'primary'\n */\n color: PropTypes\n /* @typescript-to-proptypes-ignore */\n .any,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: elementTypeAcceptingRef,\n\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n\n /**\n * `classes` prop applied to the [`Typography`](/api/typography/) element.\n */\n TypographyClasses: PropTypes.object,\n\n /**\n * Controls when the link should have an underline.\n * @default 'always'\n */\n underline: PropTypes.oneOf(['always', 'hover', 'none']),\n\n /**\n * Applies the theme typography styles.\n * @default 'inherit'\n */\n variant: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string])\n} : void 0;\nexport default Link;"],"names":["window","__NEXT_P","push","GuestGuard","children","useRouter","isAuthenticated","isAdmin","organization","useAuth","useEffect","location","href","PATH_GLOBAL","organizations","root","useIsMountedRef","isMounted","useRef","current","useResponsive","query","key","start","end","theme","useTheme","mediaUp","useMediaQuery","breakpoints","up","mediaDown","down","mediaBetween","between","mediaOnly","only","RootStyle","styled","display","SectionStyle","Card","width","maxWidth","flexDirection","justifyContent","margin","spacing","ContentStyle","minHeight","padding","Login","mdUp","Page","title","Box","sx","mb","Stack","direction","px","mt","Image","disabledEffect","visibleByDefault","alt","src","maxHeight","pb","Typography","variant","pl","Container","alignItems","flexGrow","gutterBottom","color","palette","text","secondary","LoginForm","login","isMountedRef","enqueueSnackbar","useSnackbar","showPassword","setShowPassword","useState","LoginSchema","Yup","shape","email","required","password","methods","useForm","resolver","yupResolver","defaultValues","setError","handleSubmit","formState","errors","isSubmitting","FormProvider","onSubmit","async","data","error","type","console","message","errorMsg","getAuthErrorMessage","afterSubmit","Alert","severity","RHFTextField","name","label","autoComplete","InputProps","endAdornment","InputAdornment","position","IconButton","onClick","edge","Iconify","icon","my","NextLink","PATH_AUTH","resetPassword","passHref","legacyBehavior","Link","LoadingButton","fullWidth","size","loading","code","getCardUtilityClass","slot","generateUtilityClass","generateUtilityClasses","_excluded","CardRoot","Paper","overridesResolver","props","styles","overflow","React","inProps","ref","useThemeProps","className","raised","other","_objectWithoutPropertiesLoose","ownerState","_extends","classes","composeClasses","useUtilityClasses","_jsx","clsx","elevation","undefined","getLinkUtilityClass","colorTransformations","primary","textPrimary","textSecondary","LinkRoot","capitalize","underline","component","button","getPath","transformDeprecatedColors","textDecoration","textDecorationColor","alpha","WebkitTapHighlightColor","backgroundColor","outline","border","borderRadius","cursor","userSelect","verticalAlign","MozAppearance","WebkitAppearance","borderStyle","linkClasses","focusVisible","onBlur","onFocus","TypographyClasses","isFocusVisibleRef","handleBlurVisible","handleFocusVisible","focusVisibleRef","useIsFocusVisible","setFocusVisible","handlerRef","useForkRef","slots","event"],"sourceRoot":""}