import { h } from "@stencil/core";
import { getIsExtensionAvailable, getIsMetaMaskAvailable } from "../../visual/unlock-panel/helpers/index";
import { ProviderTypeEnum } from "../../../types/provider.types";
export class UnlockButton {
    render() {
        const isExtensionProvider = this.type === ProviderTypeEnum.extension;
        const isMetaMaskProvider = this.type === ProviderTypeEnum.metamask;
        const isDetectableProvider = isExtensionProvider || isMetaMaskProvider;
        const isExtensionInstalled = isExtensionProvider && getIsExtensionAvailable();
        const isMetaMaskInstalled = isMetaMaskProvider && getIsMetaMaskAvailable();
        const shouldShowOpenLabel = isDetectableProvider && (isExtensionInstalled || isMetaMaskInstalled);
        return (h("div", { key: '5756eea34ddce724af94282fb2a69d38f31204dd', class: { 'unlock-button': true, [this.class]: Boolean(this.class) } }, this.icon ? (h("div", { class: "unlock-button-icon" }, this.icon)) : (h("div", { class: "unlock-button-icon" }, h("mvx-multiversx-logo-icon", null))), h("div", { key: '123d257164bd25376ad1dc3e67e36f008115b63d', class: "unlock-button-label" }, this.label), isDetectableProvider && (h("div", { key: 'bef6d9d10c0bb7d56efb46f6b739c7f37e8513ff', class: "unlock-button-status" }, shouldShowOpenLabel ? (h("div", { class: "unlock-button-status-open" }, "Open")) : (h("div", { class: "unlock-button-status-install" }, h("span", { class: "unlock-button-status-install-label" }, "Install"), h("mvx-arrow-up-right-icon", { class: "unlock-button-status-install-icon" })))))));
    }
    static get is() { return "mvx-unlock-button"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["unlock-button.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["unlock-button.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "attribute": "label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "icon": {
                "type": "unknown",
                "attribute": "icon",
                "mutable": false,
                "complexType": {
                    "original": "HTMLElement",
                    "resolved": "HTMLElement",
                    "references": {
                        "HTMLElement": {
                            "location": "global",
                            "id": "global::HTMLElement"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "type": {
                "type": "string",
                "attribute": "type",
                "mutable": false,
                "complexType": {
                    "original": "ProviderTypeEnum",
                    "resolved": "ProviderTypeEnum.crossWindow | ProviderTypeEnum.extension | ProviderTypeEnum.ledger | ProviderTypeEnum.metamask | ProviderTypeEnum.passkey | ProviderTypeEnum.walletConnect | ProviderTypeEnum.xalias",
                    "references": {
                        "ProviderTypeEnum": {
                            "location": "import",
                            "path": "types/provider.types",
                            "id": "src/types/provider.types.ts::ProviderTypeEnum"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "class": {
                "type": "string",
                "attribute": "class",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=unlock-button.js.map
