// Stencil
import { h } from "@stencil/core";
export class UserActionContent {
    constructor() {
        // Props
        this.buttonText = '';
        this.iconName = '';
        this.rotateIcon = false;
        this.postMessage = '';
        this.callbackId = '';
        this.showPostActionText = true;
        this.playAnimation = false;
        this.animationPath = '';
        this.buttonClicked = false;
        this.animated = false;
    }
    ////////////////////////////////////////////////////////////////
    // User Interactions
    ////////////////////////////////////////////////////////////////
    /**
     * Click on the title
     */
    onButtonClick() {
        this.animated = false;
        if (this.showPostActionText) {
            this.buttonClicked = true;
        }
        this.actionClicked.emit(this.callbackId);
    }
    ////////////////////////////////////////////////////////////////
    // Render
    ////////////////////////////////////////////////////////////////
    render() {
        return (h("div", null, this.buttonClicked
            ?
                h("span", null, this.playAnimation
                    ? h("lottie-animation", { src: this.animationPath, autoplay: true, loop: true, speed: 0.8, class: 'pin-animation' })
                    : h("p", null,
                        this.postMessage,
                        "..."))
            : h("ion-button", { color: 'secondary', size: "default", class: 'user-action-button' + (this.animated ? ' heartbeat-button' : ' delay-appearance-button'), onClick: () => this.onButtonClick() },
                this.iconName &&
                    h("ion-icon", { name: this.iconName, color: 'light', class: 'user-action-icon' }),
                this.buttonText)));
    }
    static get is() { return "user-action-content"; }
    static get originalStyleUrls() { return {
        "$": ["user-action-content.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["user-action-content.css"]
    }; }
    static get properties() { return {
        "buttonText": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "button-text",
            "reflect": false,
            "defaultValue": "''"
        },
        "iconName": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "icon-name",
            "reflect": false,
            "defaultValue": "''"
        },
        "rotateIcon": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "rotate-icon",
            "reflect": false,
            "defaultValue": "false"
        },
        "postMessage": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "post-message",
            "reflect": false,
            "defaultValue": "''"
        },
        "callbackId": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "callback-id",
            "reflect": false,
            "defaultValue": "''"
        },
        "showPostActionText": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "show-post-action-text",
            "reflect": false,
            "defaultValue": "true"
        },
        "playAnimation": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "play-animation",
            "reflect": false,
            "defaultValue": "false"
        },
        "animationPath": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "animation-path",
            "reflect": false,
            "defaultValue": "''"
        },
        "buttonClicked": {
            "type": "boolean",
            "mutable": true,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "button-clicked",
            "reflect": false,
            "defaultValue": "false"
        },
        "animated": {
            "type": "boolean",
            "mutable": true,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "animated",
            "reflect": false,
            "defaultValue": "false"
        }
    }; }
    static get events() { return [{
            "method": "actionClicked",
            "name": "actionClicked",
            "bubbles": true,
            "cancelable": true,
            "composed": true,
            "docs": {
                "tags": [],
                "text": ""
            },
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            }
        }]; }
}
