/**
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var ElThemeModule_1;
import { NgModule } from '@angular/core';
import { CommonModule, DOCUMENT } from '@angular/common';
import { EL_BUILT_IN_JS_THEMES, EL_MEDIA_BREAKPOINTS, EL_THEME_OPTIONS, EL_JS_THEMES, EL_DOCUMENT, EL_WINDOW, } from './theme.options';
import { ElThemeService } from './services/theme.service';
import { ElSpinnerService } from './services/spinner.service';
import { BUILT_IN_THEMES, ElJSThemesRegistry } from './services/js-themes-registry.service';
import { DEFAULT_MEDIA_BREAKPOINTS, ElMediaBreakpointsService, } from './services/breakpoints.service';
import { ElLayoutDirectionService, ElLayoutDirection, EL_LAYOUT_DIRECTION } from './services/direction.service';
import { ElLayoutScrollService } from './services/scroll.service';
import { ElLayoutRulerService } from './services/ruler.service';
import { ElOverlayModule } from './components/cdk/overlay/overlay.module';
export function elWindowFactory() {
    return window;
}
let ElThemeModule = ElThemeModule_1 = class ElThemeModule {
    // TODO: check the options (throw exception?)
    /**
     * Main Theme Module
     *
     * @param elThemeOptions {ElThemeOptions} Main theme options
     * @param elJSThemes {ElJSThemeOptions[]} List of JS Themes, will be merged with default themes
     * @param elMediaBreakpoints {ElMediaBreakpoint} Available media breakpoints
     * @param layoutDirection {ElLayoutDirection} Layout direction
     *
     * @returns {ModuleWithProviders}
     */
    static forRoot(elThemeOptions = { name: 'default' }, elJSThemes, elMediaBreakpoints, layoutDirection) {
        return {
            ngModule: ElThemeModule_1,
            providers: [
                { provide: EL_THEME_OPTIONS, useValue: elThemeOptions || {} },
                { provide: EL_BUILT_IN_JS_THEMES, useValue: BUILT_IN_THEMES },
                { provide: EL_JS_THEMES, useValue: elJSThemes || [] },
                { provide: EL_MEDIA_BREAKPOINTS, useValue: elMediaBreakpoints || DEFAULT_MEDIA_BREAKPOINTS },
                { provide: EL_WINDOW, useFactory: elWindowFactory },
                { provide: EL_DOCUMENT, useExisting: DOCUMENT },
                ElJSThemesRegistry,
                ElThemeService,
                ElMediaBreakpointsService,
                ElSpinnerService,
                { provide: EL_LAYOUT_DIRECTION, useValue: layoutDirection || ElLayoutDirection.LTR },
                ElLayoutDirectionService,
                ElLayoutScrollService,
                ElLayoutRulerService,
                ...ElOverlayModule.forRoot().providers,
            ],
        };
    }
};
ElThemeModule = ElThemeModule_1 = __decorate([
    NgModule({
        imports: [
            CommonModule,
        ],
        exports: [],
    })
], ElThemeModule);
export { ElThemeModule };
//# sourceMappingURL=theme.module.js.map