import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';

import { AppComponent } from './app.component';
import { routing } from './app.routing';
import { AuthGuard } from './_guards/index';
import { JwtInterceptor } from './_helpers/index';

// Directives
import { AlertComponent, SelectCodeComponent, LoadingComponent } from './_directives/index';

// Services
import { AlertService, AuthenticationService, UserService, HomeService, StatsService, QuotesService } from './_services/index';

// Pages
import { AdminComponent } from './admin/index';
import { HomeComponent } from './home/index';
import { LoginComponent } from './login/index';
import { NegocioComponent } from './negocio/negocio.component';
import { NewUserComponent } from './new-user/new-user.component';
import { EditUserComponent } from './edit-user/edit-user.component';
import { PricesComponent } from './prices/prices.component';

// Core components
import { ContentComponent } from './core/content/content.component';
import { FooterComponent } from './core/footer/footer.component';
import { HeaderComponent, MegaMenuComponent } from './core/header/header';
import { SidebarComponent } from './core/sidebar/sidebar.component';
import { SidebarTwoComponent } from './core/sidebar-two/sidebar-two.component';
import { TopMenuComponent } from './core/top-menu/top-menu.component';
import { NotFoundComponent } from './core/not-found/not-found.component';
import { BaseComponent } from './base/base.component';

// Common components
import { PaginatorModule, DataTableModule, EditorModule, InputMaskModule, ChartModule, CalendarModule, TabMenuModule} from 'primeng/primeng';
import { AngularFontAwesomeModule } from 'angular-font-awesome';
import { NguiMapModule } from '@ngui/map';
import { QuoteDetailComponent } from './quote-detail/quote-detail.component';
import { SellerQuotesComponent } from './seller-quotes/seller-quotes.component';
import { SellerQuotesDetailComponent } from './seller-quotes-detail/seller-quotes-detail.component';

@NgModule({
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        FormsModule,
        ReactiveFormsModule,
        HttpClientModule,
        routing,
        PaginatorModule,
        DataTableModule,
        EditorModule,
        InputMaskModule,
        ChartModule,
        CalendarModule,
        TabMenuModule,
        AngularFontAwesomeModule,
        NguiMapModule.forRoot({apiUrl: 'https://maps.google.com/maps/api/js?key=AIzaSyBgrQJUjMwerGb7zOQssZMtmSAfvfWdR18&libraries=places'})
    ],
    declarations: [
        AppComponent,
        AlertComponent,
        SelectCodeComponent,
        LoadingComponent,
        ContentComponent,
        FooterComponent,
        HeaderComponent,
        MegaMenuComponent,
        SidebarComponent,
        SidebarTwoComponent,
        TopMenuComponent,
        NotFoundComponent,
        BaseComponent,
        BaseComponent,
        LoginComponent,
        AdminComponent,
        HomeComponent,
        NegocioComponent,
        NewUserComponent,
        EditUserComponent,
        PricesComponent,
        QuoteDetailComponent,
        SellerQuotesComponent,
        SellerQuotesDetailComponent
    ],
    providers: [
        AuthGuard,
        AlertService,
        HomeService,
        AuthenticationService,
        UserService,
        StatsService,
        QuotesService,
        {
            provide: HTTP_INTERCEPTORS,
            useClass: JwtInterceptor,
            multi: true
        }
    ],
    bootstrap: [AppComponent]
})

export class AppModule { }
