import { ActionEntity } from "../InteractiveEntities/ActionEntity";
import { BaseInteractiveElement } from "./index";
import { ElementType } from "../../../constants/UIKitConstants";
/**
 * Represents a button element that can be added to a interactive bubble.
 */
export class ButtonElement extends BaseInteractiveElement {
    /**
     * The text to display on the button.
     */
    buttonText;
    /**
     * Whether the button should be disabled after it is interacted with.
     * */
    disableAfterInteracted = true;
    /**
     * Creates an instance of ButtonInput.
     * @param elementId - The unique identifier for the button element.
     * @param action - The action to be performed when the button is clicked.
     * @param buttonText - The text to display on the button.
     */
    constructor(elementId, action, buttonText) {
        super(elementId, ElementType.button, action);
        this.buttonText = buttonText || "";
    }
    /**
     * Gets the text to display on the button.
     * @returns The text to display on the button.
     */
    getButtonText() {
        return this.buttonText;
    }
    /**
     * Gets whether the button should be disabled after it is interacted with.
     * @returns Whether the button should be disabled after it is interacted with.
     */
    getDisableAfterInteracted() {
        return this.disableAfterInteracted;
    }
    /**
     * Sets whether the button should be disabled after it is interacted with.
     * @param disableAfterInteracted - Whether the button should be disabled after it is interacted with.
     */
    setDisableAfterInteracted(disableAfterInteracted) {
        this.disableAfterInteracted = disableAfterInteracted;
    }
    static fromJSON(json) {
        const action = ActionEntity.fromJSON(json.action);
        const buttonElement = new ButtonElement(json.elementId, action, json.buttonText);
        if (json.disableAfterInteracted)
            buttonElement.setDisableAfterInteracted(json.disableAfterInteracted);
        return buttonElement;
    }
}
//# sourceMappingURL=ButtonElement.js.map