import { h, Host } from "@stencil/core";
const classificationText = {
    default: "protective marking not set",
    official: "official",
    "official-sensitive": "official-sensitive",
    secret: "secret",
    "top-secret": "top secret",
};
export class ClassificationBanner {
    constructor() {
        /**
         * The additional information that will be displayed after the classification.
         */
        this.additionalSelectors = "";
        /**
         * The classification level to be displayed - also determines the banner and text colour.
         */
        this.classification = "default";
        /**
         * The optional text that will be displayed before classification to specify relevant country/countries.
         */
        this.country = "uk";
        /**
         * The custom text that will appear on the banner. If set, the `additionalSelectors`, `country` and `upTo` props are ignored.
         */
        this.customClassificationText = "";
        /**
         * If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page.
         */
        this.inline = false;
        /**
         * If `true`, "Up to" will be displayed before the classification and country.
         */
        this.upTo = false;
    }
    render() {
        const { inline, upTo } = this;
        // In case of unrecognized props, fallback to default
        let { country, additionalSelectors, classification, customClassificationText, } = this;
        if (!country)
            country = "";
        if (!additionalSelectors)
            additionalSelectors = "";
        if (!classification ||
            (classification && !classificationText[classification]))
            classification = "default";
        if (!customClassificationText)
            customClassificationText = "";
        return (h(Host, { key: 'dbf7b4fe92229fd32723c06070338a3611939bd5', class: { ["ic-classification-banner-inline"]: !!inline } }, h("banner", { key: '23e95a6a2ca33447e1b64cda93690cf6781bd14f', "aria-label": "Protective marking", class: {
                ["classification-banner"]: true,
                [`${classification}`]: classification,
            } }, classification !== "default" ? (h("span", { class: "offscreen" }, "The protective marking of this page is:", " ")) : null, h("ic-typography", { key: 'ff41a45d594eeeffe2f078b3ae3a99792a6f38c3', variant: "caption-uppercase" }, customClassificationText !== ""
            ? customClassificationText
            : classification === "default"
                ? classificationText[classification]
                : `${upTo ? "up to" : ""} 
               ${country} 
               ${classificationText[classification]} 
               ${additionalSelectors}`))));
    }
    static get is() { return "ic-classification-banner"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["ic-classification-banner.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["ic-classification-banner.css"]
        };
    }
    static get properties() {
        return {
            "additionalSelectors": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The additional information that will be displayed after the classification."
                },
                "getter": false,
                "setter": false,
                "attribute": "additional-selectors",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "classification": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcProtectiveMarkings",
                    "resolved": "\"default\" | \"official\" | \"official-sensitive\" | \"secret\" | \"top-secret\" | undefined",
                    "references": {
                        "IcProtectiveMarkings": {
                            "location": "import",
                            "path": "./ic-classification-banner.types",
                            "id": "src/components/ic-classification-banner/ic-classification-banner.types.tsx::IcProtectiveMarkings"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The classification level to be displayed - also determines the banner and text colour."
                },
                "getter": false,
                "setter": false,
                "attribute": "classification",
                "reflect": false,
                "defaultValue": "\"default\""
            },
            "country": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The optional text that will be displayed before classification to specify relevant country/countries."
                },
                "getter": false,
                "setter": false,
                "attribute": "country",
                "reflect": false,
                "defaultValue": "\"uk\""
            },
            "customClassificationText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The custom text that will appear on the banner. If set, the `additionalSelectors`, `country` and `upTo` props are ignored."
                },
                "getter": false,
                "setter": false,
                "attribute": "custom-classification-text",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "inline": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page."
                },
                "getter": false,
                "setter": false,
                "attribute": "inline",
                "reflect": false,
                "defaultValue": "false"
            },
            "upTo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, \"Up to\" will be displayed before the classification and country."
                },
                "getter": false,
                "setter": false,
                "attribute": "up-to",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
}
//# sourceMappingURL=ic-classification-banner.js.map
