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,OAAQH,CACV,GAAGlB,GAAG,CAAC,CAACsB,EAAGC,IAAM,UAAC7F,MAAAA,CAAYC,UAAU,oBAClC,UAAC6F,EAAAA,CAAWA,CAAAA,CAACC,UAAWR,GAAeM,EAAI,EAAI,IAAM,KADhCA,QAKjC,wEC0BA,MAvCoB,IAClB,GAAM,SACJG,EAAU,SAAS,CAqCRF,UApCXC,CAAS,EAoCc,QAnCvBE,CAAQ,QACR3C,EAAS,CAAC,CACV4C,eAAa,CACd,CAAGC,EAcJ,MAAO,WAACnG,MAAAA,CAAIC,UAAU,SAASkD,wBAAsB,cAAcvC,0BAAwB,6BACtFqF,GAAY,UAACjG,MAAAA,CAAIC,UAAU,6CAAoC,iBAEhE,WAACD,MAAAA,CAAIC,UAAU,qCACb,UAACD,MAAAA,CAAIoG,MAjBa,CAiBNC,OAhBhB/C,EACAD,MAAO,OACPiD,gBAAiB,UACjBC,aAAc,EAChB,WAaQ,UAACvG,MAAAA,CAAIoG,MAAO,CAXlB9C,OAAQ,OACRD,MAAO,GAAa,OAAV0C,EAAU,KACpBO,gBAAiBN,EACjBO,aAAc,UACdC,WAAY,uBASNC,UAAW,OACb,EAAGxG,UAAU,oBACRiG,GAAiB,UAAClG,MAAAA,CAAIC,UAAW,YAAoD,OAAxC8F,EAAY,GAAK,WAAa,UAAU,qGACjFG,QAIRD,GAAY,UAACS,OAAAA,CAAKzG,UAAU,4CAAoC,GAAa,OAAV8F,EAAU,YAGtF","sources":["webpack://_N_E/?2896","webpack://_N_E/../../packages/perdiem-ui/components/phone-number-input.tsx","webpack://_N_E/./src/app/(routes)/(auth)/signup/_component/signup.tsx","webpack://_N_E/../../packages/perdiem-ui/components/auth-stepper.tsx","webpack://_N_E/../../packages/perdiem-ui/components/progress-bar.tsx"],"sourcesContent":["import(/* webpackMode: \"eager\", webpackExports: [\"default\"] */ \"/codebuild/output/src3435381465/src/merchant-dashboard/apps/booking/src/app/(routes)/(auth)/signup/_component/signup.tsx\");\n","import \"react-phone-number-input/style.css\";\nimport type { FunctionComponent } from \"react\";\nimport { Fragment } from \"react\";\nimport PhoneInput from \"react-phone-number-input\";\nimport { getCountryCallingCode } from \"react-phone-number-input/input\";\ninterface InputProps {\n label?: string;\n errMsg?: string | null;\n value: string;\n id?: string;\n onlyCountries: string[];\n onChange: (number: string) => void;\n disabled?: boolean;\n placeholder?: string;\n}\nconst PhoneNumberInput: FunctionComponent = ({\n label,\n errMsg,\n id,\n onlyCountries,\n onChange,\n disabled = true,\n value,\n placeholder = \"Enter phone number\"\n}) => {\n return \n
\n
\n \n
\n
\n
\n
\n onChange(value || \"\")} initialValueFormat=\"national\"\n //@ts-expect-error @typescript-eslint/ban-ts-comment\n countries={onlyCountries} disabled={disabled} smartCaret defaultCountry=\"US\" value={value} onCountryChange={value => {\n if (value) {\n onChange(\"+\" + getCountryCallingCode(value));\n }\n }} data-sentry-element=\"PhoneInput\" data-sentry-source-file=\"phone-number-input.tsx\" />\n
\n
\n
\n
\n {errMsg ?

{errMsg}

: null}\n
;\n};\nexport default PhoneNumberInput;","\"use client\";\n\nimport { Divider, Link } from \"@heroui/react\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useGoogleLogin } from \"@react-oauth/google\";\nimport AuthStepper from \"@repo/perdiem-ui/auth-stepper\";\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 PhoneNumberInput from \"@repo/perdiem-ui/phone-number-input\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useRouter } from \"next/navigation\";\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 { STORE_COUNTRIES } from \"@/config/constant\";\nimport { useGoogleSignin } from \"@/hooks/mutations/auth/googleSigin\";\nimport { useSignupUser } from \"@/hooks/mutations/auth/use-auth-mutation\";\nimport useAuth from \"@/hooks/use-auth\";\nimport { UserSignupSchema } from \"@/schemas/auth/auth.schema\";\nexport default function Signup() {\n const router = useRouter();\n const [googleLoading, setGoogleLoading] = useState(false);\n const queryClient = useQueryClient();\n const signupUser = useSignupUser();\n const googleSignin = useGoogleSignin();\n const {\n LoginSuccess\n } = useAuth();\n type UserSignupType = z.infer;\n const {\n register,\n handleSubmit,\n setValue,\n getValues,\n formState: {\n errors,\n touchedFields\n }\n } = useForm({\n resolver: zodResolver(UserSignupSchema)\n });\n const onSubmit: SubmitHandler = data => {\n signupUser.mutate({\n ...data\n }, {\n onSuccess: data => {\n queryClient.setQueryData([\"current_user\"], data);\n router.push(\"/connect-square\");\n }\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 Create your account\n

