import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {PartialsModule} from '../../partials/partials.module';
import {CoreModule} from '../../../core/core.module';
import {RouterModule} from '@angular/router';
import {
	MAT_DIALOG_DEFAULT_OPTIONS,
	MatAutocompleteModule,
	MatButtonModule,
	MatCardModule,
	MatCheckboxModule,
	MatDatepickerModule,
	MatDialogModule,
	MatExpansionModule,
	MatFormFieldModule,
	MatIconModule,
	MatInputModule,
	MatMenuModule,
	MatNativeDateModule,
	MatPaginatorModule,
	MatProgressBarModule,
	MatProgressSpinnerModule,
	MatRadioModule,
	MatSelectModule,
	MatSnackBarModule,
	MatSortModule,
	MatTableModule,
	MatTabsModule,
	MatTooltipModule
} from '@angular/material';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {NgxPermissionsModule} from 'ngx-permissions';
import {HttpUtilsService, InterceptService, LayoutUtilsService, TypesUtilsService} from '../../../core/_base/crud';
import {HTTP_INTERCEPTORS} from '@angular/common/http';
import {ActionNotificationComponent, DeleteEntityDialogComponent} from '../../partials/content/crud';
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
import {CalendarioComponent} from "./calendario/calendario.component";
import {PorOperadorComponent} from "./por-operador/por-operador.component";
import {TimelineComponent} from "./timeline/timeline.component";
import {AgendaMedicaComponent} from "./agenda-medica/agenda-medica.component";
import {CalendarCommonModule, CalendarModule, DateAdapter} from "angular-calendar";
import {adapterFactory} from "angular-calendar/date-adapters/date-fns";

@NgModule({
	declarations: [CalendarioComponent, PorOperadorComponent, TimelineComponent, AgendaMedicaComponent],
	imports: [
		CommonModule,
		PartialsModule,
		CoreModule,
		RouterModule.forChild([
			{
				path: '',
				component: CalendarioComponent
			}
		]),
		CalendarModule.forRoot({provide: DateAdapter, useFactory: adapterFactory}),
		MatButtonModule,
		MatTooltipModule,
		MatFormFieldModule,
		MatInputModule,
		MatIconModule,
		MatTableModule,
		MatMenuModule,
		MatCheckboxModule,
		MatSortModule,
		MatProgressSpinnerModule,
		MatPaginatorModule,
		FormsModule,
		ReactiveFormsModule,
		MatAutocompleteModule,
		MatRadioModule,
		MatNativeDateModule,
		MatProgressBarModule,
		MatDatepickerModule,
		MatCardModule,
		MatSnackBarModule,
		MatExpansionModule,
		MatTabsModule,
		MatDialogModule,
		NgxPermissionsModule,
		MatSelectModule,
		NgxMatSelectSearchModule,
		CalendarCommonModule,
		CalendarModule
	],
	providers: [
		InterceptService,
		{
			provide: HTTP_INTERCEPTORS,
			useClass: InterceptService,
			multi: true
		},
		{
			provide: MAT_DIALOG_DEFAULT_OPTIONS,
			useValue: {
				hasBackdrop: true,
				panelClass: 'kt-mat-dialog-container__wrapper',
				height: 'auto',
				width: '900px'
			}
		},
		HttpUtilsService,
		TypesUtilsService,
		LayoutUtilsService,
	],
	entryComponents: [
		DeleteEntityDialogComponent,
		ActionNotificationComponent,
	]
})

export class AgendaModule {
}
