// #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 { Themeable } from '../../../../Behaviors/Themeable';
import { Component } from '../../../../Decorators/ComponentDecorator';
import { Property } from '../../../../Decorators/PropertyDecorator';
import { DropDownButtonElement } from '../../../Buttons/DropDownButton/DropDownButtonElement';
import { MenuElement } from '../../../Selectors/Menu/MenuElement';
import { MenuItemElement } from '../../../Selectors/Menu/MenuItemElement';
import { EmojiElement } from '../../Emoji/EmojiElement';
import { ChatReactions } from '../Models/IChatReaction';
import { ChatToolBaseElement } from './Abstracts/ChatToolBaseElement';
import { reactionChatToolElementTemplate } from './ReactionChatToolElementTemplate';
// #endregion
/**
 *   [part='reaction'] {
            min-width: unset;
            [part='emoji'] {
                --emoji-background-color: #{base.component-property($props, background-color)};
            }
        }
 */
/**
 * The `ReactionChatToolElement` element.
 *
 * @csspart emoji - The emoji part.
 *
 * @dependency mosaik-dropdown-button - The Dropdown Button element.
 * @dependency mosaik-emoji - The Emoji element.
 * @dependency mosaik-menu - The Menu element.
 * @dependency mosaik-menu-item - The Menu Item element.
 *
 * @example
 * Basic usage inside a chat element tools slot:
 * ```html
 * <mosaik-reaction-chat-tool></mosaik-reaction-chat-tool>
 * ```
 *
 * @public
 */
let ReactionChatToolElement = class ReactionChatToolElement extends Themeable(ChatToolBaseElement) {
    // #region Fields
    _reactions;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._reactions = ChatReactions.default;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-reaction-chat-tool';
    }
    /**
     * Gets or sets the `reactions` property.
     *
     * @public
     */
    get reactions() {
        return this._reactions;
    }
    set reactions(value) {
        if (this._reactions !== value) {
            this._reactions = value;
            this.requestUpdate('reactions');
        }
    }
    // #endregion
    // #region Methods
    execute(args) {
        if (!this.chatElement?.inputElement) {
            return false;
        }
        this.chatElement.inputElement.send(args);
        return true;
    }
};
__decorate([
    Property({ type: Array }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], ReactionChatToolElement.prototype, "reactions", null);
ReactionChatToolElement = __decorate([
    Component({
        selector: 'mosaik-reaction-chat-tool',
        template: reactionChatToolElementTemplate,
        // styles: reactionChatToolElementStyle,
        host: {
            slot: 'tools'
        },
        options: {
            mode: 'open',
            delegatesFocus: true
        },
        imports: [
            DropDownButtonElement,
            MenuElement,
            MenuItemElement,
            EmojiElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ReactionChatToolElement);
export { ReactionChatToolElement };
//# sourceMappingURL=ReactionChatToolElement.js.map