import { html } from "lit";
import { property } from "lit/decorators.js";
import { customElement } from "../../decorator.js";
import { ObcPoiButton } from "../building-blocks/poi-button/poi-button.js";
import { ObcPoiObjectType } from "../building-blocks/poi-object/poi-object.js";
import { ObcPoiObjectVesselType, ObcPoiObjectVesselStyle } from "../poi-object-vessel/poi-object-vessel.js";
import { ObcPoiObjectVesselState } from "../poi-object-vessel/poi-object-vessel.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;
};
let ObcPoiButtonVessel = class extends ObcPoiButton {
  constructor() {
    super(...arguments);
    this.vesselType = ObcPoiObjectVesselType.Regular;
    this.vesselStyle = ObcPoiObjectVesselStyle.Regular;
    this.vesselState = null;
    this.vesselInteractive = false;
  }
  /**
   * Maps the button's computed `poiObjectType` (Regular/Large) to the
   * vessel type enum.  When the vessel is in speed-rot mode the type
   * is fixed — otherwise it follows the button size.
   */
  get resolvedVesselType() {
    if (this.vesselType === ObcPoiObjectVesselType.SpeedRot) {
      return ObcPoiObjectVesselType.SpeedRot;
    }
    switch (this.poiObjectType) {
      case ObcPoiObjectType.Large:
        return ObcPoiObjectVesselType.Large;
      default:
        return this.vesselType;
    }
  }
  renderPoiObject() {
    return html`
      <obc-poi-object-vessel
        class="poi-object"
        exportparts="background-frame"
        .type=${this.resolvedVesselType}
        .objectStyle=${this.vesselStyle}
        .state=${this.vesselState ?? this.poiObjectState}
        ?interactive=${this.vesselInteractive}
      >
        <span
          class="icon"
          style="transform: rotate(${this.relativeDirection}deg);"
        >
          <slot></slot>
        </span>
        <slot name="turn-indicator" slot="turn-indicator"></slot>
        <slot name="speed-indicator" slot="speed-indicator"></slot>
      </obc-poi-object-vessel>
    `;
  }
};
__decorateClass([
  property({ type: String, attribute: "vessel-type" })
], ObcPoiButtonVessel.prototype, "vesselType", 2);
__decorateClass([
  property({ type: String, attribute: "vessel-style" })
], ObcPoiButtonVessel.prototype, "vesselStyle", 2);
__decorateClass([
  property({ type: String, attribute: "vessel-state" })
], ObcPoiButtonVessel.prototype, "vesselState", 2);
__decorateClass([
  property({ type: Boolean, attribute: "vessel-interactive" })
], ObcPoiButtonVessel.prototype, "vesselInteractive", 2);
ObcPoiButtonVessel = __decorateClass([
  customElement("obc-poi-button-vessel")
], ObcPoiButtonVessel);
export {
  ObcPoiButtonVessel,
  ObcPoiObjectVesselState,
  ObcPoiObjectVesselStyle,
  ObcPoiObjectVesselType
};
//# sourceMappingURL=poi-button-vessel.js.map