\n\n
\n
\n \n \n
\n \n {\n setValue(\"phone\", phone, {\n shouldValidate: true,\n shouldDirty: true,\n shouldTouch: true\n });\n }} onlyCountries={STORE_COUNTRIES?.map(country => country?.code)} disabled={false} errMsg={touchedFields.phone && errors.phone ? errors.phone.message : null} data-sentry-element=\"PhoneNumberInput\" data-sentry-source-file=\"signup.tsx\" />\n \n\n
\n \n
\n \n\n
\n
\n \n

or

\n \n
\n\n {\n setGoogleLoading(true);\n googleLogin();\n }} data-sentry-element=\"GoogleLoginButton\" data-sentry-source-file=\"signup.tsx\" />\n
\n\n
\n

\n Already a Per Diem user? \n \n Signin\n \n

\n
\n\n \n
\n
;\n}","import React, { FC } from \"react\";\nimport ProgressBar from \"./progress-bar\";\nconst AuthStepper: FC<{\n currentStep: number;\n totalSteps?: number;\n}> = ({\n totalSteps = 3,\n currentStep = 1\n}) => {\n return
\n

\n STEP {currentStep}/{totalSteps}\n

\n
\n {Array.from({\n length: totalSteps\n }).map((v, i) =>
\n = i + 1 ? 100 : 0} />\n
)}\n
\n
;\n};\nexport default AuthStepper;","import React from \"react\";\ninterface ProgressBar {\n completed: number;\n bgcolor?: string;\n showText?: boolean;\n height?: number;\n floatingLabel?: string;\n}\nconst ProgressBar = (props: ProgressBar) => {\n const {\n bgcolor = \"#0171EA\",\n completed,\n showText,\n height = 5,\n floatingLabel\n } = props;\n const containerStyles = {\n height,\n width: \"100%\",\n backgroundColor: \"#E4E5E7\",\n borderRadius: 50\n };\n const fillerStyles = {\n height: \"100%\",\n width: `${completed}%`,\n backgroundColor: bgcolor,\n borderRadius: \"inherit\",\n transition: \"width 1s ease-in-out\"\n };\n return
\n {showText &&
Uploading...
}\n\n
\n
\n
\n {floatingLabel &&
\n {floatingLabel}\n
}\n
\n
\n {showText && {`${completed}%`}}\n
\n
;\n};\nexport default ProgressBar;"],"names":["label","PhoneNumberInput","errMsg","id","onlyCountries","onChange","disabled","value","placeholder","Fragment","div","className","htmlFor","PhoneInput","countryCallingCodeEditable","initialValueFormat","countries","smartCaret","defaultCountry","onCountryChange","getCountryCallingCode","data-sentry-element","data-sentry-source-file","p","Signup","router","useRouter","googleLoading","setGoogleLoading","useState","queryClient","useQueryClient","signupUser","useSignupUser","googleSignin","useGoogleSignin","LoginSuccess","useAuth","register","handleSubmit","setValue","getValues","formState","errors","touchedFields","useForm","resolver","zodResolver","UserSignupSchema","googleLogin","useGoogleLogin","onSuccess","token","mutate","code","onError","toast","error","onNonOAuthError","flow","AuthWrapper","data-sentry-component","PerDiemLogo","width","height","h1","form","onSubmit","data","setQueryData","push","Input","labelPlacement","required","String","phone","shouldValidate","shouldDirty","shouldTouch","STORE_COUNTRIES","map","country","message","type","isPassword","Button","size","isDisabled","isPending","isLoading","Divider","GoogleLoginButton","loading","onClick","Link","href","AuthStepper","currentStep","totalSteps","Array","from","length","v","i","ProgressBar","completed","bgcolor","showText","floatingLabel","props","style","containerStyles","backgroundColor","borderRadius","transition","textAlign","span"],"sourceRoot":"","ignoreList":[]}