import { IS_LOGGED_IN_GETTER_NAME, IS_LOGGED_IN_GUEST_GETTER_NAME } from '@/config/defaults'

export default {
  [IS_LOGGED_IN_GETTER_NAME]: state => {
    return state.isLoggedIn
  },
  [IS_LOGGED_IN_GUEST_GETTER_NAME]: state => {
    return state.isLoggedInGuest
  },
  getRules: state => state.rules,
  getLoggedInUser: state => {
    return state.loggedInUser
  },
  getResetStatus: state => {
    return state.resetStatus
  },
  getResetPasswordStatus: state => {
    return state.resetPasswordStatus
  },
  getShowReset: state => {
    return state.showReset
  },
  getResetAlert: state => {
    return state.resetAlert
  },
  getEmailReset: state => {
    return state.emailReset
  },
  getResetErrorStatus: state => {
    return state.resetErrorStatus
  },
  getResetErrorMessage: state => {
    let errorMsg = state.resetErrorMessage
    let result = []
    if (errorMsg !== null) {
      Object.keys(errorMsg).forEach(x => {
        result.push(errorMsg[x][0])
      })
    }
    return result
  },
  getResetResponseData: state => {
    return state.resetResponseData
  },
  isGuestReady: state => {
    return Object.keys(state.guest).length > 0 || false
  },
  getPreferedContact: state => {
    return state.preferredContact
  },
  getIsRouteDisabled: state => {
    return state.disableRouteCheck
  },
  getVerifyContactStatus: state => state.verifyContactStatus,
  getChangePasswordStatus: state => state.changePasswordStatus,
}
