{"version":3,"sources":["component/Home/AuthVerify.tsx","action/CreateCashOfferAction.tsx","thunk/VinDecodeThunk.tsx","action/VinDecodeActions.tsx","action/SignupAction.tsx"],"names":["AuthVerify","history","useHistory","dispatch","useDispatch","useSelector","state","React","useEffect","interval","setInterval","handleLogout","window","localStorage","getItem","moment","Date","now","format","clearInterval","expTime","currentTime","a","async","success","message","removeItem","setAuthenticationLogOut","setSelectedDealer","undefined","resetSignupState","resetVinDecode","resetVinDecodeError","resetCashOfferStatus","clear","push","style","display","setImagesChnaged","vehicleType","payload","type","SET_IMAGES_CHANGED","setCashOfferPageLoading","SET_CASH_OFFER_PAGE_LOADING","setCashOfferHasError","SET_CREATE_CASH_OFFER_HAS_ERROR","setCashOfferVinDecodeResult","SET_VIN_DECODE_RESULT","setCashOfferCreatedSuccessfully","SET_CASH_OFFER_CREATED_SUCCESSFULLY","RESET_CASH_OFFER_STATUS","resetCashOffError","RESET_CREATE_CASH_OFFER_ERROR","setCashOfferEditedImageUploading","uploading","SET_CASH_OFFER_EDITED_IMG_UPLOADING","setCashOfferEditedImageUploadSuccess","updatedFile","SET_CASH_OFFER_EDITED_IMG_UPLOAD_SUCCESS","setCashOfferEditedImageUploadError","errorMessage","SET_CASH_OFFER_EDITED_IMG_UPLOAD_ERROR","env","environmentVariableList","decodeGenericVin","vin","mode","accountId","getState","setVinDecodeIsFetching","url","REACT_APP_VIN_DECODE_END_POINT","fetch","response","ok","text","responseText","includes","setVinDecodeError","Error","json","res","decodedVin","createdAt","getTime","setVinDecodeDecodedVin","addToDecodedVinList","vinDecode","console","error","resetVinDecodeThunk","setVinDecodeResetStatus","setModellist","SET_MODELLIST","setPayload","SET_PAYLOAD","SET_VIN_DECODE_IS_FETCHING","SET_VIN_DECODE_DECODED_VIN","SET_VIN_DECODE_RESET_STATUS","SET_VIN_DECODE_ERROR","RESET_VIN_DECODE_ERROR","ADD_TO_DECODED_VIN_LIST","removeFromDecodedVin","REMOVE_FROM_DECODED_VIN_LIST","RESET_V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B,UAAU3B,aAC1C1D,EAAS4E,EAAkBlB,GAAgB,wCAC3C4B,QAAQC,MAAR,MAlC+C,yBAoC/CvF,EAASmE,GAAuB,IApCe,8EAwCtCqB,EAAsB,kBAAoD,SAAOxF,GAAP,SAAAmB,EAAAC,OAAA,kEAAAD,EAAA,MAC/EnB,EAASyF,EAAwB,eAD8C,OAErFzF,EAAS4B,KACT5B,EAASyF,EAAwB,YAHoD,uCC5EvF,wZAeO,IAAMC,EAAe,SAC1BrD,GAD0B,MAGtB,CACJC,KAAMqD,IACNtD,YAEWuD,EAAa,SACxBvD,GADwB,MAGpB,CACJC,KAAMuD,IACNxD,YAEW8B,EAAyB,SACpC9B,GADoC,MAEhC,CACJC,KAAMwD,IACNzD,YAIW8C,EAAyB,SACpC9C,GADoC,MAEhC,CACJC,KAAMyD,IACN1D,YAGWoD,EAA0B,SAACpD,GAAD,MAAuC,CAC5EC,KAAM0D,IACN3D,YAGWuC,EAAoB,SAC/BvC,GAD+B,MAE3B,CACJC,KAAM2D,IACN5D,YAGWR,EAAsB,iBAAO,CACxCS,KAAM4D,MAGKd,EAAsB,SACjC/C,GADiC,MAE7B,CACJC,KAAM6D,IACN9D,YAGW+D,EAAuB,SAClC/D,GADkC,MAE9B,CACJC,KAAM+D,IACNhE,YAGWT,EAAiB,iBAAO,CACnCU,KAAMgE,O,iCC3ER,qJAQaC,EAAmB,SAAClE,GAAD,MAA0C,CACxEC,KAAMkE,IACNnE,QAASA,IAGEoE,EAAmB,SAACpE,GAAD,MAA0C,CACxEC,KAAMoE,IACNrE,QAASA,IAGEsE,EAAyB,SAACtE,GAAD,MAAyC,CAC7EC,KAAMsE,IACNvE,QAASA,IAGEV,EAAmB,iBAA0B,CACxDW,KAAMuE","file":"static/js/30.9df5f88e.chunk.js","sourcesContent":["import React from 'react';\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { notification } from 'antd';\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport {\r\n setAuthenticationLogOut,\r\n setSelectedDealer,\r\n} from \"../../action/AuthenticationAction\";\r\nimport SystemState from \"../../type\";\r\nimport { resetCashOfferStatus } from \"../../action/CreateCashOfferAction\";\r\nimport { resetSignupState } from \"../../action/SignupAction\";\r\nimport { resetVinDecode, resetVinDecodeError } from \"../../action/VinDecodeActions\";\r\n// import { withRouter } from \"./withRouter\";\r\nimport moment from 'moment'\r\nconst AuthVerify = () => {\r\n const history = useHistory();\r\n const dispatch = useDispatch();\r\n const vehicleType = useSelector((state: SystemState) => state);\r\n // const { auth, setAuth } = React.useContext(Store);\r\n const MINUTE_MS = 60000;\r\n // console.log(\"Session::::\", window?.localStorage?.getItem('expiration'))\r\n // console.log(\"vehicleType::::\", vehicleType)\r\n React.useEffect(() => {\r\n const interval = setInterval(() => {\r\n // window?.localStorage?.getItem('expiration') \"03/10/2023 11:40:55 AM\"\r\n handleLogout(window?.localStorage?.getItem('expiration'), moment(Date.now()).format(\"L LTS\"))\r\n }, MINUTE_MS);\r\n return () => clearInterval(interval);\r\n }, []);\r\n\r\n const handleLogout = async (expTime: any, currentTime: any) => {\r\n // console.log(\"auth2222222::::\", currentTime, expTime, currentTime > expTime)\r\n if (currentTime > expTime\r\n &&\r\n window.localStorage.getItem('auth') !== null\r\n ) {\r\n notification.success({ message: 'Expired Session, You Have Been Logged Out' });\r\n await window.localStorage.removeItem('auth');\r\n await window.localStorage.removeItem('expiration');\r\n dispatch(setAuthenticationLogOut());\r\n dispatch(setSelectedDealer(undefined));\r\n dispatch(resetSignupState())\r\n dispatch(resetVinDecode())\r\n dispatch(resetVinDecodeError())\r\n dispatch(resetCashOfferStatus(\"car\"));\r\n dispatch(resetCashOfferStatus(\"motorcycle\"));\r\n dispatch(resetCashOfferStatus(\"boat\"));\r\n await localStorage.clear();\r\n history.push(\"/\");\r\n }\r\n };\r\n return (\r\n
\r\n
\r\n\r\n );\r\n};\r\n\r\nexport default (AuthVerify);\r\n","import {\r\n VinDecodeResult,\r\n SET_CASH_OFFER_PAGE_LOADING,\r\n SET_VIN_DECODE_RESULT,\r\n SET_CREATE_CASH_OFFER_HAS_ERROR,\r\n SET_CASH_OFFER_CREATED_SUCCESSFULLY,\r\n RESET_CREATE_CASH_OFFER_ERROR,\r\n RESET_CASH_OFFER_STATUS,\r\n CreateCashOfferActionTypes,\r\n VehicleType,\r\n SET_CASH_OFFER_EDITED_IMG_UPLOADING,\r\n SET_CASH_OFFER_EDITED_IMG_UPLOAD_SUCCESS,\r\n SET_CASH_OFFER_EDITED_IMG_UPLOAD_ERROR,\r\n SET_IMAGES_CHANGED,\r\n} from \"../type/CreateCashOfferType\";\r\n\r\n\r\nexport const setImagesChnaged = (\r\n vehicleType: VehicleType,\r\n payload: boolean,): CreateCashOfferActionTypes => ({\r\n type: SET_IMAGES_CHANGED,\r\n vehicleType: vehicleType,\r\n payload: payload,\r\n })\r\n\r\n\r\nexport const setCashOfferPageLoading = (\r\n vehicleType: VehicleType,\r\n payload: boolean,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CASH_OFFER_PAGE_LOADING,\r\n vehicleType: vehicleType,\r\n payload: payload,\r\n});\r\n\r\nexport const setCashOfferHasError = (\r\n vehicleType: VehicleType,\r\n payload: string,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CREATE_CASH_OFFER_HAS_ERROR,\r\n vehicleType: vehicleType,\r\n payload: payload,\r\n});\r\n\r\nexport const setCashOfferVinDecodeResult = (\r\n vehicleType: VehicleType,\r\n payload: VinDecodeResult,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_VIN_DECODE_RESULT,\r\n vehicleType: vehicleType,\r\n payload: payload,\r\n});\r\n\r\nexport const setCashOfferCreatedSuccessfully = (\r\n vehicleType: VehicleType,\r\n payload: boolean,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CASH_OFFER_CREATED_SUCCESSFULLY,\r\n vehicleType: vehicleType,\r\n payload: payload,\r\n});\r\n\r\nexport const resetCashOfferStatus = (\r\n vehicleType: VehicleType,\r\n): CreateCashOfferActionTypes => ({\r\n type: RESET_CASH_OFFER_STATUS,\r\n vehicleType: vehicleType,\r\n});\r\n\r\nexport const resetCashOffError = (\r\n vehicleType: VehicleType,\r\n): CreateCashOfferActionTypes => ({\r\n type: RESET_CREATE_CASH_OFFER_ERROR,\r\n vehicleType: vehicleType,\r\n});\r\n\r\nexport const setCashOfferEditedImageUploading = (\r\n uploading: boolean,\r\n vehicleType: VehicleType,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CASH_OFFER_EDITED_IMG_UPLOADING,\r\n uploading,\r\n vehicleType,\r\n});\r\n\r\nexport const setCashOfferEditedImageUploadSuccess = (\r\n updatedFile: any,\r\n vehicleType: VehicleType,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CASH_OFFER_EDITED_IMG_UPLOAD_SUCCESS,\r\n updatedFile,\r\n vehicleType,\r\n});\r\n\r\nexport const setCashOfferEditedImageUploadError = (\r\n errorMessage: string,\r\n vehicleType: VehicleType,\r\n): CreateCashOfferActionTypes => ({\r\n type: SET_CASH_OFFER_EDITED_IMG_UPLOAD_ERROR,\r\n errorMessage,\r\n vehicleType,\r\n});","import { Action } from \"redux\";\r\nimport { ThunkAction } from \"redux-thunk\";\r\n\r\nimport SystemState from \"../type\";\r\nimport { environmentVariableList } from \"../constant\";\r\n\r\nimport {\r\n setVinDecodeIsFetching,\r\n setVinDecodeDecodedVin,\r\n setVinDecodeError,\r\n resetVinDecodeError,\r\n addToDecodedVinList,\r\n setVinDecodeResetStatus,\r\n resetVinDecode,\r\n setModellist,\r\n setPayload\r\n} from '../action/VinDecodeActions';\r\n\r\nimport {\r\n Vin\r\n} from '../type/SharedTypes';\r\n\r\nimport {\r\n DecodedVin\r\n} from '../type/VinDecodeTypes';\r\n\r\n\r\nconst env = environmentVariableList();\r\n\r\n//@todo: decode can take a long time, use Promise.race to stop -> ask user for retry\r\nexport const decodeGenericVin = (\r\n { vin, mode, accountId }: {\r\n vin: Vin,\r\n mode?: \"portal\" | \"default\",\r\n accountId?: number\r\n }\r\n): ThunkAction => async (dispatch, getState) => {\r\n\r\n try {\r\n dispatch(resetVinDecodeError());\r\n dispatch(setVinDecodeIsFetching(true));\r\n\r\n let url = `${env.REACT_APP_VIN_DECODE_END_POINT}/api/${vin}/decode`;\r\n if (mode === \"portal\") {\r\n url = url + `?accountId=${accountId}`;\r\n }\r\n\r\n const response = await fetch(url);\r\n\r\n if (!response.ok) {\r\n const responseText = await response.text(); //for VIN is already in appraisal...\r\n if (responseText.includes('already in our appraisal process')) {\r\n dispatch(setVinDecodeError('A vehicle with this VIN is already in our appraisal process.'));\r\n return;\r\n }\r\n\r\n throw new Error(responseText);\r\n } else {\r\n const res = await response.json(); //@fixtype\r\n const decodedVin: any = {\r\n ...res,\r\n createdAt: new Date().getTime()\r\n }\r\n\r\n dispatch(setVinDecodeDecodedVin(decodedVin));\r\n dispatch(addToDecodedVinList(decodedVin))\r\n }\r\n } catch (error) {\r\n const errorMessage = getState().vinDecode.errorMessage\r\n dispatch(setVinDecodeError(errorMessage || \"Sorry, we couldn't decode this VIN.\"));\r\n console.error(error);\r\n } finally {\r\n dispatch(setVinDecodeIsFetching(false));\r\n }\r\n};\r\n\r\nexport const resetVinDecodeThunk = (): ThunkAction => async (dispatch) => {\r\n await dispatch(setVinDecodeResetStatus('resetting'))\r\n dispatch(resetVinDecode())\r\n dispatch(setVinDecodeResetStatus('pending'))\r\n}","import {\r\n SET_VIN_DECODE_IS_FETCHING,\r\n SET_VIN_DECODE_DECODED_VIN,\r\n REMOVE_FROM_DECODED_VIN_LIST,\r\n SET_VIN_DECODE_RESET_STATUS,\r\n SET_VIN_DECODE_ERROR,\r\n RESET_VIN_DECODE_ERROR,\r\n ADD_TO_DECODED_VIN_LIST,\r\n RESET_VIN_DECODE_STATE,\r\n SET_MODELLIST,\r\n SET_PAYLOAD,\r\n\r\n} from '../type/VinDecodeTypes';\r\nimport { Vin } from '../type/SharedTypes';\r\n\r\nexport const setModellist = (\r\n payload: any\r\n\r\n) => ({\r\n type: SET_MODELLIST,\r\n payload\r\n})\r\nexport const setPayload = (\r\n payload: any\r\n\r\n) => ({\r\n type: SET_PAYLOAD,\r\n payload\r\n})\r\nexport const setVinDecodeIsFetching = (\r\n payload: boolean,\r\n) => ({\r\n type: SET_VIN_DECODE_IS_FETCHING,\r\n payload\r\n});\r\n\r\n\r\nexport const setVinDecodeDecodedVin = (\r\n payload: any,\r\n) => ({\r\n type: SET_VIN_DECODE_DECODED_VIN,\r\n payload,\r\n});\r\n\r\nexport const setVinDecodeResetStatus = (payload: 'resetting' | 'pending') => ({\r\n type: SET_VIN_DECODE_RESET_STATUS,\r\n payload,\r\n});\r\n\r\nexport const setVinDecodeError = (\r\n payload: string,\r\n) => ({\r\n type: SET_VIN_DECODE_ERROR,\r\n payload\r\n});\r\n\r\nexport const resetVinDecodeError = () => ({\r\n type: RESET_VIN_DECODE_ERROR,\r\n});\r\n\r\nexport const addToDecodedVinList = (\r\n payload: any\r\n) => ({\r\n type: ADD_TO_DECODED_VIN_LIST,\r\n payload,\r\n})\r\n\r\nexport const removeFromDecodedVin = (\r\n payload: Vin,\r\n) => ({\r\n type: REMOVE_FROM_DECODED_VIN_LIST,\r\n payload,\r\n});\r\n\r\nexport const resetVinDecode = () => ({\r\n type: RESET_VIN_DECODE_STATE\r\n})\r\n\r\nexport { decodeGenericVin, resetVinDecodeThunk } from '../thunk/VinDecodeThunk';","import {\r\n SignupActionTypes,\r\n SET_SIGNUP_FAILED_MESSAGE,\r\n SET_SIGNUP_LOADING,\r\n SET_SIGNUP_SUCCESS,\r\n RESET_SIGNUP_STATE,\r\n} from \"../type/SignupType\";\r\n\r\nexport const setSignupSuccess = (payload: boolean): SignupActionTypes => ({\r\n type: SET_SIGNUP_SUCCESS,\r\n payload: payload,\r\n});\r\n\r\nexport const setSignupLoading = (payload: boolean): SignupActionTypes => ({\r\n type: SET_SIGNUP_LOADING,\r\n payload: payload,\r\n});\r\n\r\nexport const setSignupFailedMessage = (payload: string): SignupActionTypes => ({\r\n type: SET_SIGNUP_FAILED_MESSAGE,\r\n payload: payload,\r\n});\r\n\r\nexport const resetSignupState = (): SignupActionTypes => ({\r\n type: RESET_SIGNUP_STATE,\r\n});\r\n"],"sourceRoot":""}