(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 _, computed as n, createElementBlock as t, openBlock as s, normalizeClass as m, createCommentVNode as o, createElementVNode as l, normalizeStyle as f, toDisplayString as d, unref as g, createBlock as v, Fragment as y, createTextVNode as h } from "vue";

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