import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { FlexLayoutModule } from '@angular/flex-layout';

import { ScrollingModule } from '@angular/cdk/scrolling';
import { ScrollingModule as ExperimentalScrollingModule } from '@angular/cdk-experimental/scrolling';

import { MatTooltipModule } from '@angular/material';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';

import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { VirtualScrollerModule } from 'ngx-virtual-scroller';

import { TranslateModule } from '@ngx-translate/core';

import { UCapUiModule } from '@ucap-webmessenger/ui';

import { FormComponent } from './components/form.component';
import { MessageBoxComponent } from './components/message-box.component';
import { MessagesComponent } from './components/messages.component';
import { SearchComponent } from './components/search.component';

import { DateSplitterComponent as MBDateSplitterComponent } from './components/message-box/date-splitter.component';
import { FileComponent as MBFileComponent } from './components/message-box/file.component';
import { AttachFileComponent as MAttachFileComponent } from './components/message-box/attach-file.component';
import { ImageComponent as MBImageComponent } from './components/message-box/image.component';
import { InformationComponent as MBInformationComponent } from './components/message-box/information.component';
import { MassTranslationComponent as MBMassTranslationComponent } from './components/message-box/mass-translation.component';
import { MassComponent as MBMassComponent } from './components/message-box/mass.component';
import { NoticeComponent as MBNoticeComponent } from './components/message-box/notice.component';
import { ReadHereComponent as MBReadHereComponent } from './components/message-box/read-here.component';
import { RecallComponent as MBRecallComponent } from './components/message-box/recall.component';
import { ScheduleComponent as MBScheduleComponent } from './components/message-box/schedule.component';
import { StickerComponent as MBStickerComponent } from './components/message-box/sticker.component';
import { TextComponent as MBTextComponent } from './components/message-box/text.component';
import { TranslationComponent as MBTranslationComponent } from './components/message-box/translation.component';
import { VideoComponent as MBVideoComponent } from './components/message-box/video.component';
import { VideoConferenceComponent as MBVideoConferenceComponent } from './components/message-box/video-conference.component';
import { AllimComponent as MBAllimComponent } from './components/message-box/allim.component';

const COMPONENTS = [
  FormComponent,
  MessagesComponent,
  MessageBoxComponent,
  SearchComponent,

  MBDateSplitterComponent,
  MBFileComponent,
  MAttachFileComponent,
  MBImageComponent,
  MBInformationComponent,
  MBMassTranslationComponent,
  MBMassComponent,
  MBNoticeComponent,
  MBReadHereComponent,
  MBRecallComponent,
  MBScheduleComponent,
  MBStickerComponent,
  MBTextComponent,
  MBTranslationComponent,
  MBVideoComponent,
  MBVideoConferenceComponent,
  MBAllimComponent
];
const SERVICES = [];
const PROVIDERS = [DatePipe];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    FlexLayoutModule,

    ScrollingModule,
    ExperimentalScrollingModule,

    MatFormFieldModule,
    MatIconModule,
    MatInputModule,
    MatButtonModule,
    MatMenuModule,
    MatTooltipModule,

    PerfectScrollbarModule,
    VirtualScrollerModule,

    TranslateModule,

    UCapUiModule
  ],
  exports: [...COMPONENTS],
  declarations: [...COMPONENTS],
  providers: [...PROVIDERS]
})
export class UCapUiChatModule {
  public static forRoot(): ModuleWithProviders<UCapUiChatModule> {
    return {
      ngModule: UCapUiChatModule,
      providers: [...SERVICES]
    };
  }
}
