import { jsx as i, Fragment as l } from "react/jsx-runtime";
import { useMemo as d } from "react";
import { ChevronUpIcon as c } from "../../../icons/ChevronUpIcon.js";
import { UIButton as f } from "../../../ui/Button.js";
import { u as s } from "../../../../ToolbarLayout.module-cbc8e216.js";
import { useLocalizationContext as u } from "../../../../contexts/LocalizationContext.js";
import { ViewMode as x, ScrollMode as P } from "../../../../utils/types.js";
import "../../../../contexts/RPDocumentContext.js";
import "../../../../contexts/DocumentPasswordContext.js";
import "../../../../contexts/DarkModeContext.js";
import "../../../../contexts/RotationContext.js";
import "../../../../contexts/LayerContext.js";
import "../../../../contexts/ZoomContext.js";
import { useViewModeContext as g } from "../../../../contexts/ViewModeContext.js";
import { useScrollModeContext as C } from "../../../../contexts/ScrollModeContext.js";
import "../../../../contexts/VirtualScrollContext.js";
import "../../../../contexts/VirtualGridContext.js";
import "../../../../contexts/SelectionModeContext.js";
import "../../../../contexts/InitialStateContext.js";
import "../../../../contexts/FullScreenContext.js";
import "../../../../contexts/FileInputContext.js";
import "../../../../contexts/DropFileZoneContext.js";
import "../../../../contexts/LayoutContainerContext.js";
import "../../../../contexts/DimensionPagesContext.js";
import "../../../../contexts/HighlightContext.js";
import "../../../../contexts/LicenseContext.js";
import "../../../../contexts/DownloadContext.js";
import "../../../../contexts/SmoothScrollContext.js";
import "../../../../contexts/ElementPageContext.js";
import "../../../../contexts/PagesRotateContext.js";
import "../../../../contexts/GlobalCurrentPage.js";
import "../../../../contexts/LoaderContext.js";
import "../../../../contexts/ToolComponentContext.js";
import "../../../../contexts/IconToolContext.js";
import "../../../../contexts/OtherToolContext.js";
import "../../../RPConfig.js";
import "../../Container.js";
import "../../../../contexts/ViewportContext.js";
import "../../../../contexts/ToolbarComponentContext.js";
import "../../WrapperLayout.js";
import "../../../../contexts/ThemeContext.js";
import "../../../RPDropFileZone.js";
import "../../../../SearchCloseButton-cbf182aa.js";
import "../../../ui/Input.js";
import "../../../ui/Checkbox.js";
import "../../../icons/LoaderIcon.js";
import "../../../../contexts/IconContext.js";
import h from "../../../ui/RPTooltip.js";
import "../../../ui/DropDown.js";
import "../../../../ZoomTool.module-6c5eabbb.js";
import "../MenuItem.js";
import "../MenuSeparator.js";
import "../../../../utils/dateFormatter.js";
import "../PropertyItem.js";
import "../RotateTool.js";
const To = ({ icon: m }) => {
  const { focusedPage: t, nextPage: n, totalPages: r } = s(), { localeMessages: o } = u(), { viewMode: p } = g(), { scrollMode: e } = C(), a = d(() => p === x.DUAL_PAGE && e === P.PAGE_SCROLLING && t === r - 1 || t === r, [t, r, p, e]);
  return /* @__PURE__ */ i(l, { children: /* @__PURE__ */ i(h, { content: o == null ? void 0 : o.nextPageTooltip, children: /* @__PURE__ */ i(
    f,
    {
      onClick: n,
      "aria-label": o == null ? void 0 : o.nextPageTooltip,
      "aria-disabled": a,
      children: m || /* @__PURE__ */ i(c, { style: { transform: "rotate(180deg" } })
    }
  ) }) });
};
export {
  To as NextPageTool
};
