// Plugins
import { Plugins } from '@capacitor/core';
// Stencil
import { h } from "@stencil/core";
// Constants
const { Clipboard } = Plugins;
const { Toast } = Plugins;
export class TourDirectionIndications {
    constructor() {
        // Props
        this.transportInfo = [];
        this.city = 'paris';
        this.directionTitle = null;
        this.byMetroTitle = '';
        this.byTaxiTitle = '';
        this.exitPrefix = '';
        this.address = '';
        this.showWalkOption = false;
        this.durationFromStartingPoint = -1; // Duration in seconds to get to the starting point
    }
    ////////////////////////////////////////////////////////////////
    // User Interactions
    ////////////////////////////////////////////////////////////////
    /**
     * The user clicked on the address
     * We add it to the clip board
     */
    onAddressClick() {
        Clipboard.write({
            string: this.address
        });
        Toast.show({
            text: 'Copied'
        });
    }
    ////////////////////////////////////////////////////////////////
    // Render
    ////////////////////////////////////////////////////////////////
    render() {
        return (h("div", null,
            this.directionTitle &&
                h("p", { class: "main-title" }, this.directionTitle),
            h("ion-list", null,
                h("ion-item", null,
                    h("dos-accordion", { "icon-color": "light" },
                        h("p", { slot: "title", class: "indication-title" }, this.byMetroTitle),
                        h("metro-indication", { slot: "content", exitPrefix: this.exitPrefix, transportInfo: this.transportInfo, city: this.city }))),
                h("ion-item", null,
                    h("dos-accordion", { "icon-color": "light" },
                        h("p", { slot: "title", class: "indication-title" }, this.byTaxiTitle),
                        h("p", { slot: "content", class: "address", onClick: () => this.onAddressClick() },
                            this.address,
                            h("ion-icon", { name: 'copy-outline', color: 'light', class: 'copy-icon' })))),
                this.showWalkOption &&
                    h("ion-item", null,
                        h("dos-accordion", { "icon-color": "light" },
                            h("p", { slot: "title", class: "indication-title" }, "BY WALK"),
                            h("p", { slot: "content", class: "address" },
                                this.durationFromStartingPoint && h("span", null,
                                    Math.round(this.durationFromStartingPoint / 60),
                                    " min away. "),
                                "See the map and walk"))))));
    }
    static get is() { return "tour-direction-indications"; }
    static get originalStyleUrls() { return {
        "$": ["tour-direction-indications.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["tour-direction-indications.css"]
    }; }
    static get properties() { return {
        "transportInfo": {
            "type": "unknown",
            "mutable": false,
            "complexType": {
                "original": "TransportIndication[]",
                "resolved": "TransportIndication[]",
                "references": {
                    "TransportIndication": {
                        "location": "import",
                        "path": "../../../../models/transport/transport-indication"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "defaultValue": "[]"
        },
        "city": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "city",
            "reflect": false,
            "defaultValue": "'paris'"
        },
        "directionTitle": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "direction-title",
            "reflect": false,
            "defaultValue": "null"
        },
        "byMetroTitle": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "by-metro-title",
            "reflect": false,
            "defaultValue": "''"
        },
        "byTaxiTitle": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "by-taxi-title",
            "reflect": false,
            "defaultValue": "''"
        },
        "exitPrefix": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "exit-prefix",
            "reflect": false,
            "defaultValue": "''"
        },
        "address": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "address",
            "reflect": false,
            "defaultValue": "''"
        },
        "showWalkOption": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "show-walk-option",
            "reflect": false,
            "defaultValue": "false"
        },
        "durationFromStartingPoint": {
            "type": "number",
            "mutable": true,
            "complexType": {
                "original": "number",
                "resolved": "number",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "duration-from-starting-point",
            "reflect": false,
            "defaultValue": "-1"
        }
    }; }
}
