import { NgModule } from '@angular/core';
import { Routes } from '@angular/router';
import { NativeScriptRouterModule } from '@nativescript/angular';
import { AuthGuard } from '~/core/services/auth-guard.service';
import { GenEventListPageComponent } from './containers/gen/gen-event-list-page/gen-event-list-page.component';
import { GenEventSearchModalComponent } from './components/gen/gen-event-search-modal/gen-event-search-modal.component';
import { GenEventDetailPageComponent } from './containers/gen/gen-event-detail-page/gen-event-detail-page.component';
import { GenEventNewPageComponent } from './containers/gen/gen-event-new-page/gen-event-new-page.component';
import { EduEventDetailPageComponent } from './containers/edu/edu-event-detail-page/edu-event-detail-page.component';
import { EduEventEnrollPageComponent } from './containers/edu/edu-event-enroll-page/edu-event-enroll-page.component';
import { EduEventListPageComponent } from './containers/edu/edu-event-list-page/edu-event-list-page.component';
import { EduEventCourseEnrollReminderPageComponent } from './containers/edu/edu-event-notification-page/edu-event-course-enroll-reminder-page.component';
import { EduEventSearchModalComponent } from './components/edu/edu-event-search-modal/edu-event-search-modal.component';
import { CampEventListPageComponent } from './containers/camp/camp-event-list-page/camp-event-list-page.component';
import { SortModalComponent } from './components/common/sort-modal/sort-modal.component';
import { CampEventSearchModalComponent } from './components/camp/camp-event-search-modal/camp-event-search-modal.component';
import { CongEventListPageComponent } from './containers/cong/cong-event-list-page/cong-event-list-page.component';
import { CampEventDetailPageComponent } from './containers/camp/camp-event-detail-page/camp-event-detail-page.component';
import { CongEventDetailPageComponent } from './containers/cong/cong-event-detail-page/cong-event-detail-page.component';
import { CongCandidateDetailPageComponent } from './containers/cong/cong-candidate-detail-page/cong-candidate-detail-page.component';
import { MapPickerModal } from './components/common/map-picker-modal/map-picker-modal.component';
import { CampMapModal } from './components/camp/camp-map-modal/camp-map-modal.component';
import { CongEventSearchModalComponent } from './containers/cong/cong-event-search-modal/cong-event-search-modal.component';
import { CongDecisionDetailModalComponent } from './components/cong/cong-decision-detail-modal/cong-decision-detail-modal.component';
import { EduEventImageViewComponent } from './containers/edu/edu-event-image-view/edu-event-image-view.component';
import { AddCampEventParticipantPageComponent } from './containers/camp/camp-event-add-participant-page/camp-event-add-participant-page.component';
import { CampEventParticipantUpdateModalComponent } from './components/camp/camp-participant-update-modal/camp-event-participant-update-modal.component';
import { AddGenEventParticipantPageComponent } from './containers/gen/gen-event-add-participant-page/gen-event-add-participant-page.component';
import { GenEventParticipantUpdateModalComponent } from './components/gen/gen-participant-update-modal/gen-event-participant-update-modal.component';
import { GenEventUpdateReportModalComponent } from './components/gen/gen-event-update-report-modal/gen-event-update-report-modal.component';
import { EduEventMyListPageComponent } from './containers/edu/edu-event-my-list-page/edu-event-my-list-page.component';
import { EduEventMySearchModalComponent } from './components/edu/edu-event-my-search-modal/edu-event-my-search-modal.component';
import { GenEventUpdateLeaderModal } from './containers/gen/gen-event-update-leader-modal/gen-event-update-leader-modal.component';
import { CampEventUpdateLeaderPage } from './containers/camp/camp-event-update-leader-page/camp-event-update-leader-page.component';
import { EduEventUpdateLeaderPageComponent } from './containers/edu/edu-event-update-leader-page/edu-event-update-leader-page.component';
import { EduEventUpdateInstructorPageComponent } from './containers/edu/edu-event-update-instructor-page/edu-event-update-instructor-page.component';
import { EduEventInstructorListPageComponent } from './containers/edu/edu-event-instructor-list-page/edu-event-instructor-list-page.component';
import { CampEventParticipantMutliAddPage } from './containers/camp/camp-event-participant-multiadd-page/camp-event-participant-multiadd-page.component';
import { CampEventNewPageComponent } from './containers/camp/camp-event-new-page/camp-event-new-page.component';

