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UA,EAAMC,OAAO,CAC/B,CACF,EA7RWrH,EA+RG+K,aAAAA,CAAgB,GACrBzD,CAAAA,EAAAA,EAAAA,WAAAA,EAA6B,MAAMmD,GAAQ,MAAMzK,EAAiBwK,WAAW,CAACC,GAAOjD,GAhSnFxH,EAmSagL,iBAAAA,CAAoB,MAAOC,EAAsB7E,KACvE,GAAI,CASF,MARsB,CACpB,MAAMW,EAAAA,CAAaA,CAACmE,MAAM,CAACjE,EAAAA,CAASA,CAACwB,mBAAmB,CAAE,CACxD3H,KAAM,CACJuF,YAAaD,EACbmC,cAAe0C,CACjB,CACF,IACAnK,IAAI,CAEN,MAAOsG,EAAY,CACnB,MAAM,MAAUA,EAAMC,OAAO,CAC/B,CACF,EAjTWrH,EAmTGmL,mBAAAA,CAAsB,GAG3B7D,CAAAA,EAAAA,EAAAA,WAAAA,EACL,MAAA1C,OAAO,CAAEqG,aAAAA,CAAY,CAAE7E,WAAAA,CAAU,CAAE,CAAAxB,SACjC,MAAM5E,EAAiBgL,iBAAiB,CAACC,EAAc7E,IACzDoB,GAzTOxH,EA6TGoL,2BAAAA,CAA8B,IACbC,OAAO1L,YAAY,CAAC2L,QAAQ,EAEvDD,CAAAA,OAAO1L,YAAY,CAAC2L,QAAQ,CAAGA,CAAAA,CAEnC,EAlUWtL,EAoUGuL,8BAAAA,CAAiC,KAC7C,IAAMC,EAAuBH,OAAO1L,YAAY,CAAC2L,QAAQ,QACzD,EACSG,KAAKC,KAAK,CAACF,GAEb,IACT","sources":["webpack://_N_E/?6c8b","webpack://_N_E/./src/app/page.tsx","webpack://_N_E/./src/components/Layout.tsx","webpack://_N_E/./src/components/svg/spinner.tsx","webpack://_N_E/./src/utils/invitation.ts","webpack://_N_E/./src/services/suppliers.ts"],"sourcesContent":["import(/* webpackMode: \"eager\" */ \"/codebuild/output/src3430008616/src/supplier-web/src/app/page.tsx\");\n","'use client';\n\nimport React, { useCallback, useState } from 'react';\n\nimport { throttle } from 'lodash';\nimport { type NextPage } from 'next';\nimport { useRouter } from 'next/navigation';\nimport { ReactSearchAutocomplete } from 'react-search-autocomplete';\nimport { toast } from 'react-toastify';\n\nimport Layout from '@/components/Layout';\nimport Spinner from '@/components/svg/spinner';\nimport { SuppliersService } from '@/services/suppliers';\n\nimport { version } from '../../package.json';\n\nconst Landing: NextPage = (): JSX.Element => {\n const router = useRouter();\n const [loading, setLoading] = useState(false);\n const [supplierItems, setSupplierItems] = useState([]);\n const [supplierName, setSupplierName] = useState();\n const [selectedSupplier, setSelectedSupplier] = useState();\n const user = localStorage.getItem('user');\n if (user) {\n router.push('/orders');\n return;\n }\n\n const { mutateAsync: searchAutocomplete } = SuppliersService.useSearchAutocomplete();\n\n const isValidSupplier = () => {\n return supplierName?.trim()?.length && supplierName.length >= 3;\n };\n\n const handleSubmit = async (event: any) => {\n event.preventDefault();\n setLoading(true);\n if (isValidSupplier()) {\n router.push(\n `/auth/steptwo?supplierExist=${\n selectedSupplier?.id || ''\n }&userCount=${selectedSupplier?.user_count}&supplierName=${supplierName}`,\n );\n } else {\n toast.info('Debes llenar el nombre de tu empresa');\n setLoading(false);\n }\n };\n\n const handleOnClear = () => {\n setSupplierName('');\n };\n\n const handleGoToLogin = () => {\n router.push('/auth/login');\n };\n\n const handleGoToJoin = () => {\n router.push('/auth/join');\n };\n\n const handleSetitems = (data: any[]) => {\n setSupplierItems(data);\n };\n\n const handleOnSelect = (result: SupplierItem) => {\n setSupplierName(result.name);\n setSelectedSupplier(result);\n };\n\n const throttled = useCallback(\n throttle(res => {\n handleSetitems(res.data);\n }, 50),\n [supplierName],\n );\n\n const loadOptions = (supplierName: string) => {\n setSupplierName(supplierName);\n searchAutocomplete({ search: supplierName }).then((res: any) => {\n const supplierAlreadyExists = res.data.findIndex((val: SupplierItem) => val.name === supplierName);\n if (supplierAlreadyExists === -1) {\n setSelectedSupplier(undefined);\n } else {\n setSelectedSupplier(res.data[supplierAlreadyExists]);\n }\n throttled(res);\n });\n };\n\n return (\n \n
\n Alisto\n \n Proveedores usan Alisto para crecer su negocio sin costos extras conectando con clientes que buscan tus\n ingredientes\n \n
\n
\n
\n

