import type { IListRoutes, ISites } from '@src/model'
import { only } from 'node:test'

function getRoutesAd(site: ISites) {

  const routes_admin: IListRoutes[] = [
    {
      active: true,
      order: 10,
      path: '/admin/sites',
      materialIcon: 'event_seat',
      name: 'pages.Sites',
      component: () => import('@src/rootgen/admin/sites/sites.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1000,
      path: '/admin/cfgserv',
      materialIcon: 'event_seat',
      name: 'pages.Admin',
      component: () => import('@src/views/admin/cfgServer/cfgServer.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1020,
      path: '/admin/dbop',
      materialIcon: 'event_seat',
      name: 'pages.dbop',
      component: () => import('@src/views/admin/dbop/dbop.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1020,
      path: '/admin/dbopmacro',
      materialIcon: 'event_seat',
      name: 'pages.dbopmacro',
      component: () => import('@src/views/admin/dbopmacro/dbopmacro.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1020,
      path: '/admin/server',
      materialIcon: 'event_seat',
      name: 'otherpages.server',
      component: () => import('@src/views/admin/server/server.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1040,
      path: '/admin/importfile',
      materialIcon: 'event_seat',
      name: 'otherpages.manage.importfile',
      component: () => import('@src/rootgen/admin/importdata/importdata.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 1040,
      path: '/admin/convertPDF',
      materialIcon: 'event_seat',
      name: 'otherpages.manage.convertPDF',
      component: () => import('@src/rootgen/admin/convertPDF/convertPDF.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true
    },
  ]



  const routes_newsletter: IListRoutes[] = [
    {
      active: true,
      order: 10,
      name: 'newsletter.template', path: '/admin/newsletter/templemail', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 10,
      name: 'newsletter.destnewsletter', path: '/admin/newsletter/destnewsletter', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 20,
      name: 'newsletter.sendemail', path: '/admin/newsletter/newnewsletter', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 30,
      name: 'newsletter.check', path: '/admin/newsletter/check', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 40,
      name: 'newsletter.sent', path: '/admin/newsletter/newslist', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 50,
      name: 'newsletter.mailinglist', path: '/admin/newsletter/mailinglist', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 60,
      name: 'newsletter.settings', path: '/admin/newsletter/settings', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 70,
      name: 'newsletter.serversettings', path: '/admin/newsletter/main_settings', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    },
    {
      active: true,
      order: 80,
      name: 'newsletter.others', path: '/admin/newsletter/events', materialIcon: 'fas fa-users',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: true, submenu: true, level_parent: 0.5, level_child: 0.5, onlyManager: true, noroute: true
    }
  ]

  const routes_ris: IListRoutes[] = [
    {
      active: true,
      order: 10,
      path: '/admin/ris/circuitslist',
      materialIcon: 'fas fa-coins',
      name: 'otherpages.admin.circuitslist',
      component: () => import('@src/rootgen/admin/circuitsList/circuitsList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0.5,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },
    {
      active: true,
      order: 20,
      path: '/admin/ris/accountslist',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.accountslist',
      component: () => import('@src/rootgen/admin/accountsList/accountsList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0.5,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },
    {
      active: true,
      order: 30,
      path: '/admin/ris/movslist',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.movslist',
      component: () => import('@src/rootgen/admin/movsList/movsList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0.5,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },
  ]


  const routes_manager: IListRoutes[] = [
    {
      active: site.confpages && site.confpages?.bookingEvents,
      order: 70,
      path: '/admin/usereventlist',
      materialIcon: 'edit',
      name: 'otherpages.admin.usereventlist',
      component: () => import('@src/rootgen/admin/eventlist/eventlist.vue'),
      inmenu: site.confpages && site.confpages.bookingEvents,
      submenu: site.confpages && site.confpages.bookingEvents,
      level_parent: 0,
      level_child: 0.5,
      infooter: false,
      onlyManager: true,
      onlyConsiglio: true,
      onlyAdmin: true
    },
    {
      active: true,
      order: 10,
      path: '/admin/userlist',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.userlist',
      component: () => import('@src/rootgen/admin/usersList/usersList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },
    {
      active: true,
      order: 10,
      path: '/admin/userpanel',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.userpanel',
      component: () => import('@src/rootgen/admin/userPanel/userPanel.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },
    /*
    {
      active: true,
      order: 10,
      path: '/admin/iscritticonacreis',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.iscritticonacreis',
      component: () => import('@src/rootgen/admin/iscritticonacreis/iscritticonacreis.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: true
    },

     */
    {
      active: site.confpages?.showMenuCoins,
      path: '/admin/ris',
      order: 60,
      faIcon: 'fa fa-list-alt',
      materialIcon: 'fas fa-coins',
      name: 'otherpages.admin.monete',
      routes2: routes_ris,
      inmenu: false,
      submenu: true,
      level_parent: 0.5,
      level_child: 0.5,
      solotitle: true,
      onlyAdmin: true,
      onlyManager: true
    },
    /*{
      active: false,
      order: 10,
      path: '/admin/zoomlist',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.zoomlist',
      component: () => import('@src/rootgen/admin/zoomList/zoomList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyFacilitatore: false
    },*/
    {
      active: true,
      order: 27,
      path: '/admin/tableslist',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.tableslist',
      component: () => import('@src/rootgen/admin/tablesList/tablesList.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
      onlyManager: true
    },
    {
      active: true,
      order: 30,
      path: '/admin/pages',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.pages',
      component: () => import('@src/rootgen/admin/pages/pages.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyEditor: true
    },
    {
      active: true,
      order: 32,
      path: '/admin/home',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.elems',
      component: () => import('@src/rootgen/admin/editElems/editElems.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
    },
    {
      active: true,
      order: 32,
      path: '/admin/lista_crons',
      materialIcon: 'fas fa-clock',
      name: 'otherpages.admin.lista_cron',
      component: () => import('@src/rootgen/admin/lista_cron/lista_cron.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
    },
    {
      active: true,
      order: 30,
      path: '/admin/bot',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.bot',
      component: () => import('@src/rootgen/admin/bot/bot.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
    },
    {
      active: true,
      order: 30,
      path: '/admin/confsite',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.confsite',
      component: () => import('@src/rootgen/admin/confsite/confsite.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyManager: true,
      onlyEditor: false
    },
    {
      active: site.confpages && site.confpages?.sendNewsletter,
      path: '/admin/newsletter',
      order: 60,
      faIcon: 'fa fa-list-alt',
      materialIcon: 'fas fa-users',
      name: 'otherpages.admin.newsletter',
      routes2: routes_newsletter,
      inmenu: false,
      submenu: true,
      level_parent: 0.5,
      level_child: 0.5,
      solotitle: true,
      onlyAdmin: true,
      onlyManager: true
    },
    {
      active: true,
      order: 35,
      path: '/admin/msg_template',
      materialIcon: 'fas fa-file-alt',
      name: 'msgs.messages',
      component: () => import('@src/rootgen/admin/msg_template/msg_template.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
      onlyManager: true
      // onlyFacilitatore: true
    },
    {
      active: true,
      order: 1030,
      path: '/admin/sendpushnotif',
      materialIcon: 'event_seat',
      name: 'otherpages.manage.sendpushnotif',
      component: () => import('@src/rootgen/admin/sendpushnotif/sendpushnotif.vue'),
      level_parent: 0.0,
      level_child: 0.5,
      inmenu: true,
      submenu: true,
      onlyAdmin: true,
      onlyManager: true,
    },
    {
      active: true,
      order: 40,
      path: '/admin/gallery',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.gallery',
      component: () => import('@src/rootgen/admin/gallery/gallery.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
      onlyManager: true
    },
    {
      active: false,
      order: 50,
      path: '/admin/media',
      materialIcon: 'fas fa-file-alt',
      name: 'otherpages.admin.media',
      component: () => import('@src/rootgen/admin/uploader/uploader.vue'),
      inmenu: true,
      submenu: true,
      level_parent: 0,
      level_child: 0.5,
      onlyAdmin: true,
      onlyManager: true
    },
  ]

  const menuAdmins = [
    {
      active: true,
      order: 135,
      path: '/my/:username',
      materialIcon: 'fas fa-user',
      name: 'pages.profile2',
      component: () => import('@src/views/user/myprofile/myprofile.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 140,
      path: '/skills/:username',
      materialIcon: 'fas fa-user',
      name: 'otherpages.myactivities',
      component: () => import('@src/views/user/myactivities/myactivities.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 145,
      path: '/attivita/:username',
      materialIcon: 'fas fa-user',
      name: 'mypages.attivita',
      component: () => import('@src/views/user/myprofile/myprofile.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },

    {
      active: true,
      order: 200,
      path: '/notifs',
      materialIcon: 'fas fa-user',
      name: 'pages.notifs',
      component: () => import('@src/views/user/usernotifs/usernotifs.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 200,
      path: '/unsubscribe',
      materialIcon: 'fas fa-envelope',
      name: 'pages.unsubscribe',
      component: () => import('@src/views/email/unsubscribe/unsubscribe.vue'),
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 200,
      path: '/unsubscribe_user',
      materialIcon: 'fas fa-envelope',
      name: 'pages.unsubscribe_user',
      component: () => import('@src/views/unsubscribe_user/unsubscribe_user.vue'),
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 15,
      path: '/provapao',
      materialIcon: 'fas fa-house-user',
      name: 'mypages.provapao',
      component: () => import('@src/root/provapao/provapao.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 400,
      path: '/testlocal',
      materialIcon: 'fas fa-test',
      name: 'mypages.TestLocal',
      component: () => import('@src/views/test/test.vue'),
      meta: { requiresAuth: true },
      inmenu: false,
      infooter: false,
    },
    {
      active: true,
      order: 2000,
      path: '/admin',
      materialIcon: 'fas fa-user-shield',
      name: 'otherpages.admin.menu',
      inmenu: true,
      routes2: routes_admin,
      solotitle: true,
      infooter: false,
      onlyAdmin: true
    },
    ...routes_admin,
    {
      active: true,
      order: 2110,
      path: '/manage',
      materialIcon: 'fas fa-users-cog',
      name: 'otherpages.manage.menu',
      inmenu: true,
      routes2: routes_manager,
      solotitle: true,
      infooter: false,
      onlyAdmin: true,
      onlyManager: true,
      onlyFacilitatore: true,
      onlyEditor: false
    },
    ...routes_manager,

    {
      active: true,
      order: 2000,
      path: '/policy',
      materialIcon: 'fas fa-user',
      name: 'pages.policy',
      component: () => import('@src/root/policy/policy.vue'),
      inmenu: false,
      infooter: true
    },
    /*{
      active: site.confpages && site.confpages.enableRegByBot,
      order: 1000,
      path: '/bot',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUpBot',
      inmenu: site.confpages && site.confpages.enableRegByBot,
      infooter: site.confpages && site.confpages.enableRegByBot,
      separator: false
    },*/
    {
      active: site.confpages && site.confpages?.enableReg && (!site.confpages?.enabledRegNeedTelegram || site.confpages?.enableRegMultiChoice),
      order: 1000,
      path: '/signup',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp5',
      component: () => import('@src/views/login/signup_noteleg/signup_noteleg.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: site.confpages && site.confpages?.enableReg && (!site.confpages?.enabledRegNeedTelegram || site.confpages?.enableRegMultiChoice),
      order: 1002,
      path: '/registrati',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp7',
      component: () => import('@src/views/login/signup_noteleg/signup_noteleg.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: true,
      order: 1001,
      path: '/signup/:invited',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp2',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: true,
      order: 1002,
      path: '/registrati/:invited',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp6',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: true,
      order: 1001,
      path: '/signup/:invited/:regexpire',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp3',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: true,
      order: 1002,
      path: '/signup_collettivo/:invited/:username_default/:name_default',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUpCollettivo',
      component: () => import('@src/views/login/signup_collettivo/signup_collettivo.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: true,
      order: 1003,
      path: '/signup_collettivo',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUpCollettivo2',
      component: () => import('@src/views/login/signup_collettivo/signup_collettivo.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: site.confpages && site.confpages.enableReg && site.confpages.enabledRegNeedTelegram,
      order: 1000,
      path: '/signup/:invited/:usernameteleg/:idteleg/:regexpire',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: site.confpages && site.confpages.enableReg && site.confpages.enabledRegNeedTelegram,
      order: 1000,
      path: '/registrati/:invited/:usernameteleg/:idteleg/:regexpire',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp11',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: site.confpages && site.confpages.enableReg && site.confpages.enabledRegNeedTelegram,
      order: 1000,
      path: '/registrati/:invited/:usernameteleg/:idteleg',
      materialIcon: 'how_to_reg',
      name: 'pages.SignUp4',
      component: () => import('@src/views/login/signup/signup.vue'),
      inmenu: false,
      infooter: false,
      separator: false
    },
    {
      active: site.confpages && site.confpages.enableReg,
      order: 2000,
      path: '/regok',
      materialIcon: 'how_to_reg',
      name: 'pages.regok',
      component: () => import('@src/views/login/regok/regok.vue'),
      inmenu: false,
      infooter: false,
      separator: false,
    },
    {
      active: true,
      order: 1000,
      path: '/signin',
      materialIcon: 'account_circle',
      name: 'pages.SignIn',
      component: () => import('@src/views/login/signin_noreg/signin_noreg.vue'),
      inmenu: false,
      infooter: true
    },
    // --- NOT IN MENU: ---
    {
      active: true,
      order: 1000,
      path: '/vreg',
      name: 'pages.vreg',
      component: () => import('@src/views/login/vreg/vreg.vue')
    },
    {
      active: true,
      order: 1000,
      path: '/requestresetpwd',
      name: 'pages.requestresetpwd',
      component: () => import('@src/views/requestresetpwd/requestresetpwd.vue')
    },
    {
      active: true,
      order: 1000,
      path: '/updatepassword',
      name: 'pages.updatepassword',
      component: () => import('@src/views/updatepassword/updatepassword.vue')
    },
    {
      active: true,
      order: 1000,
      path: '/offline',
      name: 'Offline',
      component: () => import('@src/views/offline/offline.vue')
    },
    {
      active: true,
      path: '/separator',
      name: 'separator',
      order: 35,
      isseparator: true,
      inmenu: true,
    },
    /*{
      active: true,
      order: 80,
      path: '/calendario-eventi',
      materialIcon: 'event',
      name: 'ris.calendario_eventi_riso',
      component: () => import('@src/root/calendarioeventi/calendarioeventi.vue'),
      extraclass: 'isCalendar',
      inmenu: true,
      infooter: true
    },

     */
    {
      active: true,
      order: 1000,
      path: '/admin/newsletter/:idparam',
      materialIcon: 'event',
      name: 'pages.newsletter.menu',
      component: () => import('@src/rootgen/admin/newsletter/newsletter.vue'),
      inmenu: false,
      infooter: false,
      onlyAdmin: true
    },
    {
      active: true,
      order: 90,
      path: '/event/:typol/:eventid',
      materialIcon: 'event',
      name: 'pages.evento',
      component: () => import('@src/root/evento/evento.vue'),
      inmenu: false,
      infooter: false
    },
    {
      active: true,
      order: 110,
      path: '/event/:typol',
      materialIcon: 'event',
      name: 'pages.eventodef',
      component: () => import('@src/root/evento/evento.vue'),
      inmenu: false,
      infooter: false
    },
  ]

  return menuAdmins
}


export const routesAdmin = {
  routesAd: getRoutesAd,
}
