import { unsafeCSS, LitElement, nothing, html } from "lit";
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { styleMap } from "lit/directives/style-map.js";
import { customElement } from "../../decorator.js";
import componentStyle from "./sequence-connector.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 SequenceConnectorType = /* @__PURE__ */ ((SequenceConnectorType2) => {
  SequenceConnectorType2["small"] = "small";
  SequenceConnectorType2["medium"] = "medium";
  SequenceConnectorType2["large"] = "large";
  return SequenceConnectorType2;
})(SequenceConnectorType || {});
var SequenceConnectorState = /* @__PURE__ */ ((SequenceConnectorState2) => {
  SequenceConnectorState2["notStarted"] = "not-started";
  SequenceConnectorState2["loading"] = "loading";
  SequenceConnectorState2["completed"] = "completed";
  SequenceConnectorState2["stepsBetween"] = "steps-between";
  return SequenceConnectorState2;
})(SequenceConnectorState || {});
var SequenceConnectorDirection = /* @__PURE__ */ ((SequenceConnectorDirection2) => {
  SequenceConnectorDirection2["horizontal"] = "horizontal";
  SequenceConnectorDirection2["vertical"] = "vertical";
  return SequenceConnectorDirection2;
})(SequenceConnectorDirection || {});
let ObcSequenceConnector = class extends LitElement {
  constructor() {
    super(...arguments);
    this.type = "medium";
    this.state = "not-started";
    this.direction = "horizontal";
    this.loadingBarPercent = 66;
  }
  get wrapperClasses() {
    return {
      "sequence-connector": true,
      [`type-${this.type}`]: true,
      [`state-${this.state}`]: true
    };
  }
  get containerClasses() {
    return {
      [`direction-${this.direction}`]: true,
      [`state-${this.state}`]: true
    };
  }
  get clampedLoadingBarPercent() {
    const percent = Number.isFinite(this.loadingBarPercent) ? this.loadingBarPercent : 66;
    return Math.min(100, Math.max(0, percent));
  }
  render() {
    return html`
      <div class=${classMap(this.containerClasses)}>
        <div
          class=${classMap(this.wrapperClasses)}
          style=${styleMap({
      "--loading-bar-percent": `${this.clampedLoadingBarPercent}%`
    })}
          part="wrapper"
        >
          <div class="line" part="line">
            ${this.state === "loading" ? html`<span class="loading-bar" part="loading-bar"></span>` : nothing}
          </div>
        </div>
      </div>
    `;
  }
};
ObcSequenceConnector.styles = unsafeCSS(componentStyle);
__decorateClass([
  property({ type: String })
], ObcSequenceConnector.prototype, "type", 2);
__decorateClass([
  property({ type: String })
], ObcSequenceConnector.prototype, "state", 2);
__decorateClass([
  property({ type: String })
], ObcSequenceConnector.prototype, "direction", 2);
__decorateClass([
  property({ type: Number, attribute: "loading-bar-percent" })
], ObcSequenceConnector.prototype, "loadingBarPercent", 2);
ObcSequenceConnector = __decorateClass([
  customElement("obc-sequence-connector")
], ObcSequenceConnector);
export {
  ObcSequenceConnector,
  SequenceConnectorDirection,
  SequenceConnectorState,
  SequenceConnectorType
};
//# sourceMappingURL=sequence-connector.js.map
