@pdf-viewer/react 1.6.0-beta.9 → 1.6.0-rc.0

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