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,eAAgBA,EAAgBoB,MAAOA,EAAOD,OAAQA,EAAQ5B,KAAMA,EAAM2B,IAAKA,EAAKM,WAAY,CACrK,GAAGA,CAAU,CACbO,aAAcC,CAAAA,EAAAA,EAAAA,EAAAA,CAAEA,CAACR,EAAWO,YAAY,CAAE,CACxC,gCAAoD,WAAnB/B,CACnC,GACAiC,aAAcD,CAAAA,EAAAA,EAAAA,EAAAA,CAAEA,CAACR,EAAWS,YAAY,CAAE,CACxC,OAA2B,WAAnBjC,CACV,GACAC,MAAO+B,CAAAA,EAAAA,EAAAA,EAAAA,CAAEA,CAACR,EAAWvB,KAAK,CAAE,CAC1B,eAAmC,WAAnBD,CAClB,EACF,EAAGkC,WAAY,EAAsCP,EAAO,UAACQ,EAAAA,CAAQA,CAAAA,CAAC5C,KAAK,KAAK6B,MAAM,UAAUgB,QAAS,IAAMR,EAAQ,CAACD,KAAY,UAACU,EAAAA,CAAGA,CAAAA,CAAC9C,KAAK,KAAK6B,MAAM,UAAUgB,QAAS,IAAMR,EAAQ,CAACD,KAA9JN,EAAWa,UAAU,CAAoJI,UAAW,CAAC,CAACjB,EAAWkB,YAAY,CAAG,GAAGlB,CAAU,CAAEhB,KAAMqB,GAAcC,EAAO,OAASN,EAAWhB,IAAI,EACjT","sources":["webpack://_N_E/?5ce2","webpack://_N_E/./src/hooks/mutations/auth/use-auth-mutation.ts","webpack://_N_E/./src/schemas/auth/auth.schema.ts","webpack://_N_E/./src/utils/index.ts","webpack://_N_E/./src/app/(routes)/(auth)/forget-password/_component/forget-password.tsx","webpack://_N_E/./src/assets/images/auth/auth-image-1.png","webpack://_N_E/./src/assets/images/auth/auth-image-2.png","webpack://_N_E/./src/components/ui/layout/auth-layout.tsx","webpack://_N_E/../../packages/perdiem-ui/components/button.tsx","webpack://_N_E/../../packages/perdiem-ui/components/input.tsx"],"sourcesContent":["import(/* webpackMode: \"eager\", webpackExports: [\"default\"] */ \"/codebuild/output/src3435381465/src/merchant-dashboard/apps/booking/src/app/(routes)/(auth)/forget-password/_component/forget-password.tsx\");\n","import { useMutation } from \"@tanstack/react-query\";\nimport { toast } from \"sonner\";\n\nimport sessionConfig from \"@/config/session-config\";\nimport serverApi from \"@/lib/server-api\";\nimport { StoreType } from \"@/types\";\nimport { LoginResponse } from \"@/types/login\";\nimport { UserType } from \"@/types/user\";\nimport { getErrorMessage } from \"@/utils\";\n\ntype Props = {\n password: string;\n new_password: string;\n};\ntype updateUserType = Partial;\nconst loginUser = async (payload: { email: string; password: string }) => {\n const { data }: { data: LoginResponse } = await serverApi.post(\n \"/auth/login\",\n payload,\n );\n return data;\n};\n\nconst forgetPassword = async (payload: { email: string }) => {\n await serverApi.post(\"/auth/forget-password\", payload);\n localStorage.setItem(sessionConfig.tempEmail, payload.email);\n};\n\nconst verifyCode = async (payload: { email: string; code: string }) => {\n const { data }: { data: { user: UserType; stores: StoreType[] } } =\n await serverApi.post(\"/auth/verify-code\", payload);\n return data;\n};\n\nconst signupUser = async (payload: { email: string; password: string }) => {\n const { data }: { data: { user: UserType } } = await serverApi.post(\n \"/auth/signup\",\n payload,\n );\n return data.user;\n};\nconst updateUser = async (payload: updateUserType) => {\n const { user_id, ...rest } = payload;\n const { data }: { data: { user: UserType } } = await serverApi.put(\n `/auth/${user_id}`,\n { ...rest },\n );\n return data.user;\n};\n\nexport const useLoginUser = () => {\n return useMutation({\n mutationFn: async (payload: { email: string; password: string }) =>\n await loginUser(payload),\n onError: (error) => {\n toast.error(getErrorMessage(error));\n },\n });\n};\nexport const useForgetPassword = () => {\n return useMutation({\n mutationFn: async (payload: { email: string }) =>\n await forgetPassword(payload),\n onError: (error) => {\n toast.error(getErrorMessage(error));\n },\n });\n};\nexport const useVerifyCode = () => {\n return useMutation({\n mutationFn: async (payload: { email: string; code: string }) =>\n await verifyCode(payload),\n onError: (error) => {\n toast.error(getErrorMessage(error));\n },\n });\n};\n\nexport const useSignupUser = () => {\n return useMutation({\n mutationFn: async (payload: { email: string; password: string }) =>\n await signupUser(payload),\n onError: (error) => {\n toast.error(getErrorMessage(error));\n },\n });\n};\nexport const useUpdateCurrentUser = () => {\n return useMutation({\n mutationFn: async (payload: updateUserType) => await updateUser(payload),\n onError: (error) => {\n toast.error(getErrorMessage(error));\n },\n });\n};\n","import { isPossiblePhoneNumber } from \"react-phone-number-input\";\nimport { z } from \"zod\";\n\nexport const UserLoginSchema = z.object({\n email: z.string().email(),\n password: z\n .string()\n .min(6, \"Password Length must be greater than 6 characters\"),\n});\n\nexport const ForgetPasswordSchema = z.object({\n email: z.string().email(),\n});\nexport const VerifyCodeSchema = z.object({\n email: z.string().email(),\n code: z\n .string()\n .min(4, \"Code must be 4 characters\")\n .max(4, \"Code must be 4 characters\"),\n});\n\nexport const ResetPasswordSchema = z\n .object({\n new_password: z.string().min(8, \"At least 8 characters\"),\n confirm_password: z.string().min(8, \"At least 8 characters\"),\n })\n .refine((data) => data.new_password === data.confirm_password, {\n message: \"Passwords do not match\",\n path: [\"confirm_password\"],\n });\n\nexport const UserSignupSchema = z\n .object({\n first_name: z.string(),\n last_name: z.string(),\n email: z.string().email(),\n phone: z.string(),\n password: z\n .string()\n .min(6, \"Password Length must be greater than 6 characters\"),\n })\n .superRefine((data, context) => {\n const { phone } = data;\n\n const isValuePossiblePhoneNumber = isPossiblePhoneNumber(phone);\n if (!isValuePossiblePhoneNumber) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Phone number is not valid\",\n path: [\"phone\"],\n });\n }\n });\n","// eslint-disable-next-line import/named\nimport { CalendarDate } from \"@internationalized/date\";\nimport { AxiosError, isAxiosError } from \"axios\";\nimport { NextResponse } from \"next/server\";\nimport url from \"url\";\n\nimport {\n CURRENCY_SIGNS,\n DEFAULT_CURRENCY,\n LIMIT,\n OFFSET,\n} from \"@/config/constant\";\nimport { Customer, Staff, UserType } from \"@/types\";\n\ntype Currency = keyof typeof CURRENCY_SIGNS;\ntype QueryParam = {\n [key: string]: string | number;\n};\n\nexport const getQueryParams = (request: Request, includeExtraParams = true) => {\n const params = url.parse(request.url, true).query;\n return {\n ...params,\n ...(includeExtraParams && {\n limit: Number(params.limit || LIMIT),\n offset: ((Number(params.offset) || OFFSET) - 1) * LIMIT,\n }),\n } as QueryParam;\n};\nconst customMessage: Record = {\n 'body/phone must match pattern \"^(\\\\+?1\\\\s?)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$|^(\\\\+?44\\\\s?)?\\\\(?\\\\d{2}\\\\)?[\\\\s.-]?\\\\d{4}[\\\\s.-]?\\\\d{4}$|^(\\\\+?33\\\\s?)?\\\\(?\\\\d{1}\\\\)?[\\\\s.-]?\\\\d{2}[\\\\s.-]?\\\\d{2}[\\\\s.-]?\\\\d{2}[\\\\s.-]?\\\\d{2}$|^(\\\\+?61\\\\s?)?\\\\(?\\\\d{1}\\\\)?[\\\\s.-]?\\\\d{4}[\\\\s.-]?\\\\d{4}$\"':\n \"Phone number is not valid\",\n};\nexport const getErrorMessage = (error: unknown): string => {\n if (isAxiosError(error)) {\n const axiosError = error as AxiosError & {\n response: { data: { message?: string; error?: string } };\n };\n const message = String(\n axiosError.response?.data?.message ||\n axiosError.response?.data?.error ||\n axiosError.response?.data ||\n axiosError.message,\n );\n return customMessage[message] || message;\n }\n if (error instanceof Error) {\n return error.message;\n }\n return \"Error\";\n};\n\nexport function createErrorResponse(error: unknown): NextResponse {\n const status =\n (error as { response: { status: number } })?.response?.status ?? 500;\n\n return NextResponse.json(\n { message: getErrorMessage(error) },\n { status: status },\n );\n}\n\nexport const clearUndefinedAndNull = (obj: { [key: string]: unknown }) => {\n const cleanObj = {} as { [key: string]: unknown };\n Object.entries(obj).forEach(([key, value]) => {\n if (\n typeof value === \"number\" ||\n (typeof value === \"string\" && value.length) ||\n typeof value === \"boolean\" ||\n (typeof value === \"object\" &&\n value !== null &&\n Object.entries(value as { [key: string]: unknown }).length)\n ) {\n cleanObj[key] = value;\n }\n });\n return cleanObj as T;\n};\n\nexport const getFromLocalStorage = (key: string): T | null => {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n const data = localStorage.getItem(key);\n\n if (!data || data === \"undefined\") {\n return null;\n }\n\n try {\n return JSON.parse(data) as T;\n } catch {\n return data as T;\n }\n};\n\nexport function formatDuration(\n durationInMilliseconds: number | undefined,\n): string {\n if (!durationInMilliseconds) return \"\";\n const minutes = Math.floor(durationInMilliseconds / 60000);\n return `${minutes} min`;\n}\n\nexport const centsToDollars = (cents = 0): string => {\n return \"$\" + (Math.round(cents) / 100).toFixed(2);\n};\n\nexport const formatCurrency = (\n amount = 0,\n currency: Currency = DEFAULT_CURRENCY,\n): string => {\n currency = currency ?? DEFAULT_CURRENCY;\n const sign = CURRENCY_SIGNS[currency];\n if (currency === \"JPY\") {\n return sign + amount;\n }\n return sign + (Math.round((Number(amount) / 100) * 100) / 100).toFixed(2);\n};\n\nexport const truncateText = (str: string, maxLength: number): string => {\n if (!str) return \"\";\n return `${str.substring(0, maxLength)} ${\n str.length > maxLength ? \"...\" : \"\"\n }`;\n};\n\nexport const floatToFractionString = (number: number) => {\n function gcd(a: number, b: number): number {\n return b ? gcd(b, a % b) : a;\n }\n let numerator: number = Math.round(number * 1000000);\n let denominator = 1000000;\n const divisor: number = gcd(numerator, denominator);\n numerator /= divisor;\n denominator /= divisor;\n return { numerator, denominator };\n};\n\nexport const getFullName = (user: Partial): string => {\n return `${user?.first_name ?? \"\"} ${user?.last_name ?? \"\"}`;\n};\nexport const getMimeTypeFromDataURL = (dataURL: string) => {\n const mime = dataURL.match(/^data:(.*?);base64,/)?.[1];\n return mime || \"image/jpeg\";\n};\nexport const getUser = (user: UserType): UserType => {\n return {\n user_id: user?.user_id ?? null,\n first_name: user?.first_name ?? \"\",\n last_name: user?.last_name ?? \"\",\n email: user?.email ?? \"\",\n phone: user?.phone ?? \"\",\n store_id: user?.store_id ?? null,\n store_ids: user?.store_ids ?? null,\n active: user?.active ?? false,\n type: user?.type,\n created_at: user.created_at,\n updated_at: user.updated_at,\n access_level: user?.access_level,\n storeInfo: user?.storeInfo,\n permissions: user?.permissions,\n };\n};\nexport const centsToDollarsWithoutSymbol = (cents: number): number => {\n return Math.round(cents) / 100;\n};\n\nexport const dollarsToCents = (dollars: number): number => {\n return Math.round(dollars * 100);\n};\n\nexport function isNullOrEmpty(str: string | null | undefined) {\n return !str || str.length === 0;\n}\nexport function getYouTubeVideoId(url: string): string {\n if (!url) return \"\";\n try {\n const urlObj = new URL(url);\n if (urlObj.hostname === \"youtu.be\") {\n // For short URLs like https://youtu.be/KP_A2ooJIYI\n return urlObj.pathname.slice(1);\n }\n if (\n urlObj.hostname === \"www.youtube.com\" ||\n urlObj.hostname === \"youtube.com\"\n ) {\n // For long URLs like https://www.youtube.com/watch?v=KP_A2ooJIYI\n return urlObj.searchParams.get(\"v\") ?? \"\";\n }\n // default\n return \"\";\n } catch {\n return \"\";\n }\n}\nexport const replaceAll = (str: string, sign = \"_\") => {\n return str.replaceAll(\" \", sign).toLowerCase();\n};\nexport const getCalendarDate = (date: Date | string | number) => {\n const d = new Date(date);\n return new CalendarDate(d.getFullYear(), d.getMonth() + 1, d.getDate());\n};\nexport const isArraysEqual = (\n a: number[] | string[] | A[],\n b: number[] | string[] | B[],\n) => a.length === b.length && a.every((val, idx) => val === b[idx]);\n","\"use client\";\n\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport Button from \"@repo/perdiem-ui/button\";\nimport Input from \"@repo/perdiem-ui/input\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/navigation\";\nimport { SubmitHandler, useForm } from \"react-hook-form\";\nimport { GoArrowLeft } from \"react-icons/go\";\nimport { z } from \"zod\";\nimport Authlayout from \"@/components/ui/layout/auth-layout\";\nimport { useForgetPassword } from \"@/hooks/mutations/auth/use-auth-mutation\";\nimport { ForgetPasswordSchema } from \"@/schemas/auth/auth.schema\";\ntype ForgetPasswordType = z.infer;\nexport default function ForgetPassword() {\n const router = useRouter();\n const forgetPassword = useForgetPassword();\n const {\n register,\n handleSubmit\n } = useForm({\n resolver: zodResolver(ForgetPasswordSchema)\n });\n const onSubmit: SubmitHandler = data => {\n forgetPassword.mutate({\n email: data.email\n }, {\n onSuccess: () => {\n router.push(\"/verify-code\");\n }\n });\n };\n return
\n \n
\n \n \n \n

