/*!
 * Copyright (c) what3words http://what3words.com
 */
import { DEFAULTS } from "../../lib/constants";
import { h } from "@stencil/core";
export class What3wordsAddress {
    constructor() {
        this.words = DEFAULTS.threeWordAddress;
        this.iconColor = DEFAULTS.iconColor;
        this.textColor = DEFAULTS.textColor;
        this.size = DEFAULTS.addressSize;
        this.target = DEFAULTS.target;
        this.link = DEFAULTS.true;
        this.tooltip = DEFAULTS.true;
        this.tooltipLocation = DEFAULTS.tooltipLocation;
        this.showTooltip = DEFAULTS.false;
    }
    render() {
        const url = `https://map.what3words.com/${this.words}`;
        const attributes = this.link ? { href: url, target: this.target } : {};
        return (h("span", Object.assign({ key: 'bfac3688aa7b212890a3eb635a4ac7b2a9d9ba24' }, attributes, { class: `what3words-address notranslate ${this.showTooltip ? "what3words-address_tooltip" : ""}`, style: { fontSize: `${this.size}px` } }), this.tooltip && (h("div", { key: '9d0bbf361183a9c8a519d829e143203637f12448', class: "what3words-tooltip-container" }, h("div", { key: '7042abee0d2174efa2be057a5c9a09e8e4507c8b', class: "what3words-tooltip" }, "what3words gives every 3m x 3m in the world a unique 3 word address. This one describes the precise ", this.tooltipLocation, ".", " "))), h("div", { key: 'dfeafbe02e6f5b71d710a44e6be2af7313739ba0', class: "what3words-address_container" }, h("what3words-symbol", { key: '53b8cefadf396a90a6eeda1cfdb33a909cbf1df8', size: this.size * 1.25, color: this.iconColor }), h("span", { key: 'e2320e38511358665f9d942fd3f129bc823c8e4d', class: "what3words-address_text", style: { color: this.textColor } }, this.words))));
    }
    static get is() { return "what3words-address"; }
    static get originalStyleUrls() {
        return {
            "$": ["what3words-address.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["what3words-address.css"]
        };
    }
    static get properties() {
        return {
            "words": {
                "type": "string",
                "attribute": "words",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.threeWordAddress"
            },
            "iconColor": {
                "type": "string",
                "attribute": "icon-color",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.iconColor"
            },
            "textColor": {
                "type": "string",
                "attribute": "text-color",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.textColor"
            },
            "size": {
                "type": "number",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.addressSize"
            },
            "target": {
                "type": "string",
                "attribute": "target",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.target"
            },
            "link": {
                "type": "boolean",
                "attribute": "link",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.true"
            },
            "tooltip": {
                "type": "boolean",
                "attribute": "tooltip",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.true"
            },
            "tooltipLocation": {
                "type": "string",
                "attribute": "tooltip-location",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.tooltipLocation"
            },
            "showTooltip": {
                "type": "boolean",
                "attribute": "show-tooltip",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "DEFAULTS.false"
            }
        };
    }
}
