import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { d as defineCustomElement$2 } from './ic-typography2.js';

const icClassificationBannerCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:fixed;left:0;bottom:0;width:100%;height:var(--ic-space-lg);z-index:var(--ic-z-index-classification-banner);--ic-typography-color:currentcolor}:host(.ic-classification-banner-inline){position:static;left:auto;bottom:auto}.classification-banner{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:var(--ic-space-xxxs) var(--ic-space-md)}.default{background-color:var(--ic-classification-banner-not-set);color:var(--ic-classification-banner-text-inverted)}.official{background-color:var(--ic-classification-banner-official);color:var(--ic-classification-banner-text-inverted)}.official-sensitive{background-color:var(--ic-classification-banner-official-sensitive);color:var(--ic-classification-banner-text-inverted)}.secret{background-color:var(--ic-classification-banner-secret);color:var(--ic-classification-banner-text)}.top-secret{background-color:var(--ic-classification-banner-top-secret);color:var(--ic-classification-banner-text-inverted)}.offscreen{position:absolute;left:-9999px;background-color:#fff;color:#000;text-transform:none}.offscreen:dir(rtl){right:-9999px}@media (forced-colors: active){.classification-banner{border:var(--ic-border-hc)}}";
const IcClassificationBannerStyle0 = icClassificationBannerCss;

const classificationText = {
    default: "protective marking not set",
    official: "official",
    "official-sensitive": "official-sensitive",
    secret: "secret",
    "top-secret": "top secret",
};
const ClassificationBanner = /*@__PURE__*/ proxyCustomElement(class ClassificationBanner extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        /**
         * 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 style() { return IcClassificationBannerStyle0; }
}, [1, "ic-classification-banner", {
        "additionalSelectors": [1, "additional-selectors"],
        "classification": [1],
        "country": [1],
        "customClassificationText": [1, "custom-classification-text"],
        "inline": [4],
        "upTo": [4, "up-to"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["ic-classification-banner", "ic-typography"];
    components.forEach(tagName => { switch (tagName) {
        case "ic-classification-banner":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, ClassificationBanner);
            }
            break;
        case "ic-typography":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const IcClassificationBanner = ClassificationBanner;
const defineCustomElement = defineCustomElement$1;

export { IcClassificationBanner, defineCustomElement };

//# sourceMappingURL=ic-classification-banner.js.map