@pdf-viewer/react 1.5.0-beta.3 → 1.5.0-beta.5

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 (64) hide show
  1. package/dist/Popover-b7402893.js +1445 -0
  2. package/dist/RPDefaultLayout-6f52691a.js +2959 -0
  3. package/dist/component-1da194e8.js +337 -0
  4. package/dist/components/RPController.js +21 -28
  5. package/dist/components/RPPages.js +2 -3
  6. package/dist/components/RPProvider.js +1 -1
  7. package/dist/components/layout/LayoutContainer.js +2 -3
  8. package/dist/components/layout/RPDefaultLayout.js +1 -1
  9. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  11. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  12. package/dist/components/layout/toolbar/DocumentDialog.js +2 -3
  13. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  14. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  15. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  16. package/dist/components/layout/toolbar/MostPageTool.js +3 -4
  17. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  18. package/dist/components/layout/toolbar/Paginate.js +1 -1
  19. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  20. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  22. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  23. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/SearchTool.js +3 -4
  25. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ZoomTool.js +3 -4
  28. package/dist/components/page/AnnotationLayer.js +2 -3
  29. package/dist/components/page/CanvasLayer.js +2 -3
  30. package/dist/components/page/DualPage.js +2 -3
  31. package/dist/components/page/RPPage.js +2 -3
  32. package/dist/components/page/SinglePage.js +2 -3
  33. package/dist/components/page/TextHighlightLayer.js +2 -3
  34. package/dist/components/page/TextLayer.js +2 -3
  35. package/dist/components/ui/Checkbox.js +1 -1
  36. package/dist/components/ui/DropDown.js +1 -1
  37. package/dist/components/ui/LoadingIndicator.js +1 -1
  38. package/dist/components/ui/Popover.js +1 -1
  39. package/dist/components/ui/RPTooltip.js +47 -46
  40. package/dist/contexts/PaginationContext.js +1 -1
  41. package/dist/contexts/PrintContext.js +1 -1
  42. package/dist/contexts/SearchContext.js +1 -1
  43. package/dist/contexts/ThumbnailsContext.js +1 -1
  44. package/dist/floating-ui.react-dom-15b9b819.js +1310 -0
  45. package/dist/{index-48ca3f30.js → index-1cb41342.js} +9 -9
  46. package/dist/index-7279fb4e.js +1557 -0
  47. package/dist/index-aa2d3884.js +140 -0
  48. package/dist/main.js +1 -1
  49. package/dist/utils/hooks/useFileDownload.js +2 -3
  50. package/dist/utils/hooks/useLicense.js +1 -1
  51. package/dist/utils/hooks/usePaginate.js +2 -3
  52. package/dist/utils/hooks/usePresentPage.js +2 -3
  53. package/dist/utils/hooks/usePrint.js +2 -3
  54. package/dist/utils/hooks/useScrollToPage.js +2 -3
  55. package/dist/utils/hooks/useSearch.js +2 -3
  56. package/dist/utils/hooks/useThumbnail.js +2 -3
  57. package/dist/utils/hooks/useVirtualReactWindow.js +2 -3
  58. package/package.json +1 -1
  59. package/dist/Popover-d11ec15c.js +0 -3061
  60. package/dist/RPDefaultLayout-ffbfe65f.js +0 -2968
  61. package/dist/contexts/ScrollStateContext.js +0 -13
  62. package/dist/floating-ui.react-dom-88a86594.js +0 -1447
  63. package/dist/index-4ba3ab9a.js +0 -1877
  64. package/dist/types/contexts/ScrollStateContext.d.ts +0 -8
