/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { ellipsisDefault } from "./ellipsisDefault.js";
import { ellipsisNone } from "./ellipsisNone.js";
//#region src/components/client/Pagination/computeVisiblePages.ts
const MIN_MAX_VISIBLE_WITH_ELLIPSIS = 3;
function computeVisiblePages({ activePage, totalPages, maxVisiblePageNumbers, ellipsisPlacement }) {
	const max = ellipsisPlacement === "none" ? Math.max(1, maxVisiblePageNumbers) : Math.max(MIN_MAX_VISIBLE_WITH_ELLIPSIS, maxVisiblePageNumbers);
	if (totalPages <= 0) return [];
	if (typeof ellipsisPlacement === "function") return ellipsisPlacement({
		activePage,
		totalPages,
		maxVisiblePageNumbers: max
	});
	switch (ellipsisPlacement) {
		case "none": return ellipsisNone(activePage, totalPages, max);
		default: return ellipsisDefault(activePage, totalPages, max);
	}
}
//#endregion
export { computeVisiblePages };
