{"version":3,"sources":["@gull/components/DropDownMenuItem.jsx","@gull/components/DropDownMenu.jsx","@gull/components/RichTextEditor.jsx","@gull/components/Breadcrumb.jsx","@gull/components/CodeViewer.jsx","@gull/components/GullSidenav/GullSidenav.jsx","app/GullLayout/SharedComponents/Customizer.jsx","@utils.js","app/auth/authRoles.js","app/redux/actions/LayoutActions.js","app/services/localStorageService.js","app/redux/actions/UserActions.js","app/appContext.js","app/services/jwtAuthService.js","app/GullLayout/index.js","app/GullLayout/GullLayout.jsx","app/auth/AuthGuard.jsx","app/allRoutes.js","app/RootRoutes.jsx","app/redux/reducers/LoginReducer.js","app/redux/actions/LoginActions.js","app/redux/reducers/UserReducer.js","app/GullLayout/Layout1/Layout1Settings.js","app/GullLayout/settings.js","app/redux/reducers/LayoutReducer.js","app/redux/reducers/RootReducer.js","app/redux/Store.js","app/auth/Auth.jsx","app/App.jsx","serviceWorker.js","index.jsx","@gull/components/GullLoadable/Loading.js","@history.js"],"names":["DropDownMenuItem","state","collapsed","elementRef","React","createRef","componentHeight","onItemClick","setState","node","name","children","child","this","calcaulateHeight","clientHeight","props","item","icon","className","classList","open","onClick","ref","el","style","maxHeight","Component","DropDownMenu","e","preventDefault","renderLevels","items","map","i","sub","key","closeSecSidenav","to","path","menu","RichTextEditor","content","placeholder","handleContentChange","theme","modules","onChange","value","formats","toolbar","font","size","header","script","color","background","align","list","indent","direction","clipboard","matchVisual","Breadcrumb","routeSegments","length","route","index","Customizer","sidebarColors","handleLayoutChange","layoutName","settings","setLayoutSettings","merge","activeLayout","handleCustomizerToggle","customizer","handleDirectionChange","event","dir","document","documentElement","setAttribute","changeSidebarColor","colorClass","layout2Settings","leftSidebar","id","data-perfect-scrollbar","data-suppress-scroll-x","aria-labelledby","data-parent","active","src","alt","c","title","type","checked","connect","PropTypes","func","isRequired","setDefaultSettings","layout","isMobile","window","matchMedia","matches","classes","Object","entries","filter","entry","join","Utils","formatDate","JSDate","setHours","toISOString","replace","addNDays","n","Date","setDate","getDate","trimPtoN","p","slice","authRoles","sa","AqaryOnly","dataEntry","nonDataEntry","all","SET_LAYOUT_SETTINGS","SET_DEFAULT_LAYOUT_SETTINGS","data","dispatch","localStorageService","ls","localStorage","getUserId","getItem","JSON","parse","userId","getLang","res","lang","stringify","setItem","SET_USER_DATA","REMOVE_USER_DATA","USER_LOGGED_OUT","setUserData","user","logoutUser","jwtAuthService","logout","AppContext","createContext","userType","fullName","userName","imageUrl","token","setSessionAndUser","responseData","setSession","accessToken","setUser","location","loginWithToken","Promise","resolve","reject","setTimeout","then","removeUser","axios","defaults","headers","common","removeItem","GullLayouts","layout1","lazy","GullLayout","initAppDirection","prevProps","pathname","Layout","routes","show","contextType","withRouter","defaultSettings","AuthGuard","context","authenticated","flatMap","redirectRoute","nextProps","nextState","history","push","redirectUrl","matched","find","r","auth","includes","Dashboard1","news","newForm","AccountSettings","ProfileSettings","units","unitForm","unitsAddByUserInPeriod","pushNotifications","users","userForm","securedRoutes","component","exact","anonymousRoutes","errorRoute","allRoutes","initialState","success","loading","error","username","password","LoginReducer","action","userReducer","layout1Settings","secondaryNavOpen","searchBox","GullLayoutSettings","footer","LayoutReducer","RootReducer","combineReducers","login","UserReducer","middlewares","thunk","Store","createStore","compose","applyMiddleware","x","Auth","checkJwtAuth","App","Provider","store","fallback","renderRoutes","RootRoutes","Boolean","hostname","match","ReactDOM","render","getElementById","navigator","serviceWorker","ready","registration","unregister","styles","position","left","right","top","margin","height","width","zIndex","Loading","createBrowserHistory"],"mappings":"oSAoEeA,E,4MAhEbC,MAAQ,CACNC,WAAW,G,EAEbC,WAAaC,IAAMC,Y,EAEnBC,gBAAkB,E,EAqBlBC,YAAc,WACZ,EAAKC,SAAS,CAAEN,WAAY,EAAKD,MAAMC,a,sDArBzC,SAAiBO,GACf,GAAkB,UAAdA,EAAKC,KAAkB,CAAC,IAAD,gBACPD,EAAKE,UADE,IACzB,2BAAiC,CAAC,IAAzBC,EAAwB,QAC/BC,KAAKC,iBAAiBF,IAFC,+BA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,IAAD,CAAUmE,MAAOT,IACf,kBAAC,GAAD,KACE,kBAAC,WAAD,CAAUU,SAAU,kBAAC,KAAD,OAClB,kBAAC,IAAD,CAAQxD,QAASA,KAAUyD,aAAaC,SCThCC,QACW,cAA7B9J,OAAOkE,SAAS6F,UAEe,UAA7B/J,OAAOkE,SAAS6F,UAEhB/J,OAAOkE,SAAS6F,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,GAAD,MAAS5L,SAAS6L,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM9F,MAAK,SAAA+F,GACjCA,EAAaC,iB,gCEnInB,oBAEMC,EAAS,CACbC,SAAU,QACVC,KAAM,EACNC,MAAO,EACPC,IAAK,mBACLC,OAAQ,OACRC,OAAQ,OACRC,MAAO,OACPC,OAAQ,WAWKC,IARC,WACd,OACE,yBAAKpQ,MAAO2P,GACV,yBAAKjQ,UAAU,qD,gCChBrB,YAEe2Q,oB","file":"static/js/main.f81938fe.chunk.js","sourcesContent":["import React, { Component } from \"react\";\r\nimport { classList } from \"@utils\";\r\n\r\nclass DropDownMenuItem extends Component {\r\n state = {\r\n collapsed: true\r\n };\r\n elementRef = React.createRef();\r\n\r\n componentHeight = 0;\r\n calcaulateHeight(node) {\r\n if (node.name !== \"child\") {\r\n for (let child of node.children) {\r\n this.calcaulateHeight(child);\r\n }\r\n }\r\n this.componentHeight += node.clientHeight;\r\n return;\r\n }\r\n componentDidMount() {\r\n this.calcaulateHeight(this.elementRef);\r\n\r\n // OPEN DROPDOWN IF CHILD IS ACTIVE\r\n // let { location } = this.props;\r\n // for (let child of this.elementRef.children) {\r\n // if (child.getAttribute(\"href\") === location.pathname) {\r\n // this.setState({ collapsed: false });\r\n // }\r\n // }\r\n }\r\n onItemClick = () => {\r\n this.setState({ collapsed: !this.state.collapsed });\r\n };\r\n\r\n render() {\r\n let { collapsed } = this.state;\r\n let { children } = this.props;\r\n let { name, icon } = this.props.item;\r\n\r\n return (\r\n \r\n
\r\n \r\n {name}\r\n \r\n
\r\n\r\n (this.elementRef = el)}\r\n style={\r\n collapsed\r\n ? { maxHeight: \"0px\" }\r\n : { maxHeight: this.componentHeight + \"px\" }\r\n }\r\n >\r\n {children}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default DropDownMenuItem;\r\n","import React, { Component } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { classList } from \"@utils\";\r\nimport DropDownMenuItem from \"./DropDownMenuItem\";\r\n\r\nclass DropDownMenu extends Component {\r\n state = {\r\n open: false\r\n };\r\n\r\n onItemClick = e => {\r\n e.preventDefault();\r\n this.setState({ open: !this.state.open });\r\n };\r\n\r\n renderLevels = items =>\r\n items.map((item, i) => {\r\n if (item.sub) {\r\n return (\r\n \r\n {this.renderLevels(item.sub)}\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n {item.name}\r\n \r\n \r\n );\r\n }\r\n });\r\n\r\n render() {\r\n return
    {this.renderLevels(this.props.menu)}
;\r\n }\r\n}\r\n\r\nexport default DropDownMenu;\r\n","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport ReactQuill from \"react-quill\";\r\n\r\n/*\r\n * Simple editor component that takes placeholder text as a prop\r\n */\r\n\r\nconst RichTextEditor = ({\r\n content,\r\n placeholder,\r\n handleContentChange,\r\n theme = \"snow\",\r\n modules = RichTextEditor.modules\r\n}) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n/*\r\n * Quill modules to attach to editor\r\n * See https://quilljs.com/docs/modules/ for complete options\r\n */\r\nRichTextEditor.modules = {\r\n toolbar: [\r\n [{ font: [] }],\r\n [{ size: [\"small\", false, \"large\", \"huge\"] }], // custom dropdown\r\n [{ header: [1, 2, 3, 4, 5, 6, false] }],\r\n\r\n [\"bold\", \"italic\", \"underline\", \"strike\"], // toggled buttons\r\n [\"blockquote\", \"code-block\", \"link\"],\r\n\r\n [{ script: \"sub\" }, { script: \"super\" }], // superscript/subscript\r\n [{ color: [] }, { background: [] }], // dropdown with defaults from theme\r\n [{ align: [] }],\r\n\r\n [\"image\", \"video\"],\r\n\r\n [{ header: 1 }, { header: 2 }], // custom button values\r\n [{ list: \"ordered\" }, { list: \"bullet\" }],\r\n [{ indent: \"-1\" }, { indent: \"+1\" }], // outdent/indent\r\n [{ direction: \"rtl\" }], // text direction\r\n\r\n [\"clean\"]\r\n ],\r\n clipboard: {\r\n // toggle to add extra line breaks when pasting HTML:\r\n matchVisual: true\r\n }\r\n};\r\n\r\n/*\r\n * Quill editor formats\r\n * See https://quilljs.com/docs/formats/\r\n */\r\nRichTextEditor.formats = [\r\n \"align\",\r\n \"background\",\r\n \"bold\",\r\n \"blockquote\",\r\n \"bullet\",\r\n \"color\",\r\n \"code\",\r\n \"code-block\",\r\n \"clean\",\r\n \"direction\",\r\n \"font\",\r\n \"header\",\r\n \"italic\",\r\n \"indent\",\r\n \"image\",\r\n \"list\",\r\n \"link\",\r\n \"size\",\r\n \"strike\",\r\n \"script\",\r\n \"underline\",\r\n \"video\"\r\n];\r\n\r\n/*\r\n * PropType validation\r\n */\r\nRichTextEditor.propTypes = {\r\n placeholder: PropTypes.string\r\n};\r\n\r\nexport default RichTextEditor;\r\n","import React, { Fragment } from \"react\";\r\nimport { NavLink } from \"react-router-dom\";\r\n\r\nconst Breadcrumb = (props) => {\r\n const { routeSegments } = props;\r\n return (\r\n \r\n
\r\n {routeSegments ? (\r\n \r\n

{routeSegments[routeSegments.length - 1][\"name\"]}

\r\n
\r\n ) : null}\r\n
    \r\n {routeSegments\r\n ? routeSegments.map((route, index) =>\r\n index !== routeSegments.length - 1 ? (\r\n
  • \r\n \r\n {route.name}\r\n \r\n
  • \r\n ) : (\r\n
  • \r\n {route.name}\r\n
  • \r\n )\r\n )\r\n : null}\r\n
\r\n {props.children}\r\n \r\n
\r\n {/*
*/}\r\n
\r\n );\r\n};\r\n\r\nexport default Breadcrumb;\r\n","import React, { Component } from \"react\";\r\nimport Highlight from \"react-highlight.js\";\r\nimport ClipboardJS from 'clipboard';\r\nimport { initCodeViewer } from \"@utils\";\r\n\r\nclass CodeViewer extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.elem = React.createRef();\r\n }\r\n state = {};\r\n\r\n componentDidMount() {\r\n const pre = this.elem.current.refs.code.parentElement;\r\n\r\n // add/remove class to pre tag\r\n pre.classList.add('collapsed'); \r\n pre.addEventListener('click', (e) => {\r\n e.target.classList.remove('collapsed');\r\n });\r\n\r\n // Add copy button\r\n var copyButton = document.createElement(\"BUTTON\"); \r\n var copyButtonText = document.createTextNode(\"Copy\");\r\n copyButton.appendChild(copyButtonText);\r\n copyButton.classList.add('btn', 'btn-sm', 'btn-primary', 'btn-copy')\r\n pre.appendChild(copyButton);\r\n\r\n // Clipboard\r\n new ClipboardJS(copyButton, {\r\n text: (trigger) => {\r\n return this.elem.current.props.children;\r\n }\r\n });\r\n \r\n }\r\n\r\n render() {\r\n return
\r\n {this.props.children}\r\n
;\r\n }\r\n}\r\n\r\nexport default CodeViewer;\r\n","import React, { Component } from \"react\";\r\nimport { isMobile } from \"@utils\";\r\n\r\nclass GullSidenav extends Component {\r\n handleResizeRef;\r\n\r\n state = {\r\n mobile: isMobile()\r\n };\r\n\r\n handleWindowResize = () => {\r\n return event => {\r\n if (event.target.innerWidth < 768) {\r\n this.setState({ mobile: true });\r\n } else this.setState({ mobile: false });\r\n };\r\n };\r\n\r\n componentDidMount() {\r\n this.handleResizeRef = this.handleWindowResize();\r\n if (window) window.addEventListener(\"resize\", this.handleResizeRef);\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.handleResizeRef)\r\n window.removeEventListener(\"resize\", this.handleResizeRef);\r\n }\r\n\r\n render() {\r\n let {\r\n open,\r\n children,\r\n toggleSidenav,\r\n width = \"220px\",\r\n bgClass\r\n } = this.props;\r\n\r\n let { mobile } = this.state;\r\n\r\n return (\r\n
\r\n \r\n {children}\r\n
\r\n {open && mobile && (\r\n
\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default GullSidenav;\r\n","import React, { Component } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { connect } from \"react-redux\";\r\nimport { merge } from \"lodash\";\r\nimport {\r\n setLayoutSettings,\r\n setDefaultSettings\r\n} from \"app/redux/actions/LayoutActions\";\r\nimport { classList } from \"@utils\";\r\nimport ScrollBar from \"react-perfect-scrollbar\";\r\n\r\nclass Customizer extends Component {\r\n state = {};\r\n\r\n sidebarColors = [\r\n {\r\n name: \"gradient-purple-indigo\"\r\n },\r\n {\r\n name: \"gradient-black-blue\"\r\n },\r\n {\r\n name: \"gradient-black-gray\"\r\n },\r\n {\r\n name: \"gradient-steel-gray\"\r\n },\r\n {\r\n name: \"dark-purple\"\r\n },\r\n {\r\n name: \"slate-gray\"\r\n },\r\n {\r\n name: \"midnight-blue\"\r\n },\r\n {\r\n name: \"blue\"\r\n },\r\n {\r\n name: \"indigo\"\r\n },\r\n {\r\n name: \"pink\"\r\n },\r\n {\r\n name: \"red\"\r\n },\r\n {\r\n name: \"purple\"\r\n }\r\n ];\r\n\r\n handleLayoutChange = layoutName => {\r\n let { settings, setLayoutSettings } = this.props;\r\n setLayoutSettings(\r\n merge({}, settings, {\r\n activeLayout: layoutName\r\n })\r\n );\r\n };\r\n\r\n handleCustomizerToggle = () => {\r\n let { settings, setLayoutSettings } = this.props;\r\n setLayoutSettings(\r\n merge({}, settings, {\r\n customizer: {\r\n open: !settings.customizer.open\r\n }\r\n })\r\n );\r\n };\r\n handleDirectionChange = event => {\r\n let { settings, setLayoutSettings } = this.props;\r\n let dir = settings.dir === \"rtl\" ? \"ltr\" : \"rtl\";\r\n document.documentElement.setAttribute(\"dir\", dir);\r\n setLayoutSettings(\r\n merge({}, settings, {\r\n dir: dir\r\n })\r\n );\r\n };\r\n changeSidebarColor = colorClass => {\r\n let { settings, setLayoutSettings } = this.props;\r\n setLayoutSettings(\r\n merge({}, settings, {\r\n layout2Settings: {\r\n leftSidebar: {\r\n theme: colorClass\r\n }\r\n }\r\n })\r\n );\r\n };\r\n\r\n render() {\r\n let { settings } = this.props;\r\n let { activeLayout } = settings;\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n

Sidebar Layout

\r\n
\r\n\r\n \r\n
\r\n this.handleLayoutChange(\"layout1\")}\r\n >\r\n \r\n \r\n
\r\n this.handleLayoutChange(\"layout2\")}\r\n >\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {settings.activeLayout === \"layout2\" && (\r\n
\r\n
\r\n

Sidebar Colors

\r\n
\r\n\r\n \r\n
\r\n
\r\n {this.sidebarColors.map((c, i) => (\r\n \r\n this.changeSidebarColor(`sidebar-${c.name}`)\r\n }\r\n key={i}\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

RTL

\r\n
\r\n\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n\r\n {/*
\r\n
\r\n

Bootstrap Colors

\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\nCustomizer.propTypes = {\r\n setLayoutSettings: PropTypes.func.isRequired,\r\n setDefaultSettings: PropTypes.func.isRequired,\r\n settings: PropTypes.object.isRequired\r\n};\r\n\r\nconst mapStateToProps = state => ({\r\n setLayoutSettings: PropTypes.func.isRequired,\r\n setDefaultSettings: PropTypes.func.isRequired,\r\n settings: state.layout.settings\r\n});\r\n\r\nexport default connect(mapStateToProps, {\r\n setLayoutSettings,\r\n setDefaultSettings\r\n})(Customizer);\r\n","import moment from \"moment\";\r\n\r\nexport function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function() {\r\n var context = this,\r\n args = arguments;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(function() {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n }, wait);\r\n if (immediate && !timeout) func.apply(context, args);\r\n };\r\n}\r\n\r\nexport function isMobile() {\r\n if (window) {\r\n return window.matchMedia(`(max-width: 767px)`).matches;\r\n }\r\n return false;\r\n}\r\n\r\nexport function isMdScreen() {\r\n if (window) {\r\n return window.matchMedia(`(max-width: 1199px)`).matches;\r\n }\r\n return false;\r\n}\r\n\r\nfunction currentYPosition() {\r\n if (!window) {\r\n return;\r\n }\r\n // Firefox, Chrome, Opera, Safari\r\n if (window.pageYOffset) return window.pageYOffset;\r\n // Internet Explorer 6 - standards mode\r\n if (document.documentElement && document.documentElement.scrollTop)\r\n return document.documentElement.scrollTop;\r\n // Internet Explorer 6, 7 and 8\r\n if (document.body.scrollTop) return document.body.scrollTop;\r\n return 0;\r\n}\r\n\r\nfunction elmYPosition(elm) {\r\n var y = elm.offsetTop;\r\n var node = elm;\r\n while (node.offsetParent && node.offsetParent !== document.body) {\r\n node = node.offsetParent;\r\n y += node.offsetTop;\r\n }\r\n return y;\r\n}\r\n\r\nexport function scrollTo(scrollableElement, elmID) {\r\n var elm = document.getElementById(elmID);\r\n if (!elmID || !elm) {\r\n return;\r\n }\r\n var startY = currentYPosition();\r\n var stopY = elmYPosition(elm);\r\n var distance = stopY > startY ? stopY - startY : startY - stopY;\r\n if (distance < 100) {\r\n scrollTo(0, stopY);\r\n return;\r\n }\r\n var speed = Math.round(distance / 50);\r\n if (speed >= 20) speed = 20;\r\n var step = Math.round(distance / 25);\r\n var leapY = stopY > startY ? startY + step : startY - step;\r\n var timer = 0;\r\n if (stopY > startY) {\r\n for (var i = startY; i < stopY; i += step) {\r\n setTimeout(\r\n (function(leapY) {\r\n return () => {\r\n scrollableElement.scrollTo(0, leapY);\r\n };\r\n })(leapY),\r\n timer * speed\r\n );\r\n leapY += step;\r\n if (leapY > stopY) leapY = stopY;\r\n timer++;\r\n }\r\n return;\r\n }\r\n for (let i = startY; i > stopY; i -= step) {\r\n setTimeout(\r\n (function(leapY) {\r\n return () => {\r\n scrollableElement.scrollTo(0, leapY);\r\n };\r\n })(leapY),\r\n timer * speed\r\n );\r\n leapY -= step;\r\n if (leapY < stopY) leapY = stopY;\r\n timer++;\r\n }\r\n return false;\r\n}\r\n\r\nexport function getTimeDifference(date) {\r\n let difference =\r\n moment(new Date(), \"DD/MM/YYYY HH:mm:ss\").diff(\r\n moment(date, \"DD/MM/YYYY HH:mm:ss\")\r\n ) / 1000;\r\n\r\n if (difference < 60) return `${Math.floor(difference)} seconds`;\r\n else if (difference < 3600) return `${Math.floor(difference / 60)} minutes`;\r\n else if (difference < 86400) return `${Math.floor(difference / 3660)} hours`;\r\n else if (difference < 86400 * 30)\r\n return `${Math.floor(difference / 86400)} days`;\r\n else if (difference < 86400 * 30 * 12)\r\n return `${Math.floor(difference / 86400 / 30)} months`;\r\n else return `${(difference / 86400 / 30 / 12).toFixed(1)} years`;\r\n}\r\n\r\nexport function generateRandomId() {\r\n let tempId = Math.random().toString();\r\n let uid = tempId.substr(2, tempId.length - 1);\r\n return uid;\r\n}\r\n\r\nexport function getQueryParam(prop) {\r\n var params = {};\r\n var search = decodeURIComponent(\r\n window.location.href.slice(window.location.href.indexOf(\"?\") + 1)\r\n );\r\n var definitions = search.split(\"&\");\r\n definitions.forEach(function(val, key) {\r\n var parts = val.split(\"=\", 2);\r\n params[parts[0]] = parts[1];\r\n });\r\n return prop && prop in params ? params[prop] : params;\r\n}\r\n\r\nexport function classList(classes) {\r\n return Object.entries(classes)\r\n .filter(entry => entry[1])\r\n .map(entry => entry[0])\r\n .join(\" \");\r\n}\r\n\r\nexport function initCodeViewer() {\r\n if(!document) return;\r\n const pre = document.getElementsByTagName('pre');\r\n if(!pre.length) return;\r\n Array.prototype.map.call(pre, p => {\r\n // console.log(p);\r\n p.classList.add('collapsed');\r\n p.addEventListener('click', (e) => {\r\n console.log(e.target);\r\n e.target.classList.remove('collapsed');\r\n })\r\n });\r\n\r\n \r\n\r\n // pre.map(p => {\r\n // console.log(p)\r\n // })\r\n \r\n}\r\n\r\nexport const Utils = {\r\n formatDate(JSDate) {\r\n JSDate.setHours(24);\r\n return JSDate.toISOString().replace(/T.*/, \"\");\r\n },\r\n addNDays(JSDate, n) {\r\n return new Date(JSDate.setDate(JSDate.getDate() + n));\r\n },\r\n trimPtoN(p, n) {\r\n return p.length > n ? p.slice(0, n) + \"...\" : p;\r\n },\r\n};","/*\r\nThe following routes are used in two places:\r\n//In the navigations.js file to be displayed to the user or not according to his role.\r\n2-In routes.js file to be checked against the loading of the page to prevent url navigation.\r\n*/\r\nexport const authRoles = {\r\n sa: [\"SuperAdmin\"],\r\n AqaryOnly: [\"Aqary\"],\r\n dataEntry: [\"DataEntry\"],\r\n nonDataEntry: [\"SuperAdmin\", \"Aqary\",],\r\n all: [\"SuperAdmin\", \"Aqary\",\"DataEntry\"],\r\n};\r\n","export const SET_LAYOUT_SETTINGS = \"LAYOUT_SET_SETTINGS\";\r\nexport const SET_DEFAULT_LAYOUT_SETTINGS = \"LAYOUT_SET_DEFAULT_SETTINGS\";\r\n//export const SET_LOGGEDIN_USER_FULLNAME = \"SET_LOGGEDIN_USER_FULLNAME\";//Imporve it by using user reducer instead\r\n\r\n\r\nexport const setLayoutSettings = data => dispatch => {\r\n dispatch({\r\n type: SET_LAYOUT_SETTINGS,\r\n data: data\r\n });\r\n};\r\n\r\nexport const setDefaultSettings = data => dispatch => {\r\n dispatch({\r\n type: SET_DEFAULT_LAYOUT_SETTINGS,\r\n data: data\r\n });\r\n};\r\n\r\n// export const setLoggedInUserFullName = data => dispatch => {//Imporve it by using user reducer instead\r\n// console.log(\"setLoggedInUserFullName data\",data);\r\n// dispatch({\r\n// type: SET_LOGGEDIN_USER_FULLNAME,\r\n// data: data\r\n// });\r\n// };","class localStorageService {\r\n ls = window.localStorage;\r\n\r\n setItem(key, value) {\r\n value = JSON.stringify(value);\r\n this.ls.setItem(key, value);\r\n return true;\r\n }\r\n\r\n getItem(key) {\r\n let value = this.ls.getItem(key);\r\n try {\r\n return JSON.parse(value);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n getUserId = () => {\r\n let value = this.ls.getItem(\"auth_user\");\r\n try {\r\n return JSON.parse(value).userId;\r\n } catch (e) {\r\n return null;\r\n }\r\n };\r\n getLang = () => {\r\n // return \"ar\"\r\n try {\r\n let value = this.ls.getItem(\"auth_user\");\r\n if (!value) return \"ar\";\r\n let res = JSON.parse(value).lang;\r\n if (res) return res;\r\n else return \"ar\";\r\n } catch {\r\n return \"ar\";\r\n }\r\n };\r\n}\r\n\r\nexport default new localStorageService();\r\n","import history from \"@history.js\";\r\nimport jwtAuthService from \"../../services/jwtAuthService\";\r\n\r\nexport const SET_USER_DATA = \"USER_SET_DATA\";\r\nexport const REMOVE_USER_DATA = \"USER_REMOVE_DATA\";\r\nexport const USER_LOGGED_OUT = \"USER_LOGGED_OUT\";\r\n\r\nexport function setUserData(user) {\r\n return dispatch => {\r\n dispatch({\r\n type: SET_USER_DATA,\r\n data: user\r\n });\r\n };\r\n}\r\n\r\nexport function logoutUser() {\r\n return dispatch => {\r\n jwtAuthService.logout();\r\n\r\n // history.push({\r\n // pathname: \"/session/signin\"\r\n // });\r\n\r\n dispatch({\r\n type: USER_LOGGED_OUT\r\n });\r\n };\r\n}\r\n","import React from \"react\";\r\n\r\nconst AppContext = React.createContext({});\r\n\r\nexport default AppContext;","import axios from \"axios\";\r\nimport localStorageService from \"./localStorageService\";\r\n\r\nclass JwtAuthService {\r\n\r\n user = {\r\n userId: \"1\",\r\n userType: \"Aqary\",\r\n fullName: \"\",\r\n userName: \"\",\r\n imageUrl: \"/assets/images/face-7.jpg\",\r\n //age: 25,\r\n token: \"\",\r\n };\r\n\r\n setSessionAndUser = (responseData) => {\r\n this.setSession(responseData.accessToken);\r\n this.setUser(responseData);\r\n window.location = '/dashboard/v1'\r\n };\r\n\r\n // loginWithEmailAndPassword = (userName, password,lang) => {\r\n // alert('kama')\r\n // return http.post(process.env.REACT_APP_BASEURL +\"users/login?lang=\"+lang, {mobile: userName, password }).then((response) => {\r\n // this.setSession(response.data.data.accessToken);\r\n // this.setUser(response.data.data);\r\n // window.location = '/dashboard/v1'\r\n // return response.data;\r\n // });\r\n // };\r\n\r\n\r\n loginWithToken = () => {\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n resolve(localStorageService.getItem(\"auth_user\"));\r\n }, 100);\r\n }).then((data) => {\r\n if (data) { \r\n this.setSession(data.accessToken);\r\n // this.setLang(data.lang);\r\n } else { this.setSession(null)}\r\n this.setUser(data);\r\n return data;\r\n });\r\n };\r\n\r\n logout = () => {\r\n this.setSession(null);\r\n this.removeUser();\r\n window.location = \"/session/signin\";\r\n };\r\n\r\n setSession = (token) => {\r\n if (token) {\r\n //alert(token)\r\n //localStorage.setItem(\"accessToken\", token);\r\n axios.defaults.headers.common[\"Authorization\"] = \"Bearer \" + token;\r\n } else {\r\n //alert('no token')\r\n //localStorage.removeItem(\"accessToken\");\r\n delete axios.defaults.headers.common[\"Authorization\"];\r\n }\r\n };\r\n setUser = (user) => {\r\n localStorageService.setItem(\"auth_user\", user);\r\n };\r\n removeUser = () => {\r\n localStorage.removeItem(\"auth_user\");\r\n };\r\n}\r\n\r\nexport default new JwtAuthService();\r\n","import { lazy } from \"react\";\r\n\r\nconst Layout1 = lazy(() => import(\"./Layout1/Layout1\"));\r\n\r\nexport const GullLayouts = {\r\n layout1: Layout1\r\n};\r\n","import React, { Component, Suspense } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { PropTypes } from \"prop-types\";\r\nimport { withRouter } from \"react-router-dom\";\r\nimport AppContext from \"app/appContext\";\r\nimport {\r\n setLayoutSettings,\r\n setDefaultSettings\r\n} from \"app/redux/actions/LayoutActions\";\r\n\r\nimport { GullLayouts } from \".\";\r\nimport Customizer from \"./SharedComponents/Customizer\";\r\n\r\nclass GullLayout extends Component {\r\n state = {};\r\n\r\n // constructor(props, context) {\r\n // super(props);\r\n // this.appContext = context;\r\n // this.updateSettingsFromRouter();\r\n\r\n // // Set settings from query (Only for demo purpose)\r\n // this.setLayoutFromQuery();\r\n // }\r\n\r\n componentDidUpdate(prevProps) {\r\n if (this.props.location.pathname !== prevProps.location.pathname) {\r\n // initCodeViewer();\r\n // this.updateSettingsFromRouter();\r\n }\r\n }\r\n componentDidMount() {\r\n this.initAppDirection();\r\n }\r\n\r\n // updateSettingsFromRouter() {\r\n // const { routes } = this.appContext;\r\n // const matched = matchRoutes(routes, this.props.location.pathname)[0];\r\n // let { defaultSettings, settings, setLayoutSettings } = this.props;\r\n\r\n // if (matched && matched.route.settings) {\r\n // // ROUTE HAS SETTINGS\r\n // console.log(matched.route.settings);\r\n\r\n // const updatedSettings = merge({}, settings, matched.route.settings);\r\n // if (!isEqual(settings, updatedSettings)) {\r\n // setLayoutSettings(updatedSettings);\r\n // // console.log('Route has settings');\r\n // }\r\n // } else if (!isEqual(settings, defaultSettings)) {\r\n // console.log(\"routes not found\");\r\n\r\n // setLayoutSettings(defaultSettings);\r\n // // console.log('reset settings', defaultSettings);\r\n // }\r\n // }\r\n\r\n // setLayoutFromQuery = () => {\r\n // try {\r\n // let settingsFromQuery = getQueryParam(\"settings\");\r\n // settingsFromQuery = settingsFromQuery\r\n // ? JSON.parse(settingsFromQuery)\r\n // : {};\r\n // let { settings, setLayoutSettings, setDefaultSettings } = this.props;\r\n // let updatedSettings = merge({}, settings, settingsFromQuery);\r\n\r\n // setLayoutSettings(updatedSettings);\r\n // setDefaultSettings(updatedSettings);\r\n // } catch (e) {\r\n // // console.log(\"Error! Set settings from query param\", e);\r\n // }\r\n // };\r\n\r\n initAppDirection = () => {\r\n let { settings } = this.props;\r\n setTimeout(() => {\r\n document.documentElement.setAttribute('dir', settings.dir);\r\n });\r\n }\r\n\r\n render() {\r\n let { activeLayout, route, settings } = this.props;\r\n let Layout = GullLayouts[activeLayout];\r\n return (\r\n \r\n \r\n {(settings.customizer.show && )}\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = state => ({\r\n setLayoutSettings: PropTypes.func.isRequired,\r\n setDefaultSettings: PropTypes.func.isRequired,\r\n settings: state.layout.settings,\r\n activeLayout: state.layout.settings.activeLayout,\r\n defaultSettings: state.layout.defaultSettings\r\n});\r\n\r\nGullLayout.contextType = AppContext;\r\n\r\nexport default withRouter(\r\n connect(mapStateToProps, { setLayoutSettings, setDefaultSettings })(\r\n GullLayout\r\n )\r\n);\r\n","import React, { Component, Fragment } from \"react\";\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { connect } from \"react-redux\";\r\nimport AppContext from \"app/appContext\";\r\nimport GullLayout from \"app/GullLayout/GullLayout\";\r\nimport { flatMap } from \"lodash\";\r\nclass AuthGuard extends Component {\r\n constructor(props, context) {\r\n super(props);\r\n let { routes } = context;\r\n\r\n this.state = {\r\n authenticated: true,\r\n routes\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({\r\n routes: flatMap(this.state.routes, item => {\r\n if (item.routes) {\r\n return [...item.routes];\r\n }\r\n return [item];\r\n })\r\n });\r\n\r\n if (!this.state.authenticated) {\r\n this.redirectRoute(this.props);\r\n }\r\n }\r\n\r\n componentDidUpdate() {\r\n if (!this.state.authenticated) {\r\n this.redirectRoute(this.props);\r\n }\r\n }\r\n\r\n shouldComponentUpdate(nextProps, nextState) {\r\n return nextState.authenticated !== this.state.authenticated;\r\n }\r\n\r\n static getDerivedStateFromProps(props, state) {\r\n const { location, user } = props;\r\n const { pathname } = location;\r\n //console.log(pathname)\r\n //console.log(location.pathname.slice(0, location.pathname.lastIndexOf('/')))\r\n const matched = state.routes.find(r => r.path === pathname);\r\n const authenticated =\r\n matched && matched.auth && matched.auth.length\r\n ? matched.auth.includes(user.userType)\r\n : true;\r\n\r\n return {\r\n authenticated\r\n };\r\n }\r\n\r\n redirectRoute(props) {\r\n const { location, history } = props;\r\n const { pathname } = location;\r\n //alert('1')\r\n history.push({\r\n pathname: \"/session/signin\",\r\n state: { redirectUrl: pathname }\r\n });\r\n }\r\n\r\n render() {\r\n let { route } = this.props;\r\n const { authenticated } = this.state;\r\n\r\n return authenticated ? (\r\n \r\n \r\n \r\n ) : null;\r\n }\r\n}\r\n\r\nAuthGuard.contextType = AppContext;\r\n\r\nconst mapStateToProps = state => ({\r\n user: state.user\r\n});\r\n\r\nexport default withRouter(connect(mapStateToProps)(AuthGuard));\r\n","import { lazy } from \"react\";\r\nimport React from \"react\";\r\nimport { Redirect } from \"react-router-dom\";\r\nimport { authRoles } from \"app/auth/authRoles\";\r\n\r\nconst Dashboard1 = lazy(() => import(\"./views/dashboard/dashboard1/Dashboard1\"));\r\nconst news = lazy(() => import(\"./views/news/news\"));\r\nconst newForm = lazy(() => import(\"./views/news/newsForm\"));\r\nconst AccountSettings = lazy(() => import(\"./views/sessions/AccountSettings\"));\r\nconst ProfileSettings = lazy(() => import(\"./views/sessions/ProfileSettings\"));\r\nconst units = lazy(() => import(\"./views/units/units\"));\r\nconst unitForm = lazy(() => import(\"./views/units/unitForm\"));\r\nconst unitsAddByUserInPeriod = lazy(() => import(\"./views/reports/unitsAddedByUserInPeriod\"));\r\nconst pushNotifications = lazy(() => import(\"./views/pushNotifications/pushNotifications\"));\r\nconst users = lazy(() => import(\"./views/users/users\"));\r\nconst userForm = lazy(() => import(\"./views/users/userForm\"));\r\n\r\nconst securedRoutes = [\r\n {\r\n path: \"/dashboard/v1\",\r\n component: Dashboard1,\r\n auth: authRoles.all,\r\n },\r\n {\r\n path: \"/news/list\",\r\n component: news,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n {\r\n path: \"/news/:id\", //having the id in the segment part here prevents the auth from being applied; a custom solution should be added to handle it for urls without the parameters.\r\n component: newForm,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n {\r\n path: \"/session/account-settings\",\r\n component: AccountSettings,\r\n exact: true,\r\n },\r\n {\r\n path: \"/session/my-profile\",\r\n component: ProfileSettings,\r\n exact: true,\r\n },\r\n {\r\n path: \"/units/list\",\r\n component: units,\r\n auth: authRoles.all,\r\n exact: true,\r\n },\r\n {\r\n path: \"/unit/:id\", //having the id in the segment part here prevents the auth from being applied; a custom solution should be added to handle it for urls without the parameters.\r\n component: unitForm,\r\n auth: authRoles.all,\r\n exact: true,\r\n },\r\n {\r\n path: \"/reports/unitsAddByUserInPeriod\",\r\n component: unitsAddByUserInPeriod,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n {\r\n path: \"/pushNotifications/list\",\r\n component: pushNotifications,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n {\r\n path: \"/users/list\",\r\n component: users,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n {\r\n path: \"/users/:id/:type\", //having the id in the segment part here prevents the auth from being applied; a custom solution should be added to handle it for urls without the parameters.\r\n component: userForm,\r\n auth: authRoles.sa,\r\n exact: true,\r\n },\r\n];\r\n\r\nconst Signup = lazy(() => import(\"./views/sessions/Signup\"));\r\nconst Signin = lazy(() => import(\"./views/sessions/Signin\"));\r\nconst ForgotPassword = lazy(() => import(\"./views/sessions/ForgotPassword\"));\r\nconst ConfirmCode = lazy(() => import(\"./views/sessions/ConfirmCode\"));\r\nconst ResetPassword = lazy(() => import(\"./views/sessions/ResetPassword\"));\r\nconst Terms = lazy(() => import(\"./views/termsPolicy/terms\"));\r\nconst PrivacyPolicy = lazy(() => import(\"./views/termsPolicy/privacyPolicy\"));\r\n\r\nconst anonymousRoutes = [\r\n {\r\n path: \"/session/signup\",\r\n component: Signup,\r\n },\r\n {\r\n path: \"/session/signin\",\r\n component: Signin,\r\n },\r\n {\r\n path: \"/session/forgot-password\",\r\n component: ForgotPassword,\r\n },\r\n {\r\n path: \"/session/confirm-code\",\r\n component: ConfirmCode,\r\n },\r\n {\r\n path: \"/session/reset-password/:token\",\r\n component: ResetPassword,\r\n },\r\n {\r\n path: \"/terms\",\r\n component: Terms,\r\n },\r\n {\r\n path: \"/privacy-policy\",\r\n component: PrivacyPolicy,\r\n },\r\n];\r\n\r\nconst redirectRoute = {\r\n path: \"/\",\r\n exact: true,\r\n component: () => ,\r\n};\r\n\r\nconst errorRoute = {\r\n component: () => ,\r\n};\r\n\r\nexport default {\r\n securedRoutes,\r\n anonymousRoutes,\r\n redirectRoute,\r\n errorRoute,\r\n};\r\n","\r\nimport AuthGuard from \"./auth/AuthGuard\";\r\nimport allRoutes from \"./allRoutes\";\r\n\r\nconst routes = [\r\n ...allRoutes.anonymousRoutes,\r\n {\r\n path: \"/\",\r\n component: AuthGuard,\r\n routes: [...allRoutes.securedRoutes, allRoutes.redirectRoute, allRoutes.errorRoute],\r\n },\r\n];\r\n\r\nexport default routes;\r\n","import {\r\n LOGIN_SUCCESS,\r\n LOGIN_ERROR,\r\n LOGIN_LOADING,\r\n RESET_PASSWORD\r\n} from \"../actions/LoginActions\";\r\n\r\nconst initialState = {\r\n success: false,\r\n loading: false,\r\n error: {\r\n username: null,\r\n password: null\r\n }\r\n};\r\n\r\nconst LoginReducer = function(state = initialState, action) {\r\n switch (action.type) {\r\n case LOGIN_LOADING: {\r\n return {\r\n ...state,\r\n loading: true\r\n };\r\n }\r\n case LOGIN_SUCCESS: {\r\n return {\r\n ...state,\r\n success: true,\r\n loading: false\r\n };\r\n }\r\n case RESET_PASSWORD: {\r\n return {\r\n ...state,\r\n success: true,\r\n loading: false\r\n };\r\n }\r\n case LOGIN_ERROR: {\r\n return {\r\n success: false,\r\n loading: false,\r\n error: action.data\r\n };\r\n }\r\n default: {\r\n return state;\r\n }\r\n }\r\n};\r\n\r\nexport default LoginReducer;\r\n","import jwtAuthService from \"../../services/jwtAuthService\";\r\nimport { setUserData } from \"./UserActions\";\r\nimport history from \"@history.js\";\r\n\r\nexport const LOGIN_ERROR = \"LOGIN_ERROR\";\r\nexport const LOGIN_SUCCESS = \"LOGIN_SUCCESS\";\r\nexport const LOGIN_LOADING = \"LOGIN_LOADING\";\r\nexport const RESET_PASSWORD = \"RESET_PASSWORD\";\r\n\r\nexport function loginWithEmailAndPassword({ email, password }) {\r\n // return dispatch => {\r\n // dispatch({\r\n // type: LOGIN_LOADING\r\n // });\r\n\r\n // jwtAuthService\r\n // .loginWithEmailAndPassword(email, password)\r\n // .then(user => {\r\n // dispatch(setUserData(user));\r\n\r\n // history.push({\r\n // pathname: \"/\"\r\n // });\r\n\r\n // return dispatch({\r\n // type: LOGIN_SUCCESS\r\n // });\r\n // })\r\n // .catch(error => {\r\n // return dispatch({\r\n // type: LOGIN_ERROR,\r\n // payload: error\r\n // });\r\n // });\r\n // };\r\n}\r\n\r\nexport function resetPassword({ email }) {\r\n return dispatch => {\r\n dispatch({\r\n payload: email,\r\n type: RESET_PASSWORD\r\n });\r\n };\r\n}\r\n","import {\r\n SET_USER_DATA,\r\n REMOVE_USER_DATA,\r\n USER_LOGGED_OUT\r\n} from \"../actions/UserActions\";\r\n\r\nconst initialState = {};\r\n\r\nconst userReducer = function(state = initialState, action) {\r\n switch (action.type) {\r\n case SET_USER_DATA: {\r\n return {\r\n ...state,\r\n ...action.data\r\n };\r\n }\r\n case REMOVE_USER_DATA: {\r\n return {\r\n ...state\r\n };\r\n }\r\n case USER_LOGGED_OUT: {\r\n return state;\r\n }\r\n default: {\r\n return state;\r\n }\r\n }\r\n};\r\n\r\nexport default userReducer;\r\n","const layout1Settings = {\r\n leftSidebar: {\r\n open: true,\r\n secondaryNavOpen: false,\r\n },\r\n searchBox: {\r\n open: false\r\n }\r\n};\r\n\r\nexport default layout1Settings;\r\n","import layout1Settings from \"./Layout1/Layout1Settings\";\r\nimport localStorageService from \"../services/localStorageService\";\r\nconst lang = localStorageService.getLang();\r\nexport const GullLayoutSettings = {\r\n activeLayout: \"layout1\", // layout1, layout2\r\n dir: lang === \"ar\" ? \"rtl\" : \"ltr\", // ltr, rtl\r\n lang: lang,\r\n layout1Settings,\r\n customizer: {\r\n show: false,\r\n open: false,\r\n },\r\n footer: {\r\n show: false,\r\n },\r\n};\r\n","import { SET_LAYOUT_SETTINGS, SET_DEFAULT_LAYOUT_SETTINGS/*, SET_LOGGEDIN_USER_FULLNAME*/ } from \"../actions/LayoutActions\";\r\nimport { GullLayoutSettings } from \"../../GullLayout/settings\";\r\n\r\nconst initialState = {\r\n settings: {\r\n ...GullLayoutSettings,\r\n },\r\n defaultSettings: {\r\n ...GullLayoutSettings,\r\n },\r\n //fullName: \"\",//Imporve it by using user reducer instead\r\n};\r\n\r\nconst LayoutReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case SET_LAYOUT_SETTINGS:\r\n return {\r\n ...state,\r\n settings: { ...action.data },\r\n };\r\n case SET_DEFAULT_LAYOUT_SETTINGS:\r\n return {\r\n ...state,\r\n defaultSettings: { ...action.data },\r\n };\r\n // case SET_LOGGEDIN_USER_FULLNAME://Imporve it by using user reducer instead\r\n // return {\r\n // ...state,\r\n // fullName: action.data,\r\n // };\r\n default:\r\n return { ...state };\r\n }\r\n};\r\n\r\nexport default LayoutReducer;\r\n","import { combineReducers } from \"redux\";\r\nimport LoginReducer from \"./LoginReducer\";\r\nimport UserReducer from \"./UserReducer\";\r\nimport LayoutReducer from \"./LayoutReducer\";\r\n\r\nconst RootReducer = combineReducers({\r\n login: LoginReducer,\r\n user: UserReducer,\r\n layout: LayoutReducer,\r\n});\r\n\r\nexport default RootReducer;\r\n","import thunk from \"redux-thunk\";\r\nimport { createStore, applyMiddleware, compose } from \"redux\";\r\nimport RootReducer from \"./reducers/RootReducer\";\r\n\r\nconst initialState = {};\r\n\r\nconst middlewares = [thunk];\r\nlet devtools = x => x;\r\n\r\nif (\r\n process.env.NODE_ENV !== \"production\" &&\r\n process.browser &&\r\n window.__REDUX_DEVTOOLS_EXTENSION__\r\n) {\r\n devtools = window.__REDUX_DEVTOOLS_EXTENSION__();\r\n}\r\n\r\nexport const Store = createStore(\r\n RootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middlewares), devtools)\r\n);\r\n","import React, { Component, Fragment } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { PropTypes } from \"prop-types\";\r\nimport { setUserData } from \"../redux/actions/UserActions\";\r\nimport jwtAuthService from \"../services/jwtAuthService\";\r\nimport localStorageService from \"../services/localStorageService\";\r\n\r\nclass Auth extends Component {\r\n state = {};\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.props.setUserData(localStorageService.getItem(\"auth_user\"));\r\n this.checkJwtAuth();\r\n // this.checkFirebaseAuth();\r\n }\r\n\r\n checkJwtAuth = () => {\r\n jwtAuthService.loginWithToken().then(user => {\r\n this.props.setUserData(user);\r\n });\r\n };\r\n\r\n render() {\r\n const { children } = this.props;\r\n return {children};\r\n }\r\n}\r\n\r\nconst mapStateToProps = state => ({\r\n setUserData: PropTypes.func.isRequired,\r\n login: state.login\r\n});\r\n\r\nexport default connect(mapStateToProps, { setUserData })(Auth);\r\n","import React, { Suspense } from \"react\";\r\nimport \"../styles/app/app.scss\";\r\n\r\nimport { Provider } from \"react-redux\";\r\nimport { Router } from \"react-router-dom\";\r\nimport AppContext from \"./appContext\";\r\nimport history from \"@history\";\r\n\r\nimport routes from \"./RootRoutes\";\r\nimport { Store } from \"./redux/Store\";\r\nimport { renderRoutes } from \"react-router-config\";\r\nimport Auth from \"./auth/Auth\";\r\nimport RootRoutes from \"./RootRoutes\";\r\nimport { Loading } from \"@gull\";\r\n\r\nfunction App() {\r\n return (\r\n \r\n \r\n \r\n }>\r\n {renderRoutes(RootRoutes)}\r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default App;\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(\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 .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 from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport \"./index.scss\";\r\nimport App from \"./app/App\";\r\nimport * as serviceWorker from \"./serviceWorker\";\r\n\r\nReactDOM.render(, 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","import React from \"react\";\r\n\r\nconst styles = {\r\n position: \"fixed\",\r\n left: 0,\r\n right: 0,\r\n top: \"calc(50% - 20px)\",\r\n margin: \"auto\",\r\n height: \"40px\",\r\n width: \"40px\",\r\n zIndex: 324324324\r\n};\r\n\r\nconst Loading = () => {\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Loading;\r\n","import { createBrowserHistory } from 'history';\r\n\r\nexport default createBrowserHistory();"],"sourceRoot":""}