var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m")
        throw new TypeError("Private method is not writable");
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _GxIdeStatusButtons_componentLocale;
import { Host, h } from "@stencil/core";
import { Locale } from "../../../common/locale";
export class GxIdeStatusButtons {
    constructor() {
        /**
         * The component hard-coded strings translations.
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeStatusButtons_componentLocale.set(this, void 0);
        this.evaluateIconsSize = () => {
            if (this.compact) {
                this.iconsSize = "small";
            }
        };
        this.evaluateLabel = (type) => {
            const amount = this[type];
            if (this.minimal) {
                return `${amount}`;
            }
            else {
                const singular = amount === 1;
                return singular
                    ? `${amount} ${__classPrivateFieldGet(this, _GxIdeStatusButtons_componentLocale, "f")[type]["singular"]}`
                    : `${amount} ${__classPrivateFieldGet(this, _GxIdeStatusButtons_componentLocale, "f")[type]["plural"]}`;
            }
        };
        this.selectionChangedHandler = (e) => {
            e.stopPropagation();
            this.selectionChanged.emit(e.detail);
        };
        this.active = false;
        this.errors = 0;
        this.hideError = false;
        this.warnings = 0;
        this.hideWarning = false;
        this.successes = 0;
        this.hideSuccess = false;
        this.messages = 0;
        this.hideMessage = false;
        this.minimal = false;
        this.compact = false;
        this.noInnerBorders = false;
        this.iconsSize = "small";
    }
    async componentWillLoad() {
        __classPrivateFieldSet(this, _GxIdeStatusButtons_componentLocale, await Locale.getComponentStrings(this.el), "f");
        this.evaluateIconsSize();
    }
    render() {
        return (h(Host, null, h("gx-ide-list-selector", { type: "multi-selection", listName: "status-buttons", noListBorder: true, ellipsis: true, onSelectionChanged: this.selectionChangedHandler }, !this.hideError ? (h("gx-ide-list-selector-item", { itemId: "errors", itemValue: this.evaluateLabel("errors"), icon: "gx-test/result-exception", class: { "error": true, "not-zero": this.errors !== 0 }, itemChecked: true }, h("span", { slot: "universal", class: {
                "pseudo-checkbox": true
            } }))) : null, !this.hideWarning ? (h("gx-ide-list-selector-item", { itemId: "warnings", itemValue: this.evaluateLabel("warnings"), icon: "gx-test/result-warning", class: { "warning": true, "not-zero": this.warnings !== 0 }, itemChecked: true }, h("span", { slot: "universal", class: {
                "pseudo-checkbox": true
            } }))) : null, !this.hideSuccess ? (h("gx-ide-list-selector-item", { itemId: "successes", itemValue: this.evaluateLabel("successes"), icon: "gx-test/result-ok", class: { "success": true, "not-zero": this.successes !== 0 }, itemChecked: true }, h("span", { slot: "universal", class: {
                "pseudo-checkbox": true
            } }))) : null, !this.hideMessage ? (h("gx-ide-list-selector-item", { itemId: "messages", itemValue: this.evaluateLabel("messages"), icon: "gx-test/screenshot-viewer", class: { "message": true, "not-zero": this.messages !== 0 }, itemChecked: true }, h("span", { slot: "universal", class: {
                "pseudo-checkbox": true
            } }))) : null)));
    }
    static get is() { return "gx-ide-status-buttons"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["gx-ide-status-buttons.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["gx-ide-status-buttons.css"]
        };
    }
    static get assetsDirs() { return ["gx-ide-assets/status-buttons"]; }
    static get properties() {
        return {
            "active": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether or not the buttons are active"
                },
                "attribute": "active",
                "reflect": false,
                "defaultValue": "false"
            },
            "errors": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The errors amount"
                },
                "attribute": "errors",
                "reflect": false,
                "defaultValue": "0"
            },
            "hideError": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Hide the errors button"
                },
                "attribute": "hide-error",
                "reflect": false,
                "defaultValue": "false"
            },
            "warnings": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The warnings amount"
                },
                "attribute": "warnings",
                "reflect": false,
                "defaultValue": "0"
            },
            "hideWarning": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Hide the warnings button"
                },
                "attribute": "hide-warning",
                "reflect": false,
                "defaultValue": "false"
            },
            "successes": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The successes amount"
                },
                "attribute": "successes",
                "reflect": false,
                "defaultValue": "0"
            },
            "hideSuccess": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Hide the successes button"
                },
                "attribute": "hide-success",
                "reflect": false,
                "defaultValue": "false"
            },
            "messages": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The messages amount"
                },
                "attribute": "messages",
                "reflect": false,
                "defaultValue": "0"
            },
            "hideMessage": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Hide the messages button"
                },
                "attribute": "hide-message",
                "reflect": false,
                "defaultValue": "false"
            },
            "minimal": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Display only the number"
                },
                "attribute": "minimal",
                "reflect": false,
                "defaultValue": "false"
            },
            "compact": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If present will make the component look smaller."
                },
                "attribute": "compact",
                "reflect": true,
                "defaultValue": "false"
            },
            "noInnerBorders": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "No inner borders"
                },
                "attribute": "no-inner-borders",
                "reflect": true,
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "iconsSize": {}
        };
    }
    static get events() {
        return [{
                "method": "selectionChanged",
                "name": "selectionChanged",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emits the actual selection"
                },
                "complexType": {
                    "original": "CheckedItemsInfo",
                    "resolved": "ItemData[]",
                    "references": {
                        "CheckedItemsInfo": {
                            "location": "import",
                            "path": "../list-selector/list-selector",
                            "id": "src/components/_helpers/list-selector/list-selector.tsx::CheckedItemsInfo"
                        }
                    }
                }
            }];
    }
    static get elementRef() { return "el"; }
}
_GxIdeStatusButtons_componentLocale = new WeakMap();
//# sourceMappingURL=gx-ide-status-buttons.js.map
