'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-6377956f.js');

const EclCategoryFilterItem = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    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 (index.h("li", Object.assign({ class: this.getClass() }, elAttrs), this.path ?
      index.h("ecl-link", { "style-class": this.getLinkClass(), path: this.path }, this.label, this.subItems ?
        index.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 ?
      index.h("ul", { class: `ecl-category-filter__list sc-ecl-category-filter-${this.theme}` }, index.h("slot", null)) : ''));
  }
  get el() { return index.getElement(this); }
};

exports.ecl_category_filter_item = EclCategoryFilterItem;

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