import { m as ke, j as xe, r as l, bi as Be, aX as p, bI as je, bJ as V, aY as P, aC as M } from "./index-6wLGsgHc.js";
var h = {
  small: "small",
  medium: "medium",
  large: "large"
}, $;
function k() {
  return k = Object.assign ? Object.assign.bind() : function(e) {
    for (var r = 1; r < arguments.length; r++) {
      var n = arguments[r];
      for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
    }
    return e;
  }, k.apply(this, arguments);
}
function ne(e, r) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var t = Object.getOwnPropertySymbols(e);
    r && (t = t.filter(function(o) {
      return Object.getOwnPropertyDescriptor(e, o).enumerable;
    })), n.push.apply(n, t);
  }
  return n;
}
function w(e) {
  for (var r = 1; r < arguments.length; r++) {
    var n = arguments[r] != null ? arguments[r] : {};
    r % 2 ? ne(Object(n), !0).forEach(function(t) {
      R(e, t, n[t]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach(function(t) {
      Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
    });
  }
  return e;
}
function R(e, r, n) {
  return r in e ? Object.defineProperty(e, r, {
    value: n,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = n, e;
}
function ae(e) {
  var r;
  return (r = {}, R(r, h.small, "2px"), R(r, h.medium, "4px"), R(r, h.large, "8px"), r)[e];
}
var A = p("div", function(e) {
  return {
    width: "100%"
  };
});
A.displayName = "StyledRoot";
A.displayName = "StyledRoot";
var I = p("div", function(e) {
  var r = e.$theme, n = r.sizing;
  return {
    display: "flex",
    marginLeft: n.scale500,
    marginRight: n.scale500,
    marginTop: n.scale500,
    marginBottom: n.scale500
  };
});
I.displayName = "StyledBarContainer";
I.displayName = "StyledBarContainer";
var D = p("div", function(e) {
  var r = e.$theme, n = e.$size, t = e.$steps, o = r.colors, a = r.sizing, s = r.borders, i = s.useRoundedCorners ? a.scale0 : 0;
  return w({
    borderTopLeftRadius: i,
    borderTopRightRadius: i,
    borderBottomRightRadius: i,
    borderBottomLeftRadius: i,
    backgroundColor: je(o.progressbarTrackFill, "0.16"),
    height: ae(n),
    flex: 1,
    overflow: "hidden"
  }, t < 2 ? {} : {
    marginLeft: a.scale300,
    ":first-child": {
      marginLeft: "0"
    }
  });
});
D.displayName = "StyledBar";
D.displayName = "StyledBar";
var H = p("div", function(e) {
  var r = e.$theme, n = e.$value, t = e.$successValue, o = e.$steps, a = e.$index, s = e.$maxValue, i = e.$minValue, c = i === void 0 ? 0 : i, d = s || t, S = r.colors, y = r.sizing, x = r.borders, T = "".concat(100 - (n - c) * 100 / (d - c), "%"), u = {
    default: "default",
    awaits: "awaits",
    inProgress: "inProgress",
    completed: "completed"
  }, b = u.default;
  if (o > 1) {
    var X = (d - c) / o, N = (n - c) / (d - c) * 100, B = Math.floor(N / X);
    a < B ? b = u.completed : a === B ? b = u.inProgress : b = u.awaits;
  }
  var g = x.useRoundedCorners ? y.scale0 : 0, z = {
    transform: "translateX(-".concat(T, ")")
  }, j = b === u.inProgress ? {
    animationDuration: "2.1s",
    animationIterationCount: "infinite",
    animationTimingFunction: r.animation.linearCurve,
    animationName: {
      "0%": {
        transform: "translateX(-102%)",
        opacity: 1
      },
      "50%": {
        transform: "translateX(0%)",
        opacity: 1
      },
      "100%": {
        transform: "translateX(0%)",
        opacity: 0
      }
    }
  } : b === u.completed ? {
    transform: "translateX(0%)"
  } : {
    transform: "translateX(-102%)"
  };
  return w({
    borderTopLeftRadius: g,
    borderTopRightRadius: g,
    borderBottomRightRadius: g,
    borderBottomLeftRadius: g,
    backgroundColor: S.accent,
    height: "100%",
    width: "100%",
    transform: "translateX(-102%)",
    transition: "transform 0.5s"
  }, o > 1 ? j : z);
});
H.displayName = "StyledBarProgress";
H.displayName = "StyledBarProgress";
var W = p("div", function(e) {
  var r = e.$theme, n = e.$isLeft, t = n === void 0 ? !1 : n, o = e.$size, a = o === void 0 ? h.medium : o, s = r.colors, i = r.sizing, c = r.borders, d = c.useRoundedCorners ? i.scale0 : 0, S = ae(a), y = {
    display: "inline-block",
    flex: 1,
    marginLeft: "auto",
    marginRight: "auto",
    transitionProperty: "background-position",
    animationDuration: "1.5s",
    animationIterationCount: "infinite",
    animationTimingFunction: r.animation.linearCurve,
    backgroundSize: "300% auto",
    backgroundRepeat: "no-repeat",
    backgroundPositionX: t ? "-50%" : "150%",
    backgroundImage: "linear-gradient(".concat(t ? "90" : "270", "deg, transparent 0%, ").concat(s.accent, " 25%, ").concat(s.accent, " 75%, transparent 100%)"),
    animationName: t ? {
      "0%": {
        backgroundPositionX: "-50%"
      },
      "33%": {
        backgroundPositionX: "50%"
      },
      "66%": {
        backgroundPositionX: "50%"
      },
      "100%": {
        backgroundPositionX: "150%"
      }
    } : {
      "0%": {
        backgroundPositionX: "150%"
      },
      "33%": {
        backgroundPositionX: "50%"
      },
      "66%": {
        backgroundPositionX: "50%"
      },
      "100%": {
        backgroundPositionX: "-50%"
      }
    }
  };
  return w(w({}, t ? {
    borderTopLeftRadius: d,
    borderBottomLeftRadius: d
  } : {
    borderTopRightRadius: d,
    borderBottomRightRadius: d
  }), {}, {
    height: S
  }, y);
});
W.displayName = "StyledInfiniteBar";
W.displayName = "StyledInfiniteBar";
var F = p("div", function(e) {
  return w(w({
    textAlign: "center"
  }, e.$theme.typography.font150), {}, {
    color: e.$theme.colors.contentTertiary
  });
});
F.displayName = "StyledLabel";
F.displayName = "StyledLabel";
var f = ($ = {}, R($, h.large, {
  d: "M47.5 4H71.5529C82.2933 4 91 12.9543 91 24C91 35.0457 82.2933 44 71.5529 44H23.4471C12.7067 44 4 35.0457 4 24C4 12.9543 12.7067 4 23.4471 4H47.5195",
  width: 95,
  height: 48,
  strokeWidth: 8,
  typography: "LabelLarge"
}), R($, h.medium, {
  d: "M39 2H60.5833C69.0977 2 76 9.16344 76 18C76 26.8366 69.0977 34 60.5833 34H17.4167C8.90228 34 2 26.8366 2 18C2 9.16344 8.90228 2 17.4167 2H39.0195",
  width: 78,
  height: 36,
  strokeWidth: 4,
  typography: "LabelMedium"
}), R($, h.small, {
  d: "M32 1H51.6271C57.9082 1 63 6.37258 63 13C63 19.6274 57.9082 25 51.6271 25H12.3729C6.09181 25 1 19.6274 1 13C1 6.37258 6.09181 1 12.3729 1H32.0195",
  width: 64,
  height: 26,
  strokeWidth: 2,
  typography: "LabelSmall"
}), $), ie = p("div", function(e) {
  var r = e.$size, n = e.$inline;
  return {
    width: f[r].width + "px",
    height: f[r].height + "px",
    position: "relative",
    display: n ? "inline-flex" : "flex",
    alignItems: "center",
    justifyContent: "center"
  };
});
ie.displayName = "StyledProgressBarRoundedRoot";
ie.displayName = "StyledProgressBarRoundedRoot";
var U = p("svg", function(e) {
  var r = e.$size;
  return {
    width: f[r].width + "px",
    height: f[r].height + "px",
    position: "absolute",
    fill: "none"
  };
});
U.displayName = "_StyledProgressBarRoundedSvg";
U.displayName = "_StyledProgressBarRoundedSvg";
V(U, function(e) {
  return function(r) {
    return /* @__PURE__ */ M.createElement(e, k({
      viewBox: "0 0 ".concat(f[r.$size].width, " ").concat(f[r.$size].height),
      xmlns: "http://www.w3.org/2000/svg"
    }, r));
  };
});
var G = p("path", function(e) {
  var r = e.$theme, n = e.$size;
  return {
    stroke: r.colors.backgroundTertiary,
    strokeWidth: f[n].strokeWidth + "px"
  };
});
G.displayName = "_StyledProgressBarRoundedTrackBackground";
G.displayName = "_StyledProgressBarRoundedTrackBackground";
V(G, function(e) {
  return function(r) {
    return /* @__PURE__ */ M.createElement(e, k({
      d: f[r.$size].d
    }, r));
  };
});
var q = p("path", function(e) {
  var r = e.$theme, n = e.$size, t = e.$visible, o = e.$pathLength, a = e.$pathProgress;
  return {
    visibility: t ? "visible" : "hidden",
    stroke: r.colors.borderAccent,
    strokeWidth: f[n].strokeWidth + "px",
    strokeDasharray: o,
    strokeDashoffset: o * (1 - a) + ""
  };
});
q.displayName = "_StyledProgressBarRoundedTrackForeground";
q.displayName = "_StyledProgressBarRoundedTrackForeground";
V(q, function(e) {
  return function(r) {
    return /* @__PURE__ */ M.createElement(e, k({
      d: f[r.$size].d
    }, r));
  };
});
var se = p("div", function(e) {
  var r = e.$theme, n = e.$size;
  return w({
    color: r.colors.contentPrimary
  }, r.typography[f[n].typography]);
});
se.displayName = "StyledProgressBarRoundedText";
se.displayName = "StyledProgressBarRoundedText";
function E(e) {
  "@babel/helpers - typeof";
  return E = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
    return typeof r;
  } : function(r) {
    return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
  }, E(e);
}
var Le = ["overrides", "getProgressLabel", "value", "size", "steps", "successValue", "minValue", "maxValue", "showLabel", "infinite", "errorMessage", "forwardedRef"];
function m() {
  return m = Object.assign ? Object.assign.bind() : function(e) {
    for (var r = 1; r < arguments.length; r++) {
      var n = arguments[r];
      for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
    }
    return e;
  }, m.apply(this, arguments);
}
function O(e, r) {
  return Ne(e) || Xe(e, r) || Te(e, r) || Ce();
}
function Ce() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Te(e, r) {
  if (e) {
    if (typeof e == "string") return oe(e, r);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return oe(e, r);
  }
}
function oe(e, r) {
  (r == null || r > e.length) && (r = e.length);
  for (var n = 0, t = new Array(r); n < r; n++) t[n] = e[n];
  return t;
}
function Xe(e, r) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var t = [], o = !0, a = !1, s, i;
    try {
      for (n = n.call(e); !(o = (s = n.next()).done) && (t.push(s.value), !(r && t.length === r)); o = !0) ;
    } catch (c) {
      a = !0, i = c;
    } finally {
      try {
        !o && n.return != null && n.return();
      } finally {
        if (a) throw i;
      }
    }
    return t;
  }
}
function Ne(e) {
  if (Array.isArray(e)) return e;
}
function ze(e, r) {
  if (e == null) return {};
  var n = Ee(e, r), t, o;
  if (Object.getOwnPropertySymbols) {
    var a = Object.getOwnPropertySymbols(e);
    for (o = 0; o < a.length; o++) t = a[o], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
  }
  return n;
}
function Ee(e, r) {
  if (e == null) return {};
  var n = {}, t = Object.keys(e), o, a;
  for (a = 0; a < t.length; a++) o = t[a], !(r.indexOf(o) >= 0) && (n[o] = e[o]);
  return n;
}
function _e(e, r) {
  if (!(e instanceof r)) throw new TypeError("Cannot call a class as a function");
}
function Ve(e, r) {
  for (var n = 0; n < r.length; n++) {
    var t = r[n];
    t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(e, t.key, t);
  }
}
function Me(e, r, n) {
  return r && Ve(e.prototype, r), Object.defineProperty(e, "prototype", {
    writable: !1
  }), e;
}
function Ae(e, r) {
  if (typeof r != "function" && r !== null) throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(r && r.prototype, {
    constructor: {
      value: e,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(e, "prototype", {
    writable: !1
  }), r && _(e, r);
}
function _(e, r) {
  return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
    return n.__proto__ = t, n;
  }, _(e, r);
}
function Ie(e) {
  var r = We();
  return function() {
    var n = C(e), t;
    if (r) {
      var o = C(this).constructor;
      t = Reflect.construct(n, arguments, o);
    } else t = n.apply(this, arguments);
    return De(this, t);
  };
}
function De(e, r) {
  if (r && (E(r) === "object" || typeof r == "function")) return r;
  if (r !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
  return He(e);
}
function He(e) {
  if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function We() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
  if (typeof Proxy == "function") return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function C(e) {
  return C = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
    return r.__proto__ || Object.getPrototypeOf(r);
  }, C(e);
}
function Fe(e, r, n) {
  return r in e ? Object.defineProperty(e, r, {
    value: n,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = n, e;
}
var ue = /* @__PURE__ */ (function(e) {
  Ae(n, e);
  var r = Ie(n);
  function n() {
    return _e(this, n), r.apply(this, arguments);
  }
  return Me(n, [{
    key: "componentDidMount",
    value: function() {
    }
  }, {
    key: "render",
    value: function() {
      var t = this.props, o = t.overrides, a = o === void 0 ? {} : o, s = t.getProgressLabel, i = t.value, c = t.size, d = t.steps, S = t.successValue, y = t.minValue, x = t.maxValue, T = t.showLabel, u = t.infinite, b = t.errorMessage, X = t.forwardedRef, N = ze(t, Le), B = this.props["aria-label"] || this.props.ariaLabel, g = x !== 100 ? x : S, z = P(a.Root, A), j = O(z, 2), ce = j[0], de = j[1], fe = P(a.BarContainer, I), J = O(fe, 2), pe = J[0], ge = J[1], me = P(a.Bar, D), Q = O(me, 2), ye = Q[0], be = Q[1], he = P(a.BarProgress, H), Y = O(he, 2), ve = Y[0], Re = Y[1], we = P(a.Label, F), K = O(we, 2), Pe = K[0], Oe = K[1], Se = P(a.InfiniteBar, W), Z = O(Se, 2), ee = Z[0], re = Z[1], v = {
        $infinite: u,
        $size: c,
        $steps: d,
        $successValue: g,
        $minValue: y,
        $maxValue: g,
        $value: i
      };
      function $e() {
        for (var te = [], L = 0; L < d; L++) te.push(/* @__PURE__ */ l.createElement(ye, m({
          key: L
        }, v, be), /* @__PURE__ */ l.createElement(ve, m({
          $index: L
        }, v, Re))));
        return te;
      }
      return (
        // eslint-disable-next-line jsx-a11y/role-supports-aria-props
        /* @__PURE__ */ l.createElement(ce, m({
          ref: X,
          "data-baseweb": "progress-bar",
          role: "progressbar",
          "aria-label": B || s(i, g, y),
          "aria-valuenow": u ? null : i,
          "aria-valuemin": u ? null : y,
          "aria-valuemax": u ? null : g,
          "aria-invalid": b ? !0 : null,
          "aria-errormessage": b
        }, N, v, de), /* @__PURE__ */ l.createElement(pe, m({}, v, ge), u ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(ee, m({
          $isLeft: !0,
          $size: v.$size
        }, re)), /* @__PURE__ */ l.createElement(ee, m({
          $size: v.$size
        }, re))) : $e()), T && /* @__PURE__ */ l.createElement(Pe, m({}, v, Oe), s(i, g, y)))
      );
    }
  }]), n;
})(l.Component);
Fe(ue, "defaultProps", {
  getProgressLabel: function(e, r, n) {
    return "".concat(Math.round((e - n) / (r - n) * 100), "% Loaded");
  },
  infinite: !1,
  overrides: {},
  showLabel: !1,
  size: h.medium,
  steps: 1,
  successValue: 100,
  minValue: 0,
  maxValue: 100,
  value: 0
});
var le = /* @__PURE__ */ l.forwardRef(function(e, r) {
  return (
    //$FlowExpectedError[cannot-spread-inexact]
    /* @__PURE__ */ l.createElement(ue, m({
      forwardedRef: r
    }, e))
  );
});
le.displayName = "ProgressBar";
var Ue = /* @__PURE__ */ ((e) => (e.EXTRASMALL = "xs", e.SMALL = "sm", e.MEDIUM = "md", e.LARGE = "lg", e.EXTRALARGE = "xl", e))(Ue || {});
function qe({
  value: e,
  size: r = "sm",
  overrides: n
}) {
  const t = ke(), o = {
    xs: t.spacing.twoXS,
    sm: t.spacing.sm,
    md: t.spacing.lg,
    lg: t.spacing.xl,
    xl: t.spacing.twoXL
  }, a = {
    BarContainer: {
      style: {
        marginTop: t.spacing.none,
        marginBottom: t.spacing.none,
        marginRight: t.spacing.none,
        marginLeft: t.spacing.none
      }
    },
    Bar: {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: Replace 'any' with a more specific type.
      style: ({
        $theme: s
      }) => ({
        marginTop: t.spacing.none,
        marginBottom: t.spacing.none,
        marginRight: t.spacing.none,
        marginLeft: t.spacing.none,
        height: o[r],
        backgroundColor: s.colors.progressbarTrackFill,
        borderTopLeftRadius: t.spacing.twoXS,
        borderTopRightRadius: t.spacing.twoXS,
        borderBottomLeftRadius: t.spacing.twoXS,
        borderBottomRightRadius: t.spacing.twoXS
      })
    },
    BarProgress: {
      style: () => ({
        backgroundColor: t.colors.secondary,
        borderTopLeftRadius: t.spacing.twoXS,
        borderTopRightRadius: t.spacing.twoXS,
        borderBottomLeftRadius: t.spacing.twoXS,
        borderBottomRightRadius: t.spacing.twoXS
      })
    }
  };
  return /* @__PURE__ */ xe.jsx(le, {
    value: e,
    overrides: Be(a, n)
  });
}
export {
  Ue as U,
  qe as q
};
//# sourceMappingURL=ProgressBar-bzD0ionS-BU2taYKp.js.map
