import { __decorate, __metadata, __param } from "tslib";
import { Component, Inject } from '@angular/core';
import { SettingsService } from '@delon/theme';
import { IdentityService } from '../../../../../service/identity.service';
import { KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION } from '../../../../../const/injection-token.const';
var KengicLayoutDefaultHeaderUserComponent = /** @class */ (function () {
    function KengicLayoutDefaultHeaderUserComponent(settingsService, identityService, displayChangePasswordOption) {
        this.settingsService = settingsService;
        this.identityService = identityService;
        this.displayChangePasswordOption = displayChangePasswordOption;
        this.headerUserChangePasswordComponentProp = {
            visible: false,
        };
    }
    KengicLayoutDefaultHeaderUserComponent.prototype.logout = function () {
        this.identityService.logout();
    };
    KengicLayoutDefaultHeaderUserComponent.prototype.openChangePasswordComponent = function () {
        this.headerUserChangePasswordComponentProp.visible = true;
    };
    KengicLayoutDefaultHeaderUserComponent.ctorParameters = function () { return [
        { type: SettingsService },
        { type: IdentityService },
        { type: Boolean, decorators: [{ type: Inject, args: [KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION,] }] }
    ]; };
    KengicLayoutDefaultHeaderUserComponent = __decorate([
        Component({
            selector: 'kengic-layout-default-header-user',
            template: "<div [nzDropdownMenu]=\"menuTpl\" class=\"alain-default__nav-item d-flex align-items-center px-sm\" nz-dropdown nzPlacement=\"bottomRight\">\n  <nz-avatar [nzSrc]=\"settingsService.user.avatar\" class=\"mr-sm\" nzSize=\"small\"></nz-avatar>\n  {{ settingsService.user.name }}\n</div>\n\n<nz-dropdown-menu #menuTpl=\"nzDropdownMenu\">\n  <div\n    [ngStyle]=\"{\n      width: '200px'\n    }\"\n    nz-menu\n  >\n    <div (click)=\"openChangePasswordComponent()\" *ngIf=\"displayChangePasswordOption\" nz-menu-item>\n      <i class=\"mr-sm\" nz-icon nzTheme=\"outline\" nzType=\"lock\"></i>\n      {{ 'projects/fe-ng/src/lib/component/change-password/kengic-change-password.change-password' | i18n }}\n    </div>\n\n    <div (click)=\"logout()\" nz-menu-item>\n      <i class=\"mr-sm\" nz-icon nzTheme=\"outline\" nzType=\"logout\"></i>\n      {{ 'projects/fe-ng/src/lib/page/layout/default/header/user/kengic-layout-default-header-user.logout' | i18n }}\n    </div>\n  </div>\n</nz-dropdown-menu>\n\n<kengic-change-password [(visible)]=\"headerUserChangePasswordComponentProp.visible\"></kengic-change-password>\n"
        }),
        __param(2, Inject(KENGIC_TOKEN_DISPLAY_CHANGE_PASSWORD_OPTION)),
        __metadata("design:paramtypes", [SettingsService,
            IdentityService, Boolean])
    ], KengicLayoutDefaultHeaderUserComponent);
    return KengicLayoutDefaultHeaderUserComponent;
}());
export { KengicLayoutDefaultHeaderUserComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLWxheW91dC1kZWZhdWx0LWhlYWRlci11c2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BrZW5naWMvZmUtbmcvIiwic291cmNlcyI6WyJsaWIvcGFnZS9sYXlvdXQvZGVmYXVsdC9oZWFkZXIvdXNlci9rZW5naWMtbGF5b3V0LWRlZmF1bHQtaGVhZGVyLXVzZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsMkNBQTJDLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQU16RztJQUtFLGdEQUNTLGVBQWdDLEVBQy9CLGVBQWdDLEVBRWpDLDJCQUFvQztRQUhwQyxvQkFBZSxHQUFmLGVBQWUsQ0FBaUI7UUFDL0Isb0JBQWUsR0FBZixlQUFlLENBQWlCO1FBRWp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