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

const klevuChipCss = ":host{display:inline-block;padding:var(--klevu-spacing-02) var(--klevu-spacing-05);border-radius:var(--klevu-chip-radius, var(--klevu-border-radius-xxl));align-items:center;border:1px solid var(--klevu-chip-border, var(--klevu-color-neutral-5))}:host(.removable){display:inline-flex}:host(.selected){background-color:var(--klevu-chip-selected-background, rgba(var(--klevu-color-primary-rgb), 0.2));border-color:var(--klevu-chip-selected-border, var(--klevu-color-primary))}span[part=\"material-icon\"]{position:relative;top:1px;left:-4px;font-size:0.7em;padding:2px;margin-right:var(--klevu-spacing-01);cursor:pointer;user-select:none}klevu-typography{line-height:1}";

var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuChip_instances, _KlevuChip_close;
const KlevuChip$1 = /*@__PURE__*/ proxyCustomElement(class KlevuChip extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.klevuChipRemove = createEvent(this, "klevuChipRemove", 7);
    _KlevuChip_instances.add(this);
    this.selected = false;
    this.removable = false;
  }
  render() {
    return (h(Host, { class: { removable: Boolean(this.removable), selected: Boolean(this.selected) } }, this.removable && (h("span", { onClick: __classPrivateFieldGet(this, _KlevuChip_instances, "m", _KlevuChip_close).bind(this), part: "material-icon" }, "close")), h("klevu-typography", { variant: "body-xs" }, h("slot", null))));
  }
  static get style() { return klevuChipCss; }
}, [1, "klevu-chip", {
    "selected": [4],
    "removable": [4]
  }]);
_KlevuChip_instances = new WeakSet(), _KlevuChip_close = function _KlevuChip_close() {
  if (this.removable) {
    this.klevuChipRemove.emit();
  }
};
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["klevu-chip", "klevu-typography"];
  components.forEach(tagName => { switch (tagName) {
    case "klevu-chip":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, KlevuChip$1);
      }
      break;
    case "klevu-typography":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const KlevuChip = KlevuChip$1;
const defineCustomElement = defineCustomElement$1;

export { KlevuChip, defineCustomElement };

//# sourceMappingURL=klevu-chip.js.map