@pdf-viewer/react 1.9.0-beta.4 → 1.9.0-beta.5

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