@pdf-viewer/react 1.11.0-beta.1 → 1.11.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{ToolbarLayout.module-9d258526.js → ToolbarLayout.module-082ff242.js} +853 -842
  2. package/dist/assets/ToolbarLayout.css +1 -1
  3. package/dist/components/RPController.js +1 -1
  4. package/dist/components/RPPages.js +1 -1
  5. package/dist/components/layout/LayoutContainer.js +1 -1
  6. package/dist/components/layout/RPDefaultLayout.js +1 -1
  7. package/dist/components/layout/RPLayout.js +1 -1
  8. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  11. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  12. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  13. package/dist/components/layout/toolbar/MostPageTool.js +1 -1
  14. package/dist/components/layout/toolbar/OtherTool.js +1 -1
  15. package/dist/components/layout/toolbar/Paginate.js +1 -1
  16. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  17. package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  20. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  21. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  22. package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
  23. package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
  24. package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
  25. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
  26. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
  27. package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
  28. package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
  29. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  30. package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
  31. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  32. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
  33. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
  34. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +1 -1
  35. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
  36. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
  37. package/dist/components/page/AnnotationLayer.js +1 -1
  38. package/dist/components/page/CanvasLayer.js +1 -1
  39. package/dist/components/page/DualPage.js +1 -1
  40. package/dist/components/page/RPPage.js +1 -1
  41. package/dist/components/page/SinglePage.js +1 -1
  42. package/dist/components/page/TextHighlightLayer.js +1 -1
  43. package/dist/components/page/TextLayer.js +1 -1
  44. package/dist/components/ui/LoadingIndicator.js +1 -1
  45. package/dist/contexts/PaginationContext.js +1 -1
  46. package/dist/contexts/PrintContext.js +1 -1
  47. package/dist/contexts/RenderQueueProvider.js +1 -1
  48. package/dist/contexts/SearchContext.js +1 -1
  49. package/dist/contexts/ThumbnailsContext.js +1 -1
  50. package/dist/main.js +1 -1
  51. package/dist/types/utils/getWordPositionInPage.d.ts +2 -5
  52. package/dist/utils/getWordPositionInPage.js +20 -21
  53. package/dist/utils/hooks/useFileDownload.js +1 -1
  54. package/dist/utils/hooks/useLicense.js +1 -1
  55. package/dist/utils/hooks/usePaginate.js +1 -1
  56. package/dist/utils/hooks/usePresentPage.js +1 -1
  57. package/dist/utils/hooks/usePrint.js +1 -1
  58. package/dist/utils/hooks/useScrollToPage.js +1 -1
  59. package/dist/utils/hooks/useSearch.js +1 -1
  60. package/dist/utils/hooks/useThumbnail.js +1 -1
  61. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  62. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import { jsx as a, Fragment as pe, jsxs as H } from "react/jsx-runtime";
1
+ import { jsx as a, Fragment as he, jsxs as H } from "react/jsx-runtime";
2
2
  import * as X from "react";
3
- import { useRef as W, useEffect as A, useCallback as N, useState as q, useMemo as F, createContext as $e, useContext as qe, useImperativeHandle as on, createElement as Ve, PureComponent as oo, Component as ro, memo as rn, forwardRef as io } from "react";
3
+ import { useRef as k, useEffect as z, useCallback as O, useState as $, useMemo as F, createContext as $e, useContext as qe, useImperativeHandle as on, createElement as Ve, PureComponent as oo, Component as ro, memo as rn, forwardRef as io } from "react";
4
4
  import { ChevronUpIcon as Ze } from "./components/icons/ChevronUpIcon.js";
5
- import { UIButton as ge } from "./components/ui/Button.js";
5
+ import { UIButton as we } from "./components/ui/Button.js";
6
6
  import { UIInput as an } from "./components/ui/Input.js";
7
7
  import { ViewMode as Re, ScrollMode as ne, AnnotationSubType as Dt, SelectionMode as ao, ErrorType as so } from "./utils/types.js";
8
8
  import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
@@ -21,9 +21,9 @@ import { useFullScreenContext as fo } from "./contexts/FullScreenContext.js";
21
21
  import "./contexts/FileInputContext.js";
22
22
  import "./contexts/DropFileZoneContext.js";
23
23
  import { findMatches as mo, resetDivs as go, highlightMatches as vo, isMatchEntireWord as wo } from "./utils/highlight.js";
24
- import { useLayoutContainer as _e } from "./contexts/LayoutContainerContext.js";
24
+ import { useLayoutContainer as be } from "./contexts/LayoutContainerContext.js";
25
25
  import { useDimensionPagesContext as Ge } from "./contexts/DimensionPagesContext.js";
26
- import { useLocalizationContext as he } from "./contexts/LocalizationContext.js";
26
+ import { useLocalizationContext as fe } from "./contexts/LocalizationContext.js";
27
27
  import { useHighlightContext as _o } from "./contexts/HighlightContext.js";
28
28
  import "./contexts/LicenseContext.js";
29
29
  import { useDownloadContext as bo } from "./contexts/DownloadContext.js";
@@ -35,23 +35,23 @@ import { renderPage as Co } from "./utils/renderPage.js";
35
35
  import { useGlobalCurrentPage as Po } from "./contexts/GlobalCurrentPage.js";
36
36
  import { useLoaderContext as _t } from "./contexts/LoaderContext.js";
37
37
  import { useToolComponentContext as Ne } from "./contexts/ToolComponentContext.js";
38
- import { useIconToolContext as be } from "./contexts/IconToolContext.js";
38
+ import { useIconToolContext as Te } from "./contexts/IconToolContext.js";
39
39
  import { useOtherToolContext as yo } from "./contexts/OtherToolContext.js";
40
40
  import "./components/RPConfig.js";
41
41
  import { ThumbnailIcon as xo } from "./components/icons/Thumbnail.js";
42
- import { c as se } from "./clsx-0c6e471a.js";
42
+ import { c as ce } from "./clsx-0c6e471a.js";
43
43
  import { LoaderIcon as ln } from "./components/icons/LoaderIcon.js";
44
44
  import { Container as So } from "./components/layout/Container.js";
45
45
  import { useViewportContext as Oe, ViewportProvider as Io } from "./contexts/ViewportContext.js";
46
- import { useToolbarComponentContext as Te, ToolbarComponentProvider as Ro } from "./contexts/ToolbarComponentContext.js";
46
+ import { useToolbarComponentContext as Ce, ToolbarComponentProvider as Ro } from "./contexts/ToolbarComponentContext.js";
47
47
  import { RPSplitter as Lo } from "./components/layout/sidebar/RPSplitter.js";
48
48
  import { WrapperLayout as Eo } from "./components/layout/WrapperLayout.js";
49
- import { c as we, L as No } from "./LayoutWrapper-a871c161.js";
49
+ import { c as _e, L as No } from "./LayoutWrapper-a871c161.js";
50
50
  import { useThemeContext as Oo } from "./contexts/ThemeContext.js";
51
51
  import { RPDropFileZone as Do } from "./components/RPDropFileZone.js";
52
52
  import { c as te, S as At } from "./SearchCloseButton-cbf182aa.js";
53
53
  import { UICheckbox as zt } from "./components/ui/Checkbox.js";
54
- import { useIconContext as Ce, IconProvider as Ao } from "./contexts/IconContext.js";
54
+ import { useIconContext as Pe, IconProvider as Ao } from "./contexts/IconContext.js";
55
55
  import Q from "./components/ui/RPTooltip.js";
56
56
  import { UIDropDown as dn } from "./components/ui/DropDown.js";
57
57
  import "./ZoomTool.module-6c5eabbb.js";
@@ -101,13 +101,13 @@ import { SearchIcon as gn } from "./components/icons/SearchIcon.js";
101
101
  import { ClearIcon as Lr } from "./components/icons/ClearIcon.js";
102
102
  import { InfoIcon as Wt } from "./components/icons/InfoIcon.js";
