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 _f70c196c = () => interopDefault(import('..\\pages\\admin\\index.vue' /* webpackChunkName: "pages/admin/index" */))
const _647eb306 = () => interopDefault(import('..\\pages\\authenticate\\index.vue' /* webpackChunkName: "pages/authenticate/index" */))
const _085a1188 = () => interopDefault(import('..\\pages\\explore.vue' /* webpackChunkName: "pages/explore" */))
const _5c274378 = () => interopDefault(import('..\\pages\\install.vue' /* webpackChunkName: "pages/install" */))
const _1a2394c2 = () => interopDefault(import('..\\pages\\project.vue' /* webpackChunkName: "pages/project" */))
const _f804a068 = () => interopDefault(import('..\\pages\\project\\_pid\\calendar.vue' /* webpackChunkName: "pages/project/_pid/calendar" */))
const _cc627676 = () => interopDefault(import('..\\pages\\project\\_pid\\kanban.vue' /* webpackChunkName: "pages/project/_pid/kanban" */))
const _3f2e0c87 = () => interopDefault(import('..\\pages\\project\\_pid\\overview.vue' /* webpackChunkName: "pages/project/_pid/overview" */))
const _8e47139e = () => interopDefault(import('..\\pages\\project\\_pid\\settings.vue' /* webpackChunkName: "pages/project/_pid/settings" */))
const _7d146772 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\components.vue' /* webpackChunkName: "pages/project/_pid/settings/components" */))
const _15adf6f2 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\general.vue' /* webpackChunkName: "pages/project/_pid/settings/general" */))
const _6c57518a = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\import-export.vue' /* webpackChunkName: "pages/project/_pid/settings/import-export" */))
const _8eea596a = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\information.vue' /* webpackChunkName: "pages/project/_pid/settings/information" */))
const _14514438 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\members.vue' /* webpackChunkName: "pages/project/_pid/settings/members" */))
const _a51af7d6 = () => interopDefault(import('..\\pages\\project\\_pid\\settings\\teams.vue' /* webpackChunkName: "pages/project/_pid/settings/teams" */))
const _71ee77dd = () => interopDefault(import('..\\pages\\project\\_pid\\storage.vue' /* webpackChunkName: "pages/project/_pid/storage" */))
const _4f890c20 = () => interopDefault(import('..\\pages\\project\\_pid\\tasks.vue' /* webpackChunkName: "pages/project/_pid/tasks" */))
const _275ffbeb = () => interopDefault(import('..\\pages\\project\\_pid\\whiteboard.vue' /* webpackChunkName: "pages/project/_pid/whiteboard" */))
const _14c84bca = () => interopDefault(import('..\\pages\\settings.vue' /* webpackChunkName: "pages/settings" */))
const _28407c5a = () => interopDefault(import('..\\pages\\settings\\account.vue' /* webpackChunkName: "pages/settings/account" */))
const _3962e6ae = () => interopDefault(import('..\\pages\\settings\\appearance.vue' /* webpackChunkName: "pages/settings/appearance" */))
const _4037948e = () => interopDefault(import('..\\pages\\settings\\notifications.vue' /* webpackChunkName: "pages/settings/notifications" */))
const _24945702 = () => interopDefault(import('..\\pages\\admin\\users\\index.vue' /* webpackChunkName: "pages/admin/users/index" */))
const _ea2c0d96 = () => interopDefault(import('..\\pages\\authenticate\\complete.vue' /* webpackChunkName: "pages/authenticate/complete" */))
const _3476184a = () => interopDefault(import('..\\pages\\admin\\users\\_uid\\edit.vue' /* webpackChunkName: "pages/admin/users/_uid/edit" */))
const _282f88bf = () => interopDefault(import('..\\pages\\profile\\_uid\\index.vue' /* webpackChunkName: "pages/profile/_uid/index" */))
const _26769e3b = () => 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: _f70c196c,
    name: "admin"
  }, {
    path: "/authenticate",
    component: _647eb306,
    name: "authenticate"
  }, {
    path: "/explore",
    component: _085a1188,
    name: "explore"
  }, {
    path: "/install",
    component: _5c274378,
    name: "install"
  }, {
    path: "/project",
    component: _1a2394c2,
    name: "project",
    children: [{
      path: ":pid?/calendar",
      component: _f804a068,
      name: "project-pid-calendar"
    }, {
      path: ":pid?/kanban",
      component: _cc627676,
      name: "project-pid-kanban"
    }, {
      path: ":pid?/overview",
      component: _3f2e0c87,
      name: "project-pid-overview"
    }, {
      path: ":pid?/settings",
      component: _8e47139e,
      name: "project-pid-settings",
      children: [{
        path: "components",
        component: _7d146772,
        name: "project-pid-settings-components"
      }, {
        path: "general",
        component: _15adf6f2,
        name: "project-pid-settings-general"
      }, {
        path: "import-export",
        component: _6c57518a,
        name: "project-pid-settings-import-export"
      }, {
        path: "information",
        component: _8eea596a,
        name: "project-pid-settings-information"
      }, {
        path: "members",
        component: _14514438,
        name: "project-pid-settings-members"
      }, {
        path: "teams",
        component: _a51af7d6,
        name: "project-pid-settings-teams"
      }]
    }, {
      path: ":pid?/storage",
      component: _71ee77dd,
      name: "project-pid-storage"
    }, {
      path: ":pid?/tasks",
      component: _4f890c20,
      name: "project-pid-tasks"
    }, {
      path: ":pid?/whiteboard",
      component: _275ffbeb,
      name: "project-pid-whiteboard"
    }]
  }, {
    path: "/settings",
    component: _14c84bca,
    name: "settings",
    children: [{
      path: "account",
      component: _28407c5a,
      name: "settings-account"
    }, {
      path: "appearance",
      component: _3962e6ae,
      name: "settings-appearance"
    }, {
      path: "notifications",
      component: _4037948e,
      name: "settings-notifications"
    }]
  }, {
    path: "/admin/users",
    component: _24945702,
    name: "admin-users"
  }, {
    path: "/authenticate/complete",
    component: _ea2c0d96,
    name: "authenticate-complete"
  }, {
    path: "/admin/users/:uid/edit",
    component: _3476184a,
    name: "admin-users-uid-edit"
  }, {
    path: "/profile/:uid",
    component: _282f88bf,
    name: "profile-uid"
  }, {
    path: "/",
    component: _26769e3b,
    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
}