Únete a Alisto

\n
\n
\n
\n
\n
\n
\n \n \n items={supplierItems}\n onSearch={loadOptions}\n // onHover={handleOnHover}\n onSelect={handleOnSelect}\n // onFocus={handleOnFocus}\n onClear={handleOnClear}\n autoFocus\n styling={{\n zIndex: 4,\n height: '60px',\n border: 'unset',\n borderRadius: '0px',\n backgroundColor: 'rgb(234, 234, 234)',\n boxShadow: 'rgba(32, 33, 36, 0.28) 0px 1px 6px 0px',\n hoverBackgroundColor: '#eee',\n color: '#212121',\n fontSize: '16px',\n fontFamily: 'Arial',\n iconColor: 'grey',\n lineColor: 'rgb(232, 234, 237)',\n placeholderColor: 'grey',\n clearIconMargin: '3px 14px 0 0',\n searchIconMargin: '0 0 0 16px',\n }}\n showNoResults={false}\n // formatResult={formatResult}\n />\n
\n
\n
\n Si tu empresa ya existe aparecerá cuando escribas su nombre\n
\n
\n
\n\n
\n \n {loading && }\n Iniciar\n \n
\n
\n Al darle click aceptas los{' '}\n \n términos y políticas\n {' '}\n de uso\n
\n
\n \n ¿Ya tienes cuenta? Inicia sesión\n \n
\n
\n
\n
\n
\n \n Únete a tu equipo\n \n
\n v. {version}\n
\n
\n );\n};\n\nexport default Landing;\n","import React from 'react';\n\ninterface LayoutProps {\n children?: JSX.Element | JSX.Element[];\n bg?: string;\n}\n\nconst Layout = ({ children, bg }: LayoutProps): JSX.Element => {\n return (\n \n {children}\n \n );\n};\n\nexport default Layout;\n","import React from 'react';\n\nconst Spinner = (): JSX.Element => {\n return (\n <>\n \n \n \n \n \n );\n};\n\nexport default Spinner;\n","export const getOnUserSupplierInvitationResponseParse = (data: BDUserInvitation): UserInvitation => ({\n id: data.id,\n phone: data.phone,\n email: data.email,\n firstName: data.first_name,\n lastName: data.last_name,\n supplierUserId: data.supplier_user_id,\n supplierId: data.supplier_id,\n role: data.role,\n status: data.status,\n createdAt: data.created_at,\n updatedAt: data.updated_at,\n});\n","/* eslint-disable @typescript-eslint/restrict-template-expressions */\n/* eslint-disable @typescript-eslint/naming-convention */\nimport {\n useMutation,\n type UseMutationOptions,\n type UseMutationResult,\n useQuery,\n type UseQueryResult,\n type UseQueryOptions,\n} from 'react-query';\n\nimport { type Currency } from '@/constants/Currency';\nimport Endpoints from '@/constants/Endpoints';\nimport { QueryTypes } from '@/constants/QueryTypes';\nimport axiosInstance from '@/services/api';\nimport { getOnUserSupplierInvitationResponseParse } from '@/utils/invitation';\nimport { supplierResponseParse } from '@/utils/supplier';\n\ninterface SearchAutocompleteFormData {\n search: string;\n}\n\ninterface RequestAccessResponse {\n success: boolean;\n}\n\ninterface RequestAccessFormData {\n supplier_id: number;\n full_name: string;\n email: string;\n phone_number: string;\n}\n\ninterface UserValidationFormData {\n phone_number: string;\n}\n\ninterface UserValidationResponse {\n exists: boolean;\n message: string;\n}\n\ninterface RegisterSupplierFormData {\n name: string;\n address: string;\n registration_channel: string;\n contact_phone?: string;\n contact_email?: string;\n}\n\ninterface RegisterSupplierResponse {\n success: boolean;\n}\n\nexport interface GetRestaurantSupplierFormData {\n limit: number;\n page: number;\n search?: string;\n restaurant_id?: number;\n supplier_id?: number;\n seller_id?: number;\n}\n\ninterface PatchSupplierFormData {\n id?: number;\n name?: string;\n address?: string;\n contact_email?: string;\n contact_phone?: string;\n currency?: Currency;\n order_cutoff_times?: SupplierOrderCutoffTimes;\n supplier_categories?: number[];\n main_supplier_category_id?: number;\n picture_url?: string;\n has_official_catalog?: boolean;\n is_available_for_chat?: boolean;\n shows_in_public_listings?: boolean;\n minimum_order_amount?: number;\n advance_days?: number;\n}\n\nexport class SuppliersService {\n private static readonly _searchAutocomplete = async (formData: SearchAutocompleteFormData): Promise => {\n try {\n const response: any = (\n await axiosInstance.get(`${Endpoints.SUPPLIER_SEARCH_AUTOCOMPLETE}`, { params: { search: formData.search } })\n ).data;\n return response || null;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useSearchAutocomplete = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async searchAutocompleteFormData => await SuppliersService._searchAutocomplete(searchAutocompleteFormData),\n options,\n );\n };\n\n private static readonly _requestAccess = async (formData: RequestAccessFormData): Promise => {\n try {\n const response: RequestAccessResponse = (\n await axiosInstance.post(`${Endpoints.SUPPLIER_REQUEST_ACCESS}`, formData)\n ).data;\n return response;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useRequestAccess = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async requestAccessFormData => await SuppliersService._requestAccess(requestAccessFormData),\n options,\n );\n };\n\n private static readonly _userValidation = async (\n formData: UserValidationFormData,\n ): Promise => {\n try {\n const response: UserValidationResponse = (\n await axiosInstance.post(`${Endpoints.SUPPLIER_USER_VALIDATION}`, formData)\n ).data;\n return response;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useUserValidation = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async userValidationFormData => await SuppliersService._userValidation(userValidationFormData),\n options,\n );\n };\n\n private static readonly _registerSupplier = async (\n formData: RegisterSupplierFormData,\n ): Promise => {\n try {\n const response: RegisterSupplierResponse = (\n await axiosInstance.post(`${Endpoints.SUPPLIER_REGISTRATION}`, formData)\n ).data;\n return response;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useRegisterSupplier = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async registerSupplierFormData => await SuppliersService._registerSupplier(registerSupplierFormData),\n options,\n );\n };\n\n private static readonly _getRestaurantSupplier = async (formData: GetRestaurantSupplierFormData): Promise => {\n const { restaurant_id, seller_id, supplier_id } = formData;\n\n const params = {\n 'filter.restaurant_id': restaurant_id,\n 'filter.supplier_id': supplier_id,\n 'filter.seller_id': seller_id,\n };\n\n if (!restaurant_id) {\n delete params['filter.restaurant_id'];\n }\n\n if (!supplier_id) {\n delete params['filter.supplier_id'];\n }\n\n if (!seller_id) {\n delete params['filter.seller_id'];\n }\n\n try {\n const response: any = (await axiosInstance.get(`${Endpoints.RESTAURANT_SUPPLIER}`, { params })).data;\n return response.data;\n } catch (error: any) {\n throw new Error(error.error_description);\n }\n };\n\n public static useGetRestaurantSupplier = (\n formData: GetRestaurantSupplierFormData,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(\n QueryTypes.RESTAURANT_SUPPLIER,\n async () => await this._getRestaurantSupplier(formData),\n {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n },\n );\n };\n\n public static useMutationGetRestaurantSupplier = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async (formData: GetRestaurantSupplierFormData) => await SuppliersService._getRestaurantSupplier(formData),\n options,\n );\n };\n\n private static readonly _getOneUserInvitations = async (\n formData: GetOneUserInvitationsFormData,\n ): Promise => {\n try {\n const response: BDUserInvitation = (await axiosInstance.post(`${Endpoints.SUPPLIER_USER_INVITATIONS}`, formData))\n .data;\n return getOnUserSupplierInvitationResponseParse(response);\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static useGetOneUserInvitations = (\n formData: GetOneUserInvitationsFormData,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(\n QueryTypes.INVITATION,\n async () => await this._getOneUserInvitations(formData),\n {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n },\n );\n };\n\n public static useMutateGetOneUserInvitations = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async formData => await SuppliersService._getOneUserInvitations(formData),\n options,\n );\n };\n\n private static readonly _getGetSupplier = async (supplierId: number): Promise => {\n try {\n const response: any = (await axiosInstance.get(`${Endpoints.SUPPLIER_GET}${supplierId}`)).data;\n return supplierResponseParse(response);\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static useGetSupplier = (\n supplierId: number,\n { ...opts }: UseQueryOptions,\n ): UseQueryResult => {\n return useQuery(QueryTypes.SUPPLIER, async () => await this._getGetSupplier(supplierId), {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n });\n };\n\n private static readonly _patchSupplier = async (formData: PatchSupplierFormData): Promise => {\n const { id } = formData;\n delete formData.id;\n try {\n const response: any = (await axiosInstance.patch(`${Endpoints.SUPPLIER_GET}${id}`, formData)).data;\n return supplierResponseParse(response);\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static usePatchSupplier = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async formData => await SuppliersService._patchSupplier(formData),\n options,\n );\n };\n\n private static readonly _getGetSupplierCategories = async (): Promise => {\n try {\n const response: any = (\n await axiosInstance.get(`${Endpoints.SUPPLIER_CATEGORIES}`, {\n params: {\n limit: 50,\n page: 1,\n },\n })\n ).data;\n return response.data;\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static useGetSupplierCategories = ({ ...opts }: UseQueryOptions): UseQueryResult => {\n return useQuery(QueryTypes.SUPPLIER_CATEGORIES, async () => await this._getGetSupplierCategories(), {\n refetchOnWindowFocus: false,\n cacheTime: 0,\n ...opts,\n });\n };\n\n private static readonly _postSupplierSchedule = async (params: any): Promise => {\n try {\n const response: any = (await axiosInstance.post(`${Endpoints.SUPPLIER_SCHEDULE}`, params)).data;\n return response.data;\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static useMutateSupplierSchedule = (options?: UseMutationOptions) => {\n return useMutation(\n QueryTypes.SUPPLIER_SCHEDULE,\n async params => await this._postSupplierSchedule(params),\n );\n };\n\n private static readonly _getSupplierSchedule = async (supplierId: number): Promise => {\n try {\n const response: any = (await axiosInstance.get(`${Endpoints.SUPPLIER_GET}${supplierId}/schedule`)).data;\n return response;\n } catch (error) {\n throw new Error(`Unknown error: ${error}`);\n }\n };\n\n public static useGetSupplierSchedule = (supplierId: number, opts: UseQueryOptions) => {\n return useQuery(QueryTypes.SUPPLIER_SCHEDULE, async () => await this._getSupplierSchedule(supplierId), {\n ...opts,\n });\n };\n\n private static readonly _uploadFile = async (file: File): Promise => {\n const formData = new FormData();\n formData.append('file', file);\n try {\n const response: any = (\n await axiosInstance.post(`${Endpoints.UPLOAD_FILE}`, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n transformRequest: (data, headers) => {\n return formData;\n },\n })\n ).data;\n return response;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useUploadFile = (options?: UseMutationOptions): UseMutationResult => {\n return useMutation(async file => await SuppliersService._uploadFile(file), options);\n };\n\n private static readonly _deleteRestaurant = async (restaurantId: number, supplierId: number): Promise => {\n try {\n const response: any = (\n await axiosInstance.delete(Endpoints.RESTAURANT_SUPPLIER, {\n data: {\n supplier_id: supplierId,\n restaurant_id: restaurantId,\n },\n })\n ).data;\n return response;\n } catch (error: any) {\n throw new Error(error.message);\n }\n };\n\n public static useDeleteRestaurant = (\n options?: UseMutationOptions,\n ): UseMutationResult => {\n return useMutation(\n async ({ restaurantId, supplierId }) =>\n await SuppliersService._deleteRestaurant(restaurantId, supplierId as number),\n options,\n );\n };\n\n public static storeSupplierInLocalStorage = (supplier: any): void => {\n const localStorageSupplier = window.localStorage.supplier;\n if (!localStorageSupplier) {\n window.localStorage.supplier = supplier;\n }\n };\n\n public static useGetSupplierFromLocalStorage = (): any => {\n const localStorageSupplier = window.localStorage.supplier;\n if (localStorageSupplier) {\n return JSON.parse(localStorageSupplier);\n }\n return null;\n };\n}\n"],"names":["Promise","resolve","then","__webpack_require__","bind","page","router","useRouter","loading","setLoading","useState","supplierItems","setSupplierItems","supplierName","setSupplierName","selectedSupplier","setSelectedSupplier","localStorage","getItem","push","mutateAsync","searchAutocomplete","SuppliersService","useSearchAutocomplete","isValidSupplier","trim","length","handleSubmit","event","preventDefault","concat","id","user_count","toast","info","handleSetitems","data","throttled","useCallback","throttle","res","jsx_runtime","jsx","Layout","jsxs","div","className","span","h2","form","onSubmit","autoComplete","style","zIndex","label","htmlFor","ReactSearchAutocomplete","items","onSearch","search","supplierAlreadyExists","findIndex","val","name","undefined","onSelect","result","onClear","autoFocus","styling","height","border","borderRadius","backgroundColor","boxShadow","hoverBackgroundColor","color","fontSize","fontFamily","iconColor","lineColor","placeholderColor","clearIconMargin","searchIconMargin","showNoResults","button","type","disabled","Spinner","a","href","target","rel","onClick","__webpack_exports__","Z","children","bg","param","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","main","Fragment","svg","viewBox","circle","cx","cy","r","stroke","strokeWidth","path","fill","d","getOnUserSupplierInvitationResponseParse","phone","email","firstName","first_name","lastName","last_name","supplierUserId","supplier_user_id","supplierId","supplier_id","role","status","createdAt","created_at","updatedAt","updated_at","_searchAutocomplete","formData","response","axiosInstance","get","Endpoints","SUPPLIER_SEARCH_AUTOCOMPLETE","params","error","message","useMutation","searchAutocompleteFormData","options","_requestAccess","post","SUPPLIER_REQUEST_ACCESS","useRequestAccess","requestAccessFormData","_userValidation","SUPPLIER_USER_VALIDATION","useUserValidation","userValidationFormData","_registerSupplier","SUPPLIER_REGISTRATION","useRegisterSupplier","registerSupplierFormData","_getRestaurantSupplier","restaurant_id","seller_id","RESTAURANT_SUPPLIER","error_description","useGetRestaurantSupplier","opts","useQuery","QueryTypes","refetchOnWindowFocus","cacheTime","useMutationGetRestaurantSupplier","_getOneUserInvitations","SUPPLIER_USER_INVITATIONS","useGetOneUserInvitations","INVITATION","useMutateGetOneUserInvitations","_getGetSupplier","SUPPLIER_GET","supplierResponseParse","useGetSupplier","SUPPLIER","_patchSupplier","patch","usePatchSupplier","_getGetSupplierCategories","SUPPLIER_CATEGORIES","limit","useGetSupplierCategories","_postSupplierSchedule","SUPPLIER_SCHEDULE","useMutateSupplierSchedule","_getSupplierSchedule","useGetSupplierSchedule","_uploadFile","file","FormData","append","UPLOAD_FILE","headers","transformRequest","useUploadFile","_deleteRestaurant","restaurantId","delete","useDeleteRestaurant","storeSupplierInLocalStorage","window","supplier","useGetSupplierFromLocalStorage","localStorageSupplier","JSON","parse"],"sourceRoot":""}