import { h } from "@stencil/core";
export class BpSdkBusinessClassificationSelectorNaicsGroup {
    constructor() {
        this.choices = [];
        this.showConfidence = undefined;
        this.showNaicsCode = undefined;
        this.naicsCode = '';
        this.naicsExplanation = '';
        this.naicsDescription = '';
        this.choiceId = undefined;
        this.highestChoiceScore = undefined;
        this.useExternal = false;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-business-classification-selector-naics-group');
        customElements.whenDefined('bp-sdk-external-business-classification-selector-naics-group').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-business-classification-selector-naics-group", { choices: this.choices, showConfidence: this.showNaicsCode, showNaicsCode: this.showNaicsCode, naicsCode: this.naicsCode, naicsDescription: this.naicsDescription, naicsExplanation: this.naicsExplanation, highestChoiceScore: this.highestChoiceScore, choiceId: this.choiceId }));
    }
    renderInternal() {
        var _a;
        return (h("div", { class: "bp-sdk-business-classification-selector-naics-group__container" }, h("bp-sdk-business-classification-selector-naics-group-header", { naicsCode: this.showNaicsCode ? this.naicsCode : undefined, naicsDescription: this.naicsDescription, naicsExplanation: this.naicsExplanation }), (_a = this.choices) === null || _a === void 0 ? void 0 :
            _a.map((choice) => (h("bp-sdk-business-classification-selector-list-item-container", { alias: choice.alias, choiceId: choice.id, confidence: choice.confidence, isSelected: choice.id === this.choiceId, showConfidence: this.showConfidence, showExplanation: choice.showExplanation, value: choice.value, highlights: choice.highlights, isBestMatch: choice.score === this.highestChoiceScore, isoCodes: choice.iso_codes, sicCodes: choice.sic_codes })))));
    }
    static get is() { return "bp-sdk-business-classification-selector-naics-group"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-business-classification-selector-naics-group.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-business-classification-selector-naics-group.css"]
        };
    }
    static get properties() {
        return {
            "choices": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IChoice[]",
                    "resolved": "IChoice[]",
                    "references": {
                        "IChoice": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IChoice"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "*\nChoices to display"
                },
                "defaultValue": "[]"
            },
            "showConfidence": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show confidence score preference"
                },
                "attribute": "show-confidence",
                "reflect": false
            },
            "showNaicsCode": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Show naics code preference"
                },
                "attribute": "show-naics-code",
                "reflect": false
            },
            "naicsCode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "NAICS code for this group"
                },
                "attribute": "naics-code",
                "reflect": false,
                "defaultValue": "''"
            },
            "naicsExplanation": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "NAICS explanation for this group"
                },
                "attribute": "naics-explanation",
                "reflect": false,
                "defaultValue": "''"
            },
            "naicsDescription": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "NAICS industry description for this group"
                },
                "attribute": "naics-description",
                "reflect": false,
                "defaultValue": "''"
            },
            "choiceId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Selected choice id"
                },
                "attribute": "choice_id",
                "reflect": false
            },
            "highestChoiceScore": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Score for the highest scored choice"
                },
                "attribute": "highest-choice-score",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
