"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class SelectionChip {
    onCreate(input) {
        this.state = {
            mounted: false,
            selected: input.selected || false,
        };
    }
    onMount() {
        this.state.mounted = true;
    }
    handleButtonClick(originalEvent) {
        if (!this.input.disabled) {
            const selected = !this.state.selected;
            this.state.selected = selected;
            this.emit("click", {
                selected,
                originalEvent,
            });
        }
    }
    onInput(input) {
        if (input.selected !== undefined) {
            this.state.selected = input.selected;
        }
    }
}
module.exports = SelectionChip;
