import { Component, ContentChildren, HostBinding, input } from '@angular/core';
import { NavigationStart } from '@angular/router';
import { filter, startWith } from 'rxjs/operators';
import { NavbarLinksComponent } from './navbar-links.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@angular/material/toolbar";
/**
 * Component to display a navbar
 */
export class NavbarComponent {
    constructor(router) {
        this.router = router;
        /**
         * Color 'white' or 'primary' (default value is primary)
         */
        this.color = input('primary');
        /**
         * Navbar mode (default value is large)
         */
        this.mode = input('large');
        this.class = 'mic-navbar';
    }
    ngAfterContentInit() {
        this.router.events
            .pipe(startWith({ url: this.router.url }), filter((event) => event instanceof NavigationStart))
            .subscribe((event) => {
            this.links.forEach((links) => {
                links.active.set(event.url);
                links.color.set(this.color());
            });
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NavbarComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.1.0", type: NavbarComponent, selector: "mic-navbar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.class" } }, queries: [{ propertyName: "links", predicate: NavbarLinksComponent }], ngImport: i0, template: "<mat-toolbar class=\"flex flex-row justify-between {{ color() }} {{ mode() }} gap-2\">\n  <ng-content></ng-content>\n</mat-toolbar>\n", styles: [".mic-elevation-1{box-shadow:0 4px 8px #6666661f}.mic-elevation-2{box-shadow:0 8px 16px #66666629}.mic-elevation-3{box-shadow:0 16px 32px #6663}.mic-elevation-4{box-shadow:0 32px 64px #66666652}:host{z-index:2;min-height:3.125rem}.mat-toolbar{position:relative;font-size:15px;z-index:2;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mat-toolbar:first-of-type{padding:0 10px;height:auto}.mat-toolbar:last-of-type{border-top:1px outset rgba(0,0,0,.12)}.mat-toolbar.closely{height:3.125rem}@media screen and (max-width: 599px){.mat-toolbar.closely{height:auto}}\n"], dependencies: [{ kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NavbarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'mic-navbar', template: "<mat-toolbar class=\"flex flex-row justify-between {{ color() }} {{ mode() }} gap-2\">\n  <ng-content></ng-content>\n</mat-toolbar>\n", styles: [".mic-elevation-1{box-shadow:0 4px 8px #6666661f}.mic-elevation-2{box-shadow:0 8px 16px #66666629}.mic-elevation-3{box-shadow:0 16px 32px #6663}.mic-elevation-4{box-shadow:0 32px 64px #66666652}:host{z-index:2;min-height:3.125rem}.mat-toolbar{position:relative;font-size:15px;z-index:2;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mat-toolbar:first-of-type{padding:0 10px;height:auto}.mat-toolbar:last-of-type{border-top:1px outset rgba(0,0,0,.12)}.mat-toolbar.closely{height:3.125rem}@media screen and (max-width: 599px){.mat-toolbar.closely{height:auto}}\n"] }]
        }], ctorParameters: () => [{ type: i1.Router }], propDecorators: { class: [{
                type: HostBinding,
                args: ['class']
            }], links: [{
                type: ContentChildren,
                args: [NavbarLinksComponent]
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2YmFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3RoZW1lL3NyYy9saWIvbmF2YmFyL25hdmJhci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy90aGVtZS9zcmMvbGliL25hdmJhci9uYXZiYXI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