import { html } from "lit";
import { property } from "lit/decorators.js";
import "../../icons/icon-twoway-digital-open.js";
import "../../icons/icon-twoway-digital-closed.js";
import { customElement } from "../../decorator.js";
import { ObcAbstractAutomationButton } from "../automation-button/abstract-automation-button.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 DigitalValveVariant = /* @__PURE__ */ ((DigitalValveVariant2) => {
  DigitalValveVariant2["regular"] = "regular";
  DigitalValveVariant2["flat"] = "flat";
  return DigitalValveVariant2;
})(DigitalValveVariant || {});
let ObcDigitalValve = class extends ObcAbstractAutomationButton {
  constructor() {
    super(...arguments);
    this.open = false;
    this.vertical = false;
    this.variant = "regular";
  }
  get _on() {
    return this.open;
  }
  get extraReadouts() {
    if (this.open) {
      return [
        {
          type: "state-on",
          value: "On",
          hasIcon: true
        }
      ];
    } else {
      return [
        {
          type: "state-off",
          value: "Off",
          hasIcon: true
        }
      ];
    }
  }
  get icon() {
    const transform = this.vertical ? "transform: rotate(90deg);" : "";
    if (this.open) {
      return html` <obi-twoway-digital-open
          usecsscolor
          slot="icon"
          style="display: block; ${transform} line-height: 0;"
        ></obi-twoway-digital-open>
        <obi-twoway-digital-open
          usecsscolor
          slot="icon-silhouette"
          style="display: block; ${transform} line-height: 0;"
        ></obi-twoway-digital-open>`;
    } else {
      return html` <obi-twoway-digital-closed
          usecsscolor
          slot="icon"
          style="display: block; ${transform} line-height: 0;"
        ></obi-twoway-digital-closed>
        <obi-twoway-digital-closed
          usecsscolor
          slot="icon-silhouette"
          style="display: block; ${transform} line-height: 0;"
        ></obi-twoway-digital-closed>`;
    }
  }
};
__decorateClass([
  property({ type: Boolean })
], ObcDigitalValve.prototype, "open", 2);
__decorateClass([
  property({ type: Boolean })
], ObcDigitalValve.prototype, "vertical", 2);
__decorateClass([
  property({ type: String })
], ObcDigitalValve.prototype, "variant", 2);
ObcDigitalValve = __decorateClass([
  customElement("obc-digital-valve")
], ObcDigitalValve);
export {
  DigitalValveVariant,
  ObcDigitalValve
};
//# sourceMappingURL=digital-valve.js.map
