import { NgModule }                     from '@angular/core'
import { Include }                      from './inc.search'

// Router

import { SearchRouting }                    from './rte.search'

// Shared Modules
import { SharedModule }                 from '@k-core/modules/shared/mod.shared'
import { SearchPartialModule }          from '@k-core/modules/search-partial/mod.search-partial'

// Components
import { ToggleComponent }              from './components/toggle/cmp.toggle'
import { SearchResultsComponent }       from './components/results/cmp.results'

// Views
import { SearchView }                   from './template/view.search'


/**
 * Modules is un-importable, due to the fact, that the route
 * is set up as a lazyloadable route. If one is to load this, ensure that it is lazyloaded
 * and utilizes the technology for such.
 * 
 * If the module is imported, it will overrule the base route, due to the lazyloadable route,
 * and display this page instead
 * 
 * Search-partial module is created to be able to include search-input on any page, and
 * send the result to this module, allowing this to keep its lazyloadable state, while
 * still allowing a very simple module to be included for embedding search on different pages
 */
@NgModule({
    imports: [ 
        SharedModule,
        SearchPartialModule,
        SearchRouting,

        ...Include.imports
    ],
    exports: [
        ToggleComponent,
        SearchView,

        ...Include.exports
    ],
    declarations: [
        // Components
        ToggleComponent,
        SearchResultsComponent,

        // Views
        SearchView,

        
        ...Include.declarations
    ],
    providers: [
        ...Include.providers
    ]
})

export class SearchModule {}
