import { html } from "lit";
import { property } from "lit/decorators.js";
import "../valve-analoge-two-way-icon/valve-analog-two-way-icon.js";
import { customElement } from "../../decorator.js";
import { ObcAbstractAutomationButton } from "../automation-button/abstract-automation-button.js";
import { AutomationButtonLabelDirection } from "../automation-button/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 AnalogValveVariant = /* @__PURE__ */ ((AnalogValveVariant2) => {
  AnalogValveVariant2["regular"] = "regular";
  AnalogValveVariant2["flat"] = "flat";
  return AnalogValveVariant2;
})(AnalogValveVariant || {});
let ObcAnalogValve = class extends ObcAbstractAutomationButton {
  constructor() {
    super(...arguments);
    this.open = false;
    this.value = 0;
    this.vertical = false;
    this.labelDirection = AutomationButtonLabelDirection.right;
    this.variant = "regular";
  }
  get extraReadouts() {
    if (this.open) {
      return [
        {
          type: "value",
          icon: "arrow",
          value: this.value,
          nDigits: 3,
          unit: "%",
          direction: this.labelDirection
        }
      ];
    } else {
      return [
        {
          type: "state-off",
          value: "Off",
          hasIcon: true
        }
      ];
    }
  }
  get _on() {
    return this.open;
  }
  get icon() {
    return html`<obc-valve-analog-two-way-icon
        .value=${this.value}
        .closed=${!this.open}
        .vertical=${this.vertical}
        slot="icon"
      ></obc-valve-analog-two-way-icon>
      <obc-valve-analog-two-way-icon
        .value=${this.value}
        .closed=${!this.open}
        .vertical=${this.vertical}
        slot="icon-silhouette"
      ></obc-valve-analog-two-way-icon> `;
  }
};
__decorateClass([
  property({ type: Boolean })
], ObcAnalogValve.prototype, "open", 2);
__decorateClass([
  property({ type: Number })
], ObcAnalogValve.prototype, "value", 2);
__decorateClass([
  property({ type: Boolean })
], ObcAnalogValve.prototype, "vertical", 2);
__decorateClass([
  property({ type: String })
], ObcAnalogValve.prototype, "labelDirection", 2);
__decorateClass([
  property({ type: String })
], ObcAnalogValve.prototype, "variant", 2);
ObcAnalogValve = __decorateClass([
  customElement("obc-analog-valve")
], ObcAnalogValve);
export {
  AnalogValveVariant,
  ObcAnalogValve
};
//# sourceMappingURL=analog-valve.js.map
