{"version":3,"sources":["redux/system/public-news/action-types.js","redux/system/system-action-types.js","core/auth/authUtil.js","core/auth/userIdentity.js","core/error/errorService.js","services/profile-service.jsx","redux/system/system-action-creators.js","core/history/historyObject.js","core/http/httpInterceptor.js","core/http/httpClient.js","components/common/private-route/index.jsx","config.jsx","core/auth/auth.js","components/common/scroll-to-top/index.jsx","components/common/toast/toast-notification.jsx","redux/system/notification-reducer.js","components/common/toast/toast-container.jsx","routes/index.jsx","App.js","redux/system/error-notification-reducer.js","redux/system/user-profile-reducer.js","redux/system/public-news/reducer.js","redux/system/system-reducer.js","views/contact-us/redux/reducer.js","redux/root-reducer.js","redux/configure-store.js","serviceWorker.js","index.js","views/contact-us/redux/action-types.js"],"names":["ActionTypes","PUBLIC_NEWS_LOAD_REQUEST","PUBLIC_NEWS_LOAD_SUCCESS","PUBLIC_NEWS_LOAD_FAILURE","SYS_ADD_NOTIFICATION","SYS_ADD_ERROR_NOTIFICATION","SYS_HANDLE_ERROR","SYS_HANDLE_ERROR_SHOW_FORM","SYS_HANDLE_ERROR_HIDE_FORM","SYS_GET_PROFILE_REQUEST","SYS_GET_PROFILE_SUCCESS","SYS_GET_PROFILE_FAILURE","SYS_HIDE_SPLASH","SYS_UPDATE_PROFILE_REQUEST","SYS_UPDATE_PROFILE_SUCCESS","SYS_UPDATE_PROFILE_FAILURE","SYS_GET_FEATURE_FLAG_SUCCESS","SYS_GET_FEATURE_FLAG_FAILURE","SYS_TOGGLE_LOG_OUT","SYS_UPDATE_PROFILE","token","base64","split","replace","JSON","parse","atob","UserIdentity","getFirstName","getClaimsValueByType","getLastName","claimType","claims","getClaims","_perfGetClaimsValueByType","Auth","getToken","AuthUtil","claimsExist","value","claim","getUserId","getFullName","concat","getUserName","isAuthenticated","getRole","trueForAll","expectedClaims","testResults","forEach","c","push","every","x","getEmail","any","some","ErrorService","_identifyAndCreateErrorObject","error","status","response","errData","data","defaultErrModel","isModelState","_log","undefined","_objectSpread","message","Message","console","log","resolveError","Promise","resolve","reject","ProfileService","httpClient","HttpClient","getProfile","id","get","addNotification","level","type","addErrorNotification","defaultErrorMessage","errorMessage","handleError","dispatch","then","resp","showErrorForm","catch","err","hideErrorForm","payload","service","userIdent","getProfileRequest","_ref","getProfileSuccess","getProfileFailure","setProfile","updateUserProfile","hideSplash","toggleLogOut","historyObject","require","createBrowserHistory","HttpInterceptor","authTokenRequestPromise","api","axios","create","baseURL","Config","apiUrl","_getAuthToken","refreshTokenPayload","getRefreshTokenPayload","clientId","post","_resetAuthTokenRequestPromise","interceptorReqAuth","config","headers","Authorization","interceptorRespError","Error","__isRetryRequest","setToken","access_token","refresh_token","expires_in","e","ex","invalid_refreshtoken","removeToken","newErrObj","Object","assign","interceptor","interceptors","request","use","getContentTypeString","resourcePathName","cfg","arguments","length","put","urlParams","delete","patch","getProvider","setContentType","contentType","defaults","setAuthToken","common","CheckAndRenderAuthenticatedComponent","props","noAccess","isNil","claimsAuthorisationHook","isFunction","React","createElement","Redirect","to","pathname","Fragment","children","PrivateRoute","component","path","rest","_objectWithoutProperties","_excluded","Route","render","state","from","location","appVersion","appAuthStorageKey","defaultPageTitle","process","gtmId","_classCallCheck","this","useLocalStorage","localStorage","subscribers","load","_createClass","key","tokenObject","getItem","tokenObjectParsed","_populateModel","refreshToken","expiresIn","setItem","stringify","removeItem","tokenObj","_fetchFullTokenObject","cb","_this","ClientId","GrantType","RefreshToken","getRefreshToken","refresh","ScrollToTop","_Component","_inherits","_super","_createSuper","apply","prevProps","window","scrollTo","Component","withRouter","ToastNotification","_len","args","Array","_key","call","style","NotificationItem","DefaultStyle","margin","padding","borderRadius","fontSize","color","backgroundColor","width","maxWidth","success","borderTop","Dismiss","notificationSystem","refs","newProps","_newProps$notificatio","notification","position","NotificationSystem","ref","initialState","ToastNotificationContainer","connect","system","selectNotificationData","actions","bindActionCreators","FullLayout","loadable","indexRoutes","name","App","Router","className","Switch","map","prop","privateRoute","title","lastErrorOccured","isModalOpen","isModelStateError","email","firstName","lastName","mobile","memberType","isFetching","isLoggingOut","isLoadingNews","SystemReducer","combineReducers","action","errorNotification","userProfile","publicNews","isLoading","isSuccessful","isQuoteSubmitting","isQuoteSubmissionSuccessful","RootReducer","contactUs","CONTACT_US_REQUEST","CONTACT_US_QUOTE_REQUEST","CONTACT_US_SUCCESS","CONTACT_US_QUOTE_SUCCESS","CONTACT_US_FAILURE","CONTACT_US_QUOTE_FAILURE","CONTACT_US_CLEAN_UP","ConfigureStore","middleware","thunk","enhancers","applyMiddleware","createStore","compose","Boolean","hostname","match","rootElement","document","getElementById","store","hasChildNodes","loadableReady","hydrate","Provider","navigator","serviceWorker","ready","registration","unregister"],"mappings":"oHAAA,kCAAO,IAAMA,EAAc,CACzBC,yBAA0B,2BAC1BC,yBAA0B,2BAC1BC,yBAA0B,6B,gCCH5B,kCAGO,IAAMH,EAAc,CAEzBI,qBAAsB,mBACtBC,2BAA4B,mBAG5BC,iBAAkB,eAClBC,2BAA4B,6BAC5BC,2BAA4B,6BAG5BC,wBAAyB,0BACzBC,wBAAyB,0BACzBC,wBAAyB,0BACzBC,gBAAiB,kBAEjBC,2BAA4B,6BAC5BC,2BAA4B,6BAC5BC,2BAA4B,6BAE5BC,6BAA8B,+BAC9BC,6BAA8B,+BAE9BC,mBAAoB,qBACpBC,mBAAoB,uB,2dCpBP,EAPE,SAAAC,GACf,IACIC,EADYD,EAAME,MAAM,KAAK,GACVC,QAAQ,IAAK,KAAKA,QAAQ,IAAK,KAEtD,OAAOC,KAAKC,MAAMC,KAAKL,KC6HVM,EAjGM,WAEnB,IAAMC,EAAe,WAAH,OAASC,EAAqB,eAI1CC,EAAc,WAAH,OAASD,EAAqB,gBAoBzCA,EAAuB,SAAAE,GAC3B,IAAIC,EAASC,IACb,OAAOC,EAA0BH,EAAWC,IAQxCC,EAAY,WAEhB,IAAIb,EAAQe,IAAKC,WACjB,OAAKhB,EACEiB,EAAkBjB,GADN,MAWfkB,EAAc,SAAAC,GAClB,IAAIC,EAAQX,EAAqBU,GACjC,M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,IAEjC,KAAKxS,IAAYiT,oBACf,OAAOhD,EACT,QACE,OAAOzE,MEHE0H,EAtCQ,WACrB,IAAIC,EAAa,CAACC,KACdC,EAAY,CAACC,IAAevF,WAAC,EAAGoF,IAapC,OAAOI,YAAYd,EAAae,IAAOzF,WAAC,EAAGsF,KCVzBI,QACW,cAA7BxF,OAAOvC,SAASgI,UAEe,UAA7BzF,OAAOvC,SAASgI,UAEhBzF,OAAOvC,SAASgI,SAASC,MACvB,2DCRN,IAAMC,EAAcC,SAASC,eAAe,QACtCC,EAAQb,IAEd,GAAIU,EAAYI,gBAAiB,CAC/B,IAAMD,EAAQb,IACde,aAAc,WACZC,kBACEzJ,IAAAC,cAACyJ,IAAQ,CAACJ,MAAOA,GACftJ,IAAAC,cAACkG,EAAG,OAENgD,WAIJrI,iBACEd,IAAAC,cAACyJ,IAAQ,CAACJ,MAAOA,GACftJ,IAAAC,cAACkG,EAAG,OAENgD,GDuGE,kBAAmBQ,WACrBA,UAAUC,cAAcC,MAAM1O,MAAK,SAAA2O,GACjCA,EAAaC,iB,gCEzHJxU,IAZK,CAClB2S,mBAAoB,qBACpBE,mBAAoB,qBACpBE,mBAAoB,qBAEpBH,yBAA0B,2BAC1BE,yBAA0B,2BAC1BE,yBAA0B,2BAE1BC,oBAAqB,yB","file":"static/js/main.2f7c4306.chunk.js","sourcesContent":["export const ActionTypes = {\r\n PUBLIC_NEWS_LOAD_REQUEST: \"PUBLIC_NEWS_LOAD_REQUEST\",\r\n PUBLIC_NEWS_LOAD_SUCCESS: \"PUBLIC_NEWS_LOAD_SUCCESS\",\r\n PUBLIC_NEWS_LOAD_FAILURE: \"PUBLIC_NEWS_LOAD_FAILURE\",\r\n};\r\n","/**\r\n * System-wide Action types\r\n */\r\nexport const ActionTypes = {\r\n // Notifications\r\n SYS_ADD_NOTIFICATION: \"ADD_NOTIFICATION\",\r\n SYS_ADD_ERROR_NOTIFICATION: \"ADD_NOTIFICATION\",\r\n\r\n // Error Handler\r\n SYS_HANDLE_ERROR: \"HANDLE_ERROR\",\r\n SYS_HANDLE_ERROR_SHOW_FORM: \"SYS_HANDLE_ERROR_SHOW_FORM\",\r\n SYS_HANDLE_ERROR_HIDE_FORM: \"SYS_HANDLE_ERROR_HIDE_FORM\",\r\n\r\n // Profile\r\n SYS_GET_PROFILE_REQUEST: \"SYS_GET_PROFILE_REQUEST\",\r\n SYS_GET_PROFILE_SUCCESS: \"SYS_GET_PROFILE_SUCCESS\",\r\n SYS_GET_PROFILE_FAILURE: \"SYS_GET_PROFILE_FAILURE\",\r\n SYS_HIDE_SPLASH: \"SYS_HIDE_SPLASH\",\r\n\r\n SYS_UPDATE_PROFILE_REQUEST: \"SYS_UPDATE_PROFILE_REQUEST\",\r\n SYS_UPDATE_PROFILE_SUCCESS: \"SYS_UPDATE_PROFILE_SUCCESS\",\r\n SYS_UPDATE_PROFILE_FAILURE: \"SYS_UPDATE_PROFILE_FAILURE\",\r\n\r\n SYS_GET_FEATURE_FLAG_SUCCESS: \"SYS_GET_FEATURE_FLAG_SUCCESS\",\r\n SYS_GET_FEATURE_FLAG_FAILURE: \"SYS_GET_FEATURE_FLAG_FAILURE\",\r\n\r\n SYS_TOGGLE_LOG_OUT: \"SYS_TOGGLE_LOG_OUT\",\r\n SYS_UPDATE_PROFILE: \"SYS_UPDATE_PROFILE\",\r\n};\r\n","const parseJwt = token => {\r\n let base64Url = token.split(\".\")[1];\r\n let base64 = base64Url.replace(\"-\", \"+\").replace(\"_\", \"/\");\r\n\r\n return JSON.parse(atob(base64));\r\n};\r\n\r\nexport default { parseJwt };\r\n","/**\r\n * User Claims library\r\n * Create singleton instance\r\n * by rcnet@solvable\r\n *\r\n * Claims Utility methods.\r\n * Sample usage:\r\n *\r\n * claimsExist() - accepts a single expected claim parameter to check against current user's claims.\r\n * ex.\r\n * button.disabled = userIdentity.claimsExist('CanAccessProfile') || userIdentity.claimsExist('CanManageProfile')\r\n * button.disabled = userIdentity.claimsExist('CanAccessProfile') && userIdentity.claimsExist('CanManageProfile')\r\n *\r\n * trueForAll() - supplied parameter vs claims checking should be all truthy to say that it is a valid claim.\r\n * ex.\r\n * button.disabled = userIdentity.trueForAll(['CanAccessProfile', 'CanManageProfile'])\r\n *\r\n * any() - performs OR checking of expected claim types against user's claims. If it finds any occurence of expected claims it will considered a thruthy result.\r\n * ex.\r\n * button.disabled = userIdentity.any(['CanAccessProfile', 'CanAccessPayroll'])\r\n * \r\n * Sample usage #2: (Passing a claimType)\r\n * \r\n * trueForAll example.\r\n * button.disabled = userIdentity.trueForAll(['rol==admin','CanAccessProfile', 'CanManageProfile'])\r\n * \r\n * Any example.\r\n * button.disabled = userIdentity.any(['CanAccessProfile', 'CanAccessPayroll', 'rol==NormalUser', 'location==123'])\r\n */\r\nimport Auth from \"../auth/auth\";\r\nimport AuthUtil from \"../auth/authUtil\";\r\n\r\nconst UserIdentity = () => {\r\n // Common Claims\r\n const getFirstName = () => getClaimsValueByType(\"given_name\");\r\n\r\n const getUserId = () => getClaimsValueByType(\"id\");\r\n\r\n const getLastName = () => getClaimsValueByType(\"family_name\");\r\n\r\n const getFullName = () => `${getFirstName()} ${getLastName()}`;\r\n\r\n const getUserName = () => getClaimsValueByType(\"sub\");\r\n\r\n const getRole = () => getClaimsValueByType(\"rol\");\r\n\r\n const getEmail = () => getClaimsValueByType(\"sub\");\r\n\r\n const isAuthenticated = () => Auth.isAuthenticated();\r\n\r\n // -----------------------\r\n // Claims Utility methods\r\n // -----------------------\r\n\r\n /**\r\n * Will return a claim value based on the supply claim type.\r\n * @param {*} claimType\r\n */\r\n const getClaimsValueByType = claimType => {\r\n let claims = getClaims();\r\n return _perfGetClaimsValueByType(claimType, claims);\r\n // let claim = (claims && claims[claimType]);\r\n // return claim ? claim : '';\r\n };\r\n\r\n /**\r\n * Get array of claims\r\n */\r\n const getClaims = () => {\r\n //Todo: Perform debounce here (cache it for 3-5 secs)\r\n let token = Auth.getToken();\r\n if (!token) return null;\r\n return AuthUtil.parseJwt(token);\r\n };\r\n\r\n /**\r\n * Provide either claim type or value\r\n * 1. It will check if the claim is available to this user\r\n * 2. It will check both if the claim type and value are equal\r\n *\r\n * @param {value} value\r\n */\r\n const claimsExist = value => {\r\n var claim = getClaimsValueByType(value);\r\n if (claim === \"\") return false;\r\n\r\n return claim === value;\r\n };\r\n\r\n const trueForAll = expectedClaims => {\r\n let testResults = [];\r\n expectedClaims.forEach(c => {\r\n testResults.push(claimsExist(c));\r\n });\r\n\r\n return testResults.every(x => x === true);\r\n };\r\n\r\n const any = expectedClaims => {\r\n const hasAny = expectedClaims.some(c => {\r\n return claimsExist(c);\r\n });\r\n\r\n return hasAny;\r\n };\r\n\r\n // internal only\r\n const _perfGetClaimsValueByType = (claimType, claims) => {\r\n let claim = claims && claims[claimType];\r\n return claim ? claim : \"\";\r\n };\r\n\r\n return {\r\n getFirstName,\r\n getUserId,\r\n getLastName,\r\n getFullName,\r\n getUserName,\r\n isAuthenticated,\r\n getRole,\r\n getClaimsValueByType,\r\n getClaims,\r\n claimsExist,\r\n trueForAll,\r\n getEmail,\r\n any\r\n };\r\n};\r\n\r\nexport default UserIdentity;\r\n","/**\r\n * Error Service\r\n */\r\nconst ErrorService = () => {\r\n const resolveError = error => {\r\n const deferred = new Promise((resolve, reject) => {\r\n let errObj = _identifyAndCreateErrorObject(error);\r\n resolve(errObj);\r\n });\r\n\r\n return deferred;\r\n };\r\n\r\n const _identifyAndCreateErrorObject = error => {\r\n const status = error.response && error.response.status;\r\n const errData = error.response && error.response.data;\r\n let defaultErrModel = {\r\n isModelState: false,\r\n error: errData,\r\n status: status\r\n };\r\n\r\n _log(error);\r\n\r\n if (status === undefined) {\r\n return {\r\n ...defaultErrModel,\r\n status: \"Unknown\",\r\n message:\r\n \"Oops, something went wrong. Check the console logs for details.\"\r\n };\r\n }\r\n\r\n switch (status) {\r\n case 404:\r\n return {\r\n ...defaultErrModel,\r\n message: errData\r\n };\r\n\r\n case 500:\r\n return {\r\n ...defaultErrModel,\r\n message: errData.Message\r\n };\r\n\r\n default:\r\n return {\r\n ...defaultErrModel,\r\n message: \"Oops, something went wrong.\"\r\n };\r\n }\r\n };\r\n\r\n // Perform Sentry logging here\r\n const _log = error => {\r\n console.log(\"== Encountered an error ==\");\r\n if (error && error.response && error.response.data)\r\n console.error(error.response.data);\r\n else console.error(error);\r\n };\r\n\r\n return {\r\n resolveError\r\n };\r\n};\r\n\r\nexport default ErrorService;\r\n","/**\r\n * Common service for Profile\r\n */\r\nimport HttpClient from \"../core/http/httpClient\";\r\n\r\nconst ProfileService = () => {\r\n let httpClient = HttpClient();\r\n\r\n const getProfile = id =>\r\n httpClient.get(`/v1/core/accounts/${id}/profile/settings`);\r\n\r\n return {\r\n getProfile\r\n };\r\n};\r\n\r\nexport default ProfileService;\r\n","/**\r\n * System-wide Action Creator definitions\r\n */\r\nimport { ActionTypes } from \"./system-action-types\";\r\nimport UserIdentity from \"./../../core/auth/userIdentity\";\r\nimport ErrorService from \"./../../core/error/errorService\";\r\nimport ProfileService from \"./../../services/profile-service\";\r\n\r\n// =================\r\n// Notifications\r\n// =================\r\nexport function addNotification(message, level) {\r\n return {\r\n type: ActionTypes.SYS_ADD_NOTIFICATION,\r\n message,\r\n level,\r\n };\r\n}\r\n\r\n/*\r\n error - Error object from the api response\r\n defaultErrorMessage - fallback error message (defined by the user)\r\n*/\r\nexport function addErrorNotification(error, defaultErrorMessage) {\r\n let errorMessage =\r\n error &&\r\n error.response &&\r\n error.response.status &&\r\n error.response.status === 500\r\n ? error.response.data.Message\r\n : defaultErrorMessage;\r\n\r\n return {\r\n type: ActionTypes.SYS_ADD_ERROR_NOTIFICATION,\r\n message: errorMessage,\r\n level: \"error\",\r\n };\r\n}\r\n\r\n// ==================\r\n// Handle Error\r\n// ==================\r\nexport const handleError = (error) => {\r\n return (dispatch) => {\r\n const errorService = ErrorService();\r\n //dispatch(resetPasswordRequest());\r\n errorService\r\n .resolveError(error)\r\n .then((resp) => {\r\n dispatch(showErrorForm(resp));\r\n })\r\n .catch((err) => {\r\n dispatch(hideErrorForm());\r\n });\r\n };\r\n};\r\n\r\nconst showErrorForm = (data) => ({\r\n type: ActionTypes.SYS_HANDLE_ERROR_SHOW_FORM,\r\n payload: {\r\n message: data.message,\r\n error: data.error,\r\n isModelState: data.isModelState,\r\n status: data.status,\r\n },\r\n});\r\n\r\nexport const hideErrorForm = () => ({\r\n type: ActionTypes.SYS_HANDLE_ERROR_HIDE_FORM,\r\n});\r\n\r\n// ==================\r\n// Profile\r\n// ==================\r\nexport const getProfile = () => (dispatch) => {\r\n const service = ProfileService();\r\n const userIdent = UserIdentity();\r\n\r\n if (userIdent.isAuthenticated()) {\r\n dispatch(getProfileRequest());\r\n service\r\n .getProfile(userIdent.getUserId())\r\n .then(({ data }) => {\r\n dispatch(getProfileSuccess(data));\r\n })\r\n .catch((err) => {\r\n dispatch(getProfileFailure(err));\r\n });\r\n }\r\n};\r\n\r\nexport const setProfile = (data) => {\r\n return (dispatch) => {\r\n dispatch(getProfileSuccess(data));\r\n };\r\n};\r\n\r\nconst getProfileRequest = () => ({\r\n type: ActionTypes.SYS_GET_PROFILE_REQUEST,\r\n});\r\n\r\nconst getProfileSuccess = (data) => ({\r\n type: ActionTypes.SYS_GET_PROFILE_SUCCESS,\r\n payload: data,\r\n});\r\n\r\nexport const updateUserProfile = (payload) => ({\r\n type: ActionTypes.SYS_UPDATE_PROFILE,\r\n payload,\r\n});\r\n\r\nconst getProfileFailure = (error) => ({\r\n type: ActionTypes.SYS_GET_PROFILE_FAILURE,\r\n payload: {\r\n error,\r\n },\r\n});\r\n\r\nexport const hideSplash = () => ({\r\n type: ActionTypes.SYS_HIDE_SPLASH,\r\n});\r\n\r\nexport const toggleLogOut = () => ({\r\n type: ActionTypes.SYS_TOGGLE_LOG_OUT,\r\n});\r\n","const historyObject = require(\"history\").createBrowserHistory;\r\n\r\nexport default historyObject;\r\n","/**\r\n * HttpInterceptor abstraction\r\n * To encapsulate http provider details like FETCH Api or Axios.\r\n *\r\n * Provider: Axios\r\n * - rcnet @solvable\r\n */\r\n\r\nimport axios from \"axios\";\r\nimport Auth from \"../auth/auth\";\r\nimport historyObject from \"../history/historyObject\";\r\nimport Config from \"./../../config\";\r\n\r\nconst AUTH_LOGIN_URL = \"/login\";\r\nconst AUTH_TOKEN_URL = \"/v1/core/auth/token\";\r\nconst MAINTENANCE_PAGE_URL = \"/pages/maintenance\";\r\nconst FORBIDDEN_PAGE_URL = \"/pages/error-403\";\r\n\r\nconst HttpInterceptor = () => {\r\n const api = axios.create({ baseURL: Config.apiUrl });\r\n let authTokenRequestPromise;\r\n\r\n // By default interceptors were enabled, this will impact setAuthToken rendering it no effect at all.\r\n // Todo: Provide a way to enable /disable interceptor specially the auth alteration when setAuthToken method is called.\r\n const interceptorReqAuth = (config) => {\r\n const token = Auth.getToken();\r\n if (token != null) config.headers.Authorization = `Bearer ${token}`;\r\n\r\n return config;\r\n };\r\n\r\n // AuthTokenRequestPromise plays a very important role in this code base, it handles concurrent/parallel requests which puts into queue.\r\n // To prevent multiple refreshtoken\r\n const interceptorRespError = (error) => {\r\n const err = error.response;\r\n\r\n // Check if api server is down\r\n if (error.Error === \"Network Error\" && err === undefined) {\r\n historyObject.push(MAINTENANCE_PAGE_URL);\r\n return Promise.reject(error);\r\n }\r\n\r\n if (err.status === 401 && err.config && !err.config.__isRetryRequest) {\r\n return _getAuthToken()\r\n .then((resp) => {\r\n Auth.setToken(\r\n resp.data.access_token,\r\n resp.data.refresh_token,\r\n resp.data.expires_in\r\n );\r\n err.config.__isRetryRequest = true;\r\n err.config.headers.Authorization = `Bearer ${resp.data.access_token}`;\r\n\r\n return axios(err.config);\r\n })\r\n .catch((e) => {\r\n let ex = e.response;\r\n if (ex.status === 400 && ex.data && ex.data.invalid_refreshtoken) {\r\n Auth.removeToken();\r\n historyObject.push(AUTH_LOGIN_URL);\r\n }\r\n return Promise.reject(e);\r\n });\r\n } else if (err.status === 403) {\r\n historyObject.push(FORBIDDEN_PAGE_URL);\r\n let newErrObj = Object.assign({}, error);\r\n newErrObj.response.data[\"Message\"] = \"Unable to access page.\";\r\n return Promise.reject(newErrObj);\r\n } else {\r\n return Promise.reject(error);\r\n }\r\n };\r\n\r\n const _getAuthToken = () => {\r\n if (!authTokenRequestPromise) {\r\n const refreshTokenPayload = Auth.getRefreshTokenPayload(Config.clientId);\r\n\r\n authTokenRequestPromise = api.post(AUTH_TOKEN_URL, refreshTokenPayload);\r\n authTokenRequestPromise\r\n .then(_resetAuthTokenRequestPromise)\r\n .catch(_resetAuthTokenRequestPromise);\r\n }\r\n\r\n return authTokenRequestPromise;\r\n };\r\n\r\n const _resetAuthTokenRequestPromise = () => (authTokenRequestPromise = null);\r\n\r\n return {\r\n interceptorReqAuth,\r\n interceptorRespError,\r\n };\r\n};\r\n\r\nexport default HttpInterceptor;\r\n","/**\r\n * Http abstraction\r\n * To encapsulate http provider details like FETCH Api or Axios.\r\n * Wish we have interface like typescript.\r\n *\r\n * Provider: Axios\r\n * - rcnet @solvable\r\n */\r\n\r\nimport axios from \"axios\";\r\nimport HttpInterceptor from \"./httpInterceptor\";\r\nimport Config from \"./../../config\";\r\n\r\nconst HttpClient = () => {\r\n let api = axios.create({ baseURL: Config.apiUrl });\r\n let interceptor = HttpInterceptor();\r\n\r\n api.interceptors.request.use(interceptor.interceptorReqAuth, error =>\r\n Promise.reject(error)\r\n );\r\n api.interceptors.response.use(undefined, interceptor.interceptorRespError);\r\n\r\n // ===============\r\n // Methods\r\n // ===============\r\n\r\n /**\r\n *\r\n * @param {resourcePathName} Resource path name for example 'user'\r\n * @param {cfg} you can use params - An object parameter { ID: 12345 }\r\n */\r\n const get = (resourcePathName, cfg = null) =>\r\n cfg ? api.get(resourcePathName, cfg) : api.get(resourcePathName);\r\n\r\n const post = (resourcePathName, payload, cfg = null) =>\r\n cfg\r\n ? api.post(resourcePathName, payload, cfg)\r\n : api.post(resourcePathName, payload);\r\n\r\n const del = urlParams => api.delete(urlParams);\r\n\r\n const put = (urlParams, payload, cfg = null) =>\r\n cfg ? api.put(urlParams, payload, cfg) : api.put(urlParams, payload);\r\n\r\n const patch = (resourcePathName, payload) =>\r\n api.patch(resourcePathName, payload);\r\n\r\n // Note: Has an issue with interceptor\r\n const setAuthToken = token => {\r\n api.defaults.headers.common[\"Authorization\"] = token;\r\n return this;\r\n };\r\n\r\n /**\r\n * Either form, json etc.\r\n * @param {type} 'form', 'json'\r\n * Note: if not in the list of types it will apply as custom\r\n */\r\n const setContentType = type => {\r\n // Pre-defined list of content types\r\n let contentType = getContentTypeString(type);\r\n api.defaults.headers.post[\"Content-Type\"] = contentType;\r\n return this;\r\n };\r\n\r\n /**\r\n *\r\n * @param {type} Basic content types are supported as of the moment.\r\n * Try to contribute by adding new types to enhance the library. thanks :P\r\n * types: form, json, pdf, xml, zip, csv, plain, html\r\n */\r\n const getContentTypeString = type => {\r\n let contentType =\r\n type === \"form\"\r\n ? \"application/x-www-form-urlencoded\"\r\n : type === \"json\"\r\n ? \"application/json\"\r\n : type === \"pdf\"\r\n ? \"application/pdf\"\r\n : type === \"xml\"\r\n ? \"application/xml\"\r\n : type === \"zip\"\r\n ? \"application/zip\"\r\n : type === \"csv\"\r\n ? \"text/csv\"\r\n : type === \"plain\"\r\n ? \"text/plain\"\r\n : type === \"html\"\r\n ? \"text/html\"\r\n : type === \"jpg\"\r\n ? \"image/jpeg\"\r\n : type === \"png\"\r\n ? \"image/png\"\r\n : type;\r\n return contentType;\r\n };\r\n\r\n /**\r\n * Will return the specific provider (actual library)\r\n * Note: Avoid using this!\r\n */\r\n const getProvider = () => api;\r\n\r\n return {\r\n get,\r\n post,\r\n put,\r\n delete: del,\r\n patch,\r\n getProvider,\r\n getContentTypeString,\r\n setContentType,\r\n setAuthToken\r\n };\r\n};\r\n\r\nexport default HttpClient;\r\n","/**\r\n * Higher Order component for private route\r\n * Note: This is well integrated with auth security\r\n * - 4.18.2019 rcnet\r\n * - 6.1.2019 rcnet - Added claim authorization hooks\r\n * - 11.29.2019 rcnet - Added Feature Flag checking\r\n */\r\nimport React from \"react\";\r\nimport { Redirect, Route } from \"react-router-dom\";\r\nimport isFunction from \"lodash/isFunction\";\r\nimport isNil from \"lodash/isNil\";\r\nimport Auth from \"./../../../core/auth/auth\";\r\n\r\n/**\r\n * This component will check for any claim based rules attached in the route.\r\n * @param {*} props\r\n */\r\nconst CheckAndRenderAuthenticatedComponent = props => {\r\n let noAccess = false;\r\n if (\r\n !isNil(props.claimsAuthorisationHook) &&\r\n isFunction(props.claimsAuthorisationHook)\r\n ) {\r\n noAccess = !props.claimsAuthorisationHook();\r\n }\r\n\r\n if (noAccess) {\r\n // send to Forbidden page\r\n return (\r\n \r\n );\r\n }\r\n\r\n return {props.children};\r\n};\r\n\r\nconst PrivateRoute = ({\r\n component,\r\n path,\r\n claimsAuthorisationHook,\r\n ...rest\r\n}) => (\r\n \r\n Auth.isAuthenticated() ? (\r\n \r\n {React.createElement(component, props)}\r\n \r\n ) : (\r\n \r\n )\r\n }\r\n />\r\n);\r\n\r\nexport default PrivateRoute;\r\n","const Config = {\r\n appVersion: \"1.0\",\r\n appAuthStorageKey: \"flt-app-auth\",\r\n defaultPageTitle: \"Fast Lane Traffic\",\r\n apiUrl: process.env.REACT_APP_API_URL,\r\n clientId: \"9965c262b3964704b105e29340271603\",\r\n gtmId: process.env.REACT_APP_GTM_ID,\r\n};\r\n\r\nexport default Config;\r\n","import Config from \"../../config\";\r\n\r\n/**\r\n * Authentication library\r\n * Create singleton instance\r\n */\r\n\r\nclass Auth {\r\n constructor() {\r\n this.useLocalStorage = typeof localStorage !== \"undefined\";\r\n this.subscribers = [];\r\n this.load();\r\n }\r\n\r\n load() {\r\n if (this.useLocalStorage) {\r\n let tokenObject = localStorage.getItem(Config.appAuthStorageKey);\r\n if (!tokenObject) return;\r\n\r\n let tokenObjectParsed = JSON.parse(tokenObject);\r\n this._populateModel(\r\n tokenObjectParsed.token,\r\n tokenObjectParsed.refreshToken,\r\n tokenObjectParsed.expiresIn\r\n );\r\n }\r\n }\r\n\r\n isAuthenticated() {\r\n // Check storage if token still in the local store\r\n if (this.useLocalStorage) {\r\n let tokenObject = localStorage.getItem(Config.appAuthStorageKey);\r\n if (!tokenObject) {\r\n // Reset token variable if token in local store is manually removed\r\n this._populateModel(null, null, null);\r\n return;\r\n }\r\n }\r\n return !!this.token;\r\n }\r\n\r\n setToken(token, refreshToken, expiresIn) {\r\n this._populateModel(token, refreshToken, expiresIn);\r\n\r\n if (this.useLocalStorage) {\r\n localStorage.setItem(\r\n Config.appAuthStorageKey,\r\n JSON.stringify({ token, refreshToken, expiresIn })\r\n );\r\n }\r\n }\r\n\r\n removeToken() {\r\n this._populateModel(null, null, null);\r\n\r\n if (this.useLocalStorage) {\r\n localStorage.removeItem(Config.appAuthStorageKey);\r\n }\r\n }\r\n\r\n getToken() {\r\n const tokenObj = this._fetchFullTokenObject();\r\n if (!tokenObj) return tokenObj;\r\n\r\n return tokenObj.token;\r\n }\r\n\r\n getRefreshToken() {\r\n const tokenObj = this._fetchFullTokenObject();\r\n if (!tokenObj) return tokenObj;\r\n\r\n return tokenObj.refreshToken;\r\n }\r\n\r\n subscribe(cb) {\r\n this.subscribers.push(cb);\r\n }\r\n\r\n notifySubscribers() {\r\n this.subscribers.forEach((cb) => cb(this.isAuthenticated()));\r\n }\r\n\r\n // Refresh token payload builder\r\n getRefreshTokenPayload(clientId) {\r\n const refreshTokenPayload = {\r\n ClientId: clientId,\r\n GrantType: \"refresh_token\",\r\n RefreshToken: this.getRefreshToken(),\r\n };\r\n\r\n return refreshTokenPayload;\r\n }\r\n\r\n _fetchFullTokenObject() {\r\n if (!this.useLocalStorage) return;\r\n\r\n let tokenObject = localStorage.getItem(Config.appAuthStorageKey);\r\n if (!tokenObject) {\r\n // Reset token variable if token in local store is manually removed\r\n this._populateModel(null, null, null);\r\n return;\r\n }\r\n\r\n return JSON.parse(tokenObject);\r\n }\r\n\r\n _populateModel(token, refresh, expiresIn) {\r\n this.token = token;\r\n this.refreshToken = refresh;\r\n this.expiresIn = expiresIn;\r\n }\r\n}\r\n\r\nexport default Auth = new Auth();\r\n","import { Component } from \"react\";\r\nimport { withRouter } from \"react-router\";\r\n\r\nclass ScrollToTop extends Component {\r\n componentDidUpdate(prevProps) {\r\n if (this.props.location.pathname !== prevProps.location.pathname) {\r\n window.scrollTo(0, 0);\r\n }\r\n }\r\n\r\n render() {\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport default withRouter(ScrollToTop);\r\n","/**\r\n * Toast Notification\r\n * Refer to: https://www.npmjs.com/package/react-notification-system#action\r\n */\r\nimport React, { Component } from \"react\";\r\nimport NotificationSystem from \"react-notification-system\";\r\n\r\nclass ToastNotification extends Component {\r\n // Override default style\r\n style = {\r\n NotificationItem: {\r\n // Override the notification item\r\n DefaultStyle: {\r\n // Applied to every notification, regardless of the notification level\r\n margin: \"10px 5px 2px 1px\",\r\n padding: \"15px\",\r\n borderRadius: \"4px\",\r\n fontSize: \"1em\",\r\n color: \"white\",\r\n backgroundColor: \"#313131\",\r\n width: \"500px\",\r\n maxWidth: \"100%\",\r\n },\r\n success: {\r\n // Applied only to the success notification item\r\n borderTop: \"4px solid #04D9B2\",\r\n //fontWeight: 'bolder',\r\n },\r\n error: {\r\n // Applied only to the error notification item\r\n borderTop: \"4px solid red\",\r\n //fontWeight: 'bolder',\r\n },\r\n },\r\n Dismiss: {\r\n success: {\r\n color: \"white\",\r\n backgroundColor: \"#313131\",\r\n },\r\n },\r\n };\r\n\r\n componentDidMount() {\r\n this.notificationSystem = this.refs.notificationSystem;\r\n }\r\n\r\n componentWillReceiveProps(newProps) {\r\n const { message, level } = newProps.notification;\r\n this.notificationSystem.addNotification({\r\n message,\r\n level,\r\n position: \"tr\",\r\n });\r\n }\r\n\r\n render() {\r\n return ;\r\n }\r\n}\r\n\r\nexport default ToastNotification;\r\n","import { ActionTypes } from \"./system-action-types\";\r\n\r\nconst initialState = {\r\n message: \"\",\r\n level: \"success\",\r\n position: \"br\",\r\n};\r\n\r\nexport default function NotificationReducer(state = initialState, action) {\r\n switch (action.type) {\r\n case ActionTypes.SYS_ADD_NOTIFICATION:\r\n case ActionTypes.SYS_ADD_ERROR_NOTIFICATION:\r\n return Object.assign({}, state, {\r\n message: action.message,\r\n level: action.level ? action.level : initialState.level,\r\n });\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/**\r\n * Selectors\r\n */\r\n\r\nexport const selectNotificationData = (state) => state.system.notification;\r\n","import { connect } from \"react-redux\";\r\nimport { bindActionCreators } from \"redux\";\r\nimport ToastNotification from \"./toast-notification\";\r\nimport { addNotification } from \"./../../../redux/system/system-action-creators\";\r\nimport { selectNotificationData } from \"./../../../redux/system/notification-reducer\";\r\n\r\nfunction mapStateToProps(state) {\r\n const notification = selectNotificationData(state);\r\n return {\r\n notification: notification\r\n };\r\n}\r\n\r\nfunction mapDispatchToProps(dispatch) {\r\n return {\r\n actions: bindActionCreators(\r\n {\r\n addNotification\r\n },\r\n dispatch\r\n )\r\n };\r\n}\r\n\r\nconst ToastNotificationContainer = connect(\r\n mapStateToProps,\r\n mapDispatchToProps\r\n)(ToastNotification);\r\n\r\nexport default ToastNotificationContainer;\r\n","import loadable from \"@loadable/component\";\r\n\r\nconst FullLayout = loadable(() => import(\"./../layouts/fullLayout\"));\r\nconst BlankLayout = loadable(() => import(\"./../layouts/blankLayout\"));\r\n\r\nvar indexRoutes = [\r\n { path: \"/pages\", name: \"System Misc. Pages\", component: BlankLayout },\r\n { path: \"/\", name: \"Home\", component: FullLayout },\r\n];\r\n\r\nexport default indexRoutes;\r\n","import React from \"react\";\r\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\r\nimport ScrollToTop from \"./components/common/scroll-to-top\";\r\nimport ToastNotificationContainer from \"./components/common/toast/toast-container\";\r\nimport indexRoutes from \"./routes\";\r\nimport PrivateRoute from \"./components/common/private-route\";\r\nimport \"./App.scss\";\r\nimport \"./custom.scss\";\r\n\r\nconst App = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n
\r\n {indexRoutes.map((prop, key) => {\r\n if (prop.privateRoute) {\r\n return (\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n })}\r\n \r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default App;\r\n","import { ActionTypes } from './system-action-types';\r\n\r\nconst initialState = {\r\n title: '',\r\n message: '',\r\n lastErrorOccured: null,\r\n isModalOpen: false,\r\n isModelStateError: false,\r\n status: null\r\n};\r\n\r\nexport default function ErrorNotificationReducer(state = initialState, action) {\r\n switch (action.type) {\r\n case ActionTypes.SYS_HANDLE_ERROR_SHOW_FORM:\r\n return {\r\n ...state,\r\n title: 'Application Error',\r\n message: action.payload.message,\r\n lastErrorOccured: action.payload.error,\r\n isModelStateError: action.payload.isModelState,\r\n isModalOpen: true,\r\n status: action.payload.status,\r\n };\r\n\r\n case ActionTypes.SYS_HANDLE_ERROR_HIDE_FORM: \r\n return {\r\n ...state,\r\n isModalOpen: false,\r\n };\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n/**\r\n * Selectors\r\n */\r\n\r\nexport const selectErrorNotification = state => state.system.errorNotification;","import { ActionTypes } from \"./system-action-types\";\r\nimport isNil from \"lodash/isNil\";\r\n\r\nconst initialState = {\r\n id: \"\",\r\n email: \"\",\r\n firstName: \"\",\r\n lastName: \"\",\r\n mobile: \"\",\r\n memberType: \"\",\r\n isFetching: false,\r\n isLoggingOut: false,\r\n};\r\n\r\nexport default function UserProfileReducer(state = initialState, action) {\r\n switch (action.type) {\r\n case ActionTypes.SYS_GET_PROFILE_REQUEST:\r\n return {\r\n ...state,\r\n isFetching: true,\r\n };\r\n\r\n case ActionTypes.SYS_GET_PROFILE_SUCCESS:\r\n return {\r\n ...state,\r\n id: action.payload.id,\r\n email: action.payload.email,\r\n mobile: action.payload.mobile,\r\n firstName: action.payload.firstName,\r\n lastName: action.payload.lastName,\r\n memberType: action.payload.memberType,\r\n isFetching: false,\r\n };\r\n\r\n case ActionTypes.SYS_GET_PROFILE_FAILURE:\r\n return {\r\n ...state,\r\n error: action.payload,\r\n isFetching: false,\r\n };\r\n\r\n case ActionTypes.SYS_HIDE_SPLASH:\r\n return {\r\n ...state,\r\n };\r\n\r\n case ActionTypes.SYS_TOGGLE_LOG_OUT:\r\n return {\r\n ...state,\r\n isLoggingOut: !state.isLoggingOut,\r\n };\r\n\r\n case ActionTypes.SYS_UPDATE_PROFILE:\r\n return {\r\n ...state,\r\n email: action.payload.email,\r\n mobile: action.payload.mobile,\r\n firstName: action.payload.firstName,\r\n lastName: action.payload.lastName,\r\n };\r\n\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nconst sanitiseValue = (value) => {\r\n if (typeof value === \"boolean\") {\r\n return isNil(value) ? false : value;\r\n }\r\n\r\n return isNil(value) ? \"\" : value;\r\n};\r\n\r\n/**\r\n * Selectors\r\n */\r\n\r\nexport const selectProfileData = (state) => state.system.userProfile;\r\n","import { ActionTypes } from \"./action-types\";\r\n\r\nconst initialState = {\r\n data: [],\r\n isLoadingNews: false,\r\n};\r\n\r\nexport default function PublicNewsReducer(state = initialState, action) {\r\n switch (action.type) {\r\n case ActionTypes.PUBLIC_NEWS_LOAD_REQUEST:\r\n return {\r\n ...state,\r\n isLoadingNews: true,\r\n };\r\n case ActionTypes.PUBLIC_NEWS_LOAD_SUCCESS:\r\n return {\r\n ...state,\r\n isLoadingNews: false,\r\n data: action.payload,\r\n };\r\n case ActionTypes.PUBLIC_NEWS_LOAD_FAILURE:\r\n return {\r\n ...state,\r\n isLoadingNews: false,\r\n };\r\n default:\r\n return state;\r\n }\r\n}\r\n","/**\r\n * System Reducers\r\n */\r\nimport { combineReducers } from \"redux\";\r\nimport NotificationReducer from \"./notification-reducer\";\r\nimport ErrorNotificationReducer from \"./error-notification-reducer\";\r\nimport UserProfileReducer from \"./user-profile-reducer\";\r\nimport PublicNewsReducer from \"./public-news/reducer\";\r\n\r\n/**\r\n * System functionalities\r\n */\r\nconst SystemReducer = combineReducers({\r\n notification: NotificationReducer,\r\n errorNotification: ErrorNotificationReducer,\r\n userProfile: UserProfileReducer,\r\n publicNews: PublicNewsReducer,\r\n});\r\n\r\nexport default SystemReducer;\r\n","import ActionTypes from \"./action-types\";\r\n\r\nconst initialState = {\r\n isLoading: false,\r\n isSuccessful: false,\r\n isQuoteSubmitting: false,\r\n isQuoteSubmissionSuccessful: false,\r\n};\r\n\r\nexport default function ContactUsReducer(state = initialState, action) {\r\n switch (action.type) {\r\n case ActionTypes.CONTACT_US_REQUEST:\r\n return {\r\n ...state,\r\n isLoading: true,\r\n };\r\n case ActionTypes.CONTACT_US_QUOTE_REQUEST:\r\n return {\r\n ...state,\r\n isQuoteSubmitting: true,\r\n };\r\n case ActionTypes.CONTACT_US_SUCCESS:\r\n return {\r\n ...state,\r\n isLoading: false,\r\n isSuccessful: true,\r\n };\r\n case ActionTypes.CONTACT_US_QUOTE_SUCCESS:\r\n return {\r\n ...state,\r\n isQuoteSubmitting: false,\r\n isQuoteSubmissionSuccessful: true,\r\n };\r\n case ActionTypes.CONTACT_US_FAILURE:\r\n return {\r\n ...state,\r\n isLoading: false,\r\n isSuccessful: false,\r\n };\r\n case ActionTypes.CONTACT_US_QUOTE_FAILURE:\r\n return {\r\n ...state,\r\n isQuoteSubmitting: false,\r\n isQuoteSubmissionSuccessful: false,\r\n };\r\n case ActionTypes.CONTACT_US_CLEAN_UP:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import { combineReducers } from \"redux\";\r\nimport SystemReducer from \"./system/system-reducer\";\r\nimport ContactUsReducer from \"./../views/contact-us/redux/reducer\";\r\n\r\nconst RootReducer = combineReducers({\r\n system: SystemReducer,\r\n contactUs: ContactUsReducer,\r\n});\r\n\r\nexport default RootReducer;\r\n","/**\r\n * Configure additional middleware here\r\n */\r\nimport { createStore, applyMiddleware, compose } from \"redux\";\r\nimport thunk from \"redux-thunk\";\r\nimport RootReducer from \"./root-reducer\";\r\n\r\nconst ConfigureStore = () => {\r\n let middleware = [thunk];\r\n let enhancers = [applyMiddleware(...middleware)];\r\n\r\n if (\r\n process.env.NODE_ENV === \"development\" &&\r\n typeof window === \"object\" &&\r\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\r\n ) {\r\n enhancers.push(\r\n window.__REDUX_DEVTOOLS_EXTENSION__ &&\r\n window.__REDUX_DEVTOOLS_EXTENSION__()\r\n );\r\n }\r\n\r\n return createStore(RootReducer, compose(...enhancers));\r\n\r\n // // Grab the state from a global variable injected into the server-generated HTML\r\n // const preloadedState = window.__PRELOADED_STATE__;\r\n\r\n // // Allow the passed state to be garbage-collected\r\n // delete window.__PRELOADED_STATE__;\r\n\r\n // // Create Redux store with initial state\r\n // const store = createStore(\r\n // RootReducer,\r\n // preloadedState || ,\r\n // compose(...enhancers)\r\n // );\r\n\r\n // // Tell react-snap how to save Redux state\r\n // window.snapSaveState = () => ({\r\n // __PRELOADED_STATE__: store.getState()\r\n // });\r\n\r\n // return store;\r\n};\r\n\r\nexport default ConfigureStore;\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' }\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import \"react-app-polyfill/ie9\";\r\nimport \"react-app-polyfill/stable\";\r\nimport React from \"react\";\r\nimport { hydrate, render } from \"react-dom\";\r\nimport App from \"./App\";\r\nimport { Provider } from \"react-redux\";\r\nimport ConfigureStore from \"./redux/configure-store\";\r\nimport * as serviceWorker from \"./serviceWorker\";\r\nimport { loadableReady } from \"@loadable/component\";\r\n\r\nconst rootElement = document.getElementById(\"root\");\r\nconst store = ConfigureStore();\r\n\r\nif (rootElement.hasChildNodes()) {\r\n const store = ConfigureStore();\r\n loadableReady(() => {\r\n hydrate(\r\n \r\n \r\n ,\r\n rootElement\r\n );\r\n });\r\n} else {\r\n render(\r\n \r\n \r\n ,\r\n rootElement\r\n );\r\n}\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n","const ActionTypes = {\r\n CONTACT_US_REQUEST: \"CONTACT_US_REQUEST\",\r\n CONTACT_US_SUCCESS: \"CONTACT_US_SUCCESS\",\r\n CONTACT_US_FAILURE: \"CONTACT_US_FAILURE\",\r\n\r\n CONTACT_US_QUOTE_REQUEST: \"CONTACT_US_QUOTE_REQUEST\",\r\n CONTACT_US_QUOTE_SUCCESS: \"CONTACT_US_QUOTE_SUCCESS\",\r\n CONTACT_US_QUOTE_FAILURE: \"CONTACT_US_QUOTE_FAILURE\",\r\n\r\n CONTACT_US_CLEAN_UP: \"CONTACT_US_CLEAN_UP\",\r\n};\r\n\r\nexport default ActionTypes;\r\n"],"sourceRoot":""}