{"ast":null,"code":"var _jsxFileName = \"/home/gnx/Desktop/ETB/ETB-FrontEnd/src/components/Layout/Layout.js\",\n _s = $RefreshSig$();\nimport React, { useState } from 'react';\nimport { AppBar, Box, CssBaseline, Drawer, IconButton, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Toolbar, Typography, Collapse, Divider, Avatar, Menu, MenuItem, Chip } from '@mui/material';\nimport { Menu as MenuIcon, Dashboard as DashboardIcon, BugReport as IncidentIcon, Build as ProblemIcon, SwapHoriz as ChangeIcon, Store as ServiceIcon, Storage as CMDBIcon, MenuBook as KnowledgeIcon, Assessment as ReportingIcon, Security as SecurityIcon, SmartToy as AutomationIcon, AdminPanelSettings as AdminIcon, ExpandLess, ExpandMore, AccountCircle, Logout, Assessment as AssessmentIcon } from '@mui/icons-material';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport { useAuth } from '../Auth/AuthContext';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst drawerWidth = 280;\nconst menuItems = [{\n text: 'Dashboard',\n icon: /*#__PURE__*/_jsxDEV(DashboardIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this),\n path: '/'\n}, {\n text: 'Incident Management',\n icon: /*#__PURE__*/_jsxDEV(IncidentIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this),\n path: '/incident-management',\n children: [{\n text: 'Dashboard',\n path: '/incident-management'\n }, {\n text: 'Incident Logging',\n path: '/incident-management/logging'\n }, {\n text: 'Incident Tracking',\n path: '/incident-management/tracking'\n }, {\n text: 'Lifecycle Management',\n path: '/incident-management/lifecycle'\n }, {\n text: 'Self-Service Portal',\n path: '/incident-management/self-service'\n }]\n}, {\n text: 'Problem Management',\n icon: /*#__PURE__*/_jsxDEV(ProblemIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this),\n path: '/problem-management',\n children: [{\n text: 'Dashboard',\n path: '/problem-management'\n }, {\n text: 'Root Cause Analysis',\n path: '/problem-management/root-cause'\n }, {\n text: 'Problem Records',\n path: '/problem-management/records'\n }]\n}, {\n text: 'Change Management',\n icon: /*#__PURE__*/_jsxDEV(ChangeIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 11\n }, this),\n path: '/change-management',\n children: [{\n text: 'Dashboard',\n path: '/change-management'\n }, {\n text: 'Change Requests',\n path: '/change-management/requests'\n }, {\n text: 'Release Management',\n path: '/change-management/releases'\n }]\n}, {\n text: 'Service Catalog',\n icon: /*#__PURE__*/_jsxDEV(ServiceIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this),\n path: '/service-catalog',\n children: [{\n text: 'Service Catalog',\n path: '/service-catalog'\n }, {\n text: 'Service Portal',\n path: '/service-portal'\n }]\n}, {\n text: 'Configuration Management',\n icon: /*#__PURE__*/_jsxDEV(CMDBIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 11\n }, this),\n path: '/cmdb',\n children: [{\n text: 'Dashboard',\n path: '/cmdb'\n }, {\n text: 'Configuration Items',\n path: '/cmdb/configuration-items'\n }, {\n text: 'Impact Analysis',\n path: '/cmdb/impact-analysis'\n }, {\n text: 'Dependency Mapping',\n path: '/cmdb/dependency-mapping'\n }]\n}, {\n text: 'Knowledge Management',\n icon: /*#__PURE__*/_jsxDEV(KnowledgeIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 11\n }, this),\n path: '/knowledge-management',\n children: [{\n text: 'Dashboard',\n path: '/knowledge-management'\n }, {\n text: 'Knowledge Articles',\n path: '/knowledge-management/articles'\n }]\n}, {\n text: 'Reporting & Analytics',\n icon: /*#__PURE__*/_jsxDEV(ReportingIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 11\n }, this),\n path: '/reporting',\n children: [{\n text: 'Dashboard',\n path: '/reporting'\n }, {\n text: 'Analytics',\n path: '/reporting/analytics'\n }, {\n text: 'Advanced Reporting',\n path: '/reporting/advanced'\n }]\n}, {\n text: 'Security & Compliance',\n icon: /*#__PURE__*/_jsxDEV(SecurityIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 125,\n columnNumber: 11\n }, this),\n path: '/security',\n children: [{\n text: 'Dashboard',\n path: '/security'\n }, {\n text: 'Security Incidents',\n path: '/security/incidents'\n }, {\n text: 'Compliance Reports',\n path: '/security/compliance'\n }]\n}, {\n text: 'Automation & AI',\n icon: /*#__PURE__*/_jsxDEV(AutomationIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 135,\n columnNumber: 11\n }, this),\n path: '/automation',\n children: [{\n text: 'Dashboard',\n path: '/automation'\n }, {\n text: 'Virtual Agent',\n path: '/automation/virtual-agent'\n }, {\n text: 'Workflow Automation',\n path: '/automation/workflows'\n }]\n}, {\n text: 'Administration',\n icon: /*#__PURE__*/_jsxDEV(AdminIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 145,\n columnNumber: 11\n }, this),\n path: '/admin',\n children: [{\n text: 'Dashboard',\n path: '/admin'\n }, {\n text: 'User Management',\n path: '/admin/users'\n }, {\n text: 'SLA Management',\n path: '/admin/sla'\n }, {\n text: 'Integrations',\n path: '/admin/integrations'\n }],\n adminOnly: true\n}, {\n text: 'Executive Dashboard',\n icon: /*#__PURE__*/_jsxDEV(AssessmentIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 157,\n columnNumber: 11\n }, this),\n path: '/executive',\n executiveOnly: true\n}];\nfunction Layout({\n children\n}) {\n _s();\n var _user$roleData, _user$roleData2, _user$name;\n const [mobileOpen, setMobileOpen] = useState(false);\n const [openMenus, setOpenMenus] = useState({});\n const [userMenuAnchor, setUserMenuAnchor] = useState(null);\n const navigate = useNavigate();\n const location = useLocation();\n const {\n user,\n logout,\n hasModuleAccess,\n hasPermission\n } = useAuth();\n const handleDrawerToggle = () => {\n setMobileOpen(!mobileOpen);\n };\n const handleMenuToggle = menuText => {\n setOpenMenus(prev => ({\n ...prev,\n [menuText]: !prev[menuText]\n }));\n };\n const handleNavigation = path => {\n navigate(path);\n setMobileOpen(false);\n };\n const handleUserMenuOpen = event => {\n setUserMenuAnchor(event.currentTarget);\n };\n const handleUserMenuClose = () => {\n setUserMenuAnchor(null);\n };\n const handleLogout = () => {\n logout();\n handleUserMenuClose();\n };\n const drawer = /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(Toolbar, {\n children: /*#__PURE__*/_jsxDEV(Typography, {\n variant: \"h6\",\n noWrap: true,\n component: \"div\",\n children: \"ETB - Enterprise IT Services\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 203,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 202,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Divider, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 207,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(List, {\n children: menuItems.map(item => {\n // Check if user has access to admin modules\n if (item.adminOnly && !hasModuleAccess('admin')) {\n return null;\n }\n\n // Check if user has access to executive modules\n if (item.executiveOnly && !hasPermission('executive.view')) {\n return null;\n }\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(ListItem, {\n disablePadding: true,\n children: /*#__PURE__*/_jsxDEV(ListItemButton, {\n onClick: () => {\n if (item.children) {\n handleMenuToggle(item.text);\n } else {\n handleNavigation(item.path);\n }\n },\n selected: location.pathname === item.path,\n children: [/*#__PURE__*/_jsxDEV(ListItemIcon, {\n children: item.icon\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 233,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(ListItemText, {\n primary: item.text\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 234,\n columnNumber: 19\n }, this), item.children && (openMenus[item.text] ? /*#__PURE__*/_jsxDEV(ExpandLess, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 236,\n columnNumber: 44\n }, this) : /*#__PURE__*/_jsxDEV(ExpandMore, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 236,\n columnNumber: 61\n }, this))]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 223,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 222,\n columnNumber: 15\n }, this), item.children && /*#__PURE__*/_jsxDEV(Collapse, {\n in: openMenus[item.text],\n timeout: \"auto\",\n unmountOnExit: true,\n children: /*#__PURE__*/_jsxDEV(List, {\n component: \"div\",\n disablePadding: true,\n children: item.children.map(child => /*#__PURE__*/_jsxDEV(ListItemButton, {\n sx: {\n pl: 4\n },\n onClick: () => handleNavigation(child.path),\n selected: location.pathname === child.path,\n children: /*#__PURE__*/_jsxDEV(ListItemText, {\n primary: child.text\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 250,\n columnNumber: 25\n }, this)\n }, child.text, false, {\n fileName: _jsxFileName,\n lineNumber: 244,\n columnNumber: 23\n }, this))\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 242,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 241,\n columnNumber: 17\n }, this)]\n }, item.text, true, {\n fileName: _jsxFileName,\n lineNumber: 221,\n columnNumber: 13\n }, this);\n })\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 208,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 201,\n columnNumber: 5\n }, this);\n return /*#__PURE__*/_jsxDEV(Box, {\n sx: {\n display: 'flex'\n },\n children: [/*#__PURE__*/_jsxDEV(CssBaseline, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 265,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(AppBar, {\n position: \"fixed\",\n sx: {\n width: {\n sm: `calc(100% - ${drawerWidth}px)`\n },\n ml: {\n sm: `${drawerWidth}px`\n }\n },\n children: /*#__PURE__*/_jsxDEV(Toolbar, {\n children: [/*#__PURE__*/_jsxDEV(IconButton, {\n color: \"inherit\",\n \"aria-label\": \"open drawer\",\n edge: \"start\",\n onClick: handleDrawerToggle,\n sx: {\n mr: 2,\n display: {\n sm: 'none'\n }\n },\n children: /*#__PURE__*/_jsxDEV(MenuIcon, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 281,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 274,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(Typography, {\n variant: \"h6\",\n noWrap: true,\n component: \"div\",\n sx: {\n flexGrow: 1\n },\n children: \"Enterprise IT Services Management System\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 283,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(Box, {\n sx: {\n display: 'flex',\n alignItems: 'center',\n gap: 2\n },\n children: [/*#__PURE__*/_jsxDEV(Chip, {\n label: (user === null || user === void 0 ? void 0 : (_user$roleData = user.roleData) === null || _user$roleData === void 0 ? void 0 : _user$roleData.name) || 'User',\n size: \"small\",\n sx: {\n bgcolor: (user === null || user === void 0 ? void 0 : (_user$roleData2 = user.roleData) === null || _user$roleData2 === void 0 ? void 0 : _user$roleData2.color) || 'default',\n color: 'white'\n }\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 287,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n color: \"inherit\",\n onClick: handleUserMenuOpen,\n children: /*#__PURE__*/_jsxDEV(Avatar, {\n sx: {\n width: 32,\n height: 32,\n bgcolor: 'secondary.main'\n },\n children: (user === null || user === void 0 ? void 0 : (_user$name = user.name) === null || _user$name === void 0 ? void 0 : _user$name.charAt(0)) || 'U'\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 299,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 295,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 286,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 273,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 266,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Box, {\n component: \"nav\",\n sx: {\n width: {\n sm: drawerWidth\n },\n flexShrink: {\n sm: 0\n }\n },\n \"aria-label\": \"mailbox folders\",\n children: [/*#__PURE__*/_jsxDEV(Drawer, {\n variant: \"temporary\",\n open: mobileOpen,\n onClose: handleDrawerToggle,\n ModalProps: {\n keepMounted: true\n },\n sx: {\n display: {\n xs: 'block',\n sm: 'none'\n },\n '& .MuiDrawer-paper': {\n boxSizing: 'border-box',\n width: drawerWidth\n }\n },\n children: drawer\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 311,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Drawer, {\n variant: \"permanent\",\n sx: {\n display: {\n xs: 'none',\n sm: 'block'\n },\n '& .MuiDrawer-paper': {\n boxSizing: 'border-box',\n width: drawerWidth\n }\n },\n open: true,\n children: drawer\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 325,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 306,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Box, {\n component: \"main\",\n sx: {\n flexGrow: 1,\n p: 3,\n width: {\n sm: `calc(100% - ${drawerWidth}px)`\n }\n },\n children: [/*#__PURE__*/_jsxDEV(Toolbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 344,\n columnNumber: 9\n }, this), children]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 336,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Menu, {\n anchorEl: userMenuAnchor,\n open: Boolean(userMenuAnchor),\n onClose: handleUserMenuClose,\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'right'\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'right'\n },\n children: [/*#__PURE__*/_jsxDEV(MenuItem, {\n disabled: true,\n children: [/*#__PURE__*/_jsxDEV(ListItemIcon, {\n children: /*#__PURE__*/_jsxDEV(AccountCircle, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 364,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 363,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(ListItemText, {\n primary: user === null || user === void 0 ? void 0 : user.name,\n secondary: user === null || user === void 0 ? void 0 : user.email\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 366,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 362,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Divider, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 371,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(MenuItem, {\n onClick: handleLogout,\n children: [/*#__PURE__*/_jsxDEV(ListItemIcon, {\n children: /*#__PURE__*/_jsxDEV(Logout, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 374,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 373,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(ListItemText, {\n primary: \"Logout\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 376,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 372,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 349,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 264,\n columnNumber: 5\n }, this);\n}\n_s(Layout, \"OTlkOYZMZ0gWDRln7lu2H7wLApk=\", false, function () {\n return [useNavigate, useLocation, useAuth];\n});\n_c = Layout;\nexport default Layout;\nvar _c;\n$RefreshReg$(_c, \"Layout\");","map":{"version":3,"names":["React","useState","AppBar","Box","CssBaseline","Drawer","IconButton","List","ListItem","ListItemButton","ListItemIcon","ListItemText","Toolbar","Typography","Collapse","Divider","Avatar","Menu","MenuItem","Chip","MenuIcon","Dashboard","DashboardIcon","BugReport","IncidentIcon","Build","ProblemIcon","SwapHoriz","ChangeIcon","Store","ServiceIcon","Storage","CMDBIcon","MenuBook","KnowledgeIcon","Assessment","ReportingIcon","Security","SecurityIcon","SmartToy","AutomationIcon","AdminPanelSettings","AdminIcon","ExpandLess","ExpandMore","AccountCircle","Logout","AssessmentIcon","useNavigate","useLocation","useAuth","jsxDEV","_jsxDEV","drawerWidth","menuItems","text","icon","fileName","_jsxFileName","lineNumber","columnNumber","path","children","adminOnly","executiveOnly","Layout","_s","_user$roleData","_user$roleData2","_user$name","mobileOpen","setMobileOpen","openMenus","setOpenMenus","userMenuAnchor","setUserMenuAnchor","navigate","location","user","logout","hasModuleAccess","hasPermission","handleDrawerToggle","handleMenuToggle","menuText","prev","handleNavigation","handleUserMenuOpen","event","currentTarget","handleUserMenuClose","handleLogout","drawer","variant","noWrap","component","map","item","disablePadding","onClick","selected","pathname","primary","in","timeout","unmountOnExit","child","sx","pl","display","position","width","sm","ml","color","edge","mr","flexGrow","alignItems","gap","label","roleData","name","size","bgcolor","height","charAt","flexShrink","open","onClose","ModalProps","keepMounted","xs","boxSizing","p","anchorEl","Boolean","anchorOrigin","vertical","horizontal","transformOrigin","disabled","secondary","email","_c","$RefreshReg$"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/src/components/Layout/Layout.js"],"sourcesContent":["import React, { useState } from 'react';\nimport {\n AppBar,\n Box,\n CssBaseline,\n Drawer,\n IconButton,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Toolbar,\n Typography,\n Collapse,\n Divider,\n Avatar,\n Menu,\n MenuItem,\n Chip,\n} from '@mui/material';\nimport {\n Menu as MenuIcon,\n Dashboard as DashboardIcon,\n BugReport as IncidentIcon,\n Build as ProblemIcon,\n SwapHoriz as ChangeIcon,\n Store as ServiceIcon,\n Storage as CMDBIcon,\n MenuBook as KnowledgeIcon,\n Assessment as ReportingIcon,\n Security as SecurityIcon,\n SmartToy as AutomationIcon,\n AdminPanelSettings as AdminIcon,\n ExpandLess,\n ExpandMore,\n AccountCircle,\n Logout,\n Assessment as AssessmentIcon,\n} from '@mui/icons-material';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport { useAuth } from '../Auth/AuthContext';\n\nconst drawerWidth = 280;\n\nconst menuItems = [\n {\n text: 'Dashboard',\n icon: