import { h } from '@stencil/core';
export class EclPageHeader {
  constructor() {
    this.styleClass = '';
    this.variant = 'default';
    this.theme = 'ec';
    this.image = undefined;
    this.meta = undefined;
    this.headerTitle = undefined;
    this.thumbnail = undefined;
    this.thumbnailAlt = undefined;
    this.overlay = undefined;
  }
  getClass() {
    const styleClasses = [
      `ecl-page-header`,
      `ecl-page-header--${this.variant}`,
      this.styleClass
    ];
    if (this.image) {
      styleClasses.push('ecl-page-header--image');
    }
    if (this.overlay) {
      styleClasses.push(`ecl-page-header--overlay-${this.overlay}`);
    }
    return styleClasses.join(' ');
  }
  componentDidRender() {
    if (this.el.querySelector('.ecl-breadcrumb')) {
      this.el.querySelector('.ecl-breadcrumb').classList.add(`ecl-page-header__breadcrumb`, `sc-ecl-page-header-${this.theme}`);
      this.el.querySelector('.ecl-breadcrumb__container').classList.add(`sc-ecl-page-header-${this.theme}`);
      this.el.querySelectorAll('.ecl-breadcrumb__segment').forEach((segment) => {
        segment.classList.add(`sc-ecl-page-header-${this.theme}`);
      });
    }
  }
  ;
  render() {
    return (h("div", { class: this.getClass() }, this.image ?
      h("div", { class: "ecl-page-header__background", style: { backgroundImage: "url(" + this.image + ")" }, "aria-hidden": "true" }) : '', h("div", { class: "ecl-container" }, h("slot", { name: "breadcrumb" }), this.meta ?
      h("div", { class: "ecl-page-header__meta" }, h("span", { class: "ecl-page-header__meta-item" }, this.meta)) : '', h("div", { class: "ecl-page-header__title-container" }, h("h1", { class: "ecl-page-header__title" }, this.headerTitle)), h("div", { class: "ecl-page-header__description-container" }, this.thumbnail ?
      h("img", { class: "ecl-page-header__description-thumbnail", src: this.thumbnail, alt: this.thumbnailAlt }) : '', h("p", { class: "ecl-page-header__description" }, h("slot", null))))));
  }
  ;
  static get is() { return "ecl-page-header"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-page-header-ec.css"],
      "eu": ["./build/styles/ecl-page-header-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-page-header-ec.css"],
      "eu": ["./build/styles/ecl-page-header-eu.css"]
    };
  }
  static get properties() {
    return {
      "styleClass": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "style-class",
        "reflect": false,
        "defaultValue": "''"
      },
      "variant": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "variant",
        "reflect": false,
        "defaultValue": "'default'"
      },
      "theme": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "theme",
        "reflect": false,
        "defaultValue": "'ec'"
      },
      "image": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "image",
        "reflect": false
      },
      "meta": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "meta",
        "reflect": false
      },
      "headerTitle": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "header-title",
        "reflect": false
      },
      "thumbnail": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "thumbnail",
        "reflect": false
      },
      "thumbnailAlt": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "thumbnail-alt",
        "reflect": false
      },
      "overlay": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "overlay",
        "reflect": false
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-page-header.js.map
