'use strict';

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const shared_tailwindElement_index = require('../../index-aaa67d55.cjs');
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
const styleMap = require('../../style-map-74906707.cjs');
const index = require('../../index-e9668573.cjs');
require('../../directive-8278ab14.cjs');

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;
};
exports.LuksoProgress = class LuksoProgress extends shared_tailwindElement_index.TailwindElement {
  constructor() {
    super(...arguments);
    this.min = 0;
    this.max = 100;
    this.current = 0;
    this.variant = "success";
  }
  progressWidth() {
    return this.current / this.max * 100;
  }
  render() {
    return shared_tailwindElement_index.x`
      <div
        data-testid="progress"
        class='w-full h-[12px] shadow-neutral-inner-shadow rounded-24 bg-neutral-95'
      >
        <div
          class="h-[12px] rounded-s-24 rounded-e-16 border border-solid transition-all w-[1%] ${index.customClassMap(
      {
        "bg-green-85 border-green-54": !!this.variant || this.variant === "success",
        "bg-red-85 border-red-65": this.variant === "error"
      }
    )}"
          style=${styleMap.o({
      width: `${this.progressWidth()}%`
    })}
        >
          </div>
        </div>
      </div>
    `;
  }
};
__decorateClass([
  queryAssignedElements.n({ type: Number })
], exports.LuksoProgress.prototype, "min", 2);
__decorateClass([
  queryAssignedElements.n({ type: Number })
], exports.LuksoProgress.prototype, "max", 2);
__decorateClass([
  queryAssignedElements.n({ type: Number })
], exports.LuksoProgress.prototype, "current", 2);
__decorateClass([
  queryAssignedElements.n({ type: String })
], exports.LuksoProgress.prototype, "variant", 2);
exports.LuksoProgress = __decorateClass([
  queryAssignedElements.e("lukso-progress")
], exports.LuksoProgress);
