import { h } from "@stencil/core";
export class BpSdkBusinessClassificationSelectorListItem {
    constructor() {
        this.onSelection = (e) => {
            e.preventDefault();
            if (!this.locked) {
                this.valueUpdate.emit([this.choiceId]);
            }
        };
        this.onKeyPress = (e) => {
            if (e.key === 'Enter' || e.key === ' ') {
                this.onSelection(e);
            }
        };
        this.alias = undefined;
        this.value = undefined;
        this.highlights = undefined;
        this.isSelected = false;
        this.showExplanation = true;
        this.confidence = undefined;
        this.showConfidence = undefined;
        this.choiceId = undefined;
        this.showDetailedRelevanceChip = undefined;
        this.locked = undefined;
        this.isBestMatch = undefined;
        this.isoCodes = undefined;
        this.sicCodes = undefined;
        this.useExternal = false;
        this.isExpanded = false;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-business-classification-selector-list-item');
        customElements.whenDefined('bp-sdk-external-business-classification-selector-list-item').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-business-classification-selector-list-item", { alias: this.alias, isSelected: this.isSelected, showExplanation: this.showExplanation, confidence: this.confidence, choiceId: this.choiceId, showConfidence: this.showConfidence, value: this.value, highlights: this.highlights, showDetailedRelevanceChip: this.showDetailedRelevanceChip, isBestMatch: this.isBestMatch, locked: this.locked }));
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-business-classification-selector-list-item__container" }, h("bp-sdk-business-classification-selector-card-content", { alias: this.alias, confidence: this.confidence, onClick: this.onSelection, showConfidence: this.showConfidence, showDetailedRelevanceChip: this.showDetailedRelevanceChip, value: this.value, highlights: this.highlights, isSelected: this.isSelected, isBestMatch: this.isBestMatch, isoCodes: this.isoCodes, sicCodes: this.sicCodes, tabIndex: 0, role: "button", onKeyPress: this.onKeyPress })));
    }
    static get is() { return "bp-sdk-business-classification-selector-list-item"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-business-classification-selector-list-item.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-business-classification-selector-list-item.css"]
        };
    }
    static get properties() {
        return {
            "alias": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Alias of choice"
                },
                "attribute": "alias",
                "reflect": false
            },
            "value": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Value of choice"
                },
                "attribute": "value",
                "reflect": false
            },
            "highlights": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoiceHighlight[] | undefined",
                    "resolved": "IChoiceHighlight[]",
                    "references": {
                        "IChoiceHighlight": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoiceHighlight"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "List of highlight's"
                }
            },
            "isSelected": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is choice selected"
                },
                "attribute": "is-selected",
                "reflect": false,
                "defaultValue": "false"
            },
            "showExplanation": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show explanation"
                },
                "attribute": "show-explanation",
                "reflect": false,
                "defaultValue": "true"
            },
            "confidence": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Confidence level"
                },
                "attribute": "confidence",
                "reflect": false
            },
            "showConfidence": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Should show confidence"
                },
                "attribute": "show-confidence",
                "reflect": false
            },
            "choiceId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Choice's id"
                },
                "attribute": "choice_id",
                "reflect": false
            },
            "showDetailedRelevanceChip": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show detailed relevance chip"
                },
                "attribute": "show-detailed-relevance-chip",
                "reflect": false
            },
            "locked": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is application form locked"
                },
                "attribute": "locked",
                "reflect": false
            },
            "isBestMatch": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Is best choice match"
                },
                "attribute": "is-best-match",
                "reflect": false
            },
            "isoCodes": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoiceObject[]",
                    "resolved": "IChoiceObject[]",
                    "references": {
                        "IChoiceObject": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoiceObject"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "List of matching ISO codes"
                }
            },
            "sicCodes": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoiceObject[]",
                    "resolved": "IChoiceObject[]",
                    "references": {
                        "IChoiceObject": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoiceObject"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "List of matching SIC codes"
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {},
            "isExpanded": {}
        };
    }
    static get events() {
        return [{
                "method": "valueUpdate",
                "name": "valueUpdate",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "string[]",
                    "resolved": "string[]",
                    "references": {}
                }
            }];
    }
}
