import { n as i, C as d } from "../chunks/lib-cortex-element.CVMmyPMC.js";
import { c as h } from "../chunks/component.styles.CRO4Odto.js";
import { c as m } from "../chunks/custom-element.L4WJXn1j.js";
import { L as b } from "../chunks/i18n.BABe9hN4.js";
import { i as g, x as c } from "../chunks/lit-element.jLBm65_O.js";
import { e as u } from "../chunks/class-map.BiVq-cVR.js";
import { o as v } from "../chunks/if-defined.BRoBj_Rp.js";
import { o as f } from "../chunks/style-map.llVFPd__.js";
const w = g`:host{--height:1rem;--track-color:var(--cx-color-neutral-200);--indicator-color:var(--cx-color-primary);--label-color:var(--cx-color-neutral);--indicator-label-color:var(--cx-color-neutral-0);display:block}.progress-bar-label{color:var(--label-color);font-size:var(--cx-font-size-small);font-weight:var(--cx-font-weight-medium);justify-content:space-between;align-items:center;display:flex}.progress-bar{background-color:var(--track-color);height:var(--height);border-radius:var(--cx-border-radius-pill);box-shadow:inset var(--cx-shadow-small);position:relative;overflow:hidden}.progress-bar__indicator{height:100%;font-family:var(--cx-font-sans);font-size:12px;font-weight:var(--cx-font-weight-regular);background-color:var(--indicator-color);color:var(--indicator-label-color);text-align:center;line-height:var(--height);white-space:nowrap;-webkit-user-select:none;user-select:none;transition:width .4s,background-color .4s;overflow:hidden}.progress-bar--indeterminate .progress-bar__indicator{animation:2.5s cubic-bezier(.37,0,.63,1) infinite indeterminate;position:absolute}.progress-bar--indeterminate.progress-bar--rtl .progress-bar__indicator{animation-name:indeterminate-rtl}@media (forced-colors:active){.progress-bar{background-color:var(--cx-color-neutral-0);outline:1px solid selecteditem}.progress-bar__indicator{background-color:selecteditem;outline:1px solid selecteditem}}@keyframes indeterminate{0%{width:50%;left:-50%}75%,to{width:50%;left:100%}}@keyframes indeterminate-rtl{0%{width:50%;right:-50%}75%,to{width:50%;right:100%}}`;
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, t = (p, o, s, a) => {
  for (var r = a > 1 ? void 0 : a ? y(o, s) : o, l = p.length - 1, n; l >= 0; l--)
    (n = p[l]) && (r = (a ? n(o, s, r) : n(r)) || r);
  return a && r && x(o, s, r), r;
};
let e = class extends d {
  constructor() {
    super(...arguments), this.localize = new b(this), this.value = 0, this.indeterminate = !1, this.label = "", this.showProgress = "";
  }
  render() {
    return c`<div part="container" class="container"><div part="label" class="progress-bar-label"><slot name="label"><span>${this.label}</span></slot>${this.showProgress ? c`<span>${this.value || 0}%</span>` : ""}</div><div part="base" class=${u({
      "progress-bar": !0,
      "progress-bar--indeterminate": this.indeterminate,
      "progress-bar--rtl": this.localize.dir() === "rtl"
    })} role="progressbar" title=${v(this.title)} aria-label=${this.label.length > 0 ? this.label : this.localize.term("progress")} aria-valuemin="0" aria-valuemax="100" aria-valuenow=${this.indeterminate ? 0 : this.value}><div part="indicator" class="progress-bar__indicator" style=${f({ width: `${this.value || 0}%` })}>${this.indeterminate ? "" : c`<slot part="label" class="progress-bar__label"></slot>`}</div></div></div>`;
  }
};
e.styles = [h, w];
t([
  i({ reflect: !0, type: Number })
], e.prototype, "value", 2);
t([
  i({ reflect: !0, type: Boolean })
], e.prototype, "indeterminate", 2);
t([
  i({ reflect: !0, type: String })
], e.prototype, "label", 2);
t([
  i({ attribute: "show-progress", reflect: !0, type: Boolean })
], e.prototype, "showProgress", 2);
e = t([
  m("cx-progress-bar")
], e);
export {
  e as default
};
