{"version":3,"sources":["../node_modules/memoize-one/dist/memoize-one.esm.js","_platform/src/components/MessageBox/MessageBox.js","_platform/src/utils/checkPermissions.js","_platform/src/utils/checkRoles.js","_platform/src/utils/PrivateComponent.js","components/CustomComponents/CustomHeaderNav/HeaderNavContainer.js","components/CustomComponents/CustomHeaderNav/HeaderNavMenuToggleButton.js","components/CustomComponents/CustomHeaderNav/HeaderNavTopLevel.js","components/CustomComponents/CustomHeaderNav/HeaderNavSubLevel.js","components/CustomComponents/CustomHeaderNav/HeaderNavLink.js","components/CustomComponents/CustomHeaderNav/HeaderNav.js"],"names":["safeIsNaN","Number","isNaN","value","areInputsEqual","newInputs","lastInputs","length","i","first","second","__webpack_exports__","resultFn","isEqual","lastThis","lastResult","lastArgs","calledOnce","newArgs","_i","arguments","this","apply","StyledAlert","styled","Alert","_templateObject","Title","div","_templateObject2","Multiline","_templateObject3","MessageBox","_ref","children","_ref$title","title","undefined","_ref$variant","variant","react__WEBPACK_IMPORTED_MODULE_1___default","a","createElement","defaultProps","checkPermissions","currentUser","requiredPermissions","Array","isArray","permissions","some","item","indexOf","propTypes","PropTypes","object","isRequired","array","checkPermissionsMemoized","memoizeOne","checkRoles","requiredRoles","roles","checkRolesMemoized","PrivateComponent","_this$props","props","deniedPermissions","deniedRoles","displayError","errorMessage","publicOnly","redirectOnError","tempAuthAllowed","user","_this$props2","currentUserTemp","UnauthorisedComponent","react_default","RedirectOnErrorComponent","react_router","push","to","userObject","token","userId","Component","mapStateToProps","createStructuredSelector","selectCurrentUser","selectCurrentUserTemp","connect","nav","thd","openMobileMenu","button","HeaderNavMenuToggleButton_templateObject","ul","HeaderNavTopLevel_templateObject","HeaderNavSubLevel_templateObject","theme","customSubMenuBackground","customHeaderBackground","NavLink","HeaderNavLink_templateObject","depth","concat","Overlay","HeaderNav_templateObject","p","customMobileMenuOverlayBackground","isMobileMenuOpen","SubMenu","parent","onCloseMobileMenu","HeaderNavSubLevel","map","inMenu","menuPath","key","menuId","HeaderNavLink","activeClassName","onClick","itemName","HeaderNav","_this","Object","classCallCheck","possibleConstructorReturn","getPrototypeOf","call","onMobileMenuToggle","setState","prevState","document","body","style","overflow","state","_this2","menu","Fragment","HeaderNavMenuToggleButton","HeaderNavContainer","HeaderNavTopLevel","showLoginInMenu","settingsApp","loginPagePath","exact","HeaderNav_SubMenu","showLogoutInMenu","logoutPagePath","withTheme"],"mappings":"+FAAA,IAAAA,EAAAC,OAAAC,OAAA,SAAAC,GACA,wBAAAA,UAeA,SAAAC,EAAAC,EAAAC,GACA,GAAAD,EAAAE,SAAAD,EAAAC,OACA,SAGA,QAAAC,EAAA,EAAiBA,EAAAH,EAAAE,OAAsBC,IACvC,GAlBAC,EAkBAJ,EAAAG,GAlBAE,EAkBAJ,EAAAE,KAjBAC,IAAAC,GAIAV,EAAAS,IAAAT,EAAAU,IAcA,SAnBA,IAAAD,EAAAC,EAuBA,SAkCeC,EAAA,EA/Bf,SAAAC,EAAAC,GAKA,IAAAC,OAJA,IAAAD,IACAA,EAAAT,GAIA,IACAW,EADAC,EAAA,GAEAC,GAAA,EAoBA,OAlBA,WAGA,IAFA,IAAAC,EAAA,GAEAC,EAAA,EAAoBA,EAAAC,UAAAb,OAAuBY,IAC3CD,EAAAC,GAAAC,UAAAD,GAGA,OAAAF,GAAAH,IAAAO,MAAAR,EAAAK,EAAAF,GACAD,GAGAA,EAAAH,EAAAU,MAAAD,KAAAH,GACAD,GAAA,EACAH,EAAAO,KACAL,EAAAE,EACAH,2WCnDA,IAAMQ,EAAcC,YAAOC,IAAPD,CAAHE,KAIJC,EAAQH,IAAOI,IAAVC,KAILC,EAAYN,IAAOI,IAAVG,KAIhBC,EAAa,SAAAC,GAA0D,IAAvDC,EAAuDD,EAAvDC,SAAuDC,EAAAF,EAA7CG,aAA6C,IAAAD,OAArCE,EAAqCF,EAAAG,EAAAL,EAA1BM,eAA0B,IAAAD,EAAhB,UAAgBA,EAC3E,OACEE,EAAAC,EAAAC,cAACnB,EAAD,CAAagB,QAA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9B,gBAAgB,cAChBC,QAAS,WACPiB,EAAKD,MAAM5B,kBACT6B,EAAKP,SAAS,CAAEtB,kBAAkB,IACpCwB,SAASC,KAAKC,MAAMC,SAAW,YANnC,sBA7FMpD,aAyHxBuC,EAAUlF,aAAe,CACvBkG,UAAMxG,EACN6G,qBAAiB7G,EACjBkH,sBAAkBlH,GAGLoH,sBAAU5B","file":"static/js/headerNav.e68c9489.chunk.js","sourcesContent":["var safeIsNaN = Number.isNaN || function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n};\n\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n\n return false;\n}\n\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = areInputsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n function memoized() {\n var newArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n\n return memoized;\n}\n\nexport default memoizeOne;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert, styled } from '@smooth-ui/core-sc';\n\nconst StyledAlert = styled(Alert)`\n margin-top: 1rem;\n`;\n\nexport const Title = styled.div`\n font-weight: bold;\n`;\n\nexport const Multiline = styled.div`\n white-space: pre-line;\n`;\n\nconst MessageBox = ({ children, title = undefined, variant = 'primary' }) => {\n return (\n \n {title ? {title} : null}\n {children}\n \n );\n};\n\nMessageBox.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.string,\n variant: PropTypes.string,\n};\n\nMessageBox.defaultProps = {\n title: undefined,\n variant: 'primary',\n};\n\nexport default MessageBox;\n","/**\n * Check Permissions - Check if the user has ANY of the required permissions\n *\n * @param {object} currentUser The user object containing the permissions property\n * @param {array} requiredPermissions The array of required permissions\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkPermissions = (currentUser, requiredPermissions) => {\n if (\n !requiredPermissions ||\n !Array.isArray(requiredPermissions) ||\n !currentUser ||\n !currentUser.permissions ||\n !Array.isArray(currentUser.permissions)\n )\n return false;\n\n return currentUser.permissions.some(\n item => requiredPermissions.indexOf(item) >= 0\n );\n};\n\ncheckPermissions.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredPermissions: PropTypes.array.isRequired,\n};\n\nconst checkPermissionsMemoized = memoizeOne(checkPermissions);\n\nexport default checkPermissionsMemoized;\n","/**\n * Check Roles - Check if the user has ANY of the required roles\n *\n * @param {object} currentUser The user object containing the roles property\n * @param {array} requiredRoles The array of required roles\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkRoles = (currentUser, requiredRoles) => {\n if (\n !requiredRoles ||\n !Array.isArray(requiredRoles) ||\n !currentUser ||\n !currentUser.roles ||\n !Array.isArray(currentUser.roles)\n )\n return false;\n\n return currentUser.roles.some(item => requiredRoles.indexOf(item) >= 0);\n};\n\ncheckRoles.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredRoles: PropTypes.array.isRequired,\n};\n\nconst checkRolesMemoized = memoizeOne(checkRoles);\n\nexport default checkRolesMemoized;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { createStructuredSelector } from 'reselect';\nimport { Redirect } from 'react-router-dom';\nimport {\n selectCurrentUser,\n selectCurrentUserTemp,\n} from '../containers/App/selectors'; // _platform\nimport checkPermissions from '../utils/checkPermissions'; // _platform\nimport checkRoles from '../utils/checkRoles'; // _platform\nimport MessageBox from '../components/MessageBox/MessageBox'; // _platform\n\n/**\n * Private Component - HoC to determine whether a component should be displayed\n * based on authentication, permissions and/or roles\n *\n * TODO: Extend with prop to supply function to determine permission `verifyFn` similar to LoadAsync\n *\n * The `user` prop can be either currentUser or currentUserTemp, depending on what the parent component determines is applicable.\n * If the `user` prop is not supplied, then this component will retrieve the user data via the App selectors.\n * The `tempAuthAllowed` prop determines whether currentUserTemp can be used\n *\n * `publicOnly` prop inverts the check so that the child component is only displayed to unauthenticated users (use `PublicComponent`)\n *\n * `deniedPermissions` and `deniedRoles` props take precedence over `requiredPermissions` and `requiredRoles`.\n * For example, if the props are `requiredRoles={['Administrator']} deniedRoles={['Administrator']}`,\n * users with the `Administrator` role will be denied access to the child component.\n *\n * If the checks determine that the access should be denied to the child component:\n * - By default the child component is skipped silently\n * - If the `redirectOnError` prop is supplied, the user will be redirected to the supplied local path\n * - Otherwise, if the `displayError` prop is supplied, the user will be shown an error\n * which can be customised via the `errorMessage` prop\n */\n\nclass PrivateComponent extends Component {\n render() {\n const {\n deniedPermissions,\n deniedRoles,\n displayError,\n errorMessage,\n publicOnly,\n redirectOnError,\n requiredPermissions,\n requiredRoles,\n tempAuthAllowed,\n user,\n } = this.props;\n const { currentUser, currentUserTemp } = this.props;\n\n const UnauthorisedComponent = displayError ? (\n \n {errorMessage || 'Unauthorised'}\n \n ) : null;\n\n const RedirectOnErrorComponent = redirectOnError ? (\n \n ) : null;\n\n // Determine which user object to use\n // 1. Use `user` prop if supplied\n // 2. If `tempAuthAllowed` prop:\n // 1. Is true: use `currentUserTemp` if available, if not use currentUser\n // 3. Is false: use currentUser\n //\n // Check for user.token and currentUserTemp.token to ensure they're not the\n // default empty objects. Cleaner than using Object.keys\n let userObject = {};\n if (user && user.token && user.userId) {\n userObject = user;\n } else if (tempAuthAllowed && currentUserTemp && currentUserTemp.token) {\n userObject = currentUserTemp;\n } else {\n userObject = currentUser;\n }\n\n // Invert the check if the publicOnly prop is supplied - used in PublicComponent\n if (publicOnly) {\n return !userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular permissions if supplied\n if (\n !!userObject.token &&\n ((deniedPermissions && checkPermissions(userObject, deniedPermissions)) ||\n (requiredPermissions &&\n !checkPermissions(userObject, requiredPermissions)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular roles if supplied\n if (\n !!userObject.token &&\n ((deniedRoles && checkRoles(userObject, deniedRoles)) ||\n (requiredRoles && !checkRoles(userObject, requiredRoles)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n return !!userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n}\n\nPrivateComponent.propTypes = {\n children: PropTypes.node.isRequired,\n currentUser: PropTypes.object.isRequired,\n currentUserTemp: PropTypes.object.isRequired,\n deniedPermissions: PropTypes.array,\n deniedRoles: PropTypes.array,\n displayError: PropTypes.bool,\n errorMessage: PropTypes.string,\n publicOnly: PropTypes.bool, // Inverts PrivateComponent - displays component to unauthenticated users only. Used by PublicComponent wrapper\n redirectOnError: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n requiredPermissions: PropTypes.array,\n requiredRoles: PropTypes.array,\n tempAuthAllowed: PropTypes.bool,\n user: PropTypes.object,\n};\n\nPrivateComponent.defaultProps = {\n deniedPermissions: undefined,\n deniedRoles: undefined,\n displayError: false,\n errorMessage: undefined,\n publicOnly: false,\n redirectOnError: undefined,\n requiredPermissions: undefined,\n requiredRoles: undefined,\n tempAuthAllowed: false,\n user: {},\n};\n\nconst mapStateToProps = createStructuredSelector({\n currentUser: selectCurrentUser(),\n currentUserTemp: selectCurrentUserTemp(),\n});\n\nexport default connect(\n mapStateToProps,\n null\n)(PrivateComponent);\n","import { styled, thd } from '@smooth-ui/core-sc';\n\nexport default styled.nav`\n transition: all 0.3s ease 0s;\n background-color: ${thd('customMenuBackground', '#fff')};\n height: 100vh;\n overflow-y: scroll;\n position: fixed;\n right: ${props => (props.openMobileMenu ? '0' : '-240px')};\n top: 0;\n visibility: ${props => (props.openMobileMenu ? 'visible' : 'hidden')};\n width: 240px;\n z-index: 100;\n`;\n","import { styled, thd } from '@smooth-ui/core-sc';\n\nexport default styled.button`\n background-color: ${props =>\n props.openMobileMenu ? thd('tertiary', '#B5121B') : 'transparent'};\n border: none;\n font-size: 0.75rem;\n height: 54px;\n font-weight: bold;\n position: ${props => (props.openMobileMenu ? 'fixed' : 'absolute')};\n right: ${props => (props.openMobileMenu ? '250px' : '5px')};\n text-transform: uppercase;\n top: 5px;\n transition: all 0.3s ease 0s;\n width: 54px;\n z-index: ${props => (props.openMobileMenu ? '1' : '0')};\n cursor: pointer;\n\n &:hover {\n background-color: ${props =>\n props.openMobileMenu ? thd('primary', '#003E7E') : 'transparent'};\n\n div {\n color: ${props =>\n props.openMobileMenu ? 'white' : thd('primary', '#003E7E')};\n }\n\n & > span,\n & > span::before,\n & > span::after {\n background-color: ${props =>\n props.openMobileMenu ? 'white' : thd('primary', '#003E7E')};\n }\n\n & > span {\n background-color: ${props =>\n props.openMobileMenu ? 'transparent' : thd('primary', '#003E7E')};\n }\n }\n\n & > span {\n background-color: ${props =>\n props.openMobileMenu ? '' : thd('tertiary', '#B5121B')};\n display: block;\n height: 4px;\n left: 7px;\n position: absolute;\n right: 7px;\n top: 36px;\n\n &::after,\n &::before {\n background-color: ${props =>\n props.openMobileMenu ? 'white' : thd('tertiary', '#B5121B')};\n content: '';\n display: block;\n height: 4px;\n left: 0;\n position: absolute;\n width: 100%;\n }\n\n &::before {\n bottom: 8px;\n ${props =>\n props.openMobileMenu\n ? 'bottom: 2px; width: 30px; left: 5px; transform: rotate(45deg)'\n : ''};\n }\n &::after {\n bottom: -8px;\n ${props =>\n props.openMobileMenu\n ? 'bottom: 2px; width: 30px; left: 5px; transform: rotate(-45deg)'\n : ''};\n }\n }\n\n & > div {\n color: ${props =>\n props.openMobileMenu ? 'white' : thd('tertiary', '#B5121B')};\n position: absolute;\n top: 10px;\n left: 50%;\n transform: translateX(-50%);\n }\n`;\n","import { styled } from '@smooth-ui/core-sc';\n\nexport default styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n position: relative;\n transition: all 0.3s ease 0s;\n`;\n","import { styled } from '@smooth-ui/core-sc';\n\nexport default styled.ul`\n background-color: ${props =>\n props.theme.customSubMenuBackground ||\n props.theme.customHeaderBackground ||\n '#fff'};\n display: block;\n list-style: none;\n margin: 0;\n min-width: 180px;\n padding: 0;\n`;\n","import { styled, thd } from '@smooth-ui/core-sc';\nimport { NavLink } from 'react-router-dom';\n\nexport default styled(NavLink)`\n border-left: 3px solid transparent;\n color: ${thd('customMenuColor', '#54707c')};\n display: block;\n font-size: 20px;\n font-weight: 550;\n font-variation-settings: 'wght' 550;\n padding: 0.5em;\n ${props =>\n props.depth && props.depth > 1 && `padding-left: ${props.depth - 1}em;`}\n text-decoration: none;\n\n &:hover {\n color: ${thd('customMenuHighlightColor', '#000')};\n background-color: ${thd('primary', '#003E7E')};\n }\n\n &:focus,\n &.menu-active:focus {\n outline: none;\n box-shadow: 0 0 0 0.2rem ${thd('customMenuFocus', 'rgba(84,112,124,0.25)')}\n inset;\n }\n\n &.menu-active {\n border-left-color: ${thd('customMenuHighlightColor', '#54707c')};\n color: ${thd('customMenuHighlightColor', '#000')};\n font-weight: bold;\n }\n`;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport NavContainer from './HeaderNavContainer';\nimport MenuToggleButton from './HeaderNavMenuToggleButton';\nimport TopLevel from './HeaderNavTopLevel';\nimport SubLevel from './HeaderNavSubLevel';\nimport HeaderNavLink from './HeaderNavLink';\nimport PrivateComponent from '_platform/src/utils/PrivateComponent';\nimport { styled, withTheme } from '@smooth-ui/core-sc';\n\nconst Overlay = styled.div`\n background-color: ${p =>\n p.theme.customMobileMenuOverlayBackground || 'rgba(0, 0, 0, 0.5)'};\n bottom: 0;\n height: 100vh;\n left: 0;\n opacity: ${p => (p.isMobileMenuOpen ? '1' : '0')};\n position: fixed;\n right: 0;\n top: 0;\n transition: opacity 0.3s ease 0s;\n visibility: ${p => (p.isMobileMenuOpen ? 'visible' : 'hidden')};\n z-index: 1;\n`;\n\nconst SubMenu = ({ depth, parent, onCloseMobileMenu }) => (\n \n {parent.children.map(\n item =>\n item.inMenu &&\n !!item.menuPath && (\n \n \n {item.itemName}\n \n {item.children && item.children.length > 0 && (\n \n )}\n \n )\n )}\n \n);\n\nSubMenu.propTypes = {\n depth: PropTypes.number, // eslint-disable-line react/require-default-props\n onCloseMobileMenu: PropTypes.func.isRequired,\n parent: PropTypes.object.isRequired,\n};\n\nclass HeaderNav extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n isMobileMenuOpen: false,\n };\n }\n\n onMobileMenuToggle = () => {\n this.setState(prevState => ({\n isMobileMenuOpen: !prevState.isMobileMenuOpen,\n }));\n document.body.style.overflow = this.state.isMobileMenuOpen\n ? 'visible'\n : 'hidden';\n };\n\n render() {\n if (!this.props.menu || this.props.menu.length < 1) {\n return null;\n }\n\n return (\n \n {/* Keyboard event is handled on the button (enter/space/escape) */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n {\n this.setState({ isMobileMenuOpen: false });\n document.body.style.overflow = 'visible';\n }}\n />\n \n \n {this.state.isMobileMenuOpen ? 'Close' : 'Menu'}\n \n \n \n {this.props.showLoginInMenu && (\n \n {\n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false });\n document.body.style.overflow = 'visible';\n }}\n >\n Log In\n \n \n )}\n {this.props.menu &&\n this.props.menu.map(\n item =>\n item.inMenu &&\n !!item.menuPath && (\n \n {\n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false });\n document.body.style.overflow = 'visible';\n }}\n >\n {item.itemName}\n \n {item.children && item.children.length > 0 && (\n {\n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false });\n document.body.style.overflow = 'visible';\n }}\n />\n )}\n \n )\n )}\n {this.props.showLogoutInMenu && (\n \n \n {\n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false });\n document.body.style.overflow = 'visible';\n }}\n >\n Logout\n \n \n \n )}\n \n \n \n );\n }\n}\n\nHeaderNav.propTypes = {\n menu: PropTypes.array,\n showLoginInMenu: PropTypes.bool,\n showLogoutInMenu: PropTypes.bool,\n theme: PropTypes.object.isRequired,\n};\n\nHeaderNav.defaultProps = {\n menu: undefined,\n showLoginInMenu: undefined,\n showLogoutInMenu: undefined,\n};\n\nexport default withTheme(HeaderNav);\n"],"sourceRoot":""}