{"version":3,"sources":["@core/components/OidcComponent/oidcsettings.js","utility/oAuth.js","assets/images/logo/logo.png","redux/reducers/auth/index.js","redux/reducers/navbar/index.js","redux/reducers/layout/index.js","redux/reducers/rootReducer.js","redux/storeConfig/store.js","utility/context/ThemeColors.js","@core/components/spinner/Fallback-spinner.js","@core/components/ripple-button/index.js","serviceWorker.js","index.js","configs/themeConfig.js"],"names":["IDENTITY_CONFIG","authority","process","client_id","redirect_uri","login","automaticSilentRenew","loadUserInfo","silent_redirect_uri","post_logout_redirect_uri","audience","responseType","response_type","scope","ui_locales","METADATA_OIDC","issuer","jwks_uri","authorization_endpoint","token_endpoint","userinfo_endpoint","end_session_endpoint","check_session_iframe","revocation_endpoint","introspection_endpoint","AuthService","constructor","props","signinRedirectCallback","this","UserManager","then","getUser","async","user","parseJwt","token","base64","split","replace","JSON","parse","window","atob","signinRedirect","localStorage","setItem","location","pathname","signinRedirectPrompt","prompt","navigateToScreen","page","getItem","removeItem","isAuthenticated","oidcStorage","sessionStorage","access_token","signinSilent","catch","err","signinSilentCallback","createSigninRequest","logout","signoutRedirect","id_token_hint","clearStaleState","clear","signoutRedirectCallback","userStore","WebStorageStateStore","store","metadata","Log","logger","console","level","DEBUG","events","addUserLoaded","payloadAction","id","profile","sub","name","role","jwtDecode","email","authorized","company","customer_name","customerId","customer_id","startSilentRenew","stringify","e","log","href","indexOf","addSilentRenewError","addAccessTokenExpired","getToken","json","getRoles","initialState","userData","authReducer","state","arguments","length","undefined","action","type","data","config","storageTokenKeyName","storageRefreshTokenKeyName","obj","suggestions","bookmarks","query","navbarReducer","val","objectToUpdate","find","item","isBookmarked","bookmarkIndex","findIndex","x","push","splice","isRTL","themeConfig","layout","menuCollapsed","initialMenuCollapsed","menu","isCollapsed","menuHidden","isHidden","contentWidth","message","showMsg","pricingDashboardState","layoutReducer","value","index","productId","newVal","rootReducer","combineReducers","auth","navbar","middleware","thunk","createDebounce","composeEnhancers","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","applyMiddleware","ThemeColors","createContext","ThemeContext","_ref","children","colors","setColors","useState","useEffect","getHex","color","getComputedStyle","document","body","getPropertyValue","trim","primary","light","concat","main","secondary","success","danger","warning","info","dark","_jsx","Provider","SpinnerComponent","_jsxs","className","src","logo","alt","Button","Ripple","onClick","rest","mounted","setMounted","isRippling","setIsRippling","coords","setCoords","y","setTimeout","classnames","rect","target","getBoundingClientRect","clientX","left","clientY","top","style","Boolean","hostname","match","LazyApp","lazy","axios","interceptors","response","use","error","status","Promise","reject","AuthMng","isJwtExpired","ReactDOM","render","Suspense","fallback","Spinner","ToastContainer","newestOnTop","getElementById","navigator","serviceWorker","ready","registration","unregister","app","appName","appLogoImage","require","default","skin","routerTransition","backgroundColor","footer","customizer","scrollTop"],"mappings":"mSAAO,MAAMA,EAAkB,CAC7BC,UAAWC,qCACXC,UAAWD,qBACXE,aAAcF,0DACdG,MAAO,qCACPC,sBAAsB,EACtBC,cAAc,EACdC,oBAAqBN,0DACrBO,yBAA0BP,6DAC1BQ,SAAUR,+CACVS,aAAc,iBACdC,cAAe,iBACfC,MAAOX,2IACPY,WAAY,SAGDC,EAAgB,CAC3BC,OAAQd,qCACRe,SAAU,sDACVC,uBAAwB,uDACxBC,eAAgB,mDAChBC,kBAAmB,sDACnBC,qBAAsB,wDACtBC,qBAAsB,0DACtBC,oBAAqB,wDACrBC,uBAAwB,yD,YCrBX,MAAMC,EAGnBC,YAAYC,GAAQ,KA0CpBC,uBAAyB,KACvBC,KAAKC,YAAYF,yBAAyBG,MAAK,QAAS,EACzD,KAEDC,QAAUC,UACR,MAAMC,QAAaL,KAAKC,YAAYE,UACpC,OAAKE,SAEUL,KAAKC,YAAYF,wBAErB,EACZ,KAEDO,SAAYC,IACV,MACMC,EADYD,EAAME,MAAM,KAAK,GACVC,QAAQ,IAAK,KAAKA,QAAQ,IAAK,KACxD,OAAOC,KAAKC,MAAMC,OAAOC,KAAKN,GAAQ,EACvC,KAEDO,eAAiB,KACfC,aAAa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E,SAC9ByB,eAAC3B,IAAY,CAAAE,SAAA,CACXsB,cAACgC,EAAO,IACRhC,cAACiD,IAAc,CAACC,aAAW,WAIjChE,SAASiE,eAAe,SDgDpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMpN,MAAKqN,IACjCA,EAAaC,YAAY,G,iCE1H/B,MAAM/G,EAAc,CAClBgH,IAAK,CACHC,QAAS,6BACTC,aAAcC,EAAQ,IAAoCC,SAE5DnH,OAAQ,CACNF,OAAO,EACPsH,KAAM,QACNC,iBAAkB,SAClB3I,KAAM,WACN6B,aAAc,OACdJ,KAAM,CACJG,UAAU,EACVF,aAAa,GAEfe,OAAQ,CAENzC,KAAM,WACN4I,gBAAiB,SAEnBC,OAAQ,CACN7I,KAAM,UAER8I,YAAY,EACZC,WAAW,IAIA1H,K","file":"static/js/main.dc6197d5.chunk.js","sourcesContent":["export const IDENTITY_CONFIG = {\r\n authority: process.env.REACT_APP_AUTH_URL, // (string): The URL of the OIDC provider.\r\n client_id: process.env.REACT_APP_IDENTITY_CLIENT_ID, // (string): Your client application's identifier as registered with the OIDC provider.\r\n redirect_uri: process.env.REACT_APP_REDIRECT_URL, // The URI of your client application to receive a response from the OIDC provider.\r\n login: `${process.env.REACT_APP_ISSUER_URL}`, // see if this needs to be changed\r\n automaticSilentRenew: true, // (boolean, default: false): Flag to indicate if there should be an automatic attempt to renew the access token prior to its expiration.\r\n loadUserInfo: true, // (boolean, default: true): Flag to control if additional identity data is loaded from the user info endpoint in order to populate the user's profile.\r\n silent_redirect_uri: process.env.REACT_APP_SILENT_RENEW_URI, // (string): The URL for the page containing the code handling the silent renew.\r\n post_logout_redirect_uri: process.env.REACT_APP_LOGOFF_REDIRECT_URL, // (string): The OIDC post-logout redirect URI.\r\n audience: process.env.REACT_APP_AUDIENCE, // process.env.REACT_APP_AUDIENCE, // is there a way to specific the audience when making the jwt\r\n responseType: 'id_token token', // (string, default: 'id_token'): The type of response desired from the OIDC provider.\r\n response_type: 'id_token token', // (string, default: 'id_token'): The type of response desired from the OIDC provider.\r\n scope: process.env.REACT_APP_SCOPE, // (string, default: 'openid'): The scope being requested from the OIDC provider.\r\n ui_locales: 'en-US'\r\n}\r\n\r\nexport const METADATA_OIDC = {\r\n issuer: process.env.REACT_APP_ISSUER_URL,\r\n jwks_uri: `${process.env.REACT_APP_ISSUER_URL}/.well-known/jwks`,\r\n authorization_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/authorize`,\r\n token_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/token`,\r\n userinfo_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/userinfo`,\r\n end_session_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/endsession`,\r\n check_session_iframe: `${process.env.REACT_APP_ISSUER_URL}/connect/checksession`,\r\n revocation_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/revocation`,\r\n introspection_endpoint: `${process.env.REACT_APP_ISSUER_URL}/connect/introspect`\r\n // ui_locales: \"nl-NL\"\r\n}\r\n","import { UserManager, WebStorageStateStore, Log } from 'oidc-client'\r\nimport { IDENTITY_CONFIG, METADATA_OIDC } from '../@core/components/OidcComponent/oidcsettings'\r\nimport jwtDecode from 'jwt-decode'\r\n\r\nexport default class AuthService {\r\n UserManager\r\n\r\n constructor(props) {\r\n this.UserManager = new UserManager({\r\n ...IDENTITY_CONFIG,\r\n userStore: new WebStorageStateStore({ store: window.sessionStorage }),\r\n metadata: {\r\n ...METADATA_OIDC\r\n }\r\n })\r\n // Logger\r\n Log.logger = console\r\n Log.level = Log.DEBUG\r\n // eslint-disable-next-line no-unused-vars\r\n this.UserManager.events.addUserLoaded((user) => {\r\n const payloadAction = {\r\n id: user.profile.sub,\r\n name: user.profile.name,\r\n role: jwtDecode(user.access_token).role ? jwtDecode(user.access_token).role : [],\r\n email: user.profile.email,\r\n authorized: true,\r\n token: user.access_token,\r\n company: user.profile.customer_name,\r\n customerId: jwtDecode(user.access_token).customer_id\r\n }\r\n try {\r\n this.UserManager.startSilentRenew()\r\n localStorage.setItem('user', JSON.stringify(payloadAction))\r\n } catch (e) {\r\n console.log(e)\r\n }\r\n if (window.location.href.indexOf('signin-oidc') !== -1) {\r\n this.navigateToScreen()\r\n }\r\n })\r\n this.UserManager.events.addSilentRenewError((e) => {\r\n console.log(e)\r\n })\r\n\r\n this.UserManager.events.addAccessTokenExpired(() => {\r\n this.signinSilent()\r\n })\r\n }\r\n\r\n signinRedirectCallback = () => {\r\n this.UserManager.signinRedirectCallback().then(() => {})\r\n }\r\n\r\n getUser = async () => {\r\n const user = await this.UserManager.getUser()\r\n if (!user) {\r\n // eslint-disable-next-line no-return-await\r\n return await this.UserManager.signinRedirectCallback()\r\n }\r\n return user\r\n }\r\n\r\n parseJwt = (token) => {\r\n const base64Url = token.split('.')[1]\r\n const base64 = base64Url.replace('-', '+').replace('_', '/')\r\n return JSON.parse(window.atob(base64))\r\n }\r\n\r\n signinRedirect = () => {\r\n localStorage.setItem('redirectUri', window.location.pathname)\r\n this.UserManager.signinRedirect({})\r\n }\r\n\r\n signinRedirectPrompt = () => {\r\n localStorage.setItem('redirectUri', window.location.pathname)\r\n this.UserManager.signinRedirect({prompt: 'login'})\r\n }\r\n\r\n navigateToScreen = () => {\r\n const page = localStorage.getItem('lastSeenPage')\r\n if (page && page !== '') {\r\n window.location.replace(page)\r\n localStorage.removeItem('lastSeenPage')\r\n } else {\r\n window.location.replace(`${process.env.REACT_APP_REDIRECT_PATH}`)\r\n }\r\n }\r\n\r\n isAuthenticated = () => {\r\n const oidcStorage = JSON.parse(\r\n sessionStorage.getItem(\r\n `oidc.user:${process.env.REACT_APP_AUTH_URL}:${process.env.REACT_APP_IDENTITY_CLIENT_ID}`\r\n )\r\n )\r\n\r\n return !!oidcStorage && !!oidcStorage.access_token\r\n }\r\n\r\n signinSilent = () => {\r\n this.UserManager.signinSilent()\r\n .then((user) => {})\r\n .catch((err) => {})\r\n }\r\n\r\n signinSilentCallback = () => {\r\n this.UserManager.signinSilentCallback()\r\n }\r\n\r\n createSigninRequest = () => {\r\n return this.UserManager.createSigninRequest()\r\n }\r\n\r\n logout = () => {\r\n this.UserManager.signoutRedirect({\r\n id_token_hint: localStorage.getItem('id_token')\r\n })\r\n this.UserManager.clearStaleState()\r\n localStorage.clear()\r\n }\r\n\r\n signoutRedirectCallback = () => {\r\n localStorage.clear()\r\n this.UserManager.clearStaleState()\r\n this.UserManager.signoutRedirectCallback().then(() => {\r\n window.location.replace(`${process.env.REACT_APP_ORIGIN}`)\r\n })\r\n }\r\n}\r\n\r\nexport const getToken = () => {\r\n try {\r\n const json = JSON.parse(localStorage.getItem('user'))\r\n if (json) return json.token\r\n } catch (e) {\r\n return ''\r\n }\r\n return ''\r\n}\r\n\r\nexport const getRoles = () => {\r\n try {\r\n const json = JSON.parse(localStorage.getItem('user'))\r\n if (json) return json.role\r\n } catch (e) {\r\n return []\r\n }\r\n return []\r\n}\r\n\r\nexport const getUser = () => {\r\n try {\r\n const json = JSON.parse(localStorage.getItem('user'))\r\n if (json) return json\r\n } catch (e) {\r\n return null\r\n }\r\n return null\r\n}\r\n\r\nexport const isAuthorized = () => {\r\n try {\r\n const json = JSON.parse(localStorage.getItem('user'))\r\n if (json) return json.authorized\r\n } catch (e) {\r\n return false\r\n }\r\n return false\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAAAjCAYAAAD/nmRNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA/ppVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZj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gPAe0CjMzrj7gq4r7zlINM5V9HoVe5JeGqbKn8GvYAkXz65sBBR87UQz7u5wv4m5XdK2w5DJ9Xjm33SkT9o5lPrO3OV5i1l/eV8GvlJ/0lIAeZizNTPEYp9fwrRcVTF21D/B9SGRDvuokTSonzWlpdT5a2dY3nfbDyQ0JrnAx6u1GrJ3x5/o4k2c5SblKg8f6vSyoj/BVUTPKFMiN6uFTAaJfIoX0Iudj4KMsMhjcz7EpcUUN4OytQMatoPOthV5TrCXjIwiPmohjZj38vIH8N4M7Utc2FczTDsIp5zNwyz06cP5sMBZAF0KShtD9mHk0HV0rCZNTT6y2iHg9Lm6hinONq0vorNzAHVPx50NoNn6oFt/wLFt65KNv6/AgwAebLeGmlvQvEAAAAASUVORK5CYII=\"","// ** Initial State\r\nconst initialState = {\r\n userData: {}\r\n}\r\n\r\nconst authReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case 'LOGIN':\r\n return {\r\n ...state,\r\n userData: action.data,\r\n [action.config.storageTokenKeyName]: action[action.config.storageTokenKeyName],\r\n [action.config.storageRefreshTokenKeyName]: action[action.config.storageRefreshTokenKeyName]\r\n }\r\n case 'LOGOUT':\r\n const obj = { ...action }\r\n delete obj.type\r\n return { ...state, userData: {}, ...obj }\r\n default:\r\n return state\r\n }\r\n}\r\n\r\nexport default authReducer\r\n","// ** Initial State\r\nconst initialState = {\r\n suggestions: [],\r\n bookmarks: [],\r\n query: ''\r\n}\r\n\r\nconst navbarReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case 'HANDLE_SEARCH_QUERY':\r\n return { ...state, query: action.val }\r\n case 'GET_BOOKMARKS':\r\n return { ...state, suggestions: action.data, bookmarks: action.bookmarks }\r\n case 'UPDATE_BOOKMARKED':\r\n let objectToUpdate\r\n\r\n // ** find & update object\r\n state.suggestions.find(item => {\r\n if (item.id === action.id) {\r\n item.isBookmarked = !item.isBookmarked\r\n objectToUpdate = item\r\n }\r\n })\r\n\r\n // ** Get index to add or remove bookmark from array\r\n const bookmarkIndex = state.bookmarks.findIndex(x => x.id === action.id)\r\n\r\n if (bookmarkIndex === -1) {\r\n state.bookmarks.push(objectToUpdate)\r\n } else {\r\n state.bookmarks.splice(bookmarkIndex, 1)\r\n }\r\n\r\n return { ...state }\r\n default:\r\n return state\r\n }\r\n}\r\n\r\nexport default navbarReducer\r\n","// ** ThemeConfig Import\r\nimport themeConfig from '@configs/themeConfig'\r\n\r\n// ** Returns Initial Menu Collapsed State\r\nconst initialMenuCollapsed = () => {\r\n const item = window.localStorage.getItem('menuCollapsed')\r\n //** Parse stored json or if none return initialValue\r\n return item ? JSON.parse(item) : themeConfig.layout.menu.isCollapsed\r\n}\r\n\r\n// ** Initial State\r\nconst initialState = {\r\n isRTL: themeConfig.layout.isRTL,\r\n menuCollapsed: initialMenuCollapsed(),\r\n menuHidden: themeConfig.layout.menu.isHidden,\r\n contentWidth: themeConfig.layout.contentWidth,\r\n message: {\r\n showMsg: false,\r\n type: 'success',\r\n message: ''\r\n },\r\n pricingDashboardState: []\r\n}\r\n\r\nconst layoutReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case 'HANDLE_CONTENT_WIDTH':\r\n return { ...state, contentWidth: action.value }\r\n case 'HANDLE_MENU_COLLAPSED':\r\n window.localStorage.setItem('menuCollapsed', action.value)\r\n return { ...state, menuCollapsed: action.value }\r\n case 'HANDLE_MENU_HIDDEN':\r\n return { ...state, menuHidden: action.value }\r\n case 'HANDLE_RTL':\r\n return { ...state, isRTL: action.value }\r\n case 'HANDLE_MESSAGE':\r\n return { ...state, message: action.value }\r\n case 'HANDLE_PRICING_DASHBOARD_STATE':\r\n const index = state.pricingDashboardState\r\n .findIndex(item => item.productId === action.value.productId)\r\n if (index !== -1) {\r\n const newVal = [...state.pricingDashboardState]\r\n newVal[index] = action.value\r\n return { ...state, pricingDashboardState: newVal }\r\n } else {\r\n return { ...state, pricingDashboardState: [...state.pricingDashboardState, action.value] }\r\n }\r\n case 'HANDLE_PRICING_DASHBOARD_STATE_REMOVE':\r\n return { ...state, pricingDashboardState: [] }\r\n default:\r\n return state\r\n }\r\n}\r\n\r\nexport default layoutReducer\r\n","// ** Redux Imports\r\nimport { combineReducers } from 'redux'\r\n\r\n// ** Reducers Imports\r\nimport auth from './auth'\r\nimport navbar from './navbar'\r\nimport layout from './layout'\r\n\r\nconst rootReducer = combineReducers({\r\n auth,\r\n navbar,\r\n layout\r\n})\r\n\r\nexport default rootReducer\r\n","// ** Redux, Thunk & Root Reducer Imports\r\nimport thunk from 'redux-thunk'\r\nimport createDebounce from 'redux-debounced'\r\nimport rootReducer from '../reducers/rootReducer'\r\nimport { createStore, applyMiddleware, compose } from 'redux'\r\n\r\n// ** init middleware\r\nconst middleware = [thunk, createDebounce()]\r\n\r\n// ** Dev Tools\r\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose\r\n\r\n// ** Create store\r\nconst store = createStore(rootReducer, {}, composeEnhancers(applyMiddleware(...middleware)))\r\n\r\nexport { store }\r\n","// ** React Imports\r\nimport { useEffect, useState, createContext } from 'react'\r\n\r\n// ** Create Context\r\nconst ThemeColors = createContext()\r\n\r\nconst ThemeContext = ({ children }) => {\r\n // ** State\r\n const [colors, setColors] = useState({})\r\n\r\n //** ComponentDidMount\r\n useEffect(() => {\r\n if (window !== 'undefined') {\r\n //** Get variable value\r\n const getHex = color => window.getComputedStyle(document.body).getPropertyValue(color).trim()\r\n\r\n //** Colors obj\r\n const obj = {\r\n primary: {\r\n light: getHex('--primary').concat('1a'),\r\n main: getHex('--primary')\r\n },\r\n secondary: {\r\n light: getHex('--secondary').concat('1a'),\r\n main: getHex('--secondary')\r\n },\r\n success: {\r\n light: getHex('--success').concat('1a'),\r\n main: getHex('--success')\r\n },\r\n danger: {\r\n light: getHex('--danger').concat('1a'),\r\n main: getHex('--danger')\r\n },\r\n warning: {\r\n light: getHex('--warning').concat('1a'),\r\n main: getHex('--warning')\r\n },\r\n info: {\r\n light: getHex('--info').concat('1a'),\r\n main: getHex('--info')\r\n },\r\n dark: {\r\n light: getHex('--dark').concat('1a'),\r\n main: getHex('--dark')\r\n }\r\n }\r\n\r\n setColors({ ...obj })\r\n }\r\n }, [])\r\n\r\n return {children}\r\n}\r\n\r\nexport { ThemeColors, ThemeContext }\r\n","// ** Logo\r\nimport logo from '@src/assets/images/logo/logo.png'\r\n\r\nconst SpinnerComponent = () => {\r\n return (\r\n
\r\n logo\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default SpinnerComponent\r\n","// ** React Imports\r\nimport { useState, useEffect } from 'react'\r\n\r\n// ** Third Party Components\r\nimport { Button } from 'reactstrap'\r\nimport classnames from 'classnames'\r\n\r\n// ** Styles\r\nimport './ripple-button.scss'\r\n\r\nconst RippleButton = ({ className, children, onClick, ...rest }) => {\r\n // ** States\r\n const [mounted, setMounted] = useState(false)\r\n const [isRippling, setIsRippling] = useState(false)\r\n const [coords, setCoords] = useState({ x: -1, y: -1 })\r\n\r\n // ** Toggle mounted on mount & unmount\r\n useEffect(() => {\r\n setMounted(true)\r\n return () => setMounted(false)\r\n }, [])\r\n\r\n // ** Check for coords and set ripple\r\n useEffect(() => {\r\n if (mounted) {\r\n if (coords.x !== -1 && coords.y !== -1) {\r\n setIsRippling(true)\r\n setTimeout(() => setIsRippling(false), 500)\r\n } else {\r\n setIsRippling(false)\r\n }\r\n }\r\n }, [coords])\r\n\r\n // ** Reset Coords on ripple end\r\n useEffect(() => {\r\n if (mounted) {\r\n if (!isRippling) setCoords({ x: -1, y: -1 })\r\n }\r\n }, [isRippling])\r\n\r\n return (\r\n {\r\n const rect = e.target.getBoundingClientRect()\r\n setCoords({ x: e.clientX - rect.left, y: e.clientY - rect.top })\r\n if (onClick) {\r\n onClick(e)\r\n }\r\n }}\r\n {...rest}\r\n >\r\n {children}\r\n {isRippling ? (\r\n \r\n ) : null}\r\n \r\n )\r\n}\r\n\r\n// ** PropTypes\r\nRippleButton.propTypes = {\r\n ...Button.propTypes\r\n}\r\n\r\nButton.Ripple = RippleButton\r\n","/*eslint-disable */\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.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\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 .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 (response.status === 404 || (contentType !== null && contentType.indexOf('javascript') === -1)) {\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('No internet connection found. App is running in offline mode.')\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","// ** React Imports\r\nimport { Suspense, lazy } from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport 'antd/dist/antd.css'\r\n\r\n// ** Redux Imports\r\nimport { Provider } from 'react-redux'\r\nimport { store } from './redux/storeConfig/store'\r\n\r\n// ** Toast & ThemeColors Context\r\nimport { ToastContainer } from 'react-toastify'\r\nimport { ThemeContext } from './utility/context/ThemeColors'\r\n\r\n// ** Spinner (Splash Screen)\r\nimport Spinner from './@core/components/spinner/Fallback-spinner'\r\n\r\n// ** Ripple Button\r\nimport './@core/components/ripple-button'\r\n\r\n// ** PrismJS\r\nimport 'prismjs'\r\nimport 'prismjs/themes/prism-tomorrow.css'\r\nimport 'prismjs/components/prism-jsx.min'\r\n\r\nimport axios from 'axios'\r\n\r\n// ** React Perfect Scrollbar\r\nimport 'react-perfect-scrollbar/dist/css/styles.css'\r\n\r\n// ** React Toastify\r\nimport '@styles/react/libs/toastify/toastify.scss'\r\n\r\n// ** Core styles\r\nimport './@core/assets/fonts/feather/iconfont.css'\r\nimport './@core/scss/core.scss'\r\nimport './assets/scss/style.scss'\r\n\r\n// ** Service Worker\r\nimport * as serviceWorker from './serviceWorker'\r\n\r\n// ** Lazy load app\r\nconst LazyApp = lazy(() => import('./App'))\r\n\r\nimport AuthMng, {getToken} from './utility/oAuth'\r\nimport { isJwtExpired } from 'jwt-check-expiration'\r\n\r\n\r\naxios.interceptors.response.use((response) => {\r\n return response\r\n}, (error) => {\r\n if (error.response.status === 401) {\r\n const auth = new AuthMng()\r\n localStorage.setItem('lastSeenPage', location.href)\r\n if (getToken() === '') {\r\n window.location = `${process.env.REACT_APP_BASENAME}/login`\r\n }\r\n if (isJwtExpired(getToken())) {\r\n window.location = `${process.env.REACT_APP_BASENAME}/login`\r\n } else {\r\n auth.signinRedirectPrompt()\r\n }\r\n } else {\r\n return Promise.reject(error)\r\n }\r\n})\r\n\r\nReactDOM.render(\r\n \r\n }>\r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\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","// You can customize the template with the help of this file\r\n\r\n//Template config options\r\nconst themeConfig = {\r\n app: {\r\n appName: 'actenzo.merchant.dashboard',\r\n appLogoImage: require('@src/assets/images/logo/logo.png').default\r\n },\r\n layout: {\r\n isRTL: false,\r\n skin: 'light', // light, dark, bordered, semi-dark\r\n routerTransition: 'fadeIn', // fadeIn, fadeInLeft, zoomIn, none or check this for more transition https://animate.style/\r\n type: 'vertical', // vertical, horizontal\r\n contentWidth: 'full', // full, boxed\r\n menu: {\r\n isHidden: false,\r\n isCollapsed: false\r\n },\r\n navbar: {\r\n // ? For horizontal menu, navbar type will work for navMenu type\r\n type: 'floating', // static , sticky , floating, hidden\r\n backgroundColor: 'white' // BS color options [primary, success, etc]\r\n },\r\n footer: {\r\n type: 'static' // static, sticky, hidden\r\n },\r\n customizer: false,\r\n scrollTop: true // Enable scroll to top button\r\n }\r\n}\r\n\r\nexport default themeConfig\r\n"],"sourceRoot":""}