{"version":3,"sources":["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","_platform/src/components/MessageBox/MessageBox.js","../node_modules/memoize-one/dist/memoize-one.esm.js","_platform/src/utils/checkPermissions.js","_platform/src/utils/checkRoles.js","_platform/src/utils/PrivateComponent.js"],"names":["styled","nav","_templateObject","down","css","_templateObject2","thd","props","openMobileMenu","button","HeaderNavMenuToggleButton_templateObject","HeaderNavMenuToggleButton_templateObject2","transparentize","ul","HeaderNavTopLevel_templateObject","up","HeaderNavTopLevel_templateObject2","HeaderNavSubLevel_templateObject","theme","customSubMenuBackground","customHeaderBackground","HeaderNavSubLevel_templateObject2","depth","_templateObject3","NavLink","HeaderNavLink_templateObject","concat","HeaderNavLink_templateObject2","HeaderNavLink_templateObject3","Overlay","div","HeaderNav_templateObject","p","customMobileMenuOverlayBackground","isMobileMenuOpen","SubMenu","_ref","parent","onCloseMobileMenu","react_default","a","createElement","HeaderNavSubLevel","children","map","item","inMenu","menuPath","key","menuId","HeaderNavLink","to","activeClassName","onClick","itemName","length","HeaderNav","_this","Object","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","call","onMobileMenuToggle","setState","prevState","document","body","style","overflow","state","_this2","menu","Fragment","HeaderNavMenuToggleButton","HeaderNavContainer","HeaderNavTopLevel","showLoginInMenu","settingsApp","loginPagePath","exact","HeaderNav_SubMenu","showLogoutInMenu","PrivateComponent","logoutPagePath","Component","defaultProps","undefined","withTheme","StyledAlert","Alert","Title","Multiline","MessageBox","_ref$title","title","_ref$variant","variant","react__WEBPACK_IMPORTED_MODULE_1___default","safeIsNaN","Number","isNaN","value","areInputsEqual","newInputs","lastInputs","i","first","second","__webpack_exports__","resultFn","isEqual","lastThis","lastResult","lastArgs","calledOnce","newArgs","_i","arguments","apply","checkPermissions","currentUser","requiredPermissions","Array","isArray","permissions","some","indexOf","propTypes","PropTypes","object","isRequired","array","checkPermissionsMemoized","memoizeOne","checkRoles","requiredRoles","roles","checkRolesMemoized","_this$props","deniedPermissions","deniedRoles","displayError","errorMessage","publicOnly","redirectOnError","tempAuthAllowed","user","_this$props2","currentUserTemp","UnauthorisedComponent","RedirectOnErrorComponent","react_router","push","userObject","token","userId","mapStateToProps","createStructuredSelector","selectCurrentUser","selectCurrentUserTemp","connect"],"mappings":"okBAEeA,UAAOC,IAAtBC,IAGIC,YACA,KACAC,YAFIC,IAGkBC,YAAI,uBAAwB,QAIvC,SAAAC,GAAK,OAAKA,EAAMC,eAAiB,IAAM,UAElC,SAAAD,GAAK,OAAKA,EAAMC,eAAiB,UAAY,8yCCXlDR,UAAOS,OAAtBC,IAIIP,YACA,KACAC,YAFKO,IAGiB,SAAAJ,GAAK,OACvBA,EAAMC,eAAiBI,YAAe,IAAM,WAAa,eAMlD,SAAAL,GAAK,OAAKA,EAAMC,eAAiB,QAAU,QAKzC,SAAAD,GAAK,OAAKA,EAAMC,eAAiB,IAAM,OAKhC,SAAAD,GAAK,OACvBA,EAAMC,eAAiB,GAAKF,YAAI,kBAAmB,SAU/BA,YAAI,kBAAmB,QAWzC,SAAAC,GAAK,OACLA,EAAMC,eAAiB,mCAAqC,IAI5D,SAAAD,GAAK,OACLA,EAAMC,eAAiB,uCAAyC,IAK3DF,YAAI,kBAAmB,QAUV,SAAAC,GAAK,OACvBA,EAAMC,eAAiB,GAAKF,YAAI,2BAA4B,YAGxCA,YAAI,2BAA4B,WAK7CA,YAAI,2BAA4B,+jBC7EhCN,UAAOa,GAAtBC,IAOIC,YACA,KACAX,YAFGY,okBCPQhB,UAAOa,GAAtBI,IACsB,SAAAV,GAAK,OACvBA,EAAMW,MAAMC,yBACZZ,EAAMW,MAAME,wBACZ,QAOAL,YACA,KACAX,YAFGiB,I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jE,aA2F/BF,EAAiBG,aAAe,CAC9BsD,uBAAmBrD,EACnBsD,iBAAatD,EACbuD,cAAc,EACdC,kBAAcxD,EACdyD,YAAY,EACZC,qBAAiB1D,EACjBmC,yBAAqBnC,EACrBiD,mBAAejD,EACf2D,iBAAiB,EACjBC,KAAM,IAGR,IAAMU,EAAkBC,YAAyB,CAC/CrC,YAAasC,cACbV,gBAAiBW,gBAGJC,sBACbJ,EACA,KAFaI,CAGb9E","file":"static/js/headerNav.78ff4e1e.chunk.js","sourcesContent":["import { css, down, styled, thd } from '@smooth-ui/core-sc';\n\nexport default styled.nav`\n transition: all 0.3s ease 0s;\n\n ${down(\n 'lg',\n css`\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 )};\n`;\n","import { css, down, styled, thd } from '@smooth-ui/core-sc';\nimport { transparentize } from 'polished';\n\nexport default styled.button`\n display: none;\n cursor: pointer;\n\n ${down(\n 'lg',\n css`\n background-color: ${props =>\n props.openMobileMenu ? transparentize(0.25, '#151d29') : 'transparent'};\n border: none;\n display: inline-block;\n font-size: 0.75rem;\n height: 54px;\n position: absolute;\n right: ${props => (props.openMobileMenu ? '250px' : '10px')};\n text-transform: uppercase;\n top: 11px;\n transition: all 0.3s ease 0s;\n width: 54px;\n z-index: ${props => (props.openMobileMenu ? '1' : '0')};\n `\n )};\n\n & > span {\n background-color: ${props =>\n props.openMobileMenu ? '' : thd('customMenuColor', '#fff')};\n display: block;\n height: 4px;\n left: 7px;\n position: absolute;\n right: 7px;\n top: 15px;\n\n &::after,\n &::before {\n background-color: ${thd('customMenuColor', '#fff')};\n content: '';\n display: block;\n height: 4px;\n left: 0;\n position: absolute;\n width: 100%;\n }\n\n &::before {\n top: -8px;\n ${props =>\n props.openMobileMenu ? 'top: 0; transform: rotate(45deg)' : ''};\n }\n &::after {\n bottom: -8px;\n ${props =>\n props.openMobileMenu ? 'bottom: 0; transform: rotate(-45deg)' : ''};\n }\n }\n\n & > div {\n color: ${thd('customMenuColor', '#fff')};\n position: absolute;\n bottom: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n\n &:hover,\n &:focus {\n & > span {\n background-color: ${props =>\n props.openMobileMenu ? '' : thd('customMenuHighlightColor', '#f4bd19')};\n &::after,\n &::before {\n background-color: ${thd('customMenuHighlightColor', '#f4bd19')};\n }\n }\n\n & > div {\n color: ${thd('customMenuHighlightColor', '#f4bd19')};\n }\n }\n`;\n","import { css, styled, up } 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 ${up(\n 'lg',\n css`\n display: flex;\n justify-content: flex-end;\n text-align: center;\n\n & > li {\n display: inline-block;\n position: relative;\n }\n\n li > ul {\n display: none;\n }\n li:hover > ul,\n li > ul:hover {\n display: block;\n }\n `\n )}\n`;\n","import { css, styled, up } 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: 220px;\n padding: 0;\n\n ${up(\n 'lg',\n css`\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0.25rem 2rem;\n text-align: left;\n ${props =>\n props.depth === 2 &&\n css`\n position: absolute;\n top: 100%;\n z-index: 100;\n `}\n\n li {\n position: relative;\n }\n `\n )}\n`;\n","import { css, styled, thd, up } 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 &:focus {\n color: ${thd('customMenuHighlightColor', '#000')};\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 ${up(\n 'lg',\n css`\n font-size: 16px;\n ${props =>\n // If it's the top level\n (!props.depth || props.depth < 2) &&\n css`\n border-left: 0 none;\n border-bottom: 5px solid transparent;\n margin-left: 0.4rem;\n margin-right: 0.4rem;\n padding: 0.25em 0.2em;\n `}\n\n &.menu-active {\n position: relative;\n &:after {\n border-color: transparent transparent ${thd('secondary', 'gold')}\n transparent;\n border-style: solid;\n border-width: 0 5px 10px 5px;\n bottom: -5px;\n content: '';\n display: block;\n height: 0;\n left: 50%;\n position: absolute;\n transform: translateX(-50%);\n width: 0;\n }\n &:hover,\n &:focus {\n color: ${thd('customMenuHighlightColor', '#000')};\n }\n }\n `\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","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","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;","/**\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"],"sourceRoot":""}