import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
import { g as getTranslation } from './getTranslation.js';
import { p as partsExports } from './partsExports.js';
import { d as defineCustomElement$3 } from './klevu-icon2.js';
import { d as defineCustomElement$2 } from './klevu-list2.js';
import { d as defineCustomElement$1 } from './klevu-typography2.js';

const klevuCmsListCss = ":host{display:block}klevu-typography.caption{margin-bottom:var(--klevu-spacing-02)}";

const KlevuCmsList = /*@__PURE__*/ proxyCustomElement(class KlevuCmsList extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.klevuCmsPageClick = createEvent(this, "klevuCmsPageClick", 7);
    this.pages = undefined;
    this.link = undefined;
    this.tCaption = getTranslation("cmsList.tCaption");
  }
  render() {
    var _a;
    return (h(Host, null, h("klevu-typography", { class: "caption", variant: "h3", part: "cms-list-caption" }, this.tCaption), (_a = this.pages) === null || _a === void 0 ? void 0 :
      _a.map((page) => {
        if (this.link) {
          return (h("klevu-list", { url: page.url, condensed: true, noXPadding: true, exportparts: partsExports("klevu-list") }, h("span", { slot: "primary" }, page.name)));
        }
        return (h("klevu-list", { onClick: () => this.klevuCmsPageClick.emit(page), exportparts: partsExports("klevu-list"), condensed: true, noXPadding: true }, h("span", { slot: "primary" }, page.name)));
      })));
  }
  static get style() { return klevuCmsListCss; }
}, [1, "klevu-cms-list", {
    "pages": [16],
    "link": [4],
    "tCaption": [1, "t-caption"]
  }]);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["klevu-cms-list", "klevu-icon", "klevu-list", "klevu-typography"];
  components.forEach(tagName => { switch (tagName) {
    case "klevu-cms-list":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, KlevuCmsList);
      }
      break;
    case "klevu-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "klevu-list":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
    case "klevu-typography":
      if (!customElements.get(tagName)) {
        defineCustomElement$1();
      }
      break;
  } });
}
defineCustomElement();

export { KlevuCmsList as K, defineCustomElement as d };

//# sourceMappingURL=klevu-cms-list2.js.map