import { unsafeCSS, LitElement, html, nothing } from "lit";
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { customElement } from "../../../decorator.js";
import componentStyle from "./poi-header.css.js";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
var ObcPoiHeaderSize = /* @__PURE__ */ ((ObcPoiHeaderSize2) => {
  ObcPoiHeaderSize2["Regular"] = "regular";
  return ObcPoiHeaderSize2;
})(ObcPoiHeaderSize || {});
var ObcPoiHeaderState = /* @__PURE__ */ ((ObcPoiHeaderState2) => {
  ObcPoiHeaderState2["Enabled"] = "enabled";
  ObcPoiHeaderState2["Selected"] = "selected";
  ObcPoiHeaderState2["Caution"] = "caution";
  ObcPoiHeaderState2["Warning"] = "warning";
  ObcPoiHeaderState2["Alarm"] = "alarm";
  return ObcPoiHeaderState2;
})(ObcPoiHeaderState || {});
var ObcPoiHeaderType = /* @__PURE__ */ ((ObcPoiHeaderType2) => {
  ObcPoiHeaderType2["Data"] = "data";
  ObcPoiHeaderType2["Id"] = "id";
  return ObcPoiHeaderType2;
})(ObcPoiHeaderType || {});
let ObcPoiHeader = class extends LitElement {
  constructor() {
    super(...arguments);
    this.content = "1";
    this.label = "Data";
    this.size = "regular";
    this.state = "enabled";
    this.type = "id";
    this.hasIndicator = false;
  }
  get isDataType() {
    return this.type === "data";
  }
  get isEnabled() {
    return this.state === "enabled";
  }
  get hasSingleCharacterContent() {
    return this.content?.trim().length === 1;
  }
  renderIndicator() {
    const withFrame = this.isDataType && this.isEnabled;
    const defaultIndicator = html`
      <span class="indicator" aria-hidden="true" data-node-id="10534:68353">
        <span class="bar left" data-node-id="10534:68366"></span>
        <span class="bar middle" data-node-id="10534:68365"></span>
        <span class="bar right" data-node-id="10534:68367"></span>
      </span>
    `;
    const indicator = html`<slot name="indicator">${defaultIndicator}</slot>`;
    if (!withFrame) {
      return indicator;
    }
    return html`<span class="indicator-frame">${indicator}</span>`;
  }
  renderIdOnly() {
    return html`<span class="id-only-text">${this.content}</span>`;
  }
  renderData() {
    return html`
      <div class="id-pill">
        <span class="id-text">${this.content}</span>
      </div>
      <div class="label-pill">
        <span class="label-text">${this.label}</span>
      </div>
    `;
  }
  render() {
    return html`
      <div
        class=${classMap({
      wrapper: true,
      [`size-${this.size}`]: true,
      [`state-${this.state}`]: true,
      [`type-${this.type}`]: true,
      "single-char-content": this.hasSingleCharacterContent,
      "has-indicator": this.hasIndicator
    })}
        data-node-id="10389:51689"
      >
        ${this.isDataType ? this.renderData() : this.renderIdOnly()}
        ${this.hasIndicator ? this.renderIndicator() : nothing}
      </div>
    `;
  }
};
ObcPoiHeader.styles = unsafeCSS(componentStyle);
__decorateClass([
  property({ type: String })
], ObcPoiHeader.prototype, "content", 2);
__decorateClass([
  property({ type: String })
], ObcPoiHeader.prototype, "label", 2);
__decorateClass([
  property({ type: String, reflect: true })
], ObcPoiHeader.prototype, "size", 2);
__decorateClass([
  property({ type: String, reflect: true })
], ObcPoiHeader.prototype, "state", 2);
__decorateClass([
  property({ type: String, reflect: true })
], ObcPoiHeader.prototype, "type", 2);
__decorateClass([
  property({ type: Boolean, attribute: "has-indicator" })
], ObcPoiHeader.prototype, "hasIndicator", 2);
ObcPoiHeader = __decorateClass([
  customElement("obc-poi-header")
], ObcPoiHeader);
export {
  ObcPoiHeader,
  ObcPoiHeaderSize,
  ObcPoiHeaderState,
  ObcPoiHeaderType
};
//# sourceMappingURL=poi-header.js.map
