import { h, Host } from "@stencil/core";
import state from "./pn-profile-modal-store";
import { arrow_left } from "pn-design-assets/pn-assets/icons.js";
export class PnProfileModalProfile {
    constructor() {
        this.heading = null;
        this.description = null;
        this.url = null;
        this.selected = false;
        this.showCustomerNumbers = false;
        this.pleaseSelectText = '';
        this.visible = false;
        this.identifier = '';
    }
    hostElement;
    urlSelected;
    showCustomerNumbersEvent;
    componentWillLoad() {
        this.identifier = this.heading + this.url;
    }
    onProfileOptionClick() {
        this.selected = true;
        if (this.url) {
            this.urlSelected.emit(this.url);
            // TODO: emit event with URL to parent
        }
        else {
            // TODO: Open customer number selection
            state.selectedProfile = this.identifier;
        }
    }
    render() {
        return (h(Host, { key: '15e917fc2ea14b3acd95d8c4585420f541d24753', selected: this.selected + '' }, h("div", { key: '7e14dd73e00b4a212ef78b05632ac2483d5c5b80', class: "pn-profile-modal-profile-listitem", "aria-hidden": !!state.selectedProfile + '' }, h("button", { key: '9adf6d1a07eaf7de1bf4350332f703f45b850e03', class: "pn-profile-modal-profile-listitem-button", onClick: this.onProfileOptionClick.bind(this) }, h("div", { key: '37623c337e9f8993004ab5675939dbadb8b9fc5e', class: "pn-profile-modal-profile-listitem-heading" }, this.heading), h("div", { key: 'a595631e8fa9f9f3464a813075db4b5f7b2c7381', class: "pn-profile-modal-profile-listitem-description" }, this.description))), h("div", { key: 'ee1cc93908696be9706b95e56e57357d8471159a', class: "pn-profile-modal-profile-details", "aria-hidden": !(state.selectedProfile === this.identifier) + '' }, h("pn-button", { key: '8c17659ae0af24c85e6bfd34f685bd3ac42e90e7', appearance: "light", variant: "borderless", icon: arrow_left, "left-icon": "true", small: "true", onClick: () => {
                this.selected = false;
                state.selectedProfile = '';
            } }, state.i18n.toText, " ", state.selectedType), h("div", { key: '5167fbb235356c1bcfb44b98738dc5d317b5229f', class: "pn-profile-modal-profile-details-company" }, h("div", { key: '6bf70e118be76fa69e35edb9fd3781d58d5b3122', class: "pn-profile-modal-profile-details-label" }, state.i18n.choosenCompanyText), h("div", { key: 'b1362bba25cf119e835acc3d769bd450bfa70f6c', class: "pn-profile-modal-profile-details-company-heading" }, this.heading), h("div", { key: 'ab0eedf502f9421515fca32fe99172b481084788', class: "pn-profile-modal-profile-details-company-description" }, this.description)), h("div", { key: 'df41da9a2ac011394d7b0658ebb355a7b194dccb', class: "pn-profile-modal-profile-details-list" }, h("div", { key: 'abbc7bc5fe316fc84cb7062fa890d3e771532943', class: "pn-profile-modal-profile-details-list-label" }, this.pleaseSelectText), h("slot", { key: 'd15ab032e105b8222b3b405cd6e664b654bb6517' })))));
    }
    static get is() { return "pn-profile-modal-profile"; }
    static get originalStyleUrls() {
        return {
            "$": ["pn-profile-modal-profile.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pn-profile-modal-profile.css"]
        };
    }
    static get properties() {
        return {
            "heading": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "heading",
                "reflect": true,
                "defaultValue": "null"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "description",
                "reflect": true,
                "defaultValue": "null"
            },
            "url": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "url",
                "reflect": true,
                "defaultValue": "null"
            },
            "selected": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "selected",
                "reflect": false,
                "defaultValue": "false"
            },
            "showCustomerNumbers": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "show-customer-numbers",
                "reflect": true,
                "defaultValue": "false"
            },
            "pleaseSelectText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "please-select-text",
                "reflect": true,
                "defaultValue": "''"
            },
            "visible": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "visible",
                "reflect": true,
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "identifier": {}
        };
    }
    static get events() {
        return [{
                "method": "urlSelected",
                "name": "urlSelected",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "showCustomerNumbersEvent",
                "name": "showCustomerNumbersEvent",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "hostElement"; }
}
//# sourceMappingURL=pn-profile-modal-profile.js.map
