@pdf-viewer/react 0.0.0-experimental.2 → 0.0.0-experimental.4

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