"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _tslib() {
  const data = require("tslib");

  _tslib = function () {
    return data;
  };

  return data;
}

function _jsxRuntime() {
  const data = require("react/jsx-runtime");

  _jsxRuntime = function () {
    return data;
  };

  return data;
}

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function () {
    return data;
  };

  return data;
}

function _clsx() {
  const data = _interopRequireDefault(require("clsx"));

  _clsx = function () {
    return data;
  };

  return data;
}

var _ConfigProviderContext = _interopRequireDefault(require("../config-provider/ConfigProviderContext"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const SwiperPagIndicator = _react().default.memo(_a => {
  var {
    vertical
  } = _a,
      props = (0, _tslib().__rest)(_a, ["vertical"]);

  const {
    prefixCls,
    createNamespace
  } = _react().default.useContext(_ConfigProviderContext.default);

  const [bem] = createNamespace('indicator', prefixCls);
  const dots = [];

  for (let i = 0; i < props.total; i++) {
    dots.push((0, _jsxRuntime().jsx)("div", {
      className: (0, _clsx().default)(bem('dot', {
        active: props.current === i
      }))
    }, i));
  }

  return (0, _jsxRuntime().jsx)("div", Object.assign({
    className: (0, _clsx().default)(props.className, bem({
      vertical
    })),
    style: props.style
  }, {
    children: dots
  }));
});

var _default = SwiperPagIndicator;
exports.default = _default;