import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@clr/angular";
import * as i2 from "@angular/common";
import * as i3 from "../dropdown/dropdown.component";
import * as i4 from "../dropdown/dropdown-menu.component";
import * as i5 from "../dropdown/dropdown-trigger.directive";
import * as i6 from "../dropdown/dropdown-item.directive";
import * as i7 from "../../pipes/locale-language-name.pipe";
export class LanguageSelectorComponent {
    constructor() {
        this.disabled = false;
        this.languageCodeChange = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: LanguageSelectorComponent, selector: "vdr-language-selector", inputs: { currentLanguageCode: "currentLanguageCode", availableLanguageCodes: "availableLanguageCodes", disabled: "disabled" }, outputs: { languageCodeChange: "languageCodeChange" }, ngImport: i0, template: "<ng-container *ngIf=\"1 < availableLanguageCodes?.length\">\n    <vdr-dropdown>\n        <button type=\"button\" class=\"btn btn-sm\" vdrDropdownTrigger [disabled]=\"disabled\">\n            <clr-icon shape=\"world\"></clr-icon>\n            {{ currentLanguageCode | localeLanguageName }}\n            <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\n        </button>\n        <vdr-dropdown-menu vdrPosition=\"bottom-right\">\n            <button\n                type=\"button\"\n                class=\"language-option\"\n                *ngFor=\"let code of availableLanguageCodes\"\n                (click)=\"languageCodeChange.emit(code)\"\n                vdrDropdownItem\n            >\n                <span>{{ code | localeLanguageName }}</span><span class=\"code\">{{ code | uppercase }}</span>\n            </button>\n        </vdr-dropdown-menu>\n    </vdr-dropdown>\n</ng-container>\n", styles: [":host{display:block}.language-option{display:flex;gap:4px;align-items:center;justify-content:space-between}.code{color:var(--color-grey-400)}\n"], dependencies: [{ kind: "directive", type: i1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.DropdownComponent, selector: "vdr-dropdown", inputs: ["manualToggle"] }, { kind: "component", type: i4.DropdownMenuComponent, selector: "vdr-dropdown-menu", inputs: ["vdrPosition", "customClasses"] }, { kind: "directive", type: i5.DropdownTriggerDirective, selector: "[vdrDropdownTrigger]" }, { kind: "directive", type: i6.DropdownItemDirective, selector: "[vdrDropdownItem]" }, { kind: "pipe", type: i2.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i7.LocaleLanguageNamePipe, name: "localeLanguageName" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: LanguageSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'vdr-language-selector', template: "<ng-container *ngIf=\"1 < availableLanguageCodes?.length\">\n    <vdr-dropdown>\n        <button type=\"button\" class=\"btn btn-sm\" vdrDropdownTrigger [disabled]=\"disabled\">\n            <clr-icon shape=\"world\"></clr-icon>\n            {{ currentLanguageCode | localeLanguageName }}\n            <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\n        </button>\n        <vdr-dropdown-menu vdrPosition=\"bottom-right\">\n            <button\n                type=\"button\"\n                class=\"language-option\"\n                *ngFor=\"let code of availableLanguageCodes\"\n                (click)=\"languageCodeChange.emit(code)\"\n                vdrDropdownItem\n            >\n                <span>{{ code | localeLanguageName }}</span><span class=\"code\">{{ code | uppercase }}</span>\n            </button>\n        </vdr-dropdown-menu>\n    </vdr-dropdown>\n</ng-container>\n", styles: [":host{display:block}.language-option{display:flex;gap:4px;align-items:center;justify-content:space-between}.code{color:var(--color-grey-400)}\n"] }]
        }], propDecorators: { currentLanguageCode: [{
                type: Input
            }], availableLanguageCodes: [{
                type: Input
            }], disabled: [{
                type: Input
            }], languageCodeChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ3VhZ2Utc2VsZWN0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9jb3JlL3NyYy9zaGFyZWQvY29tcG9uZW50cy9sYW5ndWFnZS1zZWxlY3Rvci9sYW5ndWFnZS1zZWxlY3Rvci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbGliL2NvcmUvc3JjL3NoYXJlZC9jb21wb25lbnRzL2xhbmd1YWdlLXNlbGVjdG9yL2xhbmd1YWdlLXNlbGVjdG9yLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7Ozs7OztBQVN2RSxNQUFNLE9BQU8seUJBQXlCO0lBTHRDO1FBUWEsYUFBUSxHQUFHLEtBQUssQ0FBQztRQUNoQix1QkFBa0IsR0FBRyxJQUFJLFlBQVksRUFBZ0IsQ0FBQztLQUNuRTs4R0FMWSx5QkFBeUI7a0dBQXpCLHlCQUF5QixvUENUdEMsczRCQW9CQTs7MkZEWGEseUJBQXlCO2tCQUxyQyxTQUFTOytCQUNJLHVCQUF1Qjs4QkFLeEIsbUJBQW1CO3NCQUEzQixLQUFLO2dCQUNHLHNCQUFzQjtzQkFBOUIsS0FBSztnQkFDRyxRQUFRO3NCQUFoQixLQUFLO2dCQUNJLGtCQUFrQjtzQkFBM0IsTUFBTSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgRXZlbnRFbWl0dGVyLCBJbnB1dCwgT3V0cHV0IH0gZnJvbSAnQGFuZ3VsYXIvY29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