import React__default, { Children } from 'react';
import PropTypes from 'prop-types';
import PageCount from './pagination/page-count.js';
import PerPageSelect from './pagination/per-page-select.js';
import Navigation from './pagination/navigation.js';
import '../select-menu/index.js';
import '../extends-C4cduGrv.js';
import '../objectWithoutProperties-TXwlfNxG.js';
import '../select-menu-BvA3x4Nf.js';
import '../slicedToArray-BB-AwwkK.js';
import '../defineProperty-CEd-kZQW.js';
import '../floating-ui.react-cWPyyUrN.js';
import '../typeof-CgC7Bq6K.js';
import '../toConsumableArray-dKQYsfpV.js';
import '../index-qSfOyGhk.js';
import 'react-dom';
import 'classnames';
import '../_commonjsHelpers-_1FafXWI.js';
import '../label/index.js';
import '@reach/visually-hidden';
import '../ck-icon/index.js';
import '../ck-icon/assets/icon-map/index.js';
import '../icon/index.js';
import '@fortawesome/react-fontawesome';
import '../icon/icons.js';
import '../icon/library.js';
import '@fortawesome/fontawesome-svg-core';
import '@fortawesome/pro-solid-svg-icons';
import '@fortawesome/pro-light-svg-icons';
import '@fortawesome/free-brands-svg-icons';
import '../portal/index.js';
import '../use-rerender-once/index.js';
import '../use-force-update/index.js';
import '../select-menu/autocomplete.js';
import '../button/index.js';
import '../button/button-group.js';

function Pagination(_ref) {
  var children = _ref.children;

  var _Children$toArray$red = Children.toArray(children).reduce(function (slots, child) {
    if (child.type === PageCount) {
      slots.pageCountSlot = child;
    } else if (child.type === PerPageSelect) {
      slots.perPageSelectSlot = child;
    } else if (child.type === Navigation) {
      slots.navigationSlot = child;
    }

    return slots;
  }, {}),
      pageCountSlot = _Children$toArray$red.pageCountSlot,
      perPageSelectSlot = _Children$toArray$red.perPageSelectSlot,
      navigationSlot = _Children$toArray$red.navigationSlot;

  return /*#__PURE__*/React__default.createElement("div", {
    className: "flex items-center justify-between gap-1 border-t border-gray-200 mt-4 py-4"
  }, pageCountSlot, /*#__PURE__*/React__default.createElement("div", {
    className: "flex items-center gap-4 ml-auto"
  }, perPageSelectSlot, navigationSlot));
}
Pagination.propTypes = {
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
};
Pagination.PageCount = PageCount;
Pagination.PerPageSelect = PerPageSelect;
Pagination.Navigation = Navigation;

export { Pagination as default };
