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\r\n  nz-dropdown\r\n  nzPlacement=\"bottomRight\"\r\n  [nzDropdownMenu]=\"menuTpl\"\r\n  class=\"alain-default__nav-item d-flex align-items-center px-sm\"\r\n>\r\n  <nz-avatar [nzSrc]=\"settingsService.user.avatar\" nzSize=\"small\" class=\"mr-sm\"></nz-avatar>\r\n  {{ settingsService.user.name }}\r\n</div>\r\n\r\n<nz-dropdown-menu #menuTpl=\"nzDropdownMenu\">\r\n  <div\r\n    nz-menu\r\n    [ngStyle]=\"{\r\n      width: '200px'\r\n    }\"\r\n  >\r\n    <div (click)=\"openChangePasswordComponent()\" *ngIf=\"displayChangePasswordOption\" nz-menu-item>\r\n      <i nz-icon nzType=\"lock\" nzTheme=\"outline\" class=\"mr-sm\"></i>\r\n      {{ 'projects/fe-ng/src/lib/component/change-password/kengic-change-password.change-password' | i18n }}\r\n    </div>\r\n\r\n    <div nz-menu-item (click)=\"logout()\">\r\n      <i nz-icon nzType=\"logout\" nzTheme=\"outline\" class=\"mr-sm\"></i>\r\n      {{ 'projects/fe-ng/src/lib/page/layout/default/header/user/kengic-layout-default-header-user.logout' | i18n }}\r\n    </div>\r\n  </div>\r\n</nz-dropdown-menu>\r\n\r\n<kengic-change-password [(visible)]=\"headerUserChangePasswordComponentProp.visible\"></kengic-change-password>\r\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2VuZ2ljLWxheW91dC1kZWZhdWx0LWhlYWRlci11c2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BrZW5naWMvZmUtbmcvIiwic291cmNlcyI6WyJsaWIvcGFnZS9sYXlvdXQvZGVmYXVsdC9oZWFkZXIvdXNlci9rZW5naWMtbGF5b3V0LWRlZmF1bHQtaGVhZGVyLXVzZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsMkNBQTJDLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQU16RztJQUtFLGdEQUNTLGVBQWdDLEVBQy9CLGVBQWdDLEVBRWpDLDJCQUFvQztRQUhw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