/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
const require_components_client_Pagination_computeVisiblePages = require("./computeVisiblePages.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Pagination/paginationContext.tsx
const defaultGetItemAriaLabel = (page, isActive) => isActive ? `Page ${page}, current page` : `Go to page ${page}`;
const PaginationContext = (0, react.createContext)(null);
const PaginationProvider = ({ value, children }) => {
	const contextValue = (0, react.useMemo)(() => value, [value]);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationContext.Provider, {
		value: contextValue,
		children
	});
};
PaginationProvider.displayName = "PaginationProvider";
function usePaginationContext() {
	const context = (0, react.useContext)(PaginationContext);
	if (!context) throw new Error("Pagination components must be used within a Pagination provider.");
	return context;
}
function useVisiblePages() {
	const { activePage, totalPages, maxVisiblePageNumbers, ellipsisPlacement } = usePaginationContext();
	return (0, react.useMemo)(() => require_components_client_Pagination_computeVisiblePages.computeVisiblePages({
		activePage,
		totalPages,
		maxVisiblePageNumbers,
		ellipsisPlacement
	}), [
		activePage,
		totalPages,
		maxVisiblePageNumbers,
		ellipsisPlacement
	]);
}
//#endregion
exports.PaginationContext = PaginationContext;
exports.PaginationProvider = PaginationProvider;
exports.defaultGetItemAriaLabel = defaultGetItemAriaLabel;
exports.usePaginationContext = usePaginationContext;
exports.useVisiblePages = useVisiblePages;
