import Vue from 'vue'
import Router from 'vue-router'
import { normalizeURL, decode } from 'ufo'
import { interopDefault } from './utils'
import scrollBehavior from './router.scrollBehavior.js'

const _9891f23c = () => interopDefault(import('..\\pages\\admin\\index.vue' /* webpackChunkName: "pages/admin/index" */))
const _6aa8e46e = () => interopDefault(import('..\\pages\\authenticate\\index.vue' /* webpackChunkName: "pages/authenticate/index" */))
const _7423f6b8 = () => interopDefault(import('..\\pages\\explore.vue' /* webpackChunkName: "pages/explore" */))
const _c7f128a8 = () => interopDefault(import('..\\pages\\install.vue' /* webpackChunkName: "pages/install" */))
const _3782bbac = () => interopDefault(import('..\\pages\\project.vue' /* webpackChunkName: "pages/project" */))
const _1d60ed34 = () => interopDefault(import('..\\pages\\project\\_pid\\calendar.vue' /* webpackChunkName: "pages/project/_pid/calendar" */))
const _839b87a6 = () => interopDefault(import('..\\pages\\project\\_pid\\kanban.vue' /* webpackChunkName: "pages/project/_pid/kanban" */))
const _4edd6c22 = () => interopDefault(import('..\\pages\\project\\_pid\\overview.vue' /* webpackChunkName: "pages/project/_pid/overview" */))
const _523fb399 = () => interopDefault(import('..\\pages\\project\\_pid\\settings.vue' /* webpackChunkName: "pages/project/_pid/settings" */))
const _7c202daf = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\components.vue' /* webpackChunkName: "pages/project/_pid/settings/components" */))
const _0e1f47c2 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\general.vue' /* webpackChunkName: "pages/project/_pid/settings/general" */))
const _43319cd3 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\import-export.vue' /* webpackChunkName: "pages/project/_pid/settings/import-export" */))
const _532c9ee3 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\information.vue' /* webpackChunkName: "pages/project/_pid/settings/information" */))
const _18189bd0 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\members.vue' /* webpackChunkName: "pages/project/_pid/settings/members" */))
const _29dae1ad = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\teams.vue' /* webpackChunkName: "pages/project/_pid/settings/teams" */))
const _4c0c2516 = () => interopDefault(import('..\\pages\\project\\_pid\\storage.vue' /* webpackChunkName: "pages/project/_pid/storage" */))
const _d15114f0 = () => interopDefault(import('..\\pages\\project\\_pid\\tasks.vue' /* webpackChunkName: "pages/project/_pid/tasks" */))
const _162d015a = () => interopDefault(import('..\\pages\\project\\_pid\\whiteboard.vue' /* webpackChunkName: "pages/project/_pid/whiteboard" */))
const _e3e2293c = () => interopDefault(import('..\\pages\\settings.vue' /* webpackChunkName: "pages/settings" */))
const _2a372d3b = () => interopDefault(import('..\\pages\\settings\\account.vue' /* webpackChunkName: "pages/settings/account" */))
const _0f023b74 = () => interopDefault(import('..\\pages\\settings\\appearance.vue' /* webpackChunkName: "pages/settings/appearance" */))
const _4cca5c14 = () => interopDefault(import('..\\pages\\settings\\notifications.vue' /* webpackChunkName: "pages/settings/notifications" */))
const _2abe886a = () => interopDefault(import('..\\pages\\admin\\users\\index.vue' /* webpackChunkName: "pages/admin/users/index" */))
const _1a152266 = () => interopDefault(import('..\\pages\\authenticate\\complete.vue' /* webpackChunkName: "pages/authenticate/complete" */))
const _78c96373 = () => interopDefault(import('..\\pages\\admin\\users\\_uid\\edit.vue' /* webpackChunkName: "pages/admin/users/_uid/edit" */))
const _3168f752 = () => interopDefault(import('..\\pages\\profile\\_uid\\index.vue' /* webpackChunkName: "pages/profile/_uid/index" */))
const _317434ba = () => interopDefault(import('..\\pages\\index.vue' /* webpackChunkName: "pages/index" */))

const emptyFn = () => {}

Vue.use(Router)

export const routerOptions = {
  mode: 'history',
  base: '/',
  linkActiveClass: 'nuxt-link-active',
  linkExactActiveClass: 'nuxt-link-exact-active',
  scrollBehavior,

  routes: [{
    path: "/admin",
    component: _9891f23c,
    name: "admin"
  }, {
    path: "/authenticate",
    component: _6aa8e46e,
    name: "authenticate"
  }, {
    path: "/explore",
    component: _7423f6b8,
    name: "explore"
  }, {
    path: "/install",
    component: _c7f128a8,
    name: "install"
  }, {
    path: "/project",
    component: _3782bbac,
    name: "project",
    children: [{
      path: ":pid?/calendar",
      component: _1d60ed34,
      name: "project-pid-calendar"
    }, {
      path: ":pid?/kanban",
      component: _839b87a6,
      name: "project-pid-kanban"
    }, {
      path: ":pid?/overview",
      component: _4edd6c22,
      name: "project-pid-overview"
    }, {
      path: ":pid?/settings",
      component: _523fb399,
      name: "project-pid-settings",
      children: [{
        path: "components",
        component: _7c202daf,
        name: "project-pid-settings-components"
      }, {
        path: "general",
        component: _0e1f47c2,
        name: "project-pid-settings-general"
      }, {
        path: "import-export",
        component: _43319cd3,
        name: "project-pid-settings-import-export"
      }, {
        path: "information",
        component: _532c9ee3,
        name: "project-pid-settings-information"
      }, {
        path: "members",
        component: _18189bd0,
        name: "project-pid-settings-members"
      }, {
        path: "teams",
        component: _29dae1ad,
        name: "project-pid-settings-teams"
      }]
    }, {
      path: ":pid?/storage",
      component: _4c0c2516,
      name: "project-pid-storage"
    }, {
      path: ":pid?/tasks",
      component: _d15114f0,
      name: "project-pid-tasks"
    }, {
      path: ":pid?/whiteboard",
      component: _162d015a,
      name: "project-pid-whiteboard"
    }]
  }, {
    path: "/settings",
    component: _e3e2293c,
    name: "settings",
    children: [{
      path: "account",
      component: _2a372d3b,
      name: "settings-account"
    }, {
      path: "appearance",
      component: _0f023b74,
      name: "settings-appearance"
    }, {
      path: "notifications",
      component: _4cca5c14,
      name: "settings-notifications"
    }]
  }, {
    path: "/admin/users",
    component: _2abe886a,
    name: "admin-users"
  }, {
    path: "/authenticate/complete",
    component: _1a152266,
    name: "authenticate-complete"
  }, {
    path: "/admin/users/:uid/edit",
    component: _78c96373,
    name: "admin-users-uid-edit"
  }, {
    path: "/profile/:uid",
    component: _3168f752,
    name: "profile-uid"
  }, {
    path: "/",
    component: _317434ba,
    name: "index"
  }],

  fallback: false
}

export function createRouter (ssrContext, config) {
  const base = (config._app && config._app.basePath) || routerOptions.base
  const router = new Router({ ...routerOptions, base  })

  // TODO: remove in Nuxt 3
  const originalPush = router.push
  router.push = function push (location, onComplete = emptyFn, onAbort) {
    return originalPush.call(this, location, onComplete, onAbort)
  }

  const resolve = router.resolve.bind(router)
  router.resolve = (to, current, append) => {
    if (typeof to === 'string') {
      to = normalizeURL(to)
    }
    return resolve(to, current, append)
  }

  return router
}