@@ -0,0 +1,2959 @@
1
+ import { jsx as a, Fragment as xe, jsxs as D } from "react/jsx-runtime";
2
+ import * as U from "react";
3
+ import { useRef as W, useEffect as A, useCallback as L, useState as $, createContext as je, useContext as Be, useMemo as F, forwardRef as We, useImperativeHandle as sn, createElement as He, PureComponent as er, Component as tr, memo as nr } from "react";
4
+ import { ChevronUpIcon as ke } from "./components/icons/ChevronUpIcon.js";
5
+ import { UIButton as ee } from "./components/ui/Button.js";
6
+ import { UIInput as cn } from "./components/ui/Input.js";
7
+ import { useScrollModeContext as Ee } from "./contexts/ScrollModeContext.js";
8
+ import { useDocumentContext as K } from "./contexts/RPDocumentContext.js";
9
+ import { useDarkModeContext as rr } from "./contexts/DarkModeContext.js";
10
+ import { ViewMode as Ue, ScrollMode as X, AnnotationSubType as At, SelectionMode as or, ZoomLevel as ot } from "./utils/types.js";
11
+ import { useRotationContext as Ke } from "./contexts/RotationContext.js";
12
+ import { useLayerContext as ir } from "./contexts/LayerContext.js";
13
+ import { useZoomContext as Xe } from "./contexts/ZoomContext.js";
14
+ import { useViewModeContext as Ye } from "./contexts/ViewModeContext.js";
15
+ import { useVirtualScrollContext as Je } from "./contexts/VirtualScrollContext.js";
16
+ import { useVirtualGridContext as ln } from "./contexts/VirtualGridContext.js";
17
+ import { useSelectionModeContext as ar } from "./contexts/SelectionModeContext.js";
18
+ import { useInitialStateContext as sr } from "./contexts/InitialStateContext.js";
19
+ import { useFullScreenContext as cr } from "./contexts/FullScreenContext.js";
20
+ import "./contexts/FileInputContext.js";
21
+ import "./contexts/DropFileZoneContext.js";
22
+ import { renderPage as vt } from "./utils/renderPage.js";
23
+ import { highlightMatches as dn, findMatches as lr, resetDivs as un, highlightMultipleColorMatches as dr } from "./utils/highlight.js";
24
+ import * as Ct from "pdfjs-dist";
25
+ import { PixelsPerInch as ur, AnnotationMode as pr, RenderingCancelledException as hr, AnnotationLayer as mr } from "pdfjs-dist";
26
+ import { useLayoutContainer as be } from "./contexts/LayoutContainerContext.js";
27
+ import { useDimensionPagesContext as Qe } from "./contexts/DimensionPagesContext.js";
28
+ import { useLocalizationContext as ue } from "./contexts/LocalizationContext.js";
29
+ import { useHighlightContext as fr } from "./contexts/HighlightContext.js";
30
+ import { useDownloadContext as gr } from "./contexts/DownloadContext.js";
31
+ import { useSmoothScrollContext as Tt } from "./contexts/SmoothScrollContext.js";
32
+ import { useLoaderContext as pn } from "./contexts/LoaderContext.js";
33
+ import "./contexts/LicenseContext.js";
34
+ import "./components/RPConfig.js";
35
+ import { ThumbnailIcon as vr } from "./components/icons/Thumbnail.js";
36
+ import { c as re } from "./clsx-0c6e471a.js";
37
+ import { LoaderIcon as Pt } from "./components/icons/LoaderIcon.js";
38
+ import { useInfiniteScroll as _r } from "./utils/hooks/useInfiniteScroll.js";
39
+ import { RPSplitter as wr } from "./components/layout/sidebar/RPSplitter.js";
40
+ import { useToolbarComponentContext as ge, ToolbarComponentProvider as br } from "./contexts/ToolbarComponentContext.js";
41
+ import { useIconContext as pe, IconProvider as Cr } from "./contexts/IconContext.js";
42
+ import q from "./components/ui/RPTooltip.js";
43
+ import { Container as Tr } from "./components/layout/Container.js";
44
+ import { WrapperLayout as Pr } from "./components/layout/WrapperLayout.js";
45
+ import { RPDropFileZone as Sr } from "./components/RPDropFileZone.js";
46
+ import { useViewportContext as ye, ViewportProvider as xr } from "./contexts/ViewportContext.js";
47
+ import { useThemeContext as Ir } from "./contexts/ThemeContext.js";
48
+ import { SimpleLinkService as yr } from "./utils/link_service.js";
49
+ import { annotationsEvents as Lr, annotationEventsHandler as Rr, handleClick as Ft, handleAnnotationWidget as Nr, handleAnnotationLink as Er, bindLayerEvents as Or, unbindLayerEvents as kt } from "./utils/annotations.js";
50
+ import { _ as Dr, U as zr } from "./Popover-b7402893.js";
51
+ import { useMousePressed as Ar } from "./utils/hooks/useMousePressed.js";
52
+ import { useGrabScroll as Fr } from "./utils/hooks/useGrabScroll.js";
53
+ import { usePinch as kr } from "./utils/hooks/usePinch.js";
54
+ import { useDebounce as St } from "./utils/hooks/useDebounce.js";
55
+ import { getPositionFromPage as Wr, getPageFromPosition as Mr } from "./utils/calculatePage.js";
56
+ import { getThumbnailViewport as Wt } from "./utils/getThumbnailViewport.js";
57
+ import { smoothScrollTo as it } from "./utils/smoothScrollTo.js";
58
+ import { appConsole as Hr } from "./utils/appConsole.js";
59
+ import { FileUploadTool as hn } from "./components/layout/toolbar/FileUploadTool.js";
60
+ import { DarkModeTool as $r } from "./components/layout/toolbar/DarkModeTool.js";
61
+ import { ThreeDotIcon as Gr } from "./components/icons/ThreeDotIcon.js";
62
+ import { UIDropDown as mn } from "./components/ui/DropDown.js";
63
+ import { e as Vr, a as xt, P as Me, c as Fe, g as It, i as Ur, k as qr, f as Zr } from "./index-1cb41342.js";
64
+ import { D as jr, u as at } from "./index-aa2d3884.js";
65
+ import { a as Br, u as Kr, F as Xr, b as Yr, G as qe } from "./index-7279fb4e.js";
66
+ import { h as Jr } from "./component-1da194e8.js";
67
+ import { CloseIcon as fn } from "./components/icons/CloseIcon.js";
68
+ import { dateFormatter as Mt } from "./utils/dateFormatter.js";
69
+ import { PropertyItem as Qr } from "./components/layout/toolbar/PropertyItem.js";
70
+ import { useOtherToolContext as eo, OtherToolProvider as to } from "./contexts/OtherToolContext.js";
71
+ import { DocumentProperties as no } from "./components/layout/toolbar/DocumentProperties.js";
72
+ import { RotateTool as ro } from "./components/layout/toolbar/RotateTool.js";
73
+ import { ScrollModeTool as oo } from "./components/layout/toolbar/ScrollModeTool.js";
74
+ import { MenuSeparator as yt } from "./components/layout/toolbar/MenuSeparator.js";
75
+ import { FileDownloadDefaultIcon as io } from "./components/icons/FileDownloadDefaultIcon.js";
76
+ import { MenuItem as we } from "./components/layout/toolbar/MenuItem.js";
77
+ import { PrintDefaultTool as ao } from "./components/icons/PrintDefaultIcon.js";
78
+ import { FullScreenTool as gn } from "./components/layout/toolbar/FullScreenTool.js";
79
+ import { GoToDownIcon as vn } from "./components/icons/GoToDownIcon.js";
80
+ import { SelectionModeTool as so } from "./components/layout/toolbar/SelectionModeTool.js";
81
+ import { ZoomInIcon as co } from "./components/icons/ZoomInIcon.js";
82
+ import { ZoomOutIcon as lo } from "./components/icons/ZoomOutIcon.js";
83
+ import { PAGE_PADDING as Ht } from "./utils/constants.js";
84
+ import { getZoomLevel as uo } from "./utils/getZoomLevel.js";
85
+ import { SearchIcon as po } from "./components/icons/SearchIcon.js";
86
+ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
87
+ import { ClearIcon as ho } from "./components/icons/ClearIcon.js";
88
+ import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
89
+ import './assets/RPDefaultLayout.css';const _n = () => {
90
+ const { viewMode: e } = Ye(), { scrollMode: t } = Ee(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = Je(), { setFocusedPage: i } = ie(), c = W(), { columnCount: s } = ln(), { widths: l, heights: d } = Qe(), u = W(t), f = W(e), h = W(s), { targetScrollPosition: g, smoothScrolling: b } = Tt();
91
+ A(() => {
92
+ n != null && n.scrollToItem && (c.current = n);
93
+ }, [n]), A(() => {
94
+ u.current = t, f.current = e;
95
+ }, [t, e]);
96
+ const w = L(
97
+ (_, m) => {
98
+ if (!r)
99
+ return;
100
+ const T = Math.ceil(_ / 2) * 2 - 1;
101
+ if (_ === T + 1) {
102
+ const p = {
103
+ left: l[T],
104
+ top: 0
105
+ };
106
+ return g.current = p, new Promise(
107
+ (P) => it(r, p, P)
108
+ );
109
+ }
110
+ const S = {
111
+ left: 0,
112
+ top: 0
113
+ };
114
+ return g.current = S, r == null ? void 0 : r.scrollTo({
115
+ ...S,
116
+ behavior: m
117
+ });
118
+ },
119
+ [r, l, it]
120
+ );
121
+ return A(() => {
122
+ u.current = t, f.current = e;
123
+ }, [t, e]), A(() => {
124
+ h.current = s;
125
+ }, [s]), { scrollToPage: L(
126
+ (_, m = "smooth") => {
127
+ const T = _ - 1;
128
+ let S = T, p = 0;
129
+ if (f.current === Ue.DUAL_PAGE && u.current === X.PAGE_SCROLLING) {
130
+ w(_, m);
131
+ return;
132
+ }
133
+ if (u.current === X.PAGE_SCROLLING) {
134
+ i(_);
135
+ return;
136
+ }
137
+ if (!c.current || !o)
138
+ return;
139
+ const P = o;
140
+ if (b.current = !0, u.current === X.HORIZONTAL_SCROLLING) {
141
+ p = T;
142
+ const I = {
143
+ left: T * (l[T] ?? 0),
144
+ top: 0
145
+ };
146
+ return g.current = I, P.scrollTo({
147
+ ...I,
148
+ behavior: m
149
+ });
150
+ }
151
+ if (f.current === Ue.DUAL_PAGE) {
152
+ p = T % 2, S = Math.floor(T / 2);
153
+ const I = S * (d[S] ?? 0), R = {
154
+ left: p * (l[p] ?? 0),
155
+ top: I
156
+ };
157
+ return g.current = R, P.scrollTo({
158
+ ...R,
159
+ behavior: m
160
+ });
161
+ }
162
+ const x = {
163
+ left: 0,
164
+ top: S * (d[S] ?? 0)
165
+ };
166
+ return g.current = x, P.scrollTo({
167
+ ...x,
168
+ behavior: m
169
+ });
170
+ },
171
+ [
172
+ o,
173
+ s,
174
+ w,
175
+ i,
176
+ it,
177
+ d,
178
+ l
179
+ ]
180
+ ) };
181
+ }, mo = (e = 1) => {
182
+ const [t, n] = $(e), [o, r] = $(0), { scrollToPage: i } = _n(), c = W(1), { viewMode: s } = Ye(), { scrollMode: l } = Ee(), d = St(t, 100), u = L(
183
+ (w) => {
184
+ if (!/^[0-9]*$/g.test(w.toString()) || !w)
185
+ return { success: !1, currentPage: c.current };
186
+ const _ = +w;
187
+ return _ < 0 || _ > o ? { success: !1, currentPage: c.current } : (n(_), c.current = _, { success: !0, currentPage: +w });
188
+ },
189
+ [o]
190
+ ), f = L(u, [u]), h = L(
191
+ (w) => {
192
+ const v = u(w);
193
+ return v.success && i(v.currentPage), v;
194
+ },
195
+ [u, i]
196
+ ), g = L(() => {
197
+ let w = t - 1;
198
+ h(w);
199
+ }, [h, t, s, l]), b = L(() => {
200
+ let w = t + 1;
201
+ h(w);
202
+ }, [h, t, s, l]);
203
+ return {
204
+ focusedPage: d,
205
+ totalPages: o,
206
+ setFocusedPage: f,
207
+ setTotalPages: r,
208
+ nextPage: b,
209
+ prevPage: g,
210
+ goToPage: h
211
+ };
212
+ }, wn = je({
213
+ focusedPage: 0,
214
+ setFocusedPage: (e) => {
215
+ },
216
+ goToPage: (e) => ({ success: !!e, currentPage: +e }),
217
+ totalPages: 0,
218
+ setTotalPages: (e) => {
219
+ },
220
+ prevPage: () => {
221
+ },
222
+ nextPage: () => {
223
+ }
224
+ }), ie = () => {
225
+ const e = Be(wn);
226
+ return typeof (e == null ? void 0 : e.focusedPage) > "u" && Hr.error("Please use this hooks inside children component of RPProvider"), e;
227
+ }, bs = ({ children: e }) => {
228
+ const { pdf: t } = K(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: i, goToPage: c, nextPage: s, prevPage: l } = mo();
229
+ return A(() => {
230
+ t != null && t.numPages && (i(t.numPages), r(1));
231
+ }, [t, i, r]), /* @__PURE__ */ a(
232
+ wn.Provider,
233
+ {
234
+ value: {
235
+ focusedPage: n,
236
+ totalPages: o,
237
+ setFocusedPage: r,
238
+ setTotalPages: i,
239
+ nextPage: s,
240
+ prevPage: l,
241
+ goToPage: c
242
+ },
243
+ children: e
244
+ }
245
+ );
246
+ };
247
+ const fo = () => {
248
+ const { pdf: e, pages: t } = K(), [n, o] = $({
249
+ loadedPages: 0,
250
+ totalPages: 0,
251
+ percentage: 0
252
+ }), [r, i] = $(!1), [c, s] = $(!1), [l, d] = $(null), u = W(!1);
253
+ A(() => {
254
+ u.current;
255
+ }, [u]);
256
+ const f = L(() => {
257
+ document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
258
+ const T = document.querySelector(".rp-print-zone");
259
+ T && T.remove();
260
+ }, []), h = L(() => {
261
+ u.current = !1, i(!1), s(!1), d(null), o({
262
+ loadedPages: 0,
263
+ totalPages: 0,
264
+ percentage: 0
265
+ });
266
+ }, []), g = () => {
267
+ u.current = !0;
268
+ }, b = async ({
269
+ scratchCanvas: T,
270
+ pdfDocument: S,
271
+ pageNumber: p,
272
+ viewerPdfPage: P,
273
+ printResolution: C,
274
+ optionalContentConfigPromise: x,
275
+ printAnnotationStoragePromise: E
276
+ }) => {
277
+ if (u.current) {
278
+ h();
279
+ return;
280
+ }
281
+ const I = C / ur.PDF;
282
+ T.width = Math.floor(P.width * I), T.height = Math.floor(P.height * I);
283
+ const O = T.getContext("2d");
284
+ O.save(), O.fillStyle = "rgb(255, 255, 255)", O.fillRect(0, 0, T.width, T.height), O.restore();
285
+ const [R, k] = await Promise.all([
286
+ S.getPage(p),
287
+ E
288
+ ]);
289
+ if (u.current) {
290
+ h();
291
+ return;
292
+ }
293
+ const z = {
294
+ canvasContext: O,
295
+ transform: [I, 0, 0, I, 0, 0],
296
+ viewport: R.getViewport({ scale: 1, rotation: P.rotation }),
297
+ intent: "print",
298
+ annotationMode: pr.ENABLE_STORAGE,
299
+ optionalContentConfigPromise: x,
300
+ printAnnotationStorage: k
301
+ };
302
+ try {
303
+ return R.render(z).promise;
304
+ } catch (y) {
305
+ throw y instanceof hr || console.error(y), y;
306
+ }
307
+ }, w = L(() => {
308
+ const T = window.print;
309
+ return new Promise((S) => {
310
+ const p = (x) => {
311
+ setTimeout(() => {
312
+ T.call(window), setTimeout(() => x(), 20);
313
+ }, 0);
314
+ };
315
+ if (document.querySelector(".rp-print-zone")) {
316
+ p(S);
317
+ return;
318
+ }
319
+ const C = new MutationObserver(() => {
320
+ document.querySelector(".rp-print-zone") && (p(S), C.disconnect());
321
+ });
322
+ C.observe(document.body, { childList: !0, subtree: !0 });
323
+ });
324
+ }, []), v = async (T) => {
325
+ const S = document.createElement("img"), p = document.createElement("div");
326
+ return p.classList.add("rp-print-page"), await new Promise((P, C) => {
327
+ T.toBlob((x) => {
328
+ x ? (S.src = URL.createObjectURL(x), S.onload = () => {
329
+ URL.revokeObjectURL(S.src), P();
330
+ }, S.onerror = C) : C(new Error("Failed to create blob"));
331
+ });
332
+ }).catch(() => {
333
+ }), p.appendChild(S), p;
334
+ }, _ = (T, S) => {
335
+ const p = document.createElement("div");
336
+ p.classList.add("rp-print-zone");
337
+ const P = document.createElement("style"), C = S.get(1);
338
+ if (C) {
339
+ const { width: x, height: E } = C == null ? void 0 : C.page.getViewport({ scale: 1 });
340
+ P.innerHTML = `@page { size: ${x}px ${E}px }`;
341
+ }
342
+ return p.appendChild(P), p.append(...T), p;
343
+ }, m = L(async () => {
344
+ if (!e)
345
+ return;
346
+ h();
347
+ const T = document.createElement("canvas"), S = [];
348
+ try {
349
+ e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
350
+ const P = e.getOptionalContentConfig({ intent: "print" }), C = Promise.resolve(
351
+ e.annotationStorage.print ?? void 0
352
+ ), x = t.size;
353
+ for (const [I, O] of t) {
354
+ if (u.current) {
355
+ h();
356
+ return;
357
+ }
358
+ const R = O.page.getViewport({ scale: 1 });
359
+ if (await b({
360
+ scratchCanvas: T,
361
+ pdfDocument: e,
362
+ pageNumber: I,
363
+ viewerPdfPage: R,
364
+ printResolution: 150,
365
+ optionalContentConfigPromise: P,
366
+ printAnnotationStoragePromise: C
367
+ }), u.current) {
368
+ h();
369
+ return;
370
+ }
371
+ const k = await v(T);
372
+ S.push(k);
373
+ const z = parseFloat((S.length / x * 100).toFixed(2));
374
+ o({
375
+ loadedPages: I,
376
+ totalPages: x,
377
+ percentage: z
378
+ });
379
+ }
380
+ if (u.current) {
381
+ h();
382
+ return;
383
+ }
384
+ const E = _(S, t);
385
+ document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), i(!0), await w();
386
+ } catch (p) {
387
+ s(!0), p instanceof Error && d(p);
388
+ } finally {
389
+ T.height = 0, T.width = 0;
390
+ }
391
+ }, [e, t, u]);
392
+ return A(() => {
393
+ const T = () => {
394
+ h(), f();
395
+ };
396
+ return window.addEventListener("afterprint", T, !0), () => {
397
+ window.removeEventListener("afterprint", T, !0);
398
+ };
399
+ }, [f, h]), {
400
+ print: m,
401
+ cancel: g,
402
+ progress: n,
403
+ isComplete: r,
404
+ isError: c,
405
+ error: l
406
+ };
407
+ }, bn = je({
408
+ print: () => {
409
+ },
410
+ cancel: () => {
411
+ },
412
+ setOnProgress: (e) => {
413
+ },
414
+ progress: {},
415
+ setOnComplete: (e) => e(),
416
+ setOnError: (e) => {
417
+ try {
418
+ const t = new Error("Print error occurred");
419
+ e(t);
420
+ } catch (t) {
421
+ console.error("Error in setOnError callback:", t);
422
+ }
423
+ }
424
+ }), Cs = ({ children: e }) => {
425
+ const [t, n] = $(null), [o, r] = $(null), { print: i, cancel: c, progress: s, isComplete: l, isError: d, error: u } = fo(), f = L((v) => {
426
+ v && typeof v == "function" && r(() => v);
427
+ }, []), h = (v) => {
428
+ u && v(u);
429
+ }, g = L(
430
+ (v) => {
431
+ n(() => v);
432
+ },
433
+ [s, t]
434
+ );
435
+ A(() => {
436
+ l && o && b();
437
+ }, [l, o]), A(() => {
438
+ d && h((v) => {
439
+ console.error(v);
440
+ });
441
+ }, [d]), A(() => {
442
+ s && t && t(s);
443
+ }, [s, t]);
444
+ const b = () => {
445
+ o && (o(), r(null));
446
+ }, w = {
447
+ print: i,
448
+ cancel: c,
449
+ setOnProgress: g,
450
+ setOnComplete: f,
451
+ setOnError: h,
452
+ progress: s
453
+ };
454
+ return /* @__PURE__ */ a(bn.Provider, { value: w, children: e });
455
+ }, et = () => {
456
+ const e = Be(bn);
457
+ if (!e)
458
+ throw new Error("usePrintContext must be used within a PrintProvider");
459
+ return e;
460
+ }, go = () => {
461
+ const [e, t] = $({}), { pages: n } = K(), { rotate: o } = Ke(), r = F(() => Object.keys(e).length, [e]), i = L(
462
+ (s) => {
463
+ if (!n.size || s > n.size)
464
+ return;
465
+ const l = Array.from(n.values()).slice(0, s).map((f) => {
466
+ const { thumbnailViewport: h, scale: g } = Wt(f.page, o);
467
+ return {
468
+ scale: g,
469
+ page: f.page,
470
+ loading: !0,
471
+ viewport: h
472
+ };
473
+ }), d = l.reduce((f, h) => (f[h.page.pageNumber] = h, f), {});
474
+ t(d);
475
+ const u = [];
476
+ for (const f of l) {
477
+ const h = document.createElement("canvas"), g = vt(f.page, h, {
478
+ scale: f.scale,
479
+ rotate: o
480
+ }).promise.then(() => {
481
+ const b = h.toDataURL();
482
+ return {
483
+ ...f,
484
+ thumbnailSrc: b,
485
+ loading: !1
486
+ };
487
+ });
488
+ u.push(g);
489
+ }
490
+ Promise.all(u).then((f) => {
491
+ const h = f.reduce(
492
+ (g, b) => (g[b.page.pageNumber] = b, g),
493
+ {}
494
+ );
495
+ t((g) => ({ ...g, ...h }));
496
+ }).catch(() => {
497
+ });
498
+ },
499
+ [n, o]
500
+ );
501
+ A(() => {
502
+ i(10);
503
+ }, [i]);
504
+ const c = L(
505
+ (s) => {
506
+ if (!n)
507
+ return;
508
+ const l = n.get(s);
509
+ if (!l)
510
+ return;
511
+ t((u) => ({
512
+ ...u,
513
+ [s]: {
514
+ loading: !0,
515
+ page: l.page,
516
+ viewport: l.thumbnailViewport,
517
+ scale: l.thumbnailScale
518
+ }
519
+ }));
520
+ const d = document.createElement("canvas");
521
+ vt(l.page, d, { scale: l.thumbnailScale, rotate: o }).promise.then(() => {
522
+ const u = d.toDataURL(), { thumbnailViewport: f, scale: h } = Wt(l.page, o);
523
+ return {
524
+ scale: h,
525
+ thumbnailSrc: u,
526
+ page: l.page,
527
+ loading: !1,
528
+ viewport: f
529
+ };
530
+ }).then((u) => {
531
+ t((f) => ({ ...f, [s]: u }));
532
+ });
533
+ },
534
+ [n, o]
535
+ );
536
+ return { thumbnailPages: e, addPage: c, addToPage: i, thumbnailLength: r };
537
+ }, Cn = je({
538
+ thumbnailPages: {},
539
+ addPage: (e) => {
540
+ },
541
+ addToPage: (e) => {
542
+ },
543
+ thumbnailLength: 0,
544
+ setActive: (e) => {
545
+ },
546
+ active: !1
547
+ }), Tn = () => Be(Cn), Ts = ({
548
+ children: e,
549
+ initialThumbnailsVisible: t
550
+ }) => {
551
+ const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i } = go(), [c, s] = $(t);
552
+ return /* @__PURE__ */ a(
553
+ Cn.Provider,
554
+ {
555
+ value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: i, active: c, setActive: s },
556
+ children: e
557
+ }
558
+ );
559
+ }, vo = (e = {}, t = "") => {
560
+ const [n, o] = $(t), [r, i] = $(!1), { pdf: c, pages: s } = K(), l = Qe(), d = W(!n), { currentZoom: u } = Xe(), [f, h] = $([]), { setFocusedPage: g } = ie(), [b, w] = $(0), { pageScrollElementRef: v, virtualScrollableElementRef: _ } = Je(), { scrollMode: m } = Ee(), { pagesRef: T } = be(), [S, p] = $(null), P = W({}), C = F(() => b === 0 ? null : f[b - 1], [b, f]), x = F(() => f.length, [f]);
561
+ A(() => {
562
+ if (!C || !s)
563
+ return;
564
+ const R = _ || v;
565
+ if (!R || !T)
566
+ return;
567
+ const k = s.get(C.page), z = T.clientHeight / 2, y = T.clientWidth / 2;
568
+ let N = 0, M = 0;
569
+ m === X.PAGE_SCROLLING && g(C.page), m === X.VERTICAL_SCROLLING && (N = l.heights.slice(0, C.page - 1).reduce((B, j) => B + j, 0)), m === X.HORIZONTAL_SCROLLING && (M = l.widths.slice(0, C.page - 1).reduce((B, j) => B + j, 0));
570
+ let V;
571
+ if (!k)
572
+ return;
573
+ const Z = P.current[C.page], Y = k.page.getViewport({ scale: 1 });
574
+ V = new Ct.TextLayer({
575
+ viewport: Y,
576
+ textContentSource: Z,
577
+ container: document.createElement("div")
578
+ }), V.render().then(() => {
579
+ const B = V.textDivs[C.start.idx], [j] = dn([C], Z, V.textDivs), te = l.widths[C.page - 1], ae = l.heights[C.page - 1], J = document.createElement("div"), ne = document.createElement("div");
580
+ B.style.position = "absolute", B.style.color = "transparent", ne.style.position = "absolute", ne.style.top = "0", ne.style.setProperty("--scale-factor", `${u}`), J.style.position = "relative", J.style.width = `${te}px`, J.style.height = `${ae}px`, J.style.zIndex = "-1", J.appendChild(B), ne.appendChild(J), T.prepend(ne);
581
+ const he = j.element.getBoundingClientRect(), ce = ne.getBoundingClientRect(), Oe = he.top - ce.top, ve = he.left - ce.left, me = N + Oe - z + he.height / 2, le = M + ve - y + he.width / 2, De = {
582
+ left: Math.max(le, 0),
583
+ top: Math.max(me, 0)
584
+ };
585
+ T.removeChild(ne), R.scrollTo({
586
+ ...De
587
+ });
588
+ });
589
+ }, [
590
+ s,
591
+ g,
592
+ l,
593
+ C,
594
+ m,
595
+ _,
596
+ v,
597
+ T
598
+ ]);
599
+ const E = L(() => {
600
+ w((R) => x ? R + 1 > x ? 1 : R + 1 : 0);
601
+ }, [x]), I = L(() => {
602
+ w((R) => x ? R - 1 <= 0 ? x : R - 1 : 0);
603
+ }, [x]), O = L(async (R) => {
604
+ if (!R)
605
+ return {};
606
+ const k = R.numPages, z = {};
607
+ for (let y = 1; y <= k; y++) {
608
+ if (d.current)
609
+ throw "close pop over";
610
+ const N = await R.getPage(y);
611
+ z[y.toString()] = await N.getTextContent();
612
+ }
613
+ return z;
614
+ }, []);
615
+ return A(() => {
616
+ if (!n) {
617
+ d.current = !0, h([]), w(0);
618
+ return;
619
+ }
620
+ d.current = !1, i(!0), h([]), w(0), O(c).then((R) => {
621
+ P.current = R;
622
+ const z = Object.keys(R).reduce((y, N) => {
623
+ const M = lr(
624
+ [n],
625
+ R[N],
626
+ Number(N) - 1,
627
+ e
628
+ ).map((V, Z) => ({ ...V, page: Number(N), pageMatchIdx: Z }));
629
+ return [...y, ...M];
630
+ }, []);
631
+ h(z), w(z.length ? 1 : 0);
632
+ }).catch(() => {
633
+ h([]), w(0);
634
+ }).finally(() => i(!1));
635
+ }, [n, O, c, e]), {
636
+ search: n,
637
+ setSearch: o,
638
+ loading: r,
639
+ matches: f,
640
+ totalMatches: x,
641
+ currentMatchPosition: b,
642
+ currentMatch: C,
643
+ nextMatch: E,
644
+ prevMatch: I,
645
+ currentMatchElement: S,
646
+ setCurrentMatchElement: p
647
+ };
648
+ }, Pn = je({
649
+ search: "",
650
+ setSearch: (e) => {
651
+ },
652
+ loading: !1,
653
+ matches: [],
654
+ totalMatches: 0,
655
+ currentMatchPosition: 0,
656
+ currentMatch: null,
657
+ nextMatch: () => {
658
+ },
659
+ prevMatch: () => {
660
+ },
661
+ searchOptions: {},
662
+ setSearchOptions: (e) => e,
663
+ currentMatchElement: null,
664
+ setCurrentMatchElement: (e) => {
665
+ }
666
+ }), Ps = ({
667
+ children: e,
668
+ initialSearch: t
669
+ }) => {
670
+ const [n, o] = $({}), {
671
+ loading: r,
672
+ setSearch: i,
673
+ totalMatches: c,
674
+ currentMatchPosition: s,
675
+ currentMatch: l,
676
+ search: d,
677
+ matches: u,
678
+ nextMatch: f,
679
+ prevMatch: h,
680
+ currentMatchElement: g,
681
+ setCurrentMatchElement: b
682
+ } = vo(n, t);
683
+ return /* @__PURE__ */ a(
684
+ Pn.Provider,
685
+ {
686
+ value: {
687
+ searchOptions: n,
688
+ setSearchOptions: o,
689
+ loading: r,
690
+ setSearch: i,
691
+ totalMatches: c,
692
+ currentMatchPosition: s,
693
+ currentMatch: l,
694
+ nextMatch: f,
695
+ prevMatch: h,
696
+ search: d,
697
+ matches: u,
698
+ currentMatchElement: g,
699
+ setCurrentMatchElement: b
700
+ },
701
+ children: e
702
+ }
703
+ );
704
+ }, Sn = () => Be(Pn), de = {
705
+ "rp-pages": "_rp-pages_1776r_1",
706
+ "rp-pages-horizontal-scroll": "_rp-pages-horizontal-scroll_1776r_7",
707
+ "rp-pages-container": "_rp-pages-container_1776r_11",
708
+ "rp-page-scrolling-wrapper": "_rp-page-scrolling-wrapper_1776r_17",
709
+ "rp-viewer": "_rp-viewer_1776r_22",
710
+ "rp-cursor-grab": "_rp-cursor-grab_1776r_27",
711
+ "rp-cursor-grabbing": "_rp-cursor-grabbing_1776r_35",
712
+ "rp-loader": "_rp-loader_1776r_43"
713
+ }, st = {
714
+ "rp-page-wrapper": "_rp-page-wrapper_h7a2q_1",
715
+ "rp-page": "_rp-page_h7a2q_1",
716
+ "rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
717
+ }, _o = (e) => {
718
+ const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = W(null), { pages: i } = K(), { rotate: c } = Ke(), s = W(), { currentZoom: l } = Xe();
719
+ return A(() => {
720
+ if (!i || l === 0)
721
+ return;
722
+ const d = i.get(t);
723
+ if (r.current && d) {
724
+ const u = r.current;
725
+ u.hidden = !0;
726
+ const f = s.current;
727
+ f && f.cancel(), o && o(), s.current = vt(d.page, u, {
728
+ scale: l,
729
+ rotate: c,
730
+ renderForms: !0
731
+ }), s.current.promise.then(() => {
732
+ u.hidden = !1;
733
+ }).catch(() => {
734
+ }).finally(() => {
735
+ n && n();
736
+ });
737
+ }
738
+ return () => {
739
+ var u;
740
+ (u = s.current) == null || u.cancel();
741
+ };
742
+ }, [i, t, c, l, o, n]), /* @__PURE__ */ a("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
743
+ }, ct = {
744
+ "rp-text-layer": "_rp-text-layer_kwwfn_1",
745
+ "rp-text-layer-text": "_rp-text-layer-text_kwwfn_9"
746
+ }, wo = (e) => {
747
+ const { pageNumber: t } = e, { pages: n } = K(), o = W(null), { matches: r, currentMatch: i, setCurrentMatchElement: c } = Sn(), [s, l] = $(
748
+ []
749
+ ), d = W(), u = W(), f = W(), h = F(() => r.filter((b) => b.pageIndex === t - 1), [r, t]), g = L(
750
+ (b, w, v = !1) => {
751
+ if (v && un(b, w), !h.length) {
752
+ f.current = void 0, l([]);
753
+ return;
754
+ }
755
+ const _ = dn(h, b, w);
756
+ l(_);
757
+ },
758
+ [h]
759
+ );
760
+ return A(() => {
761
+ var v;
762
+ if ((v = f.current) == null || v.classList.remove("selected"), !s.length || !i || i.pageIndex !== t - 1)
763
+ return;
764
+ const b = h.findIndex(
765
+ (_) => JSON.stringify(_) === JSON.stringify(i)
766
+ );
767
+ if (b === -1)
768
+ return;
769
+ const w = s.find((_) => _.index === b);
770
+ w && (f.current = w.element, c(w.element), w.element.classList.add("selected"));
771
+ }, [i, s, h]), A(() => {
772
+ const b = n.get(t);
773
+ if (!b || !o.current)
774
+ return;
775
+ const w = o.current;
776
+ return d.current && d.current.cancel(), b.page.getTextContent().then((v) => {
777
+ const _ = b.page.getViewport({ scale: 1 });
778
+ return d.current = new Ct.TextLayer({
779
+ viewport: _,
780
+ textContentSource: v,
781
+ container: w
782
+ }), u.current = v, w && (w.innerText = ""), d.current.render();
783
+ }).then(() => {
784
+ var m;
785
+ [].slice.call(w.children).forEach((T) => {
786
+ T.classList.add(ct["rp-text-layer-text"]);
787
+ });
788
+ const _ = (m = d.current) == null ? void 0 : m.textDivs;
789
+ _ && u.current && g(u.current, _);
790
+ }).catch(() => {
791
+ }), () => {
792
+ var v;
793
+ (v = d.current) == null || v.cancel();
794
+ };
795
+ }, [n, t]), A(() => {
796
+ var v;
797
+ [].slice.call(o.current.children).forEach((_) => {
798
+ _.classList.add(ct["rp-text-layer-text"]);
799
+ });
800
+ const w = (v = d.current) == null ? void 0 : v.textDivs;
801
+ w && u.current && g(u.current, w, !0);
802
+ }, [g]), /* @__PURE__ */ a(
803
+ "div",
804
+ {
805
+ "data-rp": `page-${t}-textLayer`,
806
+ className: ct["rp-text-layer"],
807
+ ref: o
808
+ }
809
+ );
810
+ }, bo = {
811
+ "rp-annotation-layer": "_rp-annotation-layer_o0ksd_1"
812
+ };
813
+ let Co = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
814
+ const To = (e) => {
815
+ const { pageNumber: t } = e, n = W(null), { pages: o, pdf: r } = K(), i = W(), [c, s] = $(), { setFocusedPage: l, goToPage: d } = ie(), { scrollMode: u } = Ee(), { print: f } = et(), { download: h } = Gn(), g = F(() => o.get(t), [o, t]), b = F(() => g == null ? void 0 : g.page.getViewport(), [g]);
816
+ A(() => {
817
+ i.current && (i.current.div.replaceChildren(), i.current = void 0);
818
+ }, [r]), A(() => {
819
+ g && g.page.getAnnotations().then((v) => {
820
+ i.current = void 0, s(v), n.current && (n.current.innerText = "");
821
+ });
822
+ }, [g]);
823
+ const w = L(
824
+ (v) => {
825
+ !c || !r || (Lr(v), Rr(v, r, c).then((_) => {
826
+ var m, T;
827
+ ((m = _ == null ? void 0 : _.data) == null ? void 0 : m.action) === "Print" ? f() : ((T = _ == null ? void 0 : _.data) == null ? void 0 : T.action) === "SaveAs" && h();
828
+ }), u === X.PAGE_SCROLLING ? Ft(v, c, r, (_) => l(_.pageIndex + 1)) : Ft(v, c, r, (_) => d(_.pageIndex + 1)));
829
+ },
830
+ [r, c, d, l, u, f, h]
831
+ );
832
+ return A(() => {
833
+ if (!g || !c)
834
+ return;
835
+ const v = g.page.getViewport();
836
+ if (i.current) {
837
+ i.current.update({
838
+ viewport: v.clone({ dontFlip: !0 })
839
+ });
840
+ return;
841
+ }
842
+ const _ = /* @__PURE__ */ new Map([]);
843
+ for (const S of c) {
844
+ const { annotationType: p } = S;
845
+ switch (p) {
846
+ case At.Link:
847
+ Er(S);
848
+ break;
849
+ case At.Widget:
850
+ Nr(S, v, _);
851
+ break;
852
+ }
853
+ }
854
+ const m = new AbortController();
855
+ return (async () => {
856
+ var P;
857
+ i.current && (i.current.div.replaceChildren(), i.current = void 0), n.current && (n.current.innerText = ""), i.current = new mr({
858
+ div: n.current,
859
+ accessibilityManager: void 0,
860
+ annotationCanvasMap: void 0,
861
+ annotationEditorUIManager: void 0,
862
+ structTreeLayer: null,
863
+ page: g.page,
864
+ viewport: v.clone({ dontFlip: !0 })
865
+ }), n.current && kt(n.current, w);
866
+ const S = await (r == null ? void 0 : r.hasJSActions()), p = await (r == null ? void 0 : r.getFieldObjects());
867
+ if (m.signal.aborted)
868
+ throw "abort";
869
+ return (P = i.current) == null ? void 0 : P.render({
870
+ annotations: c,
871
+ annotationStorage: r == null ? void 0 : r.annotationStorage,
872
+ hasJSActions: S,
873
+ fieldObjects: p,
874
+ div: n.current,
875
+ viewport: v.clone({ dontFlip: !0 }),
876
+ page: g.page,
877
+ imageResourcesPath: Co,
878
+ renderForms: !0,
879
+ linkService: new yr(),
880
+ downloadManager: null,
881
+ enableScripting: !1
882
+ });
883
+ })().then(() => {
884
+ n.current && Or(n.current, w);
885
+ }).catch((S) => {
886
+ if (S !== "abort")
887
+ throw S;
888
+ }), () => {
889
+ m.abort("clear"), n.current && kt(n.current, w);
890
+ };
891
+ }, [r, c, w]), /* @__PURE__ */ a(
892
+ "div",
893
+ {
894
+ "data-rp": `page-${t}-annotationLayer`,
895
+ style: { width: `${b == null ? void 0 : b.width}px`, height: `${b == null ? void 0 : b.height}px` },
896
+ className: bo["rp-annotation-layer"],
897
+ ref: n
898
+ }
899
+ );
900
+ }, lt = {
901
+ "rp-text-highlight-layer": "_rp-text-highlight-layer_1470i_1",
902
+ "rp-text-highlight-layer-text": "_rp-text-highlight-layer-text_1470i_9"
903
+ }, Po = ({ pageNumber: e }) => {
904
+ const t = W(null), n = W(), o = W(), { pages: r } = K(), { highlightMatches: i } = fr(), c = F(() => i.filter((d) => d.pageIndex === e - 1), [i]), s = L(
905
+ (l, d, u = !1) => {
906
+ u && un(l, d), dr(c, l, d);
907
+ },
908
+ [c, r, e]
909
+ );
910
+ return A(() => {
911
+ const l = r.get(e);
912
+ if (!l || !t.current)
913
+ return;
914
+ const d = t.current;
915
+ return n.current && n.current.cancel(), l.page.getTextContent().then((u) => {
916
+ const f = l.page.getViewport({ scale: 1 });
917
+ return n.current = new Ct.TextLayer({
918
+ viewport: f,
919
+ textContentSource: u,
920
+ container: d
921
+ }), o.current = u, d && (d.innerText = ""), n.current.render();
922
+ }).then(() => {
923
+ var h;
924
+ [].slice.call(d.children).forEach((g) => {
925
+ g.classList.add(lt["rp-text-highlight-layer-text"]);
926
+ });
927
+ const f = (h = n.current) == null ? void 0 : h.textDivs;
928
+ f && o.current && s(o.current, f);
929
+ }).catch(() => {
930
+ }), () => {
931
+ var u;
932
+ (u = n.current) == null || u.cancel();
933
+ };
934
+ }, [r, e]), A(() => {
935
+ var u;
936
+ [].slice.call(t.current.children).forEach((f) => {
937
+ f.classList.add(lt["rp-text-highlight-layer-text"]);
938
+ });
939
+ const d = (u = n.current) == null ? void 0 : u.textDivs;
940
+ d && o.current && s(o.current, d, !0);
941
+ }, [s]), /* @__PURE__ */ a(xe, { children: /* @__PURE__ */ a(
942
+ "div",
943
+ {
944
+ "data-rp": `page-${e}-textHighlightLayer`,
945
+ className: lt["rp-text-highlight-layer"],
946
+ ref: t
947
+ }
948
+ ) });
949
+ }, Lt = We((e, t) => {
950
+ const { pageNumber: n, style: o, ...r } = e, { pages: i } = K(), { rotate: c } = Ke(), { textLayer: s } = ir(), { currentZoom: l } = Xe(), d = W(i.get(n)), [u, f] = $(!1), h = W(null), [g, b] = $({
951
+ width: 0,
952
+ height: 0
953
+ });
954
+ sn(t, () => h.current), A(() => {
955
+ if (i && (d.current = i.get(n), d.current)) {
956
+ const m = d.current.page.getViewport({ scale: l, rotation: c });
957
+ b(m);
958
+ }
959
+ }, [i, n, c, l]);
960
+ const w = F(() => {
961
+ switch (c) {
962
+ case 90:
963
+ return `${g.width / 2}px ${g.width / 2}px`;
964
+ case -90:
965
+ case 270:
966
+ return `${g.height / 2}px ${g.height / 2}px`;
967
+ default:
968
+ return "center";
969
+ }
970
+ }, [c, g]), v = L(() => {
971
+ f(!0);
972
+ }, []), _ = L(() => {
973
+ f(!1);
974
+ }, []);
975
+ return /* @__PURE__ */ a(
976
+ "div",
977
+ {
978
+ ref: h,
979
+ id: `page-${n}`,
980
+ "data-rp": `page-${n}`,
981
+ ...r,
982
+ style: {
983
+ ...o,
984
+ "--rp-rotate": `${c}deg`,
985
+ "--rp-page-rotate-translate": `${w}`,
986
+ "--scale-factor": l
987
+ },
988
+ className: st["rp-page-wrapper"],
989
+ children: /* @__PURE__ */ D(
990
+ "div",
991
+ {
992
+ style: {
993
+ width: `${g.width}px`,
994
+ height: `${g.height}px`
995
+ },
996
+ className: st["rp-page"],
997
+ children: [
998
+ /* @__PURE__ */ a(_o, { onLoading: v, onLoaded: _, pageNumber: n }),
999
+ u && /* @__PURE__ */ a("div", { className: st["rp-loader-wrapper"], children: /* @__PURE__ */ a(Pt, {}) }),
1000
+ s && /* @__PURE__ */ a(wo, { pageNumber: n }),
1001
+ /* @__PURE__ */ a(Po, { pageNumber: n }),
1002
+ /* @__PURE__ */ a(To, { pageNumber: n })
1003
+ ]
1004
+ }
1005
+ )
1006
+ }
1007
+ );
1008
+ });
1009
+ function Vt(e) {
1010
+ if (e === void 0)
1011
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1012
+ return e;
1013
+ }
1014
+ function _t(e, t) {
1015
+ return _t = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
1016
+ return n.__proto__ = o, n;
1017
+ }, _t(e, t);
1018
+ }
1019
+ function So(e, t) {
1020
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, _t(e, t);
1021
+ }
1022
+ var Ut = Number.isNaN || function(t) {
1023
+ return typeof t == "number" && t !== t;
1024
+ };
1025
+ function xo(e, t) {
1026
+ return !!(e === t || Ut(e) && Ut(t));
1027
+ }
1028
+ function Io(e, t) {
1029
+ if (e.length !== t.length)
1030
+ return !1;
1031
+ for (var n = 0; n < e.length; n++)
1032
+ if (!xo(e[n], t[n]))
1033
+ return !1;
1034
+ return !0;
1035
+ }
1036
+ function dt(e, t) {
1037
+ t === void 0 && (t = Io);
1038
+ var n, o = [], r, i = !1;
1039
+ function c() {
1040
+ for (var s = [], l = 0; l < arguments.length; l++)
1041
+ s[l] = arguments[l];
1042
+ return i && n === this && t(s, o) || (r = e.apply(this, s), i = !0, n = this, o = s), r;
1043
+ }
1044
+ return c;
1045
+ }
1046
+ function qt(e, t) {
1047
+ if (e == null)
1048
+ return {};
1049
+ var n = {};
1050
+ for (var o in e)
1051
+ if ({}.hasOwnProperty.call(e, o)) {
1052
+ if (t.indexOf(o) !== -1)
1053
+ continue;
1054
+ n[o] = e[o];
1055
+ }
1056
+ return n;
1057
+ }
1058
+ var yo = typeof performance == "object" && typeof performance.now == "function", Zt = yo ? function() {
1059
+ return performance.now();
1060
+ } : function() {
1061
+ return Date.now();
1062
+ };
1063
+ function jt(e) {
1064
+ cancelAnimationFrame(e.id);
1065
+ }
1066
+ function Lo(e, t) {
1067
+ var n = Zt();
1068
+ function o() {
1069
+ Zt() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
1070
+ }
1071
+ var r = {
1072
+ id: requestAnimationFrame(o)
1073
+ };
1074
+ return r;
1075
+ }
1076
+ var ut = -1;
1077
+ function Ro(e) {
1078
+ if (e === void 0 && (e = !1), ut === -1 || e) {
1079
+ var t = document.createElement("div"), n = t.style;
1080
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), ut = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
1081
+ }
1082
+ return ut;
1083
+ }
1084
+ var Le = null;
1085
+ function Bt(e) {
1086
+ if (e === void 0 && (e = !1), Le === null || e) {
1087
+ var t = document.createElement("div"), n = t.style;
1088
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
1089
+ var o = document.createElement("div"), r = o.style;
1090
+ return r.width = "100px", r.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Le = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? Le = "negative" : Le = "positive-ascending"), document.body.removeChild(t), Le;
1091
+ }
1092
+ return Le;
1093
+ }
1094
+ var No = 150, Eo = function(t) {
1095
+ var n = t.columnIndex;
1096
+ t.data;
1097
+ var o = t.rowIndex;
1098
+ return o + ":" + n;
1099
+ }, $e = null, Ge = null, Ve = null;
1100
+ process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && ($e = /* @__PURE__ */ new WeakSet(), Ge = /* @__PURE__ */ new WeakSet(), Ve = /* @__PURE__ */ new WeakSet());
1101
+ function Oo(e) {
1102
+ var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, i = e.getColumnWidth, c = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, l = e.getOffsetForColumnAndAlignment, d = e.getOffsetForRowAndAlignment, u = e.getRowHeight, f = e.getRowOffset, h = e.getRowStartIndexForOffset, g = e.getRowStopIndexForStartIndex, b = e.initInstanceProps, w = e.shouldResetStyleCacheOnItemSizeChange, v = e.validateProps;
1103
+ return t = /* @__PURE__ */ function(_) {
1104
+ So(m, _);
1105
+ function m(S) {
1106
+ var p;
1107
+ return p = _.call(this, S) || this, p._instanceProps = b(p.props, Vt(p)), p._resetIsScrollingTimeoutId = null, p._outerRef = void 0, p.state = {
1108
+ instance: Vt(p),
1109
+ isScrolling: !1,
1110
+ horizontalScrollDirection: "forward",
1111
+ scrollLeft: typeof p.props.initialScrollLeft == "number" ? p.props.initialScrollLeft : 0,
1112
+ scrollTop: typeof p.props.initialScrollTop == "number" ? p.props.initialScrollTop : 0,
1113
+ scrollUpdateWasRequested: !1,
1114
+ verticalScrollDirection: "forward"
1115
+ }, p._callOnItemsRendered = void 0, p._callOnItemsRendered = dt(function(P, C, x, E, I, O, R, k) {
1116
+ return p.props.onItemsRendered({
1117
+ overscanColumnStartIndex: P,
1118
+ overscanColumnStopIndex: C,
1119
+ overscanRowStartIndex: x,
1120
+ overscanRowStopIndex: E,
1121
+ visibleColumnStartIndex: I,
1122
+ visibleColumnStopIndex: O,
1123
+ visibleRowStartIndex: R,
1124
+ visibleRowStopIndex: k
1125
+ });
1126
+ }), p._callOnScroll = void 0, p._callOnScroll = dt(function(P, C, x, E, I) {
1127
+ return p.props.onScroll({
1128
+ horizontalScrollDirection: x,
1129
+ scrollLeft: P,
1130
+ scrollTop: C,
1131
+ verticalScrollDirection: E,
1132
+ scrollUpdateWasRequested: I
1133
+ });
1134
+ }), p._getItemStyle = void 0, p._getItemStyle = function(P, C) {
1135
+ var x = p.props, E = x.columnWidth, I = x.direction, O = x.rowHeight, R = p._getItemStyleCache(w && E, w && I, w && O), k = P + ":" + C, z;
1136
+ if (R.hasOwnProperty(k))
1137
+ z = R[k];
1138
+ else {
1139
+ var y = n(p.props, C, p._instanceProps), N = I === "rtl";
1140
+ R[k] = z = {
1141
+ position: "absolute",
1142
+ left: N ? void 0 : y,
1143
+ right: N ? y : void 0,
1144
+ top: f(p.props, P, p._instanceProps),
1145
+ height: u(p.props, P, p._instanceProps),
1146
+ width: i(p.props, C, p._instanceProps)
1147
+ };
1148
+ }
1149
+ return z;
1150
+ }, p._getItemStyleCache = void 0, p._getItemStyleCache = dt(function(P, C, x) {
1151
+ return {};
1152
+ }), p._onScroll = function(P) {
1153
+ var C = P.currentTarget, x = C.clientHeight, E = C.clientWidth, I = C.scrollLeft, O = C.scrollTop, R = C.scrollHeight, k = C.scrollWidth;
1154
+ p.setState(function(z) {
1155
+ if (z.scrollLeft === I && z.scrollTop === O)
1156
+ return null;
1157
+ var y = p.props.direction, N = I;
1158
+ if (y === "rtl")
1159
+ switch (Bt()) {
1160
+ case "negative":
1161
+ N = -I;
1162
+ break;
1163
+ case "positive-descending":
1164
+ N = k - E - I;
1165
+ break;
1166
+ }
1167
+ N = Math.max(0, Math.min(N, k - E));
1168
+ var M = Math.max(0, Math.min(O, R - x));
1169
+ return {
1170
+ isScrolling: !0,
1171
+ horizontalScrollDirection: z.scrollLeft < I ? "forward" : "backward",
1172
+ scrollLeft: N,
1173
+ scrollTop: M,
1174
+ verticalScrollDirection: z.scrollTop < O ? "forward" : "backward",
1175
+ scrollUpdateWasRequested: !1
1176
+ };
1177
+ }, p._resetIsScrollingDebounced);
1178
+ }, p._outerRefSetter = function(P) {
1179
+ var C = p.props.outerRef;
1180
+ p._outerRef = P, typeof C == "function" ? C(P) : C != null && typeof C == "object" && C.hasOwnProperty("current") && (C.current = P);
1181
+ }, p._resetIsScrollingDebounced = function() {
1182
+ p._resetIsScrollingTimeoutId !== null && jt(p._resetIsScrollingTimeoutId), p._resetIsScrollingTimeoutId = Lo(p._resetIsScrolling, No);
1183
+ }, p._resetIsScrolling = function() {
1184
+ p._resetIsScrollingTimeoutId = null, p.setState({
1185
+ isScrolling: !1
1186
+ }, function() {
1187
+ p._getItemStyleCache(-1);
1188
+ });
1189
+ }, p;
1190
+ }
1191
+ m.getDerivedStateFromProps = function(p, P) {
1192
+ return Do(p, P), v(p), null;
1193
+ };
1194
+ var T = m.prototype;
1195
+ return T.scrollTo = function(p) {
1196
+ var P = p.scrollLeft, C = p.scrollTop;
1197
+ P !== void 0 && (P = Math.max(0, P)), C !== void 0 && (C = Math.max(0, C)), this.setState(function(x) {
1198
+ return P === void 0 && (P = x.scrollLeft), C === void 0 && (C = x.scrollTop), x.scrollLeft === P && x.scrollTop === C ? null : {
1199
+ horizontalScrollDirection: x.scrollLeft < P ? "forward" : "backward",
1200
+ scrollLeft: P,
1201
+ scrollTop: C,
1202
+ scrollUpdateWasRequested: !0,
1203
+ verticalScrollDirection: x.scrollTop < C ? "forward" : "backward"
1204
+ };
1205
+ }, this._resetIsScrollingDebounced);
1206
+ }, T.scrollToItem = function(p) {
1207
+ var P = p.align, C = P === void 0 ? "auto" : P, x = p.columnIndex, E = p.rowIndex, I = this.props, O = I.columnCount, R = I.height, k = I.rowCount, z = I.width, y = this.state, N = y.scrollLeft, M = y.scrollTop, V = Ro();
1208
+ x !== void 0 && (x = Math.max(0, Math.min(x, O - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, k - 1)));
1209
+ var Z = c(this.props, this._instanceProps), Y = s(this.props, this._instanceProps), B = Y > z ? V : 0, j = Z > R ? V : 0;
1210
+ this.scrollTo({
1211
+ scrollLeft: x !== void 0 ? l(this.props, x, C, N, this._instanceProps, j) : N,
1212
+ scrollTop: E !== void 0 ? d(this.props, E, C, M, this._instanceProps, B) : M
1213
+ });
1214
+ }, T.componentDidMount = function() {
1215
+ var p = this.props, P = p.initialScrollLeft, C = p.initialScrollTop;
1216
+ if (this._outerRef != null) {
1217
+ var x = this._outerRef;
1218
+ typeof P == "number" && (x.scrollLeft = P), typeof C == "number" && (x.scrollTop = C);
1219
+ }
1220
+ this._callPropsCallbacks();
1221
+ }, T.componentDidUpdate = function() {
1222
+ var p = this.props.direction, P = this.state, C = P.scrollLeft, x = P.scrollTop, E = P.scrollUpdateWasRequested;
1223
+ if (E && this._outerRef != null) {
1224
+ var I = this._outerRef;
1225
+ if (p === "rtl")
1226
+ switch (Bt()) {
1227
+ case "negative":
1228
+ I.scrollLeft = -C;
1229
+ break;
1230
+ case "positive-ascending":
1231
+ I.scrollLeft = C;
1232
+ break;
1233
+ default:
1234
+ var O = I.clientWidth, R = I.scrollWidth;
1235
+ I.scrollLeft = R - O - C;
1236
+ break;
1237
+ }
1238
+ else
1239
+ I.scrollLeft = Math.max(0, C);
1240
+ I.scrollTop = Math.max(0, x);
1241
+ }
1242
+ this._callPropsCallbacks();
1243
+ }, T.componentWillUnmount = function() {
1244
+ this._resetIsScrollingTimeoutId !== null && jt(this._resetIsScrollingTimeoutId);
1245
+ }, T.render = function() {
1246
+ var p = this.props, P = p.children, C = p.className, x = p.columnCount, E = p.direction, I = p.height, O = p.innerRef, R = p.innerElementType, k = p.innerTagName, z = p.itemData, y = p.itemKey, N = y === void 0 ? Eo : y, M = p.outerElementType, V = p.outerTagName, Z = p.rowCount, Y = p.style, B = p.useIsScrolling, j = p.width, te = this.state.isScrolling, ae = this._getHorizontalRangeToRender(), J = ae[0], ne = ae[1], he = this._getVerticalRangeToRender(), ce = he[0], Oe = he[1], ve = [];
1247
+ if (x > 0 && Z)
1248
+ for (var me = ce; me <= Oe; me++)
1249
+ for (var le = J; le <= ne; le++)
1250
+ ve.push(He(P, {
1251
+ columnIndex: le,
1252
+ data: z,
1253
+ isScrolling: B ? te : void 0,
1254
+ key: N({
1255
+ columnIndex: le,
1256
+ data: z,
1257
+ rowIndex: me
1258
+ }),
1259
+ rowIndex: me,
1260
+ style: this._getItemStyle(me, le)
1261
+ }));
1262
+ var De = c(this.props, this._instanceProps), tt = s(this.props, this._instanceProps);
1263
+ return He(M || V || "div", {
1264
+ className: C,
1265
+ onScroll: this._onScroll,
1266
+ ref: this._outerRefSetter,
1267
+ style: Dr({
1268
+ position: "relative",
1269
+ height: I,
1270
+ width: j,
1271
+ overflow: "auto",
1272
+ WebkitOverflowScrolling: "touch",
1273
+ willChange: "transform",
1274
+ direction: E
1275
+ }, Y)
1276
+ }, He(R || k || "div", {
1277
+ children: ve,
1278
+ ref: O,
1279
+ style: {
1280
+ height: De,
1281
+ pointerEvents: te ? "none" : void 0,
1282
+ width: tt
1283
+ }
1284
+ }));
1285
+ }, T._callPropsCallbacks = function() {
1286
+ var p = this.props, P = p.columnCount, C = p.onItemsRendered, x = p.onScroll, E = p.rowCount;
1287
+ if (typeof C == "function" && P > 0 && E > 0) {
1288
+ var I = this._getHorizontalRangeToRender(), O = I[0], R = I[1], k = I[2], z = I[3], y = this._getVerticalRangeToRender(), N = y[0], M = y[1], V = y[2], Z = y[3];
1289
+ this._callOnItemsRendered(O, R, N, M, k, z, V, Z);
1290
+ }
1291
+ if (typeof x == "function") {
1292
+ var Y = this.state, B = Y.horizontalScrollDirection, j = Y.scrollLeft, te = Y.scrollTop, ae = Y.scrollUpdateWasRequested, J = Y.verticalScrollDirection;
1293
+ this._callOnScroll(j, te, B, J, ae);
1294
+ }
1295
+ }, T._getHorizontalRangeToRender = function() {
1296
+ var p = this.props, P = p.columnCount, C = p.overscanColumnCount, x = p.overscanColumnsCount, E = p.overscanCount, I = p.rowCount, O = this.state, R = O.horizontalScrollDirection, k = O.isScrolling, z = O.scrollLeft, y = C || x || E || 1;
1297
+ if (P === 0 || I === 0)
1298
+ return [0, 0, 0, 0];
1299
+ var N = o(this.props, z, this._instanceProps), M = r(this.props, N, z, this._instanceProps), V = !k || R === "backward" ? Math.max(1, y) : 1, Z = !k || R === "forward" ? Math.max(1, y) : 1;
1300
+ return [Math.max(0, N - V), Math.max(0, Math.min(P - 1, M + Z)), N, M];
1301
+ }, T._getVerticalRangeToRender = function() {
1302
+ var p = this.props, P = p.columnCount, C = p.overscanCount, x = p.overscanRowCount, E = p.overscanRowsCount, I = p.rowCount, O = this.state, R = O.isScrolling, k = O.verticalScrollDirection, z = O.scrollTop, y = x || E || C || 1;
1303
+ if (P === 0 || I === 0)
1304
+ return [0, 0, 0, 0];
1305
+ var N = h(this.props, z, this._instanceProps), M = g(this.props, N, z, this._instanceProps), V = !R || k === "backward" ? Math.max(1, y) : 1, Z = !R || k === "forward" ? Math.max(1, y) : 1;
1306
+ return [Math.max(0, N - V), Math.max(0, Math.min(I - 1, M + Z)), N, M];
1307
+ }, m;
1308
+ }(er), t.defaultProps = {
1309
+ direction: "ltr",
1310
+ itemData: void 0,
1311
+ useIsScrolling: !1
1312
+ }, t;
1313
+ }
1314
+ var Do = function(t, n) {
1315
+ var o = t.children, r = t.direction, i = t.height, c = t.innerTagName, s = t.outerTagName, l = t.overscanColumnsCount, d = t.overscanCount, u = t.overscanRowsCount, f = t.width, h = n.instance;
1316
+ if (process.env.NODE_ENV !== "production") {
1317
+ if (typeof d == "number" && $e && !$e.has(h) && ($e.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof l == "number" || typeof u == "number") && Ge && !Ge.has(h) && (Ge.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || s != null) && Ve && !Ve.has(h) && (Ve.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
1318
+ throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
1319
+ switch (r) {
1320
+ case "ltr":
1321
+ case "rtl":
1322
+ break;
1323
+ default:
1324
+ throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + r + '" was specified.'));
1325
+ }
1326
+ if (typeof f != "number")
1327
+ throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. ' + ('"' + (f === null ? "null" : typeof f) + '" was specified.'));
1328
+ if (typeof i != "number")
1329
+ throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (i === null ? "null" : typeof i) + '" was specified.'));
1330
+ }
1331
+ }, Kt = 50, xn = function(t, n) {
1332
+ var o = t.rowCount, r = n.rowMetadataMap, i = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, s = 0;
1333
+ if (c >= o && (c = o - 1), c >= 0) {
1334
+ var l = r[c];
1335
+ s = l.offset + l.size;
1336
+ }
1337
+ var d = o - c - 1, u = d * i;
1338
+ return s + u;
1339
+ }, In = function(t, n) {
1340
+ var o = t.columnCount, r = n.columnMetadataMap, i = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, s = 0;
1341
+ if (c >= o && (c = o - 1), c >= 0) {
1342
+ var l = r[c];
1343
+ s = l.offset + l.size;
1344
+ }
1345
+ var d = o - c - 1, u = d * i;
1346
+ return s + u;
1347
+ }, fe = function(t, n, o, r) {
1348
+ var i, c, s;
1349
+ if (t === "column" ? (i = r.columnMetadataMap, c = n.columnWidth, s = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, c = n.rowHeight, s = r.lastMeasuredRowIndex), o > s) {
1350
+ var l = 0;
1351
+ if (s >= 0) {
1352
+ var d = i[s];
1353
+ l = d.offset + d.size;
1354
+ }
1355
+ for (var u = s + 1; u <= o; u++) {
1356
+ var f = c(u);
1357
+ i[u] = {
1358
+ offset: l,
1359
+ size: f
1360
+ }, l += f;
1361
+ }
1362
+ t === "column" ? r.lastMeasuredColumnIndex = o : r.lastMeasuredRowIndex = o;
1363
+ }
1364
+ return i[o];
1365
+ }, Xt = function(t, n, o, r) {
1366
+ var i, c;
1367
+ t === "column" ? (i = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (i = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
1368
+ var s = c > 0 ? i[c].offset : 0;
1369
+ return s >= r ? yn(t, n, o, c, 0, r) : zo(t, n, o, Math.max(0, c), r);
1370
+ }, yn = function(t, n, o, r, i, c) {
1371
+ for (; i <= r; ) {
1372
+ var s = i + Math.floor((r - i) / 2), l = fe(t, n, s, o).offset;
1373
+ if (l === c)
1374
+ return s;
1375
+ l < c ? i = s + 1 : l > c && (r = s - 1);
1376
+ }
1377
+ return i > 0 ? i - 1 : 0;
1378
+ }, zo = function(t, n, o, r, i) {
1379
+ for (var c = t === "column" ? n.columnCount : n.rowCount, s = 1; r < c && fe(t, n, r, o).offset < i; )
1380
+ r += s, s *= 2;
1381
+ return yn(t, n, o, Math.min(r, c - 1), Math.floor(r / 2), i);
1382
+ }, Yt = function(t, n, o, r, i, c, s) {
1383
+ var l = t === "column" ? n.width : n.height, d = fe(t, n, o, c), u = t === "column" ? In(n, c) : xn(n, c), f = Math.max(0, Math.min(u - l, d.offset)), h = Math.max(0, d.offset - l + s + d.size);
1384
+ switch (r === "smart" && (i >= h - l && i <= f + l ? r = "auto" : r = "center"), r) {
1385
+ case "start":
1386
+ return f;
1387
+ case "end":
1388
+ return h;
1389
+ case "center":
1390
+ return Math.round(h + (f - h) / 2);
1391
+ case "auto":
1392
+ default:
1393
+ return i >= h && i <= f ? i : h > f || i < h ? h : f;
1394
+ }
1395
+ }, Ao = /* @__PURE__ */ Oo({
1396
+ getColumnOffset: function(t, n, o) {
1397
+ return fe("column", t, n, o).offset;
1398
+ },
1399
+ getColumnStartIndexForOffset: function(t, n, o) {
1400
+ return Xt("column", t, o, n);
1401
+ },
1402
+ getColumnStopIndexForStartIndex: function(t, n, o, r) {
1403
+ for (var i = t.columnCount, c = t.width, s = fe("column", t, n, r), l = o + c, d = s.offset + s.size, u = n; u < i - 1 && d < l; )
1404
+ u++, d += fe("column", t, u, r).size;
1405
+ return u;
1406
+ },
1407
+ getColumnWidth: function(t, n, o) {
1408
+ return o.columnMetadataMap[n].size;
1409
+ },
1410
+ getEstimatedTotalHeight: xn,
1411
+ getEstimatedTotalWidth: In,
1412
+ getOffsetForColumnAndAlignment: function(t, n, o, r, i, c) {
1413
+ return Yt("column", t, n, o, r, i, c);
1414
+ },
1415
+ getOffsetForRowAndAlignment: function(t, n, o, r, i, c) {
1416
+ return Yt("row", t, n, o, r, i, c);
1417
+ },
1418
+ getRowOffset: function(t, n, o) {
1419
+ return fe("row", t, n, o).offset;
1420
+ },
1421
+ getRowHeight: function(t, n, o) {
1422
+ return o.rowMetadataMap[n].size;
1423
+ },
1424
+ getRowStartIndexForOffset: function(t, n, o) {
1425
+ return Xt("row", t, o, n);
1426
+ },
1427
+ getRowStopIndexForStartIndex: function(t, n, o, r) {
1428
+ for (var i = t.rowCount, c = t.height, s = fe("row", t, n, r), l = o + c, d = s.offset + s.size, u = n; u < i - 1 && d < l; )
1429
+ u++, d += fe("row", t, u, r).size;
1430
+ return u;
1431
+ },
1432
+ initInstanceProps: function(t, n) {
1433
+ var o = t, r = o.estimatedColumnWidth, i = o.estimatedRowHeight, c = {
1434
+ columnMetadataMap: {},
1435
+ estimatedColumnWidth: r || Kt,
1436
+ estimatedRowHeight: i || Kt,
1437
+ lastMeasuredColumnIndex: -1,
1438
+ lastMeasuredRowIndex: -1,
1439
+ rowMetadataMap: {}
1440
+ };
1441
+ return n.resetAfterColumnIndex = function(s, l) {
1442
+ l === void 0 && (l = !0), n.resetAfterIndices({
1443
+ columnIndex: s,
1444
+ shouldForceUpdate: l
1445
+ });
1446
+ }, n.resetAfterRowIndex = function(s, l) {
1447
+ l === void 0 && (l = !0), n.resetAfterIndices({
1448
+ rowIndex: s,
1449
+ shouldForceUpdate: l
1450
+ });
1451
+ }, n.resetAfterIndices = function(s) {
1452
+ var l = s.columnIndex, d = s.rowIndex, u = s.shouldForceUpdate, f = u === void 0 ? !0 : u;
1453
+ typeof l == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, l - 1)), typeof d == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, d - 1)), n._getItemStyleCache(-1), f && n.forceUpdate();
1454
+ }, c;
1455
+ },
1456
+ shouldResetStyleCacheOnItemSizeChange: !1,
1457
+ validateProps: function(t) {
1458
+ var n = t.columnWidth, o = t.rowHeight;
1459
+ if (process.env.NODE_ENV !== "production") {
1460
+ if (typeof n != "function")
1461
+ throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. ' + ('"' + (n === null ? "null" : typeof n) + '" was specified.'));
1462
+ if (typeof o != "function")
1463
+ throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
1464
+ }
1465
+ }
1466
+ });
1467
+ process.env.NODE_ENV;
1468
+ function Jt(e, t) {
1469
+ for (var n in e)
1470
+ if (!(n in t))
1471
+ return !0;
1472
+ for (var o in t)
1473
+ if (e[o] !== t[o])
1474
+ return !0;
1475
+ return !1;
1476
+ }
1477
+ var Fo = ["style"], ko = ["style"];
1478
+ function Wo(e, t) {
1479
+ var n = e.style, o = qt(e, Fo), r = t.style, i = qt(t, ko);
1480
+ return !Jt(n, r) && !Jt(o, i);
1481
+ }
1482
+ const Mo = () => {
1483
+ const { viewMode: e } = Ye(), { scrollMode: t } = Ee(), { setColumnCount: n } = ln(), { virtualScrollableElementRef: o } = Je(), r = Qe(), i = L(
1484
+ (g) => r.widths[g] || 0,
1485
+ [r.widths]
1486
+ ), c = L(
1487
+ (g) => r.heights[g] || 0,
1488
+ [r.heights]
1489
+ ), s = F(() => r.heights.length, [r.heights]), l = F(() => Math.max(...r.widths), [r.widths]), d = F(() => t === X.HORIZONTAL_SCROLLING ? s : e === Ue.DUAL_PAGE ? 2 : 1, [e, t, t, s, o, l]);
1490
+ A(() => {
1491
+ n(d);
1492
+ }, [d, n]);
1493
+ const u = F(() => t === X.HORIZONTAL_SCROLLING || t === X.PAGE_SCROLLING ? 1 : Math.round(s / d), [d, s, t]), f = F(() => r.heights.reduce((g, b) => g + b, 0) / r.heights.length || 0, [r]), h = F(() => r.widths.reduce((g, b) => g + b, 0) / r.heights.length || 0, [r]);
1494
+ return {
1495
+ rowCount: u,
1496
+ rowHeight: c,
1497
+ columnCount: d,
1498
+ columnWidth: i,
1499
+ pageDimension: r,
1500
+ estimatedRowHeight: f,
1501
+ estimatedColumnWidth: h
1502
+ };
1503
+ };
1504
+ let oe;
1505
+ typeof window < "u" ? oe = window : typeof self < "u" ? oe = self : oe = global;
1506
+ let wt = null, bt = null;
1507
+ const Qt = 20, pt = oe.clearTimeout, en = oe.setTimeout, ht = oe.cancelAnimationFrame || oe.mozCancelAnimationFrame || oe.webkitCancelAnimationFrame, tn = oe.requestAnimationFrame || oe.mozRequestAnimationFrame || oe.webkitRequestAnimationFrame;
1508
+ ht == null || tn == null ? (wt = pt, bt = function(t) {
1509
+ return en(t, Qt);
1510
+ }) : (wt = function([t, n]) {
1511
+ ht(t), pt(n);
1512
+ }, bt = function(t) {
1513
+ const n = tn(function() {
1514
+ pt(o), t();
1515
+ }), o = en(function() {
1516
+ ht(n), t();
1517
+ }, Qt);
1518
+ return [n, o];
1519
+ });
1520
+ function Ho(e) {
1521
+ let t, n, o, r, i, c, s;
1522
+ const l = typeof document < "u" && document.attachEvent;
1523
+ if (!l) {
1524
+ c = function(_) {
1525
+ const m = _.__resizeTriggers__, T = m.firstElementChild, S = m.lastElementChild, p = T.firstElementChild;
1526
+ S.scrollLeft = S.scrollWidth, S.scrollTop = S.scrollHeight, p.style.width = T.offsetWidth + 1 + "px", p.style.height = T.offsetHeight + 1 + "px", T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight;
1527
+ }, i = function(_) {
1528
+ return _.offsetWidth !== _.__resizeLast__.width || _.offsetHeight !== _.__resizeLast__.height;
1529
+ }, s = function(_) {
1530
+ if (_.target.className && typeof _.target.className.indexOf == "function" && _.target.className.indexOf("contract-trigger") < 0 && _.target.className.indexOf("expand-trigger") < 0)
1531
+ return;
1532
+ const m = this;
1533
+ c(this), this.__resizeRAF__ && wt(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
1534
+ i(m) && (m.__resizeLast__.width = m.offsetWidth, m.__resizeLast__.height = m.offsetHeight, m.__resizeListeners__.forEach(function(p) {
1535
+ p.call(m, _);
1536
+ }));
1537
+ });
1538
+ };
1539
+ let h = !1, g = "";
1540
+ o = "animationstart";
1541
+ const b = "Webkit Moz O ms".split(" ");
1542
+ let w = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), v = "";
1543
+ {
1544
+ const _ = document.createElement("fakeelement");
1545
+ if (_.style.animationName !== void 0 && (h = !0), h === !1) {
1546
+ for (let m = 0; m < b.length; m++)
1547
+ if (_.style[b[m] + "AnimationName"] !== void 0) {
1548
+ v = b[m], g = "-" + v.toLowerCase() + "-", o = w[m], h = !0;
1549
+ break;
1550
+ }
1551
+ }
1552
+ }
1553
+ n = "resizeanim", t = "@" + g + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = g + "animation: 1ms " + n + "; ";
1554
+ }
1555
+ const d = function(h) {
1556
+ if (!h.getElementById("detectElementResize")) {
1557
+ const g = (t || "") + ".resize-triggers { " + (r || "") + '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%; }', b = h.head || h.getElementsByTagName("head")[0], w = h.createElement("style");
1558
+ w.id = "detectElementResize", w.type = "text/css", e != null && w.setAttribute("nonce", e), w.styleSheet ? w.styleSheet.cssText = g : w.appendChild(h.createTextNode(g)), b.appendChild(w);
1559
+ }
1560
+ };
1561
+ return {
1562
+ addResizeListener: function(h, g) {
1563
+ if (l)
1564
+ h.attachEvent("onresize", g);
1565
+ else {
1566
+ if (!h.__resizeTriggers__) {
1567
+ const b = h.ownerDocument, w = oe.getComputedStyle(h);
1568
+ w && w.position === "static" && (h.style.position = "relative"), d(b), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = b.createElement("div")).className = "resize-triggers";
1569
+ const v = b.createElement("div");
1570
+ v.className = "expand-trigger", v.appendChild(b.createElement("div"));
1571
+ const _ = b.createElement("div");
1572
+ _.className = "contract-trigger", h.__resizeTriggers__.appendChild(v), h.__resizeTriggers__.appendChild(_), h.appendChild(h.__resizeTriggers__), c(h), h.addEventListener("scroll", s, !0), o && (h.__resizeTriggers__.__animationListener__ = function(T) {
1573
+ T.animationName === n && c(h);
1574
+ }, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
1575
+ }
1576
+ h.__resizeListeners__.push(g);
1577
+ }
1578
+ },
1579
+ removeResizeListener: function(h, g) {
1580
+ if (l)
1581
+ h.detachEvent("onresize", g);
1582
+ else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(g), 1), !h.__resizeListeners__.length) {
1583
+ h.removeEventListener("scroll", s, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
1584
+ try {
1585
+ h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
1586
+ } catch {
1587
+ }
1588
+ }
1589
+ }
1590
+ };
1591
+ }
1592
+ class $o extends tr {
1593
+ constructor(...t) {
1594
+ super(...t), this.state = {
1595
+ height: this.props.defaultHeight || 0,
1596
+ scaledHeight: this.props.defaultHeight || 0,
1597
+ scaledWidth: this.props.defaultWidth || 0,
1598
+ width: this.props.defaultWidth || 0
1599
+ }, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
1600
+ this._timeoutId = null;
1601
+ const {
1602
+ disableHeight: n,
1603
+ disableWidth: o,
1604
+ onResize: r
1605
+ } = this.props;
1606
+ if (this._parentNode) {
1607
+ const i = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(i.paddingLeft || "0"), s = parseFloat(i.paddingRight || "0"), l = parseFloat(i.paddingTop || "0"), d = parseFloat(i.paddingBottom || "0"), u = this._parentNode.getBoundingClientRect(), f = u.height - l - d, h = u.width - c - s, g = this._parentNode.offsetHeight - l - d, b = this._parentNode.offsetWidth - c - s;
1608
+ (!n && (this.state.height !== g || this.state.scaledHeight !== f) || !o && (this.state.width !== b || this.state.scaledWidth !== h)) && (this.setState({
1609
+ height: g,
1610
+ width: b,
1611
+ scaledHeight: f,
1612
+ scaledWidth: h
1613
+ }), typeof r == "function" && r({
1614
+ height: g,
1615
+ scaledHeight: f,
1616
+ scaledWidth: h,
1617
+ width: b
1618
+ }));
1619
+ }
1620
+ }, this._setRef = (n) => {
1621
+ this._autoSizer = n;
1622
+ };
1623
+ }
1624
+ componentDidMount() {
1625
+ const {
1626
+ nonce: t
1627
+ } = this.props, n = this._autoSizer ? this._autoSizer.parentNode : null;
1628
+ if (n != null && n.ownerDocument && n.ownerDocument.defaultView && n instanceof n.ownerDocument.defaultView.HTMLElement) {
1629
+ this._parentNode = n;
1630
+ const o = n.ownerDocument.defaultView.ResizeObserver;
1631
+ o != null ? (this._resizeObserver = new o(() => {
1632
+ this._timeoutId = setTimeout(this._onResize, 0);
1633
+ }), this._resizeObserver.observe(n)) : (this._detectElementResize = Ho(t), this._detectElementResize.addResizeListener(n, this._onResize)), this._onResize();
1634
+ }
1635
+ }
1636
+ componentWillUnmount() {
1637
+ this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && this._resizeObserver.disconnect());
1638
+ }
1639
+ render() {
1640
+ const {
1641
+ children: t,
1642
+ defaultHeight: n,
1643
+ defaultWidth: o,
1644
+ disableHeight: r = !1,
1645
+ disableWidth: i = !1,
1646
+ doNotBailOutOnEmptyChildren: c = !1,
1647
+ nonce: s,
1648
+ onResize: l,
1649
+ style: d = {},
1650
+ tagName: u = "div",
1651
+ ...f
1652
+ } = this.props, {
1653
+ height: h,
1654
+ scaledHeight: g,
1655
+ scaledWidth: b,
1656
+ width: w
1657
+ } = this.state, v = {
1658
+ overflow: "visible"
1659
+ }, _ = {};
1660
+ let m = !1;
1661
+ return r || (h === 0 && (m = !0), v.height = 0, _.height = h, _.scaledHeight = g), i || (w === 0 && (m = !0), v.width = 0, _.width = w, _.scaledWidth = b), c && (m = !1), He(u, {
1662
+ ref: this._setRef,
1663
+ style: {
1664
+ ...v,
1665
+ ...d
1666
+ },
1667
+ ...f
1668
+ }, !m && t(_));
1669
+ }
1670
+ }
1671
+ const Go = ({ widths: e, heights: t }) => {
1672
+ const { focusedPage: n, totalPages: o } = ie(), r = F(() => {
1673
+ const s = [], l = Math.ceil(n / 2) * 2 - 1;
1674
+ if (s.push(l), l + 1 < o) {
1675
+ const d = l + 1;
1676
+ s.push(d);
1677
+ }
1678
+ return s;
1679
+ }, [n, o]), i = F(() => [
1680
+ {
1681
+ position: "absolute",
1682
+ left: 0,
1683
+ width: e(n - 1),
1684
+ height: t(n - 1)
1685
+ },
1686
+ {
1687
+ position: "absolute",
1688
+ left: e(n),
1689
+ top: 0,
1690
+ width: e(n),
1691
+ height: t(n)
1692
+ }
1693
+ ], [e, t, r]), c = F(() => i.reduce((s, l) => s + Number(l.width || 0), 0), [i]);
1694
+ return /* @__PURE__ */ a("div", { style: { width: c, position: "relative" }, children: r.map((s, l) => /* @__PURE__ */ a(Lt, { style: i[l], pageNumber: s }, s)) });
1695
+ }, Vo = ({ widths: e, heights: t }) => {
1696
+ const { focusedPage: n } = ie(), o = F(() => ({
1697
+ position: "absolute",
1698
+ width: e(n - 1),
1699
+ height: t(n - 1)
1700
+ }), [e, t, n]), r = F(() => e(n - 1), [e]);
1701
+ return /* @__PURE__ */ a(
1702
+ "div",
1703
+ {
1704
+ style: {
1705
+ width: r,
1706
+ position: "relative"
1707
+ },
1708
+ children: /* @__PURE__ */ a(Lt, { style: o, pageNumber: n }, n)
1709
+ }
1710
+ );
1711
+ }, Uo = (e, t, n) => {
1712
+ const o = W(), { contentRef: r } = be(), { heights: i, widths: c } = Qe(), { setFocusedPage: s } = ie(), [l, d] = $([]), { smoothScrolling: u } = Tt(), f = St(l, 100, 500), h = F(() => i.map((b, w) => {
1713
+ const v = c[w], _ = Wr(w + 1, e), m = v * _.columnIndex, T = b * _.rowIndex, S = m + v, p = T + b;
1714
+ return {
1715
+ pageNumber: w + 1,
1716
+ ..._,
1717
+ width: v,
1718
+ height: b,
1719
+ startX: m,
1720
+ startY: T,
1721
+ endX: S,
1722
+ endY: p
1723
+ };
1724
+ }), [i, c, e, t]);
1725
+ A(() => {
1726
+ f.length > 0 && !u.current && s(f[0].pageNumber);
1727
+ }, [f, s]);
1728
+ const g = L(
1729
+ (b) => {
1730
+ o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
1731
+ const w = b.target, v = {
1732
+ startTop: w.scrollTop,
1733
+ startLeft: w.scrollLeft,
1734
+ endTop: w.scrollTop + w.clientHeight,
1735
+ endLeft: w.scrollLeft + w.clientWidth
1736
+ }, _ = h.filter((m) => {
1737
+ const T = m.endX >= v.startLeft && m.endY >= v.startTop, S = m.startX <= v.endLeft && m.startY <= v.endTop;
1738
+ return T && S;
1739
+ }).map((m) => {
1740
+ const T = v.startLeft > m.startX ? v.startLeft : m.startX, S = v.startTop > m.startY ? v.startTop : m.startY, p = v.endLeft < m.endX ? v.endLeft : m.endX, P = v.endTop < m.endY ? v.endTop : m.endY, C = p - T, x = P - S, I = +(C * x / (m.width * m.height) * 100).toFixed(2);
1741
+ return {
1742
+ pageNumber: m.pageNumber,
1743
+ ratio: I
1744
+ };
1745
+ }).sort((m, T) => T.ratio - m.ratio);
1746
+ d(_);
1747
+ });
1748
+ },
1749
+ [r, h]
1750
+ );
1751
+ A(() => {
1752
+ if (n)
1753
+ return n == null || n.addEventListener("scroll", g), () => {
1754
+ n == null || n.removeEventListener("scroll", g);
1755
+ };
1756
+ }, [n, g]);
1757
+ }, qo = nr(({ columnIndex: e, rowIndex: t, data: n, style: o }) => {
1758
+ const r = Mr(t, e, n.columnCount);
1759
+ return /* @__PURE__ */ a(Lt, { style: o, pageNumber: r }, r);
1760
+ }, Wo), Ss = () => {
1761
+ const { initialPage: e = 1, initialScrollMode: t } = sr(), { pagesRef: n, setPagesRef: o } = be(), { scrollToPage: r } = _n(), {
1762
+ virtualScrollRef: i,
1763
+ getVirtualScrollRef: c,
1764
+ getPageScrollElementRef: s,
1765
+ getVirtualScrollableElementRef: l,
1766
+ setTotalInnerDimensions: d,
1767
+ virtualScrollableElementRef: u,
1768
+ totalInnerDimensions: f,
1769
+ pageScrollElementRef: h
1770
+ } = Je(), g = W(!0), { nextPage: b, prevPage: w, setFocusedPage: v, focusedPage: _ } = ie(), { scrollMode: m } = Ee(), { viewMode: T } = Ye(), S = W(null), { loading: p } = K(), { LoaderImageComponent: P } = pn(), { smoothScrolling: C, targetScrollPosition: x } = Tt(), E = W(
1771
+ f
1772
+ ), I = W({
1773
+ viewMode: T,
1774
+ scrollMode: m
1775
+ }), O = W(!1), R = W(), { isFullScreen: k } = cr(), {
1776
+ pageDimension: z,
1777
+ rowCount: y,
1778
+ rowHeight: N,
1779
+ columnCount: M,
1780
+ columnWidth: V,
1781
+ estimatedColumnWidth: Z,
1782
+ estimatedRowHeight: Y
1783
+ } = Mo(), B = St(f, 100), j = W();
1784
+ Uo(M, y, u);
1785
+ const te = W({
1786
+ scrollTop: 0,
1787
+ scrollLeft: 0
1788
+ });
1789
+ kr(n);
1790
+ const { isPressed: ae } = Ar(), { selectionMode: J } = ar(), { initializeGrabScroll: ne, resetGrabState: he } = Fr({
1791
+ isPressed: ae
1792
+ }), ce = F(() => J === or.HAND, [J]), Oe = F(() => ({
1793
+ columnCount: M
1794
+ }), [M]), ve = L(
1795
+ (H) => {
1796
+ const G = document.activeElement !== n;
1797
+ !k && G || (["ArrowUp", "ArrowLeft"].includes(H.key) ? (H.preventDefault(), w()) : ["ArrowDown", "ArrowRight"].includes(H.key) && (H.preventDefault(), b()));
1798
+ },
1799
+ [b, w, k, m]
1800
+ );
1801
+ A(() => (window.addEventListener("keydown", ve), () => {
1802
+ window.removeEventListener("keydown", ve);
1803
+ }), [ve]), A(() => {
1804
+ if (S.current && (S.current.style.position = "relative"), !!i)
1805
+ for (let H = 0; H < y; H++)
1806
+ for (let G = 0; G < M; G++)
1807
+ i.resetAfterIndices({
1808
+ columnIndex: G,
1809
+ rowIndex: H,
1810
+ shouldForceUpdate: !0
1811
+ });
1812
+ }, [y, M, z, i]);
1813
+ const me = L(
1814
+ (H, G) => {
1815
+ if (!u)
1816
+ return { scrollTop: 0, scrollLeft: 0 };
1817
+ const Ce = te.current.scrollTop > G, Te = te.current.scrollLeft > H;
1818
+ return Ce || Te ? te.current : {
1819
+ scrollTop: u.scrollTop,
1820
+ scrollLeft: u.scrollLeft
1821
+ };
1822
+ },
1823
+ [u]
1824
+ ), le = L(
1825
+ (H, G) => {
1826
+ if (I.current.viewMode !== T || I.current.scrollMode !== m) {
1827
+ j.current && clearTimeout(j.current), O.current = !0, r(_, "auto"), j.current = setTimeout(() => {
1828
+ requestAnimationFrame(() => {
1829
+ I.current = { viewMode: T, scrollMode: m };
1830
+ });
1831
+ }, 100);
1832
+ return;
1833
+ }
1834
+ const Te = H.scrollTop, nt = H.scrollLeft;
1835
+ if (!G.height || !G.width)
1836
+ return;
1837
+ O.current = !0;
1838
+ const { height: Pe, width: rt } = G, { height: Dt, width: zt } = E.current;
1839
+ if (Dt === Pe && zt === rt)
1840
+ return;
1841
+ const Xn = Te / Dt * Pe, Yn = nt / zt * rt, Jn = Math.round(Math.min(Xn, Pe)) || 0, Qn = Math.round(Math.min(Yn, rt)) || 0;
1842
+ R.current = setTimeout(() => {
1843
+ requestAnimationFrame(() => {
1844
+ i == null || i.scrollTo({
1845
+ scrollTop: Jn,
1846
+ scrollLeft: Qn
1847
+ });
1848
+ });
1849
+ }, 0), E.current = {
1850
+ height: G.height,
1851
+ width: G.width
1852
+ };
1853
+ },
1854
+ [i, T, m]
1855
+ );
1856
+ A(() => {
1857
+ clearTimeout(R.current);
1858
+ const H = Array.from({ length: y }).reduce(
1859
+ (Te, nt, Pe) => Te + N(Pe),
1860
+ 0
1861
+ ), G = Array.from({ length: M }).reduce(
1862
+ (Te, nt, Pe) => Te + V(Pe),
1863
+ 0
1864
+ ), Ce = me(G, H);
1865
+ te.current = Ce, le(Ce, { height: H, width: G }), d({
1866
+ height: H,
1867
+ width: G
1868
+ });
1869
+ }, [z, y, M, le]);
1870
+ const De = L((H) => {
1871
+ te.current = {
1872
+ scrollTop: H.scrollTop,
1873
+ scrollLeft: H.scrollLeft
1874
+ }, Math.round(x.current.left) === Math.round(H.scrollLeft) && Math.round(x.current.top) === Math.round(H.scrollTop) && (C.current = !1);
1875
+ }, []);
1876
+ A(() => () => {
1877
+ j.current && clearTimeout(j.current);
1878
+ }, []);
1879
+ const tt = F(() => re(de["rp-pages-container"], {
1880
+ [de["rp-cursor-grab"]]: ce && !ae,
1881
+ [de["rp-cursor-grabbing"]]: ce && ae
1882
+ }), [ce, ae]), Kn = L(
1883
+ (H) => {
1884
+ if (ce && H) {
1885
+ const G = re(de["rp-pages"]), Ce = document.querySelector(`.${G}`);
1886
+ ne(Ce);
1887
+ }
1888
+ },
1889
+ [ce, ne, de]
1890
+ );
1891
+ return A(() => {
1892
+ p && he();
1893
+ }, [p]), A(() => {
1894
+ if (!(B.height === 0 || !g.current)) {
1895
+ if (t === X.PAGE_SCROLLING) {
1896
+ e !== _ && h && v(e), g.current = !1;
1897
+ return;
1898
+ }
1899
+ if (i != null && i.scrollToItem) {
1900
+ switch (t) {
1901
+ case X.HORIZONTAL_SCROLLING:
1902
+ i.scrollToItem({
1903
+ columnIndex: e - 1,
1904
+ rowIndex: 0,
1905
+ align: "start"
1906
+ });
1907
+ break;
1908
+ default:
1909
+ i.scrollToItem({
1910
+ columnIndex: 0,
1911
+ rowIndex: e - 1,
1912
+ align: "start"
1913
+ });
1914
+ break;
1915
+ }
1916
+ v(e), g.current = !1;
1917
+ }
1918
+ }
1919
+ }, [
1920
+ i,
1921
+ t,
1922
+ h,
1923
+ v,
1924
+ B
1925
+ ]), /* @__PURE__ */ a("div", { ref: o, tabIndex: -1, className: tt, children: /* @__PURE__ */ a($o, { style: { minHeight: "50px" }, children: ({ width: H, height: G }) => /* @__PURE__ */ a("div", { "data-rp": "pages", ref: Kn, style: { width: H, height: G }, children: m === X.PAGE_SCROLLING ? /* @__PURE__ */ a(
1926
+ "div",
1927
+ {
1928
+ ref: s,
1929
+ style: { width: H, height: G },
1930
+ className: re(de["rp-pages"], de["rp-page-scrolling-wrapper"]),
1931
+ children: T === Ue.DUAL_PAGE ? /* @__PURE__ */ a(Go, { widths: V, heights: N }) : /* @__PURE__ */ a(Vo, { widths: V, heights: N })
1932
+ }
1933
+ ) : Z ? /* @__PURE__ */ a(
1934
+ Ao,
1935
+ {
1936
+ ref: c,
1937
+ itemData: Oe,
1938
+ outerRef: l,
1939
+ innerRef: S,
1940
+ onScroll: De,
1941
+ columnCount: M,
1942
+ columnWidth: V,
1943
+ rowHeight: N,
1944
+ height: G,
1945
+ width: H,
1946
+ estimatedColumnWidth: Z,
1947
+ estimatedRowHeight: Y,
1948
+ rowCount: y,
1949
+ className: re(
1950
+ de["rp-pages"],
1951
+ m === X.HORIZONTAL_SCROLLING ? de["rp-pages-horizontal-scroll"] : ""
1952
+ ),
1953
+ children: qo
1954
+ }
1955
+ ) : p ? null : /* @__PURE__ */ a(
1956
+ "div",
1957
+ {
1958
+ className: de["rp-loader"],
1959
+ style: {
1960
+ display: "flex",
1961
+ justifyContent: "center",
1962
+ alignItems: "center",
1963
+ height: "100%",
1964
+ width: "100%"
1965
+ },
1966
+ children: P && /* @__PURE__ */ a(P, {})
1967
+ }
1968
+ ) }) }) });
1969
+ }, ze = {
1970
+ "rp-toolbar-content": "_rp-toolbar-content_sz31z_1",
1971
+ "rp-toolbar-wrapper": "_rp-toolbar-wrapper_sz31z_10",
1972
+ "rp-toolbar-start": "_rp-toolbar-start_sz31z_33",
1973
+ "rp-toolbar-middle": "_rp-toolbar-middle_sz31z_39",
1974
+ "rp-toolbar-end": "_rp-toolbar-end_sz31z_46"
1975
+ }, mt = {
1976
+ "rp-paginate": "_rp-paginate_1y9vo_1",
1977
+ "rp-page-input": "_rp-page-input_1y9vo_6",
1978
+ "rp-total-page": "_rp-total-page_1y9vo_11"
1979
+ }, Zo = () => {
1980
+ const { prevIcon: e } = pe();
1981
+ return e || /* @__PURE__ */ a(ke, {});
1982
+ }, jo = () => {
1983
+ const { nextIcon: e } = pe();
1984
+ return e || /* @__PURE__ */ a(ke, { style: { transform: "rotate(180deg" } });
1985
+ }, Bo = () => {
1986
+ const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: i } = ie(), [c, s] = $(e.toString()), { pageNavigationTool: l = !0 } = ge(), { isSmallScreen: d } = ye(), { localeMessages: u } = ue();
1987
+ A(() => {
1988
+ s(e.toString());
1989
+ }, [e]);
1990
+ const f = L((w) => {
1991
+ const v = w.target.value;
1992
+ s(v);
1993
+ }, []), h = L(async () => {
1994
+ const w = i(c);
1995
+ w.success || s(w.currentPage.toString());
1996
+ }, [i, c, t]), g = L(() => {
1997
+ s(e.toString());
1998
+ }, [e]), b = L(
1999
+ (w) => {
2000
+ w.key === "Enter" && h();
2001
+ },
2002
+ [h]
2003
+ );
2004
+ return typeof l != "boolean" ? /* @__PURE__ */ a(
2005
+ l,
2006
+ {
2007
+ total: t,
2008
+ current: e,
2009
+ nextPage: o,
2010
+ prevPage: r,
2011
+ goToPage: i,
2012
+ changePage: n
2013
+ }
2014
+ ) : l ? /* @__PURE__ */ D("div", { className: mt["rp-paginate"], children: [
2015
+ !d && /* @__PURE__ */ a(q, { content: u == null ? void 0 : u.previousPageTooltip, children: /* @__PURE__ */ a(
2016
+ ee,
2017
+ {
2018
+ onClick: r,
2019
+ "aria-label": u == null ? void 0 : u.previousPageTooltip,
2020
+ "aria-disabled": e === 1,
2021
+ children: /* @__PURE__ */ a(Zo, {})
2022
+ }
2023
+ ) }),
2024
+ /* @__PURE__ */ a(q, { content: u == null ? void 0 : u.currentPageTooltip, children: /* @__PURE__ */ a(
2025
+ cn,
2026
+ {
2027
+ onKeyDown: b,
2028
+ onBlur: g,
2029
+ onChange: f,
2030
+ value: c,
2031
+ className: mt["rp-page-input"]
2032
+ }
2033
+ ) }),
2034
+ /* @__PURE__ */ D("span", { className: mt["rp-total-page"], children: [
2035
+ "/",
2036
+ t
2037
+ ] }),
2038
+ !d && /* @__PURE__ */ a(q, { content: u == null ? void 0 : u.nextPageTooltip, children: /* @__PURE__ */ a(
2039
+ ee,
2040
+ {
2041
+ onClick: o,
2042
+ "aria-label": u == null ? void 0 : u.nextPageTooltip,
2043
+ "aria-disabled": e === t,
2044
+ children: /* @__PURE__ */ a(jo, {})
2045
+ }
2046
+ ) })
2047
+ ] }) : null;
2048
+ };
2049
+ var Rt = "Dialog", [Ln, xs] = Vr(Rt), [Ko, se] = Ln(Rt), Rn = (e) => {
2050
+ const {
2051
+ __scopeDialog: t,
2052
+ children: n,
2053
+ open: o,
2054
+ defaultOpen: r,
2055
+ onOpenChange: i,
2056
+ modal: c = !0
2057
+ } = e, s = U.useRef(null), l = U.useRef(null), [d = !1, u] = Zr({
2058
+ prop: o,
2059
+ defaultProp: r,
2060
+ onChange: i
2061
+ });
2062
+ return /* @__PURE__ */ a(
2063
+ Ko,
2064
+ {
2065
+ scope: t,
2066
+ triggerRef: s,
2067
+ contentRef: l,
2068
+ contentId: at(),
2069
+ titleId: at(),
2070
+ descriptionId: at(),
2071
+ open: d,
2072
+ onOpenChange: u,
2073
+ onOpenToggle: U.useCallback(() => u((f) => !f), [u]),
2074
+ modal: c,
2075
+ children: n
2076
+ }
2077
+ );
2078
+ };
2079
+ Rn.displayName = Rt;
2080
+ var Nn = "DialogTrigger", Xo = U.forwardRef(
2081
+ (e, t) => {
2082
+ const { __scopeDialog: n, ...o } = e, r = se(Nn, n), i = xt(t, r.triggerRef);
2083
+ return /* @__PURE__ */ a(
2084
+ Me.button,
2085
+ {
2086
+ type: "button",
2087
+ "aria-haspopup": "dialog",
2088
+ "aria-expanded": r.open,
2089
+ "aria-controls": r.contentId,
2090
+ "data-state": Ot(r.open),
2091
+ ...o,
2092
+ ref: i,
2093
+ onClick: Fe(e.onClick, r.onOpenToggle)
2094
+ }
2095
+ );
2096
+ }
2097
+ );
2098
+ Xo.displayName = Nn;
2099
+ var Nt = "DialogPortal", [Yo, En] = Ln(Nt, {
2100
+ forceMount: void 0
2101
+ }), On = (e) => {
2102
+ const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, i = se(Nt, t);
2103
+ return /* @__PURE__ */ a(Yo, { scope: t, forceMount: n, children: U.Children.map(o, (c) => /* @__PURE__ */ a(It, { present: n || i.open, children: /* @__PURE__ */ a(Yr, { asChild: !0, container: r, children: c }) })) });
2104
+ };
2105
+ On.displayName = Nt;
2106
+ var Ze = "DialogOverlay", Dn = U.forwardRef(
2107
+ (e, t) => {
2108
+ const n = En(Ze, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = se(Ze, e.__scopeDialog);
2109
+ return i.modal ? /* @__PURE__ */ a(It, { present: o || i.open, children: /* @__PURE__ */ a(Jo, { ...r, ref: t }) }) : null;
2110
+ }
2111
+ );
2112
+ Dn.displayName = Ze;
2113
+ var Jo = U.forwardRef(
2114
+ (e, t) => {
2115
+ const { __scopeDialog: n, ...o } = e, r = se(Ze, n);
2116
+ return (
2117
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
2118
+ // ie. when `Overlay` and `Content` are siblings
2119
+ /* @__PURE__ */ a(Br, { as: Ur, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
2120
+ Me.div,
2121
+ {
2122
+ "data-state": Ot(r.open),
2123
+ ...o,
2124
+ ref: t,
2125
+ style: { pointerEvents: "auto", ...o.style }
2126
+ }
2127
+ ) })
2128
+ );
2129
+ }
2130
+ ), Ie = "DialogContent", zn = U.forwardRef(
2131
+ (e, t) => {
2132
+ const n = En(Ie, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, i = se(Ie, e.__scopeDialog);
2133
+ return /* @__PURE__ */ a(It, { present: o || i.open, children: i.modal ? /* @__PURE__ */ a(Qo, { ...r, ref: t }) : /* @__PURE__ */ a(ei, { ...r, ref: t }) });
2134
+ }
2135
+ );
2136
+ zn.displayName = Ie;
2137
+ var Qo = U.forwardRef(
2138
+ (e, t) => {
2139
+ const n = se(Ie, e.__scopeDialog), o = U.useRef(null), r = xt(t, n.contentRef, o);
2140
+ return U.useEffect(() => {
2141
+ const i = o.current;
2142
+ if (i)
2143
+ return Jr(i);
2144
+ }, []), /* @__PURE__ */ a(
2145
+ An,
2146
+ {
2147
+ ...e,
2148
+ ref: r,
2149
+ trapFocus: n.open,
2150
+ disableOutsidePointerEvents: !0,
2151
+ onCloseAutoFocus: Fe(e.onCloseAutoFocus, (i) => {
2152
+ var c;
2153
+ i.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
2154
+ }),
2155
+ onPointerDownOutside: Fe(e.onPointerDownOutside, (i) => {
2156
+ const c = i.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
2157
+ (c.button === 2 || s) && i.preventDefault();
2158
+ }),
2159
+ onFocusOutside: Fe(
2160
+ e.onFocusOutside,
2161
+ (i) => i.preventDefault()
2162
+ )
2163
+ }
2164
+ );
2165
+ }
2166
+ ), ei = U.forwardRef(
2167
+ (e, t) => {
2168
+ const n = se(Ie, e.__scopeDialog), o = U.useRef(!1), r = U.useRef(!1);
2169
+ return /* @__PURE__ */ a(
2170
+ An,
2171
+ {
2172
+ ...e,
2173
+ ref: t,
2174
+ trapFocus: !1,
2175
+ disableOutsidePointerEvents: !1,
2176
+ onCloseAutoFocus: (i) => {
2177
+ var c, s;
2178
+ (c = e.onCloseAutoFocus) == null || c.call(e, i), i.defaultPrevented || (o.current || (s = n.triggerRef.current) == null || s.focus(), i.preventDefault()), o.current = !1, r.current = !1;
2179
+ },
2180
+ onInteractOutside: (i) => {
2181
+ var l, d;
2182
+ (l = e.onInteractOutside) == null || l.call(e, i), i.defaultPrevented || (o.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
2183
+ const c = i.target;
2184
+ ((d = n.triggerRef.current) == null ? void 0 : d.contains(c)) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
2185
+ }
2186
+ }
2187
+ );
2188
+ }
2189
+ ), An = U.forwardRef(
2190
+ (e, t) => {
2191
+ const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: i, ...c } = e, s = se(Ie, n), l = U.useRef(null), d = xt(t, l);
2192
+ return Kr(), /* @__PURE__ */ D(xe, { children: [
2193
+ /* @__PURE__ */ a(
2194
+ Xr,
2195
+ {
2196
+ asChild: !0,
2197
+ loop: !0,
2198
+ trapped: o,
2199
+ onMountAutoFocus: r,
2200
+ onUnmountAutoFocus: i,
2201
+ children: /* @__PURE__ */ a(
2202
+ jr,
2203
+ {
2204
+ role: "dialog",
2205
+ id: s.contentId,
2206
+ "aria-describedby": s.descriptionId,
2207
+ "aria-labelledby": s.titleId,
2208
+ "data-state": Ot(s.open),
2209
+ ...c,
2210
+ ref: d,
2211
+ onDismiss: () => s.onOpenChange(!1)
2212
+ }
2213
+ )
2214
+ }
2215
+ ),
2216
+ /* @__PURE__ */ D(xe, { children: [
2217
+ /* @__PURE__ */ a(ni, { titleId: s.titleId }),
2218
+ /* @__PURE__ */ a(oi, { contentRef: l, descriptionId: s.descriptionId })
2219
+ ] })
2220
+ ] });
2221
+ }
2222
+ ), Et = "DialogTitle", Fn = U.forwardRef(
2223
+ (e, t) => {
2224
+ const { __scopeDialog: n, ...o } = e, r = se(Et, n);
2225
+ return /* @__PURE__ */ a(Me.h2, { id: r.titleId, ...o, ref: t });
2226
+ }
2227
+ );
2228
+ Fn.displayName = Et;
2229
+ var kn = "DialogDescription", ti = U.forwardRef(
2230
+ (e, t) => {
2231
+ const { __scopeDialog: n, ...o } = e, r = se(kn, n);
2232
+ return /* @__PURE__ */ a(Me.p, { id: r.descriptionId, ...o, ref: t });
2233
+ }
2234
+ );
2235
+ ti.displayName = kn;
2236
+ var Wn = "DialogClose", Mn = U.forwardRef(
2237
+ (e, t) => {
2238
+ const { __scopeDialog: n, ...o } = e, r = se(Wn, n);
2239
+ return /* @__PURE__ */ a(
2240
+ Me.button,
2241
+ {
2242
+ type: "button",
2243
+ ...o,
2244
+ ref: t,
2245
+ onClick: Fe(e.onClick, () => r.onOpenChange(!1))
2246
+ }
2247
+ );
2248
+ }
2249
+ );
2250
+ Mn.displayName = Wn;
2251
+ function Ot(e) {
2252
+ return e ? "open" : "closed";
2253
+ }
2254
+ var Hn = "DialogTitleWarning", [Is, $n] = qr(Hn, {
2255
+ contentName: Ie,
2256
+ titleName: Et,
2257
+ docsSlug: "dialog"
2258
+ }), ni = ({ titleId: e }) => {
2259
+ const t = $n(Hn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2260
+
2261
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
2262
+
2263
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
2264
+ return U.useEffect(() => {
2265
+ e && (document.getElementById(e) || console.error(n));
2266
+ }, [n, e]), null;
2267
+ }, ri = "DialogDescriptionWarning", oi = ({ contentRef: e, descriptionId: t }) => {
2268
+ const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$n(ri).contentName}}.`;
2269
+ return U.useEffect(() => {
2270
+ var i;
2271
+ const r = (i = e.current) == null ? void 0 : i.getAttribute("aria-describedby");
2272
+ t && r && (document.getElementById(t) || console.warn(o));
2273
+ }, [o, e, t]), null;
2274
+ }, ii = Rn, ai = On, si = Dn, ci = zn, li = Fn, di = Mn;
2275
+ const Se = {
2276
+ "rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
2277
+ "rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
2278
+ "rp-document-dialog": "_rp-document-dialog_slqo7_13",
2279
+ "rp-document-properties": "_rp-document-properties_slqo7_35",
2280
+ "rp-dialog-title": "_rp-dialog-title_slqo7_39",
2281
+ "rp-dialog-close": "_rp-dialog-close_slqo7_47",
2282
+ "rp-properties-divider": "_rp-properties-divider_slqo7_55"
2283
+ }, ui = () => {
2284
+ const { pdfProperties: e } = K(), { container: t } = be(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = eo(), { localeMessages: r } = ue(), i = F(() => {
2285
+ if (!e)
2286
+ return [];
2287
+ const {
2288
+ fileSize: c,
2289
+ filename: s,
2290
+ title: l,
2291
+ author: d,
2292
+ subject: u,
2293
+ createdOn: f,
2294
+ creator: h,
2295
+ keywords: g,
2296
+ modifiedOn: b,
2297
+ pdfProducer: w,
2298
+ pdfVersion: v,
2299
+ pageCount: _
2300
+ } = e;
2301
+ return [
2302
+ { label: r == null ? void 0 : r.propertiesFilenameLabel, value: s },
2303
+ { label: r == null ? void 0 : r.propertiesFileSizeLabel, value: c },
2304
+ { separate: !0 },
2305
+ { label: r == null ? void 0 : r.propertiesTitleLabel, value: l },
2306
+ { label: r == null ? void 0 : r.propertiesAuthorLabel, value: d },
2307
+ { label: r == null ? void 0 : r.propertiesSubjectLabel, value: u },
2308
+ { label: r == null ? void 0 : r.propertiesKeywordLabel, value: g },
2309
+ { label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
2310
+ {
2311
+ label: r == null ? void 0 : r.propertiesCreateOnLabel,
2312
+ value: f ? Mt(f) : ""
2313
+ },
2314
+ {
2315
+ label: r == null ? void 0 : r.propertiesModifiedOnLabel,
2316
+ value: b ? Mt(b) : ""
2317
+ },
2318
+ { separate: !0 },
2319
+ { label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: w },
2320
+ { label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: v },
2321
+ { label: r == null ? void 0 : r.propertiesPageCountLabel, value: _ }
2322
+ ];
2323
+ }, [e, r]);
2324
+ return /* @__PURE__ */ a(ii, { open: n, onOpenChange: o, children: /* @__PURE__ */ a(ai, { container: t, children: /* @__PURE__ */ D("div", { className: Se["rp-dialog-wrapper"], children: [
2325
+ /* @__PURE__ */ a(si, { className: Se["rp-dialog-overlay"] }),
2326
+ /* @__PURE__ */ D(ci, { className: Se["rp-document-dialog"], children: [
2327
+ /* @__PURE__ */ a(li, { className: Se["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
2328
+ /* @__PURE__ */ a("div", { className: Se["rp-document-properties"], children: i.map((c, s) => /* @__PURE__ */ a("div", { children: c.separate ? /* @__PURE__ */ a("div", { className: Se["rp-properties-divider"] }) : /* @__PURE__ */ a(Qr, { label: c.label, value: c.value }) }, s)) }),
2329
+ /* @__PURE__ */ a(di, { asChild: !0, className: Se["rp-dialog-close"], children: /* @__PURE__ */ a(fn, {}) })
2330
+ ] })
2331
+ ] }) }) });
2332
+ }, pi = {
2333
+ "rp-other-tool-content": "_rp-other-tool-content_su718_1"
2334
+ }, nn = ".pdf", hi = (e) => URL.createObjectURL(e), mi = async (e) => {
2335
+ const n = await (await fetch(e)).blob();
2336
+ return hi(n);
2337
+ }, Gn = () => {
2338
+ const { filename: e, pdfSrc: t } = K(), { downloadFilename: n } = gr(), o = (i) => {
2339
+ const c = n || i;
2340
+ return c.endsWith(nn) ? c : `${c}${nn}`;
2341
+ };
2342
+ return { download: L(async () => {
2343
+ if (!e || !t)
2344
+ throw new Error("There is no PDF source to download");
2345
+ const i = document.createElement("a");
2346
+ i.href = await mi(t), i.download = o(e), document.body.appendChild(i), i.click(), document.body.removeChild(i);
2347
+ }, [e, t]) };
2348
+ }, Vn = () => {
2349
+ const { downloadIcon: e } = pe();
2350
+ return e || /* @__PURE__ */ a(io, {});
2351
+ }, Un = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ a(q, { className: t, content: n == null ? void 0 : n.downloadFileTooltip, children: e }), fi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ a(Un, { localeMessages: t, children: /* @__PURE__ */ a(ee, { onClick: e, "aria-label": t == null ? void 0 : t.downloadFileTooltip, children: /* @__PURE__ */ a(Vn, {}) }) }), gi = ({ download: e, localeMessages: t }) => /* @__PURE__ */ a(we, { onClick: e, children: /* @__PURE__ */ D(Un, { className: "rp-menu-item", localeMessages: t, children: [
2352
+ /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Vn, {}) }),
2353
+ t == null ? void 0 : t.downloadFileLabel
2354
+ ] }) }), qn = () => {
2355
+ const { download: e } = Gn(), { downloadTool: t = !0 } = ge(), { isSmallScreen: n } = ye(), { localeMessages: o } = ue();
2356
+ return t ? n ? /* @__PURE__ */ a(gi, { download: e, localeMessages: o }) : typeof t == "function" ? /* @__PURE__ */ a(t, { download: e }) : t ? /* @__PURE__ */ a(fi, { download: e, localeMessages: o }) : null : null;
2357
+ }, Zn = () => {
2358
+ const { printIcon: e } = pe();
2359
+ return e || /* @__PURE__ */ a(ao, {});
2360
+ }, jn = ({ children: e, className: t, localeMessages: n }) => /* @__PURE__ */ a(q, { className: t, content: n == null ? void 0 : n.printTooltip, children: e }), vi = ({ print: e, localeMessages: t }) => /* @__PURE__ */ a(jn, { localeMessages: t, children: /* @__PURE__ */ a(ee, { onClick: e, "aria-label": t == null ? void 0 : t.printTooltip, children: /* @__PURE__ */ a(Zn, {}) }) }), _i = ({ print: e, localeMessages: t }) => /* @__PURE__ */ a(we, { onClick: e, children: /* @__PURE__ */ D(jn, { className: "rp-menu-item", localeMessages: t, children: [
2361
+ /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Zn, {}) }),
2362
+ t == null ? void 0 : t.printLabel
2363
+ ] }) }), Bn = () => {
2364
+ const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: i } = et(), { printTool: c = !0 } = ge(), { isSmallScreen: s } = ye(), { localeMessages: l } = ue();
2365
+ return c ? s ? /* @__PURE__ */ a(_i, { print: e, localeMessages: l }) : typeof c == "function" ? /* @__PURE__ */ a(
2366
+ c,
2367
+ {
2368
+ print: e,
2369
+ cancel: t,
2370
+ setOnProgress: n,
2371
+ setOnError: r,
2372
+ setOnComplete: o,
2373
+ progress: i
2374
+ }
2375
+ ) : c ? /* @__PURE__ */ a(vi, { print: e, localeMessages: l }) : null : null;
2376
+ }, wi = {
2377
+ "rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
2378
+ }, bi = () => {
2379
+ const { goToFirstPageIcon: e } = pe();
2380
+ return e || /* @__PURE__ */ a(vn, { className: wi["rp-go-to-Top"] });
2381
+ }, Ci = () => {
2382
+ const { goToLastPageIcon: e } = pe();
2383
+ return e || /* @__PURE__ */ a(vn, {});
2384
+ }, rn = { width: "100%" }, Ti = () => {
2385
+ const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = ge(), { localeMessages: r } = ue(), i = F(() => n === 1, [n]), c = F(() => n === t, [n, t]), s = L(() => {
2386
+ e(1);
2387
+ }, [e]), l = L(() => {
2388
+ e(t);
2389
+ }, [e, t]);
2390
+ return o ? /* @__PURE__ */ D(qe, { children: [
2391
+ /* @__PURE__ */ a(we, { onClick: s, children: /* @__PURE__ */ a(q, { content: r == null ? void 0 : r.firstPageTooltip, style: rn, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": i, children: [
2392
+ /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(bi, {}) }),
2393
+ /* @__PURE__ */ a("span", { children: r == null ? void 0 : r.firstPageLabel })
2394
+ ] }) }) }),
2395
+ /* @__PURE__ */ a(we, { onClick: l, children: /* @__PURE__ */ a(q, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ D("div", { className: "rp-menu-item", "aria-disabled": c, children: [
2396
+ /* @__PURE__ */ a("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ a(Ci, {}) }),
2397
+ /* @__PURE__ */ a("span", { children: r == null ? void 0 : r.lastPageLabel })
2398
+ ] }) }) }),
2399
+ /* @__PURE__ */ a(yt, {})
2400
+ ] }) : null;
2401
+ }, Pi = () => {
2402
+ const { container: e } = be(), { isSmallScreen: t } = ye(), {
2403
+ openFileTool: n,
2404
+ downloadTool: o,
2405
+ documentProperties: r,
2406
+ scrollModeTool: i,
2407
+ rotateTool: c,
2408
+ selectionModeTool: s,
2409
+ jumpNavigationTool: l,
2410
+ printTool: d,
2411
+ fullscreenTool: u
2412
+ } = ge(), { localeMessages: f } = ue();
2413
+ return F(() => {
2414
+ const g = l || c || s || i || r;
2415
+ let b = !1;
2416
+ return t && (b = !(!n && !o && !d && !u)), g || b;
2417
+ }, [
2418
+ n,
2419
+ o,
2420
+ r,
2421
+ i,
2422
+ c,
2423
+ s,
2424
+ l,
2425
+ t
2426
+ ]) ? /* @__PURE__ */ D(to, { children: [
2427
+ /* @__PURE__ */ a(
2428
+ mn,
2429
+ {
2430
+ container: e,
2431
+ triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(q, { content: f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ a(ee, { "aria-label": f == null ? void 0 : f.moreOptionTooltip, children: /* @__PURE__ */ a(Gr, {}) }) }) }),
2432
+ children: /* @__PURE__ */ D("div", { className: pi["rp-other-tool-content"], "data-rp": "moreOptionsDropdown", children: [
2433
+ t && /* @__PURE__ */ D(qe, { children: [
2434
+ /* @__PURE__ */ a(hn, {}),
2435
+ /* @__PURE__ */ a(qn, {}),
2436
+ /* @__PURE__ */ a(Bn, {}),
2437
+ /* @__PURE__ */ a(gn, {}),
2438
+ /* @__PURE__ */ a(yt, {})
2439
+ ] }),
2440
+ /* @__PURE__ */ a(Ti, {}),
2441
+ /* @__PURE__ */ a(ro, {}),
2442
+ /* @__PURE__ */ a(so, {}),
2443
+ /* @__PURE__ */ a(oo, {}),
2444
+ /* @__PURE__ */ a(no, {})
2445
+ ] })
2446
+ }
2447
+ ),
2448
+ /* @__PURE__ */ a(ui, {})
2449
+ ] }) : null;
2450
+ }, Si = () => {
2451
+ const { isSmallScreen: e } = ye();
2452
+ return /* @__PURE__ */ D(xe, { children: [
2453
+ /* @__PURE__ */ a($r, {}),
2454
+ !e && /* @__PURE__ */ D(xe, { children: [
2455
+ /* @__PURE__ */ a(hn, {}),
2456
+ /* @__PURE__ */ a(qn, {}),
2457
+ /* @__PURE__ */ a(Bn, {}),
2458
+ /* @__PURE__ */ a(gn, {})
2459
+ ] }),
2460
+ /* @__PURE__ */ a(Pi, {})
2461
+ ] });
2462
+ }, Re = {
2463
+ "rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
2464
+ "rp-current-zoom-wrapper": "_rp-current-zoom-wrapper_cocqs_6",
2465
+ "rp-current-zoom-icon": "_rp-current-zoom-icon_cocqs_11",
2466
+ "rp-current-zoom-text": "_rp-current-zoom-text_cocqs_16",
2467
+ "rp-zoom-dropdown-content": "_rp-zoom-dropdown-content_cocqs_20"
2468
+ }, xi = 25, ft = 1e3, Ii = [50, 75, 100, 125, 150, 200, 300, 400], yi = () => {
2469
+ const { zoomInIcon: e } = pe();
2470
+ return e || /* @__PURE__ */ a(co, {});
2471
+ }, Li = () => {
2472
+ const { zoomOutIcon: e } = pe();
2473
+ return e || /* @__PURE__ */ a(lo, {});
2474
+ }, Ri = () => {
2475
+ const { zoomLevel: e, setZoomLevel: t } = Xe(), { container: n, contentRef: o } = be(), { zoomTool: r = !0 } = ge(), { focusedPage: i } = ie(), { rotate: c } = Ke(), { pages: s } = K(), { isSmallScreen: l } = ye(), { localeMessages: d } = ue(), u = L(() => {
2476
+ t((_) => {
2477
+ const m = Math.floor(_ / 25) * 25;
2478
+ return Math.min(m + 25, ft);
2479
+ });
2480
+ }, [t]), f = L(() => {
2481
+ t((_) => {
2482
+ const m = Math.ceil(_ / 25) * 25;
2483
+ return Math.min(m - 25, ft);
2484
+ });
2485
+ }, [t]), h = F(() => e === xi, [e]), g = F(() => e === ft, [e]), b = F(() => {
2486
+ var _;
2487
+ return (_ = s.get(i)) == null ? void 0 : _.page.getViewport({ scale: 1, rotation: c });
2488
+ }, [s, i, c]), w = L(
2489
+ (_) => {
2490
+ const m = ((b == null ? void 0 : b.width) || 0) + 2 * Ht, T = ((b == null ? void 0 : b.height) || 0) + 2 * Ht, S = (o == null ? void 0 : o.clientWidth) || 0, p = (o == null ? void 0 : o.clientHeight) || 0, P = uo(_, S, p, m, T);
2491
+ t(P);
2492
+ },
2493
+ [t, b]
2494
+ ), v = L(
2495
+ (_) => {
2496
+ typeof _ == "number" ? t(_) : w(_);
2497
+ },
2498
+ [t, w]
2499
+ );
2500
+ return typeof r != "boolean" ? /* @__PURE__ */ a(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ D("div", { className: Re["rp-zoom-wrapper"], children: [
2501
+ /* @__PURE__ */ a(q, { content: d == null ? void 0 : d.zoomOutTooltip, children: /* @__PURE__ */ a(
2502
+ ee,
2503
+ {
2504
+ disabled: h,
2505
+ onClick: f,
2506
+ "aria-label": d == null ? void 0 : d.zoomOutTooltip,
2507
+ children: /* @__PURE__ */ a(Li, {})
2508
+ }
2509
+ ) }),
2510
+ !l && /* @__PURE__ */ a(
2511
+ mn,
2512
+ {
2513
+ container: n,
2514
+ triggerComponent: /* @__PURE__ */ a("div", { role: "button", children: /* @__PURE__ */ a(q, { content: d == null ? void 0 : d.zoomSelectTooltip, children: /* @__PURE__ */ D(
2515
+ ee,
2516
+ {
2517
+ className: Re["rp-current-zoom-wrapper"],
2518
+ "aria-label": d == null ? void 0 : d.zoomSelectTooltip,
2519
+ children: [
2520
+ /* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: e }),
2521
+ /* @__PURE__ */ a("span", { className: Re["rp-current-zoom-text"], children: "%" }),
2522
+ /* @__PURE__ */ a(ke, { className: Re["rp-current-zoom-icon"] })
2523
+ ]
2524
+ }
2525
+ ) }) }),
2526
+ style: { minWidth: "200px" },
2527
+ align: "center",
2528
+ children: /* @__PURE__ */ D("div", { className: Re["rp-zoom-dropdown-content"], children: [
2529
+ /* @__PURE__ */ D(qe, { children: [
2530
+ /* @__PURE__ */ a(we, { onClick: () => v(ot.ACTUAL), children: d == null ? void 0 : d.zoomActualSize }),
2531
+ /* @__PURE__ */ a(we, { onClick: () => v(ot.PAGE_FIT), children: d == null ? void 0 : d.zoomPageFit }),
2532
+ /* @__PURE__ */ a(we, { onClick: () => v(ot.PAGE_WIDTH), children: d == null ? void 0 : d.zoomPageWidth })
2533
+ ] }),
2534
+ /* @__PURE__ */ a(yt, {}),
2535
+ /* @__PURE__ */ a(qe, { children: Ii.map((_) => /* @__PURE__ */ D(we, { onClick: () => v(_), children: [
2536
+ _,
2537
+ " %"
2538
+ ] }, _)) })
2539
+ ] })
2540
+ }
2541
+ ),
2542
+ /* @__PURE__ */ a(q, { content: d == null ? void 0 : d.zoomInTooltip, children: /* @__PURE__ */ a(
2543
+ ee,
2544
+ {
2545
+ disabled: g,
2546
+ onClick: u,
2547
+ "aria-label": d == null ? void 0 : d.zoomInTooltip,
2548
+ children: /* @__PURE__ */ a(yi, {})
2549
+ }
2550
+ ) })
2551
+ ] }) : null;
2552
+ }, Q = {
2553
+ "rp-search-tool-content": "_rp-search-tool-content_1j25f_1",
2554
+ "rp-search-tool-input": "_rp-search-tool-input_1j25f_10",
2555
+ "rp-search-tool-input-icon": "_rp-search-tool-input-icon_1j25f_17",
2556
+ "rp-search-tool-controls": "_rp-search-tool-controls_1j25f_27",
2557
+ "rp-search-tool-input-wrapper": "_rp-search-tool-input-wrapper_1j25f_35",
2558
+ "rp-search-tool-input-checkboxes": "_rp-search-tool-input-checkboxes_1j25f_41",
2559
+ "rp-search-tool-input-clear": "_rp-search-tool-input-clear_1j25f_46",
2560
+ "rp-search-input": "_rp-search-input_1j25f_60",
2561
+ "rp-search-icon-info": "_rp-search-icon-info_1j25f_65",
2562
+ "rp-search-loader-icon": "_rp-search-loader-icon_1j25f_74"
2563
+ }, on = () => {
2564
+ const { searchIcon: e } = pe();
2565
+ return e || /* @__PURE__ */ a(po, {});
2566
+ }, Ni = () => {
2567
+ const { container: e } = be(), [t, n] = $(!1), { pdf: o } = K(), [r, i] = $(null), {
2568
+ searchOptions: c,
2569
+ setSearchOptions: s,
2570
+ loading: l,
2571
+ setSearch: d,
2572
+ totalMatches: u,
2573
+ currentMatchPosition: f,
2574
+ nextMatch: h,
2575
+ prevMatch: g,
2576
+ search: b
2577
+ } = Sn(), { searchTool: w = !0 } = ge(), [v, _] = $(b), { localeMessages: m } = ue(), T = L(() => {
2578
+ n(!0);
2579
+ }, []), S = L(() => {
2580
+ d(""), _(""), n(!1);
2581
+ }, [d]), p = (y) => {
2582
+ const N = y.key === "Enter", M = y.key === " ";
2583
+ (N || M) && S();
2584
+ }, P = L(
2585
+ (y) => {
2586
+ y.key === "Escape" && t && S();
2587
+ },
2588
+ [t]
2589
+ ), C = L(
2590
+ (y) => {
2591
+ y.shiftKey && y.key === "Enter" ? g() : y.key === "Enter" && b !== v ? d(v) : y.key === "Enter" && h();
2592
+ },
2593
+ [v, g, h, d, b]
2594
+ );
2595
+ A(() => (window.addEventListener("keydown", P), () => {
2596
+ window.removeEventListener("keydown", P);
2597
+ }), [P]), A(() => {
2598
+ r && r.focus();
2599
+ }, [r]);
2600
+ const x = L((y) => {
2601
+ _(y.target.value);
2602
+ }, []), E = L(() => {
2603
+ _(""), d("");
2604
+ }, [d]), I = F(() => `${f} / ${u}`, [f, u]), { wholeWords: O, matchCase: R } = F(() => c, [c]), k = L(
2605
+ (y) => {
2606
+ s((N) => ({ ...N, matchCase: y }));
2607
+ },
2608
+ [s]
2609
+ ), z = L(
2610
+ (y) => {
2611
+ s((N) => ({ ...N, wholeWords: y }));
2612
+ },
2613
+ [s]
2614
+ );
2615
+ return A(() => {
2616
+ S();
2617
+ }, [o, S]), w ? /* @__PURE__ */ a(xe, { children: /* @__PURE__ */ a(
2618
+ zr,
2619
+ {
2620
+ open: t,
2621
+ container: e,
2622
+ triggerComponent: /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ a(ee, { onClick: T, "aria-label": m == null ? void 0 : m.searchButtonTooltip, children: /* @__PURE__ */ a(on, {}) }) }),
2623
+ children: /* @__PURE__ */ D("div", { className: Q["rp-search-tool-content"], children: [
2624
+ /* @__PURE__ */ D("div", { className: Q["rp-search-tool-input-wrapper"], children: [
2625
+ /* @__PURE__ */ D("div", { className: Q["rp-search-tool-input"], children: [
2626
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchInputTooltip, children: /* @__PURE__ */ a(
2627
+ cn,
2628
+ {
2629
+ value: v,
2630
+ onKeyDown: C,
2631
+ onChange: x,
2632
+ icon: /* @__PURE__ */ a(on, {}),
2633
+ placeholder: m == null ? void 0 : m.searchInputPlaceholder,
2634
+ className: Q["rp-search-input"],
2635
+ ref: i,
2636
+ children: !!v && /* @__PURE__ */ a("span", { className: Q["rp-search-tool-input-clear"], onClick: E, children: /* @__PURE__ */ a(ho, {}) })
2637
+ }
2638
+ ) }),
2639
+ l ? /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(Pt, { className: Q["rp-search-loader-icon"] }) }) : /* @__PURE__ */ a("span", { children: I })
2640
+ ] }),
2641
+ /* @__PURE__ */ D("div", { className: Q["rp-search-tool-input-checkboxes"], children: [
2642
+ /* @__PURE__ */ a($t, { name: "matchCase", value: R, onChange: k, children: m == null ? void 0 : m.searchMatchCaseLabel }),
2643
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchMatchCaseTooltip, children: /* @__PURE__ */ a("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Gt, {}) }) }),
2644
+ /* @__PURE__ */ a($t, { name: "wholeWord", value: O, onChange: z, children: m == null ? void 0 : m.searchWholeWordsLabel }),
2645
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchWholeWordsTooltip, children: /* @__PURE__ */ a("div", { className: Q["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ a(Gt, {}) }) })
2646
+ ] })
2647
+ ] }),
2648
+ /* @__PURE__ */ D("div", { className: Q["rp-search-tool-controls"], children: [
2649
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ a(ee, { onClick: g, "aria-label": m == null ? void 0 : m.searchPrevTooltip, children: /* @__PURE__ */ a(
2650
+ ke,
2651
+ {
2652
+ className: Q["rp-search-tool-input-icon"],
2653
+ "aria-disabled": !u
2654
+ }
2655
+ ) }) }),
2656
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ a(ee, { onClick: h, "aria-label": m == null ? void 0 : m.searchNextTooltip, children: /* @__PURE__ */ a(
2657
+ ke,
2658
+ {
2659
+ style: { transform: "rotate(180deg" },
2660
+ className: Q["rp-search-tool-input-icon"],
2661
+ "aria-disabled": !u
2662
+ }
2663
+ ) }) }),
2664
+ /* @__PURE__ */ a(q, { content: m == null ? void 0 : m.searchCloseButtonTooltip, children: /* @__PURE__ */ a(
2665
+ ee,
2666
+ {
2667
+ onKeyDown: p,
2668
+ "aria-label": m == null ? void 0 : m.searchCloseButtonTooltip,
2669
+ children: /* @__PURE__ */ a(fn, { onClick: S, className: Q["rp-search-tool-input-icon"] })
2670
+ }
2671
+ ) })
2672
+ ] })
2673
+ ] })
2674
+ }
2675
+ ) }) : null;
2676
+ }, Ei = "_loading_vpexk_1", Ne = {
2677
+ "rp-loading-overlay": "_rp-loading-overlay_vpexk_1",
2678
+ "rp-loading-modal": "_rp-loading-modal_vpexk_14",
2679
+ "rp-loading-title": "_rp-loading-title_vpexk_27",
2680
+ "rp-loading-progress-bar": "_rp-loading-progress-bar_vpexk_35",
2681
+ "rp-loading-progress": "_rp-loading-progress_vpexk_35",
2682
+ "rp-loading-cancel-button": "_rp-loading-cancel-button_vpexk_55",
2683
+ loading: Ei
2684
+ }, Oi = ({ percentage: e }) => {
2685
+ const { cancel: t } = et(), { localeMessages: n } = ue();
2686
+ return e < 1 ? null : /* @__PURE__ */ a("div", { className: re(Ne["rp-loading-overlay"]), children: /* @__PURE__ */ D("div", { className: re(Ne["rp-loading-modal"]), children: [
2687
+ /* @__PURE__ */ D("div", { className: re(Ne["rp-loading-title"]), children: [
2688
+ n == null ? void 0 : n.printLoadingMessage,
2689
+ "..."
2690
+ ] }),
2691
+ /* @__PURE__ */ a("div", { className: re(Ne["rp-loading-progress-bar"]), children: /* @__PURE__ */ a(
2692
+ "div",
2693
+ {
2694
+ className: re(Ne["rp-loading-progress"]),
2695
+ style: { width: `${e}%` }
2696
+ }
2697
+ ) }),
2698
+ /* @__PURE__ */ a("button", { className: re(Ne["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
2699
+ ] }) });
2700
+ }, Di = We((e, t) => {
2701
+ const { showPrintProgress: n } = ge(), { progress: o } = et(), { isSmallScreen: r } = ye(), { percentage: i } = o || {}, c = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
2702
+ return /* @__PURE__ */ D("div", { children: [
2703
+ /* @__PURE__ */ a("div", { "data-rp": "topBar", ref: t, className: ze["rp-toolbar-content"], children: /* @__PURE__ */ D("div", { className: ze["rp-toolbar-wrapper"], style: c(), children: [
2704
+ /* @__PURE__ */ D("div", { "data-rp": "topBarLeft", className: ze["rp-toolbar-start"], children: [
2705
+ /* @__PURE__ */ a(Ni, {}),
2706
+ /* @__PURE__ */ a(Bo, {})
2707
+ ] }),
2708
+ /* @__PURE__ */ a("div", { "data-rp": "topBarCenter", className: ze["rp-toolbar-middle"], children: /* @__PURE__ */ a(Ri, {}) }),
2709
+ /* @__PURE__ */ a("div", { "data-rp": "topBarRight", className: ze["rp-toolbar-end"], children: /* @__PURE__ */ a(Si, {}) })
2710
+ ] }) }),
2711
+ n && i ? /* @__PURE__ */ a(Oi, { percentage: i }) : null
2712
+ ] });
2713
+ }), gt = {
2714
+ "rp-sidebar-content-wrapper": "_rp-sidebar-content-wrapper_1sdl6_1",
2715
+ "rp-sidebar-content": "_rp-sidebar-content_1sdl6_1",
2716
+ "rp-thumbnails-wrapper": "_rp-thumbnails-wrapper_1sdl6_16",
2717
+ "rp-thumbnail-dragging": "_rp-thumbnail-dragging_1sdl6_21"
2718
+ }, Ae = {
2719
+ "rp-thumbnail-wrapper": "_rp-thumbnail-wrapper_3fenb_1",
2720
+ "rp-thumbnail-text": "_rp-thumbnail-text_3fenb_10",
2721
+ "rp-thumbnail": "_rp-thumbnail_3fenb_1",
2722
+ "rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
2723
+ "rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
2724
+ }, zi = (e) => {
2725
+ const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: i } = ie(), c = F(() => o ? Ae["rp-thumbnail-active"] : "", [o]), s = F(() => ({
2726
+ width: Math.round(r.width),
2727
+ height: Math.round(r.height)
2728
+ }), [r]), l = L(() => {
2729
+ n && i(n);
2730
+ }, [i, n]);
2731
+ return /* @__PURE__ */ D(
2732
+ "div",
2733
+ {
2734
+ onClick: l,
2735
+ id: `page-${n}`,
2736
+ className: Ae["rp-thumbnail-wrapper"],
2737
+ children: [
2738
+ /* @__PURE__ */ a("div", { className: re(c, Ae["rp-thumbnail"]), children: t ? /* @__PURE__ */ a(
2739
+ "img",
2740
+ {
2741
+ src: t,
2742
+ width: s.width,
2743
+ height: s.height,
2744
+ alt: "thumbnail"
2745
+ }
2746
+ ) : /* @__PURE__ */ a(
2747
+ "div",
2748
+ {
2749
+ className: Ae["rp-thumbnail-loader"],
2750
+ style: {
2751
+ width: `${s.width}px`,
2752
+ height: `${s.height}px`
2753
+ },
2754
+ children: /* @__PURE__ */ a(Pt, {})
2755
+ }
2756
+ ) }),
2757
+ /* @__PURE__ */ a("div", { className: Ae["rp-thumbnail-text"], children: n })
2758
+ ]
2759
+ }
2760
+ );
2761
+ }, an = {
2762
+ "rp-thumbnails-container": "_rp-thumbnails-container_16vqr_1",
2763
+ "rp-thumbnails": "_rp-thumbnails_16vqr_1"
2764
+ }, Ai = 16, Fi = (e, t) => {
2765
+ const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
2766
+ e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Ai);
2767
+ }, ki = We((e, t) => {
2768
+ const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: i, addPage: c, thumbnailLength: s, addToPage: l } = Tn(), d = W(null), u = W(1);
2769
+ sn(t, () => d.current);
2770
+ const f = F(() => Object.values(i), [i]), h = L(() => {
2771
+ const g = s + 1;
2772
+ g <= r && c(g);
2773
+ }, [c, r, s]);
2774
+ return A(() => {
2775
+ o > s ? l(o) : n && u.current !== o && (Fi(d.current, o), u.current = o);
2776
+ }, [o, s, l, n, f]), _r(d.current, h), /* @__PURE__ */ a("div", { ref: d, className: an["rp-thumbnails-container"], children: /* @__PURE__ */ a("div", { className: an["rp-thumbnails"], children: n ? f.map((g, b) => {
2777
+ var w, v;
2778
+ return /* @__PURE__ */ a(
2779
+ zi,
2780
+ {
2781
+ isFocused: o === ((w = g.page) == null ? void 0 : w.pageNumber),
2782
+ pageNumber: (v = g.page) == null ? void 0 : v.pageNumber,
2783
+ thumbnailSrc: g.thumbnailSrc,
2784
+ loading: g.loading,
2785
+ viewport: g.viewport
2786
+ },
2787
+ b
2788
+ );
2789
+ }) : null }) });
2790
+ }), Wi = () => {
2791
+ const { thumbnailIcon: e } = pe();
2792
+ return e || /* @__PURE__ */ a(vr, {});
2793
+ }, Mi = () => {
2794
+ const { active: e, setActive: t } = Tn(), [n, o] = $(200), r = W(null), { thumbnailTool: i, sidebarEnable: c } = ge(), { localeMessages: s } = ue(), l = L(() => {
2795
+ t((u) => !u);
2796
+ }, []), d = F(() => typeof i != "boolean" && i ? /* @__PURE__ */ a(i, { onClick: l, active: e }) : i ? /* @__PURE__ */ a(q, { content: s == null ? void 0 : s.thumbnailTooltip, children: /* @__PURE__ */ a(
2797
+ ee,
2798
+ {
2799
+ onClick: l,
2800
+ active: e,
2801
+ "aria-label": s == null ? void 0 : s.thumbnailTooltip,
2802
+ children: /* @__PURE__ */ a(Wi, {})
2803
+ }
2804
+ ) }) : null, [i, e, l, s]);
2805
+ return /* @__PURE__ */ a(xe, { children: c && /* @__PURE__ */ D(
2806
+ "div",
2807
+ {
2808
+ style: { "--rp-thumbnail-width": `${n}px` },
2809
+ className: gt["rp-sidebar-content-wrapper"],
2810
+ "data-rp": "sidebar",
2811
+ children: [
2812
+ /* @__PURE__ */ a("div", { className: gt["rp-sidebar-content"], children: d }),
2813
+ /* @__PURE__ */ D(
2814
+ "div",
2815
+ {
2816
+ "data-rp": "thumbnailSidebar",
2817
+ hidden: !e,
2818
+ className: gt["rp-thumbnails-wrapper"],
2819
+ children: [
2820
+ /* @__PURE__ */ a(ki, { show: e, ref: r }),
2821
+ /* @__PURE__ */ a(wr, { onWidthChange: o, thumbnailRef: r })
2822
+ ]
2823
+ }
2824
+ )
2825
+ ]
2826
+ }
2827
+ ) });
2828
+ }, _e = {
2829
+ "rp-layout": "_rp-layout_12d1x_1",
2830
+ "rp-content": "_rp-content_12d1x_5",
2831
+ "rp-pages": "_rp-pages_12d1x_11",
2832
+ "rp-container": "_rp-container_12d1x_16",
2833
+ "rp-loader": "_rp-loader_12d1x_52",
2834
+ "rp-theme-variables": "_rp-theme-variables_12d1x_56",
2835
+ "rp-dark-mode": "_rp-dark-mode_12d1x_147"
2836
+ }, Hi = We(
2837
+ (e, t) => {
2838
+ const { children: n, toolbarRef: o, style: r, className: i } = e, { customVariables: c, customDarkVariables: s } = Ir(), { darkMode: l } = rr();
2839
+ return /* @__PURE__ */ a(
2840
+ "div",
2841
+ {
2842
+ ref: t,
2843
+ className: re(
2844
+ _e["rp-theme-variables"],
2845
+ _e["rp-container"],
2846
+ l ? _e["rp-dark-mode"] : "",
2847
+ i
2848
+ ),
2849
+ style: {
2850
+ "--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
2851
+ ...c,
2852
+ ...l ? s : {},
2853
+ ...r
2854
+ },
2855
+ children: n
2856
+ }
2857
+ );
2858
+ }
2859
+ ), ys = We((e, t) => {
2860
+ const {
2861
+ children: n,
2862
+ slots: o,
2863
+ icons: r,
2864
+ style: i,
2865
+ className: c,
2866
+ mobileWidth: s,
2867
+ onLoaded: l,
2868
+ cleanupOnLoaded: d,
2869
+ onLayoutWidthChange: u
2870
+ } = e, [f, h] = $(null), { setContainer: g, setContentRef: b } = be(), { loading: w } = K(), { LoaderImageComponent: v } = pn();
2871
+ return A(() => (l && l(), () => {
2872
+ d && d();
2873
+ }), [l, d]), /* @__PURE__ */ a(Hi, { toolbarRef: f, ref: t, children: /* @__PURE__ */ a(xr, { mobileWidth: s, onLayoutWidthChange: u, children: /* @__PURE__ */ a(br, { slots: o, children: /* @__PURE__ */ a(Cr, { icons: r, children: /* @__PURE__ */ D(Tr, { getContainerRef: g, style: i, className: c, children: [
2874
+ /* @__PURE__ */ D(Pr, { children: [
2875
+ /* @__PURE__ */ D("div", { className: _e["rp-layout"], children: [
2876
+ /* @__PURE__ */ a(Di, { ref: h }),
2877
+ /* @__PURE__ */ D("div", { className: _e["rp-content"], children: [
2878
+ /* @__PURE__ */ a("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ a(Mi, {}) }),
2879
+ /* @__PURE__ */ a("div", { ref: b, className: _e["rp-pages"], children: n })
2880
+ ] })
2881
+ ] }),
2882
+ /* @__PURE__ */ a(Sr, {})
2883
+ ] }),
2884
+ w ? /* @__PURE__ */ a(
2885
+ "div",
2886
+ {
2887
+ className: _e["rp-loader"],
2888
+ style: {
2889
+ position: "absolute",
2890
+ top: 0,
2891
+ left: 0,
2892
+ right: 0,
2893
+ bottom: 0,
2894
+ width: "100%",
2895
+ height: "100%"
2896
+ },
2897
+ children: /* @__PURE__ */ a(
2898
+ "div",
2899
+ {
2900
+ style: {
2901
+ display: "flex",
2902
+ justifyContent: "center",
2903
+ alignItems: "center",
2904
+ height: "100%",
2905
+ width: "100%"
2906
+ },
2907
+ children: v && /* @__PURE__ */ a(v, {})
2908
+ }
2909
+ )
2910
+ }
2911
+ ) : null
2912
+ ] }) }) }) }) });
2913
+ });
2914
+ export {
2915
+ To as A,
2916
+ Ni as B,
2917
+ _o as C,
2918
+ Go as D,
2919
+ Di as E,
2920
+ qn as F,
2921
+ zi as G,
2922
+ ki as H,
2923
+ Mi as I,
2924
+ Hi as J,
2925
+ Oi as L,
2926
+ Ti as M,
2927
+ Pi as O,
2928
+ bs as P,
2929
+ Ss as R,
2930
+ Ps as S,
2931
+ Ts as T,
2932
+ Ri as Z,
2933
+ Cs as a,
2934
+ ys as b,
2935
+ Gn as c,
2936
+ et as d,
2937
+ Sn as e,
2938
+ _n as f,
2939
+ mo as g,
2940
+ wn as h,
2941
+ fo as i,
2942
+ bn as j,
2943
+ go as k,
2944
+ Cn as l,
2945
+ Tn as m,
2946
+ vo as n,
2947
+ Pn as o,
2948
+ wo as p,
2949
+ Po as q,
2950
+ Lt as r,
2951
+ Mo as s,
2952
+ Vo as t,
2953
+ ie as u,
2954
+ Uo as v,
2955
+ Bo as w,
2956
+ ui as x,
2957
+ Bn as y,
2958
+ Si as z
2959
+ };