import Vuex from 'vuex'
import vuexI18n from 'vuex-i18n'
import VueAuth from '@websanova/vue-auth'
import BootstrapVue from 'bootstrap-vue'
import VueProgressBar from 'vue-progressbar'
import Vuemerang from 'vuemerang'

import Locales from '@/lang/vue-i18n-locales.generated'

export default function configStore(Vue, storeMock) {
  Vue.use(Vuex)

  const store = new Vuex.Store(storeMock)
  const options = {
    color: '#6c4197',
    failedColor: 'rgb(242, 19, 93)',
    thickness: '2px',
    transition: {
      speed: '1.5s',
      opacity: '0.6s',
      termination: 300
    },
    autoRevert: true,
    location: 'top',
    inverse: false
  }

  Vue.use(vuexI18n.plugin, store)
  Vue.use(BootstrapVue)
  Vue.use(Vuemerang)
  Vue.use(VueProgressBar, options)

  Vue.i18n.add('en', Locales.en)
  Vue.i18n.add('es', Locales.es)

  Vue.i18n.set('es')

  return store
}