\n Forgot password?\n

\n

\n Enter your email address below. We will send you a verification\n code.\n

\n
\n \n
\n \n
\n
\n
\n
\n
;\n}","export default {\"src\":\"/_next/static/media/auth-image-1.23eece19.png\",\"height\":1000,\"width\":782,\"blurDataURL\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAAVFBMVEXn6OI1KSEyHAyhnpN9fHa6vLdbWVQ+ODCqqZ4KCQgnJSRlZmK6vLNfYFwYFRMZGxpPUVC2uLPP0MjIy8WOhnWQk45FRkNCQz6XeGS4pZjct52omIab7vFKAAAACXRSTlP4////////9f6XxCJKAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAOUlEQVR4nAXBhwHAIAzAMAMJNMzu+f+flVhUdYU4l1ghD+fDhpnze8DMUmlIz+0U3vs5LuGTOvX0AzEPAgRK5ZBpAAAAAElFTkSuQmCC\",\"blurWidth\":6,\"blurHeight\":8};","export default {\"src\":\"/_next/static/media/auth-image-2.263b1f9a.png\",\"height\":1000,\"width\":782,\"blurDataURL\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAAVFBMVEWUk595eII1OEF2WkMtIBU6NTIsLDGFh4lZVlZfTESEalJCMiRLOi8aEwyTe2KCamFFNylgYGpARExeYGt8Z1OqpZ1CRlACAwO7kX87JhdOOzAoKiq1UqXaAAAACHRSTlP1////////7gjxbu4AAAAJcEhZcwAAFiUAABYlAUlSJPAAAAA5SURBVHicBcGHAcAgDMAwAwkNu3v+/2clJrXaDPuuIg9NU8odGbftnfkdRw6kdTtDwbF4reB8jPIDP/YCDiavMz8AAAAASUVORK5CYII=\",\"blurWidth\":6,\"blurHeight\":8};","import { Image } from \"@heroui/react\";\nimport React from \"react\";\nimport AuthImage1 from \"@/assets/images/auth/auth-image-1.png\";\nimport AuthImage2 from \"@/assets/images/auth/auth-image-2.png\";\nexport default function Authlayout({\n children\n}: {\n children: React.ReactNode;\n}) {\n return
\n
\n \"image\"\n
\n
{children}
\n
\n \"image\"\n
\n
;\n}","\"use client\";\n\nimport { Button as NextButton, ButtonProps } from \"@heroui/react\";\nimport { forwardRef } from \"react\";\nconst Button = forwardRef(function Button({\n radius = \"lg\",\n color = \"primary\",\n isDisabled = false,\n ...otherProps\n}, ref) {\n return ;\n});\nexport default Button;","\"use client\";\n\nimport { cn, Input as NextInput, InputProps } from \"@heroui/react\";\nimport { Eye, EyeSlash } from \"iconsax-react\";\nimport { forwardRef, useState } from \"react\";\ntype Props = {\n isPassword?: boolean;\n};\nconst Input = forwardRef(function Input({\n variant = \"bordered\",\n labelPlacement = \"outside\",\n color = \"primary\",\n radius = \"md\",\n size = \"lg\",\n classNames = {\n base: \"\",\n label: \"!text-sm !text-[#808080]\"\n },\n isPassword = false,\n ...otherProps\n}, ref) {\n const [show, setShow] = useState(false);\n return setShow(!show)} /> : setShow(!show)} />} isInvalid={!!otherProps.errorMessage} {...otherProps} type={isPassword && show ? \"text\" : otherProps.type} />;\n});\nexport default Input;"],"names":["loginUser","payload","data","serverApi","post","forgetPassword","localStorage","setItem","sessionConfig","tempEmail","email","verifyCode","signupUser","user","updateUser","user_id","rest","put","useLoginUser","useMutation","mutationFn","onError","toast","error","getErrorMessage","useForgetPassword","useVerifyCode","useSignupUser","useUpdateCurrentUser","UserLoginSchema","z","object","string","password","min","ForgetPasswordSchema","code","max","new_password","confirm_password","refine","message","path","first_name","last_name","phone","superRefine","context","isPossiblePhoneNumber","addIssue","ZodIssueCode","custom","customMessage","isAxiosError","axiosError","String","response","Error","cleanObj","Object","entries","obj","forEach","key","value","length","getItem","JSON","parse","formatDuration","durationInMilliseconds","minutes","Math","floor","centsToDollars","cents","round","toFixed","formatCurrency","amount","currency","DEFAULT_CURRENCY","sign","CURRENCY_SIGNS","str","maxLength","substring","floatToFractionString","numerator","number","denominator","divisor","gcd","a","b","dataURL","mime","match","dollarsToCents","dollars","isNullOrEmpty","getYouTubeVideoId","url","urlObj","URL","hostname","pathname","slice","searchParams","get","getCalendarDate","d","Date","date","CalendarDate","getFullYear","getMonth","getDate","every","val","idx","ForgetPassword","router","useRouter","register","handleSubmit","useForm","resolver","zodResolver","div","className","data-sentry-component","data-sentry-source-file","Authlayout","data-sentry-element","Link","href","GoArrowLeft","size","h1","p","form","onSubmit","mutate","onSuccess","push","Input","labelPlacement","label","placeholder","required","Button","type","isDisabled","isPending","isLoading","children","Image","src","AuthImage1","width","height","alt","AuthImage2","forwardRef","ref","radius","color","otherProps","NextButton","variant","classNames","base","isPassword","show","setShow","useState","NextInput","inputWrapper","cn","innerWrapper","endContent","EyeSlash","onClick","Eye","isInvalid","errorMessage"],"sourceRoot":"","ignoreList":[]}