import { h, Host } from "@stencil/core";
import { arrow_right } from "pn-design-assets/pn-assets/icons.js";
export class PnChartsCard {
    constructor() {
        this.header = null;
        this.highlight = undefined;
        this.preamble = undefined;
        this.label = undefined;
        this.source = undefined;
        this.sourceUrl = undefined;
        this.ctaLinkText = undefined;
        this.openInNewWindow = false;
    }
    hostElement;
    showCtaLinkText = () => {
        if (this.ctaLinkText) {
            return (h("a", { class: "link--animated", href: this.sourceUrl, rel: this.openInNewWindow ? 'noopener nofollower noreferrer' : null, target: this.openInNewWindow ? '_blank' : null }, this.ctaLinkText, " ", h("pn-icon", { icon: arrow_right }, " ")));
        }
        return null;
    };
    render() {
        return (h(Host, { key: '932e9396a6f2d92296f7d3891d30c8b239f7c505' }, h("slot", { key: 'f7b2cee3fbb752529007d357977367b75d7d92dc', name: "clickable-block-wrapper" }), h("div", { key: '4e41ef800cd83f9655498dc003cc475adf94be74', class: "pn-charts-card__wrapper" }, this.header &&
            (h("div", { key: '887b87722b03a88b437e1fb8f08cd5b96a22d801', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--vertical" }, h("h2", { key: '7e42eed995b18e6e35420bc7164e2292c0ad8bad', class: "pn-charts-card__heading" }, this.header), h("div", { key: '2e5d4bfc48f85dca46a8a686ecc74c53fbea7f43', class: "pn-charts-card__heading__highlight" }, this.highlight))), h("div", { key: 'e6afaecfbff9546b65f23d063d78d2bd85fa577c', class: "pn-charts-card__content__wrapper" }, h("slot", { key: '9f648bbfba9338cadbdabf6045a4ed19a0575a99', name: "chart" }), h("div", { key: 'df43a6c84b8d990ac7ce92daea524c93427684ad', class: "pn-charts-card__text__container" }, this.header &&
            (h("div", { key: 'fad6bbcd1d3588f580f55aeb0852acd8522e696e', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--horizontal" }, h("h2", { key: 'db90f01327a55f0acffaeb11be0839b348dc3854', class: "pn-charts-card__heading pn-charts-card__heading" }, this.header), h("div", { key: 'e08e7589c11ed25b8d0b2986e2e940a24d4f911e', class: "pn-charts-card__heading__highlight" }, this.highlight))), h("span", { key: '75d76421250f366755f17f0e42217d88fb6155fd', class: "pn-charts-card__preamble" }, this.preamble), h("div", { key: 'b54eea882f8f9d8b3934dda3fdcae18d76f938ce', class: "pn-charts-card__text__wrapper" }, h("div", { key: '5696594a4b9eec838d7bedfc515e11f2d95b3268', class: "pn-charts-card__source" }, h("label", { key: '1364ed359aa0bc1ab99d06a560cb3d03e3a0fede' }, this.label), this.source ? h("p", { class: "pn-chart-card__text__heading" }, this.source) : null, this.showCtaLinkText())))))));
    }
    static get is() { return "pn-charts-card"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-charts-card.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-charts-card.css"]
        };
    }
    static get properties() {
        return {
            "header": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "header",
                "reflect": false,
                "defaultValue": "null"
            },
            "highlight": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "highlight",
                "reflect": false
            },
            "preamble": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "preamble",
                "reflect": false
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "label",
                "reflect": false
            },
            "source": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "source",
                "reflect": false
            },
            "sourceUrl": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "source-url",
                "reflect": false
            },
            "ctaLinkText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "cta-link-text",
                "reflect": false
            },
            "openInNewWindow": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "open-in-new-window",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "hostElement"; }
}
//# sourceMappingURL=pn-charts-card.js.map
