{"version":3,"sources":["components/Services/user.service.js","components/Helpers/private-route.js","app.js","index.js","components/Services/authentication.service.js","components/Helpers/role.js"],"names":["userService","getAll","getAllUsernames","getAllUserEmails","getById","getByUsername","getByResetPasswordToken","getBySessionId","register","update","deleteUser","a","fullDomain","window","location","protocol","host","url","users","fetch","method","then","response","json","result","catch","e","console","log","usernames","useremails","id","user","username","token","encodeURIComponent","firstname","lastname","email","password","requesttoviewphotos","requesttoaddphotos","status","headers","body","JSON","stringify","firstName","lastName","role","Role","User","requestToViewPhotos","requestToAddPhotos","oldpassword","oldPassword","OldPassword","PrivateRoute","Component","component","roles","rest","render","props","currentUser","authenticationService","currentUserValue","indexOf","to","pathname","state","from","Loader","React","lazy","Gallery","UploadPhotos","UserLogin","Register","Update","UpdateAdmin","ForgetPassword","UpdateReset","AdminPage","Music","Error500","Error404","Pager","AppList","App","componentWillMount","encryptor","require","localStorage","getItem","login","decrypt","Fragment","Suspense","fallback","exact","path","Admin","UserView","UserAdd","displayName","name","withRouter","baseUrl","document","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","basename","currentUserSubject","BehaviorSubject","parse","logout","logoutLocally","resetPassword","asObservable","value","setItem","encrypt","next","removeItem"],"mappings":"wKAGO,MAAMA,EAAc,CACvBC,O,2CACAC,gB,2CACAC,iB,2CACAC,Q,4CACAC,c,4CACAC,wB,4CACAC,e,4CACAC,S,0DACAC,O,gEACAC,W,yFAGJ,gCAAAC,EAAA,6DACUC,EAAaC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAASE,KAC/DC,EAFV,UAEmBL,EAFnB,iBAGQM,EAAQ,GAHhB,SAIUC,MAAMF,EAAK,CACTG,OAAQ,QAEXC,KAAKC,GAAYA,EAASC,QAC1BF,KAAKG,IACFN,EAAQM,IAEXC,MAAMC,IACHC,QAAQC,IAAIF,KAZxB,gCAcWR,GAdX,4C,kEAkBA,gCAAAP,EAAA,6DACUC,EAAaC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAAS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QC,EADR,yCAGgCqB,KAAKC,UAAUtB,GAH/C,OAGYwC,EAHZ,OAIM6B,aAAa+B,QAAQ,cAAe5D,GACpC6B,aAAa+B,QAAQ,eAAgBjC,EAAUkC,QAAQ5F,IACvD4D,aAAa+B,QAAQ,eAAgBjC,EAAUkC,QAAQtF,IACvD6E,EAAmBU,KAAKtG,GAP9B,QAUEkB,EAASpB,EAASoB,OAVpB,4CANJ,uDAPd,gEA4BQf,QAAQC,IAAR,MA5BR,kBA6Be,KA7Bf,iCAgCWc,GAhCX,2D,+BAmCe8E,I,2EAAf,sBAAA7G,EAAA,sDACIkF,aAAakC,WAAW,eACxBX,EAAmBU,KAAK,MAF5B,4C,kEAKA,8BAAAnH,EAAA,6DACUC,EAAaC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAASE,KAC/DC,EAAML,EAAa,gBAF7B,kBAKcO,MAAMF,EACR,CACIG,OAAQ,OACRuB,QAAS,CAAE,eAAgB,oBAC3BC,KAAMC,KAAKC,UAAU,CAAEb,SAAU,WAAYM,SAAU,WAAYD,MAAO,sBAT1F,uDAYQX,QAAQC,IAAR,MAZR,QAeI4F,IAfJ,0D,kEAkBA,WAA6BlF,GAA7B,iBAAA3B,EAAA,6DACUC,EAAaC,OAAOC,SAASC,SAAW,KAAOF,OAAOC,SAASE,KAC/DC,EAAML,EAAa,uBAF7B,kBAKqBO,MAAMF,EACf,CACIG,OAAQ,OACRuB,QAAS,CAAE,eAAgB,oBAC3BC,KAAMC,KAAKC,UAAU,CAAEb,SAAU,WAAYM,SAAU,WAAYD,MAAOA,MAT1F,wEAYQX,QAAQC,IAAR,MAZR,0D,uDCvEA,kCAAO,MAAMsB,EAAO,CAChBoD,MAAO,QACPnD,KAAM,OACNoD,SAAU,WACVC,QAAS,a","file":"static/js/main.b661e3c7.chunk.js","sourcesContent":["\nimport { Role } from \"../Helpers/role\";\n\nexport const userService = {\n getAll,\n getAllUsernames,\n getAllUserEmails,\n getById,\n getByUsername,\n getByResetPasswordToken,\n getBySessionId,\n register,\n update,\n deleteUser\n};\n\nasync function getAll() {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/getall`;\n var users = [];\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n users = result;\n })\n .catch(e => {\n console.log(e);\n });\n return users;\n\n}\n\nasync function getAllUsernames() {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/getallusernames`;\n var usernames = [];\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n usernames = result;\n })\n .catch(e => {\n console.log(e);\n });\n return usernames;\n}\n\nasync function getAllUserEmails() {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/getallemails`;\n var useremails = [];\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n useremails = result;\n })\n .catch(e => {\n console.log(e);\n });\n return useremails;\n}\n\nasync function getById(id) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/${id}`;\n var user = null;\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n user = result;\n })\n .catch(e => {\n console.log(e);\n });\n return user;\n}\n\nasync function getByUsername(username) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/${username}`;\n var user = null;\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n user = result;\n })\n .catch(e => {\n console.log(e);\n });\n return user;\n}\n\nasync function getByResetPasswordToken(token) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/getbyresetpasswordtoken/?token=${encodeURIComponent(token)}`;\n var user = null;\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n user = result;\n })\n .catch(e => {\n console.log(e);\n });\n return user;\n}\n\nasync function getBySessionId(token) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/getbysessionid/?token=${encodeURIComponent(token)}`;\n var user = null;\n await fetch(url, {\n method: \"GET\"\n })\n .then(response => response.json())\n .then(result => {\n user = result;\n })\n .catch(e => {\n console.log(e);\n });\n return user;\n}\n\nasync function register(firstname, lastname, email, username, password, requesttoviewphotos, requesttoaddphotos, status) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/register`;\n\n return fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({\n firstName: firstname,\n lastName: lastname,\n email: email,\n username: username,\n password: password,\n role: Role.User,\n requestToViewPhotos: requesttoviewphotos,\n requestToAddPhotos: requesttoaddphotos,\n status: status\n })\n });\n\n}\n\nasync function update(id, firstname, lastname, email, username, password, role, requesttoviewphotos, requesttoaddphotos, oldpassword, status) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/update`;\n const user = {\n id: id,\n firstName: firstname,\n lastName: lastname,\n email: email,\n username: username,\n password: password,\n role: role,\n requestToViewPhotos: requesttoviewphotos,\n requestToAddPhotos: requesttoaddphotos,\n status: status\n };\n const oldPassword = oldpassword;\n return fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({ User: user, OldPassword: oldPassword })\n });\n\n}\n\nasync function deleteUser(id) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = `${fullDomain}/users/delete`;\n\n return fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({\n id: id,\n firstName: \"\",\n lastName: \"\",\n email: \"email@email.com\",\n username: \"username\",\n password: \"password\",\n role: Role.User,\n requestToViewPhotos: false,\n requestToAddPhotos: false\n })\n });\n}\n","import React from \"react\";\r\nimport { Route, Redirect } from \"react-router-dom\";\r\n\r\nimport { authenticationService } from \"../Services/authentication.service\";\r\n\r\nexport const PrivateRoute = ({ component: Component, roles, ...rest }) => (\r\n {\r\n const currentUser = authenticationService.currentUserValue;\r\n if (!currentUser) {\r\n // not logged in so redirect to login page with the return url\r\n return ;\r\n }\r\n\r\n // check if route is restricted by role\r\n if (roles && roles.indexOf(currentUser.role) === -1) {\r\n // role not authorised so redirect to home page\r\n return ;\r\n }\r\n\r\n // authorised so return component\r\n return ;\r\n }} />\r\n)","import React, { Component } from \"react\";\r\nimport {\r\n Route,\r\n Switch,\r\n BrowserRouter as Router,\r\n withRouter,\r\n} from \"react-router-dom\";\r\n\r\nimport { authenticationService } from \"./components/Services/authentication.service\";\r\nimport { userService } from \"./components/Services/user.service\";\r\n\r\nimport { Role } from \"./components/Helpers/role\";\r\nimport { PrivateRoute } from \"./components/Helpers/private-route\";\r\n\r\n// Import css\r\nimport \"bootstrap/dist/css/bootstrap.css\";\r\nimport \"./assets/fomantic/dist/semantic.css\";\r\nimport \"./css/pe-icon-7-stroke.css\";\r\nimport \"./css/materialdesignicons.css\";\r\nimport \"./font-awesome/css/font-awesome.css\";\r\nimport \"./css/waves.css\";\r\n//import \"./css/bootstrap.min.css\";\r\nimport \"./css/magnific-popup.css\";\r\nimport \"./css/vertical.css\";\r\n//import \"./css/style-two.css\"\r\nimport \"./css/style-clever.css\";\r\nimport \"./css/red.css\";\r\nimport \"./css/style.css\";\r\n\r\nconst Loader = React.lazy(() => import(\"./components/loader\"));\r\nconst Gallery = React.lazy(() => import(\"./components/Shared/gallery\"));\r\nconst UploadPhotos = React.lazy(() =>\r\n import(\"./components/Shared/upload-photos\")\r\n);\r\n\r\nconst UserLogin = React.lazy(() => import(\"./components/Auth/user-login\"));\r\nconst Register = React.lazy(() => import(\"./components/Auth/register\"));\r\nconst Update = React.lazy(() => import(\"./components/Auth/update\"));\r\nconst UpdateAdmin = React.lazy(() => import(\"./components/Auth/update-admin\"));\r\nconst ForgetPassword = React.lazy(() =>\r\n import(\"./components/Auth/password-forget\")\r\n);\r\nconst UpdateReset = React.lazy(() => import(\"./components/Auth/update-reset\"));\r\n\r\nconst AdminPage = React.lazy(() => import(\"./components/Admin/admin-page\"));\r\n\r\nconst Music = React.lazy(() => import(\"./components/Shared/music\"));\r\n\r\nconst Error500 = React.lazy(() => import(\"./components/Errors/error-500\"));\r\nconst Error404 = React.lazy(() => import(\"./components/Errors/error-404\"));\r\n\r\nconst Pager = React.lazy(() => import(\"./components/Shared/pager\"));\r\n\r\nconst AppList = React.lazy(() => import(\"./app-list\"));\r\n\r\nclass App extends Component {\r\n static displayName = App.name;\r\n\r\n async componentWillMount() {\r\n var key = \"flasdkjfpoijwfeljaskj\";\r\n var encryptor = require(\"simple-encryptor\")(key);\r\n const loggedUser = localStorage.getItem(\"currentUser\");\r\n if (loggedUser) {\r\n await authenticationService.login(\r\n encryptor.decrypt(localStorage.getItem(\"currentUser2\")),\r\n encryptor.decrypt(localStorage.getItem(\"currentUser3\"))\r\n );\r\n }\r\n }\r\n\r\n render() {\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\n \r\n \r\n \r\n \r\n \r\n \r\n \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 withRouter(App);\r\n","import \"bootstrap/dist/css/bootstrap.css\";\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport { BrowserRouter } from \"react-router-dom\";\r\nimport App from \"./app\";\r\n\r\nconst baseUrl = document.getElementsByTagName(\"base\")[0].getAttribute(\"href\");\r\nconst rootElement = document.getElementById(\"root\");\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n rootElement\r\n);\r\n","import { BehaviorSubject } from \"rxjs\";\n\nconst currentUserSubject = new BehaviorSubject(JSON.parse(localStorage.getItem(\"currentUser\")));\n\nexport const authenticationService = {\n login,\n logout,\n logoutLocally,\n resetPassword,\n currentUser: currentUserSubject.asObservable(),\n get currentUserValue() { return currentUserSubject.value }\n};\n\nasync function login(username, password) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = fullDomain + \"/users/authenticate\";\n let status = 0;\n var key = \"flasdkjfpoijwfeljaskj\";\n var encryptor = require('simple-encryptor')(key);\n try {\n await fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({ username: username, password: password, email: \"email@email.com\" })\n })\n .then(async response => {\n const result = await response.json();\n if (result) {\n const currentUser = await JSON.stringify(result);\n localStorage.setItem(\"currentUser\", currentUser);\n localStorage.setItem(\"currentUser2\", encryptor.encrypt(username));\n localStorage.setItem(\"currentUser3\", encryptor.encrypt(password));\n currentUserSubject.next(result);\n \n }\n status = response.status;\n }\n );\n }\n catch (e) {\n console.log(e);\n return 500;\n }\n\n return status;\n}\n\nasync function logoutLocally() {\n localStorage.removeItem(\"currentUser\");\n currentUserSubject.next(null);\n}\n\nasync function logout() {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = fullDomain + \"/users/logout\";\n\n try {\n await fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({ username: \"username\", password: \"password\", email: \"email@email.com\" })\n });\n } catch (e) {\n console.log(e);\n }\n\n logoutLocally();\n}\n\nasync function resetPassword(email) {\n const fullDomain = window.location.protocol + \"//\" + window.location.host;\n const url = fullDomain + \"/users/resetpassword\";\n\n try {\n return await fetch(url,\n {\n method: \"POST\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify({ username: \"username\", password: \"password\", email: email })\n });\n } catch (e) {\n console.log(e);\n }\n}\n","export const Role = {\n Admin: \"Admin\",\n User: \"User\", \n UserView: \"UserView\",\n UserAdd: \"UserAdd\" \n}"],"sourceRoot":""}