import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$3 } from './ecl-icon2.js';
import { d as defineCustomElement$2 } from './ecl-link2.js';

const EclCategoryFilterItem$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.styleClass = '';
    this.theme = 'ec';
    this.label = undefined;
    this.path = undefined;
    this.level = undefined;
    this.subItems = false;
  }
  getClass() {
    return [
      `ecl-category-filter__list-item`,
      `sc-ecl-category-filter-${this.theme}`,
      this.styleClass
    ].join(' ');
  }
  getLinkClass() {
    const linkClasses = [
      `ecl-category-filter__item`,
      `sc-ecl-category-filter-${this.theme}`,
      `ecl-category-filter__item--level-${this.level}`,
      this.styleClass
    ];
    if (this.subItems) {
      linkClasses.push(`ecl-category-filter__item--has-children`);
    }
    return linkClasses.join(' ');
  }
  render() {
    const elAttrs = this.subItems ? { 'aria-expanded': "false" } : {};
    return (h("li", Object.assign({ class: this.getClass() }, elAttrs), this.path ?
      h("ecl-link", { "style-class": this.getLinkClass(), path: this.path }, this.label, this.subItems ?
        h("ecl-icon", { "style-class": `ecl-category-filter__item-icon sc-ecl-category-filter-${this.theme}`, icon: this.level === 1 ? 'corner-arrow' : 'solid-arrow', size: this.level === 1 ? 'xs' : 'm', transform: this.level === 1 ? 'rotate-180' : 'rotate-90', slot: this.level === 1 ? 'icon-after' : 'icon-before' }) : '') : '', !this.path ? this.label : '', this.subItems ?
      h("ul", { class: `ecl-category-filter__list sc-ecl-category-filter-${this.theme}` }, h("slot", null)) : ''));
  }
  get el() { return this; }
}, [4, "ecl-category-filter-item", {
    "styleClass": [1, "style-class"],
    "theme": [1],
    "label": [1],
    "path": [1],
    "level": [2],
    "subItems": [4, "sub-items"]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["ecl-category-filter-item", "ecl-icon", "ecl-link"];
  components.forEach(tagName => { switch (tagName) {
    case "ecl-category-filter-item":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, EclCategoryFilterItem$1);
      }
      break;
    case "ecl-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "ecl-link":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}

const EclCategoryFilterItem = EclCategoryFilterItem$1;
const defineCustomElement = defineCustomElement$1;

export { EclCategoryFilterItem, defineCustomElement };

//# sourceMappingURL=ecl-category-filter-item.js.map