"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const factory = require("../../core/factory/factory.cjs");
const Group = require("../Group/Group.cjs");
const PaginationControl = require("./PaginationControl/PaginationControl.cjs");
const PaginationDots = require("./PaginationDots/PaginationDots.cjs");
const PaginationEdges = require("./PaginationEdges/PaginationEdges.cjs");
const PaginationItems = require("./PaginationItems/PaginationItems.cjs");
const PaginationRoot = require("./PaginationRoot/PaginationRoot.cjs");
const Pagination_module_css = require("./Pagination.module.css.cjs");
const defaultProps = {
  withControls: true,
  siblings: 1,
  boundaries: 1,
  gap: 8
};
const Pagination = factory.factory((_props, ref) => {
  const props = useProps.useProps("Pagination", defaultProps, _props);
  const {
    withEdges,
    withControls,
    getControlProps,
    nextIcon,
    previousIcon,
    lastIcon,
    firstIcon,
    dotsIcon,
    total,
    gap,
    hideWithOnePage,
    ...others
  } = props;
  if (total <= 0 || hideWithOnePage && total === 1) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntime.jsx(PaginationRoot.PaginationRoot, { ref, total, ...others, children: /* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { gap, children: [
    withEdges && /* @__PURE__ */ jsxRuntime.jsx(PaginationEdges.PaginationFirst, { icon: firstIcon, ...getControlProps == null ? void 0 : getControlProps("first") }),
    withControls && /* @__PURE__ */ jsxRuntime.jsx(PaginationEdges.PaginationPrevious, { icon: previousIcon, ...getControlProps == null ? void 0 : getControlProps("previous") }),
    /* @__PURE__ */ jsxRuntime.jsx(PaginationItems.PaginationItems, { dotsIcon }),
    withControls && /* @__PURE__ */ jsxRuntime.jsx(PaginationEdges.PaginationNext, { icon: nextIcon, ...getControlProps == null ? void 0 : getControlProps("next") }),
    withEdges && /* @__PURE__ */ jsxRuntime.jsx(PaginationEdges.PaginationLast, { icon: lastIcon, ...getControlProps == null ? void 0 : getControlProps("last") })
  ] }) });
});
Pagination.classes = Pagination_module_css.default;
Pagination.displayName = "@mantine/core/Pagination";
Pagination.Root = PaginationRoot.PaginationRoot;
Pagination.Control = PaginationControl.PaginationControl;
Pagination.Dots = PaginationDots.PaginationDots;
Pagination.First = PaginationEdges.PaginationFirst;
Pagination.Last = PaginationEdges.PaginationLast;
Pagination.Next = PaginationEdges.PaginationNext;
Pagination.Previous = PaginationEdges.PaginationPrevious;
Pagination.Items = PaginationItems.PaginationItems;
exports.Pagination = Pagination;
