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 _5a0da5ee = () => interopDefault(import('../pages/about.vue' /* webpackChunkName: "pages/about" */))
const _c8db08aa = () => interopDefault(import('../pages/Admin.vue' /* webpackChunkName: "pages/Admin" */))
const _770c6145 = () => interopDefault(import('../pages/Authorize.vue' /* webpackChunkName: "pages/Authorize" */))
const _45ff9368 = () => interopDefault(import('../pages/export.vue' /* webpackChunkName: "pages/export" */))
const _33cacac5 = () => interopDefault(import('../pages/Login.vue' /* webpackChunkName: "pages/Login" */))
const _4b18c812 = () => interopDefault(import('../pages/Register.vue' /* webpackChunkName: "pages/Register" */))
const _564c1557 = () => interopDefault(import('../pages/settings.vue' /* webpackChunkName: "pages/settings" */))
const _28f26cac = () => interopDefault(import('../pages/add/DateInput.vue' /* webpackChunkName: "pages/add/DateInput" */))
const _0de96034 = () => interopDefault(import('../pages/add/HourInput.vue' /* webpackChunkName: "pages/add/HourInput" */))
const _8f302d62 = () => interopDefault(import('../pages/add/ImportDialog.vue' /* webpackChunkName: "pages/add/ImportDialog" */))
const _a2629f70 = () => interopDefault(import('../pages/add/MediaInput.vue' /* webpackChunkName: "pages/add/MediaInput" */))
const _61e356a5 = () => interopDefault(import('../pages/add/WhereInput.vue' /* webpackChunkName: "pages/add/WhereInput" */))
const _195b1870 = () => interopDefault(import('../pages/embed/list.vue' /* webpackChunkName: "pages/embed/list" */))
const _f154ccec = () => interopDefault(import('../pages/event/embedEvent.vue' /* webpackChunkName: "pages/event/embedEvent" */))
const _fdd565c4 = () => interopDefault(import('../pages/event/eventAdmin.vue' /* webpackChunkName: "pages/event/eventAdmin" */))
const _789dd395 = () => interopDefault(import('../pages/setup/Completed.vue' /* webpackChunkName: "pages/setup/Completed" */))
const _3da77b10 = () => interopDefault(import('../pages/setup/DbStep.vue' /* webpackChunkName: "pages/setup/DbStep" */))
const _62977877 = () => interopDefault(import('../pages/add/_edit.vue' /* webpackChunkName: "pages/add/_edit" */))
const _7dd19ea6 = () => interopDefault(import('../pages/announcement/_id.vue' /* webpackChunkName: "pages/announcement/_id" */))
const _51166df6 = () => interopDefault(import('../pages/embed/_event_id.vue' /* webpackChunkName: "pages/embed/_event_id" */))
const _3ecdeb5e = () => interopDefault(import('../pages/event/_slug.vue' /* webpackChunkName: "pages/event/_slug" */))
const _3d8699dd = () => interopDefault(import('../pages/recover/_code.vue' /* webpackChunkName: "pages/recover/_code" */))
const _26e68b07 = () => interopDefault(import('../pages/setup/_db.vue' /* webpackChunkName: "pages/setup/_db" */))
const _fee2b706 = () => interopDefault(import('../pages/user_confirm/_code.vue' /* webpackChunkName: "pages/user_confirm/_code" */))
const _1a9df064 = () => 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: "/about",
    component: _5a0da5ee,
    name: "about"
  }, {
    path: "/Admin",
    component: _c8db08aa,
    name: "Admin"
  }, {
    path: "/Authorize",
    component: _770c6145,
    name: "Authorize"
  }, {
    path: "/export",
    component: _45ff9368,
    name: "export"
  }, {
    path: "/Login",
    component: _33cacac5,
    name: "Login"
  }, {
    path: "/Register",
    component: _4b18c812,
    name: "Register"
  }, {
    path: "/settings",
    component: _564c1557,
    name: "settings"
  }, {
    path: "/add/DateInput",
    component: _28f26cac,
    name: "add-DateInput"
  }, {
    path: "/add/HourInput",
    component: _0de96034,
    name: "add-HourInput"
  }, {
    path: "/add/ImportDialog",
    component: _8f302d62,
    name: "add-ImportDialog"
  }, {
    path: "/add/MediaInput",
    component: _a2629f70,
    name: "add-MediaInput"
  }, {
    path: "/add/WhereInput",
    component: _61e356a5,
    name: "add-WhereInput"
  }, {
    path: "/embed/list",
    component: _195b1870,
    name: "embed-list"
  }, {
    path: "/event/embedEvent",
    component: _f154ccec,
    name: "event-embedEvent"
  }, {
    path: "/event/eventAdmin",
    component: _fdd565c4,
    name: "event-eventAdmin"
  }, {
    path: "/setup/Completed",
    component: _789dd395,
    name: "setup-Completed"
  }, {
    path: "/setup/DbStep",
    component: _3da77b10,
    name: "setup-DbStep"
  }, {
    path: "/add/:edit?",
    component: _62977877,
    name: "add-edit"
  }, {
    path: "/announcement/:id?",
    component: _7dd19ea6,
    name: "announcement-id"
  }, {
    path: "/embed/:event_id?",
    component: _51166df6,
    name: "embed-event_id"
  }, {
    path: "/event/:slug?",
    component: _3ecdeb5e,
    name: "event-slug"
  }, {
    path: "/recover/:code?",
    component: _3d8699dd,
    name: "recover-code"
  }, {
    path: "/setup/:db?",
    component: _26e68b07,
    name: "setup-db"
  }, {
    path: "/user_confirm/:code?",
    component: _fee2b706,
    name: "user_confirm-code"
  }, {
    path: "/",
    component: _1a9df064,
    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
}
