import { ChangeDetectionStrategy, ContentChild, Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';
import { NavigationEnd } from '@angular/router';
import { EuimSidebarContentComponent } from './euim-sidebar-content/euim-sidebar-content.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@ionic/angular";
export class EuimSidebarComponent {
    constructor(router, menuCtrl) {
        this.router = router;
        this.menuCtrl = menuCtrl;
        this.className = 'euim-sidebar';
        this.ionMenuId = 'main';
        this.routerPath = 'home';
    }
    ngOnInit() {
        this.router.events.subscribe(event => {
            const path = `/${this.routerPath}`;
            if (event instanceof NavigationEnd) {
                if (this.router.url === path) {
                    this.menuCtrl.close(this.ionMenuId);
                    setTimeout(() => {
                        this.menuCtrl.swipeGesture(true, this.ionMenuId);
                    }, 1000);
                }
                else {
                    this.menuCtrl.close(this.ionMenuId);
                    setTimeout(() => {
                        this.menuCtrl.swipeGesture(false, this.ionMenuId);
                    }, 1000);
                }
            }
        });
    }
    ngAfterContentInit() {
        if (this.sidebarContent && this.ionMenuId) {
            this.sidebarContent.ionMenuId = this.ionMenuId;
        }
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimSidebarComponent, deps: [{ token: i1.Router }, { token: i2.MenuController }], target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: EuimSidebarComponent, selector: "euim-sidebar", inputs: { ionMenuId: "ionMenuId", routerPath: "routerPath" }, host: { properties: { "className": "this.className" } }, queries: [{ propertyName: "sidebarContent", first: true, predicate: EuimSidebarContentComponent, descendants: true }], ngImport: i0, template: "<ion-menu contentId=\"{{ionMenuId}}\" menuId=\"{{ionMenuId}}\" slot=\"start\">\n    <ng-content></ng-content>\n    <ion-content>\n        <ng-content select=\"euim-sidebar-content\"></ng-content>\n    </ion-content>\n</ion-menu>\n", styles: [".euim-sidebar-footer--no-borders.footer-md{box-shadow:none}.euim-sidebar ion-header.header-md{box-shadow:none}.euim-sidebar ion-footer ion-icon[slot=start]{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content{height:100%}.euim-sidebar-content__list{height:auto;padding:0;position:relative}.euim-sidebar-content__searchbar--sticky{position:sticky;top:0;z-index:var(--eui-zi-sticky)}.euim-sidebar-content ion-item euim-avatar:first-child{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content ion-item .euim-avatar--color-success{background-color:var(--eui-c-success-dark)}.euim-sidebar-content ion-item .euim-avatar--color-danger{background-color:var(--eui-c-danger-dark)}.euim-sidebar-content ion-icon[slot=start]{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content ion-note[slot=end]{padding:var(--eui-s-m) 0 var(--eui-s-m)}.euim-sidebar-content ion-item::part(detail-icon){width:var(--eui-s-m);height:var(--eui-s-m);opacity:1;color:var(--eui-c-neutral-lighter);margin-left:var(--eui-s-xs)}\n"], dependencies: [{ kind: "component", type: i2.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2.IonMenu, selector: "ion-menu", inputs: ["contentId", "disabled", "maxEdgeStart", "menuId", "side", "swipeGesture", "type"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EuimSidebarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'euim-sidebar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ion-menu contentId=\"{{ionMenuId}}\" menuId=\"{{ionMenuId}}\" slot=\"start\">\n    <ng-content></ng-content>\n    <ion-content>\n        <ng-content select=\"euim-sidebar-content\"></ng-content>\n    </ion-content>\n</ion-menu>\n", styles: [".euim-sidebar-footer--no-borders.footer-md{box-shadow:none}.euim-sidebar ion-header.header-md{box-shadow:none}.euim-sidebar ion-footer ion-icon[slot=start]{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content{height:100%}.euim-sidebar-content__list{height:auto;padding:0;position:relative}.euim-sidebar-content__searchbar--sticky{position:sticky;top:0;z-index:var(--eui-zi-sticky)}.euim-sidebar-content ion-item euim-avatar:first-child{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content ion-item .euim-avatar--color-success{background-color:var(--eui-c-success-dark)}.euim-sidebar-content ion-item .euim-avatar--color-danger{background-color:var(--eui-c-danger-dark)}.euim-sidebar-content ion-icon[slot=start]{margin-inline-end:var(--eui-s-m)}.euim-sidebar-content ion-note[slot=end]{padding:var(--eui-s-m) 0 var(--eui-s-m)}.euim-sidebar-content ion-item::part(detail-icon){width:var(--eui-s-m);height:var(--eui-s-m);opacity:1;color:var(--eui-c-neutral-lighter);margin-left:var(--eui-s-xs)}\n"] }]
        }], ctorParameters: () => [{ type: i1.Router }, { type: i2.MenuController }], propDecorators: { sidebarContent: [{
                type: ContentChild,
                args: [EuimSidebarContentComponent]
            }], className: [{
                type: HostBinding
            }], ionMenuId: [{
                type: Input
            }], routerPath: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 