window.Vue = require('vue');

window._ = require('lodash');

window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}


window.axios.defaults.baseUrl = 'http://localhost:8000/';

import Vue from 'vue';
import Vuetify from 'vuetify';
import iView from 'iview';
import * as VueGoogleMaps from 'vue2-google-maps';

import App from './App.vue';
import router from './route';
import store from './store';

import 'iview/dist/styles/iview.css';

Vue.use(Vuetify);
Vue.use(iView);

iView.LoadingBar.config({
    color: '#1B5E20',
    height: 3
});

Vue.use(VueGoogleMaps, {
    load: {
      key: 'AIzaSyBJWuQmrf6UgrkGbMJF6-m1GwTZrazBFBo',
      libraries: 'places', // This is required if you use the Autocomplete plugin
      // OR: libraries: 'places,drawing'
      // OR: libraries: 'places,drawing,visualization'
      // (as you require)
   
      //// If you want to set the version, you can do so:
      // v: '3.26',
    }
})

const app = new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
});
