import Vue from 'vue'
import Router from 'vue-router'
import { beforeEachRoute } from '@/services/nav'
//const { beforeEachRoute } = nav

// Routes
import RetailorRoutes from './retailer.routes'
import GateRoutes from './gate.routes'

Vue.use(Router)

export const routes = [
...RetailorRoutes,
...GateRoutes,
]

const router = new Router({
  mode: 'history',
   base: process.env.BASE_URL || '/',
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) return savedPosition

    return { x: 0, y: 0 }
  },
  routes
})

router.beforeEach(beforeEachRoute);

export default router
