\n \n \n \n \n \n \n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./service-status-alert.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./service-status-alert.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./service-status-alert.vue?vue&type=template&id=5a2885d8&\"\nimport script from \"./service-status-alert.vue?vue&type=script&lang=js&\"\nexport * from \"./service-status-alert.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\ninstallComponents(component, {VAlert,VBtn,VDialog,VIcon})\n","import DOMPurify from 'dompurify'\n\n/**\n * Sanitzies strings containing html to remove potentially harmful code and XSS attacks\n * @param {String} dirtyHtml Potentially unsanitised HTML\n * @returns\n */\nexport default function sanitizeHtml(dirtyHtml) {\n return DOMPurify.sanitize(dirtyHtml, {\n USE_PROFILES: { html: true },\n })\n}\n","export const PermissionRequirement = Object.freeze({\n /**\n * Every permission in the permissions list is required\n */\n ALL: 'all',\n /**\n * At least one permission out of the list is required\n */\n ONE: 'one',\n})\n","/**\n * Provided as a catch all and ideally shouldn't be thrown\n */\nexport default class UnknownAppError extends Error {\n constructor(message) {\n super(message || 'Caught an unhandled client side error')\n this.name = 'UnknownAppError'\n }\n}\n","/**\n * Used to track PromiseRejectionEvents\n */\nexport default class PromiseRejectionError extends Error {\n constructor(message) {\n super(message || 'Caught an unhandled promise rejection')\n this.name = 'PromiseRejectionError'\n }\n}\n","/**\n * Code sourced from https://github.com/arunredhu/vuejs_boilerplate/blob/master/src/app/shared/services/app-logger/app-logger.js\n * on 24/10/2022 9:52 AM\n */\n\n/* eslint no-console: [\"off\"] */\nimport config from '@/common/config'\nimport UnknownAppError from '@/models/error/unknownAppError'\nimport VueErrorDTO from '@/models/error/vueErrorDTO'\nimport WindowErrorDTO from '@/models/error/windowErrorDTO'\nimport Environment from '@/shared/constants/core/Environment'\nimport Vue from 'vue'\nimport store from '@state/store.js'\nimport { compileCustomProperties } from '@/helpers/log-helper'\nimport StoreErrorDTO from '@/models/error/storeErrorDTO'\nimport PromiseRejectionError from '@/models/error/promiseRejectionError'\n\n/**\n * @description Logger class\n * This is responsible for logging of all kinds of info in the application\n * Default, we are using the console api for logging and this provides the basic level of logging such as\n * you can use the available method of console in developement but in production these will be replaced with empty methods\n * This can be extended with the help of adding Log level functionality\n */\nclass AppLogger {\n /**\n * @constructor AppLogger\n */\n constructor() {\n /** Initializing the configuration of logger */\n this.initLogger()\n }\n\n /**\n * @description Initializing the configuration such as if environment is production then all log method will be replaced with empty methods\n * except logError, which will be responsible for logging the important info on server or logging service\n */\n initLogger() {\n // Checking the environment\n if (config.get('env') !== Environment.production) {\n this.log = console.log.bind(console)\n\n this.debug = console.debug.bind(console)\n\n this.info = console.info.bind(console)\n\n this.warn = console.warn.bind(console)\n\n this.error = console.error.bind(console)\n\n this.logError = this.error\n } else {\n // In case of production replace the functions definition\n this.log = this.debug = this.info = this.warn = this.error = () => {}\n\n this.logError = (err) => {\n switch (true) {\n case err instanceof VueErrorDTO: {\n const properties = compileCustomProperties(\n store,\n {\n info: err.info,\n route: err.vm?.$route?.name,\n component:\n err.vm?.$options?.name ||\n 'Name prop not set for this component',\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: err.err,\n properties,\n })\n break\n }\n\n case err instanceof WindowErrorDTO: {\n const properties = compileCustomProperties(store, err, true)\n\n Vue.prototype.$appInsights.trackException({\n exception: err.error,\n properties,\n })\n break\n }\n\n case err instanceof PromiseRejectionEvent: {\n const properties = compileCustomProperties(\n store,\n {\n reason: err?.reason,\n type: err?.type,\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: new PromiseRejectionError(err.reason),\n properties,\n })\n break\n }\n case err instanceof StoreErrorDTO: {\n const properties = compileCustomProperties(\n store,\n {\n module: err.module,\n errorResponse: {\n source: err?.errorResponse?.source,\n type: err?.errorResponse?.type,\n message: err?.errorResponse?.message,\n },\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: err.err,\n properties,\n })\n break\n }\n\n default: {\n const properties = compileCustomProperties(\n store,\n {\n error: err,\n },\n true\n )\n\n Vue.prototype.$appInsights.trackException({\n exception: new UnknownAppError(),\n properties,\n })\n break\n }\n }\n }\n }\n }\n}\n\n/** Creating the instance of logger */\nconst logger = new AppLogger()\n\nexport { logger }\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[(_vm.isAppLoading)?_c('Loading'):_c('RouterView',{key:_vm.$route.fullPath})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n
\n \n \n \n
\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./app.vue?vue&type=template&id=2f3aa39f&\"\nimport script from \"./app.vue?vue&type=script&lang=js&\"\nexport * from \"./app.vue?vue&type=script&lang=js&\"\nimport style0 from \"./app.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export default Object.freeze({\n home: {\n name: 'home',\n path: '/',\n },\n myAvailability: {\n name: 'myAvailability',\n path: '/availability',\n },\n clientOverview: {\n path: '/overview',\n name: 'client-overview',\n },\n clientGroupOverview: {\n path: '/group-overview',\n name: 'clientGroupOverview',\n },\n timesheets: {\n path: '/timesheets',\n name: 'timesheets',\n },\n candidates: {\n path: '/candidates',\n name: 'candidates',\n },\n help: {\n path: '/help',\n name: 'help',\n },\n bookings: {\n path: '/bookings',\n },\n bookingsCreate: {\n path: 'create',\n name: 'bookings-create',\n },\n bookingsPendingApproval: {\n path: 'pending-approval',\n name: 'Bookings Pending Approval',\n },\n settings: {\n name: 'settings',\n path: '/settings',\n },\n changePassword: {\n name: 'changePassword',\n path: '/settings/change-password',\n },\n login: {\n name: 'login',\n path: '/login',\n },\n impersonateLogout: {\n name: 'impersonateLogout',\n path: '/user/impersonate/logout',\n },\n impersonateLogin: {\n name: 'impersonateLogin',\n path: '/user/impersonate/:contactId',\n },\n finance: {\n name: 'finance',\n path: '/finance',\n },\n invoiceDetails: {\n path: '/finance/invoices/:invoiceNo',\n name: 'invoice-view',\n },\n logout: {\n name: 'logout',\n path: '/logout',\n },\n underConstruction: {\n name: 'underConstruction',\n path: '/under-construction',\n },\n notFound: {\n name: 'NotFoundPage',\n path: '/404',\n },\n error: {\n name: 'ErrorPage',\n path: '/500',\n },\n unauthorized: {\n name: 'UnauthorizedPage',\n path: '/401',\n },\n forbidden: {\n name: 'ForbiddenPage',\n path: '/403',\n },\n accountLoadFailure: {\n name: 'AccountLoadFailedPage',\n },\n noServerResponse: {\n name: 'NoServerResponsePage',\n },\n actionLocked: {\n name: 'accountLockedError',\n },\n})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-btn',_vm._g(_vm._b({},'v-btn',Object.assign({}, _vm.commonAttributes, _vm.$attrs),false),_vm.$listeners),[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-button.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-button.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-button.vue?vue&type=template&id=bc3ebc9e&\"\nimport script from \"./_base-button.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-button.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\ninstallComponents(component, {VBtn})\n","export const LogoForm = Object.freeze({\n FULL: 'Full',\n SHORT: 'Short',\n ICON: 'Icon',\n NONE: '',\n})\n","const initResultObject = (\n isSuccess = false,\n error = null,\n data = null,\n message = '',\n statusCode = null\n) => {\n return { isSuccess, error, data, message, statusCode }\n}\n\n/**\n * Successful operation. isSuccess is set to true\n * @param {*} data\n * @param {String} msg\n * @param {Number} statusCode\n * @returns\n */\nexport const success = (data = null, msg = '', statusCode = 200) =>\n initResultObject(true, null, data, msg, statusCode)\n\n/**\n * Failed operation. isSuccess is set to false\n * @param {Object} error\n * @param {String} msg\n * @param {Number} statusCode\n * @returns\n */\nexport const fail = (error = null, msg = '', statusCode = 400) =>\n initResultObject(false, error, null, msg, statusCode)\n","import config from '@common/config.js'\nimport { PublicClientApplication } from '@azure/msal-browser'\n\nexport default new PublicClientApplication(config.get('msalConfig'))\n","import $date from '@/services/date'\nimport { isEmpty } from 'lodash'\n\nconst isCacheFresh = ({\n cacheDuration,\n durationUnits,\n lastUpdated,\n forceRefresh = false,\n}) => {\n // If not being forced to refresh and it hasn't been longer than staleness threshold\n // return resource without API call\n return (\n !isEmpty(lastUpdated) &&\n !forceRefresh &&\n $date().diff(lastUpdated, durationUnits) < cacheDuration\n )\n}\n\nconst getSavedState = (key) => {\n const item = window.localStorage.getItem(key)\n return item && item !== 'undefined' ? JSON.parse(item) : ''\n}\n\nconst saveState = (key, state) => {\n window.localStorage.setItem(key, JSON.stringify(state))\n}\n\nconst deleteState = (key) => {\n saveState(key, null) // extra precaution\n window.localStorage.removeItem(key)\n}\n\nexport { isCacheFresh, saveState, deleteState, getSavedState }\n","import httpStatus from 'statuses'\n\nconst isHttpStatus = (response, statusCode = 'OK') => {\n return response === httpStatus(statusCode)\n}\n\nconst isSuccess = (response) => {\n return (\n isHttpStatus(response, 'OK') ||\n isHttpStatus(response, 'No Content') ||\n isHttpStatus(response, 'Created')\n )\n}\n\nexport { isSuccess, isHttpStatus }\n","export const Tags = Object.freeze({\n /**\n * This is the primary location/client or group for this contact\n */\n PRIMARY: 'primary',\n /**\n * This contact will be notified of any bookings at this location/client or group\n * (aka confirmed contact)\n */\n CONFIRMED: 'confirmed',\n /**\n * Signifies that the replace me feature is enabled at this location/client or group\n */\n REPLACE_ME_ENABLED: 'replace_me_feature_enabled',\n})\n","/**\n * Validates that an object has every key provided in the expected array\n * @param {Array} expected\n * @param {Object} obj\n * @returns {Boolean}\n */\nexport default function objectHasKeys(expected = [], obj = {}) {\n if (!expected || !Array.isArray(expected) || expected.length === 0)\n throw Error('Expected array needs to be a valid, non-empty array')\n\n if (!obj) throw Error('Object needs to be non-empty')\n\n return expected.every((key) => Object.prototype.hasOwnProperty.call(obj, key))\n}\n","export default Object.freeze({\n /**\n * Error is undetermined\n */\n unknown: 'unknownError',\n /**\n * An internal api error.\n */\n api: 'apiError',\n /**\n * One or more of the input parameters failed validation.\n */\n validation: 'validationError',\n /**\n * An authorisation or authentication error.\n */\n security: 'securityError',\n /**\n * Resource not found\n */\n notFoundError: 'notFoundError',\n})\n","import ErrorResponseType from '@/shared/constants/error/ErrorResponseType'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\n\nexport default class ErrorResponse {\n constructor({\n _error = null,\n data = null,\n source = RequestErrorSource.unknown,\n type = ErrorResponseType.unknown,\n code = '',\n message = '',\n param = null,\n } = {}) {\n /**\n * @property {Object} The original error object returned from request attempt\n */\n this._error = _error\n\n /**\n * @property {Object} Container prop to transmit any relevant data down the pipeline\n */\n this.data = data\n\n /**\n * @property {RequestErrorSource} Indicates at what stage the error was triggered when attempting the request\n */\n this.source = source\n\n /**\n * @property {ErrorResponseType} The type of error received from the response (set to unknown if response wasn't received)\n */\n this.type = type\n\n /**\n * @property {string} Error code that may be received from the response or determined locally\n */\n this.code = code\n\n /**\n * @property {string} Message to relate error information to the user\n */\n this.message = message\n\n /**\n * @property {string} Contains the parameter in error (if applicable)\n */\n this.param = param\n }\n}\n","import objectHasKeys from '@/utils/object-has-keys'\nimport ErrorResponseType from '@/shared/constants/error/ErrorResponseType'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\nimport ErrorResponse from '@/models/error/ErrorResponse'\nimport { isEmpty } from 'lodash'\n\n// Utils\n\nconst determineRequestErrorType = (error) => {\n if (error?.response) return RequestErrorSource.server\n else if (error?.request) return RequestErrorSource.request\n else return RequestErrorSource.unknown\n}\n\n/**\n * Default API request validation response\n *\n * Object Structure:\n * ```json\n * {\n errors: Object,\n status: Number,\n title: String?,\n traceId: String?,\n type: String?,\n }\n * ```\n *\n * @param {Object} responseData\n * @returns\n */\nconst mapApiValidationErrorResponseToError = (error, errorSource, $i18n) => {\n const base = baseErrorResponse(error, errorSource, $i18n)\n base.data = error.response?.data?.errors\n base.type = error.response?.data?.type || ErrorResponseType.api\n base.message = error.response?.data?.title || base.message\n\n return base\n}\n\n/**\n * Ready2WorkAPI.DTOs.V1.Core.ErrorResponse\n *\n * Object Structure:\n * ```json\n * {\n type: String?,\n code: String?,\n message: String?,\n param: String?,\n }\n * ```\n *\n * @returns\n */\nconst mapR2WErrorResponseToError = (error, errorSource, $i18n) => {\n const base = baseErrorResponse(error, errorSource, $i18n)\n base.type = error.response?.data?.type || ErrorResponseType.api\n base.code = error.response?.data?.code || base.code\n base.message = error.response?.data?.message || base.message\n base.param = error.response?.data?.param\n return base\n}\n\n// Constants\nconst BASE_ERROR_RESPONSE_OBJ_KEYS = ['type', 'code', 'param']\nconst API_VALIDATION_ERROR_OBJ_KEYS = [\n 'errors',\n 'status',\n 'title',\n 'traceId',\n 'type',\n]\n\n// Abstract Product\nconst baseErrorResponse = (error, errorSource, $i18n) => {\n return new ErrorResponse({\n _error: error,\n source: errorSource,\n type: ErrorResponseType.unknown,\n message: $i18n.t('error.genericApiError'),\n })\n}\n\n// Factory\nexport default function(error, $i18n) {\n const errorSource = determineRequestErrorType(error)\n\n switch (errorSource) {\n case RequestErrorSource.server:\n return serverErrorResponse(error, errorSource, $i18n)\n case RequestErrorSource.request:\n return requestErrorResponse(error, errorSource, $i18n)\n default:\n return baseErrorResponse(error, errorSource, $i18n)\n }\n}\n\n// Concrete Products\nconst serverErrorResponse = (error, errorSource, $i18n) => {\n if (!error?.response || isEmpty(error?.response) || !error?.response?.data)\n return baseErrorResponse(error, errorSource, $i18n)\n\n // Case: Default API request validation response\n if (objectHasKeys(API_VALIDATION_ERROR_OBJ_KEYS, error.response?.data)) {\n return mapApiValidationErrorResponseToError(error, errorSource, $i18n)\n }\n\n // Case: Ready2WorkAPI.DTOs.V1.Core.ErrorResponse\n if (objectHasKeys(BASE_ERROR_RESPONSE_OBJ_KEYS, error.response?.data))\n return mapR2WErrorResponseToError(error, errorSource, $i18n)\n\n // Default Case\n return baseErrorResponse(error, errorSource, $i18n)\n}\n\nconst requestErrorResponse = (error, errorSource, $i18n) => {\n return baseErrorResponse(error, errorSource, $i18n)\n}\n","import { fail, success } from '@/helpers/result-helper.js'\nimport router from '@router'\nimport firebase from '@/plugins/firebase'\nimport toast from '@/services/toasts/index.js'\nimport msal from '@plugins/msal'\nimport $date from '@/services/date/index.js'\nimport {\n isCacheFresh,\n getSavedState,\n saveState,\n deleteState,\n} from '@/helpers/cache-helpers'\nimport { DurationUnits } from '@/shared/constants/date/DurationUnits.js'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport { LinkType } from '@/shared/constants/permissions/LinkType'\nimport {\n processPermissionsPayload,\n getNodeById,\n getNodePermission,\n hasPermissionAtAnyLevel,\n iterateOverPermissionsTree,\n flattenAccessTree,\n flattenPermissionsWithLocations,\n} from '@/helpers/permissions-helpers'\nimport { PermissionModifier } from '@/shared/constants/permissions/PermissionModifier'\nimport { PermissionScope } from '@/shared/constants/permissions/PermissionScope'\nimport { OperationReturnType } from '@/shared/constants/permissions/OperationReturnType'\nimport { Tags } from '@/shared/constants/permissions/Tags.js'\nimport config from '@common/config.js'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\nimport ErrorResponseFactory from '@/services/error/ErrorResponseFactory'\nimport StoreErrorDTO from '@/models/error/storeErrorDTO'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\n// eslint-disable-next-line no-unused-vars\nimport TreeViewDto from '@/models/app/treeViewDto'\nimport ClientSelectorTreeViewDto from '@/models/clients/clientSelectorTreeViewDto'\nimport { orderBy } from 'lodash'\n\n/**\n *\n * @param {{access: [], clientId: number, clientName: string, locations: [], tags: []}[]} clients\n */\nconst extractClientsForTreeView = (clients) => {\n if (!clients || clients.length === 0) return []\n\n /**\n * @type {ClientSelectorTreeViewDto[]}\n */\n const clientsList = []\n\n for (const client of clients) {\n clientsList.push(\n new ClientSelectorTreeViewDto({\n id: client.clientId,\n name: client.clientName,\n locations: client.locations.map((location) => location.locationName),\n })\n )\n }\n\n return orderBy(clientsList, 'name', 'asc')\n}\n\nexport default {\n namespaced: true,\n state: {\n // MSAL User\n account: getSavedState('auth.account'),\n interactionRequired: true,\n // User Profile from DB\n currentUser: getSavedState('auth.currentUser'),\n accessToken: '', // Bearer token\n lastTokenRefresh: null,\n loadingCount: 0,\n auth: firebase,\n permissions: [],\n generalFiles: [],\n impersonateContactId: getSavedState('auth.impersonateContactId'),\n username: null, // used to track errors when user profile is not set\n },\n\n mutations: {\n SET_CURRENT_USER(state, newValue) {\n state.currentUser = { ...newValue, ...{ lastUpdated: $date() } }\n saveState('auth.currentUser', state.currentUser)\n },\n SET_ACCOUNT(state, newValue) {\n state.account = newValue\n saveState('auth.account', newValue)\n },\n SET_IMPERSONATE_CONTACT_ID(state, contactId) {\n state.impersonateContactId = contactId\n saveState('auth.impersonateContactId', contactId)\n },\n SET_USER_PERMISSIONS(state, permissions) {\n state.permissions = processPermissionsPayload(permissions)\n },\n SET_USER_GENERALFILES(state, files) {\n state.generalFiles = files\n },\n SET_INTERACTION_REQUIRED(state, newValue) {\n state.interactionRequired = newValue\n },\n SET_ACCESS_TOKEN(state, token) {\n state.accessToken = token\n state.interactionRequired = false\n state.lastTokenRefresh = $date()\n },\n SET_USER_TO_UNAUTHENTICATED(state) {\n state.account = null\n state.interactionRequired = true\n state.currentUser = null\n state.impersonateContactId = null\n deleteState('auth.account')\n deleteState('auth.currentUser')\n deleteState('auth.impersonateContactId')\n deleteState('client.id')\n deleteState('client.name')\n state.accessToken = null\n state.username = null\n\n sessionStorage.clear()\n localStorage.clear()\n },\n FRESH_IMPERSONATE_CLEAR_STORE(state) {\n state.currentUser = null\n state.impersonateContactId = null\n state.permission = []\n deleteState('auth.currentUser')\n deleteState('auth.impersonateContactId')\n deleteState('client.id')\n deleteState('client.name')\n },\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n SET_USERNAME(state, username) {\n state.username = username\n },\n },\n\n getters: {\n moduleName: () => 'auth',\n currentUserFullName: (state) =>\n state.currentUser\n ? `${state.currentUser.firstName} ${state.currentUser.lastName}`\n : '',\n currentUserEmail: (state) =>\n state.currentUser\n ? state.currentUser.emailAddress\n : state.username || 'not_specified',\n currentUser: (state) => state.currentUser,\n currentUserContactId: (state) =>\n state.currentUser?.id || state.impersonateContactId || 'not_specified',\n currentUserSimple: (state, getters) => {\n return {\n id: getters.currentUserContactId || '',\n emailAddress: getters.currentUserEmail || '',\n isImpersonating: getters.hasImpersonateContactId,\n }\n },\n getUserForEventLogging: (state, getters) => {\n return {\n contactId: getters.currentUserContactId,\n isImpersonating: getters.hasImpersonateContactId,\n impersonator: getters.hasImpersonateContactId\n ? state.account?.name\n : null,\n }\n },\n isClientGroupOverviewEnabled: (state, getters) =>\n getters.currentUser?.isClientGroupOverviewEnabled,\n msalAccount: (state) => state.account,\n impersonateContactId: (state) => state.impersonateContactId,\n hasImpersonateContactId: (state) => !!state.impersonateContactId,\n getUserStandardBookingDetails: (state) => {\n const standardBookings = state.currentUser?.standardBookings\n if (!standardBookings || standardBookings.length === 0) return null\n return standardBookings[0]\n },\n accessToken: (state) => state.accessToken,\n lastTokenRefresh: (state) => state.lastTokenRefresh,\n isUserLoggedIn: (state) =>\n state.accessToken && (!state.interactionRequired || !!state.account),\n\n isLoadingAuth: (state) => state.loadingCount > 0,\n isInteractionRequired: (state) => state.interactionRequired,\n auth: (state) => state.auth,\n msalInstance: (state) => msal,\n permissions: (state) => state.permissions,\n permissionsTreeView: (state) => {\n if (!state.permissions || state.permissions.length === 0) return []\n\n /**\n * @type {{ access: [], clients: [], groupId: number, groupName: string }[]}\n */\n const permissionsList = state.permissions\n\n /**\n * @type {TreeViewDto[]}\n */\n const tree = []\n\n for (const group of permissionsList) {\n tree.push(\n new TreeViewDto({\n id: group.groupId,\n name: group.groupName,\n children: extractClientsForTreeView(group.clients),\n })\n )\n }\n\n return orderBy(tree, 'name', 'asc')\n },\n redirectToClientOverview: (state) => {\n let clientCount = 0\n\n if (!state.permissions || state.permissions.length === 0) return false\n\n for (const group of state.permissions) {\n clientCount += group.clients.length\n }\n\n return clientCount > 1\n },\n hasMultipleClients: (state, getters) => {\n return getters.redirectToClientOverview\n },\n firstAvailableClient: (state) => {\n return state.permissions[0].clients[0]\n },\n getNode: (state) => (nodeId, level) => {\n return getNodeById(state.permissions, nodeId, level)\n },\n getGroup: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.GROUP)\n },\n getClient: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.CLIENT)\n },\n getClients: (state, getters) => (ids) => {\n return getters.getAllClients.filter((client) =>\n ids.includes(client.clientId)\n )\n },\n getLocation: (state, getters) => (id) => {\n return getters.getNode(id, LinkType.LOCATION)\n },\n getClientLocations: (state, getters) => (id) => {\n const client = getters.getClient(id)\n return client.locations\n },\n getNodeHierarchyByIdAndLevel: (state) => (id, linkType) => {\n const flatTree = flattenPermissionsWithLocations(state.permissions)\n if (!flatTree) return null\n\n switch (linkType) {\n case LinkType.GROUP:\n return flatTree.find((x) => x.groupId === id)\n case LinkType.CLIENT:\n return flatTree.find((x) => x.clientId === id)\n case LinkType.LOCATION:\n return flatTree.find((x) => x.locationId === id)\n default:\n return null\n }\n },\n getFirstClientLocationWithReplaceMePermissions: (state, getters) => (\n clientId\n ) => {\n return getters.getFirstClientLocationWithPermissions(\n clientId,\n PermissionScope.REPLACE_ME\n )\n },\n getAllClients: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.CLIENT,\n OperationReturnType.LIST\n )\n },\n getAllClientGroups: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.GROUP,\n OperationReturnType.LIST\n )\n },\n countAllAvailableLocations: (state, getters) => {\n return iterateOverPermissionsTree(\n state.permissions,\n LinkType.LOCATION,\n OperationReturnType.LIST\n ).length\n },\n countAllAvailableBookingLocations: (state, getters) => {\n const list = iterateOverPermissionsTree(\n state.permissions,\n LinkType.LOCATION,\n OperationReturnType.LIST\n )\n\n return list.filter(\n (locationNode) => locationNode?.access?.permissions?.booking?.view\n ).length\n },\n getTimezoneFromFirstClientGroupLocation: (state, getters) => (\n clientGroupId\n ) => {\n const clientGroup = getters.getGroup(clientGroupId)\n\n if (\n !clientGroup ||\n !isNonEmptyArray(clientGroup?.clients) ||\n !isNonEmptyArray(clientGroup?.clients[0]?.locations)\n )\n return ''\n\n return clientGroup?.clients[0]?.locations[0]?.timeZone\n },\n getPermission: (state) => (\n id,\n level,\n scope,\n modifier = PermissionModifier.VIEW\n ) => {\n return getNodePermission(state.permissions, id, level, scope, modifier)\n },\n hasLocationAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.ACCOUNTS\n )\n },\n hasLocationBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.BOOKING\n )\n },\n hasLocationPendingApprovalPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.PENDING_BOOKING\n )\n },\n hasLocationBookingCreatePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.BOOKING,\n PermissionModifier.CREATE\n )\n },\n hasLocationTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.TIMESHEETS\n )\n },\n hasLocationReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.LOCATION,\n PermissionScope.REPLACE_ME\n )\n },\n hasClientAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.ACCOUNTS\n )\n },\n hasClientBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.CLIENT, PermissionScope.BOOKING)\n },\n hasClientPendingApprovalPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.PENDING_BOOKING\n )\n },\n hasClientTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.TIMESHEETS\n )\n },\n hasClientReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.CLIENT,\n PermissionScope.REPLACE_ME\n )\n },\n hasGroupAccountsPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.GROUP, PermissionScope.ACCOUNTS)\n },\n hasGroupBookingPermission: (state, getters) => (id) => {\n return getters.getPermission(id, LinkType.GROUP, PermissionScope.BOOKING)\n },\n hasGroupTimesheetPermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.GROUP,\n PermissionScope.TIMESHEETS\n )\n },\n hasGroupReplaceMePermission: (state, getters) => (id) => {\n return getters.getPermission(\n id,\n LinkType.GROUP,\n PermissionScope.REPLACE_ME\n )\n },\n hasPermissionRegardlessOfLevel: (state, getters) => (\n permissionScope,\n modifier\n ) => {\n return hasPermissionAtAnyLevel(\n state.permissions,\n permissionScope,\n modifier\n )\n },\n flatAccessTree: (state) => {\n return flattenAccessTree(state.permissions)\n },\n getGeneralFiles: (state) => state.generalFiles,\n getFirstClientLocationWithPermissions: (state, getters) => (\n clientId,\n permissionScope\n ) => {\n const client = getters.getClient(clientId)\n if (!client) return null\n if (client.locations.length === 0) return null\n\n // If client has permission, return first location\n if (getters.getPermission(clientId, LinkType.CLIENT, permissionScope)) {\n return client.locations[0]\n }\n\n // Otherwise find first client location with permissions\n const firstAuthorisedLocation = client.locations.find(\n (x) => x.access?.permissions?.[permissionScope]\n )\n return firstAuthorisedLocation\n },\n getFirstClientLocationWithPermissionsByClientIds: (state, getters) => (\n clientIds,\n permissionScope\n ) => {\n let locationWithPerm = null\n\n for (const clientId of clientIds) {\n locationWithPerm = getters.getFirstClientLocationWithPermissions(\n clientId,\n permissionScope\n )\n if (locationWithPerm) break\n }\n\n return locationWithPerm\n },\n getAllClientLocationsWithPermission: (state, getters) => (\n clientId,\n permissionScope\n ) => {\n return getters.getAllClientsLocationsWithPermission(\n [clientId],\n permissionScope\n )\n },\n getAllClientsLocationsWithPermission: (state, getters) => (\n clientIds,\n permissionScope\n ) => {\n const clients = getters.getClients(clientIds)\n\n if (!clients || clients?.length === 0) return false\n\n const locations = []\n for (const client of clients) {\n for (const location of client.locations) {\n if (\n getters.getPermission(\n location.locationId,\n LinkType.LOCATION,\n permissionScope\n )\n )\n locations.push(location)\n }\n }\n\n return locations\n },\n getAllClientLocationsWithReplaceMePermission: (state, getters) => (\n clientId\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n\n const locations = []\n for (const location of client.locations) {\n if (\n !!location.tags.find((tag) => tag === Tags.REPLACE_ME_ENABLED) &&\n getters.hasLocationReplaceMePermission(location.locationId)\n )\n locations.push(location)\n }\n\n return locations\n },\n hasPermissionForAtleastOneClientLocation: (state, getters) => (\n clientIds,\n permissionScope,\n modifier\n ) => {\n const clients = getters.getAllClients\n\n const targetClients = clientIds\n\n const selectedClients = clients.filter((client) =>\n targetClients.includes(client.clientId)\n )\n\n // Confirm that there's at least one location to be checked\n if (\n !selectedClients ||\n selectedClients.length === 0 ||\n selectedClients[0].locations.length === 0\n )\n return false\n\n for (const client of selectedClients) {\n // Check if client has permission\n if (\n getters.getPermission(\n client.clientId,\n LinkType.CLIENT,\n permissionScope,\n modifier\n )\n )\n return true\n\n // Check if at least one location has the permission\n for (const location of client.locations) {\n if (\n getters.getPermission(\n location.locationId,\n LinkType.LOCATION,\n permissionScope,\n modifier\n )\n )\n return true\n }\n }\n\n return false\n },\n hasReplaceMePermissionForAtleastOneClientLocation: (state, getters) => (\n clientId\n ) => {\n const client = getters.getClient(clientId)\n if (!client || client?.locations.length === 0) return false\n for (const location of client.locations) {\n if (\n !!location.tags.find((tag) => tag === Tags.REPLACE_ME_ENABLED) &&\n getters.hasLocationReplaceMePermission(location.locationId)\n )\n return true\n }\n\n return false\n },\n hasCreateBookingPermissionForAtleastOneClientLocation: (state, getters) => (\n clientId\n ) => {\n const hasCreateBookingPermission = getters.getFirstClientLocationWithPermissions(\n clientId,\n PermissionScope.BOOKING\n )\n\n return !!hasCreateBookingPermission\n },\n hasCreateBookingPermissionForAtleastOneClientLocationByClientIds: (\n state,\n getters\n ) => (clientIds) => {\n const hasCreateBookingPermission = getters.getFirstClientLocationWithPermissionsByClientIds(\n clientIds,\n PermissionScope.BOOKING\n )\n\n return !!hasCreateBookingPermission\n },\n },\n\n actions: {\n // This is automatically run in `src/state/store.js` when the app\n // starts, along with any other actions named `init` in other modules.\n init({ dispatch }) {},\n\n // Login via firebase\n async logIn({ dispatch, getters, commit }, { username, password }) {\n // Clean out localStorage to ensure AAD credentials don't remain\n dispatch('clearStore', null, { root: true })\n\n // Setting username in the store to assist with logging\n commit('SET_USERNAME', username)\n\n if (getters.isUserLoggedIn) return dispatch('refreshToken')\n\n commit('START_LOADING')\n\n return await firebase\n .auth()\n .signInWithEmailAndPassword(username, password)\n .then(async (response) => {\n if (!response.user)\n return Promise.reject(\n fail([], this.$i18n.t('auth.loginGetProfileFailureErrorText'))\n )\n commit('SET_INTERACTION_REQUIRED', false)\n return success()\n })\n .catch((error) => {\n let message = ''\n if (error.code === 'auth/wrong-password')\n message = this.$i18n.t('auth.loginWrongPasswordErrorText')\n else if (error.code === 'auth/user-not-found')\n message = this.$i18n.t('auth.loginUserNotFoundErrorText')\n else message = error.message\n\n return fail([], message)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n /**\n * Handles redirect auth from MSAL\n * @param {Object} response Response will be populated on msal login\n */\n async handleRedirect({ dispatch }, response) {\n // Redirect to home after login\n if (response !== null) {\n await dispatch('getUserFromMsalProvider')\n router.push({ name: 'home' })\n }\n\n // In case multiple accounts exist, you can select\n const currentAccounts = msal.getAllAccounts()\n if (currentAccounts.length > 0) {\n // TODO: Add choose account code here\n await dispatch('getUserFromMsalProvider')\n }\n },\n\n // Handles already logged in impersonate redirect from login page\n async msalAlreadyLoggedInRedirect(\n { dispatch, commit },\n impersonateContactId\n ) {\n // Attempt to log out of firebase & clear out store in preperation\n try {\n await dispatch('firebaseLogOut', {\n nuke: false,\n showNotifications: false,\n redirect: false,\n setUnauthenticated: false,\n })\n } catch {}\n\n // Clear out certain values that need to be retrieved from API\n await dispatch('client/clear', null, { root: true })\n commit('FRESH_IMPERSONATE_CLEAR_STORE')\n\n // Set the new impersonate contact Id\n commit('SET_IMPERSONATE_CONTACT_ID', impersonateContactId)\n\n // Redirect to dashboard\n router.push({ name: 'home' })\n },\n\n async clearImpersonateId({ commit }) {\n commit('FRESH_IMPERSONATE_CLEAR_STORE')\n },\n\n // Logs in the current user.\n async msalLogIn({ dispatch, getters, commit }, impersonateContactId) {\n // Attempt to log out of firebase & clear out store in preperation\n try {\n await dispatch('firebaseLogOut', {\n nuke: true,\n showNotifications: false,\n redirect: false,\n setUnauthenticated: false,\n })\n } catch {}\n\n commit('SET_IMPERSONATE_CONTACT_ID', impersonateContactId)\n\n if (getters.isUserLoggedIn) return dispatch('msalRefreshToken')\n\n const loginRequest = {\n scopes: ['openid'],\n }\n\n msal.loginRedirect(loginRequest).catch((error) => {\n commit('SET_USER_TO_UNAUTHENTICATED')\n\n const errorCode = error.errorCode\n\n const noNotificationReq = ['user_cancelled']\n\n // Filter through errors that don't require a notifiction\n if (noNotificationReq.some((v) => errorCode.includes(v)))\n return fail(error)\n\n toast.error('Failed to login as impersonated contact')\n return fail(error)\n })\n },\n\n // Logs out the current user.\n async msalLogOut(\n { commit, dispatch },\n payload = { redirect: true, nuke: true }\n ) {\n const { redirect, nuke } = payload\n\n commit('START_LOADING')\n\n return await msal\n .logout({})\n .then(() => {\n commit('SET_USER_TO_UNAUTHENTICATED')\n // Nuke store\n if (nuke) dispatch('clearStore', null, { root: true })\n if (redirect)\n router.push({ path: `${getLanguageBasedOnBaseURL()}/landing` })\n\n return success()\n })\n .catch((error) => {\n toast.error(this.$i18n.t('auth.signOutFailureErrorText'))\n return fail(error)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n // Retrieves user account from auth provider\n getUserFromMsalProvider({ commit, dispatch }) {\n if (!msal) return Promise.resolve(null)\n\n try {\n const myAccounts = msal.getAllAccounts()\n commit('SET_ACCOUNT', myAccounts[0])\n } catch {\n commit('SET_ACCOUNT', null)\n }\n },\n\n // Validates the current user's token and refreshes it\n // with new data from the API.\n async msalRefreshToken({ dispatch, commit, state }) {\n if (!msal) return Promise.resolve(fail()) // Prevents trying to access auth object before it is initialised\n await dispatch('getUserFromMsalProvider')\n if (!state.account) return Promise.resolve(fail())\n\n commit('SET_USERNAME', state.account?.username)\n\n commit('START_LOADING')\n\n const request = {\n scopes: [config.get('scopes.openId'), config.get('scopes.read')],\n account: state.account,\n }\n\n let response\n\n try {\n response = await msal.acquireTokenSilent(request)\n commit('SET_ACCESS_TOKEN', response.accessToken)\n return success()\n } catch (error) {\n console.warn('Silent token acquisition failed. Using interactive mode')\n return await msal\n .acquireTokenPopup(request)\n .then((response) => {\n commit('SET_ACCESS_TOKEN', response.accessToken)\n return success()\n })\n .catch(() => {\n toast.error('Failed to authenticate as impersonated contact')\n return fail()\n })\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n // Logs out the current user.\n async logOut({ getters, dispatch }, payload) {\n return dispatch(\n getters.impersonateContactId ? 'msalLogOut' : 'firebaseLogOut',\n payload\n )\n },\n\n // Logs out the current user.\n async firebaseLogOut(\n { commit, dispatch },\n payload = {\n redirect: true,\n nuke: true,\n showNotifications: true,\n setUnauthenticated: true,\n }\n ) {\n const { redirect, nuke, showNotifications, setUnauthenticated } = payload\n\n commit('START_LOADING')\n return await firebase\n .auth()\n .signOut()\n .then(() => {\n if (setUnauthenticated) commit('SET_USER_TO_UNAUTHENTICATED')\n // Nuke store\n if (nuke) dispatch('clearStore', null, { root: true })\n if (redirect)\n window.location.href = `/${getLanguageBasedOnBaseURL()}/landing`\n\n return success()\n })\n .catch((error) => {\n if (showNotifications)\n toast.error(this.$i18n.t('auth.signOutFailureErrorText'))\n return fail(error)\n })\n .finally(() => {\n commit('FINISH_LOADING')\n })\n },\n\n async refreshToken({ dispatch, getters }, forceRefresh = false) {\n return await dispatch(\n getters.impersonateContactId\n ? 'msalRefreshToken'\n : 'firebaseRefreshToken',\n forceRefresh\n )\n },\n\n /**\n * Checks freshness of access token and will force refresh the token if token\n * is considered stale\n * @param {*} context Vuex context\n * @param {Boolean} forceRefresh Forces a token refresh\n * @returns Access token\n */\n async getAccessTokenOrRefresh({ dispatch, getters }, forceRefresh = false) {\n const isAccessTokenFresh = isCacheFresh({\n cacheDuration: 30,\n durationUnits: DurationUnits.MINUTE,\n lastUpdated: getters.lastTokenRefresh,\n forceRefresh,\n })\n\n if (!isAccessTokenFresh) {\n await dispatch('refreshToken', true)\n }\n\n return getters.accessToken\n },\n\n // Validates the current user's token and refreshes it using Firebase\n // with new data from the API.\n async firebaseRefreshToken({ commit }, forceRefresh = false) {\n const currentUser = firebase.auth().currentUser\n commit('SET_USERNAME', currentUser?.email)\n\n return currentUser\n .getIdToken(forceRefresh)\n .then(function(idToken) {\n commit('SET_ACCESS_TOKEN', idToken)\n return Promise.resolve(success())\n })\n .catch(function(error) {\n console.warn(error)\n\n // Handle error\n commit('SET_USER_TO_UNAUTHENTICATED')\n return Promise.resolve(fail(error))\n })\n },\n\n async resetPasswordAsync({ commit }, payload) {\n commit('START_LOADING')\n\n return await firebase\n .auth()\n .sendPasswordResetEmail(payload.email)\n .then(() => {\n toast.success(this.$i18n.t('auth.resetPasswordSuccessText'))\n return success()\n })\n .catch((error) => {\n let message = ''\n if (error.code === 'auth/user-not-found')\n message = this.$i18n.t(\n 'auth.resetPasswordAccountDoesNotExistErrorText'\n )\n else message = error.message\n\n return fail([], message)\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n /**\n * Used to reauthenticate a user before a sensative action (e.g. change password, change email address)\n * This is a security requirement enforced by firebase.\n * Read more: https://firebase.google.com/docs/reference/js/firebase.User#reauthenticatewithcredential\n * @param {String} password\n */\n async reauthenticateWithCredentialsAsync({ commit }, password) {\n commit('START_LOADING')\n\n const user = firebase.auth().currentUser\n\n // Prepare auth credentials\n const credentials = firebase.auth.EmailAuthProvider.credential(\n user.email,\n password\n )\n\n // Use credentials to reauthenticate user\n return await user\n .reauthenticateWithCredential(credentials)\n .then(() => {\n return success()\n })\n .catch(() => {\n toast.error(\n this.$i18n.t('auth.failedToAuthenticateWithCredsErrorText')\n )\n return fail()\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n async changePasswordAsync({ commit }, payload) {\n commit('START_LOADING')\n\n const user = firebase.auth().currentUser\n\n return await user\n .updatePassword(payload.newPass)\n .then(() => {\n toast.success(this.$i18n.t('auth.changePasswordSuccessText'))\n return success()\n })\n .catch((error) => {\n return fail(error)\n })\n .finally(() => commit('FINISH_LOADING'))\n },\n\n /**\n * Loads user profile from ClientLogin API.\n * @param {Boolean} forceRefresh forces refresh of user profile, bypassing the cache\n * @returns\n */\n async getCurrentUserProfile(\n { commit, dispatch, getters },\n forceRefresh = false\n ) {\n // 1. Check cache freshness\n if (\n getters.currentUser &&\n getters.permissions &&\n getters.permissions.length > 0 &&\n isCacheFresh({\n cacheDuration: 2,\n durationUnits: DurationUnits.HOUR,\n lastUpdated: getters.currentUser.lastUpdated,\n forceRefresh,\n })\n )\n return success(getters.currentUser)\n\n // 2. Load profile from API & cache user profile\n commit('START_LOADING')\n\n try {\n const response = await this.$api.user.get()\n if (isSuccess(response.status)) {\n commit('SET_CURRENT_USER', response.data.contact)\n commit('SET_USER_PERMISSIONS', response.data.links)\n\n // After permission tree is set, verify that currently selected client\n // existing within tree\n dispatch('client/validateSelectedClient', null, { root: true })\n\n commit('SET_USER_GENERALFILES', response.data.generalFiles)\n\n return success(getters.currentUser)\n }\n } catch (ex) {\n const errorResponse = ErrorResponseFactory(ex, this.$i18n)\n\n await dispatch(\n 'logStoreException',\n new StoreErrorDTO({\n err: ex,\n module: getters.moduleName,\n errorResponse,\n }),\n { root: true }\n )\n\n return fail(errorResponse)\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n clear({ commit }) {\n commit('SET_USER_TO_UNAUTHENTICATED')\n },\n },\n}\n","import axios from 'axios'\nimport $date from '@services/date/index.js'\n\nconst getDefaultState = () => {\n return {\n cached: {\n list: [],\n lastUpdated: null,\n },\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'users',\n user: (state) => (id) => {\n return state.cached.find((user) => user.id === id)\n },\n users: (state) => {\n return state.cached\n },\n isLoadingUsers: (state) => state.loadingCount > 0,\n isLoadingUserCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n CACHE_USERS(state, users) {\n state.cached.list = users\n state.cached.lastUpdated = users ? $date() : null\n },\n CACHE_USER(state, newUser) {\n state.cached.list.push(newUser)\n },\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async fetchUser({ commit, state, rootState }, { username }) {\n // 1. Check if we already have the user as a current user.\n const { currentUser } = rootState.auth\n if (currentUser && currentUser.username === username) {\n return Promise.resolve(currentUser)\n }\n\n // 2. Check if we've already fetched and cached the user.\n const matchedUser = state.cached.list.find(\n (user) => user.username === username\n )\n if (matchedUser) {\n return Promise.resolve(matchedUser)\n }\n\n // 3. Fetch the user from the API and cache it in case\n // we need it again in the future.\n return axios.get(`/api/users/${username}`).then((response) => {\n const user = response.data\n commit('CACHE_USER', user)\n return user\n })\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\n\nexport default {\n namespaced: true,\n state: {\n loadingCount: 0,\n crudLoadingCount: 0,\n },\n getters: {\n moduleName: () => 'single-invoice',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n },\n actions: {\n async getInvoiceByInvoiceNo({ commit }, invoiceNo) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.invoices.getInvoiceByInvoiceNo(\n invoiceNo\n )\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail(null, '', 403)\n }\n\n toast.error('Cannot load invoice')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","export default class AddressViewModel {\n constructor({\n line1,\n line2,\n suburb,\n state,\n postcode,\n country,\n latitude,\n longitude,\n fullAddress,\n } = {}) {\n /**\n * Street address, line 1\n * @type {String}\n * @example '44 Diamond Avenue'\n */\n this.line1 = line1\n\n /**\n * Street address, line 2\n * @type {String}\n * @example 'Level 14'\n */\n this.line2 = line2\n\n /**\n * @type {String}\n * @example 'Collingwood'\n */\n this.suburb = suburb\n\n /**\n * @type {String}\n * @example 'Victoria'\n */\n this.state = state\n\n /**\n * @type {String}\n * @example '3000'\n */\n this.postcode = postcode\n\n /**\n * @type {String}\n * @example 'Australia'\n */\n this.country = country\n\n /**\n * @type {Number}\n * @example 34.51223\n */\n this.latitude = parseFloat(latitude)\n\n /**\n * @type {Number}\n * @example -145.92812\n */\n this.longitude = parseFloat(longitude)\n\n /**\n * The combination of all the address parts into a single string\n * @type {String}\n * @example '44 Diamond Avenue Level 14 Collingwood Victoria 3000 Australia'\n */\n this.fullAddress = fullAddress\n }\n}\n","import AddressViewModel from '../locations/addressViewModel'\n\nexport default class ClientGroupOverviewViewModel {\n constructor({\n address = null,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings = 0,\n totalBookings = 0,\n } = {}) {\n /**\n * Location's address\n * @type {AddressViewModel}\n */\n this.address = address ? new AddressViewModel(address) : null\n\n /**\n * @type {Number}\n */\n this.clientId = clientId\n\n /**\n * @type {String}\n */\n this.clientName = clientName.trim()\n\n /**\n * @type {Number}\n */\n this.locationId = locationId\n\n /**\n * @type {String}\n */\n this.locationName = locationName.trim()\n\n const hasSameName =\n this.clientName === this.locationName || !this.locationName\n\n /**\n * Name to display in the UI. It's a combination of the client and location name.\n * If the loction name is the same or unset, it will just display the client name.\n * @type {String}\n */\n this.displayName = `${this.clientName}${hasSameName ? '' : ' - '}${\n hasSameName ? '' : this.locationName\n }`\n\n /**\n * Number of unfilled bookings\n * @type {Number}\n */\n this.openBookings = openBookings\n\n /**\n * Number of total bookings\n * @type {Number}\n */\n this.totalBookings = totalBookings\n }\n}\n","import ClientGroupOverviewViewModel from './clientGroupOverviewViewModel'\n\nexport default class ClientGroupOverviewWithFillRateViewModel extends ClientGroupOverviewViewModel {\n constructor({\n address = null,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings = 0,\n totalBookings = 0,\n } = {}) {\n super({\n address,\n clientId,\n clientName,\n locationId,\n locationName,\n openBookings,\n totalBookings,\n })\n\n this.filledBookings = totalBookings - openBookings\n\n let fillRatePercentage = -1\n\n if (!totalBookings && !openBookings) {\n fillRatePercentage = -1\n } else {\n const percentage = ((totalBookings - openBookings) / totalBookings) * 100\n\n const normalisedPercentage =\n percentage <= 0 || isNaN(percentage) ? 0 : percentage\n\n fillRatePercentage = Math.round(normalisedPercentage)\n }\n\n /**\n * A rounded percent of the number of bookings filled for this location\n * @type {Number}\n */\n this.fillRatePercentage = fillRatePercentage\n }\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\nimport { getSavedState, saveState, deleteState } from '@/helpers/cache-helpers'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\nimport ClientGroupOverviewWithFillRateViewModel from '@/models/overview/clientGroupOverviewWithFillRateViewModel'\n\nconst getDefaultState = () => {\n return {\n id: getSavedState('client.id'),\n name: getSavedState('client.name'),\n clientList: getSavedState('selectedClients') || [],\n grades: [],\n owners: [],\n classifications: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n classificationLoadingCount: 0,\n detailsLoadingCount: 0,\n gradesLoadingCount: 0,\n overviewLoadingCount: 0,\n overviewDataLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'client',\n getSelectedClients: (state) => state.clientList,\n grades: (state) => (clientId) => {\n const grades = state.grades.find((x) => x.clientId === clientId)\n\n return grades ? orderBy(grades.list, ['name'], ['asc']) : []\n },\n owner: (state) => (clientId) => {\n const owner = state.owners.find((x) => x.clientId === clientId)\n return owner?.data\n },\n classifications: (state) => (clientId) => {\n const classifications = state.classifications.find(\n (x) => x.clientId === clientId\n )\n\n return classifications?.list || []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingClassifications: (state) => state.classificationLoadingCount > 0,\n isLoadingClientDetails: (state) => state.detailsLoadingCount > 0,\n isLoadingGrades: (state) => state.gradesLoadingCount > 0,\n isLoadingOverview: (state) => state.overviewLoadingCount > 0,\n isLoadingOverviewData: (state) => state.overviewDataLoadingCount > 0,\n mapSelectedClientsToClientsInPermissions: (\n state,\n getters,\n rootState,\n rootGetters\n ) => {\n const allClientsInPerms = rootGetters['auth/getAllClients']\n const mappedClients = allClientsInPerms.filter((client) =>\n getters.getSelectedClients.includes(client.clientId)\n )\n\n return mappedClients\n },\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_CLASSIFICATIONS(state) {\n state.classificationLoadingCount++\n },\n FINISH_LOADING_CLASSIFICATIONS(state) {\n state.classificationLoadingCount--\n },\n START_LOADING_DETAILS(state) {\n state.detailsLoadingCount++\n },\n FINISH_LOADING_DETAILS(state) {\n state.detailsLoadingCount--\n },\n START_LOADING_GRADES(state) {\n state.gradesLoadingCount++\n },\n FINISH_LOADING_GRADES(state) {\n state.gradesLoadingCount--\n },\n START_LOADING_OVERVIEW(state) {\n state.overviewLoadingCount++\n },\n FINISH_LOADING_OVERVIEW(state) {\n state.overviewLoadingCount--\n },\n START_LOADING_OVERVIEW_DATA(state) {\n state.overviewDataLoadingCount++\n },\n FINISH_LOADING_OVERVIEW_DATA(state) {\n state.overviewDataLoadingCount--\n },\n /**\n * TODO: Remove\n */\n SET_CLIENT(state, { clientId, clientName }) {\n state.id = clientId\n state.name = clientName\n\n saveState('client.id', clientId)\n saveState('client.name', clientName)\n },\n /**\n * @param {*} state\n * @param {number[]} clientsIds List of client ids\n */\n SET_CLIENTS(state, clientIds) {\n const sortedClientIds = clientIds.sort((a, b) => a - b) // Asc number sort\n\n state.clientList = sortedClientIds\n saveState('selectedClients', sortedClientIds)\n },\n UPSERT_CLIENT_GRADES(state, payload) {\n const found = state.grades.find((x) => x.clientId === payload.clientId)\n\n if (!found) {\n return state.grades.push({\n clientId: payload.clientId,\n list: payload.grades,\n })\n }\n\n found.list = payload.grades\n },\n UPSERT_ADDITIONAL_DETAILS(state, payload) {\n const found = state.owners.find((x) => x.clientId === payload.clientId)\n\n if (!found) {\n return state.owners.push({\n clientId: payload.clientId,\n data: payload.owner,\n })\n }\n\n found.data = payload.owner\n },\n UPSERT_CLIENT_CLASSIFICATIONS(state, payload) {\n const found = state.classifications.find(\n (x) => x.clientId === payload.clientId\n )\n\n if (!found) {\n return state.classifications.push({\n clientId: payload.clientId,\n list: payload.classifications,\n })\n }\n\n found.list = payload.classifications\n },\n CLEAR_STORE(state) {\n // Clear out LocalStorage\n deleteState('client.id')\n deleteState('client.name')\n\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n setClient({ commit, rootGetters, dispatch }, clientId) {\n const client = rootGetters['auth/getClient'](clientId)\n\n if (!client) {\n toast.error(this.$i18n.t('client.clientNotFoundErrorText'))\n return fail()\n }\n\n dispatch('loadClientAdditionalInformation', clientId)\n\n // Clear store modules of client specific data before switching\n dispatch('invoices/clear', {}, { root: true })\n dispatch('bookings/clear', {}, { root: true })\n dispatch('contacts/clear', {}, { root: true })\n dispatch('timesheets/clear', {}, { root: true })\n\n commit('SET_CLIENT', client)\n return success()\n },\n async loadClientAdditionalInformation({ commit, getters }, clientId) {\n const cId = clientId\n\n if (!cId)\n return Promise.resolve(\n fail('', 'Must select a client first before loading client details')\n )\n\n // Check cache\n const isCached = getters.owner(cId)\n\n if (isCached) return Promise.resolve(success(isCached))\n\n commit('START_LOADING_DETAILS')\n\n try {\n const response = await this.$api.client.getAdditionalDetails(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_ADDITIONAL_DETAILS', {\n owner: isHttpStatus(response.status, 204) ? [] : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load client details')\n return fail()\n } finally {\n commit('FINISH_LOADING_DETAILS')\n }\n },\n async loadClientGrades({ commit, getters }, clientId) {\n const cId = clientId\n\n // Check cached client grades for selected client\n const isCached = getters.grades(cId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_GRADES')\n\n try {\n const response = await this.$api.client.getClientGrades(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CLIENT_GRADES', {\n grades: isHttpStatus(response.status, 204) ? [] : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load grades')\n return fail()\n } finally {\n commit('FINISH_LOADING_GRADES')\n }\n },\n async loadClientClassifications({ commit, getters }, clientId) {\n const cId = clientId\n\n // Check cached client classifications for selected client\n const isCached = getters.classifications(cId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_CLASSIFICATIONS')\n\n try {\n const response = await this.$api.client.getClientClassifications(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CLIENT_CLASSIFICATIONS', {\n classifications: isHttpStatus(response.status, 204)\n ? []\n : response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load classifications')\n return fail()\n } finally {\n commit('FINISH_LOADING_CLASSIFICATIONS')\n }\n },\n /**\n * Validates that the user has the permission to access the currently\n * selected client. If not, this client will be removed and another\n * will be selected\n */\n async validateSelectedClient({ rootGetters, dispatch }) {\n if (!getSavedState('client.id')) return\n\n const clientExistsInPermissionTree = rootGetters['auth/getClient'](\n getSavedState('client.id')\n )\n\n // If client exists, no further action required\n if (clientExistsInPermissionTree) return\n\n // User doesn't have access to current client, select first available client\n const firstAvailableClient = rootGetters['auth/firstAvailableClient']\n await dispatch('setClient', firstAvailableClient.clientId)\n },\n async loadClientGroupOverviewSchoolStatus(\n { commit, rootGetters },\n { clientGroupId, filterDate }\n ) {\n commit('START_LOADING_OVERVIEW_DATA')\n\n try {\n const timeZone = rootGetters[\n 'auth/getTimezoneFromFirstClientGroupLocation'\n ](clientGroupId)\n\n const response = await this.$api.clientGroups.getOverviewData(\n clientGroupId,\n filterDate,\n timeZone\n )\n\n if (isSuccess(response.status)) {\n return success(\n isNonEmptyArray(response.data)\n ? response.data.map(\n (overviewVM) =>\n new ClientGroupOverviewWithFillRateViewModel(overviewVM)\n )\n : []\n )\n }\n } catch (ex) {\n return fail(\n ex.response?.data || {\n message: this.$i18n.t(\n 'clientGroupOverview.error.noMessageFromServer'\n ),\n }\n )\n } finally {\n commit('FINISH_LOADING_OVERVIEW_DATA')\n }\n },\n setClientList({ commit }, clients) {\n commit('SET_CLIENTS', clients)\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess } from '@/helpers/http-status-helpers'\n\nconst getDefaultState = () => {\n return {\n loadingCount: 0,\n crudLoadingCount: 0,\n downloadingFileCount: 0,\n invoices: [],\n invoicesTotal: 0,\n serverCurrentPage: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'invoices',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isDownloadingFile: (state) => state.downloadingFileCount > 0,\n invoices: (state) => state.invoices,\n invoicesTotal: (state) => state.invoicesTotal,\n serverCurrentPage: (state) => state.serverCurrentPage,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_INVOICES(state, invoices) {\n state.invoices = invoices\n },\n SET_INVOICES_TOTAL(state, total) {\n state.invoicesTotal = total\n },\n SET_SERVER_CURRENT_PAGE(state, page) {\n state.serverCurrentPage = page\n },\n START_DOWNLOADING_FILE(state) {\n state.downloadingFileCount++\n },\n FINISH_DOWNLOADING_FILE(state) {\n state.downloadingFileCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadInvoices({ commit }, { page, pageSize }) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.invoices.get('', {\n skip: (page - 1) * pageSize,\n take: pageSize,\n })\n\n if (isSuccess(response.status)) {\n commit('SET_INVOICES', response.data.invoices)\n commit('SET_INVOICES_TOTAL', response.data.total)\n commit('SET_SERVER_CURRENT_PAGE', response.data.currentPage)\n\n return success(response.data)\n }\n } catch {\n toast.error(this.$i18n.t('error.errorGenericApiErrorText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async getOustandingInvoicesCount({ commit }) {\n commit('START_LOADING')\n try {\n const response = await this.$api.invoices.getOustandingInvoicesCount()\n if (isSuccess(response.status)) {\n return success(response.data.outstandingInvoicesCount)\n }\n } catch {\n toast.error(`Failed to load Oustanding Invoices Count`)\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async downloadInvoiceFile({ commit }, invoiceId) {\n commit('START_DOWNLOADING_FILE')\n\n try {\n const response = await this.$api.invoices.getInvoiceFile(invoiceId)\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: 'application/pdf' })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toast.error(toastErrorMessage)\n return fail()\n } finally {\n commit('FINISH_DOWNLOADING_FILE')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","export default class TimesheetsSummaryClientViewModel {\n constructor({\n clientId = 0,\n clientName = '',\n approvedCount = 0,\n pendingReviewCount = 0,\n pendingApprovalCount = 0,\n } = {}) {\n /**\n * @type {Number}\n */\n this.clientId = clientId\n /**\n * @type {String}\n */\n this.clientName = clientName\n /**\n * @type {Number}\n */\n this.approvedCount = approvedCount\n /**\n * @type {Number}\n */\n this.pendingReviewCount = pendingReviewCount\n /**\n * @type {Number}\n */\n this.pendingApprovalCount = pendingApprovalCount\n }\n}\n","export default class TimesheetsSummaryCandidateViewModel {\n constructor({\n candidateId = 0,\n candidateName = '',\n approvedCount = 0,\n pendingReviewCount = 0,\n pendingApprovalCount = 0,\n } = {}) {\n /**\n * @type {Number}\n */\n this.candidateId = candidateId\n /**\n * @type {String}\n */\n this.candidateName = candidateName\n /**\n * @type {Number}\n */\n this.approvedCount = approvedCount\n /**\n * @type {Number}\n */\n this.pendingReviewCount = pendingReviewCount\n /**\n * @type {Number}\n */\n this.pendingApprovalCount = pendingApprovalCount\n }\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport TimesheetsSummaryClientViewModel from './timesheetsSummaryClientViewModel'\nimport TimesheetsSummaryCandidateViewModel from './timesheetsSummaryCandidateViewModel'\n\nexport default class TimesheetsSummaryViewModel {\n constructor({\n clientTimesheetsSummary = [],\n candidateTimesheetsSummary = [],\n totalApprovedCount = 0,\n totalPendingReviewCount = 0,\n totalPendingApprovalCount = 0,\n } = {}) {\n /**\n * @type {Number}\n */\n this.totalApprovedCount = totalApprovedCount\n /**\n * @type {Number}\n */\n this.totalPendingReviewCount = totalPendingReviewCount\n /**\n * @type {Number}\n */\n this.totalPendingApprovalCount = totalPendingApprovalCount\n /**\n * @type {Array}\n */\n this.clientTimesheetsSummary = isNonEmptyArray(clientTimesheetsSummary)\n ? clientTimesheetsSummary.map(\n (client) => new TimesheetsSummaryClientViewModel(client)\n )\n : []\n /**\n * @type {Array}\n */\n this.candidateTimesheetsSummary = isNonEmptyArray(\n candidateTimesheetsSummary\n )\n ? candidateTimesheetsSummary.map(\n (candidate) => new TimesheetsSummaryCandidateViewModel(candidate)\n )\n : []\n }\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport TimesheetsPendingApprovalViewModel from './timesheetsPendingApprovalViewModel'\n\nexport default class TimesheetsViewModel {\n constructor({\n approvedCount = 0,\n pendingReviewCount = 0,\n pendingApprovalList = [],\n } = {}) {\n /**\n * @type {Number}\n */\n this.approvedCount = approvedCount\n\n /**\n * @type {Number}\n */\n this.pendingReviewCount = pendingReviewCount\n\n /**\n * @type {Array}\n */\n this.pendingApprovalList = isNonEmptyArray(pendingApprovalList)\n ? pendingApprovalList.map(\n (pendingApproval) =>\n new TimesheetsPendingApprovalViewModel(pendingApproval)\n )\n : []\n }\n}\n","/**\n * Hypertext Transfer Protocol (HTTP) response status codes.\n *\n * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}\n * @see {@link https://gist.github.com/RWOverdijk/6cef816cfdf5722228e01cc05fd4b094}\n */\nexport default Object.freeze({\n /**\n * The server has received the request headers and the client should proceed to send the request body\n * (in the case of a request for which a body needs to be sent; for example, a POST request).\n * Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.\n * To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request\n * and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.\n */\n Continue: 100,\n\n /**\n * The requester has asked the server to switch protocols and the server has agreed to do so.\n */\n SwitchingProtocols: 101,\n\n /**\n * A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n * This prevents the client from timing out and assuming the request was lost.\n */\n Processing: 102,\n\n /**\n * Standard response for successful HTTP requests.\n * The actual response will depend on the request method used.\n * In a GET request, the response will contain an entity corresponding to the requested resource.\n * In a POST request, the response will contain an entity describing or containing the result of the action.\n */\n Ok: 200,\n\n /**\n * The request has been fulfilled, resulting in the creation of a new resource.\n */\n Created: 201,\n\n /**\n * The request has been accepted for processing, but the processing has not been completed.\n * The request might or might not be eventually acted upon, and may be disallowed when processing occurs.\n */\n Accepted: 202,\n\n /**\n * SINCE HTTP/1.1\n * The server is a transforming proxy that received a 200 OK from its origin,\n * but is returning a modified version of the origin's response.\n */\n NonAuthoritativeInformation: 203,\n\n /**\n * The server successfully processed the request and is not returning any content.\n */\n NoContent: 204,\n\n /**\n * The server successfully processed the request, but is not returning any content.\n * Unlike a 204 response, this response requires that the requester reset the document view.\n */\n ResetContent: 205,\n\n /**\n * The server is delivering only part of the resource (byte serving) due to a range header sent by the client.\n * The range header is used by HTTP clients to enable resuming of interrupted downloads,\n * or split a download into multiple simultaneous streams.\n */\n PartialContent: 206,\n\n /**\n * The message body that follows is an XML message and can contain a number of separate response codes,\n * depending on how many sub-requests were made.\n */\n MultiStatus: 207,\n\n /**\n * The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,\n * and are not being included again.\n */\n AlreadyReported: 208,\n\n /**\n * The server has fulfilled a request for the resource,\n * and the response is a representation of the result of one or more instance-manipulations applied to the current instance.\n */\n ImUsed: 226,\n\n /**\n * Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).\n * For example, this code could be used to present multiple video format options,\n * to list files with different filename extensions, or to suggest word-sense disambiguation.\n */\n MultipleChoices: 300,\n\n /**\n * This and all future requests should be directed to the given URI.\n */\n MovedPermanently: 301,\n\n /**\n * This is an example of industry practice contradicting the standard.\n * The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect\n * (the original describing phrase was \"Moved Temporarily\"), but popular browsers implemented 302\n * with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307\n * to distinguish between the two behaviours. However, some Web applications and frameworks\n * use the 302 status code as if it were the 303.\n */\n Found: 302,\n\n /**\n * SINCE HTTP/1.1\n * The response to the request can be found under another URI using a GET method.\n * When received in response to a POST (or PUT/DELETE), the client should presume that\n * the server has received the data and should issue a redirect with a separate GET message.\n */\n SeeOther: 303,\n\n /**\n * Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.\n * In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.\n */\n NotModified: 304,\n\n /**\n * SINCE HTTP/1.1\n * The requested resource is available only through a proxy, the address for which is provided in the response.\n * Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.\n */\n UseProxy: 305,\n\n /**\n * No longer used. Originally meant \"Subsequent requests should use the specified proxy.\"\n */\n SwitchProxy: 306,\n\n /**\n * SINCE HTTP/1.1\n * In this case, the request should be repeated with another URI; however, future requests should still use the original URI.\n * In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.\n * For example, a POST request should be repeated using another POST request.\n */\n TemporaryRedirect: 307,\n\n /**\n * The request and all future requests should be repeated using another URI.\n * 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.\n * So, for example, submitting a form to a permanently redirected resource may continue smoothly.\n */\n PermanentRedirect: 308,\n\n /**\n * The server cannot or will not process the request due to an apparent client error\n * (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).\n */\n BadRequest: 400,\n\n /**\n * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet\n * been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the\n * requested resource. See Basic access authentication and Digest access authentication. 401 semantically means\n * \"unauthenticated\",i.e. the user does not have the necessary credentials.\n */\n Unauthorized: 401,\n\n /**\n * Reserved for future use. The original intention was that this code might be used as part of some form of digital\n * cash or micro payment scheme, but that has not happened, and this code is not usually used.\n * Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.\n */\n PaymentRequired: 402,\n\n /**\n * The request was valid, but the server is refusing action.\n * The user might not have the necessary permissions for a resource.\n */\n Forbidden: 403,\n\n /**\n * The requested resource could not be found but may be available in the future.\n * Subsequent requests by the client are permissible.\n */\n NotFound: 404,\n\n /**\n * A request method is not supported for the requested resource;\n * for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.\n */\n MethodNotAllowed: 405,\n\n /**\n * The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.\n */\n NotAcceptable: 406,\n\n /**\n * The client must first authenticate itself with the proxy.\n */\n ProxyAuthenticationRequired: 407,\n\n /**\n * The server timed out waiting for the request.\n * According to HTTP specifications:\n * \"The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.\"\n */\n RequestTimeout: 408,\n\n /**\n * Indicates that the request could not be processed because of conflict in the request,\n * such as an edit conflict between multiple simultaneous updates.\n */\n Conflict: 409,\n\n /**\n * Indicates that the resource requested is no longer available and will not be available again.\n * This should be used when a resource has been intentionally removed and the resource should be purged.\n * Upon receiving a 410 status code, the client should not request the resource in the future.\n * Clients such as search engines should remove the resource from their indices.\n * Most use cases do not require clients and search engines to purge the resource, and a \"404 Not Found\" may be used instead.\n */\n Gone: 410,\n\n /**\n * The request did not specify the length of its content, which is required by the requested resource.\n */\n LengthRequired: 411,\n\n /**\n * The server does not meet one of the preconditions that the requester put on the request.\n */\n PreconditionFailed: 412,\n\n /**\n * The request is larger than the server is willing or able to process. Previously called \"Request Entity Too Large\".\n */\n PayloadTooLarge: 413,\n\n /**\n * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,\n * in which case it should be converted to a POST request.\n * Called \"Request-URI Too Long\" previously.\n */\n UriTooLong: 414,\n\n /**\n * The request entity has a media type which the server or resource does not support.\n * For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.\n */\n UnsupportedMediaType: 415,\n\n /**\n * The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.\n * For example, if the client asked for a part of the file that lies beyond the end of the file.\n * Called \"Requested Range Not Satisfiable\" previously.\n */\n RangeNotSatisfiable: 416,\n\n /**\n * The server cannot meet the requirements of the Expect request-header field.\n */\n ExpectationFailed: 417,\n\n /**\n * This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,\n * and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by\n * teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.\n */\n IAmATeapot: 418,\n\n /**\n * The request was directed at a server that is not able to produce a response (for example because a connection reuse).\n */\n MisdirectedRequest: 421,\n\n /**\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UnprocessableEntity: 422,\n\n /**\n * The resource that is being accessed is locked.\n */\n Locked: 423,\n\n /**\n * The request failed due to failure of a previous request (e.g., a PROPPATCH).\n */\n FailedDependency: 424,\n\n /**\n * The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.\n */\n UpgradeRequired: 426,\n\n /**\n * The origin server requires the request to be conditional.\n * Intended to prevent \"the 'lost update' problem, where a client\n * GETs a resource's state, modifies it, and PUTs it back to the server,\n * when meanwhile a third party has modified the state on the server, leading to a conflict.\"\n */\n PreconditionRequired: 428,\n\n /**\n * The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.\n */\n TooManyRequests: 429,\n\n /**\n * The server is unwilling to process the request because either an individual header field,\n * or all the header fields collectively, are too large.\n */\n RequestHeaderFieldsTooLarge: 431,\n\n /**\n * A server operator has received a legal demand to deny access to a resource or to a set of resources\n * that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.\n */\n UnavailableForLegalReasons: 451,\n\n /**\n * A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.\n */\n InternalServerError: 500,\n\n /**\n * The server either does not recognize the request method, or it lacks the ability to fulfill the request.\n * Usually this implies future availability (e.g., a new feature of a web-service API).\n */\n NotImplemented: 501,\n\n /**\n * The server was acting as a gateway or proxy and received an invalid response from the upstream server.\n */\n BadGateway: 502,\n\n /**\n * The server is currently unavailable (because it is overloaded or down for maintenance).\n * Generally, this is a temporary state.\n */\n ServiceUnavailable: 503,\n\n /**\n * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n */\n GatewayTimeout: 504,\n\n /**\n * The server does not support the HTTP protocol version used in the request\n */\n HttpVersionNotSupported: 505,\n\n /**\n * Transparent content negotiation for the request results in a circular reference.\n */\n VariantAlsoNegotiates: 506,\n\n /**\n * The server is unable to store the representation needed to complete the request.\n */\n InsufficientStorage: 507,\n\n /**\n * The server detected an infinite loop while processing the request.\n */\n LoopDetected: 508,\n\n /**\n * Further extensions to the request are required for the server to fulfill it.\n */\n NotExtended: 510,\n\n /**\n * The client needs to authenticate to gain network access.\n * Intended for use by intercepting proxies used to control access to the network (e.g., \"captive portals\" used\n * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).\n */\n NetworkAuthenticationRequired: 511,\n})\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport TimesheetsSummaryViewModel from '@/models/timesheets/timesheetsSummaryViewModel'\nimport TimesheetsViewModel from '@/models/timesheets/timesheetsViewModel'\nimport HttpStatusCodes from '@/shared/constants/api/HttpStatusCodes'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'timesheets',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadTimesheetsSummary({ commit, rootGetters }) {\n commit('START_LOADING')\n try {\n const cIds = rootGetters['client/getSelectedClients']\n const response = await this.$api.timesheets.getTimesheetsSummary(cIds)\n\n if (isSuccess(response.status)) {\n return success(new TimesheetsSummaryViewModel(response.data))\n }\n } catch {\n toast.error(this.$i18n.t('timesheets.summarytLoadFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async loadTimesheets({ commit }, clientId) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.timesheets.get(clientId)\n\n if (isSuccess(response.status)) {\n return success(new TimesheetsViewModel(response.data))\n }\n } catch {\n toast.error(this.$i18n.t('timesheets.loadFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async loadTimesheetsFilteredByCandidate(\n { commit, rootGetters },\n candidateId\n ) {\n commit('START_LOADING')\n\n try {\n const cIds = rootGetters['client/getSelectedClients']\n const response = await this.$api.timesheets.getTimesheetsFilteredByCandidate(\n candidateId,\n cIds\n )\n\n if (isSuccess(response.status)) {\n return success(new TimesheetsViewModel(response.data))\n }\n } catch {\n toast.error(this.$i18n.t('timesheets.loadFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async submitTimesheetsForApproval({ commit }, timesheets) {\n commit('START_LOADING_CRUD')\n\n try {\n const response = await this.$api.timesheets.post('', timesheets)\n\n // Check if there were any timesheets that couldn't be processed\n if (response.status === HttpStatusCodes.MultiStatus) {\n toast.error(\n this.$i18n.t('timesheets.submit.toasts.submittedWithIssues')\n )\n } else {\n toast.success(this.$i18n.t('timesheets.submissionSuccessToastText'))\n }\n\n return success(response.data, null, response.status)\n } catch {\n toast.error(this.$i18n.t('timesheets.submissionFailureToastText'))\n return fail()\n } finally {\n commit('FINISH_LOADING_CRUD')\n }\n },\n async downloadTimesheet({ commit }, timesheetRecordId) {\n commit('START_LOADING')\n try {\n const response = await this.$api.timesheets.downloadTimesheetFile(\n timesheetRecordId\n )\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: 'application/pdf' })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toast.error(toastErrorMessage)\n\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isHttpStatus, isSuccess } from '@/helpers/http-status-helpers'\n\nexport default {\n namespaced: true,\n state: {\n canListLoadingCount: 0,\n loadingCount: 0,\n crudLoadingCount: 0,\n displayPic: null,\n file: null,\n candidateList: [],\n },\n getters: {\n moduleName: () => 'candidate',\n isCanListLoading: (state) => state.canListLoadingCount > 0,\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n START_CANLIST_LOADING(state) {\n state.canListLoadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n FINISH_CANLIST_LOADING(state) {\n state.canListLoadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_CANDIDATE_LIST(state, data) {\n state.candidateList = data\n },\n },\n actions: {\n async loadCandidate({ commit }, id) {\n commit('START_LOADING')\n try {\n const response = await this.$api.candidate.getCandidateDetails(id)\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch {\n toast.error('Candidate data failed to load')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n\n async getCandidateList({ commit }, clientID) {\n commit('START_CANLIST_LOADING')\n try {\n const response = await this.$api.candidate.getCandidateList(clientID)\n if (isSuccess(response.status)) {\n commit('SET_CANDIDATE_LIST', response.data)\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail([], '', 403)\n }\n\n toast.error(this.$i18n.t('candidateList.candidateListErrorCannotLoad'))\n return fail()\n } finally {\n commit('FINISH_CANLIST_LOADING')\n }\n },\n\n async getDisplayPic({ commit }, id) {\n commit('START_LOADING')\n try {\n const response = await this.$api.candidate.getDisplayPic(id)\n if (isSuccess(response.status)) {\n return success(response.data.base64ProfileImg)\n }\n } catch {\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","import config from '@/common/config'\nimport { fail, success } from '@/helpers/result-helper'\nimport { isSuccess } from '@/helpers/http-status-helpers'\nimport toasts from '@/services/toasts/index'\nimport { getType } from 'mime'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'file',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async download({ commit }, fileId) {\n commit('START_LOADING')\n try {\n const response = await this.$api.file.createFileAccessToken(fileId)\n if (isSuccess(response.status)) {\n const token = response.data.accessKey\n const baseURL = `${config.get('apiUrl')}v${config.get('apiVersion')}`\n const fileURL = `${baseURL}/file/(${token})`\n try {\n const fileResponse = await this.$api.file.get(`(${token})`)\n if (isSuccess(fileResponse.status)) {\n window.location = fileURL\n }\n } catch (ex) {\n throw Error('Download Failed')\n }\n return success()\n } else {\n toasts.error('Download Failed')\n }\n } catch {\n toasts.error('Download Failed')\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n async downloadGeneralFile({ commit }, filePath) {\n commit('START_LOADING')\n\n try {\n const response = await this.$api.file.getGeneralFile(filePath)\n\n if (isSuccess(response.status)) {\n const url = window.URL.createObjectURL(\n new Blob([response.data], { type: getType(filePath) })\n )\n return success(url)\n }\n } catch (ex) {\n let toastErrorMessage = this.$i18n.t('error.errorGenericApiErrorText')\n // Try to resolve error response. Response type is Blob, need to convert\n // from blob to json\n try {\n const responseObject = JSON.parse(await ex.response.data.text())\n if (responseObject) toastErrorMessage = responseObject.message\n } catch {}\n\n toasts.error(toastErrorMessage)\n\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n },\n}\n","import { isSuccess } from '@helpers/http-status-helpers'\nimport { success, fail } from '@helpers/result-helper'\nimport toast from '@/services/toasts/index.js'\n\n/**\n * This class is intended for use inside vuex actions.\n * The only required methods are the request and go methods which will execute any function and go starts the operation\n * All requests are wrapped in try catch so the caller need not worry.\n * All other methods return the same instance which allows method chaining different configuration.\n *\n * @example\n * return await new VuexResponse(commit)\n * .request(() => this.$api.locationRestriction.loadAllUpcomingAlerts())\n * .withCommit(\"UPDATE_ALERTS\")\n * .go()\n */\nexport class VuexResponse {\n #commit = null\n constructor(commit) {\n this.#commit = commit\n return this\n }\n\n #requestFn = null\n #updateFn = null\n #stateKey = null\n #showSuccessToast = false\n #showFailureToast = false\n #successToastMessage = ''\n #failToastMessage = ''\n #loadingKey = ''\n #logResult = false\n #isPaginated = false\n #paginationKey = null\n #transformFns = []\n\n /**\n * Provide an api call to be called. Use an arrow function.\n * @param fn\n * @returns {VuexResponse}\n */\n request(fn) {\n this.#requestFn = fn\n return this\n }\n\n /**\n * Provide the name of the commit update function to pass the request data to on successful request.\n * @param updateFnName\n * @returns {VuexResponse}\n */\n withCommit(updateFnName) {\n this.#updateFn = updateFnName\n return this\n }\n\n withSetState(key) {\n this.#stateKey = key\n return this\n }\n\n /**\n * This will enrich the response data with pagination information found in the x-pagination header of the response\n * @param commitKey - optionally provide the commitKey which is passed to the commit function, this can be used to cache the page results\n */\n withPagination(commitKey = null) {\n this.#isPaginated = true\n this.#paginationKey = commitKey\n return this\n }\n\n /**\n * Pass in a transformation function such as map filter or reduce\n * Ensure you return the data in the same format.\n * This function can be called as many times as you like and will queue a list of transformation functions.\n * This will perform the transforms before committing the data\n * @param transformFn\n * @retuns {VuexResponse}\n */\n transform(transformFn) {\n this.#transformFns.push(transformFn)\n return this\n }\n\n /**\n * Enables a success toast if the request is successfull. Optionally provide a custom message\n * @param message\n * @returns {VuexResponse}\n */\n withSuccessToast(message = 'Successfully made change') {\n this.#showSuccessToast = true\n if (message) {\n this.#successToastMessage = message\n }\n return this\n }\n\n /**\n * Enables the failure toast. Optionally provide a message\n * @param message\n * @returns {VuexResponse}\n */\n withFailureToast(message = 'There was an error making the update') {\n this.#showFailureToast = true\n if (message) {\n this.#failToastMessage = message\n }\n return this\n }\n\n /**\n * Provide the commit function names for any custom loaders.\n * These are called at the start and end of the request\n * @param startName\n * @param finishName\n * @returns {VuexResponse}\n */\n withLoading(loadingKey) {\n if (!loadingKey)\n throw new Error('Vuex Action Builder: Loading key required')\n this.#loadingKey = loadingKey\n return this\n }\n\n /**\n * For help debugging. Will log the success data from the response.\n * @returns {VuexResponse}\n */\n logResult() {\n this.#logResult = true\n return this\n }\n\n /**\n * Starts the built operation.\n * @returns {Promise<{data: null, message: string, errors: [], isSuccess: boolean, statusCode: null}>}\n */\n async go() {\n if (!this.#commit) {\n console.error('The commit function has not been passed to the helper.')\n }\n\n if (this.#loadingKey) {\n this.#commit('START_LOADING', this.#loadingKey, { root: true })\n }\n\n try {\n const response = await this.#requestFn()\n\n if (this.#logResult) {\n // eslint-disable-next-line no-console\n console.info(response)\n }\n\n if (isSuccess(response.status)) {\n let data = response.data\n\n while (this.#transformFns.length) {\n const transformer = this.#transformFns.shift()\n data = transformer(data)\n }\n\n if (this.#isPaginated) {\n data = this.#enrichResponseDataWithPagination(response)\n if (this.#paginationKey) data = { ...data, key: this.#paginationKey }\n }\n\n // Map response from server\n if (this.#updateFn) {\n this.#commit(this.#updateFn, data)\n }\n\n if (this.#stateKey) {\n this.#commit('SET_STATE', {\n key: this.#stateKey,\n value: response.data,\n })\n }\n\n if (this.#showSuccessToast) {\n toast.success(this.#successToastMessage)\n }\n\n return success(data)\n }\n } catch (e) {\n console.error(e)\n if (this.#showFailureToast) {\n const message = e.response.data?.error || this.#failToastMessage\n toast.error(message)\n }\n return fail(e.response)\n } finally {\n if (this.#loadingKey) {\n this.#commit('FINISH_LOADING', this.#loadingKey, { root: true })\n }\n }\n }\n\n #enrichResponseDataWithPagination(response) {\n return {\n ...JSON.parse(response.headers['x-pagination']),\n data: response.data,\n }\n }\n}\n","import { fail, success } from '@helpers/result-helper.js'\nimport toast from '@services/toasts/index.js'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport dayjs from '@/services/date/index.js'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\nimport getSelectedDayText from '@/helpers/get-replace-me-selected-day-text'\nimport { VuexResponse } from '@/helpers/vuex-action-builder'\n// eslint-disable-next-line\nimport { BookingOverviewCountsViewModel } from '@/models/bookings/responses/bookingOverviewCountsViewModel'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n loadingCount: 0,\n bookingSummaryLoadingCount: 0,\n crudLoadingCount: 0,\n feedbackFormUrlLoadingCount: 0,\n quickFeedbackSubmittingCount: 0,\n replaceMeStatusCheckLoadingCount: 0,\n submitReplaceMeBookingLoadingCount: 0,\n cancelBookingLoadingCount: 0,\n recentLocations: [],\n replaceMeStatusChecks: [],\n bookingOverview: [],\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'bookings',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingBookingSummary: (state) => state.bookingSummaryLoadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n recentLocations: (state) => state.recentLocations,\n isLoadingFeedbackFormUrl: (state) => state.feedbackFormUrlLoadingCount > 0,\n isLoadingReplaceMeStatusCheck: (state) =>\n state.replaceMeStatusCheckLoadingCount > 0,\n isSubmittingQuickFeedback: (state) =>\n state.quickFeedbackSubmittingCount > 0,\n replaceMeStatusChecks: (state) => (clientId) =>\n state.replaceMeStatusChecks.find((x) => x.clientId === clientId),\n isSubmitReplaceMeLoading: (state) =>\n state.submitReplaceMeBookingLoadingCount > 0,\n isLoadingCancelBooking: (state) => state.cancelBookingLoadingCount > 0,\n bookingOverview: (state) => state.bookingOverview,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_SELECTED_DATE_BOOKINGS(state) {\n state.bookingSummaryLoadingCount++\n },\n FINISH_LOADING_SELECTED_DATE_BOOKINGS(state) {\n state.bookingSummaryLoadingCount--\n },\n START_LOADING_BOOKINGS_OVERVIEW(state) {\n state.bookingSummaryLoadingCount++\n },\n FINISH_LOADING_BOOKINGS_OVERVIEW(state) {\n state.bookingSummaryLoadingCount--\n },\n START_LOADING_REPLACE_ME_STATUS_CHECK(state) {\n state.replaceMeStatusCheckLoadingCount++\n },\n FINISH_LOADING_REPLACE_ME_STATUS_CHECK(state) {\n state.replaceMeStatusCheckLoadingCount--\n },\n START_LOADING_SUBMIT_REPLACE_ME(state) {\n state.submitReplaceMeBookingLoadingCount++\n },\n FINISH_LOADING_SUBMIT_REPLACE_ME(state) {\n state.submitReplaceMeBookingLoadingCount--\n },\n START_LOADING_CANCEL_BOOKING(state) {\n state.cancelBookingLoadingCount++\n },\n FINISH_LOADING_CANCEL_BOOKING(state) {\n state.cancelBookingLoadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_RECENT_BOOKING_LOCATION(state, locationId) {\n const found = state.recentLocations.find(\n (x) => x.locationId === locationId\n )\n\n if (found) {\n found.timestamp = dayjs()\n return\n }\n\n state.recentLocations.push({ locationId, timestamp: dayjs() })\n },\n /**\n * @param {*} state\n * @param {BookingOverviewCountsViewModel[]} data\n */\n SET_BOOKING_OVERVIEW(state, data) {\n state.bookingOverview = data\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n START_LOADING_FEEDBACK_FORM_URL(state) {\n state.feedbackFormUrlLoadingCount++\n },\n FINISH_LOADING_FEEDBACK_FORM_URL(state) {\n state.feedbackFormUrlLoadingCount--\n },\n START_SUBMITTING_QUICK_FEEDBACK(state) {\n state.quickFeedbackSubmittingCount++\n },\n FINISH_SUBMITTING_QUICK_FEEDBACK(state) {\n state.quickFeedbackSubmittingCount--\n },\n UPSERT_REPLACE_ME_STATUS_CHECK_FOR_CLIENT(state, { payload, clientId }) {\n let found = state.replaceMeStatusChecks.find(\n (x) => x.clientId === clientId\n )\n\n if (found) {\n found = payload\n found.timestamp = dayjs()\n return\n }\n\n const statusCheck = {\n ...payload,\n clientId,\n timestamp: dayjs(),\n }\n\n state.replaceMeStatusChecks.push(statusCheck)\n },\n },\n actions: {\n setRecentLocation({ commit }, locationId) {\n commit('SET_RECENT_BOOKING_LOCATION', locationId)\n },\n async loadBookingsByClientAndDate({ rootGetters, commit }, payload) {\n return await new VuexResponse(commit)\n .request(() =>\n this.$api.bookings.getSummaryBookingsByDate(\n rootGetters['client/getSelectedClients'],\n payload\n )\n )\n .withLoading(\n 'START_LOADING_SELECTED_DATE_BOOKINGS',\n 'FINISH_LOADING_SELECTED_DATE_BOOKINGS'\n )\n .withFailureToast('Cannot load bookings')\n .go()\n },\n async loadYearOfBookingOverviewData({ commit }, payload) {\n return await new VuexResponse(commit)\n .request(() =>\n this.$api.bookings.getBookingOverview(payload.clientIds, payload.year)\n )\n .withLoading(\n 'START_LOADING_BOOKINGS_OVERVIEW',\n 'FINISH_LOADING_BOOKINGS_OVERVIEW'\n )\n .withFailureToast('Cannot load bookings')\n .withCommit('SET_BOOKING_OVERVIEW')\n .go()\n },\n async submitBooking({ commit }, payload) {\n commit('START_LOADING_CRUD')\n\n try {\n const response = await this.$api.bookings.post('', payload)\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n return fail(ex.response.data)\n } finally {\n commit('FINISH_LOADING_CRUD')\n }\n },\n async requestFeedbackFormUrl({ commit }, payload) {\n commit('START_LOADING_FEEDBACK_FORM_URL')\n try {\n const response = await this.$api.bookings.getFeedbackFormUrl(\n payload.bookingId\n )\n\n if (isSuccess(response.status)) {\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load feedback form url')\n return fail()\n } finally {\n commit('FINISH_LOADING_FEEDBACK_FORM_URL')\n }\n },\n // TODO: This function will likely be reworked to accept a passed in\n // client ID\n async submitQuickFeedback({ commit, dispatch, rootGetters }, payload) {\n commit('START_SUBMITTING_QUICK_FEEDBACK')\n try {\n const response = await this.$api.bookings.submitQuickFeedback(\n payload.bookingId,\n payload.data\n )\n\n if (isSuccess(response.status)) {\n await dispatch(\n 'pendingfeedbacks/setFeedbackAsComplete',\n {\n bookingId: payload.bookingId,\n clientId: rootGetters['client/getSelectedClients'][0], // TODO: Remove\n },\n { root: true }\n )\n return success()\n }\n } catch (ex) {\n return fail(ex.response.data)\n } finally {\n commit('FINISH_SUBMITTING_QUICK_FEEDBACK')\n }\n },\n // TODO: This function will likely be reworked to accept a passed in\n // client ID\n async checkReplaceMeStatus(\n { commit, getters, rootGetters },\n forceRefresh = false\n ) {\n const cId = rootGetters['client/getSelectedClients'][0] // TODO: Remove\n\n // Check if user has access to replace me\n if (\n !rootGetters['auth/hasReplaceMePermissionForAtleastOneClientLocation'](\n cId\n )\n )\n return success()\n\n // Check cached replace me status\n const isCached = getters.replaceMeStatusChecks(cId)\n\n if (\n isCached &&\n isCacheFresh({\n cacheDuration: 5,\n durationUnits: 'minutes',\n lastUpdated: isCached?.timestamp,\n forceRefresh,\n })\n )\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_REPLACE_ME_STATUS_CHECK')\n\n try {\n const response = await this.$api.bookings.checkReplaceMeStatus(cId)\n\n if (isSuccess(response.status)) {\n commit('UPSERT_REPLACE_ME_STATUS_CHECK_FOR_CLIENT', {\n payload: response.data,\n clientId: cId,\n })\n return success(response.data)\n }\n } catch (ex) {\n // Ignore alert if 403 since the user doesn't have permission for replace me\n // and likely doesn't need to be notified they don't. Would just be alert spam\n if (!isHttpStatus(ex.response.status, 'Forbidden'))\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n('replaceMe.checkReplaceMeStatusErrorGenericText')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_REPLACE_ME_STATUS_CHECK')\n }\n },\n async submitReplaceMeBooking({ commit }, payload) {\n commit('START_LOADING_SUBMIT_REPLACE_ME')\n\n try {\n const response = await this.$api.bookings.submitReplaceMeBooking(\n payload\n )\n\n if (isSuccess(response.status)) {\n const selectedDay = getSelectedDayText(\n payload.selectedDay,\n payload.isNextMonday\n )\n toast.success(\n this.$i18n.t('replaceMe.successNotificationText', { selectedDay })\n )\n return success(response.data)\n }\n } catch (ex) {\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n.t('error.genericFailedRequestMessage')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_SUBMIT_REPLACE_ME')\n }\n },\n async cancelBooking({ commit }, payload) {\n commit('START_LOADING_CANCEL_BOOKING')\n\n try {\n const response = await this.$api.bookings.cancelBooking(\n payload.bookingId,\n {\n cancelReason: payload.cancelReason,\n }\n )\n\n if (isSuccess(response.status)) {\n toast.success(\n this.$i18n.t('booking.cancelBookingSuccessText', {\n date: payload.date,\n })\n )\n return success(response.data)\n }\n } catch (ex) {\n toast.error(\n ex.response?.data?.message\n ? ex.response.data?.message\n : this.$i18n.t('error.genericFailedRequestMessage')\n )\n return fail()\n } finally {\n commit('FINISH_LOADING_CANCEL_BOOKING')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\n\nconst getDefaultState = () => {\n return {\n bookingContacts: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n bookingContactsLoadingCount: 0,\n standardBookingDetailsLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'contacts',\n bookingContacts: (state) => (locationId) => {\n const contacts = state.bookingContacts.find(\n (x) => x.locationId === locationId\n )\n\n return contacts ? orderBy(contacts.list, ['fullName'], ['asc']) : []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingBookingContacts: (state) => state.bookingContactsLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_BOOKING_CONTACTS(state) {\n state.bookingContactsLoadingCount++\n },\n FINISH_LOADING_BOOKING_CONTACTS(state) {\n state.bookingContactsLoadingCount--\n },\n SET_CLIENT_BOOKING_CONTACTS(state, payload) {\n const found = state.bookingContacts.find(\n (x) => x.locationId === payload.locationId\n )\n\n if (!found) {\n return state.bookingContacts.push({\n locationId: payload.locationId,\n list: payload.contacts,\n })\n }\n\n found.list = payload.contacts\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadBookingContacts({ commit, getters }, locationId) {\n // Check cached contacts\n const hasContacts = getters.bookingContacts(locationId)\n\n if (hasContacts && hasContacts.length > 0)\n return Promise.resolve(success(hasContacts))\n\n commit('START_LOADING_BOOKING_CONTACTS')\n\n try {\n const response = await this.$api.contacts.getBookingContacts(locationId)\n\n if (isSuccess(response.status)) {\n commit('SET_CLIENT_BOOKING_CONTACTS', {\n contacts: isHttpStatus(response.status, 204) ? [] : response.data,\n locationId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load booking contacts')\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_CONTACTS')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { isNonEmptyArray } from '@/helpers/array-helpers'\nimport dayjs from '@/services/date'\n\n/**\n * @class\n * @public\n */\nexport default class BookingBlockViewModel {\n constructor({ locationId, datesLocal = [], messageMarkDown = '' } = {}) {\n /**\n * @type {Number}\n */\n this.locationId = Number(locationId)\n /**\n * @type {Array}\n */\n this.datesLocal = isNonEmptyArray(datesLocal)\n ? datesLocal.map((date) => dayjs(date))\n : []\n /**\n * Mark down text to be displayed to the user\n * @type {String}\n */\n this.messageMarkDown = messageMarkDown\n }\n}\n","import { fail, success } from '@/helpers/result-helper'\nimport toast from '@/services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport { orderBy } from 'lodash'\nimport BookingBlockViewModel from '@/models/locations/bookingBlockViewModel'\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\nimport ClientLoginLocationViewModel from '@/models/locations/clientLoginLocationViewModel'\n\nconst getDefaultState = () => {\n return {\n // Place any new state properties here\n bookingLocations: [],\n certifications: [],\n locationRestrictions: [],\n loadingCount: 0,\n crudLoadingCount: 0,\n bookingLocationLoadingCount: 0,\n certificationLoadingCount: 0,\n bookingBlocksLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'locations',\n bookingLocations: (state) => state.bookingLocations,\n certifications: (state) => (locationId) => {\n const certifications = state.certifications.find(\n (x) => x.locationId === locationId\n )\n\n return certifications\n ? orderBy(certifications.list, ['name'], ['asc'])\n : []\n },\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n isLoadingCertifications: (state) => state.certificationLoadingCount > 0,\n isLoadingBookingLocations: (state) => state.bookingLocationLoadingCount > 0,\n isLoadingBookingBlocks: (state) => state.bookingBlocksLoadingCount > 0,\n getRestrictionDetailsByLocationId: (state) => (locationId) => {\n if (!locationId || locationId < 1) throw Error('Location Id is required')\n\n return state.locationRestrictions?.find(\n (restriction) => restriction.locationId === locationId\n )\n },\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n START_LOADING_BOOKING_LOCATIONS(state) {\n state.bookingLocationLoadingCount++\n },\n FINISH_LOADING_BOOKING_LOCATIONS(state) {\n state.bookingLocationLoadingCount--\n },\n START_LOADING_CERTIFICATIONS(state) {\n state.certificationLoadingCount++\n },\n FINISH_LOADING_CERTIFICATIONS(state) {\n state.certificationLoadingCount--\n },\n START_LOADING_BOOKING_BLOCKS(state) {\n state.bookingBlocksLoadingCount++\n },\n FINISH_LOADING_BOOKING_BLOCKS(state) {\n state.bookingBlocksLoadingCount--\n },\n /**\n *\n * @param {*} state\n * @param {ClientLoginLocationViewModel[]} payload\n */\n SET_BOOKING_LOCATIONS(state, payload) {\n state.bookingLocations = payload\n },\n UPSERT_CERTIFICATIONS(state, payload) {\n const found = state.certifications.find(\n (x) => x.locationId === payload.locationId\n )\n\n if (!found) {\n return state.certifications.push({\n locationId: payload.locationId,\n list: payload.certifications,\n })\n }\n\n found.list = payload.certifications\n },\n SET_LOCATION_RESTRICTIONS(state, restrictions) {\n state.locationRestrictions = isNonEmptyArray(restrictions)\n ? restrictions.map(\n (restriction) => new BookingBlockViewModel(restriction)\n )\n : []\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async loadBookingLocations({ commit, getters }) {\n const isCached = getters.bookingLocations\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_BOOKING_LOCATIONS')\n\n try {\n const response = await this.$api.locations.getBookingLocations()\n\n if (isSuccess(response.status)) {\n const mappedLocations = isHttpStatus(response.status, 204)\n ? []\n : response.data.map(\n (location) => new ClientLoginLocationViewModel(location)\n )\n\n commit('SET_BOOKING_LOCATIONS', mappedLocations)\n return success(mappedLocations)\n }\n } catch (ex) {\n toast.error('Cannot load locations')\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_LOCATIONS')\n }\n },\n async loadLocationCertifications({ commit, getters }, locationId) {\n const isCached = getters.certifications(locationId)\n\n if (isCached && isCached.length > 0)\n return Promise.resolve(success(isCached))\n\n commit('START_LOADING_CERTIFICATIONS')\n\n try {\n const response = await this.$api.locations.getLocationCertifications(\n locationId\n )\n\n if (isSuccess(response.status)) {\n commit('UPSERT_CERTIFICATIONS', {\n certifications: isHttpStatus(response.status, 204)\n ? []\n : response.data,\n locationId,\n })\n return success(response.data)\n }\n } catch (ex) {\n toast.error('Cannot load certifications for this location')\n return fail()\n } finally {\n commit('FINISH_LOADING_CERTIFICATIONS')\n }\n },\n /**\n * Loads the booking blocks for all contact locations\n * booking on a particular day\n * @param {{commit: Function, dispatch: Function}} vuexContext\n * @returns\n */\n async loadLocationBookingBlocks({ commit }) {\n commit('START_LOADING_BOOKING_BLOCKS')\n\n try {\n const response = await this.$api.locations.getLocationBookingBlocks()\n\n if (isSuccess(response.status)) {\n commit('SET_LOCATION_RESTRICTIONS', response.data)\n return success(response.data)\n }\n } catch (ex) {\n return fail()\n } finally {\n commit('FINISH_LOADING_BOOKING_BLOCKS')\n }\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import { fail, success } from '@helpers/result-helper'\nimport toast from '@services/toasts/index'\nimport { isSuccess, isHttpStatus } from '@/helpers/http-status-helpers'\nimport dayjs from '@/services/date/index'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\n\nconst getDefaultState = () => {\n return {\n loadingCount: 0,\n crudLoadingCount: 0,\n pendingFeedback: [],\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'pending-feedback',\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n pendingFeedback: (state) => (clientId) =>\n state.pendingFeedback.find((feedback) => feedback.clientId === clientId)\n ?.list || [],\n pendingFeedbackCacheObj: (state) => (clientId) =>\n state.pendingFeedback.find((feedback) => feedback.clientId === clientId),\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n SET_PENDING_FEEDBACK(state, { clientId, feedback }) {\n const found = state.pendingFeedback.find(\n (feedback) => feedback.clientId === clientId\n )\n\n if (found) {\n found.list = feedback\n found.lastUpdated = dayjs()\n return\n }\n\n state.pendingFeedback.push({\n clientId,\n list: feedback,\n lastUpdated: dayjs(),\n })\n },\n SET_FEEDBACK_AS_COMPLETE(state, { bookingId, clientId }) {\n const foundClientFeedbackList = state.pendingFeedback.find(\n (feedback) => feedback.clientId === clientId\n )\n\n if (!foundClientFeedbackList) return\n\n const foundBookingFeedback = foundClientFeedbackList.list.find(\n (feedback) => feedback.bookingID === bookingId\n )\n\n if (!foundBookingFeedback) return\n\n foundBookingFeedback.feedbackCompleted = true\n },\n },\n actions: {\n async getPendingFeedbacks({ commit, getters }, clientId) {\n // Check if cached\n const isCached = getters.pendingFeedbackCacheObj(clientId)\n\n if (\n isCached &&\n isCacheFresh({\n cacheDuration: 5,\n durationUnits: 'minutes',\n lastUpdated: isCached?.lastUpdated,\n })\n )\n return Promise.resolve(success(isCached.list))\n\n commit('START_LOADING')\n try {\n const response = await this.$api.pendingfeedbacks.getPendingFeedbacks(\n clientId\n )\n\n if (isSuccess(response.status)) {\n commit('SET_PENDING_FEEDBACK', { clientId, feedback: response.data })\n return success(response.data)\n }\n } catch (ex) {\n if (isHttpStatus(ex.response.status, 'Forbidden')) {\n return fail(null, '', 403)\n }\n\n toast.error(this.$i18n.t('pendingFeedbacks.pendingFeedbacksError'))\n return fail()\n } finally {\n commit('FINISH_LOADING')\n }\n },\n setFeedbackAsComplete({ commit }, { bookingId, clientId }) {\n commit('SET_FEEDBACK_AS_COMPLETE', { bookingId, clientId })\n },\n },\n}\n","import config from '@/common/config'\nimport clientGroupOverviewFeatureFactory from '@/services/features/clientGroupOverviewFeatureFactory'\nimport { createFeatureDecisions } from '@/services/features/featureDecisions'\n\nconst getDefaultState = () => {\n return {\n toggles: config.get('app.featureToggles'),\n loadingCount: 0,\n crudLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'features',\n featureToggles: (state) => state.toggles,\n isLoading: (state) => state.loadingCount > 0,\n isLoadingCRUD: (state) => state.crudLoadingCount > 0,\n },\n mutations: {\n START_LOADING(state) {\n state.loadingCount++\n },\n FINISH_LOADING(state) {\n state.loadingCount--\n },\n START_LOADING_CRUD(state) {\n state.crudLoadingCount++\n },\n FINISH_LOADING_CRUD(state) {\n state.crudLoadingCount--\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n SET_FEATURE_TOGGLES(state, toggles) {\n state.toggles = toggles\n },\n },\n actions: {\n setFeatureToggles({ commit }, toggles) {\n commit('SET_FEATURE_TOGGLES', toggles)\n },\n /**\n * Is used to decide if the client group overview page is enabled for this user.\n * @param {{ rootGetters: Object }} VuexAction\n * @returns {Boolean}\n */\n isClientGroupOverviewEnabled({ getters, rootGetters }) {\n const featureDecisions = createFeatureDecisions(getters.featureToggles)\n\n const enabledForClient = rootGetters['auth/isClientGroupOverviewEnabled']\n\n const clientGroupOverviewFeatureToggles = clientGroupOverviewFeatureFactory(\n featureDecisions,\n enabledForClient\n )\n\n return clientGroupOverviewFeatureToggles.canViewDetails\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","/**\n * @typedef {Object} BookingClientViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - The name of the client\n */\n\n/**\n * @class\n */\nexport default class BookingClientViewModel {\n /**\n * Create a new BookingClientViewModel.\n * @param {...BookingClientViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n }\n}\n","/**\n * @typedef {Object} BookingClientGroupViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - The name of the client group\n */\n\n/**\n * @class\n */\nexport default class BookingClientGroupViewModel {\n /**\n * Create a new BookingClientGroupViewModel.\n * @param {...BookingClientGroupViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n }\n}\n","/**\n * @typedef {Object} BookingCreatedByViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - Name of the contact who created the booking\n */\n\n/**\n * @class\n */\nexport default class BookingCreatedByViewModel {\n /**\n * Create a new BookingCreatedByViewModel.\n * @param {...BookingCreatedByViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n }\n}\n","/**\n * @typedef {Object} BookingLocationViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - The name of the location\n * @property {string} timeZone - The location's time zone\n *\n\n/**\n * @class\n */\nexport default class BookingLocationViewModel {\n /**\n * Create a new BookingLocationViewModel.\n * @param {...BookingLocationViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n this.timeZone = params.timeZone\n }\n}\n","/**\n * @typedef {Object} BookingCoveringViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - Name of the contact who is being covered\n * @property {string} reason - The reason why the booking was created\n */\n\n/**\n * @class\n */\nexport default class BookingCoveringViewModel {\n /**\n * Create a new BookingCoveringViewModel.\n * @param {...BookingCoveringViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n this.reason = params.reason\n }\n}\n","/**\n * @typedef {Object} BookingCertificationViewModelType\n * @property {number} id - The certification type identifier\n * @property {string} name - The name of the certification\n */\n\n/**\n * @class\n */\nexport default class BookingCertificationViewModel {\n /**\n * Create a new BookingCertificationViewModel.\n * @param {...BookingCertificationViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n }\n}\n","/**\n * @typedef {Object} BookingConfirmationViewModelType\n * @property {number} id - Unique identifier\n * @property {string} name - The name of the confirmation contact\n * @property {string} email - The confirmation contact's email address\n * @property {BookingConfirmationPhoneViewModel} sms - The phone details for sms confirmations\n * @property {BookingConfirmationPhoneViewModel} voice - The phone details for voice confirmations\n */\n\n/**\n * @class\n */\nexport default class BookingConfirmationViewModel {\n /**\n * Create a new BookingConfirmationViewModel.\n * @param {...BookingConfirmationVewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n this.email = params.email\n this.sms = params.sms ? params.sms : null\n this.voice = params.voice ? params.voice : null\n }\n}\n","/**\n * @typedef {Object} BookingClassificationViewModelType\n * @property {number} id - Unique identifier\n * @property {string} onlineTitle - The online friendly name for the classification\n */\n\n/**\n * @class\n */\nexport default class BookingClassificationViewModel {\n /**\n * Create a new BookingClassificationViewModel.\n * @param {...BookingClassificationViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.onlineTitle = params.onlineTitle\n }\n}\n","/**\n * @typedef {Object} BookingGradeViewModelType\n * @property {number} id - Unique identifier\n * @property {string} title - The name for the grade\n */\n\n/**\n * @class\n */\nexport default class BookingGradeViewModel {\n /**\n * Create a new BookingGradeViewModel.\n * @param {...BookingGradeViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.title = params.title\n }\n}\n","import { isNullOrEmptyArray } from '@/helpers/array-helpers'\nimport BookingCoveringViewModel from './bookingCoveringViewModel'\nimport BookingCertificationViewModel from './bookingCertificationViewModel'\nimport BookingConfirmationViewModel from './bookingConfirmationViewModel'\nimport BookingClassificationViewModel from './bookingClassificationViewModel'\nimport BookingGradeViewModel from './bookingGradeViewModel'\n\n/**\n * @typedef {Object} BookingDetailsViewModelType\n * @property {string} startTime - The start time of the booking\n * @property {string} endTime - The end time of the booking\n * @property {string} earliestDate - The date of the earliest booking within the booking group\n * @property {string} latestDate - The date of the latest booking within the booking group\n * @property {boolean} areDatesConsecutive - True if there are no working day gaps from the earliest booking to the latest booking in the group\n * @property {string} notes - Notes added to the booking\n * @property {string} room - Information on the room\n * @property {BookingCoveringViewModel} covering - The contact\n * @property {BookingClassificationViewModel} classification - The booking's classification\n */\n\n/**\n * @class\n */\nexport default class BookingDetailsViewModel {\n /**\n * Create a new BookingDetailsViewModel.\n * @param {...BookingDetailsViewModelType} params\n */\n constructor(params) {\n this.startTime = params.startTime\n this.endTime = params.endTime\n this.earliestDate = params.earliestDate\n this.latestDate = params.latestDate\n this.areDatesConsecutive = params.areDatesConsecutive\n this.notes = params.notes\n this.room = params.room\n this.covering = params.covering\n ? new BookingCoveringViewModel(params.covering)\n : null\n this.certifications = !isNullOrEmptyArray(params.certifications)\n ? params.certifications.map(\n (certification) => new BookingCertificationViewModel(certification)\n )\n : []\n this.confirmations = !isNullOrEmptyArray(params.confirmations)\n ? params.confirmations.map(\n (confirmation) => new BookingConfirmationViewModel(confirmation)\n )\n : []\n this.classification = params.classification\n ? new BookingClassificationViewModel(params.classification)\n : null\n this.grades = !isNullOrEmptyArray(params.grades)\n ? params.grades.map(\n (confirmation) => new BookingGradeViewModel(confirmation)\n )\n : []\n }\n}\n","/**\n * @typedef {Object} BookingDateViewModelType\n * @property {number} id - Unique identifier (of a booking in the same group)\n * @property {string} date - The date of the booking without any time data\n */\n\n/**\n * @class\n */\nexport default class BookingDateViewModel {\n /**\n * Create a new BookingDateViewModel.\n * @param {...BookingDateViewModelType} params\n */\n constructor(params) {\n this.id = params.id\n this.date = params.date\n }\n}\n","import dayjs from '@/services/date/index'\nimport { isNullOrEmptyArray } from '@/helpers/array-helpers'\nimport BookingClientViewModel from './bookingClientViewModel'\nimport BookingClientGroupViewModel from './bookingClientGroupViewModel'\nimport BookingCreatedByViewModel from './bookingCreatedByViewModel'\nimport BookingLocationViewModel from './bookingLocationViewModel'\nimport BookingDetailsViewModel from './bookingDetailsViewModel'\nimport BookingDateViewModel from './bookingDateViewModel'\n\nexport default class BookingViewModel {\n constructor(params) {\n this.id = params.id\n this.status = params.status\n this.createdBy = params.createdBy\n ? new BookingCreatedByViewModel(params.createdBy)\n : null\n this.createdOnUtc = params.createdOnUtc ? dayjs(params.createdOnUtc) : null\n this.client = params.client\n ? new BookingClientViewModel(params.client)\n : null\n this.clientGroup = params.clientGroup\n ? new BookingClientGroupViewModel(params.clientGroup)\n : null\n this.location = params.location\n ? new BookingLocationViewModel(params.location)\n : null\n this.details = params.details\n ? new BookingDetailsViewModel(params.details)\n : null\n this.dates = !isNullOrEmptyArray(params.dates)\n ? params.dates.map((date) => new BookingDateViewModel(date))\n : []\n }\n}\n","import BookingCoveringViewModel from './bookingCoveringViewModel'\n\nexport default class PendingBookingSummaryDetailsViewModel {\n constructor(params) {\n this.startTime = params.startTime\n this.endTime = params.endTime\n this.earliestDate = params.earliestDate\n this.latestDate = params.latestDate\n this.areDatesConsecutive = params.areDatesConsecutive\n this.covering = params.covering\n ? new BookingCoveringViewModel(params.covering)\n : null\n }\n}\n","import dayjs from '@/services/date/index'\nimport BookingClientViewModel from './bookingClientViewModel'\nimport BookingClientGroupViewModel from './bookingClientGroupViewModel'\nimport BookingCreatedByViewModel from './bookingCreatedByViewModel'\nimport BookingLocationViewModel from './bookingLocationViewModel'\nimport PendingBookingSummaryDetailsViewModel from './pendingBookingSummaryDetailsViewModel'\n\nexport default class PendingBookingSummaryViewModel {\n constructor(params) {\n this.id = params.id\n this.status = params.status\n this.createdBy = params.createdBy\n ? new BookingCreatedByViewModel(params.createdBy)\n : null\n this.createdOnUtc = params.createdOnUtc ? dayjs(params.createdOnUtc) : null\n this.days = params.days\n this.client = params.client\n ? new BookingClientViewModel(params.client)\n : null\n this.clientGroup = params.clientGroup\n ? new BookingClientGroupViewModel(params.clientGroup)\n : null\n this.location = params.location\n ? new BookingLocationViewModel(params.location)\n : null\n this.details = params.details\n ? new PendingBookingSummaryDetailsViewModel(params.details)\n : null\n }\n}\n","/**\n * Dictionary of keys used to track loading states across the app.\n * When loading is triggered, the base store assigns the key to store.loadingKeys\n * with a count against each key (based on how many requests are loading)\n */\nexport default Object.freeze({\n defaultLoadingKey: 'defaultLoadingKey',\n bookingApprovals: {\n loadingApprovalCount: 'loadingApprovalCount',\n loadingApprovalDetails: 'loadingApprovalDetailsTest',\n loadingSubmitPendingApproval: 'loadingSubmitPendingApproval',\n },\n})\n","/**\n * Sleep util\n * @param {Number} ms milliseconds program should sleep for\n * ```js\n * import sleep from '@utils/sleep.js'\n * await sleep(500) // sleep for 500ms\n * ```\n */\nexport default (ms) => new Promise((resolve) => setTimeout(resolve, ms))\n","import { VuexResponse } from '@/helpers/vuex-action-builder'\nimport BookingViewModel from '@/models/bookings/bookingViewModel'\nimport PendingBookingSummaryViewModel from '@/models/bookings/pendingBookingSummaryViewModel'\nimport LoadingKeys from '@/shared/constants/core/LoadingKeys'\nimport sleep from '@/utils/sleep'\n\nconst getDefaultState = () => {\n return {\n flyout: {\n booking: {},\n show: false,\n error: false,\n },\n }\n}\n\nconst state = getDefaultState()\n\nexport default {\n namespaced: true,\n state,\n getters: {\n moduleName: () => 'booking-approvals',\n isLoadingApprovalsList: (state, getters, rootState, rootGetters) =>\n rootGetters.isLoadingByKey(\n LoadingKeys.bookingApprovals.loadingApprovalCount\n ),\n isLoadingFlyout: (state, getters, rootState, rootGetters) =>\n rootGetters.isLoadingByKey(\n LoadingKeys.bookingApprovals.loadingApprovalDetails\n ),\n isLoadingSubmitPendingApproval: (state, getters, rootState, rootGetters) =>\n rootGetters.isLoadingByKey(\n LoadingKeys.bookingApprovals.loadingSubmitPendingApproval\n ),\n activeBooking: (state) => state.flyout.booking,\n showFlyout: (state) => state.flyout.show,\n flyoutHasError: (state) => state.flyout.error,\n showDetailsContent: (state) => !!state.flyout.booking?.id,\n },\n mutations: {\n SET_FLYOUT(state, { key, value }) {\n state.flyout[key] = value\n },\n RESET_FLYOUT(state) {\n state.flyout = {\n booking: {},\n show: false,\n error: false,\n }\n },\n SET_STATE(state, { key, value }) {\n state[key] = value\n },\n CLEAR_STORE(state) {\n // Resets store to default state\n Object.assign(state, getDefaultState())\n },\n },\n actions: {\n async mockSubmitPendingApproval() {\n await sleep(1500)\n return {\n status: 204,\n data: {},\n }\n },\n async loadPendingApprovals({ commit }) {\n return await new VuexResponse(commit)\n .request(() => this.$api.pendingBookings.get())\n .withLoading(LoadingKeys.bookingApprovals.loadingApprovalCount)\n .transform((data) =>\n data.map((item) => new PendingBookingSummaryViewModel(item))\n )\n .go()\n },\n async loadApprovalDetails({ commit }, bookingId) {\n return await new VuexResponse(commit)\n .request(() => this.$api.bookings.get(bookingId))\n .withLoading(LoadingKeys.bookingApprovals.loadingApprovalDetails)\n .transform((data) => new BookingViewModel(data))\n .go()\n },\n async submitPendingApproval({ commit, dispatch }, payload) {\n return await new VuexResponse(commit)\n .request(() => this.$api.pendingBookings.action(payload))\n .withLoading(LoadingKeys.bookingApprovals.loadingSubmitPendingApproval)\n .withSuccessToast(\n payload.action === 'accept'\n ? this.$i18n.t('booking.details.approvals.submit.acceptToast', {\n companyNameShort: this.$i18n.t('app.companyNameShort'),\n })\n : this.$i18n.t('booking.details.approvals.submit.rejectToast')\n )\n .withFailureToast(\n this.$i18n.t('booking.details.approvals.submit.failureToast')\n )\n .go()\n },\n openFlyout({ commit }) {\n commit('SET_FLYOUT', { key: 'show', value: true })\n },\n setFlyout({ commit }, data) {\n commit('SET_FLYOUT', data)\n },\n resetFlyout({ commit }) {\n return commit('RESET_FLYOUT')\n },\n /**\n * Resets store to default state.\n */\n clear({ commit }) {\n commit('CLEAR_STORE')\n },\n },\n}\n","import authModule from './auth'\nimport usersModule from './users'\nimport singleInvoiceModule from './single-invoice'\nimport clientModule from './client'\nimport invoicesModule from './invoices'\nimport timesheetsModule from './timesheets'\nimport candidateModule from './candidate'\nimport fileModule from './file'\nimport bookingsModule from './bookings'\nimport contactsModule from './contacts'\nimport locationsModule from './locations'\nimport pendingFeedbacksModule from './pending-feedback'\nimport featuresModule from './features'\nimport bookingApprovalsModule from './booking-approvals'\n\nexport default {\n bookingApprovals: bookingApprovalsModule,\n features: featuresModule,\n locations: locationsModule,\n contacts: contactsModule,\n bookings: bookingsModule,\n timesheets: timesheetsModule,\n file: fileModule,\n singleInvoice: singleInvoiceModule,\n client: clientModule,\n invoices: invoicesModule,\n candidate: candidateModule,\n auth: authModule,\n users: usersModule,\n pendingfeedbacks: pendingFeedbacksModule,\n}\n","import allModules from '@state/modules'\nimport store from '@state/store'\n\nexport default function dispatchActionForAllModules(\n actionName,\n { modules = allModules, modulePrefix = '', flags = {} } = {}\n) {\n // For every module...\n for (const moduleName in modules) {\n const moduleDefinition = modules[moduleName]\n\n // If the action is defined on the module...\n if (moduleDefinition.actions && moduleDefinition.actions[actionName]) {\n // Dispatch the action if the module is namespaced. Otherwise,\n // set a flag to dispatch the action globally at the end.\n if (moduleDefinition.namespaced) {\n store.dispatch(`${modulePrefix}${moduleName}/${actionName}`)\n } else {\n flags.dispatchGlobal = true\n }\n }\n\n // If there are any nested sub-modules...\n if (moduleDefinition.modules) {\n // Also dispatch the action for these sub-modules.\n dispatchActionForAllModules(actionName, {\n modules: moduleDefinition.modules,\n modulePrefix: modulePrefix + moduleName + '/',\n flags,\n })\n }\n }\n\n // If this is the root and at least one non-namespaced module\n // was found with the action...\n if (!modulePrefix && flags.dispatchGlobal) {\n // Dispatch the action globally.\n store.dispatch(actionName)\n }\n}\n","import config from '@/common/config'\nimport store from '@state/store'\nimport { isHttpStatus } from '@/helpers/http-status-helpers'\nimport axios from 'axios'\n\nclass BaseApiService {\n /**\n * Api version (e.g. 1.0)\n */\n apiVersion = config.get('apiVersion')\n\n /**\n * Axios client\n */\n client = axios.create({\n baseURL: config.get('apiUrl'),\n json: true,\n })\n\n /**\n * HTTP methods\n */\n method = {\n GET: 'get',\n POST: 'post',\n DELETE: 'delete',\n PATCH: 'patch',\n PUT: 'put',\n }\n\n /**\n * A particular resource, e.i. users, posts, comments etc.\n */\n resource\n\n constructor(resource) {\n if (!resource) throw new Error('Resource is not provided')\n this.resource = resource\n }\n\n /**\n * Gets the full url for the endpoint\n * @param {String} args has the remaining fragement of the url\n * @param {Object} query key pair list of query args that will be mapped if provided e.g. `{ first: 'value', second: 'value' }`\n * @returns {String} full url including base\n */\n getUrl(args = '', query = null) {\n return `v${this.apiVersion}/${this.resource}${args ? `/${args}` : ''}${\n query ? `?${this.mapQueryParams(query)}` : ''\n }`\n }\n\n async handleErrors(err) {\n // If unauthorised, renew access token then retry\n if (isHttpStatus(err?.response?.status, 'Unauthorized')) {\n await store.dispatch('auth/getAccessTokenOrRefresh', true)\n\n return {\n retry: true,\n err,\n }\n }\n\n throw err\n }\n\n /**\n * Compiles request configuration and handles tasks like generating headers\n * list and retrieving the auth token\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @param {Boolean} isBlob Sets the response type to 'blob'\n * @returns Request config object\n */\n async compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob = false\n ) {\n const accessToken = await store.dispatch('auth/getAccessTokenOrRefresh')\n if (typeof accessToken === 'undefined' || !accessToken) {\n throw Error('An access token is required for authenticated requests')\n }\n\n let impersonateHeader = {}\n\n // Set impersonate header if impersonate id is present\n if (store.getters['auth/hasImpersonateContactId']) {\n impersonateHeader = {\n 'Impersonated-Contact': store.getters['auth/impersonateContactId'],\n }\n }\n\n // Replace versioned URLs to use accept header to request API version\n const headers = {\n Authorization: `Bearer ${accessToken}`,\n 'Accept-Version': this.apiVersion,\n ...providedHeaders,\n ...impersonateHeader,\n }\n\n let config = {\n method,\n url,\n data,\n headers,\n }\n\n if (isBlob) config = { ...config, ...{ responseType: 'blob' } }\n\n return config\n }\n\n /**\n * Executes an authenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @param {Boolean} isBlob Sets the response type to 'blob'\n * @returns Http response\n */\n async execute(method, url, data, providedHeaders, isBlob = false) {\n let config = await this.compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob\n )\n\n try {\n return await this.client(config)\n } catch (err) {\n const response = await this.handleErrors(err)\n\n if (response.retry) {\n // Recompile config to utilise new auth token\n config = await this.compileRequestConfig(\n method,\n url,\n data,\n providedHeaders,\n isBlob\n )\n\n return await this.client(config)\n }\n }\n }\n\n /**\n * Executes an authenticated HTTP request for blob files\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async executeBlob(method, url, data, providedHeaders) {\n return this.execute(method, url, data, providedHeaders, true)\n }\n\n /**\n * Executes an unauthenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @returns Http response\n */\n async executeAnon(method, url, data) {\n return this.client({\n method,\n url,\n data,\n headers: {\n 'Accept-Version': this.apiVersion,\n },\n })\n }\n\n /**\n * Mapper that accepts a 1D object and generates a query string to be appended to a URL\n * @param {Object} queryParams key value object { key: value, ... }\n * @returns A query string e.g. ?key=value&key2=value2...\n */\n mapQueryParams(queryParams) {\n return queryParams\n ? Object.keys(queryParams)\n .map(function(key) {\n return key + '=' + queryParams[key]\n })\n .join('&')\n : ''\n }\n}\n\nclass ReadOnlyApiService extends BaseApiService {\n /**\n * Generic configurable authenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetch(method, url, data, headers) {\n return this.execute(method, url, data, headers)\n }\n\n /**\n * HTTP Get authenticated request\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async get(args, query = null) {\n return this.execute(this.method.GET, this.getUrl(args, query))\n }\n\n /**\n * Generic configurable unauthenticated HTTP request\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetchAnon(method, url, data, headers) {\n return this.executeAnon(method, url, data, headers)\n }\n\n /**\n * HTTP Get unauthenticated request\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async getAnon(args, query = null) {\n return this.executeAnon(this.method.GET, this.getUrl(args, query))\n }\n\n /**\n * Generic configurable Authenticated HTTP request - Response type: Blob\n * @param {String} method HTTP Method (GET, POST, PATCH, DELETE, PUT)\n * @param {String} url Endpoint url\n * @param {*} data Payload to send to server\n * @param {*} headers Request headers to send to server\n * @returns Http response\n */\n async fetchBlob(method, url, data, headers) {\n return this.executeBlob(method, url, data, headers)\n }\n\n /**\n * HTTP Get authenticated request - Response type: Blob\n * @param {*} args\n * @param {*} query query object {key: value}\n * @returns\n */\n async getBlob(args, query = null) {\n return this.executeBlob(this.method.GET, this.getUrl(args, query))\n }\n}\n\nclass ModelApiService extends ReadOnlyApiService {\n /**\n * HTTP Post authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async post(args, data = {}, query = null) {\n return this.execute(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Post unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async postAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Post authenticated request - Response type: Blob\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async postBlob(args, data = {}, query = null) {\n return this.executeBlob(this.method.POST, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async put(args, data = {}, query = null) {\n return this.execute(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async putAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Put authenticated request - Response type: Blob\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async putBlob(args, data = {}, query = null) {\n return this.executeBlob(this.method.PUT, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Patch authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async patch(args, data = {}, query = null) {\n return this.execute(this.method.PATCH, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Patch unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async patchAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.PATCH, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Delete authenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async delete(args, data = {}, query = null) {\n return this.execute(this.method.DELETE, this.getUrl(args, query), data)\n }\n\n /**\n * HTTP Delete unauthenticated request\n * @param {String} args Url arguments\n * @param {*} data Payload\n * @param {*} query query object {key: value}\n * @returns\n */\n async deleteAnon(args, data = {}, query = null) {\n return this.executeAnon(this.method.DELETE, this.getUrl(args, query), data)\n }\n}\n\nexport { ReadOnlyApiService, ModelApiService }\n","import { ModelApiService } from './BaseApiService'\n\nexport default class SignalRApiService extends ModelApiService {\n constructor() {\n super('SignalR')\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class UserApiService extends ModelApiService {\n constructor() {\n super('me')\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class InvoicesApiService extends ModelApiService {\n constructor() {\n super('invoices')\n }\n\n async getInvoiceByInvoiceNo(invoiceNo) {\n return this.get(`GetInvoice/${invoiceNo}`)\n }\n\n async getOustandingInvoicesCount() {\n return this.get(`outstanding-invoices-count`)\n }\n\n async getInvoiceFile(invoiceId) {\n return this.getBlob(`${invoiceId}/file`)\n }\n}\n","import dayjs from '@/services/date'\nimport { ModelApiService } from './BaseApiService'\n\nexport default class ClientApiService extends ModelApiService {\n constructor() {\n super('clients')\n }\n\n async getBookingsByYear(clientId, timeZone, year) {\n const newDate = new Date(year, 1, 1)\n\n const dateFromString = dayjs(newDate)\n .startOf('year')\n .format('YYYY-MM-DD')\n const dateUntilString = dayjs(newDate)\n .endOf('year')\n .format('YYYY-MM-DD')\n\n return this.getBookingsByDateRange(\n clientId,\n timeZone,\n dateFromString,\n dateUntilString\n )\n }\n\n async getBookingsByDateRange(\n clientId,\n timeZone,\n dateFromStringLocal,\n dateUntilStringLocal\n ) {\n return this.get(\n `${clientId}/bookings/summary?timeZone=${timeZone}&dateFromLocal=${dateFromStringLocal}&dateToLocal=${dateUntilStringLocal}`\n )\n }\n\n async getBookingsByClientAndDate(clientId, dateFromStringLocal) {\n return this.get(`${clientId}/bookings?dateFromLocal=${dateFromStringLocal}`)\n }\n\n async getClientGrades(clientId) {\n return this.get(`${clientId}/grades`)\n }\n\n async getClientClassifications(clientId) {\n return this.get(`${clientId}/pay-classes`)\n }\n\n async getAdditionalDetails(clientId) {\n return this.get(`${clientId}/additional-details`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class CandidateApiService extends ModelApiService {\n constructor() {\n super('candidate')\n }\n\n async getCandidateDetails(id) {\n return this.get(`${id}/details`)\n }\n\n getCandidateList(id) {\n return this.get(`CandidateList?ClientId=${id}`)\n }\n\n async getDisplayPic(id) {\n if (id && id >= 0) {\n return this.get(`profile-image/${id}`)\n }\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class FileApiService extends ModelApiService {\n constructor() {\n super('file')\n }\n\n async createFileAccessToken(fileId) {\n return this.get(`generateAccessToken/${fileId}`)\n }\n\n async getGeneralFile(fileName) {\n return this.getBlob('general', { filePath: fileName })\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class TimesheetsApiService extends ModelApiService {\n constructor() {\n super('timesheets')\n }\n\n async getTimesheetsSummary(clientIds) {\n const urlArgs = new URLSearchParams(\n clientIds.map((clientId) => ['clientIds', clientId])\n )\n return this.get(`overview?${urlArgs}`)\n }\n\n async getTimesheetsFilteredByCandidate(candidateId, clientIds) {\n const urlArgs = new URLSearchParams(\n clientIds.map((clientId) => ['clientIds', clientId])\n )\n urlArgs.append('candidateId', candidateId)\n\n return this.get(`candidate?${urlArgs}`)\n }\n\n async downloadTimesheetFile(timesheetRecordId) {\n return this.getBlob(`download/${timesheetRecordId}`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class ContactsApiService extends ModelApiService {\n constructor() {\n super('contacts')\n }\n\n async getBookingContacts(locationId) {\n return this.get(`booking-contacts`, { locationId })\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class LocationsApiService extends ModelApiService {\n constructor() {\n super('locations')\n }\n\n async getBookingLocations() {\n return this.get(`booking-location-list`)\n }\n\n async getLocationCertifications(locationId) {\n return this.get(`${locationId}/certifications`)\n }\n\n async getLocationBookingBlocks() {\n return this.get(`booking-blocks`)\n }\n}\n","import dayjs from '@/services/date'\n// eslint-disable-next-line\nimport { ShortTermBooking } from '@/models/bookings/responses/shortTermBooking'\n// eslint-disable-next-line\nimport { BookingOverviewCountsViewModel } from '@/models/bookings/responses/bookingOverviewCountsViewModel'\nimport { ModelApiService } from './BaseApiService'\n\nexport default class BookingsApiService extends ModelApiService {\n constructor() {\n super('bookings')\n }\n\n async getFeedbackFormUrl(bookingId) {\n return await this.get(`${bookingId}/feedback-form`)\n }\n\n async submitQuickFeedback(bookingId, data) {\n return await this.post(`${bookingId}/quick-feedback`, data)\n }\n\n async checkReplaceMeStatus(clientId) {\n return await this.get('replace-me-status', { clientId })\n }\n\n async submitReplaceMeBooking(payload) {\n return await this.post('replaceMe', payload)\n }\n\n async cancelBooking(bookingId, payload) {\n return await this.post(`${bookingId}/cancel`, payload)\n }\n\n /**\n * Returns booking overview statistics for a given year and by the selected client ids\n * @param {number[]} clientIds\n * @param {number|string} year\n * @returns {Promise}\n */\n async getBookingOverview(clientIds, year) {\n const newDate = new Date(year, 1, 1)\n\n const dateFromLocal = dayjs(newDate)\n .startOf('year')\n .format('YYYY-MM-DD')\n const dateToLocal = dayjs(newDate)\n .endOf('year')\n .format('YYYY-MM-DD')\n\n const urlArgs = new URLSearchParams(\n clientIds.map((clientId) => ['clientIds', clientId])\n )\n\n urlArgs.append('dateFromLocal', dateFromLocal)\n urlArgs.append('dateToLocal', dateToLocal)\n\n return this.get(`overview?${urlArgs}`)\n }\n\n /**\n * Returns booking summaries for a given date and by the selected client ids\n * @param {number[]} clientIds\n * @param {string} dateFromStringLocal\n * @returns {Promise}\n */\n async getSummaryBookingsByDate(clientIds, dateFromLocal) {\n const urlArgs = new URLSearchParams(\n clientIds.map((clientId) => ['clientIds', clientId])\n )\n urlArgs.append('dateFromLocal', dateFromLocal)\n\n return this.get(`summary?${urlArgs}`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class PendingFeedbackApiServiceApiService extends ModelApiService {\n constructor() {\n super('feedbacks')\n }\n\n async getPendingFeedbacks(clientID) {\n return this.get(`getBookingsPendingFeedback?clientId=${clientID}`)\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class ClientGroupApiService extends ModelApiService {\n constructor() {\n super('client-groups')\n }\n\n async getOverviewData(clientGroupId, filterDate, timeZone) {\n return this.get(`${clientGroupId}/overview`, { filterDate, timeZone })\n }\n}\n","import { ModelApiService } from './BaseApiService'\n\nexport default class PendingBookingsApiService extends ModelApiService {\n constructor() {\n super('pending-bookings')\n }\n\n async action({ bookingId, action, reason }) {\n return this.post(`${bookingId}/action`, { action, reason })\n }\n}\n","import SignalRApiService from './SignalRApiService'\nimport UserApiService from './UserApiService'\nimport InvoicesApiService from './InvoicesApiService'\nimport ClientApiService from './ClientApiService'\nimport CandidateApiService from './CandidateApiService'\nimport FileApiService from './FileApiService'\nimport TimesheetsApiService from './TimesheetsApiService'\nimport ContactsApiService from './ContactsApiService'\nimport LocationsApiService from './LocationsApiService'\nimport BookingsApiService from './BookingsApiService'\nimport PendingFeedbackApiServiceApiService from './PendingFeedbackApiServiceApiService'\nimport ClientGroupApiService from './ClientGroupApiService'\nimport PendingBookingsApiService from './PendingBookingsApiService'\n\nexport default {\n pendingfeedbacks: new PendingFeedbackApiServiceApiService(),\n bookings: new BookingsApiService(),\n locations: new LocationsApiService(),\n contacts: new ContactsApiService(),\n timesheets: new TimesheetsApiService(),\n file: new FileApiService(),\n invoices: new InvoicesApiService(),\n client: new ClientApiService(),\n clientGroups: new ClientGroupApiService(),\n candidate: new CandidateApiService(),\n user: new UserApiService(),\n signalR: new SignalRApiService(),\n pendingBookings: new PendingBookingsApiService(),\n}\n","import api from '@/services/api'\n\nexport default function(store) {\n store.$api = api\n}\n","import i18n from '@plugins/vue-i18n'\n\nexport default function(store) {\n store.$i18n = i18n\n}\n","import appinsights from '@plugins/appinsights'\n\nexport default function(store) {\n store.$appInsights = appinsights\n}\n","import markdownToHtmlConverter from '@/utils/markdown-to-html-converter.js'\nimport config from '@/common/config'\nimport { success, fail } from './result-helper'\n\nconst extractHeaderData = (headers) => {\n return headers.split('|').reduce((acc, header) => {\n const keyAndValue = header.split(':')\n return {\n ...acc,\n ...{\n [keyAndValue[0]]: keyAndValue[1],\n },\n }\n }, {})\n}\n\nexport const getServiceStatus = async () => {\n try {\n return await fetch(config.get('app.status.url'))\n .then((response) => {\n if (!response.ok) return fail()\n return response.text()\n })\n .then((markdownText) => {\n // Extract header\n const fileLines = markdownText.replace(/\\r\\n/g, '\\n').split('\\n')\n const statusHeader = fileLines[0]\n fileLines.shift()\n\n const headerElements = extractHeaderData(statusHeader)\n\n return Promise.resolve(\n success({\n ...{\n _md: markdownText,\n html: markdownToHtmlConverter(fileLines.join('\\n')),\n },\n ...headerElements,\n })\n )\n })\n } catch (e) {\n return fail({ error: e, message: e.message })\n }\n}\n","import dispatchActionForAllModules from '@utils/dispatch-action-for-all-modules'\nimport Vue from 'vue'\nimport Vuex from 'vuex'\nimport toast from '@services/toasts/index.js'\nimport api from '@/plugins/api.storePlugin'\nimport i18n from '@/plugins/i18n.storePlugin'\nimport appInsights from '@/plugins/appinsights.storePlugin'\nimport { getServiceStatus } from '@/helpers/service-status-helper.js'\nimport { isCacheFresh } from '@/helpers/cache-helpers'\nimport { DurationUnits } from '@/shared/constants/date/DurationUnits.js'\nimport { success } from '@/helpers/result-helper.js'\nimport dayjs from '@/services/date'\nimport { logger } from '@/services/logging/AppLogger'\nimport Environment from '@/shared/constants/core/Environment'\nimport config from '@/common/config'\nimport modules from './modules'\n\nVue.use(Vuex)\n\nconst getDefaultState = () => {\n return {\n debugMessages: [],\n loadingCount: 0,\n activeLoaders: [],\n appLoadingCount: 0,\n debugActivateCounter: 0,\n darkMode: JSON.parse(localStorage.getItem('darkMode')),\n initialAppLoad: false, // Prevents full page loader on subsequent loads\n embedded: false, // App is embedded within RR\n drawer:\n localStorage.getItem('drawer') === undefined ||\n localStorage.getItem('drawer') === null\n ? false\n : JSON.parse(localStorage.getItem('drawer')),\n serviceStatus: null,\n serviceStatusLoadingCount: 0,\n }\n}\n\nconst state = getDefaultState()\n\nconst store = new Vuex.Store({\n modules,\n state,\n plugins: [api, i18n, appInsights],\n // Enable strict mode in development to get a warning\n // when mutating state outside of a mutation.\n // https://vuex.vuejs.org/guide/strict.html\n strict: process.env.NODE_ENV !== 'production',\n getters: {\n moduleName: () => 'root-store',\n isLoadingByKey: (state) => (key) => state.activeLoaders.indexOf(key) > -1,\n isLoadingApp: (state) => state.appLoadingCount > 0,\n serviceStatus: (state) => {\n if (!state.serviceStatus || !state.serviceStatus?.html) return null\n return state.serviceStatus\n },\n isLoadingServiceStatus: (state) => state.serviceStatusLoadingCount > 0,\n hasLoadedAppOnce: (state) => state.initialAppLoad,\n isError: (state) => state.error,\n isDebugModeActive: (state) => state.debugActivateCounter >= 10,\n isDarkModeActive: (state) => state.darkMode,\n isDrawerOpen: (state) => state.drawer,\n },\n mutations: {\n START_LOADING(state, key) {\n state.activeLoaders.push(key)\n },\n FINISH_LOADING(state, key) {\n const indexOfLoader = state.activeLoaders.indexOf(key)\n if (indexOfLoader === -1) return\n state.activeLoaders.splice(indexOfLoader, 1)\n },\n START_SERVICE_STATUS_LOADING(state) {\n state.serviceStatusLoadingCount++\n },\n FINISH_SERVICE_STATUS_LOADING(state) {\n state.serviceStatusLoadingCount--\n },\n INCREMENT_APP_LOADING(state) {\n state.appLoadingCount++\n },\n DECREMENT_APP_LOADING(state) {\n state.appLoadingCount--\n },\n SET_APP_AS_LOADED(state) {\n state.initialAppLoad = true\n },\n RESET_APP_LOADING_STATE(state) {\n state.initialAppLoad = false\n },\n SET_ERROR(state) {\n state.error = true\n },\n ACTIVATE_DEBUG(state) {\n state.debugActivateCounter = 10\n },\n INCREMENT_DEBUG(state) {\n state.debugActivateCounter++\n },\n RESET_DEBUG(state) {\n state.debugActivateCounter = 0\n },\n ENABLE_DARKMODE(state) {\n state.darkMode = true\n localStorage.setItem('darkMode', true)\n },\n DISABLE_DARKMODE(state) {\n state.darkMode = false\n localStorage.setItem('darkMode', false)\n },\n OPEN_DRAWER(state) {\n state.drawer = true\n localStorage.setItem('drawer', true)\n },\n CLOSE_DRAWER(state) {\n state.drawer = false\n localStorage.setItem('drawer', false)\n },\n CLEAR(state) {\n // Clear out local and session storage\n localStorage.clear()\n sessionStorage.clear()\n\n Object.assign(state, getDefaultState())\n },\n ADD_DEBUG_MESSAGE(state, obj) {\n state.debugMessages.push(obj)\n },\n INSERT_SERVICE_STATUS(state, serviceStatus) {\n state.serviceStatus = {\n ...{\n lastUpdated: dayjs(),\n },\n ...serviceStatus,\n }\n },\n },\n actions: {\n addDebugMessage({ commit, getters }, message) {\n if (getters.isDebugModeActive) {\n commit('ADD_DEBUG_MESSAGE', { date: new Date(), message: message })\n toast.debug(message)\n // eslint-disable-next-line no-console\n console.log(message)\n }\n },\n startLoadingApp({ commit }) {\n commit('INCREMENT_APP_LOADING')\n },\n finishLoadingApp({ commit }) {\n commit('DECREMENT_APP_LOADING')\n },\n startLoading({ commit }) {\n commit('START_LOADING')\n },\n finishLoading({ commit }) {\n commit('FINISH_LOADING')\n },\n setAppAsLoaded({ commit }) {\n commit('SET_APP_AS_LOADED')\n },\n resetAppLoadingState({ commit }) {\n commit('RESET_APP_LOADING_STATE')\n },\n toggleDebugMode({ commit, dispatch }) {\n if (this.state.debugActivateCounter <= 0) {\n commit('ACTIVATE_DEBUG')\n dispatch('addDebugMessage', 'Debug mode on')\n } else {\n dispatch('addDebugMessage', 'Debug mode off')\n commit('RESET_DEBUG')\n }\n },\n toggleDarkMode({ commit }) {\n this.state.darkMode\n ? commit('DISABLE_DARKMODE')\n : commit('ENABLE_DARKMODE')\n },\n toggleDrawer({ commit }) {\n this.state.drawer ? commit('CLOSE_DRAWER') : commit('OPEN_DRAWER')\n },\n clearStore({ commit }) {\n dispatchActionForAllModules('clear')\n\n commit('CLEAR')\n },\n async setLocale({ dispatch }, locale) {\n this.$i18n.locale = locale\n await dispatch('setFavicon')\n },\n setFavicon(context) {\n const favicon = document.querySelector(\"link[rel~='icon']\")\n favicon.href = this.$i18n.t('app.favicon')\n },\n async fetchServiceStatus({ commit, getters }, forceRefresh) {\n // 1. Check data is cached\n if (\n isCacheFresh({\n cacheDuration: 1,\n durationUnits: DurationUnits.HOUR,\n lastUpdated: state.serviceStatus?.lastUpdated,\n forceRefresh,\n })\n )\n return success({ data: getters.serviceStatus })\n\n // 2. Fetch fresh data\n commit('START_SERVICE_STATUS_LOADING')\n\n const response = await getServiceStatus()\n\n commit('INSERT_SERVICE_STATUS', response.isSuccess ? response.data : null)\n\n commit('FINISH_SERVICE_STATUS_LOADING')\n return response\n },\n /**\n * Logs store exceptions via the app logger\n * @param {*} param0\n * @param {StoreErrorDTO} payload\n */\n logStoreException(context, payload) {\n logger.logError(payload)\n },\n trackClickEvent(context, { name, properties }) {\n if (config.get('env') === Environment.development) {\n // eslint-disable-next-line no-console\n console.debug({ name, properties })\n } else {\n Vue.prototype.$appInsights.trackEvent({ name, properties })\n }\n },\n },\n})\n\nexport default store\n\n// Automatically run the `init` action for every module,\n// if one exists.\ndispatchActionForAllModules('init')\n","/**\n * @typedef {Object} TreeViewDtoType\n * @property {number} id - Unique identifier\n * @property {string} name\n * @property {boolean} locked - Disables node and children\n * @property {TreeViewDtoType[]} children\n */\n\n/**\n * @class\n */\nexport default class TreeViewDto {\n /**\n * Create a new TreeViewDto.\n * @param {...TreeViewDtoType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n this.locked = params.locked\n this.children = params.children ?? []\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"title\":\"_timeout_title_QmghM\"};","export { default } from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"","export const PermissionLevel = Object.freeze({\n /**\n * Can be either group, client or location level\n */\n GROUP_AND_BELOW: 'group_and_below',\n /**\n * Permissions for strictly the group level\n */\n GROUP: 'group',\n /**\n * Can be either client or location level\n */\n CLIENT_AND_BELOW: 'client_and_below',\n /**\n * Permissions for strictly the client level\n */\n CLIENT: 'client',\n /**\n * Can be either the currently selected client or one of the client's locations\n */\n SELECTED_CLIENT_AND_BELOW: 'selected_client_and_below',\n /**\n * Permissions for strictly the selected client\n */\n SELECTED_CLIENT: 'selected_client',\n /**\n * Permissions for strictly the location level\n */\n LOCATION: 'location',\n})\n","import Vue from 'vue'\nimport { logger } from '@/services/logging/AppLogger'\nimport VueErrorDTO from '@/models/error/vueErrorDTO'\nimport WindowErrorDTO from '@/models/error/windowErrorDTO'\n\n/**\n * Captures the errors that are specific to Vue instances. It would not be able\n * to capture the errors which are outside of Vue instances such as utils files,\n * services etc.\n * @param {*} err complete error trace, contains the `message` and `error stack`\n * @param {*} vm Vue component/instance in which error is occurred\n * @param {*} info Vue specific error information such as lifecycle hooks, events etc.\n */\nVue.config.errorHandler = (err, vm, info) => {\n logger.logError(new VueErrorDTO({ err, vm, info }))\n}\n\n/**\n * Captures unhandled expections outside of the Vue instance\n * @param {String} message A string containing a human-readable error message describing the problem. Same as `ErrorEvent.event`\n * @param {String} source A string containing the URL of the script that generated the error.\n * @param {Number} lineno An integer containing the line number of the script file on which the error occurred.\n * @param {Number} colno An integer containing the column number of the script file on which the error occurred.\n * @param {Error} error The error being thrown. Usually an `Error` object.\n */\nwindow.onerror = function(message, source, lineno, colno, error) {\n logger.logError(new WindowErrorDTO({ message, source, lineno, colno, error }))\n}\n\n/**\n * Captures promise rejections that are not handled by window.onerror\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n *\n * @param {PromiseRejectionEvent} event\n */\nconst handlePromiseRejection = function(event) {\n logger.logError(event)\n}\n\nwindow.addEventListener('unhandledrejection', handlePromiseRejection)\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ValidationProvider',{attrs:{\"name\":_vm.$attrs.label,\"rules\":_vm.rules},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nreturn [_c('v-text-field',_vm._g(_vm._b({attrs:{\"type\":_vm.type,\"error-messages\":errors},model:{value:(_vm.innerValue),callback:function ($$v) {_vm.innerValue=$$v},expression:\"innerValue\"}},'v-text-field',\n _vm.$attrs\n // https://vuejs.org/v2/guide/components-props.html#Disabling-Attribute-Inheritance\n ,false),\n _vm.$listeners\n // https://vuejs.org/v2/guide/components-custom-events.html#Binding-Native-Events-to-Components\n ))]}}])})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-input-text.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-input-text.vue?vue&type=template&id=6c2d00da&\"\nimport script from \"./_base-input-text.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-input-text.vue?vue&type=script&lang=js&\"\nimport style0 from \"./_base-input-text.vue?vue&type=style&index=0&lang=scss&module=true&\"\n\n\n\n\nfunction injectStyles (context) {\n \n this[\"$style\"] = (style0.locals || style0)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VTextField})\n","/**\n * Describes environment types related to process.env.NODE_ENV and some custom types\n */\nexport default Object.freeze({\n production: 'production',\n development: 'development',\n unit: 'unit',\n e2e: 'e2e',\n})\n","import store from '@state/store'\nimport i18n from '@plugins/vue-i18n'\nimport { PermissionLevel } from '@/shared/constants/permissions/PermissionLevel'\nimport { PermissionScope } from '@/shared/constants/permissions/PermissionScope'\nimport { PermissionModifier } from '@/shared/constants/permissions/PermissionModifier'\nimport { PermissionRequirement } from '@/shared/constants/permissions/PermissionRequirement'\nimport ErrorPageCodes from '@/shared/constants/error/ErrorPageCodes'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\n\nexport default [\n {\n ...routeDefinitions.home,\n component: () => lazyLoadView(import('@views/home.vue')),\n meta: {\n title: i18n.t('home.homePageTitle'),\n },\n },\n {\n ...routeDefinitions.timesheets,\n component: () => lazyLoadView(import('@views/timesheets.vue')),\n meta: {\n title: i18n.t('timesheets.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: PermissionLevel.SELECTED_CLIENT_AND_BELOW,\n scope: PermissionScope.TIMESHEETS,\n modifier: PermissionModifier.VIEW,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.candidates,\n component: () => lazyLoadView(import('@views/candidates.vue')),\n meta: {\n title: i18n.t('candidates.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ONE,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.BOOKING,\n modifier: PermissionModifier.VIEW,\n },\n {\n level: PermissionLevel.SELECTED_CLIENT_AND_BELOW,\n scope: PermissionScope.TIMESHEETS,\n modifier: PermissionModifier.VIEW,\n },\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.VIEW,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.help,\n component: () => lazyLoadView(import('@views/help.vue')),\n meta: {\n title: i18n.t('help.pageTitle'),\n },\n },\n {\n ...routeDefinitions.bookings,\n component: {\n render(c) {\n return c('router-view')\n },\n },\n children: [\n {\n ...routeDefinitions.bookingsCreate,\n component: () => import('@/router/views/bookings/booking-create.vue'),\n meta: {\n title: i18n.t('bookingCreate.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ONE,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.BOOKING,\n modifier: PermissionModifier.VIEW,\n },\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.PENDING_BOOKING,\n modifier: PermissionModifier.CREATE,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.bookingsPendingApproval,\n component: () => import('@/router/views/bookings/pending-approval.vue'),\n meta: {\n title: i18n.t('booking.pendingApproval.pageTitle'),\n permissions: {\n requirement: PermissionRequirement.ONE,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.PENDING_BOOKING,\n modifier: PermissionModifier.VIEW,\n },\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.PENDING_BOOKING,\n modifier: PermissionModifier.CREATE,\n },\n ],\n },\n },\n },\n ],\n },\n {\n ...routeDefinitions.settings,\n component: () =>\n lazyLoadView(import('@/router/views/settings/settings.vue')),\n },\n {\n ...routeDefinitions.changePassword,\n component: () =>\n lazyLoadView(\n import('@/router/views/settings/settings-change-password.vue')\n ),\n },\n {\n ...routeDefinitions.login,\n component: () => lazyLoadView(import('@views/login.vue')),\n meta: {\n public: true,\n title: i18n.t('login.loginPageTitle'),\n beforeResolve(routeTo, routeFrom, next) {\n // If the user is already logged in\n if (store.getters['auth/isUserLoggedIn']) {\n // Redirect to the home page instead\n next({ name: routeDefinitions.home.name })\n } else {\n // Continue to the login page\n next()\n }\n },\n },\n },\n {\n ...routeDefinitions.impersonateLogout,\n component: () => lazyLoadView(import('@views/impersonate-logout.vue')),\n meta: {\n public: true,\n title: 'Impersonate Logout',\n },\n },\n {\n ...routeDefinitions.impersonateLogin,\n component: () => lazyLoadView(import('@views/login.vue')),\n meta: {\n public: true,\n title: 'Impersonate Login',\n beforeResolve(routeTo, routeFrom, next) {\n // If the user is already logged in\n if (store.getters['auth/isUserLoggedIn']) {\n // Redirect to the home page instead\n next({ name: routeDefinitions.home.name })\n } else {\n // Continue to the login page\n next()\n }\n },\n },\n },\n {\n ...routeDefinitions.finance,\n component: () => lazyLoadView(import('@views/finance.vue')),\n meta: {\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: null,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.VIEW,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.invoiceDetails,\n component: () =>\n lazyLoadView(import('@/router/views/finance/invoice-view.vue')),\n meta: {\n title: i18n.t('finance.invoiceViewPageTitle'),\n permissions: {\n requirement: PermissionRequirement.ALL,\n list: [\n {\n level: PermissionLevel.GROUP_AND_BELOW,\n scope: PermissionScope.ACCOUNTS,\n modifier: PermissionModifier.VIEW,\n },\n ],\n },\n },\n },\n {\n ...routeDefinitions.logout,\n meta: {\n beforeResolve(routeTo, routeFrom, next) {\n store.dispatch('auth/logOut')\n const authRequiredOnPreviousRoute = routeFrom.matched.some(\n (route) => route.meta.authRequired\n )\n // Navigate back to previous page, or home as a fallback\n next(\n authRequiredOnPreviousRoute\n ? { name: routeDefinitions.home.name }\n : { ...routeFrom }\n )\n },\n },\n },\n {\n path: '/404',\n name: '404',\n redirect: { name: routeDefinitions.notFound.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.PAGE_NOT_FOUND.id,\n },\n // Allows props to be passed to the 404 page through route\n // params, such as `resource` to define what wasn't found.\n props: true,\n },\n // Redirect any unmatched routes to the 404 page. This may\n // require some server configuration to work in production:\n // https://router.vuejs.org/en/essentials/history-mode.html#example-server-configurations\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.notFound.name,\n meta: {\n public: true,\n label: 'NotFound',\n type: ErrorPageCodes.PAGE_NOT_FOUND.id,\n },\n },\n {\n path: '/500',\n redirect: { name: routeDefinitions.error.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '/401',\n redirect: { name: routeDefinitions.unauthorized.name },\n meta: {\n public: true,\n label: 'Unauthorized',\n type: ErrorPageCodes.UNAUTHORIZED.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '/403',\n redirect: { name: routeDefinitions.forbidden.name },\n meta: {\n public: true,\n label: 'Forbidden',\n type: ErrorPageCodes.FORBIDDEN.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '/error',\n redirect: { name: routeDefinitions.error.name },\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.error.name,\n meta: {\n public: true,\n label: 'Error',\n type: ErrorPageCodes.INTERNAL_SERVER_ERROR.id,\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.unauthorized.name,\n meta: {\n public: true,\n label: 'Unauthorized',\n type: ErrorPageCodes.UNAUTHORIZED.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.forbidden.name,\n meta: {\n public: true,\n label: 'Forbidden',\n type: ErrorPageCodes.FORBIDDEN.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.accountLoadFailure.name,\n meta: {\n public: true,\n label: 'Failed To Load Account',\n type: ErrorPageCodes.ACCOUNT_LOAD_FAILURE.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.noServerResponse.name,\n meta: {\n public: true,\n label: 'Unable to contact server',\n type: ErrorPageCodes.NO_SERVER_RESPONSE.id,\n icon: 'mdi-account-cancel',\n },\n },\n {\n path: '*',\n component: require('@views/_error.vue').default,\n props: true,\n name: routeDefinitions.actionLocked.name,\n meta: {\n public: true,\n label: 'Action Locked',\n type: ErrorPageCodes.ACTION_LOCKED.id,\n icon: 'mdi-shield-alert',\n },\n },\n {\n path: '/under-construction',\n name: 'underConstruction',\n component: () => lazyLoadView(import('@views/_under-construction.vue')),\n meta: {\n public: true,\n title: i18n.t('underConstruction.pageTitle'),\n },\n },\n]\n\n/** Lazy-loads view components, but with better UX. A loading view\n * will be used if the component takes a while to load, falling\n * back to a timeout view in case the page fails to load. You can\n * use this component to lazy-load a route with:\n *\n * component: () => lazyLoadView(import('@views/my-view'))\n *\n * NOTE: Components loaded with this strategy DO NOT have access\n * to in-component guards, such as beforeRouteEnter,\n * beforeRouteUpdate, and beforeRouteLeave. You must either use\n * route-level guards instead or lazy-load the component directly:\n *\n * component: () => import('@views/my-view')\n */\nfunction lazyLoadView(AsyncView) {\n const AsyncHandler = () => ({\n component: AsyncView,\n // A component to use while the component is loading.\n loading: require('@views/_loading.vue').default,\n // Delay before showing the loading component.\n // Default: 200 (milliseconds).\n delay: 400,\n // A fallback component in case the timeout is exceeded\n // when loading the component.\n error: require('@views/_timeout.vue').default,\n // Time before giving up trying to load the component.\n // Default: Infinity (milliseconds).\n timeout: 10000,\n })\n\n return Promise.resolve({\n functional: true,\n render(h, { data, children }) {\n // Transparently pass any props or children\n // to the view component.\n return h(AsyncHandler, data, children)\n },\n })\n}\n","import store from '@state/store'\nimport Vue from 'vue'\nimport VueRouter from 'vue-router'\n// https://github.com/declandewet/vue-meta\nimport VueMeta from 'vue-meta'\n// Adds a loading bar at the top during page loads.\nimport NProgress from 'nprogress/nprogress'\nimport { hasAccessToRoute } from '@/helpers/permissions-helpers.js'\nimport ErrorPageCodes from '@/shared/constants/error/ErrorPageCodes'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\nimport RequestErrorSource from '@/shared/constants/error/RequestErrorSource'\nimport { decideRouteBasedOnFeatureToggles } from '@/services/features/featureDecisions.js'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\nimport routes from './routes'\n\nVue.use(VueRouter)\nVue.use(VueMeta, {\n // The component option name that vue-meta looks for meta info on.\n keyName: 'metaInfo',\n})\n\nconst router = new VueRouter({\n routes,\n // Use the HTML5 history API (i.e. normal-looking routes)\n // instead of routes with hashes (e.g. example.com/#/about).\n // This may require some server configuration in production:\n // https://router.vuejs.org/en/essentials/history-mode.html#example-server-configurations\n mode: 'history',\n // Simulate native-like scroll behavior when navigating to a new\n // route and using back/forward buttons.\n scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n },\n})\n\nconst startRouteLoading = () => {\n // Begin loading animation. Only really required for initial page loads/refreshes.\n if (!store.getters.hasLoadedAppOnce) {\n store.dispatch('startLoadingApp')\n }\n\n // Only display the top loading bar after initial load\n if (store.getters.hasLoadedAppOnce) NProgress.start()\n}\nconst stopRouteLoading = () => {\n // Prevents full page loader showing up on every route change\n if (store.getters.isLoadingApp) {\n store.dispatch('setAppAsLoaded')\n }\n\n // Complete the full page loading animation\n store.dispatch('finishLoadingApp')\n NProgress.done()\n}\n\n// Before each route evaluates...\nrouter.beforeEach(async (routeTo, routeFrom, next) => {\n // Check if auth is required on this route\n // (including nested routes).\n const isPublic = routeTo.matched.some((route) => route.meta.public)\n\n // If auth isn't required for the route, just continue.\n if (isPublic) return next()\n\n startRouteLoading()\n\n // If auth is required and the user isn't logged in...\n if (!store.getters['auth/isUserLoggedIn']) {\n // Retrieve another access token...\n try {\n const validToken = await store.dispatch('auth/refreshToken')\n\n // Then continue if the token is valid & was acquired successfully,\n // otherwise redirect to login.\n if (!validToken.isSuccess || !store.getters['auth/isUserLoggedIn']) {\n throw new Error('Could not refresh access token')\n }\n } catch {\n return redirectToLandingPage()\n }\n }\n\n // Get user's profile if not already set or isn't fresh\n if (\n !store.getters['auth/currentUser'] ||\n !store.getters['auth/permissions'] ||\n store.getters['auth/permissions'].length === 0\n ) {\n try {\n // throw new Error()\n const loadUserProfileResult = await store.dispatch(\n 'auth/getCurrentUserProfile'\n )\n\n if (!loadUserProfileResult.isSuccess)\n return getErrorPageRedirectByStatusCode(loadUserProfileResult)\n\n // Set locale loaded in with profile\n await store.dispatch('setLocale', loadUserProfileResult.data.language)\n } catch (ex) {\n return redirectToErrorPage(ErrorPageCodes.ACCOUNT_LOAD_FAILURE.routeName)\n }\n }\n\n // If auth is required and the user is NOT currently logged in,\n // redirect to login.\n if (\n !store.getters['auth/isUserLoggedIn'] ||\n !store.getters['auth/currentUser']\n )\n redirectToLandingPage()\n\n // Check if the cached selected clients exist within loaded permissions\n if (\n store.getters['client/mapSelectedClientsToClientsInPermissions'].length ===\n 0\n ) {\n const allClients = store.getters['auth/getAllClients']\n\n if (!allClients || allClients.length === 0) {\n return redirectToErrorPage()\n }\n\n await store.dispatch(\n 'client/setClientList',\n allClients.map((client) => client.clientId)\n )\n }\n\n // TODO: Handle client owner details TASK #12722\n // Loading the first client's owner for now\n // Load the contact's rep if they aren't loaded yet\n if (\n !store.getters['client/owner'](\n store.getters['client/getSelectedClients'][0]\n )\n ) {\n store.dispatch(\n 'client/loadClientAdditionalInformation',\n store.getters['client/getSelectedClients'][0]\n )\n }\n\n // Check if permissions are required for route\n if (!hasAccessToRoute(routeTo, store))\n redirectToErrorPage(ErrorPageCodes.FORBIDDEN.routeName)\n\n return decideRouteBasedOnFeatureToggles(\n store.getters['features/featureToggles'],\n routeTo,\n next\n )\n\n function redirectToLandingPage() {\n stopRouteLoading()\n\n // To complete the redirect auth step for MSAL they should be directed to\n // impersonate login instead of the landing page\n if (store.getters['auth/hasImpersonateContactId']) {\n return next({ name: routeDefinitions.login.name })\n }\n\n // Pass the original route to the login component\n window.location.href = `${getLanguageBasedOnBaseURL()}/landing`\n }\n\n function redirectToErrorPage(errorPageName = 'ErrorPage') {\n stopRouteLoading()\n next({ name: errorPageName, params: [routeTo.path], replace: true })\n }\n\n function getErrorPageRedirectByStatusCode(response) {\n switch (response.error.source) {\n case RequestErrorSource.server: {\n const statusCode = response.error._error.response.status\n switch (statusCode) {\n case ErrorPageCodes.FORBIDDEN.statusCode:\n return redirectToErrorPage(ErrorPageCodes.FORBIDDEN.routeName)\n case ErrorPageCodes.UNAUTHORIZED.statusCode:\n return redirectToErrorPage(ErrorPageCodes.UNAUTHORIZED.routeName)\n case ErrorPageCodes.BAD_REQUEST.statusCode:\n return redirectToErrorPage(ErrorPageCodes.BAD_REQUEST.routeName)\n default:\n return redirectToErrorPage(\n ErrorPageCodes.INTERNAL_SERVER_ERROR.routeName\n )\n }\n }\n case RequestErrorSource.request:\n return redirectToErrorPage(ErrorPageCodes.NO_SERVER_RESPONSE.routeName)\n default:\n return redirectToErrorPage(\n ErrorPageCodes.ACCOUNT_LOAD_FAILURE.routeName\n )\n }\n }\n})\n\nrouter.beforeResolve(async (routeTo, routeFrom, next) => {\n // Create a `beforeResolve` hook, which fires whenever\n // `beforeRouteEnter` and `beforeRouteUpdate` would. This\n // allows us to ensure data is fetched even when params change,\n // but the resolved route does not. We put it in `meta` to\n // indicate that it's a hook we created, rather than part of\n // Vue Router (yet?).\n try {\n // For each matched route...\n for (const route of routeTo.matched) {\n await new Promise((resolve, reject) => {\n // If a `beforeResolve` hook is defined, call it with\n // the same arguments as the `beforeEnter` hook.\n if (route.meta && route.meta.beforeResolve) {\n route.meta.beforeResolve(routeTo, routeFrom, (...args) => {\n // If the user chose to redirect...\n if (args.length) {\n // If redirecting to the same route we're coming from...\n if (routeFrom.name === args[0].name) {\n // Complete the animation of the route progress bar.\n NProgress.done()\n }\n // Complete the redirect.\n next(...args)\n reject(new Error('Redirected'))\n } else {\n resolve()\n }\n })\n } else {\n // Otherwise, continue resolving the route.\n resolve()\n }\n })\n }\n // If a `beforeResolve` hook chose to redirect, just return.\n } catch (error) {\n return\n }\n\n // If we reach this point, continue resolving the route.\n next()\n})\n\n// When each route is finished evaluating...\nrouter.afterEach((routeTo, routeFrom) => {\n // Complete the animation of the route progress bar.\n stopRouteLoading()\n})\n\nexport default router\n","// Globally register all base components for convenience, because they\n// will be used very frequently. Components are registered using the\n// PascalCased version of their file name.\n\nimport Vue from 'vue'\n\n// https://webpack.js.org/guides/dependency-management/#require-context\nconst requireComponent = require.context(\n // Look for files in the current directory\n '.',\n // Do not look in subdirectories\n false,\n // Only include \"_base-\" prefixed .vue files\n /_base-[\\w-]+\\.vue$/\n)\n\n// For each matching file name...\nrequireComponent.keys().forEach((fileName) => {\n // Get the component config\n const componentConfig = requireComponent(fileName)\n // Get the PascalCase version of the component name\n const componentName = fileName\n // Remove the \"./_\" from the beginning\n .replace(/^\\.\\/_/, '')\n // Remove the file extension from the end\n .replace(/\\.\\w+$/, '')\n // Split up kebabs\n .split('-')\n // Upper case\n .map((kebab) => kebab.charAt(0).toUpperCase() + kebab.slice(1))\n // Concatenated\n .join('')\n\n // Globally register the component\n Vue.component(componentName, componentConfig.default || componentConfig)\n})\n","// generated by genversion\nexport const version = '1.0.0';\n","import Vue from 'vue'\nimport { version } from '@root/lib/version'\nconst { get, has, set, merge } = require('lodash')\n\n// Load config based on environment\nconst env = process.env.NODE_ENV\n\n// Merge in additional config\nconst config = {\n // Props\n env,\n appVersion: version,\n sameDayBookingCutOffTime: '08:00', // Should be moved to another setting later, possible client by client basis\n password: {\n minChars: 8,\n allowedCharsRegex: /[(@!#?$%^&*)(+=._-]{1,}/,\n },\n ...Vue.prototype.$config,\n\n // Methods\n get(path) {\n return get(this, path)\n },\n has(path) {\n return has(this, path)\n },\n set(path, value) {\n return set(this, path, value)\n },\n load(obj) {\n merge(this, obj)\n },\n}\n\nexport default config\n","export default Object.freeze({\n /**\n * Denotes that the associated feature is enabled\n */\n enabled: 'enabled',\n /**\n * Denotes that the associated feature is disabled\n */\n disabled: 'disabled',\n /**\n * Used by route feature toggles. Will redirect user to under construction page if set.\n */\n underConstruction: 'underConstruction',\n})\n","import featureToggleOptions from '@/shared/constants/features/featureToggleOptions'\nimport routeDefinitions from '@/shared/constants/routes/routeDefinitions'\n\nconst isEnabled = (key, featureToggles) => {\n if (\n !featureToggles ||\n !Object.prototype.hasOwnProperty.call(featureToggles, key)\n )\n return false\n\n const featureToggle = featureToggles[key]\n return featureToggle === featureToggleOptions.enabled\n}\n\n/**\n * Generates a series of feature toggle functions that will instruct which features\n * are enabled or not\n * @param {Object} featureToggles Dictionary of feature toggles\n */\nexport const createFeatureDecisions = (featureToggles) => {\n return {\n // #region Client Group Overview\n\n /**\n * UI level feature toggle that will display the client group overview UI if\n * the client enabled flag and the feature is enabled\n * @param {Boolean} clientEnabled\n * @returns\n */\n canViewClientGroupOverview(clientEnabled = false) {\n return (\n isEnabled('feature_clientGroupOverview_view', featureToggles) &&\n clientEnabled\n )\n },\n // #endregion\n }\n}\n\n/**\n * Returns value of route toggle if set or undefined\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {String} routeName\n * @returns\n */\nconst getRouteToggle = (featureToggles, routeName) => {\n if (\n !featureToggles ||\n !Object.prototype.hasOwnProperty.call(featureToggles, `route_${routeName}`)\n )\n return featureToggleOptions.enabled\n return featureToggles[`route_${routeName}`]\n}\n\n/**\n * Makes routing decisions based on feature toggles and the desired next route\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {*} routeTo\n * @param {Function} next\n */\nexport const decideRouteBasedOnFeatureToggles = (\n featureToggles,\n routeTo,\n next\n) => {\n // Check if route toggle exists. If yes, decide based on value. If not, assume enabled\n const routeToggle = getRouteToggle(featureToggles, routeTo.name)\n\n switch (routeToggle) {\n case featureToggleOptions.enabled:\n case undefined:\n return next()\n case featureToggleOptions.underConstruction:\n return next({\n name: routeDefinitions.underConstruction.name,\n query: { redirectFrom: routeTo.fullPath },\n })\n case featureToggleOptions.disabled:\n default:\n return next({\n name: routeDefinitions.notFound.name,\n params: [routeTo.fullPath],\n replace: true,\n })\n }\n}\n\n/**\n * Checks route toggles to determine if a nav item should be displayed or not\n * @param {Object} featureToggles Dictionary of feature toggles\n * @param {String} routeName\n * @returns\n */\nexport const displayNavItem = (featureToggles, routeName) => {\n const routeToggle = getRouteToggle(featureToggles, routeName)\n return routeToggle === featureToggleOptions.enabled\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isDev)?_c('v-system-bar',{attrs:{\"app\":\"\",\"dark\":\"\",\"color\":\"purple\"}},[_c('v-icon',[_vm._v(\"mdi-wrench\")]),_c('span',[_vm._v(\" Dev Mode \")]),_c('v-spacer'),_c('span',{staticClass:\"mr-4 caption\"},[_c('v-switch',{attrs:{\"id\":\"debug-toggle\",\"input-value\":_vm.debugToggle},on:{\"change\":_vm.toggleDebugMode},scopedSlots:_vm._u([{key:\"label\",fn:function(){return [_c('span',{staticClass:\"caption\"},[_vm._v(\"Enable Debug Mode\")])]},proxy:true}],null,false,3585174715)})],1),(!_vm.isMobileViewPort)?_c('span',{staticClass:\"mr-4\"},[_c('v-icon',[_vm._v(\"mdi-code-tags\")]),_c('span',[_vm._v(_vm._s((\"v\" + _vm.appVersion)))])],1):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n \n mdi-wrench\n \n Dev Mode\n \n \n \n \n \n Enable Debug Mode\n \n \n \n\n \n mdi-code-tags\n {{ `v${appVersion}` }}\n \n \n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./the-debug-bar.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./the-debug-bar.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./the-debug-bar.vue?vue&type=template&id=1d4309ae&\"\nimport script from \"./the-debug-bar.vue?vue&type=script&lang=js&\"\nexport * from \"./the-debug-bar.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\nimport { VSystemBar } from 'vuetify/lib/components/VSystemBar';\ninstallComponents(component, {VIcon,VSpacer,VSwitch,VSystemBar})\n","/**\n * @typedef {Object} ClientLoginLocationViewModelType\n * @property {number} locationId - The ID of the location.\n * @property {string} locationName - The name of the location.\n * @property {number} clientId - The ID of the client.\n * @property {string} clientName - The name of the client.\n * @property {number} clientTypeInt - The integer representation of the client type.\n * @property {number} clientGroupId - The ID of the client group.\n * @property {string} clientGroupName - The name of the client group.\n * @property {string} startTime - The start time of operations.\n * @property {string} endTime - The end time of operations.\n * @property {number} locationLunchBreakMinutes - The duration of the lunch break in minutes.\n * @property {boolean} submittedByTemplateRequired - Indicates if submission by template is required.\n * @property {string} addressLine1 - The first line of the address.\n * @property {string} addressLine2 - The second line of the address.\n * @property {string} suburb - The suburb of the location.\n * @property {string} postcode - The postcode of the location.\n * @property {string} state - The state of the location.\n * @property {string} country - The country of the location.\n * @property {string} timeZone - The timezone of the location.\n */\n\nexport default class ClientLoginLocationViewModel {\n /** @param {ClientLoginLocationViewModelType} params */\n constructor(params) {\n this.locationId = params.locationId\n this.locationName = params.locationName\n this.clientId = params.clientId\n this.clientName = params.clientName\n this.clientTypeInt = params.clientTypeInt\n this.clientGroupId = params.clientGroupId\n this.clientGroupName = params.clientGroupName\n this.startTime = params.startTime\n this.endTime = params.endTime\n this.locationLunchBreakMinutes = params.locationLunchBreakMinutes\n this.submittedByTemplateRequired = params.submittedByTemplateRequired\n this.addressLine1 = params.addressLine1\n this.addressLine2 = params.addressLine2\n this.suburb = params.suburb\n this.postcode = params.postcode\n this.state = params.state\n this.country = params.country\n this.timeZone = params.timeZone\n }\n}\n","export const LogoShade = Object.freeze({\n DARK: 'Dark',\n LIGHT: 'Light',\n WHITE: 'White',\n})\n","var map = {\n\t\"./_base-button.vue\": \"8339\",\n\t\"./_base-checkbox-list.vue\": \"4626\",\n\t\"./_base-icon.vue\": \"670f\",\n\t\"./_base-input-select.vue\": \"16e5\",\n\t\"./_base-input-text.vue\": \"9c57\",\n\t\"./_base-link.vue\": \"cbd4\",\n\t\"./_base-logo.vue\": \"b7c5\",\n\t\"./_base-page-title.vue\": \"feda\",\n\t\"./_base-split-btn.vue\": \"c3bd\",\n\t\"./_base-status-label.vue\": \"f8f2\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"b526\";","export default class ShiftRecordBreakDto {\n constructor({ type, startTime, endTime } = {}) {\n /**\n * The type of break that was taken\n * @type {String}\n * @see {ShiftRecordBreakType} for valid range of values\n */\n this.type = type\n /**\n * Start time of block in 24 hr format\n * @type {String}\n * @example 08:30\n */\n this.startTime = startTime\n /**\n * End time of block in 24 hr format\n * @type {String}\n * @example 15:30\n */\n this.endTime = endTime\n }\n}\n","/* eslint-disable no-unused-vars */\nimport { isNonEmptyArray } from '@/helpers/array-helpers'\nimport dayjs from '@/services/date/index'\nimport ShiftRecordBreakDto from '../shiftRecords/shiftRecordBreakDto'\nimport CandidateTimesheetModificationsViewModel from './candidateTimesheetModificationsViewModel'\n\nexport default class TimesheetsPendingApprovalViewModel {\n constructor({\n locationId = 0,\n locationName,\n locationTimeZone,\n clientId = 0,\n clientName,\n clientGroupId = 0,\n payOptionType,\n payOptionTypes = [],\n unitType,\n bookingId = 0,\n startTimeLocal,\n endTimeLocal,\n startTimeUTC,\n endTimeUTC,\n candidateId = 0,\n candidateFirstName,\n candidateLastName,\n candidatePreferredName,\n candidateFullName,\n breakMinutes = 0,\n isApprovedByCandidate = true,\n breaks = [],\n timesheetMethod,\n bookingStatus,\n candidateBookingModifications,\n } = {}) {\n /**\n * @type {Number}\n */\n this.locationId = locationId\n\n /**\n * @type {String}\n */\n this.locationName = locationName\n\n /**\n * @type {String}\n */\n this.locationTimeZone = locationTimeZone\n\n /**\n * @type {Number}\n */\n this.clientId = clientId\n\n /**\n * @type {String}\n */\n this.clientName = clientName\n\n /**\n * @type {Number}\n */\n this.clientGroupId = clientGroupId\n\n /**\n * @type {String}\n */\n this.payOptionType = payOptionType\n\n /**\n * @type {Array}\n */\n this.payOptionTypes = isNonEmptyArray(payOptionTypes) ? payOptionTypes : []\n\n /**\n * @type {String}\n * @see {RateUnitType} for valid range of values\n */\n this.unitType = unitType\n\n /**\n * @type {Number}\n */\n this.bookingId = bookingId\n\n /**\n * @type {Date}\n */\n this.startTimeLocal = startTimeLocal ? dayjs(startTimeLocal) : null\n\n /**\n * @type {Date}\n */\n this.endTimeLocal = endTimeLocal ? dayjs(endTimeLocal) : null\n\n /**\n * @type {Date}\n */\n this.startTimeUTC = startTimeUTC ? dayjs.utc(startTimeUTC) : null\n\n /**\n * @type {Date}\n */\n this.endTimeUTC = endTimeUTC ? dayjs.utc(endTimeUTC) : null\n\n /**\n * @type {Number}\n */\n this.candidateId = candidateId\n\n /**\n * @type {String}\n */\n this.candidateFirstName = candidateFirstName\n\n /**\n * @type {String}\n */\n this.candidateLastName = candidateLastName\n\n /**\n * @type {String}\n */\n this.candidatePreferredName = candidatePreferredName\n\n /**\n * @type {String}\n */\n this.candidateFullName = candidateFullName\n\n /**\n * @type {Number}\n */\n this.breakMinutes = breakMinutes\n\n /**\n * @type {Boolean}\n */\n this.isApprovedByCandidate = isApprovedByCandidate\n\n /**\n * @type {Array}\n */\n this.breaks = isNonEmptyArray(breaks)\n ? breaks.map((breakTaken) => new ShiftRecordBreakDto(breakTaken))\n : []\n\n /**\n * @type {String}\n * @see {TimesheetMethod} for valid range of values\n */\n this.timesheetMethod = timesheetMethod\n\n /**\n * @type {Number}\n * @see {BookingStatus} for valid range of values\n */\n this.bookingStatus = bookingStatus\n\n /**\n * @type {CandidateTimesheetModificationsViewModel}\n */\n this.candidateBookingModifications = candidateBookingModifications\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a',{attrs:{\"href\":_vm.compHref,\"target\":_vm.compTarget}},[_c('v-img',_vm._g(_vm._b({staticClass:\"base-logo\",attrs:{\"src\":_vm.compSrc,\"title\":_vm.compAltText,\"alt\":_vm.compAltText,\"contain\":\"\"}},'v-img',Object.assign({}, _vm.commonAttributes, _vm.$attrs),false),_vm.$listeners))],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const LogoType = Object.freeze({\n COMPANY: 'company', // Company logo\n APP: 'app', // App logo (Ready2Book)\n})\n","\n\n\n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-logo.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-logo.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-logo.vue?vue&type=template&id=201a930c&\"\nimport script from \"./_base-logo.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-logo.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VImg } from 'vuetify/lib/components/VImg';\ninstallComponents(component, {VImg})\n","/**\n * Checks if an array contains any items.\n * @param {Array} arr The array to check.\n * @returns True, if the array contains items. Otherwise, false.\n * @obsolete Use isNullOrEmptyArray instead\n */\nexport const isNonEmptyArray = (arr) => !isNullOrEmptyArray(arr)\n\n/**\n * Checks whether an object is both an array and is empty.\n * @param arr {any}\n * @return {boolean} true if not an array or empty. Otherwise, false.\n */\nexport const isNullOrEmptyArray = (arr) =>\n !arr || !Array.isArray(arr) || arr.length === 0\n\n/**\n * Checks whether all elements within the given array are of a certain type e.g. typeof === 'string'\n * @param arr\n * @param type {string}\n * @return {boolean} true if all elements are of type. False if not array or not all elements are of same type\n */\nexport const isArrayOfType = (arr, type) => {\n return (\n arr &&\n Array.isArray(arr) &&\n arr.length &&\n // eslint-disable-next-line valid-typeof\n arr.every((i) => typeof i === type)\n )\n}\n","/**\n * @typedef {Object} ClientSelectorTreeViewDtoType\n * @property {number} id - Unique identifier\n * @property {string} name\n * @property {boolean} locked - Disables node and children\n * @property {string[]} locations\n */\n\n/**\n * @class\n */\nexport default class ClientSelectorTreeViewDto {\n /**\n * Create a new ClientSelectorTreeViewDto.\n * @param {...ClientSelectorTreeViewDtoType} params\n */\n constructor(params) {\n this.id = params.id\n this.name = params.name\n this.locked = params.locked\n this.locations = params.locations\n }\n}\n","export default Object.freeze({\n /**\n * Something happened in setting up the request that triggered an Error\n */\n unknown: 'unknown',\n /**\n * The request was made and the server responded with a status code\n * that falls out of the range of 2xx\n */\n server: 'server',\n /**\n * The request was made but no response was received\n */\n request: 'request',\n})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-item-group',{class:['v-btn-toggle', _vm.dense ? 'v-btn-toggle--dense' : '']},[_c('v-btn',_vm._g(_vm._b({},'v-btn',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\")],2),_c('v-menu',{attrs:{\"offset-y\":\"\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nvar attrs = ref.attrs;\nreturn [_c('v-btn',_vm._g(_vm._b({},'v-btn',Object.assign({}, attrs, _vm.$attrs),false),on),[_c('v-icon',[_vm._v(\"mdi-chevron-down\")])],1)]}}])},[_vm._t(\"menu\",[_c('v-list',{attrs:{\"dense\":\"\"}},[_c('v-list-item',[_c('v-list-item-title',[_vm._v(\"Item 1\")])],1)],1)])],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n \n mdi-chevron-down\n \n \n \n \n Item 1\n \n \n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-split-btn.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-split-btn.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-split-btn.vue?vue&type=template&id=3dc910f6&\"\nimport script from \"./_base-split-btn.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-split-btn.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VItemGroup } from 'vuetify/lib/components/VItemGroup';\nimport { VList } from 'vuetify/lib/components/VList';\nimport { VListItem } from 'vuetify/lib/components/VList';\nimport { VListItemTitle } from 'vuetify/lib/components/VList';\nimport { VMenu } from 'vuetify/lib/components/VMenu';\ninstallComponents(component, {VBtn,VIcon,VItemGroup,VList,VListItem,VListItemTitle,VMenu})\n","import Vue from 'vue'\nimport Toast, { POSITION } from 'vue-toastification'\nimport 'vue-toastification/dist/index.css'\n\n// Options: https://github.com/Maronato/vue-toastification/tree/main#plugin-registration-vueuse\nconst options = {\n position: POSITION.BOTTOM_CENTER,\n}\n\nVue.use(Toast, options)\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.href)?_c('a',_vm._g(_vm._b({attrs:{\"href\":_vm.href,\"target\":\"_blank\"}},'a',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\"),(_vm.showExternalLinkIcon)?_c('v-icon',_vm._b({staticClass:\"ml-1\",attrs:{\"small\":\"\"}},'v-icon',_vm.$attrs,false),[_vm._v(\"mdi-open-in-new\")]):_vm._e()],2):_c('RouterLink',_vm._g(_vm._b({attrs:{\"to\":_vm.routerLinkTo}},'RouterLink',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n mdi-open-in-new\n \n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-link.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-link.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-link.vue?vue&type=template&id=882bf89a&\"\nimport script from \"./_base-link.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-link.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VIcon } from 'vuetify/lib/components/VIcon';\ninstallComponents(component, {VIcon})\n","import dayjs from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport localizedFormat from 'dayjs/plugin/localizedFormat'\nimport isoWeek from 'dayjs/plugin/isoWeek'\nimport advancedFormat from 'dayjs/plugin/advancedFormat'\nimport isBetween from 'dayjs/plugin/isBetween'\nimport duration from 'dayjs/plugin/duration'\nimport utc from 'dayjs/plugin/utc'\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore'\nimport objectSupport from 'dayjs/plugin/objectSupport'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\nimport isToday from 'dayjs/plugin/isToday'\nimport isYesterday from 'dayjs/plugin/isYesterday'\nimport timezone from 'dayjs/plugin/timezone'\n// TODO: Any new supported i18n locales should have their dayjs equivalent imported here\nimport 'dayjs/locale/en-au'\nimport 'dayjs/locale/en-nz'\nimport 'dayjs/locale/en-ca'\nimport 'dayjs/locale/en-gb'\nimport localeData from 'dayjs/plugin/localeData'\n\ndayjs.extend(customParseFormat)\ndayjs.extend(objectSupport)\ndayjs.extend(isSameOrBefore)\ndayjs.extend(utc)\ndayjs.extend(timezone)\ndayjs.extend(duration)\ndayjs.extend(isBetween)\ndayjs.extend(advancedFormat)\ndayjs.extend(relativeTime)\ndayjs.extend(localizedFormat)\ndayjs.extend(isoWeek)\ndayjs.extend(isToday)\ndayjs.extend(isYesterday)\ndayjs.extend(localeData)\n\nexport default dayjs\n","export { default } from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-0-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-0-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"","/**\n * Truncates any string provided\n * @param {String} text String to be truncated\n * @param {Number} limit String length before truncating. Default: 0\n * @param {String} delimiter Defaults to '...'\n * @returns Truncated string\n */\nexport default (text, limit = 0, delimiter = '...') => {\n if (typeof text !== 'string')\n throw Error('Invalid data type for text (Expected String)')\n\n if (typeof limit !== 'number')\n throw Error('Invalid data type for limit (Expected Number)')\n\n if (typeof delimiter !== 'string')\n throw Error('Invalid data type for delimiter (Expected String)')\n\n if (limit === 0) return text\n\n if (text.length > limit) text = text.substring(0, limit) + delimiter\n\n return text\n}\n","/**\n * The error event is fired on a Window object when a resource failed to load or couldn't be used — for example if a script has an execution error.\n * @tutorial https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n */\nexport default class WindowErrorDTO {\n constructor({ message, source, lineno, colno, error } = {}) {\n /**\n * @type {String} message A string containing a human-readable error message describing the problem. Same as `ErrorEvent.event`\n */\n this.message = message\n\n /**\n * @type {String} source A string containing the URL of the script that generated the error.\n */\n this.source = source\n\n /**\n * @type {Number} lineno An integer containing the line number of the script file on which the error occurred.\n */\n this.lineno = lineno\n\n /**\n * @type {Number} colno An integer containing the column number of the script file on which the error occurred.\n */\n this.colno = colno\n\n /**\n * @type {Error} error The error being thrown. Usually an `Error` object.\n */\n this.error = error\n }\n}\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_error.vue?vue&type=style&index=0&id=4161b4e7&lang=scss&scoped=true&\"","// Locales\nimport en from '@/locales/en.json'\nimport enUS from '@/locales/en-US.json'\nimport enCA from '@/locales/en-CA.json'\nimport enNZ from '@/locales/en-NZ.json'\nimport enGB from '@/locales/en-GB.json'\nimport enAU from '@/locales/en-AU.json'\n\n// https://kazupon.github.io/vue-i18n/api/#constructor-options\nconst vueI18nSettings = {\n // messages: The locale messages of localization.\n messages: {\n en,\n 'en-US': enUS,\n 'en-CA': enCA,\n 'en-NZ': enNZ,\n 'en-GB': enGB,\n 'en-AU': enAU,\n },\n numberFormats: {\n 'en-US': {\n currency: {\n style: 'currency',\n currency: 'USD',\n },\n },\n 'en-AU': {\n currency: {\n style: 'currency',\n currency: 'AUD',\n },\n },\n 'en-NZ': {\n currency: {\n style: 'currency',\n currency: 'NZD',\n },\n },\n 'en-GB': {\n currency: {\n style: 'currency',\n currency: 'GBP',\n },\n },\n 'en-CA': {\n currency: {\n style: 'currency',\n currency: 'CAD',\n },\n },\n },\n dateTimeFormats: {\n en: {\n time: {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n },\n time24: {\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n },\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-AU': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-NZ': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-GB': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-CA': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n 'en-US': {\n dateShort: {\n day: 'numeric',\n month: 'short',\n },\n dateFormatted: {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n },\n },\n },\n // silentTranslationWarn: Whether suppress warnings outputted when localization fails.\n silentTranslationWarn: true,\n // silentFallbackWarn: Whether suppress fallback warnings when localization fails.\n silentFallbackWarn: true,\n}\n\nexport default vueI18nSettings\n","import Vue from 'vue'\nimport VueI18n from 'vue-i18n'\nimport { getLanguageBasedOnBaseURL } from '@/helpers/language-helpers'\nimport vueI18nSettings from '@/locales/setup/index'\n\nVue.use(VueI18n)\n\n// https://kazupon.github.io/vue-i18n/api/#constructor-options\nexport default new VueI18n({\n // locale: The locale of localization. If the locale contains a territory and a dialect, this locale contains an implicit fallback.\n locale: getLanguageBasedOnBaseURL(),\n ...vueI18nSettings,\n})\n","export const PermissionScope = Object.freeze({\n ACCOUNTS: 'accounts',\n BOOKING: 'booking',\n TIMESHEETS: 'timesheets',\n REPLACE_ME: 'replaceMe',\n PENDING_BOOKING: 'pendingBooking',\n})\n","/**\n * List of units available from https://day.js.org/docs/en/display/difference\n */\nexport const DurationUnits = Object.freeze({\n DAY: 'd',\n WEEK: 'w',\n QUARTER: 'Q',\n MONTH: 'M',\n YEAR: 'y',\n HOUR: 'h',\n MINUTE: 'm',\n SECOND: 's',\n MILLISECOND: 'ms',\n})\n","export default class VueErrorDTO {\n constructor({ err, vm, info } = {}) {\n /**\n * @type {Object} complete error trace, contains the `message` and `error stack`\n */\n this.err = err\n\n /**\n * @type {Object} Vue component/instance in which error is occurred\n */\n this.vm = vm\n\n /**\n * @type {Object} info Vue specific error information such as lifecycle hooks, events etc.\n */\n this.info = info\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.offlineConfirmed)?_c('Layout',[_c('h1',{class:_vm.$style.title},[_vm._v(\" The page timed out while loading. Are you sure you're still connected to the Internet? \")])]):_c('LoadingView')}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n
\n The page timed out while loading. Are you sure you're still connected to\n the Internet?\n
\n \n \n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_timeout.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_timeout.vue?vue&type=template&id=c7520ae8&\"\nimport script from \"./_timeout.vue?vue&type=script&lang=js&\"\nexport * from \"./_timeout.vue?vue&type=script&lang=js&\"\nimport style0 from \"./_timeout.vue?vue&type=style&index=0&lang=scss&module=true&\"\n\n\n\n\nfunction injectStyles (context) {\n \n this[\"$style\"] = (style0.locals || style0)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n \n)\n\nexport default component.exports","export default class StoreErrorDTO {\n constructor({ err, module, errorResponse, logIpAddress = false } = {}) {\n /**\n * @type {Error} complete error trace, contains the `message` and `error stack`\n */\n this.err = err\n\n /**\n * @type {String} Name of module the error occurred in\n */\n this.module = module\n\n /**\n * @type {ErrorResponse} Object that determines which error page to display based on error returned from response\n */\n this.errorResponse = errorResponse\n\n /**\n * @type {Boolean} Indicates whether or not to log the user's IP address\n */\n this.logIpAddress = logIpAddress\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',[(_vm.content && _vm.icon && !Array.isArray(_vm.content))?_c('span',{class:['status-badge', _vm.capitalize ? 'text-capitalize' : '']},[_c('v-tooltip',{attrs:{\"disabled\":!_vm.tooltip,\"bottom\":\"\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nvar attrs = ref.attrs;\nreturn [_c('span',_vm._g(_vm._b({},'span',attrs,false),on),[_c('v-icon',{class:_vm.content.color + '--text',attrs:{\"left\":\"\",\"small\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.content.icon)+\" \")]),_vm._v(\" \"+_vm._s(_vm.mobile ? '' : _vm.content.title)+\" \")],1)]}}],null,false,2294613669)},[_c('span',[_vm._v(_vm._s(_vm.tooltip))])])],1):(_vm.content && !Array.isArray(_vm.content))?_c('v-chip',{staticClass:\"status-badge\",attrs:{\"x-small\":\"\",\"outlined\":_vm.outlined,\"label\":_vm.label,\"color\":_vm.content.color,\"dark\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.content.title)+\" \")]):(_vm.content && Array.isArray(_vm.content))?_c('div',[_vm._l((_vm.content),function(badge,index){return [_c('v-chip',{key:index,attrs:{\"x-small\":\"\",\"light\":\"\",\"outlined\":_vm.outlined}},[_vm._v(\" \"+_vm._s(badge.title)+\" \")])]})],2):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const Severity = Object.freeze({\n /**\n * Services are working as expected\n */\n HEALTHY: 'Healthy',\n /**\n * Services may be runing slow but are otherwise functional\n */\n DEGRADED: 'Degraded',\n /**\n * Services may not be functional at all or at a severly reduced rate\n */\n UNHEALTHY: 'Unhealthy',\n /**\n * A notification that could be used to notify of upcoming maintenance or service degredation\n */\n ADVISORY: 'Advisory',\n})\n","import { Severity } from '@/shared/constants/serviceStatus/Severity'\n\n/**\n * getStatusLabelHashMap: Returns a hash map of all the available status labels\n * @returns\n */\nconst getStatusLabelHashMap = function() {\n const map = new Map()\n\n map.set(Severity.HEALTHY, {\n title: Severity.HEALTHY,\n color: 'success',\n icon: 'mdi-check-circle-outline',\n })\n map.set(Severity.DEGRADED, {\n title: Severity.DEGRADED,\n color: 'warning',\n icon: 'mdi-alert-circle-outline',\n })\n map.set(Severity.UNHEALTHY, {\n title: Severity.UNHEALTHY,\n color: 'error',\n icon: 'mdi-alert-circle-outline',\n })\n map.set(Severity.ADVISORY, {\n title: Severity.ADVISORY,\n color: 'info',\n icon: 'mdi-information-outline',\n })\n\n return map\n}\n\nexport { getStatusLabelHashMap }\n","\n\n\n \n \n \n \n \n \n {{ content.icon }}\n \n {{ mobile ? '' : content.title }}\n \n \n {{ tooltip }}\n \n \n\n \n {{ content.title }}\n \n
\n \n \n {{ badge.title }}\n \n \n \n
\n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-status-label.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-status-label.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-status-label.vue?vue&type=template&id=8b90f0e2&\"\nimport script from \"./_base-status-label.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-status-label.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VChip } from 'vuetify/lib/components/VChip';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VTooltip } from 'vuetify/lib/components/VTooltip';\ninstallComponents(component, {VChip,VIcon,VTooltip})\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{class:[_vm.isMobileViewPort ? 'mb-4' : 'mb-8', 'd-flex align-center mt-3']},[_vm._t(\"leftAction\"),_c('header',[(_vm.subtitleOnTop)?_c('h4',{class:[!_vm.isMobileViewPort ? _vm.subtitleClass : 'body-2'],attrs:{\"id\":\"page-subtitle\"}},[_vm._v(\" \"+_vm._s(_vm.subtitle)+\" \")]):_vm._e(),_vm._t(\"title\",[_c('h2',{class:[\n !_vm.isMobileViewPort\n ? 'text-h5 d-inline-block font-weight-medium'\n : 'text-h6 font-weight-medium',\n _vm.subtitleOnTop ? 'mt-0 mb-8' : 'mb-0' ],attrs:{\"id\":\"page-title\"}},[_vm._v(\" \"+_vm._s(_vm.title)+\" \")]),_vm._t(\"appendTitle\")]),_vm._t(\"bottomSubtitle\",[(!_vm.subtitleOnTop)?_c('h4',{class:[!_vm.isMobileViewPort ? _vm.subtitleClass : 'body-2'],attrs:{\"id\":\"page-subtitle\"}},[_vm._v(\" \"+_vm._s(_vm.subtitle)+\" \")]):_vm._e()])],2)],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n \n \n \n
\n {{ subtitle }}\n
\n \n
\n {{ title }}\n
\n \n \n \n
\n {{ subtitle }}\n
\n \n \n \n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-page-title.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./_base-page-title.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./_base-page-title.vue?vue&type=template&id=25fdeeb4&\"\nimport script from \"./_base-page-title.vue?vue&type=script&lang=js&\"\nexport * from \"./_base-page-title.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}