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,QAAS,KACpDxD,GAAiB,GACjBY,GACF,EAAG6C,YAAY,sBAAsBjC,sBAAoB,oBAAoBE,0BAAwB,gBAErG,WAACC,MAAAA,CAAIC,UAAU,mDACb,UAACyB,IAAAA,CAAEzB,UAAU,mBAAU,gCACvB,UAACiB,EAAAA,CAAIA,CAAAA,CAACC,KAAK,UAAUlB,UAAU,2CAA2CJ,sBAAoB,OAAOE,0BAAwB,qBAAY,gCAOrJ","sources":["webpack://_N_E/?4564","webpack://_N_E/./src/app/(routes)/(auth)/login/_component/login.tsx"],"sourcesContent":["import(/* webpackMode: \"eager\", webpackExports: [\"default\"] */ \"/codebuild/output/src3435381465/src/merchant-dashboard/apps/booking/src/app/(routes)/(auth)/login/_component/login.tsx\");\n","\"use client\";\n\nimport { Divider, Link } from \"@heroui/react\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useGoogleLogin } from \"@react-oauth/google\";\nimport Button from \"@repo/perdiem-ui/button\";\nimport GoogleLoginButton from \"@repo/perdiem-ui/google-login-button\";\nimport Input from \"@repo/perdiem-ui/input\";\nimport PerDiemLogo from \"@repo/perdiem-ui/perdiem-logo\";\nimport { useState } from \"react\";\nimport { SubmitHandler, useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport AuthWrapper from \"@/components/ui/layout/auth-wrapper\";\nimport { useGoogleSignin } from \"@/hooks/mutations/auth/googleSigin\";\nimport { useLoginUser } from \"@/hooks/mutations/auth/use-auth-mutation\";\nimport useAuth from \"@/hooks/use-auth\";\nimport { UserLoginSchema } from \"@/schemas/auth/auth.schema\";\nexport default function Login() {\n const googleSignin = useGoogleSignin();\n const [googleLoading, setGoogleLoading] = useState(false);\n const {\n LoginSuccess\n } = useAuth();\n const loginUser = useLoginUser();\n type UserLoginType = z.infer;\n const {\n register,\n handleSubmit\n } = useForm({\n resolver: zodResolver(UserLoginSchema)\n });\n const onSubmit: SubmitHandler = data => {\n loginUser.mutate({\n email: data.email,\n password: data.password\n }, {\n onSuccess: LoginSuccess\n });\n };\n const googleLogin = useGoogleLogin({\n onSuccess: token => {\n googleSignin.mutate({\n token: token.code\n }, {\n onSuccess: LoginSuccess,\n onError: () => {\n setGoogleLoading(false);\n toast.error(\"Error Signing up with google\");\n }\n });\n },\n onNonOAuthError: () => {\n setGoogleLoading(false);\n },\n onError: error => {\n setGoogleLoading(false);\n if (error && error?.error === \"access_denied\") {\n toast.error(\"Google sign-in cancelled. Please try again.\");\n } else {\n toast.error(\"Error Signing up with google\");\n }\n },\n flow: \"auth-code\"\n });\n return \n
\n
\n \n
\n

Sign in

\n
\n \n \n\n \n Forgot password?\n \n
\n \n
\n
\n \n

or

\n \n
\n
\n {\n setGoogleLoading(true);\n googleLogin();\n }} buttonLabel=\"Sign in with Google\" data-sentry-element=\"GoogleLoginButton\" data-sentry-source-file=\"login.tsx\" />\n
\n
\n

Don’t have a Per Diem user?

\n \n Create an account\n \n
\n
\n
\n
;\n}"],"names":["Login","googleSignin","useGoogleSignin","googleLoading","setGoogleLoading","useState","LoginSuccess","useAuth","loginUser","useLoginUser","register","handleSubmit","useForm","resolver","zodResolver","UserLoginSchema","googleLogin","useGoogleLogin","onSuccess","token","mutate","code","onError","toast","error","onNonOAuthError","flow","AuthWrapper","data-sentry-element","data-sentry-component","data-sentry-source-file","div","className","PerDiemLogo","width","height","h1","form","onSubmit","data","email","password","Input","labelPlacement","label","placeholder","required","type","isPassword","Link","href","Button","size","isDisabled","isPending","isLoading","Divider","p","GoogleLoginButton","loading","onClick","buttonLabel"],"sourceRoot":"","ignoreList":[]}