{
  "version": 3,
  "sources": ["../../../packages/shared/bz-stores/lib/auth-store.ts", "../../../packages/shared/tm3-core/api/mobx/current-user/index.ts", "../../../packages/shared/bz-pronto-core/cache/index.tsx", "../../../packages/shared/bz-stores/lib/dashboard-store.ts", "../../../packages/controls/bz-core-controls/styles/report-colours.tsx", "../../../packages/shared/bz-stores/lib/diary-popover-store.tsx", "../../../packages/shared/bz-stores/lib/diary-cache-store.tsx", "../../../packages/shared/tm3-core/interfaces/practitioner/enums/status.tsx", "../../../packages/shared/bz-stores/lib/diary-view-store.tsx", "../../../packages/shared/bz-stores/lib/diary-view-store/enums/resources.ts", "../../../packages/shared/bz-stores/lib/enums/calendar-display.ts", "../../../packages/shared/bz-stores/lib/schedule-store.tsx", "../../../packages/shared/bz-stores/lib/locks.tsx", "../../../packages/shared/tm3-core/api/mobx/locations-response/index.ts", "../../../packages/shared/bz-stores/lib/dynamic-labels.tsx", "../../../packages/shared/tm3-core/licence.ts", "../../../packages/shared/bz-stores/lib/locations.tsx", "../../../packages/shared/bz-stores/lib/lookups.tsx", "../../../packages/shared/bz-stores/lib/reminder-store.tsx", "../../../packages/shared/bz-stores/lib/snackbar-store.ts", "../../../packages/shared/bz-stores/lib/security.tsx", "../../../packages/shared/bz-stores/lib/templates.tsx", "../../../packages/shared/bz-stores/lib/tours.tsx"],
  "sourcesContent": ["import 'tm3-core/api/mobx/current-user';\n\nimport { action, computed, observable, runInAction } from 'mobx';\n\nimport ProntoCache from 'bz-pronto-core/cache';\n\nimport DashboardStore from 'bz-stores/lib/dashboard-store';\n\nimport history from 'bz-utilities/modules/networking/history/rr4';\n\nimport Api from 'tm3-core/api';\nimport {\n  AutoLoginRequest,\n  ChangeLoggedInLocation,\n  CurrentUser,\n  GetCurrentUser,\n  ReferralPortalCurrentUserRequest\n} from 'tm3-core/api.dtos';\nimport LocationResponse from 'tm3-core/api/mobx/locations-response';\nimport { cache } from 'tm3-core/cache';\n\nimport createContext from 'bz-utilities/hooks/context-v2';\nimport JsonServiceClient from './JsonServiceClient';\nimport Config from './config';\nimport DiaryViewStore from './diary-view-store';\nimport DynamicLabels from './dynamic-labels';\nimport Licence from './licence';\nimport Locations from './locations';\nimport Locks from './locks';\nimport Lookups from './lookups';\nimport ReminderStore from './reminder-store';\nimport Security from './security';\nimport Templates from './templates';\nimport Tours from './tours';\nimport ToursMobx from './tours-mobx';\n\nexport enum AuthStoreMode {\n  none = 'none',\n  countdown = 'countdown',\n  reAuth = 're-auth'\n}\nvar lowerRegex = /[a-z]/g;\nexport const [AuthStoreContext, useAuthStore] = createContext<AuthStoreType>('AuthStore');\n\nexport class AuthStoreType {\n  @observable authenticated = false;\n  @observable user: CurrentUser = new CurrentUser({\n    location: new LocationResponse()\n  });\n  @computed get initials() {\n    const name = this.user?.displayName ?? '?';\n    return name.replace(lowerRegex, '');\n  }\n  @observable authTimeout: number = 20;\n  @observable mode: AuthStoreMode = AuthStoreMode.none;\n  @observable stage1Authenticated: boolean = false;\n  @observable usedLicenses: number = 0;\n\n  private client = new JsonServiceClient();\n\n  regex = /^\\/login|^\\/help/;\n\n  ttl?: number;\n\n  public setAuthToken(token: string): void {\n    sessionStorage.setItem('authToken', token);\n  }\n\n  public setTimeoutAmount(mins: number): void {\n    this.authTimeout = mins < 1 ? 20 : mins;\n    this.onReset();\n  }\n\n  @action.bound\n  public onReset(): void {\n    this.mode = AuthStoreMode.none;\n    clearTimeout(this.ttl);\n    let sec = this.authTimeout * 60000 - 30000;\n    this.ttl = window.setTimeout(this.onExpiring, sec);\n  }\n\n  @action.bound\n  private onExpiring(): void {\n    let { pathname } = window.location;\n    if (this.regex.test(pathname)) {\n      return;\n    }\n\n    const tabLastActive = localStorage.getItem('tabLastActive') ?? '';\n\n    if (tabLastActive != '') {\n      const lastActive = new Date(tabLastActive);\n      const seconds = (new Date().getTime() - lastActive.getTime()) / 1000;\n      const timeoutSeconds = this.authTimeout * 60 - 30;\n\n      if (document.visibilityState !== 'visible' && !(seconds > timeoutSeconds)) {\n        this.onReset();\n        return;\n      }\n    }\n\n    this.mode = AuthStoreMode.countdown;\n    return;\n  }\n\n  @action.bound\n  public async checkReferralPortalLoginState() {\n    try {\n      const { result } = await this.client.get(new ReferralPortalCurrentUserRequest());\n      this.onAuthenticate(result);\n    } catch (ex: any) {\n      if (window.location.pathname !== '/wrong-address' && ex.status !== 404) {\n        history.replace('/login');\n      }\n    }\n  }\n\n  @action.bound\n  public async refreshReferralPortalUser() {\n    try {\n      const { result } = await this.client.get(new ReferralPortalCurrentUserRequest());\n      runInAction(() => {\n        this.user = result;\n        if (result.meta) this.setTimeoutAmount(result.meta['autoLogout'].toInt());\n      });\n    } catch (ex: any) {\n      if (window.location.pathname !== '/wrong-address' && ex.status !== 404) {\n        history.replace('/login');\n      }\n    }\n  }\n\n  @action.bound\n  async checkLoginState() {\n    try {\n      const result = await this.client.get(new GetCurrentUser());\n      this.onAuthenticate(result);\n      this.initialiseStores();\n    } catch (ex) {\n      if (window.location.pathname !== '/wrong-address' && ex.status !== 404) {\n        history.replace('/login');\n      }\n    }\n  }\n  @action.bound\n  async changeLocation(id: number) {\n    const res = await this.client.post(new ChangeLoggedInLocation({ id }));\n    this.onAuthenticate(res);\n    this.initialiseStores();\n\n    Security.actions.updateDefaultLocation(res.location.id);\n    DashboardStore.setLocationUserId(res.location, res.practitionerId);\n  }\n\n  @action.bound\n  initialiseStores() {\n    const { user } = this;\n\n    if (cache.app.ReferralPortal) {\n      return;\n    }\n\n    Config.actions.loadAll().then((config) => {\n      this.setMode();\n      this.setTimeoutAmount(parseInt(config[0].AUTOLOGOUTINTERVAL));\n    });\n\n    this.initIntercom();\n    Tours.actions.preload(user.tours);\n    Object.assign(ToursMobx.tours, user.tours);\n    Locks.actions.clearAllForUser();\n    Security.actions.loadAll();\n    DashboardStore.setLocationUserId(user.location, user.practitionerId);\n    Security.actions.updateDefaultLocation(user.location.id);\n    DynamicLabels.actions.loadAll();\n    Lookups.actions.loadAll();\n    Lookups.actions.loadRegionalLookups();\n    Templates.actions.loadAll();\n    Locations.actions.load();\n    ReminderStore.getReminderTime();\n    ProntoCache.onConfigure();\n    DiaryViewStore.onReload(user.id);\n  }\n\n  @action.bound\n  setMode() {\n    const mode = Config.get('config')?.TM3MODE;\n    if (mode && mode.toUpperCase() === 'TRUE') {\n      const configDictionary = {\n        patient: {\n          normal: 'Client',\n          normalPlural: 'Clients',\n          possessive: \"Client's\",\n          possessivePlural: \"Clients'\"\n        },\n        group: {\n          normal: 'Business',\n          normalPlural: 'Businesses',\n          possessive: \"Business'\",\n          possessivePlural: \"Business'\"\n        },\n        vat: {\n          aus: 'GST',\n          can: 'GST',\n          gbr: 'VAT',\n          eur: 'VAT',\n          gcc: 'VAT'\n        }\n      };\n      // build up plurals and possessives as lower case keys\n\n      const result = [];\n      for (let key in configDictionary) {\n        const { normal } = configDictionary[key];\n        if (normal) {\n          if (!configDictionary[key].normalPlural) {\n            configDictionary[key].normalPlural = normal + 's';\n          }\n          if (!configDictionary[key].possessive) {\n            configDictionary[key].possessive = normal + \"'s\";\n          }\n          if (!configDictionary[key].possessivePlural) {\n            result.push(\n              (configDictionary[key].possessivePlural = configDictionary[key].normalPlural + \"'\")\n            );\n          } else {\n            result.push(undefined);\n          }\n        } else {\n          result.push(undefined);\n        }\n      }\n      return result;\n    }\n  }\n\n  @action.bound\n  async logout(storeReset = true) {\n    await Api.post('/api/auth/logout', {}).catch((err) => {});\n    localStorage.diaryAlertsAcknowledgedIds = null;\n    localStorage.lastAlertObjectId = null;\n    localStorage.lastAlertDiscriminator = null;\n    localStorage.setItem('tm3-logout', new Date());\n    sessionStorage.clear();\n\n    DiaryViewStore.onUnload();\n    if (storeReset) {\n      return Promise.all([Security.actions.logout(), Templates.reset()]).then(() => {\n        this.stage1Authenticated = false;\n        this.authenticated = false;\n        this.user = {};\n      });\n    }\n  }\n\n  get intercomAppId() {\n    if (cache.isClick) return 'qqcol12v';\n    if (cache.isGDS) return 'ocod7y8a';\n    return 'f8r88klr';\n  }\n\n  @action.bound\n  async initIntercom(): Promise<void> {\n    try {\n      const { user } = this;\n      const licensePromise = Licence.actions.load();\n      if (localStorage.getItem('hideChat') == 'true') return;\n\n      if (!cache.app.Caseflow) {\n        await licensePromise;\n        const host = window.location.host;\n\n        let intercomSettings;\n\n        if (!!process.env.isClick) {\n          intercomSettings = {\n            app_id: 'qqcol12v',\n            name: user.displayName,\n            ClientID: user.clientId,\n            userName: user.name,\n            email: user.email,\n            subdomain: host.substring(0, host.indexOf('.')),\n            Evaluating: !!Licence.get('licence').isEvaluating,\n            isProntoPortal: !!Licence.get('licence').isProntoPortal,\n            host: host,\n            custom_launcher_selector: '#intercom_messenger',\n            alignment: 'left',\n            hide_default_launcher: true\n          };\n        } else {\n          intercomSettings = {\n            app_id: this.intercomAppId,\n            name: user.displayName,\n            ClientID: user.clientId,\n            userName: user.name,\n            email: user.email,\n            subdomain: host.substring(0, host.indexOf('.')),\n            Evaluating: !!Licence.get('licence').isEvaluating,\n            isProntoPortal: !!Licence.get('licence').isProntoPortal,\n            host: host,\n            horizontal_padding: 60,\n            alignment: 'left',\n            custom_launcher_selector: '#tm3_intercom_messenger',\n            hide_default_launcher: true\n          };\n        }\n        window.Intercom?.('update', intercomSettings);\n      }\n    } catch (e) {\n      console.error('[initIntercom] - something went wrong');\n      console.error(e);\n    }\n  }\n\n  @action.bound\n  async autoLogin(token, redirectParam) {\n    try {\n      const result = await this.client.post(new AutoLoginRequest({ token }));\n      if (!result) {\n        return history.push('/help');\n      } else {\n        this.onAuthenticate(result);\n        this.initialiseStores();\n        if (process.env.isClick && !!redirectParam) {\n          const url = decodeURIComponent(redirectParam);\n          return history.push(url);\n        }\n        return history.push('/');\n      }\n    } catch {\n      return history.push('/help');\n    }\n  }\n\n  @action.bound\n  onAuthenticate(\n    result: CurrentUser,\n    skipRedirects: boolean = false,\n    isLogin: boolean = false\n  ): boolean {\n    this.stage1Authenticated = true;\n    this.user = result;\n    if (result.meta && result.meta['autoLogout'])\n      this.setTimeoutAmount(result.meta['autoLogout'].toInt());\n    if (this.user.practitionerId) {\n      this.user.token = this.user.practitioner.physitrackToken;\n    }\n    if (skipRedirects) return true;\n\n    if (result.twoFactorRequired && !result.twoFactorAuthenticated) {\n      if (result.twoFactorSetup) history.push('/login/mfa/challenge');\n      else history.push('/login/mfa/setup');\n      return false;\n    } else if (result.requiresUserRegistration) {\n      history.push('/login/verify');\n      return false;\n    } else if (result.isAuthenticated) {\n      localStorage.setItem('isFirstLoggedIn', String(true));\n      localStorage.setItem('isAuthenticated', String(true));\n    }\n    this.authenticated = result.isAuthenticated;\n    if (isLogin) localStorage.removeItem(`${result.userId}date`);\n\n    return true;\n  }\n}\n\nconst AuthStore = new AuthStoreType();\nexport default AuthStore;\n", "import { decorate, observable } from 'mobx';\n\nimport { CurrentUser } from 'tm3-core/api.dtos';\n\ndecorate(CurrentUser, {\n  id: observable,\n  name: observable,\n  email: observable,\n  clientId: observable,\n  userType: observable,\n  isAuthenticated: observable,\n  isEvaluating: observable,\n  settings: observable,\n  practitioner: observable,\n  location: observable,\n  roleId: observable,\n  practitionerId: observable,\n  tM2UserName: observable,\n  roleName: observable,\n  userPermissionId: observable,\n  tours: observable,\n  departments: observable,\n  customer: observable,\n  userGlobalGuid: observable,\n  hasTrialExpired: observable,\n  needsVerified: observable,\n  bearerToken: observable,\n  displayName: observable,\n  meta: observable,\n  permissions: observable,\n  profileUrl: observable,\n  referrerUrl: observable,\n  refreshToken: observable,\n  responseStatus: observable,\n  roles: observable,\n  sessionId: observable,\n  userId: observable,\n  userName: observable,\n  signatureRxIntegrationCode: observable\n});\n\nexport default CurrentUser;\n", "import { action, computed, observable, runInAction } from 'mobx';\n\nimport { bind as bound } from 'bind-decorator';\nimport { computedFn } from 'mobx-utils';\nimport Api from 'tm3-core/api';\nimport { cache } from 'tm3-core/cache';\nimport featureFlag from 'tm3-core/stores/feature-store';\n\nexport class ProntoCache {\n  @observable prontoNetworkServices = {};\n  @observable prontoInvoiceTemplates = {};\n\n  @action.bound\n  onConfigure() {\n    return new Promise((resolve, reject) => {\n      if (cache.isEClinic) return resolve(true);\n      Api.post('/api/pronto/cache/load').then((res) => {\n        const { result } = res.body;\n\n        let networkServices = new ProntoNetworkServices();\n        let invoiceTemplates = new ProntoInvoiceTemplates();\n\n        networkServices.onLoad(result.services);\n        invoiceTemplates.onLoad(result.invoices);\n\n        runInAction(() => {\n          this.prontoNetworkServices = networkServices;\n          this.prontoInvoiceTemplates = invoiceTemplates;\n        });\n\n        let req = {\n          prontoNetworkServices: networkServices,\n          prontoInvoiceTemplates: invoiceTemplates\n        };\n\n        resolve(req);\n      });\n    });\n  }\n}\n\nclass CacheObject {\n  @observable loading = true;\n  all = observable.map();\n\n  @action.bound\n  onLoad(res) {\n    this.all.replace(res || {});\n    this.loading = false;\n  }\n\n  getById = computedFn(this._getById);\n\n  @bound\n  _getById(id) {\n    return this.all.get(id);\n  }\n}\n\nclass ProntoNetworkServices extends CacheObject {\n  public orderBy: string = 'discipline';\n  getServiceName = computedFn(this._getServiceName);\n  getAll = computedFn(this._getAll);\n\n  @bound\n  _getServiceName(networkServiceId) {\n    const service = this.getById(networkServiceId);\n\n    const prontoServiceName =\n      !!service && service.serviceName ? service.serviceName : 'Unknown Service';\n\n    return prontoServiceName;\n  }\n\n  @bound\n  _getAll() {\n    let services: any[] = [];\n\n    const res = Array.from(this.all._data.values()) || [];\n    res.forEach((service) => {\n      services.push(service.value);\n    });\n\n    const { orderBy } = this;\n    try {\n      if (orderBy.length > 0) {\n        services.sort((a, b) => {\n          if (!a[orderBy] || !b[orderBy]) {\n            return 0;\n          }\n          return a[orderBy].localeCompare(b[orderBy]);\n        });\n      }\n    } catch {\n      // no ordering is going to happen\n      console.error('A problem arose when attempting to order these items');\n    }\n    return services;\n  }\n}\nclass ProntoInvoiceTemplates extends CacheObject {}\n\nexport default new ProntoCache();\n", "import { action, observable, runInAction } from 'mobx';\nimport type {\n  GeneralCustomerResponse,\n  GraphData,\n  PieChartData,\n  ResponseBase,\n  TopClients\n} from 'tm3-core/api.dtos';\nimport {\n  AlertSearchRequest,\n  CustomerRequest,\n  DashboardListRequest,\n  DashboardResponse\n} from 'tm3-core/api.dtos';\n\nimport { Colours } from 'bz-core-controls/styles/report-colours';\nimport JsonServiceClient from 'bz-stores/lib/JsonServiceClient';\nimport popovers from 'bz-stores/lib/diary-popover-store';\nimport CacheStore from 'bz-utilities/modules/stores/cached-map-store';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport Api from 'tm3-core/api';\nimport LocationsStore from 'tm3-core/cache/stores/locations-store';\nimport EConfigKeys from 'tm3-core/enums/config-enum';\n\nconst colours = Object.values(Colours);\n\nclass DashboardStore {\n  client = new JsonServiceClient('/api');\n  locations = new LocationsStore();\n\n  constructor() {}\n\n  @observable dnas: GraphData[] = [];\n  @observable dnaTotal: object = {};\n  @observable cancellations: GraphData[] = [];\n  @observable allAppointments: GraphData[] = [];\n  @observable appointmentShare: PieChartData[] = [];\n  @observable debt: object = {\n    aged: []\n  };\n  @observable newPatientByType = [{}];\n  @observable turnover = [{}];\n  @observable topClients: TopClients[] = [];\n  @observable appointmentStats: object = {\n    total: 0,\n    cancellations: {},\n    dnas: {}\n  };\n\n  @observable points: boolean = true;\n  @observable dashboard = {};\n  @observable appointments: any[] = [];\n  @observable selectedAppointment = {};\n  @observable doNextOpen = false;\n  @observable newPatients = [];\n  @observable loadingMoreBottom = false;\n  @observable futureDays = 3;\n  @observable loadLimiter = 0;\n  @observable currentDate = moment(new Date()).startOf('day').toDate();\n\n  @observable showDoNextScreen: boolean;\n  @observable user = {};\n  @observable appointmentDoNext = {};\n  @observable patientDoNext? = {};\n  @observable loadingMoreTop: boolean;\n  @observable active: boolean;\n  @observable statusToggleActive: boolean;\n\n  @action.bound\n  async load() {\n    this.showDoNextScreen = !!EConfigKeys.DONEXTENABLED;\n\n    const { result: result } = await this.client.get('/dashboard');\n\n    result.dnas[0].colour = 'rgba(255,255,255, 0.3)';\n    result.dnas[0].borderColour = 'white';\n    result.turnover[0].colour = 'rgba(255,255,255, 0.3)';\n    result.turnover[0].borderColour = 'white';\n    result.newPatients[0].colour = 'rgba(255,255,255, 0.3)';\n    result.newPatients[0].borderColour = 'white';\n    result.cancellations[0].colour = 'rgba(255,255,255, 0.3)';\n    result.cancellations[0].borderColour = 'white';\n    result.allAppointments[0].colour = 'rgba(255,255,255, 0.3)';\n    result.allAppointments[0].borderColour = 'white';\n\n    let j = 0;\n    let { segments } = result.appointmentShare;\n    let withColour = segments.map((s) => {\n      s.colour = colours[j];\n      j = j < segments.length ? j : 0;\n      j++;\n      return s;\n    });\n    let newPatientByType = result.newPatientByType.segments;\n    j = 0;\n    newPatientByType.map((s) => {\n      s.colour = colours[j];\n      j = j < newPatientByType.length ? j : 0;\n      j++;\n      return s;\n    });\n    runInAction(() => {\n      this.newPatientByType = newPatientByType;\n\n      const {\n        dnas,\n        dnaTotal,\n        cancellations,\n        allAppointments,\n        appointmentShare,\n        debt,\n        turnover,\n        topClients,\n        appointmentStats,\n        newPatients\n      } = result;\n\n      this.dnas = dnas;\n      this.dnaTotal = dnaTotal;\n      this.cancellations = cancellations;\n      this.allAppointments = allAppointments;\n      this.appointmentShare = appointmentShare;\n      this.debt = debt;\n      this.turnover = turnover;\n      this.topClients = topClients;\n      this.appointmentStats = appointmentStats;\n\n      this.newPatients.replace(newPatients);\n    });\n  }\n\n  setLocationUserId(location, practitionerId) {\n    return (this.user = {\n      user: { location, practitionerId }\n    });\n  }\n\n  @action.bound\n  doNextPrompt(apptId) {\n    if (this.showDoNextScreen) {\n      const appointment = (this.appointments || []).filter((x) => x.id === parseInt(apptId));\n      if (appointment[0] != null) {\n        this.appointmentDoNext = appointment[0];\n        return this.setPatientForDoNext(appointment[0].customerId).then(() => {\n          return (this.doNextOpen = true);\n        });\n      }\n    }\n  }\n\n  setPatientForDoNext(patientId) {\n    return this.client\n      .get(new CustomerRequest(), patientId)\n      .then((res: ResponseBase<GeneralCustomerResponse>) => {\n        const patient = res.result != null ? res.result : undefined;\n        return (this.patientDoNext = patient);\n      });\n  }\n\n  closePopover() {\n    return (this.doNextOpen = false);\n  }\n\n  @action.bound\n  async loadAppointments(initialLoad = false) {\n    if (\n      this.loadingMoreBottom ||\n      !this.user ||\n      ((initialLoad === true && this.appointments) ?? [].length === 0) ||\n      initialLoad === false\n    ) {\n      const currentDate = moment(this.currentDate);\n      const startDate = currentDate.toDate();\n      const endDate = currentDate.clone().add(this.futureDays, 'days').toDate();\n\n      this.loadingMoreBottom = true;\n      const req = new DashboardListRequest({\n        startDate: startDate.toISOString(),\n        endDate: endDate.toISOString()\n      });\n      const res: any[] = await this.client.post(req);\n\n      runInAction(() => {\n        let appointments: any[] = this.appointments || [];\n\n        const idsNotToInclude = res.map((y) => y.id);\n        appointments = appointments.filter((x) => !idsNotToInclude.includes(x.id));\n        appointments = _.union(appointments, res);\n        this.currentDate =\n          res.length > 0\n            ? moment(res[res.length - 1].endDateTime)\n                .add(1, 's')\n                .toDate()\n            : endDate;\n        this.appointments = appointments;\n        this.loadingMoreBottom = false;\n        this.loadingMoreTop = false;\n      });\n    }\n  }\n\n  selectAppointment(appt) {\n    appt.location = this.locations.All.filter({ id: appt.locationId }).value()[0];\n    return new Promise((resolve, reject) => {\n      if (appt.customerId > 0 && !appt.patient) {\n        this.client.get('/customers', appt.customerId).then((res) => {\n          appt.patient = res;\n          this.selectedAppointment = appt;\n          popovers.selected = appt;\n          resolve(appt);\n        });\n      } else {\n        this.selectedAppointment = appt;\n        popovers.selected = appt;\n        resolve(appt);\n      }\n    });\n  }\n\n  @action.bound\n  async refreshAlerts(id) {\n    if (!id) {\n      return;\n    }\n\n    const appointments = this.appointments;\n    const discriminatorType = 'A';\n    let existing = _.find(appointments, { id: parseInt(id) });\n    if (!existing) {\n      existing = _.find(appointments, { customerId: parseInt(id) });\n    }\n    if (!existing) {\n      return;\n    }\n\n    const req = new AlertSearchRequest({\n      objectId: existing.id,\n      discriminatorType: 'A'\n    });\n\n    let res = await this.client.post(req);\n    existing.alerts = (res != null ? res : undefined) || [];\n    let idx = _.findIndex(appointments, (x) => x.id === existing.id);\n    appointments.splice(idx, 1, existing);\n    runInAction(() => {\n      this.appointments = appointments;\n    });\n  }\n\n  refreshAppointmentAuth(id, authLeft) {\n    let appointments = this.appointments;\n    const existing = _.find(appointments, { id });\n    if (existing) {\n      existing.authLeft = authLeft;\n      this.refreshAppointment(id, existing);\n    }\n  }\n\n  @action.bound\n  async refreshAppointment(id, appt = null) {\n    id = parseInt(id);\n    if (!!appt) {\n      id = appt.id;\n    }\n    let appointments = this.appointments;\n    const existing = _.find(appointments, { id });\n\n    if (appt) {\n      if (existing) {\n        appt.startDateTime = moment(appt.startDateTime).format('YYYY-MM-DDTHH:mm');\n        appointments = (this.appointments || []).filter((x) => x.id !== appt.id);\n        appointments = appointments.concat(appt);\n        this.appointments = _.sortBy(appointments, 'startDateTime');\n        return;\n      } else {\n        appointments.push(appt);\n        this.appointments = _.sortBy(appointments, 'startDateTime');\n        return;\n      }\n    }\n\n    if (!existing) {\n      return;\n    }\n\n    const req = new DashboardListRequest({\n      startDate: moment(existing.startDateTime).startOf('day').toDate().toISOString(),\n      endDate: moment(existing.endDateTime).startOf('day').toDate().toISOString()\n    });\n    let res = await this.client.post(req);\n    appointments = _.reject(this.appointments || [], (x) => _.includes(_.map(res, 'id'), x.id));\n    appointments = _.union(appointments, res);\n    runInAction(() => {\n      this.appointments = _.sortBy(appointments, 'startDateTime');\n    });\n  }\n\n  @action.bound\n  deleteAppointmentOrEvent(apptId): void {\n    let id = parseInt(apptId);\n\n    const existing = _.find(this.appointments, { id });\n\n    if (existing) {\n      const latestAppointments = (this.appointments || []).filter((x) => x.id !== id);\n      this.appointments = _.sortBy(latestAppointments, 'startDateTime');\n    }\n  }\n\n  @action.bound\n  deleteRecurringAppointmentsOrEvents(apptDeleteResp: any): void {\n    if (!apptDeleteResp) {\n      return;\n    }\n    let apptIds: number[] = [];\n\n    for (const key in apptDeleteResp) {\n      var sessions = apptDeleteResp[key];\n      apptIds.push(...sessions.map((appt) => appt.id));\n    }\n\n    const latestAppointments = (this.appointments || []).filter((x) => !apptIds.includes(x.id));\n    this.appointments = _.sortBy(latestAppointments, 'startDateTime');\n  }\n\n  @action.bound\n  storeCurrentTab(currentTab, statusToggleActive) {\n    if (currentTab != null) {\n      this.active = currentTab;\n    }\n    if (statusToggleActive != null) {\n      return this.statusToggleActive;\n    }\n  }\n}\n\nexport default new DashboardStore();\n", "// FROM http://mcg.mbitson.com/#!?lightBlue=%2347b3e6&blue=%234483c4&blueGrey=%23677789&grey=%23323f4d&turq=%23356e7b&green=%2325ab6a&red=%23f22613&purple=%238f5fa0&yellow=%23f4ab34&orange=%23e65100&themename=tm3\nconst colours = {\n  lightBlue500: '#47b3e6',\n  green500: '#25ab6a',\n  red500: '#ef5350',\n  purple500: '#8f5fa0',\n  yellow500: '#f4ab34',\n  blue500: '#4483c4',\n  blueGrey500: '#677789',\n  lightGreen500: '#cddc39',\n  grey500: '#323f4d',\n  orange500: '#e65100',\n  turq500: '#356e7b',\n\n  lightBlue900: '#208bd5',\n  green900: '#0d803c',\n  red900: '#e42927',\n  purple900: '#603273',\n  yellow900: '#ec8015',\n  blue900: '#1f53a2',\n  blueGrey900: '#394759',\n  lightGreen900: '#aec517',\n  grey900: '#131b25',\n  orange900: '#d52700',\n  turq900: '#163f4b',\n\n  lightBlue300: '#7ecaee',\n  green300: '#66c497',\n  red300: '#f48785',\n  purple300: '#b18fbd',\n  yellow300: '#f7c471',\n  blue300: '#7ca8d6',\n  blueGrey300: '#95a0ac',\n  lightGreen300: '#dce774',\n  grey300: '#707982',\n  orange300: '#ee854d',\n  turq300: '#729aa3'\n};\n\nexport default colours;\nexport { colours };\nexport { colours as Colours };\nexport { colours as Colors }; //material-ui replacement\n", "import { action, observable, runInAction } from 'mobx';\n\nimport cache from 'bz-stores/lib/diary-cache-store';\nimport view from 'bz-stores/lib/diary-view-store';\nimport Locks from 'bz-stores/lib/locks';\nimport BaseStore from 'bz-stores/mobx/base-store';\nimport {\n  type AppointmentResponse,\n  DiaryListRequest,\n  DiaryListResponse,\n  type GeneralCustomerResponse\n} from 'tm3-core/api.dtos';\n\nexport enum EActivePopover {\n  cancellation = 'cancellation',\n  doNext = 'doNext',\n  none = 'none',\n  quickbill = 'quickbill',\n  event = 'event'\n}\n\nexport interface ICancellationOptions {\n  id: number;\n  mandatory: boolean;\n  deleteCase: boolean;\n}\n\nexport interface IQuickbillOptions {\n  id: number;\n  status: number;\n  deleteCase: boolean;\n  mandatory: boolean;\n}\n\nclass DiaryPopoverStore {\n  @observable activePopover: EActivePopover = EActivePopover.none;\n  @observable anchorEl: HTMLElement | null = null;\n  @observable selected = null;\n  @observable appointmentDoNext = null;\n  @observable patientDoNext = null;\n  @observable quickbillOptions: Partial<IQuickbillOptions> = {};\n  @observable cancellationOptions: Partial<ICancellationOptions> = {};\n  @observable callback?: (() => void) | null = null;\n  @action\n  showPopoverForCustomer(appt: AppointmentResponse, customer: GeneralCustomerResponse) {\n    const {\n      reference,\n      mobileTelephone,\n      email,\n      smsEnabled,\n      title,\n      forename,\n      surname,\n      gender,\n      insuranceNumber,\n      groupReference,\n      status,\n      registrationDate\n    } = customer;\n    const mapped = {\n      customerReference: reference,\n      customerMobileTelephone: mobileTelephone,\n      customerEmail: email,\n      customerSMSEnabled: smsEnabled,\n      customerTitle: title,\n      customerForename: forename,\n      customerSurname: surname,\n      customerGender: gender,\n      insuranceNumber: insuranceNumber,\n      groupReference: groupReference,\n      customerStatus: status,\n      customerRegistrationDate: registrationDate\n    };\n    return this.showPopover(EActivePopover.event, new DiaryListResponse({ ...mapped, ...appt }));\n  }\n\n  @action\n  showPopover(\n    activePopover: EActivePopover,\n    appt: any,\n    selection?: HTMLElement,\n    callback?: () => void\n  ) {\n    let { allRooms, allLocations, allPractitioners } = cache;\n    appt.room = allRooms.find((x) => x.id === appt.roomId);\n    appt.location = allLocations.find((x) => x.id === appt.locationId);\n    appt.practitioner = allPractitioners.find((x) => x.id === appt.practitionerId);\n    appt.apptStockColour = appt.hexColour;\n\n    if (selection) this.anchorEl = selection;\n    this.activePopover = activePopover;\n    this.selected = appt;\n    this.callback = callback;\n  }\n\n  @action.bound\n  hidePopover() {\n    let _active = this.activePopover;\n    let promise = !!this.selected\n      ? Locks.actions.releaseLock('A', this.selected.id)\n      : Promise.resolve();\n\n    promise.finally(() => {\n      this.selected = null;\n      if (_active !== this.activePopover) {\n        return;\n      }\n\n      this.callback?.();\n\n      runInAction(() => {\n        this.activePopover = EActivePopover.none;\n        this.anchorEl = null;\n        this.selected = null;\n        this.callback = null;\n      });\n    });\n  }\n\n  @action\n  doNextPrompt(appointment, patient) {\n    if (!view.showDoNextScreen) return;\n    // appointment = (@get('appointments') || []).filter((x) -> x.id is parseInt(apptId))\n    // return unless appointment[0]?\n    this.appointmentDoNext = appointment;\n    this.patientDoNext = patient;\n    this.activePopover = EActivePopover.doNext;\n  }\n\n  @action\n  quickbill(id: number, status: number, deleteCase: boolean, mandatory?: boolean) {\n    this.activePopover = EActivePopover.quickbill;\n    this.quickbillOptions = { id, status, deleteCase, mandatory };\n  }\n\n  @action\n  cancellation(id: number, mandatory: boolean, deleteCase: boolean) {\n    this.activePopover = EActivePopover.cancellation;\n    this.cancellationOptions = { id, mandatory, deleteCase };\n  }\n}\n\nexport default new DiaryPopoverStore();\n", "// This is a hack store to allow us to slowly\n// remove functionality from the exim store\n// This will need to be an instance in time loaded by the user id\nimport { computed, observable } from 'mobx';\nimport z from 'z';\n\nimport { RoomResponse } from 'tm3-core/api.dtos';\nimport type {\n  GeneralPractitionerResponse,\n  LocationResponse,\n  PractitionerLocation\n} from 'tm3-core/api.dtos';\nimport { cache } from 'tm3-core/cache';\nimport EPractitionerStatus from 'tm3-core/interfaces/practitioner/enums/status';\n\nclass DiaryCacheStore {\n  @computed\n  get noRoom(): RoomResponse {\n    return new RoomResponse({ description: z.format('No {Room} Assigned'), id: -2 });\n  }\n\n  @computed\n  get loaded(): boolean {\n    return cache.locations.loaded && cache.practitioners.loaded && cache.rooms.loaded;\n  }\n\n  @computed\n  get allLocations(): LocationResponse[] {\n    return cache.locations.All;\n  }\n\n  @computed\n  get currentLocations(): LocationResponse[] {\n    return cache.locations.CurrentLocations;\n  }\n\n  @computed\n  get allRooms(): RoomResponse[] {\n    return [this.noRoom, ...cache.rooms.Current];\n  }\n\n  @computed\n  get allPractitioners(): GeneralPractitionerResponse[] {\n    return cache.practitioners.All;\n  }\n\n  @computed\n  get activePractitioners(): GeneralPractitionerResponse[] {\n    return cache.practitioners.All.filter((x) => {\n      return x.status !== EPractitionerStatus.inactive;\n    });\n  }\n\n  @computed\n  get allPractitionerLocations(): PractitionerLocation[] {\n    return cache.practitionerLocations.All;\n  }\n\n  onLoad(): void {\n    // do nothing\n  }\n}\n\nconst GlobalDiaryCacheStore = new DiaryCacheStore();\n\nexport default GlobalDiaryCacheStore;\n", "enum EPractitionerStatus {\n  allActive = -2,\n  inactive = 0,\n  active = 1,\n  payAsYouGo = 2\n}\n\nexport default EPractitionerStatus;\n", "import BaseStore from 'bz-stores/mobx/base-store';\nimport type { IEvent } from 'bz-utilities/modules/plugins/register/stores/mediator';\nimport { action, autorun, computed, observable, observe, runInAction } from 'mobx';\nimport type { IReactionDisposer, Lambda } from 'mobx';\nimport Moment from 'moment';\nimport Api from 'tm3-core/api';\nimport { AppointmentGetRequest, DiaryRequest, MonthlyScheduleRequest } from 'tm3-core/api.dtos';\nimport type {\n  AppointmentDetailsResponse,\n  DiaryDefaultDataForUserResponse,\n  GeneralPractitionerResponse,\n  ResourceMode\n} from 'tm3-core/api.dtos';\nimport { MonthlyScheduleResponse } from 'tm3-core/api.dtos';\nimport { cache } from 'tm3-core/cache';\nimport { ConfigObservable } from './config';\nimport DiaryCacheStore from './diary-cache-store';\nimport Resources from './diary-view-store/enums/resources';\nimport CalendarDisplay from './enums/calendar-display';\nimport ScheduleStore from './schedule-store';\n\nexport enum ETimeFormat {\n  h12 = '12h',\n  h24 = '24h'\n}\n\nexport enum EMode {\n  appointment = 'appointment',\n  event = 'event',\n  session = 'session'\n}\n\nexport class DiaryViewStoreType {\n  [key: string]: any;\n  @observable lsPrefix = '';\n  @observable mode: EMode = EMode.appointment;\n  @observable isWeek = false;\n  @observable calendarDisplay: CalendarDisplay = CalendarDisplay.Day;\n  @observable monthOverview: MonthlyScheduleResponse = new MonthlyScheduleResponse();\n  @observable hideDayWeekSelector = false;\n  @observable timeFormat: ETimeFormat = ETimeFormat.h24;\n  @observable privacy = false;\n  @observable interval = 15;\n  @observable resourceMode: Resources = Resources.practitioner;\n  @observable cancellations = false;\n  @observable location = -1;\n  @observable rooms = observable.array<number>([-2]);\n  @observable readonly practitioners = observable.array<number>([]);\n  @observable date: string = new Date().toJSON();\n  @observable currentTime = new Date();\n  @observable processing = true;\n  @observable withoutSessions = true;\n  @observable weekends = false;\n  @observable compressed = true;\n  @observable showCalendarSidebar = false;\n  @observable pinCalendar = false;\n  @observable locationPractitioners = {};\n  @observable statsKeys = [];\n  @observable loaded: boolean = false;\n\n  //hack for appt selection\n  @observable target = '';\n\n  //hacked back prop to stop double fetch\n  //investigate computed setters to solve this\n  @observable _location: number | undefined = -1;\n\n  @observable readonly _practitioners = observable.array<GeneralPractitionerResponse>([]);\n\n  onClearSelection?: () => void;\n\n  private _disposers: (IReactionDisposer | Lambda)[] = [];\n  private configDisposer?: Lambda;\n  private lastFetchDate?: Moment.Moment;\n\n  constructor() {\n    //sync update with the minute\n    let delay = (60 - new Date().getSeconds()) * 1000;\n    setTimeout(() => {\n      this.currentTime = new Date();\n      setInterval(() => {\n        this.currentTime = new Date();\n      }, 60000);\n    }, delay);\n  }\n\n  @action.bound\n  async onLoad(userId?: number): Promise<void> {\n    if (userId !== undefined && userId > 0) {\n      this.lsPrefix = userId.toString();\n    }\n\n    const res = await BaseStore.defaultClient.post(new DiaryRequest({}));\n\n    runInAction(() => {\n      this._onLoad(res);\n      this.loaded = true;\n    });\n  }\n\n  async onReload(userId?: number): Promise<void> {\n    //temp hack until ui refactor\n    this._disposers.forEach((fn) => {\n      fn();\n    });\n    await this.onLoad(userId);\n  }\n\n  @action.bound\n  hideDayWeekSelection(): void {\n    if (!this.allowAllPractitionerWeekView) {\n      if (this.practitioners.length > 1) {\n        this.isWeek = false;\n        this.hideDayWeekSelector = true;\n      }\n      if (this.practitioners.length === 1) {\n        this.hideDayWeekSelector = false;\n      }\n    }\n  }\n\n  @action.bound\n  verifyResources(locationId?: number) {\n    let { allRooms, allPractitionerLocations } = DiaryCacheStore;\n    const loc = locationId || this._location;\n\n    let availRooms = allRooms.filter((x) => x.locationId === loc).map((x) => x.id);\n\n    this.rooms.replace(this.getStorage(`roomLocations-${this.location}`, this.rooms));\n\n    let availPract = allPractitionerLocations\n      .filter((x) => x.locationId === loc)\n      .map((x) => x.practitionerId);\n    availPract = this.intersect(\n      this._practitioners.map((x) => x.id),\n      this.intersect(this.activePractitioners, availPract)\n    );\n\n    const practitionerLocationsResult = this.getStorage(\n      `practitionerLocations-${this.location}`,\n      this.practitioners.slice()\n    );\n    const plr = Array.isArray(practitionerLocationsResult)\n      ? practitionerLocationsResult\n      : [practitionerLocationsResult];\n    let _pract = availPract.length > 0 ? this.intersect(availPract, plr) : plr;\n    let _rooms = this.intersect(availRooms, this.rooms);\n    if (_rooms.length === 0) {\n      _rooms = [-2];\n    }\n    if (_pract.length === 0 && availPract.length > 0) {\n      _pract = [availPract[0]];\n    }\n\n    this.rooms.replace(_rooms);\n    this.practitioners.replace(_pract);\n\n    if (loc != this._location) {\n      this._location = locationId;\n    }\n  }\n\n  @action\n  _onLoad(diary: DiaryDefaultDataForUserResponse) {\n    const { isClick } = process.env;\n    const isPhone = !!window.mobileDetection.mobile();\n\n    const defaultLocation = !!diary.currentLocation\n      ? diary.currentLocation.id\n      : this._location || 1;\n\n    this._location = this.getStorage('location', defaultLocation);\n\n    this._practitioners.replace(diary.practitioners);\n\n    this._disposers.forEach((fn) => {\n      fn();\n    });\n    const defaultToWeek = isClick && !isPhone;\n    this._disposers = [\n      this.applyStorage('isWeek', defaultToWeek),\n      this.applyStorage(\n        'calendarDisplay',\n        defaultToWeek ? CalendarDisplay.Week : CalendarDisplay.Day\n      ),\n      this.applyStorage('weekends', isClick),\n      this.applyStorage('timeFormat', isClick ? '12h' : '24h'),\n      this.applyStorage('date', new Date()),\n      this.applyStorage('rooms', [diary.currentRoom.id]),\n      this.applyStorage('privacy', false),\n      this.applyStorage('interval', 15),\n      this.applyStorage('location', defaultLocation),\n      this.applyStorage('resourceMode', 'practitioner'),\n      this.applyStorage(\n        'practitioners',\n        diary.currentPractitioner ? [diary.currentPractitioner.id] : []\n      ),\n      this.applyStorage('cancellations', true),\n      this.applyStorage('withoutSessions', true),\n      autorun(this.onFetch.bind(this, false)),\n      (this.configDisposer = observe(ConfigObservable.configMap, (change) => {\n        if (change.name === 'ALLOWALLPRACTWEEKVIEW') {\n          this.hideDayWeekSelection();\n        }\n      }))\n    ];\n\n    const doVerify = () => {\n      runInAction(() => {\n        this.verifyResources();\n      });\n      this._disposers.push(\n        observe(this, 'location', (change) => {\n          runInAction(() => {\n            this.verifyResources(change.newValue);\n          });\n        })\n      );\n    };\n\n    if (cache.practitionerLocations.loaded) doVerify();\n    else\n      this._disposers.push(\n        observe(cache.practitionerLocations, 'loaded', () => {\n          doVerify();\n        })\n      );\n  }\n\n  intersect<T>(available: T[], current: T[]): T[] {\n    const all = new Set(available);\n    const sub = new Set(current);\n    return [...all].filter((x) => sub.has(x));\n  }\n\n  applyStorage(key: string, fallback: any) {\n    this[key] = this.getStorage(key, fallback);\n\n    return autorun(() => {\n      let val: any = this[key];\n      let result = !!val?.toJS ? val.toJS() : val;\n      if (!!sessionStorage.getItem('diary-restore')) {\n        return;\n      }\n      localStorage[this.lsPrefix + key] = JSON.stringify(result);\n    });\n  }\n\n  getStorage(key: string, fallback: any) {\n    var result = localStorage[this.lsPrefix + key];\n    if (typeof result !== 'string' || result === '') {\n      return fallback;\n    }\n\n    try {\n      result = JSON.parse(result);\n    } catch (err) {\n      /*supress catch & fallback to string*/\n    }\n\n    return result;\n  }\n\n  @computed\n  get getConfig(): Record<string, string> {\n    const { config } = ConfigObservable;\n    const diaryPrintState = localStorage.getItem('diaryPrintState');\n\n    if (diaryPrintState !== null) {\n      const lsConfig: Record<string, string> | null = JSON.parse(diaryPrintState);\n      return lsConfig != null ? lsConfig : config;\n    }\n\n    return config;\n  }\n\n  @computed\n  get activePractitioners(): number[] {\n    return DiaryCacheStore.allPractitioners.filter((x) => x.status !== 0).map((x) => x.id);\n  }\n\n  @computed\n  get workingWeekDays(): number {\n    return parseInt(this.getConfig['WORKINGWEEKDAYS']);\n  }\n\n  @computed\n  get allowAllPractitionerWeekView(): boolean {\n    return (this.getConfig['ALLOWALLPRACTWEEKVIEW'] || '').toLowerCase() === 'y';\n  }\n\n  @computed\n  get firstDayOfWeek(): number {\n    return parseInt(this.getConfig['FIRSTDAYOFWEEK']);\n  }\n\n  @computed\n  get todayLine(): boolean {\n    return (this.getConfig['SHOWDIARYTODAYLINE'] || '').toLowerCase() === 'true';\n  }\n\n  @computed\n  get showDoNextScreen(): boolean {\n    return (this.getConfig['DONEXTENABLED'] || '').toLowerCase() === 'true';\n  }\n\n  @computed\n  get multiDay(): boolean {\n    return Math.log2(this.workingWeekDays) % 1 > 0;\n  }\n\n  @action.bound\n  setDiarySessionMode(practitionerId: number, locationId: number, userId: number) {\n    if (!this.loaded) {\n      this.onLoad(userId);\n    }\n    let _cache = Object.assign({}, this);\n    _cache._practitionerId = practitionerId;\n    sessionStorage.setItem('diary-restore', JSON.stringify(_cache));\n\n    this.practitioners.replace([practitionerId]);\n    this._location = locationId;\n    this.location = locationId;\n    this.mode = EMode.session;\n    this.interval = 60;\n    this.withoutSessions = true;\n    this.isWeek = true;\n\n    this.onFetch();\n  }\n\n  @action.bound\n  restoreDiaryMode(): void {\n    let json = sessionStorage.getItem('diary-restore');\n    if (this.mode !== EMode.session) {\n      return;\n    }\n    let restore = JSON.parse(json || '{}');\n    restore.mode = 'appointment';\n\n    sessionStorage.removeItem('diary-restore');\n\n    Object.keys(restore).map((key) => {\n      if (key.indexOf('_') === 0) {\n        return;\n      }\n      this[key] = restore[key];\n    });\n  }\n\n  onFetch(isAutoRefresh = false): void {\n    let { date, isWeek, resourceMode, weekends, _location, withoutSessions } = this;\n    if (![Resources.room, Resources.practitioner, Resources.list].includes(resourceMode)) return;\n\n    //allows fetch when config changes\n    let firstDay = this.firstDayOfWeek;\n    let workingDays = this.workingWeekDays;\n    if (!firstDay || !workingDays) return;\n    //-------------------------------\n    this.processing = true;\n    this.lastFetchDate = Moment();\n\n    let resourceIds = resourceMode === 'room' ? this.rooms : this.practitioners;\n    if (process.env.isClick) {\n      if (resourceIds.length === 0) {\n        resourceIds =\n          this.activePractitioners.length > 0\n            ? observable.array(this.activePractitioners)\n            : observable.array([1]);\n      }\n    }\n\n    if (this.calendarDisplay === CalendarDisplay.Month) {\n      BaseStore.defaultClient\n        .post(\n          new MonthlyScheduleRequest({\n            date: date,\n            mode: resourceMode as unknown as ResourceMode,\n            location: _location,\n            resourceIds: resourceIds,\n            autoRefresh: isAutoRefresh,\n            showCancellations: this.cancellations\n          })\n        )\n        .then(\n          action((res) => {\n            this.monthOverview = res.result;\n            this.processing = false;\n          })\n        );\n      return;\n    }\n\n    const request = {\n      date: date,\n      isWeek: isWeek,\n      mode: resourceMode,\n      location: _location,\n      showWeekends: weekends,\n      resourceIds: resourceIds,\n      withoutSessions: withoutSessions\n    };\n\n    const queryString = !!isAutoRefresh ? '?autoRefresh=true' : '';\n    Api.post('/api/diary/schedule' + queryString, request).then(\n      action((res) => {\n        this.statsKeys = res.body.result.keys;\n        ScheduleStore.onLoad(res.body.result);\n        cache.mediator.publish(new DiaryFetchEvent());\n        this.processing = false;\n      })\n    );\n  }\n\n  @action.bound\n  onUnload(): void {\n    this.mode = EMode.appointment;\n    this._disposers.forEach((fn) => {\n      fn();\n    });\n  }\n\n  @action.bound\n  async _getAppt(apptId: number): Promise<AppointmentDetailsResponse> {\n    const { result } = await BaseStore.defaultClient.get(new AppointmentGetRequest({ id: apptId }));\n\n    return result;\n  }\n\n  @action.bound\n  async moveToAppt(apptId: number): Promise<AppointmentDetailsResponse> {\n    const { result } = await BaseStore.defaultClient.get(new AppointmentGetRequest({ id: apptId }));\n\n    runInAction(() => {\n      this.location = result.locationId;\n      this.practitioners.replace([result.practitionerId]);\n      this.date = Moment(result.startDateTime).toDate();\n    });\n\n    return result;\n  }\n\n  @action.bound\n  protected _moveToAppt(appt: AppointmentDetailsResponse): void {\n    this.location = appt.locationId;\n    if (!this.practitioners.includes(appt.practitionerId)) {\n      if (this.practitioners.length > 1) this.practitioners.push(appt.practitionerId);\n      else this.practitioners.replace([appt.practitionerId]);\n    }\n    this.date = Moment(appt.startDateTime).toDate();\n  }\n\n  @action.bound\n  async navigateToAppt(apptId: number): Promise<void> {\n    this.target = `evt-appt-${apptId}`;\n\n    const res = await this._getAppt(apptId);\n\n    this._moveToAppt(res);\n  }\n}\n\nexport { default as Resources } from './diary-view-store/enums/resources';\nconst DiaryViewStore = new DiaryViewStoreType();\nexport default DiaryViewStore;\n\nexport class DiaryFetchEvent implements IEvent {\n  public constructor(init?: Partial<DiaryFetchEvent>) {\n    (Object as any).assign(this, init);\n  }\n}\n", "enum DiaryResources {\n  classes = 'classes',\n  practitioner = 'practitioner',\n  room = 'room',\n  list = 'list'\n}\n\nexport default DiaryResources;\n", "enum CalendarDisplay {\n  Day = 'Day',\n  Week = 'Week',\n  Month = 'Month'\n}\n\nexport default CalendarDisplay;\n", "import { action, extendObservable, observable } from 'mobx';\n\nimport _ from 'lodash';\n\nimport { MonthlyScheduleResponse } from 'tm3-core/api.dtos';\n\nimport type {\n  Schedule,\n  ScheduleAppointment,\n  ScheduleBlock,\n  ScheduleResponse,\n  ScheduleSession\n} from 'tm3-core/api.dtos';\n\nexport type TMode = 'appointments' | 'sessions';\n\nexport interface IMergable<T> {\n  onMerge(value: T): void;\n}\n\nexport class BlockStore {\n  @observable count = 0;\n  @observable holiday = false;\n  @observable readonly keys = observable.array<string>([]);\n  @observable readonly resources = observable.map<string, ResourceStore>(new Map());\n  @observable readonly monthlySummary = observable.object({});\n\n  @action.bound\n  onMerge(props: ScheduleBlock): void {\n    this.count = props.count;\n    this.holiday = props.holiday;\n    this.keys.replace(props.keys);\n    this.mergeResources(props.keys, props.values);\n  }\n\n  @action.bound\n  private mergeResources(keys: string[], newResources: Record<string, Schedule>): void {\n    const { resources } = this;\n    keys.forEach((key, i) => {\n      const lResorces = resources.has(key) ? resources : resources.set(key, new ResourceStore());\n      lResorces.get(key)!.onMerge(newResources[key]);\n    });\n  }\n}\n\nexport class ResourceStore {\n  @observable id = 0;\n  @observable name = '';\n  @observable readonly sessions = observable.map<string, EventStore<ScheduleSession>>(new Map());\n  @observable readonly appointments = observable.map<string, EventStore<ScheduleAppointment>>(\n    new Map()\n  );\n\n  @action.bound\n  onMerge(props: Schedule): void {\n    this.id = props.id;\n    this.name = props.name;\n    this.mergeAppointments(props.appointments);\n    this.mergeSessions(props.sessions);\n  }\n\n  @action.bound\n  private mergeSessions(newSessions: Record<string, ScheduleSession>): void {\n    const { sessions } = this;\n    Object.entries(newSessions).forEach(([key, value]) => {\n      const lSessions = sessions.has(key) ? sessions : sessions.set(key, new EventStore());\n      lSessions.get(key)!.onMerge(value);\n    });\n  }\n\n  @action.bound\n  private mergeAppointments(newAppointments: Record<string, ScheduleAppointment>): void {\n    const { appointments } = this;\n    Object.entries(newAppointments).forEach(([key, value]) => {\n      const lAppointments = appointments.has(key)\n        ? appointments\n        : appointments.set(key, new EventStore());\n      lAppointments.get(key)!.onMerge(value);\n    });\n  }\n}\n\nexport class EventStore<T extends {}> {\n  @action.bound\n  onMerge(props: T) {\n    const keys = Object.keys(this);\n    if (!!keys.length) {\n      const rest: Partial<T> = {};\n      Object.keys(props).map((key) => {\n        if (keys.includes(key)) {\n          (this as unknown as T)[key as keyof T] = props[key as keyof T];\n        } else {\n          rest[key as keyof T] = props[key as keyof T];\n        }\n      });\n      extendObservable(this, rest);\n    } else {\n      extendObservable(this, props);\n    }\n  }\n}\n\nexport class ScheduleStore {\n  @observable count = 0;\n  @observable columns = 0;\n  @observable readonly keys = observable.array<string>([]);\n  @observable readonly blocks = observable.map<string, BlockStore>(new Map());\n\n  @action.bound\n  onLoad(res: ScheduleResponse): void {\n    this.count = res.count;\n    this.columns = res.columns;\n    this.keys.replace(res.keys);\n\n    const { blocks } = this;\n    blocks.clear();\n    res.keys.forEach((key) => {\n      const lBlocks = blocks.has(key) ? blocks : blocks.set(key, new BlockStore());\n      lBlocks.get(key)!.onMerge(res.blocks[key]);\n    });\n  }\n\n  getBlock(block: number): BlockStore | undefined {\n    return this.blocks.get(this.keys[block]);\n  }\n\n  getBlockByKey(key: string): BlockStore | undefined {\n    return this.blocks.get(key);\n  }\n\n  getResource(block: number, resource: number): ResourceStore | null {\n    const res = this.getBlock(block);\n    //hack for inverted render\n    //remove when fixed\n    if (!res) {\n      return null;\n    }\n    const keys = res.keys;\n    if (resource >= keys.length) {\n      return null;\n    }\n    return res.resources.get(keys[resource]) ?? null;\n  }\n\n  getResourceByKey(blockKey: string, resourceKey: string): ResourceStore | null {\n    const res = this.getBlockByKey(blockKey);\n    if (!res) {\n      return null;\n    }\n    //hack for inverted render\n    //remove when fixed\n    const val = res.resources.get(resourceKey);\n    if (!val) {\n      return null;\n    }\n    return val;\n  }\n\n  private _onChangeMap(obj, key: string) {\n    const map = {};\n\n    Object.keys(obj).forEach((blockId) => {\n      const block = obj[blockId];\n      block.forEach((evt) => {\n        map[evt.scheduleId] = { block: blockId, resource: evt[key] };\n      });\n    });\n\n    return map;\n  }\n\n  //This method needs modded to be more efficient\n  @action.bound\n  onMerge(mode: TMode, key: string, obj) {\n    const map = this._onChangeMap(obj, key);\n\n    this.keys.forEach((blockId) => {\n      const block = this.getBlockByKey(blockId);\n      if (!block) return;\n\n      const group = _.groupBy<ScheduleSession & ScheduleAppointment>(obj[blockId], key);\n      let b: Set<String>;\n      block.keys.forEach((resId) => {\n        const resource = this.getResourceByKey(blockId, resId)?.[mode];\n        if (!resource) return;\n\n        const a = new Set(resource.keys());\n        b = b ?? new Set(Object.keys(map));\n        const intersection = new Set([...a].filter((x) => b.has(x)));\n\n        intersection.forEach((x) => {\n          if (map[x].block === blockId && map[x].resource === resId) {\n            return;\n          }\n          resource.delete(x);\n        });\n\n        let evts: Record<string, EventStore<ScheduleAppointment> | EventStore<ScheduleSession>> =\n          {};\n        group[resId]?.forEach((x: ScheduleSession & ScheduleAppointment) => {\n          const evt = resource.get(x.scheduleId) ?? new EventStore();\n          evt.onMerge(x);\n\n          evts[x.scheduleId] = evt;\n        });\n        resource.merge(evts);\n      });\n    });\n  }\n\n  // @action\n  // onMerge(mode, key, obj) {\n  //   this.keys.forEach((block) => {\n  //     if (!obj[block]) {return}\n  //     let group = _.groupBy(obj[block], key)\n  //     Object.keys(group).forEach((resId) => {\n  //       let list = this.getResourceByKey(block, resId).get(mode)\n  //       group[resId].map((x) => {\n  //         list.set(x.scheduleId, x)\n  //       })\n  //     })\n  //   })\n  // }\n\n  @action\n  onRemove(mode: TMode, key: string, obj): void {\n    if (!obj) {\n      return;\n    }\n\n    this.keys.forEach((block) => {\n      if (!obj[block]) {\n        return;\n      }\n      const group = _.groupBy(obj[block], key);\n      Object.keys(group).forEach((resId) => {\n        const list = this.getResourceByKey(block, resId)?.[mode];\n        group[resId].forEach((x) => {\n          list?.delete(x.scheduleId);\n        });\n      });\n    });\n  }\n}\n\nconst GlobalScheduleStore = new ScheduleStore();\n\nexport default GlobalScheduleStore;\n", "import Exim from 'exim';\nimport Api from 'tm3-core/api';\n\nexport default Exim.createStore({\n  actions: ['requestLock', 'releaseLock', 'appointmentIsSame', 'clearAllForUser'],\n\n  initial: {\n    lock: false,\n    needsRefresh: false,\n    caseIsLocked: false\n  },\n\n  appointmentIsSame(appointment) {\n    //Diary.set(processing:true)\n    const appt = {\n      id: appointment.id,\n      startDateTime: appointment.actualStartDateTime || appointment.startDateTime,\n      endDateTime: appointment.actualEndDateTime || appointment.endDateTime,\n      status: appointment.status,\n      practitionerId: appointment.practitionerId,\n      locationId: appointment.locationId,\n      roomId: appointment.roomId,\n      type: appointment.type,\n      name: appointment.name,\n      description: appointment.description || appointment.comment\n    };\n\n    return Api.post('/api/lock/same', appt).then((res) => {\n      switch (res.body.result) {\n        case '-1':\n          return this.set({\n            needsRefresh: true,\n            lock: false\n          });\n        //Diary.set(processing:false)\n        case '0':\n          return this.set({\n            needsRefresh: false,\n            lock: true\n          });\n        //Diary.set(processing:false)\n        default:\n          return this.set({\n            needsRefresh: false,\n            lockUserName: res.body.result,\n            lock: false\n          });\n      }\n    });\n  },\n  //Diary.set(processing:false)\n\n  requestLock(objectType, objectId) {\n    return Api.post('/api/lock/request', { objectType, objectId }).then((res) => {\n      if (res.body === false) {\n        return this.set({\n          lock: true\n        });\n      } else {\n        const { id, userName, objectType } = res.body.result;\n        return this.set({\n          caseIsLocked: objectType.toUpperCase().trim() === 'H',\n          lockUserId: id,\n          lockUserName: userName\n        });\n      }\n    });\n  },\n\n  releaseLock(objectType, objectId) {\n    return Api.post('/api/lock/release', { objectType, objectId });\n  },\n\n  clearAllForUser() {\n    return Api.post('/api/lock/release/user').then((res) => {\n      return this.set({\n        lock: false\n      });\n    });\n  }\n});\n", "import { decorate, observable } from 'mobx';\n\nimport { LocationResponse } from 'tm3-core/api.dtos';\n\ndecorate(LocationResponse, {\n  addressLine1: observable,\n  addressLine2: observable,\n  addressLine3: observable,\n  addressLine4: observable,\n  addressLine5: observable,\n  cancelStockId: observable,\n  directions: observable,\n  dnaStockId: observable,\n  email: observable,\n  facilities: observable,\n  fax: observable,\n  fullAddressMultiLine: observable,\n  id: observable,\n  isMainLocation: observable,\n  name: observable,\n  onlineGuid: observable,\n  postCode: observable,\n  reminderTemplateEmail_TM3: observable,\n  reminderTemplateSMS_TM3: observable,\n  status: observable,\n  telephone: observable,\n  web: observable\n});\n\nexport default LocationResponse;\n", "import Exim from 'exim';\nimport _ from 'lodash';\nimport Api from 'tm3-core/api';\nimport { cache } from 'tm3-core/cache';\nimport ModuleEnum from 'tm3-core/licence';\nimport lazy from './lazy-loader';\n\nconst LabelAPI = {\n  cache: {},\n\n  loadAll() {\n    return lazy('/api/sys/labels/all');\n  },\n\n  resetCache() {\n    lazy.clear('/api/sys/labels/all');\n    return lazy('/api/sys/labels/all');\n  },\n\n  get(label) {\n    return this.loadAll().then(function (res) {\n      let val = __guard__(\n        _.filter(res.body.results, { id: label.toUpperCase() })[0],\n        (x) => x.text\n      );\n      if (val == null) {\n        val = label;\n      }\n      return val;\n    });\n  }\n};\n\nconst saveLabels = (labels) =>\n  Api.post('/api/settings/labels/save', { labels }).then(() => {\n    return LabelAPI.resetCache();\n  });\nconst debouncedSave = _.debounce(saveLabels, 1000);\n\nexport default Exim.createStore({\n  actions: ['loadAll', 'load', 'set', 'newLoad'],\n\n  initial: {\n    loadingLabels: true,\n    labels: {},\n    allLabels: [\n      { id: 'ADDR1', niceName: 'Address:', text: 'Address:' },\n      {\n        id: 'ADDR2',\n        niceName: 'Address 2:',\n        text: 'Address 2:'\n      },\n      { id: 'ADDR3', niceName: 'Town:', text: 'Town:' },\n      { id: 'ADDR4', niceName: 'County:', text: 'County:' },\n      { id: 'ADDR5', niceName: 'Country:', text: 'Country:' },\n      {\n        id: 'ADDRPC',\n        niceName: 'Postcode:',\n        text: 'Postcode:'\n      },\n      {\n        id: 'PATAREF',\n        niceName: 'Alt Reference:',\n        text: 'Alt Reference:'\n      },\n      {\n        id: 'PATEMPLY',\n        niceName: 'Employer:',\n        text: 'Employer:',\n        module: ModuleEnum.ContactsAdvanced\n      },\n      {\n        id: 'PATHOSCD',\n        niceName: 'Hospital Code:',\n        text: 'Hospital Code:',\n        module: ModuleEnum.ContactsAdvanced\n      },\n      {\n        id: 'PATNICD',\n        niceName: 'NI Number:',\n        text: 'NI Number:',\n        module: ModuleEnum.ContactsAdvanced\n      },\n      {\n        id: 'PATPLCY',\n        niceName: 'Policy No:',\n        text: 'Policy No:',\n        module: ModuleEnum.ContactsAdvanced\n      }\n    ]\n  },\n\n  load(label) {\n    return LabelAPI.get(label).then((res) => {\n      return this.set({ [label]: res });\n    });\n  },\n\n  newLoad(label) {\n    return LabelAPI.get(label).then((res) => {\n      return res;\n    });\n  },\n\n  loadAll() {\n    this.set({ loadingLabels: true });\n    return LabelAPI.loadAll().then((res) => {\n      let allLabels = this.get('allLabels');\n\n      for (let label of res.body.results) {\n        const selected = _.filter(allLabels, { id: label.id })[0];\n        if (selected != null) {\n          selected.text = label.text;\n        }\n      }\n      this.set({ allLabels });\n      return this.set({ loadingLabels: false });\n    });\n  },\n\n  set(label, value) {\n    const allLabels = this.get('allLabels');\n    const selected = _.filter(allLabels, { id: label })[0];\n    if (selected != null) {\n      selected.text = value;\n    } else {\n      allLabels.push({ id: label, value });\n    }\n    debouncedSave(allLabels);\n    return this.set({\n      allLabels,\n      savingLabels: true\n    });\n  }\n});\n\nfunction __guard__(value, transform) {\n  return typeof value !== 'undefined' && value !== null ? transform(value) : undefined;\n}\n", "enum ModuleEnum {\n  AccountingIntegrations = 'Accounting Integrations',\n  AccountManagement = 'Account Management',\n  AppointmentBilling = 'Standard Appointment Billing',\n  AutomationsHasHad = 'Automations Has Had',\n  Classes = 'Classes',\n  ClinicalServices = 'Clinical Services',\n  CommunicationBasic = 'Communication (Basic)',\n  CommunicationAdvanced = 'Communication (Advanced)',\n  CommunicationEnhanced = 'Communication (Enhanced)',\n  ConnectHideFromExplorer = 'Connect Hide From Explorer',\n  ContactsBasic = 'Contacts (Basic)',\n  ContactsAdvanced = 'Contacts (Advanced)',\n  CreditBasedPackages = 'Credit Based Packages',\n  CRMBasic = 'CRM (Basic)',\n  CRMAdvanced = 'CRM (Advanced)',\n  Dashboard = 'Dashboard',\n  DiaryBasic = 'Diary (Basic)',\n  DiaryAdvanced = 'Diary (Advanced)',\n  DiaryEnhanced = 'Diary (Enhanced)',\n  TreatmentAuthorisation = 'Treatment Authorisation',\n  DiarySkills = 'Diary Skills',\n  DigitalPrescriptions = 'Digital Prescriptions',\n  ExerciseIntegrations = 'Exercise Integrations',\n  FinanceBasic = 'Finance (Basic)',\n  FinanceAdvanced = 'Finance (Advanced)',\n  Forms = 'Forms',\n  GarageServices = 'Garage Services',\n  Healthcode = 'Healthcode Integration',\n  MultiLocation = 'Multi Location',\n  MyAccount = 'My Account Section',\n  MyAccountInvoices = 'My Account Invoice',\n  MyAccountSubscription = 'My Account Subscription Section',\n  MyAccountContacts = 'My Account Contacts',\n  OnlineBookingsBasic = 'Online Bookings (Basic)',\n  OnlineBookingsAdvanced = 'Online Bookings (Advanced)',\n  Optical = 'Optical',\n  Packages = 'Packages and Subscriptions',\n  PayPerClick = 'Pay Per Click',\n  PostcodeLookup = 'Address/Postcode Lookup',\n  ProntoReferrals = 'Pronto Referrals',\n  QuickStartWizard = 'QuickStartWizard',\n  ReceptionServices = 'Reception Services',\n  ReportingBasic = 'Reporting (Basic)',\n  ReportingAdvanced = 'Reporting (Advanced)',\n  SecurityBasic = 'Security (Basic)',\n  SecurityAdvanced = 'Security (Advanced)',\n  SecurityEnhanced = 'Security (Enhanced)',\n  SettingsBasic = 'Settings (Basic)',\n  SettingsAdvanced = 'Settings (Advanced)',\n  SMSBundles = 'SMS Bundles',\n  SocialSignOn = 'Social Sign On',\n  StockBasic = 'Stock (Basic)',\n  StockAdvanced = 'Stock (Advanced)',\n  SystemCredits = 'System Credits',\n  TechnicalSupport = 'Technical Support (Basic)',\n  TechnicalSupportAdvanced = 'Technical Support (Advanced)',\n  Telehealth = 'Telehealth',\n  TreatmentBasic = 'Treatment (Basic)',\n  TreatmentAdvanced = 'Treatment (Advanced)',\n  TreatmentEnhanced = 'Treatment (Enhanced)',\n  Worksheets = 'Worksheets',\n  TaxExemption = 'Tax Exemption'\n}\nexport default ModuleEnum;\n", "import Exim from 'exim';\nimport Api from 'tm3-core/api';\nimport lazy from './lazy-loader';\n\nexport default Exim.createStore({\n  actions: ['load', 'refresh'],\n\n  initial: {\n    locations: []\n  },\n\n  load() {\n    return lazy('/api/locations/all').then((res) => {\n      return this.set({\n        locations: res.body.results\n      });\n    });\n  },\n\n  refresh() {\n    return Api.get('/api/locations/all').then((res) => {\n      return this.set({\n        locations: res.body.results\n      });\n    });\n  }\n});\n", "import Exim from 'exim';\nimport _ from 'lodash';\nimport lazy from './lazy-loader';\n\nconst LookupsAPI = {\n  loadAll() {\n    return lazy('/api/lookups/all');\n  },\n\n  resetCache() {\n    lazy.clear('/api/lookups/all');\n    return lazy('/api/lookups/all');\n  },\n\n  get(lookup) {\n    return this.loadAll().then(function (res) {\n      lookup = lookup.toUpperCase();\n      return __guard__(_.filter(res.body.results, { name: lookup })[0], (x) =>\n        x.values.map((l) => ({ payload: l, text: l }))\n      );\n    });\n  }\n};\n\nexport default Exim.createStore({\n  actions: ['getLookup', 'load', 'loadAll', 'resetCache', 'loadRegionalLookups'],\n\n  getLookup(lookup) {\n    return LookupsAPI.get(lookup);\n  },\n\n  load(lookup) {\n    return LookupsAPI.get(lookup).then((res) => {\n      return this.set({ [lookup]: res });\n    });\n  },\n\n  loadAll() {\n    return LookupsAPI.loadAll();\n  },\n\n  loadRegionalLookups() {\n    return lazy.item('/api/lookups/regional').then((res) => {\n      return this.set({\n        regionalLookups: res.body\n      });\n    });\n  },\n\n  resetCache() {\n    return LookupsAPI.resetCache();\n  }\n});\n\nexport { LookupsAPI as API };\n\nexport let AllStore = Exim.createStore({\n  actions: ['loadAll'],\n  initial: {\n    lookups: []\n  },\n\n  loadAll() {\n    return LookupsAPI.loadAll().then((res) => {\n      return this.set({\n        lookups: res.body.results\n      });\n    });\n  }\n});\n\nfunction __guard__(value, transform) {\n  return typeof value !== 'undefined' && value !== null ? transform(value) : undefined;\n}\n", "import { action, computed, observable } from 'mobx';\nimport moment from 'moment';\nimport Api from 'tm3-core/api';\nimport { cache } from 'tm3-core/cache';\nimport { ConfigObservable } from './config';\nimport SnackbarStore from './snackbar-store';\n\nclass ReminderStore {\n  @observable loading = false;\n  @observable reminders = [];\n  @observable show = false;\n  @observable day = '';\n  @observable isEmail = false;\n  @observable lastReminderTime = null;\n\n  @action\n  onLoad(type, isEmail, date, locationId, appointmentId, practitionerIds) {\n    this.loading = true;\n    if (moment(date).isValid()) {\n      this.day = moment(date).format('ddd Do MMM');\n    }\n    this.isEmail = isEmail;\n\n    let pId = type === 'P' ? practitionerIds : [];\n    let request = {\n      day: date,\n      isEmail: isEmail,\n      locationId: locationId,\n      practitionerIds: pId || [],\n      appointmentId: appointmentId || 0\n    };\n\n    Api.post('/api/reminder/data', request).then((res) => {\n      res.body.results.forEach((r) => {\n        let sms = r.mobileTelephone || '';\n        let email = r.customerEmail || '';\n\n        let hasEmail = isEmail && email.length > 0;\n        let hasSms = !isEmail && sms.length > 0 && r.customerSmsEnabled;\n        r.include = (hasEmail || hasSms) && r.customerGivenConsent;\n        return;\n      });\n      this.reminders.replace(res.body.results);\n      this.loading = false;\n      this.show = true;\n    });\n  }\n\n  @action\n  getReminderTime() {\n    const { app } = cache;\n    const isProntoPortal = cache.licence.get('isProntoPortal');\n\n    if (isProntoPortal || app.Pronto) return;\n\n    Api.get('/api/reminder/last').then((res) => {\n      this.lastReminderTime = res.body.result;\n    });\n  }\n\n  @action\n  onSend(reminders, isEmail) {\n    let text = !isEmail ? 'SMS successfully queued' : 'Email successfully queued';\n\n    this.reminders.replace(reminders);\n\n    let appointmentIds = reminders.filter((x) => !!x.include).map((r) => r.id);\n\n    Api.post('/api/reminder/send', { appointmentIds, sendEmail: isEmail, sendSms: !isEmail }).then(\n      (res) => {\n        SnackbarStore.onNotify(text, true);\n      }\n    );\n  }\n\n  @computed\n  get ozMode() {\n    let { config } = ConfigObservable;\n    let mode = config['OZ MODE'] || 'false';\n    return mode.toUpperCase() === 'TRUE';\n  }\n\n  @computed\n  get enabled() {\n    let { config } = ConfigObservable;\n    let sms = config['S_REMINDERS_SENDSMS'] || 'false';\n    let email = config['S_REMINDERS_SENDEMAIL'] || 'false';\n\n    return email.toUpperCase() === 'TRUE' || sms.toUpperCase() === 'TRUE';\n  }\n}\n\nexport default new ReminderStore();\n", "import { action, observable } from 'mobx';\n\nclass SnackbarStore {\n  @observable\n  open: boolean = false;\n  @observable\n  message: string = 'Sending Email';\n\n  private timeout?: number = -1;\n\n  @action.bound\n  onNotify(message: string | null, open: boolean | null) {\n    if (open !== null) {\n      if (!!this.timeout) {\n        clearTimeout(this.timeout);\n      }\n\n      this.open = open;\n      this.timeout = setTimeout(this.onClose, 3000);\n    }\n\n    if (message !== null) {\n      this.message = message;\n    }\n  }\n\n  @action.bound\n  private onClose() {\n    this.open = false;\n    this.timeout = undefined;\n  }\n}\n\nexport default new SnackbarStore();\n", "import Exim from 'exim';\nimport _ from 'lodash';\nimport lazy from './lazy-loader';\n\nlet can = {};\n\nconst SecurityAPI = {\n  loadAll() {\n    return lazy.item('/api/user/current/roles');\n  }\n};\n\nexport default Exim.createStore({\n  actions: ['canDoAction', 'updateDefaultLocation', 'logout', 'loadAll'],\n  initial: {\n    can: {}\n  },\n\n  logout() {\n    this.reset();\n    lazy.clear();\n    // PermissionStore.can.clear();\n  },\n\n  loadAll() {\n    can = this.get('can');\n    return new Promise((resolve, reject) => {\n      return SecurityAPI.loadAll().then((res) => {\n        this.set({ can, securityLoadAll: true });\n        return resolve(true);\n      });\n    });\n  },\n\n  canDoAction(action, locationId, cb) {\n    return SecurityAPI.loadAll().then((res) => {\n      if (!res || !res.body) {\n        return;\n      }\n      const resp = res.body.result;\n      const location = locationId || this.get('defaultLocation');\n      const role = resp.locationRoleMap[location];\n      can = this.get('can');\n      if (_.isArray(action)) {\n        _.each(action, (action) => {\n          if (resp.roles[role] != null ? resp.roles[role][`d${action}`] : undefined) {\n            return (can[(location + action).replace(/\\//g, '-')] = true);\n          }\n        });\n        this.set({ can });\n      } else {\n        if (resp.roles[role] != null ? resp.roles[role][`d${action}`] : undefined) {\n          can[(location + action).replace(/\\//g, '-')] = true;\n          this.set({ can });\n        }\n      }\n      return typeof cb === 'function' ? cb() : undefined;\n    });\n  },\n\n  updateDefaultLocation(locationId) {\n    // hoping this will trigger a change globally at some point.\n    return this.set({\n      defaultLocation: locationId\n    });\n  }\n});\n", "import Exim from 'exim';\nimport _ from 'lodash';\nimport { observable } from 'mobx';\nimport Api from 'tm3-core/api';\nimport type { FolderTree } from 'tm3-core/api.dtos';\nimport lazy from './lazy-loader';\n\ntype TTemplate = {\n  templates: FolderTree;\n  filteredTemplates: FolderTree;\n};\n\nconst TemplateObservable: TTemplate = observable({\n  templates: {\n    folders: [],\n    files: []\n  },\n  filteredTemplates: {\n    files: [],\n    folders: []\n  }\n});\n\nconst Store = Exim.createStore({\n  actions: [\n    'setCurrent',\n    'loadAll',\n    'loadAttachments',\n    'setTemplates',\n    'delete',\n    'rename',\n    'copy',\n    'reloadTemplates',\n    'reset'\n  ],\n  initial: {\n    loadingTemplates: true,\n    templates: {\n      folders: [],\n      files: []\n    },\n    filteredTemplates: {\n      folders: [],\n      files: []\n    }\n  },\n\n  setCurrent(name, filter) {\n    return lazy('/api/templates').then((res) => {\n      let filteredTemplates;\n      const templatesFolder = res.body;\n      if (name) {\n        filteredTemplates = templatesFolder.folders.find((x) => x.name === name);\n      }\n      if (filteredTemplates) {\n        this.set({ filteredTemplates });\n        TemplateObservable.templates = res.body; // Handle refresh issue (legacy)\n        TemplateObservable.filteredTemplates = filteredTemplates;\n      }\n    });\n  },\n\n  reloadTemplates() {\n    lazy.clear('/api/templates');\n    return this.actions.loadAll();\n  },\n\n  loadAll() {\n    this.set({\n      loadingTemplates: true\n    });\n\n    return lazy('/api/templates')\n      .then((res) => {\n        TemplateObservable.templates = res.body;\n        return this.set({\n          templates: res.body,\n          loadingTemplates: false\n        });\n      })\n      .catch(() => {\n        return console.log('Error loadingTemplates templates');\n      });\n  },\n\n  loadAttachments(mode) {\n    this.set({\n      loadingTemplates: true\n    });\n\n    return lazy('/api/templates')\n      .then((res) => {\n        return this.set({\n          templates: res.body,\n          loadingTemplates: false\n        });\n      })\n      .catch(() => {\n        return console.log('Error loadingTemplates templates');\n      });\n  },\n\n  delete(path, isGlobal) {\n    path = path.replace(/\\\\|\\//g, '%2F');\n    return Api.post('/api/delete', { path, isGlobal }).then((res) => {\n      return this.actions.reloadTemplates();\n    });\n  },\n\n  rename(path, newName, isGlobal) {\n    if (isGlobal) {\n      this.actions.rename(path, path + '.hidden');\n    }\n    path = path.replace(/\\\\|\\//g, '%2F');\n    newName = newName.replace(/\\\\|\\//g, '%2F');\n    return Api.post('/api/rename', { path, newName, overwrite: true, isGlobal }).then((res) => {\n      return this.actions.reloadTemplates();\n    });\n  },\n\n  copy(path, newName, isGlobal) {\n    path = path.replace(/\\\\|\\//g, '%2F');\n    newName = newName.replace(/\\\\|\\//g, '%2F');\n    return Api.post('/api/copy', { path, newName, overwrite: true, isGlobal }).then((res) => {\n      return this.actions.reloadTemplates();\n    });\n  }\n});\n\n// Store.TemplateObservable = TemplateObservable\n// module.exports = Store\n\nexport default Store;\nexport { TemplateObservable };\n", "import Exim from 'exim';\nimport Api from 'tm3-core/api';\n\nconst Tours = Exim.createStore({\n  actions: ['preload', 'dontShowAgain'],\n\n  initial() {\n    return { tours: {} };\n  },\n\n  preload(tours) {\n    return this.set({ tours });\n  },\n\n  dontShowAgain(name) {\n    const tours = this.get('tours');\n    tours[name] = true;\n    this.set({ tours });\n    return Api.put('/api/tours/skip', tours);\n  }\n});\nexport default Tours;\nexport { Tours };\n"],
  "mappings": "+vBAAAA,IAAAC,ICAAC,IAAAC,IAIAC,GAASC,GAAa,CACpB,GAAIC,EACJ,KAAMA,EACN,MAAOA,EACP,SAAUA,EACV,SAAUA,EACV,gBAAiBA,EACjB,aAAcA,EACd,SAAUA,EACV,aAAcA,EACd,SAAUA,EACV,OAAQA,EACR,eAAgBA,EAChB,YAAaA,EACb,SAAUA,EACV,iBAAkBA,EAClB,MAAOA,EACP,YAAaA,EACb,SAAUA,EACV,eAAgBA,EAChB,gBAAiBA,EACjB,cAAeA,EACf,YAAaA,EACb,YAAaA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ill", "init_buffer", "init_virtual_process_polyfill", "init_buffer", "decorate", "CurrentUser", "observable", "init_virtual_process_polyfill", "init_buffer", "import_bind_decorator", "ProntoCache", "resolve", "reject", "cache", "api_default", "res", "result", "networkServices", "ProntoNetworkServices", "invoiceTemplates", "ProntoInvoiceTemplates", "runInAction", "__name", "__decorateClass", "observable", "action", "CacheObject", "computedFn", "id", "bound", "networkServiceId", "service", "services", "orderBy", "b", "cache_default", "init_virtual_process_polyfill", "init_buffer", "init_virtual_process_polyfill", "init_buffer", "colours", "init_virtual_process_polyfill", "init_buffer", "init_virtual_process_polyfill", "init_buffer", "init_virtual_process_polyfill", "init_buffer", "EPractitionerStatus", "status_default", "DiaryCacheStore", "RoomResponse", "z_default", "cache", "x", "status_default", "__name", "__decorateClass", "computed", "GlobalDiaryCacheStore", "diary_cache_store_default", "init_virtual_process_polyfill", "init_buffer", "import_moment", "init_virtual_process_polyfill", "init_buffer", "DiaryResources", "resources_default", "init_virtual_process_polyfill", "init_buffer", "CalendarDisplay", "calendar_display_default", "init_virtual_process_polyfill", "init_buffer", "import_lodash", "BlockStore", "observable", "props", "keys", "newResources", "resources", "key", "i", "ResourceStore", "__name", "__decorateClass", "action", "newSessions", "sessions", "value", "EventStore", "newAppointments", "appointments", "rest", "extendObservable", "ScheduleStore", "res", "blocks", "block", "resource", "blockKey", "resourceKey", "val", "obj", "map", "blockId", "evt", "mode", "group", "_", "resId", "a", "x", "evts", "list", "GlobalScheduleStore", "schedule_store_default", "DiaryViewStoreType", "calendar_display_default", "MonthlyScheduleResponse", "resources_default", "observable", "delay", "userId", "res", "base_store_default", "DiaryRequest", "runInAction", "fn", "locationId", "allRooms", "allPractitionerLocations", "diary_cache_store_default", "loc", "availRooms", "x", "availPract", "practitionerLocationsResult", "plr", "_pract", "_rooms", "diary", "isClick", "isPhone", "defaultLocation", "defaultToWeek", "autorun", "observe", "ConfigObservable", "change", "doVerify", "__name", "cache", "available", "current", "all", "sub", "key", "fallback", "val", "result", "config", "diaryPrintState", "lsConfig", "practitionerId", "_cache", "json", "restore", "isAutoRefresh", "date", "isWeek", "resourceMode", "weekends", "_location", "withoutSessions", "firstDay", "workingDays", "Moment", "resourceIds", "MonthlyScheduleRequest", "action", "request", "queryString", "api_default", "schedule_store_default", "DiaryFetchEvent", "apptId", "AppointmentGetRequest", "appt", "__decorateClass", "computed", "DiaryViewStore", "diary_view_store_default", "init", "init_virtual_process_polyfill", "init_buffer", "import_exim", "locks_default", "Exim", "appointment", "appt", "api_default", "res", "objectType", "objectId", "id", "userName", "DiaryPopoverStore", "appt", "customer", "reference", "mobileTelephone", "email", "smsEnabled", "title", "forename", "surname", "gender", "insuranceNumber", "groupReference", "status", "registrationDate", "mapped", "DiaryListResponse", "activePopover", "selection", "callback", "allRooms", "allLocations", "allPractitioners", "diary_cache_store_default", "x", "_active", "locks_default", "runInAction", "appointment", "patient", "diary_view_store_default", "id", "deleteCase", "mandatory", "__name", "__decorateClass", "observable", "action", "diary_popover_store_default", "import_lodash", "import_moment", "colours", "DashboardStore", "ServiceClient", "locations_store_default", "moment", "config_enum_default", "result", "j", "segments", "withColour", "s", "newPatientByType", "runInAction", "dnas", "dnaTotal", "cancellations", "allAppointments", "appointmentShare", "debt", "turnover", "topClients", "appointmentStats", "newPatients", "location", "practitionerId", "apptId", "appointment", "x", "patientId", "CustomerRequest", "res", "patient", "initialLoad", "currentDate", "startDate", "endDate", "req", "DashboardListRequest", "appointments", "idsNotToInclude", "y", "_", "appt", "resolve", "reject", "diary_popover_store_default", "id", "discriminatorType", "existing", "AlertSearchRequest", "idx", "authLeft", "latestAppointments", "apptDeleteResp", "apptIds", "key", "sessions", "currentTab", "statusToggleActive", "__name", "__decorateClass", "observable", "action", "dashboard_store_default", "init_virtual_process_polyfill", "init_buffer", "decorate", "LocationResponse", "observable", "locations_response_default", "init_virtual_process_polyfill", "init_buffer", "import_exim", "import_lodash", "init_virtual_process_polyfill", "init_buffer", "ModuleEnum", "licence_default", "LabelAPI", "lazy_loader_default", "label", "res", "val", "__guard__", "_", "x", "saveLabels", "__name", "labels", "api_default", "debouncedSave", "dynamic_labels_default", "Exim", "licence_default", "allLabels", "selected", "value", "transform", "init_virtual_process_polyfill", "init_buffer", "import_exim", "locations_default", "Exim", "lazy_loader_default", "res", "api_default", "init_virtual_process_polyfill", "init_buffer", "import_exim", "import_lodash", "LookupsAPI", "lazy_loader_default", "lookup", "res", "__guard__", "_", "x", "l", "lookups_default", "Exim", "AllStore", "Exim", "LookupsAPI", "res", "__guard__", "value", "transform", "__name", "init_virtual_process_polyfill", "init_buffer", "import_moment", "init_virtual_process_polyfill", "init_buffer", "SnackbarStore", "message", "open", "__name", "__decorateClass", "observable", "action", "snackbar_store_default", "ReminderStore", "type", "isEmail", "date", "locationId", "appointmentId", "practitionerIds", "moment", "request", "api_default", "res", "r", "sms", "email", "hasEmail", "hasSms", "app", "cache", "reminders", "text", "appointmentIds", "x", "snackbar_store_default", "config", "ConfigObservable", "__name", "__decorateClass", "observable", "action", "computed", "reminder_store_default", "init_virtual_process_polyfill", "init_buffer", "import_exim", "import_lodash", "can", "SecurityAPI", "lazy_loader_default", "security_default", "Exim", "resolve", "reject", "res", "action", "locationId", "cb", "resp", "location", "role", "_", "init_virtual_process_polyfill", "init_buffer", "import_exim", "TemplateObservable", "observable", "Store", "Exim", "name", "filter", "lazy_loader_default", "res", "filteredTemplates", "templatesFolder", "x", "mode", "path", "isGlobal", "api_default", "newName", "templates_default", "init_virtual_process_polyfill", "init_buffer", "import_exim", "Tours", "Exim", "tours", "name", "api_default", "tours_default", "lowerRegex", "AuthStoreContext", "useAuthStore", "context_v2_default", "AuthStoreType", "CurrentUser", "locations_response_default", "ServiceClient", "token", "mins", "sec", "pathname", "tabLastActive", "lastActive", "seconds", "timeoutSeconds", "result", "ReferralPortalCurrentUserRequest", "ex", "rr4_default", "runInAction", "GetCurrentUser", "id", "res", "ChangeLoggedInLocation", "security_default", "dashboard_store_default", "user", "cache", "config_default", "config", "tours_default", "tours_mobx_default", "locks_default", "dynamic_labels_default", "lookups_default", "templates_default", "locations_default", "reminder_store_default", "cache_default", "diary_view_store_default", "mode", "configDictionary", "key", "normal", "storeReset", "api_default", "err", "licensePromise", "licence_default", "host", "intercomSettings", "redirectParam", "AutoLoginRequest", "url", "skipRedirects", "isLogin", "__name", "__decorateClass", "observable", "computed", "action", "AuthStore", "auth_store_default"]
}