import { Host, h } from "@stencil/core";
import { cls } from "../../utils/helpers";
export class XCard {
    constructor() {
        /**
         * Element has not empty header slot
         */
        this.hasHeaderSlot = false;
        /**
         * Element has not empty footer slot
         */
        this.hasFooterSlot = false;
        this.image = undefined;
        this.imageDescription = undefined;
        this.imagePosition = 'top';
        this.imageHeight = 'auto';
        this.icon = undefined;
        this.iconColor = 'default';
        this.footerJustify = 'space-between';
        this.overlayBottomMargin = undefined;
    }
    /**
     * On component will be loaded hook
     */
    componentWillLoad() {
        this.hasHeaderSlot = !!this.el.querySelector('[slot="header"]');
        this.hasFooterSlot = !!this.el.querySelector('[slot="footer"]');
    }
    /**
     * On component did loaded hook
     *
     * @returns
     */
    componentDidLoad() {
        const footer = this.el.querySelector('.card-footer');
        if (!this.el || !footer) {
            return null;
        }
        this.overlayBottomMargin = footer.getBoundingClientRect().height + 'px';
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: 'a196a223fd2cd993e88dc03b206203837ff74757', class: cls({
                'card-with-footer': this.hasFooterSlot,
                'card-with-overlay': this.imagePosition == 'overlay',
                'card-with-icon': this.icon
            }) }, this.icon && h("x-icon", { key: '1e028b7c36dcf34de286f612d687e5e3ab2f8acd', class: "card-icon", name: this.icon, color: this.iconColor, raised: true }), this.image && this.imagePosition != 'bottom' && h("img", { key: '340a9fa6e29f4cd26f37926196be2685f9873d1d', class: this.imagePosition === 'overlay' ? 'card-img' : 'card-img-top', src: this.image, alt: this.imageDescription, style: { height: this.imageHeight } }), this.hasHeaderSlot && this.imagePosition != 'overlay' && h("div", { key: '3ee7d6659447ec7115f923bdb271d190b4ad6211', class: "card-header" }, h("slot", { key: 'fdffadeb15be1560ee8cd09d2aab04c9c034beba', name: "header" })), this.imagePosition != 'overlay' ?
            h("div", { class: "card-body" }, h("slot", null)) :
            h("div", { class: "card-img-overlay", style: { marginBottom: this.overlayBottomMargin } }, h("div", null, h("slot", null))), this.hasFooterSlot && h("div", { key: '1069fc9757e6cf265dafca3a4cee2f2c222bcfc5', class: "card-footer", style: { justifyContent: this.footerJustify } }, h("slot", { key: '01f813a9026c8690689bc16cfe528a70d6321191', name: "footer" })), this.image && this.imagePosition == 'bottom' && h("img", { key: 'cf1324e01aba6e315432b08997129134ce539e78', class: "card-img-bottom", src: this.image, alt: this.imageDescription, style: { height: this.imageHeight } }));
    }
    static get is() { return "x-card"; }
    static get originalStyleUrls() {
        return {
            "$": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["style.css"]
        };
    }
    static get properties() {
        return {
            "image": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element image path"
                },
                "attribute": "image",
                "reflect": false
            },
            "imageDescription": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element image description"
                },
                "attribute": "image-description",
                "reflect": false
            },
            "imagePosition": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "CardPositionType",
                    "resolved": "\"bottom\" | \"overlay\" | \"top\"",
                    "references": {
                        "CardPositionType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-card/component.tsx",
                            "id": "src/components/x-card/component.tsx::CardPositionType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element image position"
                },
                "attribute": "image-position",
                "reflect": false,
                "defaultValue": "'top'"
            },
            "imageHeight": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element image height"
                },
                "attribute": "image-height",
                "reflect": false,
                "defaultValue": "'auto'"
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IconType",
                    "resolved": "\"help\" | \"profile\" | \"watch\" | \"filter\" | \"map\" | \"info\" | \"error\" | \"document\" | \"data\" | \"label\" | \"link\" | \"menu\" | \"table\" | \"video\" | \"circle\" | \"image\" | \"marker\" | \"download\" | \"sync\" | \"cursor\" | \"rotate\" | \"testing\" | \"copy\" | \"unknown\" | \"history\" | \"print\" | \"key\" | \"danger\" | \"tv\" | \"rotate-right\" | \"rotate-left\" | \"visible\" | \"right\" | \"left\" | \"forward\" | \"search\" | \"message\" | \"split\" | \"3ds-alt\" | \"3ds\" | \"abbreviation\" | \"activate\" | \"activity\" | \"allergies\" | \"answer\" | \"app-store\" | \"apple-pay\" | \"apple\" | \"ask-question\" | \"auth-capture\" | \"aws\" | \"back\" | \"backclear\" | \"badge-fingerprint\" | \"badge-package\" | \"badge-shield\" | \"bank-account\" | \"bank-cards\" | \"bank\" | \"barcode\" | \"basket\" | \"bin-card\" | \"bitcoin\" | \"bot\" | \"bowl\" | \"brain\" | \"browser-chrome\" | \"browser-default\" | \"browser-edge\" | \"browser-firefox\" | \"browser-ie\" | \"browser-opera\" | \"browser-safari\" | \"bug\" | \"calendar-event\" | \"calendar\" | \"call-list\" | \"car\" | \"card-amex\" | \"card-banrural\" | \"card-diners_club\" | \"card-discover\" | \"card-jcb\" | \"card-mastercard\" | \"card-unionpay\" | \"card-visa\" | \"card-wallet\" | \"cash-register\" | \"certificate\" | \"chat\" | \"chatbot\" | \"chatgpt\" | \"check-circle\" | \"check\" | \"checkmark\" | \"chip-card\" | \"chip\" | \"clean\" | \"clipboard\" | \"clock\" | \"cloud-offline\" | \"cloud\" | \"coins\" | \"comment-3ds\" | \"comment-afs\" | \"comment-avs\" | \"comment-cavv\" | \"comment-cavvf\" | \"comment-cavvw\" | \"comment-cvn\" | \"comment-error\" | \"comment-info\" | \"comment-pos\" | \"comment-val\" | \"confectionery\" | \"configuration\" | \"connected\" | \"console\" | \"contactless-payment\" | \"credit-card\" | \"crop\" | \"crown\" | \"cube\" | \"cubes\" | \"currency-settings\" | \"cut-paper\" | \"cut\" | \"cutlery\" | \"dark-mode\" | \"dashboard\" | \"debit-card\" | \"decrease-decimal\" | \"delivered-mail\" | \"desktop\" | \"device-android\" | \"device-ios\" | \"device-linux\" | \"device-mac\" | \"device-other\" | \"device-ubuntu\" | \"device-windows\" | \"discount\" | \"divide\" | \"double-tick\" | \"download-report\" | \"drag-reorder\" | \"drop\" | \"dropdown\" | \"edit\" | \"estimate\" | \"eth\" | \"exchange-bitcoin\" | \"exchange-ethereum\" | \"exchange\" | \"external-link\" | \"face-id\" | \"facebook\" | \"file-archive\" | \"file-document\" | \"file-image\" | \"file-video\" | \"file\" | \"fill-color\" | \"fill-drip\" | \"filter-alt\" | \"finance-document\" | \"financial-changes\" | \"fingerprint\" | \"flag\" | \"format-blockquote\" | \"format-bold\" | \"format-code\" | \"format-header-1\" | \"format-header-2\" | \"format-header-3\" | \"format-header\" | \"format-icon\" | \"format-italic\" | \"format-line\" | \"format-paragraph\" | \"format-quote\" | \"format-redo\" | \"format-strikethrough\" | \"format-table\" | \"format-tip\" | \"format-underline\" | \"format-undo\" | \"git\" | \"google-play\" | \"google\" | \"graph\" | \"hand\" | \"handcart\" | \"hosted-checkout\" | \"hot-price\" | \"hourglass\" | \"idea\" | \"identification-documents\" | \"image-document\" | \"image-gallery\" | \"in-transit\" | \"inactive-state\" | \"increase-decimal\" | \"insert-money\" | \"instashop\" | \"invisible\" | \"invoice\" | \"job\" | \"js-squared\" | \"kitchen\" | \"lambda\" | \"lang-angular\" | \"lang-bash\" | \"lang-capacitor\" | \"lang-code\" | \"lang-cpp\" | \"lang-csharp\" | \"lang-css\" | \"lang-flutter\" | \"lang-go\" | \"lang-html\" | \"lang-ini\" | \"lang-ionic\" | \"lang-java\" | \"lang-js\" | \"lang-json\" | \"lang-kotlin\" | \"lang-laravel\" | \"lang-node-js\" | \"lang-objectivec\" | \"lang-php\" | \"lang-python\" | \"lang-react\" | \"lang-ruby\" | \"lang-sql\" | \"lang-swift\" | \"lang-typescript\" | \"lang-visual-basic\" | \"lang-vue\" | \"lang-xamarin\" | \"lang-xml\" | \"legal\" | \"licence\" | \"light-mode\" | \"list-bullet\" | \"list-numbered\" | \"list-todo\" | \"list\" | \"lock\" | \"love-fill\" | \"love\" | \"mail-bulk\" | \"mail\" | \"mailbox-full\" | \"mailbox\" | \"mailing\" | \"mediaplayer\" | \"merchant-setting\" | \"merchant\" | \"mindmap\" | \"minus\" | \"mobile\" | \"modules\" | \"mouse-scrolling\" | \"move\" | \"network-cable\" | \"network-group\" | \"network\" | \"nfc-tag\" | \"node-js\" | \"notifications\" | \"october\" | \"offline\" | \"onboarding\" | \"online-shop\" | \"online-support\" | \"open-box\" | \"package-tag\" | \"package\" | \"paint-brush\" | \"palette\" | \"parking-meter\" | \"parking-prohibited\" | \"parking\" | \"paycheque\" | \"pending\" | \"percentage\" | \"petition\" | \"phone\" | \"pie-chart-alt\" | \"pie-chart\" | \"pin\" | \"platform-edit\" | \"plus\" | \"power-off\" | \"prestashop\" | \"prize\" | \"qr\" | \"quickbooks\" | \"receipt-added\" | \"receipt-approved\" | \"receipt-declined\" | \"receipt-deleted\" | \"receipt-ticket\" | \"receipt\" | \"receive-cash\" | \"register\" | \"report\" | \"resend-mail\" | \"restaurant-menu\" | \"restaurant\" | \"rice-bowl\" | \"room-service\" | \"ruler\" | \"safe\" | \"sale\" | \"save-pdf\" | \"save\" | \"schedule\" | \"search-folder\" | \"select-circle\" | \"send\" | \"separate-document\" | \"settings\" | \"share\" | \"shield-lock\" | \"shield-warning\" | \"shield\" | \"ship\" | \"shipping-product\" | \"shopify\" | \"shopping-bag\" | \"shopping-cart\" | \"shopping\" | \"sim-card-sensor\" | \"sim-card\" | \"sparkling\" | \"star-fill\" | \"star\" | \"stocks-growth\" | \"suspend\" | \"table-alt\" | \"tag\" | \"tags\" | \"test-tube\" | \"themes\" | \"three-ways\" | \"ticket\" | \"timer\" | \"toggle-off\" | \"toggle-on\" | \"toolkit\" | \"trash-disable\" | \"trash\" | \"truck\" | \"unavailable\" | \"up-down-arrow\" | \"update\" | \"upload-cloud\" | \"upload\" | \"usb-stick\" | \"user-activity\" | \"user-admin\" | \"user-calendar\" | \"user-female\" | \"user-group\" | \"user-guide\" | \"user-male\" | \"user-permissions\" | \"user-tag\" | \"user\" | \"users-settings\" | \"vault\" | \"versions\" | \"vtex\" | \"wallet\" | \"webhook\" | \"whatsapp\" | \"wired-network\" | \"withdraw\" | \"woocommerce\" | \"workflow\"",
                    "references": {
                        "IconType": {
                            "location": "import",
                            "path": "../../constants/icons",
                            "id": "src/constants/icons.ts::IconType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element icon name"
                },
                "attribute": "icon",
                "reflect": false
            },
            "iconColor": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "ColorType",
                    "resolved": "\"accent\" | \"blue\" | \"cyan\" | \"danger\" | \"default\" | \"green\" | \"indigo\" | \"info\" | \"orange\" | \"pink\" | \"primary\" | \"purple\" | \"red\" | \"success\" | \"teal\" | \"warning\" | \"yellow\"",
                    "references": {
                        "ColorType": {
                            "location": "import",
                            "path": "../../constants/colors",
                            "id": "src/constants/colors.ts::ColorType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element icon color"
                },
                "attribute": "icon-color",
                "reflect": false,
                "defaultValue": "'default'"
            },
            "footerJustify": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "CardJustifyType",
                    "resolved": "\"center\" | \"end\" | \"flex-end\" | \"flex-start\" | \"left\" | \"normal\" | \"right\" | \"space-around\" | \"space-between\" | \"space-evenly\" | \"start\" | \"stretch\"",
                    "references": {
                        "CardJustifyType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-card/component.tsx",
                            "id": "src/components/x-card/component.tsx::CardJustifyType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element footer justify content"
                },
                "attribute": "footer-justify",
                "reflect": false,
                "defaultValue": "'space-between'"
            }
        };
    }
    static get states() {
        return {
            "overlayBottomMargin": {}
        };
    }
    static get elementRef() { return "el"; }
}
