"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkRSHN4K6Ncjs = require('./chunk-RSHN4K6N.cjs');


var _chunkOBHJBBPCcjs = require('./chunk-OBHJBBPC.cjs');

// src/components/ProgressBar.tsx
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _react = require('react');
var _jsxruntime = require('@emotion/react/jsx-runtime');
var defaultProps = {
  isSm: false,
  stepDuration: 0.5
};
function ProgressBar({
  background,
  progressPercentage,
  isSm = defaultProps.isSm,
  stepDuration = defaultProps.stepDuration
}) {
  const [percentage, setPercentage] = _react.useState.call(void 0, 5);
  _react.useEffect.call(void 0, () => {
    if (progressPercentage !== void 0) {
      setPercentage(progressPercentage);
    } else {
      setTimeout(() => {
        setPercentage(100);
      }, 0);
    }
  }, [progressPercentage]);
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProgressBarContainer, { isSm, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Bar, { isSm, percentage, stepDuration, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
    BarBg,
    {
      background,
      isSm,
      percentage,
      stepDuration
    }
  ) }) });
}
ProgressBar.defaultProps = defaultProps;
var ProgressBarContainer = _styled2.default.div`
  ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 16)}
  background-color: ${({ theme }) => _chunkOBHJBBPCcjs.themeOr.call(void 0, theme.c05Neutral, theme.c1Neutral)({ theme })};
  box-sizing: border-box;
  display: flex;
  height: ${({ isSm }) => isSm ? "6px" : "16px"};
  justify-content: flex-start;
  width: 100%;
  position: relative;
`;
var BarBg = _styled2.default.div`
  ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 16)}
  width: ${({ percentage }) => 100 / percentage * 100}%;
  height: 100%;

  background: ${({ background }) => background ? background : `
  linear-gradient(
    90deg,
    #000000 -25.9%,
    #1b4077 14.55%,
    #a152c7 82.22%,
    #3f2e7e 115.32%
  )`};
`;
var Bar = _styled2.default.div`
  ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 16)}
  overflow: hidden;
  box-sizing: border-box;
  display: inline-block;
  height: ${({ isSm }) => isSm ? "6px" : "16px"};
  width: ${(props) => props.percentage}%;
  transition: width ${({ stepDuration }) => stepDuration}s
    cubic-bezier(0.16, 0.3, 0.18, 1);
`;



exports.ProgressBar = ProgressBar;
