import { h } from '@stencil/core';
import { _t } from '../i18n/i18n';
export class ShareButton {
    constructor() {
        this.icon = 'share';
    }
    async openPopover(ev) {
        const options = {
            component: document.createElement('gl-share'),
            ev: ev
        };
        const popover = await this.popoverCtrl.create(options);
        await popover.present();
        return popover;
    }
    render() {
        return (h("ion-button", { title: _t('webmapgl.share-button.title'), onClick: (e) => this.openPopover(e) },
            h("ion-icon", { slot: "icon-only", name: this.icon })));
    }
    static get is() { return "gl-share-button"; }
    static get properties() { return {
        "icon": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "icon",
            "reflect": false,
            "defaultValue": "'share'"
        }
    }; }
    static get connectProps() { return [{
            "name": "popoverCtrl",
            "connect": "ion-popover-controller"
        }]; }
}
