import { LitElement, html } from "lit";
import { customElement } from "../../decorator.js";
import { property } from "lit/decorators.js";
import { InstrumentState, Priority } from "../types.js";
import { SetpointMixin } from "../../svghelpers/setpoint-mixin.js";
import "../../building-blocks/instrument-radial/instrument-radial.js";
import { TickmarkStyle } from "../watch/tickmark.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 ObcGaugeRadialType = /* @__PURE__ */ ((ObcGaugeRadialType2) => {
  ObcGaugeRadialType2["filled"] = "filled";
  ObcGaugeRadialType2["bar"] = "bar";
  ObcGaugeRadialType2["needle"] = "needle";
  return ObcGaugeRadialType2;
})(ObcGaugeRadialType || {});
let ObcGaugeRadial = class extends SetpointMixin(LitElement) {
  constructor() {
    super(...arguments);
    this.value = 0;
    this.maxValue = 100;
    this.minValue = 0;
    this.showLabels = false;
    this.primaryTickmarkInterval = 50;
    this.secondaryTickmarkInterval = 10;
    this.tertiaryTickmarkInterval = void 0;
    this.state = InstrumentState.active;
    this.priority = Priority.regular;
    this.type = "filled";
    this.tickmarksInside = false;
    this.tickmarkStyle = TickmarkStyle.regular;
    this.advices = [];
  }
  getAngle(v) {
    const hasNegative = this.minValue < 0;
    if (hasNegative) {
      return v / this.maxValue * 135;
    } else {
      return v / this.maxValue * 270 - 135;
    }
  }
  render() {
    return html`
      <obc-instrument-radial
        .value=${this.value}
        .state=${this.state}
        .priority=${this.priority}
        .setpoint=${this.setpoint}
        .newSetpoint=${this.newSetpoint}
        .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}
        .setpointOverride=${this.setpointOverride}
        .touching=${this.touching}
        .autoAtSetpoint=${this.autoAtSetpoint}
        .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}
        .animateSetpoint=${this.animateSetpoint}
        .maxValue=${this.maxValue}
        .minValue=${this.minValue}
        .getAngle=${this.getAngle}
        .showLabels=${this.showLabels}
        .primaryTickmarkInterval=${this.primaryTickmarkInterval}
        .secondaryTickmarkInterval=${this.secondaryTickmarkInterval}
        .tertiaryTickmarkInterval=${this.tertiaryTickmarkInterval}
        .type=${this.type}
        .needleType=${this.type}
        .tickmarksInside=${this.tickmarksInside}
        .tickmarkStyle=${this.tickmarkStyle}
        .advices=${this.advices}
      >
      </obc-instrument-radial>
    `;
  }
};
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "value", 2);
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "maxValue", 2);
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "minValue", 2);
__decorateClass([
  property({ type: Boolean })
], ObcGaugeRadial.prototype, "showLabels", 2);
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "primaryTickmarkInterval", 2);
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "secondaryTickmarkInterval", 2);
__decorateClass([
  property({ type: Number })
], ObcGaugeRadial.prototype, "tertiaryTickmarkInterval", 2);
__decorateClass([
  property({ type: String })
], ObcGaugeRadial.prototype, "state", 2);
__decorateClass([
  property({ type: String })
], ObcGaugeRadial.prototype, "priority", 2);
__decorateClass([
  property({ type: String })
], ObcGaugeRadial.prototype, "type", 2);
__decorateClass([
  property({ type: Boolean })
], ObcGaugeRadial.prototype, "tickmarksInside", 2);
__decorateClass([
  property({ type: String })
], ObcGaugeRadial.prototype, "tickmarkStyle", 2);
__decorateClass([
  property({ type: Array, attribute: false })
], ObcGaugeRadial.prototype, "advices", 2);
ObcGaugeRadial = __decorateClass([
  customElement("obc-gauge-radial")
], ObcGaugeRadial);
export {
  ObcGaugeRadial,
  ObcGaugeRadialType
};
//# sourceMappingURL=gauge-radial.js.map
