import { NgModule, ModuleWithProviders }  		from '@angular/core'
import { CommonModule }                   		from '@angular/common'
import { RouterModule } 						from '@angular/router'
import { FormsModule, ReactiveFormsModule } 	from '@angular/forms'
import { PinchZoomModule } from 'ngx-pinch-zoom'
import { MatButtonModule, MatDialogModule, MatIconModule } from '@angular/material'


// Components
//import { GeoBarComponent }                  from '../components/layout/geo-bar/cmp.geo-bar'
//import { StorelocatorSearchComponent }      from '../../components/layout/storelocator/search/cmp.search'
import { FoldOutContainerComponent }        from './components/fold-out/container/component.fold-out-container'
import { FoldOutDescriptionComponent }      from './components/fold-out/description/component.fold-out-description'
import { FoldOutImageComponent }      		from './components/fold-out/image/component.fold-out-image'
import { UpDownComponent }                  from './components/updown/cmp.updown'
import { FormBandComponent }             	from './components/form-band/cmp.form-band'
import { DynamicFormComponent }             from './components/dynamic-form/cmp.dynamic-form'
import { FormInputComponent }               from './components/dynamic-form/form-input/cmp.form-input'
import { SliderComponent }                  from './components/slider/cmp.slider'
import { ImageComponent }                   from './components/image/cmp.image'
import { InputEditorComponent } 			from './components/inputEditor/cmp.inputEditor'
import { LinkwrapperComponent }				from './components/linkwrapper/cmp.linkwrapper'
import { AddedToCartDialogComponent }		from './components/added-to-cart-dialog/cmp.added-to-cart-dialog'

import { CategoryNavigationComponent }    	from '@k-core/modules/catalog/components/category-navigation/cmp.category-navigation'

import { ProductListElementComponent } 		from './components/product-list-element/cmp.product-list-element'
// TODO: Change this pls
import { ListProductComponent }             from '@k-core/modules/catalog/components/list-product/cmp.list-product'
import { CannotAddDialogComponent } 		from '../basket-partial/components/cannot-add-dialog/cmp.cannot-add-dialog'

// Modules
import { LazyLoadImageModule } 				from '../lazyload/lazyload-image.module'
import { StaticBlockModule }				from '../static-block/mod.static-block'



// Directives
import { InternalUrlToRouteDirective }		from '@k-directives/dir.internal-url-to-route'


import { CommonPipesModule } from '../../common/pipes/mod.pipes'
// Pipes
import { filterPhonePipe }                  from '../../pipes/pipe.filterPhone'
import { TranslatePipe }                    from '../../pipes/pipe.translate'
import { NumberFormatPipe }                 from '../../pipes/pipe.currency'
import { SafePipe }                         from '../../pipes/pipe.safe'
import { formatUrlPipe }                    from '../../pipes/pipe.formatUrl'

// Services
import { HelperService } 					from '@k-services/svc.helper'
import { PromotionService }                 from '@k-services/svc.promotions'
import { PageBlockService }                 from '@k-services/svc.pageblock'

import { ZoomedColorComponent } from './components/zoomed-color/cmp.zoomed-color'

import { LocalstorageService, SessionstorageService } from '@k-services/general/storage'


const MODULES = [
	// Do NOT include HttpModule, or JsonpModule here
	CommonModule,
	RouterModule,
	FormsModule,
	CommonPipesModule,
	LazyLoadImageModule,
	ReactiveFormsModule,
	StaticBlockModule,
	MatDialogModule,
	MatIconModule,
	MatButtonModule,
	PinchZoomModule
]

const DIRECTIVES = [
	InternalUrlToRouteDirective
]

const PIPES = [
	TranslatePipe,
	filterPhonePipe,
	NumberFormatPipe,
	SafePipe,
	formatUrlPipe
]

const COMPONENTS = [
	ImageComponent,
	//GeoBarComponent,
	//StorelocatorSearchComponent,
	FoldOutContainerComponent,
	FoldOutDescriptionComponent,
	FoldOutImageComponent,
	ListProductComponent,
	ProductListElementComponent,
	FormBandComponent,
	DynamicFormComponent,
	FormInputComponent,
	SliderComponent,
	UpDownComponent,
	InputEditorComponent,
	LinkwrapperComponent,
	CategoryNavigationComponent,
	AddedToCartDialogComponent,
	CannotAddDialogComponent,
	ZoomedColorComponent
]

const PROVIDERS = [
	PromotionService,
	HelperService,
	PageBlockService,

	LocalstorageService,
	SessionstorageService
]

const ENTRY = [
	CannotAddDialogComponent,
	AddedToCartDialogComponent,
	ZoomedColorComponent
]
@NgModule({
	entryComponents: [
		...ENTRY

	],
	imports: [
		...MODULES
	],
	declarations: [
		...DIRECTIVES,
		...PIPES,
		...COMPONENTS
	],
	exports: [
		...DIRECTIVES,
		...MODULES,
		...PIPES,
		...COMPONENTS
	],

	providers: [
		...PROVIDERS
	]
})
export class SharedModule {}
