"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "SmartPaginationDots", {
    enumerable: true,
    get: function() {
        return SmartPaginationDots;
    }
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
var _usePaginationDots = require("./usePaginationDots");
var _PaginationDots = require("./PaginationDots");
var _PaginationDot = require("./PaginationDot");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys, key, i;
    if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
        sourceKeys = Reflect.ownKeys(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
        return target;
    }
    target = _object_without_properties_loose(source, excluded);
    if (Object.getOwnPropertySymbols) {
        sourceKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
    }
    return target;
}
var SmartPaginationDots = function SmartPaginationDots(_0) {
    var items = _0.items, index = _0.index, visibleItems = _0.visibleItems, onIndexChange = _0.onIndexChange, rest = _object_without_properties(_0, [
        "items",
        "index",
        "visibleItems",
        "onIndexChange"
    ]);
    var _usePaginationDots1 = (0, _usePaginationDots.usePaginationDots)({
        items: items,
        index: index,
        visibleItems: visibleItems
    }), sliced = _usePaginationDots1.sliced, activeId = _usePaginationDots1.activeId;
    return /*#__PURE__*/ _react.default.createElement(_PaginationDots.PaginationDots, rest, sliced.map(function(param, i) {
        var id = param.id;
        return /*#__PURE__*/ _react.default.createElement(_PaginationDot.PaginationDot, {
            key: "item:".concat(i),
            isActive: id === activeId,
            onClick: function onClick() {
                return onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(i);
            }
        });
    }));
};
