// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { KeyName, ModifierKeyName } from '../../../Types/Key';
import { CustomElement } from '../../Abstracts/CustomElement';
import { kbdElementTemplate } from './KbdElementTemplate';
import { kbdElementJoyStyle } from './Themes/KbdElement.Joy';
import { kbdElementMemphisStyle } from './Themes/KbdElement.Memphis';
import { kbdElementCosmopolitanStyle } from './Themes/KbdElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
// #endregion
/**
 * Kbd - Represents user input from a keyboard, typically used for keyboard shortcuts or key sequences.
 *
 * @element mosaik-kbd
 *
 * @description
 * The Kbd component is used to display text styled in a way that indicates user input from a keyboard.
 * It is often used to represent keyboard shortcuts, key sequences, or any other form of user input
 * that is relevant to the interface.
 *
 * @category Text
 *
 * @example
 * ```html
 * <mosaik-kbd>Ctrl</mosaik-kbd> + <mosaik-kbd>C</mosaik-kbd>
 * ```
 *
 * @public
 */
let KbdElement = class KbdElement extends Themeable(Valueable(Variantable(CustomElement))) {
    // #region Fields
    _modifierSymbols = new Map([
        [ModifierKeyName.Shift, '⇧'],
        [ModifierKeyName.Control, '⌃'],
        [ModifierKeyName.Meta, '⌘'],
        [ModifierKeyName.Alt, '⌥']
    ]);
    _modifierKeys = [
        KeyName.Shift.toLowerCase(),
        KeyName.Control.toLowerCase(),
        KeyName.Meta.toLowerCase(),
        KeyName.Alt.toLowerCase()
    ];
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-kbd';
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     * @attr
     */
    get value() {
        return super.value;
    }
    set value(value) {
        super.value = value;
    }
    // #endregion
    // #region Methods
    /**
     * @internal
     * @template
     */
    getModifierSymbol(key) {
        return this._modifierKeys.includes(key.toLowerCase())
            ? this._modifierSymbols.get(key) ?? key
            : key;
    }
};
__decorate([
    Attribute({ type: Array }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], KbdElement.prototype, "value", null);
KbdElement = __decorate([
    Component({
        selector: 'mosaik-kbd',
        template: kbdElementTemplate,
        themes: {
            joy: kbdElementJoyStyle,
            memphis: kbdElementMemphisStyle,
            cosmopolitan: kbdElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], KbdElement);
export { KbdElement };
//# sourceMappingURL=KbdElement.js.map