// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'

import Vuex from 'vuex'
import 'es6-promise/auto' //Vuex likes promises
import store from './stores/mainStore';

import App from './App'
import router from './router'

require('./assets/semantic-min.css')
require('./assets/semantic-helper.css')
// Fonts 
require('./assets/roboto-latin.woff2')
require('./assets/roboto-latin-bold.woff2')

require('./assets/themes/default/assets/fonts/icons.eot')
require('./assets/themes/default/assets/fonts/icons.otf')
require('./assets/themes/default/assets/fonts/icons.svg')
require('./assets/themes/default/assets/fonts/icons.ttf')
require('./assets/themes/default/assets/fonts/icons.woff')
require('./assets/themes/default/assets/fonts/icons.woff2')

require('./assets/themes/default/assets/fonts/outline-icons.eot')
require('./assets/themes/default/assets/fonts/outline-icons.svg')
require('./assets/themes/default/assets/fonts/outline-icons.ttf')
require('./assets/themes/default/assets/fonts/outline-icons.woff')
require('./assets/themes/default/assets/fonts/outline-icons.woff2')

require('./assets/squire.js')

//Import socket io, init using nginx configured socket path
import io from 'socket.io-client';
const socket = io({ path:'/socket' });

//integrate connected socket into vue instance
Object.defineProperties(Vue.prototype, {
	$io: {
		get: () => socket
	}
})



// This callback runs before every route change, including on page load.
// Sets the title of the page using vue router
router.beforeEach((to, from, next) => {
	document.title = to.meta.title;
	next();
});

//Attach event bus to main vue object, all components will inherit event bus
import EventBus from './EventBus'
import Helpers from './Helpers'

Vue.use(Vuex)
Vue.config.productionTip = false


new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})