(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".progress-cell{background-color:transparent;height:100%;position:relative;width:100%;overflow:hidden;border-radius:2px}.progress-cell .mask-error{--icon-color: var(--txt-error)}.progress-cell.not-started *{color:var(--txt-03)!important}.progress-cell.error *{color:var(--txt-error)!important}.progress-cell__white-bg{background-color:#fff}.progress-cell__indicator{position:absolute;height:100%;transition:width .4s ease-in-out;background:linear-gradient(90deg,#fff,#d8fac8);transition:width .2s ease-in-out}.progress-cell__body{padding:0 15px;display:flex;gap:12px;align-items:center;height:100%;width:100%;position:absolute;z-index:1}.progress-cell__stage{overflow:hidden;text-overflow:ellipsis;flex-shrink:1;text-wrap:nowrap}.progress-cell__percentage{flex-grow:1;flex-shrink:0;text-align:right}.progress-cell__stage--queued{color:var(--txt-03)}.progress-cell__infinity-loader{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;animation:move-gradient 2s linear infinite}.progress-cell__infinity-gradient{width:50%;height:100%;background:linear-gradient(90deg,#fff,#d8fac8,#fff)}@keyframes move-gradient{0%{transform:translate(-50%)}to{transform:translate(100%)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
import { defineComponent as m, computed as n, createElementBlock as s, openBlock as t, normalizeClass as f, createCommentVNode as o, createElementVNode as l, normalizeStyle as p, toDisplayString as c, unref as d, createBlock as v, Fragment as _, createTextVNode as y } from "vue";

import h from "../PlIcon24/PlIcon24.vue.js";
import { getErrorMessage as k } from "../../helpers/error.js";
const x = {
  key: 0,
  class: "progress-cell__infinity-loader"
}, S = { class: "progress-cell__body" }, w = { class: "progress-cell__stage text-s" }, B = { class: "progress-cell__percentage text-s d-flex align-center justify-end" }, V = /* @__PURE__ */ m({
  __name: "PlProgressCell",
  props: {
    stage: { default: "not_started" },
    step: { default: "" },
    progressString: { default: "" },
    progress: { default: void 0 },
    error: { default: void 0 }
  },
  setup(e) {
    const r = e, g = n(() => r.stage !== "not_started"), u = n(() => r.stage === "done" ? 100 : Math.min(100, r.progress || 0)), a = n(() => r.progress === void 0 && r.stage !== "done" && r.stage !== "not_started" && !r.error);
    return (C, i) => (t(), s("div", {
      class: f({ "progress-cell": !0, "progress-cell__white-bg": g.value, error: e.error, "not-started": r.stage === "not_started" })
    }, [
      a.value ? (t(), s("div", x, [...i[0] || (i[0] = [
        l("div", { class: "progress-cell__infinity-gradient" }, null, -1)
      ])])) : o("", !0),
      !a.value && !e.error ? (t(), s("div", {
        key: 1,
        class: "progress-cell__indicator",
        style: p({ width: u.value + "%" })
      }, null, 4)) : o("", !0),
      l("div", S, [
        l("div", w, c(e.error ? d(k)(e.error) : e.step), 1),
        l("div", B, [
          e.error ? (t(), v(d(h), {
            key: 0,
            name: "error"
          })) : o("", !0),
          e.error ? o("", !0) : (t(), s(_, { key: 1 }, [
            y(c(e.progressString), 1)
          ], 64))
        ])
      ])
    ], 2));
  }
});
export {
  V as default
};
//# sourceMappingURL=PlProgressCell.vue.js.map
