{"version":3,"sources":["withAuth.jsx","App.js","config/config.js","polyfill.js","serviceWorker.js","index.js"],"names":["withAuth","ComponentToProtect","state","loading","redirect","fetch","then","res","status","json","result","localStorage","setItem","window","location","host","admin_level","setState","catch","err","this","to","Fragment","props","Component","DefaultLayout","React","lazy","Login","Page404","Page500","App","require","document","title","global","gConfig","page_title","Suspense","fallback","className","exact","path","name","component","_","config","defaultConfig","development","environmentConfig","finalConfig","merge","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","createEvent","initCustomEvent","prototype","Event","Boolean","hostname","match","ReactDOM","render","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"+LAGe,SAASA,EAASC,GAE/B,yDACE,aAAe,IAAD,8BACZ,gBACKC,MAAQ,CACXC,SAAS,EACTC,UAAU,GAJA,EADhB,gEASuB,IAAD,OAClBC,MAAM,eACHC,MAAK,SAAAC,GACJ,OAAmB,MAAfA,EAAIC,OACCD,EAAIE,OAEJ,QAKVH,MAAK,SAAAI,GACAA,GACFC,aAAaC,QAAb,UAAwBC,OAAOC,SAASC,KAAxC,SAAoDL,EAAOM,aAC3D,EAAKC,SAAS,CAAEd,SAAS,KAGzB,EAAKc,SAAS,CAAEd,SAAS,EAAOC,UAAU,OAG7Cc,OAAM,SAAAC,SA7Bb,+BAoCY,IAAD,EACuBC,KAAKlB,MAA3BC,EADD,EACCA,QAASC,EADV,EACUA,SACjB,OAAID,EACK,KAELC,EAEK,kBAAC,IAAD,CAAUiB,GAAG,WAGpB,kBAAC,IAAMC,SAAP,KACE,kBAACrB,EAAuBmB,KAAKG,YA/CrC,GAAqBC,e,mICIjBC,EAAgBC,IAAMC,MAAK,kBAAM,yDAGjCC,EAAQF,IAAMC,MAAK,kBAAM,yDACzBE,EAAUH,IAAMC,MAAK,kBAAM,yDAC3BG,EAAUJ,IAAMC,MAAK,kBAAM,yDAK3BI,GAFSC,EAAQ,K,kLAMrBC,SAASC,MAAQC,EAAOC,QAAQC,a,+BAI9B,OACE,kBAAC,aAAD,KACI,kBAAC,IAAMC,SAAP,CAAgBC,SAvBJ,yBAAKC,UAAU,oCAAf,eAwBV,kBAAC,IAAD,KACE,kBAAC,IAAD,CAAOC,OAAK,EAACC,KAAK,SAASC,KAAK,aAAaC,UAAWhB,IACxD,kBAAC,IAAD,CAAOa,OAAK,EAACC,KAAK,OAAOC,KAAK,WAAWC,UAAWf,IACpD,kBAAC,IAAD,CAAOY,OAAK,EAACC,KAAK,OAAOC,KAAK,WAAWC,UAAWd,IACpD,kBAAC,IAAD,CAAOY,KAAK,IAAIC,KAAK,aAAaC,UAAW5C,YAASyB,Y,GAflDD,cAuBHO,Q,yHC1Cf,YACA,IAAMc,EAAIb,EAAQ,KAGZc,EAASd,EAAQ,KACjBe,EAAgBD,EAAOE,YAEvBC,EAAoBH,EAAM,YAC1BI,EAAcL,EAAEM,MAAMJ,EAAeE,GAE3Cd,EAAOC,QAAUc,I,0XCmBjB,WAEE,GAAmC,oBAAvBrC,OAAOuC,YAA6B,OAAO,EAEvD,SAASA,EAAcC,EAAOC,GAC5BA,EAASA,GAAU,CAAEC,SAAS,EAAOC,YAAY,EAAOC,YAAQC,GAChE,IAAIC,EAAM1B,SAAS2B,YAAa,eAEhC,OADAD,EAAIE,gBAAiBR,EAAOC,EAAOC,QAASD,EAAOE,WAAYF,EAAOG,QAC/DE,EAGTP,EAAYU,UAAYjD,OAAOkD,MAAMD,UAErCjD,OAAOuC,YAAcA,EAbvB,G,wDCnBoBY,QACW,cAA7BnD,OAAOC,SAASmD,UAEe,UAA7BpD,OAAOC,SAASmD,UAEhBpD,OAAOC,SAASmD,SAASC,MACvB,2DCPNC,IAASC,OAAO,kBAACrC,EAAA,EAAD,MAASE,SAASoC,eAAe,SDgH3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMlE,MAAK,SAAAmE,GACjCA,EAAaC,kB","file":"static/js/main.fee65d64.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport { Redirect } from 'react-router-dom';\n\nexport default function withAuth(ComponentToProtect) {\n\t\n return class extends Component {\n constructor() {\n super();\n this.state = {\n loading: true,\n redirect: false,\n };\n }\n\n componentDidMount() {\n fetch('/checkToken')\n .then(res => {\n if (res.status === 200) {\n return res.json();\n } else {\n return null\n //const error = new Error(res.error);\n //throw error;\n }\n })\n .then(result=>{\n if (result){\n localStorage.setItem(`${window.location.host}-role`,result.admin_level);\n this.setState({ loading: false });\n }\n else{\n this.setState({ loading: false, redirect: true });\n }\n })\n .catch(err => {\n //console.error(err);\n \n });\n }\n\n\n render() {\n const { loading, redirect } = this.state;\n if (loading) {\n return null;\n }\n if (redirect) {\n\t\t //alert(\"Session Timeout. Please login again\");\n return ;\n }\n return (\n \n \n \n );\n }\n }\n}","import React, { Component } from 'react';\nimport { HashRouter, Route, Switch } from 'react-router-dom';\n// import { renderRoutes } from 'react-router-config';\nimport './App.scss';\nimport withAuth from './withAuth';\n\nconst loading = () =>
Loading...
;\n\n// Containers\nconst DefaultLayout = React.lazy(() => import('./containers/DefaultLayout'));\n\n// Pages\nconst Login = React.lazy(() => import('./views/Pages/Login'));\nconst Page404 = React.lazy(() => import('./views/Pages/Page404'));\nconst Page500 = React.lazy(() => import('./views/Pages/Page500'));\n\n// eslint-disable-next-line\nconst config = require('./config/config.js');\n\nclass App extends Component {\n\t\n\tcomponentDidMount(){\n\t\t\n\t\tdocument.title = global.gConfig.page_title;\n\t}\n \n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default App;\n","// requires\r\nconst _ = require('lodash');\r\n\r\n// module variables\r\nconst config = require('./config.json');\r\nconst defaultConfig = config.development;\r\nconst environment = 'development';\r\nconst environmentConfig = config[environment];\r\nconst finalConfig = _.merge(defaultConfig, environmentConfig);\r\n\r\nglobal.gConfig = finalConfig;\r\n\r\n","/*\n* required polyfills\n*/\n\n/** IE9, IE10 and IE11 requires all of the following polyfills. **/\n// import 'core-js/es6/symbol'\n// import 'core-js/es6/object'\n// import 'core-js/es6/function'\n// import 'core-js/es6/parse-int'\n// import 'core-js/es6/parse-float'\n// import 'core-js/es6/number'\n// import 'core-js/es6/math'\n// import 'core-js/es6/string'\n// import 'core-js/es6/date'\nimport 'core-js/es6/array'\n// import 'core-js/es6/regexp'\nimport 'core-js/es6/map'\n// import 'core-js/es6/weak-map'\nimport 'core-js/es6/set'\nimport 'core-js/es7/object'\n\n/** IE10 and IE11 requires the following for the Reflect API. */\n// import 'core-js/es6/reflect'\n\n/** Evergreen browsers require these. **/\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\n// import 'core-js/es7/reflect'\n\n// CustomEvent() constructor functionality in IE9, IE10, IE11\n(function () {\n\n if ( typeof window.CustomEvent === \"function\" ) return false\n\n function CustomEvent ( event, params ) {\n params = params || { bubbles: false, cancelable: false, detail: undefined }\n var evt = document.createEvent( 'CustomEvent' )\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail )\n return evt\n }\n\n CustomEvent.prototype = window.Event.prototype\n\n window.CustomEvent = CustomEvent\n})()\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://goo.gl/SC7cgQ'\n );\n });\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n console.log('New content is available; please refresh.');\n\n // Execute callback\n if (config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import 'react-app-polyfill/ie9'; // For IE 9-11 support\nimport 'react-app-polyfill/ie11'; // For IE 11 support\nimport './polyfill'\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}