103
103
  import './assets/ToolbarLayout.css';const vn = () => {
104
- const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Ye(), { setFocusedPage: i } = le(), c = W(), { columnCount: l } = sn(), { widths: d, heights: f } = Ge(), m = W(e), P = W(t), h = W(l), { targetScrollPage: T } = cn();
105
- A(() => {
104
+ const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: r, pageScrollElementRef: o } = Ye(), { setFocusedPage: i } = de(), c = k(), { columnCount: l } = sn(), { widths: d, heights: f } = Ge(), m = k(e), P = k(t), p = k(l), { targetScrollPage: T } = cn();
105
+ z(() => {
106
106
  n != null && n.scrollToItem && (c.current = n);
107
- }, [n]), A(() => {
107
+ }, [n]), z(() => {
108
108
  m.current = e, P.current = t;
109
109
  }, [e, t]);
110
- const C = N(
110
+ const C = O(
111
111
  (v, y) => {
112
112
  if (!o)
113
113
  return;
@@ -121,26 +121,26 @@ import './assets/ToolbarLayout.css';const vn = () => {
121
121
  (s) => it(o, u, s)
122
122
  );
123
123
  }
124
- const p = {
124
+ const h = {
125
125
  left: 0,
126
126
  top: 0
127
127
  };
128
128
  return o == null ? void 0 : o.scrollTo({
129
- ...p,
129
+ ...h,
130
130
  behavior: y
131
131
  });
132
132
  },
133
133
  [o, d, it]
134
134
  );
135
- return A(() => {
135
+ return z(() => {
136
136
  m.current = e, P.current = t;
137
- }, [e, t]), A(() => {
138
- h.current = l;
139
- }, [l]), { scrollToPage: N(
137
+ }, [e, t]), z(() => {
138
+ p.current = l;
139
+ }, [l]), { scrollToPage: O(
140
140
  (v, y = "smooth") => {
141
141
  i(v);
142
142
  const g = v - 1;
143
- let p = g, u = 0;
143
+ let h = g, u = 0;
144
144
  if (P.current === Re.DUAL_PAGE && m.current === ne.PAGE_SCROLLING) {
145
145
  C(v, y);
146
146
  return;
@@ -153,33 +153,33 @@ import './assets/ToolbarLayout.css';const vn = () => {
153
153
  return;
154
154
  const s = r;
155
155
  y === "smooth" && (T.current = v);
156
- const { columnsWidth: _, rowsHeight: w } = bt(
156
+ const { columnsWidth: w, rowsHeight: _ } = bt(
157
157
  { widths: d, heights: f },
158
158
  l
159
159
  );
160
160
  if (m.current === ne.HORIZONTAL_SCROLLING) {
161
161
  u = g;
162
- const S = ze(_, u), I = {
163
- left: Math.floor(S),
162
+ const I = ze(w, u), S = {
163
+ left: Math.floor(I),
164
164
  top: 0
165
165
  };
166
166
  return s.scrollTo({
167
- ...I,
167
+ ...S,
168
168
  behavior: y
169
169
  });
170
170
  }
171
171
  if (P.current === Re.DUAL_PAGE) {
172
- u = g % 2, p = Math.floor(g / 2);
173
- const I = ze(_, u), E = ze(w, p), D = {
174
- left: Math.floor(I),
175
- top: Math.floor(E)
172
+ u = g % 2, h = Math.floor(g / 2);
173
+ const S = ze(w, u), N = ze(_, h), D = {
174
+ left: Math.floor(S),
175
+ top: Math.floor(N)
176
176
  };
177
177
  return s.scrollTo({
178
178
  ...D,
179
179
  behavior: y
180
180
  });
181
181
  }
182
- const x = ze(w, p), R = {
182
+ const x = ze(_, h), R = {
183
183
  left: 0,
184
184
  top: Math.floor(x)
185
185
  };
@@ -199,34 +199,34 @@ import './assets/ToolbarLayout.css';const vn = () => {
199
199
  ]
200
200
  ) };
201
201
  }, Er = (t = 1) => {
202
- const [e, n] = q(t), [r, o] = q(0), { scrollToPage: i } = vn(), c = W(1), { viewMode: l } = Me(), { scrollMode: d } = Ee(), { widths: f } = Ge(), { pagesRef: m } = _e(), P = Tt(e, 100), h = N(
203
- (p) => {
204
- if (!/^[0-9]*$/g.test(p.toString()) || !p)
202
+ const [e, n] = $(t), [r, o] = $(0), { scrollToPage: i } = vn(), c = k(1), { viewMode: l } = Me(), { scrollMode: d } = Ee(), { widths: f } = Ge(), { pagesRef: m } = be(), P = Tt(e, 100), p = O(
203
+ (h) => {
204
+ if (!/^[0-9]*$/g.test(h.toString()) || !h)
205
205
  return { success: !1, currentPage: c.current };
206
- const s = +p;
207
- return s < 0 || s > r ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +p });
206
+ const s = +h;
207
+ return s < 0 || s > r ? { success: !1, currentPage: c.current } : (n(s), c.current = s, { success: !0, currentPage: +h });
208
208
  },
209
209
  [r]
210
- ), T = N(h, [h]), C = N(
211
- (p) => {
212
- const u = h(p);
210
+ ), T = O(p, [p]), C = O(
211
+ (h) => {
212
+ const u = p(h);
213
213
  return u.success && i(u.currentPage), u;
214
214
  },
215
- [h, i]
216
- ), b = N((p) => {
217
- const u = p % 2 === 1;
215
+ [p, i]
216
+ ), b = O((h) => {
217
+ const u = h % 2 === 1;
218
218
  if (!m || u)
219
219
  return !1;
220
- const s = u ? f[p] : f[p - 1], _ = u ? f[p + 1] : f[p];
221
- return l === Re.DUAL_PAGE && s + _ < m.clientWidth;
222
- }, [l, f, m, r]), v = N(() => {
223
- let p = e - 1;
224
- b(p) && (p = e - 2), C(p);
225
- }, [C, e, l, d, b]), y = F(() => l === Re.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, l, d]), g = N(() => {
220
+ const s = u ? f[h] : f[h - 1], w = u ? f[h + 1] : f[h];
221
+ return l === Re.DUAL_PAGE && s + w < m.clientWidth;
222
+ }, [l, f, m, r]), v = O(() => {
223
+ let h = e - 1;
224
+ b(h) && (h = e - 2), C(h);
225
+ }, [C, e, l, d, b]), y = F(() => l === Re.DUAL_PAGE && d === ne.PAGE_SCROLLING ? e === r - 1 : e === r, [e, r, l, d]), g = O(() => {
226
226
  if (y)
227
227
  return;
228
- let p = e + 1;
229
- b(p) && (p = e + 2), C(p);
228
+ let h = e + 1;
229
+ b(h) && (h = e + 2), C(h);
230
230
  }, [C, e, b, l, d, y]);
231
231
  return {
232
232
  focusedPage: P,
@@ -249,14 +249,14 @@ import './assets/ToolbarLayout.css';const vn = () => {
249
249
  },
250
250
  nextPage: () => {
251
251
  }
252
- }), le = () => {
252
+ }), de = () => {
253
253
  const t = qe(wn);
254
254
  return typeof (t == null ? void 0 : t.focusedPage) > "u" && sr.error("Please use this hooks inside children component of RPProvider"), t;
255
255
  }, Ks = ({ children: t }) => {
256
256
  const { pdf: e } = oe(), { setCurrentPage: n } = Po(), { focusedPage: r, totalPages: o, setFocusedPage: i, setTotalPages: c, goToPage: l, nextPage: d, prevPage: f } = Er();
257
- return A(() => {
257
+ return z(() => {
258
258
  e != null && e.numPages && (c(e.numPages), i(1));
259
- }, [e, c, i]), A(() => {
259
+ }, [e, c, i]), z(() => {
260
260
  n(r);
261
261
  }, [r, n]), /* @__PURE__ */ a(
262
262
  wn.Provider,
@@ -275,19 +275,19 @@ import './assets/ToolbarLayout.css';const vn = () => {
275
275
  );
276
276
  };
277
277
  const Nr = () => {
278
- const { pdf: t, pages: e } = oe(), [n, r] = q({
278
+ const { pdf: t, pages: e } = oe(), [n, r] = $({
279
279
  loadedPages: 0,
280
280
  totalPages: 0,
281
281
  percentage: 0
282
- }), [o, i] = q(!1), [c, l] = q(!1), [d, f] = q(null), m = W(!1);
283
- A(() => {
282
+ }), [o, i] = $(!1), [c, l] = $(!1), [d, f] = $(null), m = k(!1);
283
+ z(() => {
284
284
  m.current;
285
285
  }, [m]);
286
- const P = N(() => {
286
+ const P = O(() => {
287
287
  document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
288
- const p = document.querySelector(".rp-print-zone");
289
- p && p.remove();
290
- }, []), h = N(() => {
288
+ const h = document.querySelector(".rp-print-zone");
289
+ h && h.remove();
290
+ }, []), p = O(() => {
291
291
  m.current = !1, i(!1), l(!1), f(null), r({
292
292
  loadedPages: 0,
293
293
  totalPages: 0,
@@ -296,119 +296,119 @@ const Nr = () => {
296
296
  }, []), T = () => {
297
297
  m.current = !0;
298
298
  }, C = async ({
299
- scratchCanvas: p,
299
+ scratchCanvas: h,
300
300
  pdfDocument: u,
301
301
  pageNumber: s,
302
- viewerPdfPage: _,
303
- printResolution: w,
302
+ viewerPdfPage: w,
303
+ printResolution: _,
304
304
  optionalContentConfigPromise: x,
305
305
  printAnnotationStoragePromise: R
306
306
  }) => {
307
307
  if (m.current) {
308
- h();
308
+ p();
309
309
  return;
310
310
  }
311
- const S = w / Wo.PDF;
312
- p.width = Math.floor(_.width * S), p.height = Math.floor(_.height * S);
313
- const I = p.getContext("2d");
314
- I.save(), I.fillStyle = "rgb(255, 255, 255)", I.fillRect(0, 0, p.width, p.height), I.restore();
315
- const [E, D] = await Promise.all([
311
+ const I = _ / Wo.PDF;
312
+ h.width = Math.floor(w.width * I), h.height = Math.floor(w.height * I);
313
+ const S = h.getContext("2d");
314
+ S.save(), S.fillStyle = "rgb(255, 255, 255)", S.fillRect(0, 0, h.width, h.height), S.restore();
315
+ const [N, D] = await Promise.all([
316
316
  u.getPage(s),
317
317
  R
318
318
  ]);
319
319
  if (m.current) {
320
- h();
320
+ p();
321
321
  return;
322
322
  }
323
- const z = {
324
- canvasContext: I,
325
- transform: [S, 0, 0, S, 0, 0],
326
- viewport: E.getViewport({ scale: 1, rotation: _.rotation }),
323
+ const M = {
324
+ canvasContext: S,
325
+ transform: [I, 0, 0, I, 0, 0],
326
+ viewport: N.getViewport({ scale: 1, rotation: w.rotation }),
327
327
  intent: "print",
328
328
  annotationMode: Ho.ENABLE_STORAGE,
329
329
  optionalContentConfigPromise: x,
330
330
  printAnnotationStorage: D
331
331
  };
332
332
  try {
333
- return E.render(z).promise;
334
- } catch (L) {
335
- throw L instanceof $o || console.error(L), L;
333
+ return N.render(M).promise;
334
+ } catch (A) {
335
+ throw A instanceof $o || console.error(A), A;
336
336
  }
337
- }, b = N(() => {
338
- const p = window.print;
337
+ }, b = O(() => {
338
+ const h = window.print;
339
339
  return new Promise((u) => {
340
340
  const s = (x) => {
341
341
  setTimeout(() => {
342
- p.call(window), setTimeout(() => x(), 20);
342
+ h.call(window), setTimeout(() => x(), 20);
343
343
  }, 0);
344
344
  };
345
345
  if (document.querySelector(".rp-print-zone")) {
346
346
  s(u);
347
347
  return;
348
348
  }
349
- const w = new MutationObserver(() => {
350
- document.querySelector(".rp-print-zone") && (s(u), w.disconnect());
349
+ const _ = new MutationObserver(() => {
350
+ document.querySelector(".rp-print-zone") && (s(u), _.disconnect());
351
351
  });
352
- w.observe(document.body, { childList: !0, subtree: !0 });
352
+ _.observe(document.body, { childList: !0, subtree: !0 });
353
353
  });
354
- }, []), v = async (p) => {
354
+ }, []), v = async (h) => {
355
355
  const u = document.createElement("img"), s = document.createElement("div");
356
- return s.classList.add("rp-print-page"), await new Promise((_, w) => {
357
- p.toBlob((x) => {
356
+ return s.classList.add("rp-print-page"), await new Promise((w, _) => {
357
+ h.toBlob((x) => {
358
358
  x ? (u.src = URL.createObjectURL(x), u.onload = () => {
359
- URL.revokeObjectURL(u.src), _();
360
- }, u.onerror = w) : w(new Error("Failed to create blob"));
359
+ URL.revokeObjectURL(u.src), w();
360
+ }, u.onerror = _) : _(new Error("Failed to create blob"));
361
361
  });
362
362
  }).catch(() => {
363
363
  }), s.appendChild(u), s;
364
- }, y = (p, u) => {
364
+ }, y = (h, u) => {
365
365
  const s = document.createElement("div");
366
366
  s.classList.add("rp-print-zone");
367
- const _ = document.createElement("style"), w = u.get(1);
368
- if (w) {
369
- const { width: x, height: R } = w == null ? void 0 : w.page.getViewport({ scale: 1 });
370
- _.innerHTML = `@page { size: ${x}px ${R}px }`;
367
+ const w = document.createElement("style"), _ = u.get(1);
368
+ if (_) {
369
+ const { width: x, height: R } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
370
+ w.innerHTML = `@page { size: ${x}px ${R}px }`;
371
371
  }
372
- return s.appendChild(_), s.append(...p), s;
373
- }, g = N(async () => {
372
+ return s.appendChild(w), s.append(...h), s;
373
+ }, g = O(async () => {
374
374
  if (!t)
375
375
  return;
376
- h();
377
- const p = document.createElement("canvas"), u = [];
376
+ p();
377
+ const h = document.createElement("canvas"), u = [];
378
378
  try {
379
379
  t.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
380
- const _ = t.getOptionalContentConfig({ intent: "print" }), w = Promise.resolve(
380
+ const w = t.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
381
381
  t.annotationStorage.print ?? void 0
382
382
  ), x = e.size;
383
- for (const [S, I] of e) {
383
+ for (const [I, S] of e) {
384
384
  if (m.current) {
385
- h();
385
+ p();
386
386
  return;
387
387
  }
388
- const E = I.page.getViewport({ scale: 1 });
388
+ const N = S.page.getViewport({ scale: 1 });
389
389
  if (await C({
390
- scratchCanvas: p,
390
+ scratchCanvas: h,
391
391
  pdfDocument: t,
392
- pageNumber: S,
393
- viewerPdfPage: E,
392
+ pageNumber: I,
393
+ viewerPdfPage: N,
394
394
  printResolution: 150,
395
- optionalContentConfigPromise: _,
396
- printAnnotationStoragePromise: w
395
+ optionalContentConfigPromise: w,
396
+ printAnnotationStoragePromise: _
397
397
  }), m.current) {
398
- h();
398
+ p();
399
399
  return;
400
400
  }
401
- const D = await v(p);
401
+ const D = await v(h);
402
402
  u.push(D);
403
- const z = parseFloat((u.length / x * 100).toFixed(2));
403
+ const M = parseFloat((u.length / x * 100).toFixed(2));
404
404
  r({
405
- loadedPages: S,
405
+ loadedPages: I,
406
406
  totalPages: x,
407
- percentage: z
407
+ percentage: M
408
408
  });
409
409
  }
410
410
  if (m.current) {
411
- h();
411
+ p();
412
412
  return;
413
413
  }
414
414
  const R = y(u, e);
@@ -416,17 +416,17 @@ const Nr = () => {
416
416
  } catch (s) {
417
417
  l(!0), s instanceof Error && f(s);
418
418
  } finally {
419
- p.height = 0, p.width = 0;
419
+ h.height = 0, h.width = 0;
420
420
  }
421
421
  }, [t, e, m]);
422
- return A(() => {
423
- const p = () => {
424
- h(), P();
422
+ return z(() => {
423
+ const h = () => {
424
+ p(), P();
425
425
  };
426
- return window.addEventListener("afterprint", p, !0), () => {
427
- window.removeEventListener("afterprint", p, !0);
426
+ return window.addEventListener("afterprint", h, !0), () => {
427
+ window.removeEventListener("afterprint", h, !0);
428
428
  };
429
- }, [P, h]), {
429
+ }, [P, p]), {
430
430
  print: g,
431
431
  cancel: T,
432
432
  progress: n,
@@ -452,23 +452,23 @@ const Nr = () => {
452
452
  }
453
453
  }
454
454
  }), Zs = ({ children: t }) => {
455
- const [e, n] = q(null), [r, o] = q(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Nr(), P = N((v) => {
455
+ const [e, n] = $(null), [r, o] = $(null), { print: i, cancel: c, progress: l, isComplete: d, isError: f, error: m } = Nr(), P = O((v) => {
456
456
  v && typeof v == "function" && o(() => v);
457
- }, []), h = (v) => {
457
+ }, []), p = (v) => {
458
458
  m && v(m);
459
- }, T = N(
459
+ }, T = O(
460
460
  (v) => {
461
461
  n(() => v);
462
462
  },
463
463
  [l, e]
464
464
  );
465
- A(() => {
465
+ z(() => {
466
466
  d && r && C();
467
- }, [d, r]), A(() => {
468
- f && h((v) => {
467
+ }, [d, r]), z(() => {
468
+ f && p((v) => {
469
469
  console.error(v);
470
470
  });
471
- }, [f]), A(() => {
471
+ }, [f]), z(() => {
472
472
  l && e && e(l);
473
473
  }, [l, e]);
474
474
  const C = () => {
@@ -478,7 +478,7 @@ const Nr = () => {
478
478
  cancel: c,
479
479
  setOnProgress: T,
480
480
  setOnComplete: P,
481
- setOnError: h,
481
+ setOnError: p,
482
482
  progress: l
483
483
  };
484
484
  return /* @__PURE__ */ a(_n.Provider, { value: b, children: t });
@@ -488,14 +488,14 @@ const Nr = () => {
488
488
  throw new Error("usePrintContext must be used within a PrintProvider");
489
489
  return t;
490
490
  }, Or = () => {
491
- const [t, e] = q({}), { pages: n } = oe(), r = F(() => Object.keys(t).length, [t]), o = N(
491
+ const [t, e] = $({}), { pages: n } = oe(), r = F(() => Object.keys(t).length, [t]), o = O(
492
492
  (c) => {
493
493
  if (!n.size)
494
494
  return;
495
495
  const l = c > n.size ? n.size : c, f = Array.from(n.values()).slice(0, l).map((m) => {
496
- const { thumbnailViewport: P, scale: h } = ar(m.page, m.defaultRotation);
496
+ const { thumbnailViewport: P, scale: p } = ar(m.page, m.defaultRotation);
497
497
  return {
498
- scale: h,
498
+ scale: p,
499
499
  page: m.page,
500
500
  loading: !0,
501
501
  viewport: P,
@@ -506,10 +506,10 @@ const Nr = () => {
506
506
  },
507
507
  [n]
508
508
  );
509
- A(() => {
509
+ z(() => {
510
510
  o(10);
511
511
  }, [o]);
512
- const i = N(
512
+ const i = O(
513
513
  (c) => {
514
514
  if (!n)
515
515
  return;
@@ -542,7 +542,7 @@ const Nr = () => {
542
542
  children: t,
543
543
  initialThumbnailsVisible: e
544
544
  }) => {
545
- const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Or(), [c, l] = q(e);
545
+ const { thumbnailPages: n, addPage: r, addToPage: o, thumbnailLength: i } = Or(), [c, l] = $(e);
546
546
  return /* @__PURE__ */ a(
547
547
  bn.Provider,
548
548
  {
@@ -551,100 +551,111 @@ const Nr = () => {
551
551
  }
552
552
  );
553
553
  }, Dr = (t = {}, e = "") => {
554
- const [n, r] = q(e), [o, i] = q(!1), { pdf: c, pages: l } = oe(), { widths: d, heights: f } = Ge(), m = W(!n), { currentZoom: P } = wt(), [h, T] = q([]), { setFocusedPage: C } = le(), { columnCount: b } = Me(), { pageRotate: v } = Je(), [y, g] = q(0), { pageScrollElementRef: p, virtualScrollableElementRef: u } = Ye(), { scrollMode: s } = Ee(), { pagesRef: _ } = _e(), [w, x] = q(null), R = W({}), S = F(() => y === 0 ? null : h[y - 1], [y, h]), I = F(() => h.length, [h]);
555
- A(() => {
556
- if (!S || !l)
557
- return;
558
- const L = u || p;
559
- if (!L || !_)
560
- return;
561
- const O = l.get(S.page);
562
- if (s === ne.PAGE_SCROLLING && C(S.page), !O)
563
- return;
564
- let M = 0, $ = 0;
565
- if (s === ne.VERTICAL_SCROLLING) {
566
- const J = S.page - 1, ee = b, re = J % ee, ve = Math.floor(J / ee);
567
- M = ze(f, ve), $ = ze(d, re);
568
- }
569
- s === ne.HORIZONTAL_SCROLLING && ($ = d.slice(0, S.page - 1).reduce((J, ee) => J + ee, 0));
570
- const k = {
571
- height: f[S.page - 1],
572
- width: d[S.page - 1]
573
- }, B = {
574
- top: k.height / 2,
575
- left: k.width / 2
576
- }, Z = v[S.page], { leftInPage: U, topInPage: ie } = ir(
577
- k,
578
- B,
579
- S.rect,
580
- P,
581
- Z
582
- ), G = $ + U, K = M + ie, Y = {
583
- left: Math.max(G, 0),
584
- top: Math.max(K, 0)
585
- };
586
- L.scrollTo({
587
- ...Y,
588
- behavior: "smooth"
554
+ const [n, r] = $(e), [o, i] = $(!1), { pdf: c, pages: l } = oe(), { widths: d, heights: f } = Ge(), m = k(!n), { currentZoom: P } = wt(), [p, T] = $([]), { setFocusedPage: C } = de(), { columnCount: b } = Me(), { pageRotate: v } = Je(), [y, g] = $(0), { pageScrollElementRef: h, virtualScrollableElementRef: u } = Ye(), { scrollMode: s } = Ee(), { pagesRef: w } = be(), [_, x] = $(null), R = k({}), I = F(() => y === 0 ? null : p[y - 1], [y, p]), S = F(() => p.length, [p]), N = O(
555
+ (L) => {
556
+ if (L === 0)
557
+ return;
558
+ const E = p[L - 1];
559
+ if (!E || !l)
560
+ return;
561
+ const q = u || h;
562
+ if (!q || !w)
563
+ return;
564
+ const W = l.get(E.page);
565
+ if (s === ne.PAGE_SCROLLING && C(E.page), !W)
566
+ return;
567
+ let U = 0, j = 0;
568
+ if (s === ne.VERTICAL_SCROLLING) {
569
+ const J = E.page - 1, ue = b, ie = J % ue, me = Math.floor(J / ue);
570
+ U = ze(f, me), j = ze(d, ie);
571
+ }
572
+ s === ne.HORIZONTAL_SCROLLING && (j = d.slice(0, E.page - 1).reduce((J, ue) => J + ue, 0));
573
+ const V = {
574
+ height: f[E.page - 1],
575
+ width: d[E.page - 1]
576
+ }, ee = v[E.page], { leftInPage: G, topInPage: Z } = ir(
577
+ V,
578
+ w,
579
+ E.rect,
580
+ P,
581
+ ee
582
+ ), Y = j + G, re = U + Z, ae = {
583
+ left: Math.max(Y, 0),
584
+ top: Math.max(re, 0)
585
+ };
586
+ q.scrollTo({
587
+ ...ae,
588
+ behavior: "smooth"
589
+ });
590
+ },
591
+ [
592
+ l,
593
+ C,
594
+ d,
595
+ f,
596
+ s,
597
+ u,
598
+ h,
599
+ w,
600
+ p
601
+ ]
602
+ );
603
+ z(() => {
604
+ y === 1 && N(y);
605
+ }, [y]);
606
+ const D = O(() => {
607
+ g((L) => {
608
+ let E;
609
+ return S ? L + 1 > S ? E = 1 : E = L + 1 : E = 0, E !== 1 && N(E), E;
589
610
  });
590
- }, [
591
- l,
592
- C,
593
- d,
594
- f,
595
- S,
596
- s,
597
- u,
598
- p,
599
- _
600
- ]);
601
- const E = N(() => {
602
- g((L) => I ? L + 1 > I ? 1 : L + 1 : 0);
603
- }, [I]), D = N(() => {
604
- g((L) => I ? L - 1 <= 0 ? I : L - 1 : 0);
605
- }, [I]), z = N(async (L) => {
611
+ }, [S, N]), M = O(() => {
612
+ g((L) => {
613
+ let E;
614
+ return S ? L - 1 <= 0 ? E = S : E = L - 1 : E = 0, E !== 1 && N(E), E;
615
+ });
616
+ }, [S, N]), A = O(async (L) => {
606
617
  if (!L)
607
618
  return {};
608
- const O = L.numPages, M = {};
609
- for (let $ = 1; $ <= O; $++) {
619
+ const E = L.numPages, q = {};
620
+ for (let W = 1; W <= E; W++) {
610
621
  if (m.current)
611
622
  throw "close pop over";
612
- const k = await L.getPage($);
613
- M[$.toString()] = await k.getTextContent();
623
+ const U = await L.getPage(W);
624
+ q[W.toString()] = await U.getTextContent();
614
625
  }
615
- return M;
626
+ return q;
616
627
  }, []);
617
- return A(() => {
628
+ return z(() => {
618
629
  if (!n) {
619
630
  m.current = !0, T([]), g(0);
620
631
  return;
621
632
  }
622
- m.current = !1, i(!0), T([]), g(0), z(c).then((L) => {
633
+ m.current = !1, i(!0), T([]), g(0), A(c).then((L) => {
623
634
  R.current = L;
624
- const M = Object.keys(L).reduce(($, k) => {
625
- const B = mo(
635
+ const q = Object.keys(L).reduce((W, U) => {
636
+ const j = mo(
626
637
  [n],
627
- L[k],
628
- Number(k) - 1,
638
+ L[U],
639
+ Number(U) - 1,
629
640
  t
630
- ).map((Z, U) => ({ ...Z, page: Number(k), pageMatchIdx: U }));
631
- return [...$, ...B];
641
+ ).map((V, ee) => ({ ...V, page: Number(U), pageMatchIdx: ee }));
642
+ return [...W, ...j];
632
643
  }, []);
633
- T(M), g(M.length ? 1 : 0);
644
+ T(q), g(q.length ? 1 : 0);
634
645
  }).catch(() => {
635
646
  T([]), g(0);
636
647
  }).finally(() => i(!1));
637
- }, [n, z, c, t]), {
648
+ }, [n, A, c, t]), {
638
649
  search: n,
639
650
  setSearch: r,
640
651
  loading: o,
641
- matches: h,
642
- totalMatches: I,
652
+ matches: p,
653
+ totalMatches: S,
643
654
  currentMatchPosition: y,
644
- currentMatch: S,
645
- nextMatch: E,
646
- prevMatch: D,
647
- currentMatchElement: w,
655
+ currentMatch: I,
656
+ nextMatch: D,
657
+ prevMatch: M,
658
+ currentMatchElement: _,
648
659
  setCurrentMatchElement: x
649
660
  };
650
661
  }, Cn = $e({
@@ -669,7 +680,7 @@ const Nr = () => {
669
680
  children: t,
670
681
  initialSearch: e
671
682
  }) => {
672
- const [n, r] = q({}), {
683
+ const [n, r] = $({}), {
673
684
  loading: o,
674
685
  setSearch: i,
675
686
  totalMatches: c,
@@ -678,7 +689,7 @@ const Nr = () => {
678
689
  search: f,
679
690
  matches: m,
680
691
  nextMatch: P,
681
- prevMatch: h,
692
+ prevMatch: p,
682
693
  currentMatchElement: T,
683
694
  setCurrentMatchElement: C
684
695
  } = Dr(n, e);
@@ -694,7 +705,7 @@ const Nr = () => {
694
705
  currentMatchPosition: l,
695
706
  currentMatch: d,
696
707
  nextMatch: P,
697
- prevMatch: h,
708
+ prevMatch: p,
698
709
  search: f,
699
710
  matches: m,
700
711
  currentMatchElement: T,
@@ -704,9 +715,9 @@ const Nr = () => {
704
715
  }
705
716
  );
706
717
  }, yt = () => qe(Cn), Pn = $e(null), Ys = ({ children: t }) => {
707
- const e = W(!1), [n, r] = q([]), o = N((d) => {
718
+ const e = k(!1), [n, r] = $([]), o = O((d) => {
708
719
  r((f) => [...f, { id: d.page.pageNumber.toString(), data: d, priority: 0 }]);
709
- }, []), i = F(() => new To(o), [o]), { focusedPage: c } = le(), l = N((d) => (e.current = !0, Co(
720
+ }, []), i = F(() => new To(o), [o]), { focusedPage: c } = de(), l = O((d) => (e.current = !0, Co(
710
721
  d.data.page,
711
722
  d.data.canvasElem,
712
723
  d.data.options
@@ -715,9 +726,9 @@ const Nr = () => {
715
726
  }).finally(() => {
716
727
  d.data.onLoaded && d.data.onLoaded();
717
728
  })), []);
718
- return A(() => {
729
+ return z(() => {
719
730
  c && (i.changePagePriority(`^page-${c}`, 0), i.changePagePriority(`^thumbnail-${c}`, 1));
720
- }, [c]), A(() => {
731
+ }, [c]), z(() => {
721
732
  if (i.isEmpty() || e.current)
722
733
  return;
723
734
  const d = () => {
@@ -733,7 +744,7 @@ const Nr = () => {
733
744
  if (!t)
734
745
  throw new Error("RenderQueue not found");
735
746
  return t;
736
- }, ae = {
747
+ }, se = {
737
748
  "rp-pages": "_rp-pages_1fvmx_1",
738
749
  "rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1fvmx_6",
739
750
  "rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1fvmx_11",
@@ -749,20 +760,20 @@ const Nr = () => {
749
760
  "rp-page": "_rp-page_14ohm_1",
750
761
  "rp-loader-wrapper": "_rp-loader-wrapper_14ohm_15"
751
762
  }, Ar = (t) => {
752
- const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = W(null), { pages: i } = oe(), { pageRotate: c } = Je(), l = W(), { currentZoom: d } = wt(), f = yn(), m = W(`page-${e}`);
753
- return A(() => {
763
+ const { pageNumber: e, onLoaded: n, onLoading: r } = t, o = k(null), { pages: i } = oe(), { pageRotate: c } = Je(), l = k(), { currentZoom: d } = wt(), f = yn(), m = k(`page-${e}`);
764
+ return z(() => {
754
765
  if (!i || d === 0)
755
766
  return;
756
767
  const P = i.get(e);
757
768
  if (o.current && P) {
758
- const h = o.current;
759
- h.hidden = !0;
769
+ const p = o.current;
770
+ p.hidden = !0;
760
771
  const T = l.current;
761
772
  T && T.cancel(), r && r(), f.enqueue(
762
773
  m.current,
763
774
  {
764
775
  page: P.page,
765
- canvasElem: h,
776
+ canvasElem: p,
766
777
  options: {
767
778
  scale: d,
768
779
  rotate: c[e],
@@ -777,33 +788,33 @@ const Nr = () => {
777
788
  f.removeQueue(m.current);
778
789
  };
779
790
  }, [i, e, c, d, r, n, f]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${e}-canvas`, ref: o });
780
- }, zr = "_selecting_1uik2_10", Mr = "_markedContent_1uik2_33", fe = {
781
- "rp-text-layer": "_rp-text-layer_1uik2_1",
791
+ }, zr = "_selecting_ppr5g_10", Mr = "_markedContent_ppr5g_33", ge = {
792
+ "rp-text-layer": "_rp-text-layer_ppr5g_1",
782
793
  selecting: zr,
783
794
  markedContent: Mr,
784
- "rp-text-layer-text": "_rp-text-layer-text_1uik2_52"
795
+ "rp-text-layer-text": "_rp-text-layer-text_ppr5g_52"
785
796
  }, Fr = (t) => {
786
- const { pageNumber: e } = t, { pages: n } = oe(), r = W(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = yt(), [l, d] = q(
797
+ const { pageNumber: e } = t, { pages: n } = oe(), r = k(null), { matches: o, currentMatch: i, setCurrentMatchElement: c } = yt(), [l, d] = $(
787
798
  []
788
- ), f = W(), m = W(), P = W([]), h = F(() => o.filter((p) => p.pageIndex === e - 1), [o, e]), T = N(
789
- (p, u, s = !1) => {
790
- if (s && go(p, u), !h.length) {
799
+ ), f = k(), m = k(), P = k([]), p = F(() => o.filter((h) => h.pageIndex === e - 1), [o, e]), T = O(
800
+ (h, u, s = !1) => {
801
+ if (s && go(h, u), !p.length) {
791
802
  P.current = [], d([]);
792
803
  return;
793
804
  }
794
- const _ = vo(h, p, u);
795
- d(_);
805
+ const w = vo(p, h, u);
806
+ d(w);
796
807
  },
797
- [h]
798
- ), C = W(), b = W(!1), v = N(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
799
- A(() => ((() => {
808
+ [p]
809
+ ), C = k(), b = k(!1), v = O(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
810
+ z(() => ((() => {
800
811
  if (C.current)
801
812
  return;
802
813
  C.current = new AbortController();
803
814
  const { signal: u } = C.current, s = () => {
804
- v().forEach((w) => {
805
- const x = w.querySelector(".endOfContent");
806
- x && (w.appendChild(x), x.style.width = "", x.style.height = "", w.classList.remove(fe.selecting));
815
+ v().forEach((_) => {
816
+ const x = _.querySelector(".endOfContent");
817
+ x && (_.appendChild(x), x.style.width = "", x.style.height = "", _.classList.remove(ge.selecting));
807
818
  });
808
819
  };
809
820
  document.addEventListener(
@@ -831,40 +842,40 @@ const Nr = () => {
831
842
  },
832
843
  { signal: u }
833
844
  );
834
- let _ = null;
845
+ let w = null;
835
846
  document.addEventListener(
836
847
  "selectionchange",
837
848
  () => {
838
- var z, L;
839
- const w = document.getSelection();
840
- if (!w)
849
+ var M, A;
850
+ const _ = document.getSelection();
851
+ if (!_)
841
852
  return;
842
- if (w.rangeCount === 0) {
853
+ if (_.rangeCount === 0) {
843
854
  s();
844
855
  return;
845
856
  }
846
857
  const x = /* @__PURE__ */ new Set();
847
- for (let O = 0; O < w.rangeCount; O++) {
848
- const M = w.getRangeAt(O);
849
- v().forEach(($) => {
850
- M.intersectsNode($) && !x.has($) && x.add($);
858
+ for (let L = 0; L < _.rangeCount; L++) {
859
+ const E = _.getRangeAt(L);
860
+ v().forEach((q) => {
861
+ E.intersectsNode(q) && !x.has(q) && x.add(q);
851
862
  });
852
863
  }
853
- v().forEach((O) => {
854
- if (x.has(O))
855
- O.classList.add(fe.selecting);
864
+ v().forEach((L) => {
865
+ if (x.has(L))
866
+ L.classList.add(ge.selecting);
856
867
  else {
857
- const M = O.querySelector(".endOfContent");
858
- M && (O.appendChild(M), M.style.width = "", M.style.height = "", O.classList.remove(fe.selecting));
868
+ const E = L.querySelector(".endOfContent");
869
+ E && (L.appendChild(E), E.style.width = "", E.style.height = "", L.classList.remove(ge.selecting));
859
870
  }
860
871
  });
861
- const R = w.getRangeAt(0);
862
- let I = _ && (R.compareBoundaryPoints(Range.END_TO_END, _) === 0 || R.compareBoundaryPoints(Range.START_TO_END, _) === 0) ? R.startContainer : R.endContainer;
863
- I.nodeType === Node.TEXT_NODE && (I = I.parentNode);
864
- const E = (z = I.parentElement) == null ? void 0 : z.closest(
865
- fe["rp-text-layer"]
866
- ), D = E == null ? void 0 : E.querySelector(".endOfContent");
867
- D && E && (D.style.width = E.style.width, D.style.height = E.style.height, (L = I.parentElement) == null || L.insertBefore(D, I.nextSibling)), _ = R.cloneRange();
872
+ const R = _.getRangeAt(0);
873
+ let S = w && (R.compareBoundaryPoints(Range.END_TO_END, w) === 0 || R.compareBoundaryPoints(Range.START_TO_END, w) === 0) ? R.startContainer : R.endContainer;
874
+ S.nodeType === Node.TEXT_NODE && (S = S.parentNode);
875
+ const N = (M = S.parentElement) == null ? void 0 : M.closest(
876
+ ge["rp-text-layer"]
877
+ ), D = N == null ? void 0 : N.querySelector(".endOfContent");
878
+ D && N && (D.style.width = N.style.width, D.style.height = N.style.height, (A = S.parentElement) == null || A.insertBefore(D, S.nextSibling)), w = R.cloneRange();
868
879
  },
869
880
  { signal: u }
870
881
  );
@@ -872,55 +883,55 @@ const Nr = () => {
872
883
  var u;
873
884
  (u = C.current) == null || u.abort(), C.current = void 0;
874
885
  }), [v]);
875
- const y = N(() => {
876
- r.current && r.current.classList.add(fe.selecting);
877
- }, []), g = N(() => {
878
- r.current && r.current.classList.remove(fe.selecting);
886
+ const y = O(() => {
887
+ r.current && r.current.classList.add(ge.selecting);
888
+ }, []), g = O(() => {
889
+ r.current && r.current.classList.remove(ge.selecting);
879
890
  }, []);
880
- return A(() => {
891
+ return z(() => {
881
892
  if (P.current.forEach((s) => {
882
893
  s.classList.remove("selected");
883
894
  }), !l.length || !i || i.pageIndex !== e - 1)
884
895
  return;
885
- const p = h.findIndex(
896
+ const h = p.findIndex(
886
897
  (s) => JSON.stringify(s) === JSON.stringify(i)
887
898
  );
888
- if (p === -1)
899
+ if (h === -1)
889
900
  return;
890
- const u = l.filter((s) => s.index === p);
901
+ const u = l.filter((s) => s.index === h);
891
902
  u.length && (P.current = u.map((s) => s.element), c(u[0].element), u.forEach((s) => {
892
903
  s.element.classList.add("selected");
893
904
  }));
894
- }, [i, l, h]), A(() => {
895
- const p = n.get(e);
896
- if (!p || !r.current)
905
+ }, [i, l, p]), z(() => {
906
+ const h = n.get(e);
907
+ if (!h || !r.current)
897
908
  return;
898
909
  const u = r.current;
899
- return f.current && f.current.cancel(), p.page.getTextContent().then((s) => {
900
- const _ = p.page.getViewport({ scale: 1 });
910
+ return f.current && f.current.cancel(), h.page.getTextContent().then((s) => {
911
+ const w = h.page.getViewport({ scale: 1 });
901
912
  return f.current = new ko.TextLayer({
902
- viewport: _,
913
+ viewport: w,
903
914
  textContentSource: s,
904
915
  container: u
905
916
  }), m.current = s, u && (u.innerText = ""), f.current.render();
906
917
  }).then(() => {
907
918
  var x, R;
908
- [].slice.call(u.children).forEach((S) => {
909
- S.classList.add(fe["rp-text-layer-text"]), S.setAttribute("data-rp", "rp-text-layer-text");
919
+ [].slice.call(u.children).forEach((I) => {
920
+ I.classList.add(ge["rp-text-layer-text"]), I.setAttribute("data-rp", "rp-text-layer-text");
910
921
  });
911
- const _ = (x = f.current) == null ? void 0 : x.textDivs;
912
- _ && m.current && T(m.current, _);
913
- const w = document.createElement("div");
914
- w.className = "endOfContent", (R = r.current) == null || R.appendChild(w);
922
+ const w = (x = f.current) == null ? void 0 : x.textDivs;
923
+ w && m.current && T(m.current, w);
924
+ const _ = document.createElement("div");
925
+ _.className = "endOfContent", (R = r.current) == null || R.appendChild(_);
915
926
  }).catch(() => {
916
927
  }), () => {
917
928
  var s;
918
929
  (s = f.current) == null || s.cancel();
919
930
  };
920
- }, [n, e]), A(() => {
931
+ }, [n, e]), z(() => {
921
932
  var s;
922
- [].slice.call(r.current.children).forEach((_) => {
923
- _.classList.add(fe["rp-text-layer-text"]);
933
+ [].slice.call(r.current.children).forEach((w) => {
934
+ w.classList.add(ge["rp-text-layer-text"]);
924
935
  });
925
936
  const u = (s = f.current) == null ? void 0 : s.textDivs;
926
937
  u && m.current && T(m.current, u, !0);
@@ -929,7 +940,7 @@ const Nr = () => {
929
940
  {
930
941
  "data-rp-text-layer": !0,
931
942
  "data-rp": `page-${e}-textLayer`,
932
- className: fe["rp-text-layer"],
943
+ className: ge["rp-text-layer"],
933
944
  ref: r,
934
945
  onMouseDown: y,
935
946
  onMouseUp: g
@@ -940,24 +951,24 @@ const Nr = () => {
940
951
  };
941
952
  let Wr = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
942
953
  const Hr = (t) => {
943
- const { pageNumber: e } = t, n = W(null), { pages: r, pdf: o } = oe(), i = W(), [c, l] = q(), { setFocusedPage: d, goToPage: f } = le(), { scrollMode: m } = Ee(), { print: P } = tt(), { download: h } = Gn(), T = F(() => r.get(e), [r, e]), C = F(() => T == null ? void 0 : T.page.getViewport(), [T]);
944
- A(() => {
954
+ const { pageNumber: e } = t, n = k(null), { pages: r, pdf: o } = oe(), i = k(), [c, l] = $(), { setFocusedPage: d, goToPage: f } = de(), { scrollMode: m } = Ee(), { print: P } = tt(), { download: p } = Gn(), T = F(() => r.get(e), [r, e]), C = F(() => T == null ? void 0 : T.page.getViewport(), [T]);
955
+ z(() => {
945
956
  i.current && (i.current.div.replaceChildren(), i.current = void 0);
946
- }, [o]), A(() => {
957
+ }, [o]), z(() => {
947
958
  T && T.page.getAnnotations().then((v) => {
948
959
  i.current = void 0, l(v), n.current && (n.current.innerText = "");
949
960
  });
950
961
  }, [T]);
951
- const b = N(
962
+ const b = O(
952
963
  (v) => {
953
964
  !c || !o || (Uo(v), Vo(v, o, c).then((y) => {
954
- var g, p;
955
- ((g = y == null ? void 0 : y.data) == null ? void 0 : g.action) === "Print" ? P() : ((p = y == null ? void 0 : y.data) == null ? void 0 : p.action) === "SaveAs" && h();
965
+ var g, h;
966
+ ((g = y == null ? void 0 : y.data) == null ? void 0 : g.action) === "Print" ? P() : ((h = y == null ? void 0 : y.data) == null ? void 0 : h.action) === "SaveAs" && p();
956
967
  }), m === ne.PAGE_SCROLLING ? Ft(v, c, o, (y) => d(y.pageIndex + 1)) : Ft(v, c, o, (y) => f(y.pageIndex + 1)));
957
968
  },
958
- [o, c, f, d, m, P, h]
969
+ [o, c, f, d, m, P, p]
959
970
  );
960
- return A(() => {
971
+ return z(() => {
961
972
  if (!T || !c)
962
973
  return;
963
974
  const v = T.page.getViewport();
@@ -981,7 +992,7 @@ const Hr = (t) => {
981
992
  }
982
993
  const g = new AbortController();
983
994
  return (async () => {
984
- var _;
995
+ var w;
985
996
  i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new qo({
986
997
  div: n.current,
987
998
  accessibilityManager: void 0,
@@ -994,7 +1005,7 @@ const Hr = (t) => {
994
1005
  const u = await (o == null ? void 0 : o.hasJSActions()), s = await (o == null ? void 0 : o.getFieldObjects());
995
1006
  if (g.signal.aborted)
996
1007
  throw "abort";
997
- return (_ = i.current) == null ? void 0 : _.render({
1008
+ return (w = i.current) == null ? void 0 : w.render({
998
1009
  annotations: c,
999
1010
  annotationStorage: o == null ? void 0 : o.annotationStorage,
1000
1011
  hasJSActions: u,
@@ -1028,92 +1039,92 @@ const Hr = (t) => {
1028
1039
  }, $r = {
1029
1040
  "rp-text-highlight": "_rp-text-highlight_jdkf8_1"
1030
1041
  }, qr = ({ pageNumber: t, viewport: e }) => {
1031
- const [n, r] = q(), { pages: o } = oe(), { highlightKeywords: i } = _o(), c = !0, l = W(null), [d, f] = q(null), [m, P] = q([]);
1032
- A(() => {
1042
+ const [n, r] = $(), { pages: o } = oe(), { highlightKeywords: i } = _o(), c = !0, l = k(null), [d, f] = $(null), [m, P] = $([]);
1043
+ z(() => {
1033
1044
  l.current && f(l.current.parentElement);
1034
- }, [l]), A(() => {
1045
+ }, [l]), z(() => {
1035
1046
  (async () => {
1036
- const p = o.get(t);
1037
- if (!p || !l.current)
1047
+ const h = o.get(t);
1048
+ if (!h || !l.current)
1038
1049
  return;
1039
- const u = await p.page.getTextContent();
1050
+ const u = await h.page.getTextContent();
1040
1051
  r(u);
1041
1052
  })();
1042
1053
  }, [o, t]);
1043
- const h = F(() => i ? i.map((g) => {
1044
- var p, u;
1054
+ const p = F(() => i ? i.map((g) => {
1055
+ var h, u;
1045
1056
  return {
1046
- ...Zo(g.keyword, (p = g.options) == null ? void 0 : p.matchCase, (u = g.options) == null ? void 0 : u.wholeWords),
1057
+ ...Zo(g.keyword, (h = g.options) == null ? void 0 : h.matchCase, (u = g.options) == null ? void 0 : u.wholeWords),
1047
1058
  color: g.highlightColor
1048
1059
  };
1049
1060
  }) : [], [i]);
1050
- function T(g, p) {
1061
+ function T(g, h) {
1051
1062
  if (!g)
1052
1063
  return;
1053
- const u = `[data-rp="page-${p}-textLayer"]`;
1064
+ const u = `[data-rp="page-${h}-textLayer"]`;
1054
1065
  return new Promise((s) => {
1055
- const _ = g.querySelector(u);
1056
- if (_) {
1057
- s(_);
1066
+ const w = g.querySelector(u);
1067
+ if (w) {
1068
+ s(w);
1058
1069
  return;
1059
1070
  }
1060
1071
  new MutationObserver((x, R) => {
1061
- const S = g.querySelector(u);
1062
- S && (s(S), R.disconnect());
1072
+ const I = g.querySelector(u);
1073
+ I && (s(I), R.disconnect());
1063
1074
  }).observe(g, { childList: !0, subtree: !0 });
1064
1075
  });
1065
1076
  }
1066
1077
  function C(g) {
1067
- return new Promise((p) => {
1078
+ return new Promise((h) => {
1068
1079
  const u = g.querySelectorAll(
1069
1080
  '[data-rp="rp-text-layer-text"]'
1070
1081
  );
1071
1082
  if (u.length) {
1072
- p(Array.from(u));
1083
+ h(Array.from(u));
1073
1084
  return;
1074
1085
  }
1075
- new MutationObserver((_, w) => {
1086
+ new MutationObserver((w, _) => {
1076
1087
  const x = g.querySelectorAll(
1077
1088
  ".rp-text-layer-text"
1078
1089
  );
1079
- x.length && (p(Array.from(x)), w.disconnect());
1090
+ x.length && (h(Array.from(x)), _.disconnect());
1080
1091
  }).observe(g, { childList: !0, subtree: !0 });
1081
1092
  });
1082
1093
  }
1083
- const b = (g, p, u, s) => {
1084
- var B;
1085
- const _ = document.createRange(), w = u.firstChild;
1086
- if (!w || w.nodeType !== Node.TEXT_NODE)
1094
+ const b = (g, h, u, s) => {
1095
+ var U;
1096
+ const w = document.createRange(), _ = u.firstChild;
1097
+ if (!_ || _.nodeType !== Node.TEXT_NODE)
1087
1098
  return null;
1088
- const x = ((B = w.textContent) == null ? void 0 : B.length) ?? 0, R = s[0].charIdxInSpan, S = s.length === 1 ? R : s[s.length - 1].charIdxInSpan;
1089
- if (R > x || S + 1 > x)
1099
+ const x = ((U = _.textContent) == null ? void 0 : U.length) ?? 0, R = s[0].charIdxInSpan, I = s.length === 1 ? R : s[s.length - 1].charIdxInSpan;
1100
+ if (R > x || I + 1 > x)
1090
1101
  return null;
1091
- _.setStart(w, R), _.setEnd(w, S + 1);
1092
- const I = document.createElement("span");
1093
- I.style.width = "auto", _.surroundContents(I);
1094
- const E = I.getBoundingClientRect(), D = g.getBoundingClientRect(), z = D.height, L = D.width, O = 100 * (E.left - D.left) / L, M = 100 * (E.top - D.top) / z, $ = 100 * E.height / z, k = 100 * E.width / L;
1095
- return Qo(I), {
1096
- keywordStr: p,
1097
- left: O,
1098
- top: M,
1099
- height: $,
1100
- width: k,
1101
- pageHeight: z,
1102
- pageWidth: L
1102
+ w.setStart(_, R), w.setEnd(_, I + 1);
1103
+ const S = document.createElement("span");
1104
+ S.style.width = "auto", w.surroundContents(S);
1105
+ const N = S.getBoundingClientRect(), D = g.getBoundingClientRect(), M = D.height, A = D.width, L = 100 * (N.left - D.left) / A, E = 100 * (N.top - D.top) / M, q = 100 * N.height / M, W = 100 * N.width / A;
1106
+ return Qo(S), {
1107
+ keywordStr: h,
1108
+ left: L,
1109
+ top: E,
1110
+ height: q,
1111
+ width: W,
1112
+ pageHeight: M,
1113
+ pageWidth: A
1103
1114
  };
1104
1115
  };
1105
- async function v(g, p) {
1116
+ async function v(g, h) {
1106
1117
  const u = await T(d, g);
1107
1118
  if (!u)
1108
1119
  return;
1109
1120
  const s = await C(u);
1110
1121
  if (s.length) {
1111
- const _ = s.map((x) => x.tagName === "BR" ? " " : x.textContent).reduce(
1112
- (x, R, S) => x.concat(
1113
- R.split("").map((I, E) => ({
1114
- char: I,
1115
- charIdxInSpan: E,
1116
- spanIdx: S
1122
+ const w = s.map((x) => x.tagName === "BR" ? " " : x.textContent).reduce(
1123
+ (x, R, I) => x.concat(
1124
+ R.split("").map((S, N) => ({
1125
+ char: S,
1126
+ charIdxInSpan: N,
1127
+ spanIdx: I
1117
1128
  }))
1118
1129
  ),
1119
1130
  [
@@ -1123,57 +1134,57 @@ const Hr = (t) => {
1123
1134
  spanIdx: 0
1124
1135
  }
1125
1136
  ]
1126
- ).slice(1), w = y(u, p, s, _);
1127
- P(w);
1137
+ ).slice(1), _ = y(u, h, s, w);
1138
+ P(_);
1128
1139
  }
1129
1140
  }
1130
- const y = (g, p, u, s) => {
1131
- const _ = p.length;
1132
- if (!s.length || !_)
1141
+ const y = (g, h, u, s) => {
1142
+ const w = h.length;
1143
+ if (!s.length || !w)
1133
1144
  return [];
1134
- const w = [], x = s.map((R) => R.char).join("");
1135
- return h.forEach((R) => {
1136
- const { keyword: S, regExp: I, wholeWords: E, color: D } = R, z = S;
1137
- if (!z.trim())
1145
+ const _ = [], x = s.map((R) => R.char).join("");
1146
+ return p.forEach((R) => {
1147
+ const { keyword: I, regExp: S, wholeWords: N, color: D } = R, M = I;
1148
+ if (!M.trim())
1138
1149
  return;
1139
- const L = I.flags.indexOf("g") === -1 ? new RegExp(I, `${I.flags}g`) : I;
1140
- let O;
1141
- const M = [];
1142
- for (; (O = L.exec(x)) !== null; )
1143
- E && !wo(x, O.index, O[0].length) || M.push({
1144
- keyword: L,
1145
- startIndex: O.index,
1146
- endIndex: L.lastIndex
1150
+ const A = S.flags.indexOf("g") === -1 ? new RegExp(S, `${S.flags}g`) : S;
1151
+ let L;
1152
+ const E = [];
1153
+ for (; (L = A.exec(x)) !== null; )
1154
+ N && !wo(x, L.index, L[0].length) || E.push({
1155
+ keyword: A,
1156
+ startIndex: L.index,
1157
+ endIndex: A.lastIndex
1147
1158
  });
1148
- const $ = M.map((k) => ({
1149
- keyword: k.keyword,
1150
- indexes: s.slice(k.startIndex, k.endIndex),
1159
+ const q = E.map((W) => ({
1160
+ keyword: W.keyword,
1161
+ indexes: s.slice(W.startIndex, W.endIndex),
1151
1162
  color: D
1152
1163
  }));
1153
- for (const k of $) {
1154
- const B = k.indexes.reduce(
1155
- (Z, U) => (Z[U.spanIdx] = (Z[U.spanIdx] || []).concat([U]), Z),
1164
+ for (const W of q) {
1165
+ const U = W.indexes.reduce(
1166
+ (j, V) => (j[V.spanIdx] = (j[V.spanIdx] || []).concat([V]), j),
1156
1167
  {}
1157
1168
  );
1158
- for (const Z of Object.values(B))
1159
- if (Z.length !== 1 || Z[0].char.trim() !== "") {
1160
- const U = Z, ie = u[U[0].spanIdx], G = b(
1169
+ for (const j of Object.values(U))
1170
+ if (j.length !== 1 || j[0].char.trim() !== "") {
1171
+ const V = j, ee = u[V[0].spanIdx], G = b(
1161
1172
  g,
1162
- z,
1163
- ie,
1164
- U
1173
+ M,
1174
+ ee,
1175
+ V
1165
1176
  );
1166
1177
  if (G) {
1167
- const { left: K, top: Y } = G;
1168
- if (w.find((ee) => ee.left === K && ee.top === Y))
1178
+ const { left: Z, top: Y } = G;
1179
+ if (_.find((ae) => ae.left === Z && ae.top === Y))
1169
1180
  continue;
1170
- w.push({ ...G, highlightColor: k.color });
1181
+ _.push({ ...G, highlightColor: W.color });
1171
1182
  }
1172
1183
  }
1173
1184
  }
1174
- }), w.sort(Xo), w;
1185
+ }), _.sort(Xo), _;
1175
1186
  };
1176
- return A(() => {
1187
+ return z(() => {
1177
1188
  (async () => {
1178
1189
  if (!i || i.length === 0) {
1179
1190
  P([]);
@@ -1181,11 +1192,11 @@ const Hr = (t) => {
1181
1192
  }
1182
1193
  try {
1183
1194
  await v(t, i);
1184
- } catch (p) {
1185
- console.error(p);
1195
+ } catch (h) {
1196
+ console.error(h);
1186
1197
  }
1187
1198
  })();
1188
- }, [c, i, t, n, e]), /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((g, p) => /* @__PURE__ */ a(
1199
+ }, [c, i, t, n, e]), /* @__PURE__ */ a(he, { children: /* @__PURE__ */ a("div", { ref: l, "data-rp": `page-${t}-textHighlightLayer`, children: m.map((g, h) => /* @__PURE__ */ a(
1189
1200
  "div",
1190
1201
  {
1191
1202
  className: $r["rp-text-highlight"],
@@ -1197,16 +1208,16 @@ const Hr = (t) => {
1197
1208
  backgroundColor: g.highlightColor
1198
1209
  }
1199
1210
  },
1200
- p
1211
+ h
1201
1212
  )) }) });
1202
1213
  }, xt = et((t, e) => {
1203
- const { pageNumber: n, style: r, ...o } = t, { pages: i } = oe(), { pageRotate: c } = Je(), { textLayer: l } = uo(), { currentZoom: d } = wt(), { LoaderImageComponent: f } = _t(), m = W(i.get(n)), [P, h] = q(!1), T = W(null), [C, b] = q({
1214
+ const { pageNumber: n, style: r, ...o } = t, { pages: i } = oe(), { pageRotate: c } = Je(), { textLayer: l } = uo(), { currentZoom: d } = wt(), { LoaderImageComponent: f } = _t(), m = k(i.get(n)), [P, p] = $(!1), T = k(null), [C, b] = $({
1204
1215
  width: 0,
1205
1216
  height: 0
1206
1217
  });
1207
1218
  on(e, () => T.current);
1208
1219
  const v = F(() => m.current ? c[n] : 0, [n, c]);
1209
- A(() => {
1220
+ z(() => {
1210
1221
  if (i && (m.current = i.get(n), m.current)) {
1211
1222
  const u = m.current.page.getViewport({
1212
1223
  scale: d,
@@ -1225,10 +1236,10 @@ const Hr = (t) => {
1225
1236
  default:
1226
1237
  return "center";
1227
1238
  }
1228
- }, [v, C]), g = N(() => {
1229
- h(!0);
1230
- }, []), p = N(() => {
1231
- h(!1);
1239
+ }, [v, C]), g = O(() => {
1240
+ p(!0);
1241
+ }, []), h = O(() => {
1242
+ p(!1);
1232
1243
  }, []);
1233
1244
  return /* @__PURE__ */ a(
1234
1245
  "div",
@@ -1253,7 +1264,7 @@ const Hr = (t) => {
1253
1264
  },
1254
1265
  className: st["rp-page"],
1255
1266
  children: [
1256
- /* @__PURE__ */ a(Ar, { onLoading: g, onLoaded: p, pageNumber: n }),
1267
+ /* @__PURE__ */ a(Ar, { onLoading: g, onLoaded: h, pageNumber: n }),
1257
1268
  P && f && /* @__PURE__ */ a("div", { className: st["rp-loader-wrapper"], children: /* @__PURE__ */ a(f, {}) }),
1258
1269
  /* @__PURE__ */ a(Yo, { pageNumber: n }),
1259
1270
  l && /* @__PURE__ */ a(Fr, { pageNumber: n }),
@@ -1368,7 +1379,7 @@ var Zr = 150, Xr = function(e) {
1368
1379
  }, Be = null, je = null, Ke = null;
1369
1380
  process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet(), Ke = /* @__PURE__ */ new WeakSet());
1370
1381
  function Qr(t) {
1371
- var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, c = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, f = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, h = t.getRowStartIndexForOffset, T = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, b = t.shouldResetStyleCacheOnItemSizeChange, v = t.validateProps;
1382
+ var e, n = t.getColumnOffset, r = t.getColumnStartIndexForOffset, o = t.getColumnStopIndexForStartIndex, i = t.getColumnWidth, c = t.getEstimatedTotalHeight, l = t.getEstimatedTotalWidth, d = t.getOffsetForColumnAndAlignment, f = t.getOffsetForRowAndAlignment, m = t.getRowHeight, P = t.getRowOffset, p = t.getRowStartIndexForOffset, T = t.getRowStopIndexForStartIndex, C = t.initInstanceProps, b = t.shouldResetStyleCacheOnItemSizeChange, v = t.validateProps;
1372
1383
  return e = /* @__PURE__ */ function(y) {
1373
1384
  Gr(g, y);
1374
1385
  function g(u) {
@@ -1381,72 +1392,72 @@ function Qr(t) {
1381
1392
  scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
1382
1393
  scrollUpdateWasRequested: !1,
1383
1394
  verticalScrollDirection: "forward"
1384
- }, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ct(function(_, w, x, R, S, I, E, D) {
1395
+ }, s._callOnItemsRendered = void 0, s._callOnItemsRendered = ct(function(w, _, x, R, I, S, N, D) {
1385
1396
  return s.props.onItemsRendered({
1386
- overscanColumnStartIndex: _,
1387
- overscanColumnStopIndex: w,
1397
+ overscanColumnStartIndex: w,
1398
+ overscanColumnStopIndex: _,
1388
1399
  overscanRowStartIndex: x,
1389
1400
  overscanRowStopIndex: R,
1390
- visibleColumnStartIndex: S,
1391
- visibleColumnStopIndex: I,
1392
- visibleRowStartIndex: E,
1401
+ visibleColumnStartIndex: I,
1402
+ visibleColumnStopIndex: S,
1403
+ visibleRowStartIndex: N,
1393
1404
  visibleRowStopIndex: D
1394
1405
  });
1395
- }), s._callOnScroll = void 0, s._callOnScroll = ct(function(_, w, x, R, S) {
1406
+ }), s._callOnScroll = void 0, s._callOnScroll = ct(function(w, _, x, R, I) {
1396
1407
  return s.props.onScroll({
1397
1408
  horizontalScrollDirection: x,
1398
- scrollLeft: _,
1399
- scrollTop: w,
1409
+ scrollLeft: w,
1410
+ scrollTop: _,
1400
1411
  verticalScrollDirection: R,
1401
- scrollUpdateWasRequested: S
1412
+ scrollUpdateWasRequested: I
1402
1413
  });
1403
- }), s._getItemStyle = void 0, s._getItemStyle = function(_, w) {
1404
- var x = s.props, R = x.columnWidth, S = x.direction, I = x.rowHeight, E = s._getItemStyleCache(b && R, b && S, b && I), D = _ + ":" + w, z;
1405
- if (E.hasOwnProperty(D))
1406
- z = E[D];
1414
+ }), s._getItemStyle = void 0, s._getItemStyle = function(w, _) {
1415
+ var x = s.props, R = x.columnWidth, I = x.direction, S = x.rowHeight, N = s._getItemStyleCache(b && R, b && I, b && S), D = w + ":" + _, M;
1416
+ if (N.hasOwnProperty(D))
1417
+ M = N[D];
1407
1418
  else {
1408
- var L = n(s.props, w, s._instanceProps), O = S === "rtl";
1409
- E[D] = z = {
1419
+ var A = n(s.props, _, s._instanceProps), L = I === "rtl";
1420
+ N[D] = M = {
1410
1421
  position: "absolute",
1411
- left: O ? void 0 : L,
1412
- right: O ? L : void 0,
1413
- top: P(s.props, _, s._instanceProps),
1414
- height: m(s.props, _, s._instanceProps),
1415
- width: i(s.props, w, s._instanceProps)
1422
+ left: L ? void 0 : A,
1423
+ right: L ? A : void 0,
1424
+ top: P(s.props, w, s._instanceProps),
1425
+ height: m(s.props, w, s._instanceProps),
1426
+ width: i(s.props, _, s._instanceProps)
1416
1427
  };
1417
1428
  }
1418
- return z;
1419
- }, s._getItemStyleCache = void 0, s._getItemStyleCache = ct(function(_, w, x) {
1429
+ return M;
1430
+ }, s._getItemStyleCache = void 0, s._getItemStyleCache = ct(function(w, _, x) {
1420
1431
  return {};
1421
- }), s._onScroll = function(_) {
1422
- var w = _.currentTarget, x = w.clientHeight, R = w.clientWidth, S = w.scrollLeft, I = w.scrollTop, E = w.scrollHeight, D = w.scrollWidth;
1423
- s.setState(function(z) {
1424
- if (z.scrollLeft === S && z.scrollTop === I)
1432
+ }), s._onScroll = function(w) {
1433
+ var _ = w.currentTarget, x = _.clientHeight, R = _.clientWidth, I = _.scrollLeft, S = _.scrollTop, N = _.scrollHeight, D = _.scrollWidth;
1434
+ s.setState(function(M) {
1435
+ if (M.scrollLeft === I && M.scrollTop === S)
1425
1436
  return null;
1426
- var L = s.props.direction, O = S;
1427
- if (L === "rtl")
1437
+ var A = s.props.direction, L = I;
1438
+ if (A === "rtl")
1428
1439
  switch (Vt()) {
1429
1440
  case "negative":
1430
- O = -S;
1441
+ L = -I;
1431
1442
  break;
1432
1443
  case "positive-descending":
1433
- O = D - R - S;
1444
+ L = D - R - I;
1434
1445
  break;
1435
1446
  }
1436
- O = Math.max(0, Math.min(O, D - R));
1437
- var M = Math.max(0, Math.min(I, E - x));
1447
+ L = Math.max(0, Math.min(L, D - R));
1448
+ var E = Math.max(0, Math.min(S, N - x));
1438
1449
  return {
1439
1450
  isScrolling: !0,
1440
- horizontalScrollDirection: z.scrollLeft < S ? "forward" : "backward",
1441
- scrollLeft: O,
1442
- scrollTop: M,
1443
- verticalScrollDirection: z.scrollTop < I ? "forward" : "backward",
1451
+ horizontalScrollDirection: M.scrollLeft < I ? "forward" : "backward",
1452
+ scrollLeft: L,
1453
+ scrollTop: E,
1454
+ verticalScrollDirection: M.scrollTop < S ? "forward" : "backward",
1444
1455
  scrollUpdateWasRequested: !1
1445
1456
  };
1446
1457
  }, s._resetIsScrollingDebounced);
1447
- }, s._outerRefSetter = function(_) {
1448
- var w = s.props.outerRef;
1449
- s._outerRef = _, typeof w == "function" ? w(_) : w != null && typeof w == "object" && w.hasOwnProperty("current") && (w.current = _);
1458
+ }, s._outerRefSetter = function(w) {
1459
+ var _ = s.props.outerRef;
1460
+ s._outerRef = w, typeof _ == "function" ? _(w) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = w);
1450
1461
  }, s._resetIsScrollingDebounced = function() {
1451
1462
  s._resetIsScrollingTimeoutId !== null && Ut(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = jr(s._resetIsScrolling, Zr);
1452
1463
  }, s._resetIsScrolling = function() {
@@ -1457,122 +1468,122 @@ function Qr(t) {
1457
1468
  });
1458
1469
  }, s;
1459
1470
  }
1460
- g.getDerivedStateFromProps = function(s, _) {
1461
- return Yr(s, _), v(s), null;
1471
+ g.getDerivedStateFromProps = function(s, w) {
1472
+ return Yr(s, w), v(s), null;
1462
1473
  };
1463
- var p = g.prototype;
1464
- return p.scrollTo = function(s) {
1465
- var _ = s.scrollLeft, w = s.scrollTop;
1466
- _ !== void 0 && (_ = Math.max(0, _)), w !== void 0 && (w = Math.max(0, w)), this.setState(function(x) {
1467
- return _ === void 0 && (_ = x.scrollLeft), w === void 0 && (w = x.scrollTop), x.scrollLeft === _ && x.scrollTop === w ? null : {
1468
- horizontalScrollDirection: x.scrollLeft < _ ? "forward" : "backward",
1469
- scrollLeft: _,
1470
- scrollTop: w,
1474
+ var h = g.prototype;
1475
+ return h.scrollTo = function(s) {
1476
+ var w = s.scrollLeft, _ = s.scrollTop;
1477
+ w !== void 0 && (w = Math.max(0, w)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(x) {
1478
+ return w === void 0 && (w = x.scrollLeft), _ === void 0 && (_ = x.scrollTop), x.scrollLeft === w && x.scrollTop === _ ? null : {
1479
+ horizontalScrollDirection: x.scrollLeft < w ? "forward" : "backward",
1480
+ scrollLeft: w,
1481
+ scrollTop: _,
1471
1482
  scrollUpdateWasRequested: !0,
1472
- verticalScrollDirection: x.scrollTop < w ? "forward" : "backward"
1483
+ verticalScrollDirection: x.scrollTop < _ ? "forward" : "backward"
1473
1484
  };
1474
1485
  }, this._resetIsScrollingDebounced);
1475
- }, p.scrollToItem = function(s) {
1476
- var _ = s.align, w = _ === void 0 ? "auto" : _, x = s.columnIndex, R = s.rowIndex, S = this.props, I = S.columnCount, E = S.height, D = S.rowCount, z = S.width, L = this.state, O = L.scrollLeft, M = L.scrollTop, $ = Kr();
1477
- x !== void 0 && (x = Math.max(0, Math.min(x, I - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, D - 1)));
1478
- var k = c(this.props, this._instanceProps), B = l(this.props, this._instanceProps), Z = B > z ? $ : 0, U = k > E ? $ : 0;
1486
+ }, h.scrollToItem = function(s) {
1487
+ var w = s.align, _ = w === void 0 ? "auto" : w, x = s.columnIndex, R = s.rowIndex, I = this.props, S = I.columnCount, N = I.height, D = I.rowCount, M = I.width, A = this.state, L = A.scrollLeft, E = A.scrollTop, q = Kr();
1488
+ x !== void 0 && (x = Math.max(0, Math.min(x, S - 1))), R !== void 0 && (R = Math.max(0, Math.min(R, D - 1)));
1489
+ var W = c(this.props, this._instanceProps), U = l(this.props, this._instanceProps), j = U > M ? q : 0, V = W > N ? q : 0;
1479
1490
  this.scrollTo({
1480
- scrollLeft: x !== void 0 ? d(this.props, x, w, O, this._instanceProps, U) : O,
1481
- scrollTop: R !== void 0 ? f(this.props, R, w, M, this._instanceProps, Z) : M
1491
+ scrollLeft: x !== void 0 ? d(this.props, x, _, L, this._instanceProps, V) : L,
1492
+ scrollTop: R !== void 0 ? f(this.props, R, _, E, this._instanceProps, j) : E
1482
1493
  });
1483
- }, p.componentDidMount = function() {
1484
- var s = this.props, _ = s.initialScrollLeft, w = s.initialScrollTop;
1494
+ }, h.componentDidMount = function() {
1495
+ var s = this.props, w = s.initialScrollLeft, _ = s.initialScrollTop;
1485
1496
  if (this._outerRef != null) {
1486
1497
  var x = this._outerRef;
1487
- typeof _ == "number" && (x.scrollLeft = _), typeof w == "number" && (x.scrollTop = w);
1498
+ typeof w == "number" && (x.scrollLeft = w), typeof _ == "number" && (x.scrollTop = _);
1488
1499
  }
1489
1500
  this._callPropsCallbacks();
1490
- }, p.componentDidUpdate = function() {
1491
- var s = this.props.direction, _ = this.state, w = _.scrollLeft, x = _.scrollTop, R = _.scrollUpdateWasRequested;
1501
+ }, h.componentDidUpdate = function() {
1502
+ var s = this.props.direction, w = this.state, _ = w.scrollLeft, x = w.scrollTop, R = w.scrollUpdateWasRequested;
1492
1503
  if (R && this._outerRef != null) {
1493
- var S = this._outerRef;
1504
+ var I = this._outerRef;
1494
1505
  if (s === "rtl")
1495
1506
  switch (Vt()) {
1496
1507
  case "negative":
1497
- S.scrollLeft = -w;
1508
+ I.scrollLeft = -_;
1498
1509
  break;
1499
1510
  case "positive-ascending":
1500
- S.scrollLeft = w;
1511
+ I.scrollLeft = _;
1501
1512
  break;
1502
1513
  default:
1503
- var I = S.clientWidth, E = S.scrollWidth;
1504
- S.scrollLeft = E - I - w;
1514
+ var S = I.clientWidth, N = I.scrollWidth;
1515
+ I.scrollLeft = N - S - _;
1505
1516
  break;
1506
1517
  }
1507
1518
  else
1508
- S.scrollLeft = Math.max(0, w);
1509
- S.scrollTop = Math.max(0, x);
1519
+ I.scrollLeft = Math.max(0, _);
1520
+ I.scrollTop = Math.max(0, x);
1510
1521
  }
1511
1522
  this._callPropsCallbacks();
1512
- }, p.componentWillUnmount = function() {
1523
+ }, h.componentWillUnmount = function() {
1513
1524
  this._resetIsScrollingTimeoutId !== null && Ut(this._resetIsScrollingTimeoutId);
1514
- }, p.render = function() {
1515
- var s = this.props, _ = s.children, w = s.className, x = s.columnCount, R = s.direction, S = s.height, I = s.innerRef, E = s.innerElementType, D = s.innerTagName, z = s.itemData, L = s.itemKey, O = L === void 0 ? Xr : L, M = s.outerElementType, $ = s.outerTagName, k = s.rowCount, B = s.style, Z = s.useIsScrolling, U = s.width, ie = this.state.isScrolling, G = this._getHorizontalRangeToRender(), K = G[0], Y = G[1], J = this._getVerticalRangeToRender(), ee = J[0], re = J[1], ve = [];
1516
- if (x > 0 && k)
1517
- for (var de = ee; de <= re; de++)
1518
- for (var Pe = K; Pe <= Y; Pe++)
1519
- ve.push(Ve(_, {
1520
- columnIndex: Pe,
1521
- data: z,
1522
- isScrolling: Z ? ie : void 0,
1523
- key: O({
1524
- columnIndex: Pe,
1525
- data: z,
1526
- rowIndex: de
1525
+ }, h.render = function() {
1526
+ var s = this.props, w = s.children, _ = s.className, x = s.columnCount, R = s.direction, I = s.height, S = s.innerRef, N = s.innerElementType, D = s.innerTagName, M = s.itemData, A = s.itemKey, L = A === void 0 ? Xr : A, E = s.outerElementType, q = s.outerTagName, W = s.rowCount, U = s.style, j = s.useIsScrolling, V = s.width, ee = this.state.isScrolling, G = this._getHorizontalRangeToRender(), Z = G[0], Y = G[1], re = this._getVerticalRangeToRender(), ae = re[0], J = re[1], ue = [];
1527
+ if (x > 0 && W)
1528
+ for (var ie = ae; ie <= J; ie++)
1529
+ for (var me = Z; me <= Y; me++)
1530
+ ue.push(Ve(w, {
1531
+ columnIndex: me,
1532
+ data: M,
1533
+ isScrolling: j ? ee : void 0,
1534
+ key: L({
1535
+ columnIndex: me,
1536
+ data: M,
1537
+ rowIndex: ie
1527
1538
  }),
1528
- rowIndex: de,
1529
- style: this._getItemStyle(de, Pe)
1539
+ rowIndex: ie,
1540
+ style: this._getItemStyle(ie, me)
1530
1541
  }));
1531
1542
  var Fe = c(this.props, this._instanceProps), nt = l(this.props, this._instanceProps);
1532
- return Ve(M || $ || "div", {
1533
- className: w,
1543
+ return Ve(E || q || "div", {
1544
+ className: _,
1534
1545
  onScroll: this._onScroll,
1535
1546
  ref: this._outerRefSetter,
1536
1547
  style: ft({
1537
1548
  position: "relative",
1538
- height: S,
1539
- width: U,
1549
+ height: I,
1550
+ width: V,
1540
1551
  overflow: "auto",
1541
1552
  WebkitOverflowScrolling: "touch",
1542
1553
  willChange: "transform",
1543
1554
  direction: R
1544
- }, B)
1545
- }, Ve(E || D || "div", {
1546
- children: ve,
1547
- ref: I,
1555
+ }, U)
1556
+ }, Ve(N || D || "div", {
1557
+ children: ue,
1558
+ ref: S,
1548
1559
  style: {
1549
1560
  height: Fe,
1550
- pointerEvents: ie ? "none" : void 0,
1561
+ pointerEvents: ee ? "none" : void 0,
1551
1562
  width: nt
1552
1563
  }
1553
1564
  }));
1554
- }, p._callPropsCallbacks = function() {
1555
- var s = this.props, _ = s.columnCount, w = s.onItemsRendered, x = s.onScroll, R = s.rowCount;
1556
- if (typeof w == "function" && _ > 0 && R > 0) {
1557
- var S = this._getHorizontalRangeToRender(), I = S[0], E = S[1], D = S[2], z = S[3], L = this._getVerticalRangeToRender(), O = L[0], M = L[1], $ = L[2], k = L[3];
1558
- this._callOnItemsRendered(I, E, O, M, D, z, $, k);
1565
+ }, h._callPropsCallbacks = function() {
1566
+ var s = this.props, w = s.columnCount, _ = s.onItemsRendered, x = s.onScroll, R = s.rowCount;
1567
+ if (typeof _ == "function" && w > 0 && R > 0) {
1568
+ var I = this._getHorizontalRangeToRender(), S = I[0], N = I[1], D = I[2], M = I[3], A = this._getVerticalRangeToRender(), L = A[0], E = A[1], q = A[2], W = A[3];
1569
+ this._callOnItemsRendered(S, N, L, E, D, M, q, W);
1559
1570
  }
1560
1571
  if (typeof x == "function") {
1561
- var B = this.state, Z = B.horizontalScrollDirection, U = B.scrollLeft, ie = B.scrollTop, G = B.scrollUpdateWasRequested, K = B.verticalScrollDirection;
1562
- this._callOnScroll(U, ie, Z, K, G);
1572
+ var U = this.state, j = U.horizontalScrollDirection, V = U.scrollLeft, ee = U.scrollTop, G = U.scrollUpdateWasRequested, Z = U.verticalScrollDirection;
1573
+ this._callOnScroll(V, ee, j, Z, G);
1563
1574
  }
1564
- }, p._getHorizontalRangeToRender = function() {
1565
- var s = this.props, _ = s.columnCount, w = s.overscanColumnCount, x = s.overscanColumnsCount, R = s.overscanCount, S = s.rowCount, I = this.state, E = I.horizontalScrollDirection, D = I.isScrolling, z = I.scrollLeft, L = w || x || R || 1;
1566
- if (_ === 0 || S === 0)
1575
+ }, h._getHorizontalRangeToRender = function() {
1576
+ var s = this.props, w = s.columnCount, _ = s.overscanColumnCount, x = s.overscanColumnsCount, R = s.overscanCount, I = s.rowCount, S = this.state, N = S.horizontalScrollDirection, D = S.isScrolling, M = S.scrollLeft, A = _ || x || R || 1;
1577
+ if (w === 0 || I === 0)
1567
1578
  return [0, 0, 0, 0];
1568
- var O = r(this.props, z, this._instanceProps), M = o(this.props, O, z, this._instanceProps), $ = !D || E === "backward" ? Math.max(1, L) : 1, k = !D || E === "forward" ? Math.max(1, L) : 1;
1569
- return [Math.max(0, O - $), Math.max(0, Math.min(_ - 1, M + k)), O, M];
1570
- }, p._getVerticalRangeToRender = function() {
1571
- var s = this.props, _ = s.columnCount, w = s.overscanCount, x = s.overscanRowCount, R = s.overscanRowsCount, S = s.rowCount, I = this.state, E = I.isScrolling, D = I.verticalScrollDirection, z = I.scrollTop, L = x || R || w || 1;
1572
- if (_ === 0 || S === 0)
1579
+ var L = r(this.props, M, this._instanceProps), E = o(this.props, L, M, this._instanceProps), q = !D || N === "backward" ? Math.max(1, A) : 1, W = !D || N === "forward" ? Math.max(1, A) : 1;
1580
+ return [Math.max(0, L - q), Math.max(0, Math.min(w - 1, E + W)), L, E];
1581
+ }, h._getVerticalRangeToRender = function() {
1582
+ var s = this.props, w = s.columnCount, _ = s.overscanCount, x = s.overscanRowCount, R = s.overscanRowsCount, I = s.rowCount, S = this.state, N = S.isScrolling, D = S.verticalScrollDirection, M = S.scrollTop, A = x || R || _ || 1;
1583
+ if (w === 0 || I === 0)
1573
1584
  return [0, 0, 0, 0];
1574
- var O = h(this.props, z, this._instanceProps), M = T(this.props, O, z, this._instanceProps), $ = !E || D === "backward" ? Math.max(1, L) : 1, k = !E || D === "forward" ? Math.max(1, L) : 1;
1575
- return [Math.max(0, O - $), Math.max(0, Math.min(S - 1, M + k)), O, M];
1585
+ var L = p(this.props, M, this._instanceProps), E = T(this.props, L, M, this._instanceProps), q = !N || D === "backward" ? Math.max(1, A) : 1, W = !N || D === "forward" ? Math.max(1, A) : 1;
1586
+ return [Math.max(0, L - q), Math.max(0, Math.min(I - 1, E + W)), L, E];
1576
1587
  }, g;
1577
1588
  }(oo), e.defaultProps = {
1578
1589
  direction: "ltr",
@@ -1581,9 +1592,9 @@ function Qr(t) {
1581
1592
  }, e;
1582
1593
  }
1583
1594
  var Yr = function(e, n) {
1584
- var r = e.children, o = e.direction, i = e.height, c = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, f = e.overscanCount, m = e.overscanRowsCount, P = e.width, h = n.instance;
1595
+ var r = e.children, o = e.direction, i = e.height, c = e.innerTagName, l = e.outerTagName, d = e.overscanColumnsCount, f = e.overscanCount, m = e.overscanRowsCount, P = e.width, p = n.instance;
1585
1596
  if (process.env.NODE_ENV !== "production") {
1586
- if (typeof f == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && je && !je.has(h) && (je.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || l != null) && Ke && !Ke.has(h) && (Ke.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
1597
+ if (typeof f == "number" && Be && !Be.has(p) && (Be.add(p), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof d == "number" || typeof m == "number") && je && !je.has(p) && (je.add(p), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || l != null) && Ke && !Ke.has(p) && (Ke.add(p), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
1587
1598
  throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
1588
1599
  switch (o) {
1589
1600
  case "ltr":
@@ -1613,7 +1624,7 @@ var Yr = function(e, n) {
1613
1624
  }
1614
1625
  var f = r - c - 1, m = f * i;
1615
1626
  return l + m;
1616
- }, me = function(e, n, r, o) {
1627
+ }, ve = function(e, n, r, o) {
1617
1628
  var i, c, l;
1618
1629
  if (e === "column" ? (i = o.columnMetadataMap, c = n.columnWidth, l = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, c = n.rowHeight, l = o.lastMeasuredRowIndex), r > l) {
1619
1630
  var d = 0;
@@ -1638,39 +1649,39 @@ var Yr = function(e, n) {
1638
1649
  return l >= o ? In(e, n, r, c, 0, o) : Jr(e, n, r, Math.max(0, c), o);
1639
1650
  }, In = function(e, n, r, o, i, c) {
1640
1651
  for (; i <= o; ) {
1641
- var l = i + Math.floor((o - i) / 2), d = me(e, n, l, r).offset;
1652
+ var l = i + Math.floor((o - i) / 2), d = ve(e, n, l, r).offset;
1642
1653
  if (d === c)
1643
1654
  return l;
1644
1655
  d < c ? i = l + 1 : d > c && (o = l - 1);
1645
1656
  }
1646
1657
  return i > 0 ? i - 1 : 0;
1647
1658
  }, Jr = function(e, n, r, o, i) {
1648
- for (var c = e === "column" ? n.columnCount : n.rowCount, l = 1; o < c && me(e, n, o, r).offset < i; )
1659
+ for (var c = e === "column" ? n.columnCount : n.rowCount, l = 1; o < c && ve(e, n, o, r).offset < i; )
1649
1660
  o += l, l *= 2;
1650
1661
  return In(e, n, r, Math.min(o, c - 1), Math.floor(o / 2), i);
1651
1662
  }, Kt = function(e, n, r, o, i, c, l) {
1652
- var d = e === "column" ? n.width : n.height, f = me(e, n, r, c), m = e === "column" ? Sn(n, c) : xn(n, c), P = Math.max(0, Math.min(m - d, f.offset)), h = Math.max(0, f.offset - d + l + f.size);
1653
- switch (o === "smart" && (i >= h - d && i <= P + d ? o = "auto" : o = "center"), o) {
1663
+ var d = e === "column" ? n.width : n.height, f = ve(e, n, r, c), m = e === "column" ? Sn(n, c) : xn(n, c), P = Math.max(0, Math.min(m - d, f.offset)), p = Math.max(0, f.offset - d + l + f.size);
1664
+ switch (o === "smart" && (i >= p - d && i <= P + d ? o = "auto" : o = "center"), o) {
1654
1665
  case "start":
1655
1666
  return P;
1656
1667
  case "end":
1657
- return h;
1668
+ return p;
1658
1669
  case "center":
1659
- return Math.round(h + (P - h) / 2);
1670
+ return Math.round(p + (P - p) / 2);
1660
1671
  case "auto":
1661
1672
  default:
1662
- return i >= h && i <= P ? i : h > P || i < h ? h : P;
1673
+ return i >= p && i <= P ? i : p > P || i < p ? p : P;
1663
1674
  }
1664
1675
  }, ei = /* @__PURE__ */ Qr({
1665
1676
  getColumnOffset: function(e, n, r) {
1666
- return me("column", e, n, r).offset;
1677
+ return ve("column", e, n, r).offset;
1667
1678
  },
1668
1679
  getColumnStartIndexForOffset: function(e, n, r) {
1669
1680
  return jt("column", e, r, n);
1670
1681
  },
1671
1682
  getColumnStopIndexForStartIndex: function(e, n, r, o) {
1672
- for (var i = e.columnCount, c = e.width, l = me("column", e, n, o), d = r + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
1673
- m++, f += me("column", e, m, o).size;
1683
+ for (var i = e.columnCount, c = e.width, l = ve("column", e, n, o), d = r + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
1684
+ m++, f += ve("column", e, m, o).size;
1674
1685
  return m;
1675
1686
  },
1676
1687
  getColumnWidth: function(e, n, r) {
@@ -1685,7 +1696,7 @@ var Yr = function(e, n) {
1685
1696
  return Kt("row", e, n, r, o, i, c);
1686
1697
  },
1687
1698
  getRowOffset: function(e, n, r) {
1688
- return me("row", e, n, r).offset;
1699
+ return ve("row", e, n, r).offset;
1689
1700
  },
1690
1701
  getRowHeight: function(e, n, r) {
1691
1702
  return r.rowMetadataMap[n].size;
@@ -1694,8 +1705,8 @@ var Yr = function(e, n) {
1694
1705
  return jt("row", e, r, n);
1695
1706
  },
1696
1707
  getRowStopIndexForStartIndex: function(e, n, r, o) {
1697
- for (var i = e.rowCount, c = e.height, l = me("row", e, n, o), d = r + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
1698
- m++, f += me("row", e, m, o).size;
1708
+ for (var i = e.rowCount, c = e.height, l = ve("row", e, n, o), d = r + c, f = l.offset + l.size, m = n; m < i - 1 && f < d; )
1709
+ m++, f += ve("row", e, m, o).size;
1699
1710
  return m;
1700
1711
  },
1701
1712
  initInstanceProps: function(e, n) {
@@ -1750,28 +1761,28 @@ function oi(t, e) {
1750
1761
  }
1751
1762
  const ri = () => {
1752
1763
  const { viewMode: t } = Me(), { scrollMode: e } = Ee(), { setColumnCount: n } = sn(), { virtualScrollableElementRef: r } = Ye(), o = Ge(), i = F(() => o.heights.length, [o.heights]), c = F(() => e === ne.HORIZONTAL_SCROLLING ? i : t === Re.DUAL_PAGE ? 2 : 1, [t, e, e, i, r]), l = F(() => o.widths.reduce((v, y, g) => {
1753
- const p = g % c;
1754
- return (!v[p] || y > v[p]) && (v[p] = y), v;
1755
- }, []), [o.widths, c]), d = N(
1764
+ const h = g % c;
1765
+ return (!v[h] || y > v[h]) && (v[h] = y), v;
1766
+ }, []), [o.widths, c]), d = O(
1756
1767
  (b) => {
1757
1768
  const v = b % l.length;
1758
1769
  return l[v] || 0;
1759
1770
  },
1760
1771
  [l]
1761
- ), f = N(
1772
+ ), f = O(
1762
1773
  (b) => {
1763
1774
  const v = Array.from({ length: c }, (y, g) => {
1764
- const p = b * c + g;
1765
- return o.heights[p] || 0;
1775
+ const h = b * c + g;
1776
+ return o.heights[h] || 0;
1766
1777
  });
1767
1778
  return Math.max(...v);
1768
1779
  },
1769
1780
  [o.heights, c]
1770
1781
  );
1771
- A(() => {
1782
+ z(() => {
1772
1783
  n(c);
1773
1784
  }, [c, n]);
1774
- const m = F(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), P = F(() => o.heights.reduce((b, v) => b + v, 0) / o.heights.length || 0, [o]), h = F(() => o.widths.reduce((b, v) => b + v, 0) / o.widths.length || 0, [o]), T = F(() => {
1785
+ const m = F(() => e === ne.HORIZONTAL_SCROLLING || e === ne.PAGE_SCROLLING ? 1 : Math.round(i / c), [c, i, e]), P = F(() => o.heights.reduce((b, v) => b + v, 0) / o.heights.length || 0, [o]), p = F(() => o.widths.reduce((b, v) => b + v, 0) / o.widths.length || 0, [o]), T = F(() => {
1775
1786
  const { rowsHeight: b, columnsWidth: v } = bt(o, c);
1776
1787
  return {
1777
1788
  rowsHeight: b,
@@ -1788,15 +1799,15 @@ const ri = () => {
1788
1799
  columnWidth: d,
1789
1800
  pageDimension: o,
1790
1801
  estimatedRowHeight: P,
1791
- estimatedColumnWidth: h,
1802
+ estimatedColumnWidth: p,
1792
1803
  gridDimension: T,
1793
1804
  totalDimension: C
1794
1805
  };
1795
1806
  };
1796
- let ce;
1797
- typeof window < "u" ? ce = window : typeof self < "u" ? ce = self : ce = global;
1807
+ let le;
1808
+ typeof window < "u" ? le = window : typeof self < "u" ? le = self : le = global;
1798
1809
  let gt = null, vt = null;
1799
- const Xt = 20, dt = ce.clearTimeout, Qt = ce.setTimeout, ut = ce.cancelAnimationFrame || ce.mozCancelAnimationFrame || ce.webkitCancelAnimationFrame, Yt = ce.requestAnimationFrame || ce.mozRequestAnimationFrame || ce.webkitRequestAnimationFrame;
1810
+ const Xt = 20, dt = le.clearTimeout, Qt = le.setTimeout, ut = le.cancelAnimationFrame || le.mozCancelAnimationFrame || le.webkitCancelAnimationFrame, Yt = le.requestAnimationFrame || le.mozRequestAnimationFrame || le.webkitRequestAnimationFrame;
1800
1811
  ut == null || Yt == null ? (gt = dt, vt = function(e) {
1801
1812
  return Qt(e, Xt);
1802
1813
  }) : (gt = function([e, n]) {
@@ -1814,8 +1825,8 @@ function ii(t) {
1814
1825
  const d = typeof document < "u" && document.attachEvent;
1815
1826
  if (!d) {
1816
1827
  c = function(y) {
1817
- const g = y.__resizeTriggers__, p = g.firstElementChild, u = g.lastElementChild, s = p.firstElementChild;
1818
- u.scrollLeft = u.scrollWidth, u.scrollTop = u.scrollHeight, s.style.width = p.offsetWidth + 1 + "px", s.style.height = p.offsetHeight + 1 + "px", p.scrollLeft = p.scrollWidth, p.scrollTop = p.scrollHeight;
1828
+ const g = y.__resizeTriggers__, h = g.firstElementChild, u = g.lastElementChild, s = h.firstElementChild;
1829
+ u.scrollLeft = u.scrollWidth, u.scrollTop = u.scrollHeight, s.style.width = h.offsetWidth + 1 + "px", s.style.height = h.offsetHeight + 1 + "px", h.scrollLeft = h.scrollWidth, h.scrollTop = h.scrollHeight;
1819
1830
  }, i = function(y) {
1820
1831
  return y.offsetWidth !== y.__resizeLast__.width || y.offsetHeight !== y.__resizeLast__.height;
1821
1832
  }, l = function(y) {
@@ -1828,53 +1839,53 @@ function ii(t) {
1828
1839
  }));
1829
1840
  });
1830
1841
  };
1831
- let h = !1, T = "";
1842
+ let p = !1, T = "";
1832
1843
  r = "animationstart";
1833
1844
  const C = "Webkit Moz O ms".split(" ");
1834
1845
  let b = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
1835
1846
  {
1836
1847
  const y = document.createElement("fakeelement");
1837
- if (y.style.animationName !== void 0 && (h = !0), h === !1) {
1848
+ if (y.style.animationName !== void 0 && (p = !0), p === !1) {
1838
1849
  for (let g = 0; g < C.length; g++)
1839
1850
  if (y.style[C[g] + "AnimationName"] !== void 0) {
1840
- v = C[g], T = "-" + v.toLowerCase() + "-", r = b[g], h = !0;
1851
+ v = C[g], T = "-" + v.toLowerCase() + "-", r = b[g], p = !0;
1841
1852
  break;
1842
1853
  }
1843
1854
  }
1844
1855
  }
1845
1856
  n = "resizeanim", e = "@" + T + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", o = T + "animation: 1ms " + n + "; ";
1846
1857
  }
1847
- const f = function(h) {
1848
- if (!h.getElementById("detectElementResize")) {
1849
- const T = (e || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = h.head || h.getElementsByTagName("head")[0], b = h.createElement("style");
1850
- b.id = "detectElementResize", b.type = "text/css", t != null && b.setAttribute("nonce", t), b.styleSheet ? b.styleSheet.cssText = T : b.appendChild(h.createTextNode(T)), C.appendChild(b);
1858
+ const f = function(p) {
1859
+ if (!p.getElementById("detectElementResize")) {
1860
+ const T = (e || "") + ".resize-triggers { " + (o || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', C = p.head || p.getElementsByTagName("head")[0], b = p.createElement("style");
1861
+ b.id = "detectElementResize", b.type = "text/css", t != null && b.setAttribute("nonce", t), b.styleSheet ? b.styleSheet.cssText = T : b.appendChild(p.createTextNode(T)), C.appendChild(b);
1851
1862
  }
1852
1863
  };
1853
1864
  return {
1854
- addResizeListener: function(h, T) {
1865
+ addResizeListener: function(p, T) {
1855
1866
  if (d)
1856
- h.attachEvent("onresize", T);
1867
+ p.attachEvent("onresize", T);
1857
1868
  else {
1858
- if (!h.__resizeTriggers__) {
1859
- const C = h.ownerDocument, b = ce.getComputedStyle(h);
1860
- b && b.position === "static" && (h.style.position = "relative"), f(C), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
1869
+ if (!p.__resizeTriggers__) {
1870
+ const C = p.ownerDocument, b = le.getComputedStyle(p);
1871
+ b && b.position === "static" && (p.style.position = "relative"), f(C), p.__resizeLast__ = {}, p.__resizeListeners__ = [], (p.__resizeTriggers__ = C.createElement("div")).className = "resize-triggers";
1861
1872
  const v = C.createElement("div");
1862
1873
  v.className = "expand-trigger", v.appendChild(C.createElement("div"));
1863
1874
  const y = C.createElement("div");
1864
- y.className = "contract-trigger", h.__resizeTriggers__.appendChild(v), h.__resizeTriggers__.appendChild(y), h.appendChild(h.__resizeTriggers__), c(h), h.addEventListener("scroll", l, !0), r && (h.__resizeTriggers__.__animationListener__ = function(p) {
1865
- p.animationName === n && c(h);
1866
- }, h.__resizeTriggers__.addEventListener(r, h.__resizeTriggers__.__animationListener__));
1875
+ y.className = "contract-trigger", p.__resizeTriggers__.appendChild(v), p.__resizeTriggers__.appendChild(y), p.appendChild(p.__resizeTriggers__), c(p), p.addEventListener("scroll", l, !0), r && (p.__resizeTriggers__.__animationListener__ = function(h) {
1876
+ h.animationName === n && c(p);
1877
+ }, p.__resizeTriggers__.addEventListener(r, p.__resizeTriggers__.__animationListener__));
1867
1878
  }
1868
- h.__resizeListeners__.push(T);
1879
+ p.__resizeListeners__.push(T);
1869
1880
  }
1870
1881
  },
1871
- removeResizeListener: function(h, T) {
1882
+ removeResizeListener: function(p, T) {
1872
1883
  if (d)
1873
- h.detachEvent("onresize", T);
1874
- else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(T), 1), !h.__resizeListeners__.length) {
1875
- h.removeEventListener("scroll", l, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(r, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
1884
+ p.detachEvent("onresize", T);
1885
+ else if (p.__resizeListeners__.splice(p.__resizeListeners__.indexOf(T), 1), !p.__resizeListeners__.length) {
1886
+ p.removeEventListener("scroll", l, !0), p.__resizeTriggers__.__animationListener__ && (p.__resizeTriggers__.removeEventListener(r, p.__resizeTriggers__.__animationListener__), p.__resizeTriggers__.__animationListener__ = null);
1876
1887
  try {
1877
- h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
1888
+ p.__resizeTriggers__ = !p.removeChild(p.__resizeTriggers__);
1878
1889
  } catch {
1879
1890
  }
1880
1891
  }
@@ -1896,16 +1907,16 @@ class ai extends ro {
1896
1907
  onResize: o
1897
1908
  } = this.props;
1898
1909
  if (this._parentNode) {
1899
- const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), f = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - f, h = m.width - c - l, T = this._parentNode.offsetHeight - d - f, C = this._parentNode.offsetWidth - c - l;
1900
- (!n && (this.state.height !== T || this.state.scaledHeight !== P) || !r && (this.state.width !== C || this.state.scaledWidth !== h)) && (this.setState({
1910
+ const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), l = parseFloat(i.paddingRight || "0"), d = parseFloat(i.paddingTop || "0"), f = parseFloat(i.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), P = m.height - d - f, p = m.width - c - l, T = this._parentNode.offsetHeight - d - f, C = this._parentNode.offsetWidth - c - l;
1911
+ (!n && (this.state.height !== T || this.state.scaledHeight !== P) || !r && (this.state.width !== C || this.state.scaledWidth !== p)) && (this.setState({
1901
1912
  height: T,
1902
1913
  width: C,
1903
1914
  scaledHeight: P,
1904
- scaledWidth: h
1915
+ scaledWidth: p
1905
1916
  }), typeof o == "function" && o({
1906
1917
  height: T,
1907
1918
  scaledHeight: P,
1908
- scaledWidth: h,
1919
+ scaledWidth: p,
1909
1920
  width: C
1910
1921
  }));
1911
1922
  }
@@ -1942,7 +1953,7 @@ class ai extends ro {
1942
1953
  tagName: m = "div",
1943
1954
  ...P
1944
1955
  } = this.props, {
1945
- height: h,
1956
+ height: p,
1946
1957
  scaledHeight: T,
1947
1958
  scaledWidth: C,
1948
1959
  width: b
@@ -1950,7 +1961,7 @@ class ai extends ro {
1950
1961
  overflow: "visible"
1951
1962
  }, y = {};
1952
1963
  let g = !1;
1953
- return o || (h === 0 && (g = !0), v.height = 0, y.height = h, y.scaledHeight = T), i || (b === 0 && (g = !0), v.width = 0, y.width = b, y.scaledWidth = C), c && (g = !1), Ve(m, {
1964
+ return o || (p === 0 && (g = !0), v.height = 0, y.height = p, y.scaledHeight = T), i || (b === 0 && (g = !0), v.width = 0, y.width = b, y.scaledWidth = C), c && (g = !1), Ve(m, {
1954
1965
  ref: this._setRef,
1955
1966
  style: {
1956
1967
  ...v,
@@ -1961,7 +1972,7 @@ class ai extends ro {
1961
1972
  }
1962
1973
  }
1963
1974
  const si = rn(({ widths: t, heights: e }) => {
1964
- const { focusedPage: n, totalPages: r } = le(), o = F(() => {
1975
+ const { focusedPage: n, totalPages: r } = de(), o = F(() => {
1965
1976
  const l = [], d = Math.ceil(n / 2) * 2 - 1;
1966
1977
  if (l.push(d), d + 1 <= r) {
1967
1978
  const f = d + 1;
@@ -1987,7 +1998,7 @@ const si = rn(({ widths: t, heights: e }) => {
1987
1998
  }, [t, e, o]), c = F(() => i.reduce((l, d) => l + Number(d.width || 0), 0), [i]);
1988
1999
  return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: o.map((l, d) => /* @__PURE__ */ a(xt, { style: i[d], pageNumber: l }, l)) });
1989
2000
  }), ci = ({ widths: t, heights: e }) => {
1990
- const { focusedPage: n } = le(), r = F(() => ({
2001
+ const { focusedPage: n } = de(), r = F(() => ({
1991
2002
  position: "absolute",
1992
2003
  width: t(n - 1),
1993
2004
  height: e(n - 1)
@@ -2003,29 +2014,29 @@ const si = rn(({ widths: t, heights: e }) => {
2003
2014
  }
2004
2015
  );
2005
2016
  }, li = (t, e, n) => {
2006
- const r = W(), { contentRef: o } = _e(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = le(), [d, f] = q([]), { targetScrollPage: m } = cn(), P = Tt(d, 0, 500), h = F(() => {
2017
+ const r = k(), { contentRef: o } = be(), { heights: i, widths: c } = Ge(), { setFocusedPage: l } = de(), [d, f] = $([]), { targetScrollPage: m } = cn(), P = Tt(d, 0, 500), p = F(() => {
2007
2018
  const { rowsHeight: C, columnsWidth: b } = bt({ heights: i, widths: c }, t);
2008
2019
  return i.map((v, y) => {
2009
- const g = c[y], p = Jo(y + 1, t), u = b.slice(0, p.columnIndex).reduce((x, R) => x + R, 0), s = C.slice(0, p.rowIndex).reduce((x, R) => x + R, 0), _ = u + g, w = s + v;
2020
+ const g = c[y], h = Jo(y + 1, t), u = b.slice(0, h.columnIndex).reduce((x, R) => x + R, 0), s = C.slice(0, h.rowIndex).reduce((x, R) => x + R, 0), w = u + g, _ = s + v;
2010
2021
  return {
2011
2022
  pageNumber: y + 1,
2012
- ...p,
2023
+ ...h,
2013
2024
  width: g,
2014
2025
  height: v,
2015
2026
  startX: u,
2016
2027
  startY: s,
2017
- endX: _,
2018
- endY: w
2028
+ endX: w,
2029
+ endY: _
2019
2030
  };
2020
2031
  });
2021
2032
  }, [i, c, t, e]);
2022
- A(() => {
2033
+ z(() => {
2023
2034
  var b;
2024
2035
  P.length > 0 && !m.current && l(P[0].pageNumber), ((b = P[0]) == null ? void 0 : b.ratio) && P.some((v) => v.pageNumber === m.current) && setTimeout(() => {
2025
2036
  m.current = void 0;
2026
2037
  }, 500);
2027
2038
  }, [P, l]);
2028
- const T = N(
2039
+ const T = O(
2029
2040
  (C) => {
2030
2041
  r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
2031
2042
  const b = C.target, v = {
@@ -2033,22 +2044,22 @@ const si = rn(({ widths: t, heights: e }) => {
2033
2044
  startLeft: b.scrollLeft,
2034
2045
  endTop: b.scrollTop + b.clientHeight,
2035
2046
  endLeft: b.scrollLeft + b.clientWidth
2036
- }, y = h.filter((g) => {
2037
- const p = g.endX >= v.startLeft && g.endY >= v.startTop, u = g.startX <= v.endLeft && g.startY <= v.endTop;
2038
- return p && u;
2047
+ }, y = p.filter((g) => {
2048
+ const h = g.endX >= v.startLeft && g.endY >= v.startTop, u = g.startX <= v.endLeft && g.startY <= v.endTop;
2049
+ return h && u;
2039
2050
  }).map((g) => {
2040
- const p = v.startLeft > g.startX ? v.startLeft : g.startX, u = v.startTop > g.startY ? v.startTop : g.startY, s = v.endLeft < g.endX ? v.endLeft : g.endX, _ = v.endTop < g.endY ? v.endTop : g.endY, w = s - p, x = _ - u, S = +(w * x / (g.width * g.height) * 100).toFixed(2);
2051
+ const h = v.startLeft > g.startX ? v.startLeft : g.startX, u = v.startTop > g.startY ? v.startTop : g.startY, s = v.endLeft < g.endX ? v.endLeft : g.endX, w = v.endTop < g.endY ? v.endTop : g.endY, _ = s - h, x = w - u, I = +(_ * x / (g.width * g.height) * 100).toFixed(2);
2041
2052
  return {
2042
2053
  pageNumber: g.pageNumber,
2043
- ratio: S
2054
+ ratio: I
2044
2055
  };
2045
- }).sort((g, p) => p.ratio - g.ratio);
2056
+ }).sort((g, h) => h.ratio - g.ratio);
2046
2057
  f(y);
2047
2058
  });
2048
2059
  },
2049
- [o, h]
2060
+ [o, p]
2050
2061
  );
2051
- A(() => {
2062
+ z(() => {
2052
2063
  if (n)
2053
2064
  return n == null || n.addEventListener("scroll", T), () => {
2054
2065
  n == null || n.removeEventListener("scroll", T);
@@ -2061,10 +2072,10 @@ const si = rn(({ widths: t, heights: e }) => {
2061
2072
  {
2062
2073
  ref: e,
2063
2074
  ...c,
2064
- className: se(
2065
- we["rp-theme-variables"],
2066
- we["rp-container"],
2067
- f ? we["rp-dark-mode"] : "",
2075
+ className: ce(
2076
+ _e["rp-theme-variables"],
2077
+ _e["rp-container"],
2078
+ f ? _e["rp-dark-mode"] : "",
2068
2079
  i
2069
2080
  ),
2070
2081
  style: {
@@ -2080,147 +2091,147 @@ const si = rn(({ widths: t, heights: e }) => {
2080
2091
  const o = er(e, t, n.columnCount);
2081
2092
  return /* @__PURE__ */ a(xt, { style: r, pageNumber: o }, o);
2082
2093
  }, oi), Js = () => {
2083
- const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = ho(), { pagesRef: r, setPagesRef: o, setContentRef: i } = _e(), { scrollToPage: c } = vn(), {
2094
+ const { initialPage: t = 1, initialScrollMode: e, instanceId: n } = ho(), { pagesRef: r, setPagesRef: o, setContentRef: i } = be(), { scrollToPage: c } = vn(), {
2084
2095
  virtualScrollRef: l,
2085
2096
  getVirtualScrollRef: d,
2086
2097
  getPageScrollElementRef: f,
2087
2098
  getVirtualScrollableElementRef: m,
2088
2099
  setTotalInnerDimensions: P,
2089
- virtualScrollableElementRef: h,
2100
+ virtualScrollableElementRef: p,
2090
2101
  totalInnerDimensions: T,
2091
2102
  pageScrollElementRef: C
2092
- } = Ye(), b = W(!0), { nextPage: v, prevPage: y, setFocusedPage: g, focusedPage: p } = le(), { scrollMode: u } = Ee(), { viewMode: s } = Me(), _ = W(null), { loading: w, error: x } = oe(), { passwordRequired: R } = co(), { LoaderImageComponent: S } = _t(), I = W(
2103
+ } = Ye(), b = k(!0), { nextPage: v, prevPage: y, setFocusedPage: g, focusedPage: h } = de(), { scrollMode: u } = Ee(), { viewMode: s } = Me(), w = k(null), { loading: _, error: x } = oe(), { passwordRequired: R } = co(), { LoaderImageComponent: I } = _t(), S = k(
2093
2104
  T
2094
- ), E = W({
2105
+ ), N = k({
2095
2106
  viewMode: s,
2096
2107
  scrollMode: u
2097
- }), D = W(!1), z = W(), { isFullScreen: L } = fo(), {
2098
- pageDimension: O,
2099
- rowCount: M,
2100
- rowHeight: $,
2101
- columnCount: k,
2102
- columnWidth: B,
2103
- estimatedColumnWidth: Z,
2104
- estimatedRowHeight: U,
2105
- totalDimension: ie
2106
- } = ri(), G = Tt(T, 100), K = W();
2107
- li(k, M, h);
2108
- const Y = W({
2108
+ }), D = k(!1), M = k(), { isFullScreen: A } = fo(), {
2109
+ pageDimension: L,
2110
+ rowCount: E,
2111
+ rowHeight: q,
2112
+ columnCount: W,
2113
+ columnWidth: U,
2114
+ estimatedColumnWidth: j,
2115
+ estimatedRowHeight: V,
2116
+ totalDimension: ee
2117
+ } = ri(), G = Tt(T, 100), Z = k();
2118
+ li(W, E, p);
2119
+ const Y = k({
2109
2120
  scrollTop: 0,
2110
2121
  scrollLeft: 0
2111
2122
  });
2112
2123
  or(r);
2113
- const { isPressed: J } = tr(), { selectionMode: ee } = po(), { initializeGrabScroll: re, resetGrabState: ve } = nr({
2114
- isPressed: J
2115
- }), de = F(() => ee === ao.HAND, [ee]), Pe = F(() => ({
2116
- columnCount: k
2117
- }), [k]), Fe = N(
2118
- (V) => {
2119
- const j = document.activeElement !== r;
2120
- !L && j || (["ArrowUp", "ArrowLeft"].includes(V.key) ? (V.preventDefault(), y()) : ["ArrowDown", "ArrowRight"].includes(V.key) && (V.preventDefault(), v()));
2124
+ const { isPressed: re } = tr(), { selectionMode: ae } = po(), { initializeGrabScroll: J, resetGrabState: ue } = nr({
2125
+ isPressed: re
2126
+ }), ie = F(() => ae === ao.HAND, [ae]), me = F(() => ({
2127
+ columnCount: W
2128
+ }), [W]), Fe = O(
2129
+ (B) => {
2130
+ const K = document.activeElement !== r;
2131
+ !A && K || (["ArrowUp", "ArrowLeft"].includes(B.key) ? (B.preventDefault(), y()) : ["ArrowDown", "ArrowRight"].includes(B.key) && (B.preventDefault(), v()));
2121
2132
  },
2122
- [v, y, L, u]
2133
+ [v, y, A, u]
2123
2134
  );
2124
- A(() => (window.addEventListener("keydown", Fe), () => {
2135
+ z(() => (window.addEventListener("keydown", Fe), () => {
2125
2136
  window.removeEventListener("keydown", Fe);
2126
- }), [Fe]), A(() => {
2127
- if (_.current && (_.current.style.position = "relative"), !!l)
2128
- for (let V = 0; V < M; V++)
2129
- for (let j = 0; j < k; j++)
2137
+ }), [Fe]), z(() => {
2138
+ if (w.current && (w.current.style.position = "relative"), !!l)
2139
+ for (let B = 0; B < E; B++)
2140
+ for (let K = 0; K < W; K++)
2130
2141
  l.resetAfterIndices({
2131
- columnIndex: j,
2132
- rowIndex: V,
2142
+ columnIndex: K,
2143
+ rowIndex: B,
2133
2144
  shouldForceUpdate: !0
2134
2145
  });
2135
- }, [M, k, O, l]);
2136
- const nt = N(
2137
- (V, j) => {
2138
- if (!h)
2146
+ }, [E, W, L, l]);
2147
+ const nt = O(
2148
+ (B, K) => {
2149
+ if (!p)
2139
2150
  return { scrollTop: 0, scrollLeft: 0 };
2140
- const ye = Y.current.scrollTop > j, xe = Y.current.scrollLeft > V;
2151
+ const ye = Y.current.scrollTop > K, xe = Y.current.scrollLeft > B;
2141
2152
  return ye || xe ? Y.current : {
2142
- scrollTop: h.scrollTop,
2143
- scrollLeft: h.scrollLeft
2153
+ scrollTop: p.scrollTop,
2154
+ scrollLeft: p.scrollLeft
2144
2155
  };
2145
2156
  },
2146
- [h]
2147
- ), Et = N(
2148
- (V, j) => {
2149
- if (E.current.viewMode !== s || E.current.scrollMode !== u) {
2150
- K.current && clearTimeout(K.current), D.current = !0, c(p, "auto"), K.current = setTimeout(() => {
2157
+ [p]
2158
+ ), Et = O(
2159
+ (B, K) => {
2160
+ if (N.current.viewMode !== s || N.current.scrollMode !== u) {
2161
+ Z.current && clearTimeout(Z.current), D.current = !0, c(h, "auto"), Z.current = setTimeout(() => {
2151
2162
  requestAnimationFrame(() => {
2152
- E.current = { viewMode: s, scrollMode: u };
2163
+ N.current = { viewMode: s, scrollMode: u };
2153
2164
  });
2154
2165
  }, 100);
2155
2166
  return;
2156
2167
  }
2157
- const xe = V.scrollTop, ot = V.scrollLeft;
2158
- if (!j.height || !j.width)
2168
+ const xe = B.scrollTop, ot = B.scrollLeft;
2169
+ if (!K.height || !K.width)
2159
2170
  return;
2160
2171
  D.current = !0;
2161
- const { height: Se, width: rt } = j, { height: Nt, width: Ot } = I.current;
2172
+ const { height: Se, width: rt } = K, { height: Nt, width: Ot } = S.current;
2162
2173
  if (Nt === Se && Ot === rt)
2163
2174
  return;
2164
2175
  const Jn = xe / Nt * Se, eo = ot / Ot * rt, to = Math.round(Math.min(Jn, Se)) || 0, no = Math.round(Math.min(eo, rt)) || 0;
2165
- z.current = setTimeout(() => {
2176
+ M.current = setTimeout(() => {
2166
2177
  requestAnimationFrame(() => {
2167
- h == null || h.scrollTo({
2178
+ p == null || p.scrollTo({
2168
2179
  top: to,
2169
2180
  left: no,
2170
2181
  behavior: "auto"
2171
2182
  });
2172
2183
  });
2173
- }, 0), I.current = {
2174
- height: j.height,
2175
- width: j.width
2184
+ }, 0), S.current = {
2185
+ height: K.height,
2186
+ width: K.width
2176
2187
  };
2177
2188
  },
2178
- [h, s, u, c]
2189
+ [p, s, u, c]
2179
2190
  );
2180
- A(() => {
2181
- clearTimeout(z.current);
2182
- const V = Array.from({ length: M }).reduce(
2183
- (xe, ot, Se) => xe + $(Se),
2191
+ z(() => {
2192
+ clearTimeout(M.current);
2193
+ const B = Array.from({ length: E }).reduce(
2194
+ (xe, ot, Se) => xe + q(Se),
2184
2195
  0
2185
- ), j = Array.from({ length: k }).reduce(
2186
- (xe, ot, Se) => xe + B(Se),
2196
+ ), K = Array.from({ length: W }).reduce(
2197
+ (xe, ot, Se) => xe + U(Se),
2187
2198
  0
2188
- ), ye = nt(j, V);
2189
- Y.current = ye, Et(ye, { height: V, width: j }), P({
2190
- height: V,
2191
- width: j
2199
+ ), ye = nt(K, B);
2200
+ Y.current = ye, Et(ye, { height: B, width: K }), P({
2201
+ height: B,
2202
+ width: K
2192
2203
  });
2193
- }, [O, M, k, Et]);
2194
- const Xn = N(
2195
- (V) => {
2204
+ }, [L, E, W, Et]);
2205
+ const Xn = O(
2206
+ (B) => {
2196
2207
  Y.current = {
2197
- scrollTop: V.scrollTop,
2198
- scrollLeft: V.scrollLeft
2208
+ scrollTop: B.scrollTop,
2209
+ scrollLeft: B.scrollLeft
2199
2210
  };
2200
2211
  },
2201
- [h]
2212
+ [p]
2202
2213
  );
2203
- A(() => () => {
2204
- K.current && clearTimeout(K.current);
2214
+ z(() => () => {
2215
+ Z.current && clearTimeout(Z.current);
2205
2216
  }, []);
2206
- const Qn = F(() => se(ae["rp-pages-container"], {
2207
- [ae["rp-cursor-grab"]]: de && !J,
2208
- [ae["rp-cursor-grabbing"]]: de && J
2209
- }), [de, J]), Yn = N(
2210
- (V) => {
2211
- if (de && V) {
2212
- const j = se(ae["rp-pages"]), ye = document.querySelector(`.${j}`);
2213
- re(ye);
2217
+ const Qn = F(() => ce(se["rp-pages-container"], {
2218
+ [se["rp-cursor-grab"]]: ie && !re,
2219
+ [se["rp-cursor-grabbing"]]: ie && re
2220
+ }), [ie, re]), Yn = O(
2221
+ (B) => {
2222
+ if (ie && B) {
2223
+ const K = ce(se["rp-pages"]), ye = document.querySelector(`.${K}`);
2224
+ J(ye);
2214
2225
  }
2215
2226
  },
2216
- [de, re, ae]
2227
+ [ie, J, se]
2217
2228
  );
2218
- return A(() => {
2219
- w && ve();
2220
- }, [w]), A(() => {
2229
+ return z(() => {
2230
+ _ && ue();
2231
+ }, [_]), z(() => {
2221
2232
  if (!(G.height === 0 || !b.current)) {
2222
2233
  if (e === ne.PAGE_SCROLLING) {
2223
- t !== p && C && g(t), b.current = !1;
2234
+ t !== h && C && g(t), b.current = !1;
2224
2235
  return;
2225
2236
  }
2226
2237
  c(t, "auto"), g(t), b.current = !1;
@@ -2231,7 +2242,7 @@ const si = rn(({ widths: t, heights: e }) => {
2231
2242
  C,
2232
2243
  g,
2233
2244
  G
2234
- ]), /* @__PURE__ */ H(pe, { children: [
2245
+ ]), /* @__PURE__ */ H(he, { children: [
2235
2246
  /* @__PURE__ */ a(No, { ref: i, children: /* @__PURE__ */ a(
2236
2247
  Rn,
2237
2248
  {
@@ -2239,46 +2250,46 @@ const si = rn(({ widths: t, heights: e }) => {
2239
2250
  ref: o,
2240
2251
  tabIndex: -1,
2241
2252
  className: Qn,
2242
- children: /* @__PURE__ */ a(ai, { style: { minHeight: "50px" }, children: ({ width: V, height: j }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Yn, style: { width: V, height: j }, children: u === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
2253
+ children: /* @__PURE__ */ a(ai, { style: { minHeight: "50px" }, children: ({ width: B, height: K }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Yn, style: { width: B, height: K }, children: u === ne.PAGE_SCROLLING ? /* @__PURE__ */ a(
2243
2254
  "div",
2244
2255
  {
2245
2256
  ref: f,
2246
- style: { width: V, height: j },
2247
- className: se(ae["rp-pages"], ae["rp-page-scrolling-wrapper"]),
2248
- children: s === Re.DUAL_PAGE ? /* @__PURE__ */ a(si, { widths: B, heights: $ }) : /* @__PURE__ */ a(ci, { widths: B, heights: $ })
2257
+ style: { width: B, height: K },
2258
+ className: ce(se["rp-pages"], se["rp-page-scrolling-wrapper"]),
2259
+ children: s === Re.DUAL_PAGE ? /* @__PURE__ */ a(si, { widths: U, heights: q }) : /* @__PURE__ */ a(ci, { widths: U, heights: q })
2249
2260
  }
2250
- ) : U ? /* @__PURE__ */ a(
2261
+ ) : V ? /* @__PURE__ */ a(
2251
2262
  ei,
2252
2263
  {
2253
2264
  ref: d,
2254
- itemData: Pe,
2265
+ itemData: me,
2255
2266
  outerRef: m,
2256
- innerRef: _,
2267
+ innerRef: w,
2257
2268
  onScroll: Xn,
2258
- columnCount: k,
2259
- columnWidth: B,
2260
- rowHeight: $,
2261
- height: j,
2262
- width: V,
2263
- estimatedColumnWidth: Z,
2264
- estimatedRowHeight: U,
2265
- rowCount: M,
2266
- className: se(
2267
- ae["rp-pages"],
2268
- u === ne.HORIZONTAL_SCROLLING ? ae["rp-pages-horizontal-scroll"] : ""
2269
+ columnCount: W,
2270
+ columnWidth: U,
2271
+ rowHeight: q,
2272
+ height: K,
2273
+ width: B,
2274
+ estimatedColumnWidth: j,
2275
+ estimatedRowHeight: V,
2276
+ rowCount: E,
2277
+ className: ce(
2278
+ se["rp-pages"],
2279
+ u === ne.HORIZONTAL_SCROLLING ? se["rp-pages-horizontal-scroll"] : ""
2269
2280
  ),
2270
2281
  style: {
2271
- "--rp-page-height": `${ie.height}px`,
2272
- "--rp-page-width": `${ie.width}px`,
2273
- "--rp-row-count": `${M}`,
2274
- "--rp-column-count": `${k}`
2282
+ "--rp-page-height": `${ee.height}px`,
2283
+ "--rp-page-width": `${ee.width}px`,
2284
+ "--rp-row-count": `${E}`,
2285
+ "--rp-column-count": `${W}`
2275
2286
  },
2276
2287
  children: di
2277
2288
  }
2278
- ) : !w && !x ? /* @__PURE__ */ a(
2289
+ ) : !_ && !x ? /* @__PURE__ */ a(
2279
2290
  "div",
2280
2291
  {
2281
- className: ae["rp-loader"],
2292
+ className: se["rp-loader"],
2282
2293
  style: {
2283
2294
  display: "flex",
2284
2295
  justifyContent: "center",
@@ -2286,9 +2297,9 @@ const si = rn(({ widths: t, heights: e }) => {
2286
2297
  height: "100%",
2287
2298
  width: "100%"
2288
2299
  },
2289
- children: S && /* @__PURE__ */ a(S, {})
2300
+ children: I && /* @__PURE__ */ a(I, {})
2290
2301
  }
2291
- ) : x === so.NOT_SUPPORTED ? /* @__PURE__ */ a("div", { className: ae["rp-not-supported"], children: /* @__PURE__ */ H("div", { className: ae["rp-not-supported-content"], children: [
2302
+ ) : x === so.NOT_SUPPORTED ? /* @__PURE__ */ a("div", { className: se["rp-not-supported"], children: /* @__PURE__ */ H("div", { className: se["rp-not-supported-content"], children: [
2292
2303
  "React PDF is unable to render on this browser. Please use the supported browsers from the list below:",
2293
2304
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ H("ul", { children: [
2294
2305
  /* @__PURE__ */ a("li", { children: "Chrome 110+" }),
@@ -2314,30 +2325,30 @@ const si = rn(({ widths: t, heights: e }) => {
2314
2325
  "rp-page-input": "_rp-page-input_1gck0_6",
2315
2326
  "rp-total-page": "_rp-total-page_1gck0_18"
2316
2327
  }, ui = () => {
2317
- const { prevIcon: t } = Ce(), { prevIcon: e } = be();
2328
+ const { prevIcon: t } = Pe(), { prevIcon: e } = Te();
2318
2329
  return t || e || /* @__PURE__ */ a(Ze, {});
2319
2330
  }, pi = () => {
2320
- const { nextIcon: t } = Ce(), { nextIcon: e } = be();
2331
+ const { nextIcon: t } = Pe(), { nextIcon: e } = Te();
2321
2332
  return t || e || /* @__PURE__ */ a(Ze, { style: { transform: "rotate(180deg" } });
2322
2333
  }, hi = () => {
2323
- const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = le(), [c, l] = q(t.toString()), { pageNavigationTool: d = !0 } = Te(), { pageNavigationTool: f = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: P } = Me(), { scrollMode: h } = Ee(), { localeMessages: T } = he();
2324
- A(() => {
2334
+ const { focusedPage: t, totalPages: e, setFocusedPage: n, nextPage: r, prevPage: o, goToPage: i } = de(), [c, l] = $(t.toString()), { pageNavigationTool: d = !0 } = Ce(), { pageNavigationTool: f = !0 } = Ne(), { isSmallScreen: m } = Oe(), { viewMode: P } = Me(), { scrollMode: p } = Ee(), { localeMessages: T } = fe();
2335
+ z(() => {
2325
2336
  l(t.toString());
2326
2337
  }, [t]);
2327
- const C = N((p) => {
2328
- const u = p.target.value;
2338
+ const C = O((h) => {
2339
+ const u = h.target.value;
2329
2340
  l(u);
2330
- }, []), b = N(async () => {
2331
- const p = i(c);
2332
- p.success || l(p.currentPage.toString());
2333
- }, [i, c, e]), v = N(() => {
2341
+ }, []), b = O(async () => {
2342
+ const h = i(c);
2343
+ h.success || l(h.currentPage.toString());
2344
+ }, [i, c, e]), v = O(() => {
2334
2345
  l(t.toString());
2335
- }, [t]), y = N(
2336
- (p) => {
2337
- p.key === "Enter" && b();
2346
+ }, [t]), y = O(
2347
+ (h) => {
2348
+ h.key === "Enter" && b();
2338
2349
  },
2339
2350
  [b]
2340
- ), g = F(() => P === Re.DUAL_PAGE && h === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, h]);
2351
+ ), g = F(() => P === Re.DUAL_PAGE && p === ne.PAGE_SCROLLING && t === e - 1 || t === e, [t, e, P, p]);
2341
2352
  return !d || !f ? null : typeof d != "boolean" ? /* @__PURE__ */ a(
2342
2353
  d,
2343
2354
  {
@@ -2360,7 +2371,7 @@ const si = rn(({ widths: t, heights: e }) => {
2360
2371
  }
2361
2372
  ) : /* @__PURE__ */ H("div", { className: pt["rp-paginate"], children: [
2362
2373
  !m && /* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.previousPageTooltip, children: /* @__PURE__ */ a(
2363
- ge,
2374
+ we,
2364
2375
  {
2365
2376
  onClick: o,
2366
2377
  "aria-label": T == null ? void 0 : T.previousPageTooltip,
@@ -2385,7 +2396,7 @@ const si = rn(({ widths: t, heights: e }) => {
2385
2396
  e
2386
2397
  ] }),
2387
2398
  !m && /* @__PURE__ */ a(Q, { content: T == null ? void 0 : T.nextPageTooltip, children: /* @__PURE__ */ a(
2388
- ge,
2399
+ we,
2389
2400
  {
2390
2401
  onClick: r,
2391
2402
  "aria-label": T == null ? void 0 : T.nextPageTooltip,
@@ -2395,7 +2406,7 @@ const si = rn(({ widths: t, heights: e }) => {
2395
2406
  ) })
2396
2407
  ] });
2397
2408
  };
2398
- var St = "Dialog", [Ln, ec] = dr(St), [fi, ue] = Ln(St), En = (t) => {
2409
+ var St = "Dialog", [Ln, ec] = dr(St), [fi, pe] = Ln(St), En = (t) => {
2399
2410
  const {
2400
2411
  __scopeDialog: e,
2401
2412
  children: n,
@@ -2428,7 +2439,7 @@ var St = "Dialog", [Ln, ec] = dr(St), [fi, ue] = Ln(St), En = (t) => {
2428
2439
  En.displayName = St;
2429
2440
  var Nn = "DialogTrigger", mi = X.forwardRef(
2430
2441
  (t, e) => {
2431
- const { __scopeDialog: n, ...r } = t, o = ue(Nn, n), i = Ct(e, o.triggerRef);
2442
+ const { __scopeDialog: n, ...r } = t, o = pe(Nn, n), i = Ct(e, o.triggerRef);
2432
2443
  return /* @__PURE__ */ a(
2433
2444
  Ue.button,
2434
2445
  {
@@ -2448,20 +2459,20 @@ mi.displayName = Nn;
2448
2459
  var It = "DialogPortal", [gi, On] = Ln(It, {
2449
2460
  forceMount: void 0
2450
2461
  }), Dn = (t) => {
2451
- const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, i = ue(It, e);
2462
+ const { __scopeDialog: e, forceMount: n, children: r, container: o } = t, i = pe(It, e);
2452
2463
  return /* @__PURE__ */ a(gi, { scope: e, forceMount: n, children: X.Children.map(r, (c) => /* @__PURE__ */ a(Pt, { present: n || i.open, children: /* @__PURE__ */ a(_r, { asChild: !0, container: o, children: c }) })) });
2453
2464
  };
2454
2465
  Dn.displayName = It;
2455
2466
  var Qe = "DialogOverlay", An = X.forwardRef(
2456
2467
  (t, e) => {
2457
- const n = On(Qe, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = ue(Qe, t.__scopeDialog);
2468
+ const n = On(Qe, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = pe(Qe, t.__scopeDialog);
2458
2469
  return i.modal ? /* @__PURE__ */ a(Pt, { present: r || i.open, children: /* @__PURE__ */ a(vi, { ...o, ref: e }) }) : null;
2459
2470
  }
2460
2471
  );
2461
2472
  An.displayName = Qe;
2462
2473
  var vi = X.forwardRef(
2463
2474
  (t, e) => {
2464
- const { __scopeDialog: n, ...r } = t, o = ue(Qe, n);
2475
+ const { __scopeDialog: n, ...r } = t, o = pe(Qe, n);
2465
2476
  return (
2466
2477
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2467
2478
  // ie. when `Overlay` and `Content` are siblings
@@ -2478,14 +2489,14 @@ var vi = X.forwardRef(
2478
2489
  }
2479
2490
  ), Le = "DialogContent", zn = X.forwardRef(
2480
2491
  (t, e) => {
2481
- const n = On(Le, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = ue(Le, t.__scopeDialog);
2492
+ const n = On(Le, t.__scopeDialog), { forceMount: r = n.forceMount, ...o } = t, i = pe(Le, t.__scopeDialog);
2482
2493
  return /* @__PURE__ */ a(Pt, { present: r || i.open, children: i.modal ? /* @__PURE__ */ a(wi, { ...o, ref: e }) : /* @__PURE__ */ a(_i, { ...o, ref: e }) });
2483
2494
  }
2484
2495
  );
2485
2496
  zn.displayName = Le;
2486
2497
  var wi = X.forwardRef(
2487
2498
  (t, e) => {
2488
- const n = ue(Le, t.__scopeDialog), r = X.useRef(null), o = Ct(e, n.contentRef, r);
2499
+ const n = pe(Le, t.__scopeDialog), r = X.useRef(null), o = Ct(e, n.contentRef, r);
2489
2500
  return X.useEffect(() => {
2490
2501
  const i = r.current;
2491
2502
  if (i)
@@ -2514,7 +2525,7 @@ var wi = X.forwardRef(
2514
2525
  }
2515
2526
  ), _i = X.forwardRef(
2516
2527
  (t, e) => {
2517
- const n = ue(Le, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
2528
+ const n = pe(Le, t.__scopeDialog), r = X.useRef(!1), o = X.useRef(!1);
2518
2529
  return /* @__PURE__ */ a(
2519
2530
  Mn,
2520
2531
  {
@@ -2537,8 +2548,8 @@ var wi = X.forwardRef(
2537
2548
  }
2538
2549
  ), Mn = X.forwardRef(
2539
2550
  (t, e) => {
2540
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = ue(Le, n), d = X.useRef(null), f = Ct(e, d);
2541
- return vr(), /* @__PURE__ */ H(pe, { children: [
2551
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...c } = t, l = pe(Le, n), d = X.useRef(null), f = Ct(e, d);
2552
+ return vr(), /* @__PURE__ */ H(he, { children: [
2542
2553
  /* @__PURE__ */ a(
2543
2554
  wr,
2544
2555
  {
@@ -2562,7 +2573,7 @@ var wi = X.forwardRef(
2562
2573
  )
2563
2574
  }
2564
2575
  ),
2565
- /* @__PURE__ */ H(pe, { children: [
2576
+ /* @__PURE__ */ H(he, { children: [
2566
2577
  /* @__PURE__ */ a(Ti, { titleId: l.titleId }),
2567
2578
  /* @__PURE__ */ a(Pi, { contentRef: d, descriptionId: l.descriptionId })
2568
2579
  ] })
@@ -2570,21 +2581,21 @@ var wi = X.forwardRef(
2570
2581
  }
2571
2582
  ), Rt = "DialogTitle", Fn = X.forwardRef(
2572
2583
  (t, e) => {
2573
- const { __scopeDialog: n, ...r } = t, o = ue(Rt, n);
2584
+ const { __scopeDialog: n, ...r } = t, o = pe(Rt, n);
2574
2585
  return /* @__PURE__ */ a(Ue.h2, { id: o.titleId, ...r, ref: e });
2575
2586
  }
2576
2587
  );
2577
2588
  Fn.displayName = Rt;
2578
2589
  var kn = "DialogDescription", bi = X.forwardRef(
2579
2590
  (t, e) => {
2580
- const { __scopeDialog: n, ...r } = t, o = ue(kn, n);
2591
+ const { __scopeDialog: n, ...r } = t, o = pe(kn, n);
2581
2592
  return /* @__PURE__ */ a(Ue.p, { id: o.descriptionId, ...r, ref: e });
2582
2593
  }
2583
2594
  );
2584
2595
  bi.displayName = kn;
2585
2596
  var Wn = "DialogClose", Hn = X.forwardRef(
2586
2597
  (t, e) => {
2587
- const { __scopeDialog: n, ...r } = t, o = ue(Wn, n);
2598
+ const { __scopeDialog: n, ...r } = t, o = pe(Wn, n);
2588
2599
  return /* @__PURE__ */ a(
2589
2600
  Ue.button,
2590
2601
  {
@@ -2630,7 +2641,7 @@ const Ie = {
2630
2641
  "rp-dialog-close": "_rp-dialog-close_slqo7_47",
2631
2642
  "rp-properties-divider": "_rp-properties-divider_slqo7_55"
2632
2643
  }, Ei = () => {
2633
- const { pdfProperties: t } = oe(), { container: e } = _e(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = he(), i = F(() => {
2644
+ const { pdfProperties: t } = oe(), { container: e } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: r } = yo(), { localeMessages: o } = fe(), i = F(() => {
2634
2645
  if (!t)
2635
2646
  return [];
2636
2647
  const {
@@ -2640,7 +2651,7 @@ const Ie = {
2640
2651
  author: f,
2641
2652
  subject: m,
2642
2653
  createdOn: P,
2643
- creator: h,
2654
+ creator: p,
2644
2655
  keywords: T,
2645
2656
  modifiedOn: C,
2646
2657
  pdfProducer: b,
@@ -2655,7 +2666,7 @@ const Ie = {
2655
2666
  { label: o == null ? void 0 : o.propertiesAuthorLabel, value: f },
2656
2667
  { label: o == null ? void 0 : o.propertiesSubjectLabel, value: m },
2657
2668
  { label: o == null ? void 0 : o.propertiesKeywordLabel, value: T },
2658
- { label: o == null ? void 0 : o.propertiesCreatorLabel, value: h },
2669
+ { label: o == null ? void 0 : o.propertiesCreatorLabel, value: p },
2659
2670
  {
2660
2671
  label: o == null ? void 0 : o.propertiesCreateOnLabel,
2661
2672
  value: P ? Mt(P) : ""
@@ -2688,29 +2699,29 @@ const Ie = {
2688
2699
  const c = n || i;
2689
2700
  return c.endsWith(Jt) ? c : `${c}${Jt}`;
2690
2701
  };
2691
- return { download: N(async () => {
2702
+ return { download: O(async () => {
2692
2703
  if (!t || !e)
2693
2704
  throw new Error("There is no PDF source to download");
2694
2705
  const i = document.createElement("a");
2695
2706
  i.href = await Di(e), i.download = r(t), document.body.appendChild(i), i.click(), document.body.removeChild(i);
2696
2707
  }, [t, e]) };
2697
2708
  }, Un = () => {
2698
- const { downloadIcon: t } = Ce(), { downloadIcon: e } = be();
2709
+ const { downloadIcon: t } = Pe(), { downloadIcon: e } = Te();
2699
2710
  return t || e || /* @__PURE__ */ a(xr, {});
2700
- }, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ai = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(ge, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), zi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ H(Vn, { className: "rp-menu-item", localeMessages: e, children: [
2711
+ }, Vn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.downloadFileTooltip, children: t }), Ai = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Vn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.downloadFileTooltip, children: /* @__PURE__ */ a(Un, {}) }) }), zi = ({ download: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ H(Vn, { className: "rp-menu-item", localeMessages: e, children: [
2701
2712
  /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Un, {}) }),
2702
2713
  e == null ? void 0 : e.downloadFileLabel
2703
2714
  ] }) }), Bn = () => {
2704
- const { download: t } = Gn(), { downloadTool: e = !0 } = Te(), { downloadTool: n = !0 } = Ne(), { isSmallScreen: r } = Oe(), { localeMessages: o } = he(), i = o == null ? void 0 : o.downloadFileTooltip;
2715
+ const { download: t } = Gn(), { downloadTool: e = !0 } = Ce(), { downloadTool: n = !0 } = Ne(), { isSmallScreen: r } = Oe(), { localeMessages: o } = fe(), i = o == null ? void 0 : o.downloadFileTooltip;
2705
2716
  return !e || !n ? null : r ? /* @__PURE__ */ a(zi, { download: t, localeMessages: o }) : typeof e == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(e, { download: t }) }) : typeof n == "function" ? /* @__PURE__ */ a(Q, { content: i, children: /* @__PURE__ */ a(n, { download: t }) }) : /* @__PURE__ */ a(Ai, { download: t, localeMessages: o });
2706
2717
  }, jn = () => {
2707
- const { printIcon: t } = Ce(), { printIcon: e } = be();
2718
+ const { printIcon: t } = Pe(), { printIcon: e } = Te();
2708
2719
  return t || e || /* @__PURE__ */ a(Sr, {});
2709
- }, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Mi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(ge, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), Fi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ H(Kn, { className: "rp-menu-item", localeMessages: e, children: [
2720
+ }, Kn = ({ children: t, className: e, localeMessages: n }) => /* @__PURE__ */ a(Q, { className: e, content: n == null ? void 0 : n.printTooltip, children: t }), Mi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Kn, { localeMessages: e, children: /* @__PURE__ */ a(we, { onClick: t, "aria-label": e == null ? void 0 : e.printTooltip, children: /* @__PURE__ */ a(jn, {}) }) }), Fi = ({ print: t, localeMessages: e }) => /* @__PURE__ */ a(Xe, { onClick: t, children: /* @__PURE__ */ H(Kn, { className: "rp-menu-item", localeMessages: e, children: [
2710
2721
  /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(jn, {}) }),
2711
2722
  e == null ? void 0 : e.printLabel
2712
2723
  ] }) }), Zn = () => {
2713
- const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = tt(), { printTool: c = !0 } = Te(), { printTool: l = !0 } = Ne(), { isSmallScreen: d } = Oe(), { localeMessages: f } = he(), m = f == null ? void 0 : f.printTooltip;
2724
+ const { print: t, cancel: e, setOnProgress: n, setOnComplete: r, setOnError: o, progress: i } = tt(), { printTool: c = !0 } = Ce(), { printTool: l = !0 } = Ne(), { isSmallScreen: d } = Oe(), { localeMessages: f } = fe(), m = f == null ? void 0 : f.printTooltip;
2714
2725
  return !c || !l ? null : d ? /* @__PURE__ */ a(Fi, { print: t, localeMessages: f }) : typeof c == "function" ? /* @__PURE__ */ a(Q, { content: m, children: /* @__PURE__ */ a(
2715
2726
  c,
2716
2727
  {
@@ -2735,15 +2746,15 @@ const Ie = {
2735
2746
  }, ki = {
2736
2747
  "rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
2737
2748
  }, Wi = () => {
2738
- const { goToFirstPageIcon: t } = Ce(), { goToFirstPageIcon: e } = be();
2749
+ const { goToFirstPageIcon: t } = Pe(), { goToFirstPageIcon: e } = Te();
2739
2750
  return t || e || /* @__PURE__ */ a(mn, { className: ki["rp-go-to-Top"] });
2740
2751
  }, Hi = () => {
2741
- const { goToLastPageIcon: t } = Ce(), { goToLastPageIcon: e } = be();
2752
+ const { goToLastPageIcon: t } = Pe(), { goToLastPageIcon: e } = Te();
2742
2753
  return t || e || /* @__PURE__ */ a(mn, {});
2743
2754
  }, en = { width: "100%" }, $i = () => {
2744
- const { goToPage: t, totalPages: e, focusedPage: n } = le(), { jumpNavigationTool: r = !0 } = Te(), { jumpNavigationTool: o = !0 } = Ne(), { localeMessages: i } = he(), c = F(() => n === 1, [n]), l = F(() => n === e, [n, e]), d = N(() => {
2755
+ const { goToPage: t, totalPages: e, focusedPage: n } = de(), { jumpNavigationTool: r = !0 } = Ce(), { jumpNavigationTool: o = !0 } = Ne(), { localeMessages: i } = fe(), c = F(() => n === 1, [n]), l = F(() => n === e, [n, e]), d = O(() => {
2745
2756
  t(1);
2746
- }, [t]), f = N(() => {
2757
+ }, [t]), f = O(() => {
2747
2758
  t(e);
2748
2759
  }, [t, e]);
2749
2760
  return !r || !o ? null : /* @__PURE__ */ H(hn, { children: [
@@ -2758,7 +2769,7 @@ const Ie = {
2758
2769
  /* @__PURE__ */ a(un, {})
2759
2770
  ] });
2760
2771
  }, qi = () => {
2761
- const [t, e] = q(!1), { container: n, pagesRef: r } = _e(), { isSmallScreen: o } = Oe(), {
2772
+ const [t, e] = $(!1), { container: n, pagesRef: r } = be(), { isSmallScreen: o } = Oe(), {
2762
2773
  openFileTool: i,
2763
2774
  downloadTool: c,
2764
2775
  documentProperties: l,
@@ -2766,28 +2777,28 @@ const Ie = {
2766
2777
  rotateTool: f,
2767
2778
  selectionModeTool: m,
2768
2779
  jumpNavigationTool: P,
2769
- printTool: h,
2780
+ printTool: p,
2770
2781
  fullscreenTool: T,
2771
2782
  viewModeTool: C
2772
- } = Te(), {
2783
+ } = Ce(), {
2773
2784
  openFileTool: b,
2774
2785
  downloadTool: v,
2775
2786
  documentProperties: y,
2776
2787
  scrollModeTool: g,
2777
- rotateTool: p,
2788
+ rotateTool: h,
2778
2789
  selectionModeTool: u,
2779
2790
  jumpNavigationTool: s,
2780
- printTool: _,
2781
- fullscreenTool: w,
2791
+ printTool: w,
2792
+ fullscreenTool: _,
2782
2793
  viewModeTool: x
2783
- } = Ne(), { localeMessages: R } = he(), [S, I] = q(0), E = W(
2784
- new ResizeObserver((L) => {
2785
- I(L[0].contentRect.height);
2794
+ } = Ne(), { localeMessages: R } = fe(), [I, S] = $(0), N = k(
2795
+ new ResizeObserver((A) => {
2796
+ S(A[0].contentRect.height);
2786
2797
  })
2787
- ), D = F(() => P || f || m || d || l || C || o && (i || c || h || T), [
2798
+ ), D = F(() => P || f || m || d || l || C || o && (i || c || p || T), [
2788
2799
  i,
2789
2800
  c,
2790
- h,
2801
+ p,
2791
2802
  T,
2792
2803
  l,
2793
2804
  d,
@@ -2795,33 +2806,33 @@ const Ie = {
2795
2806
  m,
2796
2807
  P,
2797
2808
  o
2798
- ]), z = F(() => s || p || u || g || y || x || o && (b || v || _ || w), [
2809
+ ]), M = F(() => s || h || u || g || y || x || o && (b || v || w || _), [
2799
2810
  b,
2800
2811
  v,
2801
- _,
2802
2812
  w,
2813
+ _,
2803
2814
  y,
2804
2815
  g,
2805
- p,
2816
+ h,
2806
2817
  u,
2807
2818
  s,
2808
2819
  o
2809
2820
  ]);
2810
- return A(() => (r && E.current.observe(r), () => {
2811
- E.current.disconnect();
2812
- }), [r]), !D || !z ? null : /* @__PURE__ */ H(pe, { children: [
2821
+ return z(() => (r && N.current.observe(r), () => {
2822
+ N.current.disconnect();
2823
+ }), [r]), !D || !M ? null : /* @__PURE__ */ H(he, { children: [
2813
2824
  /* @__PURE__ */ a(
2814
2825
  dn,
2815
2826
  {
2816
2827
  container: n,
2817
2828
  onOpenChange: e,
2818
- triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(ge, { active: t, "aria-label": R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(lr, {}) }) }) }),
2829
+ triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(Q, { content: R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(we, { active: t, "aria-label": R == null ? void 0 : R.moreOptionTooltip, children: /* @__PURE__ */ a(lr, {}) }) }) }),
2819
2830
  side: "bottom",
2820
2831
  avoidCollisions: !1,
2821
2832
  children: /* @__PURE__ */ H(
2822
2833
  "div",
2823
2834
  {
2824
- style: { maxHeight: `${S}px`, overflow: "auto" },
2835
+ style: { maxHeight: `${I}px`, overflow: "auto" },
2825
2836
  className: Ni["rp-other-tool-content"],
2826
2837
  "data-rp": "moreOptionsDropdown",
2827
2838
  children: [
@@ -2847,9 +2858,9 @@ const Ie = {
2847
2858
  ] });
2848
2859
  }, Gi = () => {
2849
2860
  const { isSmallScreen: t } = Oe();
2850
- return /* @__PURE__ */ H(pe, { children: [
2861
+ return /* @__PURE__ */ H(he, { children: [
2851
2862
  /* @__PURE__ */ a(cr, {}),
2852
- !t && /* @__PURE__ */ H(pe, { children: [
2863
+ !t && /* @__PURE__ */ H(he, { children: [
2853
2864
  /* @__PURE__ */ a(pn, {}),
2854
2865
  /* @__PURE__ */ a(Bn, {}),
2855
2866
  /* @__PURE__ */ a(Zn, {}),
@@ -2858,14 +2869,14 @@ const Ie = {
2858
2869
  /* @__PURE__ */ a(qi, {})
2859
2870
  ] });
2860
2871
  }, tn = () => {
2861
- const { totalMatches: t, nextMatch: e, prevMatch: n } = yt(), { localeMessages: r } = he();
2862
- return /* @__PURE__ */ H(pe, { children: [
2872
+ const { totalMatches: t, nextMatch: e, prevMatch: n } = yt(), { localeMessages: r } = fe();
2873
+ return /* @__PURE__ */ H(he, { children: [
2863
2874
  /* @__PURE__ */ a(
2864
2875
  Q,
2865
2876
  {
2866
2877
  content: r == null ? void 0 : r.searchPrevTooltip,
2867
2878
  className: te["rp-search-tool-result-navigator"],
2868
- children: /* @__PURE__ */ a(ge, { tabIndex: 0, onClick: n, "aria-label": r == null ? void 0 : r.searchPrevTooltip, children: /* @__PURE__ */ a(
2879
+ children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: n, "aria-label": r == null ? void 0 : r.searchPrevTooltip, children: /* @__PURE__ */ a(
2869
2880
  Ze,
2870
2881
  {
2871
2882
  className: te["rp-search-tool-input-icon"],
@@ -2879,7 +2890,7 @@ const Ie = {
2879
2890
  {
2880
2891
  content: r == null ? void 0 : r.searchNextTooltip,
2881
2892
  className: te["rp-search-tool-result-navigator"],
2882
- children: /* @__PURE__ */ a(ge, { tabIndex: 0, onClick: e, "aria-label": r == null ? void 0 : r.searchNextTooltip, children: /* @__PURE__ */ a(
2893
+ children: /* @__PURE__ */ a(we, { tabIndex: 0, onClick: e, "aria-label": r == null ? void 0 : r.searchNextTooltip, children: /* @__PURE__ */ a(
2883
2894
  Ze,
2884
2895
  {
2885
2896
  style: { transform: "rotate(180deg" },
@@ -2891,93 +2902,93 @@ const Ie = {
2891
2902
  )
2892
2903
  ] });
2893
2904
  }, Ui = () => {
2894
- const { searchIcon: t } = Ce(), { searchIcon: e } = be();
2905
+ const { searchIcon: t } = Pe(), { searchIcon: e } = Te();
2895
2906
  return t || e || /* @__PURE__ */ a(gn, {});
2896
2907
  }, Vi = ({ icon: t }) => {
2897
- const { container: e } = _e(), [n, r] = q(!1), { pdf: o } = oe(), [i, c] = q(null), {
2908
+ const { container: e } = be(), [n, r] = $(!1), { pdf: o } = oe(), [i, c] = $(null), {
2898
2909
  searchOptions: l,
2899
2910
  setSearchOptions: d,
2900
2911
  loading: f,
2901
2912
  setSearch: m,
2902
2913
  totalMatches: P,
2903
- currentMatchPosition: h,
2914
+ currentMatchPosition: p,
2904
2915
  nextMatch: T,
2905
2916
  prevMatch: C,
2906
2917
  search: b
2907
- } = yt(), { searchTool: v = !0 } = Te(), { searchTool: y = !0 } = Ne(), [g, p] = q(b), { localeMessages: u } = he(), { isSmallScreen: s } = Oe(), [_, w] = q(null), [x, R] = q(!1), S = N(() => {
2918
+ } = yt(), { searchTool: v = !0 } = Ce(), { searchTool: y = !0 } = Ne(), [g, h] = $(b), { localeMessages: u } = fe(), { isSmallScreen: s } = Oe(), [w, _] = $(null), [x, R] = $(!1), I = O(() => {
2908
2919
  r(!0);
2909
- }, []), I = N(() => {
2910
- m(""), p(""), r(!1);
2911
- }, [m]), E = (G) => {
2912
- const K = G.key === "Enter", Y = G.key === " ";
2913
- (K || Y) && I();
2914
- }, D = N(
2920
+ }, []), S = O(() => {
2921
+ m(""), h(""), r(!1);
2922
+ }, [m]), N = (G) => {
2923
+ const Z = G.key === "Enter", Y = G.key === " ";
2924
+ (Z || Y) && S();
2925
+ }, D = O(
2915
2926
  (G) => {
2916
- G.key === "Escape" && n && I();
2927
+ G.key === "Escape" && n && S();
2917
2928
  },
2918
2929
  [n]
2919
- ), z = N(
2930
+ ), M = O(
2920
2931
  (G) => {
2921
2932
  G.shiftKey && G.key === "Enter" ? C() : G.key === "Enter" && b !== g ? m(g) : G.key === "Enter" && T();
2922
2933
  },
2923
2934
  [g, C, T, m, b]
2924
2935
  );
2925
- A(() => {
2926
- p(b);
2927
- }, [b]), A(() => {
2936
+ z(() => {
2937
+ h(b);
2938
+ }, [b]), z(() => {
2928
2939
  b && o && R(!0);
2929
- }, [b, o]), A(() => {
2930
- b && b.trim() !== "" && (p(b), m(b));
2931
- }, []), A(() => (window.addEventListener("keydown", D), () => {
2940
+ }, [b, o]), z(() => {
2941
+ b && b.trim() !== "" && (h(b), m(b));
2942
+ }, []), z(() => (window.addEventListener("keydown", D), () => {
2932
2943
  window.removeEventListener("keydown", D);
2933
- }), [D]), A(() => {
2944
+ }), [D]), z(() => {
2934
2945
  i && setTimeout(() => {
2935
2946
  i.focus();
2936
2947
  }, 0);
2937
2948
  }, [i]);
2938
- const L = N((G) => {
2939
- p(G.target.value);
2940
- }, []), O = N(() => {
2941
- p(""), m("");
2942
- }, [m]), M = F(() => `${h} / ${P}`, [h, P]), { wholeWords: $, matchCase: k } = F(() => l, [l]), B = N(
2949
+ const A = O((G) => {
2950
+ h(G.target.value);
2951
+ }, []), L = O(() => {
2952
+ h(""), m("");
2953
+ }, [m]), E = F(() => `${p} / ${P}`, [p, P]), { wholeWords: q, matchCase: W } = F(() => l, [l]), U = O(
2943
2954
  (G) => {
2944
- d((K) => ({ ...K, matchCase: G }));
2955
+ d((Z) => ({ ...Z, matchCase: G }));
2945
2956
  },
2946
2957
  [d]
2947
- ), Z = N(
2958
+ ), j = O(
2948
2959
  (G) => {
2949
- d((K) => ({ ...K, wholeWords: G }));
2960
+ d((Z) => ({ ...Z, wholeWords: G }));
2950
2961
  },
2951
2962
  [d]
2952
2963
  );
2953
- A(() => {
2954
- o && x && I();
2955
- }, [o, I]);
2956
- const U = F(() => (_ == null ? void 0 : _.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [_]), ie = N(
2964
+ z(() => {
2965
+ o && x && S();
2966
+ }, [o, S]);
2967
+ const V = F(() => (w == null ? void 0 : w.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [w]), ee = O(
2957
2968
  (G) => {
2958
2969
  if (G.key === "Tab") {
2959
- const K = document.activeElement;
2970
+ const Z = document.activeElement;
2960
2971
  let Y = 0;
2961
- U.forEach((re, ve) => {
2962
- re === K && (Y = ve);
2972
+ V.forEach((J, ue) => {
2973
+ J === Z && (Y = ue);
2963
2974
  });
2964
- let J = Y + 1;
2965
- G.shiftKey && (J = Y - 1);
2966
- const ee = U[J];
2967
- if (ee)
2968
- ee.focus();
2969
- else if (J > U.length - 1) {
2970
- const re = U[0];
2971
- re && re.focus();
2975
+ let re = Y + 1;
2976
+ G.shiftKey && (re = Y - 1);
2977
+ const ae = V[re];
2978
+ if (ae)
2979
+ ae.focus();
2980
+ else if (re > V.length - 1) {
2981
+ const J = V[0];
2982
+ J && J.focus();
2972
2983
  } else {
2973
- const re = U[U.length - 1];
2974
- re && re.focus();
2984
+ const J = V[V.length - 1];
2985
+ J && J.focus();
2975
2986
  }
2976
2987
  }
2977
2988
  },
2978
- [U]
2989
+ [V]
2979
2990
  );
2980
- return !v || !y ? null : /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ a(
2991
+ return !v || !y ? null : /* @__PURE__ */ a(he, { children: /* @__PURE__ */ a(
2981
2992
  dn,
2982
2993
  {
2983
2994
  open: n,
@@ -2987,10 +2998,10 @@ const Ie = {
2987
2998
  tabIndex: 0,
2988
2999
  avoidCollisions: !1,
2989
3000
  triggerComponent: /* @__PURE__ */ a(Q, { content: u == null ? void 0 : u.searchButtonTooltip, children: /* @__PURE__ */ a(
2990
- ge,
3001
+ we,
2991
3002
  {
2992
3003
  active: n,
2993
- onClick: S,
3004
+ onClick: I,
2994
3005
  "aria-label": u == null ? void 0 : u.searchButtonTooltip,
2995
3006
  children: t || /* @__PURE__ */ a(Ui, {})
2996
3007
  }
@@ -2998,10 +3009,10 @@ const Ie = {
2998
3009
  children: /* @__PURE__ */ H(
2999
3010
  "div",
3000
3011
  {
3001
- ref: w,
3012
+ ref: _,
3002
3013
  className: te["rp-search-tool-content"],
3003
3014
  tabIndex: 0,
3004
- onKeyDown: ie,
3015
+ onKeyDown: ee,
3005
3016
  children: [
3006
3017
  /* @__PURE__ */ H("div", { className: te["rp-search-tool-input-wrapper"], children: [
3007
3018
  /* @__PURE__ */ H("div", { className: te["rp-search-tool-input"], children: [
@@ -3009,8 +3020,8 @@ const Ie = {
3009
3020
  an,
3010
3021
  {
3011
3022
  value: g,
3012
- onKeyDown: z,
3013
- onChange: L,
3023
+ onKeyDown: M,
3024
+ onChange: A,
3014
3025
  icon: /* @__PURE__ */ a(gn, {}),
3015
3026
  placeholder: u == null ? void 0 : u.searchInputPlaceholder,
3016
3027
  className: te["rp-search-input"],
@@ -3018,11 +3029,11 @@ const Ie = {
3018
3029
  id: "search-input",
3019
3030
  name: "search-input",
3020
3031
  tabIndex: 0,
3021
- children: !!g && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: O, children: /* @__PURE__ */ a(Lr, {}) })
3032
+ children: !!g && /* @__PURE__ */ a("span", { className: te["rp-search-tool-input-clear"], onClick: L, children: /* @__PURE__ */ a(Lr, {}) })
3022
3033
  }
3023
3034
  ) }),
3024
- f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: M }),
3025
- s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress: E, handleClose: I }) })
3035
+ f ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(ln, { className: te["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: E }),
3036
+ s && /* @__PURE__ */ a("div", { className: te["rp-search-tool-controls"], children: /* @__PURE__ */ a(At, { onKeyPress: N, handleClose: S }) })
3026
3037
  ] }),
3027
3038
  /* @__PURE__ */ H("div", { className: te["rp-search-tool-input-checkboxes"], children: [
3028
3039
  s && /* @__PURE__ */ a(tn, {}),
@@ -3031,8 +3042,8 @@ const Ie = {
3031
3042
  {
3032
3043
  tabIndex: 0,
3033
3044
  name: "matchCase",
3034
- value: k,
3035
- onChange: B,
3045
+ value: W,
3046
+ onChange: U,
3036
3047
  children: u == null ? void 0 : u.searchMatchCaseLabel
3037
3048
  }
3038
3049
  ),
@@ -3042,8 +3053,8 @@ const Ie = {
3042
3053
  {
3043
3054
  tabIndex: 0,
3044
3055
  name: "wholeWord",
3045
- value: $,
3046
- onChange: Z,
3056
+ value: q,
3057
+ onChange: j,
3047
3058
  children: u == null ? void 0 : u.searchWholeWordsLabel
3048
3059
  }
3049
3060
  ),
@@ -3052,7 +3063,7 @@ const Ie = {
3052
3063
  ] }),
3053
3064
  !s && /* @__PURE__ */ H("div", { className: te["rp-search-tool-controls"], children: [
3054
3065
  /* @__PURE__ */ a(tn, {}),
3055
- /* @__PURE__ */ a(At, { onKeyPress: E, handleClose: I })
3066
+ /* @__PURE__ */ a(At, { onKeyPress: N, handleClose: S })
3056
3067
  ] })
3057
3068
  ]
3058
3069
  }
@@ -3068,23 +3079,23 @@ const Ie = {
3068
3079
  "rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
3069
3080
  loading: Bi
3070
3081
  }, ji = ({ percentage: t }) => {
3071
- const { cancel: e } = tt(), { localeMessages: n } = he();
3072
- return t < 1 ? null : /* @__PURE__ */ a("div", { className: se(Ae["rp-loading-overlay"]), children: /* @__PURE__ */ H("div", { className: se(Ae["rp-loading-modal"]), children: [
3073
- /* @__PURE__ */ H("div", { className: se(Ae["rp-loading-title"]), children: [
3082
+ const { cancel: e } = tt(), { localeMessages: n } = fe();
3083
+ return t < 1 ? null : /* @__PURE__ */ a("div", { className: ce(Ae["rp-loading-overlay"]), children: /* @__PURE__ */ H("div", { className: ce(Ae["rp-loading-modal"]), children: [
3084
+ /* @__PURE__ */ H("div", { className: ce(Ae["rp-loading-title"]), children: [
3074
3085
  n == null ? void 0 : n.printLoadingMessage,
3075
3086
  "..."
3076
3087
  ] }),
3077
- /* @__PURE__ */ a("div", { className: se(Ae["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
3088
+ /* @__PURE__ */ a("div", { className: ce(Ae["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
3078
3089
  "div",
3079
3090
  {
3080
- className: se(Ae["rp-loading-progress"]),
3091
+ className: ce(Ae["rp-loading-progress"]),
3081
3092
  style: { width: `${t}%` }
3082
3093
  }
3083
3094
  ) }),
3084
- /* @__PURE__ */ a("button", { className: se(Ae["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
3095
+ /* @__PURE__ */ a("button", { className: ce(Ae["rp-loading-cancel-button"]), onClick: e, children: n == null ? void 0 : n.printCancelLabel })
3085
3096
  ] }) });
3086
3097
  }, Ki = et((t, e) => {
3087
- const { showPrintProgress: n = !0 } = Te(), { showPrintProgress: r = !0 } = Ne(), { progress: o } = tt(), { isSmallScreen: i } = Oe(), { percentage: c } = o || {}, l = () => i ? { gridTemplateColumns: "25% 60% 15%" } : void 0, d = () => {
3098
+ const { showPrintProgress: n = !0 } = Ce(), { showPrintProgress: r = !0 } = Ne(), { progress: o } = tt(), { isSmallScreen: i } = Oe(), { percentage: c } = o || {}, l = () => i ? { gridTemplateColumns: "25% 60% 15%" } : void 0, d = () => {
3088
3099
  if (!(!n || !r || !c))
3089
3100
  return /* @__PURE__ */ a(ji, { percentage: c });
3090
3101
  };
@@ -3110,26 +3121,26 @@ const Ie = {
3110
3121
  "rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
3111
3122
  "rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
3112
3123
  }, Zi = (t) => {
3113
- const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = le(), { pageRotate: i } = Je(), c = W(null), l = yn(), { pages: d } = oe(), [f, m] = q(null), P = W(!1), h = W(), T = F(() => n ? We["rp-thumbnail-active"] : "", [n]), C = F(() => ({
3124
+ const { pageNumber: e, isFocused: n, viewport: r } = t, { goToPage: o } = de(), { pageRotate: i } = Je(), c = k(null), l = yn(), { pages: d } = oe(), [f, m] = $(null), P = k(!1), p = k(), T = F(() => n ? We["rp-thumbnail-active"] : "", [n]), C = F(() => ({
3114
3125
  width: Math.round(r.width),
3115
3126
  height: Math.round(r.height)
3116
- }), [r]), b = N(() => {
3127
+ }), [r]), b = O(() => {
3117
3128
  e && o(e);
3118
3129
  }, [o, e]);
3119
- return A(() => {
3130
+ return z(() => {
3120
3131
  const v = d.get(e);
3121
- h.current === v || (m(null), h.current = v);
3122
- }, [d, e]), A(() => {
3132
+ p.current === v || (m(null), p.current = v);
3133
+ }, [d, e]), z(() => {
3123
3134
  const v = d.get(e);
3124
3135
  if (!c.current || !e || !v || f)
3125
3136
  return;
3126
3137
  const y = new IntersectionObserver((g) => {
3127
- g.forEach((p) => {
3138
+ g.forEach((h) => {
3128
3139
  if (P.current) {
3129
3140
  P.current = !1, l.removeQueue(`thumbnail-${e}`);
3130
3141
  return;
3131
3142
  }
3132
- if (p.isIntersecting) {
3143
+ if (h.isIntersecting) {
3133
3144
  const u = document.createElement("canvas");
3134
3145
  P.current = !0, l.enqueue(
3135
3146
  `thumbnail-${e}`,
@@ -3143,8 +3154,8 @@ const Ie = {
3143
3154
  u.toBlob((s) => {
3144
3155
  if (!s)
3145
3156
  return;
3146
- const _ = URL.createObjectURL(s);
3147
- m(_);
3157
+ const w = URL.createObjectURL(s);
3158
+ m(w);
3148
3159
  });
3149
3160
  }
3150
3161
  },
@@ -3170,7 +3181,7 @@ const Ie = {
3170
3181
  style: {
3171
3182
  transform: `rotate(${i[e || 0]}deg)`
3172
3183
  },
3173
- className: se(T, We["rp-thumbnail"]),
3184
+ className: ce(T, We["rp-thumbnail"]),
3174
3185
  children: f ? /* @__PURE__ */ a(
3175
3186
  "img",
3176
3187
  {
@@ -3203,15 +3214,15 @@ const Ie = {
3203
3214
  const n = t == null ? void 0 : t.querySelector(`#page-${e}`);
3204
3215
  t && (n != null && n.offsetTop) && (t.scrollTop = (n == null ? void 0 : n.offsetTop) - Xi);
3205
3216
  }, Yi = et((t, e) => {
3206
- const { show: n, width: r } = t, { focusedPage: o, totalPages: i } = le(), { thumbnailPages: c, addPage: l, thumbnailLength: d, addToPage: f } = Tn(), m = W(null), P = W(1);
3217
+ const { show: n, width: r } = t, { focusedPage: o, totalPages: i } = de(), { thumbnailPages: c, addPage: l, thumbnailLength: d, addToPage: f } = Tn(), m = k(null), P = k(1);
3207
3218
  on(e, () => m.current);
3208
- const h = F(() => Object.values(c), [c]), T = N(() => {
3219
+ const p = F(() => Object.values(c), [c]), T = O(() => {
3209
3220
  const C = d + 1;
3210
3221
  C <= i && l(C);
3211
3222
  }, [l, i, d]);
3212
- return A(() => {
3223
+ return z(() => {
3213
3224
  o > d && i > d ? f(o) : n && P.current !== o && (Qi(m.current, o), P.current = o);
3214
- }, [o, d, f, n, h]), Mo(m.current, T), /* @__PURE__ */ a("div", { ref: m, className: nn["rp-thumbnails-container"], style: { width: r }, children: /* @__PURE__ */ a("div", { className: nn["rp-thumbnails"], children: n ? h.map((C, b) => {
3225
+ }, [o, d, f, n, p]), Mo(m.current, T), /* @__PURE__ */ a("div", { ref: m, className: nn["rp-thumbnails-container"], style: { width: r }, children: /* @__PURE__ */ a("div", { className: nn["rp-thumbnails"], children: n ? p.map((C, b) => {
3215
3226
  var v, y;
3216
3227
  return /* @__PURE__ */ a(
3217
3228
  Zi,
@@ -3226,13 +3237,13 @@ const Ie = {
3226
3237
  );
3227
3238
  }) : null }) });
3228
3239
  }), Ji = () => {
3229
- const { thumbnailIcon: t } = Ce(), { thumbnailIcon: e } = be();
3240
+ const { thumbnailIcon: t } = Pe(), { thumbnailIcon: e } = Te();
3230
3241
  return t || e || /* @__PURE__ */ a(xo, {});
3231
3242
  }, ea = () => {
3232
- const { active: t, setActive: e } = Tn(), [n, r] = q(Fo), o = W(null), i = W(null), { thumbnailTool: c, sidebarEnable: l } = Te(), { localeMessages: d } = he(), f = N(() => {
3243
+ const { active: t, setActive: e } = Tn(), [n, r] = $(Fo), o = k(null), i = k(null), { thumbnailTool: c, sidebarEnable: l } = Ce(), { localeMessages: d } = fe(), f = O(() => {
3233
3244
  e((P) => !P);
3234
3245
  }, []), m = F(() => typeof c != "boolean" && c ? /* @__PURE__ */ a(c, { onClick: f, active: t }) : c ? /* @__PURE__ */ a(Q, { content: d == null ? void 0 : d.thumbnailTooltip, children: /* @__PURE__ */ a(
3235
- ge,
3246
+ we,
3236
3247
  {
3237
3248
  onClick: f,
3238
3249
  active: t,
@@ -3240,7 +3251,7 @@ const Ie = {
3240
3251
  children: /* @__PURE__ */ a(Ji, {})
3241
3252
  }
3242
3253
  ) }) : null, [c, t, f, d]);
3243
- return /* @__PURE__ */ a(pe, { children: l && /* @__PURE__ */ H(
3254
+ return /* @__PURE__ */ a(he, { children: l && /* @__PURE__ */ H(
3244
3255
  "div",
3245
3256
  {
3246
3257
  style: { "--rp-thumbnail-width": `${n}px` },
@@ -3281,22 +3292,22 @@ const Ie = {
3281
3292
  onLoaded: d,
3282
3293
  cleanupOnLoaded: f,
3283
3294
  onLayoutWidthChange: m
3284
- } = t, [P, h] = q(null), { setContainer: T, setContentRef: C } = _e(), { loading: b } = oe(), { LoaderImageComponent: v } = _t();
3285
- return A(() => (d && d(), () => {
3295
+ } = t, [P, p] = $(null), { setContainer: T, setContentRef: C } = be(), { loading: b } = oe(), { LoaderImageComponent: v } = _t();
3296
+ return z(() => (d && d(), () => {
3286
3297
  f && f();
3287
3298
  }), [d, f]), // TODO: deprecated in v2.0.0, remove later ~
3288
3299
  /* @__PURE__ */ a(Rn, { toolbarRef: P, ref: e, children: /* @__PURE__ */ a(Io, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ a(Ro, { slots: r, children: /* @__PURE__ */ a(Ao, { icons: o, children: /* @__PURE__ */ H(So, { getContainerRef: T, style: i, className: c, children: [
3289
3300
  /* @__PURE__ */ H(Eo, { children: [
3290
- /* @__PURE__ */ H("div", { className: we["rp-layout"], children: [
3301
+ /* @__PURE__ */ H("div", { className: _e["rp-layout"], children: [
3291
3302
  /* @__PURE__ */ a(
3292
3303
  Ki,
3293
3304
  {
3294
- ref: h
3305
+ ref: p
3295
3306
  }
3296
3307
  ),
3297
- /* @__PURE__ */ H("div", { className: we["rp-content"], children: [
3298
- /* @__PURE__ */ a("div", { className: we["rp-sidebar"], children: /* @__PURE__ */ a(ea, {}) }),
3299
- /* @__PURE__ */ a("div", { ref: C, className: we["rp-pages"], children: n })
3308
+ /* @__PURE__ */ H("div", { className: _e["rp-content"], children: [
3309
+ /* @__PURE__ */ a("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ a(ea, {}) }),
3310
+ /* @__PURE__ */ a("div", { ref: C, className: _e["rp-pages"], children: n })
3300
3311
  ] })
3301
3312
  ] }),
3302
3313
  /* @__PURE__ */ a(Do, {})
@@ -3304,7 +3315,7 @@ const Ie = {
3304
3315
  b ? /* @__PURE__ */ a(
3305
3316
  "div",
3306
3317
  {
3307
- className: we["rp-loader"],
3318
+ className: _e["rp-loader"],
3308
3319
  style: {
3309
3320
  position: "absolute",
3310
3321
  top: 0,
@@ -3385,7 +3396,7 @@ export {
3385
3396
  vn as r,
3386
3397
  Er as s,
3387
3398
  wn as t,
3388
- le as u,
3399
+ de as u,
3389
3400
  Nr as v,
3390
3401
  _n as w,
3391
3402
  Or as x,