/// <reference types="@angular/localize" />

import {importProvidersFrom} from '@angular/core';
import {AppComponent} from './app/app.component';
import {NgOptimizedImage} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {NgChartsModule} from 'ng2-charts';
import {AppRoutingModule} from './app/app-routing.module';
import {bootstrapApplication, BrowserModule} from '@angular/platform-browser';
import {NiseHttpInterceptor} from './corelib/nise-http.interceptor';
import {HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import {rxStompServiceFactory} from './corelib/stomp/stomp.factory';
import {RxStompService} from './corelib/stomp/stomp.service';


bootstrapApplication(AppComponent, {
  providers: [
    importProvidersFrom(BrowserModule, AppRoutingModule, NgChartsModule, FormsModule, NgOptimizedImage),
    {
      provide: RxStompService,
      useFactory: rxStompServiceFactory,
    },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: NiseHttpInterceptor, multi: true
    },
    provideHttpClient(withInterceptorsFromDi())
  ]
})
  .catch(err => console.error(err));