const routes: Routes = [
    {
        path: 'education', component: EduEventListPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "enroll-reminder", component: EduEventCourseEnrollReminderPageComponent },
            { path: "sort-menu", component: SortModalComponent },
            { path: "search-edu-event-modal", component: EduEventSearchModalComponent },
        ]
    },
    { path: 'educationDetail/:id', component: EduEventDetailPageComponent, canActivate: [AuthGuard] },
    { path: 'educationDetail/:id/:section', component: EduEventDetailPageComponent, canActivate: [AuthGuard] },
    { path: 'educationCourseEnroll/:eventId/:courseId', component: EduEventEnrollPageComponent, canActivate: [AuthGuard] },
    { path: "educationUpdateFunctions/:id", component: EduEventUpdateLeaderPageComponent, canActivate: [AuthGuard] },
    { path: "educationUpdateInstructor/:id", component: EduEventUpdateInstructorPageComponent, canActivate: [AuthGuard] },
    { path: "educationUpdateInstructor/:id/:instructorId", component: EduEventUpdateInstructorPageComponent, canActivate: [AuthGuard] },
    { path: "educationInstructors/:id", component: EduEventInstructorListPageComponent, canActivate: [AuthGuard] },
    {
        path: 'myEducation', component: EduEventMyListPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "search-edu-my-event-modal", component: EduEventMySearchModalComponent },
        ]
    },
    {
        path: 'general', component: GenEventListPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "sort-gen-event-menu", component: SortModalComponent },
            { path: "search-gen-event-modal", component: GenEventSearchModalComponent },
        ]
    },

    { path: 'generalDetail/:id', component: GenEventDetailPageComponent, canActivate: [AuthGuard], },
    {
        path: 'generalDetail/:id/:section', component: GenEventDetailPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "gen-participant-update-modal", component: GenEventParticipantUpdateModalComponent },
            { path: "gen-report-update-modal", component: GenEventUpdateReportModalComponent },
            { path: "gen-team-update-modal", component: GenEventUpdateLeaderModal },
        ]
    },
    {
        path: 'generalNew', component: GenEventNewPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "map-picker", component: MapPickerModal },
        ]
    },
    {
        path: 'campNew', component: CampEventNewPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "map-picker", component: MapPickerModal },
        ]
    },
    { path: 'campUpdate/:id', component: CampEventNewPageComponent, canActivate: [AuthGuard] },
    { path: 'generalUpdate/:id', component: GenEventNewPageComponent, canActivate: [AuthGuard] },
    {
        path: 'camp', component: CampEventListPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "sort-camp-event-menu", component: SortModalComponent },
            { path: "search-camp-event-modal", component: CampEventSearchModalComponent },
            { path: "camp-map-modal", component: CampMapModal },
        ]
    },
    { path: 'campDetail/:id', component: CampEventDetailPageComponent, canActivate: [AuthGuard] },
    {
        path: 'campDetail/:id/:section', component: CampEventDetailPageComponent, canActivate: [AuthGuard],
        children: [
            { path: "participant-update-modal", component: CampEventParticipantUpdateModalComponent },
        ]
    },
    { path: "campUpdateFunctions/:id", component: CampEventUpdateLeaderPage, canActivate: [AuthGuard] },
    { path: "campPersonMultiAdd/:id", component: CampEventParticipantMutliAddPage, canActivate: [AuthGuard] },
    { path: 'addCampParticipant/:id', component: AddCampEventParticipantPageComponent, canActivate: [AuthGuard] },
    { path: 'addGeneralParticipant/:id', component: AddGenEventParticipantPageComponent, canActivate: [AuthGuard] },
    {
        path: 'congress', component: CongEventListPageComponent, canActivate: [AuthGuard]
        , children: [
            { path: "sort-cong-event-menu", component: SortModalComponent },
            { path: "search-cong-event-modal", component: CongEventSearchModalComponent },
            { path: "cong-decision-detail", component: CongDecisionDetailModalComponent },
        ]
    },
    { path: 'congressDetail/:id/:section', component: CongEventDetailPageComponent, canActivate: [AuthGuard] },
    { path: 'congressDetail/:id', component: CongEventDetailPageComponent, canActivate: [AuthGuard], },
    { path: 'congressCandidate/:id', component: CongCandidateDetailPageComponent, canActivate: [AuthGuard] },
    { path: 'image/:id/:title', component: EduEventImageViewComponent, canActivate: [AuthGuard] },

];

@NgModule({
    imports: [NativeScriptRouterModule.forChild(routes)],
    exports: [NativeScriptRouterModule]
})
export class EventRoutingModule {
}
